summaryrefslogtreecommitdiff
path: root/sw/qa/extras
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-12-07 10:00:10 +0100
committerJan Holesovsky <kendy@collabora.com>2016-12-08 10:42:31 +0000
commitc1ae11db4a56dea9369d379a83c8a2a7afc2b99b (patch)
tree063fbac03ee84e6ffe77110a505c07601c7a2e7f /sw/qa/extras
parent0543ac9016528aa9c49573b1b1115bb6fbddf0b4 (diff)
tdf#104440 sw: fix layout inconsistency with dynamic wrapping and undo
The problem was that the second fly frame was placed on the first page initially, but after typing a character (which moved it to the second page) and then undoing, it wasn't moved back. Fix the inconsistency by handling the "fly frame takes all horizontal space" case as parallel wrapping (which will result in no wrapping at the end), this way the second fly frame appears on the second page both initially and after editing. As an additional data point, the DOC export of the bugdoc is now rendered in Word the same way as in Writer. (cherry picked from commit 862c12396585661606d4e6ae583d1d024a19d222) Conflicts: sw/qa/extras/uiwriter/uiwriter.cxx Change-Id: Ifc9f17458ad0501b8ab6077e5a4998d48fd6f1d8 Reviewed-on: https://gerrit.libreoffice.org/31725 Reviewed-by: Jan Holesovsky <kendy@collabora.com> Tested-by: Jan Holesovsky <kendy@collabora.com>
Diffstat (limited to 'sw/qa/extras')
-rw-r--r--sw/qa/extras/uiwriter/data/tdf104440.odtbin0 -> 8807 bytes
-rw-r--r--sw/qa/extras/uiwriter/uiwriter.cxx15
2 files changed, 15 insertions, 0 deletions
diff --git a/sw/qa/extras/uiwriter/data/tdf104440.odt b/sw/qa/extras/uiwriter/data/tdf104440.odt
new file mode 100644
index 000000000000..b226bb55de8d
--- /dev/null
+++ b/sw/qa/extras/uiwriter/data/tdf104440.odt
Binary files differ
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx
index 1a37476f21e2..d7827ae6b734 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -199,6 +199,7 @@ public:
void testCursorWindows();
void testLandscape();
void testTdf95699();
+ void testTdf104440();
CPPUNIT_TEST_SUITE(SwUiWriterTest);
CPPUNIT_TEST(testReplaceForward);
@@ -299,6 +300,7 @@ public:
CPPUNIT_TEST(testCursorWindows);
CPPUNIT_TEST(testLandscape);
CPPUNIT_TEST(testTdf95699);
+ CPPUNIT_TEST(testTdf104440);
CPPUNIT_TEST_SUITE_END();
private:
@@ -3484,6 +3486,19 @@ void SwUiWriterTest::testTdf95699()
CPPUNIT_ASSERT_EQUAL(OUString("vnd.oasis.opendocument.field.FORMCHECKBOX"), pFieldMark->GetFieldname());
}
+void SwUiWriterTest::testTdf104440()
+{
+ createDoc("tdf104440.odt");
+ xmlDocPtr pXmlDoc = parseLayoutDump();
+ xmlXPathObjectPtr pXmlObj = getXPathNode(pXmlDoc, "//page[2]/body/txt/anchored");
+ xmlNodeSetPtr pXmlNodes = pXmlObj->nodesetval;
+ // This was 0: both Text Frames in the document were anchored to a
+ // paragraph on page 1, while we expect that the second Text Frame is
+ // anchored to a paragraph on page 2.
+ CPPUNIT_ASSERT_EQUAL(1, xmlXPathNodeSetGetLength(pXmlNodes));
+ xmlXPathFreeObject(pXmlObj);
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(SwUiWriterTest);
CPPUNIT_PLUGIN_IMPLEMENT();