diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2018-08-01 08:34:42 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2018-08-01 09:34:02 +0200 |
commit | d8b7ac327cfe39f46aaa871cfa7a8fdc8b2b6b54 (patch) | |
tree | 2bf47230c7899b254773dfff62dc4b6ce1541bc0 /svx | |
parent | 8d5a74868383e5405a2225d6a7268dec5ca9cbff (diff) |
pdfium: replace FPDFTextObj_GetColor() patch with backport
Upstream already got FPDFPageObj_GetFillColor() and
FPDFPageObj_GetStrokeColor(), so what was necessary is just a
FPDFText_GetTextRenderMode() to find out which one to use.
Change-Id: I2f31fcadee8a4377b890e01ea62ed96bce275f2b
Reviewed-on: https://gerrit.libreoffice.org/58381
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/svdraw/svdpdf.cxx | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/svx/source/svdraw/svdpdf.cxx b/svx/source/svdraw/svdpdf.cxx index 5b664eb23c65..b6bc08ce7d10 100644 --- a/svx/source/svdraw/svdpdf.cxx +++ b/svx/source/svdraw/svdpdf.cxx @@ -867,9 +867,32 @@ void ImpSdrPdfImport::ImportText(FPDF_PAGEOBJECT pPageObject, FPDF_TEXTPAGE pTex } Color aTextColor(COL_TRANSPARENT); - unsigned int nR, nG, nB, nA; - if (FPDFTextObj_GetColor(pPageObject, &nR, &nG, &nB, &nA)) - aTextColor = Color(nR, nG, nB); + bool bFill = false; + bool bUse = true; + switch (FPDFText_GetTextRenderMode(pPageObject)) + { + case FPDF_TEXTRENDERMODE_FILL: + case FPDF_TEXTRENDERMODE_FILL_CLIP: + case FPDF_TEXTRENDERMODE_FILL_STROKE: + case FPDF_TEXTRENDERMODE_FILL_STROKE_CLIP: + bFill = true; + break; + case FPDF_TEXTRENDERMODE_STROKE: + case FPDF_TEXTRENDERMODE_STROKE_CLIP: + break; + case FPDF_TEXTRENDERMODE_INVISIBLE: + case FPDF_TEXTRENDERMODE_CLIP: + bUse = false; + break; + } + if (bUse) + { + unsigned int nR, nG, nB, nA; + bool bRet = bFill ? FPDFPageObj_GetFillColor(pPageObject, &nR, &nG, &nB, &nA) + : FPDFPageObj_GetStrokeColor(pPageObject, &nR, &nG, &nB, &nA); + if (bRet) + aTextColor = Color(nR, nG, nB); + } if (aTextColor != mpVD->GetTextColor()) { |