summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorCédric Bosdonnat <cedric.bosdonnat@free.fr>2013-04-29 15:41:37 +0200
committerCédric Bosdonnat <cedric.bosdonnat@free.fr>2013-04-29 16:37:11 +0200
commit51d5e90b7c09cb980bc72a2c6b1a65303ef15ea2 (patch)
treec8533c7b37c536956642c1ad1c4e6305628915c6 /sw
parentea6b7347767a05fa63853964a6868719898799da (diff)
n#592908: docx import, fixed handling of w10:wrap
commit f837c4288cdae4921b3fb6747ba2e2cd5ce2dcd2 moved the handling of w10:wrap tag in oox, but thus no wrapping was imported any more. The fix consists in letting the w10:wrap element be handled by writerfilter's dmapper if the shape has already been retrieved from oox (which is the case for textboxes). In other cases, make sure that we don't set the Surround property once again in writerfilter as that would override what has been done in oox. Change-Id: I8ab158641afcf6b9945c52238e7f5adb9e8b3adf
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/ooxmlimport/data/n592908-frame.docxbin0 -> 13589 bytes
-rw-r--r--sw/qa/extras/ooxmlimport/data/n592908-picture.docxbin0 -> 62593 bytes
-rw-r--r--sw/qa/extras/ooxmlimport/ooxmlimport.cxx24
3 files changed, 24 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlimport/data/n592908-frame.docx b/sw/qa/extras/ooxmlimport/data/n592908-frame.docx
new file mode 100644
index 000000000000..ff59cacbad79
--- /dev/null
+++ b/sw/qa/extras/ooxmlimport/data/n592908-frame.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlimport/data/n592908-picture.docx b/sw/qa/extras/ooxmlimport/data/n592908-picture.docx
new file mode 100644
index 000000000000..2766d3691cdd
--- /dev/null
+++ b/sw/qa/extras/ooxmlimport/data/n592908-picture.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 3f5a07064a75..54a14786efd5 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -114,6 +114,8 @@ public:
void testFdo53985();
void testFdo59638();
void testFdo61343();
+ void testN592908_Frame();
+ void testN592908_Picture();
CPPUNIT_TEST_SUITE(Test);
#if !defined(MACOSX) && !defined(WNT)
@@ -180,6 +182,8 @@ void Test::run()
{"fdo53985.docx", &Test::testFdo53985},
{"fdo59638.docx", &Test::testFdo59638},
{"fdo61343.docx", &Test::testFdo61343},
+ {"n592908-frame.docx", &Test::testN592908_Frame},
+ {"n592908-picture.docx", &Test::testN592908_Picture},
};
for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i)
{
@@ -1132,6 +1136,26 @@ void Test::testFdo61343()
CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xDraws->getCount());
}
+void Test::testN592908_Frame()
+{
+ uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> xPropertySet(xDraws->getByIndex(0), uno::UNO_QUERY);
+ text::WrapTextMode eValue;
+ xPropertySet->getPropertyValue("Surround") >>= eValue;
+ CPPUNIT_ASSERT_EQUAL(eValue, text::WrapTextMode_PARALLEL);
+}
+
+void Test::testN592908_Picture()
+{
+ uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> xPropertySet(xDraws->getByIndex(0), uno::UNO_QUERY);
+ text::WrapTextMode eValue;
+ xPropertySet->getPropertyValue("Surround") >>= eValue;
+ CPPUNIT_ASSERT_EQUAL(eValue, text::WrapTextMode_PARALLEL);
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
CPPUNIT_PLUGIN_IMPLEMENT();