[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - oox/source sd/qa

Andras Timar andras.timar at collabora.com
Thu Apr 9 16:25:02 PDT 2015


 oox/source/drawingml/shape.cxx     |   17 +++++++++++++++++
 sd/qa/unit/data/tdf90403.pptx      |binary
 sd/qa/unit/data/xml/tdf90403_0.xml |    4 ++++
 sd/qa/unit/import-tests.cxx        |    1 +
 4 files changed, 22 insertions(+)

New commits:
commit 6322ef95c9d3128ede01d45f1542c6ad03cac392
Author: Andras Timar <andras.timar at collabora.com>
Date:   Thu Apr 2 13:42:11 2015 +0200

    tdf#90403 PPTX import: use real table size
    
    PowerPoint ignores a:ext cx and cy value of p:xfrm, and uses
    real table width and height. PowerPoint 2010 saves files where
    cx and cy contains good values, but I found files in the wild
    whose cx and cy values did not match to actual table width and
    height, and there was a visible difference between rendering
    of Impress and PowerPoint.
    
    Reviewed-on: https://gerrit.libreoffice.org/15123
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Andras Timar <andras.timar at collabora.com>
    (cherry picked from commit 037fe3671cbdad51f52d2f69f72f47f463dba7c2)
    
    Conflicts:
    	oox/source/drawingml/shape.cxx
    	sd/qa/unit/import-tests.cxx
    
    Change-Id: I3f80c0cea4cac46763d449f918bb78dca1a6562d
    Reviewed-on: https://gerrit.libreoffice.org/15133
    Tested-by: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
    Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>

diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index 265eea9..4a56c9e 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -416,6 +416,23 @@ Reference< XShape > Shape::createAndInsert(
     bool bIsEmbMedia = false;
     SAL_INFO("oox.drawingml", OSL_THIS_FUNC << " id: " << msId);
 
+    // tdf#90403 PowerPoint ignores a:ext cx and cy values of p:xfrm, and uses real table width and height
+    if ( mpTablePropertiesPtr.get() && rServiceName == "com.sun.star.drawing.TableShape" )
+    {
+        maSize.Width = 0;
+        for( std::vector< sal_Int32 >::const_iterator aTableColIter(mpTablePropertiesPtr->getTableGrid().begin());
+             aTableColIter != mpTablePropertiesPtr->getTableGrid().end(); aTableColIter++ )
+        {
+            maSize.Width += *aTableColIter;
+        }
+        maSize.Height = 0;
+        for( std::vector< ::oox::drawingml::table::TableRow >::const_iterator aTableRowIter(mpTablePropertiesPtr->getTableRows().begin());
+             aTableRowIter != mpTablePropertiesPtr->getTableRows().end(); aTableRowIter++ )
+        {
+            maSize.Height += (*aTableRowIter).getHeight();
+        }
+    }
+
     awt::Rectangle aShapeRectHmm( maPosition.X / 360, maPosition.Y / 360, maSize.Width / 360, maSize.Height / 360 );
 
     OUString aServiceName;
diff --git a/sd/qa/unit/data/tdf90403.pptx b/sd/qa/unit/data/tdf90403.pptx
new file mode 100644
index 0000000..fd48d05
Binary files /dev/null and b/sd/qa/unit/data/tdf90403.pptx differ
diff --git a/sd/qa/unit/data/xml/tdf90403_0.xml b/sd/qa/unit/data/xml/tdf90403_0.xml
new file mode 100644
index 0000000..297504d
--- /dev/null
+++ b/sd/qa/unit/data/xml/tdf90403_0.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0"?>
+<XShapes>
+ <XShape positionX="4233" positionY="3881" sizeX="16932" sizeY="14044" type="com.sun.star.drawing.TableShape" name="Table 1"/>
+</XShapes>
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index 13b23b7..b52fb0c 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -194,6 +194,7 @@ void SdFiltersTest::testDocumentLayout()
         { "n593612.pptx", "xml/n593612_", -1 },
         { "fdo71434.pptx", "xml/fdo71434_", -1 },
         { "n902652.pptx", "xml/n902652_", -1 },
+        { "tdf90403.pptx", "xml/tdf90403_", -1 },
         // { "pptx/n828390.pptx", "pptx/xml/n828390_", PPTX }, // Example
     };
 


More information about the Libreoffice-commits mailing list