1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #include <vcl/svapp.hxx>
22 #include <com/sun/star/uno/Any.hxx>
23 #include <com/sun/star/uno/Sequence.hxx>
25 #include "appoptio.hxx"
26 #include "rechead.hxx"
27 #include "scresid.hxx"
29 #include "userlist.hxx"
31 #include <formula/compiler.hrc>
32 #include "miscuno.hxx"
35 using namespace com::sun::star::uno
;
37 // ScAppOptions - Applikations-Optionen
39 ScAppOptions::ScAppOptions() : pLRUList( NULL
)
44 ScAppOptions::ScAppOptions( const ScAppOptions
& rCpy
) : pLRUList( NULL
)
49 ScAppOptions::~ScAppOptions()
54 void ScAppOptions::SetDefaults()
56 if ( ScOptionsUtil::IsMetricSystem() )
57 eMetric
= FUNIT_CM
; // default for countries with metric system
59 eMetric
= FUNIT_INCH
; // default for others
62 eZoomType
= SVX_ZOOM_PERCENT
;
63 bSynchronizeZoom
= sal_True
;
64 nStatusFunc
= SUBTOTAL_FUNC_SUM
;
65 bAutoComplete
= sal_True
;
66 bDetectiveAuto
= sal_True
;
69 pLRUList
= new sal_uInt16
[5]; // sinnvoll vorbelegen
70 pLRUList
[0] = SC_OPCODE_SUM
;
71 pLRUList
[1] = SC_OPCODE_AVERAGE
;
72 pLRUList
[2] = SC_OPCODE_MIN
;
73 pLRUList
[3] = SC_OPCODE_MAX
;
74 pLRUList
[4] = SC_OPCODE_IF
;
77 nTrackContentColor
= COL_TRANSPARENT
;
78 nTrackInsertColor
= COL_TRANSPARENT
;
79 nTrackDeleteColor
= COL_TRANSPARENT
;
80 nTrackMoveColor
= COL_TRANSPARENT
;
81 eLinkMode
= LM_ON_DEMAND
;
83 nDefaultObjectSizeWidth
= 8000;
84 nDefaultObjectSizeHeight
= 5000;
86 mbShowSharedDocumentWarning
= true;
88 meKeyBindingType
= ScOptionsUtil::KEY_DEFAULT
;
91 const ScAppOptions
& ScAppOptions::operator=( const ScAppOptions
& rCpy
)
93 eMetric
= rCpy
.eMetric
;
94 eZoomType
= rCpy
.eZoomType
;
95 bSynchronizeZoom
= rCpy
.bSynchronizeZoom
;
97 SetLRUFuncList( rCpy
.pLRUList
, rCpy
.nLRUFuncCount
);
98 nStatusFunc
= rCpy
.nStatusFunc
;
99 bAutoComplete
= rCpy
.bAutoComplete
;
100 bDetectiveAuto
= rCpy
.bDetectiveAuto
;
101 nTrackContentColor
= rCpy
.nTrackContentColor
;
102 nTrackInsertColor
= rCpy
.nTrackInsertColor
;
103 nTrackDeleteColor
= rCpy
.nTrackDeleteColor
;
104 nTrackMoveColor
= rCpy
.nTrackMoveColor
;
105 eLinkMode
= rCpy
.eLinkMode
;
106 nDefaultObjectSizeWidth
= rCpy
.nDefaultObjectSizeWidth
;
107 nDefaultObjectSizeHeight
= rCpy
.nDefaultObjectSizeHeight
;
108 mbShowSharedDocumentWarning
= rCpy
.mbShowSharedDocumentWarning
;
109 meKeyBindingType
= rCpy
.meKeyBindingType
;
113 void ScAppOptions::SetLRUFuncList( const sal_uInt16
* pList
, const sal_uInt16 nCount
)
117 nLRUFuncCount
= nCount
;
119 if ( nLRUFuncCount
> 0 )
121 pLRUList
= new sal_uInt16
[nLRUFuncCount
];
123 for ( sal_uInt16 i
=0; i
<nLRUFuncCount
; i
++ )
124 pLRUList
[i
] = pList
[i
];
130 // Config Item containing app options
132 static void lcl_SetLastFunctions( ScAppOptions
& rOpt
, const Any
& rValue
)
134 Sequence
<sal_Int32
> aSeq
;
135 if ( rValue
>>= aSeq
)
137 long nCount
= aSeq
.getLength();
138 if ( nCount
< USHRT_MAX
)
140 const sal_Int32
* pArray
= aSeq
.getConstArray();
141 sal_uInt16
* pUShorts
= new sal_uInt16
[nCount
];
142 for (long i
=0; i
<nCount
; i
++)
143 pUShorts
[i
] = (sal_uInt16
) pArray
[i
];
145 rOpt
.SetLRUFuncList( pUShorts
, sal::static_int_cast
<sal_uInt16
>(nCount
) );
152 static void lcl_GetLastFunctions( Any
& rDest
, const ScAppOptions
& rOpt
)
154 long nCount
= rOpt
.GetLRUFuncListCount();
155 sal_uInt16
* pUShorts
= rOpt
.GetLRUFuncList();
156 if ( nCount
&& pUShorts
)
158 Sequence
<sal_Int32
> aSeq( nCount
);
159 sal_Int32
* pArray
= aSeq
.getArray();
160 for (long i
=0; i
<nCount
; i
++)
161 pArray
[i
] = pUShorts
[i
];
165 rDest
<<= Sequence
<sal_Int32
>(0); // empty
168 static void lcl_SetSortList( const Any
& rValue
)
170 Sequence
<OUString
> aSeq
;
171 if ( rValue
>>= aSeq
)
173 long nCount
= aSeq
.getLength();
174 const OUString
* pArray
= aSeq
.getConstArray();
177 // if setting is "default", keep default values from ScUserList ctor
178 //! mark "default" in a safe way
179 sal_Bool bDefault
= ( nCount
== 1 && pArray
[0] == "NULL" );
185 for (long i
=0; i
<nCount
; i
++)
187 ScUserListData
* pNew
= new ScUserListData( pArray
[i
] );
188 aList
.push_back(pNew
);
192 ScGlobal::SetUserList( &aList
);
196 static void lcl_GetSortList( Any
& rDest
)
198 const ScUserList
* pUserList
= ScGlobal::GetUserList();
201 size_t nCount
= pUserList
->size();
202 Sequence
<OUString
> aSeq( nCount
);
203 OUString
* pArray
= aSeq
.getArray();
204 for (size_t i
=0; i
<nCount
; ++i
)
205 pArray
[i
] = (*pUserList
)[sal::static_int_cast
<sal_uInt16
>(i
)]->GetString();
209 rDest
<<= Sequence
<OUString
>(0); // empty
212 #define CFGPATH_LAYOUT "Office.Calc/Layout"
214 #define SCLAYOUTOPT_MEASURE 0
215 #define SCLAYOUTOPT_STATUSBAR 1
216 #define SCLAYOUTOPT_ZOOMVAL 2
217 #define SCLAYOUTOPT_ZOOMTYPE 3
218 #define SCLAYOUTOPT_SYNCZOOM 4
219 #define SCLAYOUTOPT_COUNT 5
221 #define CFGPATH_INPUT "Office.Calc/Input"
223 #define SCINPUTOPT_LASTFUNCS 0
224 #define SCINPUTOPT_AUTOINPUT 1
225 #define SCINPUTOPT_DET_AUTO 2
226 #define SCINPUTOPT_COUNT 3
228 #define CFGPATH_REVISION "Office.Calc/Revision/Color"
230 #define SCREVISOPT_CHANGE 0
231 #define SCREVISOPT_INSERTION 1
232 #define SCREVISOPT_DELETION 2
233 #define SCREVISOPT_MOVEDENTRY 3
234 #define SCREVISOPT_COUNT 4
236 #define CFGPATH_CONTENT "Office.Calc/Content/Update"
238 #define SCCONTENTOPT_LINK 0
239 #define SCCONTENTOPT_COUNT 1
241 #define CFGPATH_SORTLIST "Office.Calc/SortList"
243 #define SCSORTLISTOPT_LIST 0
244 #define SCSORTLISTOPT_COUNT 1
246 #define CFGPATH_MISC "Office.Calc/Misc"
248 #define SCMISCOPT_DEFOBJWIDTH 0
249 #define SCMISCOPT_DEFOBJHEIGHT 1
250 #define SCMISCOPT_SHOWSHAREDDOCWARN 2
251 #define SCMISCOPT_COUNT 3
253 #define CFGPATH_COMPAT "Office.Calc/Compatibility"
255 #define SCCOMPATOPT_KEY_BINDING 0
256 #define SCCOMPATOPT_COUNT 1
258 Sequence
<OUString
> ScAppCfg::GetLayoutPropertyNames()
260 static const char* aPropNames
[] =
262 "Other/MeasureUnit/NonMetric", // SCLAYOUTOPT_MEASURE
263 "Other/StatusbarFunction", // SCLAYOUTOPT_STATUSBAR
264 "Zoom/Value", // SCLAYOUTOPT_ZOOMVAL
265 "Zoom/Type", // SCLAYOUTOPT_ZOOMTYPE
266 "Zoom/Synchronize" // SCLAYOUTOPT_SYNCZOOM
268 Sequence
<OUString
> aNames(SCLAYOUTOPT_COUNT
);
269 OUString
* pNames
= aNames
.getArray();
270 for(int i
= 0; i
< SCLAYOUTOPT_COUNT
; i
++)
271 pNames
[i
] = OUString::createFromAscii(aPropNames
[i
]);
273 // adjust for metric system
274 if (ScOptionsUtil::IsMetricSystem())
275 pNames
[SCLAYOUTOPT_MEASURE
] = "Other/MeasureUnit/Metric";
280 Sequence
<OUString
> ScAppCfg::GetInputPropertyNames()
282 static const char* aPropNames
[] =
284 "LastFunctions", // SCINPUTOPT_LASTFUNCS
285 "AutoInput", // SCINPUTOPT_AUTOINPUT
286 "DetectiveAuto" // SCINPUTOPT_DET_AUTO
288 Sequence
<OUString
> aNames(SCINPUTOPT_COUNT
);
289 OUString
* pNames
= aNames
.getArray();
290 for(int i
= 0; i
< SCINPUTOPT_COUNT
; i
++)
291 pNames
[i
] = OUString::createFromAscii(aPropNames
[i
]);
296 Sequence
<OUString
> ScAppCfg::GetRevisionPropertyNames()
298 static const char* aPropNames
[] =
300 "Change", // SCREVISOPT_CHANGE
301 "Insertion", // SCREVISOPT_INSERTION
302 "Deletion", // SCREVISOPT_DELETION
303 "MovedEntry" // SCREVISOPT_MOVEDENTRY
305 Sequence
<OUString
> aNames(SCREVISOPT_COUNT
);
306 OUString
* pNames
= aNames
.getArray();
307 for(int i
= 0; i
< SCREVISOPT_COUNT
; i
++)
308 pNames
[i
] = OUString::createFromAscii(aPropNames
[i
]);
313 Sequence
<OUString
> ScAppCfg::GetContentPropertyNames()
315 static const char* aPropNames
[] =
317 "Link" // SCCONTENTOPT_LINK
319 Sequence
<OUString
> aNames(SCCONTENTOPT_COUNT
);
320 OUString
* pNames
= aNames
.getArray();
321 for(int i
= 0; i
< SCCONTENTOPT_COUNT
; i
++)
322 pNames
[i
] = OUString::createFromAscii(aPropNames
[i
]);
327 Sequence
<OUString
> ScAppCfg::GetSortListPropertyNames()
329 static const char* aPropNames
[] =
331 "List" // SCSORTLISTOPT_LIST
333 Sequence
<OUString
> aNames(SCSORTLISTOPT_COUNT
);
334 OUString
* pNames
= aNames
.getArray();
335 for(int i
= 0; i
< SCSORTLISTOPT_COUNT
; i
++)
336 pNames
[i
] = OUString::createFromAscii(aPropNames
[i
]);
341 Sequence
<OUString
> ScAppCfg::GetMiscPropertyNames()
343 static const char* aPropNames
[] =
345 "DefaultObjectSize/Width", // SCMISCOPT_DEFOBJWIDTH
346 "DefaultObjectSize/Height", // SCMISCOPT_DEFOBJHEIGHT
347 "SharedDocument/ShowWarning" // SCMISCOPT_SHOWSHAREDDOCWARN
349 Sequence
<OUString
> aNames(SCMISCOPT_COUNT
);
350 OUString
* pNames
= aNames
.getArray();
351 for(int i
= 0; i
< SCMISCOPT_COUNT
; i
++)
352 pNames
[i
] = OUString::createFromAscii(aPropNames
[i
]);
357 Sequence
<OUString
> ScAppCfg::GetCompatPropertyNames()
359 static const char* aPropNames
[] =
361 "KeyBindings/BaseGroup" // SCCOMPATOPT_KEY_BINDING
363 Sequence
<OUString
> aNames(SCCOMPATOPT_COUNT
);
364 OUString
* pNames
= aNames
.getArray();
365 for (int i
= 0; i
< SCCOMPATOPT_COUNT
; ++i
)
366 pNames
[i
] = OUString::createFromAscii(aPropNames
[i
]);
371 ScAppCfg::ScAppCfg() :
372 aLayoutItem( OUString( CFGPATH_LAYOUT
) ),
373 aInputItem( OUString( CFGPATH_INPUT
) ),
374 aRevisionItem( OUString( CFGPATH_REVISION
) ),
375 aContentItem( OUString( CFGPATH_CONTENT
) ),
376 aSortListItem( OUString( CFGPATH_SORTLIST
) ),
377 aMiscItem( OUString( CFGPATH_MISC
) ),
378 aCompatItem( OUString(CFGPATH_COMPAT
) )
380 sal_Int32 nIntVal
= 0;
382 Sequence
<OUString
> aNames
;
383 Sequence
<Any
> aValues
;
384 const Any
* pValues
= NULL
;
386 aNames
= GetLayoutPropertyNames();
387 aValues
= aLayoutItem
.GetProperties(aNames
);
388 aLayoutItem
.EnableNotification(aNames
);
389 pValues
= aValues
.getConstArray();
390 OSL_ENSURE(aValues
.getLength() == aNames
.getLength(), "GetProperties failed");
391 if(aValues
.getLength() == aNames
.getLength())
393 for(int nProp
= 0; nProp
< aNames
.getLength(); nProp
++)
395 OSL_ENSURE(pValues
[nProp
].hasValue(), "property value missing");
396 if(pValues
[nProp
].hasValue())
400 case SCLAYOUTOPT_MEASURE
:
401 if (pValues
[nProp
] >>= nIntVal
) SetAppMetric( (FieldUnit
) nIntVal
);
403 case SCLAYOUTOPT_STATUSBAR
:
404 if (pValues
[nProp
] >>= nIntVal
) SetStatusFunc( (sal_uInt16
) nIntVal
);
406 case SCLAYOUTOPT_ZOOMVAL
:
407 if (pValues
[nProp
] >>= nIntVal
) SetZoom( (sal_uInt16
) nIntVal
);
409 case SCLAYOUTOPT_ZOOMTYPE
:
410 if (pValues
[nProp
] >>= nIntVal
) SetZoomType( (SvxZoomType
) nIntVal
);
412 case SCLAYOUTOPT_SYNCZOOM
:
413 SetSynchronizeZoom( ScUnoHelpFunctions::GetBoolFromAny( pValues
[nProp
] ) );
419 aLayoutItem
.SetCommitLink( LINK( this, ScAppCfg
, LayoutCommitHdl
) );
421 aNames
= GetInputPropertyNames();
422 aValues
= aInputItem
.GetProperties(aNames
);
423 aInputItem
.EnableNotification(aNames
);
424 pValues
= aValues
.getConstArray();
425 OSL_ENSURE(aValues
.getLength() == aNames
.getLength(), "GetProperties failed");
426 if(aValues
.getLength() == aNames
.getLength())
428 for(int nProp
= 0; nProp
< aNames
.getLength(); nProp
++)
430 OSL_ENSURE(pValues
[nProp
].hasValue(), "property value missing");
431 if(pValues
[nProp
].hasValue())
435 case SCINPUTOPT_LASTFUNCS
:
436 lcl_SetLastFunctions( *this, pValues
[nProp
] );
438 case SCINPUTOPT_AUTOINPUT
:
439 SetAutoComplete( ScUnoHelpFunctions::GetBoolFromAny( pValues
[nProp
] ) );
441 case SCINPUTOPT_DET_AUTO
:
442 SetDetectiveAuto( ScUnoHelpFunctions::GetBoolFromAny( pValues
[nProp
] ) );
448 aInputItem
.SetCommitLink( LINK( this, ScAppCfg
, InputCommitHdl
) );
450 aNames
= GetRevisionPropertyNames();
451 aValues
= aRevisionItem
.GetProperties(aNames
);
452 aRevisionItem
.EnableNotification(aNames
);
453 pValues
= aValues
.getConstArray();
454 OSL_ENSURE(aValues
.getLength() == aNames
.getLength(), "GetProperties failed");
455 if(aValues
.getLength() == aNames
.getLength())
457 for(int nProp
= 0; nProp
< aNames
.getLength(); nProp
++)
459 OSL_ENSURE(pValues
[nProp
].hasValue(), "property value missing");
460 if(pValues
[nProp
].hasValue())
464 case SCREVISOPT_CHANGE
:
465 if (pValues
[nProp
] >>= nIntVal
) SetTrackContentColor( (sal_uInt32
) nIntVal
);
467 case SCREVISOPT_INSERTION
:
468 if (pValues
[nProp
] >>= nIntVal
) SetTrackInsertColor( (sal_uInt32
) nIntVal
);
470 case SCREVISOPT_DELETION
:
471 if (pValues
[nProp
] >>= nIntVal
) SetTrackDeleteColor( (sal_uInt32
) nIntVal
);
473 case SCREVISOPT_MOVEDENTRY
:
474 if (pValues
[nProp
] >>= nIntVal
) SetTrackMoveColor( (sal_uInt32
) nIntVal
);
480 aRevisionItem
.SetCommitLink( LINK( this, ScAppCfg
, RevisionCommitHdl
) );
482 aNames
= GetContentPropertyNames();
483 aValues
= aContentItem
.GetProperties(aNames
);
484 aContentItem
.EnableNotification(aNames
);
485 pValues
= aValues
.getConstArray();
486 OSL_ENSURE(aValues
.getLength() == aNames
.getLength(), "GetProperties failed");
487 if(aValues
.getLength() == aNames
.getLength())
489 for(int nProp
= 0; nProp
< aNames
.getLength(); nProp
++)
491 OSL_ENSURE(pValues
[nProp
].hasValue(), "property value missing");
492 if(pValues
[nProp
].hasValue())
496 case SCCONTENTOPT_LINK
:
497 if (pValues
[nProp
] >>= nIntVal
) SetLinkMode( (ScLkUpdMode
) nIntVal
);
503 aContentItem
.SetCommitLink( LINK( this, ScAppCfg
, ContentCommitHdl
) );
505 aNames
= GetSortListPropertyNames();
506 aValues
= aSortListItem
.GetProperties(aNames
);
507 aSortListItem
.EnableNotification(aNames
);
508 pValues
= aValues
.getConstArray();
509 OSL_ENSURE(aValues
.getLength() == aNames
.getLength(), "GetProperties failed");
510 if(aValues
.getLength() == aNames
.getLength())
512 for(int nProp
= 0; nProp
< aNames
.getLength(); nProp
++)
514 OSL_ENSURE(pValues
[nProp
].hasValue(), "property value missing");
515 if(pValues
[nProp
].hasValue())
519 case SCSORTLISTOPT_LIST
:
520 lcl_SetSortList( pValues
[nProp
] );
526 aSortListItem
.SetCommitLink( LINK( this, ScAppCfg
, SortListCommitHdl
) );
528 aNames
= GetMiscPropertyNames();
529 aValues
= aMiscItem
.GetProperties(aNames
);
530 aMiscItem
.EnableNotification(aNames
);
531 pValues
= aValues
.getConstArray();
532 OSL_ENSURE(aValues
.getLength() == aNames
.getLength(), "GetProperties failed");
533 if(aValues
.getLength() == aNames
.getLength())
535 for(int nProp
= 0; nProp
< aNames
.getLength(); nProp
++)
537 OSL_ENSURE(pValues
[nProp
].hasValue(), "property value missing");
538 if(pValues
[nProp
].hasValue())
542 case SCMISCOPT_DEFOBJWIDTH
:
543 if (pValues
[nProp
] >>= nIntVal
) SetDefaultObjectSizeWidth( nIntVal
);
545 case SCMISCOPT_DEFOBJHEIGHT
:
546 if (pValues
[nProp
] >>= nIntVal
) SetDefaultObjectSizeHeight( nIntVal
);
548 case SCMISCOPT_SHOWSHAREDDOCWARN
:
549 SetShowSharedDocumentWarning( ScUnoHelpFunctions::GetBoolFromAny( pValues
[nProp
] ) );
555 aMiscItem
.SetCommitLink( LINK( this, ScAppCfg
, MiscCommitHdl
) );
557 aNames
= GetCompatPropertyNames();
558 aValues
= aCompatItem
.GetProperties(aNames
);
559 aCompatItem
.EnableNotification(aNames
);
560 pValues
= aValues
.getConstArray();
561 if (aValues
.getLength() == aNames
.getLength())
563 for (int nProp
= 0; nProp
< aNames
.getLength(); ++nProp
)
567 case SCCOMPATOPT_KEY_BINDING
:
569 nIntVal
= 0; // 0 = 'Default'
570 pValues
[nProp
] >>= nIntVal
;
571 SetKeyBindingType(static_cast<ScOptionsUtil::KeyBindingType
>(nIntVal
));
577 aCompatItem
.SetCommitLink( LINK(this, ScAppCfg
, CompatCommitHdl
) );
579 IMPL_LINK_NOARG(ScAppCfg
, LayoutCommitHdl
)
581 Sequence
<OUString
> aNames
= GetLayoutPropertyNames();
582 Sequence
<Any
> aValues(aNames
.getLength());
583 Any
* pValues
= aValues
.getArray();
585 for(int nProp
= 0; nProp
< aNames
.getLength(); nProp
++)
589 case SCLAYOUTOPT_MEASURE
:
590 pValues
[nProp
] <<= (sal_Int32
) GetAppMetric();
592 case SCLAYOUTOPT_STATUSBAR
:
593 pValues
[nProp
] <<= (sal_Int32
) GetStatusFunc();
595 case SCLAYOUTOPT_ZOOMVAL
:
596 pValues
[nProp
] <<= (sal_Int32
) GetZoom();
598 case SCLAYOUTOPT_ZOOMTYPE
:
599 pValues
[nProp
] <<= (sal_Int32
) GetZoomType();
601 case SCLAYOUTOPT_SYNCZOOM
:
602 ScUnoHelpFunctions::SetBoolInAny( pValues
[nProp
], GetSynchronizeZoom() );
606 aLayoutItem
.PutProperties(aNames
, aValues
);
611 IMPL_LINK_NOARG(ScAppCfg
, InputCommitHdl
)
613 Sequence
<OUString
> aNames
= GetInputPropertyNames();
614 Sequence
<Any
> aValues(aNames
.getLength());
615 Any
* pValues
= aValues
.getArray();
617 for(int nProp
= 0; nProp
< aNames
.getLength(); nProp
++)
621 case SCINPUTOPT_LASTFUNCS
:
622 lcl_GetLastFunctions( pValues
[nProp
], *this );
624 case SCINPUTOPT_AUTOINPUT
:
625 ScUnoHelpFunctions::SetBoolInAny( pValues
[nProp
], GetAutoComplete() );
627 case SCINPUTOPT_DET_AUTO
:
628 ScUnoHelpFunctions::SetBoolInAny( pValues
[nProp
], GetDetectiveAuto() );
632 aInputItem
.PutProperties(aNames
, aValues
);
637 IMPL_LINK_NOARG(ScAppCfg
, RevisionCommitHdl
)
639 Sequence
<OUString
> aNames
= GetRevisionPropertyNames();
640 Sequence
<Any
> aValues(aNames
.getLength());
641 Any
* pValues
= aValues
.getArray();
643 for(int nProp
= 0; nProp
< aNames
.getLength(); nProp
++)
647 case SCREVISOPT_CHANGE
:
648 pValues
[nProp
] <<= (sal_Int32
) GetTrackContentColor();
650 case SCREVISOPT_INSERTION
:
651 pValues
[nProp
] <<= (sal_Int32
) GetTrackInsertColor();
653 case SCREVISOPT_DELETION
:
654 pValues
[nProp
] <<= (sal_Int32
) GetTrackDeleteColor();
656 case SCREVISOPT_MOVEDENTRY
:
657 pValues
[nProp
] <<= (sal_Int32
) GetTrackMoveColor();
661 aRevisionItem
.PutProperties(aNames
, aValues
);
666 IMPL_LINK_NOARG(ScAppCfg
, ContentCommitHdl
)
668 Sequence
<OUString
> aNames
= GetContentPropertyNames();
669 Sequence
<Any
> aValues(aNames
.getLength());
670 Any
* pValues
= aValues
.getArray();
672 for(int nProp
= 0; nProp
< aNames
.getLength(); nProp
++)
676 case SCCONTENTOPT_LINK
:
677 pValues
[nProp
] <<= (sal_Int32
) GetLinkMode();
681 aContentItem
.PutProperties(aNames
, aValues
);
686 IMPL_LINK_NOARG(ScAppCfg
, SortListCommitHdl
)
688 Sequence
<OUString
> aNames
= GetSortListPropertyNames();
689 Sequence
<Any
> aValues(aNames
.getLength());
690 Any
* pValues
= aValues
.getArray();
692 for(int nProp
= 0; nProp
< aNames
.getLength(); nProp
++)
696 case SCSORTLISTOPT_LIST
:
697 lcl_GetSortList( pValues
[nProp
] );
701 aSortListItem
.PutProperties(aNames
, aValues
);
706 IMPL_LINK_NOARG(ScAppCfg
, MiscCommitHdl
)
708 Sequence
<OUString
> aNames
= GetMiscPropertyNames();
709 Sequence
<Any
> aValues(aNames
.getLength());
710 Any
* pValues
= aValues
.getArray();
712 for(int nProp
= 0; nProp
< aNames
.getLength(); nProp
++)
716 case SCMISCOPT_DEFOBJWIDTH
:
717 pValues
[nProp
] <<= (sal_Int32
) GetDefaultObjectSizeWidth();
719 case SCMISCOPT_DEFOBJHEIGHT
:
720 pValues
[nProp
] <<= (sal_Int32
) GetDefaultObjectSizeHeight();
722 case SCMISCOPT_SHOWSHAREDDOCWARN
:
723 ScUnoHelpFunctions::SetBoolInAny( pValues
[nProp
], GetShowSharedDocumentWarning() );
727 aMiscItem
.PutProperties(aNames
, aValues
);
732 IMPL_LINK_NOARG(ScAppCfg
, CompatCommitHdl
)
734 Sequence
<OUString
> aNames
= GetCompatPropertyNames();
735 Sequence
<Any
> aValues(aNames
.getLength());
736 Any
* pValues
= aValues
.getArray();
738 for (int nProp
= 0; nProp
< aNames
.getLength(); ++nProp
)
742 case SCCOMPATOPT_KEY_BINDING
:
743 pValues
[nProp
] <<= static_cast<sal_Int32
>(GetKeyBindingType());
747 aCompatItem
.PutProperties(aNames
, aValues
);
751 void ScAppCfg::SetOptions( const ScAppOptions
& rNew
)
753 *(ScAppOptions
*)this = rNew
;
757 void ScAppCfg::OptionsChanged()
759 aLayoutItem
.SetModified();
760 aInputItem
.SetModified();
761 aRevisionItem
.SetModified();
762 aContentItem
.SetModified();
763 aSortListItem
.SetModified();
764 aMiscItem
.SetModified();
765 aCompatItem
.SetModified();
768 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */