summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorLászló Németh <nemeth@numbertext.org>2019-07-02 18:36:32 +0200
committerLászló Németh <nemeth@numbertext.org>2019-07-03 17:32:40 +0200
commit5322663f8234836a6a4aaaed025c158fd7e8b67a (patch)
tree1fccc3d960c4c7700efe7f538effe3c8bee57def /sw/qa
parent86fd893e32ef7a737b2c4b60e0938146b102fc07 (diff)
tdf#126206 DOCX: add rejection of character formatting changes
using imported change tracking data, instead of clearing only direct formatting in the modified text range. See commit 9c4eef7d809ad7d283860c7b47b0f561aa240906 "tdf#52391 reject/clear formatting of format-only changes". Change-Id: Ie27d5c5bca6d9f30681e8f542f95417e9bb4c266 Reviewed-on: https://gerrit.libreoffice.org/75011 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/tdf126206.docxbin0 -> 12509 bytes
-rw-r--r--sw/qa/extras/uiwriter/uiwriter2.cxx30
2 files changed, 30 insertions, 0 deletions
diff --git a/sw/qa/extras/uiwriter/data2/tdf126206.docx b/sw/qa/extras/uiwriter/data2/tdf126206.docx
new file mode 100644
index 000000000000..166125e7a738
--- /dev/null
+++ b/sw/qa/extras/uiwriter/data2/tdf126206.docx
Binary files differ
diff --git a/sw/qa/extras/uiwriter/uiwriter2.cxx b/sw/qa/extras/uiwriter/uiwriter2.cxx
index 04b2c4df88ba..24e3f3ddec38 100644
--- a/sw/qa/extras/uiwriter/uiwriter2.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter2.cxx
@@ -8,6 +8,7 @@
*/
#include <swmodeltestbase.hxx>
+#include <com/sun/star/awt/FontWeight.hpp>
#include <com/sun/star/frame/DispatchHelper.hpp>
#include <com/sun/star/style/LineSpacing.hpp>
#include <comphelper/propertysequence.hxx>
@@ -1139,6 +1140,35 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf52391)
CPPUNIT_ASSERT_EQUAL(OUString("Portion1Portion2"), xRun->getString());
}
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf126206)
+{
+ load(DATA_DIRECTORY, "tdf126206.docx");
+
+ SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get());
+ CPPUNIT_ASSERT(pTextDoc);
+
+ // normal text (it was bold)
+ auto xText = getParagraph(1)->getText();
+ CPPUNIT_ASSERT(xText.is());
+ {
+ auto xCursor(xText->createTextCursorByRange(getRun(getParagraph(1), 2)));
+ CPPUNIT_ASSERT(xCursor.is());
+ CPPUNIT_ASSERT_EQUAL(awt::FontWeight::NORMAL, getProperty<float>(xCursor, "CharWeight"));
+ }
+
+ // reject tracked changes
+ lcl_dispatchCommand(mxComponent, ".uno:RejectAllTrackedChanges", {});
+
+ // bold text again
+ xText = getParagraph(1)->getText();
+ CPPUNIT_ASSERT(xText.is());
+ {
+ auto xCursor(xText->createTextCursorByRange(getRun(getParagraph(1), 2)));
+ CPPUNIT_ASSERT(xCursor.is());
+ CPPUNIT_ASSERT_EQUAL(awt::FontWeight::BOLD, getProperty<float>(xCursor, "CharWeight"));
+ }
+}
+
CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf101873)
{
SwDoc* pDoc = createDoc();