Update ooo320-m1
[ooovba.git] / sd / source / ui / app / optsitem.cxx
blob7a905a5885ab3fec96632856a62f2f84974196d5
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: optsitem.cxx,v $
10 * $Revision: 1.43 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_sd.hxx"
33 #include <svx/svdmodel.hxx>
34 #include <sfx2/app.hxx>
35 #include <sfx2/sfx.hrc>
36 #ifndef _SV_SALBTYPE_HRC //autogen
37 #include <vcl/salbtype.hxx>
38 #endif
39 #include <svtools/syslocale.hxx>
41 #include "app.hxx"
42 #include "optsitem.hxx"
43 #include "cfgids.hxx"
44 #include "FrameView.hxx"
46 using namespace ::rtl;
47 using namespace ::utl;
48 using namespace ::com::sun::star::uno;
50 #define B2U(_def_aStr) (OUString::createFromAscii(_def_aStr))
53 // -----------------
54 // - SdOptionsItem -
55 // -----------------
57 SdOptionsItem::SdOptionsItem( const SdOptionsGeneric& rParent, const OUString rSubTree ) :
58 ConfigItem ( rSubTree ),
59 mrParent ( rParent )
63 // -----------------------------------------------------------------------------
65 SdOptionsItem::~SdOptionsItem()
69 // -----------------------------------------------------------------------------
71 void SdOptionsItem::Commit()
73 if( IsModified() )
74 mrParent.Commit( *this );
77 // -----------------------------------------------------------------------------
79 Sequence< Any > SdOptionsItem::GetProperties( const Sequence< OUString >& rNames )
81 return ConfigItem::GetProperties( rNames );
84 // -----------------------------------------------------------------------------
86 sal_Bool SdOptionsItem::PutProperties( const Sequence< OUString >& rNames, const Sequence< Any>& rValues )
88 return ConfigItem::PutProperties( rNames, rValues );
91 // -----------------------------------------------------------------------------
93 void SdOptionsItem::SetModified()
95 ConfigItem::SetModified();
98 // --------------------
99 // - SdOptionsGeneric -
100 // --------------------
102 SdOptionsGeneric::SdOptionsGeneric( USHORT nConfigId, const OUString& rSubTree ) :
103 maSubTree ( rSubTree ),
104 mpCfgItem ( NULL ),
105 mnConfigId ( nConfigId ),
106 mbInit ( rSubTree.getLength() == 0 )
110 // -----------------------------------------------------------------------------
112 void SdOptionsGeneric::Init() const
114 if( !mbInit )
116 SdOptionsGeneric* pThis = const_cast<SdOptionsGeneric*>(this);
118 if( !mpCfgItem )
119 pThis->mpCfgItem = new SdOptionsItem( *this, maSubTree );
121 const Sequence< OUString > aNames( GetPropertyNames() );
122 const Sequence< Any > aValues = mpCfgItem->GetProperties( aNames );
124 if( aNames.getLength() && ( aValues.getLength() == aNames.getLength() ) )
126 const Any* pValues = aValues.getConstArray();
128 pThis->EnableModify( FALSE );
129 pThis->mbInit = pThis->ReadData( pValues );
130 pThis->EnableModify( TRUE );
132 else
133 pThis->mbInit = TRUE;
137 // -----------------------------------------------------------------------------
139 SdOptionsGeneric::~SdOptionsGeneric()
141 if( mpCfgItem )
142 delete mpCfgItem;
145 // -----------------------------------------------------------------------------
147 void SdOptionsGeneric::Commit( SdOptionsItem& rCfgItem ) const
149 const Sequence< OUString > aNames( GetPropertyNames() );
150 Sequence< Any > aValues( aNames.getLength() );
152 if( aNames.getLength() && ( aValues.getLength() == aNames.getLength() ) )
154 if( (const_cast<SdOptionsGeneric*>(this))->WriteData( aValues.getArray() ) )
155 rCfgItem.PutProperties( aNames, aValues );
156 else
158 DBG_ERROR( "PutProperties failed" );
163 // -----------------------------------------------------------------------------
165 Sequence< OUString > SdOptionsGeneric::GetPropertyNames() const
167 ULONG nCount;
168 const char** ppPropNames;
170 GetPropNameArray( ppPropNames, nCount );
172 Sequence< OUString > aNames( nCount );
173 OUString* pNames = aNames.getArray();
175 for( ULONG i = 0; i < nCount; i++ )
176 pNames[ i ] = OUString::createFromAscii( ppPropNames[ i ] );
178 return aNames;
181 // -----------------------------------------------------------------------------
183 void SdOptionsGeneric::Store()
185 if( mpCfgItem )
186 mpCfgItem->Commit();
189 // -----------------------------------------------------------------------------
191 bool SdOptionsGeneric::isMetricSystem()
193 SvtSysLocale aSysLocale;
194 MeasurementSystem eSys = aSysLocale.GetLocaleDataPtr()->getMeasurementSystemEnum();
196 return ( eSys == MEASURE_METRIC );
199 /*************************************************************************
201 |* SdOptionsLayout
203 \************************************************************************/
205 SdOptionsLayout::SdOptionsLayout( USHORT nConfigId, BOOL bUseConfig ) :
206 SdOptionsGeneric( nConfigId, bUseConfig ?
207 ( ( SDCFG_DRAW == nConfigId ) ?
208 B2U( "Office.Draw/Layout" ) :
209 B2U( "Office.Impress/Layout" ) ) :
210 OUString() ),
211 bRuler( TRUE ),
212 bMoveOutline( TRUE ),
213 bDragStripes( FALSE ),
214 bHandlesBezier( FALSE ),
215 bHelplines( TRUE ),
216 nMetric((UINT16)(isMetricSystem() ? FUNIT_CM : FUNIT_INCH)),
217 nDefTab( 1250 )
219 EnableModify( TRUE );
222 // -----------------------------------------------------------------------------
224 void SdOptionsLayout::SetDefaults()
226 SetRulerVisible( TRUE );
227 SetHelplines( TRUE );
228 SetHandlesBezier( FALSE );
229 SetMoveOutline( TRUE );
230 SetDragStripes( FALSE );
231 if ( isMetricSystem() )
232 SetMetric( FUNIT_CM ); // default for countries with metric system
233 else
234 SetMetric( FUNIT_INCH ); // default for others
235 SetDefTab( 1250 );
238 // -----------------------------------------------------------------------------
240 BOOL SdOptionsLayout::operator==( const SdOptionsLayout& rOpt ) const
242 return( IsRulerVisible() == rOpt.IsRulerVisible() &&
243 IsMoveOutline() == rOpt.IsMoveOutline() &&
244 IsDragStripes() == rOpt.IsDragStripes() &&
245 IsHandlesBezier() == rOpt.IsHandlesBezier() &&
246 IsHelplines() == rOpt.IsHelplines() &&
247 GetMetric() == rOpt.GetMetric() &&
248 GetDefTab() == rOpt.GetDefTab() );
251 // -----------------------------------------------------------------------------
253 void SdOptionsLayout::GetPropNameArray( const char**& ppNames, ULONG& rCount ) const
255 static const char* aPropNamesMetric[] =
257 "Display/Ruler",
258 "Display/Bezier",
259 "Display/Contour",
260 "Display/Guide",
261 "Display/Helpline",
262 "Other/MeasureUnit/Metric",
263 "Other/TabStop/Metric"
266 static const char* aPropNamesNonMetric[] =
268 "Display/Ruler",
269 "Display/Bezier",
270 "Display/Contour",
271 "Display/Guide",
272 "Display/Helpline",
273 "Other/MeasureUnit/NonMetric",
274 "Other/TabStop/NonMetric"
277 rCount = 7;
279 if( isMetricSystem() )
280 ppNames = aPropNamesMetric;
281 else
282 ppNames = aPropNamesNonMetric;
285 // -----------------------------------------------------------------------------
287 BOOL SdOptionsLayout::ReadData( const Any* pValues )
289 if( pValues[0].hasValue() ) SetRulerVisible( *(sal_Bool*) pValues[ 0 ].getValue() );
290 if( pValues[1].hasValue() ) SetHandlesBezier( *(sal_Bool*) pValues[ 1 ].getValue() );
291 if( pValues[2].hasValue() ) SetMoveOutline( *(sal_Bool*) pValues[ 2 ].getValue() );
292 if( pValues[3].hasValue() ) SetDragStripes( *(sal_Bool*) pValues[ 3 ].getValue() );
293 if( pValues[4].hasValue() ) SetHelplines( *(sal_Bool*) pValues[ 4 ].getValue() );
294 if( pValues[5].hasValue() ) SetMetric( (UINT16) *(sal_Int32*) pValues[ 5 ].getValue() );
295 if( pValues[6].hasValue() ) SetDefTab( (UINT16) *(sal_Int32*) pValues[ 6 ].getValue() );
297 return TRUE;
300 // -----------------------------------------------------------------------------
302 BOOL SdOptionsLayout::WriteData( Any* pValues ) const
304 pValues[ 0 ] <<= IsRulerVisible();
305 pValues[ 1 ] <<= IsHandlesBezier();
306 pValues[ 2 ] <<= IsMoveOutline();
307 pValues[ 3 ] <<= IsDragStripes();
308 pValues[ 4 ] <<= IsHelplines();
309 pValues[ 5 ] <<= (sal_Int32) GetMetric();
310 pValues[ 6 ] <<= (sal_Int32) GetDefTab();
312 return TRUE;
315 /*************************************************************************
317 |* SdOptionsLayoutItem
319 \************************************************************************/
321 SdOptionsLayoutItem::SdOptionsLayoutItem( USHORT _nWhich )
322 : SfxPoolItem ( _nWhich )
323 , maOptionsLayout ( 0, FALSE )
327 // ----------------------------------------------------------------------
329 SdOptionsLayoutItem::SdOptionsLayoutItem( USHORT _nWhich, SdOptions* pOpts, ::sd::FrameView* pView )
330 : SfxPoolItem ( _nWhich )
331 , maOptionsLayout ( 0, FALSE )
333 if( pOpts )
335 maOptionsLayout.SetMetric( pOpts->GetMetric() );
336 maOptionsLayout.SetDefTab( pOpts->GetDefTab() );
339 if( pView )
341 maOptionsLayout.SetRulerVisible( pView->HasRuler() );
342 maOptionsLayout.SetMoveOutline( !pView->IsNoDragXorPolys() );
343 maOptionsLayout.SetDragStripes( pView->IsDragStripes() );
344 maOptionsLayout.SetHandlesBezier( pView->IsPlusHandlesAlwaysVisible() );
345 maOptionsLayout.SetHelplines( pView->IsHlplVisible() );
347 else if( pOpts )
349 maOptionsLayout.SetRulerVisible( pOpts->IsRulerVisible() );
350 maOptionsLayout.SetMoveOutline( pOpts->IsMoveOutline() );
351 maOptionsLayout.SetDragStripes( pOpts->IsDragStripes() );
352 maOptionsLayout.SetHandlesBezier( pOpts->IsHandlesBezier() );
353 maOptionsLayout.SetHelplines( pOpts->IsHelplines() );
357 // ----------------------------------------------------------------------
359 SfxPoolItem* SdOptionsLayoutItem::Clone( SfxItemPool* ) const
361 return new SdOptionsLayoutItem( *this );
365 // ----------------------------------------------------------------------
367 int SdOptionsLayoutItem::operator==( const SfxPoolItem& rAttr ) const
369 const bool bSameType = SfxPoolItem::operator==( rAttr );
370 DBG_ASSERT( bSameType, "SdOptionsLayoutItem::operator==(), differen pool item type!" );
371 return bSameType && ( maOptionsLayout == static_cast< const SdOptionsLayoutItem& >( rAttr ).maOptionsLayout );
374 // -----------------------------------------------------------------------
376 void SdOptionsLayoutItem::SetOptions( SdOptions* pOpts ) const
378 if( pOpts )
380 pOpts->SetRulerVisible( maOptionsLayout.IsRulerVisible() );
381 pOpts->SetMoveOutline( maOptionsLayout.IsMoveOutline() );
382 pOpts->SetDragStripes( maOptionsLayout.IsDragStripes() );
383 pOpts->SetHandlesBezier( maOptionsLayout.IsHandlesBezier() );
384 pOpts->SetHelplines( maOptionsLayout.IsHelplines() );
385 pOpts->SetMetric( maOptionsLayout.GetMetric() );
386 pOpts->SetDefTab( maOptionsLayout.GetDefTab() );
390 /*************************************************************************
392 |* SdOptionsContents
394 \************************************************************************/
396 SdOptionsContents::SdOptionsContents( USHORT nConfigId, BOOL bUseConfig ) :
397 SdOptionsGeneric( nConfigId, bUseConfig ?
398 ( ( SDCFG_DRAW == nConfigId ) ?
399 B2U( "Office.Draw/Content" ) :
400 B2U( "Office.Impress/Content" ) ) :
401 OUString() )
403 EnableModify( TRUE );
406 // -----------------------------------------------------------------------------
408 void SdOptionsContents::SetDefaults()
412 // -----------------------------------------------------------------------------
414 BOOL SdOptionsContents::operator==(const SdOptionsContents&) const
416 return true;
419 // -----------------------------------------------------------------------------
421 void SdOptionsContents::GetPropNameArray( const char**& ppNames, ULONG& rCount ) const
423 static const char* aPropNames[] =
425 "Display/PicturePlaceholder",
426 "Display/ContourMode",
427 "Display/LineContour",
428 "Display/TextPlaceholder"
431 rCount = 4;
432 ppNames = aPropNames;
435 // -----------------------------------------------------------------------------
437 BOOL SdOptionsContents::ReadData(const Any*)
439 return TRUE;
442 // -----------------------------------------------------------------------------
444 BOOL SdOptionsContents::WriteData( Any* pValues ) const
446 //#i80528# no draft anymore
447 pValues[ 0 ] <<= (BOOL)false;
448 pValues[ 1 ] <<= (BOOL)false;
449 pValues[ 2 ] <<= (BOOL)false;
450 pValues[ 3 ] <<= (BOOL)false;
452 return TRUE;
455 /*************************************************************************
457 |* SdOptionsContentsItem
459 \************************************************************************/
461 SdOptionsContentsItem::SdOptionsContentsItem( USHORT _nWhich )
462 : SfxPoolItem ( _nWhich )
463 , maOptionsContents ( 0, FALSE )
467 // ----------------------------------------------------------------------
469 SdOptionsContentsItem::SdOptionsContentsItem(USHORT _nWhich, SdOptions*, ::sd::FrameView*)
470 : SfxPoolItem ( _nWhich )
471 , maOptionsContents ( 0, FALSE )
475 // ----------------------------------------------------------------------
477 SfxPoolItem* SdOptionsContentsItem::Clone( SfxItemPool* ) const
479 return new SdOptionsContentsItem( *this );
482 // ----------------------------------------------------------------------
484 int SdOptionsContentsItem::operator==( const SfxPoolItem& rAttr ) const
486 const bool bSameType = SfxPoolItem::operator==(rAttr);
487 DBG_ASSERT( bSameType, "SdOptionsContentsItem::operator==(), differen pool item type!" );
488 return bSameType && ( maOptionsContents == static_cast<const SdOptionsContentsItem&>( rAttr ).maOptionsContents );
491 // -----------------------------------------------------------------------
493 void SdOptionsContentsItem::SetOptions(SdOptions*) const
497 /*************************************************************************
499 |* SdOptionsMisc
501 \************************************************************************/
503 SdOptionsMisc::SdOptionsMisc( USHORT nConfigId, BOOL bUseConfig ) :
504 SdOptionsGeneric( nConfigId, bUseConfig ?
505 ( ( SDCFG_DRAW == nConfigId ) ?
506 B2U( "Office.Draw/Misc" ) :
507 B2U( "Office.Impress/Misc" ) ) :
508 OUString() ),
509 // #97016#
510 nDefaultObjectSizeWidth(8000),
511 nDefaultObjectSizeHeight(5000),
512 bStartWithTemplate( TRUE ),
513 bMarkedHitMovesAlways( TRUE ),
514 bMoveOnlyDragging( FALSE ),
515 bCrookNoContortion( FALSE ),
516 bQuickEdit( GetConfigId() != SDCFG_DRAW ),
517 bMasterPageCache( TRUE ),
518 bDragWithCopy( FALSE ),
519 bPickThrough( TRUE ),
520 bBigHandles( FALSE ),
521 bDoubleClickTextEdit( TRUE ),
522 bClickChangeRotation( FALSE ),
523 bStartWithActualPage( FALSE ),
524 bSolidDragging( TRUE ),
525 bSolidMarkHdl( TRUE ),
526 bSummationOfParagraphs( FALSE ),
527 // #90356#
528 bShowUndoDeleteWarning( TRUE ),
529 bSlideshowRespectZOrder( TRUE ),
530 bShowComments( TRUE ),
531 bPreviewNewEffects( TRUE ),
532 bPreviewChangedEffects( FALSE ),
533 bPreviewTransitions( TRUE ),
534 mnDisplay( 0 ),
535 // The default for 6.1-and-above documents is to use printer-independent
536 // formatting.
537 mnPrinterIndependentLayout (1)
539 EnableModify( TRUE );
542 // -----------------------------------------------------------------------------
544 void SdOptionsMisc::SetDefaults()
546 SetStartWithTemplate( TRUE );
547 SetMarkedHitMovesAlways( TRUE );
548 SetMoveOnlyDragging( FALSE );
549 SetCrookNoContortion( FALSE );
550 SetQuickEdit( GetConfigId() != SDCFG_DRAW );
551 SetMasterPagePaintCaching( TRUE );
552 SetDragWithCopy( FALSE );
553 SetPickThrough( TRUE );
554 SetBigHandles( FALSE );
555 SetDoubleClickTextEdit( TRUE );
556 SetClickChangeRotation( FALSE );
557 SetStartWithActualPage( FALSE );
558 SetSummationOfParagraphs( FALSE );
559 SetSolidDragging( TRUE );
560 SetSolidMarkHdl( TRUE );
561 // #90356#
562 SetShowUndoDeleteWarning( TRUE );
563 // The default for 6.1-and-above documents is to use printer-independent
564 // formatting.
565 SetPrinterIndependentLayout (1);
566 // #97016#
567 SetDefaultObjectSizeWidth(8000);
568 SetDefaultObjectSizeHeight(5000);
569 SetPreviewNewEffects(true);
570 SetPreviewChangedEffects(false);
571 SetPreviewTransitions(true);
572 SetDisplay(0);
573 SetShowComments(true);
576 // -----------------------------------------------------------------------------
578 BOOL SdOptionsMisc::operator==( const SdOptionsMisc& rOpt ) const
580 return( IsStartWithTemplate() == rOpt.IsStartWithTemplate() &&
581 IsMarkedHitMovesAlways() == rOpt.IsMarkedHitMovesAlways() &&
582 IsMoveOnlyDragging() == rOpt.IsMoveOnlyDragging() &&
583 IsCrookNoContortion() == rOpt.IsCrookNoContortion() &&
584 IsQuickEdit() == rOpt.IsQuickEdit() &&
585 IsMasterPagePaintCaching() == rOpt.IsMasterPagePaintCaching() &&
586 IsDragWithCopy() == rOpt.IsDragWithCopy() &&
587 IsPickThrough() == rOpt.IsPickThrough() &&
588 IsBigHandles() == rOpt.IsBigHandles() &&
589 IsDoubleClickTextEdit() == rOpt.IsDoubleClickTextEdit() &&
590 IsClickChangeRotation() == rOpt.IsClickChangeRotation() &&
591 IsStartWithActualPage() == rOpt.IsStartWithActualPage() &&
592 IsSummationOfParagraphs() == rOpt.IsSummationOfParagraphs() &&
593 IsSolidDragging() == rOpt.IsSolidDragging() &&
594 IsSolidMarkHdl() == rOpt.IsSolidMarkHdl() &&
595 // #90356#
596 IsShowUndoDeleteWarning() == rOpt.IsShowUndoDeleteWarning() &&
597 IsSlideshowRespectZOrder() == rOpt.IsSlideshowRespectZOrder() &&
598 GetPrinterIndependentLayout() == rOpt.GetPrinterIndependentLayout() &&
599 // #97016#
600 GetDefaultObjectSizeWidth() == rOpt.GetDefaultObjectSizeWidth() &&
601 GetDefaultObjectSizeHeight() == rOpt.GetDefaultObjectSizeHeight() &&
603 IsPreviewNewEffects() == rOpt.IsPreviewNewEffects() &&
604 IsPreviewChangedEffects() == rOpt.IsPreviewChangedEffects() &&
605 IsPreviewTransitions() == rOpt.IsPreviewTransitions() &&
606 GetDisplay() == rOpt.GetDisplay() &&
607 IsShowComments() == rOpt.IsShowComments()
611 // -----------------------------------------------------------------------------
613 void SdOptionsMisc::GetPropNameArray( const char**& ppNames, ULONG& rCount ) const
615 static const char* aPropNames[] =
617 "ObjectMoveable",
618 "NoDistort",
619 "TextObject/QuickEditing",
620 "BackgroundCache",
621 "CopyWhileMoving",
622 "TextObject/Selectable",
623 "BigHandles",
624 "DclickTextedit",
625 "RotateClick",
626 "Preview",
627 "ModifyWithAttributes",
628 "SimpleHandles",
629 // #97016#
630 "DefaultObjectSize/Width",
631 "DefaultObjectSize/Height",
633 "Compatibility/PrinterIndependentLayout",
635 "ShowComments",
637 // just for impress
638 "NewDoc/AutoPilot",
639 "Start/CurrentPage",
640 "Compatibility/AddBetween",
641 // #90356#
642 "ShowUndoDeleteWarning",
643 "SlideshowRespectZOrder",
645 "PreviewNewEffects",
646 "PreviewChangedEffects",
647 "PreviewTransitions",
649 "Display"
652 rCount = ( ( GetConfigId() == SDCFG_IMPRESS ) ? 25 : 16 );
653 ppNames = aPropNames;
656 // -----------------------------------------------------------------------------
658 BOOL SdOptionsMisc::ReadData( const Any* pValues )
660 if( pValues[0].hasValue() ) SetMarkedHitMovesAlways( *(sal_Bool*) pValues[ 0 ].getValue() );
661 if( pValues[1].hasValue() ) SetCrookNoContortion( *(sal_Bool*) pValues[ 1 ].getValue() );
662 if( pValues[2].hasValue() ) SetQuickEdit( *(sal_Bool*)pValues[ 2 ].getValue() );
663 if( pValues[3].hasValue() ) SetMasterPagePaintCaching( *(sal_Bool*) pValues[ 3 ].getValue() );
664 if( pValues[4].hasValue() ) SetDragWithCopy( *(sal_Bool*) pValues[ 4 ].getValue() );
665 if( pValues[5].hasValue() ) SetPickThrough( *(sal_Bool*) pValues[ 5 ].getValue() );
666 if( pValues[6].hasValue() ) SetBigHandles( *(sal_Bool*) pValues[ 6 ].getValue() );
667 if( pValues[7].hasValue() ) SetDoubleClickTextEdit( *(sal_Bool*) pValues[ 7 ].getValue() );
668 if( pValues[8].hasValue() ) SetClickChangeRotation( *(sal_Bool*) pValues[ 8 ].getValue() );
669 // if( pValues[9].hasValue() ) SetPreviewQuality( FRound( *(double*) pValues[ 9 ].getValue() ) );
670 if( pValues[10].hasValue() ) SetSolidDragging( *(sal_Bool*) pValues[ 10 ].getValue() );
671 if( pValues[11].hasValue() ) SetSolidMarkHdl( *(sal_Bool*) pValues[ 11 ].getValue() );
672 // #97016#
673 if( pValues[12].hasValue() ) SetDefaultObjectSizeWidth( *(sal_uInt32*) pValues[ 12 ].getValue() );
674 if( pValues[13].hasValue() ) SetDefaultObjectSizeHeight( *(sal_uInt32*) pValues[ 13 ].getValue() );
675 if( pValues[14].hasValue() ) SetPrinterIndependentLayout( *(sal_uInt16*) pValues[ 14 ].getValue() );
677 if( pValues[15].hasValue() ) SetShowComments( *(sal_Bool*) pValues[ 11 ].getValue() );
679 // just for Impress
680 if( GetConfigId() == SDCFG_IMPRESS )
682 if( pValues[16].hasValue() )
683 SetStartWithTemplate( *(sal_Bool*) pValues[ 16 ].getValue() );
684 if( pValues[17].hasValue() )
685 SetStartWithActualPage( *(sal_Bool*) pValues[ 17 ].getValue() );
686 if( pValues[18].hasValue() )
687 SetSummationOfParagraphs( *(sal_Bool*) pValues[ 18 ].getValue() );
688 // #90356#
689 if( pValues[19].hasValue() )
690 SetShowUndoDeleteWarning( *(sal_Bool*) pValues[ 19 ].getValue() );
692 if( pValues[20].hasValue() )
693 SetSlideshowRespectZOrder(*(sal_Bool*) pValues[ 20 ].getValue());
695 if( pValues[21].hasValue() )
696 SetPreviewNewEffects(*(sal_Bool*) pValues[ 21 ].getValue());
698 if( pValues[22].hasValue() )
699 SetPreviewChangedEffects(*(sal_Bool*) pValues[ 22 ].getValue());
701 if( pValues[23].hasValue() )
702 SetPreviewTransitions(*(sal_Bool*) pValues[ 23 ].getValue());
704 if( pValues[24].hasValue() )
705 SetDisplay(*(sal_Int32*) pValues[ 24 ].getValue());
708 return TRUE;
711 // -----------------------------------------------------------------------------
713 BOOL SdOptionsMisc::WriteData( Any* pValues ) const
715 pValues[ 0 ] <<= IsMarkedHitMovesAlways();
716 pValues[ 1 ] <<= IsCrookNoContortion();
717 pValues[ 2 ] <<= IsQuickEdit();
718 pValues[ 3 ] <<= IsMasterPagePaintCaching();
719 pValues[ 4 ] <<= IsDragWithCopy();
720 pValues[ 5 ] <<= IsPickThrough();
721 pValues[ 6 ] <<= IsBigHandles();
722 pValues[ 7 ] <<= IsDoubleClickTextEdit();
723 pValues[ 8 ] <<= IsClickChangeRotation();
724 // The preview is not supported anymore. Use a dummy value.
725 pValues[ 9 ] <<= (double)0;// GetPreviewQuality();
726 pValues[ 10 ] <<= IsSolidDragging();
727 pValues[ 11 ] <<= IsSolidMarkHdl();
728 // #97016#
729 pValues[ 12 ] <<= GetDefaultObjectSizeWidth();
730 pValues[ 13 ] <<= GetDefaultObjectSizeHeight();
731 pValues[ 14 ] <<= GetPrinterIndependentLayout();
732 pValues[ 15 ] <<= (sal_Bool)IsShowComments();
734 // just for Impress
735 if( GetConfigId() == SDCFG_IMPRESS )
737 pValues[ 16 ] <<= IsStartWithTemplate();
738 pValues[ 17 ] <<= IsStartWithActualPage();
739 pValues[ 18 ] <<= IsSummationOfParagraphs();
740 // #90356#
741 pValues[ 19 ] <<= IsShowUndoDeleteWarning();
742 pValues[ 20 ] <<= IsSlideshowRespectZOrder();
744 pValues[ 21 ] <<= IsPreviewNewEffects();
745 pValues[ 22 ] <<= IsPreviewChangedEffects();
746 pValues[ 23 ] <<= IsPreviewTransitions();
748 pValues[ 24 ] <<= GetDisplay();
751 return TRUE;
754 /*************************************************************************
756 |* SdOptionsMiscItem
758 \************************************************************************/
760 SdOptionsMiscItem::SdOptionsMiscItem( USHORT _nWhich )
761 : SfxPoolItem ( _nWhich )
762 , maOptionsMisc ( 0, FALSE )
766 // ----------------------------------------------------------------------
768 SdOptionsMiscItem::SdOptionsMiscItem( USHORT _nWhich, SdOptions* pOpts, ::sd::FrameView* pView )
769 : SfxPoolItem ( _nWhich )
770 , maOptionsMisc ( 0, FALSE )
772 if( pOpts )
774 maOptionsMisc.SetStartWithTemplate( pOpts->IsStartWithTemplate() );
775 maOptionsMisc.SetStartWithActualPage( pOpts->IsStartWithActualPage() );
776 maOptionsMisc.SetSummationOfParagraphs( pOpts->IsSummationOfParagraphs() );
777 // #90356#
778 maOptionsMisc.SetShowUndoDeleteWarning( pOpts->IsShowUndoDeleteWarning() );
779 maOptionsMisc.SetPrinterIndependentLayout( pOpts->GetPrinterIndependentLayout() );
780 // #97016#
781 maOptionsMisc.SetDefaultObjectSizeWidth( pOpts->GetDefaultObjectSizeWidth() );
782 maOptionsMisc.SetDefaultObjectSizeHeight( pOpts->GetDefaultObjectSizeHeight() );
784 maOptionsMisc.SetPreviewNewEffects(pOpts->IsPreviewNewEffects());
785 maOptionsMisc.SetPreviewChangedEffects(pOpts->IsPreviewChangedEffects());
786 maOptionsMisc.SetPreviewTransitions(pOpts->IsPreviewTransitions());
788 maOptionsMisc.SetDisplay(pOpts->GetDisplay());
791 if( pView )
793 maOptionsMisc.SetMarkedHitMovesAlways( pView->IsMarkedHitMovesAlways() );
794 maOptionsMisc.SetMoveOnlyDragging( pView->IsMoveOnlyDragging() );
795 maOptionsMisc.SetCrookNoContortion( pView->IsCrookNoContortion() );
796 maOptionsMisc.SetQuickEdit( pView->IsQuickEdit() );
798 // #i26631#
799 maOptionsMisc.SetMasterPagePaintCaching( pView->IsMasterPagePaintCaching() );
801 maOptionsMisc.SetDragWithCopy( pView->IsDragWithCopy() );
802 maOptionsMisc.SetPickThrough( (BOOL)pView->GetModel()->IsPickThroughTransparentTextFrames() );
803 maOptionsMisc.SetBigHandles( (BOOL)pView->IsBigHandles() );
804 maOptionsMisc.SetDoubleClickTextEdit( pView->IsDoubleClickTextEdit() );
805 maOptionsMisc.SetClickChangeRotation( pView->IsClickChangeRotation() );
806 maOptionsMisc.SetSolidDragging( pView->IsSolidDragging() );
807 maOptionsMisc.SetSolidMarkHdl( pView->IsSolidMarkHdl() );
809 else if( pOpts )
811 maOptionsMisc.SetMarkedHitMovesAlways( pOpts->IsMarkedHitMovesAlways() );
812 maOptionsMisc.SetMoveOnlyDragging( pOpts->IsMoveOnlyDragging() );
813 maOptionsMisc.SetCrookNoContortion( pOpts->IsCrookNoContortion() );
814 maOptionsMisc.SetQuickEdit( pOpts->IsQuickEdit() );
815 maOptionsMisc.SetMasterPagePaintCaching( pOpts->IsMasterPagePaintCaching() );
816 maOptionsMisc.SetDragWithCopy( pOpts->IsDragWithCopy() );
817 maOptionsMisc.SetPickThrough( pOpts->IsPickThrough() );
818 maOptionsMisc.SetBigHandles( pOpts->IsBigHandles() );
819 maOptionsMisc.SetDoubleClickTextEdit( pOpts->IsDoubleClickTextEdit() );
820 maOptionsMisc.SetClickChangeRotation( pOpts->IsClickChangeRotation() );
821 maOptionsMisc.SetSolidDragging( pOpts->IsSolidDragging() );
822 maOptionsMisc.SetSolidMarkHdl( pOpts->IsSolidMarkHdl() );
826 // ----------------------------------------------------------------------
828 SfxPoolItem* SdOptionsMiscItem::Clone( SfxItemPool* ) const
830 return new SdOptionsMiscItem( *this );
834 // ----------------------------------------------------------------------
836 int SdOptionsMiscItem::operator==( const SfxPoolItem& rAttr ) const
838 const bool bSameType = SfxPoolItem::operator==(rAttr);
839 DBG_ASSERT( bSameType, "SdOptionsMiscItem::operator==(), differen pool item type!" );
840 return bSameType && ( maOptionsMisc == static_cast< const SdOptionsMiscItem& >(rAttr).maOptionsMisc );
843 // -----------------------------------------------------------------------
845 void SdOptionsMiscItem::SetOptions( SdOptions* pOpts ) const
847 if( pOpts )
849 pOpts->SetStartWithTemplate( maOptionsMisc.IsStartWithTemplate() );
850 pOpts->SetMarkedHitMovesAlways( maOptionsMisc.IsMarkedHitMovesAlways() );
851 pOpts->SetMoveOnlyDragging( maOptionsMisc.IsMoveOnlyDragging() );
852 pOpts->SetCrookNoContortion( maOptionsMisc.IsCrookNoContortion() );
853 pOpts->SetQuickEdit( maOptionsMisc.IsQuickEdit() );
854 pOpts->SetMasterPagePaintCaching( maOptionsMisc.IsMasterPagePaintCaching() );
855 pOpts->SetDragWithCopy( maOptionsMisc.IsDragWithCopy() );
856 pOpts->SetPickThrough( maOptionsMisc.IsPickThrough() );
857 pOpts->SetBigHandles( maOptionsMisc.IsBigHandles() );
858 pOpts->SetDoubleClickTextEdit( maOptionsMisc.IsDoubleClickTextEdit() );
859 pOpts->SetClickChangeRotation( maOptionsMisc.IsClickChangeRotation() );
860 pOpts->SetStartWithActualPage( maOptionsMisc.IsStartWithActualPage() );
861 pOpts->SetSummationOfParagraphs( maOptionsMisc.IsSummationOfParagraphs() );
862 pOpts->SetSolidDragging( maOptionsMisc.IsSolidDragging() );
863 pOpts->SetSolidMarkHdl( maOptionsMisc.IsSolidMarkHdl() );
864 // #90356#
865 pOpts->SetShowUndoDeleteWarning( maOptionsMisc.IsShowUndoDeleteWarning() );
866 pOpts->SetPrinterIndependentLayout( maOptionsMisc.GetPrinterIndependentLayout() );
867 // #97016#
868 pOpts->SetDefaultObjectSizeWidth( maOptionsMisc.GetDefaultObjectSizeWidth() );
869 pOpts->SetDefaultObjectSizeHeight( maOptionsMisc.GetDefaultObjectSizeHeight() );
871 pOpts->SetPreviewNewEffects( maOptionsMisc.IsPreviewNewEffects() );
872 pOpts->SetPreviewChangedEffects( maOptionsMisc.IsPreviewChangedEffects() );
873 pOpts->SetPreviewTransitions( maOptionsMisc.IsPreviewTransitions() );
875 pOpts->SetDisplay( maOptionsMisc.GetDisplay() );
879 /*************************************************************************
881 |* SdOptionsSnap
883 \************************************************************************/
885 SdOptionsSnap::SdOptionsSnap( USHORT nConfigId, BOOL bUseConfig ) :
886 SdOptionsGeneric( nConfigId, bUseConfig ?
887 ( ( SDCFG_DRAW == nConfigId ) ?
888 B2U( "Office.Draw/Snap" ) :
889 B2U( "Office.Impress/Snap" ) ) :
890 OUString() ),
891 bSnapHelplines( TRUE ),
892 bSnapBorder( TRUE ),
893 bSnapFrame( FALSE ),
894 bSnapPoints( FALSE ),
895 bOrtho( FALSE ),
896 bBigOrtho( TRUE ),
897 bRotate( FALSE ),
898 nSnapArea( 5 ),
899 nAngle( 1500 ),
900 nBezAngle( 1500 )
903 EnableModify( TRUE );
906 // -----------------------------------------------------------------------------
908 void SdOptionsSnap::SetDefaults()
910 SetSnapHelplines( TRUE );
911 SetSnapBorder( TRUE );
912 SetSnapFrame( FALSE );
913 SetSnapPoints( FALSE );
914 SetOrtho( FALSE );
915 SetBigOrtho( TRUE );
916 SetRotate( FALSE );
917 SetSnapArea( 5 );
918 SetAngle( 1500 );
919 SetEliminatePolyPointLimitAngle( 1500 );
922 // -----------------------------------------------------------------------------
924 BOOL SdOptionsSnap::operator==( const SdOptionsSnap& rOpt ) const
926 return( IsSnapHelplines() == rOpt.IsSnapHelplines() &&
927 IsSnapBorder() == rOpt.IsSnapBorder() &&
928 IsSnapFrame() == rOpt.IsSnapFrame() &&
929 IsSnapPoints() == rOpt.IsSnapPoints() &&
930 IsOrtho() == rOpt.IsOrtho() &&
931 IsBigOrtho() == rOpt.IsBigOrtho() &&
932 IsRotate() == rOpt.IsRotate() &&
933 GetSnapArea() == rOpt.GetSnapArea() &&
934 GetAngle() == rOpt.GetAngle() &&
935 GetEliminatePolyPointLimitAngle() == rOpt.GetEliminatePolyPointLimitAngle() );
938 // -----------------------------------------------------------------------------
940 void SdOptionsSnap::GetPropNameArray( const char**& ppNames, ULONG& rCount ) const
942 static const char* aPropNames[] =
944 "Object/SnapLine",
945 "Object/PageMargin",
946 "Object/ObjectFrame",
947 "Object/ObjectPoint",
948 "Position/CreatingMoving",
949 "Position/ExtendEdges",
950 "Position/Rotating",
951 "Object/Range",
952 "Position/RotatingValue",
953 "Position/PointReduction"
956 rCount = 10;
957 ppNames = aPropNames;
960 // -----------------------------------------------------------------------------
962 BOOL SdOptionsSnap::ReadData( const Any* pValues )
964 if( pValues[0].hasValue() ) SetSnapHelplines( *(sal_Bool*) pValues[ 0 ].getValue() );
965 if( pValues[1].hasValue() ) SetSnapBorder( *(sal_Bool*)pValues[ 1 ].getValue() );
966 if( pValues[2].hasValue() ) SetSnapFrame( *(sal_Bool*) pValues[ 2 ].getValue() );
967 if( pValues[3].hasValue() ) SetSnapPoints( *(sal_Bool*) pValues[ 3 ].getValue() );
968 if( pValues[4].hasValue() ) SetOrtho( *(sal_Bool*) pValues[ 4 ].getValue() );
969 if( pValues[5].hasValue() ) SetBigOrtho( *(sal_Bool*) pValues[ 5 ].getValue() );
970 if( pValues[6].hasValue() ) SetRotate( *(sal_Bool*) pValues[ 6 ].getValue() );
971 if( pValues[7].hasValue() ) SetSnapArea( (INT16) *(sal_Int32*) pValues[ 7 ].getValue() );
972 if( pValues[8].hasValue() ) SetAngle( (INT16) *(sal_Int32*) pValues[ 8 ].getValue() );
973 if( pValues[9].hasValue() ) SetEliminatePolyPointLimitAngle( (INT16) *(sal_Int32*) pValues[ 9 ].getValue() );
975 return TRUE;
978 // -----------------------------------------------------------------------------
980 BOOL SdOptionsSnap::WriteData( Any* pValues ) const
982 pValues[ 0 ] <<= IsSnapHelplines();
983 pValues[ 1 ] <<= IsSnapBorder();
984 pValues[ 2 ] <<= IsSnapFrame();
985 pValues[ 3 ] <<= IsSnapPoints();
986 pValues[ 4 ] <<= IsOrtho();
987 pValues[ 5 ] <<= IsBigOrtho();
988 pValues[ 6 ] <<= IsRotate();
989 pValues[ 7 ] <<= (sal_Int32) GetSnapArea();
990 pValues[ 8 ] <<= (sal_Int32) GetAngle();
991 pValues[ 9 ] <<= (sal_Int32) GetEliminatePolyPointLimitAngle();
993 return TRUE;
996 /*************************************************************************
998 |* SdOptionsSnapItem
1000 \************************************************************************/
1002 SdOptionsSnapItem::SdOptionsSnapItem( USHORT _nWhich )
1003 : SfxPoolItem ( _nWhich )
1004 , maOptionsSnap ( 0, FALSE )
1008 // ----------------------------------------------------------------------
1010 SdOptionsSnapItem::SdOptionsSnapItem( USHORT _nWhich, SdOptions* pOpts, ::sd::FrameView* pView )
1011 : SfxPoolItem ( _nWhich )
1012 , maOptionsSnap ( 0, FALSE )
1014 if( pView )
1016 maOptionsSnap.SetSnapHelplines( pView->IsHlplSnap() );
1017 maOptionsSnap.SetSnapBorder( pView->IsBordSnap() );
1018 maOptionsSnap.SetSnapFrame( pView->IsOFrmSnap() );
1019 maOptionsSnap.SetSnapPoints( pView->IsOPntSnap() );
1020 maOptionsSnap.SetOrtho( pView->IsOrtho() );
1021 maOptionsSnap.SetBigOrtho( pView->IsBigOrtho() );
1022 maOptionsSnap.SetRotate( pView->IsAngleSnapEnabled() );
1023 maOptionsSnap.SetSnapArea( pView->GetSnapMagneticPixel() );
1024 maOptionsSnap.SetAngle( (INT16) pView->GetSnapAngle() );
1025 maOptionsSnap.SetEliminatePolyPointLimitAngle( (INT16) pView->GetEliminatePolyPointLimitAngle() );
1027 else if( pOpts )
1029 maOptionsSnap.SetSnapHelplines( pOpts->IsSnapHelplines() );
1030 maOptionsSnap.SetSnapBorder( pOpts->IsSnapBorder() );
1031 maOptionsSnap.SetSnapFrame( pOpts->IsSnapFrame() );
1032 maOptionsSnap.SetSnapPoints( pOpts->IsSnapPoints() );
1033 maOptionsSnap.SetOrtho( pOpts->IsOrtho() );
1034 maOptionsSnap.SetBigOrtho( pOpts->IsBigOrtho() );
1035 maOptionsSnap.SetRotate( pOpts->IsRotate() );
1036 maOptionsSnap.SetSnapArea( pOpts->GetSnapArea() );
1037 maOptionsSnap.SetAngle( pOpts->GetAngle() );
1038 maOptionsSnap.SetEliminatePolyPointLimitAngle( pOpts->GetEliminatePolyPointLimitAngle() );
1042 // ----------------------------------------------------------------------
1044 SfxPoolItem* SdOptionsSnapItem::Clone( SfxItemPool* ) const
1046 return new SdOptionsSnapItem( *this );
1050 // ----------------------------------------------------------------------
1052 int SdOptionsSnapItem::operator==( const SfxPoolItem& rAttr ) const
1054 const bool bSameType = SfxPoolItem::operator==(rAttr);
1055 DBG_ASSERT( bSameType, "SdOptionsSnapItem::operator==(), differen pool item type!" );
1056 return bSameType && ( maOptionsSnap == static_cast< const SdOptionsSnapItem& >(rAttr).maOptionsSnap );
1059 // -----------------------------------------------------------------------
1061 void SdOptionsSnapItem::SetOptions( SdOptions* pOpts ) const
1063 if( pOpts )
1065 pOpts->SetSnapHelplines( maOptionsSnap.IsSnapHelplines() );
1066 pOpts->SetSnapBorder( maOptionsSnap.IsSnapBorder() );
1067 pOpts->SetSnapFrame( maOptionsSnap.IsSnapFrame() );
1068 pOpts->SetSnapPoints( maOptionsSnap.IsSnapPoints() );
1069 pOpts->SetOrtho( maOptionsSnap.IsOrtho() );
1070 pOpts->SetBigOrtho( maOptionsSnap.IsBigOrtho() );
1071 pOpts->SetRotate( maOptionsSnap.IsRotate() );
1072 pOpts->SetSnapArea( maOptionsSnap.GetSnapArea() );
1073 pOpts->SetAngle( maOptionsSnap.GetAngle() );
1074 pOpts->SetEliminatePolyPointLimitAngle( maOptionsSnap.GetEliminatePolyPointLimitAngle() );
1078 /*************************************************************************
1080 |* SdOptionsZoom
1082 \************************************************************************/
1084 SdOptionsZoom::SdOptionsZoom( USHORT nConfigId, BOOL bUseConfig ) :
1085 SdOptionsGeneric( nConfigId, ( bUseConfig && ( SDCFG_DRAW == nConfigId ) ) ?
1086 B2U( "Office.Draw/Zoom" ) :
1087 OUString() ),
1088 nX( 1 ),
1089 nY( 1 )
1092 EnableModify( TRUE );
1095 // -----------------------------------------------------------------------------
1097 void SdOptionsZoom::SetDefaults()
1099 SetScale( 1, 1 );
1102 // -----------------------------------------------------------------------------
1104 BOOL SdOptionsZoom::operator==( const SdOptionsZoom& rOpt ) const
1106 INT32 nX1, nX2, nY1, nY2;
1108 GetScale( nX1, nY1 );
1109 rOpt.GetScale( nX2, nY2 );
1111 return( ( nX1 == nX2 ) &&
1112 ( nY1 == nY2 ) );
1115 // -----------------------------------------------------------------------------
1117 void SdOptionsZoom::GetPropNameArray( const char**& ppNames, ULONG& rCount ) const
1119 static const char* aPropNames[] =
1121 "ScaleX",
1122 "ScaleY"
1125 rCount = ( GetConfigId() == SDCFG_DRAW ) ? 2 : 0;
1126 ppNames = aPropNames;
1129 // -----------------------------------------------------------------------------
1131 BOOL SdOptionsZoom::ReadData( const Any* pValues )
1133 INT32 x = 1, y = 1;
1135 if( pValues[0].hasValue() ) x = ( *(sal_Int32*) pValues[ 0 ].getValue() );
1136 if( pValues[1].hasValue() ) y = ( *(sal_Int32*) pValues[ 1 ].getValue() );
1138 SetScale( x, y );
1140 return TRUE;
1143 // -----------------------------------------------------------------------------
1145 BOOL SdOptionsZoom::WriteData( Any* pValues ) const
1147 INT32 x, y;
1149 GetScale( x, y );
1151 pValues[ 0 ] <<= (sal_Int32) x;
1152 pValues[ 1 ] <<= (sal_Int32) y;
1154 return TRUE;
1157 /*************************************************************************
1159 |* SdOptionsZoomItem
1161 \************************************************************************/
1163 SdOptionsZoomItem::SdOptionsZoomItem( USHORT _nWhich )
1164 : SfxPoolItem ( _nWhich )
1165 , maOptionsZoom ( 0, FALSE )
1169 // ----------------------------------------------------------------------
1171 SdOptionsZoomItem::SdOptionsZoomItem( USHORT _nWhich, SdOptions* pOpts, ::sd::FrameView* )
1172 : SfxPoolItem ( _nWhich )
1173 , maOptionsZoom ( 0, FALSE )
1175 if( pOpts )
1177 INT32 nX, nY;
1179 pOpts->GetScale( nX, nY );
1180 maOptionsZoom.SetScale( nX, nY );
1184 // ----------------------------------------------------------------------
1186 SfxPoolItem* SdOptionsZoomItem::Clone( SfxItemPool* ) const
1188 return new SdOptionsZoomItem( *this );
1192 // ----------------------------------------------------------------------
1194 int SdOptionsZoomItem::operator==( const SfxPoolItem& rAttr ) const
1196 const bool bSameType = SfxPoolItem::operator==(rAttr);
1197 DBG_ASSERT( bSameType, "SdOptionsZoomItem::operator==(), differen pool item type!" );
1198 return bSameType && ( maOptionsZoom == static_cast< const SdOptionsZoomItem& >(rAttr).maOptionsZoom );
1201 // -----------------------------------------------------------------------
1203 void SdOptionsZoomItem::SetOptions( SdOptions* pOpts ) const
1205 if( pOpts )
1207 INT32 nX, nY;
1209 maOptionsZoom.GetScale( nX, nY );
1210 pOpts->SetScale( nX, nY );
1214 /*************************************************************************
1216 |* SdOptionsGrid
1218 \************************************************************************/
1220 SdOptionsGrid::SdOptionsGrid( USHORT nConfigId, BOOL bUseConfig ) :
1221 SdOptionsGeneric( nConfigId, bUseConfig ?
1222 ( ( SDCFG_DRAW == nConfigId ) ?
1223 B2U( "Office.Draw/Grid" ) :
1224 B2U( "Office.Impress/Grid" ) ) :
1225 OUString() )
1227 EnableModify( FALSE );
1228 SetDefaults();
1229 EnableModify( TRUE );
1232 // -----------------------------------------------------------------------------
1234 SdOptionsGrid::~SdOptionsGrid()
1238 // -----------------------------------------------------------------------------
1240 void SdOptionsGrid::SetDefaults()
1242 const UINT32 nVal = 1000;
1244 SetFldDivisionX( nVal );
1245 SetFldDivisionY( nVal );
1246 SetFldDrawX( nVal );
1247 SetFldDrawY( nVal );
1248 SetFldSnapX( nVal );
1249 SetFldSnapY( nVal );
1250 SetUseGridSnap( FALSE );
1251 SetSynchronize( TRUE );
1252 SetGridVisible( FALSE );
1253 SetEqualGrid( TRUE );
1256 // -----------------------------------------------------------------------------
1258 BOOL SdOptionsGrid::operator==( const SdOptionsGrid& rOpt ) const
1260 return( GetFldDrawX() == rOpt.GetFldDrawX() &&
1261 GetFldDivisionX() == rOpt.GetFldDivisionX() &&
1262 GetFldDrawY() == rOpt.GetFldDrawY() &&
1263 GetFldDivisionY() == rOpt.GetFldDivisionY() &&
1264 GetFldSnapX() == rOpt.GetFldSnapX() &&
1265 GetFldSnapY() == rOpt.GetFldSnapY() &&
1266 IsUseGridSnap() == rOpt.IsUseGridSnap() &&
1267 IsSynchronize() == rOpt.IsSynchronize() &&
1268 IsGridVisible() == rOpt.IsGridVisible() &&
1269 IsEqualGrid() == rOpt.IsEqualGrid() );
1272 // -----------------------------------------------------------------------------
1274 void SdOptionsGrid::GetPropNameArray( const char**& ppNames, ULONG& rCount ) const
1276 static const char* aPropNamesMetric[] =
1278 "Resolution/XAxis/Metric",
1279 "Resolution/YAxis/Metric",
1280 "Subdivision/XAxis",
1281 "Subdivision/YAxis",
1282 "SnapGrid/XAxis/Metric",
1283 "SnapGrid/YAxis/Metric",
1284 "Option/SnapToGrid",
1285 "Option/Synchronize",
1286 "Option/VisibleGrid",
1287 "SnapGrid/Size"
1290 static const char* aPropNamesNonMetric[] =
1292 "Resolution/XAxis/NonMetric",
1293 "Resolution/YAxis/NonMetric",
1294 "Subdivision/XAxis",
1295 "Subdivision/YAxis",
1296 "SnapGrid/XAxis/NonMetric",
1297 "SnapGrid/YAxis/NonMetric",
1298 "Option/SnapToGrid",
1299 "Option/Synchronize",
1300 "Option/VisibleGrid",
1301 "SnapGrid/Size"
1304 rCount = 10;
1306 if( isMetricSystem() )
1307 ppNames = aPropNamesMetric;
1308 else
1309 ppNames = aPropNamesNonMetric;
1312 // -----------------------------------------------------------------------------
1314 BOOL SdOptionsGrid::ReadData( const Any* pValues )
1316 if( pValues[0].hasValue() ) SetFldDrawX( *(sal_Int32*) pValues[ 0 ].getValue() );
1317 if( pValues[1].hasValue() ) SetFldDrawY( *(sal_Int32*) pValues[ 1 ].getValue() );
1319 if( pValues[2].hasValue() )
1321 const UINT32 nDivX = FRound( *(double*) pValues[ 2 ].getValue() );
1322 SetFldDivisionX( SvxOptionsGrid::GetFldDrawX() / ( nDivX + 1 ) );
1325 if( pValues[3].hasValue() )
1327 const UINT32 nDivY = FRound( *(double*) pValues[ 3 ].getValue() );
1328 SetFldDivisionY( SvxOptionsGrid::GetFldDrawY() / ( nDivY + 1 ) );
1331 if( pValues[4].hasValue() ) SetFldSnapX( *(sal_Int32*) pValues[ 4 ].getValue() );
1332 if( pValues[5].hasValue() ) SetFldSnapY( *(sal_Int32*) pValues[ 5 ].getValue() );
1333 if( pValues[6].hasValue() ) SetUseGridSnap( *(sal_Bool*) pValues[ 6 ].getValue() );
1334 if( pValues[7].hasValue() ) SetSynchronize( *(sal_Bool*) pValues[ 7 ].getValue() );
1335 if( pValues[8].hasValue() ) SetGridVisible( *(sal_Bool*) pValues[ 8 ].getValue() );
1336 if( pValues[9].hasValue() ) SetEqualGrid( *(sal_Bool*) pValues[ 9 ].getValue() );
1338 return TRUE;
1341 // -----------------------------------------------------------------------------
1343 BOOL SdOptionsGrid::WriteData( Any* pValues ) const
1345 pValues[ 0 ] <<= (sal_Int32) GetFldDrawX();
1346 pValues[ 1 ] <<= (sal_Int32) GetFldDrawY();
1347 pValues[ 2 ] <<= ( GetFldDivisionX() ? ( (double) GetFldDrawX() / GetFldDivisionX() - 1.0 ) : (double) 0 );
1348 pValues[ 3 ] <<= ( GetFldDivisionY() ? ( (double) GetFldDrawY() / GetFldDivisionY() - 1.0 ) : (double) 0 );
1349 pValues[ 4 ] <<= (sal_Int32) GetFldSnapX();
1350 pValues[ 5 ] <<= (sal_Int32) GetFldSnapY();
1351 pValues[ 6 ] <<= IsUseGridSnap();
1352 pValues[ 7 ] <<= IsSynchronize();
1353 pValues[ 8 ] <<= IsGridVisible();
1354 pValues[ 9 ] <<= IsEqualGrid();
1356 return TRUE;
1359 /*************************************************************************
1361 |* SdOptionsGridItem
1363 \************************************************************************/
1365 SdOptionsGridItem::SdOptionsGridItem( USHORT _nWhich ) :
1366 SvxGridItem( _nWhich )
1370 // -----------------------------------------------------------------------------
1372 SdOptionsGridItem::SdOptionsGridItem( USHORT _nWhich, SdOptions* pOpts, ::sd::FrameView* pView ) :
1373 SvxGridItem( _nWhich )
1375 SetSynchronize( pOpts->IsSynchronize() );
1376 SetEqualGrid( pOpts->IsEqualGrid() );
1378 if( pView )
1380 SetFldDrawX( pView->GetGridCoarse().Width() );
1381 SetFldDrawY( pView->GetGridCoarse().Height() );
1382 SetFldDivisionX( pView->GetGridFine().Width() ? ( GetFldDrawX() / pView->GetGridFine().Width() - 1 ) : 0 );
1383 SetFldDivisionY( pView->GetGridFine().Height() ? ( GetFldDrawY() / pView->GetGridFine().Height() - 1 ) : 0 );
1384 SetFldSnapX( long(pView->GetSnapGridWidthX()) );
1385 SetFldSnapY( long(pView->GetSnapGridWidthY()) );
1386 SetUseGridSnap( pView->IsGridSnap() );
1387 SetGridVisible( pView->IsGridVisible() );
1389 else
1391 SetFldDrawX( pOpts->GetFldDrawX() );
1392 SetFldDrawY( pOpts->GetFldDrawY() );
1393 SetFldDivisionX( pOpts->GetFldDivisionX() ? ( pOpts->GetFldDrawX() / pOpts->GetFldDivisionX() - 1 ) : 0 );
1394 SetFldDivisionY( pOpts->GetFldDivisionY() ? ( pOpts->GetFldDrawY() / pOpts->GetFldDivisionY() - 1 ) : 0 );
1395 SetFldSnapX( pOpts->GetFldSnapX() );
1396 SetFldSnapY( pOpts->GetFldSnapY() );
1397 SetUseGridSnap( pOpts->IsUseGridSnap() );
1398 SetGridVisible( pOpts->IsGridVisible() );
1402 // -----------------------------------------------------------------------
1404 void SdOptionsGridItem::SetOptions( SdOptions* pOpts ) const
1406 pOpts->SetFldDrawX( GetFldDrawX() );
1407 pOpts->SetFldDivisionX( GetFldDrawX() / ( GetFldDivisionX() + 1 ) );
1408 pOpts->SetFldDrawY( GetFldDrawY() );
1409 pOpts->SetFldDivisionY( GetFldDrawY() / ( GetFldDivisionY() + 1 ) );
1410 pOpts->SetFldSnapX( GetFldSnapX() );
1411 pOpts->SetFldSnapY( GetFldSnapY() );
1412 pOpts->SetUseGridSnap( GetUseGridSnap() );
1413 pOpts->SetSynchronize( GetSynchronize() );
1414 pOpts->SetGridVisible( GetGridVisible() );
1415 pOpts->SetEqualGrid( GetEqualGrid() );
1418 /*************************************************************************
1420 |* SdOptionsPrint
1422 \************************************************************************/
1424 SdOptionsPrint::SdOptionsPrint( USHORT nConfigId, BOOL bUseConfig ) :
1425 SdOptionsGeneric( nConfigId, bUseConfig ?
1426 ( ( SDCFG_DRAW == nConfigId ) ?
1427 B2U( "Office.Draw/Print" ) :
1428 B2U( "Office.Impress/Print" ) ) :
1429 OUString() ),
1430 bDraw( TRUE ),
1431 bNotes( FALSE ),
1432 bHandout( FALSE ),
1433 bOutline( FALSE ),
1434 bDate( FALSE ),
1435 bTime( FALSE ),
1436 bPagename( FALSE ),
1437 bHiddenPages( TRUE ),
1438 bPagesize( FALSE ),
1439 bPagetile( FALSE ),
1440 bWarningPrinter( TRUE ),
1441 bWarningSize( FALSE ),
1442 bWarningOrientation( FALSE ),
1443 bBooklet( FALSE ),
1444 bFront( TRUE ),
1445 bBack( TRUE ),
1446 bCutPage( FALSE ),
1447 bPaperbin( FALSE ),
1448 mbHandoutHorizontal( TRUE ),
1449 mnHandoutPages( 6 ),
1450 nQuality( 0 )
1452 EnableModify( TRUE );
1455 // -----------------------------------------------------------------------------
1457 void SdOptionsPrint::SetDefaults()
1459 SetDraw( TRUE );
1460 SetNotes( FALSE );
1461 SetHandout( FALSE );
1462 SetOutline( FALSE );
1463 SetDate( FALSE );
1464 SetTime( FALSE );
1465 SetPagename( FALSE );
1466 SetHiddenPages( TRUE );
1467 SetPagesize( FALSE );
1468 SetPagetile( FALSE );
1469 SetWarningPrinter( TRUE );
1470 SetWarningSize( FALSE );
1471 SetWarningOrientation( FALSE );
1472 SetBooklet( FALSE );
1473 SetFrontPage( TRUE );
1474 SetBackPage( TRUE );
1475 SetCutPage( FALSE );
1476 SetPaperbin( FALSE );
1477 SetOutputQuality( 0 );
1478 SetHandoutHorizontal( TRUE );
1479 SetHandoutPages( 6 );
1482 // -----------------------------------------------------------------------------
1484 BOOL SdOptionsPrint::operator==( const SdOptionsPrint& rOpt ) const
1486 return( IsDraw() == rOpt.IsDraw() &&
1487 IsNotes() == rOpt.IsNotes() &&
1488 IsHandout() == rOpt.IsHandout() &&
1489 IsOutline() == rOpt.IsOutline() &&
1490 IsDate() == rOpt.IsDate() &&
1491 IsTime() == rOpt.IsTime() &&
1492 IsPagename() == rOpt.IsPagename() &&
1493 IsHiddenPages() == rOpt.IsHiddenPages() &&
1494 IsPagesize() == rOpt.IsPagesize() &&
1495 IsPagetile() == rOpt.IsPagetile() &&
1496 IsWarningPrinter() == rOpt.IsWarningPrinter() &&
1497 IsWarningSize() == rOpt.IsWarningSize() &&
1498 IsWarningOrientation() == rOpt.IsWarningOrientation() &&
1499 IsBooklet() == rOpt.IsBooklet() &&
1500 IsFrontPage() == rOpt.IsFrontPage() &&
1501 IsBackPage() == rOpt.IsBackPage() &&
1502 IsCutPage() == rOpt.IsCutPage() &&
1503 IsPaperbin() == rOpt.IsPaperbin() &&
1504 GetOutputQuality() == rOpt.GetOutputQuality() &&
1505 IsHandoutHorizontal() == rOpt.IsHandoutHorizontal() &&
1506 GetHandoutPages() == rOpt.GetHandoutPages() );
1509 // -----------------------------------------------------------------------------
1511 void SdOptionsPrint::GetPropNameArray( const char**& ppNames, ULONG& rCount ) const
1513 static const char* aDrawPropNames[] =
1515 "Other/Date",
1516 "Other/Time",
1517 "Other/PageName",
1518 "Other/HiddenPage",
1519 "Page/PageSize",
1520 "Page/PageTile",
1521 // bWarningPrinter
1522 // bWarningSize
1523 // bWarningOrientation
1524 "Page/Booklet",
1525 "Page/BookletFront",
1526 "Page/BookletBack",
1527 // bCutPage
1528 "Other/FromPrinterSetup",
1529 "Other/Quality",
1530 "Content/Drawing",
1532 static const char* aImpressPropNames[] =
1534 "Other/Date",
1535 "Other/Time",
1536 "Other/PageName",
1537 "Other/HiddenPage",
1538 "Page/PageSize",
1539 "Page/PageTile",
1540 // bWarningPrinter
1541 // bWarningSize
1542 // bWarningOrientation
1543 "Page/Booklet",
1544 "Page/BookletFront",
1545 "Page/BookletBack",
1546 // bCutPage
1547 "Other/FromPrinterSetup",
1548 "Other/Quality",
1549 "Content/Presentation",
1550 "Content/Note",
1551 "Content/Handout",
1552 "Content/Outline",
1553 "Other/HandoutHorizontal",
1554 "Other/PagesPerHandout"
1557 if( GetConfigId() == SDCFG_IMPRESS )
1559 rCount = 17;
1560 ppNames = aImpressPropNames;
1562 else
1564 rCount = 12;
1565 ppNames = aDrawPropNames;
1569 // -----------------------------------------------------------------------------
1571 BOOL SdOptionsPrint::ReadData( const Any* pValues )
1573 if( pValues[0].hasValue() ) SetDate( *(sal_Bool*) pValues[ 0 ].getValue() );
1574 if( pValues[1].hasValue() ) SetTime( *(sal_Bool*) pValues[ 1 ].getValue() );
1575 if( pValues[2].hasValue() ) SetPagename( *(sal_Bool*) pValues[ 2 ].getValue() );
1576 if( pValues[3].hasValue() ) SetHiddenPages( *(sal_Bool*) pValues[ 3 ].getValue() );
1577 if( pValues[4].hasValue() ) SetPagesize( *(sal_Bool*) pValues[ 4 ].getValue() );
1578 if( pValues[5].hasValue() ) SetPagetile( *(sal_Bool*) pValues[ 5 ].getValue() );
1579 if( pValues[6].hasValue() ) SetBooklet( *(sal_Bool*) pValues[ 6 ].getValue() );
1580 if( pValues[7].hasValue() ) SetFrontPage( *(sal_Bool*) pValues[ 7 ].getValue() );
1581 if( pValues[8].hasValue() ) SetBackPage( *(sal_Bool*) pValues[ 8 ].getValue() );
1582 if( pValues[9].hasValue() ) SetPaperbin( *(sal_Bool*) pValues[ 9 ].getValue() );
1583 if( pValues[10].hasValue() ) SetOutputQuality( (UINT16) *(sal_Int32*) pValues[ 10 ].getValue() );
1584 if( pValues[11].hasValue() ) SetDraw( *(sal_Bool*) pValues[ 11 ].getValue() );
1586 // just for impress
1587 if( GetConfigId() == SDCFG_IMPRESS )
1589 if( pValues[12].hasValue() ) SetNotes( *(sal_Bool*) pValues[ 12 ].getValue() );
1590 if( pValues[13].hasValue() ) SetHandout( *(sal_Bool*) pValues[ 13 ].getValue() );
1591 if( pValues[14].hasValue() ) SetOutline( *(sal_Bool*) pValues[ 14 ].getValue() );
1592 if( pValues[15].hasValue() ) SetHandoutHorizontal( *(sal_Bool*) pValues[15].getValue() );
1593 if( pValues[16].hasValue() ) SetHandoutPages( (UINT16)*(sal_Int32*) pValues[16].getValue() );
1596 return TRUE;
1599 // -----------------------------------------------------------------------------
1601 BOOL SdOptionsPrint::WriteData( Any* pValues ) const
1603 pValues[ 0 ] <<= IsDate();
1604 pValues[ 1 ] <<= IsTime();
1605 pValues[ 2 ] <<= IsPagename();
1606 pValues[ 3 ] <<= IsHiddenPages();
1607 pValues[ 4 ] <<= IsPagesize();
1608 pValues[ 5 ] <<= IsPagetile();
1609 pValues[ 6 ] <<= IsBooklet();
1610 pValues[ 7 ] <<= IsFrontPage();
1611 pValues[ 8 ] <<= IsBackPage();
1612 pValues[ 9 ] <<= IsPaperbin();
1613 pValues[ 10 ] <<= (sal_Int32) GetOutputQuality();
1614 pValues[ 11 ] <<= IsDraw();
1616 // just for impress
1617 if( GetConfigId() == SDCFG_IMPRESS )
1619 pValues[ 12 ] <<= IsNotes();
1620 pValues[ 13 ] <<= IsHandout();
1621 pValues[ 14 ] <<= IsOutline();
1622 pValues[ 15 ] <<= IsHandoutHorizontal();
1623 pValues[ 16 ] <<= GetHandoutPages();
1626 return TRUE;
1629 void SdOptionsPrint::SetPrinterOptions( const SdOptionsPrint* pOptions )
1631 bDraw = pOptions->bDraw;
1632 bNotes = pOptions->bNotes;
1633 bHandout = pOptions->bHandout;
1634 bOutline = pOptions->bOutline;
1635 bDate = pOptions->bDate;
1636 bTime = pOptions->bTime;
1637 bPagename = pOptions->bPagename;
1638 bHiddenPages = pOptions->bHiddenPages;
1639 bPagesize = pOptions->bPagesize;
1640 bPagetile = pOptions->bPagetile;
1641 bWarningPrinter = pOptions->bWarningPrinter;
1642 bWarningSize = pOptions->bWarningSize;
1643 bWarningOrientation = pOptions->bWarningOrientation;
1644 bBooklet = pOptions->bBooklet;
1645 bFront = pOptions->bFront;
1646 bBack = pOptions->bBack;
1647 bCutPage = pOptions->bCutPage;
1648 bPaperbin = pOptions->bPaperbin;
1649 nQuality = pOptions->nQuality;
1650 mnHandoutPages = pOptions->mnHandoutPages;
1651 mbHandoutHorizontal = pOptions->mbHandoutHorizontal;
1654 /*************************************************************************
1656 |* SdOptionsPrintItem
1658 \************************************************************************/
1660 SdOptionsPrintItem::SdOptionsPrintItem( USHORT _nWhich )
1661 : SfxPoolItem ( _nWhich )
1662 , maOptionsPrint ( 0, FALSE )
1666 // ----------------------------------------------------------------------
1668 SdOptionsPrintItem::SdOptionsPrintItem( USHORT _nWhich, SdOptions* pOpts, ::sd::FrameView* )
1669 : SfxPoolItem ( _nWhich )
1670 , maOptionsPrint ( 0, FALSE )
1672 if( pOpts )
1674 maOptionsPrint.SetDraw( pOpts->IsDraw() );
1675 maOptionsPrint.SetNotes( pOpts->IsNotes() );
1676 maOptionsPrint.SetHandout( pOpts->IsHandout() );
1677 maOptionsPrint.SetOutline( pOpts->IsOutline() );
1678 maOptionsPrint.SetDate( pOpts->IsDate() );
1679 maOptionsPrint.SetTime( pOpts->IsTime() );
1680 maOptionsPrint.SetPagename( pOpts->IsPagename() );
1681 maOptionsPrint.SetHiddenPages( pOpts->IsHiddenPages() );
1682 maOptionsPrint.SetPagesize( pOpts->IsPagesize() );
1683 maOptionsPrint.SetPagetile( pOpts->IsPagetile() );
1684 maOptionsPrint.SetWarningPrinter( pOpts->IsWarningPrinter() );
1685 maOptionsPrint.SetWarningSize( pOpts->IsWarningSize() );
1686 maOptionsPrint.SetWarningOrientation( pOpts->IsWarningOrientation() );
1687 maOptionsPrint.SetBooklet( pOpts->IsBooklet() );
1688 maOptionsPrint.SetFrontPage( pOpts->IsFrontPage() );
1689 maOptionsPrint.SetBackPage( pOpts->IsBackPage() );
1690 maOptionsPrint.SetCutPage( pOpts->IsCutPage() );
1691 maOptionsPrint.SetPaperbin( pOpts->IsPaperbin() );
1692 maOptionsPrint.SetOutputQuality( pOpts->GetOutputQuality() );
1696 // ----------------------------------------------------------------------
1698 SfxPoolItem* SdOptionsPrintItem::Clone( SfxItemPool* ) const
1700 return new SdOptionsPrintItem( *this );
1703 // ----------------------------------------------------------------------
1705 int SdOptionsPrintItem::operator==( const SfxPoolItem& rAttr ) const
1707 const bool bSameType = SfxPoolItem::operator==(rAttr);
1708 DBG_ASSERT( bSameType, "SdOptionsPrintItem::operator==(), differen pool item type!" );
1709 return bSameType && ( maOptionsPrint == static_cast< const SdOptionsPrintItem& >( rAttr ).maOptionsPrint );
1712 // -----------------------------------------------------------------------
1714 void SdOptionsPrintItem::SetOptions( SdOptions* pOpts ) const
1716 if( pOpts )
1718 pOpts->SetDraw( maOptionsPrint.IsDraw() );
1719 pOpts->SetNotes( maOptionsPrint.IsNotes() );
1720 pOpts->SetHandout( maOptionsPrint.IsHandout() );
1721 pOpts->SetOutline( maOptionsPrint.IsOutline() );
1722 pOpts->SetDate( maOptionsPrint.IsDate() );
1723 pOpts->SetTime( maOptionsPrint.IsTime() );
1724 pOpts->SetPagename( maOptionsPrint.IsPagename() );
1725 pOpts->SetHiddenPages( maOptionsPrint.IsHiddenPages() );
1726 pOpts->SetPagesize( maOptionsPrint.IsPagesize() );
1727 pOpts->SetPagetile( maOptionsPrint.IsPagetile() );
1728 pOpts->SetWarningPrinter( maOptionsPrint.IsWarningPrinter() );
1729 pOpts->SetWarningSize( maOptionsPrint.IsWarningSize() );
1730 pOpts->SetWarningOrientation( maOptionsPrint.IsWarningOrientation() );
1731 pOpts->SetBooklet( maOptionsPrint.IsBooklet() );
1732 pOpts->SetFrontPage( maOptionsPrint.IsFrontPage() );
1733 pOpts->SetBackPage( maOptionsPrint.IsBackPage() );
1734 pOpts->SetCutPage( maOptionsPrint.IsCutPage() );
1735 pOpts->SetPaperbin( maOptionsPrint.IsPaperbin() );
1736 pOpts->SetOutputQuality( maOptionsPrint.GetOutputQuality() );
1740 /*************************************************************************
1742 |* SdOptions
1744 \************************************************************************/
1746 SdOptions::SdOptions( USHORT nConfigId ) :
1747 SdOptionsLayout( nConfigId, TRUE ),
1748 SdOptionsContents( nConfigId, TRUE ),
1749 SdOptionsMisc( nConfigId, TRUE ),
1750 SdOptionsSnap( nConfigId, TRUE ),
1751 SdOptionsZoom( nConfigId, TRUE ),
1752 SdOptionsGrid( nConfigId, TRUE ),
1753 SdOptionsPrint( nConfigId, TRUE )
1757 // ----------------------------------------------------------------------
1759 SdOptions::~SdOptions()
1763 // ----------------------------------------------------------------------
1765 void SdOptions::SetRangeDefaults( ULONG nOptionsRange )
1767 if( nOptionsRange & SD_OPTIONS_LAYOUT )
1768 SdOptionsLayout::SetDefaults();
1770 if( nOptionsRange & SD_OPTIONS_CONTENTS )
1771 SdOptionsContents::SetDefaults();
1773 if( nOptionsRange & SD_OPTIONS_MISC )
1774 SdOptionsMisc::SetDefaults();
1776 if( nOptionsRange & SD_OPTIONS_SNAP )
1777 SdOptionsSnap::SetDefaults();
1779 if( nOptionsRange & SD_OPTIONS_ZOOM )
1780 SdOptionsZoom::SetDefaults();
1782 if( nOptionsRange & SD_OPTIONS_GRID )
1783 SdOptionsGrid::SetDefaults();
1785 if( nOptionsRange & SD_OPTIONS_PRINT )
1786 SdOptionsPrint::SetDefaults();
1789 // ----------------------------------------------------------------------
1791 void SdOptions::StoreConfig( ULONG nOptionsRange )
1793 if( nOptionsRange & SD_OPTIONS_LAYOUT )
1794 SdOptionsLayout::Store();
1796 if( nOptionsRange & SD_OPTIONS_CONTENTS )
1797 SdOptionsContents::Store();
1799 if( nOptionsRange & SD_OPTIONS_MISC )
1800 SdOptionsMisc::Store();
1802 if( nOptionsRange & SD_OPTIONS_SNAP )
1803 SdOptionsSnap::Store();
1805 if( nOptionsRange & SD_OPTIONS_ZOOM )
1806 SdOptionsZoom::Store();
1808 if( nOptionsRange & SD_OPTIONS_GRID )
1809 SdOptionsGrid::Store();
1811 if( nOptionsRange & SD_OPTIONS_PRINT )
1812 SdOptionsPrint::Store();