cui/source/options/optsave.cxx                               |    8 +--
 framework/source/services/autorecovery.cxx                   |   18 -------
 officecfg/registry/schema/org/openoffice/Office/Common.xcs   |   21 ---------
 officecfg/registry/schema/org/openoffice/Office/Recovery.xcs |   25 +++++++++--
 officecfg/util/sanity.xsl                                    |    2 
 sd/source/ui/slideshow/slideshowimpl.cxx                     |    4 -
 sfx2/source/appl/appcfg.cxx                                  |   12 ++---
 7 files changed, 38 insertions(+), 52 deletions(-)

New commits:
commit 3c41b32562d5ccdd306000484c5b16245b2b4a4f
Author:     Mike Kaganski <mike.kagan...@collabora.com>
AuthorDate: Sun Jul 16 18:17:21 2023 +0300
Commit:     Mike Kaganski <mike.kagan...@collabora.com>
CommitDate: Mon Jul 17 21:14:24 2023 +0200

    tdf#156308: Restore use of /org.openoffice.Office.Recovery/AutoSave
    
    ... instead of respective values from 
/org.openoffice.Office.Common/Save/Document
    
    The history of the problem:
    
    d0f9685d2cfc3927add412b276c804dcc20cb6a5 (2004-11-26)
      made SvtSaveOptions use org.openoffice.Office.Recovery/AutoSave,
      *in addition* to org.openoffice.Office.Common/Save/Document/*,
      as "forward AutoSave/AutoSaveTime to new config location" part
      of i#27726; at this point, org.openoffice.Office.Recovery/AutoSave/*
      took precedence (they were read last).
    
    8e6031e126782ced6d7527b19cf817395e9b63e4 (2004-11-26)
      implemented autorecovery.cxx, already reading
      org.openoffice.Office.Recovery/AutoSave/*
    
    d5b9283985633fdb423269cab961bba2acc3539e (2021-07-25)
      made SvxSaveTabPage and SfxApplication::SetOptions_Impl use
      officecfg::Office::Common::Save::Document::* instead of
      SvtSaveOptions.
    
    134f40136a9bea265d8f2fedfdb41a1e65d81b49 (2021-07-25)
      dropped SvtSaveOptions_Impl::ImplCommit, and its saving of
      officecfg::Office::Recovery::AutoSave::* (which likely
      detached officecfg::Office::Recovery::AutoSave from
      officecfg::Office::Common::Save::Document, making UI edits
      not stored to the former).
    
    aeb8a0076cd5ec2836b3dfc1adffcced432f995f (2022-05-23)
      made AutoRecovery::implts_readAutoSaveConfig read
      officecfg::Office::Common::Save::Document::* instead of
      proper officecfg::Office::Recovery::AutoSave::*.
    
    This change restores the intended use, and deprecates corresponding
    values in /org.openoffice.Office.Common/Save/Document.
    
    Change-Id: I33d48e3945326c80d356bfc930ed8a7f042c982b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154500
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>

diff --git a/cui/source/options/optsave.cxx b/cui/source/options/optsave.cxx
index 2772c6d60944..743c6015b1d5 100644
--- a/cui/source/options/optsave.cxx
+++ b/cui/source/options/optsave.cxx
@@ -475,8 +475,8 @@ void SvxSaveTabPage::Reset( const SfxItemSet* )
     
m_xBackupCB->set_active(officecfg::Office::Common::Save::Document::CreateBackup::get());
     
m_xBackupCB->set_sensitive(!officecfg::Office::Common::Save::Document::CreateBackup::isReadOnly());
 
-    
m_xAutoSaveCB->set_active(officecfg::Office::Common::Save::Document::AutoSave::get());
-    
m_xAutoSaveCB->set_sensitive(!officecfg::Office::Common::Save::Document::AutoSave::isReadOnly());
+    
m_xAutoSaveCB->set_active(officecfg::Office::Recovery::AutoSave::Enabled::get());
+    
m_xAutoSaveCB->set_sensitive(!officecfg::Office::Recovery::AutoSave::Enabled::isReadOnly());
 
     
m_xUserAutoSaveCB->set_active(officecfg::Office::Recovery::AutoSave::UserAutoSaveEnabled::get());
     
m_xUserAutoSaveCB->set_sensitive(!officecfg::Office::Recovery::AutoSave::UserAutoSaveEnabled::isReadOnly());
@@ -484,8 +484,8 @@ void SvxSaveTabPage::Reset( const SfxItemSet* )
     
m_xWarnAlienFormatCB->set_active(officecfg::Office::Common::Save::Document::WarnAlienFormat::get());
     
m_xWarnAlienFormatCB->set_sensitive(!officecfg::Office::Common::Save::Document::WarnAlienFormat::isReadOnly());
 
-    
m_xAutoSaveEdit->set_value(officecfg::Office::Common::Save::Document::AutoSaveTimeIntervall::get());
-    
m_xAutoSaveEdit->set_sensitive(!officecfg::Office::Common::Save::Document::AutoSaveTimeIntervall::isReadOnly());
+    
m_xAutoSaveEdit->set_value(officecfg::Office::Recovery::AutoSave::TimeIntervall::get());
+    
m_xAutoSaveEdit->set_sensitive(!officecfg::Office::Recovery::AutoSave::TimeIntervall::isReadOnly());
 
     // save relatively
     
m_xRelativeFsysCB->set_active(officecfg::Office::Common::Save::URL::FileSystem::get());
diff --git a/framework/source/services/autorecovery.cxx 
b/framework/source/services/autorecovery.cxx
index 07ea3184476f..a1a984e7617e 100644
--- a/framework/source/services/autorecovery.cxx
+++ b/framework/source/services/autorecovery.cxx
@@ -386,11 +386,6 @@ private:
     bool m_bListenForDocEvents;
     bool m_bListenForConfigChanges;
 
-    /** @short  specify the time interval between two save actions.
-        @descr  tools::Time is measured in [min].
-     */
-    sal_Int32 m_nAutoSaveTimeIntervall;
-
     /** @short  for an asynchronous operation we must know, if there is
                 at least one running job (may be asynchronous!).
      */
