Kaydet (Commit) d98b8882 authored tarafından Kohei Yoshida's avatar Kohei Yoshida

Forgot to add checkbox to the dialog & saving the option when checked.

Also remove a printf statement.

Change-Id: I29c89a19f0c75b21f912d12903d1fceea535a6c7
üst 3d21bda6
...@@ -335,22 +335,22 @@ void WorkbookFragment::finalizeImport() ...@@ -335,22 +335,22 @@ void WorkbookFragment::finalizeImport()
ScGlobal::GetRscString(STR_QUERY_FORMULA_RECALC_ONLOAD_XLS)); ScGlobal::GetRscString(STR_QUERY_FORMULA_RECALC_ONLOAD_XLS));
aBox.SetCheckBoxText(ScGlobal::GetRscString(STR_ALWAYS_PERFORM_SELECTED)); aBox.SetCheckBoxText(ScGlobal::GetRscString(STR_ALWAYS_PERFORM_SELECTED));
boost::shared_ptr< comphelper::ConfigurationChanges > batch( comphelper::ConfigurationChanges::create() );
sal_Int32 nRet = aBox.Execute(); sal_Int32 nRet = aBox.Execute();
bHardRecalc = nRet == RET_YES; bHardRecalc = nRet == RET_YES;
if (aBox.GetCheckBoxState()) if (aBox.GetCheckBoxState())
{ {
// Always perform selected action in the future. // 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); officecfg::Office::Calc::Formula::Load::OOXMLRecalcMode::set(sal_Int32(0), batch);
ScFormulaOptions aOpt = SC_MOD()->GetFormulaOptions(); ScFormulaOptions aOpt = SC_MOD()->GetFormulaOptions();
aOpt.SetOOXMLRecalcOptions(bHardRecalc ? RECALC_ALWAYS : RECALC_NEVER); aOpt.SetOOXMLRecalcOptions(bHardRecalc ? RECALC_ALWAYS : RECALC_NEVER);
SC_MOD()->SetFormulaOptions(aOpt); SC_MOD()->SetFormulaOptions(aOpt);
}
batch->commit(); batch->commit();
} }
} }
}
else if (nRecalcMode == RECALC_ALWAYS) else if (nRecalcMode == RECALC_ALWAYS)
bHardRecalc = true; bHardRecalc = true;
......
...@@ -444,15 +444,26 @@ sal_Bool ScDocShell::LoadXML( SfxMedium* pLoadMedium, const ::com::sun::star::un ...@@ -444,15 +444,26 @@ sal_Bool ScDocShell::LoadXML( SfxMedium* pLoadMedium, const ::com::sun::star::un
QueryBox aBox( QueryBox aBox(
GetActiveDialogParent(), WinBits(WB_YES_NO | WB_DEF_YES), GetActiveDialogParent(), WinBits(WB_YES_NO | WB_DEF_YES),
ScGlobal::GetRscString(STR_QUERY_FORMULA_RECALC_ONLOAD_ODS)); ScGlobal::GetRscString(STR_QUERY_FORMULA_RECALC_ONLOAD_ODS));
aBox.SetCheckBoxText(ScGlobal::GetRscString(STR_ALWAYS_PERFORM_SELECTED));
bHardRecalc = aBox.Execute() == RET_YES; 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) else if (nRecalcMode == RECALC_ALWAYS)
bHardRecalc = true; bHardRecalc = true;
fprintf(stdout, "ScDocShell::LoadXML: hard recalc = %d\n", bHardRecalc);
if (bHardRecalc) if (bHardRecalc)
DoHardRecalc(false); DoHardRecalc(false);
else else
......
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