summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>2023-05-08 15:41:27 +0200
committerSamuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>2023-05-24 22:28:04 +0200
commitcb46fe877fd000ad74eb167a3a6127e89c8990f9 (patch)
tree0677ed9c51c376d4df89e44bebca050384cbf931
parentResolves: tdf#114878 Add 'Evaluate formulas' option to CSV import and paste (diff)
downloadcore-cb46fe877fd000ad74eb167a3a6127e89c8990f9.tar.gz
core-cb46fe877fd000ad74eb167a3a6127e89c8990f9.zip
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> (cherry picked from commit e7e9991fd06ba2e0484ae5e6b6acc323ab8bf66b)
-rw-r--r--sfx2/source/doc/objmisc.cxx3
-rw-r--r--starmath/qa/cppunit/test_cursor.cxx1
-rw-r--r--starmath/qa/cppunit/test_node.cxx1
-rw-r--r--starmath/qa/cppunit/test_nodetotextvisitors.cxx1
4 files changed, 5 insertions, 1 deletions
diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx
index ff31ce956bbc..50f92ee65ac6 100644
--- a/sfx2/source/doc/objmisc.cxx
+++ b/sfx2/source/doc/objmisc.cxx
@@ -262,7 +262,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 080e7a274c4d..b85b5ceef37a 100644
--- a/starmath/qa/cppunit/test_cursor.cxx
+++ b/starmath/qa/cppunit/test_cursor.cxx
@@ -57,6 +57,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 dba0b9ff3c40..570cab00d062 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 c3172ab60126..e738351a8d23 100644
--- a/starmath/qa/cppunit/test_nodetotextvisitors.cxx
+++ b/starmath/qa/cppunit/test_nodetotextvisitors.cxx
@@ -90,6 +90,7 @@ void Test::setUp()
SmGlobals::ensure();
xDocShRef = new SmDocShell(SfxModelFlags::EMBEDDED_OBJECT);
+ xDocShRef->DoInitNew();
}
void Test::tearDown()