Replace FX_NEW with new, remove tests from fpdfapi
[pdfium.git] / core / src / fpdfapi / fpdf_page / fpdf_page_parser_old.cpp
index bb29595..952fe1d 100644 (file)
@@ -307,13 +307,12 @@ FX_DWORD PDF_DecodeInlineStream(const FX_BYTE* src_buf, FX_DWORD limit,
     dest_buf = 0;
     return (FX_DWORD) - 1;
 }
-extern const FX_LPCSTR _PDF_CharType;
 CPDF_Stream* CPDF_StreamParser::ReadInlineStream(CPDF_Document* pDoc, CPDF_Dictionary* pDict, CPDF_Object* pCSObj, FX_BOOL bDecode)
 {
     if (m_Pos == m_Size) {
         return NULL;
     }
-    if (_PDF_CharType[m_pBuf[m_Pos]] == 'W') {
+    if (PDF_CharType[m_pBuf[m_Pos]] == 'W') {
         m_Pos ++;
     }
     CFX_ByteString Decoder;
@@ -447,14 +446,14 @@ CPDF_StreamParser::SyntaxType CPDF_StreamParser::ParseNextElement()
         return EndOfData;
     }
     int ch = m_pBuf[m_Pos++];
-    int type = _PDF_CharType[ch];
+    int type = PDF_CharType[ch];
     while (1) {
         while (type == 'W') {
             if (m_Size <= m_Pos) {
                 return EndOfData;
             }
             ch = m_pBuf[m_Pos++];
-            type = _PDF_CharType[ch];
+            type = PDF_CharType[ch];
         }
         if (ch != '%') {
             break;
@@ -468,7 +467,7 @@ CPDF_StreamParser::SyntaxType CPDF_StreamParser::ParseNextElement()
                 break;
             }
         }
-        type = _PDF_CharType[ch];
+        type = PDF_CharType[ch];
     }
     if (type == 'D' && ch != '/') {
         m_Pos --;
@@ -486,7 +485,7 @@ CPDF_StreamParser::SyntaxType CPDF_StreamParser::ParseNextElement()
             break;
         }
         ch = m_pBuf[m_Pos++];
-        type = _PDF_CharType[ch];
+        type = PDF_CharType[ch];
         if (type == 'D' || type == 'W') {
             m_Pos --;
             break;
@@ -523,14 +522,14 @@ void CPDF_StreamParser::SkipPathObject()
         return;
     }
     int ch = m_pBuf[m_Pos++];
-    int type = _PDF_CharType[ch];
+    int type = PDF_CharType[ch];
     while (1) {
         while (type == 'W') {
             if (m_Pos >= m_Size) {
                 return;
             }
             ch = m_pBuf[m_Pos++];
-            type = _PDF_CharType[ch];
+            type = PDF_CharType[ch];
         }
         if (type != 'N') {
             m_Pos = command_startpos;
@@ -542,14 +541,14 @@ void CPDF_StreamParser::SkipPathObject()
                     return;
                 }
                 ch = m_pBuf[m_Pos++];
-                type = _PDF_CharType[ch];
+                type = PDF_CharType[ch];
             }
             while (type == 'W') {
                 if (m_Pos >= m_Size) {
                     return;
                 }
                 ch = m_pBuf[m_Pos++];
-                type = _PDF_CharType[ch];
+                type = PDF_CharType[ch];
             }
             if (type == 'N') {
                 continue;
@@ -560,7 +559,7 @@ void CPDF_StreamParser::SkipPathObject()
                     return;
                 }
                 ch = m_pBuf[m_Pos++];
-                type = _PDF_CharType[ch];
+                type = PDF_CharType[ch];
             }
             if (m_Pos - op_startpos == 2) {
                 int op = m_pBuf[op_startpos];
@@ -672,14 +671,14 @@ void CPDF_StreamParser::GetNextWord(FX_BOOL& bIsNumber)
         return;
     }
     int ch = m_pBuf[m_Pos++];
