xref: /aoo41x/main/sd/source/ui/app/optsitem.cxx (revision 93278366)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_sd.hxx"
26 #include <svx/svdmodel.hxx>
27 #include <sfx2/app.hxx>
28 #include <sfx2/sfx.hrc>
29 #ifndef _SV_SALBTYPE_HRC //autogen
30 #include <vcl/salbtype.hxx>
31 #endif
32 #include <unotools/syslocale.hxx>
33 
34 #include "app.hxx"
35 #include "optsitem.hxx"
36 #include "cfgids.hxx"
37 #include "FrameView.hxx"
38 
39 using namespace ::rtl;
40 using namespace ::utl;
41 using namespace ::com::sun::star::uno;
42 
43 #define B2U(_def_aStr) (OUString::createFromAscii(_def_aStr))
44 
45 template< class T > T getSafeValue( const Any& rAny )
46 {
47 	T value = T();
48 	bool bOk = (rAny >>= value);
49 
50 	DBG_ASSERT( bOk, "SdOptionsItem, wrong type from configuration!" );
51 	(void)bOk;
52 
53 	return value;
54 }
55 
56 // -----------------
57 // - SdOptionsItem -
58 // -----------------
59 
60 SdOptionsItem::SdOptionsItem( const SdOptionsGeneric& rParent, const OUString rSubTree ) :
61 	ConfigItem	( rSubTree ),
62 	mrParent	( rParent )
63 {
64 }
65 
66 // -----------------------------------------------------------------------------
67 
68 SdOptionsItem::~SdOptionsItem()
69 {
70 }
71 
72 // -----------------------------------------------------------------------------
73 
74 void SdOptionsItem::Commit()
75 {
76 	if( IsModified() )
77 		mrParent.Commit( *this );
78 };
79 
80 void SdOptionsItem::Notify( const com::sun::star::uno::Sequence<rtl::OUString>& )
81 {}
82 
83 
84 // -----------------------------------------------------------------------------
85 
86 Sequence< Any >	SdOptionsItem::GetProperties( const Sequence< OUString >& rNames )
87 {
88 	return ConfigItem::GetProperties( rNames );
89 }
90 
91 // -----------------------------------------------------------------------------
92 
93 sal_Bool SdOptionsItem::PutProperties( const Sequence< OUString >& rNames, const Sequence< Any>& rValues )
94 {
95 	return ConfigItem::PutProperties( rNames, rValues );
96 }
97 
98 // -----------------------------------------------------------------------------
99 
100 void SdOptionsItem::SetModified()
101 {
102 	ConfigItem::SetModified();
103 }
104 
105 // --------------------
106 // - SdOptionsGeneric -
107 // --------------------
108 
109 SdOptionsGeneric::SdOptionsGeneric( sal_uInt16 nConfigId, const OUString& rSubTree ) :
110 	maSubTree	( rSubTree ),
111 	mpCfgItem	( NULL ),
112 	mnConfigId	( nConfigId ),
113 	mbInit		( rSubTree.getLength() == 0 )
114 {
115 }
116 
117 // -----------------------------------------------------------------------------
118 
119 void SdOptionsGeneric::Init() const
120 {
121 	if( !mbInit )
122 	{
123 		SdOptionsGeneric* pThis	= const_cast<SdOptionsGeneric*>(this);
124 
125 		if( !mpCfgItem )
126 			pThis->mpCfgItem = new SdOptionsItem( *this, maSubTree );
127 
128 		const Sequence< OUString >	aNames( GetPropertyNames() );
129 		const Sequence< Any >		aValues = mpCfgItem->GetProperties( aNames );
130 
131 		if( aNames.getLength() && ( aValues.getLength() == aNames.getLength() ) )
132 		{
133 			const Any* pValues = aValues.getConstArray();
134 
135 			pThis->EnableModify( sal_False );
136 			pThis->mbInit = pThis->ReadData( pValues );
137 			pThis->EnableModify( sal_True );
138 		}
139 		else
140 			pThis->mbInit = sal_True;
141 	}
142 }
143 
144 // -----------------------------------------------------------------------------
145 
146 SdOptionsGeneric::~SdOptionsGeneric()
147 {
148 	delete mpCfgItem;
149 	mpCfgItem = NULL;
150 }
151 
152 // -----------------------------------------------------------------------------
153 
154 void SdOptionsGeneric::Commit( SdOptionsItem& rCfgItem ) const
155 {
156 	const Sequence< OUString >	aNames( GetPropertyNames() );
157 	Sequence< Any >				aValues( aNames.getLength() );
158 
159 	if( aNames.getLength() && ( aValues.getLength() == aNames.getLength() ) )
160 	{
161 		if( (const_cast<SdOptionsGeneric*>(this))->WriteData( aValues.getArray() ) )
162 			rCfgItem.PutProperties( aNames, aValues );
163 		else
164 		{
165 			DBG_ERROR( "PutProperties failed" );
166 		}
167 	}
168 }
169 
170 // -----------------------------------------------------------------------------
171 
172 Sequence< OUString > SdOptionsGeneric::GetPropertyNames() const
173 {
174 	sal_uLong			nCount;
175 	const char**	ppPropNames;
176 
177 	GetPropNameArray( ppPropNames, nCount );
178 
179 	Sequence< OUString > aNames( nCount );
180 	OUString*			 pNames = aNames.getArray();
181 
182 	for( sal_uLong i = 0; i < nCount; i++ )
183 		pNames[ i ] = OUString::createFromAscii( ppPropNames[ i ] );
184 
185 	return aNames;
186 }
187 
188 // -----------------------------------------------------------------------------
189 
190 void SdOptionsGeneric::Store()
191 {
192 	if( mpCfgItem )
193 		mpCfgItem->Commit();
194 }
195 
196 // -----------------------------------------------------------------------------
197 
198 bool SdOptionsGeneric::isMetricSystem()
199 {
200 	SvtSysLocale aSysLocale;
201     MeasurementSystem eSys = aSysLocale.GetLocaleDataPtr()->getMeasurementSystemEnum();
202 
203 	return ( eSys == MEASURE_METRIC );
204 }
205 
206 /*************************************************************************
207 |*
208 |* SdOptionsLayout
209 |*
210 \************************************************************************/
211 
212 SdOptionsLayout::SdOptionsLayout(  sal_uInt16 nConfigId, sal_Bool bUseConfig ) :
213 	SdOptionsGeneric( nConfigId, bUseConfig ?
214 					  ( ( SDCFG_DRAW == nConfigId ) ?
215 						B2U( "Office.Draw/Layout" ) :
216 						B2U( "Office.Impress/Layout" ) ) :
217 					  OUString() ),
218 	bRuler( sal_True ),
219 	bMoveOutline( sal_True ),
220 	bDragStripes( sal_False ),
221 	bHandlesBezier( sal_False ),
222 	bHelplines( sal_True ),
223 	nMetric((sal_uInt16)(isMetricSystem() ? FUNIT_CM : FUNIT_INCH)),
224 	nDefTab( 1250 )
225 {
226 	EnableModify( sal_True );
227 }
228 
229 // -----------------------------------------------------------------------------
230 
231 sal_Bool SdOptionsLayout::operator==( const SdOptionsLayout& rOpt ) const
232 {
233 	return(	IsRulerVisible() == rOpt.IsRulerVisible() &&
234 			IsMoveOutline() == rOpt.IsMoveOutline() &&
235 			IsDragStripes() == rOpt.IsDragStripes() &&
236 			IsHandlesBezier() == rOpt.IsHandlesBezier() &&
237 			IsHelplines() == rOpt.IsHelplines() &&
238 			GetMetric() == rOpt.GetMetric() &&
239 			GetDefTab() == rOpt.GetDefTab() );
240 }
241 
242 // -----------------------------------------------------------------------------
243 
244 void SdOptionsLayout::GetPropNameArray( const char**& ppNames, sal_uLong& rCount ) const
245 {
246 	static const char* aPropNamesMetric[] =
247 	{
248 		"Display/Ruler",
249 		"Display/Bezier",
250 		"Display/Contour",
251 		"Display/Guide",
252 		"Display/Helpline",
253 		"Other/MeasureUnit/Metric",
254 		"Other/TabStop/Metric"
255 	};
256 
257 	static const char* aPropNamesNonMetric[] =
258 	{
259 		"Display/Ruler",
260 		"Display/Bezier",
261 		"Display/Contour",
262 		"Display/Guide",
263 		"Display/Helpline",
264 		"Other/MeasureUnit/NonMetric",
265 		"Other/TabStop/NonMetric"
266 	};
267 
268 	rCount = 7;
269 
270 	if( isMetricSystem() )
271 		ppNames = aPropNamesMetric;
272 	else
273 		ppNames = aPropNamesNonMetric;
274 }
275 
276 // -----------------------------------------------------------------------------
277 
278 sal_Bool SdOptionsLayout::ReadData( const Any* pValues )
279 {
280 	if( pValues[0].hasValue() ) SetRulerVisible( *(sal_Bool*) pValues[ 0 ].getValue() );
281 	if( pValues[1].hasValue() ) SetHandlesBezier( *(sal_Bool*) pValues[ 1 ].getValue() );
282 	if( pValues[2].hasValue() ) SetMoveOutline( *(sal_Bool*) pValues[ 2 ].getValue() );
283 	if( pValues[3].hasValue() ) SetDragStripes( *(sal_Bool*) pValues[ 3 ].getValue() );
284 	if( pValues[4].hasValue() ) SetHelplines( *(sal_Bool*) pValues[ 4 ].getValue() );
285 	if( pValues[5].hasValue() ) SetMetric( (sal_uInt16) *(sal_Int32*) pValues[ 5 ].getValue() );
286 	if( pValues[6].hasValue() ) SetDefTab( (sal_uInt16) *(sal_Int32*) pValues[ 6 ].getValue() );
287 
288 	return sal_True;
289 }
290 
291 // -----------------------------------------------------------------------------
292 
293 sal_Bool SdOptionsLayout::WriteData( Any* pValues ) const
294 {
295 	pValues[ 0 ] <<= IsRulerVisible();
296 	pValues[ 1 ] <<= IsHandlesBezier();
297 	pValues[ 2 ] <<= IsMoveOutline();
298 	pValues[ 3 ] <<= IsDragStripes();
299 	pValues[ 4 ] <<= IsHelplines();
300 	pValues[ 5 ] <<= (sal_Int32) GetMetric();
301 	pValues[ 6 ] <<= (sal_Int32) GetDefTab();
302 
303 	return sal_True;
304 }
305 
306 /*************************************************************************
307 |*
308 |* SdOptionsLayoutItem
309 |*
310 \************************************************************************/
311 
312 SdOptionsLayoutItem::SdOptionsLayoutItem( sal_uInt16 _nWhich )
313 :	SfxPoolItem		( _nWhich )
314 ,	maOptionsLayout	( 0, sal_False )
315 {
316 }
317 
318 // ----------------------------------------------------------------------
319 
320 SdOptionsLayoutItem::SdOptionsLayoutItem( sal_uInt16 _nWhich, SdOptions* pOpts, ::sd::FrameView* pView )
321 :	SfxPoolItem		( _nWhich )
322 ,	maOptionsLayout	( 0, sal_False )
323 {
324 	if( pOpts )
325 	{
326 		maOptionsLayout.SetMetric( pOpts->GetMetric() );
327 		maOptionsLayout.SetDefTab( pOpts->GetDefTab() );
328 	}
329 
330 	if( pView )
331 	{
332 		maOptionsLayout.SetRulerVisible( pView->HasRuler() );
333 		maOptionsLayout.SetMoveOutline( !pView->IsNoDragXorPolys() );
334 		maOptionsLayout.SetDragStripes( pView->IsDragStripes() );
335 		maOptionsLayout.SetHandlesBezier( pView->IsPlusHandlesAlwaysVisible() );
336 		maOptionsLayout.SetHelplines( pView->IsHlplVisible() );
337 	}
338 	else if( pOpts )
339 	{
340 		maOptionsLayout.SetRulerVisible( pOpts->IsRulerVisible() );
341 		maOptionsLayout.SetMoveOutline( pOpts->IsMoveOutline() );
342 		maOptionsLayout.SetDragStripes( pOpts->IsDragStripes() );
343 		maOptionsLayout.SetHandlesBezier( pOpts->IsHandlesBezier() );
344 		maOptionsLayout.SetHelplines( pOpts->IsHelplines() );
345 	}
346 }
347 
348 // ----------------------------------------------------------------------
349 
350 SfxPoolItem* SdOptionsLayoutItem::Clone( SfxItemPool* ) const
351 {
352 	return new SdOptionsLayoutItem( *this );
353 }
354 
355 
356 // ----------------------------------------------------------------------
357 
358 int SdOptionsLayoutItem::operator==( const SfxPoolItem& rAttr ) const
359 {
360 	const bool bSameType = SfxPoolItem::operator==( rAttr );
361 	DBG_ASSERT( bSameType, "SdOptionsLayoutItem::operator==(), differen pool item type!" );
362 	return bSameType && ( maOptionsLayout == static_cast< const SdOptionsLayoutItem& >( rAttr ).maOptionsLayout );
363 }
364 
365 // -----------------------------------------------------------------------
366 
367 void SdOptionsLayoutItem::SetOptions( SdOptions* pOpts ) const
368 {
369 	if( pOpts )
370 	{
371 		pOpts->SetRulerVisible( maOptionsLayout.IsRulerVisible() );
372 		pOpts->SetMoveOutline( maOptionsLayout.IsMoveOutline() );
373 		pOpts->SetDragStripes( maOptionsLayout.IsDragStripes() );
374 		pOpts->SetHandlesBezier( maOptionsLayout.IsHandlesBezier() );
375 		pOpts->SetHelplines( maOptionsLayout.IsHelplines() );
376 		pOpts->SetMetric( maOptionsLayout.GetMetric() );
377 		pOpts->SetDefTab( maOptionsLayout.GetDefTab() );
378 	}
379 }
380 
381 /*************************************************************************
382 |*
383 |* SdOptionsContents
384 |*
385 \************************************************************************/
386 
387 SdOptionsContents::SdOptionsContents( sal_uInt16 nConfigId, sal_Bool bUseConfig ) :
388 	SdOptionsGeneric( nConfigId, bUseConfig ?
389 					  ( ( SDCFG_DRAW == nConfigId ) ?
390 						B2U( "Office.Draw/Content" ) :
391 						B2U( "Office.Impress/Content" ) ) :
392 					  OUString() )
393 {
394 	EnableModify( sal_True );
395 }
396 
397 // -----------------------------------------------------------------------------
398 
399 sal_Bool SdOptionsContents::operator==(const SdOptionsContents&) const
400 {
401     return true;
402 }
403 
404 // -----------------------------------------------------------------------------
405 
406 void SdOptionsContents::GetPropNameArray( const char**& ppNames, sal_uLong& rCount ) const
407 {
408 	static const char* aPropNames[] =
409 	{
410 		"Display/PicturePlaceholder",
411 		"Display/ContourMode",
412 		"Display/LineContour",
413 		"Display/TextPlaceholder"
414 	};
415 
416 	rCount = 4;
417 	ppNames = aPropNames;
418 }
419 
420 // -----------------------------------------------------------------------------
421 
422 sal_Bool SdOptionsContents::ReadData(const Any*)
423 {
424 	return sal_True;
425 }
426 
427 // -----------------------------------------------------------------------------
428 
429 sal_Bool SdOptionsContents::WriteData( Any* pValues ) const
430 {
431 	//#i80528# no draft anymore
432 	pValues[ 0 ] <<= (sal_Bool)false;
433 	pValues[ 1 ] <<= (sal_Bool)false;
434 	pValues[ 2 ] <<= (sal_Bool)false;
435 	pValues[ 3 ] <<= (sal_Bool)false;
436 
437 	return sal_True;
438 }
439 
440 /*************************************************************************
441 |*
442 |* SdOptionsContentsItem
443 |*
444 \************************************************************************/
445 
446 SdOptionsContentsItem::SdOptionsContentsItem(sal_uInt16 _nWhich, SdOptions*, ::sd::FrameView*)
447 :	SfxPoolItem			( _nWhich )
448 ,	maOptionsContents	( 0, sal_False )
449 {
450 }
451 
452 // ----------------------------------------------------------------------
453 
454 SfxPoolItem* SdOptionsContentsItem::Clone( SfxItemPool* ) const
455 {
456 	return new SdOptionsContentsItem( *this );
457 }
458 
459 // ----------------------------------------------------------------------
460 
461 int SdOptionsContentsItem::operator==( const SfxPoolItem& rAttr ) const
462 {
463 	const bool bSameType = SfxPoolItem::operator==(rAttr);
464 	DBG_ASSERT( bSameType, "SdOptionsContentsItem::operator==(), differen pool item type!" );
465 	return bSameType && ( maOptionsContents == static_cast<const SdOptionsContentsItem&>( rAttr ).maOptionsContents );
466 }
467 
468 // -----------------------------------------------------------------------
469 
470 void SdOptionsContentsItem::SetOptions(SdOptions*) const
471 {
472 }
473 
474 /*************************************************************************
475 |*
476 |* SdOptionsMisc
477 |*
478 \************************************************************************/
479 
480 SdOptionsMisc::SdOptionsMisc( sal_uInt16 nConfigId, sal_Bool bUseConfig ) :
481 	SdOptionsGeneric( nConfigId, bUseConfig ?
482 					  ( ( SDCFG_DRAW == nConfigId ) ?
483 						B2U( "Office.Draw/Misc" ) :
484 						B2U( "Office.Impress/Misc" ) ) :
485 					  OUString() ),
486 	// #97016#
487 	nDefaultObjectSizeWidth(8000),
488 	nDefaultObjectSizeHeight(5000),
489 	bStartWithTemplate( sal_True ),
490 	bMarkedHitMovesAlways( sal_True ),
491 	bMoveOnlyDragging( sal_False ),
492 	bCrookNoContortion( sal_False ),
493 	bQuickEdit( GetConfigId() != SDCFG_DRAW ),
494 	bMasterPageCache( sal_True ),
495 	bDragWithCopy( sal_False ),
496 	bPickThrough( sal_True ),
497 	bBigHandles( sal_False ),
498 	bDoubleClickTextEdit( sal_True ),
499 	bClickChangeRotation( sal_False ),
500 	bStartWithActualPage( sal_False ),
501 	bSolidDragging( sal_True ),
502 	bSolidMarkHdl( sal_True ),
503 	bSummationOfParagraphs( sal_False ),
504 	// #90356#
505 	bShowUndoDeleteWarning( sal_True ),
506     bSlideshowRespectZOrder( sal_True ),
507     bShowComments( sal_True ),
508 	bPreviewNewEffects( sal_True ),
509 	bPreviewChangedEffects( sal_False ),
510 	bPreviewTransitions( sal_True ),
511 	mnDisplay( 0 ),
512 	mnPenColor( 0xff0000 ),
513 	mnPenWidth( 150.0 ),
514 
515 	// The default for 6.1-and-above documents is to use printer-independent
516     // formatting.
517 	mnPrinterIndependentLayout (1)
518 {
519 	EnableModify( sal_True );
520 }
521 
522 // -----------------------------------------------------------------------------
523 
524 sal_Bool SdOptionsMisc::operator==( const SdOptionsMisc& rOpt ) const
525 {
526 	return(	IsStartWithTemplate() == rOpt.IsStartWithTemplate() &&
527 			IsMarkedHitMovesAlways() == rOpt.IsMarkedHitMovesAlways() &&
528 			IsMoveOnlyDragging() == rOpt.IsMoveOnlyDragging() &&
529 			IsCrookNoContortion() == rOpt.IsCrookNoContortion() &&
530 			IsQuickEdit() == rOpt.IsQuickEdit() &&
531 			IsMasterPagePaintCaching() == rOpt.IsMasterPagePaintCaching() &&
532 			IsDragWithCopy() == rOpt.IsDragWithCopy() &&
533 			IsPickThrough() == rOpt.IsPickThrough() &&
534 			IsBigHandles() == rOpt.IsBigHandles() &&
535 			IsDoubleClickTextEdit() == rOpt.IsDoubleClickTextEdit() &&
536 			IsClickChangeRotation() == rOpt.IsClickChangeRotation() &&
537 			IsStartWithActualPage() == rOpt.IsStartWithActualPage() &&
538 			IsSummationOfParagraphs() == rOpt.IsSummationOfParagraphs() &&
539 			IsSolidDragging() == rOpt.IsSolidDragging() &&
540 			IsSolidMarkHdl() == rOpt.IsSolidMarkHdl() &&
541 			// #90356#
542 			IsShowUndoDeleteWarning() == rOpt.IsShowUndoDeleteWarning() &&
543 			IsSlideshowRespectZOrder() == rOpt.IsSlideshowRespectZOrder() &&
544 			GetPrinterIndependentLayout() == rOpt.GetPrinterIndependentLayout() &&
545 			// #97016#
546 			GetDefaultObjectSizeWidth() == rOpt.GetDefaultObjectSizeWidth() &&
547 			GetDefaultObjectSizeHeight() == rOpt.GetDefaultObjectSizeHeight() &&
548 
549 			IsPreviewNewEffects() == rOpt.IsPreviewNewEffects() &&
550 			IsPreviewChangedEffects() == rOpt.IsPreviewChangedEffects() &&
551 			IsPreviewTransitions() == rOpt.IsPreviewTransitions() &&
552 			GetDisplay() == rOpt.GetDisplay() &&
553 			IsShowComments() == rOpt.IsShowComments() &&
554 			GetPresentationPenColor() == rOpt.GetPresentationPenColor() &&
555 			GetPresentationPenWidth() == rOpt.GetPresentationPenWidth()
556 		);
557 }
558 
559 // -----------------------------------------------------------------------------
560 
561 void SdOptionsMisc::GetPropNameArray( const char**& ppNames, sal_uLong& rCount ) const
562 {
563 	static const char* aPropNames[] =
564 	{
565 		"ObjectMoveable",
566 		"NoDistort",
567 		"TextObject/QuickEditing",
568 		"BackgroundCache",
569 		"CopyWhileMoving",
570 		"TextObject/Selectable",
571 		"BigHandles",
572 		"DclickTextedit",
573 		"RotateClick",
574 		"Preview",
575 		"ModifyWithAttributes",
576 		"SimpleHandles",
577 		// #97016#
578 		"DefaultObjectSize/Width",
579 		"DefaultObjectSize/Height",
580 
581         "Compatibility/PrinterIndependentLayout",
582 
583 		"ShowComments",
584 
585 		// just for impress
586 		"NewDoc/AutoPilot",
587 		"Start/CurrentPage",
588 		"Compatibility/AddBetween",
589 		// #90356#
590 		"ShowUndoDeleteWarning",
591         "SlideshowRespectZOrder",
592 
593 		"PreviewNewEffects",
594 		"PreviewChangedEffects",
595 		"PreviewTransitions",
596 
597 		"Display",
598 
599 		"PenColor",
600 		"PenWidth"
601 	};
602 
603 	rCount = ( ( GetConfigId() == SDCFG_IMPRESS ) ? 27 : 16 );
604 	ppNames = aPropNames;
605 }
606 
607 // -----------------------------------------------------------------------------
608 
609 sal_Bool SdOptionsMisc::ReadData( const Any* pValues )
610 {
611 	if( pValues[0].hasValue() ) SetMarkedHitMovesAlways( *(sal_Bool*) pValues[ 0 ].getValue() );
612 	if( pValues[1].hasValue() ) SetCrookNoContortion( *(sal_Bool*) pValues[ 1 ].getValue() );
613 	if( pValues[2].hasValue() ) SetQuickEdit( *(sal_Bool*)pValues[ 2 ].getValue() );
614 	if( pValues[3].hasValue() ) SetMasterPagePaintCaching( *(sal_Bool*) pValues[ 3 ].getValue() );
615 	if( pValues[4].hasValue() ) SetDragWithCopy( *(sal_Bool*) pValues[ 4 ].getValue() );
616 	if( pValues[5].hasValue() ) SetPickThrough( *(sal_Bool*) pValues[ 5 ].getValue() );
617 	if( pValues[6].hasValue() ) SetBigHandles( *(sal_Bool*) pValues[ 6 ].getValue() );
618 	if( pValues[7].hasValue() ) SetDoubleClickTextEdit( *(sal_Bool*) pValues[ 7 ].getValue() );
619 	if( pValues[8].hasValue() ) SetClickChangeRotation( *(sal_Bool*) pValues[ 8 ].getValue() );
620     //	if( pValues[9].hasValue() ) SetPreviewQuality( FRound( *(double*) pValues[ 9 ].getValue() ) );
621 	if( pValues[10].hasValue() ) SetSolidDragging( *(sal_Bool*) pValues[ 10 ].getValue() );
622 	if( pValues[11].hasValue() ) SetSolidMarkHdl( *(sal_Bool*) pValues[ 11 ].getValue() );
623 	// #97016#
624 	if( pValues[12].hasValue() ) SetDefaultObjectSizeWidth( *(sal_uInt32*) pValues[ 12 ].getValue() );
625 	if( pValues[13].hasValue() ) SetDefaultObjectSizeHeight( *(sal_uInt32*) pValues[ 13 ].getValue() );
626 	if( pValues[14].hasValue() ) SetPrinterIndependentLayout( *(sal_uInt16*) pValues[ 14 ].getValue() );
627 
628     if( pValues[15].hasValue() )
629 		SetShowComments(  *(sal_Bool*) pValues[ 15 ].getValue() );
630 
631 	// just for Impress
632 	if( GetConfigId() == SDCFG_IMPRESS )
633 	{
634 		if( pValues[16].hasValue() )
635 			SetStartWithTemplate( *(sal_Bool*) pValues[ 16 ].getValue() );
636 		if( pValues[17].hasValue() )
637 			SetStartWithActualPage( *(sal_Bool*) pValues[ 17 ].getValue() );
638 		if( pValues[18].hasValue() )
639 			SetSummationOfParagraphs( *(sal_Bool*) pValues[ 18 ].getValue() );
640 		// #90356#
641 		if( pValues[19].hasValue() )
642 			SetShowUndoDeleteWarning( *(sal_Bool*) pValues[ 19 ].getValue() );
643 
644 		if( pValues[20].hasValue() )
645             SetSlideshowRespectZOrder(*(sal_Bool*) pValues[ 20 ].getValue());
646 
647 		if( pValues[21].hasValue() )
648 			SetPreviewNewEffects(*(sal_Bool*) pValues[ 21 ].getValue());
649 
650 		if( pValues[22].hasValue() )
651 			SetPreviewChangedEffects(*(sal_Bool*) pValues[ 22 ].getValue());
652 
653 		if( pValues[23].hasValue() )
654 			SetPreviewTransitions(*(sal_Bool*) pValues[ 23 ].getValue());
655 
656 		if( pValues[24].hasValue() )
657 			SetDisplay(*(sal_Int32*) pValues[ 24 ].getValue());
658 
659 		if( pValues[25].hasValue() )
660 			SetPresentationPenColor( getSafeValue< sal_Int32 >( pValues[ 25 ] ) );
661 
662 		if( pValues[26].hasValue() )
663 			SetPresentationPenWidth( getSafeValue< double >( pValues[ 26 ] ) );
664 	}
665 
666 	return sal_True;
667 }
668 
669 // -----------------------------------------------------------------------------
670 
671 sal_Bool SdOptionsMisc::WriteData( Any* pValues ) const
672 {
673 	pValues[ 0 ] <<= IsMarkedHitMovesAlways();
674 	pValues[ 1 ] <<= IsCrookNoContortion();
675 	pValues[ 2 ] <<= IsQuickEdit();
676 	pValues[ 3 ] <<= IsMasterPagePaintCaching();
677 	pValues[ 4 ] <<= IsDragWithCopy();
678 	pValues[ 5 ] <<= IsPickThrough();
679 	pValues[ 6 ] <<= IsBigHandles();
680 	pValues[ 7 ] <<= IsDoubleClickTextEdit();
681 	pValues[ 8 ] <<= IsClickChangeRotation();
682     // The preview is not supported anymore.  Use a dummy value.
683 	pValues[ 9 ] <<= (double)0;// GetPreviewQuality();
684 	pValues[ 10 ] <<= IsSolidDragging();
685 	pValues[ 11 ] <<= IsSolidMarkHdl();
686 	// #97016#
687 	pValues[ 12 ] <<= GetDefaultObjectSizeWidth();
688 	pValues[ 13 ] <<= GetDefaultObjectSizeHeight();
689 	pValues[ 14 ] <<= GetPrinterIndependentLayout();
690     pValues[ 15 ] <<= (sal_Bool)IsShowComments();
691 
692 	// just for Impress
693 	if( GetConfigId() == SDCFG_IMPRESS )
694 	{
695 		pValues[ 16 ] <<= IsStartWithTemplate();
696 		pValues[ 17 ] <<= IsStartWithActualPage();
697 		pValues[ 18 ] <<= IsSummationOfParagraphs();
698 		// #90356#
699 		pValues[ 19 ] <<= IsShowUndoDeleteWarning();
700 		pValues[ 20 ] <<= IsSlideshowRespectZOrder();
701 
702 		pValues[ 21 ] <<= IsPreviewNewEffects();
703 		pValues[ 22 ] <<= IsPreviewChangedEffects();
704 		pValues[ 23 ] <<= IsPreviewTransitions();
705 
706 		pValues[ 24 ] <<= GetDisplay();
707 
708 		pValues[ 25 ] <<= GetPresentationPenColor();
709 		pValues[ 26 ] <<= GetPresentationPenWidth();
710 	}
711 
712 	return sal_True;
713 }
714 
715 /*************************************************************************
716 |*
717 |* SdOptionsMiscItem
718 |*
719 \************************************************************************/
720 
721 SdOptionsMiscItem::SdOptionsMiscItem( sal_uInt16 _nWhich )
722 :	SfxPoolItem		( _nWhich )
723 ,	maOptionsMisc	( 0, sal_False )
724 {
725 }
726 
727 // ----------------------------------------------------------------------
728 
729 SdOptionsMiscItem::SdOptionsMiscItem( sal_uInt16 _nWhich, SdOptions* pOpts, ::sd::FrameView* pView )
730 :	SfxPoolItem		( _nWhich )
731 ,	maOptionsMisc	( 0, sal_False )
732 {
733 	if( pOpts )
734 	{
735 		maOptionsMisc.SetStartWithTemplate( pOpts->IsStartWithTemplate() );
736 		maOptionsMisc.SetStartWithActualPage( pOpts->IsStartWithActualPage() );
737 		maOptionsMisc.SetSummationOfParagraphs( pOpts->IsSummationOfParagraphs() );
738 		// #90356#
739 		maOptionsMisc.SetShowUndoDeleteWarning( pOpts->IsShowUndoDeleteWarning() );
740 		maOptionsMisc.SetPrinterIndependentLayout( pOpts->GetPrinterIndependentLayout() );
741 		// #97016#
742 		maOptionsMisc.SetDefaultObjectSizeWidth( pOpts->GetDefaultObjectSizeWidth() );
743 		maOptionsMisc.SetDefaultObjectSizeHeight( pOpts->GetDefaultObjectSizeHeight() );
744 
745 		maOptionsMisc.SetPreviewNewEffects(pOpts->IsPreviewNewEffects());
746 		maOptionsMisc.SetPreviewChangedEffects(pOpts->IsPreviewChangedEffects());
747 		maOptionsMisc.SetPreviewTransitions(pOpts->IsPreviewTransitions());
748 
749 		maOptionsMisc.SetDisplay(pOpts->GetDisplay());
750 		maOptionsMisc.SetShowComments( pOpts->IsShowComments() );
751 
752 		maOptionsMisc.SetPresentationPenColor(pOpts->GetPresentationPenColor() );
753 		maOptionsMisc.SetPresentationPenWidth(pOpts->GetPresentationPenWidth() );
754 	}
755 
756 	if( pView )
757 	{
758 		maOptionsMisc.SetMarkedHitMovesAlways( pView->IsMarkedHitMovesAlways() );
759 		maOptionsMisc.SetMoveOnlyDragging( pView->IsMoveOnlyDragging() );
760 		maOptionsMisc.SetCrookNoContortion( pView->IsCrookNoContortion() );
761 		maOptionsMisc.SetQuickEdit( pView->IsQuickEdit() );
762 
763 		// #i26631#
764 		maOptionsMisc.SetMasterPagePaintCaching( pView->IsMasterPagePaintCaching() );
765 
766 		maOptionsMisc.SetDragWithCopy( pView->IsDragWithCopy() );
767 		maOptionsMisc.SetPickThrough( (sal_Bool)pView->GetModel()->IsPickThroughTransparentTextFrames() );
768 		maOptionsMisc.SetBigHandles( (sal_Bool)pView->IsBigHandles() );
769 		maOptionsMisc.SetDoubleClickTextEdit( pView->IsDoubleClickTextEdit() );
770 		maOptionsMisc.SetClickChangeRotation( pView->IsClickChangeRotation() );
771 		maOptionsMisc.SetSolidDragging( pView->IsSolidDragging() );
772 		maOptionsMisc.SetSolidMarkHdl( pView->IsSolidMarkHdl() );
773 	}
774 	else if( pOpts )
775 	{
776 		maOptionsMisc.SetMarkedHitMovesAlways( pOpts->IsMarkedHitMovesAlways() );
777 		maOptionsMisc.SetMoveOnlyDragging( pOpts->IsMoveOnlyDragging() );
778 		maOptionsMisc.SetCrookNoContortion( pOpts->IsCrookNoContortion() );
779 		maOptionsMisc.SetQuickEdit( pOpts->IsQuickEdit() );
780 		maOptionsMisc.SetMasterPagePaintCaching( pOpts->IsMasterPagePaintCaching() );
781 		maOptionsMisc.SetDragWithCopy( pOpts->IsDragWithCopy() );
782 		maOptionsMisc.SetPickThrough( pOpts->IsPickThrough() );
783 		maOptionsMisc.SetBigHandles( pOpts->IsBigHandles() );
784 		maOptionsMisc.SetDoubleClickTextEdit( pOpts->IsDoubleClickTextEdit() );
785 		maOptionsMisc.SetClickChangeRotation( pOpts->IsClickChangeRotation() );
786 		maOptionsMisc.SetSolidDragging( pOpts->IsSolidDragging() );
787 		maOptionsMisc.SetSolidMarkHdl( pOpts->IsSolidMarkHdl() );
788 	}
789 }
790 
791 // ----------------------------------------------------------------------
792 
793 SfxPoolItem* SdOptionsMiscItem::Clone( SfxItemPool* ) const
794 {
795 	return new SdOptionsMiscItem( *this );
796 }
797 
798 
799 // ----------------------------------------------------------------------
800 
801 int SdOptionsMiscItem::operator==( const SfxPoolItem& rAttr ) const
802 {
803 	const bool bSameType = SfxPoolItem::operator==(rAttr);
804 	DBG_ASSERT( bSameType, "SdOptionsMiscItem::operator==(), differen pool item type!" );
805 	return bSameType && ( maOptionsMisc == static_cast< const SdOptionsMiscItem& >(rAttr).maOptionsMisc );
806 }
807 
808 // -----------------------------------------------------------------------
809 
810 void SdOptionsMiscItem::SetOptions( SdOptions* pOpts ) const
811 {
812 	if( pOpts )
813 	{
814 		pOpts->SetStartWithTemplate( maOptionsMisc.IsStartWithTemplate() );
815 		pOpts->SetMarkedHitMovesAlways( maOptionsMisc.IsMarkedHitMovesAlways() );
816 		pOpts->SetMoveOnlyDragging( maOptionsMisc.IsMoveOnlyDragging() );
817 		pOpts->SetCrookNoContortion( maOptionsMisc.IsCrookNoContortion() );
818 		pOpts->SetQuickEdit( maOptionsMisc.IsQuickEdit() );
819 		pOpts->SetMasterPagePaintCaching( maOptionsMisc.IsMasterPagePaintCaching() );
820 		pOpts->SetDragWithCopy( maOptionsMisc.IsDragWithCopy() );
821 		pOpts->SetPickThrough( maOptionsMisc.IsPickThrough() );
822 		pOpts->SetBigHandles( maOptionsMisc.IsBigHandles() );
823 		pOpts->SetDoubleClickTextEdit( maOptionsMisc.IsDoubleClickTextEdit() );
824 		pOpts->SetClickChangeRotation( maOptionsMisc.IsClickChangeRotation() );
825 		pOpts->SetStartWithActualPage( maOptionsMisc.IsStartWithActualPage() );
826 		pOpts->SetSummationOfParagraphs( maOptionsMisc.IsSummationOfParagraphs() );
827 		pOpts->SetSolidDragging( maOptionsMisc.IsSolidDragging() );
828 		pOpts->SetSolidMarkHdl( maOptionsMisc.IsSolidMarkHdl() );
829 		// #90356#
830 		pOpts->SetShowUndoDeleteWarning( maOptionsMisc.IsShowUndoDeleteWarning() );
831 		pOpts->SetPrinterIndependentLayout( maOptionsMisc.GetPrinterIndependentLayout() );
832 		pOpts->SetShowComments( maOptionsMisc.IsShowComments() );
833 		// #97016#
834 		pOpts->SetDefaultObjectSizeWidth( maOptionsMisc.GetDefaultObjectSizeWidth() );
835 		pOpts->SetDefaultObjectSizeHeight( maOptionsMisc.GetDefaultObjectSizeHeight() );
836 
837 		pOpts->SetPreviewNewEffects( maOptionsMisc.IsPreviewNewEffects() );
838 		pOpts->SetPreviewChangedEffects( maOptionsMisc.IsPreviewChangedEffects() );
839 		pOpts->SetPreviewTransitions( maOptionsMisc.IsPreviewTransitions() );
840 
841 		pOpts->SetDisplay( maOptionsMisc.GetDisplay() );
842 
843 		pOpts->SetPresentationPenColor( maOptionsMisc.GetPresentationPenColor() );
844 		pOpts->SetPresentationPenWidth( maOptionsMisc.GetPresentationPenWidth() );
845 	}
846 }
847 
848 /*************************************************************************
849 |*
850 |* SdOptionsSnap
851 |*
852 \************************************************************************/
853 
854 SdOptionsSnap::SdOptionsSnap( sal_uInt16 nConfigId, sal_Bool bUseConfig ) :
855 	SdOptionsGeneric( nConfigId, bUseConfig ?
856 					  ( ( SDCFG_DRAW == nConfigId ) ?
857 						B2U( "Office.Draw/Snap" ) :
858 						B2U( "Office.Impress/Snap" ) ) :
859 					  OUString() ),
860 	bSnapHelplines( sal_True ),
861 	bSnapBorder( sal_True ),
862 	bSnapFrame( sal_False ),
863 	bSnapPoints( sal_False ),
864 	bOrtho( sal_False ),
865 	bBigOrtho( sal_True ),
866 	bRotate( sal_False ),
867 	nSnapArea( 5 ),
868 	nAngle( 1500 ),
869 	nBezAngle( 1500 )
870 
871 {
872 	EnableModify( sal_True );
873 }
874 
875 // -----------------------------------------------------------------------------
876 
877 sal_Bool SdOptionsSnap::operator==( const SdOptionsSnap& rOpt ) const
878 {
879 	return(	IsSnapHelplines() == rOpt.IsSnapHelplines() &&
880 			IsSnapBorder() == rOpt.IsSnapBorder() &&
881 			IsSnapFrame() == rOpt.IsSnapFrame() &&
882 			IsSnapPoints() == rOpt.IsSnapPoints() &&
883 			IsOrtho() == rOpt.IsOrtho() &&
884 			IsBigOrtho() == rOpt.IsBigOrtho() &&
885 			IsRotate() == rOpt.IsRotate() &&
886 			GetSnapArea() == rOpt.GetSnapArea() &&
887 			GetAngle() == rOpt.GetAngle() &&
888 			GetEliminatePolyPointLimitAngle() == rOpt.GetEliminatePolyPointLimitAngle() );
889 }
890 
891 // -----------------------------------------------------------------------------
892 
893 void SdOptionsSnap::GetPropNameArray( const char**& ppNames, sal_uLong& rCount ) const
894 {
895 	static const char* aPropNames[] =
896 	{
897 		"Object/SnapLine",
898 		"Object/PageMargin",
899 		"Object/ObjectFrame",
900 		"Object/ObjectPoint",
901 		"Position/CreatingMoving",
902 		"Position/ExtendEdges",
903 		"Position/Rotating",
904 		"Object/Range",
905 		"Position/RotatingValue",
906 		"Position/PointReduction"
907 	};
908 
909 	rCount = 10;
910 	ppNames = aPropNames;
911 }
912 
913 // -----------------------------------------------------------------------------
914 
915 sal_Bool SdOptionsSnap::ReadData( const Any* pValues )
916 {
917 	if( pValues[0].hasValue() ) SetSnapHelplines( *(sal_Bool*) pValues[ 0 ].getValue() );
918 	if( pValues[1].hasValue() ) SetSnapBorder( *(sal_Bool*)pValues[ 1 ].getValue() );
919 	if( pValues[2].hasValue() ) SetSnapFrame( *(sal_Bool*) pValues[ 2 ].getValue() );
920 	if( pValues[3].hasValue() ) SetSnapPoints( *(sal_Bool*) pValues[ 3 ].getValue() );
921 	if( pValues[4].hasValue() ) SetOrtho( *(sal_Bool*) pValues[ 4 ].getValue() );
922 	if( pValues[5].hasValue() ) SetBigOrtho( *(sal_Bool*) pValues[ 5 ].getValue() );
923 	if( pValues[6].hasValue() ) SetRotate( *(sal_Bool*) pValues[ 6 ].getValue() );
924 	if( pValues[7].hasValue() ) SetSnapArea( (sal_Int16) *(sal_Int32*) pValues[ 7 ].getValue() );
925 	if( pValues[8].hasValue() ) SetAngle( (sal_Int16) *(sal_Int32*) pValues[ 8 ].getValue() );
926 	if( pValues[9].hasValue() ) SetEliminatePolyPointLimitAngle( (sal_Int16) *(sal_Int32*) pValues[ 9 ].getValue() );
927 
928 	return sal_True;
929 }
930 
931 // -----------------------------------------------------------------------------
932 
933 sal_Bool SdOptionsSnap::WriteData( Any* pValues ) const
934 {
935 	pValues[ 0 ] <<= IsSnapHelplines();
936 	pValues[ 1 ] <<= IsSnapBorder();
937 	pValues[ 2 ] <<= IsSnapFrame();
938 	pValues[ 3 ] <<= IsSnapPoints();
939 	pValues[ 4 ] <<= IsOrtho();
940 	pValues[ 5 ] <<= IsBigOrtho();
941 	pValues[ 6 ] <<= IsRotate();
942 	pValues[ 7 ] <<= (sal_Int32) GetSnapArea();
943 	pValues[ 8 ] <<= (sal_Int32) GetAngle();
944 	pValues[ 9 ] <<= (sal_Int32) GetEliminatePolyPointLimitAngle();
945 
946 	return sal_True;
947 }
948 
949 /*************************************************************************
950 |*
951 |* SdOptionsSnapItem
952 |*
953 \************************************************************************/
954 
955 SdOptionsSnapItem::SdOptionsSnapItem( sal_uInt16 _nWhich )
956 :	SfxPoolItem		( _nWhich )
957 ,	maOptionsSnap	( 0, sal_False )
958 {
959 }
960 
961 // ----------------------------------------------------------------------
962 
963 SdOptionsSnapItem::SdOptionsSnapItem( sal_uInt16 _nWhich, SdOptions* pOpts, ::sd::FrameView* pView )
964 :	SfxPoolItem		( _nWhich )
965 ,	maOptionsSnap	( 0, sal_False )
966 {
967 	if( pView )
968 	{
969 		maOptionsSnap.SetSnapHelplines( pView->IsHlplSnap() );
970 		maOptionsSnap.SetSnapBorder( pView->IsBordSnap() );
971 		maOptionsSnap.SetSnapFrame( pView->IsOFrmSnap() );
972 		maOptionsSnap.SetSnapPoints( pView->IsOPntSnap() );
973 		maOptionsSnap.SetOrtho( pView->IsOrtho() );
974 		maOptionsSnap.SetBigOrtho( pView->IsBigOrtho() );
975 		maOptionsSnap.SetRotate( pView->IsAngleSnapEnabled() );
976 		maOptionsSnap.SetSnapArea( pView->GetSnapMagneticPixel() );
977 		maOptionsSnap.SetAngle( (sal_Int16) pView->GetSnapAngle() );
978 		maOptionsSnap.SetEliminatePolyPointLimitAngle( (sal_Int16) pView->GetEliminatePolyPointLimitAngle() );
979 	}
980 	else if( pOpts )
981 	{
982 		maOptionsSnap.SetSnapHelplines( pOpts->IsSnapHelplines() );
983 		maOptionsSnap.SetSnapBorder( pOpts->IsSnapBorder() );
984 		maOptionsSnap.SetSnapFrame( pOpts->IsSnapFrame() );
985 		maOptionsSnap.SetSnapPoints( pOpts->IsSnapPoints() );
986 		maOptionsSnap.SetOrtho( pOpts->IsOrtho() );
987 		maOptionsSnap.SetBigOrtho( pOpts->IsBigOrtho() );
988 		maOptionsSnap.SetRotate( pOpts->IsRotate() );
989 		maOptionsSnap.SetSnapArea( pOpts->GetSnapArea() );
990 		maOptionsSnap.SetAngle( pOpts->GetAngle() );
991 		maOptionsSnap.SetEliminatePolyPointLimitAngle( pOpts->GetEliminatePolyPointLimitAngle() );
992 	}
993 }
994 
995 // ----------------------------------------------------------------------
996 
997 SfxPoolItem* SdOptionsSnapItem::Clone( SfxItemPool* ) const
998 {
999 	return new SdOptionsSnapItem( *this );
1000 }
1001 
1002 
1003 // ----------------------------------------------------------------------
1004 
1005 int SdOptionsSnapItem::operator==( const SfxPoolItem& rAttr ) const
1006 {
1007 	const bool bSameType = SfxPoolItem::operator==(rAttr);
1008 	DBG_ASSERT( bSameType, "SdOptionsSnapItem::operator==(), differen pool item type!" );
1009 	return bSameType && ( maOptionsSnap == static_cast< const SdOptionsSnapItem& >(rAttr).maOptionsSnap );
1010 }
1011 
1012 // -----------------------------------------------------------------------
1013 
1014 void SdOptionsSnapItem::SetOptions( SdOptions* pOpts ) const
1015 {
1016 	if( pOpts )
1017 	{
1018 		pOpts->SetSnapHelplines( maOptionsSnap.IsSnapHelplines() );
1019 		pOpts->SetSnapBorder( maOptionsSnap.IsSnapBorder() );
1020 		pOpts->SetSnapFrame( maOptionsSnap.IsSnapFrame() );
1021 		pOpts->SetSnapPoints( maOptionsSnap.IsSnapPoints() );
1022 		pOpts->SetOrtho( maOptionsSnap.IsOrtho() );
1023 		pOpts->SetBigOrtho( maOptionsSnap.IsBigOrtho() );
1024 		pOpts->SetRotate( maOptionsSnap.IsRotate() );
1025 		pOpts->SetSnapArea( maOptionsSnap.GetSnapArea() );
1026 		pOpts->SetAngle( maOptionsSnap.GetAngle() );
1027 		pOpts->SetEliminatePolyPointLimitAngle( maOptionsSnap.GetEliminatePolyPointLimitAngle() );
1028 	}
1029 }
1030 
1031 /*************************************************************************
1032 |*
1033 |* SdOptionsZoom
1034 |*
1035 \************************************************************************/
1036 
1037 SdOptionsZoom::SdOptionsZoom( sal_uInt16 nConfigId, sal_Bool bUseConfig ) :
1038 	SdOptionsGeneric( nConfigId, ( bUseConfig &&  ( SDCFG_DRAW == nConfigId ) ) ?
1039 								 B2U( "Office.Draw/Zoom" ) :
1040 							     OUString() ),
1041 	nX( 1 ),
1042     nY( 1 )
1043 
1044 {
1045 	EnableModify( sal_True );
1046 }
1047 
1048 // -----------------------------------------------------------------------------
1049 
1050 sal_Bool SdOptionsZoom::operator==( const SdOptionsZoom& rOpt ) const
1051 {
1052 	sal_Int32 nX1, nX2, nY1, nY2;
1053 
1054 	GetScale( nX1, nY1 );
1055 	rOpt.GetScale( nX2, nY2 );
1056 
1057 	return( ( nX1 == nX2 ) &&
1058 			( nY1 == nY2 ) );
1059 }
1060 
1061 // -----------------------------------------------------------------------------
1062 
1063 void SdOptionsZoom::GetPropNameArray( const char**& ppNames, sal_uLong& rCount ) const
1064 {
1065 	static const char* aPropNames[] =
1066 	{
1067 		"ScaleX",
1068 		"ScaleY"
1069 	};
1070 
1071 	rCount = ( GetConfigId() == SDCFG_DRAW ) ? 2 : 0;
1072 	ppNames = aPropNames;
1073 }
1074 
1075 // -----------------------------------------------------------------------------
1076 
1077 sal_Bool SdOptionsZoom::ReadData( const Any* pValues )
1078 {
1079 	sal_Int32 x = 1, y = 1;
1080 
1081 	if( pValues[0].hasValue() ) x = ( *(sal_Int32*) pValues[ 0 ].getValue() );
1082 	if( pValues[1].hasValue() ) y = ( *(sal_Int32*) pValues[ 1 ].getValue() );
1083 
1084 	SetScale( x, y );
1085 
1086 	return sal_True;
1087 }
1088 
1089 // -----------------------------------------------------------------------------
1090 
1091 sal_Bool SdOptionsZoom::WriteData( Any* pValues ) const
1092 {
1093 	sal_Int32 x, y;
1094 
1095 	GetScale( x, y );
1096 
1097 	pValues[ 0 ] <<= (sal_Int32) x;
1098 	pValues[ 1 ] <<= (sal_Int32) y;
1099 
1100 	return sal_True;
1101 }
1102 
1103 /*************************************************************************
1104 |*
1105 |* SdOptionsGrid
1106 |*
1107 \************************************************************************/
1108 
1109 SdOptionsGrid::SdOptionsGrid( sal_uInt16 nConfigId, sal_Bool bUseConfig ) :
1110 	SdOptionsGeneric( nConfigId, bUseConfig ?
1111 					  ( ( SDCFG_DRAW == nConfigId ) ?
1112 						B2U( "Office.Draw/Grid" ) :
1113 						B2U( "Office.Impress/Grid" ) ) :
1114 					  OUString() )
1115 {
1116 	EnableModify( sal_False );
1117 	SetDefaults();
1118 	EnableModify( sal_True );
1119 }
1120 
1121 // -----------------------------------------------------------------------------
1122 
1123 SdOptionsGrid::~SdOptionsGrid()
1124 {
1125 }
1126 
1127 // -----------------------------------------------------------------------------
1128 
1129 void SdOptionsGrid::SetDefaults()
1130 {
1131 	const sal_uInt32 nVal = 1000;
1132 
1133 	SetFldDivisionX( nVal );
1134 	SetFldDivisionY( nVal );
1135 	SetFldDrawX( nVal );
1136 	SetFldDrawY( nVal );
1137 	SetFldSnapX( nVal );
1138 	SetFldSnapY( nVal );
1139 	SetUseGridSnap( sal_False );
1140 	SetSynchronize( sal_True );
1141 	SetGridVisible( sal_False );
1142 	SetEqualGrid( sal_True );
1143 }
1144 
1145 // -----------------------------------------------------------------------------
1146 
1147 sal_Bool SdOptionsGrid::operator==( const SdOptionsGrid& rOpt ) const
1148 {
1149 	return(	GetFldDrawX() == rOpt.GetFldDrawX() &&
1150 			GetFldDivisionX() == rOpt.GetFldDivisionX() &&
1151 			GetFldDrawY() == rOpt.GetFldDrawY() &&
1152 			GetFldDivisionY() == rOpt.GetFldDivisionY() &&
1153 			GetFldSnapX() == rOpt.GetFldSnapX() &&
1154 			GetFldSnapY() == rOpt.GetFldSnapY() &&
1155 			IsUseGridSnap() == rOpt.IsUseGridSnap() &&
1156 			IsSynchronize() == rOpt.IsSynchronize() &&
1157 			IsGridVisible() == rOpt.IsGridVisible() &&
1158 			IsEqualGrid() == rOpt.IsEqualGrid() );
1159 }
1160 
1161 // -----------------------------------------------------------------------------
1162 
1163 void SdOptionsGrid::GetPropNameArray( const char**& ppNames, sal_uLong& rCount ) const
1164 {
1165 	static const char* aPropNamesMetric[] =
1166 	{
1167 		"Resolution/XAxis/Metric",
1168 		"Resolution/YAxis/Metric",
1169 		"Subdivision/XAxis",
1170 		"Subdivision/YAxis",
1171 		"SnapGrid/XAxis/Metric",
1172 		"SnapGrid/YAxis/Metric",
1173 		"Option/SnapToGrid",
1174 		"Option/Synchronize",
1175 		"Option/VisibleGrid",
1176 		"SnapGrid/Size"
1177 	};
1178 
1179 	static const char* aPropNamesNonMetric[] =
1180 	{
1181 		"Resolution/XAxis/NonMetric",
1182 		"Resolution/YAxis/NonMetric",
1183 		"Subdivision/XAxis",
1184 		"Subdivision/YAxis",
1185 		"SnapGrid/XAxis/NonMetric",
1186 		"SnapGrid/YAxis/NonMetric",
1187 		"Option/SnapToGrid",
1188 		"Option/Synchronize",
1189 		"Option/VisibleGrid",
1190 		"SnapGrid/Size"
1191 	};
1192 
1193 	rCount = 10;
1194 
1195 	if( isMetricSystem() )
1196 		ppNames = aPropNamesMetric;
1197 	else
1198 		ppNames = aPropNamesNonMetric;
1199 }
1200 
1201 // -----------------------------------------------------------------------------
1202 
1203 sal_Bool SdOptionsGrid::ReadData( const Any* pValues )
1204 {
1205 	if( pValues[0].hasValue() ) SetFldDrawX( *(sal_Int32*) pValues[ 0 ].getValue() );
1206 	if( pValues[1].hasValue() ) SetFldDrawY( *(sal_Int32*) pValues[ 1 ].getValue() );
1207 
1208 	if( pValues[2].hasValue() )
1209 	{
1210 		const sal_uInt32 nDivX = FRound( *(double*) pValues[ 2 ].getValue() );
1211 		SetFldDivisionX( SvxOptionsGrid::GetFldDrawX() / ( nDivX + 1 ) );
1212 	}
1213 
1214 	if( pValues[3].hasValue() )
1215 	{
1216 		const sal_uInt32 nDivY = FRound( *(double*) pValues[ 3 ].getValue() );
1217 		SetFldDivisionY( SvxOptionsGrid::GetFldDrawY() / ( nDivY + 1 ) );
1218 	}
1219 
1220 	if( pValues[4].hasValue() ) SetFldSnapX( *(sal_Int32*) pValues[ 4 ].getValue() );
1221 	if( pValues[5].hasValue() ) SetFldSnapY( *(sal_Int32*) pValues[ 5 ].getValue() );
1222 	if( pValues[6].hasValue() ) SetUseGridSnap( *(sal_Bool*) pValues[ 6 ].getValue() );
1223 	if( pValues[7].hasValue() ) SetSynchronize( *(sal_Bool*) pValues[ 7 ].getValue() );
1224 	if( pValues[8].hasValue() ) SetGridVisible( *(sal_Bool*) pValues[ 8 ].getValue() );
1225 	if( pValues[9].hasValue() ) SetEqualGrid( *(sal_Bool*) pValues[ 9 ].getValue() );
1226 
1227 	return sal_True;
1228 }
1229 
1230 // -----------------------------------------------------------------------------
1231 
1232 sal_Bool SdOptionsGrid::WriteData( Any* pValues ) const
1233 {
1234 	pValues[ 0 ] <<= (sal_Int32) GetFldDrawX();
1235 	pValues[ 1 ] <<= (sal_Int32) GetFldDrawY();
1236 	pValues[ 2 ] <<= ( GetFldDivisionX() ? ( (double) GetFldDrawX() / GetFldDivisionX() - 1.0 ) : (double) 0 );
1237 	pValues[ 3 ] <<= ( GetFldDivisionY() ? ( (double) GetFldDrawY() / GetFldDivisionY() - 1.0 ) : (double) 0 );
1238 	pValues[ 4 ] <<= (sal_Int32) GetFldSnapX();
1239 	pValues[ 5 ] <<= (sal_Int32) GetFldSnapY();
1240 	pValues[ 6 ] <<= IsUseGridSnap();
1241 	pValues[ 7 ] <<= IsSynchronize();
1242 	pValues[ 8 ] <<= IsGridVisible();
1243 	pValues[ 9 ] <<= IsEqualGrid();
1244 
1245 	return sal_True;
1246 }
1247 
1248 /*************************************************************************
1249 |*
1250 |* SdOptionsGridItem
1251 |*
1252 \************************************************************************/
1253 
1254 SdOptionsGridItem::SdOptionsGridItem( sal_uInt16 _nWhich, SdOptions* pOpts, ::sd::FrameView* pView ) :
1255 	SvxGridItem( _nWhich )
1256 {
1257 	SetSynchronize( pOpts->IsSynchronize() );
1258 	SetEqualGrid( pOpts->IsEqualGrid() );
1259 
1260 	if( pView )
1261 	{
1262 		SetFldDrawX( pView->GetGridCoarse().Width() );
1263 		SetFldDrawY( pView->GetGridCoarse().Height() );
1264 		SetFldDivisionX( pView->GetGridFine().Width() ? ( GetFldDrawX() / pView->GetGridFine().Width() - 1 ) : 0 );
1265 		SetFldDivisionY( pView->GetGridFine().Height() ? ( GetFldDrawY() / pView->GetGridFine().Height() - 1 ) : 0 );
1266 		SetFldSnapX( long(pView->GetSnapGridWidthX()) );
1267 		SetFldSnapY( long(pView->GetSnapGridWidthY()) );
1268 		SetUseGridSnap( pView->IsGridSnap() );
1269 		SetGridVisible( pView->IsGridVisible() );
1270 	}
1271 	else
1272 	{
1273 		SetFldDrawX( pOpts->GetFldDrawX() );
1274 		SetFldDrawY( pOpts->GetFldDrawY() );
1275 		SetFldDivisionX( pOpts->GetFldDivisionX() ? ( pOpts->GetFldDrawX() / pOpts->GetFldDivisionX() - 1 ) : 0 );
1276 		SetFldDivisionY( pOpts->GetFldDivisionY() ? ( pOpts->GetFldDrawY() / pOpts->GetFldDivisionY() - 1 ) : 0 );
1277 		SetFldSnapX( pOpts->GetFldSnapX() );
1278 		SetFldSnapY( pOpts->GetFldSnapY() );
1279 		SetUseGridSnap( pOpts->IsUseGridSnap() );
1280 		SetGridVisible( pOpts->IsGridVisible() );
1281 	}
1282 }
1283 
1284 // -----------------------------------------------------------------------
1285 
1286 void SdOptionsGridItem::SetOptions( SdOptions* pOpts ) const
1287 {
1288 	pOpts->SetFldDrawX( GetFldDrawX() );
1289 	pOpts->SetFldDivisionX( GetFldDrawX() / ( GetFldDivisionX() + 1 ) );
1290 	pOpts->SetFldDrawY( GetFldDrawY() );
1291 	pOpts->SetFldDivisionY( GetFldDrawY() / ( GetFldDivisionY() + 1 ) );
1292 	pOpts->SetFldSnapX( GetFldSnapX() );
1293 	pOpts->SetFldSnapY( GetFldSnapY() );
1294 	pOpts->SetUseGridSnap( GetUseGridSnap() );
1295 	pOpts->SetSynchronize( GetSynchronize() );
1296 	pOpts->SetGridVisible( GetGridVisible() );
1297 	pOpts->SetEqualGrid( GetEqualGrid() );
1298 }
1299 
1300 /*************************************************************************
1301 |*
1302 |* SdOptionsPrint
1303 |*
1304 \************************************************************************/
1305 
1306 SdOptionsPrint::SdOptionsPrint( sal_uInt16 nConfigId, sal_Bool bUseConfig ) :
1307 	SdOptionsGeneric( nConfigId, bUseConfig ?
1308 					  ( ( SDCFG_DRAW == nConfigId ) ?
1309 						B2U( "Office.Draw/Print" ) :
1310 						B2U( "Office.Impress/Print" ) ) :
1311 					  OUString() ),
1312 	bDraw( sal_True ),
1313 	bNotes( sal_False ),
1314 	bHandout( sal_False ),
1315 	bOutline( sal_False ),
1316 	bDate( sal_False ),
1317 	bTime( sal_False ),
1318 	bPagename( sal_False ),
1319 	bHiddenPages( sal_True ),
1320 	bPagesize( sal_False ),
1321 	bPagetile( sal_False ),
1322 	bWarningPrinter( sal_True ),
1323 	bWarningSize( sal_False ),
1324 	bWarningOrientation( sal_False ),
1325 	bBooklet( sal_False ),
1326 	bFront( sal_True ),
1327 	bBack( sal_True ),
1328 	bCutPage( sal_False ),
1329 	bPaperbin( sal_False ),
1330 	mbHandoutHorizontal( sal_True ),
1331 	mnHandoutPages( 6 ),
1332 	nQuality( 0 )
1333 {
1334 	EnableModify( sal_True );
1335 }
1336 
1337 // -----------------------------------------------------------------------------
1338 
1339 sal_Bool SdOptionsPrint::operator==( const SdOptionsPrint& rOpt ) const
1340 {
1341 	return( IsDraw() == rOpt.IsDraw() &&
1342 			IsNotes() == rOpt.IsNotes() &&
1343 			IsHandout() == rOpt.IsHandout() &&
1344 			IsOutline() == rOpt.IsOutline() &&
1345 			IsDate() == rOpt.IsDate() &&
1346 			IsTime() == rOpt.IsTime() &&
1347 			IsPagename() == rOpt.IsPagename() &&
1348 			IsHiddenPages() == rOpt.IsHiddenPages() &&
1349 			IsPagesize() == rOpt.IsPagesize() &&
1350 			IsPagetile() == rOpt.IsPagetile() &&
1351 			IsWarningPrinter() == rOpt.IsWarningPrinter() &&
1352 			IsWarningSize() == rOpt.IsWarningSize() &&
1353 			IsWarningOrientation() == rOpt.IsWarningOrientation() &&
1354 			IsBooklet() == rOpt.IsBooklet() &&
1355 			IsFrontPage() == rOpt.IsFrontPage() &&
1356 			IsBackPage() == rOpt.IsBackPage() &&
1357 			IsCutPage() == rOpt.IsCutPage() &&
1358 			IsPaperbin() == rOpt.IsPaperbin() &&
1359 			GetOutputQuality() == rOpt.GetOutputQuality() &&
1360 			IsHandoutHorizontal() == rOpt.IsHandoutHorizontal() &&
1361 			GetHandoutPages() == rOpt.GetHandoutPages() );
1362 }
1363 
1364 // -----------------------------------------------------------------------------
1365 
1366 void SdOptionsPrint::GetPropNameArray( const char**& ppNames, sal_uLong& rCount ) const
1367 {
1368 	static const char* aDrawPropNames[] =
1369 	{
1370 		"Other/Date",
1371 		"Other/Time",
1372 		"Other/PageName",
1373 		"Other/HiddenPage",
1374 		"Page/PageSize",
1375 		"Page/PageTile",
1376 		// bWarningPrinter
1377 		// bWarningSize
1378 		// bWarningOrientation
1379 		"Page/Booklet",
1380 		"Page/BookletFront",
1381 		"Page/BookletBack",
1382 		// bCutPage
1383 		"Other/FromPrinterSetup",
1384 		"Other/Quality",
1385 		"Content/Drawing",
1386 	};
1387 	static const char* aImpressPropNames[] =
1388 	{
1389 		"Other/Date",
1390 		"Other/Time",
1391 		"Other/PageName",
1392 		"Other/HiddenPage",
1393 		"Page/PageSize",
1394 		"Page/PageTile",
1395 		// bWarningPrinter
1396 		// bWarningSize
1397 		// bWarningOrientation
1398 		"Page/Booklet",
1399 		"Page/BookletFront",
1400 		"Page/BookletBack",
1401 		// bCutPage
1402 		"Other/FromPrinterSetup",
1403 		"Other/Quality",
1404 		"Content/Presentation",
1405 		"Content/Note",
1406 		"Content/Handout",
1407 		"Content/Outline",
1408 		"Other/HandoutHorizontal",
1409 		"Other/PagesPerHandout"
1410 	};
1411 
1412 	if( GetConfigId() == SDCFG_IMPRESS )
1413 	{
1414 		rCount = 17;
1415 		ppNames = aImpressPropNames;
1416 	}
1417 	else
1418 	{
1419 		rCount = 12;
1420 		ppNames = aDrawPropNames;
1421 	}
1422 }
1423 
1424 // -----------------------------------------------------------------------------
1425 
1426 sal_Bool SdOptionsPrint::ReadData( const Any* pValues )
1427 {
1428 	if( pValues[0].hasValue() ) SetDate( *(sal_Bool*) pValues[ 0 ].getValue() );
1429 	if( pValues[1].hasValue() ) SetTime( *(sal_Bool*) pValues[ 1 ].getValue() );
1430 	if( pValues[2].hasValue() ) SetPagename( *(sal_Bool*) pValues[ 2 ].getValue() );
1431 	if( pValues[3].hasValue() ) SetHiddenPages( *(sal_Bool*) pValues[ 3 ].getValue() );
1432 	if( pValues[4].hasValue() ) SetPagesize( *(sal_Bool*) pValues[ 4 ].getValue() );
1433 	if( pValues[5].hasValue() ) SetPagetile( *(sal_Bool*) pValues[ 5 ].getValue() );
1434 	if( pValues[6].hasValue() ) SetBooklet( *(sal_Bool*) pValues[ 6 ].getValue() );
1435 	if( pValues[7].hasValue() ) SetFrontPage( *(sal_Bool*) pValues[ 7 ].getValue() );
1436 	if( pValues[8].hasValue() ) SetBackPage( *(sal_Bool*) pValues[ 8 ].getValue() );
1437 	if( pValues[9].hasValue() ) SetPaperbin( *(sal_Bool*) pValues[ 9 ].getValue() );
1438 	if( pValues[10].hasValue() ) SetOutputQuality( (sal_uInt16) *(sal_Int32*) pValues[ 10 ].getValue() );
1439 	if( pValues[11].hasValue() ) SetDraw( *(sal_Bool*) pValues[ 11 ].getValue() );
1440 
1441 	// just for impress
1442 	if( GetConfigId() == SDCFG_IMPRESS )
1443 	{
1444 		if( pValues[12].hasValue() ) SetNotes( *(sal_Bool*) pValues[ 12 ].getValue() );
1445 		if( pValues[13].hasValue() ) SetHandout( *(sal_Bool*) pValues[ 13 ].getValue() );
1446 		if( pValues[14].hasValue() ) SetOutline( *(sal_Bool*) pValues[ 14 ].getValue() );
1447 		if( pValues[15].hasValue() ) SetHandoutHorizontal( *(sal_Bool*) pValues[15].getValue() );
1448 		if( pValues[16].hasValue() ) SetHandoutPages( (sal_uInt16)*(sal_Int32*) pValues[16].getValue() );
1449 	}
1450 
1451 	return sal_True;
1452 }
1453 
1454 // -----------------------------------------------------------------------------
1455 
1456 sal_Bool SdOptionsPrint::WriteData( Any* pValues ) const
1457 {
1458 	pValues[ 0 ] <<= IsDate();
1459 	pValues[ 1 ] <<= IsTime();
1460 	pValues[ 2 ] <<= IsPagename();
1461 	pValues[ 3 ] <<= IsHiddenPages();
1462 	pValues[ 4 ] <<= IsPagesize();
1463 	pValues[ 5 ] <<= IsPagetile();
1464 	pValues[ 6 ] <<= IsBooklet();
1465 	pValues[ 7 ] <<= IsFrontPage();
1466 	pValues[ 8 ] <<= IsBackPage();
1467 	pValues[ 9 ] <<= IsPaperbin();
1468 	pValues[ 10 ] <<= (sal_Int32) GetOutputQuality();
1469 	pValues[ 11 ] <<= IsDraw();
1470 
1471 	// just for impress
1472 	if( GetConfigId() == SDCFG_IMPRESS )
1473 	{
1474 		pValues[ 12 ] <<= IsNotes();
1475 		pValues[ 13 ] <<= IsHandout();
1476 		pValues[ 14 ] <<= IsOutline();
1477 		pValues[ 15 ] <<= IsHandoutHorizontal();
1478 		pValues[ 16 ] <<= GetHandoutPages();
1479 	}
1480 
1481 	return sal_True;
1482 }
1483 
1484 /*************************************************************************
1485 |*
1486 |* SdOptionsPrintItem
1487 |*
1488 \************************************************************************/
1489 
1490 SdOptionsPrintItem::SdOptionsPrintItem( sal_uInt16 _nWhich )
1491 :	SfxPoolItem		( _nWhich )
1492 ,	maOptionsPrint	( 0, sal_False )
1493 {
1494 }
1495 
1496 // ----------------------------------------------------------------------
1497 
1498 SdOptionsPrintItem::SdOptionsPrintItem( sal_uInt16 _nWhich, SdOptions* pOpts, ::sd::FrameView* )
1499 :	SfxPoolItem		( _nWhich )
1500 ,	maOptionsPrint	( 0, sal_False )
1501 {
1502 	if( pOpts )
1503 	{
1504 		maOptionsPrint.SetDraw( pOpts->IsDraw() );
1505 		maOptionsPrint.SetNotes( pOpts->IsNotes() );
1506 		maOptionsPrint.SetHandout( pOpts->IsHandout() );
1507 		maOptionsPrint.SetOutline( pOpts->IsOutline() );
1508 		maOptionsPrint.SetDate( pOpts->IsDate() );
1509 		maOptionsPrint.SetTime( pOpts->IsTime() );
1510 		maOptionsPrint.SetPagename( pOpts->IsPagename() );
1511 		maOptionsPrint.SetHiddenPages( pOpts->IsHiddenPages() );
1512 		maOptionsPrint.SetPagesize( pOpts->IsPagesize() );
1513 		maOptionsPrint.SetPagetile( pOpts->IsPagetile() );
1514 		maOptionsPrint.SetWarningPrinter( pOpts->IsWarningPrinter() );
1515 		maOptionsPrint.SetWarningSize( pOpts->IsWarningSize() );
1516 		maOptionsPrint.SetWarningOrientation( pOpts->IsWarningOrientation() );
1517 		maOptionsPrint.SetBooklet( pOpts->IsBooklet() );
1518 		maOptionsPrint.SetFrontPage( pOpts->IsFrontPage() );
1519 		maOptionsPrint.SetBackPage( pOpts->IsBackPage() );
1520 		maOptionsPrint.SetCutPage( pOpts->IsCutPage() );
1521 		maOptionsPrint.SetPaperbin( pOpts->IsPaperbin() );
1522 		maOptionsPrint.SetOutputQuality( pOpts->GetOutputQuality() );
1523 	}
1524 }
1525 
1526 // ----------------------------------------------------------------------
1527 
1528 SfxPoolItem* SdOptionsPrintItem::Clone( SfxItemPool* ) const
1529 {
1530 	return new SdOptionsPrintItem( *this );
1531 }
1532 
1533 // ----------------------------------------------------------------------
1534 
1535 int SdOptionsPrintItem::operator==( const SfxPoolItem& rAttr ) const
1536 {
1537 	const bool bSameType = SfxPoolItem::operator==(rAttr);
1538 	DBG_ASSERT( bSameType, "SdOptionsPrintItem::operator==(), differen pool item type!" );
1539 	return bSameType && ( maOptionsPrint == static_cast< const SdOptionsPrintItem& >( rAttr ).maOptionsPrint );
1540 }
1541 
1542 // -----------------------------------------------------------------------
1543 
1544 void SdOptionsPrintItem::SetOptions( SdOptions* pOpts ) const
1545 {
1546 	if( pOpts )
1547 	{
1548 		pOpts->SetDraw( maOptionsPrint.IsDraw() );
1549 		pOpts->SetNotes( maOptionsPrint.IsNotes() );
1550 		pOpts->SetHandout( maOptionsPrint.IsHandout() );
1551 		pOpts->SetOutline( maOptionsPrint.IsOutline() );
1552 		pOpts->SetDate( maOptionsPrint.IsDate() );
1553 		pOpts->SetTime( maOptionsPrint.IsTime() );
1554 		pOpts->SetPagename( maOptionsPrint.IsPagename() );
1555 		pOpts->SetHiddenPages( maOptionsPrint.IsHiddenPages() );
1556 		pOpts->SetPagesize( maOptionsPrint.IsPagesize() );
1557 		pOpts->SetPagetile( maOptionsPrint.IsPagetile() );
1558 		pOpts->SetWarningPrinter( maOptionsPrint.IsWarningPrinter() );
1559 		pOpts->SetWarningSize( maOptionsPrint.IsWarningSize() );
1560 		pOpts->SetWarningOrientation( maOptionsPrint.IsWarningOrientation() );
1561 		pOpts->SetBooklet( maOptionsPrint.IsBooklet() );
1562 		pOpts->SetFrontPage( maOptionsPrint.IsFrontPage() );
1563 		pOpts->SetBackPage( maOptionsPrint.IsBackPage() );
1564 		pOpts->SetCutPage( maOptionsPrint.IsCutPage() );
1565 		pOpts->SetPaperbin( maOptionsPrint.IsPaperbin() );
1566 		pOpts->SetOutputQuality( maOptionsPrint.GetOutputQuality() );
1567 	}
1568 }
1569 
1570 /*************************************************************************
1571 |*
1572 |* SdOptions
1573 |*
1574 \************************************************************************/
1575 
1576 SdOptions::SdOptions( sal_uInt16 nConfigId ) :
1577 	SdOptionsLayout( nConfigId, sal_True ),
1578 	SdOptionsContents( nConfigId, sal_True ),
1579 	SdOptionsMisc( nConfigId, sal_True ),
1580 	SdOptionsSnap( nConfigId, sal_True ),
1581 	SdOptionsZoom( nConfigId, sal_True ),
1582 	SdOptionsGrid( nConfigId, sal_True ),
1583 	SdOptionsPrint( nConfigId, sal_True )
1584 {
1585 }
1586 
1587 // ----------------------------------------------------------------------
1588 
1589 SdOptions::~SdOptions()
1590 {
1591 }
1592 
1593 // ----------------------------------------------------------------------
1594 
1595 void SdOptions::StoreConfig( sal_uLong nOptionsRange )
1596 {
1597 	if( nOptionsRange & SD_OPTIONS_LAYOUT )
1598 		SdOptionsLayout::Store();
1599 
1600 	if( nOptionsRange & SD_OPTIONS_CONTENTS )
1601 		SdOptionsContents::Store();
1602 
1603 	if( nOptionsRange & SD_OPTIONS_MISC )
1604 		SdOptionsMisc::Store();
1605 
1606 	if( nOptionsRange & SD_OPTIONS_SNAP )
1607 		SdOptionsSnap::Store();
1608 
1609 	if( nOptionsRange & SD_OPTIONS_ZOOM )
1610 		SdOptionsZoom::Store();
1611 
1612 	if( nOptionsRange & SD_OPTIONS_GRID )
1613 		SdOptionsGrid::Store();
1614 
1615 	if( nOptionsRange & SD_OPTIONS_PRINT )
1616 		SdOptionsPrint::Store();
1617 }
1618