Merge to XFA: Create top-level public/ header directory.
[pdfium.git] / fpdfsdk / src / fpdf_progressive.cpp
index b6691af..bd8d864 100644 (file)
@@ -4,10 +4,12 @@
  
 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
 
-#include "../include/fpdf_progressive.h"
+#include "../../public/fpdf_progressive.h"
+#include "../../public/fpdfview.h"
 #include "../include/fsdk_define.h"
-#include "../include/fpdfview.h"
 #include "../include/fsdk_rendercontext.h"
+#include "../include/fpdfxfa/fpdfxfa_doc.h"
+#include "../include/fpdfxfa/fpdfxfa_page.h"
 
 extern void (*Func_RenderPage)( CRenderContext*, FPDF_PAGE page, int start_x, int start_y, int size_x, int size_y,
                                                int rotate, int flags,FX_BOOL bNeedToRestore, IFSDK_PAUSE_Adapter * pause );
@@ -28,7 +30,9 @@ DLLEXPORT int STDCALL FPDF_RenderPageBitmap_Start( FPDF_BITMAP bitmap, FPDF_PAGE
        if (pause->version !=1)
                return FPDF_RENDER_FAILED;
 
-       CPDF_Page* pPage = (CPDF_Page*)page;
+       CPDF_Page* pPage = ((CPDFXFA_Page*)page)->GetPDFPage();
+       if (!pPage)
+               return FPDF_RENDER_FAILED;
        
 //     FXMT_CSLOCK_OBJ(&pPage->m_PageLock);
        
@@ -49,14 +53,7 @@ DLLEXPORT int STDCALL FPDF_RenderPageBitmap_Start( FPDF_BITMAP bitmap, FPDF_PAGE
 #endif
        IFSDK_PAUSE_Adapter IPauseAdapter(pause);
        
-       if (flags & FPDF_NO_CATCH)
-               Func_RenderPage(pContext, page, start_x, start_y, size_x, size_y, rotate, flags,FALSE, &IPauseAdapter);
-       else {
-               try {
-                       Func_RenderPage(pContext, page, start_x, start_y, size_x, size_y, rotate, flags,FALSE, &IPauseAdapter);
-                       }
-               catch (...){}
-       }
+       Func_RenderPage(pContext, page, start_x, start_y, size_x, size_y, rotate, flags,FALSE, &IPauseAdapter);
 
        if ( pContext->m_pRenderer )
        {
@@ -78,7 +75,9 @@ DLLEXPORT int STDCALL FPDF_RenderPage_Continue(FPDF_PAGE page,IFSDK_PAUSE * paus
        if (pause->version !=1)
                return FPDF_RENDER_FAILED;
 
-       CPDF_Page* pPage = (CPDF_Page*)page;
+       CPDF_Page* pPage = ((CPDFXFA_Page*)page)->GetPDFPage();
+       if (!pPage)
+               return FPDF_RENDER_FAILED;
 
 //     FXMT_CSLOCK_OBJ(&pPage->m_PageLock);
 
@@ -99,7 +98,8 @@ DLLEXPORT int STDCALL FPDF_RenderPage_Continue(FPDF_PAGE page,IFSDK_PAUSE * paus
 DLLEXPORT void STDCALL FPDF_RenderPage_Close(FPDF_PAGE page)
 {
        if (page == NULL) return;
-       CPDF_Page* pPage = (CPDF_Page*)page;
+       CPDF_Page* pPage = ((CPDFXFA_Page*)page)->GetPDFPage();
+       if (!pPage) return;
 
 //     FXMT_CSLOCK_OBJ(&pPage->m_PageLock);