[Libreoffice-commits] .: Branch 'libreoffice-4-0' - officecfg/registry sc/inc sc/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Mon Dec 17 09:55:12 PST 2012
officecfg/registry/schema/org/openoffice/Office/Calc.xcs | 4 ++--
sc/inc/calcconfig.hxx | 8 ++++++++
sc/inc/formulaopt.hxx | 8 --------
sc/source/core/tool/formulaopt.cxx | 10 +++++-----
sc/source/filter/oox/workbookfragment.cxx | 8 +++++---
sc/source/ui/optdlg/tpformula.cxx | 8 ++++----
sc/source/ui/src/optdlg.src | 8 ++++----
7 files changed, 28 insertions(+), 26 deletions(-)
New commits:
commit 244da713e5b08ec3724ed6870757fb0f55d30611
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date: Mon Dec 17 11:57:06 2012 -0500
Change the order of always, never, ask enumerations.
This tri-state option is commonly ordered ask-always-never or
always-never-ask, but not always-ask-never, which is not very common.
Change-Id: Ie3a3d1b40397b5cd7d28e64948a2b946bb619b49
diff --git a/officecfg/registry/schema/org/openoffice/Office/Calc.xcs b/officecfg/registry/schema/org/openoffice/Office/Calc.xcs
index 2dd5d7c..cc61d83 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Calc.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Calc.xcs
@@ -1524,12 +1524,12 @@
</enumeration>
<enumeration oor:value="1">
<info>
- <desc>Ask before Recalc</desc>
+ <desc>Recalc never</desc>
</info>
</enumeration>
<enumeration oor:value="2">
<info>
- <desc>Recalc never</desc>
+ <desc>Ask before Recalc</desc>
</info>
</enumeration>
</constraints>
diff --git a/sc/inc/calcconfig.hxx b/sc/inc/calcconfig.hxx
index 2006ba2..7a9c73c 100644
--- a/sc/inc/calcconfig.hxx
+++ b/sc/inc/calcconfig.hxx
@@ -32,6 +32,14 @@
#include "scdllapi.h"
#include "formula/grammar.hxx"
+// have to match the registry values
+enum ScRecalcOptions
+{
+ RECALC_ALWAYS = 0,
+ RECALC_NEVER,
+ RECALC_ASK,
+};
+
/**
* Configuration options for formula interpreter.
*/
diff --git a/sc/inc/formulaopt.hxx b/sc/inc/formulaopt.hxx
index bf12fce..fe585fe 100644
--- a/sc/inc/formulaopt.hxx
+++ b/sc/inc/formulaopt.hxx
@@ -37,14 +37,6 @@
#include "global.hxx"
#include "calcconfig.hxx"
-// have to match the registry values
-enum ScRecalcOptions
-{
- RECALC_ALWAYS = 0,
- RECALC_ASK = 1,
- RECALC_NEVER = 2
-};
-
class SC_DLLPUBLIC ScFormulaOptions
{
private:
diff --git a/sc/source/core/tool/formulaopt.cxx b/sc/source/core/tool/formulaopt.cxx
index fe54621..a14463b 100644
--- a/sc/source/core/tool/formulaopt.cxx
+++ b/sc/source/core/tool/formulaopt.cxx
@@ -367,10 +367,10 @@ ScFormulaCfg::ScFormulaCfg() :
eOpt = RECALC_ALWAYS;
break;
case 1:
- eOpt = RECALC_ASK;
+ eOpt = RECALC_NEVER;
break;
case 2:
- eOpt = RECALC_NEVER;
+ eOpt = RECALC_ASK;
break;
default:
SAL_WARN("sc", "unknown ooxml recalc option!");
@@ -446,16 +446,16 @@ void ScFormulaCfg::Commit()
break;
case SCFORMULAOPT_OOXML_RECALC:
{
- sal_Int32 nVal = 1;
+ sal_Int32 nVal = 2;
switch (GetOOXMLRecalcOptions())
{
case RECALC_ALWAYS:
nVal = 0;
break;
- case RECALC_ASK:
+ case RECALC_NEVER:
nVal = 1;
break;
- case RECALC_NEVER:
+ case RECALC_ASK:
nVal = 2;
break;
}
diff --git a/sc/source/filter/oox/workbookfragment.cxx b/sc/source/filter/oox/workbookfragment.cxx
index 4f71e57..ba74b96 100644
--- a/sc/source/filter/oox/workbookfragment.cxx
+++ b/sc/source/filter/oox/workbookfragment.cxx
@@ -47,6 +47,7 @@
#include "document.hxx"
#include "docsh.hxx"
#include "globstr.hrc"
+#include "calcconfig.hxx"
#include <comphelper/processfactory.hxx>
#include <officecfg/Office/Calc.hxx>
@@ -321,9 +322,10 @@ void WorkbookFragment::finalizeImport()
ScDocument& rDoc = getScDocument();
ScDocShell* pDocSh = static_cast<ScDocShell*>(rDoc.GetDocumentShell());
Reference< XComponentContext > xContext = comphelper::getProcessComponentContext();
- sal_Int32 nRecalcMode = officecfg::Office::Calc::Formula::Load::OOXMLRecalcMode::get(xContext);
+ ScRecalcOptions nRecalcMode =
+ static_cast<ScRecalcOptions>(officecfg::Office::Calc::Formula::Load::OOXMLRecalcMode::get(xContext));
bool bHardRecalc = false;
- if (nRecalcMode == 1)
+ if (nRecalcMode == RECALC_ASK)
{
if (rDoc.IsUserInteractionEnabled())
{
@@ -349,7 +351,7 @@ void WorkbookFragment::finalizeImport()
batch->commit();
}
}
- else if (nRecalcMode == 0)
+ else if (nRecalcMode == RECALC_ALWAYS)
bHardRecalc = true;
if (bHardRecalc)
diff --git a/sc/source/ui/optdlg/tpformula.cxx b/sc/source/ui/optdlg/tpformula.cxx
index 4a9608c..ba34d6f 100644
--- a/sc/source/ui/optdlg/tpformula.cxx
+++ b/sc/source/ui/optdlg/tpformula.cxx
@@ -286,10 +286,10 @@ sal_Bool ScTpFormulaOptions::FillItemSet(SfxItemSet& rCoreSet)
eOOXMLRecalc = RECALC_ALWAYS;
break;
case 1:
- eOOXMLRecalc = RECALC_ASK;
+ eOOXMLRecalc = RECALC_NEVER;
break;
case 2:
- eOOXMLRecalc = RECALC_NEVER;
+ eOOXMLRecalc = RECALC_ASK;
break;
};
@@ -342,10 +342,10 @@ void ScTpFormulaOptions::Reset(const SfxItemSet& rCoreSet)
case RECALC_ALWAYS:
maLbOOXMLRecalcOptions.SelectEntryPos(0);
break;
- case RECALC_ASK:
+ case RECALC_NEVER:
maLbOOXMLRecalcOptions.SelectEntryPos(1);
break;
- case RECALC_NEVER:
+ case RECALC_ASK:
maLbOOXMLRecalcOptions.SelectEntryPos(2);
break;
}
diff --git a/sc/source/ui/src/optdlg.src b/sc/source/ui/src/optdlg.src
index 43cb595..e1c5a28 100644
--- a/sc/source/ui/src/optdlg.src
+++ b/sc/source/ui/src/optdlg.src
@@ -294,14 +294,14 @@ TabPage RID_SCPAGE_FORMULA
ListBox LB_OOXML_RECALC
{
Pos = MAP_APPFONT( 21, 147 );
- Size = MAP_APPFONT( 100, 50 );
+ Size = MAP_APPFONT( 80, 50 );
Border = TRUE;
DropDown = TRUE;
StringList [ en-US ] =
{
- "Recalculate always";
- "Ask before recalculation";
- "Recalculate never";
+ "Always recalculate";
+ "Never recalculate";
+ "Prompt user";
};
};
};
More information about the Libreoffice-commits
mailing list