Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(450)

Side by Side Diff: fpdfsdk/src/fsdk_mgr.cpp

Issue 1399833002: Allow building of XFA branch without XFA (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Keep GN in sync. Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « fpdfsdk/src/fsdk_baseform.cpp ('k') | fpdfsdk/src/javascript/JS_Runtime.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include "../../public/fpdf_ext.h" 7 #include "../../public/fpdf_ext.h"
8 #include "../include/formfiller/FFL_FormFiller.h" 8 #include "../include/formfiller/FFL_FormFiller.h"
9 #include "../include/fpdfxfa/fpdfxfa_app.h" 9 #include "../include/fpdfxfa/fpdfxfa_app.h"
10 #include "../include/fpdfxfa/fpdfxfa_doc.h" 10 #include "../include/fpdfxfa/fpdfxfa_doc.h"
(...skipping 676 matching lines...) Expand 10 before | Expand all | Expand 10 after
687 FX_RECT* pClip) { 687 FX_RECT* pClip) {
688 m_curMatrix = *pUser2Device; 688 m_curMatrix = *pUser2Device;
689 // m_pAnnotList->DisplayAnnots(m_page, pDevice, pUser2Device, FALSE, 689 // m_pAnnotList->DisplayAnnots(m_page, pDevice, pUser2Device, FALSE,
690 // pOptions); 690 // pOptions);
691 CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv(); 691 CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
692 CPDFXFA_Page* pPage = GetPDFXFAPage(); 692 CPDFXFA_Page* pPage = GetPDFXFAPage();
693 693
694 if (pPage == NULL) 694 if (pPage == NULL)
695 return; 695 return;
696 696
697 #ifdef PDF_ENABLE_XFA
697 if (pPage->GetDocument()->GetDocType() == DOCTYPE_DYNIMIC_XFA) { 698 if (pPage->GetDocument()->GetDocType() == DOCTYPE_DYNIMIC_XFA) {
698 CFX_Graphics gs; 699 CFX_Graphics gs;
699 gs.Create(pDevice); 700 gs.Create(pDevice);
700 if (pClip) { 701 if (pClip) {
701 CFX_RectF rectClip; 702 CFX_RectF rectClip;
702 rectClip.Set(static_cast<FX_FLOAT>(pClip->left), 703 rectClip.Set(static_cast<FX_FLOAT>(pClip->left),
703 static_cast<FX_FLOAT>(pClip->top), 704 static_cast<FX_FLOAT>(pClip->top),
704 static_cast<FX_FLOAT>(pClip->Width()), 705 static_cast<FX_FLOAT>(pClip->Width()),
705 static_cast<FX_FLOAT>(pClip->Height())); 706 static_cast<FX_FLOAT>(pClip->Height()));
706 gs.SetClipRect(rectClip); 707 gs.SetClipRect(rectClip);
707 } 708 }
708 IXFA_RenderContext* pRenderContext = XFA_RenderContext_Create(); 709 IXFA_RenderContext* pRenderContext = XFA_RenderContext_Create();
709 if (!pRenderContext) 710 if (!pRenderContext)
710 return; 711 return;
711 CXFA_RenderOptions renderOptions; 712 CXFA_RenderOptions renderOptions;
712 renderOptions.m_bHighlight = TRUE; 713 renderOptions.m_bHighlight = TRUE;
713 pRenderContext->StartRender(pPage->GetXFAPageView(), &gs, *pUser2Device, 714 pRenderContext->StartRender(pPage->GetXFAPageView(), &gs, *pUser2Device,
714 renderOptions); 715 renderOptions);
715 pRenderContext->DoRender(); 716 pRenderContext->DoRender();
716 pRenderContext->StopRender(); 717 pRenderContext->StopRender();
717 pRenderContext->Release(); 718 pRenderContext->Release();
718 return; 719 return;
719 } 720 }
721 #endif // PDF_ENABLE_XFA
722
720 // for pdf/static xfa. 723 // for pdf/static xfa.
721 CPDFSDK_AnnotIterator annotIterator(this, TRUE); 724 CPDFSDK_AnnotIterator annotIterator(this, TRUE);
722 CPDFSDK_Annot* pSDKAnnot = NULL; 725 CPDFSDK_Annot* pSDKAnnot = NULL;
723 int index = -1; 726 int index = -1;
724 pSDKAnnot = annotIterator.Next(index); 727 pSDKAnnot = annotIterator.Next(index);
725 while (pSDKAnnot) { 728 while (pSDKAnnot) {
726 CPDFSDK_AnnotHandlerMgr* pAnnotHandlerMgr = pEnv->GetAnnotHandlerMgr(); 729 CPDFSDK_AnnotHandlerMgr* pAnnotHandlerMgr = pEnv->GetAnnotHandlerMgr();
727 ASSERT(pAnnotHandlerMgr); 730 ASSERT(pAnnotHandlerMgr);
728 pAnnotHandlerMgr->Annot_OnDraw(this, pSDKAnnot, pDevice, pUser2Device, 0); 731 pAnnotHandlerMgr->Annot_OnDraw(this, pSDKAnnot, pDevice, pUser2Device, 0);
729 pSDKAnnot = annotIterator.Next(index); 732 pSDKAnnot = annotIterator.Next(index);
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after
1188 if (!pFocusAnnot) 1191 if (!pFocusAnnot)
1189 return NULL; 1192 return NULL;
1190 1193
1191 for (int i = 0; i < m_fxAnnotArray.GetSize(); i++) { 1194 for (int i = 0; i < m_fxAnnotArray.GetSize(); i++) {
1192 CPDFSDK_Annot* pAnnot = (CPDFSDK_Annot*)m_fxAnnotArray.GetAt(i); 1195 CPDFSDK_Annot* pAnnot = (CPDFSDK_Annot*)m_fxAnnotArray.GetAt(i);
1193 if (pAnnot == pFocusAnnot) 1196 if (pAnnot == pFocusAnnot)
1194 return pAnnot; 1197 return pAnnot;
1195 } 1198 }
1196 return NULL; 1199 return NULL;
1197 } 1200 }
OLDNEW
« no previous file with comments | « fpdfsdk/src/fsdk_baseform.cpp ('k') | fpdfsdk/src/javascript/JS_Runtime.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698