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 @@
</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>
......
......@@ -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.
*/
......
......@@ -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:
......
......@@ -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;
}
......
......@@ -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)
......
......@@ -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;
}
......
......@@ -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";
};
};
};
......
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