diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2018-09-04 21:17:39 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2018-09-05 09:11:21 +0200 |
commit | 51dca926f5968e9227391f7c47d25b9442178eaa (patch) | |
tree | 16248ce2ab2bc8bc1629df8ca182650cb57ec830 /svx/source/svdraw | |
parent | ce74572fb321b9a47fa4f70eb60dc7c6487abda3 (diff) |
pdfium: replace FPDFTextObj_CountChars/GetTextProcessed patches with backport
Change-Id: I9c198ff0cd31de064fcc4a3bb0ed92066f38e4c5
Reviewed-on: https://gerrit.libreoffice.org/60007
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'svx/source/svdraw')
-rw-r--r-- | svx/source/svdraw/svdpdf.cxx | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/svx/source/svdraw/svdpdf.cxx b/svx/source/svdraw/svdpdf.cxx index 88e157b696fb..e0a394d61a2c 100644 --- a/svx/source/svdraw/svdpdf.cxx +++ b/svx/source/svdraw/svdpdf.cxx @@ -823,12 +823,10 @@ void ImpSdrPdfImport::ImportText(FPDF_PAGEOBJECT pPageObject, FPDF_TEXTPAGE pTex aTextMatrix.Transform(left, right, top, bottom); const tools::Rectangle aRect = PointsToLogic(left, right, top, bottom); - const int nChars = FPDFTextObj_CountChars(pPageObject) * 2; - std::unique_ptr<sal_Unicode[]> pText(new sal_Unicode[nChars + 1]); // + terminating null + const int nChars = FPDFTextObj_GetText(pPageObject, pTextPage, nullptr, 0); + std::unique_ptr<sal_Unicode[]> pText(new sal_Unicode[nChars]); - unsigned short* pShortText = reinterpret_cast<unsigned short*>(pText.get()); - const int nActualChars - = FPDFTextObj_GetTextProcessed(pPageObject, pTextPage, 0, nChars, pShortText); + const int nActualChars = FPDFTextObj_GetText(pPageObject, pTextPage, pText.get(), nChars); if (nActualChars <= 0) { return; |