diff options
author | Albert Thuswaldner <albert.thuswaldner@gmail.com> | 2012-04-12 21:20:58 +0200 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2012-04-13 12:00:17 -0400 |
commit | be7cbf49c4fa586bd6ec96c2d278a317894f569c (patch) | |
tree | 4b4394be3b88845ef9146a95c4acabcc5d0fb286 /sc/source/ui/app | |
parent | d117d974184e47ba2a5f2c8181207556f19ee5ef (diff) |
Moved ScDefaultsOptions from ScDocOptions to separate class
Diffstat (limited to 'sc/source/ui/app')
-rw-r--r-- | sc/source/ui/app/scmod.cxx | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/sc/source/ui/app/scmod.cxx b/sc/source/ui/app/scmod.cxx index 4dec73a976c7..c2eb40441e74 100644 --- a/sc/source/ui/app/scmod.cxx +++ b/sc/source/ui/app/scmod.cxx @@ -79,6 +79,7 @@ #include "viewopti.hxx" #include "docoptio.hxx" #include "appoptio.hxx" +#include "defaultsoptions.hxx" #include "formulaopt.hxx" #include "inputopt.hxx" #include "printopt.hxx" @@ -142,6 +143,7 @@ ScModule::ScModule( SfxObjectFactory* pFact ) : pViewCfg( NULL ), pDocCfg( NULL ), pAppCfg( NULL ), + pDefaultsCfg( NULL ), pFormulaCfg( NULL ), pInputCfg( NULL ), pPrintCfg( NULL ), @@ -344,6 +346,7 @@ void ScModule::DeleteCfg() DELETEZ( pViewCfg ); // Speichern passiert vor Exit() automatisch DELETEZ( pDocCfg ); DELETEZ( pAppCfg ); + DELETEZ( pDefaultsCfg ); DELETEZ( pFormulaCfg ); DELETEZ( pInputCfg ); DELETEZ( pPrintCfg ); @@ -852,6 +855,22 @@ const ScAppOptions& ScModule::GetAppOptions() return *pAppCfg; } +void ScModule::SetDefaultsOptions( const ScDefaultsOptions& rOpt ) +{ + if ( !pDefaultsCfg ) + pDefaultsCfg = new ScDefaultsCfg; + + pDefaultsCfg->SetOptions( rOpt ); +} + +const ScDefaultsOptions& ScModule::GetDefaultsOptions() +{ + if ( !pDefaultsCfg ) + pDefaultsCfg = new ScDefaultsCfg; + + return *pDefaultsCfg; +} + void ScModule::SetFormulaOptions( const ScFormulaOptions& rOpt ) { if ( !pFormulaCfg ) @@ -1046,6 +1065,16 @@ void ScModule::ModifyOptions( const SfxItemSet& rOptSet ) } //============================================ + // DefaultsOptions + //============================================ + + if (rOptSet.HasItem(SID_SCDEFAULTSOPTIONS, &pItem)) + { + const ScDefaultsOptions& rOpt = ((const ScTpDefaultsItem*)pItem)->GetDefaultsOptions(); + SetDefaultsOptions( rOpt ); + } + + //============================================ // FormulaOptions //============================================ @@ -1959,6 +1988,8 @@ SfxItemSet* ScModule::CreateItemSet( sal_uInt16 nId ) SID_ATTR_DEFTABSTOP, SID_ATTR_DEFTABSTOP, // TP_COMPATIBILITY SID_SC_OPT_KEY_BINDING_COMPAT, SID_SC_OPT_KEY_BINDING_COMPAT, + // TP_DEFAULTS + SID_SCDEFAULTSOPTIONS, SID_SCDEFAULTSOPTIONS, // TP_FORMULA SID_SCFORMULAOPTIONS, SID_SCFORMULAOPTIONS, 0 ); @@ -2031,6 +2062,9 @@ SfxItemSet* ScModule::CreateItemSet( sal_uInt16 nId ) pRet->Put( SfxUInt16Item( SID_SC_OPT_KEY_BINDING_COMPAT, rAppOpt.GetKeyBindingType() ) ); + // TP_DEFAULTS + pRet->Put( ScTpDefaultsItem( SID_SCDEFAULTSOPTIONS, GetDefaultsOptions() ) ); + // TP_FORMULA pRet->Put( ScTpFormulaItem( SID_SCFORMULAOPTIONS, GetFormulaOptions() ) ); } |