-    int type = _PDF_CharType[ch];
+    int type = PDF_CharType[ch];
     while (1) {
         while (type == 'W') {
             if (m_Size <= m_Pos) {
                 return;
             }
             ch = m_pBuf[m_Pos++];
-            type = _PDF_CharType[ch];
+            type = PDF_CharType[ch];
         }
         if (ch != '%') {
             break;
@@ -693,7 +692,7 @@ void CPDF_StreamParser::GetNextWord(FX_BOOL& bIsNumber)
                 break;
             }
         }
-        type = _PDF_CharType[ch];
+        type = PDF_CharType[ch];
     }
     if (type == 'D') {
         bIsNumber = FALSE;
@@ -704,7 +703,7 @@ void CPDF_StreamParser::GetNextWord(FX_BOOL& bIsNumber)
                     return;
                 }
                 ch = m_pBuf[m_Pos++];
-                type = _PDF_CharType[ch];
+                type = PDF_CharType[ch];
                 if (type != 'R' && type != 'N') {
                     m_Pos --;
                     return;
@@ -747,7 +746,7 @@ void CPDF_StreamParser::GetNextWord(FX_BOOL& bIsNumber)
             return;
         }
         ch = m_pBuf[m_Pos++];
-        type = _PDF_CharType[ch];
+        type = PDF_CharType[ch];
         if (type == 'D' || type == 'W') {
             m_Pos --;
             break;
@@ -962,7 +961,7 @@ void CPDF_ContentParser::Start(CPDF_Page* pPage, CPDF_ParseOptions* pOptions)
     }
     if (pContent->GetType() == PDFOBJ_STREAM) {
         m_nStreams = 0;
-        m_pSingleStream = FX_NEW CPDF_StreamAcc;
+        m_pSingleStream = new CPDF_StreamAcc;
         m_pSingleStream->LoadAllData((CPDF_Stream*)pContent, FALSE);
     } else if (pContent->GetType() == PDFOBJ_ARRAY) {
         CPDF_Array* pArray = (CPDF_Array*)pContent;
@@ -1004,7 +1003,7 @@ void CPDF_ContentParser::Start(CPDF_Form* pForm, CPDF_AllStates* pGraphicStates,
         }
     }
     CPDF_Dictionary* pResources = pForm->m_pFormDict->GetDict(FX_BSTRC("Resources"));
-    m_pParser = FX_NEW CPDF_StreamContentParser;
+    m_pParser = new CPDF_StreamContentParser;
     m_pParser->Initialize();
     m_pParser->PrepareParse(pForm->m_pDocument, pForm->m_pPageResources, pForm->m_pResources, pParentMatrix, pForm,
                             pResources, &form_bbox, pOptions, pGraphicStates, level);
@@ -1021,7 +1020,7 @@ void CPDF_ContentParser::Start(CPDF_Form* pForm, CPDF_AllStates* pGraphicStates,
         pData->m_pSoftMask = NULL;
     }
     m_nStreams = 0;
-    m_pSingleStream = FX_NEW CPDF_StreamAcc;
+    m_pSingleStream = new CPDF_StreamAcc;
     if (pForm->m_pDocument) {
         m_pSingleStream->LoadAllData(pForm->m_pFormStream, FALSE);
     } else {
@@ -1072,7 +1071,7 @@ void CPDF_ContentParser::Continue(IFX_Pause* pPause)
                 m_CurrentOffset = 0;
             } else {
                 CPDF_Array* pContent = m_pObjects->m_pFormDict->GetArray(FX_BSTRC("Contents"));
-                m_pStreamArray[m_CurrentOffset] = FX_NEW CPDF_StreamAcc;
+                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_CurrentOffset ++;
@@ -1080,7 +1079,7 @@ void CPDF_ContentParser::Continue(IFX_Pause* pPause)
         }
         if (m_InternalStage == PAGEPARSE_STAGE_PARSE) {
             if (m_pParser == NULL) {
-                m_pParser = FX_NEW CPDF_StreamContentParser;
+                m_pParser = new CPDF_StreamContentParser;
                 m_pParser->Initialize();
                 m_pParser->PrepareParse(m_pObjects->m_pDocument, m_pObjects->m_pPageResources, NULL, NULL, m_pObjects,
                                         m_pObjects->m_pResources, &m_pObjects->m_BBox, &m_Options, NULL, 0);