summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/vcl/filter/PDFiumLibrary.hxx1
-rw-r--r--svx/source/svdraw/svdpdf.cxx13
-rw-r--r--vcl/source/pdf/PDFiumLibrary.cxx7
3 files changed, 11 insertions, 10 deletions
diff --git a/include/vcl/filter/PDFiumLibrary.hxx b/include/vcl/filter/PDFiumLibrary.hxx
index aff5ad6ad8af..eee97e39bf9a 100644
--- a/include/vcl/filter/PDFiumLibrary.hxx
+++ b/include/vcl/filter/PDFiumLibrary.hxx
@@ -148,6 +148,7 @@ public:
PDFTextRenderMode getTextRenderMode();
Color getFillColor();
Color getStrokeColor();
+ double getStrokeWidth();
// Path
int getPathSegmentCount();
std::unique_ptr<PDFiumPathSegment> getPathSegment(int index);
diff --git a/svx/source/svdraw/svdpdf.cxx b/svx/source/svdraw/svdpdf.cxx
index 00969a90904c..e266609bd295 100644
--- a/svx/source/svdraw/svdpdf.cxx
+++ b/svx/source/svdraw/svdpdf.cxx
@@ -1007,8 +1007,7 @@ void ImpSdrPdfImport::ImportPath(std::unique_ptr<vcl::pdf::PDFiumPageObject> con
basegfx::utils::createScaleTranslateB2DHomMatrix(mfScaleX, mfScaleY, maOfs.X(), maOfs.Y()));
aPolyPoly.transform(aTransform);
- float fWidth = 1;
- FPDFPageObj_GetStrokeWidth(pPageObject->getPointer(), &fWidth);
+ float fWidth = pPageObject->getStrokeWidth();
const double dWidth = 0.5 * fabs(sqrt2(aPathMatrix.a(), aPathMatrix.c()) * fWidth);
mnLineWidth = convertPointToMm100(dWidth);
@@ -1024,17 +1023,11 @@ void ImpSdrPdfImport::ImportPath(std::unique_ptr<vcl::pdf::PDFiumPageObject> con
mpVD->SetDrawMode(DrawModeFlags::NoFill);
}
- unsigned int nR;
- unsigned int nG;
- unsigned int nB;
- unsigned int nA;
- FPDFPageObj_GetFillColor(pPageObject->getPointer(), &nR, &nG, &nB, &nA);
- mpVD->SetFillColor(Color(nR, nG, nB));
+ mpVD->SetFillColor(pPageObject->getFillColor());
if (bStroke)
{
- FPDFPageObj_GetStrokeColor(pPageObject->getPointer(), &nR, &nG, &nB, &nA);
- mpVD->SetLineColor(Color(nR, nG, nB));
+ mpVD->SetLineColor(pPageObject->getStrokeColor());
}
else
mpVD->SetLineColor(COL_TRANSPARENT);
diff --git a/vcl/source/pdf/PDFiumLibrary.cxx b/vcl/source/pdf/PDFiumLibrary.cxx
index 3165f669f41d..755c19684183 100644
--- a/vcl/source/pdf/PDFiumLibrary.cxx
+++ b/vcl/source/pdf/PDFiumLibrary.cxx
@@ -666,6 +666,13 @@ Color PDFiumPageObject::getStrokeColor()
return aColor;
}
+double PDFiumPageObject::getStrokeWidth()
+{
+ float fWidth = 1;
+ FPDFPageObj_GetStrokeWidth(mpPageObject, &fWidth);
+ return fWidth;
+}
+
int PDFiumPageObject::getPathSegmentCount() { return FPDFPath_CountSegments(mpPageObject); }
std::unique_ptr<PDFiumPathSegment> PDFiumPageObject::getPathSegment(int index)