summaryrefslogtreecommitdiff
path: root/sdext/source
diff options
context:
space:
mode:
authorDr. David Alan Gilbert <dave@treblig.org>2024-02-14 00:25:13 +0000
committerNoel Grandin <noel.grandin@collabora.co.uk>2024-02-29 08:28:08 +0100
commit784696e47c7f28dac111b95e61f06a9a1f7cdc97 (patch)
treec28cea68b54fbeba141be768d0cdb812425b842f /sdext/source
parent4b295b1b77b33c9a5b5fcfab58132ca0dcb7f90b (diff)
tdf#113050 sdext.pdfimport: Add TileWidth and TileHeight fields
We need to scale the tiled image that fills our polygon, so add width and height fields, we'll fill in and process them in subsequent patches. Change-Id: Ib0000066170ccbc0f4a4c971e1d6df72c3f7df14 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163573 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sdext/source')
-rw-r--r--sdext/source/pdfimport/inc/genericelements.hxx11
-rw-r--r--sdext/source/pdfimport/tree/genericelements.cxx8
-rw-r--r--sdext/source/pdfimport/tree/pdfiprocessor.cxx8
3 files changed, 18 insertions, 9 deletions
diff --git a/sdext/source/pdfimport/inc/genericelements.hxx b/sdext/source/pdfimport/inc/genericelements.hxx
index 4332d4f1372b..705773b9893a 100644
--- a/sdext/source/pdfimport/inc/genericelements.hxx
+++ b/sdext/source/pdfimport/inc/genericelements.hxx
@@ -213,7 +213,8 @@ namespace pdfi
friend class ElementFactory;
PolyPolyElement( Element* pParent, sal_Int32 nGCId,
const basegfx::B2DPolyPolygon& rPolyPoly,
- sal_Int8 nAction, ImageId nFillImage );
+ sal_Int8 nAction, ImageId nFillImage,
+ double nTileWidth, double nTileHeight );
public:
virtual void visitedBy( ElementTreeVisitor&, const std::list< std::unique_ptr<Element> >::const_iterator& rParentIt ) override;
@@ -226,6 +227,8 @@ namespace pdfi
basegfx::B2DPolyPolygon PolyPoly;
sal_Int8 Action;
ImageId FillImage;
+ double TileWidth;
+ double TileHeight;
};
struct ImageElement final : public DrawElement
@@ -300,8 +303,10 @@ namespace pdfi
createPolyPolyElement( Element* pParent,
sal_Int32 nGCId,
const basegfx::B2DPolyPolygon& rPolyPoly,
- sal_Int8 nAction, ImageId nFillImage )
- { return new PolyPolyElement( pParent, nGCId, rPolyPoly, nAction, nFillImage ); }
+ sal_Int8 nAction, ImageId nFillImage,
+ double nTileWidth, double nTileHeight )
+ { return new PolyPolyElement( pParent, nGCId, rPolyPoly, nAction,
+ nFillImage, nTileWidth, nTileHeight ); }
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 100e145608aa..aec9c999fcf6 100644
--- a/sdext/source/pdfimport/tree/genericelements.cxx
+++ b/sdext/source/pdfimport/tree/genericelements.cxx
@@ -125,11 +125,15 @@ PolyPolyElement::PolyPolyElement( Element* pParent,
sal_Int32 nGCId,
const basegfx::B2DPolyPolygon& rPolyPoly,
sal_Int8 nAction,
- ImageId nFillImage )
+ ImageId nFillImage,
+ double nTileWidth,
+ double nTileHeight )
: DrawElement( pParent, nGCId ),
PolyPoly( rPolyPoly ),
Action( nAction ),
- FillImage( nFillImage )
+ FillImage( nFillImage ),
+ TileWidth( nTileWidth ),
+ TileHeight( nTileHeight )
{
}
diff --git a/sdext/source/pdfimport/tree/pdfiprocessor.cxx b/sdext/source/pdfimport/tree/pdfiprocessor.cxx
index 0ef30a176ed2..6f4b45f21a40 100644
--- a/sdext/source/pdfimport/tree/pdfiprocessor.cxx
+++ b/sdext/source/pdfimport/tree/pdfiprocessor.cxx
@@ -433,7 +433,7 @@ void PDFIProcessor::tilingPatternFill(int nX0, int nY0, int nX1, int nY1,
getGCId(getCurrentContext()),
aB2DPoly,
PATH_EOFILL, // Hmm how do I know if this should be EO or not?
- nTile );
+ nTile, 0, 0 );
pPolyElement->updateGeometry();
pPolyElement->ZOrder = m_nNextZOrder++;
}
@@ -448,7 +448,7 @@ void PDFIProcessor::strokePath( const uno::Reference< rendering::XPolyPolygon2D
getGCId(getCurrentContext()),
aPoly,
PATH_STROKE,
- -1 );
+ -1, 0, 0 );
pPoly->updateGeometry();
pPoly->ZOrder = m_nNextZOrder++;
}
@@ -463,7 +463,7 @@ void PDFIProcessor::fillPath( const uno::Reference< rendering::XPolyPolygon2D >&
getGCId(getCurrentContext()),
aPoly,
PATH_FILL,
- -1 );
+ -1, 0, 0 );
pPoly->updateGeometry();
pPoly->ZOrder = m_nNextZOrder++;
}
@@ -478,7 +478,7 @@ void PDFIProcessor::eoFillPath( const uno::Reference< rendering::XPolyPolygon2D
getGCId(getCurrentContext()),
aPoly,
PATH_EOFILL,
- -1 );
+ -1, 0, 0 );
pPoly->updateGeometry();
pPoly->ZOrder = m_nNextZOrder++;
}