[Libreoffice-commits] core.git: vcl/source

Tomaž Vajngerl tomaz.vajngerl at collabora.co.uk
Sun Jan 7 02:13:46 UTC 2018


 vcl/source/bitmap/BitmapTools.cxx |   13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

New commits:
commit 9707a0017379317069383fd061384a91a8b46281
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
Date:   Sat Jan 6 23:34:44 2018 +0900

    use the rect from all primitives when converting svg to Bitmap
    
    In some cases we assume wrong size in svgio filter which we tried
    to "fix" outside when we render svg to bitmap. This reverts the
    "fix" and is now practically the same when rendering a svg
    graphic (might be good to combine in the future). The fix for
    svgio is fixed in a different commit.
    
    Change-Id: I43ee35d3220b3a750b8f72f22085f6a34b9d26b8
    Reviewed-on: https://gerrit.libreoffice.org/47497
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>

diff --git a/vcl/source/bitmap/BitmapTools.cxx b/vcl/source/bitmap/BitmapTools.cxx
index ff8bf5cbf2d1..f0aa8ccecf33 100644
--- a/vcl/source/bitmap/BitmapTools.cxx
+++ b/vcl/source/bitmap/BitmapTools.cxx
@@ -67,13 +67,10 @@ void loadFromSvg(SvStream& rStream, const OUString& sPath, BitmapEx& rBitmapEx,
 
     uno::Sequence<beans::PropertyValue> aViewParameters;
 
-    const sal_Int32 nCount(aPrimitiveSequence.getLength());
     geometry::RealRectangle2D aRealRect;
     basegfx::B2DRange aRange;
-    for (sal_Int32 a = 0; a < nCount; ++a)
+    for (Primitive2DReference const & xReference : aPrimitiveSequence)
     {
-        const Primitive2DReference xReference(aPrimitiveSequence[a]);
-
         if (xReference.is())
         {
             aRealRect = xReference->getRange(aViewParameters);
@@ -81,10 +78,10 @@ void loadFromSvg(SvStream& rStream, const OUString& sPath, BitmapEx& rBitmapEx,
         }
     }
 
-    aRealRect.X1 = 0;
-    aRealRect.Y1 = 0;
-    aRealRect.X2 = aRange.getMaxX() - aRange.getMinX();
-    aRealRect.Y2 = aRange.getMaxY() - aRange.getMinY();
+    aRealRect.X1 = aRange.getMinX();
+    aRealRect.Y1 = aRange.getMinY();
+    aRealRect.X2 = aRange.getMaxX();
+    aRealRect.Y2 = aRange.getMaxY();
 
     double nDPI = 96 * fScalingFactor;
 


More information about the Libreoffice-commits mailing list