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

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
üst f828e91d
...@@ -1524,12 +1524,12 @@ ...@@ -1524,12 +1524,12 @@
</enumeration> </enumeration>
<enumeration oor:value="1"> <enumeration oor:value="1">
<info> <info>
<desc>Ask before Recalc</desc> <desc>Recalc never</desc>
</info> </info>
</enumeration> </enumeration>
<enumeration oor:value="2"> <enumeration oor:value="2">
<info> <info>
<desc>Recalc never</desc> <desc>Ask before Recalc</desc>
</info> </info>
</enumeration> </enumeration>
</constraints> </constraints>
......
...@@ -32,6 +32,14 @@ ...@@ -32,6 +32,14 @@
#include "scdllapi.h" #include "scdllapi.h"
#include "formula/grammar.hxx" #include "formula/grammar.hxx"
// have to match the registry values
enum ScRecalcOptions
{
RECALC_ALWAYS = 0,
RECALC_NEVER,
RECALC_ASK,
};
/** /**
* Configuration options for formula interpreter. * Configuration options for formula interpreter.
*/ */
......
...@@ -37,14 +37,6 @@ ...@@ -37,14 +37,6 @@
#include "global.hxx" #include "global.hxx"
#include "calcconfig.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 class SC_DLLPUBLIC ScFormulaOptions
{ {
private: private:
......
...@@ -367,10 +367,10 @@ ScFormulaCfg::ScFormulaCfg() : ...@@ -367,10 +367,10 @@ ScFormulaCfg::ScFormulaCfg() :
eOpt = RECALC_ALWAYS; eOpt = RECALC_ALWAYS;
break; break;
case 1: case 1:
eOpt = RECALC_ASK; eOpt = RECALC_NEVER;
break; break;
case 2: case 2:
eOpt = RECALC_NEVER; eOpt = RECALC_ASK;
break; break;
default: default:
SAL_WARN("sc", "unknown ooxml recalc option!"); SAL_WARN("sc", "unknown ooxml recalc option!");
...@@ -446,16 +446,16 @@ void ScFormulaCfg::Commit() ...@@ -446,16 +446,16 @@ void ScFormulaCfg::Commit()
break; break;
case SCFORMULAOPT_OOXML_RECALC: case SCFORMULAOPT_OOXML_RECALC:
{ {
sal_Int32 nVal = 1; sal_Int32 nVal = 2;
switch (GetOOXMLRecalcOptions()) switch (GetOOXMLRecalcOptions())
{ {
case RECALC_ALWAYS: case RECALC_ALWAYS:
nVal = 0; nVal = 0;
break; break;
case RECALC_ASK: case RECALC_NEVER:
nVal = 1; nVal = 1;
break; break;
case RECALC_NEVER: case RECALC_ASK:
nVal = 2; nVal = 2;
break; break;
} }
......
...@@ -47,6 +47,7 @@ ...@@ -47,6 +47,7 @@
#include "document.hxx" #include "document.hxx"
#include "docsh.hxx" #include "docsh.hxx"
#include "globstr.hrc" #include "globstr.hrc"
#include "calcconfig.hxx"
#include <comphelper/processfactory.hxx> #include <comphelper/processfactory.hxx>
#include <officecfg/Office/Calc.hxx> #include <officecfg/Office/Calc.hxx>
...@@ -321,9 +322,10 @@ void WorkbookFragment::finalizeImport() ...@@ -321,9 +322,10 @@ void WorkbookFragment::finalizeImport()
ScDocument& rDoc = getScDocument(); ScDocument& rDoc = getScDocument();
ScDocShell* pDocSh = static_cast<ScDocShell*>(rDoc.GetDocumentShell()); ScDocShell* pDocSh = static_cast<ScDocShell*>(rDoc.GetDocumentShell());
Reference< XComponentContext > xContext = comphelper::getProcessComponentContext(); 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; bool bHardRecalc = false;
if (nRecalcMode == 1) if (nRecalcMode == RECALC_ASK)
{ {
if (rDoc.IsUserInteractionEnabled()) if (rDoc.IsUserInteractionEnabled())
{ {
...@@ -349,7 +351,7 @@ void WorkbookFragment::finalizeImport() ...@@ -349,7 +351,7 @@ void WorkbookFragment::finalizeImport()
batch->commit(); batch->commit();
} }
} }
else if (nRecalcMode == 0) else if (nRecalcMode == RECALC_ALWAYS)
bHardRecalc = true; bHardRecalc = true;
if (bHardRecalc) if (bHardRecalc)
......
...@@ -286,10 +286,10 @@ sal_Bool ScTpFormulaOptions::FillItemSet(SfxItemSet& rCoreSet) ...@@ -286,10 +286,10 @@ sal_Bool ScTpFormulaOptions::FillItemSet(SfxItemSet& rCoreSet)
eOOXMLRecalc = RECALC_ALWAYS; eOOXMLRecalc = RECALC_ALWAYS;
break; break;
case 1: case 1:
eOOXMLRecalc = RECALC_ASK; eOOXMLRecalc = RECALC_NEVER;
break; break;
case 2: case 2:
eOOXMLRecalc = RECALC_NEVER; eOOXMLRecalc = RECALC_ASK;
break; break;
}; };
...@@ -342,10 +342,10 @@ void ScTpFormulaOptions::Reset(const SfxItemSet& rCoreSet) ...@@ -342,10 +342,10 @@ void ScTpFormulaOptions::Reset(const SfxItemSet& rCoreSet)
case RECALC_ALWAYS: case RECALC_ALWAYS:
maLbOOXMLRecalcOptions.SelectEntryPos(0); maLbOOXMLRecalcOptions.SelectEntryPos(0);
break; break;
case RECALC_ASK: case RECALC_NEVER:
maLbOOXMLRecalcOptions.SelectEntryPos(1); maLbOOXMLRecalcOptions.SelectEntryPos(1);
break; break;
case RECALC_NEVER: case RECALC_ASK:
maLbOOXMLRecalcOptions.SelectEntryPos(2); maLbOOXMLRecalcOptions.SelectEntryPos(2);
break; break;
} }
......
...@@ -294,14 +294,14 @@ TabPage RID_SCPAGE_FORMULA ...@@ -294,14 +294,14 @@ TabPage RID_SCPAGE_FORMULA
ListBox LB_OOXML_RECALC ListBox LB_OOXML_RECALC
{ {
Pos = MAP_APPFONT( 21, 147 ); Pos = MAP_APPFONT( 21, 147 );
Size = MAP_APPFONT( 100, 50 ); Size = MAP_APPFONT( 80, 50 );
Border = TRUE; Border = TRUE;
DropDown = TRUE; DropDown = TRUE;
StringList [ en-US ] = StringList [ en-US ] =
{ {
"Recalculate always"; "Always recalculate";
"Ask before recalculation"; "Never recalculate";
"Recalculate never"; "Prompt user";
}; };
}; };
}; };
......
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