[Libreoffice-commits] core.git: 2 commits - oox/source sw/qa

László Németh laszlo.nemeth at collabora.com
Wed May 6 15:23:12 PDT 2015


 oox/source/vml/vmlshape.cxx                 |    9 +++++++--
 sw/qa/extras/ooxmlimport/data/tdf91122.docx |binary
 sw/qa/extras/ooxmlimport/ooxmlimport.cxx    |   13 +++++++++++++
 3 files changed, 20 insertions(+), 2 deletions(-)

New commits:
commit 8981041eb61ac703921784e1df9e9435c053d04f
Author: László Németh <laszlo.nemeth at collabora.com>
Date:   Wed May 6 23:29:38 2015 +0200

    tdf#91122 unit test for docx import with wrong vertical position
    
    Change-Id: Id268393bf28a6edb4a481d7a74ae412b337b3fc8

diff --git a/sw/qa/extras/ooxmlimport/data/tdf91122.docx b/sw/qa/extras/ooxmlimport/data/tdf91122.docx
new file mode 100644
index 0000000..688f882
Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/tdf91122.docx differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 0a5aa3f..cdf5b1b 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -869,6 +869,19 @@ DECLARE_OOXMLIMPORT_TEST(testN779627b, "n779627b.docx")
     CPPUNIT_ASSERT_EQUAL_MESSAGE("Not centered vertically relatively to page", text::RelOrientation::PAGE_FRAME, nValue);
 }
 
+DECLARE_OOXMLIMPORT_TEST(testTDF91122, "tdf91122.docx")
+{
+    /*
+     * OLE object shape: default vertical position is top in MSO, not bottom
+     */
+    uno::Reference<beans::XPropertySet> xShapeProperties( getShape(1), uno::UNO_QUERY );
+    uno::Reference<drawing::XShapeDescriptor> xShapeDescriptor(xShapeProperties, uno::UNO_QUERY);
+    CPPUNIT_ASSERT_EQUAL(OUString("FrameShape"), xShapeDescriptor->getShapeType());
+    sal_Int16 nValue;
+    xShapeProperties->getPropertyValue("VertOrient") >>= nValue;
+    CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong vertical orientation", text::VertOrientation::TOP, nValue);
+}
+
 DECLARE_OOXMLIMPORT_TEST(testFdo74357, "fdo74357.docx")
 {
     // Floating table wasn't converted to a textframe.
commit 3f1cbf94cb3ef743295eb7dcc8ed97e6252828ec
Author: László Németh <laszlo.nemeth at collabora.com>
Date:   Wed May 6 23:26:50 2015 +0200

    tdf#91122 docx import: fix wrong vertical position of OLE object shape
    
    Change-Id: I34cdae7182631ca2d6e86f94f244e9362fe9dc6b

diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx
index 988923c..6342140 100644
--- a/oox/source/vml/vmlshape.cxx
+++ b/oox/source/vml/vmlshape.cxx
@@ -1076,8 +1076,13 @@ Reference< XShape > ComplexShape::implConvertAndInsert( const Reference< XShapes
 
     // try to create a picture object
     if( !aGraphicPath.isEmpty() )
-        return SimpleShape::createPictureObject(rxShapes, rShapeRect, aGraphicPath);
-
+    {
+        Reference< XShape > xShape = SimpleShape::createPictureObject(rxShapes, rShapeRect, aGraphicPath);
+        // AS_CHARACTER shape: vertical orientation default is bottom, MSO default is top.
+        if ( maTypeModel.maPosition != "absolute" && maTypeModel.maPosition != "relative" )
+            PropertySet( xShape ).setAnyProperty( PROP_VertOrient, makeAny(text::VertOrientation::TOP));
+        return xShape;
+    }
     // default: try to create a custom shape
     return CustomShape::implConvertAndInsert( rxShapes, rShapeRect );
 }


More information about the Libreoffice-commits mailing list