@@ -1003,7 +998,6 @@ private:
 constexpr OUStringLiteral CFG_PACKAGE_RECOVERY = 
u"org.openoffice.Office.Recovery/";
 
 const char CFG_ENTRY_AUTOSAVE_ENABLED[] = "AutoSave/Enabled";
-const char CFG_ENTRY_AUTOSAVE_TIMEINTERVALL[] = "AutoSave/TimeIntervall"; 
//sic!
 
 constexpr OUStringLiteral CFG_ENTRY_REALDEFAULTFILTER = 
u"ooSetupFactoryActualFilter";
 
@@ -1218,7 +1212,6 @@ AutoRecovery::AutoRecovery(css::uno::Reference< 
css::uno::XComponentContext >  x
     , m_xContext                (std::move(xContext                            
               ))
     , m_bListenForDocEvents     (false                                         
 )
     , m_bListenForConfigChanges (false                                         
 )
-    , m_nAutoSaveTimeIntervall  (0                                             
     )
     , m_eJob                    (Job::NoJob)
     , m_aTimer( "framework::AutoRecovery m_aTimer" )
     , m_xAsyncDispatcher        (new vcl::EventPoster( LINK( this, 
AutoRecovery, implts_asyncDispatch )  ))
@@ -1646,9 +1639,6 @@ void SAL_CALL AutoRecovery::changesOccurred(const 
css::util::ChangesEvent& aEven
                 }
             }
         }
-        else
-        if ( sPath == CFG_ENTRY_AUTOSAVE_TIMEINTERVALL )
-            pChanges[i].Element >>= m_nAutoSaveTimeIntervall;
     }
 
     } /* SAFE */
@@ -1754,7 +1744,7 @@ void AutoRecovery::implts_readAutoSaveConfig()
     implts_openConfig();
 
     // AutoSave [bool]
