diff options
author | Eike Rathke <erack@redhat.com> | 2014-03-14 23:00:25 +0100 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2014-03-14 23:04:19 +0100 |
commit | 83a55e63f15a2b5f9897636bfb33a3ceb4105eba (patch) | |
tree | a1491a5b5ed4a06ae1ab2897ba6e89c25075b928 /sc/source/ui | |
parent | a12de5aab0c2f1553086de13a7bdb92fac81ee70 (diff) |
some formula interpreter options are document specific
Ideally they'd even be stored as document options. Future work?
Change-Id: Ida126a441ca88c35406fb66ea3722d6335e6e8e2
Diffstat (limited to 'sc/source/ui')
-rw-r--r-- | sc/source/ui/app/scmod.cxx | 9 | ||||
-rw-r--r-- | sc/source/ui/docshell/docsh6.cxx | 8 | ||||
-rw-r--r-- | sc/source/ui/inc/docsh.hxx | 1 |
3 files changed, 17 insertions, 1 deletions
diff --git a/sc/source/ui/app/scmod.cxx b/sc/source/ui/app/scmod.cxx index 99492d195ce1..b32a280b3862 100644 --- a/sc/source/ui/app/scmod.cxx +++ b/sc/source/ui/app/scmod.cxx @@ -2162,7 +2162,14 @@ SfxItemSet* ScModule::CreateItemSet( sal_uInt16 nId ) pRet->Put( ScTpDefaultsItem( SID_SCDEFAULTSOPTIONS, GetDefaultsOptions() ) ); // TP_FORMULA - pRet->Put( ScTpFormulaItem( SID_SCFORMULAOPTIONS, GetFormulaOptions() ) ); + ScFormulaOptions aOptions = GetFormulaOptions(); + if (pDocSh) + { + ScCalcConfig aConfig( aOptions.GetCalcConfig()); + aConfig.MergeDocumentSpecific( pDocSh->GetDocument()->GetCalcConfig()); + aOptions.SetCalcConfig( aConfig); + } + pRet->Put( ScTpFormulaItem( SID_SCFORMULAOPTIONS, aOptions ) ); } return pRet; } diff --git a/sc/source/ui/docshell/docsh6.cxx b/sc/source/ui/docshell/docsh6.cxx index a0d29a893948..4c573f4cfe7e 100644 --- a/sc/source/ui/docshell/docsh6.cxx +++ b/sc/source/ui/docshell/docsh6.cxx @@ -480,6 +480,14 @@ void ScDocShell::SetFormulaOptions(const ScFormulaOptions& rOpt ) // Global interpreter settings. ScInterpreter::SetGlobalConfig(rOpt.GetCalcConfig()); + + // Per document interpreter settings. + SetCalcConfig( rOpt.GetCalcConfig()); +} + +void ScDocShell::SetCalcConfig( const ScCalcConfig& rConfig ) +{ + aDocument.SetCalcConfig( rConfig); } void ScDocShell::CheckConfigOptions() diff --git a/sc/source/ui/inc/docsh.hxx b/sc/source/ui/inc/docsh.hxx index 49215fd72426..5227a755a42b 100644 --- a/sc/source/ui/inc/docsh.hxx +++ b/sc/source/ui/inc/docsh.hxx @@ -323,6 +323,7 @@ public: bool ReloadTabLinks(); void SetFormulaOptions(const ScFormulaOptions& rOpt ); + void SetCalcConfig( const ScCalcConfig& rConfig ); virtual void CheckConfigOptions(); void PostEditView( ScEditEngineDefaulter* pEditEngine, const ScAddress& rCursorPos ); |