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];
128 if ( nCount && pUShorts )
131 sal_Int32* pArray = aSeq.getArray();
133 pArray[
i] = pUShorts[
i];
137 rDest <<= Sequence<sal_Int32>(0);
147 OUString* pArray = aSeq.getArray();
148 for (
size_t i=0;
i<nCount; ++
i)
149 pArray[
i] = (*pUserList)[sal::static_int_cast<sal_uInt16>(
i)].
GetString();
153 rDest <<= Sequence<OUString>(0);
158 #define SCLAYOUTOPT_MEASURE 0
159 #define SCLAYOUTOPT_STATUSBAR 1
160 #define SCLAYOUTOPT_ZOOMVAL 2
161 #define SCLAYOUTOPT_ZOOMTYPE 3
162 #define SCLAYOUTOPT_SYNCZOOM 4
163 #define SCLAYOUTOPT_STATUSBARMULTI 5
167 #define SCINPUTOPT_LASTFUNCS 0
168 #define SCINPUTOPT_AUTOINPUT 1
169 #define SCINPUTOPT_DET_AUTO 2
173 #define SCREVISOPT_CHANGE 0
174 #define SCREVISOPT_INSERTION 1
175 #define SCREVISOPT_DELETION 2
176 #define SCREVISOPT_MOVEDENTRY 3
180 #define SCCONTENTOPT_LINK 0
184 #define SCSORTLISTOPT_LIST 0
188 #define SCMISCOPT_DEFOBJWIDTH 0
189 #define SCMISCOPT_DEFOBJHEIGHT 1
190 #define SCMISCOPT_SHOWSHAREDDOCWARN 2
194 #define SCCOMPATOPT_KEY_BINDING 0
197 #define SCLAYOUTOPT_STATUSBARMULTI_DEFAULTVAL 514
199 #define SCLAYOUTOPT_STATUSBAR_DEFAULTVAL 1
202 #define SCLAYOUTOPT_STATUSBAR_DEFAULTVAL_LEGACY 9
208 for ( sal_uInt32 nFunc = 1; nFunc < 32; ++nFunc )
209 if ( nFuncSet & ( 1
U << nFunc ) )
218 return {(bIsMetric ? OUString(
"Other/MeasureUnit/Metric")
219 : OUString(
"Other/MeasureUnit/NonMetric")),
220 "Other/StatusbarFunction",
224 "Other/StatusbarMultiFunction"};
229 return {
"LastFunctions",
254 return {
"DefaultObjectSize/Width",
255 "DefaultObjectSize/Height",
256 "SharedDocument/ShowWarning"};
261 return {
"KeyBindings/BaseGroup"};
313 OSL_ENSURE(aValues.getLength() == aNames.getLength(),
"GetProperties failed");
314 if (aValues.getLength() != aNames.getLength())
317 sal_uInt32 nStatusBarFuncSingle = 0;
318 sal_uInt32 nStatusBarFuncMulti = 0;
323 nStatusBarFuncSingle = nUIntVal;
325 nStatusBarFuncMulti = nUIntVal;
327 SetZoom(static_cast<sal_uInt16>(nIntVal));
337 if (nStatusBarFuncSingle)
350 OSL_ENSURE(aValues.getLength() == aNames.getLength(),
"GetProperties failed");
351 if (aValues.getLength() != aNames.getLength())
359 std::vector<sal_uInt16> pUShorts(nCount);
360 for (sal_Int32
i = 0;
i < nCount;
i++)
374 OSL_ENSURE(aValues.getLength() == aNames.getLength(),
"GetProperties failed");
375 if (aValues.getLength() != aNames.getLength())
392 OSL_ENSURE(aValues.getLength() == aNames.getLength(),
"GetProperties failed");
393 if (aValues.getLength() != aNames.getLength())
404 OSL_ENSURE(aValues.getLength() == aNames.getLength(),
"GetProperties failed");
405 if (aValues.getLength() != aNames.getLength())
414 const bool bDefault = (
aSeq.getLength() == 1 &&
aSeq[0] ==
"NULL");
418 for (
const OUString& rStr : std::as_const(
aSeq))
433 OSL_ENSURE(aValues.getLength() == aNames.getLength(),
"GetProperties failed");
434 if (aValues.getLength() != aNames.getLength())
449 if (aValues.getLength() != aNames.getLength())
452 sal_Int32 nIntVal = 0;
463 for(
int nProp = 0; nProp < aNames.getLength(); nProp++)
468 pValues[nProp] <<=
static_cast<sal_Int32
>(GetAppMetric());
474 pValues[nProp] <<=
static_cast<sal_Int32
>(GetZoom());
477 pValues[nProp] <<=
static_cast<sal_Int32
>(GetZoomType());
480 pValues[nProp] <<= GetSynchronizeZoom();
483 pValues[nProp] <<= GetStatusFunc();
487 aLayoutItem.PutProperties(aNames, aValues);
498 for(
int nProp = 0; nProp < aNames.getLength(); nProp++)
506 pValues[nProp] <<= GetAutoComplete();
509 pValues[nProp] <<= GetDetectiveAuto();
513 aInputItem.PutProperties(aNames, aValues);
524 for(
int nProp = 0; nProp < aNames.getLength(); nProp++)
529 pValues[nProp] <<= GetTrackContentColor();
532 pValues[nProp] <<= GetTrackInsertColor();
535 pValues[nProp] <<= GetTrackDeleteColor();
538 pValues[nProp] <<= GetTrackMoveColor();
542 aRevisionItem.PutProperties(aNames, aValues);
553 for(
int nProp = 0; nProp < aNames.getLength(); nProp++)
558 pValues[nProp] <<=
static_cast<sal_Int32
>(GetLinkMode());
562 aContentItem.PutProperties(aNames, aValues);
573 for(
int nProp = 0; nProp < aNames.getLength(); nProp++)
582 aSortListItem.PutProperties(aNames, aValues);
593 for(
int nProp = 0; nProp < aNames.getLength(); nProp++)
598 pValues[nProp] <<= GetDefaultObjectSizeWidth();
601 pValues[nProp] <<= GetDefaultObjectSizeHeight();
604 pValues[nProp] <<= GetShowSharedDocumentWarning();
608 aMiscItem.PutProperties(aNames, aValues);
619 for (
int nProp = 0; nProp < aNames.getLength(); ++nProp)
624 pValues[nProp] <<=
static_cast<sal_Int32
>(GetKeyBindingType());
628 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)
constexpr OUStringLiteral CFGPATH_LAYOUT
#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 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
constexpr OUStringLiteral CFGPATH_CONTENT
#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
constexpr OUStringLiteral CFGPATH_SORTLIST
void SetDefaultObjectSizeHeight(sal_Int32 nNew)
#define SCCOMPATOPT_KEY_BINDING
#define SCMISCOPT_DEFOBJHEIGHT
constexpr OUStringLiteral CFGPATH_COMPAT
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
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()
constexpr OUStringLiteral CFGPATH_MISC
ScLinkConfigItem aInputItem
void SetNotifyLink(const Link< ScLinkConfigItem &, void > &rLink)
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
constexpr OUStringLiteral CFGPATH_INPUT
static css::uno::Sequence< OUString > GetLayoutPropertyNames()
bool mbShowSharedDocumentWarning
void SetDefaultObjectSizeWidth(sal_Int32 nNew)
constexpr OUStringLiteral CFGPATH_REVISION
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)