| Index: core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp
|
| diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp
|
| index ebd4d83310ad65ca88bf1dac3a4a18774f7be88c..84b034de068a1626c4afe578ccfcc16fd1bd04d5 100644
|
| --- a/core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp
|
| +++ b/core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp
|
| @@ -18,18 +18,18 @@ const FX_CHAR* const _PDF_OpCharType =
|
| "IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII"
|
| "IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII"
|
| "IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII";
|
| -FX_BOOL _PDF_HasInvalidOpChar(const FX_CHAR* op)
|
| +bool _PDF_HasInvalidOpChar(const FX_CHAR* op)
|
| {
|
| if(!op) {
|
| - return FALSE;
|
| + return false;
|
| }
|
| uint8_t ch;
|
| while((ch = *op++)) {
|
| if(_PDF_OpCharType[ch] == 'I') {
|
| - return TRUE;
|
| + return true;
|
| }
|
| }
|
| - return FALSE;
|
| + return false;
|
| }
|
| class CPDF_StreamParserAutoClearer {
|
| public:
|
| @@ -60,7 +60,7 @@ FX_DWORD CPDF_StreamContentParser::Parse(const uint8_t* pData, FX_DWORD dwSize,
|
| return m_pSyntax->GetPos();
|
| case CPDF_StreamParser::Keyword:
|
| if(!OnOperator((char*)syntax.GetWordBuf()) && _PDF_HasInvalidOpChar((char*)syntax.GetWordBuf())) {
|
| - m_bAbort = TRUE;
|
| + m_bAbort = true;
|
| }
|
| if (m_bAbort) {
|
| return m_pSyntax->GetPos();
|
| @@ -143,7 +143,7 @@ void CPDF_StreamContentParser::Handle_BeginImage()
|
| return;
|
| }
|
| pDict->SetAtName(FX_BSTRC("Subtype"), FX_BSTRC("Image"));
|
| - CPDF_ImageObject *pImgObj = AddImage(pStream, NULL, TRUE);
|
| + CPDF_ImageObject *pImgObj = AddImage(pStream, NULL, true);
|
| if (!pImgObj) {
|
| if (pStream) {
|
| pStream->Release();
|
| @@ -159,7 +159,7 @@ void CPDF_StreamContentParser::ParsePathObject()
|
| int last_pos = m_pSyntax->GetPos();
|
| while (1) {
|
| CPDF_StreamParser::SyntaxType type = m_pSyntax->ParseNextElement();
|
| - FX_BOOL bProcessed = TRUE;
|
| + bool bProcessed = true;
|
| switch (type) {
|
| case CPDF_StreamParser::EndOfData:
|
| return;
|
| @@ -198,7 +198,7 @@ void CPDF_StreamContentParser::ParsePathObject()
|
| nParams = 0;
|
| break;
|
| default:
|
| - bProcessed = FALSE;
|
| + bProcessed = false;
|
| break;
|
| }
|
| } else if (len == 2) {
|
| @@ -206,10 +206,10 @@ void CPDF_StreamContentParser::ParsePathObject()
|
| AddPathRect(params[0], params[1], params[2], params[3]);
|
| nParams = 0;
|
| } else {
|
| - bProcessed = FALSE;
|
| + bProcessed = false;
|
| }
|
| } else {
|
| - bProcessed = FALSE;
|
| + bProcessed = false;
|
| }
|
| if (bProcessed) {
|
| last_pos = m_pSyntax->GetPos();
|
| @@ -220,14 +220,14 @@ void CPDF_StreamContentParser::ParsePathObject()
|
| if (nParams == 6) {
|
| break;
|
| }
|
| - FX_BOOL bInteger;
|
| + bool bInteger;
|
| int value;
|
| FX_atonum(CFX_ByteStringC(m_pSyntax->GetWordBuf(), m_pSyntax->GetWordSize()), bInteger, &value);
|
| params[nParams++] = bInteger ? (FX_FLOAT)value : *(FX_FLOAT*)&value;
|
| break;
|
| }
|
| default:
|
| - bProcessed = FALSE;
|
| + bProcessed = false;
|
| }
|
| if (!bProcessed) {
|
| m_pSyntax->SetPos(last_pos);
|
| @@ -279,7 +279,7 @@ ICodec_ScanlineDecoder* FPDFAPI_CreateFaxDecoder(const uint8_t* src_buf, FX_DWOR
|
| const CPDF_Dictionary* pParams);
|
| FX_DWORD _A85Decode(const uint8_t* src_buf, FX_DWORD src_size, uint8_t*& dest_buf, FX_DWORD& dest_size);
|
| FX_DWORD _HexDecode(const uint8_t* src_buf, FX_DWORD src_size, uint8_t*& dest_buf, FX_DWORD& dest_size);
|
| -FX_DWORD FPDFAPI_FlateOrLZWDecode(FX_BOOL bLZW, const uint8_t* src_buf, FX_DWORD src_size, CPDF_Dictionary* pParams,
|
| +FX_DWORD FPDFAPI_FlateOrLZWDecode(bool bLZW, const uint8_t* src_buf, FX_DWORD src_size, CPDF_Dictionary* pParams,
|
| FX_DWORD estimated_size, uint8_t*& dest_buf, FX_DWORD& dest_size);
|
| FX_DWORD PDF_DecodeInlineStream(const uint8_t* src_buf, FX_DWORD limit,
|
| int width, int height, CFX_ByteString& decoder,
|
| @@ -293,9 +293,9 @@ FX_DWORD PDF_DecodeInlineStream(const uint8_t* src_buf, FX_DWORD limit,
|
| } else if (decoder == FX_BSTRC("ASCIIHexDecode") || decoder == FX_BSTRC("AHx")) {
|
| return _HexDecode(src_buf, limit, dest_buf, dest_size);
|
| } else if (decoder == FX_BSTRC("FlateDecode") || decoder == FX_BSTRC("Fl")) {
|
| - return FPDFAPI_FlateOrLZWDecode(FALSE, src_buf, limit, pParam, dest_size, dest_buf, dest_size);
|
| + return FPDFAPI_FlateOrLZWDecode(false, src_buf, limit, pParam, dest_size, dest_buf, dest_size);
|
| } else if (decoder == FX_BSTRC("LZWDecode") || decoder == FX_BSTRC("LZW")) {
|
| - return FPDFAPI_FlateOrLZWDecode(TRUE, src_buf, limit, pParam, 0, dest_buf, dest_size);
|
| + return FPDFAPI_FlateOrLZWDecode(true, src_buf, limit, pParam, 0, dest_buf, dest_size);
|
| } else if (decoder == FX_BSTRC("DCTDecode") || decoder == FX_BSTRC("DCT")) {
|
| ICodec_ScanlineDecoder* pDecoder = CPDF_ModuleMgr::Get()->GetJpegModule()->CreateDecoder(
|
| src_buf, limit, width, height, 0, pParam ? pParam->GetInteger(FX_BSTRC("ColorTransform"), 1) : 1);
|
| @@ -307,7 +307,7 @@ FX_DWORD PDF_DecodeInlineStream(const uint8_t* src_buf, FX_DWORD limit,
|
| dest_buf = 0;
|
| return (FX_DWORD) - 1;
|
| }
|
| -CPDF_Stream* CPDF_StreamParser::ReadInlineStream(CPDF_Document* pDoc, CPDF_Dictionary* pDict, CPDF_Object* pCSObj, FX_BOOL bDecode)
|
| +CPDF_Stream* CPDF_StreamParser::ReadInlineStream(CPDF_Document* pDoc, CPDF_Dictionary* pDict, CPDF_Object* pCSObj, bool bDecode)
|
| {
|
| if (m_Pos == m_Size) {
|
| return NULL;
|
| @@ -441,7 +441,7 @@ CPDF_StreamParser::SyntaxType CPDF_StreamParser::ParseNextElement()
|
| m_pLastObj = NULL;
|
| }
|
| m_WordSize = 0;
|
| - FX_BOOL bIsNumber = TRUE;
|
| + bool bIsNumber = true;
|
| if (m_Pos >= m_Size) {
|
| return EndOfData;
|
| }
|
| @@ -479,7 +479,7 @@ CPDF_StreamParser::SyntaxType CPDF_StreamParser::ParseNextElement()
|
| m_WordBuffer[m_WordSize++] = ch;
|
| }
|
| if (type != 'N') {
|
| - bIsNumber = FALSE;
|
| + bIsNumber = false;
|
| }
|
| if (m_Size <= m_Pos) {
|
| break;
|
| @@ -500,7 +500,7 @@ CPDF_StreamParser::SyntaxType CPDF_StreamParser::ParseNextElement()
|
| }
|
| if (m_WordSize == 4) {
|
| if (*(FX_DWORD*)m_WordBuffer == FXDWORD_TRUE) {
|
| - m_pLastObj = CPDF_Boolean::Create(TRUE);
|
| + m_pLastObj = CPDF_Boolean::Create(true);
|
| return Others;
|
| }
|
| if (*(FX_DWORD*)m_WordBuffer == FXDWORD_NULL) {
|
| @@ -509,7 +509,7 @@ CPDF_StreamParser::SyntaxType CPDF_StreamParser::ParseNextElement()
|
| }
|
| } else if (m_WordSize == 5) {
|
| if (*(FX_DWORD*)m_WordBuffer == FXDWORD_FALS && m_WordBuffer[4] == 'e') {
|
| - m_pLastObj = CPDF_Boolean::Create(FALSE);
|
| + m_pLastObj = CPDF_Boolean::Create(false);
|
| return Others;
|
| }
|
| }
|
| @@ -578,9 +578,9 @@ void CPDF_StreamParser::SkipPathObject()
|
| }
|
| }
|
| }
|
| -CPDF_Object* CPDF_StreamParser::ReadNextObject(FX_BOOL bAllowNestedArray, FX_BOOL bInArray)
|
| +CPDF_Object* CPDF_StreamParser::ReadNextObject(bool bAllowNestedArray, bool bInArray)
|
| {
|
| - FX_BOOL bIsNumber;
|
| + bool bIsNumber;
|
| GetNextWord(bIsNumber);
|
| if (m_WordSize == 0) {
|
| return NULL;
|
| @@ -598,7 +598,7 @@ CPDF_Object* CPDF_StreamParser::ReadNextObject(FX_BOOL bAllowNestedArray, FX_BOO
|
| }
|
| if (first_char == '<') {
|
| if (m_WordSize == 1) {
|
| - return CPDF_String::Create(ReadHexString(), TRUE);
|
| + return CPDF_String::Create(ReadHexString(), true);
|
| }
|
| CPDF_Dictionary* pDict = CPDF_Dictionary::Create();
|
| while (1) {
|
| @@ -615,7 +615,7 @@ CPDF_Object* CPDF_StreamParser::ReadNextObject(FX_BOOL bAllowNestedArray, FX_BOO
|
| return NULL;
|
| }
|
| CFX_ByteString key = PDF_NameDecode(CFX_ByteStringC(m_WordBuffer + 1, m_WordSize - 1));
|
| - CPDF_Object* pObj = ReadNextObject(TRUE);
|
| + CPDF_Object* pObj = ReadNextObject(true);
|
| if (pObj == NULL) {
|
| if (pDict) {
|
| pDict->Release();
|
| @@ -636,7 +636,7 @@ CPDF_Object* CPDF_StreamParser::ReadNextObject(FX_BOOL bAllowNestedArray, FX_BOO
|
| }
|
| CPDF_Array* pArray = CPDF_Array::Create();
|
| while (1) {
|
| - CPDF_Object* pObj = ReadNextObject(bAllowNestedArray, TRUE);
|
| + CPDF_Object* pObj = ReadNextObject(bAllowNestedArray, true);
|
| if (pObj == NULL) {
|
| if (m_WordSize == 0 || m_WordBuffer[0] == ']') {
|
| return pArray;
|
| @@ -651,22 +651,22 @@ CPDF_Object* CPDF_StreamParser::ReadNextObject(FX_BOOL bAllowNestedArray, FX_BOO
|
| }
|
| if (m_WordSize == 4) {
|
| if (*(FX_DWORD*)m_WordBuffer == FXDWORD_TRUE) {
|
| - return CPDF_Boolean::Create(TRUE);
|
| + return CPDF_Boolean::Create(true);
|
| }
|
| if (*(FX_DWORD*)m_WordBuffer == FXDWORD_NULL) {
|
| return CPDF_Null::Create();
|
| }
|
| } else if (m_WordSize == 5) {
|
| if (*(FX_DWORD*)m_WordBuffer == FXDWORD_FALS && m_WordBuffer[4] == 'e') {
|
| - return CPDF_Boolean::Create(FALSE);
|
| + return CPDF_Boolean::Create(false);
|
| }
|
| }
|
| return NULL;
|
| }
|
| -void CPDF_StreamParser::GetNextWord(FX_BOOL& bIsNumber)
|
| +void CPDF_StreamParser::GetNextWord(bool& bIsNumber)
|
| {
|
| m_WordSize = 0;
|
| - bIsNumber = TRUE;
|
| + bIsNumber = true;
|
| if (m_Size <= m_Pos) {
|
| return;
|
| }
|
| @@ -695,7 +695,7 @@ void CPDF_StreamParser::GetNextWord(FX_BOOL& bIsNumber)
|
| type = PDF_CharType[ch];
|
| }
|
| if (type == 'D') {
|
| - bIsNumber = FALSE;
|
| + bIsNumber = false;
|
| m_WordBuffer[m_WordSize++] = ch;
|
| if (ch == '/') {
|
| while (1) {
|
| @@ -740,7 +740,7 @@ void CPDF_StreamParser::GetNextWord(FX_BOOL& bIsNumber)
|
| m_WordBuffer[m_WordSize++] = ch;
|
| }
|
| if (type != 'N') {
|
| - bIsNumber = FALSE;
|
| + bIsNumber = false;
|
| }
|
| if (m_Size <= m_Pos) {
|
| return;
|
| @@ -856,7 +856,7 @@ CFX_ByteString CPDF_StreamParser::ReadHexString()
|
| }
|
| int ch = m_pBuf[m_Pos++];
|
| CFX_ByteTextBuf buf;
|
| - FX_BOOL bFirst = TRUE;
|
| + bool bFirst = true;
|
| int code = 0;
|
| while (1) {
|
| if (ch == '>') {
|
| @@ -941,7 +941,7 @@ void CPDF_ContentParser::Start(CPDF_Page* pPage, CPDF_ParseOptions* pOptions)
|
| return;
|
| }
|
| m_pObjects = pPage;
|
| - m_bForm = FALSE;
|
| + m_bForm = false;
|
| if (pOptions) {
|
| m_Options = *pOptions;
|
| }
|
| @@ -956,7 +956,7 @@ void CPDF_ContentParser::Start(CPDF_Page* pPage, CPDF_ParseOptions* pOptions)
|
| if (pContent->GetType() == PDFOBJ_STREAM) {
|
| m_nStreams = 0;
|
| m_pSingleStream = new CPDF_StreamAcc;
|
| - m_pSingleStream->LoadAllData((CPDF_Stream*)pContent, FALSE);
|
| + m_pSingleStream->LoadAllData((CPDF_Stream*)pContent, false);
|
| } else if (pContent->GetType() == PDFOBJ_ARRAY) {
|
| CPDF_Array* pArray = (CPDF_Array*)pContent;
|
| m_nStreams = pArray->GetCount();
|
| @@ -975,7 +975,7 @@ void CPDF_ContentParser::Start(CPDF_Form* pForm, CPDF_AllStates* pGraphicStates,
|
| {
|
| m_pType3Char = pType3Char;
|
| m_pObjects = pForm;
|
| - m_bForm = TRUE;
|
| + m_bForm = true;
|
| CFX_AffineMatrix form_matrix = pForm->m_pFormDict->GetMatrix(FX_BSTRC("Matrix"));
|
| if (pGraphicStates) {
|
| form_matrix.Concat(pGraphicStates->m_CTM);
|
| @@ -1005,7 +1005,7 @@ void CPDF_ContentParser::Start(CPDF_Form* pForm, CPDF_AllStates* pGraphicStates,
|
| m_pParser->GetCurStates()->m_CTM = form_matrix;
|
| m_pParser->GetCurStates()->m_ParentMatrix = form_matrix;
|
| if (ClipPath.NotNull()) {
|
| - m_pParser->GetCurStates()->m_ClipPath.AppendPath(ClipPath, FXFILL_WINDING, TRUE);
|
| + m_pParser->GetCurStates()->m_ClipPath.AppendPath(ClipPath, FXFILL_WINDING, true);
|
| }
|
| if (pForm->m_Transparency & PDFTRANS_GROUP) {
|
| CPDF_GeneralStateData* pData = m_pParser->GetCurStates()->m_GeneralState.GetModify();
|
| @@ -1017,9 +1017,9 @@ void CPDF_ContentParser::Start(CPDF_Form* pForm, CPDF_AllStates* pGraphicStates,
|
| m_nStreams = 0;
|
| m_pSingleStream = new CPDF_StreamAcc;
|
| if (pForm->m_pDocument) {
|
| - m_pSingleStream->LoadAllData(pForm->m_pFormStream, FALSE);
|
| + m_pSingleStream->LoadAllData(pForm->m_pFormStream, false);
|
| } else {
|
| - m_pSingleStream->LoadAllData(pForm->m_pFormStream, FALSE);
|
| + m_pSingleStream->LoadAllData(pForm->m_pFormStream, false);
|
| }
|
| m_pData = (uint8_t*)m_pSingleStream->GetData();
|
| m_Size = m_pSingleStream->GetSize();
|
| @@ -1064,7 +1064,7 @@ void CPDF_ContentParser::Continue(IFX_Pause* pPause)
|
| CPDF_Array* pContent = m_pObjects->m_pFormDict->GetArray(FX_BSTRC("Contents"));
|
| m_pStreamArray[m_CurrentOffset] = new CPDF_StreamAcc;
|
| CPDF_Stream* pStreamObj = (CPDF_Stream*)(pContent ? pContent->GetElementValue(m_CurrentOffset) : NULL);
|
| - m_pStreamArray[m_CurrentOffset]->LoadAllData(pStreamObj, FALSE);
|
| + m_pStreamArray[m_CurrentOffset]->LoadAllData(pStreamObj, false);
|
| m_CurrentOffset ++;
|
| }
|
| }
|
|
|