summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <michael.stahl@allotropia.de>2024-06-05 18:53:05 +0200
committerMichael Stahl <michael.stahl@allotropia.de>2024-06-11 10:11:12 +0200
commit0f9b5cd1c5e1e2a2ac389a3e9cd6b4f84bcb108e (patch)
tree6fea78b108a92fc39bc88b9723dd57674a57b4aa
parent2034ed9acc639694b9ea01805e9e5d4752287371 (diff)
tdf#157931 sfx2: fix modified status of Base forms cib-6.4-26distro/cib/libreoffice-6-4
The problem is that when a Base form is not in design mode, it's not expected that it will be stored. There are checks for m_bOpenInDesign in ODocumentDefinition::save() and ODocumentDefinition::saveAs() that were added in commit 9cfe62966ff1e0039d95a07d0c613675a53e3075 "CWS dba201b" but removing these runs into another check in OCommonEmbeddedObject::storeOwn() of m_bReadOnly and then it still fails, presumably because the storage was opened readonly. Let's restore SfxObjectShell::IsEnableSetModified() to check IsReadOnly(), but only for Base form documents, which seems simplest. (regression from commit bde746141f9b382156a5ce79ebf82c5e32fc455b) Change-Id: I886389e2bd462d27ed5c46bfd2132893bb2d5a81 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168481 Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> Tested-by: Jenkins (cherry picked from commit 3e7478ef9706e74ac551c1f94090e163e74c7fd8) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168442 Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de> (cherry picked from commit d6b881627cc1f6982129862e0221da65389d83bf)
-rw-r--r--sfx2/source/doc/objmisc.cxx8
1 files changed, 7 insertions, 1 deletions
diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx
index 9ff78bff6eea..635fabd3b292 100644
--- a/sfx2/source/doc/objmisc.cxx
+++ b/sfx2/source/doc/objmisc.cxx
@@ -267,7 +267,13 @@ bool SfxObjectShell::IsEnableSetModified() const
// which the user didn't load or activate to modified.
return pImpl->m_bEnableSetModified && !IsPreview()
&& eCreateMode != SfxObjectCreateMode::ORGANIZER
- && eCreateMode != SfxObjectCreateMode::INTERNAL;
+ && eCreateMode != SfxObjectCreateMode::INTERNAL
+ // tdf#157931 form documents only in design mode
+ && ((pImpl->pBaseModel
+ && !pImpl->pBaseModel->impl_isDisposed()
+ && pImpl->pBaseModel->IsInitialized()
+ && pImpl->pBaseModel->getIdentifier() != "com.sun.star.sdb.FormDesign")
+ || !IsReadOnly());
}