summaryrefslogtreecommitdiff
path: root/sw/qa/extras/uiwriter/uiwriter.cxx
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2015-02-13 13:47:30 +0100
committerCaolán McNamara <caolanm@redhat.com>2015-03-03 10:30:37 +0000
commit0fb40be65da7eb3360edc2970facff0117833038 (patch)
tree9a30da51cae3896938213105a17da295e9781ed6 /sw/qa/extras/uiwriter/uiwriter.cxx
parenta46a1895f6280b8da2dd6ea61b6c39aea9952f3d (diff)
cp#1000115 SwTxtFrm: don't join follow just because it has no content
The problem was that the bugdoc had a table, and inside the table there was a long paragraph that flows to the next page, but only the paragraph mark of it does so. We first split the frame to have space for the paragraph mark, but later decided that all the content would fit the first frame, and this way the last hard line break and the paragraph mark was painted on each other. This is normally not a problem without tables, because SwTxtFrm::FormatAdjust() just calls SplitFrm(), sets its nNew flag to non-zero make sure that later SwTxtFrm::_AdjustFollow() doesn't try to join it, and we're ready. However, when the paragraph is inside a table, then the paragraph was formatted multiple times, and next time when we already had a follow nNew was not set, so even if there was a correct split first, the new frame was joined later. Fix the problem by explicitly setting nNew for the "in a table and paragraph ends with a hard line break" case, that way we don't blindly join the frame, only in case there is enough space for the follow in the master. (cherry picked from commit 7e33cce05b2df3f1761bcc66606c4d3b2b2671e9) Conflicts: sw/qa/extras/uiwriter/uiwriter.cxx Change-Id: Iede654740dcb0d8aa768d742ee330208291a383a Reviewed-on: https://gerrit.libreoffice.org/14476 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw/qa/extras/uiwriter/uiwriter.cxx')
-rw-r--r--sw/qa/extras/uiwriter/uiwriter.cxx15
1 files changed, 15 insertions, 0 deletions
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx
index 7500b7def7c0..512095ec4da8 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -58,6 +58,7 @@ public:
void testChineseConversionSimplifiedToTraditional();
void testFdo85554();
void testBookmarkUndo();
+ void testCp1000115();
CPPUNIT_TEST_SUITE(SwUiWriterTest);
CPPUNIT_TEST(testReplaceForward);
@@ -82,6 +83,7 @@ public:
CPPUNIT_TEST(testChineseConversionSimplifiedToTraditional);
CPPUNIT_TEST(testFdo85554);
CPPUNIT_TEST(testBookmarkUndo);
+ CPPUNIT_TEST(testCp1000115);
CPPUNIT_TEST_SUITE_END();
@@ -624,6 +626,19 @@ void SwUiWriterTest::testBookmarkUndo()
CPPUNIT_ASSERT_EQUAL(sal_Int32(0), pMarkAccess->getAllMarksCount());
}
+void SwUiWriterTest::testCp1000115()
+{
+ createDoc("cp1000115.fodt");
+ xmlDocPtr pXmlDoc = parseLayoutDump();
+ xmlXPathObjectPtr pXmlObj = getXPathNode(pXmlDoc, "/root/page[2]/body/tab/row/cell[2]/txt");
+ xmlNodeSetPtr pXmlNodes = pXmlObj->nodesetval;
+ // This was 1: the long paragraph in the B1 cell did flow over to the
+ // second page, so there was only one paragraph in the second cell of the
+ // second page.
+ CPPUNIT_ASSERT_EQUAL(2, xmlXPathNodeSetGetLength(pXmlNodes));
+ xmlXPathFreeObject(pXmlObj);
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(SwUiWriterTest);
CPPUNIT_PLUGIN_IMPLEMENT();