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 /external/pdfium/0004-svx-support-PDF-text-color.patch.2 | |
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 'external/pdfium/0004-svx-support-PDF-text-color.patch.2')
-rw-r--r-- | external/pdfium/0004-svx-support-PDF-text-color.patch.2 | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/external/pdfium/0004-svx-support-PDF-text-color.patch.2 b/external/pdfium/0004-svx-support-PDF-text-color.patch.2 index a9b492891ba7..5f492007da3b 100644 --- a/external/pdfium/0004-svx-support-PDF-text-color.patch.2 +++ b/external/pdfium/0004-svx-support-PDF-text-color.patch.2 @@ -38,57 +38,6 @@ index 3244943..f8e2418 100644 return pTxtObj->CountChars(); } -@@ -645,3 +645,23 @@ FPDFPageObj_SetLineCap(FPDF_PAGEOBJECT page_object, int line_cap) { - pPageObj->SetDirty(true); - return true; - } -+ -+FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV -+FPDFTextObj_GetStrokeColor(FPDF_PAGEOBJECT text_object, -+ unsigned int* R, -+ unsigned int* G, -+ unsigned int* B, -+ unsigned int* A) -+{ -+ CPDF_TextObject* pTxtObj = CPDFTextObjectFromFPDFPageObject(text_object); -+ if (!pTxtObj || !R || !G || !B || !A) -+ return false; -+ -+ const uint32_t strokeRGB = pTxtObj->m_ColorState.GetStrokeRGB(); -+ *R = FXSYS_GetRValue(strokeRGB); -+ *G = FXSYS_GetGValue(strokeRGB); -+ *B = FXSYS_GetBValue(strokeRGB); -+ *A = static_cast<unsigned int>( -+ (pTxtObj->m_GeneralState.GetStrokeAlpha() * 255.f) + 0.5f); -+ return true; -+} -diff --git a/pdfium/public/fpdf_edit.h b/pdfium/public/fpdf_edit.h -index 602849f..fa9902e 100644 ---- a/pdfium/public/fpdf_edit.h -+++ b/pdfium/public/fpdf_edit.h -@@ -1125,6 +1125,22 @@ FPDFPageObj_CreateTextObj(FPDF_DOCUMENT document, - FPDF_EXPORT int FPDF_CALLCONV - FPDFTextObj_CountChars(FPDF_PAGEOBJECT text_object); - -+// Get the stroke RGBA of a text. Range of values: 0 - 255. -+// -+// path - the handle to the path object. -+// R - the red component of the path stroke color. -+// G - the green component of the path stroke color. -+// B - the blue component of the path stroke color. -+// A - the stroke alpha of the path. -+// -+// Returns TRUE on success. -+FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV -+FPDFTextObj_GetStrokeColor(FPDF_PAGEOBJECT text_object, -+ unsigned int* R, -+ unsigned int* G, -+ unsigned int* B, -+ unsigned int* A); -+ - #ifdef __cplusplus - } // extern "C" - #endif // __cplusplus diff --git a/pdfium/fpdfsdk/fpdf_edittext.cpp b/pdfium/fpdfsdk/fpdf_edittext.cpp index c38873faa..aa3287ef4 100644 --- a/pdfium/fpdfsdk/fpdf_edittext.cpp |