summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2014-08-17 18:12:16 +0200
committerAndras Timar <andras.timar@collabora.com>2014-08-21 21:24:42 +0200
commitd00cbe4e2175c03b5b63e7822c6c43ae27f93259 (patch)
treea8f03ffa91cf8a384190d655b33967553325c6b8 /sw/qa
parent0ffc9157ada9c82f0dea3b047fb67548a997aaa7 (diff)
fix reading a .doc that has frame anchored to the end of page (bnc#787942)
MSWord, unlike Writer, can anchor even to a page break (i.e. after the last paragraph). When this document was read, what happended was: - the last paragraph was read and the current position PaM was set to point after it - frame was read and anchored to the PaM - page break was read, making everything following be moved to the next page; including whatever ended up at the PaM position Handle this by checking for this case and inserting an extra empty paragraph before the break. This shouldn't affect layout of the page itself anyway, since the break should leave room for it (and MSWord shows a page break there if control characters are enabled, so there is room). Change-Id: Ia2a13bf5cf1c959b5aa228254365019a00a22679 (cherry picked from commit 4a1888a97eab4ead2e0bec76cd1cba410a8e7e13) Reviewed-on: https://gerrit.libreoffice.org/10952 Reviewed-by: Matúš Kukan <matus.kukan@collabora.com> Tested-by: Matúš Kukan <matus.kukan@collabora.com>
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/extras/ww8import/data/bnc787942.docbin0 -> 24064 bytes
-rw-r--r--sw/qa/extras/ww8import/ww8import.cxx7
2 files changed, 7 insertions, 0 deletions
diff --git a/sw/qa/extras/ww8import/data/bnc787942.doc b/sw/qa/extras/ww8import/data/bnc787942.doc
new file mode 100644
index 000000000000..06b2c39f2f84
--- /dev/null
+++ b/sw/qa/extras/ww8import/data/bnc787942.doc
Binary files differ
diff --git a/sw/qa/extras/ww8import/ww8import.cxx b/sw/qa/extras/ww8import/ww8import.cxx
index 6a48abf464c6..1e99ab84c241 100644
--- a/sw/qa/extras/ww8import/ww8import.cxx
+++ b/sw/qa/extras/ww8import/ww8import.cxx
@@ -336,6 +336,13 @@ DECLARE_WW8IMPORT_TEST(testFdp80333, "fdo80333.doc")
#endif
+DECLARE_WW8IMPORT_TEST(testBnc787942, "bnc787942.doc")
+{
+ // The frame ended up on the second page instead of first.
+ parseDump("/root/page[1]/body/txt[4]/anchored");
+}
+
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */