diff options
author | Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de> | 2023-05-08 15:41:27 +0200 |
---|---|---|
committer | Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de> | 2023-05-22 14:30:10 +0200 |
commit | e7e9991fd06ba2e0484ae5e6b6acc323ab8bf66b (patch) | |
tree | 0a54fcf1a32294ae920c06bee1f32e8d4956b404 | |
parent | c4c220b56c25a5a78106b9d0fc06280968ccdb28 (diff) |
tdf#146547 Mark read-only docs as modified
when an editable section is changed.
Change-Id: I588b09f160974d3a3833bfa011fd07f2ee496616
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151535
Tested-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
-rw-r--r-- | sfx2/source/doc/objmisc.cxx | 3 | ||||
-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 |
4 files changed, 5 insertions, 1 deletions
diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx index 6b86e2163ccb..dd639c36900d 100644 --- a/sfx2/source/doc/objmisc.cxx +++ b/sfx2/source/doc/objmisc.cxx @@ -247,7 +247,8 @@ void SfxObjectShell::EnableSetModified( bool bEnable ) bool SfxObjectShell::IsEnableSetModified() const { - return pImpl->m_bEnableSetModified && !IsReadOnly(); + // Don't allow when user explicitly requested read only (IsLoadReadonly() or IsOriginallyLoadedReadOnlyMedium()) + return pImpl->m_bEnableSetModified && ! (IsLoadReadonly() || IsOriginallyLoadedReadOnlyMedium()); } 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() |