cui/source/options/optsave.cxx             |    2 +-
 framework/source/services/autorecovery.cxx |   15 +++++----------
 2 files changed, 6 insertions(+), 11 deletions(-)

New commits:
commit d36ae6786e05deda7e78338d36624af371e7a3ed
Author:     Justin Luth <jl...@mail.com>
AuthorDate: Wed Jul 12 11:59:44 2023 -0400
Commit:     Justin Luth <jl...@mail.com>
CommitDate: Thu Jul 13 00:51:10 2023 +0200

    tdf#65509 apply new AutoRecovery timeInterval without restarting
    
    Another option would be to listen for config changes I guess.
    
    However, this alternative method of setting the timer interval
    (which I assume is related to Impress slideshows, but couldn't reproduce)
    is basically never used.
    
    At worst (in case this alternative method sets a non-zero time)
    it will be the same as before where a restart is needed to
    gain the new time.
    
    I'm not worried about having the user wait for the current
    timer to run out (in 10 minutes based on the default state)
    before their new time kicks in.
    
    Change-Id: Iaa2b9e3e0912918ae29aaf262b5d7f51924b8147
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154365
    Tested-by: Jenkins
    Reviewed-by: Justin Luth <jl...@mail.com>

diff --git a/cui/source/options/optsave.cxx b/cui/source/options/optsave.cxx
index 56e0f4486730..c35da388ebf9 100644
--- a/cui/source/options/optsave.cxx
+++ b/cui/source/options/optsave.cxx
@@ -283,7 +283,7 @@ bool SvxSaveTabPage::FillItemSet( SfxItemSet* rSet )
     {
         rSet->Put( SfxUInt16Item( SID_ATTR_AUTOSAVEMINUTE,
                                  
static_cast<sal_uInt16>(m_xAutoSaveEdit->get_value()) ) );
-        bModified = bRequestRestart = true;
+        bModified = true;
     }
 
     if ( m_xUserAutoSaveCB->get_state_changed_from_saved() )
diff --git a/framework/source/services/autorecovery.cxx 
b/framework/source/services/autorecovery.cxx
index c9e7d62cc5f9..ddeeab2c23c5 100644
--- a/framework/source/services/autorecovery.cxx
+++ b/framework/source/services/autorecovery.cxx
@@ -1780,15 +1780,6 @@ void AutoRecovery::implts_readAutoSaveConfig()
         m_eTimerType  = AutoRecovery::E_DONT_START_TIMER;
     }
     } /* SAFE */
-
-    // AutoSaveTimeIntervall [int] in min
-    sal_Int32 nTimeIntervall(
-        
officecfg::Office::Common::Save::Document::AutoSaveTimeIntervall::get());
-
-    /* SAFE */ {
-    osl::MutexGuard g(cppu::WeakComponentImplHelperBase::rBHelper.rMutex);
-    m_nAutoSaveTimeIntervall = nTimeIntervall;
-    } /* SAFE */
 }
 
 void AutoRecovery::implts_readConfig()
@@ -2216,7 +2207,11 @@ void AutoRecovery::implts_updateTimer()
 
     if (m_eTimerType == AutoRecovery::E_NORMAL_AUTOSAVE_INTERVALL)
     {
-        nMilliSeconds = (m_nAutoSaveTimeIntervall*60000); // [min] => 60.000 ms
+        nMilliSeconds
+            = m_nAutoSaveTimeIntervall
+                  ? m_nAutoSaveTimeIntervall
+                  : 
officecfg::Office::Common::Save::Document::AutoSaveTimeIntervall::get();
+        nMilliSeconds *= 60000; // [min] => 60.000 ms
     }
     else if (m_eTimerType == AutoRecovery::E_POLL_FOR_USER_IDLE)
     {

Reply via email to