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

Side by Side Diff: fpdfsdk/src/fpdfxfa/fpdfxfa_doc.cpp

Issue 1737593006: Re-land "Replace CPDF_Rect and CPDF_Point with CFX types." (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Ooops. Created 4 years, 10 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/fpdfformfill.cpp ('k') | fpdfsdk/src/fsdk_annothandler.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 "fpdfsdk/include/fpdfxfa/fpdfxfa_app.h" 7 #include "fpdfsdk/include/fpdfxfa/fpdfxfa_app.h"
8 #include "fpdfsdk/include/fpdfxfa/fpdfxfa_doc.h" 8 #include "fpdfsdk/include/fpdfxfa/fpdfxfa_doc.h"
9 #include "fpdfsdk/include/fpdfxfa/fpdfxfa_page.h" 9 #include "fpdfsdk/include/fpdfxfa/fpdfxfa_page.h"
10 #include "fpdfsdk/include/fpdfxfa/fpdfxfa_util.h" 10 #include "fpdfsdk/include/fpdfxfa/fpdfxfa_util.h"
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 } 185 }
186 186
187 CPDFSDK_Document* CPDFXFA_Document::GetSDKDocument( 187 CPDFSDK_Document* CPDFXFA_Document::GetSDKDocument(
188 CPDFDoc_Environment* pFormFillEnv) { 188 CPDFDoc_Environment* pFormFillEnv) {
189 if (!m_pSDKDoc && pFormFillEnv) 189 if (!m_pSDKDoc && pFormFillEnv)
190 m_pSDKDoc = new CPDFSDK_Document(this, pFormFillEnv); 190 m_pSDKDoc = new CPDFSDK_Document(this, pFormFillEnv);
191 return m_pSDKDoc; 191 return m_pSDKDoc;
192 } 192 }
193 193
194 void CPDFXFA_Document::FXRect2PDFRect(const CFX_RectF& fxRectF, 194 void CPDFXFA_Document::FXRect2PDFRect(const CFX_RectF& fxRectF,
195 CPDF_Rect& pdfRect) { 195 CFX_FloatRect& pdfRect) {
196 pdfRect.left = fxRectF.left; 196 pdfRect.left = fxRectF.left;
197 pdfRect.top = fxRectF.bottom(); 197 pdfRect.top = fxRectF.bottom();
198 pdfRect.right = fxRectF.right(); 198 pdfRect.right = fxRectF.right();
199 pdfRect.bottom = fxRectF.top; 199 pdfRect.bottom = fxRectF.top;
200 } 200 }
201 201
202 void CPDFXFA_Document::SetChangeMark(IXFA_Doc* hDoc) { 202 void CPDFXFA_Document::SetChangeMark(IXFA_Doc* hDoc) {
203 if (hDoc == m_pXFADoc && m_pSDKDoc) { 203 if (hDoc == m_pXFADoc && m_pSDKDoc) {
204 m_pSDKDoc->SetChangeMark(); 204 m_pSDKDoc->SetChangeMark();
205 } 205 }
206 } 206 }
207 207
208 FX_BOOL CPDFXFA_Document::GetChangeMark(IXFA_Doc* hDoc) { 208 FX_BOOL CPDFXFA_Document::GetChangeMark(IXFA_Doc* hDoc) {
209 if (hDoc == m_pXFADoc && m_pSDKDoc) 209 if (hDoc == m_pXFADoc && m_pSDKDoc)
210 return m_pSDKDoc->GetChangeMark(); 210 return m_pSDKDoc->GetChangeMark();
211 return FALSE; 211 return FALSE;
212 } 212 }
213 213
214 void CPDFXFA_Document::InvalidateRect(IXFA_PageView* pPageView, 214 void CPDFXFA_Document::InvalidateRect(IXFA_PageView* pPageView,
215 const CFX_RectF& rt, 215 const CFX_RectF& rt,
216 FX_DWORD dwFlags /* = 0 */) { 216 FX_DWORD dwFlags /* = 0 */) {
217 if (!m_pXFADoc || !m_pSDKDoc) 217 if (!m_pXFADoc || !m_pSDKDoc)
218 return; 218 return;
219 219
220 if (m_iDocType != DOCTYPE_DYNAMIC_XFA) 220 if (m_iDocType != DOCTYPE_DYNAMIC_XFA)
221 return; 221 return;
222 222
223 CPDF_Rect rcPage; 223 CFX_FloatRect rcPage;
224 FXRect2PDFRect(rt, rcPage); 224 FXRect2PDFRect(rt, rcPage);
225 225
226 CPDFXFA_Page* pPage = GetPage(pPageView); 226 CPDFXFA_Page* pPage = GetPage(pPageView);
227 227
228 if (pPage == NULL) 228 if (pPage == NULL)
229 return; 229 return;
230 230
231 CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv(); 231 CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
232 if (!pEnv) 232 if (!pEnv)
233 return; 233 return;
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 278
279 IXFA_PageView* pPageView = pWidgetHandler->GetPageView(hWidget); 279 IXFA_PageView* pPageView = pWidgetHandler->GetPageView(hWidget);
280 if (!pPageView) 280 if (!pPageView)
281 return; 281 return;
282 282
283 CPDFXFA_Page* pPage = GetPage(pPageView); 283 CPDFXFA_Page* pPage = GetPage(pPageView);
284 284
285 if (pPage == NULL) 285 if (pPage == NULL)
286 return; 286 return;
287 287
288 CPDF_Rect rcCaret; 288 CFX_FloatRect rcCaret;
289 FXRect2PDFRect(*pRtAnchor, rcCaret); 289 FXRect2PDFRect(*pRtAnchor, rcCaret);
290 290
291 CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv(); 291 CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
292 if (!pEnv) 292 if (!pEnv)
293 return; 293 return;
294 294
295 pEnv->FFI_DisplayCaret((FPDF_PAGE)pPage, bVisible, rcCaret.left, rcCaret.top, 295 pEnv->FFI_DisplayCaret((FPDF_PAGE)pPage, bVisible, rcCaret.left, rcCaret.top,
296 rcCaret.right, rcCaret.bottom); 296 rcCaret.right, rcCaret.bottom);
297 } 297 }
298 298
(...skipping 21 matching lines...) Expand all
320 #ifdef PDF_ENABLE_XFA 320 #ifdef PDF_ENABLE_XFA
321 nRotate = pWidgetAcc->GetRotate(); 321 nRotate = pWidgetAcc->GetRotate();
322 #endif 322 #endif
323 323
324 CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv(); 324 CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
325 if (pEnv == NULL) 325 if (pEnv == NULL)
326 return FALSE; 326 return FALSE;
327 FS_RECTF pageViewRect; 327 FS_RECTF pageViewRect;
328 pEnv->FFI_GetPageViewRect(pPage, pageViewRect); 328 pEnv->FFI_GetPageViewRect(pPage, pageViewRect);
329 329
330 CPDF_Rect rcAnchor; 330 CFX_FloatRect rcAnchor;
331 331
332 rcAnchor.left = rtAnchor.left; 332 rcAnchor.left = rtAnchor.left;
333 rcAnchor.top = rtAnchor.bottom(); 333 rcAnchor.top = rtAnchor.bottom();
334 rcAnchor.right = rtAnchor.right(); 334 rcAnchor.right = rtAnchor.right();
335 rcAnchor.bottom = rtAnchor.top; 335 rcAnchor.bottom = rtAnchor.top;
336 336
337 int t1, t2, t; 337 int t1, t2, t;
338 FX_DWORD dwPos; 338 FX_DWORD dwPos;
339 FX_FLOAT fPoupHeight; 339 FX_FLOAT fPoupHeight;
340 switch (nRotate) { 340 switch (nRotate) {
(...skipping 908 matching lines...) Expand 10 before | Expand all | Expand 10 after
1249 } 1249 }
1250 1250
1251 return _GetHValueByName(szPropName, hValue, 1251 return _GetHValueByName(szPropName, hValue,
1252 m_pSDKDoc->GetEnv()->GetJSRuntime()); 1252 m_pSDKDoc->GetEnv()->GetJSRuntime());
1253 } 1253 }
1254 FX_BOOL CPDFXFA_Document::_GetHValueByName(const CFX_ByteStringC& utf8Name, 1254 FX_BOOL CPDFXFA_Document::_GetHValueByName(const CFX_ByteStringC& utf8Name,
1255 FXJSE_HVALUE hValue, 1255 FXJSE_HVALUE hValue,
1256 IJS_Runtime* runTime) { 1256 IJS_Runtime* runTime) {
1257 return runTime->GetHValueByName(utf8Name, hValue); 1257 return runTime->GetHValueByName(utf8Name, hValue);
1258 } 1258 }
OLDNEW
« no previous file with comments | « fpdfsdk/src/fpdfformfill.cpp ('k') | fpdfsdk/src/fsdk_annothandler.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698