-    bool bEnabled(officecfg::Office::Common::Save::Document::AutoSave::get());
+    bool bEnabled(officecfg::Office::Recovery::AutoSave::Enabled::get());
 
     /* SAFE */ {
     osl::MutexGuard g(cppu::WeakComponentImplHelperBase::rBHelper.rMutex);
@@ -2206,11 +2196,7 @@ void AutoRecovery::implts_updateTimer()
 
     if (m_eTimerType == AutoRecovery::E_NORMAL_AUTOSAVE_INTERVALL)
     {
-        nMilliSeconds
-            = m_nAutoSaveTimeIntervall
-                  ? m_nAutoSaveTimeIntervall
-                  : 
officecfg::Office::Common::Save::Document::AutoSaveTimeIntervall::get();
-        nMilliSeconds *= 60000; // [min] => 60.000 ms
+        nMilliSeconds = 
officecfg::Office::Recovery::AutoSave::TimeIntervall::get() * 60000; // [min] 
=> 60.000 ms
     }
     else if (m_eTimerType == AutoRecovery::E_POLL_FOR_USER_IDLE)
     {
diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs 
b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
index 87ee6c665814..2219c4353faa 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
@@ -2041,11 +2041,8 @@
           <value>true</value>
         </prop>
         <prop oor:name="AutoSave" oor:type="xs:boolean" oor:nillable="false">
-          <!-- UIHints: Tools  Options - General  Save - [Section] Save -->
           <info>
-            <desc>Specifies whether all modified documents are automatically
-            saved in a time interval.</desc>
-            <label>AutoSave every</label>
+            <deprecated>Not used anymore</deprecated>
           </info>
           <value>true</value>
         </prop>
@@ -2086,23 +2083,9 @@
           <value>true</value>
         </prop>
         <prop oor:name="AutoSaveTimeIntervall" oor:type="xs:int" 
oor:nillable="false">
-          <!-- UIHints: Tools  Options - General  Save - [Section] Save -->
           <info>
-            <desc>Specifies the AutoSave time interval in minutes.</desc>
-            <label>Minutes</label>
+            <deprecated>Not used anymore</deprecated>
           </info>
-          <constraints>
-            <minInclusive oor:value="1">
-              <info>
-                <desc>Specifies that the minimum time interval is 1 
minute.</desc>
-              </info>
-            </minInclusive>
-            <maxInclusive oor:value="60">
-              <info>
-                <desc>Specifies that the maximum time interval is 60 
minutes.</desc>
-              </info>
-            </maxInclusive>
-          </constraints>
           <value>10</value>
         </prop>
         <prop oor:name="ViewInfo" oor:type="xs:boolean" oor:nillable="false">
diff --git a/officecfg/registry/schema/org/openoffice/Office/Recovery.xcs 
b/officecfg/registry/schema/org/openoffice/Office/Recovery.xcs
index 93f7ba8c4dc0..c14b729f0608 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Recovery.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Recovery.xcs
@@ -113,8 +113,11 @@
         <desc> </desc>
       </info>
       <prop oor:name="Enabled" oor:type="xs:boolean" oor:nillable="false">
+        <!-- UIHints: Tools  Options - General  Save - [Section] Save -->
         <info>
-          <desc> </desc>
+          <desc>Specifies whether all modified documents are automatically
+          saved in a time interval.</desc>
+          <label>AutoSave every</label>
         </info>
         <value>true</value>
       </prop>
@@ -125,9 +128,23 @@
         <value>false</value>
       </prop>
       <prop oor:name="TimeIntervall" oor:type="xs:int" oor:nillable="false">
-        <info>
-          <desc> </desc>
-        </info>
+        <!-- UIHints: Tools  Options - General  Save - [Section] Save -->
+        <info>
+          <desc>Specifies the AutoSave time interval in minutes.</desc>
+          <label>Minutes</label>
+        </info>
+        <constraints>
+          <minInclusive oor:value="1">
+            <info>
+              <desc>Specifies that the minimum time interval is 1 
minute.</desc>
+            </info>
+          </minInclusive>
+          <maxInclusive oor:value="60">
+            <info>
+              <desc>Specifies that the maximum time interval is 60 
minutes.</desc>
+            </info>
+          </maxInclusive>
+        </constraints>
         <value>10</value>
       </prop>
       <prop oor:name="MinSpaceDocSave" oor:type="xs:int" oor:nillable="false">
diff --git a/officecfg/util/sanity.xsl b/officecfg/util/sanity.xsl
index a02ba25c2972..6dd3e9ddf1dd 100644
--- a/officecfg/util/sanity.xsl
+++ b/officecfg/util/sanity.xsl
@@ -34,7 +34,7 @@
     <!-- match all elements that could possibly contain info/desc elements -->
     <xsl:template 
match="group|set|node-ref|prop|enumeration|length|minLength|maxLength|minInclusive|maxInclusive|minExclusive|maxExclusive|whiteSpace">
 
-        <xsl:if test="1>string-length(info/desc)">
+        <xsl:if test="(1>string-length(info/desc)) and (not(info/deprecated))">
             <!-- print TPF's path to current node -->
             <xsl:message terminate="yes">
 
diff --git a/sd/source/ui/slideshow/slideshowimpl.cxx 
b/sd/source/ui/slideshow/slideshowimpl.cxx
index 01165afaecd7..692b3d73ef64 100644
--- a/sd/source/ui/slideshow/slideshowimpl.cxx
+++ b/sd/source/ui/slideshow/slideshowimpl.cxx
@@ -37,7 +37,7 @@
 #include <com/sun/star/frame/XLayoutManager.hpp>
 #include <com/sun/star/presentation/SlideShow.hpp>
 #include <com/sun/star/media/XPlayer.hpp>
-#include <officecfg/Office/Common.hxx>
+#include <officecfg/Office/Recovery.hxx>
 #include <svl/stritem.hxx>
 #include <svl/urihelper.hxx>
 #include <basic/sbstar.hxx>
@@ -530,7 +530,7 @@ SlideshowImpl::SlideshowImpl( const Reference< 
XPresentation2 >& xPresentation,
     maInputFreezeTimer.SetTimeout( 20 );
 
         // no autosave during show
-    if( officecfg::Office::Common::Save::Document::AutoSave::get() )
+    if (officecfg::Office::Recovery::AutoSave::Enabled::get())
         mbAutoSaveWasOn = true;
 
     Application::AddEventListener( LINK( this, SlideshowImpl, EventListenerHdl 
) );
diff --git a/sfx2/source/appl/appcfg.cxx b/sfx2/source/appl/appcfg.cxx
index 5576c5c5b9bd..41603134a225 100644
--- a/sfx2/source/appl/appcfg.cxx
+++ b/sfx2/source/appl/appcfg.cxx
@@ -155,9 +155,9 @@ void SfxApplication::GetOptions( SfxItemSet& rSet )
                 case SID_ATTR_AUTOSAVE :
                     {
                         bRet = true;
-                        if 
(!officecfg::Office::Common::Save::Document::AutoSave::isReadOnly())
+                        if 
(!officecfg::Office::Recovery::AutoSave::Enabled::isReadOnly())
                             if (!rSet.Put( SfxBoolItem( SID_ATTR_AUTOSAVE,
-                                    
officecfg::Office::Common::Save::Document::AutoSave::get() )))
+                                    
officecfg::Office::Recovery::AutoSave::Enabled::get() )))
                                 bRet = false;
                     }
                     break;
