From f701ff3ce04a4e7e757a9f3ee62b4967749455dd Mon Sep 17 00:00:00 2001 From: Ashod Nakashian Date: Tue, 5 Jun 2018 14:27:55 +0200 Subject: [PATCH 14/14] svx: update PDFium patch and code --- pdfium/fpdfsdk/cpdfsdk_helpers.h | 2 ++ pdfium/fpdfsdk/fpdf_editimg.cpp | 2 +- pdfium/fpdfsdk/fpdf_editpage.cpp | 19 ++++++++++++------- pdfium/public/fpdf_edit.h | 16 ++++++++-------- 4 files changed, 23 insertions(+), 16 deletions(-) diff --git a/pdfium/fpdfsdk/cpdfsdk_helpers.h b/pdfium/fpdfsdk/cpdfsdk_helpers.h index 477bb74..c907ad8 100644 --- a/pdfium/fpdfsdk/cpdfsdk_helpers.h +++ b/pdfium/fpdfsdk/cpdfsdk_helpers.h @@ -40,6 +40,8 @@ class CPDF_TextPage; class CPDF_TextPageFind; class IPDFSDK_PauseAdapter; class FX_PATHPOINT; +class CPDF_TextObject; +class CPDF_FormObject; #ifdef PDF_ENABLE_XFA class CPDFXFA_Context; diff --git a/pdfium/fpdfsdk/fpdf_editimg.cpp b/pdfium/fpdfsdk/fpdf_editimg.cpp index 3f400c7..968b84a 100644 --- a/pdfium/fpdfsdk/fpdf_editimg.cpp +++ b/pdfium/fpdfsdk/fpdf_editimg.cpp @@ -203,7 +203,7 @@ FPDFImageObj_GetBitmapBgra(FPDF_PAGEOBJECT image_object) { RetainPtr pBitmap; pBitmap = pSource->CloneConvert(FXDIB_Argb); - return pBitmap.Leak(); + return FPDFBitmapFromCFXDIBitmap(pBitmap.Leak()); } FPDF_EXPORT unsigned long FPDF_CALLCONV diff --git a/pdfium/fpdfsdk/fpdf_editpage.cpp b/pdfium/fpdfsdk/fpdf_editpage.cpp index 29c8b01..a52e1a9 100644 --- a/pdfium/fpdfsdk/fpdf_editpage.cpp +++ b/pdfium/fpdfsdk/fpdf_editpage.cpp @@ -688,7 +688,7 @@ FPDFTextObj_GetTextProcessed(FPDF_PAGEOBJECT text_object, int ret_count = byte_str_len / kBytesPerCharacter; ASSERT(ret_count <= char_count + 1); // +1 to account for the NUL terminator. - memcpy(result, byte_str.GetBuffer(byte_str_len), byte_str_len); + memcpy(result, byte_str.GetBuffer(byte_str_len).data(), byte_str_len); return ret_count; } @@ -714,7 +714,7 @@ FPDFFormObj_GetSubObject(FPDF_PAGEOBJECT form_object, int index) { const CPDF_PageObjectList* pObjectList = pFrmObj->form()->GetPageObjectList(); if (pObjectList) - return pObjectList->GetPageObjectByIndex(index); + return FPDFPageObjectFromCPDFPageObject(pObjectList->GetPageObjectByIndex(index)); } return nullptr; -- 2.16.3