Kaydet (Commit) 313df729 authored tarafından Katarina Behrens's avatar Katarina Behrens Kaydeden (comit) Eike Rathke

tdf#92256, c#19: Implement "current doc only" switch

that'll save calculation settings into current document only, not
into global user profile

Change-Id: I50ab31b679f712ff512f85a2cd58319d356462ea
Reviewed-on: https://gerrit.libreoffice.org/19318Reviewed-by: 's avatarEike Rathke <erack@redhat.com>
Tested-by: 's avatarEike Rathke <erack@redhat.com>
üst f1bcf41b
...@@ -46,6 +46,7 @@ class SC_DLLPUBLIC ScDocOptions ...@@ -46,6 +46,7 @@ class SC_DLLPUBLIC ScDocOptions
bool bDoAutoSpell; ///< auto-spelling bool bDoAutoSpell; ///< auto-spelling
bool bLookUpColRowNames; ///< determine column-/row titles automagically bool bLookUpColRowNames; ///< determine column-/row titles automagically
bool bFormulaRegexEnabled; ///< regular expressions in formulas enabled bool bFormulaRegexEnabled; ///< regular expressions in formulas enabled
bool bWriteCalcConfig; ///< (subset of) Calc config will be written to user's profile
public: public:
ScDocOptions(); ScDocOptions();
ScDocOptions( const ScDocOptions& rCpy ); ScDocOptions( const ScDocOptions& rCpy );
...@@ -91,6 +92,8 @@ public: ...@@ -91,6 +92,8 @@ public:
void SetFormulaRegexEnabled( bool bVal ) { bFormulaRegexEnabled = bVal; } void SetFormulaRegexEnabled( bool bVal ) { bFormulaRegexEnabled = bVal; }
bool IsFormulaRegexEnabled() const { return bFormulaRegexEnabled; } bool IsFormulaRegexEnabled() const { return bFormulaRegexEnabled; }
void SetWriteCalcConfig( bool bVal ) { bWriteCalcConfig = bVal; }
bool IsWriteCalcConfig() const { return bWriteCalcConfig; }
}; };
inline const ScDocOptions& ScDocOptions::operator=( const ScDocOptions& rCpy ) inline const ScDocOptions& ScDocOptions::operator=( const ScDocOptions& rCpy )
...@@ -110,6 +113,7 @@ inline const ScDocOptions& ScDocOptions::operator=( const ScDocOptions& rCpy ) ...@@ -110,6 +113,7 @@ inline const ScDocOptions& ScDocOptions::operator=( const ScDocOptions& rCpy )
bDoAutoSpell = rCpy.bDoAutoSpell; bDoAutoSpell = rCpy.bDoAutoSpell;
bLookUpColRowNames = rCpy.bLookUpColRowNames; bLookUpColRowNames = rCpy.bLookUpColRowNames;
bFormulaRegexEnabled= rCpy.bFormulaRegexEnabled; bFormulaRegexEnabled= rCpy.bFormulaRegexEnabled;
bWriteCalcConfig = rCpy.bWriteCalcConfig;
return *this; return *this;
} }
...@@ -132,6 +136,7 @@ inline bool ScDocOptions::operator==( const ScDocOptions& rOpt ) const ...@@ -132,6 +136,7 @@ inline bool ScDocOptions::operator==( const ScDocOptions& rOpt ) const
&& rOpt.bDoAutoSpell == bDoAutoSpell && rOpt.bDoAutoSpell == bDoAutoSpell
&& rOpt.bLookUpColRowNames == bLookUpColRowNames && rOpt.bLookUpColRowNames == bLookUpColRowNames
&& rOpt.bFormulaRegexEnabled == bFormulaRegexEnabled && rOpt.bFormulaRegexEnabled == bFormulaRegexEnabled
&& rOpt.bWriteCalcConfig == bWriteCalcConfig
); );
} }
......
...@@ -25,6 +25,7 @@ private: ...@@ -25,6 +25,7 @@ private:
bool bUseEnglishFuncName; // use English function name even if the locale is not English. bool bUseEnglishFuncName; // use English function name even if the locale is not English.
formula::FormulaGrammar::Grammar eFormulaGrammar; // formula grammar used to switch different formula syntax formula::FormulaGrammar::Grammar eFormulaGrammar; // formula grammar used to switch different formula syntax
ScCalcConfig aCalcConfig; ScCalcConfig aCalcConfig;
bool mbWriteCalcConfig;
OUString aFormulaSepArg; OUString aFormulaSepArg;
OUString aFormulaSepArrayRow; OUString aFormulaSepArrayRow;
...@@ -50,6 +51,9 @@ public: ...@@ -50,6 +51,9 @@ public:
void SetUseEnglishFuncName( bool bVal ) { bUseEnglishFuncName = bVal; } void SetUseEnglishFuncName( bool bVal ) { bUseEnglishFuncName = bVal; }
bool GetUseEnglishFuncName() const { return bUseEnglishFuncName; } bool GetUseEnglishFuncName() const { return bUseEnglishFuncName; }
void SetWriteCalcConfig( bool bVal ) { mbWriteCalcConfig = bVal; }
bool GetWriteCalcConfig() const { return mbWriteCalcConfig; }
void SetFormulaSepArg(const OUString& rSep) { aFormulaSepArg = rSep; } void SetFormulaSepArg(const OUString& rSep) { aFormulaSepArg = rSep; }
OUString GetFormulaSepArg() const { return aFormulaSepArg; } OUString GetFormulaSepArg() const { return aFormulaSepArg; }
......
...@@ -71,7 +71,8 @@ ScDocOptions::ScDocOptions( const ScDocOptions& rCpy ) ...@@ -71,7 +71,8 @@ ScDocOptions::ScDocOptions( const ScDocOptions& rCpy )
bMatchWholeCell( rCpy.bMatchWholeCell ), bMatchWholeCell( rCpy.bMatchWholeCell ),
bDoAutoSpell( rCpy.bDoAutoSpell ), bDoAutoSpell( rCpy.bDoAutoSpell ),
bLookUpColRowNames( rCpy.bLookUpColRowNames ), bLookUpColRowNames( rCpy.bLookUpColRowNames ),
bFormulaRegexEnabled( rCpy.bFormulaRegexEnabled ) bFormulaRegexEnabled( rCpy.bFormulaRegexEnabled ),
bWriteCalcConfig( rCpy.bWriteCalcConfig )
{ {
} }
...@@ -96,6 +97,7 @@ void ScDocOptions::ResetDocOptions() ...@@ -96,6 +97,7 @@ void ScDocOptions::ResetDocOptions()
bDoAutoSpell = false; bDoAutoSpell = false;
bLookUpColRowNames = true; bLookUpColRowNames = true;
bFormulaRegexEnabled= true; bFormulaRegexEnabled= true;
bWriteCalcConfig = true;
} }
// ScTpCalcItem - Daten fuer die CalcOptions-TabPage // ScTpCalcItem - Daten fuer die CalcOptions-TabPage
......
...@@ -36,6 +36,7 @@ ScFormulaOptions::ScFormulaOptions( const ScFormulaOptions& rCpy ) : ...@@ -36,6 +36,7 @@ ScFormulaOptions::ScFormulaOptions( const ScFormulaOptions& rCpy ) :
bUseEnglishFuncName ( rCpy.bUseEnglishFuncName ), bUseEnglishFuncName ( rCpy.bUseEnglishFuncName ),
eFormulaGrammar ( rCpy.eFormulaGrammar ), eFormulaGrammar ( rCpy.eFormulaGrammar ),
aCalcConfig(rCpy.aCalcConfig), aCalcConfig(rCpy.aCalcConfig),
mbWriteCalcConfig (rCpy.mbWriteCalcConfig),
aFormulaSepArg ( rCpy.aFormulaSepArg ), aFormulaSepArg ( rCpy.aFormulaSepArg ),
aFormulaSepArrayRow ( rCpy.aFormulaSepArrayRow ), aFormulaSepArrayRow ( rCpy.aFormulaSepArrayRow ),
aFormulaSepArrayCol ( rCpy.aFormulaSepArrayCol ), aFormulaSepArrayCol ( rCpy.aFormulaSepArrayCol ),
...@@ -52,6 +53,7 @@ void ScFormulaOptions::SetDefaults() ...@@ -52,6 +53,7 @@ void ScFormulaOptions::SetDefaults()
{ {
bUseEnglishFuncName = false; bUseEnglishFuncName = false;
eFormulaGrammar = ::formula::FormulaGrammar::GRAM_NATIVE; eFormulaGrammar = ::formula::FormulaGrammar::GRAM_NATIVE;
mbWriteCalcConfig = true;
meOOXMLRecalc = RECALC_ASK; meOOXMLRecalc = RECALC_ASK;
meODFRecalc = RECALC_ASK; meODFRecalc = RECALC_ASK;
...@@ -129,6 +131,7 @@ ScFormulaOptions& ScFormulaOptions::operator=( const ScFormulaOptions& rCpy ) ...@@ -129,6 +131,7 @@ ScFormulaOptions& ScFormulaOptions::operator=( const ScFormulaOptions& rCpy )
bUseEnglishFuncName = rCpy.bUseEnglishFuncName; bUseEnglishFuncName = rCpy.bUseEnglishFuncName;
eFormulaGrammar = rCpy.eFormulaGrammar; eFormulaGrammar = rCpy.eFormulaGrammar;
aCalcConfig = rCpy.aCalcConfig; aCalcConfig = rCpy.aCalcConfig;
mbWriteCalcConfig = rCpy.mbWriteCalcConfig;
aFormulaSepArg = rCpy.aFormulaSepArg; aFormulaSepArg = rCpy.aFormulaSepArg;
aFormulaSepArrayRow = rCpy.aFormulaSepArrayRow; aFormulaSepArrayRow = rCpy.aFormulaSepArrayRow;
aFormulaSepArrayCol = rCpy.aFormulaSepArrayCol; aFormulaSepArrayCol = rCpy.aFormulaSepArrayCol;
...@@ -142,6 +145,7 @@ bool ScFormulaOptions::operator==( const ScFormulaOptions& rOpt ) const ...@@ -142,6 +145,7 @@ bool ScFormulaOptions::operator==( const ScFormulaOptions& rOpt ) const
return bUseEnglishFuncName == rOpt.bUseEnglishFuncName return bUseEnglishFuncName == rOpt.bUseEnglishFuncName
&& eFormulaGrammar == rOpt.eFormulaGrammar && eFormulaGrammar == rOpt.eFormulaGrammar
&& aCalcConfig == rOpt.aCalcConfig && aCalcConfig == rOpt.aCalcConfig
&& mbWriteCalcConfig == rOpt.mbWriteCalcConfig
&& aFormulaSepArg == rOpt.aFormulaSepArg && aFormulaSepArg == rOpt.aFormulaSepArg
&& aFormulaSepArrayRow == rOpt.aFormulaSepArrayRow && aFormulaSepArrayRow == rOpt.aFormulaSepArrayRow
&& aFormulaSepArrayCol == rOpt.aFormulaSepArrayCol && aFormulaSepArrayCol == rOpt.aFormulaSepArrayCol
...@@ -510,6 +514,10 @@ void ScFormulaCfg::ImplCommit() ...@@ -510,6 +514,10 @@ void ScFormulaCfg::ImplCommit()
Sequence<OUString> aNames = GetPropertyNames(); Sequence<OUString> aNames = GetPropertyNames();
Sequence<Any> aValues(aNames.getLength()); Sequence<Any> aValues(aNames.getLength());
Any* pValues = aValues.getArray(); Any* pValues = aValues.getArray();
Sequence<Any> aOldValues = GetProperties(aNames);
Any* pOldValues = aOldValues.getArray();
bool bSetOpenCL = false; bool bSetOpenCL = false;
for (int nProp = 0; nProp < aNames.getLength(); ++nProp) for (int nProp = 0; nProp < aNames.getLength(); ++nProp)
...@@ -546,34 +554,57 @@ void ScFormulaCfg::ImplCommit() ...@@ -546,34 +554,57 @@ void ScFormulaCfg::ImplCommit()
case SCFORMULAOPT_STRING_REF_SYNTAX: case SCFORMULAOPT_STRING_REF_SYNTAX:
{ {
sal_Int32 nVal = -1; sal_Int32 nVal = -1;
switch (GetCalcConfig().meStringRefAddressSyntax)
if (GetWriteCalcConfig())
{ {
case ::formula::FormulaGrammar::CONV_OOO: nVal = 0; break; switch (GetCalcConfig().meStringRefAddressSyntax)
case ::formula::FormulaGrammar::CONV_XL_A1: nVal = 1; break; {
case ::formula::FormulaGrammar::CONV_XL_R1C1: nVal = 2; break; case ::formula::FormulaGrammar::CONV_OOO: nVal = 0; break;
case ::formula::FormulaGrammar::CONV_A1_XL_A1: nVal = 3; break; case ::formula::FormulaGrammar::CONV_XL_A1: nVal = 1; break;
default: break; case ::formula::FormulaGrammar::CONV_XL_R1C1: nVal = 2; break;
case ::formula::FormulaGrammar::CONV_A1_XL_A1: nVal = 3; break;
default: break;
}
pValues[nProp] <<= nVal;
}
else
{
pValues[nProp] = pOldValues[nProp];
} }
pValues[nProp] <<= nVal;
} }
break; break;
case SCFORMULAOPT_STRING_CONVERSION: case SCFORMULAOPT_STRING_CONVERSION:
{ {
sal_Int32 nVal = 3; if (GetWriteCalcConfig())
switch (GetCalcConfig().meStringConversion)
{ {
case ScCalcConfig::StringConversion::ILLEGAL: nVal = 0; break; sal_Int32 nVal = 3;
case ScCalcConfig::StringConversion::ZERO: nVal = 1; break;
case ScCalcConfig::StringConversion::UNAMBIGUOUS: nVal = 2; break; switch (GetCalcConfig().meStringConversion)
case ScCalcConfig::StringConversion::LOCALE: nVal = 3; break; {
case ScCalcConfig::StringConversion::ILLEGAL: nVal = 0; break;
case ScCalcConfig::StringConversion::ZERO: nVal = 1; break;
case ScCalcConfig::StringConversion::UNAMBIGUOUS: nVal = 2; break;
case ScCalcConfig::StringConversion::LOCALE: nVal = 3; break;
}
pValues[nProp] <<= nVal;
}
else
{
pValues[nProp] = pOldValues[nProp];
} }
pValues[nProp] <<= nVal;
} }
break; break;
case SCFORMULAOPT_EMPTY_OUSTRING_AS_ZERO: case SCFORMULAOPT_EMPTY_OUSTRING_AS_ZERO:
{ {
bool bVal = GetCalcConfig().mbEmptyStringAsZero; if (GetWriteCalcConfig())
pValues[nProp] <<= bVal; {
bool bVal = GetCalcConfig().mbEmptyStringAsZero;
pValues[nProp] <<= bVal;
}
else
{
pValues[nProp] = pOldValues[nProp];
}
} }
break; break;
case SCFORMULAOPT_OOXML_RECALC: case SCFORMULAOPT_OOXML_RECALC:
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include <vcl/button.hxx> #include <vcl/button.hxx>
#include "calcconfig.hxx" #include "calcconfig.hxx"
#include "docoptio.hxx"
class ScTpFormulaOptions : public SfxTabPage class ScTpFormulaOptions : public SfxTabPage
{ {
...@@ -79,6 +80,9 @@ private: ...@@ -79,6 +80,9 @@ private:
ScCalcConfig maSavedConfig; ScCalcConfig maSavedConfig;
ScCalcConfig maCurrentConfig; ScCalcConfig maCurrentConfig;
ScDocOptions maSavedDocOptions;
ScDocOptions maCurrentDocOptions;
sal_Unicode mnDecSep; sal_Unicode mnDecSep;
}; };
......
...@@ -76,11 +76,12 @@ sal_Int32 toSelectedItem( formula::FormulaGrammar::AddressConvention eConv ) ...@@ -76,11 +76,12 @@ sal_Int32 toSelectedItem( formula::FormulaGrammar::AddressConvention eConv )
} }
ScCalcOptionsDialog::ScCalcOptionsDialog(vcl::Window* pParent, const ScCalcConfig& rConfig) ScCalcOptionsDialog::ScCalcOptionsDialog(vcl::Window* pParent, const ScCalcConfig& rConfig, bool bWriteConfig)
: ModalDialog(pParent, "FormulaCalculationOptions", : ModalDialog(pParent, "FormulaCalculationOptions",
"modules/scalc/ui/formulacalculationoptions.ui") "modules/scalc/ui/formulacalculationoptions.ui")
, maConfig(rConfig) , maConfig(rConfig)
, mbSelectedEmptyStringAsZero(rConfig.mbEmptyStringAsZero) , mbSelectedEmptyStringAsZero(rConfig.mbEmptyStringAsZero)
, mbWriteConfig(bWriteConfig)
{ {
get(mpTestButton, "test"); get(mpTestButton, "test");
get(mpOpenclInfoList, "opencl_list"); get(mpOpenclInfoList, "opencl_list");
...@@ -103,6 +104,10 @@ ScCalcOptionsDialog::ScCalcOptionsDialog(vcl::Window* pParent, const ScCalcConfi ...@@ -103,6 +104,10 @@ ScCalcOptionsDialog::ScCalcOptionsDialog(vcl::Window* pParent, const ScCalcConfi
mpSyntax->SelectEntryPos( toSelectedItem(rConfig.meStringRefAddressSyntax) ); mpSyntax->SelectEntryPos( toSelectedItem(rConfig.meStringRefAddressSyntax) );
mpSyntax->SetSelectHdl(LINK(this, ScCalcOptionsDialog, SyntaxModifiedHdl)); mpSyntax->SetSelectHdl(LINK(this, ScCalcOptionsDialog, SyntaxModifiedHdl));
get(mpCurrentDocOnly,"current_doc");
mpCurrentDocOnly->Check(!mbWriteConfig);
mpCurrentDocOnly->SetClickHdl(LINK(this, ScCalcOptionsDialog, CurrentDocOnlyHdl));
get(mpUseOpenCL,"CBUseOpenCL"); get(mpUseOpenCL,"CBUseOpenCL");
mpUseOpenCL->Check(rConfig.mbOpenCLSubsetOnly); mpUseOpenCL->Check(rConfig.mbOpenCLSubsetOnly);
mpUseOpenCL->SetClickHdl(LINK(this, ScCalcOptionsDialog, CBUseOpenCLHdl)); mpUseOpenCL->SetClickHdl(LINK(this, ScCalcOptionsDialog, CBUseOpenCLHdl));
...@@ -233,6 +238,11 @@ IMPL_LINK_TYPED(ScCalcOptionsDialog, SyntaxModifiedHdl, ListBox&, rSyntax, void) ...@@ -233,6 +238,11 @@ IMPL_LINK_TYPED(ScCalcOptionsDialog, SyntaxModifiedHdl, ListBox&, rSyntax, void)
maConfig.SetStringRefSyntax(toAddressConvention(rSyntax.GetSelectEntryPos())); maConfig.SetStringRefSyntax(toAddressConvention(rSyntax.GetSelectEntryPos()));
} }
IMPL_LINK_TYPED(ScCalcOptionsDialog, CurrentDocOnlyHdl, Button*, pCheckBox, void)
{
mbWriteConfig = !(static_cast<CheckBox*>(pCheckBox)->IsChecked());
}
IMPL_LINK_TYPED(ScCalcOptionsDialog, CBUseOpenCLHdl, Button*, pCheckBox, void) IMPL_LINK_TYPED(ScCalcOptionsDialog, CBUseOpenCLHdl, Button*, pCheckBox, void)
{ {
maConfig.mbOpenCLSubsetOnly = static_cast<CheckBox*>(pCheckBox)->IsChecked(); maConfig.mbOpenCLSubsetOnly = static_cast<CheckBox*>(pCheckBox)->IsChecked();
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
class ScCalcOptionsDialog : public ModalDialog class ScCalcOptionsDialog : public ModalDialog
{ {
public: public:
ScCalcOptionsDialog(vcl::Window* pParent, const ScCalcConfig& rConfig); ScCalcOptionsDialog(vcl::Window* pParent, const ScCalcConfig& rConfig, bool bWriteConfig);
virtual ~ScCalcOptionsDialog(); virtual ~ScCalcOptionsDialog();
virtual void dispose() override; virtual void dispose() override;
...@@ -45,10 +45,12 @@ public: ...@@ -45,10 +45,12 @@ public:
DECL_LINK_TYPED( AsZeroModifiedHdl, Button*, void); DECL_LINK_TYPED( AsZeroModifiedHdl, Button*, void);
DECL_LINK_TYPED( ConversionModifiedHdl, ListBox&, void); DECL_LINK_TYPED( ConversionModifiedHdl, ListBox&, void);
DECL_LINK_TYPED( SyntaxModifiedHdl, ListBox&, void); DECL_LINK_TYPED( SyntaxModifiedHdl, ListBox&, void);
DECL_LINK_TYPED( CurrentDocOnlyHdl, Button*, void);
DECL_LINK_TYPED( CBUseOpenCLHdl, Button*, void); DECL_LINK_TYPED( CBUseOpenCLHdl, Button*, void);
DECL_LINK_TYPED( SpinOpenCLMinSizeHdl, Edit&, void); DECL_LINK_TYPED( SpinOpenCLMinSizeHdl, Edit&, void);
const ScCalcConfig& GetConfig() const { return maConfig;} const ScCalcConfig& GetConfig() const { return maConfig;}
bool GetWriteCalcConfig() const { return mbWriteConfig;}
private: private:
void OpenCLAutomaticSelectionChanged(); void OpenCLAutomaticSelectionChanged();
...@@ -59,6 +61,7 @@ private: ...@@ -59,6 +61,7 @@ private:
VclPtr<CheckBox> mpEmptyAsZero; VclPtr<CheckBox> mpEmptyAsZero;
VclPtr<ListBox> mpConversion; VclPtr<ListBox> mpConversion;
VclPtr<ListBox> mpSyntax; VclPtr<ListBox> mpSyntax;
VclPtr<CheckBox> mpCurrentDocOnly;
VclPtr<CheckBox> mpUseOpenCL; VclPtr<CheckBox> mpUseOpenCL;
VclPtr<NumericField> mpSpinButton; VclPtr<NumericField> mpSpinButton;
...@@ -81,6 +84,7 @@ private: ...@@ -81,6 +84,7 @@ private:
#endif #endif
bool mbSelectedEmptyStringAsZero; bool mbSelectedEmptyStringAsZero;
bool mbWriteConfig;
}; };
#endif #endif
......
...@@ -77,6 +77,10 @@ ScTpFormulaOptions::ScTpFormulaOptions(vcl::Window* pParent, const SfxItemSet& r ...@@ -77,6 +77,10 @@ ScTpFormulaOptions::ScTpFormulaOptions(vcl::Window* pParent, const SfxItemSet& r
// Get the decimal separator for current locale. // Get the decimal separator for current locale.
OUString aSep = ScGlobal::GetpLocaleData()->getNumDecimalSep(); OUString aSep = ScGlobal::GetpLocaleData()->getNumDecimalSep();
mnDecSep = aSep.isEmpty() ? sal_Unicode('.') : aSep[0]; mnDecSep = aSep.isEmpty() ? sal_Unicode('.') : aSep[0];
maSavedDocOptions = ScDocOptions(
static_cast<const ScTpCalcItem&>(rCoreAttrs.Get(
GetWhich(SID_SCDOCOPTIONS))).GetDocOptions());
} }
ScTpFormulaOptions::~ScTpFormulaOptions() ScTpFormulaOptions::~ScTpFormulaOptions()
...@@ -139,10 +143,12 @@ void ScTpFormulaOptions::UpdateCustomCalcRadioButtons(bool bDefault) ...@@ -139,10 +143,12 @@ void ScTpFormulaOptions::UpdateCustomCalcRadioButtons(bool bDefault)
void ScTpFormulaOptions::LaunchCustomCalcSettings() void ScTpFormulaOptions::LaunchCustomCalcSettings()
{ {
ScopedVclPtrInstance< ScCalcOptionsDialog > aDlg(this, maCurrentConfig); ScopedVclPtrInstance< ScCalcOptionsDialog > aDlg(this, maCurrentConfig,
maCurrentDocOptions.IsWriteCalcConfig());
if (aDlg->Execute() == RET_OK) if (aDlg->Execute() == RET_OK)
{ {
maCurrentConfig = aDlg->GetConfig(); maCurrentConfig = aDlg->GetConfig();
maCurrentDocOptions.SetWriteCalcConfig( aDlg->GetWriteCalcConfig());
} }
} }
...@@ -260,7 +266,8 @@ bool ScTpFormulaOptions::FillItemSet(SfxItemSet* rCoreSet) ...@@ -260,7 +266,8 @@ bool ScTpFormulaOptions::FillItemSet(SfxItemSet* rCoreSet)
|| static_cast<OUString>(mpEdSepArrayRow->GetSavedValue()) != aSepArrayRow || static_cast<OUString>(mpEdSepArrayRow->GetSavedValue()) != aSepArrayRow
|| mpLbOOXMLRecalcOptions->GetSavedValue() != nOOXMLRecalcMode || mpLbOOXMLRecalcOptions->GetSavedValue() != nOOXMLRecalcMode
|| mpLbODFRecalcOptions->GetSavedValue() != nODFRecalcMode || mpLbODFRecalcOptions->GetSavedValue() != nODFRecalcMode
|| maSavedConfig != maCurrentConfig ) || maSavedConfig != maCurrentConfig
|| maSavedDocOptions != maCurrentDocOptions )
{ {
::formula::FormulaGrammar::Grammar eGram = ::formula::FormulaGrammar::GRAM_DEFAULT; ::formula::FormulaGrammar::Grammar eGram = ::formula::FormulaGrammar::GRAM_DEFAULT;
...@@ -288,8 +295,11 @@ bool ScTpFormulaOptions::FillItemSet(SfxItemSet* rCoreSet) ...@@ -288,8 +295,11 @@ bool ScTpFormulaOptions::FillItemSet(SfxItemSet* rCoreSet)
aOpt.SetCalcConfig(maCurrentConfig); aOpt.SetCalcConfig(maCurrentConfig);
aOpt.SetOOXMLRecalcOptions(eOOXMLRecalc); aOpt.SetOOXMLRecalcOptions(eOOXMLRecalc);
aOpt.SetODFRecalcOptions(eODFRecalc); aOpt.SetODFRecalcOptions(eODFRecalc);
aOpt.SetWriteCalcConfig( maCurrentDocOptions.IsWriteCalcConfig());
rCoreSet->Put( ScTpFormulaItem( SID_SCFORMULAOPTIONS, aOpt ) ); rCoreSet->Put( ScTpFormulaItem( SID_SCFORMULAOPTIONS, aOpt ) );
rCoreSet->Put( ScTpCalcItem( SID_SCDOCOPTIONS, maCurrentDocOptions ) );
bRet = true; bRet = true;
} }
return bRet; return bRet;
...@@ -362,6 +372,8 @@ void ScTpFormulaOptions::Reset(const SfxItemSet* rCoreSet) ...@@ -362,6 +372,8 @@ void ScTpFormulaOptions::Reset(const SfxItemSet* rCoreSet)
UpdateCustomCalcRadioButtons(bDefault); UpdateCustomCalcRadioButtons(bDefault);
maCurrentConfig = maSavedConfig; maCurrentConfig = maSavedConfig;
maCurrentDocOptions = maSavedDocOptions;
} }
SfxTabPage::sfxpg ScTpFormulaOptions::DeactivatePage(SfxItemSet* /*pSet*/) SfxTabPage::sfxpg ScTpFormulaOptions::DeactivatePage(SfxItemSet* /*pSet*/)
......
...@@ -110,6 +110,21 @@ ...@@ -110,6 +110,21 @@
<property name="top_attach">0</property> <property name="top_attach">0</property>
</packing> </packing>
</child> </child>
<child>
<object class="GtkCheckButton" id="current_doc">
<property name="label" translatable="yes">Apply those settings to current document only</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">3</property>
<property name="width">2</property>
</packing>
</child>
</object> </object>
</child> </child>
</object> </object>
......
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