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