summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2014-08-22 04:29:06 +0200
committerEike Rathke <erack@redhat.com>2014-08-22 04:31:32 +0200
commit10b6bda51c9da5429ca562c70ce75ee03e5f4e56 (patch)
tree00d520a1b35a63d6903a7186a32c61c2cf04cdb4
parent9344af955b68143b362a586a50543c5f05467c63 (diff)
init formula options once, fdo#82183
Change-Id: I1db4816f4693e35024c6dc6c70585d7b72e68c32
-rw-r--r--sc/source/ui/docshell/docsh6.cxx10
1 files changed, 8 insertions, 2 deletions
diff --git a/sc/source/ui/docshell/docsh6.cxx b/sc/source/ui/docshell/docsh6.cxx
index a752fefec797..c4b25acce685 100644
--- a/sc/source/ui/docshell/docsh6.cxx
+++ b/sc/source/ui/docshell/docsh6.cxx
@@ -459,9 +459,15 @@ void ScDocShell::SetFormulaOptions( const ScFormulaOptions& rOpt, bool bForLoadi
/* TODO: bForLoading is a workaround, rather get rid of setting any
* globals from per document instances like ScDocShell. */
- if (!bForLoading)
+ /* XXX this is utter crap, we rely on the options being set here at least
+ * once, for the very first document, empty or loaded. */
+ static bool bInitOnce = true;
+
+ if (!bForLoading || bInitOnce)
{
- if (rOpt.GetUseEnglishFuncName() != SC_MOD()->GetFormulaOptions().GetUseEnglishFuncName())
+ bool bForceInit = bInitOnce;
+ bInitOnce = false;
+ if (bForceInit || rOpt.GetUseEnglishFuncName() != SC_MOD()->GetFormulaOptions().GetUseEnglishFuncName())
{
// This needs to be called first since it may re-initialize the entire
// opcode map.