diff options
author | Kohei Yoshida <kyoshida@novell.com> | 2010-10-05 10:15:35 -0400 |
---|---|---|
committer | Kohei Yoshida <kyoshida@novell.com> | 2010-10-05 10:19:53 -0400 |
commit | fc7c68636687446d0723330e848faa93c4b7efd8 (patch) | |
tree | a689ac25f19290be20148c291c8d81804056c1e3 /svtools | |
parent | c3d6f3f840b8f5c8de0f318f1e0d90df7efc7329 (diff) |
Ported always-save-option-svtools.diff from ooo-build.
Loading and saving of the new configuration option related to the
"Allow document save even when the document has not been modified"
option.
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/inc/svtools/miscopt.hxx | 3 | ||||
-rw-r--r-- | svtools/source/config/miscopt.cxx | 42 |
2 files changed, 43 insertions, 2 deletions
diff --git a/svtools/inc/svtools/miscopt.hxx b/svtools/inc/svtools/miscopt.hxx index ecee18fbe6b4..5d642021ec48 100644 --- a/svtools/inc/svtools/miscopt.hxx +++ b/svtools/inc/svtools/miscopt.hxx @@ -146,6 +146,9 @@ class SVT_DLLPUBLIC SvtMiscOptions: public utl::detail::Options void SetShowLinkWarningDialog( sal_Bool bSet ); sal_Bool IsShowLinkWarningDialogReadOnly() const; + void SetSaveAlwaysAllowed( sal_Bool bSet ); + sal_Bool IsSaveAlwaysAllowed() const; + //------------------------------------------------------------------------------------------------------------- // private methods //------------------------------------------------------------------------------------------------------------- diff --git a/svtools/source/config/miscopt.cxx b/svtools/source/config/miscopt.cxx index e036225cb5f4..45fcc187b741 100644 --- a/svtools/source/config/miscopt.cxx +++ b/svtools/source/config/miscopt.cxx @@ -84,8 +84,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> @@ -119,6 +121,7 @@ class SvtMiscOptions_Impl : public ConfigItem sal_Bool m_bShowLinkWarningDialog; sal_Bool m_bIsShowLinkWarningDialogRO; sal_Bool m_bDisableUICustomization; + sal_Bool m_bAlwaysAllowSave; //------------------------------------------------------------------------------------------------------------- // public methods @@ -199,6 +202,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; } @@ -307,6 +316,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. @@ -418,6 +428,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; + } } } @@ -538,6 +554,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; } } } @@ -707,6 +729,11 @@ void SvtMiscOptions_Impl::Commit() seqValues[nProperty] <<= m_bDisableUICustomization; break; } + case PROPERTYHANDLE_ALWAYSALLOWSAVE : + { + seqValues[nProperty] <<= m_bAlwaysAllowSave; + break; + } } } // Set properties in configuration. @@ -729,7 +756,8 @@ Sequence< OUString > SvtMiscOptions_Impl::GetPropertyNames() PROPERTYNAME_USESYSTEMPRINTDIALOG, PROPERTYNAME_TRYODMADIALOG, PROPERTYNAME_SHOWLINKWARNINGDIALOG, - PROPERTYNAME_DISABLEUICUSTOMIZATION + PROPERTYNAME_DISABLEUICUSTOMIZATION, + PROPERTYNAME_ALWAYSALLOWSAVE }; // Initialize return sequence with these list ... @@ -935,6 +963,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 //***************************************************************************************************************** |