Kaydet (Commit) 90284a5e authored tarafından Albert Thuswaldner's avatar Albert Thuswaldner Kaydeden (comit) Kohei Yoshida

Splitting ScDocument::SetDocOptions, moved new SetFormulaOptions to ScDocShell

üst b091acc2
...@@ -52,10 +52,8 @@ ...@@ -52,10 +52,8 @@
#include "rangelst.hxx" #include "rangelst.hxx"
#include "chartarr.hxx" #include "chartarr.hxx"
#include "chartlock.hxx" #include "chartlock.hxx"
#include "compiler.hxx"
#include "refupdat.hxx" #include "refupdat.hxx"
#include "docoptio.hxx" #include "docoptio.hxx"
#include "appoptio.hxx"
#include "viewopti.hxx" #include "viewopti.hxx"
#include "scextopt.hxx" #include "scextopt.hxx"
#include "brdcst.hxx" #include "brdcst.hxx"
...@@ -67,7 +65,6 @@ ...@@ -67,7 +65,6 @@
#include "dociter.hxx" #include "dociter.hxx"
#include "detdata.hxx" #include "detdata.hxx"
#include "detfunc.hxx" #include "detfunc.hxx"
#include "scmod.hxx" // SC_MOD
#include "inputopt.hxx" // GetExpandRefs #include "inputopt.hxx" // GetExpandRefs
#include "chartlis.hxx" #include "chartlis.hxx"
#include "sc.hrc" // SID_LINK #include "sc.hrc" // SID_LINK
...@@ -1938,39 +1935,10 @@ const ScDocOptions& ScDocument::GetDocOptions() const ...@@ -1938,39 +1935,10 @@ const ScDocOptions& ScDocument::GetDocOptions() const
void ScDocument::SetDocOptions( const ScDocOptions& rOpt ) void ScDocument::SetDocOptions( const ScDocOptions& rOpt )
{ {
ScAppOptions rAppOpt=SC_MOD()->GetAppOptions();
OSL_ENSURE( pDocOptions, "No DocOptions! :-(" ); OSL_ENSURE( pDocOptions, "No DocOptions! :-(" );
// bool bUpdateFuncNames = pDocOptions->GetUseEnglishFuncName() != rOpt.GetUseEnglishFuncName();
*pDocOptions = rOpt; *pDocOptions = rOpt;
xPoolHelper->SetFormTableOpt(rOpt); xPoolHelper->SetFormTableOpt(rOpt);
SetGrammar( rAppOpt.GetFormulaSyntax() );
//if (bUpdateFuncNames)
{
// This needs to be called first since it may re-initialize the entire
// opcode map.
if (rAppOpt.GetUseEnglishFuncName())
{
// switch native symbols to English.
ScCompiler aComp(NULL, ScAddress());
ScCompiler::OpCodeMapPtr xMap = aComp.GetOpCodeMap(::com::sun::star::sheet::FormulaLanguage::ENGLISH);
ScCompiler::SetNativeSymbols(xMap);
}
else
// re-initialize native symbols with localized function names.
ScCompiler::ResetNativeSymbols();
// Force re-population of function names for the function wizard, function tip etc.
ScGlobal::ResetFunctionList();
}
// Update the separators.
ScCompiler::UpdateSeparatorsNative(
rAppOpt.GetFormulaSepArg(), rAppOpt.GetFormulaSepArrayCol(), rAppOpt.GetFormulaSepArrayRow());
} }
const ScViewOptions& ScDocument::GetViewOptions() const const ScViewOptions& ScDocument::GetViewOptions() const
......
...@@ -1088,13 +1088,9 @@ void ScModule::ModifyOptions( const SfxItemSet& rOptSet ) ...@@ -1088,13 +1088,9 @@ void ScModule::ModifyOptions( const SfxItemSet& rOptSet )
} }
// Do all the format updates on open documents in one go // Do all the format updates on open documents in one go
if ( bUpdateDocFormat && pDoc ) if ( bUpdateDocFormat && pDocSh )
{ {
const ScDocOptions& rOpt = pDoc->GetDocOptions(); // Temporary fix to keep pDocSh->SetFormulaOptions( *pAppCfg );
// SettDocOption call as is
// Needs update.
pDoc->SetDocOptions( rOpt );
pDocSh->SetDocumentModified(); pDocSh->SetDocumentModified();
} }
......
...@@ -432,6 +432,7 @@ void ScDocShell::InitOptions(bool bForLoading) // called from InitNew and L ...@@ -432,6 +432,7 @@ void ScDocShell::InitOptions(bool bForLoading) // called from InitNew and L
ScModule* pScMod = SC_MOD(); ScModule* pScMod = SC_MOD();
ScDocOptions aDocOpt = pScMod->GetDocOptions(); ScDocOptions aDocOpt = pScMod->GetDocOptions();
ScAppOptions aAppOpt = pScMod->GetAppOptions();
ScViewOptions aViewOpt = pScMod->GetViewOptions(); ScViewOptions aViewOpt = pScMod->GetViewOptions();
aDocOpt.SetAutoSpell( bAutoSpell ); aDocOpt.SetAutoSpell( bAutoSpell );
...@@ -448,6 +449,7 @@ void ScDocShell::InitOptions(bool bForLoading) // called from InitNew and L ...@@ -448,6 +449,7 @@ void ScDocShell::InitOptions(bool bForLoading) // called from InitNew and L
aDocument.SetDocOptions( aDocOpt ); aDocument.SetDocOptions( aDocOpt );
aDocument.SetViewOptions( aViewOpt ); aDocument.SetViewOptions( aViewOpt );
SetFormulaOptions( aAppOpt );
// Druck-Optionen werden jetzt direkt vor dem Drucken gesetzt // Druck-Optionen werden jetzt direkt vor dem Drucken gesetzt
......
...@@ -47,9 +47,9 @@ ...@@ -47,9 +47,9 @@
#include "viewdata.hxx" #include "viewdata.hxx"
#include "tabvwsh.hxx" #include "tabvwsh.hxx"
#include "tablink.hxx" #include "tablink.hxx"
#include "appoptio.hxx"
#include "globstr.hrc" #include "globstr.hrc"
#include "scmod.hxx" #include "scmod.hxx"
#include "compiler.hxx"
#include "formula/FormulaCompiler.hxx" #include "formula/FormulaCompiler.hxx"
#include "comphelper/processfactory.hxx" #include "comphelper/processfactory.hxx"
...@@ -486,6 +486,31 @@ sal_Bool ScDocShell::ReloadTabLinks() ...@@ -486,6 +486,31 @@ sal_Bool ScDocShell::ReloadTabLinks()
return sal_True; //! Fehler erkennen return sal_True; //! Fehler erkennen
} }
void ScDocShell::SetFormulaOptions(const ScAppOptions& rAppOpt )
{
aDocument.SetGrammar( rAppOpt.GetFormulaSyntax() );
// This needs to be called first since it may re-initialize the entire
// opcode map.
if (rAppOpt.GetUseEnglishFuncName())
{
// switch native symbols to English.
ScCompiler aComp(NULL, ScAddress());
ScCompiler::OpCodeMapPtr xMap = aComp.GetOpCodeMap(::com::sun::star::sheet::FormulaLanguage::ENGLISH);
ScCompiler::SetNativeSymbols(xMap);
}
else
// re-initialize native symbols with localized function names.
ScCompiler::ResetNativeSymbols();
// Force re-population of function names for the function wizard, function tip etc.
ScGlobal::ResetFunctionList();
// Update the separators.
ScCompiler::UpdateSeparatorsNative(
rAppOpt.GetFormulaSepArg(), rAppOpt.GetFormulaSepArrayCol(), rAppOpt.GetFormulaSepArrayRow());
}
void ScDocShell::CheckConfigOptions() void ScDocShell::CheckConfigOptions()
{ {
if (IsConfigOptionsChecked()) if (IsConfigOptionsChecked())
...@@ -506,6 +531,7 @@ void ScDocShell::CheckConfigOptions() ...@@ -506,6 +531,7 @@ void ScDocShell::CheckConfigOptions()
// separator. Reset them to default. // separator. Reset them to default.
ScAppOptions aNew = rAppOpt; ScAppOptions aNew = rAppOpt;
aNew.ResetFormulaSeparators(); aNew.ResetFormulaSeparators();
SetFormulaOptions(aNew);
pScMod->SetAppOptions(aNew); pScMod->SetAppOptions(aNew);
// Launch a nice warning dialog to let the users know of this change. // Launch a nice warning dialog to let the users know of this change.
......
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
#include "scdllapi.h" #include "scdllapi.h"
#include "scdll.hxx" #include "scdll.hxx"
#include "document.hxx" #include "document.hxx"
#include "appoptio.hxx"
#include "shellids.hxx" #include "shellids.hxx"
#include "refreshtimer.hxx" #include "refreshtimer.hxx"
#include "optutil.hxx" #include "optutil.hxx"
...@@ -320,6 +321,7 @@ public: ...@@ -320,6 +321,7 @@ public:
void UpdateLinks(); // Link-Eintraege aktuallisieren void UpdateLinks(); // Link-Eintraege aktuallisieren
sal_Bool ReloadTabLinks(); // Links ausfuehren (Inhalt aktualisieren) sal_Bool ReloadTabLinks(); // Links ausfuehren (Inhalt aktualisieren)
void SetFormulaOptions(const ScAppOptions& rAppOpt );
virtual void CheckConfigOptions(); virtual void CheckConfigOptions();
void PostEditView( ScEditEngineDefaulter* pEditEngine, const ScAddress& rCursorPos ); void PostEditView( ScEditEngineDefaulter* pEditEngine, const ScAddress& rCursorPos );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment