CPDFDoc_Environment::GetAnnotHandlerMgr() never returns nullptr.
[pdfium.git] / fpdfsdk / src / fpdfppo.cpp
index 7b589b5..6bdd7c5 100644 (file)
@@ -207,7 +207,7 @@ FX_BOOL CPDF_PageOrganizer::UpdateReference(CPDF_Object* pObj,
                                             ObjectNumberMap* pObjNumberMap) {
   switch (pObj->GetType()) {
     case PDFOBJ_REFERENCE: {
-      CPDF_Reference* pReference = (CPDF_Reference*)pObj;
+      CPDF_Reference* pReference = pObj->AsReference();
       FX_DWORD newobjnum = GetNewObjId(pDoc, pObjNumberMap, pReference);
       if (newobjnum == 0)
         return FALSE;
@@ -247,7 +247,7 @@ FX_BOOL CPDF_PageOrganizer::UpdateReference(CPDF_Object* pObj,
       break;
     }
     case PDFOBJ_STREAM: {
-      CPDF_Stream* pStream = (CPDF_Stream*)pObj;
+      CPDF_Stream* pStream = pObj->AsStream();
       CPDF_Dictionary* pDict = pStream->GetDict();
       if (pDict) {
         if (!UpdateReference(pDict, pDoc, pObjNumberMap))