From 3cbf1ced422d56e8a89e36cada8f1988b0e8d453 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Thu, 20 Dec 2012 14:50:36 -0500 Subject: Forgot to add checkbox to the dialog & saving the option when checked. Also remove a printf statement. Change-Id: I29c89a19f0c75b21f912d12903d1fceea535a6c7 --- sc/source/filter/oox/workbookfragment.cxx | 4 ++-- sc/source/ui/docshell/docsh.cxx | 15 +++++++++++++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/sc/source/filter/oox/workbookfragment.cxx b/sc/source/filter/oox/workbookfragment.cxx index ba74b967e92f..ba0c2fdd86b4 100644 --- a/sc/source/filter/oox/workbookfragment.cxx +++ b/sc/source/filter/oox/workbookfragment.cxx @@ -335,20 +335,20 @@ void WorkbookFragment::finalizeImport() ScGlobal::GetRscString(STR_QUERY_FORMULA_RECALC_ONLOAD_XLS)); aBox.SetCheckBoxText(ScGlobal::GetRscString(STR_ALWAYS_PERFORM_SELECTED)); - boost::shared_ptr< comphelper::ConfigurationChanges > batch( comphelper::ConfigurationChanges::create() ); sal_Int32 nRet = aBox.Execute(); bHardRecalc = nRet == RET_YES; if (aBox.GetCheckBoxState()) { // Always perform selected action in the future. + boost::shared_ptr< comphelper::ConfigurationChanges > batch( comphelper::ConfigurationChanges::create() ); officecfg::Office::Calc::Formula::Load::OOXMLRecalcMode::set(sal_Int32(0), batch); ScFormulaOptions aOpt = SC_MOD()->GetFormulaOptions(); aOpt.SetOOXMLRecalcOptions(bHardRecalc ? RECALC_ALWAYS : RECALC_NEVER); SC_MOD()->SetFormulaOptions(aOpt); + batch->commit(); } - batch->commit(); } } else if (nRecalcMode == RECALC_ALWAYS) diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx index 0a5b488cadd5..291f5e0540da 100644 --- a/sc/source/ui/docshell/docsh.cxx +++ b/sc/source/ui/docshell/docsh.cxx @@ -442,15 +442,26 @@ sal_Bool ScDocShell::LoadXML( SfxMedium* pLoadMedium, const ::com::sun::star::un QueryBox aBox( GetActiveDialogParent(), WinBits(WB_YES_NO | WB_DEF_YES), ScGlobal::GetRscString(STR_QUERY_FORMULA_RECALC_ONLOAD_ODS)); + aBox.SetCheckBoxText(ScGlobal::GetRscString(STR_ALWAYS_PERFORM_SELECTED)); bHardRecalc = aBox.Execute() == RET_YES; + + if (aBox.GetCheckBoxState()) + { + // Always perform selected action in the future. + boost::shared_ptr< comphelper::ConfigurationChanges > batch( comphelper::ConfigurationChanges::create() ); + officecfg::Office::Calc::Formula::Load::ODFRecalcMode::set(sal_Int32(0), batch); + ScFormulaOptions aOpt = SC_MOD()->GetFormulaOptions(); + aOpt.SetODFRecalcOptions(bHardRecalc ? RECALC_ALWAYS : RECALC_NEVER); + SC_MOD()->SetFormulaOptions(aOpt); + + batch->commit(); + } } } else if (nRecalcMode == RECALC_ALWAYS) bHardRecalc = true; - fprintf(stdout, "ScDocShell::LoadXML: hard recalc = %d\n", bHardRecalc); - if (bHardRecalc) DoHardRecalc(false); else -- cgit v1.2.3