summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Luth <jluth@mail.com>2023-07-19 20:39:58 -0400
committerJustin Luth <jluth@mail.com>2023-07-20 11:48:48 +0200
commit97e5f7be679c9cc34d905987d08b62a67dde022c (patch)
tree568dd24b082f6820d95cbde1e5d8f644528431b0
parentd969715fa4df9de762c652a7af27601fa75fb275 (diff)
tdf#65509 autosave: apply UserAutoSave without restarting
Now that I know there is a config listener running in AutoRecovery, listen for the config change and apply it immediately instead of requesting the user to do a restart. Change-Id: I69912c0e95c04cc1a5e680d5e8c59b15e94efb05 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154664 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com>
-rw-r--r--cui/source/options/optsave.cxx2
-rw-r--r--framework/source/services/autorecovery.cxx12
2 files changed, 13 insertions, 1 deletions
diff --git a/cui/source/options/optsave.cxx b/cui/source/options/optsave.cxx
index e63bab701926..d7cbd61b366d 100644
--- a/cui/source/options/optsave.cxx
+++ b/cui/source/options/optsave.cxx
@@ -301,7 +301,7 @@ bool SvxSaveTabPage::FillItemSet( SfxItemSet* rSet )
{
rSet->Put( SfxBoolItem( SID_ATTR_USERAUTOSAVE,
m_xUserAutoSaveCB->get_active() ) );
- bModified = bRequestRestart = true;
+ bModified = true;
}
// save relatively
if ( m_xRelativeFsysCB->get_state_changed_from_saved() )
diff --git a/framework/source/services/autorecovery.cxx b/framework/source/services/autorecovery.cxx
index b1abcf5e9982..f325a45788a2 100644
--- a/framework/source/services/autorecovery.cxx
+++ b/framework/source/services/autorecovery.cxx
@@ -998,6 +998,7 @@ private:
constexpr OUStringLiteral CFG_PACKAGE_RECOVERY = u"/org.openoffice.Office.Recovery";
const char CFG_ENTRY_AUTOSAVE_ENABLED[] = "AutoSave/Enabled";
+const char CFG_ENTRY_AUTOSAVE_USERAUTOSAVE_ENABLED[] = "AutoSave/UserAutoSaveEnabled";
constexpr OUStringLiteral CFG_ENTRY_REALDEFAULTFILTER = u"ooSetupFactoryActualFilter";
@@ -1639,6 +1640,17 @@ void SAL_CALL AutoRecovery::changesOccurred(const css::util::ChangesEvent& aEven
}
}
}
+ else if (sPath == CFG_ENTRY_AUTOSAVE_USERAUTOSAVE_ENABLED)
+ {
+ bool bEnabled = false;
+ if (pChanges[i].Element >>= bEnabled)
+ {
+ if (bEnabled)
+ m_eJob |= Job::UserAutoSave;
+ else
+ m_eJob &= ~Job::UserAutoSave;
+ }
+ }
}
} /* SAFE */