LibreOffice Module sc (master)  1
appoptio.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #include <com/sun/star/uno/Any.hxx>
21 #include <com/sun/star/uno/Sequence.hxx>
22 #include <appoptio.hxx>
23 #include <global.hxx>
24 #include <userlist.hxx>
25 #include <formula/compiler.hxx>
26 #include <miscuno.hxx>
27 #include <vector>
28 #include <osl/diagnose.h>
29 
30 using namespace utl;
31 using namespace com::sun::star::uno;
32 
33 // ScAppOptions - Application Options
34 
36 {
37  SetDefaults();
38 }
39 
41 {
42  *this = rCpy;
43 }
44 
46 {
47 }
48 
50 {
52  eMetric = FieldUnit::CM; // default for countries with metric system
53  else
54  eMetric = FieldUnit::INCH; // default for others
55 
56  nZoom = 100;
57  eZoomType = SvxZoomType::PERCENT;
58  bSynchronizeZoom = true;
59  nStatusFunc = ( 1 << SUBTOTAL_FUNC_SUM );
60  bAutoComplete = true;
61  bDetectiveAuto = true;
62 
63  pLRUList.reset( new sal_uInt16[5] ); // sensible initialization
64  pLRUList[0] = SC_OPCODE_SUM;
65  pLRUList[1] = SC_OPCODE_AVERAGE;
66  pLRUList[2] = SC_OPCODE_MIN;
67  pLRUList[3] = SC_OPCODE_MAX;
68  pLRUList[4] = SC_OPCODE_IF;
69  nLRUFuncCount = 5;
70 
71  nTrackContentColor = COL_TRANSPARENT;
72  nTrackInsertColor = COL_TRANSPARENT;
73  nTrackDeleteColor = COL_TRANSPARENT;
74  nTrackMoveColor = COL_TRANSPARENT;
75  eLinkMode = LM_ON_DEMAND;
76 
77  nDefaultObjectSizeWidth = 8000;
78  nDefaultObjectSizeHeight = 5000;
79 
80  mbShowSharedDocumentWarning = true;
81 
82  meKeyBindingType = ScOptionsUtil::KEY_DEFAULT;
83 }
84 
86 {
87  eMetric = rCpy.eMetric;
88  eZoomType = rCpy.eZoomType;
89  bSynchronizeZoom = rCpy.bSynchronizeZoom;
90  nZoom = rCpy.nZoom;
91  SetLRUFuncList( rCpy.pLRUList.get(), rCpy.nLRUFuncCount );
92  nStatusFunc = rCpy.nStatusFunc;
93  bAutoComplete = rCpy.bAutoComplete;
94  bDetectiveAuto = rCpy.bDetectiveAuto;
95  nTrackContentColor = rCpy.nTrackContentColor;
96  nTrackInsertColor = rCpy.nTrackInsertColor;
97  nTrackDeleteColor = rCpy.nTrackDeleteColor;
98  nTrackMoveColor = rCpy.nTrackMoveColor;
99  eLinkMode = rCpy.eLinkMode;
100  nDefaultObjectSizeWidth = rCpy.nDefaultObjectSizeWidth;
101  nDefaultObjectSizeHeight = rCpy.nDefaultObjectSizeHeight;
102  mbShowSharedDocumentWarning = rCpy.mbShowSharedDocumentWarning;
103  meKeyBindingType = rCpy.meKeyBindingType;
104  return *this;
105 }
106 
107 void ScAppOptions::SetLRUFuncList( const sal_uInt16* pList, const sal_uInt16 nCount )
108 {
109  nLRUFuncCount = nCount;
110 
111  if ( nLRUFuncCount > 0 )
112  {
113  pLRUList.reset( new sal_uInt16[nLRUFuncCount] );
114 
115  for ( sal_uInt16 i=0; i<nLRUFuncCount; i++ )
116  pLRUList[i] = pList[i];
117  }
118  else
119  pLRUList.reset();
120 }
121 
122 // Config Item containing app options
123 
124 static void lcl_GetLastFunctions( Any& rDest, const ScAppOptions& rOpt )
125 {
127  sal_uInt16* pUShorts = rOpt.GetLRUFuncList();
128  if ( nCount && pUShorts )
129  {
130  Sequence<sal_Int32> aSeq( nCount );
131  sal_Int32* pArray = aSeq.getArray();
132  for (tools::Long i=0; i<nCount; i++)
133  pArray[i] = pUShorts[i];
134  rDest <<= aSeq;
135  }
136  else
137  rDest <<= Sequence<sal_Int32>(0); // empty
138 }
139 
140 static void lcl_GetSortList( Any& rDest )
141 {
142  const ScUserList* pUserList = ScGlobal::GetUserList();
143  if (pUserList)
144  {
145  size_t nCount = pUserList->size();
146  Sequence<OUString> aSeq( nCount );
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();
150  rDest <<= aSeq;
151  }
152  else
153  rDest <<= Sequence<OUString>(0); // empty
154 }
155 
156 constexpr OUStringLiteral CFGPATH_LAYOUT = u"Office.Calc/Layout";
157 
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
164 
165 constexpr OUStringLiteral CFGPATH_INPUT = u"Office.Calc/Input";
166 
167 #define SCINPUTOPT_LASTFUNCS 0
168 #define SCINPUTOPT_AUTOINPUT 1
169 #define SCINPUTOPT_DET_AUTO 2
170 
171 constexpr OUStringLiteral CFGPATH_REVISION = u"Office.Calc/Revision/Color";
172 
173 #define SCREVISOPT_CHANGE 0
174 #define SCREVISOPT_INSERTION 1
175 #define SCREVISOPT_DELETION 2
176 #define SCREVISOPT_MOVEDENTRY 3
177 
178 constexpr OUStringLiteral CFGPATH_CONTENT = u"Office.Calc/Content/Update";
179 
180 #define SCCONTENTOPT_LINK 0
181 
182 constexpr OUStringLiteral CFGPATH_SORTLIST = u"Office.Calc/SortList";
183 
184 #define SCSORTLISTOPT_LIST 0
185 
186 constexpr OUStringLiteral CFGPATH_MISC = u"Office.Calc/Misc";
187 
188 #define SCMISCOPT_DEFOBJWIDTH 0
189 #define SCMISCOPT_DEFOBJHEIGHT 1
190 #define SCMISCOPT_SHOWSHAREDDOCWARN 2
191 
192 constexpr OUStringLiteral CFGPATH_COMPAT = u"Office.Calc/Compatibility";
193 
194 #define SCCOMPATOPT_KEY_BINDING 0
195 
196 // Default value of Layout/Other/StatusbarMultiFunction
197 #define SCLAYOUTOPT_STATUSBARMULTI_DEFAULTVAL 514
198 // Default value of Layout/Other/StatusbarFunction
199 #define SCLAYOUTOPT_STATUSBAR_DEFAULTVAL 1
200 // Legacy default value of Layout/Other/StatusbarFunction
201 // prior to multiple statusbar functions feature addition
202 #define SCLAYOUTOPT_STATUSBAR_DEFAULTVAL_LEGACY 9
203 
204 static sal_uInt32 lcl_ConvertStatusBarFuncSetToSingle( sal_uInt32 nFuncSet )
205 {
206  if ( !nFuncSet )
207  return 0;
208  for ( sal_uInt32 nFunc = 1; nFunc < 32; ++nFunc )
209  if ( nFuncSet & ( 1U << nFunc ) )
210  return nFunc;
211  return 0;
212 }
213 
215 {
216  const bool bIsMetric = ScOptionsUtil::IsMetricSystem();
217 
218  return {(bIsMetric ? OUString("Other/MeasureUnit/Metric")
219  : OUString("Other/MeasureUnit/NonMetric")), // SCLAYOUTOPT_MEASURE
220  "Other/StatusbarFunction", // SCLAYOUTOPT_STATUSBAR
221  "Zoom/Value", // SCLAYOUTOPT_ZOOMVAL
222  "Zoom/Type", // SCLAYOUTOPT_ZOOMTYPE
223  "Zoom/Synchronize", // SCLAYOUTOPT_SYNCZOOM
224  "Other/StatusbarMultiFunction"}; // SCLAYOUTOPT_STATUSBARMULTI
225 }
226 
228 {
229  return {"LastFunctions", // SCINPUTOPT_LASTFUNCS
230  "AutoInput", // SCINPUTOPT_AUTOINPUT
231  "DetectiveAuto"}; // SCINPUTOPT_DET_AUTO
232 }
233 
235 {
236  return {"Change", // SCREVISOPT_CHANGE
237  "Insertion", // SCREVISOPT_INSERTION
238  "Deletion", // SCREVISOPT_DELETION
239  "MovedEntry"}; // SCREVISOPT_MOVEDENTRY
240 }
241 
243 {
244  return {"Link"}; // SCCONTENTOPT_LINK
245 }
246 
248 {
249  return {"List"}; // SCSORTLISTOPT_LIST
250 }
251 
253 {
254  return {"DefaultObjectSize/Width", // SCMISCOPT_DEFOBJWIDTH
255  "DefaultObjectSize/Height", // SCMISCOPT_DEFOBJHEIGHT
256  "SharedDocument/ShowWarning"}; // SCMISCOPT_SHOWSHAREDDOCWARN
257 }
258 
260 {
261  return {"KeyBindings/BaseGroup"}; // SCCOMPATOPT_KEY_BINDING
262 }
263 
265  aLayoutItem( CFGPATH_LAYOUT ),
266  aInputItem( CFGPATH_INPUT ),
267  aRevisionItem( CFGPATH_REVISION ),
268  aContentItem( CFGPATH_CONTENT ),
269  aSortListItem( CFGPATH_SORTLIST ),
270  aMiscItem( CFGPATH_MISC ),
271  aCompatItem( CFGPATH_COMPAT )
272 {
274  ReadLayoutCfg();
275  aLayoutItem.SetCommitLink( LINK( this, ScAppCfg, LayoutCommitHdl ) );
276  aLayoutItem.SetNotifyLink( LINK( this, ScAppCfg, LayoutNotifyHdl ) );
277 
279  ReadInputCfg();
280  aInputItem.SetCommitLink( LINK( this, ScAppCfg, InputCommitHdl ) );
281  aInputItem.SetNotifyLink( LINK( this, ScAppCfg, InputNotifyHdl ) );
282 
284  ReadRevisionCfg();
285  aRevisionItem.SetCommitLink( LINK( this, ScAppCfg, RevisionCommitHdl ) );
286  aRevisionItem.SetNotifyLink( LINK( this, ScAppCfg, RevisionNotifyHdl ) );
287 
289  ReadContentCfg();
290  aContentItem.SetCommitLink( LINK( this, ScAppCfg, ContentCommitHdl ) );
291  aContentItem.SetNotifyLink( LINK( this, ScAppCfg, ContentNotifyHdl ) );
292 
294  ReadSortListCfg();
295  aSortListItem.SetCommitLink( LINK( this, ScAppCfg, SortListCommitHdl ) );
296  aSortListItem.SetNotifyLink( LINK( this, ScAppCfg, SortListNotifyHdl ) );
297 
299  ReadMiscCfg();
300  aMiscItem.SetCommitLink( LINK( this, ScAppCfg, MiscCommitHdl ) );
301  aMiscItem.SetNotifyLink( LINK( this, ScAppCfg, MiscNotifyHdl ) );
302 
304  ReadCompatCfg();
305  aCompatItem.SetCommitLink( LINK(this, ScAppCfg, CompatCommitHdl) );
306  aCompatItem.SetNotifyLink( LINK(this, ScAppCfg, CompatNotifyHdl) );
307 }
308 
310 {
312  const Sequence<Any> aValues = aLayoutItem.GetProperties(aNames);
313  OSL_ENSURE(aValues.getLength() == aNames.getLength(), "GetProperties failed");
314  if (aValues.getLength() != aNames.getLength())
315  return;
316 
317  sal_uInt32 nStatusBarFuncSingle = 0;
318  sal_uInt32 nStatusBarFuncMulti = 0;
319 
320  if (sal_Int32 nIntVal; aValues[SCLAYOUTOPT_MEASURE] >>= nIntVal)
321  SetAppMetric(static_cast<FieldUnit>(nIntVal));
322  if (sal_uInt32 nUIntVal; aValues[SCLAYOUTOPT_STATUSBAR] >>= nUIntVal)
323  nStatusBarFuncSingle = nUIntVal;
324  if (sal_uInt32 nUIntVal; aValues[SCLAYOUTOPT_STATUSBARMULTI] >>= nUIntVal)
325  nStatusBarFuncMulti = nUIntVal;
326  if (sal_Int32 nIntVal; aValues[SCLAYOUTOPT_ZOOMVAL] >>= nIntVal)
327  SetZoom(static_cast<sal_uInt16>(nIntVal));
328  if (sal_Int32 nIntVal; aValues[SCLAYOUTOPT_ZOOMTYPE] >>= nIntVal)
329  SetZoomType(static_cast<SvxZoomType>(nIntVal));
331 
332  if (nStatusBarFuncMulti != SCLAYOUTOPT_STATUSBARMULTI_DEFAULTVAL)
333  SetStatusFunc(nStatusBarFuncMulti);
334  else if (nStatusBarFuncSingle != SCLAYOUTOPT_STATUSBAR_DEFAULTVAL
335  && nStatusBarFuncSingle != SCLAYOUTOPT_STATUSBAR_DEFAULTVAL_LEGACY)
336  {
337  if (nStatusBarFuncSingle)
338  SetStatusFunc(1 << nStatusBarFuncSingle);
339  else
340  SetStatusFunc(0);
341  }
342  else
344 }
345 
347 {
348  const Sequence<OUString> aNames = GetInputPropertyNames();
349  const Sequence<Any> aValues = aInputItem.GetProperties(aNames);
350  OSL_ENSURE(aValues.getLength() == aNames.getLength(), "GetProperties failed");
351  if (aValues.getLength() != aNames.getLength())
352  return;
353 
355  {
356  sal_Int32 nCount = aSeq.getLength();
357  if (nCount < SAL_MAX_UINT16)
358  {
359  std::vector<sal_uInt16> pUShorts(nCount);
360  for (sal_Int32 i = 0; i < nCount; i++)
361  pUShorts[i] = aSeq[i];
362 
363  SetLRUFuncList(pUShorts.data(), nCount);
364  }
365  }
368 }
369 
371 {
373  const Sequence<Any> aValues = aRevisionItem.GetProperties(aNames);
374  OSL_ENSURE(aValues.getLength() == aNames.getLength(), "GetProperties failed");
375  if (aValues.getLength() != aNames.getLength())
376  return;
377 
378  if (sal_Int32 nIntVal; aValues[SCREVISOPT_CHANGE] >>= nIntVal)
380  if (sal_Int32 nIntVal; aValues[SCREVISOPT_INSERTION] >>= nIntVal)
382  if (sal_Int32 nIntVal; aValues[SCREVISOPT_DELETION] >>= nIntVal)
384  if (sal_Int32 nIntVal; aValues[SCREVISOPT_MOVEDENTRY] >>= nIntVal)
386 }
387 
389 {
391  const Sequence<Any> aValues = aContentItem.GetProperties(aNames);
392  OSL_ENSURE(aValues.getLength() == aNames.getLength(), "GetProperties failed");
393  if (aValues.getLength() != aNames.getLength())
394  return;
395 
396  if (sal_Int32 nIntVal; aValues[SCCONTENTOPT_LINK] >>= nIntVal)
397  SetLinkMode(static_cast<ScLkUpdMode>(nIntVal));
398 }
399 
401 {
403  const Sequence<Any> aValues = aSortListItem.GetProperties(aNames);
404  OSL_ENSURE(aValues.getLength() == aNames.getLength(), "GetProperties failed");
405  if (aValues.getLength() != aNames.getLength())
406  return;
407 
409  {
410  ScUserList aList;
411 
412  // if setting is "default", keep default values from ScUserList ctor
413  //TODO: mark "default" in a safe way
414  const bool bDefault = (aSeq.getLength() == 1 && aSeq[0] == "NULL");
415 
416  if (!bDefault)
417  {
418  for (const OUString& rStr : std::as_const(aSeq))
419  {
420  ScUserListData* pNew = new ScUserListData(rStr);
421  aList.push_back(pNew);
422  }
423  }
424 
425  ScGlobal::SetUserList(&aList);
426  }
427 }
428 
430 {
431  const Sequence<OUString> aNames = GetMiscPropertyNames();
432  const Sequence<Any> aValues = aMiscItem.GetProperties(aNames);
433  OSL_ENSURE(aValues.getLength() == aNames.getLength(), "GetProperties failed");
434  if (aValues.getLength() != aNames.getLength())
435  return;
436 
437  if (sal_Int32 nIntVal; aValues[SCMISCOPT_DEFOBJWIDTH] >>= nIntVal)
438  SetDefaultObjectSizeWidth(nIntVal);
439  if (sal_Int32 nIntVal; aValues[SCMISCOPT_DEFOBJHEIGHT] >>= nIntVal)
443 }
444 
446 {
448  const Sequence<Any> aValues = aCompatItem.GetProperties(aNames);
449  if (aValues.getLength() != aNames.getLength())
450  return;
451 
452  sal_Int32 nIntVal = 0; // 0 = 'Default'
453  aValues[SCCOMPATOPT_KEY_BINDING] >>= nIntVal;
454  SetKeyBindingType(static_cast<ScOptionsUtil::KeyBindingType>(nIntVal));
455 }
456 
457 IMPL_LINK_NOARG(ScAppCfg, LayoutCommitHdl, ScLinkConfigItem&, void)
458 {
459  Sequence<OUString> aNames = GetLayoutPropertyNames();
460  Sequence<Any> aValues(aNames.getLength());
461  Any* pValues = aValues.getArray();
462 
463  for(int nProp = 0; nProp < aNames.getLength(); nProp++)
464  {
465  switch(nProp)
466  {
467  case SCLAYOUTOPT_MEASURE:
468  pValues[nProp] <<= static_cast<sal_Int32>(GetAppMetric());
469  break;
471  pValues[nProp] <<= lcl_ConvertStatusBarFuncSetToSingle( GetStatusFunc() );
472  break;
473  case SCLAYOUTOPT_ZOOMVAL:
474  pValues[nProp] <<= static_cast<sal_Int32>(GetZoom());
475  break;
477  pValues[nProp] <<= static_cast<sal_Int32>(GetZoomType());
478  break;
480  pValues[nProp] <<= GetSynchronizeZoom();
481  break;
483  pValues[nProp] <<= GetStatusFunc();
484  break;
485  }
486  }
487  aLayoutItem.PutProperties(aNames, aValues);
488 }
489 
490 IMPL_LINK_NOARG(ScAppCfg, LayoutNotifyHdl, ScLinkConfigItem&, void) { ReadLayoutCfg(); }
491 
492 IMPL_LINK_NOARG(ScAppCfg, InputCommitHdl, ScLinkConfigItem&, void)
493 {
494  Sequence<OUString> aNames = GetInputPropertyNames();
495  Sequence<Any> aValues(aNames.getLength());
496  Any* pValues = aValues.getArray();
497 
498  for(int nProp = 0; nProp < aNames.getLength(); nProp++)
499  {
500  switch(nProp)
501  {
503  lcl_GetLastFunctions( pValues[nProp], *this );
504  break;
506  pValues[nProp] <<= GetAutoComplete();
507  break;
508  case SCINPUTOPT_DET_AUTO:
509  pValues[nProp] <<= GetDetectiveAuto();
510  break;
511  }
512  }
513  aInputItem.PutProperties(aNames, aValues);
514 }
515 
516 IMPL_LINK_NOARG(ScAppCfg, InputNotifyHdl, ScLinkConfigItem&, void) { ReadInputCfg(); }
517 
518 IMPL_LINK_NOARG(ScAppCfg, RevisionCommitHdl, ScLinkConfigItem&, void)
519 {
520  Sequence<OUString> aNames = GetRevisionPropertyNames();
521  Sequence<Any> aValues(aNames.getLength());
522  Any* pValues = aValues.getArray();
523 
524  for(int nProp = 0; nProp < aNames.getLength(); nProp++)
525  {
526  switch(nProp)
527  {
528  case SCREVISOPT_CHANGE:
529  pValues[nProp] <<= GetTrackContentColor();
530  break;
532  pValues[nProp] <<= GetTrackInsertColor();
533  break;
534  case SCREVISOPT_DELETION:
535  pValues[nProp] <<= GetTrackDeleteColor();
536  break;
538  pValues[nProp] <<= GetTrackMoveColor();
539  break;
540  }
541  }
542  aRevisionItem.PutProperties(aNames, aValues);
543 }
544 
545 IMPL_LINK_NOARG(ScAppCfg, RevisionNotifyHdl, ScLinkConfigItem&, void) { ReadRevisionCfg(); }
546 
547 IMPL_LINK_NOARG(ScAppCfg, ContentCommitHdl, ScLinkConfigItem&, void)
548 {
549  Sequence<OUString> aNames = GetContentPropertyNames();
550  Sequence<Any> aValues(aNames.getLength());
551  Any* pValues = aValues.getArray();
552 
553  for(int nProp = 0; nProp < aNames.getLength(); nProp++)
554  {
555  switch(nProp)
556  {
557  case SCCONTENTOPT_LINK:
558  pValues[nProp] <<= static_cast<sal_Int32>(GetLinkMode());
559  break;
560  }
561  }
562  aContentItem.PutProperties(aNames, aValues);
563 }
564 
565 IMPL_LINK_NOARG(ScAppCfg, ContentNotifyHdl, ScLinkConfigItem&, void) { ReadContentCfg(); }
566 
567 IMPL_LINK_NOARG(ScAppCfg, SortListCommitHdl, ScLinkConfigItem&, void)
568 {
569  Sequence<OUString> aNames = GetSortListPropertyNames();
570  Sequence<Any> aValues(aNames.getLength());
571  Any* pValues = aValues.getArray();
572 
573  for(int nProp = 0; nProp < aNames.getLength(); nProp++)
574  {
575  switch(nProp)
576  {
577  case SCSORTLISTOPT_LIST:
578  lcl_GetSortList( pValues[nProp] );
579  break;
580  }
581  }
582  aSortListItem.PutProperties(aNames, aValues);
583 }
584 
585 IMPL_LINK_NOARG(ScAppCfg, SortListNotifyHdl, ScLinkConfigItem&, void) { ReadSortListCfg(); }
586 
588 {
589  Sequence<OUString> aNames = GetMiscPropertyNames();
590  Sequence<Any> aValues(aNames.getLength());
591  Any* pValues = aValues.getArray();
592 
593  for(int nProp = 0; nProp < aNames.getLength(); nProp++)
594  {
595  switch(nProp)
596  {
598  pValues[nProp] <<= GetDefaultObjectSizeWidth();
599  break;
601  pValues[nProp] <<= GetDefaultObjectSizeHeight();
602  break;
604  pValues[nProp] <<= GetShowSharedDocumentWarning();
605  break;
606  }
607  }
608  aMiscItem.PutProperties(aNames, aValues);
609 }
610 
611 IMPL_LINK_NOARG(ScAppCfg, MiscNotifyHdl, ScLinkConfigItem&, void) { ReadMiscCfg(); }
612 
613 IMPL_LINK_NOARG(ScAppCfg, CompatCommitHdl, ScLinkConfigItem&, void)
614 {
615  Sequence<OUString> aNames = GetCompatPropertyNames();
616  Sequence<Any> aValues(aNames.getLength());
617  Any* pValues = aValues.getArray();
618 
619  for (int nProp = 0; nProp < aNames.getLength(); ++nProp)
620  {
621  switch(nProp)
622  {
624  pValues[nProp] <<= static_cast<sal_Int32>(GetKeyBindingType());
625  break;
626  }
627  }
628  aCompatItem.PutProperties(aNames, aValues);
629 }
630 
631 IMPL_LINK_NOARG(ScAppCfg, CompatNotifyHdl, ScLinkConfigItem&, void) { ReadCompatCfg(); }
632 
634 {
635  *static_cast<ScAppOptions*>(this) = rNew;
636 
644 
646  aInputItem.Commit();
650  aMiscItem.Commit();
652 }
653 
654 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
ScOptionsUtil::KeyBindingType meKeyBindingType
Definition: appoptio.hxx:101
void SetAutoComplete(bool bNew)
Definition: appoptio.hxx:53
ScLkUpdMode eLinkMode
Definition: appoptio.hxx:97
#define SCREVISOPT_DELETION
Definition: appoptio.cxx:175
Collection of user-defined sort lists.
Definition: userlist.hxx:66
#define SCMISCOPT_SHOWSHAREDDOCWARN
Definition: appoptio.cxx:190
SvxZoomType eZoomType
Definition: appoptio.hxx:87
ScLinkConfigItem aMiscItem
Definition: appoptio.hxx:116
ScLinkConfigItem aSortListItem
Definition: appoptio.hxx:115
IMPL_LINK_NOARG(ScAppCfg, LayoutCommitHdl, ScLinkConfigItem &, void)
Definition: appoptio.cxx:457
Color nTrackDeleteColor
Definition: appoptio.hxx:95
ScLinkConfigItem aContentItem
Definition: appoptio.hxx:114
void ReadMiscCfg()
Definition: appoptio.cxx:429
sal_uInt16 GetLRUFuncListCount() const
Definition: appoptio.hxx:47
void SetLRUFuncList(const sal_uInt16 *pList, const sal_uInt16 nCount)
Definition: appoptio.cxx:107
long Long
constexpr::Color COL_TRANSPARENT(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
constexpr OUStringLiteral CFGPATH_LAYOUT
Definition: appoptio.cxx:156
#define SCREVISOPT_INSERTION
Definition: appoptio.cxx:174
static void SetUserList(const ScUserList *pNewList)
Definition: global.cxx:295
void SetStatusFunc(sal_uInt32 nNew)
Definition: appoptio.hxx:51
void ReadRevisionCfg()
Definition: appoptio.cxx:370
size_t size() const
Definition: userlist.cxx:345
static void lcl_GetSortList(Any &rDest)
Definition: appoptio.cxx:140
static css::uno::Sequence< OUString > GetSortListPropertyNames()
Definition: appoptio.cxx:247
static css::uno::Sequence< OUString > GetRevisionPropertyNames()
Definition: appoptio.cxx:234
Color nTrackMoveColor
Definition: appoptio.hxx:96
sal_uInt16 nLRUFuncCount
Definition: appoptio.hxx:84
void SetCommitLink(const Link< ScLinkConfigItem &, void > &rLink)
Definition: optutil.cxx:47
#define SC_OPCODE_MIN
ScAppOptions & operator=(const ScAppOptions &rOpt)
Definition: appoptio.cxx:85
void ReadSortListCfg()
Definition: appoptio.cxx:400
void SetTrackDeleteColor(Color nNew)
Definition: appoptio.hxx:62
#define SCINPUTOPT_AUTOINPUT
Definition: appoptio.cxx:168
void ReadInputCfg()
Definition: appoptio.cxx:346
OUString GetString(int nId)
void push_back(ScUserListData *p)
Definition: userlist.cxx:350
Stores individual user-defined sort list.
Definition: userlist.hxx:32
#define SCLAYOUTOPT_MEASURE
Definition: appoptio.cxx:158
constexpr OUStringLiteral CFGPATH_CONTENT
Definition: appoptio.cxx:178
#define SCLAYOUTOPT_STATUSBAR_DEFAULTVAL_LEGACY
Definition: appoptio.cxx:202
#define SAL_MAX_UINT16
void SetTrackContentColor(Color nNew)
Definition: appoptio.hxx:58
void ReadLayoutCfg()
Definition: appoptio.cxx:309
static bool IsMetricSystem()
Definition: optutil.cxx:25
int nCount
sal_uInt16 * GetLRUFuncList() const
Definition: appoptio.hxx:48
bool bDetectiveAuto
Definition: appoptio.hxx:92
#define SCLAYOUTOPT_STATUSBAR_DEFAULTVAL
Definition: appoptio.cxx:199
Color nTrackInsertColor
Definition: appoptio.hxx:94
bool bAutoComplete
Definition: appoptio.hxx:91
bool EnableNotification(const css::uno::Sequence< OUString > &rNames, bool bEnableInternalNotification=false)
void SetTrackMoveColor(Color nNew)
Definition: appoptio.hxx:64
#define SCREVISOPT_MOVEDENTRY
Definition: appoptio.cxx:176
sal_Int32 nDefaultObjectSizeHeight
Definition: appoptio.hxx:99
#define SCLAYOUTOPT_SYNCZOOM
Definition: appoptio.cxx:162
constexpr OUStringLiteral CFGPATH_SORTLIST
Definition: appoptio.cxx:182
void SetDefaultObjectSizeHeight(sal_Int32 nNew)
Definition: appoptio.hxx:72
void ReadContentCfg()
Definition: appoptio.cxx:388
#define SCCOMPATOPT_KEY_BINDING
Definition: appoptio.cxx:194
int i
#define SC_OPCODE_MAX
#define SC_OPCODE_SUM
void ReadCompatCfg()
Definition: appoptio.cxx:445
#define SCMISCOPT_DEFOBJHEIGHT
Definition: appoptio.cxx:189
constexpr OUStringLiteral CFGPATH_COMPAT
Definition: appoptio.cxx:192
void SetKeyBindingType(ScOptionsUtil::KeyBindingType e)
Definition: appoptio.hxx:78
void SetDetectiveAuto(bool bNew)
Definition: appoptio.hxx:55
ScLinkConfigItem aCompatItem
Definition: appoptio.hxx:117
#define SCSORTLISTOPT_LIST
Definition: appoptio.cxx:184
float u
#define SCMISCOPT_DEFOBJWIDTH
Definition: appoptio.cxx:188
static SC_DLLPUBLIC ScUserList * GetUserList()
Definition: global.cxx:284
void SetSynchronizeZoom(bool bNew)
Definition: appoptio.hxx:45
#define SCCONTENTOPT_LINK
Definition: appoptio.cxx:180
ColorTransparency
#define SC_OPCODE_AVERAGE
#define SCLAYOUTOPT_STATUSBARMULTI_DEFAULTVAL
Definition: appoptio.cxx:197
void SetShowSharedDocumentWarning(bool bNew)
Definition: appoptio.hxx:75
void SetZoom(sal_uInt16 nNew)
Definition: appoptio.hxx:41
#define SCLAYOUTOPT_STATUSBAR
Definition: appoptio.cxx:159
bool bSynchronizeZoom
Definition: appoptio.hxx:89
void SetTrackInsertColor(Color nNew)
Definition: appoptio.hxx:60
sal_Int32 nDefaultObjectSizeWidth
Definition: appoptio.hxx:98
static css::uno::Sequence< OUString > GetMiscPropertyNames()
Definition: appoptio.cxx:252
constexpr OUStringLiteral CFGPATH_MISC
Definition: appoptio.cxx:186
ScLinkConfigItem aInputItem
Definition: appoptio.hxx:112
void SetNotifyLink(const Link< ScLinkConfigItem &, void > &rLink)
Definition: optutil.cxx:52
Color nTrackContentColor
Definition: appoptio.hxx:93
const PropertyValue * pValues
static css::uno::Sequence< OUString > GetCompatPropertyNames()
Definition: appoptio.cxx:259
static css::uno::Sequence< OUString > GetContentPropertyNames()
Definition: appoptio.cxx:242
#define SCLAYOUTOPT_STATUSBARMULTI
Definition: appoptio.cxx:163
#define SCLAYOUTOPT_ZOOMTYPE
Definition: appoptio.cxx:161
sal_uInt16 nZoom
Definition: appoptio.hxx:88
static void lcl_GetLastFunctions(Any &rDest, const ScAppOptions &rOpt)
Definition: appoptio.cxx:124
ScLinkConfigItem aLayoutItem
split ScAppOptions into different classes
Definition: appoptio.hxx:111
#define SC_OPCODE_IF
Sequence< sal_Int8 > aSeq
void SetZoomType(SvxZoomType eNew)
Definition: appoptio.hxx:43
#define SCINPUTOPT_LASTFUNCS
Definition: appoptio.cxx:167
std::unique_ptr< sal_uInt16[]> pLRUList
Definition: appoptio.hxx:86
constexpr OUStringLiteral CFGPATH_INPUT
Definition: appoptio.cxx:165
static css::uno::Sequence< OUString > GetLayoutPropertyNames()
Definition: appoptio.cxx:214
bool mbShowSharedDocumentWarning
Definition: appoptio.hxx:100
void SetDefaultObjectSizeWidth(sal_Int32 nNew)
Definition: appoptio.hxx:70
constexpr OUStringLiteral CFGPATH_REVISION
Definition: appoptio.cxx:171
static bool GetBoolFromAny(const css::uno::Any &aAny)
Definition: miscuno.cxx:138
sal_uInt32 nStatusFunc
Definition: appoptio.hxx:90
#define SCINPUTOPT_DET_AUTO
Definition: appoptio.cxx:169
static css::uno::Sequence< OUString > GetInputPropertyNames()
Definition: appoptio.cxx:227
#define SCLAYOUTOPT_ZOOMVAL
Definition: appoptio.cxx:160
FieldUnit eMetric
Definition: appoptio.hxx:83
css::uno::Sequence< css::uno::Any > GetProperties(const css::uno::Sequence< OUString > &rNames)
Definition: optutil.hxx:53
static sal_uInt32 lcl_ConvertStatusBarFuncSetToSingle(sal_uInt32 nFuncSet)
Definition: appoptio.cxx:204
void SetLinkMode(ScLkUpdMode nSet)
Definition: appoptio.hxx:68
void SetOptions(const ScAppOptions &rNew)
Definition: appoptio.cxx:633
#define SCREVISOPT_CHANGE
Definition: appoptio.cxx:173
ScLinkConfigItem aRevisionItem
Definition: appoptio.hxx:113
void SetDefaults()
Definition: appoptio.cxx:49
void SetAppMetric(FieldUnit eUnit)
Definition: appoptio.hxx:39