cui/source/dialogs/tipofthedaydlg.cxx |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

New commits:
commit a10568c2e8d42f4568802de079a6290431ef77b1
Author:     Gabor Kelemen <[email protected]>
AuthorDate: Mon Nov 10 13:50:25 2025 +0100
Commit:     Gabor Kelemen <[email protected]>
CommitDate: Wed Nov 12 09:33:57 2025 +0100

    tdf#169367 Don't crash on dialog close if ShowTipOfTheDay is locked down
    
    Change-Id: Ib8ba4f24fdd5ba4ca4e10578fbc26d084bf0b0bf
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193745
    Tested-by: Jenkins
    Reviewed-by: Andras Timar <[email protected]>
    (cherry picked from commit ae6920c194e5eb0039f7ae3084ca5b7679ea8498)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193788
    Tested-by: Jenkins CollaboraOffice <[email protected]>

diff --git a/cui/source/dialogs/tipofthedaydlg.cxx 
b/cui/source/dialogs/tipofthedaydlg.cxx
index 86b84c688e8b..795aeb1acc75 100644
--- a/cui/source/dialogs/tipofthedaydlg.cxx
+++ b/cui/source/dialogs/tipofthedaydlg.cxx
@@ -100,8 +100,14 @@ TipOfTheDayDialog::~TipOfTheDayDialog()
 {
     std::shared_ptr<comphelper::ConfigurationChanges> xChanges(
         comphelper::ConfigurationChanges::create());
-    officecfg::Office::Common::Misc::LastTipOfTheDayID::set(m_nCurrentTip, 
xChanges);
-    
officecfg::Office::Common::Misc::ShowTipOfTheDay::set(m_pShowTip->get_active(), 
xChanges);
+    if (!officecfg::Office::Common::Misc::LastTipOfTheDayID::isReadOnly())
+    {
+        officecfg::Office::Common::Misc::LastTipOfTheDayID::set(m_nCurrentTip, 
xChanges);
+    }
+    if (!officecfg::Office::Common::Misc::ShowTipOfTheDay::isReadOnly())
+    {
+        
officecfg::Office::Common::Misc::ShowTipOfTheDay::set(m_pShowTip->get_active(), 
xChanges);
+    }
     xChanges->commit();
 
     if (m_xParent.is())

Reply via email to