summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf103573.docxbin0 -> 16155 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport9.cxx19
-rw-r--r--sw/source/filter/ww8/docxsdrexport.cxx6
3 files changed, 23 insertions, 2 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf103573.docx b/sw/qa/extras/ooxmlexport/data/tdf103573.docx
new file mode 100644
index 000000000000..34d7e3367d9e
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf103573.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
index 5ee0ff47884f..a580bc99bc49 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
@@ -18,6 +18,8 @@
#include <com/sun/star/text/XTextEmbeddedObjectsSupplier.hpp>
#include <com/sun/star/text/XTextViewCursorSupplier.hpp>
#include <com/sun/star/graphic/XGraphic.hpp>
+#include <com/sun/star/text/HoriOrientation.hpp>
+#include <com/sun/star/text/RelOrientation.hpp>
class Test : public SwModelTestBase
{
@@ -85,6 +87,23 @@ DECLARE_OOXMLEXPORT_TEST(testTdf103544, "tdf103544.docx")
CPPUNIT_ASSERT(xGraphic.is());
}
+DECLARE_OOXMLEXPORT_TEST(testTdf103573, "tdf103573.docx")
+{
+ // Relative positions to the left or right margin (MS Word naming) was not handled.
+ uno::Reference<beans::XPropertySet> xShapeProperties( getShape(1), uno::UNO_QUERY );
+ sal_Int16 nValue;
+ xShapeProperties->getPropertyValue("HoriOrient") >>= nValue;
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Not centered horizontally", text::HoriOrientation::CENTER, nValue);
+ xShapeProperties->getPropertyValue("HoriOrientRelation") >>= nValue;
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Not centered horizontally relatively to left page border", text::RelOrientation::PAGE_LEFT, nValue);
+
+ xShapeProperties.set( getShape(2), uno::UNO_QUERY );
+ xShapeProperties->getPropertyValue("HoriOrient") >>= nValue;
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Not centered horizontally", text::HoriOrientation::CENTER, nValue);
+ xShapeProperties->getPropertyValue("HoriOrientRelation") >>= nValue;
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Not centered horizontally relatively to right page border", text::RelOrientation::PAGE_RIGHT, nValue);
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/filter/ww8/docxsdrexport.cxx b/sw/source/filter/ww8/docxsdrexport.cxx
index 163f45c145d9..0fe507fd39a1 100644
--- a/sw/source/filter/ww8/docxsdrexport.cxx
+++ b/sw/source/filter/ww8/docxsdrexport.cxx
@@ -444,8 +444,10 @@ void DocxSdrExport::startDMLAnchorInline(const SwFrameFormat* pFrameFormat, cons
relativeFromH = "character";
break;
case text::RelOrientation::PAGE_RIGHT:
- relativeFromH = "page";
- alignH = "right";
+ relativeFromH = "rightMargin";
+ break;
+ case text::RelOrientation::PAGE_LEFT:
+ relativeFromH = "leftMargin";
break;
case text::RelOrientation::FRAME:
default: