20 #include <com/sun/star/uno/Any.hxx>
21 #include <com/sun/star/uno/Sequence.hxx>
28 #include <osl/diagnose.h>
52 eMetric = FieldUnit::CM;
54 eMetric = FieldUnit::INCH;
57 eZoomType = SvxZoomType::PERCENT;
58 bSynchronizeZoom =
true;
61 bDetectiveAuto =
true;
63 pLRUList.reset(
new sal_uInt16[5] );
77 nDefaultObjectSizeWidth = 8000;
78 nDefaultObjectSizeHeight = 5000;
80 mbShowSharedDocumentWarning =
true;
109 nLRUFuncCount = nCount;
111 if ( nLRUFuncCount > 0 )
113 pLRUList.reset(
new sal_uInt16[nLRUFuncCount] );
115 for ( sal_uInt16
i=0;
i<nLRUFuncCount;
i++ )
116 pLRUList[
i] = pList[
i];
127 if ( !(rValue >>= aSeq) )
130 sal_Int32
nCount = aSeq.getLength();
133 const sal_Int32* pArray = aSeq.getConstArray();
134 std::unique_ptr<sal_uInt16[]> pUShorts(
new sal_uInt16[nCount]);
135 for (sal_Int32
i=0;
i<nCount;
i++)
136 pUShorts[
i] = static_cast<sal_uInt16>(pArray[
i]);
138 rOpt.
SetLRUFuncList( pUShorts.get(), sal::static_int_cast<sal_uInt16>(nCount) );
146 if ( nCount && pUShorts )
149 sal_Int32* pArray = aSeq.getArray();
151 pArray[
i] = pUShorts[
i];
155 rDest <<= Sequence<sal_Int32>(0);
161 if ( !(rValue >>= aSeq) )
165 const OUString* pArray = aSeq.getConstArray();
170 bool bDefault = ( nCount == 1 && pArray[0] ==
"NULL" );
176 for (
const auto& rStr : std::as_const(aSeq))
193 OUString* pArray = aSeq.getArray();
194 for (
size_t i=0;
i<nCount; ++
i)
195 pArray[
i] = (*pUserList)[sal::static_int_cast<sal_uInt16>(
i)].
GetString();
199 rDest <<= Sequence<OUString>(0);
202 #define CFGPATH_LAYOUT "Office.Calc/Layout"
204 #define SCLAYOUTOPT_MEASURE 0
205 #define SCLAYOUTOPT_STATUSBAR 1
206 #define SCLAYOUTOPT_ZOOMVAL 2
207 #define SCLAYOUTOPT_ZOOMTYPE 3
208 #define SCLAYOUTOPT_SYNCZOOM 4
209 #define SCLAYOUTOPT_STATUSBARMULTI 5
211 #define CFGPATH_INPUT "Office.Calc/Input"
213 #define SCINPUTOPT_LASTFUNCS 0
214 #define SCINPUTOPT_AUTOINPUT 1
215 #define SCINPUTOPT_DET_AUTO 2
217 #define CFGPATH_REVISION "Office.Calc/Revision/Color"
219 #define SCREVISOPT_CHANGE 0
220 #define SCREVISOPT_INSERTION 1
221 #define SCREVISOPT_DELETION 2
222 #define SCREVISOPT_MOVEDENTRY 3
224 #define CFGPATH_CONTENT "Office.Calc/Content/Update"
226 #define SCCONTENTOPT_LINK 0
228 #define CFGPATH_SORTLIST "Office.Calc/SortList"
230 #define SCSORTLISTOPT_LIST 0
232 #define CFGPATH_MISC "Office.Calc/Misc"
234 #define SCMISCOPT_DEFOBJWIDTH 0
235 #define SCMISCOPT_DEFOBJHEIGHT 1
236 #define SCMISCOPT_SHOWSHAREDDOCWARN 2
238 #define CFGPATH_COMPAT "Office.Calc/Compatibility"
240 #define SCCOMPATOPT_KEY_BINDING 0
243 #define SCLAYOUTOPT_STATUSBARMULTI_DEFAULTVAL 514
245 #define SCLAYOUTOPT_STATUSBAR_DEFAULTVAL 1
248 #define SCLAYOUTOPT_STATUSBAR_DEFAULTVAL_LEGACY 9
254 for ( sal_uInt32 nFunc = 1; nFunc < 32; ++nFunc )
255 if ( nFuncSet & ( 1
U << nFunc ) )
264 return {(bIsMetric ? OUString(
"Other/MeasureUnit/Metric")
265 : OUString(
"Other/MeasureUnit/NonMetric")),
266 "Other/StatusbarFunction",
270 "Other/StatusbarMultiFunction"};
275 return {
"LastFunctions",
300 return {
"DefaultObjectSize/Width",
301 "DefaultObjectSize/Height",
302 "SharedDocument/ShowWarning"};
307 return {
"KeyBindings/BaseGroup"};
319 sal_Int32 nIntVal = 0;
328 pValues = aValues.getConstArray();
329 OSL_ENSURE(aValues.getLength() == aNames.getLength(),
"GetProperties failed");
330 if(aValues.getLength() == aNames.getLength())
332 sal_uInt32 nStatusBarFuncSingle = 0;
333 sal_uInt32 nStatusBarFuncMulti = 0;
334 sal_uInt32 nUIntValTmp = 0;
335 for(
int nProp = 0; nProp < aNames.getLength(); nProp++)
337 OSL_ENSURE(pValues[nProp].hasValue(),
"property value missing");
338 if(pValues[nProp].hasValue())
343 if (pValues[nProp] >>= nIntVal)
SetAppMetric( static_cast<FieldUnit>(nIntVal) );
347 nStatusBarFuncSingle = nUIntValTmp;
351 nStatusBarFuncMulti = nUIntValTmp;
354 if (pValues[nProp] >>= nIntVal)
SetZoom( static_cast<sal_uInt16>(nIntVal) );
357 if (pValues[nProp] >>= nIntVal)
SetZoomType( static_cast<SvxZoomType>(nIntVal) );
371 if ( nStatusBarFuncSingle )
384 pValues = aValues.getConstArray();
385 OSL_ENSURE(aValues.getLength() == aNames.getLength(),
"GetProperties failed");
386 if(aValues.getLength() == aNames.getLength())
388 for(
int nProp = 0; nProp < aNames.getLength(); nProp++)
390 OSL_ENSURE(pValues[nProp].hasValue(),
"property value missing");
391 if(pValues[nProp].hasValue())
413 pValues = aValues.getConstArray();
414 OSL_ENSURE(aValues.getLength() == aNames.getLength(),
"GetProperties failed");
415 if(aValues.getLength() == aNames.getLength())
417 for(
int nProp = 0; nProp < aNames.getLength(); nProp++)
419 OSL_ENSURE(pValues[nProp].hasValue(),
"property value missing");
420 if(pValues[nProp].hasValue())
445 pValues = aValues.getConstArray();
446 OSL_ENSURE(aValues.getLength() == aNames.getLength(),
"GetProperties failed");
447 if(aValues.getLength() == aNames.getLength())
449 for(
int nProp = 0; nProp < aNames.getLength(); nProp++)
451 OSL_ENSURE(pValues[nProp].hasValue(),
"property value missing");
452 if(pValues[nProp].hasValue())
457 if (pValues[nProp] >>= nIntVal)
SetLinkMode( static_cast<ScLkUpdMode>(nIntVal) );
468 pValues = aValues.getConstArray();
469 OSL_ENSURE(aValues.getLength() == aNames.getLength(),
"GetProperties failed");
470 if(aValues.getLength() == aNames.getLength())
472 for(
int nProp = 0; nProp < aNames.getLength(); nProp++)
474 OSL_ENSURE(pValues[nProp].hasValue(),
"property value missing");
475 if(pValues[nProp].hasValue())
491 pValues = aValues.getConstArray();
492 OSL_ENSURE(aValues.getLength() == aNames.getLength(),
"GetProperties failed");
493 if(aValues.getLength() == aNames.getLength())
495 for(
int nProp = 0; nProp < aNames.getLength(); nProp++)
497 OSL_ENSURE(pValues[nProp].hasValue(),
"property value missing");
498 if(pValues[nProp].hasValue())
520 pValues = aValues.getConstArray();
521 if (aValues.getLength() == aNames.getLength())
523 for (
int nProp = 0; nProp < aNames.getLength(); ++nProp)
530 pValues[nProp] >>= nIntVal;
545 for(
int nProp = 0; nProp < aNames.getLength(); nProp++)
550 pValues[nProp] <<=
static_cast<sal_Int32
>(GetAppMetric());
556 pValues[nProp] <<=
static_cast<sal_Int32
>(GetZoom());
559 pValues[nProp] <<=
static_cast<sal_Int32
>(GetZoomType());
562 pValues[nProp] <<= GetSynchronizeZoom();
565 pValues[nProp] <<= GetStatusFunc();
569 aLayoutItem.PutProperties(aNames, aValues);
578 for(
int nProp = 0; nProp < aNames.getLength(); nProp++)
586 pValues[nProp] <<= GetAutoComplete();
589 pValues[nProp] <<= GetDetectiveAuto();
593 aInputItem.PutProperties(aNames, aValues);
602 for(
int nProp = 0; nProp < aNames.getLength(); nProp++)
607 pValues[nProp] <<= GetTrackContentColor();
610 pValues[nProp] <<= GetTrackInsertColor();
613 pValues[nProp] <<= GetTrackDeleteColor();
616 pValues[nProp] <<= GetTrackMoveColor();
620 aRevisionItem.PutProperties(aNames, aValues);
629 for(
int nProp = 0; nProp < aNames.getLength(); nProp++)
634 pValues[nProp] <<=
static_cast<sal_Int32
>(GetLinkMode());
638 aContentItem.PutProperties(aNames, aValues);
647 for(
int nProp = 0; nProp < aNames.getLength(); nProp++)
656 aSortListItem.PutProperties(aNames, aValues);
665 for(
int nProp = 0; nProp < aNames.getLength(); nProp++)
670 pValues[nProp] <<= GetDefaultObjectSizeWidth();
673 pValues[nProp] <<= GetDefaultObjectSizeHeight();
676 pValues[nProp] <<= GetShowSharedDocumentWarning();
680 aMiscItem.PutProperties(aNames, aValues);
689 for (
int nProp = 0; nProp < aNames.getLength(); ++nProp)
694 pValues[nProp] <<=
static_cast<sal_Int32
>(GetKeyBindingType());
698 aCompatItem.PutProperties(aNames, aValues);
ScOptionsUtil::KeyBindingType meKeyBindingType
#define LINK(Instance, Class, Member)
void SetAutoComplete(bool bNew)
#define SCREVISOPT_DELETION
Collection of user-defined sort lists.
#define SCMISCOPT_SHOWSHAREDDOCWARN
ScLinkConfigItem aMiscItem
ScLinkConfigItem aSortListItem
IMPL_LINK_NOARG(ScAppCfg, LayoutCommitHdl, ScLinkConfigItem &, void)
ScLinkConfigItem aContentItem
sal_uInt16 GetLRUFuncListCount() const
void SetLRUFuncList(const sal_uInt16 *pList, const sal_uInt16 nCount)
constexpr::Color COL_TRANSPARENT(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
#define SCREVISOPT_INSERTION
static void SetUserList(const ScUserList *pNewList)
void SetStatusFunc(sal_uInt32 nNew)
static void lcl_GetSortList(Any &rDest)
static css::uno::Sequence< OUString > GetSortListPropertyNames()
static void lcl_SetLastFunctions(ScAppOptions &rOpt, const Any &rValue)
static css::uno::Sequence< OUString > GetRevisionPropertyNames()
void SetCommitLink(const Link< ScLinkConfigItem &, void > &rLink)
ScAppOptions & operator=(const ScAppOptions &rOpt)
void SetTrackDeleteColor(Color nNew)
#define SCINPUTOPT_AUTOINPUT
OUString GetString(int nId)
void push_back(ScUserListData *p)
Stores individual user-defined sort list.
#define SCLAYOUTOPT_MEASURE
#define SCLAYOUTOPT_STATUSBAR_DEFAULTVAL_LEGACY
void SetTrackContentColor(Color nNew)
static bool IsMetricSystem()
sal_uInt16 * GetLRUFuncList() const
#define SCLAYOUTOPT_STATUSBAR_DEFAULTVAL
bool EnableNotification(const css::uno::Sequence< OUString > &rNames, bool bEnableInternalNotification=false)
void SetTrackMoveColor(Color nNew)
#define SCREVISOPT_MOVEDENTRY
sal_Int32 nDefaultObjectSizeHeight
#define SCLAYOUTOPT_SYNCZOOM
void SetDefaultObjectSizeHeight(sal_Int32 nNew)
#define SCCOMPATOPT_KEY_BINDING
#define SCMISCOPT_DEFOBJHEIGHT
void SetKeyBindingType(ScOptionsUtil::KeyBindingType e)
void SetDetectiveAuto(bool bNew)
ScLinkConfigItem aCompatItem
#define SCSORTLISTOPT_LIST
#define SCMISCOPT_DEFOBJWIDTH
static SC_DLLPUBLIC ScUserList * GetUserList()
void SetSynchronizeZoom(bool bNew)
#define SCCONTENTOPT_LINK
#define SC_OPCODE_AVERAGE
#define SCLAYOUTOPT_STATUSBARMULTI_DEFAULTVAL
static void lcl_SetSortList(const Any &rValue)
void SetShowSharedDocumentWarning(bool bNew)
void SetZoom(sal_uInt16 nNew)
#define SCLAYOUTOPT_STATUSBAR
void SetTrackInsertColor(Color nNew)
sal_Int32 nDefaultObjectSizeWidth
static css::uno::Sequence< OUString > GetMiscPropertyNames()
ScLinkConfigItem aInputItem
const PropertyValue * pValues
static css::uno::Sequence< OUString > GetCompatPropertyNames()
static css::uno::Sequence< OUString > GetContentPropertyNames()
#define SCLAYOUTOPT_STATUSBARMULTI
#define SCLAYOUTOPT_ZOOMTYPE
static void lcl_GetLastFunctions(Any &rDest, const ScAppOptions &rOpt)
ScLinkConfigItem aLayoutItem
split ScAppOptions into different classes
Sequence< sal_Int8 > aSeq
void SetZoomType(SvxZoomType eNew)
#define SCINPUTOPT_LASTFUNCS
std::unique_ptr< sal_uInt16[]> pLRUList
static css::uno::Sequence< OUString > GetLayoutPropertyNames()
bool mbShowSharedDocumentWarning
void SetDefaultObjectSizeWidth(sal_Int32 nNew)
static bool GetBoolFromAny(const css::uno::Any &aAny)
#define SCINPUTOPT_DET_AUTO
static css::uno::Sequence< OUString > GetInputPropertyNames()
#define SCLAYOUTOPT_ZOOMVAL
css::uno::Sequence< css::uno::Any > GetProperties(const css::uno::Sequence< OUString > &rNames)
static sal_uInt32 lcl_ConvertStatusBarFuncSetToSingle(sal_uInt32 nFuncSet)
void SetLinkMode(ScLkUpdMode nSet)
void SetOptions(const ScAppOptions &rNew)
#define SCREVISOPT_CHANGE
ScLinkConfigItem aRevisionItem
void SetAppMetric(FieldUnit eUnit)