summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/fpdfppo.cpp
diff options
context:
space:
mode:
authorBo Xu <bo_xu@foxitsoftware.com>2014-10-28 23:03:33 -0700
committerBo Xu <bo_xu@foxitsoftware.com>2014-11-03 11:10:11 -0800
commitfdc00a7042d912aafaabddae4d9c84199921ef23 (patch)
tree32ab8ac91cc68d2cd15b9168782a71b3f3f5e7b9 /fpdfsdk/src/fpdfppo.cpp
parente9b38fa38de2c95d8260be31c57d9272c4d127ed (diff)
downloadpdfium-fdc00a7042d912aafaabddae4d9c84199921ef23.tar.xz
Merge XFA to PDFium master at 4dc95e7 on 10/28/2014
Diffstat (limited to 'fpdfsdk/src/fpdfppo.cpp')
-rw-r--r--fpdfsdk/src/fpdfppo.cpp25
1 files changed, 15 insertions, 10 deletions
diff --git a/fpdfsdk/src/fpdfppo.cpp b/fpdfsdk/src/fpdfppo.cpp
index a5c4275648..ed0c8565c0 100644
--- a/fpdfsdk/src/fpdfppo.cpp
+++ b/fpdfsdk/src/fpdfppo.cpp
@@ -6,6 +6,7 @@
#include "../include/fpdfppo.h"
#include "../include/fsdk_define.h"
+#include "../include/fpdfxfa/fpdfxfa_doc.h"
class CPDF_PageOrganizer
{
@@ -428,8 +429,9 @@ DLLEXPORT FPDF_BOOL STDCALL FPDF_ImportPages(FPDF_DOCUMENT dest_doc,FPDF_DOCUMEN
if(dest_doc == NULL || src_doc == NULL )
return FALSE;
CFX_WordArray pageArray;
- CPDF_Document* pSrcDoc = (CPDF_Document*)src_doc;
- int nCount = pSrcDoc->GetPageCount();
+ CPDFXFA_Document* pSrcDoc = (CPDFXFA_Document*)src_doc;
+ CPDF_Document* pSrcPDFDoc = pSrcDoc->GetPDFDoc();
+ int nCount = pSrcPDFDoc->GetPageCount();
if(pagerange)
{
if(ParserPageRangeString(pagerange,&pageArray,nCount) == FALSE)
@@ -443,12 +445,13 @@ DLLEXPORT FPDF_BOOL STDCALL FPDF_ImportPages(FPDF_DOCUMENT dest_doc,FPDF_DOCUMEN
}
}
- CPDF_Document* pDestDoc = (CPDF_Document*)dest_doc;
+ CPDFXFA_Document* pDestDoc = (CPDFXFA_Document*)dest_doc;
+ CPDF_Document* pDestPDFDoc = pDestDoc->GetPDFDoc();
CPDF_PageOrganizer pageOrg;
- pageOrg.PDFDocInit(pDestDoc,pSrcDoc);
+ pageOrg.PDFDocInit(pDestPDFDoc,pSrcPDFDoc);
- if(pageOrg.ExportPage(pSrcDoc,&pageArray,pDestDoc,index))
+ if(pageOrg.ExportPage(pSrcPDFDoc,&pageArray,pDestPDFDoc,index))
return TRUE;
return FALSE;
}
@@ -457,13 +460,15 @@ DLLEXPORT FPDF_BOOL STDCALL FPDF_CopyViewerPreferences(FPDF_DOCUMENT dest_doc, F
{
if(src_doc == NULL || dest_doc == NULL)
return false;
- CPDF_Document* pSrcDoc = (CPDF_Document*)src_doc;
- CPDF_Dictionary* pSrcDict = pSrcDoc->GetRoot();
- pSrcDict = pSrcDict->GetDict(FX_BSTRC("ViewerPreferences"));;
+ CPDFXFA_Document* pSrcDoc = (CPDFXFA_Document*)src_doc;
+ CPDF_Document* pSrcPDFDoc = pSrcDoc->GetPDFDoc();
+ CPDF_Dictionary* pSrcDict = pSrcPDFDoc->GetRoot();
+ pSrcDict = pSrcDict->GetDict(FX_BSTRC("ViewerPreferences"));
if(!pSrcDict)
return FALSE;
- CPDF_Document* pDstDoc = (CPDF_Document*)dest_doc;
- CPDF_Dictionary* pDstDict = pDstDoc->GetRoot();
+ CPDFXFA_Document* pDstDoc = (CPDFXFA_Document*)dest_doc;
+ CPDF_Document* pDstPDFDoc = pDstDoc->GetPDFDoc();
+ CPDF_Dictionary* pDstDict = pDstPDFDoc->GetRoot();
if(!pDstDict)
return FALSE;
pDstDict->SetAt(FX_BSTRC("ViewerPreferences"), pSrcDict->Clone(TRUE));