summaryrefslogtreecommitdiff
path: root/sc/source/ui/app/scmod.cxx
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@gmail.com>2013-01-30 15:55:58 -0500
committerKohei Yoshida <kohei.yoshida@gmail.com>2013-01-30 19:18:41 -0500
commit54ebe3df4a4c24dec7c38487a7da387fee266321 (patch)
tree25c8b4762b0ec75678abd0b91319e39f76a82b5c /sc/source/ui/app/scmod.cxx
parent24bce470788aa34e5e1bb001250bfa14cee1c75e (diff)
bnc#615317: Recompile cells with #NAME! for English function name option.
When the option for using English function name changes, we should re-compile all cells with #NAME! as the error may have been caused by unresolved function name which may be fixed after the option change. Change-Id: Id340ce9b5db3ed368b98e814861be5c3f96df071
Diffstat (limited to 'sc/source/ui/app/scmod.cxx')
-rw-r--r--sc/source/ui/app/scmod.cxx29
1 files changed, 23 insertions, 6 deletions
diff --git a/sc/source/ui/app/scmod.cxx b/sc/source/ui/app/scmod.cxx
index d4ed9daca3c1..38fc9ecb3002 100644
--- a/sc/source/ui/app/scmod.cxx
+++ b/sc/source/ui/app/scmod.cxx
@@ -100,6 +100,7 @@
#include "scslots.hxx"
#include "scabstdlg.hxx"
+#include "formula/errorcodes.hxx"
#define SC_IDLE_MIN 150
#define SC_IDLE_MAX 3000
@@ -998,12 +999,13 @@ void ScModule::ModifyOptions( const SfxItemSet& rOptSet )
ScDocShell* pDocSh = PTR_CAST(ScDocShell, SfxObjectShell::Current());
ScDocument* pDoc = pDocSh ? pDocSh->GetDocument() : NULL;
const SfxPoolItem* pItem = NULL;
- sal_Bool bRepaint = false;
- sal_Bool bUpdateMarks = false;
- sal_Bool bUpdateRefDev = false;
- sal_Bool bCalcAll = false;
- sal_Bool bSaveAppOptions = false;
- sal_Bool bSaveInputOptions = false;
+ bool bRepaint = false;
+ bool bUpdateMarks = false;
+ bool bUpdateRefDev = false;
+ bool bCalcAll = false;
+ bool bSaveAppOptions = false;
+ bool bSaveInputOptions = false;
+ bool bCompileErrorCells = false;
//--------------------------------------------------------------------------
@@ -1065,6 +1067,13 @@ void ScModule::ModifyOptions( const SfxItemSet& rOptSet )
// Formula options have changed. Repaint the column headers.
bRepaint = true;
+ if (pFormulaCfg && pFormulaCfg->GetUseEnglishFuncName() != rOpt.GetUseEnglishFuncName())
+ {
+ // Re-compile formula cells with error as the error may have been
+ // caused by unresolved function names.
+ bCompileErrorCells = true;
+ }
+
SetFormulaOptions( rOpt );
if ( pDocSh )
@@ -1313,6 +1322,14 @@ void ScModule::ModifyOptions( const SfxItemSet& rOptSet )
// Neuberechnung anstossen?
+ if (pDoc && bCompileErrorCells)
+ {
+ // Re-compile cells with name error, and recalc if at least one cell
+ // has been re-compiled. In the future we may want to find a way to
+ // recalc only those that are affected.
+ bCalcAll = pDoc->CompileErrorCells(ScErrorCodes::errNoName);
+ }
+
if ( pDoc && bCalcAll )
{
WaitObject aWait( pDocSh->GetActiveDialogParent() );