diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2021-01-14 21:20:31 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2021-01-15 08:35:11 +0100 |
commit | 97601533cbef67bfdb5f25dc00d0dda743e8349e (patch) | |
tree | 6eae76971eeff1980c6f82289055b708e6f20621 /vcl/source | |
parent | 61a3aaae61dfb6d9538eeeed4721d44293d737f4 (diff) |
pdfium: add wrapper for FPDF_FILLMODE_* defines
Which is, I think, the last direct pdfium usage outside vcl.
Change-Id: I2e435e5a3669c6163bf2c20bc6d1d8bd4c88cecd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109314
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/pdf/PDFiumLibrary.cxx | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/vcl/source/pdf/PDFiumLibrary.cxx b/vcl/source/pdf/PDFiumLibrary.cxx index 755c19684183..bdd3fed7b4d4 100644 --- a/vcl/source/pdf/PDFiumLibrary.cxx +++ b/vcl/source/pdf/PDFiumLibrary.cxx @@ -107,6 +107,13 @@ static_assert(static_cast<int>(vcl::pdf::PDFTextRenderMode::FillStrokeClip) static_assert(static_cast<int>(vcl::pdf::PDFTextRenderMode::Clip) == FPDF_TEXTRENDERMODE_CLIP, "PDFTextRenderMode::Clip value mismatch"); +static_assert(static_cast<int>(vcl::pdf::PDFFillMode::None) == FPDF_FILLMODE_NONE, + "PDFFillMode::None value mismatch"); +static_assert(static_cast<int>(vcl::pdf::PDFFillMode::Alternate) == FPDF_FILLMODE_ALTERNATE, + "PDFFillMode::Alternate value mismatch"); +static_assert(static_cast<int>(vcl::pdf::PDFFillMode::Winding) == FPDF_FILLMODE_WINDING, + "PDFFillMode::Winding value mismatch"); + namespace { /// Callback class to be used with FPDF_SaveWithVersion(). @@ -704,6 +711,16 @@ std::unique_ptr<PDFiumBitmap> PDFiumPageObject::getImageBitmap() return pPDFiumBitmap; } +bool PDFiumPageObject::getDrawMode(PDFFillMode& rFillMode, bool& rStroke) +{ + auto nFillMode = static_cast<int>(rFillMode); + auto bStroke = static_cast<FPDF_BOOL>(rStroke); + bool bRet = FPDFPath_GetDrawMode(mpPageObject, &nFillMode, &bStroke); + rFillMode = static_cast<PDFFillMode>(nFillMode); + rStroke = static_cast<bool>(bStroke); + return bRet; +} + BitmapChecksum PDFiumPage::getChecksum(int nMDPPerm) { size_t nPageWidth = getWidth(); |