Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/2481

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/81/2481/1

not working, throws exception in config menu when trying to write config key

Change-Id: I2da740eeba796d630c58d209a3d685650096a206
---
M cui/source/options/optsave.src
M framework/source/services/autorecovery.cxx
M officecfg/registry/data/org/openoffice/Office/Recovery.xcu
M officecfg/registry/schema/org/openoffice/Office/Common.xcs
M shell/source/backends/gconfbe/gconfaccess.cxx
M shell/source/backends/gconfbe/gconfaccess.hxx
M unotools/source/config/saveopt.cxx
7 files changed, 50 insertions(+), 9 deletions(-)



diff --git a/cui/source/options/optsave.src b/cui/source/options/optsave.src
index d92df79..32bcb6e 100644
--- a/cui/source/options/optsave.src
+++ b/cui/source/options/optsave.src
@@ -115,7 +115,7 @@
         HelpID = "cui:CheckBox:RID_SFXPAGE_SAVE:BTN_USERAUTOSAVE"; //? FIX ME
         Pos = MAP_APPFONT ( 12 , 74 ) ;
         Size = MAP_APPFONT ( 163 , 10 ) ;
-        Text [ en-US ] = "Save document when saving ~AutoRecovery information" ;
+        Text [ en-US ] = "Save document when saving AutoRecovery information" ;
     };
     CheckBox BTN_RELATIVE_FSYS
     {
diff --git a/framework/source/services/autorecovery.cxx b/framework/source/services/autorecovery.cxx
index c9c14f9..c065d35 100644
--- a/framework/source/services/autorecovery.cxx
+++ b/framework/source/services/autorecovery.cxx
@@ -21,6 +21,8 @@
 #include "services/autorecovery.hxx"
 #include <loadenv/loadenv.hxx>
 
+#include <sfx2/sfxbasemodel.hxx> //?
+
 #include <loadenv/targethelper.hxx>
 #include <pattern/frame.hxx>
 #include <threadhelp/readguard.hxx>
@@ -124,7 +126,7 @@
 static const char CFG_ENTRY_AUTOSAVE_ENABLED[] = "AutoSave/Enabled";
 static const char CFG_ENTRY_AUTOSAVE_TIMEINTERVALL[] = "AutoSave/TimeIntervall"; //sic!
 
-static const char CFG_ENTRY_USERAUTOSAVE_ENABLED[] = "UserAutoSave/Enabled";
+static const char CFG_ENTRY_USERAUTOSAVE_ENABLED[] = "AutoSave/UserAutoSaveEnabled";
 
 static const char CFG_PATH_AUTOSAVE[] = "AutoSave";
 static const char CFG_ENTRY_MINSPACE_DOCSAVE[] = "MinSpaceDocSave";
@@ -2357,10 +2359,11 @@
         {
             xDocRecover->storeToRecoveryFile( rInfo.NewTempURL, 
lNewArgs.getAsConstPropertyValueList() );
 
-            //if userautosave is enabled, also save to the original file
+            // if userautosave is enabled, also save to the original file
             if((m_eJob & AutoRecovery::E_AUTO_SAVE) == AutoRecovery::E_AUTO_SAVE)
             {
-                //dispatchURL( rtl::OUString( ".uno:Save" ), rtl::OUString(), xFrame, aArgs );
+                //SfxBaseModel::storeToURL( rInfo.OrgURL, lOldArgs.getAsConstPropertyValueList() );
+                //xDocRecover->storeToRecoveryFile( rInfo.OrgURL, 
lOldArgs.getAsConstPropertyValueList() );
             }
 
 #ifdef TRIGGER_FULL_DISC_CHECK
diff --git a/officecfg/registry/data/org/openoffice/Office/Recovery.xcu 
b/officecfg/registry/data/org/openoffice/Office/Recovery.xcu
index e5fbed4..92cbff7 100644
--- a/officecfg/registry/data/org/openoffice/Office/Recovery.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/Recovery.xcu
@@ -25,6 +25,10 @@
       <value oor:external=
           "com.sun.star.configuration.backend.GconfBackend AutoSaveEnabled"/>
     </prop>
+    <prop oor:name="UserAutoSaveEnabled">
+      <value oor:external=
+          "com.sun.star.configuration.backend.GconfBackend UserAutoSaveEnabled"/>
+    </prop>
     <prop oor:name="TimeIntervall">
       <value oor:external=
        "com.sun.star.configuration.backend.GconfBackend AutoSaveTimeIntervall"/>
diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs 
b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
index 3e89fa1..f62fe36 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
@@ -2545,6 +2545,18 @@
           </info>
           <value>false</value>
         </prop>
+        <prop oor:name="UserAutoSaveEnabled" oor:type="xs:boolean" oor:nillable="false">
+          <!-- OldPath: General/Save/Documents -->
+          <!-- OldLocation: soffice.cfg -->
+          <!-- UIHints: Tools  Options - General  Save - [Section] Save -->
+          <info>
+            <author>_</author>
+            <desc>Specifies whether to save over the original document when
+            auto saving.</desc>
+            <label>Save file when AutoSaving</label>
+          </info>
+          <value>false</value>
+        </prop>
         <prop
             oor:name="CreateBackup" oor:type="xs:boolean" oor:nillable="false">
           <!-- OldPath: General/Save/Documents -->
diff --git a/shell/source/backends/gconfbe/gconfaccess.cxx 
b/shell/source/backends/gconfbe/gconfaccess.cxx
index 4705013..71276da 100644
--- a/shell/source/backends/gconfbe/gconfaccess.cxx
+++ b/shell/source/backends/gconfbe/gconfaccess.cxx
@@ -34,6 +34,7 @@
 
 #define GCONF_PROXY_MODE_KEY "/system/proxy/mode"
 #define GCONF_AUTO_SAVE_KEY  "/apps/openoffice/auto_save"
+#define GCONF_USER_AUTO_SAVE_KEY  "/apps/openoffice/user_auto_save"
 
 namespace gconfaccess {
 
@@ -433,6 +434,18 @@
             }
         }
             break;