@@ -173,9 +173,9 @@ void SfxApplication::GetOptions( SfxItemSet& rSet )
                 case SID_ATTR_AUTOSAVEMINUTE :
                     {
                         bRet = true;
-                        if 
(!officecfg::Office::Common::Save::Document::AutoSaveTimeIntervall::isReadOnly())
+                        if 
(!officecfg::Office::Recovery::AutoSave::TimeIntervall::isReadOnly())
                             if (!rSet.Put( SfxUInt16Item( 
SID_ATTR_AUTOSAVEMINUTE,
-                                    
officecfg::Office::Common::Save::Document::AutoSaveTimeIntervall::get() )))
+                                    
officecfg::Office::Recovery::AutoSave::TimeIntervall::get() )))
                                 bRet = false;
                     }
                     break;
@@ -447,7 +447,7 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& 
rSet )
     // AutoSave
     if ( const SfxBoolItem *pItem = rSet.GetItemIfSet( SID_ATTR_AUTOSAVE ))
     {
-        officecfg::Office::Common::Save::Document::AutoSave::set(
+        officecfg::Office::Recovery::AutoSave::Enabled::set(
             pItem->GetValue(),
             batch);
     }
@@ -463,7 +463,7 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& 
rSet )
     // AutoSave-Time
     if ( const SfxUInt16Item *pItem = 
rSet.GetItemIfSet(SID_ATTR_AUTOSAVEMINUTE ))
     {
-        officecfg::Office::Common::Save::Document::AutoSaveTimeIntervall::set(
+        officecfg::Office::Recovery::AutoSave::TimeIntervall::set(
                 pItem->GetValue(),
                 batch);
     }

Reply via email to