summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2015-09-28 09:03:13 +0200
committerCaolán McNamara <caolanm@redhat.com>2015-10-08 11:28:18 +0000
commitf98d09c8325c642f0463f2e65ff57be0498e9c23 (patch)
treef2b560a132249a6bd8eed17e3709036cb172e284 /sw
parentf7e8fe2a4b0c2554200b1191cf4497c0ece8dbeb (diff)
tdf#90153 DOCX import: fix default sw TextFrame roundtrip
The AnchorType of the shape was at-paragraph, which does not allow line-level VertOrientRelation (which is correct, it would be undefined, what line of the paragraph should be the used). Fix this by changing the AnchorType to at-character in the line-level case, which brings the filter in sync with the DOC one. With this, import of a DOCX file that was created by inserting a TextFrame into an empty document is roundtripped without shifting the shape up considerably. (cherry-picked from commit 358666e4204364ce915ee95372dc6f2fca545253) Conflicts: sw/qa/extras/ooxmlimport/ooxmlimport.cxx Change-Id: I6d85c38be859d6e730584f2349c857b87496a1d4 Reviewed-on: https://gerrit.libreoffice.org/19099 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/ooxmlimport/data/tdf90153.docxbin0 -> 4856 bytes
-rw-r--r--sw/qa/extras/ooxmlimport/ooxmlimport.cxx6
2 files changed, 6 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlimport/data/tdf90153.docx b/sw/qa/extras/ooxmlimport/data/tdf90153.docx
new file mode 100644
index 000000000000..decbfa29d3b9
--- /dev/null
+++ b/sw/qa/extras/ooxmlimport/data/tdf90153.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index b00b53254e68..dc460b55fd5b 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -2795,6 +2795,12 @@ DECLARE_OOXMLIMPORT_TEST(testTdf92124, "tdf92124.docx")
CPPUNIT_ASSERT(aSuffix.isEmpty());
}
+DECLARE_OOXMLIMPORT_TEST(testTdf90153, "tdf90153.docx")
+{
+ // This was at-para, so the line-level VertOrientRelation was lost, resulting in an incorrect vertical position.
+ CPPUNIT_ASSERT_EQUAL(text::TextContentAnchorType_AT_CHARACTER, getProperty<text::TextContentAnchorType>(getShape(1), "AnchorType"));
+}
+
#endif
CPPUNIT_PLUGIN_IMPLEMENT();