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