Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(426)

Unified Diff: xfa/fxfa/app/xfa_ffdoc.cpp

Issue 2467203003: Remove FX_BOOL from xfa. (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « xfa/fxfa/app/xfa_ffchoicelist.cpp ('k') | xfa/fxfa/app/xfa_ffdochandler.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fxfa/app/xfa_ffdoc.cpp
diff --git a/xfa/fxfa/app/xfa_ffdoc.cpp b/xfa/fxfa/app/xfa_ffdoc.cpp
index cfb5e9fc475ec3df2ad4f54b003222adc0a344d4..5439b1fe47f82ae4965b4efed80933e1983d6778 100644
--- a/xfa/fxfa/app/xfa_ffdoc.cpp
+++ b/xfa/fxfa/app/xfa_ffdoc.cpp
@@ -155,7 +155,7 @@ CXFA_FFDoc::CXFA_FFDoc(CXFA_FFApp* pApp, IXFA_DocEnvironment* pDocEnvironment)
m_pNotify(nullptr),
m_pPDFDoc(nullptr),
m_dwDocType(XFA_DOCTYPE_Static),
- m_bOwnStream(TRUE) {}
+ m_bOwnStream(true) {}
CXFA_FFDoc::~CXFA_FFDoc() {
CloseDoc();
@@ -172,9 +172,9 @@ int32_t CXFA_FFDoc::StartLoad() {
return iStatus;
}
-FX_BOOL XFA_GetPDFContentsFromPDFXML(CFDE_XMLNode* pPDFElement,
- uint8_t*& pByteBuffer,
- int32_t& iBufferSize) {
+bool XFA_GetPDFContentsFromPDFXML(CFDE_XMLNode* pPDFElement,
+ uint8_t*& pByteBuffer,
+ int32_t& iBufferSize) {
CFDE_XMLElement* pDocumentElement = nullptr;
for (CFDE_XMLNode* pXMLNode =
pPDFElement->GetNodeItem(CFDE_XMLNode::FirstChild);
@@ -190,7 +190,7 @@ FX_BOOL XFA_GetPDFContentsFromPDFXML(CFDE_XMLNode* pPDFElement,
}
}
if (!pDocumentElement) {
- return FALSE;
+ return false;
}
CFDE_XMLElement* pChunkElement = nullptr;
for (CFDE_XMLNode* pXMLNode =
@@ -207,7 +207,7 @@ FX_BOOL XFA_GetPDFContentsFromPDFXML(CFDE_XMLNode* pPDFElement,
}
}
if (!pChunkElement) {
- return FALSE;
+ return false;
}
CFX_WideString wsPDFContent;
pChunkElement->GetTextData(wsPDFContent);
@@ -216,7 +216,7 @@ FX_BOOL XFA_GetPDFContentsFromPDFXML(CFDE_XMLNode* pPDFElement,
pByteBuffer = FX_Alloc(uint8_t, iBufferSize + 1);
pByteBuffer[iBufferSize] = '0'; // FIXME: I bet this is wrong.
Base64DecodeW(wsPDFContent.c_str(), wsPDFContent.GetLength(), pByteBuffer);
- return TRUE;
+ return true;
}
void XFA_XPDPacket_MergeRootNode(CXFA_Node* pOriginRoot, CXFA_Node* pNewRoot) {
CXFA_Node* pChildNode = pNewRoot->GetNodeItem(XFA_NODEITEM_FirstChild);
@@ -290,27 +290,26 @@ CXFA_FFDocView* CXFA_FFDoc::GetDocView() {
return it != m_TypeToDocViewMap.end() ? it->second.get() : nullptr;
}
-FX_BOOL CXFA_FFDoc::OpenDoc(IFX_SeekableReadStream* pStream,
- FX_BOOL bTakeOverFile) {
+bool CXFA_FFDoc::OpenDoc(IFX_SeekableReadStream* pStream, bool bTakeOverFile) {
m_bOwnStream = bTakeOverFile;
m_pStream = pStream;
- return TRUE;
+ return true;
}
-FX_BOOL CXFA_FFDoc::OpenDoc(CPDF_Document* pPDFDoc) {
+bool CXFA_FFDoc::OpenDoc(CPDF_Document* pPDFDoc) {
if (!pPDFDoc)
- return FALSE;
+ return false;
CPDF_Dictionary* pRoot = pPDFDoc->GetRoot();
if (!pRoot)
- return FALSE;
+ return false;
CPDF_Dictionary* pAcroForm = pRoot->GetDictFor("AcroForm");
if (!pAcroForm)
- return FALSE;
+ return false;
CPDF_Object* pElementXFA = pAcroForm->GetDirectObjectFor("XFA");
if (!pElementXFA)
- return FALSE;
+ return false;
std::vector<CPDF_Stream*> xfaStreams;
if (pElementXFA->IsArray()) {
@@ -323,7 +322,7 @@ FX_BOOL CXFA_FFDoc::OpenDoc(CPDF_Document* pPDFDoc) {
xfaStreams.push_back((CPDF_Stream*)pElementXFA);
}
if (xfaStreams.empty())
- return FALSE;
+ return false;
IFX_SeekableReadStream* pFileRead = new CXFA_FileRead(xfaStreams);
m_pPDFDoc = pPDFDoc;
@@ -332,11 +331,11 @@ FX_BOOL CXFA_FFDoc::OpenDoc(CPDF_Document* pPDFDoc) {
m_pStream = nullptr;
}
m_pStream = pFileRead;
- m_bOwnStream = TRUE;
- return TRUE;
+ m_bOwnStream = true;
+ return true;
}
-FX_BOOL CXFA_FFDoc::CloseDoc() {
+bool CXFA_FFDoc::CloseDoc() {
for (const auto& pair : m_TypeToDocViewMap)
pair.second->RunDocClose();
@@ -360,7 +359,7 @@ FX_BOOL CXFA_FFDoc::CloseDoc() {
m_HashToDibDpiMap.clear();
m_pApp->ClearEventTargets();
- return TRUE;
+ return true;
}
void CXFA_FFDoc::SetDocType(uint32_t dwType) {
m_dwDocType = dwType;
@@ -445,7 +444,7 @@ bool CXFA_FFDoc::SavePackage(XFA_HashCode code,
pFile, pNode, 0, bsChecksum.GetLength() ? bsChecksum.c_str() : nullptr);
}
-FX_BOOL CXFA_FFDoc::ImportData(IFX_SeekableReadStream* pStream, FX_BOOL bXDP) {
+bool CXFA_FFDoc::ImportData(IFX_SeekableReadStream* pStream, bool bXDP) {
std::unique_ptr<CXFA_DataImporter> importer(
new CXFA_DataImporter(m_pDocumentParser->GetDocument()));
return importer->ImportData(pStream);
« no previous file with comments | « xfa/fxfa/app/xfa_ffchoicelist.cpp ('k') | xfa/fxfa/app/xfa_ffdochandler.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698