7b0e383
From a74837a0e7c7259e4396aa5f05cf1384e256db35 Mon Sep 17 00:00:00 2001
7b0e383
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
7b0e383
Date: Mon, 20 Feb 2017 16:04:58 +0000
7b0e383
Subject: [PATCH] Related: tdf#106100 recover mangled svg in presentations
7b0e383
7b0e383
Change-Id: I77b452aa69a8341aa30e1e93d0d5ee8160533095
7b0e383
---
7b0e383
 svgio/Module_svgio.mk                 |  4 ----
7b0e383
 svgio/source/svgreader/svgsvgnode.cxx | 27 +++------------------------
7b0e383
 2 files changed, 3 insertions(+), 28 deletions(-)
7b0e383
7b0e383
diff --git a/svgio/Module_svgio.mk b/svgio/Module_svgio.mk
7b0e383
index 29ef97d..8b827fc 100644
7b0e383
--- a/svgio/Module_svgio.mk
7b0e383
+++ b/svgio/Module_svgio.mk
7b0e383
@@ -22,8 +22,4 @@ $(eval $(call gb_Module_add_targets,svgio,\
7b0e383
     Library_svgio \
7b0e383
 ))
7b0e383
 
7b0e383
-$(eval $(call gb_Module_add_check_targets,svgio,\
7b0e383
-    CppunitTest_svgio \
7b0e383
-))
7b0e383
-
7b0e383
 # vim: set noet ts=4 sw=4:
7b0e383
diff --git a/svgio/source/svgreader/svgsvgnode.cxx b/svgio/source/svgreader/svgsvgnode.cxx
7b0e383
index 7800666..087c621 100644
7b0e383
--- a/svgio/source/svgreader/svgsvgnode.cxx
7b0e383
+++ b/svgio/source/svgreader/svgsvgnode.cxx
7b0e383
@@ -522,32 +522,11 @@ namespace svgio
7b0e383
                                 }
7b0e383
                                 else
7b0e383
                                 {
7b0e383
-                                    // There exists no parent to resolve relative width or height.
7b0e383
-                                    // Use child size as fallback and expand to aspect ratio given
7b0e383
-                                    // by the viewBox. No mapping.
7b0e383
-                                    // We get viewport >= content, therefore no clipping.
7b0e383
-                                    bNeedsMapping = false;
7b0e383
-                                    const basegfx::B2DRange aChildRange(
7b0e383
-                                        aSequence.getB2DRange(
7b0e383
-                                            drawinglayer::geometry::ViewInformation2D()));
7b0e383
-                                    const double fChildWidth(aChildRange.getWidth());
7b0e383
-                                    const double fChildHeight(aChildRange.getHeight());
7b0e383
-                                    const double fLeft(aChildRange.getMinX());
7b0e383
-                                    const double fTop(aChildRange.getMinY());
7b0e383
-                                    if ( fChildWidth / fViewBoxWidth > fChildHeight / fViewBoxHeight )
7b0e383
-                                    {  // expand y
7b0e383
-                                        fW = fChildWidth;
7b0e383
-                                        fH = fChildWidth / fViewBoxRatio;
7b0e383
-                                    }
7b0e383
-                                    else
7b0e383
-                                    {  // expand x
7b0e383
-                                        fH = fChildHeight;
7b0e383
-                                        fW = fChildHeight * fViewBoxRatio;
7b0e383
-                                    }
7b0e383
-                                    aSvgCanvasRange = basegfx::B2DRange(fLeft, fTop, fLeft + fW, fTop + fH);
7b0e383
+                                    fW = fViewBoxWidth;
7b0e383
+                                    fH = fViewBoxHeight;
7b0e383
+                                    aSvgCanvasRange = basegfx::B2DRange(0.0, 0.0, fW, fH);
7b0e383
                                 }
7b0e383
 
7b0e383
-
7b0e383
                                 if (bNeedsMapping)
7b0e383
                                 {
7b0e383
                                     // create mapping
7b0e383
-- 
7b0e383
2.9.3
7b0e383