21 #include <osl/diagnose.h>
23 #include <com/sun/star/uno/Any.hxx>
24 #include <com/sun/star/uno/Sequence.hxx>
53 bIsIgnoreCase =
false;
64 bMatchWholeCell =
true;
66 bLookUpColRowNames =
true;
67 bFormulaRegexEnabled=
false;
68 bFormulaWildcardsEnabled=
true;
70 bWriteCalcConfig =
true;
77 bFormulaRegexEnabled =
true;
78 bFormulaWildcardsEnabled =
false;
81 else if (!bFormulaRegexEnabled)
85 bFormulaRegexEnabled =
false;
94 bFormulaRegexEnabled =
false;
95 bFormulaWildcardsEnabled =
true;
98 else if (!bFormulaWildcardsEnabled)
102 bFormulaWildcardsEnabled =
false;
121 assert(SfxPoolItem::operator==(rItem));
137 #define SCCALCOPT_ITER_ITER 0
138 #define SCCALCOPT_ITER_STEPS 1
139 #define SCCALCOPT_ITER_MINCHG 2
140 #define SCCALCOPT_DATE_DAY 3
141 #define SCCALCOPT_DATE_MONTH 4
142 #define SCCALCOPT_DATE_YEAR 5
143 #define SCCALCOPT_DECIMALS 6
144 #define SCCALCOPT_CASESENSITIVE 7
145 #define SCCALCOPT_PRECISION 8
146 #define SCCALCOPT_SEARCHCRIT 9
147 #define SCCALCOPT_FINDLABEL 10
148 #define SCCALCOPT_REGEX 11
149 #define SCCALCOPT_WILDCARDS 12
153 #define SCDOCLAYOUTOPT_TABSTOP 0
157 return {
"IterativeReference/Iteration",
158 "IterativeReference/Steps",
159 "IterativeReference/MinimumChange",
163 "Other/DecimalPlaces",
164 "Other/CaseSensitive",
166 "Other/SearchCriteria",
168 "Other/RegularExpressions",
175 return {
"TabStop/Metric"};
177 return {
"TabStop/NonMetric"};
184 sal_Int32 nIntVal = 0;
190 sal_uInt16 nDateDay, nDateMonth;
192 GetDate( nDateDay, nDateMonth, nDateYear );
197 pValues = aValues.getConstArray();
198 OSL_ENSURE(aValues.getLength() == aNames.getLength(),
"GetProperties failed");
199 if(aValues.getLength() == aNames.getLength())
201 double fDoubleVal = 0;
202 for(
int nProp = 0; nProp < aNames.getLength(); nProp++)
204 OSL_ENSURE(pValues[nProp].hasValue(),
"property value missing");
205 if(pValues[nProp].hasValue())
213 if (pValues[nProp] >>= nIntVal)
SetIterCount( static_cast<sal_uInt16>(nIntVal) );
216 if (pValues[nProp] >>= fDoubleVal)
SetIterEps( fDoubleVal );
219 if (pValues[nProp] >>= nIntVal) nDateDay =
static_cast<sal_uInt16
>(nIntVal);
222 if (pValues[nProp] >>= nIntVal) nDateMonth =
static_cast<sal_uInt16
>(nIntVal);
225 if (pValues[nProp] >>= nIntVal) nDateYear =
static_cast<sal_Int16
>(nIntVal);
228 if (pValues[nProp] >>= nIntVal)
SetStdPrecision( static_cast<sal_uInt16>(nIntVal) );
255 SetDate( nDateDay, nDateMonth, nDateYear );
260 pValues = aValues.getConstArray();
261 OSL_ENSURE(aValues.getLength() == aNames.getLength(),
"GetProperties failed");
262 if(aValues.getLength() == aNames.getLength())
264 for(
int nProp = 0; nProp < aNames.getLength(); nProp++)
266 OSL_ENSURE(pValues[nProp].hasValue(),
"property value missing");
267 if(pValues[nProp].hasValue())
273 if (pValues[nProp] >>= nIntVal)
289 sal_uInt16 nDateDay, nDateMonth;
291 GetDate( nDateDay, nDateMonth, nDateYear );
293 for(
int nProp = 0; nProp < aNames.getLength(); nProp++)
298 pValues[nProp] <<= IsIter();
301 pValues[nProp] <<=
static_cast<sal_Int32
>(GetIterCount());
304 pValues[nProp] <<= GetIterEps();
307 pValues[nProp] <<=
static_cast<sal_Int32
>(nDateDay);
310 pValues[nProp] <<=
static_cast<sal_Int32
>(nDateMonth);
313 pValues[nProp] <<=
static_cast<sal_Int32
>(nDateYear);
316 pValues[nProp] <<=
static_cast<sal_Int32
>(GetStdPrecision());
320 pValues[nProp] <<= !IsIgnoreCase();
323 pValues[nProp] <<= IsCalcAsShown();
326 pValues[nProp] <<= IsMatchWholeCell();
329 pValues[nProp] <<= IsLookUpColRowNames();
332 pValues[nProp] <<= IsFormulaRegexEnabled();
335 pValues[nProp] <<= IsFormulaWildcardsEnabled();
339 aCalcItem.PutProperties(aNames, aValues);
348 for(
int nProp = 0; nProp < aNames.getLength(); nProp++)
356 pValues[nProp] <<=
static_cast<sal_Int32
>(
TwipsToEvenHMM( GetTabDistance() ));
360 aLayoutItem.PutProperties(aNames, aValues);
#define LINK(Instance, Class, Member)
ScTpCalcItem(sal_uInt16 nWhich, const ScDocOptions &rOpt)
#define SCCALCOPT_FINDLABEL
constexpr auto toTwips(N number, Length from)
virtual bool operator==(const SfxPoolItem &) const override
virtual ~ScTpCalcItem() override
void SetFormulaWildcardsEnabled(bool bVal)
void SetOptions(const ScDocOptions &rNew)
void SetTabDistance(sal_uInt16 nTabDist)
IMPL_LINK_NOARG(ScDocCfg, CalcCommitHdl, ScLinkConfigItem &, void)
void SetCommitLink(const Link< ScLinkConfigItem &, void > &rLink)
#define SCCALCOPT_PRECISION
#define SCCALCOPT_ITER_MINCHG
#define SCCALCOPT_CASESENSITIVE
#define SCCALCOPT_DATE_YEAR
static css::uno::Sequence< OUString > GetCalcPropertyNames()
static bool IsMetricSystem()
void SetLookUpColRowNames(bool bVal)
void SetIgnoreCase(bool bVal)
#define SCCALCOPT_ITER_STEPS
static css::uno::Sequence< OUString > GetLayoutPropertyNames()
bool EnableNotification(const css::uno::Sequence< OUString > &rNames, bool bEnableInternalNotification=false)
void SetCalcAsShown(bool bVal)
virtual ScTpCalcItem * Clone(SfxItemPool *pPool=nullptr) const override
ScLinkConfigItem aCalcItem
#define SCCALCOPT_DATE_DAY
void SetDate(sal_uInt16 nD, sal_uInt16 nM, sal_Int16 nY)
void SetIterCount(sal_uInt16 nCount)
constexpr::tools::Long TwipsToEvenHMM(::tools::Long nTwips)
#define SCCALCOPT_DECIMALS
#define SCCALCOPT_ITER_ITER
#define SCCALCOPT_SEARCHCRIT
void SetStdPrecision(sal_uInt16 n)
static sal_uInt16 lcl_GetDefaultTabDist()
const PropertyValue * pValues
#define SCCALCOPT_DATE_MONTH
void SetMatchWholeCell(bool bVal)
#define SCDOCLAYOUTOPT_TABSTOP
constexpr OUStringLiteral CFGPATH_CALC
static bool GetBoolFromAny(const css::uno::Any &aAny)
ScLinkConfigItem aLayoutItem
void SetFormulaRegexEnabled(bool bVal)
#define SCCALCOPT_WILDCARDS
css::uno::Sequence< css::uno::Any > GetProperties(const css::uno::Sequence< OUString > &rNames)
void GetDate(sal_uInt16 &rD, sal_uInt16 &rM, sal_Int16 &rY) const
constexpr OUStringLiteral CFGPATH_DOCLAYOUT
void SetIterEps(double fEps)