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>
26 #include "globstr.hrc"
28 #include "viewopti.hxx"
29 #include "rechead.hxx"
30 #include "scresid.hxx"
32 #include "miscuno.hxx"
35 using namespace com::sun::star::uno
;
37 TYPEINIT1(ScTpViewItem
, SfxPoolItem
);
39 // class ScGridOptions
41 void ScGridOptions::SetDefaults()
43 *this = ScGridOptions();
45 // Raster-Defaults sind jetzt zwischen den Apps unterschiedlich
46 // darum hier selber eintragen (alles in 1/100mm)
48 if ( ScOptionsUtil::IsMetricSystem() )
50 nFldDrawX
= 1000; // 1cm
57 nFldDrawX
= 1270; // 0,5"
66 const ScGridOptions
& ScGridOptions::operator=( const ScGridOptions
& rCpy
)
68 nFldDrawX
= rCpy
.nFldDrawX
; // UINT32
69 nFldDivisionX
= rCpy
.nFldDivisionX
;
70 nFldDrawY
= rCpy
.nFldDrawY
;
71 nFldDivisionY
= rCpy
.nFldDivisionY
;
72 nFldSnapX
= rCpy
.nFldSnapX
;
73 nFldSnapY
= rCpy
.nFldSnapY
;
74 bUseGridsnap
= rCpy
.bUseGridsnap
; // BitBool
75 bSynchronize
= rCpy
.bSynchronize
;
76 bGridVisible
= rCpy
.bGridVisible
;
77 bEqualGrid
= rCpy
.bEqualGrid
;
82 bool ScGridOptions::operator==( const ScGridOptions
& rCpy
) const
84 return ( nFldDrawX
== rCpy
.nFldDrawX
85 && nFldDivisionX
== rCpy
.nFldDivisionX
86 && nFldDrawY
== rCpy
.nFldDrawY
87 && nFldDivisionY
== rCpy
.nFldDivisionY
88 && nFldSnapX
== rCpy
.nFldSnapX
89 && nFldSnapY
== rCpy
.nFldSnapY
90 && bUseGridsnap
== rCpy
.bUseGridsnap
91 && bSynchronize
== rCpy
.bSynchronize
92 && bGridVisible
== rCpy
.bGridVisible
93 && bEqualGrid
== rCpy
.bEqualGrid
);
96 // class ScViewOptions
98 ScViewOptions::ScViewOptions()
103 ScViewOptions::ScViewOptions( const ScViewOptions
& rCpy
)
108 ScViewOptions::~ScViewOptions()
112 void ScViewOptions::SetDefaults()
114 aOptArr
[ VOPT_FORMULAS
] = false;
115 aOptArr
[ VOPT_SYNTAX
] = false;
116 aOptArr
[ VOPT_HELPLINES
] = false;
117 aOptArr
[ VOPT_GRID_ONTOP
] = false;
118 aOptArr
[ VOPT_NOTES
] = true;
119 aOptArr
[ VOPT_NULLVALS
] = true;
120 aOptArr
[ VOPT_VSCROLL
] = true;
121 aOptArr
[ VOPT_HSCROLL
] = true;
122 aOptArr
[ VOPT_TABCONTROLS
] = true;
123 aOptArr
[ VOPT_OUTLINER
] = true;
124 aOptArr
[ VOPT_HEADER
] = true;
125 aOptArr
[ VOPT_GRID
] = true;
126 aOptArr
[ VOPT_ANCHOR
] = true;
127 aOptArr
[ VOPT_PAGEBREAKS
] = true;
128 aOptArr
[ VOPT_CLIPMARKS
] = true;
130 aModeArr
[VOBJ_TYPE_OLE
] = VOBJ_MODE_SHOW
;
131 aModeArr
[VOBJ_TYPE_CHART
] = VOBJ_MODE_SHOW
;
132 aModeArr
[VOBJ_TYPE_DRAW
] = VOBJ_MODE_SHOW
;
134 aGridCol
= Color( SC_STD_GRIDCOLOR
);
135 aGridColName
= ScGlobal::GetRscString( STR_GRIDCOLOR
);
137 aGridOpt
.SetDefaults();
140 Color
ScViewOptions::GetGridColor( OUString
* pStrName
) const
143 *pStrName
= aGridColName
;
148 const ScViewOptions
& ScViewOptions::operator=( const ScViewOptions
& rCpy
)
152 for ( i
=0; i
<MAX_OPT
; i
++ ) aOptArr
[i
] = rCpy
.aOptArr
[i
];
153 for ( i
=0; i
<MAX_TYPE
; i
++ ) aModeArr
[i
] = rCpy
.aModeArr
[i
];
155 aGridCol
= rCpy
.aGridCol
;
156 aGridColName
= rCpy
.aGridColName
;
157 aGridOpt
= rCpy
.aGridOpt
;
162 bool ScViewOptions::operator==( const ScViewOptions
& rOpt
) const
167 for ( i
=0; i
<MAX_OPT
&& bEqual
; i
++ ) bEqual
= (aOptArr
[i
] == rOpt
.aOptArr
[i
]);
168 for ( i
=0; i
<MAX_TYPE
&& bEqual
; i
++ ) bEqual
= (aModeArr
[i
] == rOpt
.aModeArr
[i
]);
170 bEqual
= bEqual
&& (aGridCol
== rOpt
.aGridCol
);
171 bEqual
= bEqual
&& (aGridColName
== rOpt
.aGridColName
);
172 bEqual
= bEqual
&& (aGridOpt
== rOpt
.aGridOpt
);
177 SvxGridItem
* ScViewOptions::CreateGridItem( sal_uInt16 nId
/* = SID_ATTR_GRID_OPTIONS */ ) const
179 SvxGridItem
* pItem
= new SvxGridItem( nId
);
181 pItem
->SetFieldDrawX ( aGridOpt
.GetFieldDrawX() );
182 pItem
->SetFieldDivisionX ( aGridOpt
.GetFieldDivisionX() );
183 pItem
->SetFieldDrawY ( aGridOpt
.GetFieldDrawY() );
184 pItem
->SetFieldDivisionY ( aGridOpt
.GetFieldDivisionY() );
185 pItem
->SetFieldSnapX ( aGridOpt
.GetFieldSnapX() );
186 pItem
->SetFieldSnapY ( aGridOpt
.GetFieldSnapY() );
187 pItem
->SetUseGridSnap ( aGridOpt
.GetUseGridSnap() );
188 pItem
->SetSynchronize ( aGridOpt
.GetSynchronize() );
189 pItem
->SetGridVisible ( aGridOpt
.GetGridVisible() );
190 pItem
->SetEqualGrid ( aGridOpt
.GetEqualGrid() );
195 // ScTpViewItem - Daten fuer die ViewOptions-TabPage
197 ScTpViewItem::ScTpViewItem( sal_uInt16 nWhichP
, const ScViewOptions
& rOpt
)
198 : SfxPoolItem ( nWhichP
),
203 ScTpViewItem::ScTpViewItem( const ScTpViewItem
& rItem
)
204 : SfxPoolItem ( rItem
),
205 theOptions ( rItem
.theOptions
)
209 ScTpViewItem::~ScTpViewItem()
213 bool ScTpViewItem::operator==( const SfxPoolItem
& rItem
) const
215 assert(SfxPoolItem::operator==(rItem
));
217 const ScTpViewItem
& rPItem
= static_cast<const ScTpViewItem
&>(rItem
);
219 return ( theOptions
== rPItem
.theOptions
);
222 SfxPoolItem
* ScTpViewItem::Clone( SfxItemPool
* ) const
224 return new ScTpViewItem( *this );
227 // Config Item containing view options
229 #define CFGPATH_LAYOUT "Office.Calc/Layout"
231 #define SCLAYOUTOPT_GRIDLINES 0
232 #define SCLAYOUTOPT_GRIDCOLOR 1
233 #define SCLAYOUTOPT_PAGEBREAK 2
234 #define SCLAYOUTOPT_GUIDE 3
235 #define SCLAYOUTOPT_COLROWHDR 4
236 #define SCLAYOUTOPT_HORISCROLL 5
237 #define SCLAYOUTOPT_VERTSCROLL 6
238 #define SCLAYOUTOPT_SHEETTAB 7
239 #define SCLAYOUTOPT_OUTLINE 8
240 #define SCLAYOUTOPT_GRID_ONCOLOR 9
241 #define SCLAYOUTOPT_COUNT 10
243 #define CFGPATH_DISPLAY "Office.Calc/Content/Display"
245 #define SCDISPLAYOPT_FORMULA 0
246 #define SCDISPLAYOPT_ZEROVALUE 1
247 #define SCDISPLAYOPT_NOTETAG 2
248 #define SCDISPLAYOPT_VALUEHI 3
249 #define SCDISPLAYOPT_ANCHOR 4
250 #define SCDISPLAYOPT_TEXTOVER 5
251 #define SCDISPLAYOPT_OBJECTGRA 6
252 #define SCDISPLAYOPT_CHART 7
253 #define SCDISPLAYOPT_DRAWING 8
254 #define SCDISPLAYOPT_COUNT 9
256 #define CFGPATH_GRID "Office.Calc/Grid"
258 #define SCGRIDOPT_RESOLU_X 0
259 #define SCGRIDOPT_RESOLU_Y 1
260 #define SCGRIDOPT_SUBDIV_X 2
261 #define SCGRIDOPT_SUBDIV_Y 3
262 #define SCGRIDOPT_OPTION_X 4
263 #define SCGRIDOPT_OPTION_Y 5
264 #define SCGRIDOPT_SNAPTOGRID 6
265 #define SCGRIDOPT_SYNCHRON 7
266 #define SCGRIDOPT_VISIBLE 8
267 #define SCGRIDOPT_SIZETOGRID 9
268 #define SCGRIDOPT_COUNT 10
270 Sequence
<OUString
> ScViewCfg::GetLayoutPropertyNames()
272 static const char* aPropNames
[] =
274 "Line/GridLine", // SCLAYOUTOPT_GRIDLINES
275 "Line/GridLineColor", // SCLAYOUTOPT_GRIDCOLOR
276 "Line/PageBreak", // SCLAYOUTOPT_PAGEBREAK
277 "Line/Guide", // SCLAYOUTOPT_GUIDE
278 "Window/ColumnRowHeader", // SCLAYOUTOPT_COLROWHDR
279 "Window/HorizontalScroll", // SCLAYOUTOPT_HORISCROLL
280 "Window/VerticalScroll", // SCLAYOUTOPT_VERTSCROLL
281 "Window/SheetTab", // SCLAYOUTOPT_SHEETTAB
282 "Window/OutlineSymbol", // SCLAYOUTOPT_OUTLINE
283 "Line/GridOnColoredCells" // SCLAYOUTOPT_GRID_ONCOLOR
285 Sequence
<OUString
> aNames(SCLAYOUTOPT_COUNT
);
286 OUString
* pNames
= aNames
.getArray();
287 for(int i
= 0; i
< SCLAYOUTOPT_COUNT
; i
++)
288 pNames
[i
] = OUString::createFromAscii(aPropNames
[i
]);
293 Sequence
<OUString
> ScViewCfg::GetDisplayPropertyNames()
295 static const char* aPropNames
[] =
297 "Formula", // SCDISPLAYOPT_FORMULA
298 "ZeroValue", // SCDISPLAYOPT_ZEROVALUE
299 "NoteTag", // SCDISPLAYOPT_NOTETAG
300 "ValueHighlighting", // SCDISPLAYOPT_VALUEHI
301 "Anchor", // SCDISPLAYOPT_ANCHOR
302 "TextOverflow", // SCDISPLAYOPT_TEXTOVER
303 "ObjectGraphic", // SCDISPLAYOPT_OBJECTGRA
304 "Chart", // SCDISPLAYOPT_CHART
305 "DrawingObject" // SCDISPLAYOPT_DRAWING
307 Sequence
<OUString
> aNames(SCDISPLAYOPT_COUNT
);
308 OUString
* pNames
= aNames
.getArray();
309 for(int i
= 0; i
< SCDISPLAYOPT_COUNT
; i
++)
310 pNames
[i
] = OUString::createFromAscii(aPropNames
[i
]);
315 Sequence
<OUString
> ScViewCfg::GetGridPropertyNames()
317 static const char* aPropNames
[] =
319 "Resolution/XAxis/NonMetric", // SCGRIDOPT_RESOLU_X
320 "Resolution/YAxis/NonMetric", // SCGRIDOPT_RESOLU_Y
321 "Subdivision/XAxis", // SCGRIDOPT_SUBDIV_X
322 "Subdivision/YAxis", // SCGRIDOPT_SUBDIV_Y
323 "Option/XAxis/NonMetric", // SCGRIDOPT_OPTION_X
324 "Option/YAxis/NonMetric", // SCGRIDOPT_OPTION_Y
325 "Option/SnapToGrid", // SCGRIDOPT_SNAPTOGRID
326 "Option/Synchronize", // SCGRIDOPT_SYNCHRON
327 "Option/VisibleGrid", // SCGRIDOPT_VISIBLE
328 "Option/SizeToGrid" // SCGRIDOPT_SIZETOGRID
330 Sequence
<OUString
> aNames(SCGRIDOPT_COUNT
);
331 OUString
* pNames
= aNames
.getArray();
332 for(int i
= 0; i
< SCGRIDOPT_COUNT
; i
++)
333 pNames
[i
] = OUString::createFromAscii(aPropNames
[i
]);
335 // adjust for metric system
336 if (ScOptionsUtil::IsMetricSystem())
338 pNames
[SCGRIDOPT_RESOLU_X
] = "Resolution/XAxis/Metric";
339 pNames
[SCGRIDOPT_RESOLU_Y
] = "Resolution/YAxis/Metric";
340 pNames
[SCGRIDOPT_OPTION_X
] = "Option/XAxis/Metric";
341 pNames
[SCGRIDOPT_OPTION_Y
] = "Option/YAxis/Metric";
347 ScViewCfg::ScViewCfg() :
348 aLayoutItem( OUString( CFGPATH_LAYOUT
) ),
349 aDisplayItem( OUString( CFGPATH_DISPLAY
) ),
350 aGridItem( OUString( CFGPATH_GRID
) )
352 sal_Int32 nIntVal
= 0;
354 Sequence
<OUString
> aNames
= GetLayoutPropertyNames();
355 Sequence
<Any
> aValues
= aLayoutItem
.GetProperties(aNames
);
356 aLayoutItem
.EnableNotification(aNames
);
357 const Any
* pValues
= aValues
.getConstArray();
358 OSL_ENSURE(aValues
.getLength() == aNames
.getLength(), "GetProperties failed");
359 if(aValues
.getLength() == aNames
.getLength())
361 for(int nProp
= 0; nProp
< aNames
.getLength(); nProp
++)
363 OSL_ENSURE(pValues
[nProp
].hasValue(), "property value missing");
364 if(pValues
[nProp
].hasValue())
368 case SCLAYOUTOPT_GRIDCOLOR
:
369 if ( pValues
[nProp
] >>= nIntVal
)
370 SetGridColor( Color(nIntVal
), EMPTY_OUSTRING
);
372 case SCLAYOUTOPT_GRIDLINES
:
373 SetOption( VOPT_GRID
, ScUnoHelpFunctions::GetBoolFromAny( pValues
[nProp
] ) );
375 case SCLAYOUTOPT_GRID_ONCOLOR
:
376 SetOption( VOPT_GRID_ONTOP
, ScUnoHelpFunctions::GetBoolFromAny( pValues
[nProp
] ) );
378 case SCLAYOUTOPT_PAGEBREAK
:
379 SetOption( VOPT_PAGEBREAKS
, ScUnoHelpFunctions::GetBoolFromAny( pValues
[nProp
] ) );
381 case SCLAYOUTOPT_GUIDE
:
382 SetOption( VOPT_HELPLINES
, ScUnoHelpFunctions::GetBoolFromAny( pValues
[nProp
] ) );
384 case SCLAYOUTOPT_COLROWHDR
:
385 SetOption( VOPT_HEADER
, ScUnoHelpFunctions::GetBoolFromAny( pValues
[nProp
] ) );
387 case SCLAYOUTOPT_HORISCROLL
:
388 SetOption( VOPT_HSCROLL
, ScUnoHelpFunctions::GetBoolFromAny( pValues
[nProp
] ) );
390 case SCLAYOUTOPT_VERTSCROLL
:
391 SetOption( VOPT_VSCROLL
, ScUnoHelpFunctions::GetBoolFromAny( pValues
[nProp
] ) );
393 case SCLAYOUTOPT_SHEETTAB
:
394 SetOption( VOPT_TABCONTROLS
, ScUnoHelpFunctions::GetBoolFromAny( pValues
[nProp
] ) );
396 case SCLAYOUTOPT_OUTLINE
:
397 SetOption( VOPT_OUTLINER
, ScUnoHelpFunctions::GetBoolFromAny( pValues
[nProp
] ) );
403 aLayoutItem
.SetCommitLink( LINK( this, ScViewCfg
, LayoutCommitHdl
) );
405 aNames
= GetDisplayPropertyNames();
406 aValues
= aDisplayItem
.GetProperties(aNames
);
407 aDisplayItem
.EnableNotification(aNames
);
408 pValues
= aValues
.getConstArray();
409 OSL_ENSURE(aValues
.getLength() == aNames
.getLength(), "GetProperties failed");
410 if(aValues
.getLength() == aNames
.getLength())
412 for(int nProp
= 0; nProp
< aNames
.getLength(); nProp
++)
414 OSL_ENSURE(pValues
[nProp
].hasValue(), "property value missing");
415 if(pValues
[nProp
].hasValue())
419 case SCDISPLAYOPT_FORMULA
:
420 SetOption( VOPT_FORMULAS
, ScUnoHelpFunctions::GetBoolFromAny( pValues
[nProp
] ) );
422 case SCDISPLAYOPT_ZEROVALUE
:
423 SetOption( VOPT_NULLVALS
, ScUnoHelpFunctions::GetBoolFromAny( pValues
[nProp
] ) );
425 case SCDISPLAYOPT_NOTETAG
:
426 SetOption( VOPT_NOTES
, ScUnoHelpFunctions::GetBoolFromAny( pValues
[nProp
] ) );
428 case SCDISPLAYOPT_VALUEHI
:
429 SetOption( VOPT_SYNTAX
, ScUnoHelpFunctions::GetBoolFromAny( pValues
[nProp
] ) );
431 case SCDISPLAYOPT_ANCHOR
:
432 SetOption( VOPT_ANCHOR
, ScUnoHelpFunctions::GetBoolFromAny( pValues
[nProp
] ) );
434 case SCDISPLAYOPT_TEXTOVER
:
435 SetOption( VOPT_CLIPMARKS
, ScUnoHelpFunctions::GetBoolFromAny( pValues
[nProp
] ) );
437 case SCDISPLAYOPT_OBJECTGRA
:
438 if ( pValues
[nProp
] >>= nIntVal
)
440 //#i80528# adapt to new range eventually
441 if((sal_Int32
)VOBJ_MODE_HIDE
< nIntVal
) nIntVal
= (sal_Int32
)VOBJ_MODE_SHOW
;
443 SetObjMode( VOBJ_TYPE_OLE
, (ScVObjMode
)nIntVal
);
446 case SCDISPLAYOPT_CHART
:
447 if ( pValues
[nProp
] >>= nIntVal
)
449 //#i80528# adapt to new range eventually
450 if((sal_Int32
)VOBJ_MODE_HIDE
< nIntVal
) nIntVal
= (sal_Int32
)VOBJ_MODE_SHOW
;
452 SetObjMode( VOBJ_TYPE_CHART
, (ScVObjMode
)nIntVal
);
455 case SCDISPLAYOPT_DRAWING
:
456 if ( pValues
[nProp
] >>= nIntVal
)
458 //#i80528# adapt to new range eventually
459 if((sal_Int32
)VOBJ_MODE_HIDE
< nIntVal
) nIntVal
= (sal_Int32
)VOBJ_MODE_SHOW
;
461 SetObjMode( VOBJ_TYPE_DRAW
, (ScVObjMode
)nIntVal
);
468 aDisplayItem
.SetCommitLink( LINK( this, ScViewCfg
, DisplayCommitHdl
) );
470 ScGridOptions aGrid
= GetGridOptions(); //TODO: initialization necessary?
471 aNames
= GetGridPropertyNames();
472 aValues
= aGridItem
.GetProperties(aNames
);
473 aGridItem
.EnableNotification(aNames
);
474 pValues
= aValues
.getConstArray();
475 OSL_ENSURE(aValues
.getLength() == aNames
.getLength(), "GetProperties failed");
476 if(aValues
.getLength() == aNames
.getLength())
478 for(int nProp
= 0; nProp
< aNames
.getLength(); nProp
++)
480 OSL_ENSURE(pValues
[nProp
].hasValue(), "property value missing");
481 if(pValues
[nProp
].hasValue())
485 case SCGRIDOPT_RESOLU_X
:
486 if (pValues
[nProp
] >>= nIntVal
) aGrid
.SetFieldDrawX( nIntVal
);
488 case SCGRIDOPT_RESOLU_Y
:
489 if (pValues
[nProp
] >>= nIntVal
) aGrid
.SetFieldDrawY( nIntVal
);
491 case SCGRIDOPT_SUBDIV_X
:
492 if (pValues
[nProp
] >>= nIntVal
) aGrid
.SetFieldDivisionX( nIntVal
);
494 case SCGRIDOPT_SUBDIV_Y
:
495 if (pValues
[nProp
] >>= nIntVal
) aGrid
.SetFieldDivisionY( nIntVal
);
497 case SCGRIDOPT_OPTION_X
:
498 if (pValues
[nProp
] >>= nIntVal
) aGrid
.SetFieldSnapX( nIntVal
);
500 case SCGRIDOPT_OPTION_Y
:
501 if (pValues
[nProp
] >>= nIntVal
) aGrid
.SetFieldSnapY( nIntVal
);
503 case SCGRIDOPT_SNAPTOGRID
:
504 aGrid
.SetUseGridSnap( ScUnoHelpFunctions::GetBoolFromAny( pValues
[nProp
] ) );
506 case SCGRIDOPT_SYNCHRON
:
507 aGrid
.SetSynchronize( ScUnoHelpFunctions::GetBoolFromAny( pValues
[nProp
] ) );
509 case SCGRIDOPT_VISIBLE
:
510 aGrid
.SetGridVisible( ScUnoHelpFunctions::GetBoolFromAny( pValues
[nProp
] ) );
512 case SCGRIDOPT_SIZETOGRID
:
513 aGrid
.SetEqualGrid( ScUnoHelpFunctions::GetBoolFromAny( pValues
[nProp
] ) );
519 SetGridOptions( aGrid
);
520 aGridItem
.SetCommitLink( LINK( this, ScViewCfg
, GridCommitHdl
) );
523 IMPL_LINK_NOARG(ScViewCfg
, LayoutCommitHdl
)
525 Sequence
<OUString
> aNames
= GetLayoutPropertyNames();
526 Sequence
<Any
> aValues(aNames
.getLength());
527 Any
* pValues
= aValues
.getArray();
529 for(int nProp
= 0; nProp
< aNames
.getLength(); nProp
++)
533 case SCLAYOUTOPT_GRIDCOLOR
:
534 pValues
[nProp
] <<= (sal_Int32
) GetGridColor().GetColor();
536 case SCLAYOUTOPT_GRIDLINES
:
537 ScUnoHelpFunctions::SetBoolInAny( pValues
[nProp
], GetOption( VOPT_GRID
) );
539 case SCLAYOUTOPT_GRID_ONCOLOR
:
540 ScUnoHelpFunctions::SetBoolInAny( pValues
[nProp
], GetOption( VOPT_GRID_ONTOP
) );
542 case SCLAYOUTOPT_PAGEBREAK
:
543 ScUnoHelpFunctions::SetBoolInAny( pValues
[nProp
], GetOption( VOPT_PAGEBREAKS
) );
545 case SCLAYOUTOPT_GUIDE
:
546 ScUnoHelpFunctions::SetBoolInAny( pValues
[nProp
], GetOption( VOPT_HELPLINES
) );
548 case SCLAYOUTOPT_COLROWHDR
:
549 ScUnoHelpFunctions::SetBoolInAny( pValues
[nProp
], GetOption( VOPT_HEADER
) );
551 case SCLAYOUTOPT_HORISCROLL
:
552 ScUnoHelpFunctions::SetBoolInAny( pValues
[nProp
], GetOption( VOPT_HSCROLL
) );
554 case SCLAYOUTOPT_VERTSCROLL
:
555 ScUnoHelpFunctions::SetBoolInAny( pValues
[nProp
], GetOption( VOPT_VSCROLL
) );
557 case SCLAYOUTOPT_SHEETTAB
:
558 ScUnoHelpFunctions::SetBoolInAny( pValues
[nProp
], GetOption( VOPT_TABCONTROLS
) );
560 case SCLAYOUTOPT_OUTLINE
:
561 ScUnoHelpFunctions::SetBoolInAny( pValues
[nProp
], GetOption( VOPT_OUTLINER
) );
565 aLayoutItem
.PutProperties(aNames
, aValues
);
570 IMPL_LINK_NOARG(ScViewCfg
, DisplayCommitHdl
)
572 Sequence
<OUString
> aNames
= GetDisplayPropertyNames();
573 Sequence
<Any
> aValues(aNames
.getLength());
574 Any
* pValues
= aValues
.getArray();
576 for(int nProp
= 0; nProp
< aNames
.getLength(); nProp
++)
580 case SCDISPLAYOPT_FORMULA
:
581 ScUnoHelpFunctions::SetBoolInAny( pValues
[nProp
], GetOption( VOPT_FORMULAS
) );
583 case SCDISPLAYOPT_ZEROVALUE
:
584 ScUnoHelpFunctions::SetBoolInAny( pValues
[nProp
], GetOption( VOPT_NULLVALS
) );
586 case SCDISPLAYOPT_NOTETAG
:
587 ScUnoHelpFunctions::SetBoolInAny( pValues
[nProp
], GetOption( VOPT_NOTES
) );
589 case SCDISPLAYOPT_VALUEHI
:
590 ScUnoHelpFunctions::SetBoolInAny( pValues
[nProp
], GetOption( VOPT_SYNTAX
) );
592 case SCDISPLAYOPT_ANCHOR
:
593 ScUnoHelpFunctions::SetBoolInAny( pValues
[nProp
], GetOption( VOPT_ANCHOR
) );
595 case SCDISPLAYOPT_TEXTOVER
:
596 ScUnoHelpFunctions::SetBoolInAny( pValues
[nProp
], GetOption( VOPT_CLIPMARKS
) );
598 case SCDISPLAYOPT_OBJECTGRA
:
599 pValues
[nProp
] <<= (sal_Int32
) GetObjMode( VOBJ_TYPE_OLE
);
601 case SCDISPLAYOPT_CHART
:
602 pValues
[nProp
] <<= (sal_Int32
) GetObjMode( VOBJ_TYPE_CHART
);
604 case SCDISPLAYOPT_DRAWING
:
605 pValues
[nProp
] <<= (sal_Int32
) GetObjMode( VOBJ_TYPE_DRAW
);
609 aDisplayItem
.PutProperties(aNames
, aValues
);
614 IMPL_LINK_NOARG(ScViewCfg
, GridCommitHdl
)
616 const ScGridOptions
& rGrid
= GetGridOptions();
618 Sequence
<OUString
> aNames
= GetGridPropertyNames();
619 Sequence
<Any
> aValues(aNames
.getLength());
620 Any
* pValues
= aValues
.getArray();
622 for(int nProp
= 0; nProp
< aNames
.getLength(); nProp
++)
626 case SCGRIDOPT_RESOLU_X
:
627 pValues
[nProp
] <<= (sal_Int32
) rGrid
.GetFieldDrawX();
629 case SCGRIDOPT_RESOLU_Y
:
630 pValues
[nProp
] <<= (sal_Int32
) rGrid
.GetFieldDrawY();
632 case SCGRIDOPT_SUBDIV_X
:
633 pValues
[nProp
] <<= (sal_Int32
) rGrid
.GetFieldDivisionX();
635 case SCGRIDOPT_SUBDIV_Y
:
636 pValues
[nProp
] <<= (sal_Int32
) rGrid
.GetFieldDivisionY();
638 case SCGRIDOPT_OPTION_X
:
639 pValues
[nProp
] <<= (sal_Int32
) rGrid
.GetFieldSnapX();
641 case SCGRIDOPT_OPTION_Y
:
642 pValues
[nProp
] <<= (sal_Int32
) rGrid
.GetFieldSnapY();
644 case SCGRIDOPT_SNAPTOGRID
:
645 ScUnoHelpFunctions::SetBoolInAny( pValues
[nProp
], rGrid
.GetUseGridSnap() );
647 case SCGRIDOPT_SYNCHRON
:
648 ScUnoHelpFunctions::SetBoolInAny( pValues
[nProp
], rGrid
.GetSynchronize() );
650 case SCGRIDOPT_VISIBLE
:
651 ScUnoHelpFunctions::SetBoolInAny( pValues
[nProp
], rGrid
.GetGridVisible() );
653 case SCGRIDOPT_SIZETOGRID
:
654 ScUnoHelpFunctions::SetBoolInAny( pValues
[nProp
], rGrid
.GetEqualGrid() );
658 aGridItem
.PutProperties(aNames
, aValues
);
663 void ScViewCfg::SetOptions( const ScViewOptions
& rNew
)
665 *(ScViewOptions
*)this = rNew
;
666 aLayoutItem
.SetModified();
667 aDisplayItem
.SetModified();
668 aGridItem
.SetModified();
671 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */