summaryrefslogtreecommitdiff
path: root/xfa/fxfa/app/xfa_ffdoc.cpp
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-11-02 15:43:18 -0700
committerCommit bot <commit-bot@chromium.org>2016-11-02 15:43:19 -0700
commitd19e912dd469e4bdad9f3020e1f6eb98f10f3470 (patch)
tree239cb568a80445f14a1ab9b63dcaaddcce67e1cc /xfa/fxfa/app/xfa_ffdoc.cpp
parent12f3e4a58f05850b93af35619cb04f0231d86acc (diff)
downloadpdfium-d19e912dd469e4bdad9f3020e1f6eb98f10f3470.tar.xz
Remove FX_BOOL from xfa.
Review-Url: https://codereview.chromium.org/2467203003
Diffstat (limited to 'xfa/fxfa/app/xfa_ffdoc.cpp')
-rw-r--r--xfa/fxfa/app/xfa_ffdoc.cpp41
1 files changed, 20 insertions, 21 deletions
diff --git a/xfa/fxfa/app/xfa_ffdoc.cpp b/xfa/fxfa/app/xfa_ffdoc.cpp
index cfb5e9fc47..5439b1fe47 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);