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