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

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

Issue 1545183002: Merge to XFA: Switch from nonstd::unique_ptr to std::unique_ptr. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: xfa Created 4 years, 12 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
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>
10
9 #include "fpdfsdk/include/fsdk_define.h" 11 #include "fpdfsdk/include/fsdk_define.h"
10 #include "fpdfsdk/include/fsdk_mgr.h" 12 #include "fpdfsdk/include/fsdk_mgr.h"
11 #include "public/fpdfview.h" 13 #include "public/fpdfview.h"
12 #include "third_party/base/nonstd_unique_ptr.h"
13 14
14 #ifdef PDF_ENABLE_XFA 15 #ifdef PDF_ENABLE_XFA
15 #include "../include/fpdfxfa/fpdfxfa_app.h" 16 #include "../include/fpdfxfa/fpdfxfa_app.h"
16 #include "../include/fpdfxfa/fpdfxfa_doc.h" 17 #include "../include/fpdfxfa/fpdfxfa_doc.h"
17 #include "../include/fpdfxfa/fpdfxfa_page.h" 18 #include "../include/fpdfxfa/fpdfxfa_page.h"
18 #endif // PDF_ENABLE_XFA 19 #endif // PDF_ENABLE_XFA
19 20
20 namespace { 21 namespace {
21 22
22 CPDFSDK_Document* FormHandleToSDKDoc(FPDF_FORMHANDLE hHandle) { 23 CPDFSDK_Document* FormHandleToSDKDoc(FPDF_FORMHANDLE hHandle) {
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 CFX_Matrix matrix; 338 CFX_Matrix matrix;
338 pPage->GetDisplayMatrix(matrix, start_x, start_y, size_x, size_y, rotate); 339 pPage->GetDisplayMatrix(matrix, start_x, start_y, size_x, size_y, rotate);
339 340
340 FX_RECT clip; 341 FX_RECT clip;
341 clip.left = start_x; 342 clip.left = start_x;
342 clip.right = start_x + size_x; 343 clip.right = start_x + size_x;
343 clip.top = start_y; 344 clip.top = start_y;
344 clip.bottom = start_y + size_y; 345 clip.bottom = start_y + size_y;
345 346
346 #ifdef _SKIA_SUPPORT_ 347 #ifdef _SKIA_SUPPORT_
347 nonstd::unique_ptr<CFX_SkiaDevice> pDevice(new CFX_SkiaDevice); 348 std::unique_ptr<CFX_SkiaDevice> pDevice(new CFX_SkiaDevice);
348 #else 349 #else
349 nonstd::unique_ptr<CFX_FxgeDevice> pDevice(new CFX_FxgeDevice); 350 std::unique_ptr<CFX_FxgeDevice> pDevice(new CFX_FxgeDevice);
350 #endif 351 #endif
351 pDevice->Attach((CFX_DIBitmap*)bitmap); 352 pDevice->Attach((CFX_DIBitmap*)bitmap);
352 pDevice->SaveState(); 353 pDevice->SaveState();
353 pDevice->SetClip_Rect(&clip); 354 pDevice->SetClip_Rect(&clip);
354 355
355 #ifndef PDF_ENABLE_XFA 356 #ifndef PDF_ENABLE_XFA
356 if (CPDFSDK_PageView* pPageView = FormHandleToPageView(hHandle, pPage)) 357 if (CPDFSDK_PageView* pPageView = FormHandleToPageView(hHandle, pPage))
357 pPageView->PageView_OnDraw(pDevice.get(), &matrix, &options); 358 pPageView->PageView_OnDraw(pDevice.get(), &matrix, &options);
358 #else // PDF_ENABLE_XFA 359 #else // PDF_ENABLE_XFA
359 CPDF_RenderOptions options; 360 CPDF_RenderOptions options;
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
733 pActionHandler->DoAction_Page(action, CPDF_AAction::OpenPage, pSDKDoc); 734 pActionHandler->DoAction_Page(action, CPDF_AAction::OpenPage, pSDKDoc);
734 } 735 }
735 } else { 736 } else {
736 if (aa.ActionExist(CPDF_AAction::ClosePage)) { 737 if (aa.ActionExist(CPDF_AAction::ClosePage)) {
737 CPDF_Action action = aa.GetAction(CPDF_AAction::ClosePage); 738 CPDF_Action action = aa.GetAction(CPDF_AAction::ClosePage);
738 pActionHandler->DoAction_Page(action, CPDF_AAction::ClosePage, pSDKDoc); 739 pActionHandler->DoAction_Page(action, CPDF_AAction::ClosePage, pSDKDoc);
739 } 740 }
740 } 741 }
741 } 742 }
742 } 743 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698