diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2020-12-01 21:02:54 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2020-12-02 09:07:51 +0100 |
commit | 0e072c8225e747267eeb915ac88b33b7201df210 (patch) | |
tree | 43bb7c642f61cdea9b17ab1558af7274ad0055c7 /svx | |
parent | 4d7ad433c6ebd9fbcac480ebdd00af933a437df5 (diff) |
pdfium: introduce an enum class for path segment types
Towards not including fpdf_edit.h in PDFiumLibrary client code.
Change-Id: Iffdd11b0613399f31a3ed383c22b7a91059b83de
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107011
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/svdraw/svdpdf.cxx | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/svx/source/svdraw/svdpdf.cxx b/svx/source/svdraw/svdpdf.cxx index db83863b001a..47ea46c62801 100644 --- a/svx/source/svdraw/svdpdf.cxx +++ b/svx/source/svdraw/svdpdf.cxx @@ -964,14 +964,14 @@ void ImpSdrPdfImport::ImportPath(std::unique_ptr<vcl::pdf::PDFiumPageObject> con aB2DPoint.setX(aPoint.X()); aB2DPoint.setY(aPoint.Y()); - const int nSegmentType = pPathSegment->getType(); - switch (nSegmentType) + const vcl::pdf::PDFSegmentType eSegmentType = pPathSegment->getType(); + switch (eSegmentType) { - case FPDF_SEGMENT_LINETO: + case vcl::pdf::PDFSegmentType::Lineto: aPoly.append(aB2DPoint); break; - case FPDF_SEGMENT_BEZIERTO: + case vcl::pdf::PDFSegmentType::Bezierto: aBezier.emplace_back(aB2DPoint.getX(), aB2DPoint.getY()); if (aBezier.size() == 3) { @@ -980,7 +980,7 @@ void ImpSdrPdfImport::ImportPath(std::unique_ptr<vcl::pdf::PDFiumPageObject> con } break; - case FPDF_SEGMENT_MOVETO: + case vcl::pdf::PDFSegmentType::Moveto: // New Poly. if (aPoly.count() > 0) { @@ -991,9 +991,10 @@ void ImpSdrPdfImport::ImportPath(std::unique_ptr<vcl::pdf::PDFiumPageObject> con aPoly.append(aB2DPoint); break; - case FPDF_SEGMENT_UNKNOWN: + case vcl::pdf::PDFSegmentType::Unknown: default: - SAL_WARN("sd.filter", "Unknown path segment type in PDF: " << nSegmentType); + SAL_WARN("sd.filter", "Unknown path segment type in PDF: " + << static_cast<int>(eSegmentType)); break; } } |