From d416250f4f1766e2d596ea3feef6a94b7adf29f4 Mon Sep 17 00:00:00 2001 From: László Németh Date: Fri, 11 Oct 2019 09:21:18 +0200 Subject: tdf#106843 DOCX: forbid disabling protected Record Changes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Password protection of enabled record changes has been grab- bagged, yet, but it was possible to disable the protection without password verification, eg. by a simple click on Record Track Changes. Now it's forbidden to disable the protected Record Changes, using a dummy password temporarily. Change-Id: Ibc1c9016ea164ebb588265579fb9fa589ddee114 Reviewed-on: https://gerrit.libreoffice.org/80643 Tested-by: Jenkins Reviewed-by: László Németh --- sw/qa/extras/uiwriter/data2/tdf106843.docx | Bin 0 -> 13936 bytes sw/qa/extras/uiwriter/uiwriter2.cxx | 17 +++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 sw/qa/extras/uiwriter/data2/tdf106843.docx (limited to 'sw') diff --git a/sw/qa/extras/uiwriter/data2/tdf106843.docx b/sw/qa/extras/uiwriter/data2/tdf106843.docx new file mode 100644 index 000000000000..339ebd594168 Binary files /dev/null and b/sw/qa/extras/uiwriter/data2/tdf106843.docx differ diff --git a/sw/qa/extras/uiwriter/uiwriter2.cxx b/sw/qa/extras/uiwriter/uiwriter2.cxx index 50df467a168f..83cc90bc5d84 100644 --- a/sw/qa/extras/uiwriter/uiwriter2.cxx +++ b/sw/qa/extras/uiwriter/uiwriter2.cxx @@ -1745,6 +1745,23 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf120336) CPPUNIT_ASSERT_EQUAL(2, getPages()); } +CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf106843) +{ + load(DATA_DIRECTORY, "tdf106843.docx"); + + SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); + CPPUNIT_ASSERT(pTextDoc); + + SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc(); + + // try to turn off red-lining + lcl_dispatchCommand(mxComponent, ".uno:TrackChanges", {}); + + // but the protection doesn't allow it + CPPUNIT_ASSERT_MESSAGE("redlining should be on", + pDoc->getIDocumentRedlineAccess().IsRedlineOn()); +} + CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testImageComment) { // Load a document with an as-char image in it. -- cgit