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

Miklos Vajna vmiklos at collabora.co.uk
Mon Dec 23 09:27:14 PST 2013


 sw/qa/extras/ooxmlexport/data/relorientation.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlexport.cxx          |   12 ++++++++++++
 sw/source/filter/ww8/docxsdrexport.cxx            |    4 ++++
 3 files changed, 16 insertions(+)

New commits:
commit 4e49887bee01133a349447a00341c0293f8a5899
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Mon Dec 23 17:58:59 2013 +0100

    DOCX export: fix relativeFrom=page, align=right handling
    
    This is the export part of 51a61bd4aca15c860d301b687d582a39193089e2.
    
    Change-Id: I9f7459e99ada8f5f73e9075d249c4e508c941d44

diff --git a/sw/qa/extras/ooxmlexport/data/relorientation.docx b/sw/qa/extras/ooxmlexport/data/relorientation.docx
new file mode 100644
index 0000000..d71148b
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/relorientation.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 10ab77b..15ca09e 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -2163,6 +2163,18 @@ DECLARE_OOXMLEXPORT_TEST(testFileOpenInputOutputError,"floatingtbl_with_formula.
       assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:pStyle", "val", "Normal");
 }
 
+DECLARE_OOXMLEXPORT_TEST(testRelorientation, "relorientation.docx")
+{
+    uno::Reference<drawing::XShape> xShape = getShape(1);
+    // This was text::RelOrientation::FRAME, when handling relativeFrom=page, align=right
+    CPPUNIT_ASSERT_EQUAL(text::RelOrientation::PAGE_RIGHT, getProperty<sal_Int16>(xShape, "HoriOrientRelation"));
+
+    uno::Reference<drawing::XShapes> xGroup(xShape, uno::UNO_QUERY);
+    // This resulted in lang::IndexOutOfBoundsException, as nested groupshapes weren't handled.
+    uno::Reference<drawing::XShapeDescriptor> xShapeDescriptor(xGroup->getByIndex(0), uno::UNO_QUERY);
+    CPPUNIT_ASSERT_EQUAL(OUString("com.sun.star.drawing.GroupShape"), xShapeDescriptor->getShapeType());
+}
+
 #endif
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/source/filter/ww8/docxsdrexport.cxx b/sw/source/filter/ww8/docxsdrexport.cxx
index e030a81..a714e55 100644
--- a/sw/source/filter/ww8/docxsdrexport.cxx
+++ b/sw/source/filter/ww8/docxsdrexport.cxx
@@ -153,6 +153,10 @@ void DocxSdrExport::startDMLAnchorInline(const SwFrmFmt* pFrmFmt, const Size& rS
         case text::RelOrientation::CHAR:
             relativeFromH = "character";
             break;
+        case text::RelOrientation::PAGE_RIGHT:
+            relativeFromH = "page";
+            alignH = "right";
+            break;
         case text::RelOrientation::FRAME:
         default:
             relativeFromH = "column";


More information about the Libreoffice-commits mailing list