LCOV - code coverage report
Current view: top level - sd/source/ui/app - optsitem.cxx (source / functions) Hit Total Coverage
Test: commit 0e63ca4fde4e446f346e35849c756a30ca294aab Lines: 231 721 32.0 %
Date: 2014-04-11 Functions: 38 90 42.2 %
Legend: Lines: hit not hit

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

Generated by: LCOV version 1.10