[ooo-build-commit] .: officecfg/registry sfx2/source

Kohei Yoshida kohei at kemper.freedesktop.org
Tue Oct 5 07:21:23 PDT 2010


 officecfg/registry/schema/org/openoffice/Office/Common.xcs |    7 +++++++
 sfx2/source/doc/guisaveas.cxx                              |   12 +++++++++---
 sfx2/source/doc/objserv.cxx                                |   10 +++++++---
 3 files changed, 23 insertions(+), 6 deletions(-)

New commits:
commit 54d5ffd4948bcd050c58a0369dec6235381a1fca
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Tue Oct 5 10:11:12 2010 -0400

    Ported always-save-option-*.diff from ooo-build.
    
    A new configuration option to toggle allowing of saves even when
    no "modification" has been made.

diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
index 113ecdc..be7d7eb 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
@@ -5791,6 +5791,13 @@
                 </info>
                 <value>false</value>
             </prop>
+            <prop oor:name="AlwaysAllowSave" oor:type="xs:boolean">
+                <info>
+                    <author>kohei</author>
+                    <desc>Determines if the user can save the document even when it's not modified.</desc>
+                </info>
+                <value>false</value>
+            </prop>
 			<prop oor:name="SymbolSet" oor:type="xs:short">
 				<!-- UIHints: Tools  Options General View -->
 				<info>
diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx
index 1e0093e..21878c0 100644
--- a/sfx2/source/doc/guisaveas.cxx
+++ b/sfx2/source/doc/guisaveas.cxx
@@ -67,6 +67,7 @@
 #include <svl/intitem.hxx>
 #include <unotools/useroptions.hxx>
 #include <unotools/saveopt.hxx>
+#include <svtools/miscopt.hxx>
 #include <tools/debug.hxx>
 #include <tools/urlobj.hxx>
 #include <comphelper/processfactory.hxx>
@@ -696,9 +697,14 @@ sal_Int8 ModelData_Impl::CheckStateForSave()
     if ( GetMediaDescr().size() != aAcceptedArgs.size() )
         GetMediaDescr() = aAcceptedArgs;
 
-    // the document must be modified
-    if ( !GetModifiable()->isModified() && !bVersInfoNeedsStore )
-        return STATUS_NO_ACTION;
+    // the document must be modified unless the always-save flag is set.
+    SvtMiscOptions aMiscOptions;
+    sal_Bool bAlwaysAllowSave = aMiscOptions.IsSaveAlwaysAllowed();
+    if (!bAlwaysAllowSave)
+    {
+        if ( !GetModifiable()->isModified() && !bVersInfoNeedsStore )
+            return STATUS_NO_ACTION;
+    }
 
     // if the document is readonly or a new one a SaveAs operation must be used
     if ( !GetStorable()->hasLocation() || GetStorable()->isReadonly() )
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index f4440b6..d40c5d8 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -63,8 +63,9 @@
 #include <basic/sbx.hxx>
 #include <unotools/pathoptions.hxx>
 #include <unotools/useroptions.hxx>
-#include <svtools/asynclink.hxx>
 #include <unotools/saveopt.hxx>
+#include <svtools/asynclink.hxx>
+#include <svtools/miscopt.hxx>
 #include <comphelper/documentconstants.hxx>
 
 #include <sfx2/app.hxx>
@@ -943,8 +944,11 @@ void SfxObjectShell::GetState_Impl(SfxItemSet &rSet)
                 }
             case SID_SAVEDOC:
                 {
-                    BOOL bMediumRO = IsReadOnlyMedium();
-                    if ( !bMediumRO && GetMedium() && IsModified() )
+                    SvtMiscOptions aMiscOptions;
+                    bool bAlwaysAllowSave = aMiscOptions.IsSaveAlwaysAllowed();
+                    bool bAllowSave = (bAlwaysAllowSave || IsModified());
+                    bool bMediumRO = IsReadOnlyMedium();
+                    if ( !bMediumRO && GetMedium() && bAllowSave )
                         rSet.Put(SfxStringItem(
                             nWhich, String(SfxResId(STR_SAVEDOC))));
                     else


More information about the ooo-build-commit mailing list