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

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

Issue 1473503002: Introduce "underlying types" to abstract XFA differences. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: rebase past Jun's CL. Created 5 years 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_baseannot.cpp ('k') | fpdfsdk/src/fsdk_mgr.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 "../include/fpdfxfa/fpdfxfa_doc.h" 7 #include "../include/fpdfxfa/fpdfxfa_doc.h"
8 #include "../include/fpdfxfa/fpdfxfa_util.h" 8 #include "../include/fpdfxfa/fpdfxfa_util.h"
9 #include "fpdfsdk/include/formfiller/FFL_FormFiller.h" 9 #include "fpdfsdk/include/formfiller/FFL_FormFiller.h"
10 #include "fpdfsdk/include/fsdk_actionhandler.h" 10 #include "fpdfsdk/include/fsdk_actionhandler.h"
(...skipping 18 matching lines...) Expand all
29 m_nValueAge(0), 29 m_nValueAge(0),
30 m_hMixXFAWidget(NULL), 30 m_hMixXFAWidget(NULL),
31 m_pWidgetHandler(NULL) { 31 m_pWidgetHandler(NULL) {
32 ASSERT(m_pInterForm != NULL); 32 ASSERT(m_pInterForm != NULL);
33 } 33 }
34 34
35 CPDFSDK_Widget::~CPDFSDK_Widget() {} 35 CPDFSDK_Widget::~CPDFSDK_Widget() {}
36 36
37 IXFA_Widget* CPDFSDK_Widget::GetMixXFAWidget() const { 37 IXFA_Widget* CPDFSDK_Widget::GetMixXFAWidget() const {
38 CPDFSDK_Document* pSDKDoc = m_pPageView->GetSDKDocument(); 38 CPDFSDK_Document* pSDKDoc = m_pPageView->GetSDKDocument();
39 CPDFXFA_Document* pDoc = pSDKDoc->GetDocument(); 39 CPDFXFA_Document* pDoc = pSDKDoc->GetXFADocument();
40 if (pDoc->GetDocType() == DOCTYPE_STATIC_XFA) { 40 if (pDoc->GetDocType() == DOCTYPE_STATIC_XFA) {
41 if (!m_hMixXFAWidget) { 41 if (!m_hMixXFAWidget) {
42 if (IXFA_DocView* pDocView = pDoc->GetXFADocView()) { 42 if (IXFA_DocView* pDocView = pDoc->GetXFADocView()) {
43 CFX_WideString sName; 43 CFX_WideString sName;
44 if (this->GetFieldType() == FIELDTYPE_RADIOBUTTON) { 44 if (this->GetFieldType() == FIELDTYPE_RADIOBUTTON) {
45 sName = this->GetAnnotName(); 45 sName = this->GetAnnotName();
46 if (sName.IsEmpty()) 46 if (sName.IsEmpty())
47 sName = GetName(); 47 sName = GetName();
48 } else 48 } else
49 sName = GetName(); 49 sName = GetName();
50 50
51 if (!sName.IsEmpty()) 51 if (!sName.IsEmpty())
52 m_hMixXFAWidget = pDocView->GetWidgetByName(sName); 52 m_hMixXFAWidget = pDocView->GetWidgetByName(sName);
53 } 53 }
54 } 54 }
55 return m_hMixXFAWidget; 55 return m_hMixXFAWidget;
56 } 56 }
57 57
58 return NULL; 58 return NULL;
59 } 59 }
60 60
61 IXFA_Widget* CPDFSDK_Widget::GetGroupMixXFAWidget() { 61 IXFA_Widget* CPDFSDK_Widget::GetGroupMixXFAWidget() {
62 ASSERT(m_pPageView != NULL);
63
64 CPDFSDK_Document* pSDKDoc = m_pPageView->GetSDKDocument(); 62 CPDFSDK_Document* pSDKDoc = m_pPageView->GetSDKDocument();
65 ASSERT(pSDKDoc != NULL); 63 CPDFXFA_Document* pDoc = pSDKDoc->GetXFADocument();
66
67 CPDFXFA_Document* pDoc = pSDKDoc->GetDocument();
68 ASSERT(pDoc != NULL);
69
70 if (pDoc->GetDocType() == DOCTYPE_STATIC_XFA) { 64 if (pDoc->GetDocType() == DOCTYPE_STATIC_XFA) {
71 if (IXFA_DocView* pDocView = pDoc->GetXFADocView()) { 65 if (IXFA_DocView* pDocView = pDoc->GetXFADocView()) {
72 CFX_WideString sName = GetName(); 66 CFX_WideString sName = GetName();
73
74 if (!sName.IsEmpty()) 67 if (!sName.IsEmpty())
75 return pDocView->GetWidgetByName(sName); 68 return pDocView->GetWidgetByName(sName);
76 } 69 }
77 } 70 }
78 71
79 return NULL; 72 return nullptr;
80 } 73 }
81 74
82 IXFA_WidgetHandler* CPDFSDK_Widget::GetXFAWidgetHandler() const { 75 IXFA_WidgetHandler* CPDFSDK_Widget::GetXFAWidgetHandler() const {
83 CPDFSDK_Document* pSDKDoc = m_pPageView->GetSDKDocument(); 76 CPDFSDK_Document* pSDKDoc = m_pPageView->GetSDKDocument();
84 CPDFXFA_Document* pDoc = pSDKDoc->GetDocument(); 77 CPDFXFA_Document* pDoc = pSDKDoc->GetXFADocument();
85 if (pDoc->GetDocType() == DOCTYPE_STATIC_XFA) { 78 if (pDoc->GetDocType() == DOCTYPE_STATIC_XFA) {
86 if (!m_pWidgetHandler) { 79 if (!m_pWidgetHandler) {
87 if (IXFA_DocView* pDocView = pDoc->GetXFADocView()) { 80 if (IXFA_DocView* pDocView = pDoc->GetXFADocView()) {
88 m_pWidgetHandler = pDocView->GetWidgetHandler(); 81 m_pWidgetHandler = pDocView->GetWidgetHandler();
89 } 82 }
90 } 83 }
91 return m_pWidgetHandler; 84 return m_pWidgetHandler;
92 } 85 }
93 86
94 return NULL; 87 return NULL;
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 } 182 }
190 } 183 }
191 } 184 }
192 185
193 return FALSE; 186 return FALSE;
194 } 187 }
195 188
196 FX_BOOL CPDFSDK_Widget::OnXFAAAction(PDFSDK_XFAAActionType eXFAAAT, 189 FX_BOOL CPDFSDK_Widget::OnXFAAAction(PDFSDK_XFAAActionType eXFAAAT,
197 PDFSDK_FieldAction& data, 190 PDFSDK_FieldAction& data,
198 CPDFSDK_PageView* pPageView) { 191 CPDFSDK_PageView* pPageView) {
199 ASSERT(m_pPageView != NULL);
200
201 CPDFSDK_Document* pSDKDoc = m_pPageView->GetSDKDocument(); 192 CPDFSDK_Document* pSDKDoc = m_pPageView->GetSDKDocument();
202 ASSERT(pSDKDoc != NULL); 193 CPDFXFA_Document* pDoc = pSDKDoc->GetXFADocument();
203 194 if (IXFA_Widget* hWidget = GetMixXFAWidget()) {
204 CPDFXFA_Document* pDoc = pSDKDoc->GetDocument();
205 ASSERT(pDoc != NULL);
206
207 if (IXFA_Widget* hWidget = this->GetMixXFAWidget()) {
208 XFA_EVENTTYPE eEventType = GetXFAEventType(eXFAAAT); 195 XFA_EVENTTYPE eEventType = GetXFAEventType(eXFAAAT);
209 196
210 if (eEventType != XFA_EVENT_Unknown) { 197 if (eEventType != XFA_EVENT_Unknown) {
211 if (IXFA_WidgetHandler* pXFAWidgetHandler = this->GetXFAWidgetHandler()) { 198 if (IXFA_WidgetHandler* pXFAWidgetHandler = this->GetXFAWidgetHandler()) {
212 CXFA_EventParam param; 199 CXFA_EventParam param;
213 param.m_eType = eEventType; 200 param.m_eType = eEventType;
214 param.m_wsChange = data.sChange; 201 param.m_wsChange = data.sChange;
215 param.m_iCommitKey = data.nCommitKey; 202 param.m_iCommitKey = data.nCommitKey;
216 param.m_bShift = data.bShift; 203 param.m_bShift = data.bShift;
217 param.m_iSelStart = data.nSelStart; 204 param.m_iSelStart = data.nSelStart;
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 if (bSynchronizeElse) 294 if (bSynchronizeElse)
308 pWidgetAcc->ProcessValueChanged(); 295 pWidgetAcc->ProcessValueChanged();
309 } 296 }
310 } 297 }
311 } 298 }
312 #endif // PDF_ENABLE_XFA 299 #endif // PDF_ENABLE_XFA
313 } 300 }
314 301
315 void CPDFSDK_Widget::SynchronizeXFAValue() { 302 void CPDFSDK_Widget::SynchronizeXFAValue() {
316 #ifdef PDF_ENABLE_XFA 303 #ifdef PDF_ENABLE_XFA
317 ASSERT(m_pPageView != NULL);
318
319 CPDFSDK_Document* pSDKDoc = m_pPageView->GetSDKDocument(); 304 CPDFSDK_Document* pSDKDoc = m_pPageView->GetSDKDocument();
320 ASSERT(pSDKDoc != NULL); 305 CPDFXFA_Document* pDoc = pSDKDoc->GetXFADocument();
321
322 CPDFXFA_Document* pDoc = pSDKDoc->GetDocument();
323 ASSERT(pDoc != NULL);
324
325 IXFA_DocView* pXFADocView = pDoc->GetXFADocView(); 306 IXFA_DocView* pXFADocView = pDoc->GetXFADocView();
326 if (!pXFADocView) 307 if (!pXFADocView)
327 return; 308 return;
328 309
329 if (IXFA_Widget* hWidget = GetMixXFAWidget()) { 310 if (IXFA_Widget* hWidget = GetMixXFAWidget()) {
330 if (GetXFAWidgetHandler()) { 311 if (GetXFAWidgetHandler()) {
331 CPDFSDK_Widget::SynchronizeXFAValue(pXFADocView, hWidget, GetFormField(), 312 CPDFSDK_Widget::SynchronizeXFAValue(pXFADocView, hWidget, GetFormField(),
332 GetFormControl()); 313 GetFormControl());
333 } 314 }
334 } 315 }
335 #endif // PDF_ENABLE_XFA 316 #endif // PDF_ENABLE_XFA
336 } 317 }
337 318
338 void CPDFSDK_Widget::SynchronizeXFAItems() { 319 void CPDFSDK_Widget::SynchronizeXFAItems() {
339 #ifdef PDF_ENABLE_XFA 320 #ifdef PDF_ENABLE_XFA
340 ASSERT(m_pPageView != NULL);
341
342 CPDFSDK_Document* pSDKDoc = m_pPageView->GetSDKDocument(); 321 CPDFSDK_Document* pSDKDoc = m_pPageView->GetSDKDocument();
343 ASSERT(pSDKDoc != NULL); 322 CPDFXFA_Document* pDoc = pSDKDoc->GetXFADocument();
344
345 CPDFXFA_Document* pDoc = pSDKDoc->GetDocument();
346 ASSERT(pDoc != NULL);
347
348 IXFA_DocView* pXFADocView = pDoc->GetXFADocView(); 323 IXFA_DocView* pXFADocView = pDoc->GetXFADocView();
349 if (!pXFADocView) 324 if (!pXFADocView)
350 return; 325 return;
351 326
352 if (IXFA_Widget* hWidget = GetMixXFAWidget()) { 327 if (IXFA_Widget* hWidget = GetMixXFAWidget()) {
353 if (GetXFAWidgetHandler()) 328 if (GetXFAWidgetHandler())
354 SynchronizeXFAItems(pXFADocView, hWidget, GetFormField(), nullptr); 329 SynchronizeXFAItems(pXFADocView, hWidget, GetFormField(), nullptr);
355 } 330 }
356 #endif // PDF_ENABLE_XFA 331 #endif // PDF_ENABLE_XFA
357 } 332 }
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
520 } 495 }
521 496
522 int CPDFSDK_Widget::GetFieldType() const { 497 int CPDFSDK_Widget::GetFieldType() const {
523 CPDF_FormField* pField = GetFormField(); 498 CPDF_FormField* pField = GetFormField();
524 ASSERT(pField != NULL); 499 ASSERT(pField != NULL);
525 500
526 return pField->GetFieldType(); 501 return pField->GetFieldType();
527 } 502 }
528 503
529 FX_BOOL CPDFSDK_Widget::IsAppearanceValid() { 504 FX_BOOL CPDFSDK_Widget::IsAppearanceValid() {
530 ASSERT(m_pPageView != NULL);
531
532 CPDFSDK_Document* pSDKDoc = m_pPageView->GetSDKDocument(); 505 CPDFSDK_Document* pSDKDoc = m_pPageView->GetSDKDocument();
533 ASSERT(pSDKDoc != NULL); 506 CPDFXFA_Document* pDoc = pSDKDoc->GetXFADocument();
534
535 CPDFXFA_Document* pDoc = pSDKDoc->GetDocument();
536 ASSERT(pDoc != NULL);
537
538 int nDocType = pDoc->GetDocType(); 507 int nDocType = pDoc->GetDocType();
539 if (nDocType == DOCTYPE_PDF || nDocType == DOCTYPE_STATIC_XFA) 508 if (nDocType == DOCTYPE_PDF || nDocType == DOCTYPE_STATIC_XFA)
540 return CPDFSDK_BAAnnot::IsAppearanceValid(); 509 return CPDFSDK_BAAnnot::IsAppearanceValid();
541 510
542 return TRUE; 511 return TRUE;
543 } 512 }
544 513
545 int CPDFSDK_Widget::GetFieldFlags() const { 514 int CPDFSDK_Widget::GetFieldFlags() const {
546 CPDF_InterForm* pPDFInterForm = m_pInterForm->GetInterForm(); 515 CPDF_InterForm* pPDFInterForm = m_pInterForm->GetInterForm();
547 ASSERT(pPDFInterForm != NULL); 516 ASSERT(pPDFInterForm != NULL);
(...skipping 1431 matching lines...) Expand 10 before | Expand all | Expand 10 after
1979 void CPDFSDK_Widget::RemoveAppearance(const CFX_ByteString& sAPType) { 1948 void CPDFSDK_Widget::RemoveAppearance(const CFX_ByteString& sAPType) {
1980 if (CPDF_Dictionary* pAPDict = m_pAnnot->GetAnnotDict()->GetDict("AP")) { 1949 if (CPDF_Dictionary* pAPDict = m_pAnnot->GetAnnotDict()->GetDict("AP")) {
1981 pAPDict->RemoveAt(sAPType); 1950 pAPDict->RemoveAt(sAPType);
1982 } 1951 }
1983 } 1952 }
1984 1953
1985 FX_BOOL CPDFSDK_Widget::OnAAction(CPDF_AAction::AActionType type, 1954 FX_BOOL CPDFSDK_Widget::OnAAction(CPDF_AAction::AActionType type,
1986 PDFSDK_FieldAction& data, 1955 PDFSDK_FieldAction& data,
1987 CPDFSDK_PageView* pPageView) { 1956 CPDFSDK_PageView* pPageView) {
1988 CPDFSDK_Document* pDocument = pPageView->GetSDKDocument(); 1957 CPDFSDK_Document* pDocument = pPageView->GetSDKDocument();
1989 ASSERT(pDocument != NULL); 1958 CPDFXFA_Document* pDoc = pDocument->GetXFADocument();
1990
1991 CPDFXFA_Document* pDoc = pDocument->GetDocument();
1992 ASSERT(pDoc != NULL);
1993
1994 CPDFDoc_Environment* pEnv = pDocument->GetEnv(); 1959 CPDFDoc_Environment* pEnv = pDocument->GetEnv();
1995 ASSERT(pEnv != NULL);
1996 1960
1997 if (IXFA_Widget* hWidget = this->GetMixXFAWidget()) { 1961 if (IXFA_Widget* hWidget = this->GetMixXFAWidget()) {
1998 XFA_EVENTTYPE eEventType = GetXFAEventType(type, data.bWillCommit); 1962 XFA_EVENTTYPE eEventType = GetXFAEventType(type, data.bWillCommit);
1999 1963
2000 if (eEventType != XFA_EVENT_Unknown) { 1964 if (eEventType != XFA_EVENT_Unknown) {
2001 if (IXFA_WidgetHandler* pXFAWidgetHandler = this->GetXFAWidgetHandler()) { 1965 if (IXFA_WidgetHandler* pXFAWidgetHandler = this->GetXFAWidgetHandler()) {
2002 CXFA_EventParam param; 1966 CXFA_EventParam param;
2003 param.m_eType = eEventType; 1967 param.m_eType = eEventType;
2004 param.m_wsChange = data.sChange; 1968 param.m_wsChange = data.sChange;
2005 param.m_iCommitKey = data.nCommitKey; 1969 param.m_iCommitKey = data.nCommitKey;
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
2114 return TRUE; 2078 return TRUE;
2115 } 2079 }
2116 2080
2117 CFX_ByteString CPDFSDK_XFAWidget::GetType() const { 2081 CFX_ByteString CPDFSDK_XFAWidget::GetType() const {
2118 return FSDK_XFAWIDGET_TYPENAME; 2082 return FSDK_XFAWIDGET_TYPENAME;
2119 } 2083 }
2120 2084
2121 CFX_FloatRect CPDFSDK_XFAWidget::GetRect() const { 2085 CFX_FloatRect CPDFSDK_XFAWidget::GetRect() const {
2122 CPDFSDK_PageView* pPageView = GetPageView(); 2086 CPDFSDK_PageView* pPageView = GetPageView();
2123 CPDFSDK_Document* pDocument = pPageView->GetSDKDocument(); 2087 CPDFSDK_Document* pDocument = pPageView->GetSDKDocument();
2124 CPDFXFA_Document* pDoc = pDocument->GetDocument(); 2088 CPDFXFA_Document* pDoc = pDocument->GetXFADocument();
2125 IXFA_DocView* pDocView = pDoc->GetXFADocView(); 2089 IXFA_DocView* pDocView = pDoc->GetXFADocView();
2126 IXFA_WidgetHandler* pWidgetHandler = pDocView->GetWidgetHandler(); 2090 IXFA_WidgetHandler* pWidgetHandler = pDocView->GetWidgetHandler();
2127 2091
2128 CFX_RectF rcBBox; 2092 CFX_RectF rcBBox;
2129 pWidgetHandler->GetRect(GetXFAWidget(), rcBBox); 2093 pWidgetHandler->GetRect(GetXFAWidget(), rcBBox);
2130 2094
2131 return CFX_FloatRect(rcBBox.left, rcBBox.top, rcBBox.left + rcBBox.width, 2095 return CFX_FloatRect(rcBBox.left, rcBBox.top, rcBBox.left + rcBBox.width,
2132 rcBBox.top + rcBBox.height); 2096 rcBBox.top + rcBBox.height);
2133 } 2097 }
2134 2098
2135 // CPDFSDK_InterForm 2099 // CPDFSDK_InterForm
2136 CPDFSDK_InterForm::CPDFSDK_InterForm(CPDFSDK_Document* pDocument) 2100 CPDFSDK_InterForm::CPDFSDK_InterForm(CPDFSDK_Document* pDocument)
2137 : m_pDocument(pDocument), 2101 : m_pDocument(pDocument),
2138 m_pInterForm(NULL), 2102 m_pInterForm(NULL),
2139 m_bCalculate(TRUE), 2103 m_bCalculate(TRUE),
2140 m_bXfaCalculate(TRUE), 2104 m_bXfaCalculate(TRUE),
2141 m_bXfaValidationsEnabled(TRUE), 2105 m_bXfaValidationsEnabled(TRUE),
2142 m_bBusy(FALSE) { 2106 m_bBusy(FALSE) {
2143 ASSERT(m_pDocument != NULL); 2107 ASSERT(m_pDocument != NULL);
2144 m_pInterForm = 2108 m_pInterForm = new CPDF_InterForm(m_pDocument->GetPDFDocument(), FALSE);
2145 new CPDF_InterForm(m_pDocument->GetDocument()->GetPDFDoc(), FALSE);
2146 m_pInterForm->SetFormNotify(this); 2109 m_pInterForm->SetFormNotify(this);
2147 2110
2148 for (int i = 0; i < kNumFieldTypes; ++i) 2111 for (int i = 0; i < kNumFieldTypes; ++i)
2149 m_bNeedHightlight[i] = FALSE; 2112 m_bNeedHightlight[i] = FALSE;
2150 m_iHighlightAlpha = 0; 2113 m_iHighlightAlpha = 0;
2151 } 2114 }
2152 2115
2153 CPDFSDK_InterForm::~CPDFSDK_InterForm() { 2116 CPDFSDK_InterForm::~CPDFSDK_InterForm() {
2154 delete m_pInterForm; 2117 delete m_pInterForm;
2155 m_pInterForm = nullptr; 2118 m_pInterForm = nullptr;
(...skipping 22 matching lines...) Expand all
2178 2141
2179 CPDFSDK_Widget* pWidget = nullptr; 2142 CPDFSDK_Widget* pWidget = nullptr;
2180 const auto it = m_Map.find(pControl); 2143 const auto it = m_Map.find(pControl);
2181 if (it != m_Map.end()) 2144 if (it != m_Map.end())
2182 pWidget = it->second; 2145 pWidget = it->second;
2183 2146
2184 if (pWidget) 2147 if (pWidget)
2185 return pWidget; 2148 return pWidget;
2186 2149
2187 CPDF_Dictionary* pControlDict = pControl->GetWidget(); 2150 CPDF_Dictionary* pControlDict = pControl->GetWidget();
2188 CPDF_Document* pDocument = m_pDocument->GetDocument()->GetPDFDoc(); 2151 CPDF_Document* pDocument = m_pDocument->GetPDFDocument();
2189 CPDFSDK_PageView* pPage = nullptr; 2152 CPDFSDK_PageView* pPage = nullptr;
2190 2153
2191 if (CPDF_Dictionary* pPageDict = pControlDict->GetDict("P")) { 2154 if (CPDF_Dictionary* pPageDict = pControlDict->GetDict("P")) {
2192 int nPageIndex = pDocument->GetPageIndex(pPageDict->GetObjNum()); 2155 int nPageIndex = pDocument->GetPageIndex(pPageDict->GetObjNum());
2193 if (nPageIndex >= 0) { 2156 if (nPageIndex >= 0) {
2194 pPage = m_pDocument->GetPageView(nPageIndex); 2157 pPage = m_pDocument->GetPageView(nPageIndex);
2195 } 2158 }
2196 } 2159 }
2197 2160
2198 if (!pPage) { 2161 if (!pPage) {
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
2294 FX_BOOL CPDFSDK_InterForm::IsXfaValidationsEnabled() { 2257 FX_BOOL CPDFSDK_InterForm::IsXfaValidationsEnabled() {
2295 return m_bXfaValidationsEnabled; 2258 return m_bXfaValidationsEnabled;
2296 } 2259 }
2297 void CPDFSDK_InterForm::XfaSetValidationsEnabled(FX_BOOL bEnabled) { 2260 void CPDFSDK_InterForm::XfaSetValidationsEnabled(FX_BOOL bEnabled) {
2298 m_bXfaValidationsEnabled = bEnabled; 2261 m_bXfaValidationsEnabled = bEnabled;
2299 } 2262 }
2300 2263
2301 #ifdef _WIN32 2264 #ifdef _WIN32
2302 CPDF_Stream* CPDFSDK_InterForm::LoadImageFromFile(const CFX_WideString& sFile) { 2265 CPDF_Stream* CPDFSDK_InterForm::LoadImageFromFile(const CFX_WideString& sFile) {
2303 ASSERT(m_pDocument != NULL); 2266 ASSERT(m_pDocument != NULL);
2304 CPDF_Document* pDocument = m_pDocument->GetDocument()->GetPDFDoc(); 2267 CPDF_Document* pDocument = m_pDocument->GetDocument()->GetPDFDoc();
Lei Zhang 2015/11/24 18:13:09 Looks like you got more to change.
2305 ASSERT(pDocument != NULL); 2268 ASSERT(pDocument != NULL);
2306 2269
2307 CPDF_Stream* pRetStream = NULL; 2270 CPDF_Stream* pRetStream = NULL;
2308 2271
2309 if (CFX_DIBitmap* pBmp = CFX_WindowsDIB::LoadFromFile(sFile.c_str())) { 2272 if (CFX_DIBitmap* pBmp = CFX_WindowsDIB::LoadFromFile(sFile.c_str())) {
2310 int nWidth = pBmp->GetWidth(); 2273 int nWidth = pBmp->GetWidth();
2311 int nHeight = pBmp->GetHeight(); 2274 int nHeight = pBmp->GetHeight();
2312 2275
2313 CPDF_Image Image(pDocument); 2276 CPDF_Image Image(pDocument);
2314 Image.SetImage(pBmp, FALSE); 2277 Image.SetImage(pBmp, FALSE);
(...skipping 862 matching lines...) Expand 10 before | Expand all | Expand 10 after
3177 break; 3140 break;
3178 } 3141 }
3179 } 3142 }
3180 } 3143 }
3181 3144
3182 CPDF_Rect CBA_AnnotIterator::GetAnnotRect(CPDFSDK_Annot* pAnnot) { 3145 CPDF_Rect CBA_AnnotIterator::GetAnnotRect(CPDFSDK_Annot* pAnnot) {
3183 CPDF_Rect rcAnnot; 3146 CPDF_Rect rcAnnot;
3184 pAnnot->GetPDFAnnot()->GetRect(rcAnnot); 3147 pAnnot->GetPDFAnnot()->GetRect(rcAnnot);
3185 return rcAnnot; 3148 return rcAnnot;
3186 } 3149 }
OLDNEW
« no previous file with comments | « fpdfsdk/src/fsdk_baseannot.cpp ('k') | fpdfsdk/src/fsdk_mgr.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698