summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorLászló Németh <nemeth@numbertext.org>2019-10-11 09:21:18 +0200
committerLászló Németh <nemeth@numbertext.org>2019-10-12 09:29:44 +0200
commitd416250f4f1766e2d596ea3feef6a94b7adf29f4 (patch)
tree5edb01b3e3a5b1e251cf04fcaa86a6543e2ccca8 /sw
parent2b729c8fac2b3fb9da06b8a2e3c6a57251cc00d1 (diff)
tdf#106843 DOCX: forbid disabling protected Record Changes
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 <nemeth@numbertext.org>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/uiwriter/data2/tdf106843.docxbin0 -> 13936 bytes
-rw-r--r--sw/qa/extras/uiwriter/uiwriter2.cxx17
2 files changed, 17 insertions, 0 deletions
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
--- /dev/null
+++ b/sw/qa/extras/uiwriter/data2/tdf106843.docx
Binary files 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<SwXTextDocument*>(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.