summaryrefslogtreecommitdiff
path: root/sw/qa/extras
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2014-02-27 23:48:59 +0100
committerMichael Stahl <mstahl@redhat.com>2014-03-03 13:53:21 +0100
commite3f254ab8211fbab7541cde2100a35c875b0c240 (patch)
treecffe4e2ec71d86711a799deb427b47588399968c /sw/qa/extras
parent9ca4fa05eb5ec7d0d7c3f4a83489013e140d2f0b (diff)
RTF import: fix spurious page breaks at doc end (related: rhbz#1065629)
When a document ends with \sect it's possible that a spurious page break is created. In fact the spurious page break is always created by the RTF importer, sometimes it is deleted again by DomainMapper_Impl::RemoveLastParagraph() and sometimes not. It is created because on the final \sect RTFDocumentImpl::sectBreak() still calls startSectionGroup(), and the popState() for the \rtf1 group then calls sectBreak() another time. To prevent this, do not call startSectionGroup() from sectBreak() but instead from setNeedSect(), and ensure that it is called as soon as anything after \sect is read. One unit test fails because the \page is not handled properly: the conversion to \skbpage \sect \skbnone is not correct, because the \skb* keywords are an exception and affect the \sect that precedes them, not the following one; sending the \skbpage later unfortunately requires additional cleanup later. Change-Id: I3c1a3bceb2c8b75bbecdc748170562451ce5f5c3
Diffstat (limited to 'sw/qa/extras')
-rw-r--r--sw/qa/extras/rtfimport/rtfimport.cxx3
1 files changed, 3 insertions, 0 deletions
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx
index 88b8ca1d1a2e..2c119f3bf76b 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -1415,6 +1415,9 @@ DECLARE_RTFIMPORT_TEST(testNestedTable, "rhbz1065629.rtf")
getProperty<table::BorderLine2>(xCell, "RightBorder"));
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0xffffffff),
getProperty<sal_Int32>(xCell, "BackColor"));
+
+ // \sect at the end resulted in spurious page break
+ CPPUNIT_ASSERT_EQUAL(1, getPages());
}
DECLARE_RTFIMPORT_TEST(testCp1000016, "hello.rtf")