summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDr. David Alan Gilbert <dave@treblig.org>2024-02-12 01:14:06 +0000
committerNoel Grandin <noel.grandin@collabora.co.uk>2024-02-29 08:26:40 +0100
commit2bf5664823e7ef71d917fe95a2c3d92e46d77c32 (patch)
treefecfade02803a5027fb9cb17edee5cf9d0531aa2
parentd7e5eae44e18ab89e85a0e6ed633853ede70ec71 (diff)
tdf#113050 sdext.pdfimport: Add FillImage field to PolyPolyElement
Use -1 to mean the existing solid fill, otherwise it's the ID of the image to use as the fill. Change-Id: I596c26145f5285f75af631a3bb7ddf09600982a6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163570 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--sdext/source/pdfimport/inc/genericelements.hxx7
-rw-r--r--sdext/source/pdfimport/tree/genericelements.cxx6
-rw-r--r--sdext/source/pdfimport/tree/pdfiprocessor.cxx15
3 files changed, 18 insertions, 10 deletions
diff --git a/sdext/source/pdfimport/inc/genericelements.hxx b/sdext/source/pdfimport/inc/genericelements.hxx
index 6d1459a1f032..4332d4f1372b 100644
--- a/sdext/source/pdfimport/inc/genericelements.hxx
+++ b/sdext/source/pdfimport/inc/genericelements.hxx
@@ -213,7 +213,7 @@ namespace pdfi
friend class ElementFactory;
PolyPolyElement( Element* pParent, sal_Int32 nGCId,
const basegfx::B2DPolyPolygon& rPolyPoly,
- sal_Int8 nAction );
+ sal_Int8 nAction, ImageId nFillImage );
public:
virtual void visitedBy( ElementTreeVisitor&, const std::list< std::unique_ptr<Element> >::const_iterator& rParentIt ) override;
@@ -225,6 +225,7 @@ namespace pdfi
basegfx::B2DPolyPolygon PolyPoly;
sal_Int8 Action;
+ ImageId FillImage;
};
struct ImageElement final : public DrawElement
@@ -299,8 +300,8 @@ namespace pdfi
createPolyPolyElement( Element* pParent,
sal_Int32 nGCId,
const basegfx::B2DPolyPolygon& rPolyPoly,
- sal_Int8 nAction)
- { return new PolyPolyElement( pParent, nGCId, rPolyPoly, nAction ); }
+ sal_Int8 nAction, ImageId nFillImage )
+ { return new PolyPolyElement( pParent, nGCId, rPolyPoly, nAction, nFillImage ); }
static ImageElement* createImageElement( Element* pParent, sal_Int32 nGCId, ImageId nImage )
{ return new ImageElement( pParent, nGCId, nImage ); }
diff --git a/sdext/source/pdfimport/tree/genericelements.cxx b/sdext/source/pdfimport/tree/genericelements.cxx
index 1d11cd0d914e..100e145608aa 100644
--- a/sdext/source/pdfimport/tree/genericelements.cxx
+++ b/sdext/source/pdfimport/tree/genericelements.cxx
@@ -124,10 +124,12 @@ void ImageElement::visitedBy( ElementTreeVisitor& rVisi
PolyPolyElement::PolyPolyElement( Element* pParent,
sal_Int32 nGCId,
const basegfx::B2DPolyPolygon& rPolyPoly,
- sal_Int8 nAction )
+ sal_Int8 nAction,
+ ImageId nFillImage )
: DrawElement( pParent, nGCId ),
PolyPoly( rPolyPoly ),
- Action( nAction )
+ Action( nAction ),
+ FillImage( nFillImage )
{
}
diff --git a/sdext/source/pdfimport/tree/pdfiprocessor.cxx b/sdext/source/pdfimport/tree/pdfiprocessor.cxx
index 32280f8fd110..0ef30a176ed2 100644
--- a/sdext/source/pdfimport/tree/pdfiprocessor.cxx
+++ b/sdext/source/pdfimport/tree/pdfiprocessor.cxx
@@ -389,9 +389,10 @@ void PDFIProcessor::tilingPatternFill(int nX0, int nY0, int nX1, int nY1,
double nxStep, double nyStep,
int /* nPaintType */,
css::geometry::AffineMatrix2D& rMat,
- const css::uno::Sequence<css::beans::PropertyValue>& /*xTile*/)
+ const css::uno::Sequence<css::beans::PropertyValue>& xTile)
{
const GraphicsContext& rGC(getCurrentContext());
+ auto nTile = m_aImages.addImage(xTile);
basegfx::B2DTuple aScale, aTranslation;
double fRotate, fShearX;
@@ -431,7 +432,8 @@ void PDFIProcessor::tilingPatternFill(int nX0, int nY0, int nX1, int nY1,
m_pCurElement,
getGCId(getCurrentContext()),
aB2DPoly,
- PATH_EOFILL ); // Hmm how do I know if this should be EO or not?
+ PATH_EOFILL, // Hmm how do I know if this should be EO or not?
+ nTile );
pPolyElement->updateGeometry();
pPolyElement->ZOrder = m_nNextZOrder++;
}
@@ -445,7 +447,8 @@ void PDFIProcessor::strokePath( const uno::Reference< rendering::XPolyPolygon2D
m_pCurElement,
getGCId(getCurrentContext()),
aPoly,
- PATH_STROKE );
+ PATH_STROKE,
+ -1 );
pPoly->updateGeometry();
pPoly->ZOrder = m_nNextZOrder++;
}
@@ -459,7 +462,8 @@ void PDFIProcessor::fillPath( const uno::Reference< rendering::XPolyPolygon2D >&
m_pCurElement,
getGCId(getCurrentContext()),
aPoly,
- PATH_FILL );
+ PATH_FILL,
+ -1 );
pPoly->updateGeometry();
pPoly->ZOrder = m_nNextZOrder++;
}
@@ -473,7 +477,8 @@ void PDFIProcessor::eoFillPath( const uno::Reference< rendering::XPolyPolygon2D
m_pCurElement,
getGCId(getCurrentContext()),
aPoly,
- PATH_EOFILL );
+ PATH_EOFILL,
+ -1 );
pPoly->updateGeometry();
pPoly->ZOrder = m_nNextZOrder++;
}