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

Side by Side Diff: fpdfsdk/fpdfformfill.cpp

Issue 2006483002: Clean up doc_ocg.cpp. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: nit Created 4 years, 7 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 | « core/fpdfdoc/include/fpdf_doc.h ('k') | fpdfsdk/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 "public/fpdf_formfill.h" 7 #include "public/fpdf_formfill.h"
8 8
9 #include <memory> 9 #include <memory>
10 #include <vector> 10 #include <vector>
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 options.m_Flags |= RENDER_CLEARTYPE; 315 options.m_Flags |= RENDER_CLEARTYPE;
316 else 316 else
317 options.m_Flags &= ~RENDER_CLEARTYPE; 317 options.m_Flags &= ~RENDER_CLEARTYPE;
318 // Grayscale output 318 // Grayscale output
319 if (flags & FPDF_GRAYSCALE) { 319 if (flags & FPDF_GRAYSCALE) {
320 options.m_ColorMode = RENDER_COLOR_GRAY; 320 options.m_ColorMode = RENDER_COLOR_GRAY;
321 options.m_ForeColor = 0; 321 options.m_ForeColor = 0;
322 options.m_BackColor = 0xffffff; 322 options.m_BackColor = 0xffffff;
323 } 323 }
324 options.m_AddFlags = flags >> 8; 324 options.m_AddFlags = flags >> 8;
325 options.m_pOCContext = new CPDF_OCContext(pPage->m_pDocument); 325 options.m_pOCContext =
326 new CPDF_OCContext(pPage->m_pDocument, CPDF_OCContext::View);
326 #else // PDF_ENABLE_XFA 327 #else // PDF_ENABLE_XFA
327 CPDFXFA_Document* pDocument = pPage->GetDocument(); 328 CPDFXFA_Document* pDocument = pPage->GetDocument();
328 if (!pDocument) 329 if (!pDocument)
329 return; 330 return;
330 CPDF_Document* pPDFDoc = pDocument->GetPDFDoc(); 331 CPDF_Document* pPDFDoc = pDocument->GetPDFDoc();
331 if (!pPDFDoc) 332 if (!pPDFDoc)
332 return; 333 return;
333 CPDFDoc_Environment* pEnv = (CPDFDoc_Environment*)hHandle; 334 CPDFDoc_Environment* pEnv = (CPDFDoc_Environment*)hHandle;
334 CPDFSDK_Document* pFXDoc = pEnv->GetSDKDocument(); 335 CPDFSDK_Document* pFXDoc = pEnv->GetSDKDocument();
335 if (!pFXDoc) 336 if (!pFXDoc)
(...skipping 23 matching lines...) Expand all
359 else 360 else
360 options.m_Flags &= ~RENDER_CLEARTYPE; 361 options.m_Flags &= ~RENDER_CLEARTYPE;
361 362
362 // Grayscale output 363 // Grayscale output
363 if (flags & FPDF_GRAYSCALE) { 364 if (flags & FPDF_GRAYSCALE) {
364 options.m_ColorMode = RENDER_COLOR_GRAY; 365 options.m_ColorMode = RENDER_COLOR_GRAY;
365 options.m_ForeColor = 0; 366 options.m_ForeColor = 0;
366 options.m_BackColor = 0xffffff; 367 options.m_BackColor = 0xffffff;
367 } 368 }
368 options.m_AddFlags = flags >> 8; 369 options.m_AddFlags = flags >> 8;
369 options.m_pOCContext = new CPDF_OCContext(pPDFDoc); 370 options.m_pOCContext = new CPDF_OCContext(pPDFDoc, CPDF_OCContext::View);
370 371
371 if (CPDFSDK_PageView* pPageView = pFXDoc->GetPageView(pPage)) 372 if (CPDFSDK_PageView* pPageView = pFXDoc->GetPageView(pPage))
372 pPageView->PageView_OnDraw(pDevice.get(), &matrix, &options, clip); 373 pPageView->PageView_OnDraw(pDevice.get(), &matrix, &options, clip);
373 #endif // PDF_ENABLE_XFA 374 #endif // PDF_ENABLE_XFA
374 375
375 pDevice->RestoreState(); 376 pDevice->RestoreState();
376 delete options.m_pOCContext; 377 delete options.m_pOCContext;
377 #ifdef PDF_ENABLE_XFA 378 #ifdef PDF_ENABLE_XFA
378 options.m_pOCContext = NULL; 379 options.m_pOCContext = NULL;
379 #endif // PDF_ENABLE_XFA 380 #endif // PDF_ENABLE_XFA
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after
715 pActionHandler->DoAction_Page(action, CPDF_AAction::OpenPage, pSDKDoc); 716 pActionHandler->DoAction_Page(action, CPDF_AAction::OpenPage, pSDKDoc);
716 } 717 }
717 } else { 718 } else {
718 if (aa.ActionExist(CPDF_AAction::ClosePage)) { 719 if (aa.ActionExist(CPDF_AAction::ClosePage)) {
719 CPDF_Action action = aa.GetAction(CPDF_AAction::ClosePage); 720 CPDF_Action action = aa.GetAction(CPDF_AAction::ClosePage);
720 pActionHandler->DoAction_Page(action, CPDF_AAction::ClosePage, pSDKDoc); 721 pActionHandler->DoAction_Page(action, CPDF_AAction::ClosePage, pSDKDoc);
721 } 722 }
722 } 723 }
723 } 724 }
724 } 725 }
OLDNEW
« no previous file with comments | « core/fpdfdoc/include/fpdf_doc.h ('k') | fpdfsdk/fsdk_mgr.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698