[ooo-build-commit] patches/dev300

Kohei Yoshida kohei at kemper.freedesktop.org
Tue Dec 1 22:21:42 PST 2009


 patches/dev300/always-allow-save-document-sc.diff   |   60 --------
 patches/dev300/always-allow-save-document-sfx2.diff |   97 -------------
 patches/dev300/always-save-option-officecfg.diff    |   18 ++
 patches/dev300/always-save-option-sfx2.diff         |   56 +++++++
 patches/dev300/always-save-option-svtools.diff      |  124 +++++++++++++++++
 patches/dev300/always-save-option-svx.diff          |  143 ++++++++++++++++++++
 patches/dev300/apply                                |   12 +
 7 files changed, 349 insertions(+), 161 deletions(-)

New commits:
commit ab3c1b5a891881c0f1cf30773ccbb94efd3f5bca
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Wed Dec 2 00:32:49 2009 -0500

    Make the save icon behavior a configuration option.
    
    * patches/dev300/always-allow-save-document-sc.diff:
    * patches/dev300/always-allow-save-document-sfx2.diff: old patches
      removed.
    
    * patches/dev300/always-save-option-officecfg.diff:
    * patches/dev300/always-save-option-sfx2.diff:
    * patches/dev300/always-save-option-svtools.diff:
    * patches/dev300/always-save-option-svx.diff:
    * patches/dev300/apply: new patches to implement a configurable
      save icon.  You can now configure whether or not the save action
      is always enabled regardless of document's modified status.  The
      default is off.  The option is located in the General page of
      the Options dialog. (n#556125)

diff --git a/patches/dev300/always-allow-save-document-sc.diff b/patches/dev300/always-allow-save-document-sc.diff
deleted file mode 100644
index 1082cb7..0000000
--- a/patches/dev300/always-allow-save-document-sc.diff
+++ /dev/null
@@ -1,60 +0,0 @@
-diff --git sc/inc/unonames.hxx sc/inc/unonames.hxx
-index 18c858b..0dbbfe3 100644
---- sc/inc/unonames.hxx
-+++ sc/inc/unonames.hxx
-@@ -482,6 +482,7 @@
- #define SC_UNO_ISEXECUTELINKENABLED     "IsExecuteLinkEnabled"
- #define SC_UNO_ISCHANGEREADONLYENABLED  "IsChangeReadOnlyEnabled"
- #define SC_UNO_REFERENCEDEVICE          "ReferenceDevice"
-+#define SC_UNO_ALWAYS_ALLOW_SAVE        "AlwaysAllowSave"
- 
- //	document properties from FormModel
- #define SC_UNO_APPLYFMDES			"ApplyFormDesignMode"
-diff --git sc/source/ui/docshell/docsh6.cxx sc/source/ui/docshell/docsh6.cxx
-index d4f4b61..b41b4a1 100644
---- sc/source/ui/docshell/docsh6.cxx
-+++ sc/source/ui/docshell/docsh6.cxx
-@@ -436,6 +436,16 @@ void ScDocShell::UpdateLinks()
- 		}
- }
- 
-+bool ScDocShell::GetApplicationFlag(SfxApplicationFlagType eFlagType)
-+{
-+    switch (eFlagType)
-+    {
-+        case SFX_APPFLAG_ALWAYS_ALLOW_SAVE:
-+            return true;
-+    }
-+    return false;
-+}
-+
- BOOL ScDocShell::ReloadTabLinks()
- {
- 	SvxLinkManager* pLinkManager = aDocument.GetLinkManager();
-diff --git sc/source/ui/inc/docsh.hxx sc/source/ui/inc/docsh.hxx
-index fcf3f7f..a53d4dc 100644
---- sc/source/ui/inc/docsh.hxx
-+++ sc/source/ui/inc/docsh.hxx
-@@ -311,6 +311,9 @@ public:
-     void            CancelAutoDBRange();    // called when dialog is cancelled
- 
- 	void			UpdateLinks();			// Link-Eintraege aktuallisieren
-+
-+    virtual bool GetApplicationFlag(SfxApplicationFlagType eFlagType);
-+
- 	BOOL			ReloadTabLinks();		// Links ausfuehren (Inhalt aktualisieren)
- 
- 	void            PostEditView( ScEditEngineDefaulter* pEditEngine, const ScAddress& rCursorPos );
-diff --git sc/source/ui/unoobj/docuno.cxx sc/source/ui/unoobj/docuno.cxx
-index d1bee0d..9c9b897 100644
---- sc/source/ui/unoobj/docuno.cxx
-+++ sc/source/ui/unoobj/docuno.cxx
-@@ -1587,6 +1587,8 @@ uno::Any SAL_CALL ScModelObj::getPropertyValue( const rtl::OUString& aPropertyNa
-             pXDev->SetOutputDevice( pDoc->GetRefDevice() );
-             aRet <<= uno::Reference< awt::XDevice >( pXDev );
-         }
-+        else if (aString.EqualsAscii(SC_UNO_ALWAYS_ALLOW_SAVE))
-+            ScUnoHelpFunctions::SetBoolInAny(aRet, pDocShell->GetApplicationFlag(SFX_APPFLAG_ALWAYS_ALLOW_SAVE));
-         else if ( aString.EqualsAscii( "BuildId" ) )
- 		{
- 			aRet <<= maBuildId;
diff --git a/patches/dev300/always-allow-save-document-sfx2.diff b/patches/dev300/always-allow-save-document-sfx2.diff
deleted file mode 100644
index 715bede..0000000
--- a/patches/dev300/always-allow-save-document-sfx2.diff
+++ /dev/null
@@ -1,97 +0,0 @@
-diff --git sfx2/inc/sfx2/objsh.hxx sfx2/inc/sfx2/objsh.hxx
-index f365bbf..c65280b 100644
---- sfx2/inc/sfx2/objsh.hxx
-+++ sfx2/inc/sfx2/objsh.hxx
-@@ -203,6 +203,10 @@ enum SfxTitleQuery
- 	SFX_TITLE_QUERY_SAVE_NAME_PROPOSAL
- };
- 
-+enum SfxApplicationFlagType
-+{
-+    SFX_APPFLAG_ALWAYS_ALLOW_SAVE
-+};
- 
- class SfxToolBoxConfig;
- struct TransferableObjectDescriptor;
-@@ -350,6 +354,7 @@ public:
-     virtual sal_Bool            SwitchPersistance(
- 									const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage );
-     virtual void                UpdateLinks();
-+    virtual bool                GetApplicationFlag(SfxApplicationFlagType eFlagType);
- 
-     sal_Bool                    SaveChildren(BOOL bObjectsOnly=FALSE);
-     sal_Bool                    SaveAsChildren( SfxMedium &rMedium );
-diff --git sfx2/source/doc/guisaveas.cxx sfx2/source/doc/guisaveas.cxx
-index 049f9b7..da8f008 100644
---- sfx2/source/doc/guisaveas.cxx
-+++ sfx2/source/doc/guisaveas.cxx
-@@ -597,6 +597,7 @@ sal_Int8 ModelData_Impl::CheckStateForSave()
- 	::rtl::OUString aAuthorString = ::rtl::OUString::createFromAscii( "Author" );
- 	::rtl::OUString aInteractionHandlerString = ::rtl::OUString::createFromAscii( "InteractionHandler" );
- 	::rtl::OUString aStatusIndicatorString = ::rtl::OUString::createFromAscii( "StatusIndicator" );
-+    ::rtl::OUString aAlwaysSaveString = ::rtl::OUString::createFromAscii("AlwaysAllowSave");
- 
- 	if ( GetMediaDescr().find( aVersionCommentString ) != GetMediaDescr().end() )
- 	{
-@@ -616,9 +617,26 @@ 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.
-+    sal_Bool bAlwaysAllowSave = sal_False;
-+    uno::Reference<beans::XPropertySet> xPropSet(m_xModel, uno::UNO_QUERY);
-+    if (xPropSet.is())
-+    {
-+        try
-+        {
-+            uno::Any any = xPropSet->getPropertyValue( aAlwaysSaveString );
-+            any >>= bAlwaysAllowSave;
-+        }
-+        catch (const beans::UnknownPropertyException&)
-+        {
-+            // do nothing...
-+        }
-+    }
-+    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 sfx2/source/doc/objserv.cxx sfx2/source/doc/objserv.cxx
-index 1d114cb..204dd55 100644
---- sfx2/source/doc/objserv.cxx
-+++ sfx2/source/doc/objserv.cxx
-@@ -988,8 +988,9 @@ void SfxObjectShell::GetState_Impl(SfxItemSet &rSet)
- 				}
- 			case SID_SAVEDOC:
- 	            {
--					BOOL bMediumRO = IsReadOnlyMedium();
--                    if ( !bMediumRO && GetMedium() && IsModified() )
-+                    bool bAllowSave = (GetApplicationFlag(SFX_APPFLAG_ALWAYS_ALLOW_SAVE) || IsModified());
-+                    bool bMediumRO = IsReadOnlyMedium();                                                  
-+                    if ( !bMediumRO && GetMedium() && bAllowSave )
- 						rSet.Put(SfxStringItem(
- 							nWhich, String(SfxResId(STR_SAVEDOC))));
- 					else
-diff --git sfx2/source/doc/objstor.cxx sfx2/source/doc/objstor.cxx
-index e82361c..a060ddc 100644
---- sfx2/source/doc/objstor.cxx
-+++ sfx2/source/doc/objstor.cxx
-@@ -3825,6 +3825,11 @@ void SfxObjectShell::UpdateLinks()
- {
- }
- 
-+bool SfxObjectShell::GetApplicationFlag(SfxApplicationFlagType eFlagType)
-+{
-+    return false;
-+}
-+
- sal_Bool SfxObjectShell::QuerySaveSizeExceededModules_Impl( const uno::Reference< task::XInteractionHandler >& xHandler )
- {
-     if ( !HasBasic() )
diff --git a/patches/dev300/always-save-option-officecfg.diff b/patches/dev300/always-save-option-officecfg.diff
new file mode 100644
index 0000000..e1b0e4e
--- /dev/null
+++ b/patches/dev300/always-save-option-officecfg.diff
@@ -0,0 +1,18 @@
+diff --git officecfg/registry/schema/org/openoffice/Office/Common.xcs officecfg/registry/schema/org/openoffice/Office/Common.xcs
+index d158081..055b62f 100644
+--- officecfg/registry/schema/org/openoffice/Office/Common.xcs
++++ officecfg/registry/schema/org/openoffice/Office/Common.xcs
+@@ -5765,6 +5765,13 @@ Dymamic border coloring means that when the mouse is hovered over a control, and
+ 				</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/patches/dev300/always-save-option-sfx2.diff b/patches/dev300/always-save-option-sfx2.diff
new file mode 100644
index 0000000..67205b9
--- /dev/null
+++ b/patches/dev300/always-save-option-sfx2.diff
@@ -0,0 +1,56 @@
+diff --git sfx2/source/doc/guisaveas.cxx sfx2/source/doc/guisaveas.cxx
+index d0b40db..43479b1 100644
+--- sfx2/source/doc/guisaveas.cxx
++++ sfx2/source/doc/guisaveas.cxx
+@@ -68,6 +68,7 @@
+ #include <svtools/adrparse.hxx>
+ #include <svtools/useroptions.hxx>
+ #include <svtools/saveopt.hxx>
++#include "svtools/miscopt.hxx"
+ #include <tools/debug.hxx>
+ #include <tools/urlobj.hxx>
+ #include <comphelper/processfactory.hxx>
+@@ -627,9 +628,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 sfx2/source/doc/objserv.cxx sfx2/source/doc/objserv.cxx
+index 801aad7..d887e73 100644
+--- sfx2/source/doc/objserv.cxx
++++ sfx2/source/doc/objserv.cxx
+@@ -68,6 +68,7 @@
+ #include <svtools/useroptions.hxx>
+ #include <svtools/asynclink.hxx>
+ #include <svtools/saveopt.hxx>
++#include "svtools/miscopt.hxx"
+ #include <comphelper/documentconstants.hxx>
+ 
+ #include <sfx2/app.hxx>
+@@ -968,8 +969,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
diff --git a/patches/dev300/always-save-option-svtools.diff b/patches/dev300/always-save-option-svtools.diff
new file mode 100644
index 0000000..af8a108
--- /dev/null
+++ b/patches/dev300/always-save-option-svtools.diff
@@ -0,0 +1,124 @@
+diff --git svtools/inc/svtools/miscopt.hxx svtools/inc/svtools/miscopt.hxx
+index e7a9511..2146df7 100644
+--- svtools/inc/svtools/miscopt.hxx
++++ svtools/inc/svtools/miscopt.hxx
+@@ -149,6 +149,9 @@ class SVT_DLLPUBLIC SvtMiscOptions: public svt::detail::Options
+         void        SetShowLinkWarningDialog( sal_Bool bSet );
+         sal_Bool    IsShowLinkWarningDialogReadOnly() const;
+ 
++        void        SetSaveAlwaysAllowed( sal_Bool bSet );
++        sal_Bool    IsSaveAlwaysAllowed() const;
++
+     //-------------------------------------------------------------------------------------------------------------
+     //	private methods
+     //-------------------------------------------------------------------------------------------------------------
+diff --git svtools/source/config/miscopt.cxx svtools/source/config/miscopt.cxx
+index 49e20ed..a4250bb 100644
+--- svtools/source/config/miscopt.cxx
++++ svtools/source/config/miscopt.cxx
+@@ -91,8 +91,10 @@ using namespace ::com::sun::star;
+ #define PROPERTYHANDLE_SHOWLINKWARNINGDIALOG 7
+ #define PROPERTYNAME_DISABLEUICUSTOMIZATION	ASCII_STR("DisableUICustomization")
+ #define PROPERTYHANDLE_DISABLEUICUSTOMIZATION			8
++#define PROPERTYNAME_ALWAYSALLOWSAVE ASCII_STR("AlwaysAllowSave")
++#define PROPERTYHANDLE_ALWAYSALLOWSAVE 9
+ 
+-#define PROPERTYCOUNT						9
++#define PROPERTYCOUNT                       10
+ 
+ #define VCL_TOOLBOX_STYLE_FLAT				((USHORT)0x0004) // from <vcl/toolbox.hxx>
+ 
+@@ -126,6 +128,7 @@ class SvtMiscOptions_Impl : public ConfigItem
+     sal_Bool    m_bShowLinkWarningDialog;
+     sal_Bool    m_bIsShowLinkWarningDialogRO;
+     sal_Bool    m_bDisableUICustomization;
++    sal_Bool    m_bAlwaysAllowSave;
+ 
+     //-------------------------------------------------------------------------------------------------------------
+     //	public methods
+@@ -206,6 +209,12 @@ class SvtMiscOptions_Impl : public ConfigItem
+         inline sal_Bool DisableUICustomization() const
+         { return m_bDisableUICustomization; }
+ 
++        inline void SetSaveAlwaysAllowed( sal_Bool bSet )
++        { m_bAlwaysAllowSave = bSet; SetModified(); }
++
++        inline sal_Bool IsSaveAlwaysAllowed() const
++        { return m_bAlwaysAllowSave; }
++
+         inline sal_Bool IsPluginsEnabled() const
+         { return m_bPluginsEnabled; }
+ 
+@@ -352,6 +361,7 @@ SvtMiscOptions_Impl::SvtMiscOptions_Impl()
+     , m_bIsUseSystemPrintDialogRO( sal_False )
+     , m_bShowLinkWarningDialog( sal_True )
+     , m_bIsShowLinkWarningDialogRO( sal_False )
++    , m_bAlwaysAllowSave( sal_False )
+ 
+ {
+     // Use our static list of configuration keys to get his values.
+@@ -463,6 +473,12 @@ SvtMiscOptions_Impl::SvtMiscOptions_Impl()
+                     DBG_ERROR("Wrong type of \"Misc\\DisableUICustomization\"!" );
+                     break;
+             }
++            case PROPERTYHANDLE_ALWAYSALLOWSAVE : 
++            {
++                if( !(seqValues[nProperty] >>= m_bAlwaysAllowSave) )
++                    DBG_ERROR("Wrong type of \"Misc\\AlwaysAllowSave\"!" );
++                    break;
++            }
+         }
+     }
+ 
+@@ -583,6 +599,12 @@ void SvtMiscOptions_Impl::Load( const Sequence< OUString >& rPropertyNames )
+                                                                 DBG_ERROR("Wrong type of \"Misc\\DisableUICustomization\"!" );
+                                                         }
+                                                     break;
++            case PROPERTYHANDLE_ALWAYSALLOWSAVE:
++            {
++                if( !(seqValues[nProperty] >>= m_bAlwaysAllowSave) )
++                    DBG_ERROR("Wrong type of \"Misc\\AlwaysAllowSave\"!" );
++            }
++            break;
+         }
+     }
+ }
+@@ -752,6 +774,11 @@ void SvtMiscOptions_Impl::Commit()
+                 seqValues[nProperty] <<= m_bDisableUICustomization;
+                 break;
+             }
++            case PROPERTYHANDLE_ALWAYSALLOWSAVE :
++            {
++                seqValues[nProperty] <<= m_bAlwaysAllowSave;
++                break;
++            }
+         }
+     }
+     // Set properties in configuration.
+@@ -774,7 +801,8 @@ Sequence< OUString > SvtMiscOptions_Impl::GetPropertyNames()
+         PROPERTYNAME_USESYSTEMPRINTDIALOG,
+         PROPERTYNAME_TRYODMADIALOG,
+         PROPERTYNAME_SHOWLINKWARNINGDIALOG,
+-        PROPERTYNAME_DISABLEUICUSTOMIZATION
++        PROPERTYNAME_DISABLEUICUSTOMIZATION,
++        PROPERTYNAME_ALWAYSALLOWSAVE
+     };
+ 
+     // Initialize return sequence with these list ...
+@@ -980,6 +1008,16 @@ sal_Bool SvtMiscOptions::IsShowLinkWarningDialogReadOnly() const
+     return m_pDataContainer->IsShowLinkWarningDialogReadOnly();
+ }
+ 
++void SvtMiscOptions::SetSaveAlwaysAllowed( sal_Bool bSet )
++{
++    m_pDataContainer->SetSaveAlwaysAllowed( bSet );
++}
++
++sal_Bool SvtMiscOptions::IsSaveAlwaysAllowed() const
++{
++    return m_pDataContainer->IsSaveAlwaysAllowed();
++}
++
+ //*****************************************************************************************************************
+ //	private method
+ //*****************************************************************************************************************
diff --git a/patches/dev300/always-save-option-svx.diff b/patches/dev300/always-save-option-svx.diff
new file mode 100644
index 0000000..cc3b8c0
--- /dev/null
+++ b/patches/dev300/always-save-option-svx.diff
@@ -0,0 +1,143 @@
+diff --git svx/source/cui/optgdlg.cxx svx/source/cui/optgdlg.cxx
+index de0e90c..5ff4def 100644
+--- svx/source/cui/optgdlg.cxx
++++ svx/source/cui/optgdlg.cxx
+@@ -223,6 +223,7 @@ OfaMiscTabPage::OfaMiscTabPage(Window* pParent, const SfxItemSet& rSet ) :
+     aPrintDlgCB			( this, SVX_RES( CB_PRINTDLG ) ),
+     aDocStatusFL		( this, SVX_RES( FL_DOCSTATUS ) ),
+     aDocStatusCB		( this, SVX_RES( CB_DOCSTATUS ) ),
++    aSaveAlwaysCB       ( this, SVX_RES( CB_SAVE_ALWAYS ) ),
+     aTwoFigureFL		( this, SVX_RES( FL_TWOFIGURE ) ),
+     aInterpretFT		( this, SVX_RES( FT_INTERPRET ) ),
+     aYearValueField		( this, SVX_RES( NF_YEARVALUE ) ),
+@@ -253,7 +254,7 @@ OfaMiscTabPage::OfaMiscTabPage(Window* pParent, const SfxItemSet& rSet ) :
+ 
+ 		Window* pWins[] =
+ 		{
+-		    &aDocStatusFL, &aDocStatusCB, &aTwoFigureFL,
++		    &aDocStatusFL, &aDocStatusCB, &aSaveAlwaysCB, &aTwoFigureFL,
+ 		    &aInterpretFT, &aYearValueField, &aToYearFT
+ 		};
+ 		Window** pCurrent = pWins;
+@@ -275,8 +276,8 @@ OfaMiscTabPage::OfaMiscTabPage(Window* pParent, const SfxItemSet& rSet ) :
+ 
+         Window* pWins[] =
+         {
+-            &aPrintDlgFL, &aPrintDlgCB, &aDocStatusFL, &aDocStatusCB, &aTwoFigureFL,
+-            &aInterpretFT, &aYearValueField, &aToYearFT
++            &aPrintDlgFL, &aPrintDlgCB, &aDocStatusFL, &aDocStatusCB, &aSaveAlwaysCB,
++            &aTwoFigureFL, &aInterpretFT, &aYearValueField, &aToYearFT
+         };
+         Window** pCurrent = pWins;
+         const sal_Int32 nCount = sizeof( pWins ) / sizeof( pWins[ 0 ] );
+@@ -301,7 +302,7 @@ OfaMiscTabPage::OfaMiscTabPage(Window* pParent, const SfxItemSet& rSet ) :
+ 
+         Window* pWins[] =
+         {
+-            &aDocStatusFL, &aDocStatusCB, &aTwoFigureFL,
++            &aDocStatusFL, &aDocStatusCB, &aSaveAlwaysCB, &aTwoFigureFL,
+             &aInterpretFT, &aYearValueField, &aToYearFT
+         };
+         Window** pCurrent = pWins;
+@@ -432,6 +433,13 @@ BOOL OfaMiscTabPage::FillItemSet( SfxItemSet& rSet )
+         bModified = TRUE;
+     }
+ 
++    if ( aSaveAlwaysCB.IsChecked() != aSaveAlwaysCB.GetSavedValue() )
++    {
++        SvtMiscOptions aMiscOpt;
++        aMiscOpt.SetSaveAlwaysAllowed( aSaveAlwaysCB.IsChecked() );
++        bModified = TRUE;
++    }
++
+     const SfxUInt16Item* pUInt16Item =
+         PTR_CAST( SfxUInt16Item, GetOldItem( rSet, SID_ATTR_YEAR2000 ) );
+     USHORT nNum = (USHORT)aYearValueField.GetText().ToInt32();
+@@ -473,6 +481,8 @@ void OfaMiscTabPage::Reset( const SfxItemSet& rSet )
+     aFileDlgCB.SaveValue();
+     aPrintDlgCB.Check( !aMiscOpt.UseSystemPrintDialog() );
+     aPrintDlgCB.SaveValue();
++    aSaveAlwaysCB.Check( aMiscOpt.IsSaveAlwaysAllowed() );
++    aSaveAlwaysCB.SaveValue();
+ 
+     aODMADlgCB.Check( aMiscOpt.TryODMADialog() );
+     aODMADlgCB.SaveValue();
+diff --git svx/source/cui/optgdlg.hrc svx/source/cui/optgdlg.hrc
+index bea3f72..f499400 100644
+--- svx/source/cui/optgdlg.hrc
++++ svx/source/cui/optgdlg.hrc
+@@ -59,7 +59,8 @@
+ #define ROW9					(ROW8+RSC_CD_CHECKBOX_HEIGHT+ROWSPACE)
+ #define ROW10					(ROW9+RSC_CD_FIXEDLINE_HEIGHT+ROWSPACE)
+ #define ROW11					(ROW10+RSC_CD_CHECKBOX_HEIGHT+ROWSPACE)
+-#define ROW12					(ROW11+RSC_CD_FIXEDLINE_HEIGHT+ROWSPACE)
++#define ROW12					(ROW11+RSC_CD_CHECKBOX_HEIGHT+ROWSPACE)
++#define ROW13					(ROW12+RSC_CD_FIXEDLINE_HEIGHT+ROWSPACE)
+ 
+ #define DIFF(v1,v2)						(v2-v1)
+ #define OFFS_TEXTBOX_FIXEDTEXT(base)	(base+(RSC_CD_TEXTBOX_HEIGHT-RSC_CD_FIXEDTEXT_HEIGHT)/2)
+@@ -204,6 +205,7 @@
+ #define FL_DOCSTATUS                60
+ #define CB_DOCSTATUS                61
+ #define CB_ODMADLG                  62
++#define CB_SAVE_ALWAYS              74
+ #endif // #ifndef _SVX_OPTGDLG_HRC
+ 
+ // ******************************************************************* EOF
+diff --git svx/source/cui/optgdlg.hxx svx/source/cui/optgdlg.hxx
+index 2a26918..f3d233d 100644
+--- svx/source/cui/optgdlg.hxx
++++ svx/source/cui/optgdlg.hxx
+@@ -66,6 +66,7 @@ private:
+ 
+     FixedLine           aDocStatusFL;
+     CheckBox            aDocStatusCB;
++    CheckBox            aSaveAlwaysCB;
+ 
+     FixedLine           aTwoFigureFL;
+     FixedText			aInterpretFT;
+diff --git svx/source/cui/optgdlg.src svx/source/cui/optgdlg.src
+index 8805d4b..6831324 100644
+--- svx/source/cui/optgdlg.src
++++ svx/source/cui/optgdlg.src
+@@ -134,22 +134,28 @@ TabPage OFA_TP_MISC
+         Size = MAP_APPFONT( WHOLE_WIDTH - COL1, RSC_CD_CHECKBOX_HEIGHT );
+         Text [ en-US ] = "~Printing sets \"document modified\" status";
+     };
++    CheckBox CB_SAVE_ALWAYS
++    {
++        Pos = MAP_APPFONT( COL1, ROW11 );
++        Size = MAP_APPFONT( WHOLE_WIDTH - COL1, RSC_CD_CHECKBOX_HEIGHT );
++        Text [ en-US ] = "Always allow saving of document";
++    };
+     FixedLine FL_TWOFIGURE
+     {
+-		Pos = MAP_APPFONT( COL0, ROW11 );
++        Pos = MAP_APPFONT( COL0, ROW12 );
+         Size = MAP_APPFONT( WHOLE_WIDTH, RSC_CD_FIXEDLINE_HEIGHT );
+         Text [ en-US ] = "Year (two digits)" ;
+     };
+     FixedText FT_INTERPRET
+     {
+-		Pos = MAP_APPFONT( COL1, OFFS_TEXTBOX_FIXEDTEXT(ROW12) );
++        Pos = MAP_APPFONT( COL1, OFFS_TEXTBOX_FIXEDTEXT(ROW13) );
+         Size = MAP_APPFONT( DIFF( COL1, COL3), RSC_CD_FIXEDTEXT_HEIGHT );
+         Text [ en-US ] = "Interpret as years between";
+     };
+     NumericField NF_YEARVALUE
+     {
+         Border = TRUE ;
+-		Pos = MAP_APPFONT( COL4, ROW12 );
++        Pos = MAP_APPFONT( COL4, ROW13 );
+         Size = MAP_APPFONT( EDIT_WIDTH, RSC_CD_TEXTBOX_HEIGHT );
+         Minimum = 1583 ;
+         Maximum = 9857 ;
+@@ -158,7 +164,7 @@ TabPage OFA_TP_MISC
+     };
+     FixedText FT_TOYEAR
+     {
+-		Pos = MAP_APPFONT( COL6, OFFS_TEXTBOX_FIXEDTEXT(ROW12) );
++        Pos = MAP_APPFONT( COL6, OFFS_TEXTBOX_FIXEDTEXT(ROW13) );
+         Size = MAP_APPFONT( WHOLE_WIDTH - COL6, RSC_CD_FIXEDTEXT_HEIGHT );
+         Text [ en-US ] = "and " ;
+     };
diff --git a/patches/dev300/apply b/patches/dev300/apply
index 8175b32..0852ec1 100644
--- a/patches/dev300/apply
+++ b/patches/dev300/apply
@@ -965,10 +965,6 @@ svtools-unsort-template-dialogentries.diff, rodo
 # display command line help '-h' to stdout instead of stderr.
 desktop-cmdhelp-stdout.diff, kohei
 
-# always enable file save even when the document is not modified.
-always-allow-save-document-sfx2.diff, n#347423, n#450789, i#5226, kohei
-always-allow-save-document-sc.diff,   n#347423, n#450789, i#5226, kohei
-
 # Adjust scroll speed while extending selection beyoud visible sheet area.
 scroll-accel-sc.diff, n#375909, i#71362, kohei
 scroll-accel-vcl.diff, n#375909, i#71362, kohei
@@ -3445,3 +3441,11 @@ libwpd-testing.diff
 libwpg-testing.diff
 libwps-testing.diff
 writerperfect-testing.diff
+
+[ Misc ]
+
+# make the always save behavior configurable.
+always-save-option-officecfg.diff, n#556125, i#5226, kohei
+always-save-option-sfx2.diff,      n#556125, i#5226, kohei
+always-save-option-svtools.diff,   n#556125, i#5226, kohei
+always-save-option-svx.diff,       n#556125, i#5226, kohei


More information about the ooo-build-commit mailing list