xref: /AOO41X/main/unotools/source/config/optionsdrawinglayer.cxx (revision 1ecadb572e7010ff3b3382ad9bf179dbc6efadbb)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 #ifdef _MSC_VER
28 #pragma hdrstop
29 #endif
30 
31 //_________________________________________________________________________________________________________________
32 //	includes
33 //_________________________________________________________________________________________________________________
34 
35 #include <unotools/optionsdrawinglayer.hxx>
36 #include <unotools/configmgr.hxx>
37 #include <unotools/configitem.hxx>
38 #include <tools/debug.hxx>
39 #include <com/sun/star/uno/Any.hxx>
40 #include <com/sun/star/uno/Sequence.hxx>
41 #include <vcl/svapp.hxx>
42 #include <vcl/outdev.hxx>
43 
44 //_________________________________________________________________________________________________________________
45 //	namespaces
46 //_________________________________________________________________________________________________________________
47 
48 using namespace ::utl					;
49 using namespace ::rtl					;
50 using namespace ::osl					;
51 using namespace ::com::sun::star::uno	;
52 
53 //_________________________________________________________________________________________________________________
54 //	const
55 //_________________________________________________________________________________________________________________
56 
57 #define	ROOTNODE_START			   		OUString(RTL_CONSTASCII_USTRINGPARAM("Office.Common/Drawinglayer"	))
58 #define	DEFAULT_OVERLAYBUFFER			sal_True
59 #define	DEFAULT_PAINTBUFFER				sal_True
60 #define	DEFAULT_STRIPE_COLOR_A			0
61 #define	DEFAULT_STRIPE_COLOR_B			16581375
62 #define	DEFAULT_STRIPE_LENGTH			4
63 
64 // #i73602#
65 // #i74769#, #i75172# : Change default for Calc and Writer to True
66 #define	DEFAULT_OVERLAYBUFFER_CALC			sal_True
67 #define	DEFAULT_OVERLAYBUFFER_WRITER		sal_True
68 #define	DEFAULT_OVERLAYBUFFER_DRAWIMPRESS	sal_True
69 
70 // #i74769#, #i75172#
71 #define	DEFAULT_PAINTBUFFER_CALC			sal_True
72 #define	DEFAULT_PAINTBUFFER_WRITER			sal_True
73 #define	DEFAULT_PAINTBUFFER_DRAWIMPRESS		sal_True
74 
75 // #i4219#
76 #define	DEFAULT_MAXIMUMPAPERWIDTH			300
77 #define	DEFAULT_MAXIMUMPAPERHEIGHT			300
78 #define	DEFAULT_MAXIMUMPAPERLEFTMARGIN		9999
79 #define	DEFAULT_MAXIMUMPAPERRIGHTMARGIN		9999
80 #define	DEFAULT_MAXIMUMPAPERTOPMARGIN		9999
81 #define	DEFAULT_MAXIMUMPAPERBOTTOMMARGIN	9999
82 
83 // primitives
84 #define	DEFAULT_ANTIALIASING                        sal_True
85 #define	DEFAULT_SNAPHORVERLINESTODISCRETE			sal_True
86 #define	DEFAULT_SOLIDDRAGCREATE                     sal_True
87 #define	DEFAULT_RENDERDECORATEDTEXTDIRECT           sal_True
88 #define	DEFAULT_RENDERSIMPLETEXTDIRECT              sal_True
89 #define	DEFAULT_QUADRATIC3DRENDERLIMIT              1000000
90 #define	DEFAULT_QUADRATICFORMCONTROLRENDERLIMIT     45000
91 
92 // #i97672# selection settings
93 #define	DEFAULT_TRANSPARENTSELECTION                sal_True
94 #define DEFAULT_TRANSPARENTSELECTIONPERCENT			75
95 #define DEFAULT_SELECTIONMAXIMUMLUMINANCEPERCENT    70
96 
97 #define	PROPERTYNAME_OVERLAYBUFFER		OUString(RTL_CONSTASCII_USTRINGPARAM("OverlayBuffer"	))
98 #define	PROPERTYNAME_PAINTBUFFER		OUString(RTL_CONSTASCII_USTRINGPARAM("PaintBuffer"		))
99 #define	PROPERTYNAME_STRIPE_COLOR_A		OUString(RTL_CONSTASCII_USTRINGPARAM("StripeColorA"		))
100 #define	PROPERTYNAME_STRIPE_COLOR_B		OUString(RTL_CONSTASCII_USTRINGPARAM("StripeColorB"		))
101 #define	PROPERTYNAME_STRIPE_LENGTH		OUString(RTL_CONSTASCII_USTRINGPARAM("StripeLength"		))
102 
103 // #i73602#
104 #define	PROPERTYNAME_OVERLAYBUFFER_CALC			OUString(RTL_CONSTASCII_USTRINGPARAM("OverlayBuffer_Calc"))
105 #define	PROPERTYNAME_OVERLAYBUFFER_WRITER		OUString(RTL_CONSTASCII_USTRINGPARAM("OverlayBuffer_Writer"))
106 #define	PROPERTYNAME_OVERLAYBUFFER_DRAWIMPRESS	OUString(RTL_CONSTASCII_USTRINGPARAM("OverlayBuffer_DrawImpress"))
107 
108 // #i74769#, #i75172#
109 #define	PROPERTYNAME_PAINTBUFFER_CALC			OUString(RTL_CONSTASCII_USTRINGPARAM("PaintBuffer_Calc"))
110 #define	PROPERTYNAME_PAINTBUFFER_WRITER			OUString(RTL_CONSTASCII_USTRINGPARAM("PaintBuffer_Writer"))
111 #define	PROPERTYNAME_PAINTBUFFER_DRAWIMPRESS	OUString(RTL_CONSTASCII_USTRINGPARAM("PaintBuffer_DrawImpress"))
112 
113 // #i4219#
114 #define	PROPERTYNAME_MAXIMUMPAPERWIDTH OUString(RTL_CONSTASCII_USTRINGPARAM("MaximumPaperWidth"))
115 #define	PROPERTYNAME_MAXIMUMPAPERHEIGHT OUString(RTL_CONSTASCII_USTRINGPARAM("MaximumPaperHeight"))
116 #define	PROPERTYNAME_MAXIMUMPAPERLEFTMARGIN OUString(RTL_CONSTASCII_USTRINGPARAM("MaximumPaperLeftMargin"))
117 #define	PROPERTYNAME_MAXIMUMPAPERRIGHTMARGIN OUString(RTL_CONSTASCII_USTRINGPARAM("MaximumPaperRightMargin"))
118 #define	PROPERTYNAME_MAXIMUMPAPERTOPMARGIN OUString(RTL_CONSTASCII_USTRINGPARAM("MaximumPaperTopMargin"))
119 #define	PROPERTYNAME_MAXIMUMPAPERBOTTOMMARGIN OUString(RTL_CONSTASCII_USTRINGPARAM("MaximumPaperBottomMargin"))
120 
121 // primitives
122 #define	PROPERTYNAME_ANTIALIASING OUString(RTL_CONSTASCII_USTRINGPARAM("AntiAliasing"))
123 #define	PROPERTYNAME_SNAPHORVERLINESTODISCRETE OUString(RTL_CONSTASCII_USTRINGPARAM("SnapHorVerLinesToDiscrete"))
124 #define	PROPERTYNAME_SOLIDDRAGCREATE OUString(RTL_CONSTASCII_USTRINGPARAM("SolidDragCreate"))
125 #define	PROPERTYNAME_RENDERDECORATEDTEXTDIRECT OUString(RTL_CONSTASCII_USTRINGPARAM("RenderDecoratedTextDirect"))
126 #define	PROPERTYNAME_RENDERSIMPLETEXTDIRECT OUString(RTL_CONSTASCII_USTRINGPARAM("RenderSimpleTextDirect"))
127 #define	PROPERTYNAME_QUADRATIC3DRENDERLIMIT OUString(RTL_CONSTASCII_USTRINGPARAM("Quadratic3DRenderLimit"))
128 #define	PROPERTYNAME_QUADRATICFORMCONTROLRENDERLIMIT OUString(RTL_CONSTASCII_USTRINGPARAM("QuadraticFormControlRenderLimit"))
129 
130 // #i97672# selection settings
131 #define	PROPERTYNAME_TRANSPARENTSELECTION OUString(RTL_CONSTASCII_USTRINGPARAM("TransparentSelection"))
132 #define	PROPERTYNAME_TRANSPARENTSELECTIONPERCENT OUString(RTL_CONSTASCII_USTRINGPARAM("TransparentSelectionPercent"))
133 #define	PROPERTYNAME_SELECTIONMAXIMUMLUMINANCEPERCENT OUString(RTL_CONSTASCII_USTRINGPARAM("SelectionMaximumLuminancePercent"))
134 
135 #define	PROPERTYHANDLE_OVERLAYBUFFER				0
136 #define	PROPERTYHANDLE_PAINTBUFFER					1
137 #define	PROPERTYHANDLE_STRIPE_COLOR_A				2
138 #define	PROPERTYHANDLE_STRIPE_COLOR_B				3
139 #define	PROPERTYHANDLE_STRIPE_LENGTH				4
140 
141 // #i73602#
142 #define	PROPERTYHANDLE_OVERLAYBUFFER_CALC			5
143 #define	PROPERTYHANDLE_OVERLAYBUFFER_WRITER			6
144 #define	PROPERTYHANDLE_OVERLAYBUFFER_DRAWIMPRESS	7
145 
146 // #i74769#, #i75172#
147 #define	PROPERTYHANDLE_PAINTBUFFER_CALC				8
148 #define	PROPERTYHANDLE_PAINTBUFFER_WRITER			9
149 #define	PROPERTYHANDLE_PAINTBUFFER_DRAWIMPRESS		10
150 
151 // #i4219#
152 #define	PROPERTYHANDLE_MAXIMUMPAPERWIDTH			11
153 #define	PROPERTYHANDLE_MAXIMUMPAPERHEIGHT			12
154 #define	PROPERTYHANDLE_MAXIMUMPAPERLEFTMARGIN		13
155 #define	PROPERTYHANDLE_MAXIMUMPAPERRIGHTMARGIN		14
156 #define	PROPERTYHANDLE_MAXIMUMPAPERTOPMARGIN		15
157 #define	PROPERTYHANDLE_MAXIMUMPAPERBOTTOMMARGIN		16
158 
159 // primitives
160 #define	PROPERTYHANDLE_ANTIALIASING                     17
161 #define	PROPERTYHANDLE_SNAPHORVERLINESTODISCRETE        18
162 #define	PROPERTYHANDLE_SOLIDDRAGCREATE					19
163 #define	PROPERTYHANDLE_RENDERDECORATEDTEXTDIRECT        20
164 #define	PROPERTYHANDLE_RENDERSIMPLETEXTDIRECT           21
165 #define	PROPERTYHANDLE_QUADRATIC3DRENDERLIMIT           22
166 #define	PROPERTYHANDLE_QUADRATICFORMCONTROLRENDERLIMIT  23
167 
168 // #i97672# selection settings
169 #define	PROPERTYHANDLE_TRANSPARENTSELECTION             24
170 #define	PROPERTYHANDLE_TRANSPARENTSELECTIONPERCENT      25
171 #define	PROPERTYHANDLE_SELECTIONMAXIMUMLUMINANCEPERCENT 26
172 
173 #define	PROPERTYCOUNT								27
174 
175 class SvtOptionsDrawinglayer_Impl : public ConfigItem
176 {
177 public:
178 
179 //---------------------------------------------------------------------------------------------------------
180 //	constructor / destructor
181 //---------------------------------------------------------------------------------------------------------
182 
183 	 SvtOptionsDrawinglayer_Impl();
184 	~SvtOptionsDrawinglayer_Impl();
185 
186 //---------------------------------------------------------------------------------------------------------
187 //	overloaded methods of baseclass
188 //---------------------------------------------------------------------------------------------------------
189 
190 	virtual void Commit();
191 
192 //---------------------------------------------------------------------------------------------------------
193 //	public interface
194 //---------------------------------------------------------------------------------------------------------
195 
196 	sal_Bool	IsOverlayBuffer() const;
197 	sal_Bool	IsPaintBuffer() const;
198 	Color		GetStripeColorA() const;
199 	Color		GetStripeColorB() const;
200 	sal_uInt16	GetStripeLength() const;
201 
202 	// #i73602#
203 	sal_Bool	IsOverlayBuffer_Calc() const;
204 	sal_Bool	IsOverlayBuffer_Writer() const;
205 	sal_Bool	IsOverlayBuffer_DrawImpress() const;
206 
207 	// #i74769#, #i75172#
208 	sal_Bool	IsPaintBuffer_Calc() const;
209 	sal_Bool	IsPaintBuffer_Writer() const;
210 	sal_Bool	IsPaintBuffer_DrawImpress() const;
211 
212 	void		SetOverlayBuffer( sal_Bool bState );
213 	void		SetPaintBuffer( sal_Bool bState );
214 	void		SetStripeColorA( Color aColor );
215 	void		SetStripeColorB( Color aColor );
216 	void		SetStripeLength( sal_uInt16 nLength );
217 
218 	// #i73602#
219 	void		SetOverlayBuffer_Calc( sal_Bool bState );
220 	void		SetOverlayBuffer_Writer( sal_Bool bState );
221 	void		SetOverlayBuffer_DrawImpress( sal_Bool bState );
222 
223 	// #i74769#, #i75172#
224 	void		SetPaintBuffer_Calc( sal_Bool bState );
225 	void		SetPaintBuffer_Writer( sal_Bool bState );
226 	void		SetPaintBuffer_DrawImpress( sal_Bool bState );
227 
228 	// #i4219#
229 	sal_uInt32 GetMaximumPaperWidth() const;
230 	sal_uInt32 GetMaximumPaperHeight() const;
231 	sal_uInt32 GetMaximumPaperLeftMargin() const;
232 	sal_uInt32 GetMaximumPaperRightMargin() const;
233 	sal_uInt32 GetMaximumPaperTopMargin() const;
234 	sal_uInt32 GetMaximumPaperBottomMargin() const;
235 
236 	void SetMaximumPaperWidth(sal_uInt32 nNew);
237 	void SetMaximumPaperHeight(sal_uInt32 nNew);
238 	void SetMaximumPaperLeftMargin(sal_uInt32 nNew);
239 	void SetMaximumPaperRightMargin(sal_uInt32 nNew);
240 	void SetMaximumPaperTopMargin(sal_uInt32 nNew);
241 	void SetMaximumPaperBottomMargin(sal_uInt32 nNew);
242 
243     // helper
244     sal_Bool IsAAPossibleOnThisSystem() const;
245 
246     // primitives
247 	sal_Bool	IsAntiAliasing() const;
248 	sal_Bool	IsSnapHorVerLinesToDiscrete() const;
249 	sal_Bool	IsSolidDragCreate() const;
250 	sal_Bool	IsRenderDecoratedTextDirect() const;
251 	sal_Bool	IsRenderSimpleTextDirect() const;
252 	sal_uInt32  GetQuadratic3DRenderLimit() const;
253 	sal_uInt32  GetQuadraticFormControlRenderLimit() const;
254 
255     void		SetAntiAliasing( sal_Bool bState );
256     void		SetSnapHorVerLinesToDiscrete( sal_Bool bState );
257 	void		SetSolidDragCreate( sal_Bool bState );
258 	void		SetRenderDecoratedTextDirect( sal_Bool bState );
259 	void		SetRenderSimpleTextDirect( sal_Bool bState );
260 	void        SetQuadratic3DRenderLimit(sal_uInt32 nNew);
261 	void        SetQuadraticFormControlRenderLimit(sal_uInt32 nNew);
262 
263 	// #i97672# selection settings
264 	sal_Bool	IsTransparentSelection() const;
265 	sal_uInt16	GetTransparentSelectionPercent() const;
266 	sal_uInt16	GetSelectionMaximumLuminancePercent() const;
267 
268 	void		SetTransparentSelection( sal_Bool bState );
269 	void		SetTransparentSelectionPercent( sal_uInt16 nPercent );
270 	void		SetSelectionMaximumLuminancePercent( sal_uInt16 nPercent );
271 
272 //-------------------------------------------------------------------------------------------------------------
273 //	private methods
274 //-------------------------------------------------------------------------------------------------------------
275 
276 private:
277 
278 	static Sequence< OUString > impl_GetPropertyNames();
279 
280 //-------------------------------------------------------------------------------------------------------------
281 //	private member
282 //-------------------------------------------------------------------------------------------------------------
283 
284 private:
285 
286 		sal_Bool	m_bOverlayBuffer;
287 		sal_Bool	m_bPaintBuffer;
288 		Color		m_bStripeColorA;
289 		Color		m_bStripeColorB;
290 		sal_uInt16	m_nStripeLength;
291 
292 		// #i73602#
293 		sal_Bool	m_bOverlayBuffer_Calc;
294 		sal_Bool	m_bOverlayBuffer_Writer;
295 		sal_Bool	m_bOverlayBuffer_DrawImpress;
296 
297 		// #i74769#, #i75172#
298 		sal_Bool	m_bPaintBuffer_Calc;
299 		sal_Bool	m_bPaintBuffer_Writer;
300 		sal_Bool	m_bPaintBuffer_DrawImpress;
301 
302 		// #i4219#
303 		sal_uInt32	m_nMaximumPaperWidth;
304 		sal_uInt32	m_nMaximumPaperHeight;
305 		sal_uInt32	m_nMaximumPaperLeftMargin;
306 		sal_uInt32	m_nMaximumPaperRightMargin;
307 		sal_uInt32	m_nMaximumPaperTopMargin;
308 		sal_uInt32	m_nMaximumPaperBottomMargin;
309 
310         // primitives
311 		sal_Bool	m_bAntiAliasing;
312 		sal_Bool	m_bSnapHorVerLinesToDiscrete;
313 		sal_Bool	m_bSolidDragCreate;
314 		sal_Bool	m_bRenderDecoratedTextDirect;
315 		sal_Bool	m_bRenderSimpleTextDirect;
316 		sal_uInt32	m_nQuadratic3DRenderLimit;
317 		sal_uInt32	m_nQuadraticFormControlRenderLimit;
318 
319 		// #i97672# selection settings
320 		sal_uInt16	m_nTransparentSelectionPercent;
321 		sal_uInt16	m_nSelectionMaximumLuminancePercent;
322 		sal_Bool	m_bTransparentSelection;
323 
324         // local values
325         bool        m_bAllowAA : 1;
326         bool        m_bAllowAAChecked : 1;
327 };
328 
329 //_________________________________________________________________________________________________________________
330 //	definitions
331 //_________________________________________________________________________________________________________________
332 
333 //*****************************************************************************************************************
334 //	constructor
335 //*****************************************************************************************************************
336 SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl() :
337 	ConfigItem( ROOTNODE_START	),
338 	m_bOverlayBuffer( DEFAULT_OVERLAYBUFFER ),
339 	m_bPaintBuffer( DEFAULT_PAINTBUFFER ),
340 	m_bStripeColorA(Color(DEFAULT_STRIPE_COLOR_A)),
341 	m_bStripeColorB(Color(DEFAULT_STRIPE_COLOR_B)),
342 	m_nStripeLength(DEFAULT_STRIPE_LENGTH),
343 
344 	// #i73602#
345 	m_bOverlayBuffer_Calc( DEFAULT_OVERLAYBUFFER_CALC ),
346 	m_bOverlayBuffer_Writer( DEFAULT_OVERLAYBUFFER_WRITER ),
347 	m_bOverlayBuffer_DrawImpress( DEFAULT_OVERLAYBUFFER_DRAWIMPRESS ),
348 
349 	// #i74769#, #i75172#
350 	m_bPaintBuffer_Calc( DEFAULT_PAINTBUFFER_CALC ),
351 	m_bPaintBuffer_Writer( DEFAULT_PAINTBUFFER_WRITER ),
352 	m_bPaintBuffer_DrawImpress( DEFAULT_PAINTBUFFER_DRAWIMPRESS ),
353 
354 	// #i4219#
355 	m_nMaximumPaperWidth(DEFAULT_MAXIMUMPAPERWIDTH),
356 	m_nMaximumPaperHeight(DEFAULT_MAXIMUMPAPERHEIGHT),
357 	m_nMaximumPaperLeftMargin(DEFAULT_MAXIMUMPAPERLEFTMARGIN),
358 	m_nMaximumPaperRightMargin(DEFAULT_MAXIMUMPAPERRIGHTMARGIN),
359 	m_nMaximumPaperTopMargin(DEFAULT_MAXIMUMPAPERTOPMARGIN),
360 	m_nMaximumPaperBottomMargin(DEFAULT_MAXIMUMPAPERBOTTOMMARGIN),
361 
362     // primitives
363 	m_bAntiAliasing(DEFAULT_ANTIALIASING),
364 	m_bSnapHorVerLinesToDiscrete(DEFAULT_SNAPHORVERLINESTODISCRETE),
365 	m_bSolidDragCreate(DEFAULT_SOLIDDRAGCREATE),
366 	m_bRenderDecoratedTextDirect(DEFAULT_RENDERDECORATEDTEXTDIRECT),
367 	m_bRenderSimpleTextDirect(DEFAULT_RENDERSIMPLETEXTDIRECT),
368 	m_nQuadratic3DRenderLimit(DEFAULT_QUADRATIC3DRENDERLIMIT),
369 	m_nQuadraticFormControlRenderLimit(DEFAULT_QUADRATICFORMCONTROLRENDERLIMIT),
370 
371 	// #i97672# selection settings
372 	m_nTransparentSelectionPercent(DEFAULT_TRANSPARENTSELECTIONPERCENT),
373 	m_nSelectionMaximumLuminancePercent(DEFAULT_SELECTIONMAXIMUMLUMINANCEPERCENT),
374 	m_bTransparentSelection(DEFAULT_TRANSPARENTSELECTION),
375 
376     // local values
377     m_bAllowAA(true),
378     m_bAllowAAChecked(false)
379 {
380 	Sequence< OUString >	seqNames( impl_GetPropertyNames() );
381 	Sequence< Any >			seqValues	= GetProperties( seqNames )	;
382 
383 	DBG_ASSERT( !(seqNames.getLength()!=seqValues.getLength()), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nI miss some values of configuration keys!\n" );
384 
385 	// Copy values from list in right order to ouer internal member.
386 	sal_Int32 nPropertyCount = seqValues.getLength();
387 	sal_Int32 nProperty	= 0;
388 
389 	for( nProperty=0; nProperty<nPropertyCount; ++nProperty )
390 	{
391 		DBG_ASSERT( !(seqValues[nProperty].hasValue()==sal_False), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nInvalid property value for property detected!\n" );
392 
393         switch( nProperty )
394         {
395             case PROPERTYHANDLE_OVERLAYBUFFER:
396 			{
397 				DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\OverlayBuffer\"?" );
398 				seqValues[nProperty] >>= m_bOverlayBuffer;
399 			}
400 			break;
401 
402             case PROPERTYHANDLE_PAINTBUFFER:
403 			{
404 				DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\PaintBuffer\"?" );
405 				seqValues[nProperty] >>= m_bPaintBuffer;
406 			}
407 			break;
408 
409 			case PROPERTYHANDLE_STRIPE_COLOR_A:
410 			{
411 				DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_LONG), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\StripeColorA\"?" );
412 				sal_Int32 nValue = 0;
413 				seqValues[nProperty] >>= nValue;
414 				m_bStripeColorA = nValue;
415 			}
416 			break;
417 
418 			case PROPERTYHANDLE_STRIPE_COLOR_B:
419 			{
420 				DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_LONG), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\StripeColorB\"?" );
421 				sal_Int32 nValue = 0;
422 				seqValues[nProperty] >>= nValue;
423 				m_bStripeColorB = nValue;
424 			}
425 			break;
426 
427 			case PROPERTYHANDLE_STRIPE_LENGTH:
428 			{
429 				DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_SHORT), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\StripeLength\"?" );
430 				seqValues[nProperty] >>= m_nStripeLength;
431 			}
432 			break;
433 
434 			// #i73602#
435             case PROPERTYHANDLE_OVERLAYBUFFER_CALC:
436 			{
437 				DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\OverlayBuffer_Calc\"?" );
438 				seqValues[nProperty] >>= m_bOverlayBuffer_Calc;
439 			}
440 			break;
441 
442 			case PROPERTYHANDLE_OVERLAYBUFFER_WRITER:
443 			{
444 				DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\OverlayBuffer_Writer\"?" );
445 				seqValues[nProperty] >>= m_bOverlayBuffer_Writer;
446 			}
447 			break;
448 
449 			case PROPERTYHANDLE_OVERLAYBUFFER_DRAWIMPRESS:
450 			{
451 				DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\OverlayBuffer_DrawImpress\"?" );
452 				seqValues[nProperty] >>= m_bOverlayBuffer_DrawImpress;
453 			}
454 			break;
455 
456 			// #i74769#, #i75172#
457             case PROPERTYHANDLE_PAINTBUFFER_CALC:
458 			{
459 				DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\PaintBuffer_Calc\"?" );
460 				seqValues[nProperty] >>= m_bPaintBuffer_Calc;
461 			}
462 			break;
463 
464 			case PROPERTYHANDLE_PAINTBUFFER_WRITER:
465 			{
466 				DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\PaintBuffer_Writer\"?" );
467 				seqValues[nProperty] >>= m_bPaintBuffer_Writer;
468 			}
469 			break;
470 
471 			case PROPERTYHANDLE_PAINTBUFFER_DRAWIMPRESS:
472 			{
473 				DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\PaintBuffer_DrawImpress\"?" );
474 				seqValues[nProperty] >>= m_bPaintBuffer_DrawImpress;
475 			}
476 			break;
477 
478 			// #i4219#
479 			case PROPERTYHANDLE_MAXIMUMPAPERWIDTH:
480 			{
481 				DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_LONG), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\MaximumPaperWidth\"?" );
482 				seqValues[nProperty] >>= m_nMaximumPaperWidth;
483 			}
484 			break;
485 
486 			case PROPERTYHANDLE_MAXIMUMPAPERHEIGHT:
487 			{
488 				DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_LONG), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\MaximumPaperHeight\"?" );
489 				seqValues[nProperty] >>= m_nMaximumPaperHeight;
490 			}
491 			break;
492 
493 			case PROPERTYHANDLE_MAXIMUMPAPERLEFTMARGIN:
494 			{
495 				DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_LONG), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\MaximumPaperLeftMargin\"?" );
496 				seqValues[nProperty] >>= m_nMaximumPaperLeftMargin;
497 			}
498 			break;
499 
500 			case PROPERTYHANDLE_MAXIMUMPAPERRIGHTMARGIN:
501 			{
502 				DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_LONG), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\MaximumPaperRightMargin\"?" );
503 				seqValues[nProperty] >>= m_nMaximumPaperRightMargin;
504 			}
505 			break;
506 
507 			case PROPERTYHANDLE_MAXIMUMPAPERTOPMARGIN:
508 			{
509 				DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_LONG), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\MaximumPaperTopMargin\"?" );
510 				seqValues[nProperty] >>= m_nMaximumPaperTopMargin;
511 			}
512 			break;
513 
514 			case PROPERTYHANDLE_MAXIMUMPAPERBOTTOMMARGIN:
515 			{
516 				DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_LONG), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\MaximumPaperBottomMargin\"?" );
517 				seqValues[nProperty] >>= m_nMaximumPaperBottomMargin;
518 			}
519 			break;
520 
521             // primitives
522             case PROPERTYHANDLE_ANTIALIASING:
523 			{
524 				DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\AntiAliasing\"?" );
525 				seqValues[nProperty] >>= m_bAntiAliasing;
526 			}
527 			break;
528 
529             // primitives
530             case PROPERTYHANDLE_SNAPHORVERLINESTODISCRETE:
531 			{
532 				DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\SnapHorVerLinesToDiscrete\"?" );
533 				seqValues[nProperty] >>= m_bSnapHorVerLinesToDiscrete;
534 			}
535 			break;
536 
537             case PROPERTYHANDLE_SOLIDDRAGCREATE:
538 			{
539 				DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\SolidDragCreate\"?" );
540 				seqValues[nProperty] >>= m_bSolidDragCreate;
541 			}
542 			break;
543 
544             case PROPERTYHANDLE_RENDERDECORATEDTEXTDIRECT:
545 			{
546 				DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\RenderDecoratedTextDirect\"?" );
547 				seqValues[nProperty] >>= m_bRenderDecoratedTextDirect;
548 			}
549 			break;
550 
551             case PROPERTYHANDLE_RENDERSIMPLETEXTDIRECT:
552 			{
553 				DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\RenderSimpleTextDirect\"?" );
554 				seqValues[nProperty] >>= m_bRenderSimpleTextDirect;
555 			}
556 			break;
557 
558             case PROPERTYHANDLE_QUADRATIC3DRENDERLIMIT:
559 			{
560 				DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_LONG), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\Quadratic3DRenderLimit\"?" );
561 				seqValues[nProperty] >>= m_nQuadratic3DRenderLimit;
562 			}
563 			break;
564 
565             case PROPERTYHANDLE_QUADRATICFORMCONTROLRENDERLIMIT:
566 			{
567 				DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_LONG), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\QuadraticFormControlRenderLimit\"?" );
568 				seqValues[nProperty] >>= m_nQuadraticFormControlRenderLimit;
569 			}
570 			break;
571 
572 			// #i97672# selection settings
573             case PROPERTYHANDLE_TRANSPARENTSELECTION:
574 			{
575 				DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\TransparentSelection\"?" );
576 				seqValues[nProperty] >>= m_bTransparentSelection;
577 			}
578 			break;
579 
580 			case PROPERTYHANDLE_TRANSPARENTSELECTIONPERCENT:
581 			{
582 				DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_SHORT), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\TransparentSelectionPercent\"?" );
583 				seqValues[nProperty] >>= m_nTransparentSelectionPercent;
584 			}
585 
586 			case PROPERTYHANDLE_SELECTIONMAXIMUMLUMINANCEPERCENT:
587 			{
588 				DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_SHORT), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\SelectionMaximumLuminancePercent\"?" );
589 				seqValues[nProperty] >>= m_nSelectionMaximumLuminancePercent;
590 			}
591 			break;
592         }
593 	}
594 }
595 
596 //*****************************************************************************************************************
597 //	destructor
598 //*****************************************************************************************************************
599 SvtOptionsDrawinglayer_Impl::~SvtOptionsDrawinglayer_Impl()
600 {
601 	if( IsModified() )
602 		Commit();
603 }
604 
605 //*****************************************************************************************************************
606 //	Commit
607 //*****************************************************************************************************************
608 void SvtOptionsDrawinglayer_Impl::Commit()
609 {
610 	Sequence< OUString >	aSeqNames( impl_GetPropertyNames() );
611 	Sequence< Any >			aSeqValues( aSeqNames.getLength() );
612 
613 	for( sal_Int32 nProperty = 0, nCount = aSeqNames.getLength(); nProperty < nCount; ++nProperty )
614 	{
615         switch( nProperty )
616         {
617             case PROPERTYHANDLE_OVERLAYBUFFER:
618 				aSeqValues[nProperty] <<= m_bOverlayBuffer;
619 			break;
620 
621             case PROPERTYHANDLE_PAINTBUFFER:
622 				aSeqValues[nProperty] <<= m_bPaintBuffer;
623 			break;
624 
625 			case PROPERTYHANDLE_STRIPE_COLOR_A:
626 				aSeqValues[nProperty] <<= m_bStripeColorA.GetColor();
627 			break;
628 
629 			case PROPERTYHANDLE_STRIPE_COLOR_B:
630 				aSeqValues[nProperty] <<= m_bStripeColorB.GetColor();
631 			break;
632 
633 			case PROPERTYHANDLE_STRIPE_LENGTH:
634 				aSeqValues[nProperty] <<= m_nStripeLength;
635 			break;
636 
637 			// #i73602#
638             case PROPERTYHANDLE_OVERLAYBUFFER_CALC:
639 				aSeqValues[nProperty] <<= m_bOverlayBuffer_Calc;
640 			break;
641 
642 			case PROPERTYHANDLE_OVERLAYBUFFER_WRITER:
643 				aSeqValues[nProperty] <<= m_bOverlayBuffer_Writer;
644 			break;
645 
646 			case PROPERTYHANDLE_OVERLAYBUFFER_DRAWIMPRESS:
647 				aSeqValues[nProperty] <<= m_bOverlayBuffer_DrawImpress;
648 			break;
649 
650 			// #i74769#, #i75172#
651             case PROPERTYHANDLE_PAINTBUFFER_CALC:
652 				aSeqValues[nProperty] <<= m_bPaintBuffer_Calc;
653 			break;
654 
655 			case PROPERTYHANDLE_PAINTBUFFER_WRITER:
656 				aSeqValues[nProperty] <<= m_bPaintBuffer_Writer;
657 			break;
658 
659 			case PROPERTYHANDLE_PAINTBUFFER_DRAWIMPRESS:
660 				aSeqValues[nProperty] <<= m_bPaintBuffer_DrawImpress;
661 			break;
662 
663 			// #i4219#
664 			case PROPERTYHANDLE_MAXIMUMPAPERWIDTH:
665 				aSeqValues[nProperty] <<= m_nMaximumPaperWidth;
666 			break;
667 
668 			case PROPERTYHANDLE_MAXIMUMPAPERHEIGHT:
669 				aSeqValues[nProperty] <<= m_nMaximumPaperHeight;
670 			break;
671 
672 			case PROPERTYHANDLE_MAXIMUMPAPERLEFTMARGIN:
673 				aSeqValues[nProperty] <<= m_nMaximumPaperLeftMargin;
674 			break;
675 
676 			case PROPERTYHANDLE_MAXIMUMPAPERRIGHTMARGIN:
677 				aSeqValues[nProperty] <<= m_nMaximumPaperRightMargin;
678 			break;
679 
680 			case PROPERTYHANDLE_MAXIMUMPAPERTOPMARGIN:
681 				aSeqValues[nProperty] <<= m_nMaximumPaperTopMargin;
682 			break;
683 
684 			case PROPERTYHANDLE_MAXIMUMPAPERBOTTOMMARGIN:
685 				aSeqValues[nProperty] <<= m_nMaximumPaperBottomMargin;
686 			break;
687 
688             // primitives
689             case PROPERTYHANDLE_ANTIALIASING:
690 				aSeqValues[nProperty] <<= m_bAntiAliasing;
691 			break;
692 
693             case PROPERTYHANDLE_SNAPHORVERLINESTODISCRETE:
694 				aSeqValues[nProperty] <<= m_bSnapHorVerLinesToDiscrete;
695 			break;
696 
697             case PROPERTYHANDLE_SOLIDDRAGCREATE:
698 				aSeqValues[nProperty] <<= m_bSolidDragCreate;
699 			break;
700 
701             case PROPERTYHANDLE_RENDERDECORATEDTEXTDIRECT:
702 				aSeqValues[nProperty] <<= m_bRenderDecoratedTextDirect;
703 			break;
704 
705             case PROPERTYHANDLE_RENDERSIMPLETEXTDIRECT:
706 				aSeqValues[nProperty] <<= m_bRenderSimpleTextDirect;
707 			break;
708 
709             case PROPERTYHANDLE_QUADRATIC3DRENDERLIMIT:
710 				aSeqValues[nProperty] <<= m_nQuadratic3DRenderLimit;
711 			break;
712 
713             case PROPERTYHANDLE_QUADRATICFORMCONTROLRENDERLIMIT:
714 				aSeqValues[nProperty] <<= m_nQuadraticFormControlRenderLimit;
715 			break;
716 
717 			// #i97672# selection settings
718             case PROPERTYHANDLE_TRANSPARENTSELECTION:
719 				aSeqValues[nProperty] <<= m_bTransparentSelection;
720 			break;
721 
722 			case PROPERTYHANDLE_TRANSPARENTSELECTIONPERCENT:
723 				aSeqValues[nProperty] <<= m_nTransparentSelectionPercent;
724 			break;
725 
726 			case PROPERTYHANDLE_SELECTIONMAXIMUMLUMINANCEPERCENT:
727 				aSeqValues[nProperty] <<= m_nSelectionMaximumLuminancePercent;
728 			break;
729         }
730 	}
731 
732 	PutProperties( aSeqNames, aSeqValues );
733 }
734 
735 //*****************************************************************************************************************
736 //	public method
737 //*****************************************************************************************************************
738 sal_Bool SvtOptionsDrawinglayer_Impl::IsOverlayBuffer() const
739 {
740 	return m_bOverlayBuffer;
741 }
742 
743 //*****************************************************************************************************************
744 //	public method
745 //*****************************************************************************************************************
746 sal_Bool SvtOptionsDrawinglayer_Impl::IsPaintBuffer() const
747 {
748 	return m_bPaintBuffer;
749 }
750 
751 //*****************************************************************************************************************
752 //	public method
753 //*****************************************************************************************************************
754 Color SvtOptionsDrawinglayer_Impl::GetStripeColorA() const
755 {
756 	return m_bStripeColorA;
757 }
758 
759 //*****************************************************************************************************************
760 //	public method
761 //*****************************************************************************************************************
762 Color SvtOptionsDrawinglayer_Impl::GetStripeColorB() const
763 {
764 	return m_bStripeColorB;
765 }
766 
767 //*****************************************************************************************************************
768 //	public method
769 //*****************************************************************************************************************
770 sal_uInt16 SvtOptionsDrawinglayer_Impl::GetStripeLength() const
771 {
772 	return m_nStripeLength;
773 }
774 
775 // #i73602#
776 sal_Bool SvtOptionsDrawinglayer_Impl::IsOverlayBuffer_Calc() const
777 {
778 	return m_bOverlayBuffer_Calc;
779 }
780 
781 sal_Bool SvtOptionsDrawinglayer_Impl::IsOverlayBuffer_Writer() const
782 {
783 	return m_bOverlayBuffer_Writer;
784 }
785 
786 sal_Bool SvtOptionsDrawinglayer_Impl::IsOverlayBuffer_DrawImpress() const
787 {
788 	return m_bOverlayBuffer_DrawImpress;
789 }
790 
791 // #i74769#, #i75172#
792 sal_Bool SvtOptionsDrawinglayer_Impl::IsPaintBuffer_Calc() const
793 {
794 	return m_bPaintBuffer_Calc;
795 }
796 
797 sal_Bool SvtOptionsDrawinglayer_Impl::IsPaintBuffer_Writer() const
798 {
799 	return m_bPaintBuffer_Writer;
800 }
801 
802 sal_Bool SvtOptionsDrawinglayer_Impl::IsPaintBuffer_DrawImpress() const
803 {
804 	return m_bPaintBuffer_DrawImpress;
805 }
806 
807 // #i4219#
808 sal_uInt32 SvtOptionsDrawinglayer_Impl::GetMaximumPaperWidth() const
809 {
810 	return m_nMaximumPaperWidth;
811 }
812 
813 sal_uInt32 SvtOptionsDrawinglayer_Impl::GetMaximumPaperHeight() const
814 {
815 	return m_nMaximumPaperHeight;
816 }
817 
818 sal_uInt32 SvtOptionsDrawinglayer_Impl::GetMaximumPaperLeftMargin() const
819 {
820 	return m_nMaximumPaperLeftMargin;
821 }
822 
823 sal_uInt32 SvtOptionsDrawinglayer_Impl::GetMaximumPaperRightMargin() const
824 {
825 	return m_nMaximumPaperRightMargin;
826 }
827 
828 sal_uInt32 SvtOptionsDrawinglayer_Impl::GetMaximumPaperTopMargin() const
829 {
830 	return m_nMaximumPaperTopMargin;
831 }
832 
833 sal_uInt32 SvtOptionsDrawinglayer_Impl::GetMaximumPaperBottomMargin() const
834 {
835 	return m_nMaximumPaperBottomMargin;
836 }
837 
838 //*****************************************************************************************************************
839 //	public method
840 //*****************************************************************************************************************
841 void SvtOptionsDrawinglayer_Impl::SetOverlayBuffer( sal_Bool bState )
842 {
843 	if(m_bOverlayBuffer != bState)
844 	{
845 		m_bOverlayBuffer = bState;
846 		SetModified();
847 	}
848 }
849 
850 //*****************************************************************************************************************
851 //	public method
852 //*****************************************************************************************************************
853 void SvtOptionsDrawinglayer_Impl::SetPaintBuffer( sal_Bool bState )
854 {
855 	if(m_bPaintBuffer != bState)
856 	{
857 		m_bPaintBuffer = bState;
858 		SetModified();
859 	}
860 }
861 
862 //*****************************************************************************************************************
863 //	public method
864 //*****************************************************************************************************************
865 void SvtOptionsDrawinglayer_Impl::SetStripeColorA( Color aColor )
866 {
867 	if(m_bStripeColorA != aColor)
868 	{
869 		m_bStripeColorA = aColor;
870 		SetModified();
871 	}
872 }
873 
874 //*****************************************************************************************************************
875 //	public method
876 //*****************************************************************************************************************
877 void SvtOptionsDrawinglayer_Impl::SetStripeColorB( Color aColor )
878 {
879 	if(m_bStripeColorB != aColor)
880 	{
881 		m_bStripeColorB = aColor;
882 		SetModified();
883 	}
884 }
885 
886 //*****************************************************************************************************************
887 //	public method
888 //*****************************************************************************************************************
889 void SvtOptionsDrawinglayer_Impl::SetStripeLength( sal_uInt16 nLength )
890 {
891 	if(m_nStripeLength != nLength)
892 	{
893 		m_nStripeLength = nLength;
894 		SetModified();
895 	}
896 }
897 
898 // #i73602#
899 void SvtOptionsDrawinglayer_Impl::SetOverlayBuffer_Calc( sal_Bool bState )
900 {
901 	if(m_bOverlayBuffer_Calc != bState)
902 	{
903 		m_bOverlayBuffer_Calc = bState;
904 		SetModified();
905 	}
906 }
907 
908 void SvtOptionsDrawinglayer_Impl::SetOverlayBuffer_Writer( sal_Bool bState )
909 {
910 	if(m_bOverlayBuffer_Writer != bState)
911 	{
912 		m_bOverlayBuffer_Writer = bState;
913 		SetModified();
914 	}
915 }
916 
917 void SvtOptionsDrawinglayer_Impl::SetOverlayBuffer_DrawImpress( sal_Bool bState )
918 {
919 	if(m_bOverlayBuffer_DrawImpress != bState)
920 	{
921 		m_bOverlayBuffer_DrawImpress = bState;
922 		SetModified();
923 	}
924 }
925 
926 // #i74769#, #i75172#
927 void SvtOptionsDrawinglayer_Impl::SetPaintBuffer_Calc( sal_Bool bState )
928 {
929 	if(m_bPaintBuffer_Calc != bState)
930 	{
931 		m_bPaintBuffer_Calc = bState;
932 		SetModified();
933 	}
934 }
935 
936 void SvtOptionsDrawinglayer_Impl::SetPaintBuffer_Writer( sal_Bool bState )
937 {
938 	if(m_bPaintBuffer_Writer != bState)
939 	{
940 		m_bPaintBuffer_Writer = bState;
941 		SetModified();
942 	}
943 }
944 
945 void SvtOptionsDrawinglayer_Impl::SetPaintBuffer_DrawImpress( sal_Bool bState )
946 {
947 	if(m_bPaintBuffer_DrawImpress != bState)
948 	{
949 		m_bPaintBuffer_DrawImpress = bState;
950 		SetModified();
951 	}
952 }
953 
954 // #i4219#
955 void SvtOptionsDrawinglayer_Impl::SetMaximumPaperWidth( sal_uInt32 nNew )
956 {
957 	if(m_nMaximumPaperWidth != nNew)
958 	{
959 		m_nMaximumPaperWidth = nNew;
960 		SetModified();
961 	}
962 }
963 
964 void SvtOptionsDrawinglayer_Impl::SetMaximumPaperHeight( sal_uInt32 nNew )
965 {
966 	if(m_nMaximumPaperHeight != nNew)
967 	{
968 		m_nMaximumPaperHeight = nNew;
969 		SetModified();
970 	}
971 }
972 
973 void SvtOptionsDrawinglayer_Impl::SetMaximumPaperLeftMargin( sal_uInt32 nNew )
974 {
975 	if(m_nMaximumPaperLeftMargin != nNew)
976 	{
977 		m_nMaximumPaperLeftMargin = nNew;
978 		SetModified();
979 	}
980 }
981 
982 void SvtOptionsDrawinglayer_Impl::SetMaximumPaperRightMargin( sal_uInt32 nNew )
983 {
984 	if(m_nMaximumPaperRightMargin != nNew)
985 	{
986 		m_nMaximumPaperRightMargin = nNew;
987 		SetModified();
988 	}
989 }
990 
991 void SvtOptionsDrawinglayer_Impl::SetMaximumPaperTopMargin( sal_uInt32 nNew )
992 {
993 	if(m_nMaximumPaperTopMargin != nNew)
994 	{
995 		m_nMaximumPaperTopMargin = nNew;
996 		SetModified();
997 	}
998 }
999 
1000 void SvtOptionsDrawinglayer_Impl::SetMaximumPaperBottomMargin( sal_uInt32 nNew )
1001 {
1002 	if(m_nMaximumPaperBottomMargin != nNew)
1003 	{
1004 		m_nMaximumPaperBottomMargin = nNew;
1005 		SetModified();
1006 	}
1007 }
1008 
1009 // helper
1010 sal_Bool SvtOptionsDrawinglayer_Impl::IsAAPossibleOnThisSystem() const
1011 {
1012     if(!m_bAllowAAChecked)
1013     {
1014         SvtOptionsDrawinglayer_Impl* pThat = const_cast< SvtOptionsDrawinglayer_Impl* >(this);
1015         pThat->m_bAllowAAChecked = true;
1016 
1017 #ifdef WIN32
1018         // WIN32 uses GDIPlus with VCL forthe first incarnation; this will be enhanced
1019         // in the future to use canvases and the canvas renderer, thus a AA-abled
1020         // canvas needs to be checked here in the future.
1021         // Currently, just allow AA for WIN32
1022 #endif
1023 
1024 	    // check XRenderExtension
1025 	    if(m_bAllowAA && !Application::GetDefaultDevice()->supportsOperation( OutDevSupport_TransparentRect ))
1026 	    {
1027 		    pThat->m_bAllowAA = false;
1028 	    }
1029     }
1030 
1031     return m_bAllowAA;
1032 }
1033 
1034 // primitives
1035 sal_Bool SvtOptionsDrawinglayer_Impl::IsAntiAliasing() const
1036 {
1037 	return m_bAntiAliasing;
1038 }
1039 
1040 sal_Bool SvtOptionsDrawinglayer_Impl::IsSnapHorVerLinesToDiscrete() const
1041 {
1042 	return m_bSnapHorVerLinesToDiscrete;
1043 }
1044 
1045 sal_Bool SvtOptionsDrawinglayer_Impl::IsSolidDragCreate() const
1046 {
1047 	return m_bSolidDragCreate;
1048 }
1049 
1050 sal_Bool SvtOptionsDrawinglayer_Impl::IsRenderDecoratedTextDirect() const
1051 {
1052 	return m_bRenderDecoratedTextDirect;
1053 }
1054 
1055 sal_Bool SvtOptionsDrawinglayer_Impl::IsRenderSimpleTextDirect() const
1056 {
1057 	return m_bRenderSimpleTextDirect;
1058 }
1059 
1060 sal_uInt32 SvtOptionsDrawinglayer_Impl::GetQuadratic3DRenderLimit() const
1061 {
1062 	return m_nQuadratic3DRenderLimit;
1063 }
1064 
1065 sal_uInt32 SvtOptionsDrawinglayer_Impl::GetQuadraticFormControlRenderLimit() const
1066 {
1067 	return m_nQuadraticFormControlRenderLimit;
1068 }
1069 
1070 void SvtOptionsDrawinglayer_Impl::SetAntiAliasing( sal_Bool bState )
1071 {
1072 	if(m_bAntiAliasing != bState)
1073 	{
1074 		m_bAntiAliasing = bState;
1075 		SetModified();
1076 	}
1077 }
1078 
1079 void SvtOptionsDrawinglayer_Impl::SetSnapHorVerLinesToDiscrete( sal_Bool bState )
1080 {
1081 	if(m_bSnapHorVerLinesToDiscrete != bState)
1082 	{
1083 		m_bSnapHorVerLinesToDiscrete = bState;
1084 		SetModified();
1085 	}
1086 }
1087 
1088 void SvtOptionsDrawinglayer_Impl::SetSolidDragCreate( sal_Bool bState )
1089 {
1090 	if(m_bSolidDragCreate != bState)
1091 	{
1092 		m_bSolidDragCreate = bState;
1093 		SetModified();
1094 	}
1095 }
1096 
1097 void SvtOptionsDrawinglayer_Impl::SetRenderDecoratedTextDirect( sal_Bool bState )
1098 {
1099 	if(m_bRenderDecoratedTextDirect != bState)
1100 	{
1101 		m_bRenderDecoratedTextDirect = bState;
1102 		SetModified();
1103 	}
1104 }
1105 
1106 void SvtOptionsDrawinglayer_Impl::SetRenderSimpleTextDirect( sal_Bool bState )
1107 {
1108 	if(m_bRenderSimpleTextDirect != bState)
1109 	{
1110 		m_bRenderSimpleTextDirect = bState;
1111 		SetModified();
1112 	}
1113 }
1114 
1115 void SvtOptionsDrawinglayer_Impl::SetQuadratic3DRenderLimit(sal_uInt32 nNew)
1116 {
1117 	if(m_nQuadratic3DRenderLimit != nNew)
1118 	{
1119 		m_nQuadratic3DRenderLimit = nNew;
1120 		SetModified();
1121 	}
1122 }
1123 
1124 void SvtOptionsDrawinglayer_Impl::SetQuadraticFormControlRenderLimit(sal_uInt32 nNew)
1125 {
1126 	if(m_nQuadraticFormControlRenderLimit != nNew)
1127 	{
1128 		m_nQuadraticFormControlRenderLimit = nNew;
1129 		SetModified();
1130 	}
1131 }
1132 
1133 // #i97672# selection settings
1134 sal_Bool SvtOptionsDrawinglayer_Impl::IsTransparentSelection() const
1135 {
1136 	return m_bTransparentSelection;
1137 }
1138 
1139 void SvtOptionsDrawinglayer_Impl::SetTransparentSelection( sal_Bool bState )
1140 {
1141 	if(m_bTransparentSelection != bState)
1142 	{
1143 		m_bTransparentSelection = bState;
1144 		SetModified();
1145 	}
1146 }
1147 
1148 void SvtOptionsDrawinglayer_Impl::SetTransparentSelectionPercent( sal_uInt16 nPercent )
1149 {
1150 	if(m_nTransparentSelectionPercent != nPercent)
1151 	{
1152 		m_nTransparentSelectionPercent = nPercent;
1153 		SetModified();
1154 	}
1155 }
1156 
1157 sal_uInt16 SvtOptionsDrawinglayer_Impl::GetTransparentSelectionPercent() const
1158 {
1159 	return m_nTransparentSelectionPercent;
1160 }
1161 
1162 void SvtOptionsDrawinglayer_Impl::SetSelectionMaximumLuminancePercent( sal_uInt16 nPercent )
1163 {
1164 	if(m_nSelectionMaximumLuminancePercent != nPercent)
1165 	{
1166 		m_nSelectionMaximumLuminancePercent = nPercent;
1167 		SetModified();
1168 	}
1169 }
1170 
1171 sal_uInt16 SvtOptionsDrawinglayer_Impl::GetSelectionMaximumLuminancePercent() const
1172 {
1173 	return m_nSelectionMaximumLuminancePercent;
1174 }
1175 
1176 //*****************************************************************************************************************
1177 //	private method
1178 //*****************************************************************************************************************
1179 Sequence< OUString > SvtOptionsDrawinglayer_Impl::impl_GetPropertyNames()
1180 {
1181 	// Build static list of configuration key names.
1182 	static const OUString pProperties[] =
1183 	{
1184 		PROPERTYNAME_OVERLAYBUFFER		,
1185 		PROPERTYNAME_PAINTBUFFER		,
1186 		PROPERTYNAME_STRIPE_COLOR_A		,
1187 		PROPERTYNAME_STRIPE_COLOR_B		,
1188 		PROPERTYNAME_STRIPE_LENGTH		,
1189 
1190 		// #i73602#
1191 		PROPERTYNAME_OVERLAYBUFFER_CALC,
1192 		PROPERTYNAME_OVERLAYBUFFER_WRITER,
1193 		PROPERTYNAME_OVERLAYBUFFER_DRAWIMPRESS,
1194 
1195 		// #i74769#, #i75172#
1196 		PROPERTYNAME_PAINTBUFFER_CALC,
1197 		PROPERTYNAME_PAINTBUFFER_WRITER,
1198 		PROPERTYNAME_PAINTBUFFER_DRAWIMPRESS,
1199 
1200 		// #i4219#
1201 		PROPERTYNAME_MAXIMUMPAPERWIDTH,
1202 		PROPERTYNAME_MAXIMUMPAPERHEIGHT,
1203 		PROPERTYNAME_MAXIMUMPAPERLEFTMARGIN,
1204 		PROPERTYNAME_MAXIMUMPAPERRIGHTMARGIN,
1205 		PROPERTYNAME_MAXIMUMPAPERTOPMARGIN,
1206 		PROPERTYNAME_MAXIMUMPAPERBOTTOMMARGIN,
1207 
1208         // primitives
1209         PROPERTYNAME_ANTIALIASING,
1210 		PROPERTYNAME_SNAPHORVERLINESTODISCRETE,
1211         PROPERTYNAME_SOLIDDRAGCREATE,
1212         PROPERTYNAME_RENDERDECORATEDTEXTDIRECT,
1213         PROPERTYNAME_RENDERSIMPLETEXTDIRECT,
1214         PROPERTYNAME_QUADRATIC3DRENDERLIMIT,
1215         PROPERTYNAME_QUADRATICFORMCONTROLRENDERLIMIT,
1216 
1217 		// #i97672# selection settings
1218 		PROPERTYNAME_TRANSPARENTSELECTION,
1219 		PROPERTYNAME_TRANSPARENTSELECTIONPERCENT,
1220 		PROPERTYNAME_SELECTIONMAXIMUMLUMINANCEPERCENT
1221     };
1222 
1223 	// Initialize return sequence with these list ...
1224 	static const Sequence< OUString > seqPropertyNames( pProperties, PROPERTYCOUNT );
1225 	// ... and return it.
1226 	return seqPropertyNames;
1227 }
1228 
1229 //*****************************************************************************************************************
1230 //	initialize static member
1231 //	DON'T DO IT IN YOUR HEADER!
1232 //	see definition for further informations
1233 //*****************************************************************************************************************
1234 SvtOptionsDrawinglayer_Impl* SvtOptionsDrawinglayer::m_pDataContainer = NULL;
1235 sal_Int32 SvtOptionsDrawinglayer::m_nRefCount = 0;
1236 
1237 //*****************************************************************************************************************
1238 //	constructor
1239 //*****************************************************************************************************************
1240 SvtOptionsDrawinglayer::SvtOptionsDrawinglayer()
1241 {
1242     // Global access, must be guarded (multithreading!).
1243     MutexGuard aGuard( GetOwnStaticMutex() );
1244 	// Increase ouer refcount ...
1245 	++m_nRefCount;
1246 	// ... and initialize ouer data container only if it not already!
1247     if( m_pDataContainer == NULL )
1248 	{
1249         m_pDataContainer = new SvtOptionsDrawinglayer_Impl();
1250 	}
1251 }
1252 
1253 //*****************************************************************************************************************
1254 //	destructor
1255 //*****************************************************************************************************************
1256 SvtOptionsDrawinglayer::~SvtOptionsDrawinglayer()
1257 {
1258     // Global access, must be guarded (multithreading!)
1259     MutexGuard aGuard( GetOwnStaticMutex() );
1260 	// Decrease ouer refcount.
1261 	--m_nRefCount;
1262 	// If last instance was deleted ...
1263 	// we must destroy ouer static data container!
1264     if( m_nRefCount <= 0 )
1265 	{
1266 		delete m_pDataContainer;
1267 		m_pDataContainer = NULL;
1268 	}
1269 }
1270 
1271 //*****************************************************************************************************************
1272 //	public method
1273 //*****************************************************************************************************************
1274 sal_Bool SvtOptionsDrawinglayer::IsOverlayBuffer() const
1275 {
1276     MutexGuard aGuard( GetOwnStaticMutex() );
1277 	return m_pDataContainer->IsOverlayBuffer();
1278 }
1279 
1280 //*****************************************************************************************************************
1281 //	public method
1282 //*****************************************************************************************************************
1283 sal_Bool SvtOptionsDrawinglayer::IsPaintBuffer() const
1284 {
1285     MutexGuard aGuard( GetOwnStaticMutex() );
1286 	return m_pDataContainer->IsPaintBuffer();
1287 }
1288 
1289 //*****************************************************************************************************************
1290 //	public method
1291 //*****************************************************************************************************************
1292 Color SvtOptionsDrawinglayer::GetStripeColorA() const
1293 {
1294     MutexGuard aGuard( GetOwnStaticMutex() );
1295 	return m_pDataContainer->GetStripeColorA();
1296 }
1297 
1298 //*****************************************************************************************************************
1299 //	public method
1300 //*****************************************************************************************************************
1301 Color SvtOptionsDrawinglayer::GetStripeColorB() const
1302 {
1303     MutexGuard aGuard( GetOwnStaticMutex() );
1304 	return m_pDataContainer->GetStripeColorB();
1305 }
1306 
1307 //*****************************************************************************************************************
1308 //	public method
1309 //*****************************************************************************************************************
1310 sal_uInt16 SvtOptionsDrawinglayer::GetStripeLength() const
1311 {
1312     MutexGuard aGuard( GetOwnStaticMutex() );
1313 	return m_pDataContainer->GetStripeLength();
1314 }
1315 
1316 // #i73602#
1317 sal_Bool SvtOptionsDrawinglayer::IsOverlayBuffer_Calc() const
1318 {
1319     MutexGuard aGuard( GetOwnStaticMutex() );
1320 	return m_pDataContainer->IsOverlayBuffer_Calc();
1321 }
1322 
1323 sal_Bool SvtOptionsDrawinglayer::IsOverlayBuffer_Writer() const
1324 {
1325     MutexGuard aGuard( GetOwnStaticMutex() );
1326 	return m_pDataContainer->IsOverlayBuffer_Writer();
1327 }
1328 
1329 sal_Bool SvtOptionsDrawinglayer::IsOverlayBuffer_DrawImpress() const
1330 {
1331     MutexGuard aGuard( GetOwnStaticMutex() );
1332 	return m_pDataContainer->IsOverlayBuffer_DrawImpress();
1333 }
1334 
1335 // #i74769#, #i75172#
1336 sal_Bool SvtOptionsDrawinglayer::IsPaintBuffer_Calc() const
1337 {
1338     MutexGuard aGuard( GetOwnStaticMutex() );
1339 	return m_pDataContainer->IsPaintBuffer_Calc();
1340 }
1341 
1342 sal_Bool SvtOptionsDrawinglayer::IsPaintBuffer_Writer() const
1343 {
1344     MutexGuard aGuard( GetOwnStaticMutex() );
1345 	return m_pDataContainer->IsPaintBuffer_Writer();
1346 }
1347 
1348 sal_Bool SvtOptionsDrawinglayer::IsPaintBuffer_DrawImpress() const
1349 {
1350     MutexGuard aGuard( GetOwnStaticMutex() );
1351 	return m_pDataContainer->IsPaintBuffer_DrawImpress();
1352 }
1353 
1354 // #i4219#
1355 sal_uInt32 SvtOptionsDrawinglayer::GetMaximumPaperWidth() const
1356 {
1357     MutexGuard aGuard( GetOwnStaticMutex() );
1358 	return m_pDataContainer->GetMaximumPaperWidth();
1359 }
1360 
1361 sal_uInt32 SvtOptionsDrawinglayer::GetMaximumPaperHeight() const
1362 {
1363     MutexGuard aGuard( GetOwnStaticMutex() );
1364 	return m_pDataContainer->GetMaximumPaperHeight();
1365 }
1366 
1367 sal_uInt32 SvtOptionsDrawinglayer::GetMaximumPaperLeftMargin() const
1368 {
1369     MutexGuard aGuard( GetOwnStaticMutex() );
1370 	return m_pDataContainer->GetMaximumPaperLeftMargin();
1371 }
1372 
1373 sal_uInt32 SvtOptionsDrawinglayer::GetMaximumPaperRightMargin() const
1374 {
1375     MutexGuard aGuard( GetOwnStaticMutex() );
1376 	return m_pDataContainer->GetMaximumPaperRightMargin();
1377 }
1378 
1379 sal_uInt32 SvtOptionsDrawinglayer::GetMaximumPaperTopMargin() const
1380 {
1381     MutexGuard aGuard( GetOwnStaticMutex() );
1382 	return m_pDataContainer->GetMaximumPaperTopMargin();
1383 }
1384 
1385 sal_uInt32 SvtOptionsDrawinglayer::GetMaximumPaperBottomMargin() const
1386 {
1387     MutexGuard aGuard( GetOwnStaticMutex() );
1388 	return m_pDataContainer->GetMaximumPaperBottomMargin();
1389 }
1390 
1391 //*****************************************************************************************************************
1392 //	public method
1393 //*****************************************************************************************************************
1394 void SvtOptionsDrawinglayer::SetOverlayBuffer( sal_Bool bState )
1395 {
1396     MutexGuard aGuard( GetOwnStaticMutex() );
1397 	m_pDataContainer->SetOverlayBuffer( bState );
1398 }
1399 
1400 //*****************************************************************************************************************
1401 //	public method
1402 //*****************************************************************************************************************
1403 void SvtOptionsDrawinglayer::SetPaintBuffer( sal_Bool bState )
1404 {
1405     MutexGuard aGuard( GetOwnStaticMutex() );
1406 	m_pDataContainer->SetPaintBuffer( bState );
1407 }
1408 
1409 //*****************************************************************************************************************
1410 //	public method
1411 //*****************************************************************************************************************
1412 void SvtOptionsDrawinglayer::SetStripeColorA( Color aColor )
1413 {
1414     MutexGuard aGuard( GetOwnStaticMutex() );
1415 	m_pDataContainer->SetStripeColorA( aColor );
1416 }
1417 
1418 //*****************************************************************************************************************
1419 //	public method
1420 //*****************************************************************************************************************
1421 void SvtOptionsDrawinglayer::SetStripeColorB( Color aColor )
1422 {
1423     MutexGuard aGuard( GetOwnStaticMutex() );
1424 	m_pDataContainer->SetStripeColorB( aColor );
1425 }
1426 
1427 //*****************************************************************************************************************
1428 //	public method
1429 //*****************************************************************************************************************
1430 void SvtOptionsDrawinglayer::SetStripeLength( sal_uInt16 nLength )
1431 {
1432     MutexGuard aGuard( GetOwnStaticMutex() );
1433 	m_pDataContainer->SetStripeLength( nLength );
1434 }
1435 
1436 // #i73602#
1437 void SvtOptionsDrawinglayer::SetOverlayBuffer_Calc( sal_Bool bState )
1438 {
1439     MutexGuard aGuard( GetOwnStaticMutex() );
1440 	m_pDataContainer->SetOverlayBuffer_Calc( bState );
1441 }
1442 
1443 void SvtOptionsDrawinglayer::SetOverlayBuffer_Writer( sal_Bool bState )
1444 {
1445     MutexGuard aGuard( GetOwnStaticMutex() );
1446 	m_pDataContainer->SetOverlayBuffer_Writer( bState );
1447 }
1448 
1449 void SvtOptionsDrawinglayer::SetOverlayBuffer_DrawImpress( sal_Bool bState )
1450 {
1451     MutexGuard aGuard( GetOwnStaticMutex() );
1452 	m_pDataContainer->SetOverlayBuffer_DrawImpress( bState );
1453 }
1454 
1455 // #i74769#, #i75172#
1456 void SvtOptionsDrawinglayer::SetPaintBuffer_Calc( sal_Bool bState )
1457 {
1458     MutexGuard aGuard( GetOwnStaticMutex() );
1459 	m_pDataContainer->SetPaintBuffer_Calc( bState );
1460 }
1461 
1462 void SvtOptionsDrawinglayer::SetPaintBuffer_Writer( sal_Bool bState )
1463 {
1464     MutexGuard aGuard( GetOwnStaticMutex() );
1465 	m_pDataContainer->SetPaintBuffer_Writer( bState );
1466 }
1467 
1468 void SvtOptionsDrawinglayer::SetPaintBuffer_DrawImpress( sal_Bool bState )
1469 {
1470     MutexGuard aGuard( GetOwnStaticMutex() );
1471 	m_pDataContainer->SetPaintBuffer_DrawImpress( bState );
1472 }
1473 
1474 // #i4219#
1475 void SvtOptionsDrawinglayer::SetMaximumPaperWidth( sal_uInt32 nNew )
1476 {
1477     MutexGuard aGuard( GetOwnStaticMutex() );
1478 	m_pDataContainer->SetMaximumPaperWidth( nNew );
1479 }
1480 
1481 void SvtOptionsDrawinglayer::SetMaximumPaperHeight( sal_uInt32 nNew )
1482 {
1483     MutexGuard aGuard( GetOwnStaticMutex() );
1484 	m_pDataContainer->SetMaximumPaperHeight( nNew );
1485 }
1486 
1487 void SvtOptionsDrawinglayer::SetMaximumPaperLeftMargin( sal_uInt32 nNew )
1488 {
1489     MutexGuard aGuard( GetOwnStaticMutex() );
1490 	m_pDataContainer->SetMaximumPaperLeftMargin( nNew );
1491 }
1492 
1493 void SvtOptionsDrawinglayer::SetMaximumPaperRightMargin( sal_uInt32 nNew )
1494 {
1495     MutexGuard aGuard( GetOwnStaticMutex() );
1496 	m_pDataContainer->SetMaximumPaperRightMargin( nNew );
1497 }
1498 
1499 void SvtOptionsDrawinglayer::SetMaximumPaperTopMargin( sal_uInt32 nNew )
1500 {
1501     MutexGuard aGuard( GetOwnStaticMutex() );
1502 	m_pDataContainer->SetMaximumPaperTopMargin( nNew );
1503 }
1504 
1505 void SvtOptionsDrawinglayer::SetMaximumPaperBottomMargin( sal_uInt32 nNew )
1506 {
1507     MutexGuard aGuard( GetOwnStaticMutex() );
1508 	m_pDataContainer->SetMaximumPaperBottomMargin( nNew );
1509 }
1510 
1511 // helper
1512 sal_Bool SvtOptionsDrawinglayer::IsAAPossibleOnThisSystem() const
1513 {
1514 	return m_pDataContainer->IsAAPossibleOnThisSystem();
1515 }
1516 
1517 // primitives
1518 sal_Bool SvtOptionsDrawinglayer::IsAntiAliasing() const
1519 {
1520     MutexGuard aGuard( GetOwnStaticMutex() );
1521 	return m_pDataContainer->IsAntiAliasing() && IsAAPossibleOnThisSystem();
1522 }
1523 
1524 sal_Bool SvtOptionsDrawinglayer::IsSnapHorVerLinesToDiscrete() const
1525 {
1526     MutexGuard aGuard( GetOwnStaticMutex() );
1527 	return m_pDataContainer->IsAntiAliasing() && m_pDataContainer->IsSnapHorVerLinesToDiscrete();
1528 }
1529 
1530 sal_Bool SvtOptionsDrawinglayer::IsSolidDragCreate() const
1531 {
1532     MutexGuard aGuard( GetOwnStaticMutex() );
1533 	return m_pDataContainer->IsSolidDragCreate();
1534 }
1535 
1536 sal_Bool SvtOptionsDrawinglayer::IsRenderDecoratedTextDirect() const
1537 {
1538     MutexGuard aGuard( GetOwnStaticMutex() );
1539 	return m_pDataContainer->IsRenderDecoratedTextDirect();
1540 }
1541 
1542 sal_Bool SvtOptionsDrawinglayer::IsRenderSimpleTextDirect() const
1543 {
1544     MutexGuard aGuard( GetOwnStaticMutex() );
1545 	return m_pDataContainer->IsRenderSimpleTextDirect();
1546 }
1547 
1548 sal_uInt32 SvtOptionsDrawinglayer::GetQuadratic3DRenderLimit() const
1549 {
1550     MutexGuard aGuard( GetOwnStaticMutex() );
1551 	return m_pDataContainer->GetQuadratic3DRenderLimit();
1552 }
1553 
1554 sal_uInt32 SvtOptionsDrawinglayer::GetQuadraticFormControlRenderLimit() const
1555 {
1556     MutexGuard aGuard( GetOwnStaticMutex() );
1557 	return m_pDataContainer->GetQuadraticFormControlRenderLimit();
1558 }
1559 
1560 void SvtOptionsDrawinglayer::SetAntiAliasing( sal_Bool bState )
1561 {
1562     MutexGuard aGuard( GetOwnStaticMutex() );
1563 	m_pDataContainer->SetAntiAliasing( bState );
1564 }
1565 
1566 void SvtOptionsDrawinglayer::SetSnapHorVerLinesToDiscrete( sal_Bool bState )
1567 {
1568     MutexGuard aGuard( GetOwnStaticMutex() );
1569 	m_pDataContainer->SetSnapHorVerLinesToDiscrete( bState );
1570 }
1571 
1572 void SvtOptionsDrawinglayer::SetSolidDragCreate( sal_Bool bState )
1573 {
1574     MutexGuard aGuard( GetOwnStaticMutex() );
1575 	m_pDataContainer->SetSolidDragCreate( bState );
1576 }
1577 
1578 void SvtOptionsDrawinglayer::SetRenderDecoratedTextDirect( sal_Bool bState )
1579 {
1580     MutexGuard aGuard( GetOwnStaticMutex() );
1581 	m_pDataContainer->SetRenderDecoratedTextDirect( bState );
1582 }
1583 
1584 void SvtOptionsDrawinglayer::SetRenderSimpleTextDirect( sal_Bool bState )
1585 {
1586     MutexGuard aGuard( GetOwnStaticMutex() );
1587 	m_pDataContainer->SetRenderSimpleTextDirect( bState );
1588 }
1589 
1590 void SvtOptionsDrawinglayer::SetQuadratic3DRenderLimit(sal_uInt32 nNew)
1591 {
1592     MutexGuard aGuard( GetOwnStaticMutex() );
1593 	m_pDataContainer->SetQuadratic3DRenderLimit( nNew );
1594 }
1595 
1596 void SvtOptionsDrawinglayer::SetQuadraticFormControlRenderLimit(sal_uInt32 nNew)
1597 {
1598     MutexGuard aGuard( GetOwnStaticMutex() );
1599 	m_pDataContainer->SetQuadraticFormControlRenderLimit( nNew );
1600 }
1601 
1602 // #i97672# selection settings
1603 sal_Bool SvtOptionsDrawinglayer::IsTransparentSelection() const
1604 {
1605     MutexGuard aGuard( GetOwnStaticMutex() );
1606 	return m_pDataContainer->IsTransparentSelection();
1607 }
1608 
1609 void SvtOptionsDrawinglayer::SetTransparentSelection( sal_Bool bState )
1610 {
1611     MutexGuard aGuard( GetOwnStaticMutex() );
1612 	m_pDataContainer->SetTransparentSelection( bState );
1613 }
1614 
1615 sal_uInt16 SvtOptionsDrawinglayer::GetTransparentSelectionPercent() const
1616 {
1617     MutexGuard aGuard( GetOwnStaticMutex() );
1618 	sal_uInt16 aRetval(m_pDataContainer->GetTransparentSelectionPercent());
1619 
1620 	// crop to range [10% .. 90%]
1621 	if(aRetval < 10)
1622 	{
1623 		aRetval = 10;
1624 	}
1625 
1626 	if(aRetval > 90)
1627 	{
1628 		aRetval = 90;
1629 	}
1630 
1631 	return aRetval;
1632 }
1633 
1634 void SvtOptionsDrawinglayer::SetTransparentSelectionPercent( sal_uInt16 nPercent )
1635 {
1636     MutexGuard aGuard( GetOwnStaticMutex() );
1637 
1638     // crop to range [10% .. 90%]
1639 	if(nPercent < 10)
1640 	{
1641 		nPercent = 10;
1642 	}
1643 
1644 	if(nPercent > 90)
1645 	{
1646 		nPercent = 90;
1647 	}
1648 
1649     m_pDataContainer->SetTransparentSelectionPercent( nPercent );
1650 }
1651 
1652 sal_uInt16 SvtOptionsDrawinglayer::GetSelectionMaximumLuminancePercent() const
1653 {
1654     MutexGuard aGuard( GetOwnStaticMutex() );
1655 	sal_uInt16 aRetval(m_pDataContainer->GetSelectionMaximumLuminancePercent());
1656 
1657 	// crop to range [0% .. 100%]
1658 	if(aRetval > 90)
1659 	{
1660 		aRetval = 90;
1661 	}
1662 
1663 	return aRetval;
1664 }
1665 
1666 void SvtOptionsDrawinglayer::SetSelectionMaximumLuminancePercent( sal_uInt16 nPercent )
1667 {
1668     MutexGuard aGuard( GetOwnStaticMutex() );
1669 
1670     // crop to range [0% .. 100%]
1671 	if(nPercent > 90)
1672 	{
1673 		nPercent = 90;
1674 	}
1675 
1676     m_pDataContainer->SetSelectionMaximumLuminancePercent( nPercent );
1677 }
1678 
1679 //*****************************************************************************************************************
1680 //	private method
1681 //*****************************************************************************************************************
1682 Mutex& SvtOptionsDrawinglayer::GetOwnStaticMutex()
1683 {
1684 	// Initialize static mutex only for one time!
1685     static Mutex* pMutex = NULL;
1686 	// If these method first called (Mutex not already exist!) ...
1687     if( pMutex == NULL )
1688     {
1689 		// ... we must create a new one. Protect follow code with the global mutex -
1690 		// It must be - we create a static variable!
1691         MutexGuard aGuard( Mutex::getGlobalMutex() );
1692 		// We must check our pointer again - because it can be that another instance of ouer class will be fastr then these!
1693         if( pMutex == NULL )
1694         {
1695 			// Create the new mutex and set it for return on static variable.
1696             static Mutex aMutex;
1697             pMutex = &aMutex;
1698         }
1699     }
1700 	// Return new created or already existing mutex object.
1701     return *pMutex;
1702 }
1703 
1704 // eof
1705 
1706