21 #include <osl/diagnose.h>
23 #include <com/sun/star/uno/Any.hxx>
24 #include <com/sun/star/uno/Sequence.hxx>
54 bIsIgnoreCase =
false;
65 bMatchWholeCell =
true;
67 bLookUpColRowNames =
true;
68 bFormulaRegexEnabled=
false;
69 bFormulaWildcardsEnabled=
true;
71 bWriteCalcConfig =
true;
78 bFormulaRegexEnabled =
true;
79 bFormulaWildcardsEnabled =
false;
82 else if (!bFormulaRegexEnabled)
86 bFormulaRegexEnabled =
false;
95 bFormulaRegexEnabled =
false;
96 bFormulaWildcardsEnabled =
true;
99 else if (!bFormulaWildcardsEnabled)
103 bFormulaWildcardsEnabled =
false;
122 assert(SfxPoolItem::operator==(rItem));
136 #define CFGPATH_CALC "Office.Calc/Calculate"
138 #define SCCALCOPT_ITER_ITER 0
139 #define SCCALCOPT_ITER_STEPS 1
140 #define SCCALCOPT_ITER_MINCHG 2
141 #define SCCALCOPT_DATE_DAY 3
142 #define SCCALCOPT_DATE_MONTH 4
143 #define SCCALCOPT_DATE_YEAR 5
144 #define SCCALCOPT_DECIMALS 6
145 #define SCCALCOPT_CASESENSITIVE 7
146 #define SCCALCOPT_PRECISION 8
147 #define SCCALCOPT_SEARCHCRIT 9
148 #define SCCALCOPT_FINDLABEL 10
149 #define SCCALCOPT_REGEX 11
150 #define SCCALCOPT_WILDCARDS 12
152 #define CFGPATH_DOCLAYOUT "Office.Calc/Layout/Other"
154 #define SCDOCLAYOUTOPT_TABSTOP 0
158 return {
"IterativeReference/Iteration",
159 "IterativeReference/Steps",
160 "IterativeReference/MinimumChange",
164 "Other/DecimalPlaces",
165 "Other/CaseSensitive",
167 "Other/SearchCriteria",
169 "Other/RegularExpressions",
176 return {
"TabStop/Metric"};
178 return {
"TabStop/NonMetric"};
185 sal_Int32 nIntVal = 0;
191 sal_uInt16 nDateDay, nDateMonth;
193 GetDate( nDateDay, nDateMonth, nDateYear );
198 pValues = aValues.getConstArray();
199 OSL_ENSURE(aValues.getLength() == aNames.getLength(),
"GetProperties failed");
200 if(aValues.getLength() == aNames.getLength())
202 double fDoubleVal = 0;
203 for(
int nProp = 0; nProp < aNames.getLength(); nProp++)
205 OSL_ENSURE(pValues[nProp].hasValue(),
"property value missing");
206 if(pValues[nProp].hasValue())
214 if (pValues[nProp] >>= nIntVal)
SetIterCount( static_cast<sal_uInt16>(nIntVal) );
217 if (pValues[nProp] >>= fDoubleVal)
SetIterEps( fDoubleVal );
220 if (pValues[nProp] >>= nIntVal) nDateDay =
static_cast<sal_uInt16
>(nIntVal);
223 if (pValues[nProp] >>= nIntVal) nDateMonth =
static_cast<sal_uInt16
>(nIntVal);
226 if (pValues[nProp] >>= nIntVal) nDateYear =
static_cast<sal_Int16
>(nIntVal);
229 if (pValues[nProp] >>= nIntVal)
SetStdPrecision( static_cast<sal_uInt16>(nIntVal) );
256 SetDate( nDateDay, nDateMonth, nDateYear );
261 pValues = aValues.getConstArray();
262 OSL_ENSURE(aValues.getLength() == aNames.getLength(),
"GetProperties failed");
263 if(aValues.getLength() == aNames.getLength())
265 for(
int nProp = 0; nProp < aNames.getLength(); nProp++)
267 OSL_ENSURE(pValues[nProp].hasValue(),
"property value missing");
268 if(pValues[nProp].hasValue())
274 if (pValues[nProp] >>= nIntVal)
290 sal_uInt16 nDateDay, nDateMonth;
292 GetDate( nDateDay, nDateMonth, nDateYear );
294 for(
int nProp = 0; nProp < aNames.getLength(); nProp++)
299 pValues[nProp] <<= IsIter();
302 pValues[nProp] <<=
static_cast<sal_Int32
>(GetIterCount());
305 pValues[nProp] <<= GetIterEps();
308 pValues[nProp] <<=
static_cast<sal_Int32
>(nDateDay);
311 pValues[nProp] <<=
static_cast<sal_Int32
>(nDateMonth);
314 pValues[nProp] <<=
static_cast<sal_Int32
>(nDateYear);
317 pValues[nProp] <<=
static_cast<sal_Int32
>(GetStdPrecision());
321 pValues[nProp] <<= !IsIgnoreCase();
324 pValues[nProp] <<= IsCalcAsShown();
327 pValues[nProp] <<= IsMatchWholeCell();
330 pValues[nProp] <<= IsLookUpColRowNames();
333 pValues[nProp] <<= IsFormulaRegexEnabled();
336 pValues[nProp] <<= IsFormulaWildcardsEnabled();
340 aCalcItem.PutProperties(aNames, aValues);
349 for(
int nProp = 0; nProp < aNames.getLength(); nProp++)
357 pValues[nProp] <<=
static_cast<sal_Int32
>(
TwipsToEvenHMM( GetTabDistance() ));
361 aLayoutItem.PutProperties(aNames, aValues);
#define LINK(Instance, Class, Member)
ScTpCalcItem(sal_uInt16 nWhich, const ScDocOptions &rOpt)
#define SCCALCOPT_FINDLABEL
virtual bool operator==(const SfxPoolItem &) const override
virtual ~ScTpCalcItem() override
#define CFGPATH_DOCLAYOUT
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
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
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)
inline::tools::Long HMMToTwips(::tools::Long nHMM)
void SetIterCount(sal_uInt16 nCount)
#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)
inline::tools::Long TwipsToEvenHMM(::tools::Long nTwips)
#define SCDOCLAYOUTOPT_TABSTOP
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
void SetIterEps(double fEps)