tdf#113050 sdext.pdfimport: Set and write TileWidth/Height

Set the tile width/height from the step size and write it into the
draw:fill-image-width/height properties.

Change-Id: I70d69a6d5e77929bd14282731dd68d3bcafa9c1a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163574
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
diff --git a/sdext/source/pdfimport/tree/drawtreevisiting.cxx b/sdext/source/pdfimport/tree/drawtreevisiting.cxx
index 2c02adde..7897dba 100644
--- a/sdext/source/pdfimport/tree/drawtreevisiting.cxx
+++ b/sdext/source/pdfimport/tree/drawtreevisiting.cxx
@@ -826,6 +826,8 @@ void DrawXmlFinalizer::visit( PolyPolyElement& elem, const std::list< std::uniqu
        aGCProps[ "draw:fill-image-name" ] =
            m_rStyleContainer.getStyleName(
            m_rStyleContainer.getStyleId(style));
        aGCProps[ "draw:fill-image-width" ] = unitMMString(convPx2mm(elem.TileWidth));
        aGCProps[ "draw:fill-image-height" ] = unitMMString(convPx2mm(elem.TileHeight));

    }

diff --git a/sdext/source/pdfimport/tree/pdfiprocessor.cxx b/sdext/source/pdfimport/tree/pdfiprocessor.cxx
index 6f4b45f..2483144 100644
--- a/sdext/source/pdfimport/tree/pdfiprocessor.cxx
+++ b/sdext/source/pdfimport/tree/pdfiprocessor.cxx
@@ -428,12 +428,17 @@ void PDFIProcessor::tilingPatternFill(int nX0, int nY0, int nX1, int nY1,
    }
    // TODO: That clipping might shift the fill pattern offsets

    double transformedxStep = nxStep * rMat.m00 + nyStep * rMat.m01;
    double transformedyStep = nxStep * rMat.m10 + nyStep * rMat.m11;

    auto pPolyElement = ElementFactory::createPolyPolyElement(
        m_pCurElement,
        getGCId(getCurrentContext()),
        aB2DPoly,
        PATH_EOFILL, // Hmm how do I know if this should be EO or not?
        nTile, 0, 0 );
        nTile,
        transformedxStep * aScale.getX(),
        transformedyStep * -aScale.getY());
    pPolyElement->updateGeometry();
    pPolyElement->ZOrder = m_nNextZOrder++;
}
diff --git a/sdext/source/pdfimport/tree/writertreevisiting.cxx b/sdext/source/pdfimport/tree/writertreevisiting.cxx
index 746fc9e..9012aaa 100644
--- a/sdext/source/pdfimport/tree/writertreevisiting.cxx
+++ b/sdext/source/pdfimport/tree/writertreevisiting.cxx
@@ -1004,7 +1004,8 @@ void WriterXmlFinalizer::visit( PolyPolyElement& elem, const std::list< std::uni
        aGCProps[ "draw:fill-image-name" ] =
            m_rStyleContainer.getStyleName(
            m_rStyleContainer.getStyleId(style));

        aGCProps[ "draw:fill-image-width" ] = unitMMString(convPx2mm(elem.TileWidth));
        aGCProps[ "draw:fill-image-height" ] = unitMMString(convPx2mm(elem.TileHeight));
    }

    // TODO(F1): check whether stuff could be emulated by gradient/bitmap/hatch