diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2012-12-17 10:31:14 -0500 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2012-12-17 10:39:20 -0500 |
commit | 8d5479cde68b8e70c4bfa2a6edae030260c740e4 (patch) | |
tree | 858abad13a2a6c904e1e902fab7825b94bfc933c /sc | |
parent | 77d3777c8934171a9557a96872d020cf12443fb9 (diff) |
Use check box "Always perform this in future" rather than 4 buttons.
Change-Id: Ib04debaf3c2d06e694e965c1ece01d6cc7a43fa8
Diffstat (limited to 'sc')
-rw-r--r-- | sc/inc/globstr.hrc | 5 | ||||
-rw-r--r-- | sc/source/filter/oox/workbookfragment.cxx | 46 | ||||
-rw-r--r-- | sc/source/ui/src/globstr.src | 8 | ||||
-rw-r--r-- | sc/source/ui/src/optdlg.src | 2 |
4 files changed, 16 insertions, 45 deletions
diff --git a/sc/inc/globstr.hrc b/sc/inc/globstr.hrc index e860a6b68704..4b8031dede58 100644 --- a/sc/inc/globstr.hrc +++ b/sc/inc/globstr.hrc @@ -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 diff --git a/sc/source/filter/oox/workbookfragment.cxx b/sc/source/filter/oox/workbookfragment.cxx index 0e92e2a39b89..4f71e5720e2a 100644 --- a/sc/source/filter/oox/workbookfragment.cxx +++ b/sc/source/filter/oox/workbookfragment.cxx @@ -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 diff --git a/sc/source/ui/src/globstr.src b/sc/source/ui/src/globstr.src index 955dcb5f12fc..79ad06e3425e 100644 --- a/sc/source/ui/src/globstr.src +++ b/sc/source/ui/src/globstr.src @@ -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."; }; }; diff --git a/sc/source/ui/src/optdlg.src b/sc/source/ui/src/optdlg.src index e3a117583479..821f200407fb 100644 --- a/sc/source/ui/src/optdlg.src +++ b/sc/source/ui/src/optdlg.src @@ -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 { |