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

Use check box "Always perform this in future" rather than 4 buttons.

Change-Id: Ib04debaf3c2d06e694e965c1ece01d6cc7a43fa8
üst 77d3777c
......@@ -619,9 +619,8 @@
#define STR_QUERY_FORMULA_RECALC_ONLOAD_ODS 493
#define STR_QUERY_FORMULA_RECALC_ONLOAD_XLS 494
#define STR_ALWAYS 495
#define STR_NEVER 496
#define STR_ALWAYS_PERFORM_SELECTED 495
#define STR_COUNT 497
#define STR_COUNT 496
#endif
......@@ -327,55 +327,31 @@ void WorkbookFragment::finalizeImport()
{
if (rDoc.IsUserInteractionEnabled())
{
#define RET_ALWAYS 10
#define RET_NEVER 11
// Ask the user if full re-calculation is desired.
QueryBox aBox(
pDocSh->GetActiveDialogParent(), WinBits(WB_YES_NO | WB_DEF_YES),
ScGlobal::GetRscString(STR_QUERY_FORMULA_RECALC_ONLOAD_XLS));
aBox.AddButton(ScGlobal::GetRscString(STR_ALWAYS), RET_ALWAYS, 0);
aBox.AddButton(ScGlobal::GetRscString(STR_NEVER), RET_NEVER, 0);
aBox.SetCheckBoxText(ScGlobal::GetRscString(STR_ALWAYS_PERFORM_SELECTED));
boost::shared_ptr< comphelper::ConfigurationChanges > batch( comphelper::ConfigurationChanges::create() );
sal_Int32 nRet = aBox.Execute();
switch (nRet)
bHardRecalc = nRet == RET_YES;
if (aBox.GetCheckBoxState())
{
case RET_YES:
bHardRecalc = true;
break;
case RET_NO:
bHardRecalc = false;
break;
case RET_ALWAYS:
{
bHardRecalc = true;
officecfg::Office::Calc::Formula::Load::OOXMLRecalcMode::set(sal_Int32(0), batch);
ScFormulaOptions aOpt = SC_MOD()->GetFormulaOptions();
aOpt.SetOOXMLRecalcOptions(RECALC_ALWAYS);
SC_MOD()->SetFormulaOptions(aOpt);
}
break;
case RET_NEVER:
{
bHardRecalc = false;
officecfg::Office::Calc::Formula::Load::OOXMLRecalcMode::set(sal_Int32(2), batch);
ScFormulaOptions aOpt = SC_MOD()->GetFormulaOptions();
aOpt.SetOOXMLRecalcOptions(RECALC_NEVER);
SC_MOD()->SetFormulaOptions(aOpt);
}
break;
default:
SAL_WARN("sc", "unknown return value!");
bHardRecalc = true;
// Always perform selected action in the future.
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();
}
}
else if(nRecalcMode == 0)
else if (nRecalcMode == 0)
bHardRecalc = true;
if (bHardRecalc)
pDocSh->DoHardRecalc(false);
else
......
......@@ -1961,13 +1961,9 @@ Resource RID_GLOBSTR
Text [ en-US ] = "This document was last saved by Excel. Some formula cells may produce different results when recalculated.\n\nDo you want to recalculate all formula cells now?";
};
String STR_ALWAYS
String STR_ALWAYS_PERFORM_SELECTED
{
Text [ en-US ] = "Always";
};
String STR_NEVER
{
Text [ en-US ] = "Never";
Text [ en-US ] = "Always perform this without prompt in the future.";
};
};
......@@ -288,7 +288,7 @@ TabPage RID_SCPAGE_FORMULA
{
Pos = MAP_APPFONT ( 6, 178 );
Size = MAP_APPFONT( 248, 8 );
Text [ en-US ] = "Recalculation after laod settings";
Text [ en-US ] = "Recalculation on file load";
};
ListBox LB_OOXML_RECALC
{
......
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