summaryrefslogtreecommitdiff
path: root/sw/qa/extras/layout
diff options
context:
space:
mode:
authorLászló Németh <nemeth@numbertext.org>2021-11-19 12:57:23 +0100
committerLászló Németh <nemeth@numbertext.org>2021-11-23 11:54:13 +0100
commit7bc57e698910e24495605bd197a6d3ab5e0be5b8 (patch)
tree4330d0916dc0d806d6f8f62bd4df1bbc9ef77f01 /sw/qa/extras/layout
parent87fafdb9dc045735e235cbba2ef37198043422c7 (diff)
tdf#145719 sw: track moved text in import and ChangesInMargin
Recognize moved text by accessing to the hidden redline content pContentSect during ODT import (in the case of Delete redlines) and ChangesInMargin mode (Delete or Insert redlines depending on Deletion in Margin or Insertion in Margin modes). Fix Undo and redline stack handling by moving IsMoved bit to SwRedlineData from SwRangeRedline. Note: .fodt format is applicable for the unit test document, because it's not affected by the problem. Change-Id: Ifd4f993520bec4b845d978a844c465509ea87b50 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125552 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sw/qa/extras/layout')
-rw-r--r--sw/qa/extras/layout/data/tdf145719.odtbin0 -> 10558 bytes
-rw-r--r--sw/qa/extras/layout/layout2.cxx16
2 files changed, 16 insertions, 0 deletions
diff --git a/sw/qa/extras/layout/data/tdf145719.odt b/sw/qa/extras/layout/data/tdf145719.odt
new file mode 100644
index 000000000000..62e4cc4a73e4
--- /dev/null
+++ b/sw/qa/extras/layout/data/tdf145719.odt
Binary files differ
diff --git a/sw/qa/extras/layout/layout2.cxx b/sw/qa/extras/layout/layout2.cxx
index 9eee8228ea8d..3ca1abc2747a 100644
--- a/sw/qa/extras/layout/layout2.cxx
+++ b/sw/qa/extras/layout/layout2.cxx
@@ -350,6 +350,22 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testRedlineMovingDOCX)
assertXPath(pXmlDoc, "/metafile/push/push/push/textcolor[@color='#008000']", 6);
}
+CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf145719)
+{
+ SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf145719.odt");
+ SwDocShell* pShell = pDoc->GetDocShell();
+
+ // Dump the rendering of the first page as an XML file.
+ std::shared_ptr<GDIMetaFile> xMetaFile = pShell->GetPreviewMetaFile();
+ MetafileXmlDump dumper;
+ xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile);
+ CPPUNIT_ASSERT(pXmlDoc);
+
+ // text colors show moved text
+ // This was 0 (other color, not COL_GREEN, color of the tracked text movement)
+ assertXPath(pXmlDoc, "/metafile/push/push/push/textcolor[@color='#008000']", 4);
+}
+
CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf145225_RedlineMovingWithBadInsertion)
{
SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf42748.fodt");