diff options
author | Michael Stahl <michael.stahl@allotropia.de> | 2023-06-16 14:51:13 +0200 |
---|---|---|
committer | Michael Stahl <michael.stahl@allotropia.de> | 2023-06-16 16:52:43 +0200 |
commit | aca32a55456aa4e907b216fb490b3c15d26c3d55 (patch) | |
tree | ad6056715749b05c2c50ae0b0b251834fb0912c4 /starmath/qa | |
parent | 4da11a5d39ccd9f59e326011d4de7ffee8a71d10 (diff) |
tdf#146547 sfx2: allow read-only documents to be modified
This is particularly useful for a Writer document that contains a
section that is set to be editable in a read-only document, so that the
user is warned when closing such a document without saving it.
Originally this check was added in commit
27db57efc51487b3976fbf73df1868b8fb78d201 "CWS fwkbugfix05"
"#i39869#: readonly docs should never become modified"
but the actual problem there was that the read-only document was
displayed in a wizard dialog, not in a document view, so let's instead
check that the document is some kind of "internal" document.
Also the dialog's Save button should do something, and since the
document is read-only, a Save As dialog appears appropriate.
Change-Id: I339cbe92a2c9eb74a1f5061246f921037a47f79c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153180
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'starmath/qa')
-rw-r--r-- | starmath/qa/cppunit/test_cursor.cxx | 1 | ||||
-rw-r--r-- | starmath/qa/cppunit/test_node.cxx | 1 | ||||
-rw-r--r-- | starmath/qa/cppunit/test_nodetotextvisitors.cxx | 1 |
3 files changed, 3 insertions, 0 deletions
diff --git a/starmath/qa/cppunit/test_cursor.cxx b/starmath/qa/cppunit/test_cursor.cxx index 56c673c1bd22..5f4c551675a1 100644 --- a/starmath/qa/cppunit/test_cursor.cxx +++ b/starmath/qa/cppunit/test_cursor.cxx @@ -58,6 +58,7 @@ void Test::setUp() SmGlobals::ensure(); xDocShRef = new SmDocShell(SfxModelFlags::EMBEDDED_OBJECT); + xDocShRef->DoInitNew(); } void Test::tearDown() diff --git a/starmath/qa/cppunit/test_node.cxx b/starmath/qa/cppunit/test_node.cxx index f16f195aa8bc..af9ff177f38f 100644 --- a/starmath/qa/cppunit/test_node.cxx +++ b/starmath/qa/cppunit/test_node.cxx @@ -53,6 +53,7 @@ void NodeTest::setUp() mxDocShell = new SmDocShell(SfxModelFlags::EMBEDDED_OBJECT | SfxModelFlags::DISABLE_EMBEDDED_SCRIPTS | SfxModelFlags::DISABLE_DOCUMENT_RECOVERY); + mxDocShell->DoInitNew(); } void NodeTest::tearDown() diff --git a/starmath/qa/cppunit/test_nodetotextvisitors.cxx b/starmath/qa/cppunit/test_nodetotextvisitors.cxx index 6f714321de82..11ef5affcc4c 100644 --- a/starmath/qa/cppunit/test_nodetotextvisitors.cxx +++ b/starmath/qa/cppunit/test_nodetotextvisitors.cxx @@ -91,6 +91,7 @@ void Test::setUp() SmGlobals::ensure(); xDocShRef = new SmDocShell(SfxModelFlags::EMBEDDED_OBJECT); + xDocShRef->DoInitNew(); } void Test::tearDown() |