sdext/source/pdfimport/inc/genericelements.hxx  |   11 ++++++++---
 sdext/source/pdfimport/tree/genericelements.cxx |    8 ++++++--
 sdext/source/pdfimport/tree/pdfiprocessor.cxx   |    8 ++++----
 3 files changed, 18 insertions(+), 9 deletions(-)

New commits:
commit 784696e47c7f28dac111b95e61f06a9a1f7cdc97
Author:     Dr. David Alan Gilbert <d...@treblig.org>
AuthorDate: Wed Feb 14 00:25:13 2024 +0000
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Thu Feb 29 08:28:08 2024 +0100

    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.gran...@collabora.co.uk>

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++;
 }

Reply via email to