summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2018-04-26 12:03:12 +0200
committerAndras Timar <andras.timar@collabora.com>2018-04-27 11:15:54 +0200
commited002d7b8de39de81ccd016bc40841b8d2a132dc (patch)
tree8ca6452b9b3ce8519f211c64f46c84706d234e5f /sw
parent909d104b9e144f42087783acda6e71b1c1e54290 (diff)
tdf#117246 RTF import: don't loose page breaks inside nested groups
Regression from e3f254ab8211fbab7541cde2100a35c875b0c240 (RTF import: fix spurious page breaks at doc end (related: rhbz#1065629), 2014-02-27), the problem was that now we update the parser state to remember the next section break should set the break type of the current section to "next page", but this state should be remembered once the RTF group ends ("}" character), otherwise \page will be represented with a continuous break, i.e. lost. (cherry picked from commit 4a93b46e4652e73ed3460e4c66999d94e50db4b7) Conflicts: sw/qa/extras/rtfimport/rtfimport.cxx Change-Id: I69a8413f45e17e11d6d676c7bfd13ca7560b4d43 Reviewed-on: https://gerrit.libreoffice.org/53510 Reviewed-by: Andras Timar <andras.timar@collabora.com> Tested-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/rtfimport/data/tdf117246.rtf11
-rw-r--r--sw/qa/extras/rtfimport/rtfimport.cxx6
2 files changed, 17 insertions, 0 deletions
diff --git a/sw/qa/extras/rtfimport/data/tdf117246.rtf b/sw/qa/extras/rtfimport/data/tdf117246.rtf
new file mode 100644
index 000000000000..a6fc7cf94426
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/tdf117246.rtf
@@ -0,0 +1,11 @@
+{\rtf1
+\sbknone\pard\plain
+{Page 1}
+{\par }
+{\page }
+{Page 2}
+{\par }
+{\page }
+{Page 3}
+{\par }
+}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx
index 18730e123084..5c7f39db475a 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -211,6 +211,12 @@ DECLARE_RTFIMPORT_TEST(testN695479, "n695479.rtf")
CPPUNIT_ASSERT(bDrawFound);
}
+DECLARE_RTFIMPORT_TEST(testTdf117246, "tdf117246.rtf")
+{
+ // This was 2, all but the last \page was lost.
+ CPPUNIT_ASSERT_EQUAL(3, getPages());
+}
+
DECLARE_RTFIMPORT_TEST(testFdo42465, "fdo42465.rtf")
{
CPPUNIT_ASSERT_EQUAL(3, getLength());