summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2013-12-05 18:20:51 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2013-12-05 18:34:54 +0100
commit31c65a129afb3c1bf14a1acd88c60b64d4f555d1 (patch)
tree02eb7ff34f06b8527aad655c3851947ec25c3a2d /sw
parentb780e0c263edf7124d261a616a5daed723cc2cf6 (diff)
DOCX import: never call lcl_start/endElement if handling mce elements
The problem was that after handling the mce elements (AlternativeContent, Choice, Fallback) we still invoked the lcl version of these methods and this resulted in duplicated properties in the dmapper, finally resulting in incorrect position of the textbox. Change-Id: Ib581162cba703fc1e2e44c1a9e63358891d6f78c
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/ooxmlimport/data/mce-nested.docxbin0 -> 28318 bytes
-rw-r--r--sw/qa/extras/ooxmlimport/ooxmlimport.cxx10
2 files changed, 10 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlimport/data/mce-nested.docx b/sw/qa/extras/ooxmlimport/data/mce-nested.docx
new file mode 100644
index 000000000000..c110f63dae40
--- /dev/null
+++ b/sw/qa/extras/ooxmlimport/data/mce-nested.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index bd7b1800cad0..d7ce137afe02 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -1583,6 +1583,16 @@ DECLARE_OOXMLIMPORT_TEST(testMceWpg, "mce-wpg.docx")
getParagraphOfText(1, xText, "DML1");
}
+DECLARE_OOXMLIMPORT_TEST(testMceNested, "mce-nested.docx")
+{
+ // Vertical position of the textbox was incorrect due to incorrect nested mce handling.
+ uno::Reference<text::XTextFramesSupplier> xTextFramesSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> xFrame(xIndexAccess->getByIndex(0), uno::UNO_QUERY);
+ // positionV's posOffset from the bugdoc, was 0.
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(EMU_TO_MM100(2514600)), getProperty<sal_Int32>(xFrame, "VertOrientPosition"));
+}
+
DECLARE_OOXMLIMPORT_TEST(testFdo70457, "fdo70457.docx")
{
// The document contains a rotated bitmap