Clean up CPDF_AnnotList.
[pdfium.git] / fpdfsdk / src / fpdf_flatten.cpp
index 39441c4..75db8f8 100644 (file)
@@ -444,12 +444,10 @@ DLLEXPORT int STDCALL FPDFPage_Flatten(FPDF_PAGE page, int nFlag) {
           CFX_ByteString sKey;
           CPDF_Object* pFirstObj = pAPDic->GetNextElement(pos, sKey);
           if (pFirstObj) {
-            if (pFirstObj->GetType() == PDFOBJ_REFERENCE)
+            if (pFirstObj->IsReference())
               pFirstObj = pFirstObj->GetDirect();
-
             if (!pFirstObj->IsStream())
               continue;
-
             pAPStream = pFirstObj->AsStream();
           }
         }