diff options
author | László Németh <nemeth@numbertext.org> | 2019-07-04 15:23:26 +0200 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2019-07-05 10:09:05 +0200 |
commit | 05526a206cc8a273771b2e6aae1fd3c4092cbf03 (patch) | |
tree | 50d8eb6b910b7feadce69d3172f4e3b16042ce3d /sw/qa | |
parent | 970751c818bb46029ab9fc84a45337bdd856d70b (diff) |
tdf#120338 DOCX: add rejection of paragraph formatting changes
using imported change tracking data, instead of doing nothing
for the user request.
Change-Id: I37775ae2d9b78fe3a31541a331f686af9ca9094f
Reviewed-on: https://gerrit.libreoffice.org/75089
Tested-by: Jenkins
Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sw/qa')
-rw-r--r-- | sw/qa/extras/uiwriter/data2/tdf120338.docx | bin | 0 -> 14898 bytes | |||
-rw-r--r-- | sw/qa/extras/uiwriter/uiwriter2.cxx | 29 |
2 files changed, 29 insertions, 0 deletions
diff --git a/sw/qa/extras/uiwriter/data2/tdf120338.docx b/sw/qa/extras/uiwriter/data2/tdf120338.docx Binary files differnew file mode 100644 index 000000000000..94e0023cea7f --- /dev/null +++ b/sw/qa/extras/uiwriter/data2/tdf120338.docx diff --git a/sw/qa/extras/uiwriter/uiwriter2.cxx b/sw/qa/extras/uiwriter/uiwriter2.cxx index dfa98003007b..64352b08f5fd 100644 --- a/sw/qa/extras/uiwriter/uiwriter2.cxx +++ b/sw/qa/extras/uiwriter/uiwriter2.cxx @@ -1649,4 +1649,33 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testImageCommentAtChar) pDoc->getIDocumentMarkAccess()->getAnnotationMarksCount()); } +CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf120338) +{ + load(DATA_DIRECTORY, "tdf120338.docx"); + + SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get()); + CPPUNIT_ASSERT(pTextDoc); + + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), + getProperty<sal_Int32>(getParagraph(2), "ParaAdjust")); // right + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), + getProperty<sal_Int32>(getParagraph(3), "ParaAdjust")); // right + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), + getProperty<sal_Int32>(getParagraph(4), "ParaAdjust")); // left + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), + getProperty<sal_Int32>(getParagraph(5), "ParaAdjust")); // right + + // reject tracked paragraph adjustments + lcl_dispatchCommand(mxComponent, ".uno:RejectAllTrackedChanges", {}); + + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), + getProperty<sal_Int32>(getParagraph(2), "ParaAdjust")); // left + CPPUNIT_ASSERT_EQUAL(sal_Int32(3), + getProperty<sal_Int32>(getParagraph(3), "ParaAdjust")); // center + CPPUNIT_ASSERT_EQUAL(sal_Int32(3), + getProperty<sal_Int32>(getParagraph(4), "ParaAdjust")); // center + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), + getProperty<sal_Int32>(getParagraph(5), "ParaAdjust")); // left +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |