diff options
author | Eike Rathke <erack@redhat.com> | 2016-02-20 00:14:54 +0100 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2016-02-20 00:39:29 +0100 |
commit | 91dd7a67d1b64d56fc00b19db102731a91f220f7 (patch) | |
tree | a694b723797d7cbe46634152b567548c8e274924 | |
parent | ec3bc95a1cc8283867d2d4df4aa1268588ccaedf (diff) |
add FormulaWildcardsEnabled to ScDocOptions, tdf#72196
Currently as raw bool values matching the configuration values.
Will need a precedence handling.
Change-Id: I1a65b4dc0af54bd39474a2ca329bee1ea0337a9f
-rw-r--r-- | sc/inc/docoptio.hxx | 6 | ||||
-rw-r--r-- | sc/source/core/tool/docoptio.cxx | 13 |
2 files changed, 18 insertions, 1 deletions
diff --git a/sc/inc/docoptio.hxx b/sc/inc/docoptio.hxx index 4b179352ee3f..cd7effa2fab1 100644 --- a/sc/inc/docoptio.hxx +++ b/sc/inc/docoptio.hxx @@ -46,6 +46,7 @@ class SC_DLLPUBLIC ScDocOptions bool bDoAutoSpell; ///< auto-spelling bool bLookUpColRowNames; ///< determine column-/row titles automagically bool bFormulaRegexEnabled; ///< regular expressions in formulas enabled + bool bFormulaWildcardsEnabled;///< wildcards in formulas enabled bool bWriteCalcConfig; ///< (subset of) Calc config will be written to user's profile public: ScDocOptions(); @@ -92,6 +93,9 @@ public: void SetFormulaRegexEnabled( bool bVal ) { bFormulaRegexEnabled = bVal; } bool IsFormulaRegexEnabled() const { return bFormulaRegexEnabled; } + void SetFormulaWildcardsEnabled( bool bVal ) { bFormulaWildcardsEnabled = bVal; } + bool IsFormulaWildcardsEnabled() const { return bFormulaWildcardsEnabled; } + void SetWriteCalcConfig( bool bVal ) { bWriteCalcConfig = bVal; } bool IsWriteCalcConfig() const { return bWriteCalcConfig; } }; @@ -113,6 +117,7 @@ inline const ScDocOptions& ScDocOptions::operator=( const ScDocOptions& rCpy ) bDoAutoSpell = rCpy.bDoAutoSpell; bLookUpColRowNames = rCpy.bLookUpColRowNames; bFormulaRegexEnabled= rCpy.bFormulaRegexEnabled; + bFormulaWildcardsEnabled = rCpy.bFormulaWildcardsEnabled; bWriteCalcConfig = rCpy.bWriteCalcConfig; return *this; @@ -136,6 +141,7 @@ inline bool ScDocOptions::operator==( const ScDocOptions& rOpt ) const && rOpt.bDoAutoSpell == bDoAutoSpell && rOpt.bLookUpColRowNames == bLookUpColRowNames && rOpt.bFormulaRegexEnabled == bFormulaRegexEnabled + && rOpt.bFormulaWildcardsEnabled == bFormulaWildcardsEnabled && rOpt.bWriteCalcConfig == bWriteCalcConfig ); } diff --git a/sc/source/core/tool/docoptio.cxx b/sc/source/core/tool/docoptio.cxx index e68875293471..8b9bcaa57df5 100644 --- a/sc/source/core/tool/docoptio.cxx +++ b/sc/source/core/tool/docoptio.cxx @@ -71,6 +71,7 @@ ScDocOptions::ScDocOptions( const ScDocOptions& rCpy ) bDoAutoSpell( rCpy.bDoAutoSpell ), bLookUpColRowNames( rCpy.bLookUpColRowNames ), bFormulaRegexEnabled( rCpy.bFormulaRegexEnabled ), + bFormulaWildcardsEnabled( rCpy.bFormulaWildcardsEnabled ), bWriteCalcConfig( rCpy.bWriteCalcConfig ) { } @@ -96,6 +97,7 @@ void ScDocOptions::ResetDocOptions() bDoAutoSpell = false; bLookUpColRowNames = true; bFormulaRegexEnabled= true; + bFormulaWildcardsEnabled= false; bWriteCalcConfig = true; } @@ -147,7 +149,8 @@ SfxPoolItem* ScTpCalcItem::Clone( SfxItemPool * ) const #define SCCALCOPT_SEARCHCRIT 9 #define SCCALCOPT_FINDLABEL 10 #define SCCALCOPT_REGEX 11 -#define SCCALCOPT_COUNT 12 +#define SCCALCOPT_WILDCARDS 12 +#define SCCALCOPT_COUNT 13 #define CFGPATH_DOCLAYOUT "Office.Calc/Layout/Other" @@ -170,6 +173,7 @@ Sequence<OUString> ScDocCfg::GetCalcPropertyNames() "Other/SearchCriteria", // SCCALCOPT_SEARCHCRIT "Other/FindLabel", // SCCALCOPT_FINDLABEL "Other/RegularExpressions", // SCCALCOPT_REGEX + "Other/Wildcards", // SCCALCOPT_WILDCARDS }; Sequence<OUString> aNames(SCCALCOPT_COUNT); OUString* pNames = aNames.getArray(); @@ -262,6 +266,9 @@ ScDocCfg::ScDocCfg() : case SCCALCOPT_REGEX : SetFormulaRegexEnabled( ScUnoHelpFunctions::GetBoolFromAny( pValues[nProp] ) ); break; + case SCCALCOPT_WILDCARDS : + SetFormulaWildcardsEnabled( ScUnoHelpFunctions::GetBoolFromAny( pValues[nProp] ) ); + break; } } } @@ -345,6 +352,10 @@ IMPL_LINK_NOARG_TYPED(ScDocCfg, CalcCommitHdl, ScLinkConfigItem&, void) break; case SCCALCOPT_REGEX : ScUnoHelpFunctions::SetBoolInAny( pValues[nProp], IsFormulaRegexEnabled() ); + break; + case SCCALCOPT_WILDCARDS : + ScUnoHelpFunctions::SetBoolInAny( pValues[nProp], IsFormulaWildcardsEnabled() ); + break; } } aCalcItem.PutProperties(aNames, aValues); |