[Libreoffice-commits] .: sc/inc sc/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Dec 17 07:38:23 PST 2012


 sc/inc/globstr.hrc                        |    5 +--
 sc/source/filter/oox/workbookfragment.cxx |   46 +++++++-----------------------
 sc/source/ui/src/globstr.src              |    8 +----
 sc/source/ui/src/optdlg.src               |    2 -
 4 files changed, 16 insertions(+), 45 deletions(-)

New commits:
commit 8d5479cde68b8e70c4bfa2a6edae030260c740e4
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date:   Mon Dec 17 10:31:14 2012 -0500

    Use check box "Always perform this in future" rather than 4 buttons.
    
    Change-Id: Ib04debaf3c2d06e694e965c1ece01d6cc7a43fa8

diff --git a/sc/inc/globstr.hrc b/sc/inc/globstr.hrc
index e860a6b..4b8031d 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 0e92e2a..4f71e57 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 955dcb5..79ad06e 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 e3a1175..821f200 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
     {


More information about the Libreoffice-commits mailing list