+        case SETTING_USER_AUTO_SAVE:
+        {
+            GConfValue* pGconfValue = gconf_client_get( pClient, GCONF_USER_AUTO_SAVE_KEY, NULL );
+
+            if( ( pGconfValue != NULL ) )
+            {
+                bool bOk = gconf_value_get_bool( pGconfValue );
+                gconf_value_free( pGconfValue );
+                if (bOk) return sal_True;
+            }
+        }
+            break;
 #endif // ENABLE_LOCKDOWN
 
         default:
@@ -599,6 +612,14 @@
     },
 
     {
+        SETTING_USER_AUTO_SAVE,
+        GCONF_USER_AUTO_SAVE_KEY,
+        RTL_CONSTASCII_STRINGPARAM("UserAutoSaveEnabled"),
+        sal_False,
+        SETTINGS_LAST
+    },
+
+    {
         SETTING_AUTO_SAVE_INTERVAL,
         "/apps/openoffice/auto_save_interval",
         RTL_CONSTASCII_STRINGPARAM("AutoSaveTimeIntervall"),
diff --git a/shell/source/backends/gconfbe/gconfaccess.hxx 
b/shell/source/backends/gconfbe/gconfaccess.hxx
index 98ce947..7f0a52a 100644
--- a/shell/source/backends/gconfbe/gconfaccess.hxx
+++ b/shell/source/backends/gconfbe/gconfaccess.hxx
@@ -80,6 +80,7 @@
     SETTING_CREATE_BACKUP,
     SETTING_WARN_ALIEN_FORMAT,
     SETTING_AUTO_SAVE,
+    SETTING_USER_AUTO_SAVE,
     SETTING_AUTO_SAVE_INTERVAL,
     SETTING_WRITER_DEFAULT_DOC_FORMAT,
     SETTING_IMPRESS_DEFAULT_DOC_FORMAT,
diff --git a/unotools/source/config/saveopt.cxx b/unotools/source/config/saveopt.cxx
index 13b4d98..b0b8f06 100644
--- a/unotools/source/config/saveopt.cxx
+++ b/unotools/source/config/saveopt.cxx
@@ -591,8 +591,8 @@
 
     ::comphelper::ConfigurationHelper::readRelativeKey(
         xCFG,
-        ::rtl::OUString("UserAutoSave"),
-        ::rtl::OUString("Enabled")) >>= bUserAutoSave;
+        ::rtl::OUString("AutoSave"),
+        ::rtl::OUString("UserAutoSaveEnabled")) >>= bUserAutoSave;
     }
     catch(const css::uno::Exception&)
         { OSL_FAIL("Could not find needed informations for AutoSave feature."); }
@@ -793,9 +793,9 @@
 
     ::comphelper::ConfigurationHelper::writeRelativeKey(
         xCFG,
-        ::rtl::OUString("UserAutoSave"),
-        ::rtl::OUString("Enabled"),
-    css::uno::makeAny(bUserAutoSave));
+        ::rtl::OUString("AutoSave"),
+        ::rtl::OUString("UserAutoSaveEnabled"),
+        css::uno::makeAny(bUserAutoSave));
 
     ::comphelper::ConfigurationHelper::flush(xCFG);
 }

-- 
To view, visit https://gerrit.libreoffice.org/2481
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2da740eeba796d630c58d209a3d685650096a206
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Krisztian Pinter <pin.terminator@gmail.com>


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.