1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: optionsdrawinglayer.cxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
34 //_________________________________________________________________________________________________________________
36 //_________________________________________________________________________________________________________________
38 #include <svtools/optionsdrawinglayer.hxx>
39 #include <unotools/configmgr.hxx>
40 #include <unotools/configitem.hxx>
41 #include <tools/debug.hxx>
42 #include <com/sun/star/uno/Any.hxx>
43 #include <com/sun/star/uno/Sequence.hxx>
44 #include <vcl/svapp.hxx>
45 #include <vcl/outdev.hxx>
47 //_________________________________________________________________________________________________________________
49 //_________________________________________________________________________________________________________________
51 using namespace ::utl
;
52 using namespace ::rtl
;
53 using namespace ::osl
;
54 using namespace ::com::sun::star::uno
;
56 //_________________________________________________________________________________________________________________
58 //_________________________________________________________________________________________________________________
60 #define ROOTNODE_START OUString(RTL_CONSTASCII_USTRINGPARAM("Office.Common/Drawinglayer" ))
61 #define DEFAULT_OVERLAYBUFFER sal_True
62 #define DEFAULT_PAINTBUFFER sal_True
63 #define DEFAULT_STRIPE_COLOR_A 0
64 #define DEFAULT_STRIPE_COLOR_B 16581375
65 #define DEFAULT_STRIPE_LENGTH 4
68 // #i74769#, #i75172# : Change default for Calc and Writer to True
69 #define DEFAULT_OVERLAYBUFFER_CALC sal_True
70 #define DEFAULT_OVERLAYBUFFER_WRITER sal_True
71 #define DEFAULT_OVERLAYBUFFER_DRAWIMPRESS sal_True
74 #define DEFAULT_PAINTBUFFER_CALC sal_True
75 #define DEFAULT_PAINTBUFFER_WRITER sal_True
76 #define DEFAULT_PAINTBUFFER_DRAWIMPRESS sal_True
79 #define DEFAULT_MAXIMUMPAPERWIDTH 300
80 #define DEFAULT_MAXIMUMPAPERHEIGHT 300
81 #define DEFAULT_MAXIMUMPAPERLEFTMARGIN 9999
82 #define DEFAULT_MAXIMUMPAPERRIGHTMARGIN 9999
83 #define DEFAULT_MAXIMUMPAPERTOPMARGIN 9999
84 #define DEFAULT_MAXIMUMPAPERBOTTOMMARGIN 9999
87 #define DEFAULT_ANTIALIASING sal_True
88 #define DEFAULT_SNAPHORVERLINESTODISCRETE sal_True
89 #define DEFAULT_SOLIDDRAGCREATE sal_True
90 #define DEFAULT_RENDERDECORATEDTEXTDIRECT sal_True
91 #define DEFAULT_RENDERSIMPLETEXTDIRECT sal_True
92 #define DEFAULT_QUADRATIC3DRENDERLIMIT 1000000
93 #define DEFAULT_QUADRATICFORMCONTROLRENDERLIMIT 45000
95 // #i97672# selection settings
96 #define DEFAULT_TRANSPARENTSELECTION sal_True
97 #define DEFAULT_TRANSPARENTSELECTIONPERCENT 75
98 #define DEFAULT_SELECTIONMAXIMUMLUMINANCEPERCENT 70
100 #define PROPERTYNAME_OVERLAYBUFFER OUString(RTL_CONSTASCII_USTRINGPARAM("OverlayBuffer" ))
101 #define PROPERTYNAME_PAINTBUFFER OUString(RTL_CONSTASCII_USTRINGPARAM("PaintBuffer" ))
102 #define PROPERTYNAME_STRIPE_COLOR_A OUString(RTL_CONSTASCII_USTRINGPARAM("StripeColorA" ))
103 #define PROPERTYNAME_STRIPE_COLOR_B OUString(RTL_CONSTASCII_USTRINGPARAM("StripeColorB" ))
104 #define PROPERTYNAME_STRIPE_LENGTH OUString(RTL_CONSTASCII_USTRINGPARAM("StripeLength" ))
107 #define PROPERTYNAME_OVERLAYBUFFER_CALC OUString(RTL_CONSTASCII_USTRINGPARAM("OverlayBuffer_Calc"))
108 #define PROPERTYNAME_OVERLAYBUFFER_WRITER OUString(RTL_CONSTASCII_USTRINGPARAM("OverlayBuffer_Writer"))
109 #define PROPERTYNAME_OVERLAYBUFFER_DRAWIMPRESS OUString(RTL_CONSTASCII_USTRINGPARAM("OverlayBuffer_DrawImpress"))
111 // #i74769#, #i75172#
112 #define PROPERTYNAME_PAINTBUFFER_CALC OUString(RTL_CONSTASCII_USTRINGPARAM("PaintBuffer_Calc"))
113 #define PROPERTYNAME_PAINTBUFFER_WRITER OUString(RTL_CONSTASCII_USTRINGPARAM("PaintBuffer_Writer"))
114 #define PROPERTYNAME_PAINTBUFFER_DRAWIMPRESS OUString(RTL_CONSTASCII_USTRINGPARAM("PaintBuffer_DrawImpress"))
117 #define PROPERTYNAME_MAXIMUMPAPERWIDTH OUString(RTL_CONSTASCII_USTRINGPARAM("MaximumPaperWidth"))
118 #define PROPERTYNAME_MAXIMUMPAPERHEIGHT OUString(RTL_CONSTASCII_USTRINGPARAM("MaximumPaperHeight"))
119 #define PROPERTYNAME_MAXIMUMPAPERLEFTMARGIN OUString(RTL_CONSTASCII_USTRINGPARAM("MaximumPaperLeftMargin"))
120 #define PROPERTYNAME_MAXIMUMPAPERRIGHTMARGIN OUString(RTL_CONSTASCII_USTRINGPARAM("MaximumPaperRightMargin"))
121 #define PROPERTYNAME_MAXIMUMPAPERTOPMARGIN OUString(RTL_CONSTASCII_USTRINGPARAM("MaximumPaperTopMargin"))
122 #define PROPERTYNAME_MAXIMUMPAPERBOTTOMMARGIN OUString(RTL_CONSTASCII_USTRINGPARAM("MaximumPaperBottomMargin"))
125 #define PROPERTYNAME_ANTIALIASING OUString(RTL_CONSTASCII_USTRINGPARAM("AntiAliasing"))
126 #define PROPERTYNAME_SNAPHORVERLINESTODISCRETE OUString(RTL_CONSTASCII_USTRINGPARAM("SnapHorVerLinesToDiscrete"))
127 #define PROPERTYNAME_SOLIDDRAGCREATE OUString(RTL_CONSTASCII_USTRINGPARAM("SolidDragCreate"))
128 #define PROPERTYNAME_RENDERDECORATEDTEXTDIRECT OUString(RTL_CONSTASCII_USTRINGPARAM("RenderDecoratedTextDirect"))
129 #define PROPERTYNAME_RENDERSIMPLETEXTDIRECT OUString(RTL_CONSTASCII_USTRINGPARAM("RenderSimpleTextDirect"))
130 #define PROPERTYNAME_QUADRATIC3DRENDERLIMIT OUString(RTL_CONSTASCII_USTRINGPARAM("Quadratic3DRenderLimit"))
131 #define PROPERTYNAME_QUADRATICFORMCONTROLRENDERLIMIT OUString(RTL_CONSTASCII_USTRINGPARAM("QuadraticFormControlRenderLimit"))
133 // #i97672# selection settings
134 #define PROPERTYNAME_TRANSPARENTSELECTION OUString(RTL_CONSTASCII_USTRINGPARAM("TransparentSelection"))
135 #define PROPERTYNAME_TRANSPARENTSELECTIONPERCENT OUString(RTL_CONSTASCII_USTRINGPARAM("TransparentSelectionPercent"))
136 #define PROPERTYNAME_SELECTIONMAXIMUMLUMINANCEPERCENT OUString(RTL_CONSTASCII_USTRINGPARAM("SelectionMaximumLuminancePercent"))
138 #define PROPERTYHANDLE_OVERLAYBUFFER 0
139 #define PROPERTYHANDLE_PAINTBUFFER 1
140 #define PROPERTYHANDLE_STRIPE_COLOR_A 2
141 #define PROPERTYHANDLE_STRIPE_COLOR_B 3
142 #define PROPERTYHANDLE_STRIPE_LENGTH 4
145 #define PROPERTYHANDLE_OVERLAYBUFFER_CALC 5
146 #define PROPERTYHANDLE_OVERLAYBUFFER_WRITER 6
147 #define PROPERTYHANDLE_OVERLAYBUFFER_DRAWIMPRESS 7
149 // #i74769#, #i75172#
150 #define PROPERTYHANDLE_PAINTBUFFER_CALC 8
151 #define PROPERTYHANDLE_PAINTBUFFER_WRITER 9
152 #define PROPERTYHANDLE_PAINTBUFFER_DRAWIMPRESS 10
155 #define PROPERTYHANDLE_MAXIMUMPAPERWIDTH 11
156 #define PROPERTYHANDLE_MAXIMUMPAPERHEIGHT 12
157 #define PROPERTYHANDLE_MAXIMUMPAPERLEFTMARGIN 13
158 #define PROPERTYHANDLE_MAXIMUMPAPERRIGHTMARGIN 14
159 #define PROPERTYHANDLE_MAXIMUMPAPERTOPMARGIN 15
160 #define PROPERTYHANDLE_MAXIMUMPAPERBOTTOMMARGIN 16
163 #define PROPERTYHANDLE_ANTIALIASING 17
164 #define PROPERTYHANDLE_SNAPHORVERLINESTODISCRETE 18
165 #define PROPERTYHANDLE_SOLIDDRAGCREATE 19
166 #define PROPERTYHANDLE_RENDERDECORATEDTEXTDIRECT 20
167 #define PROPERTYHANDLE_RENDERSIMPLETEXTDIRECT 21
168 #define PROPERTYHANDLE_QUADRATIC3DRENDERLIMIT 22
169 #define PROPERTYHANDLE_QUADRATICFORMCONTROLRENDERLIMIT 23
171 // #i97672# selection settings
172 #define PROPERTYHANDLE_TRANSPARENTSELECTION 24
173 #define PROPERTYHANDLE_TRANSPARENTSELECTIONPERCENT 25
174 #define PROPERTYHANDLE_SELECTIONMAXIMUMLUMINANCEPERCENT 26
176 #define PROPERTYCOUNT 27
178 class SvtOptionsDrawinglayer_Impl
: public ConfigItem
182 //---------------------------------------------------------------------------------------------------------
183 // constructor / destructor
184 //---------------------------------------------------------------------------------------------------------
186 SvtOptionsDrawinglayer_Impl();
187 ~SvtOptionsDrawinglayer_Impl();
189 //---------------------------------------------------------------------------------------------------------
190 // overloaded methods of baseclass
191 //---------------------------------------------------------------------------------------------------------
193 virtual void Commit();
195 //---------------------------------------------------------------------------------------------------------
197 //---------------------------------------------------------------------------------------------------------
199 sal_Bool
IsOverlayBuffer() const;
200 sal_Bool
IsPaintBuffer() const;
201 Color
GetStripeColorA() const;
202 Color
GetStripeColorB() const;
203 sal_uInt16
GetStripeLength() const;
206 sal_Bool
IsOverlayBuffer_Calc() const;
207 sal_Bool
IsOverlayBuffer_Writer() const;
208 sal_Bool
IsOverlayBuffer_DrawImpress() const;
210 // #i74769#, #i75172#
211 sal_Bool
IsPaintBuffer_Calc() const;
212 sal_Bool
IsPaintBuffer_Writer() const;
213 sal_Bool
IsPaintBuffer_DrawImpress() const;
215 void SetOverlayBuffer( sal_Bool bState
);
216 void SetPaintBuffer( sal_Bool bState
);
217 void SetStripeColorA( Color aColor
);
218 void SetStripeColorB( Color aColor
);
219 void SetStripeLength( sal_uInt16 nLength
);
222 void SetOverlayBuffer_Calc( sal_Bool bState
);
223 void SetOverlayBuffer_Writer( sal_Bool bState
);
224 void SetOverlayBuffer_DrawImpress( sal_Bool bState
);
226 // #i74769#, #i75172#
227 void SetPaintBuffer_Calc( sal_Bool bState
);
228 void SetPaintBuffer_Writer( sal_Bool bState
);
229 void SetPaintBuffer_DrawImpress( sal_Bool bState
);
232 sal_uInt32
GetMaximumPaperWidth() const;
233 sal_uInt32
GetMaximumPaperHeight() const;
234 sal_uInt32
GetMaximumPaperLeftMargin() const;
235 sal_uInt32
GetMaximumPaperRightMargin() const;
236 sal_uInt32
GetMaximumPaperTopMargin() const;
237 sal_uInt32
GetMaximumPaperBottomMargin() const;
239 void SetMaximumPaperWidth(sal_uInt32 nNew
);
240 void SetMaximumPaperHeight(sal_uInt32 nNew
);
241 void SetMaximumPaperLeftMargin(sal_uInt32 nNew
);
242 void SetMaximumPaperRightMargin(sal_uInt32 nNew
);
243 void SetMaximumPaperTopMargin(sal_uInt32 nNew
);
244 void SetMaximumPaperBottomMargin(sal_uInt32 nNew
);
247 sal_Bool
IsAAPossibleOnThisSystem() const;
250 sal_Bool
IsAntiAliasing() const;
251 sal_Bool
IsSnapHorVerLinesToDiscrete() const;
252 sal_Bool
IsSolidDragCreate() const;
253 sal_Bool
IsRenderDecoratedTextDirect() const;
254 sal_Bool
IsRenderSimpleTextDirect() const;
255 sal_uInt32
GetQuadratic3DRenderLimit() const;
256 sal_uInt32
GetQuadraticFormControlRenderLimit() const;
258 void SetAntiAliasing( sal_Bool bState
);
259 void SetSnapHorVerLinesToDiscrete( sal_Bool bState
);
260 void SetSolidDragCreate( sal_Bool bState
);
261 void SetRenderDecoratedTextDirect( sal_Bool bState
);
262 void SetRenderSimpleTextDirect( sal_Bool bState
);
263 void SetQuadratic3DRenderLimit(sal_uInt32 nNew
);
264 void SetQuadraticFormControlRenderLimit(sal_uInt32 nNew
);
266 // #i97672# selection settings
267 sal_Bool
IsTransparentSelection() const;
268 sal_uInt16
GetTransparentSelectionPercent() const;
269 sal_uInt16
GetSelectionMaximumLuminancePercent() const;
271 void SetTransparentSelection( sal_Bool bState
);
272 void SetTransparentSelectionPercent( sal_uInt16 nPercent
);
273 void SetSelectionMaximumLuminancePercent( sal_uInt16 nPercent
);
275 //-------------------------------------------------------------------------------------------------------------
277 //-------------------------------------------------------------------------------------------------------------
281 static Sequence
< OUString
> impl_GetPropertyNames();
283 //-------------------------------------------------------------------------------------------------------------
285 //-------------------------------------------------------------------------------------------------------------
289 sal_Bool m_bOverlayBuffer
;
290 sal_Bool m_bPaintBuffer
;
291 Color m_bStripeColorA
;
292 Color m_bStripeColorB
;
293 sal_uInt16 m_nStripeLength
;
296 sal_Bool m_bOverlayBuffer_Calc
;
297 sal_Bool m_bOverlayBuffer_Writer
;
298 sal_Bool m_bOverlayBuffer_DrawImpress
;
300 // #i74769#, #i75172#
301 sal_Bool m_bPaintBuffer_Calc
;
302 sal_Bool m_bPaintBuffer_Writer
;
303 sal_Bool m_bPaintBuffer_DrawImpress
;
306 sal_uInt32 m_nMaximumPaperWidth
;
307 sal_uInt32 m_nMaximumPaperHeight
;
308 sal_uInt32 m_nMaximumPaperLeftMargin
;
309 sal_uInt32 m_nMaximumPaperRightMargin
;
310 sal_uInt32 m_nMaximumPaperTopMargin
;
311 sal_uInt32 m_nMaximumPaperBottomMargin
;
314 sal_Bool m_bAntiAliasing
;
315 sal_Bool m_bSnapHorVerLinesToDiscrete
;
316 sal_Bool m_bSolidDragCreate
;
317 sal_Bool m_bRenderDecoratedTextDirect
;
318 sal_Bool m_bRenderSimpleTextDirect
;
319 sal_uInt32 m_nQuadratic3DRenderLimit
;
320 sal_uInt32 m_nQuadraticFormControlRenderLimit
;
322 // #i97672# selection settings
323 sal_uInt16 m_nTransparentSelectionPercent
;
324 sal_uInt16 m_nSelectionMaximumLuminancePercent
;
325 sal_Bool m_bTransparentSelection
;
329 bool m_bAllowAAChecked
: 1;
332 //_________________________________________________________________________________________________________________
334 //_________________________________________________________________________________________________________________
336 //*****************************************************************************************************************
338 //*****************************************************************************************************************
339 SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl() :
340 ConfigItem( ROOTNODE_START
),
341 m_bOverlayBuffer( DEFAULT_OVERLAYBUFFER
),
342 m_bPaintBuffer( DEFAULT_PAINTBUFFER
),
343 m_bStripeColorA(Color(DEFAULT_STRIPE_COLOR_A
)),
344 m_bStripeColorB(Color(DEFAULT_STRIPE_COLOR_B
)),
345 m_nStripeLength(DEFAULT_STRIPE_LENGTH
),
348 m_bOverlayBuffer_Calc( DEFAULT_OVERLAYBUFFER_CALC
),
349 m_bOverlayBuffer_Writer( DEFAULT_OVERLAYBUFFER_WRITER
),
350 m_bOverlayBuffer_DrawImpress( DEFAULT_OVERLAYBUFFER_DRAWIMPRESS
),
352 // #i74769#, #i75172#
353 m_bPaintBuffer_Calc( DEFAULT_PAINTBUFFER_CALC
),
354 m_bPaintBuffer_Writer( DEFAULT_PAINTBUFFER_WRITER
),
355 m_bPaintBuffer_DrawImpress( DEFAULT_PAINTBUFFER_DRAWIMPRESS
),
358 m_nMaximumPaperWidth(DEFAULT_MAXIMUMPAPERWIDTH
),
359 m_nMaximumPaperHeight(DEFAULT_MAXIMUMPAPERHEIGHT
),
360 m_nMaximumPaperLeftMargin(DEFAULT_MAXIMUMPAPERLEFTMARGIN
),
361 m_nMaximumPaperRightMargin(DEFAULT_MAXIMUMPAPERRIGHTMARGIN
),
362 m_nMaximumPaperTopMargin(DEFAULT_MAXIMUMPAPERTOPMARGIN
),
363 m_nMaximumPaperBottomMargin(DEFAULT_MAXIMUMPAPERBOTTOMMARGIN
),
366 m_bAntiAliasing(DEFAULT_ANTIALIASING
),
367 m_bSnapHorVerLinesToDiscrete(DEFAULT_SNAPHORVERLINESTODISCRETE
),
368 m_bSolidDragCreate(DEFAULT_SOLIDDRAGCREATE
),
369 m_bRenderDecoratedTextDirect(DEFAULT_RENDERDECORATEDTEXTDIRECT
),
370 m_bRenderSimpleTextDirect(DEFAULT_RENDERSIMPLETEXTDIRECT
),
371 m_nQuadratic3DRenderLimit(DEFAULT_QUADRATIC3DRENDERLIMIT
),
372 m_nQuadraticFormControlRenderLimit(DEFAULT_QUADRATICFORMCONTROLRENDERLIMIT
),
374 // #i97672# selection settings
375 m_nTransparentSelectionPercent(DEFAULT_TRANSPARENTSELECTIONPERCENT
),
376 m_nSelectionMaximumLuminancePercent(DEFAULT_SELECTIONMAXIMUMLUMINANCEPERCENT
),
377 m_bTransparentSelection(DEFAULT_TRANSPARENTSELECTION
),
381 m_bAllowAAChecked(false)
383 Sequence
< OUString
> seqNames( impl_GetPropertyNames() );
384 Sequence
< Any
> seqValues
= GetProperties( seqNames
) ;
386 DBG_ASSERT( !(seqNames
.getLength()!=seqValues
.getLength()), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nI miss some values of configuration keys!\n" );
388 // Copy values from list in right order to ouer internal member.
389 sal_Int32 nPropertyCount
= seqValues
.getLength();
390 sal_Int32 nProperty
= 0;
392 for( nProperty
=0; nProperty
<nPropertyCount
; ++nProperty
)
394 DBG_ASSERT( !(seqValues
[nProperty
].hasValue()==sal_False
), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nInvalid property value for property detected!\n" );
398 case PROPERTYHANDLE_OVERLAYBUFFER
:
400 DBG_ASSERT(!(seqValues
[nProperty
].getValueTypeClass()!=TypeClass_BOOLEAN
), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\OverlayBuffer\"?" );
401 seqValues
[nProperty
] >>= m_bOverlayBuffer
;
405 case PROPERTYHANDLE_PAINTBUFFER
:
407 DBG_ASSERT(!(seqValues
[nProperty
].getValueTypeClass()!=TypeClass_BOOLEAN
), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\PaintBuffer\"?" );
408 seqValues
[nProperty
] >>= m_bPaintBuffer
;
412 case PROPERTYHANDLE_STRIPE_COLOR_A
:
414 DBG_ASSERT(!(seqValues
[nProperty
].getValueTypeClass()!=TypeClass_LONG
), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\StripeColorA\"?" );
415 sal_Int32 nValue
= 0;
416 seqValues
[nProperty
] >>= nValue
;
417 m_bStripeColorA
= nValue
;
421 case PROPERTYHANDLE_STRIPE_COLOR_B
:
423 DBG_ASSERT(!(seqValues
[nProperty
].getValueTypeClass()!=TypeClass_LONG
), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\StripeColorB\"?" );
424 sal_Int32 nValue
= 0;
425 seqValues
[nProperty
] >>= nValue
;
426 m_bStripeColorB
= nValue
;
430 case PROPERTYHANDLE_STRIPE_LENGTH
:
432 DBG_ASSERT(!(seqValues
[nProperty
].getValueTypeClass()!=TypeClass_SHORT
), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\StripeLength\"?" );
433 seqValues
[nProperty
] >>= m_nStripeLength
;
438 case PROPERTYHANDLE_OVERLAYBUFFER_CALC
:
440 DBG_ASSERT(!(seqValues
[nProperty
].getValueTypeClass()!=TypeClass_BOOLEAN
), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\OverlayBuffer_Calc\"?" );
441 seqValues
[nProperty
] >>= m_bOverlayBuffer_Calc
;
445 case PROPERTYHANDLE_OVERLAYBUFFER_WRITER
:
447 DBG_ASSERT(!(seqValues
[nProperty
].getValueTypeClass()!=TypeClass_BOOLEAN
), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\OverlayBuffer_Writer\"?" );
448 seqValues
[nProperty
] >>= m_bOverlayBuffer_Writer
;
452 case PROPERTYHANDLE_OVERLAYBUFFER_DRAWIMPRESS
:
454 DBG_ASSERT(!(seqValues
[nProperty
].getValueTypeClass()!=TypeClass_BOOLEAN
), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\OverlayBuffer_DrawImpress\"?" );
455 seqValues
[nProperty
] >>= m_bOverlayBuffer_DrawImpress
;
459 // #i74769#, #i75172#
460 case PROPERTYHANDLE_PAINTBUFFER_CALC
:
462 DBG_ASSERT(!(seqValues
[nProperty
].getValueTypeClass()!=TypeClass_BOOLEAN
), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\PaintBuffer_Calc\"?" );
463 seqValues
[nProperty
] >>= m_bPaintBuffer_Calc
;
467 case PROPERTYHANDLE_PAINTBUFFER_WRITER
:
469 DBG_ASSERT(!(seqValues
[nProperty
].getValueTypeClass()!=TypeClass_BOOLEAN
), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\PaintBuffer_Writer\"?" );
470 seqValues
[nProperty
] >>= m_bPaintBuffer_Writer
;
474 case PROPERTYHANDLE_PAINTBUFFER_DRAWIMPRESS
:
476 DBG_ASSERT(!(seqValues
[nProperty
].getValueTypeClass()!=TypeClass_BOOLEAN
), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\PaintBuffer_DrawImpress\"?" );
477 seqValues
[nProperty
] >>= m_bPaintBuffer_DrawImpress
;
482 case PROPERTYHANDLE_MAXIMUMPAPERWIDTH
:
484 DBG_ASSERT(!(seqValues
[nProperty
].getValueTypeClass()!=TypeClass_LONG
), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\MaximumPaperWidth\"?" );
485 seqValues
[nProperty
] >>= m_nMaximumPaperWidth
;
489 case PROPERTYHANDLE_MAXIMUMPAPERHEIGHT
:
491 DBG_ASSERT(!(seqValues
[nProperty
].getValueTypeClass()!=TypeClass_LONG
), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\MaximumPaperHeight\"?" );
492 seqValues
[nProperty
] >>= m_nMaximumPaperHeight
;
496 case PROPERTYHANDLE_MAXIMUMPAPERLEFTMARGIN
:
498 DBG_ASSERT(!(seqValues
[nProperty
].getValueTypeClass()!=TypeClass_LONG
), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\MaximumPaperLeftMargin\"?" );
499 seqValues
[nProperty
] >>= m_nMaximumPaperLeftMargin
;
503 case PROPERTYHANDLE_MAXIMUMPAPERRIGHTMARGIN
:
505 DBG_ASSERT(!(seqValues
[nProperty
].getValueTypeClass()!=TypeClass_LONG
), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\MaximumPaperRightMargin\"?" );
506 seqValues
[nProperty
] >>= m_nMaximumPaperRightMargin
;
510 case PROPERTYHANDLE_MAXIMUMPAPERTOPMARGIN
:
512 DBG_ASSERT(!(seqValues
[nProperty
].getValueTypeClass()!=TypeClass_LONG
), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\MaximumPaperTopMargin\"?" );
513 seqValues
[nProperty
] >>= m_nMaximumPaperTopMargin
;
517 case PROPERTYHANDLE_MAXIMUMPAPERBOTTOMMARGIN
:
519 DBG_ASSERT(!(seqValues
[nProperty
].getValueTypeClass()!=TypeClass_LONG
), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\MaximumPaperBottomMargin\"?" );
520 seqValues
[nProperty
] >>= m_nMaximumPaperBottomMargin
;
525 case PROPERTYHANDLE_ANTIALIASING
:
527 DBG_ASSERT(!(seqValues
[nProperty
].getValueTypeClass()!=TypeClass_BOOLEAN
), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\AntiAliasing\"?" );
528 seqValues
[nProperty
] >>= m_bAntiAliasing
;
533 case PROPERTYHANDLE_SNAPHORVERLINESTODISCRETE
:
535 DBG_ASSERT(!(seqValues
[nProperty
].getValueTypeClass()!=TypeClass_BOOLEAN
), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\SnapHorVerLinesToDiscrete\"?" );
536 seqValues
[nProperty
] >>= m_bSnapHorVerLinesToDiscrete
;
540 case PROPERTYHANDLE_SOLIDDRAGCREATE
:
542 DBG_ASSERT(!(seqValues
[nProperty
].getValueTypeClass()!=TypeClass_BOOLEAN
), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\SolidDragCreate\"?" );
543 seqValues
[nProperty
] >>= m_bSolidDragCreate
;
547 case PROPERTYHANDLE_RENDERDECORATEDTEXTDIRECT
:
549 DBG_ASSERT(!(seqValues
[nProperty
].getValueTypeClass()!=TypeClass_BOOLEAN
), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\RenderDecoratedTextDirect\"?" );
550 seqValues
[nProperty
] >>= m_bRenderDecoratedTextDirect
;
554 case PROPERTYHANDLE_RENDERSIMPLETEXTDIRECT
:
556 DBG_ASSERT(!(seqValues
[nProperty
].getValueTypeClass()!=TypeClass_BOOLEAN
), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\RenderSimpleTextDirect\"?" );
557 seqValues
[nProperty
] >>= m_bRenderSimpleTextDirect
;
561 case PROPERTYHANDLE_QUADRATIC3DRENDERLIMIT
:
563 DBG_ASSERT(!(seqValues
[nProperty
].getValueTypeClass()!=TypeClass_LONG
), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\Quadratic3DRenderLimit\"?" );
564 seqValues
[nProperty
] >>= m_nQuadratic3DRenderLimit
;
568 case PROPERTYHANDLE_QUADRATICFORMCONTROLRENDERLIMIT
:
570 DBG_ASSERT(!(seqValues
[nProperty
].getValueTypeClass()!=TypeClass_LONG
), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\QuadraticFormControlRenderLimit\"?" );
571 seqValues
[nProperty
] >>= m_nQuadraticFormControlRenderLimit
;
575 // #i97672# selection settings
576 case PROPERTYHANDLE_TRANSPARENTSELECTION
:
578 DBG_ASSERT(!(seqValues
[nProperty
].getValueTypeClass()!=TypeClass_BOOLEAN
), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\TransparentSelection\"?" );
579 seqValues
[nProperty
] >>= m_bTransparentSelection
;
583 case PROPERTYHANDLE_TRANSPARENTSELECTIONPERCENT
:
585 DBG_ASSERT(!(seqValues
[nProperty
].getValueTypeClass()!=TypeClass_SHORT
), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\TransparentSelectionPercent\"?" );
586 seqValues
[nProperty
] >>= m_nTransparentSelectionPercent
;
589 case PROPERTYHANDLE_SELECTIONMAXIMUMLUMINANCEPERCENT
:
591 DBG_ASSERT(!(seqValues
[nProperty
].getValueTypeClass()!=TypeClass_SHORT
), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\SelectionMaximumLuminancePercent\"?" );
592 seqValues
[nProperty
] >>= m_nSelectionMaximumLuminancePercent
;
599 //*****************************************************************************************************************
601 //*****************************************************************************************************************
602 SvtOptionsDrawinglayer_Impl::~SvtOptionsDrawinglayer_Impl()
608 //*****************************************************************************************************************
610 //*****************************************************************************************************************
611 void SvtOptionsDrawinglayer_Impl::Commit()
613 Sequence
< OUString
> aSeqNames( impl_GetPropertyNames() );
614 Sequence
< Any
> aSeqValues( aSeqNames
.getLength() );
616 for( sal_Int32 nProperty
= 0, nCount
= aSeqNames
.getLength(); nProperty
< nCount
; ++nProperty
)
620 case PROPERTYHANDLE_OVERLAYBUFFER
:
621 aSeqValues
[nProperty
] <<= m_bOverlayBuffer
;
624 case PROPERTYHANDLE_PAINTBUFFER
:
625 aSeqValues
[nProperty
] <<= m_bPaintBuffer
;
628 case PROPERTYHANDLE_STRIPE_COLOR_A
:
629 aSeqValues
[nProperty
] <<= m_bStripeColorA
.GetColor();
632 case PROPERTYHANDLE_STRIPE_COLOR_B
:
633 aSeqValues
[nProperty
] <<= m_bStripeColorB
.GetColor();
636 case PROPERTYHANDLE_STRIPE_LENGTH
:
637 aSeqValues
[nProperty
] <<= m_nStripeLength
;
641 case PROPERTYHANDLE_OVERLAYBUFFER_CALC
:
642 aSeqValues
[nProperty
] <<= m_bOverlayBuffer_Calc
;
645 case PROPERTYHANDLE_OVERLAYBUFFER_WRITER
:
646 aSeqValues
[nProperty
] <<= m_bOverlayBuffer_Writer
;
649 case PROPERTYHANDLE_OVERLAYBUFFER_DRAWIMPRESS
:
650 aSeqValues
[nProperty
] <<= m_bOverlayBuffer_DrawImpress
;
653 // #i74769#, #i75172#
654 case PROPERTYHANDLE_PAINTBUFFER_CALC
:
655 aSeqValues
[nProperty
] <<= m_bPaintBuffer_Calc
;
658 case PROPERTYHANDLE_PAINTBUFFER_WRITER
:
659 aSeqValues
[nProperty
] <<= m_bPaintBuffer_Writer
;
662 case PROPERTYHANDLE_PAINTBUFFER_DRAWIMPRESS
:
663 aSeqValues
[nProperty
] <<= m_bPaintBuffer_DrawImpress
;
667 case PROPERTYHANDLE_MAXIMUMPAPERWIDTH
:
668 aSeqValues
[nProperty
] <<= m_nMaximumPaperWidth
;
671 case PROPERTYHANDLE_MAXIMUMPAPERHEIGHT
:
672 aSeqValues
[nProperty
] <<= m_nMaximumPaperHeight
;
675 case PROPERTYHANDLE_MAXIMUMPAPERLEFTMARGIN
:
676 aSeqValues
[nProperty
] <<= m_nMaximumPaperLeftMargin
;
679 case PROPERTYHANDLE_MAXIMUMPAPERRIGHTMARGIN
:
680 aSeqValues
[nProperty
] <<= m_nMaximumPaperRightMargin
;
683 case PROPERTYHANDLE_MAXIMUMPAPERTOPMARGIN
:
684 aSeqValues
[nProperty
] <<= m_nMaximumPaperTopMargin
;
687 case PROPERTYHANDLE_MAXIMUMPAPERBOTTOMMARGIN
:
688 aSeqValues
[nProperty
] <<= m_nMaximumPaperBottomMargin
;
692 case PROPERTYHANDLE_ANTIALIASING
:
693 aSeqValues
[nProperty
] <<= m_bAntiAliasing
;
696 case PROPERTYHANDLE_SNAPHORVERLINESTODISCRETE
:
697 aSeqValues
[nProperty
] <<= m_bSnapHorVerLinesToDiscrete
;
700 case PROPERTYHANDLE_SOLIDDRAGCREATE
:
701 aSeqValues
[nProperty
] <<= m_bSolidDragCreate
;
704 case PROPERTYHANDLE_RENDERDECORATEDTEXTDIRECT
:
705 aSeqValues
[nProperty
] <<= m_bRenderDecoratedTextDirect
;
708 case PROPERTYHANDLE_RENDERSIMPLETEXTDIRECT
:
709 aSeqValues
[nProperty
] <<= m_bRenderSimpleTextDirect
;
712 case PROPERTYHANDLE_QUADRATIC3DRENDERLIMIT
:
713 aSeqValues
[nProperty
] <<= m_nQuadratic3DRenderLimit
;
716 case PROPERTYHANDLE_QUADRATICFORMCONTROLRENDERLIMIT
:
717 aSeqValues
[nProperty
] <<= m_nQuadraticFormControlRenderLimit
;
720 // #i97672# selection settings
721 case PROPERTYHANDLE_TRANSPARENTSELECTION
:
722 aSeqValues
[nProperty
] <<= m_bTransparentSelection
;
725 case PROPERTYHANDLE_TRANSPARENTSELECTIONPERCENT
:
726 aSeqValues
[nProperty
] <<= m_nTransparentSelectionPercent
;
729 case PROPERTYHANDLE_SELECTIONMAXIMUMLUMINANCEPERCENT
:
730 aSeqValues
[nProperty
] <<= m_nSelectionMaximumLuminancePercent
;
735 PutProperties( aSeqNames
, aSeqValues
);
738 //*****************************************************************************************************************
740 //*****************************************************************************************************************
741 sal_Bool
SvtOptionsDrawinglayer_Impl::IsOverlayBuffer() const
743 return m_bOverlayBuffer
;
746 //*****************************************************************************************************************
748 //*****************************************************************************************************************
749 sal_Bool
SvtOptionsDrawinglayer_Impl::IsPaintBuffer() const
751 return m_bPaintBuffer
;
754 //*****************************************************************************************************************
756 //*****************************************************************************************************************
757 Color
SvtOptionsDrawinglayer_Impl::GetStripeColorA() const
759 return m_bStripeColorA
;
762 //*****************************************************************************************************************
764 //*****************************************************************************************************************
765 Color
SvtOptionsDrawinglayer_Impl::GetStripeColorB() const
767 return m_bStripeColorB
;
770 //*****************************************************************************************************************
772 //*****************************************************************************************************************
773 sal_uInt16
SvtOptionsDrawinglayer_Impl::GetStripeLength() const
775 return m_nStripeLength
;
779 sal_Bool
SvtOptionsDrawinglayer_Impl::IsOverlayBuffer_Calc() const
781 return m_bOverlayBuffer_Calc
;
784 sal_Bool
SvtOptionsDrawinglayer_Impl::IsOverlayBuffer_Writer() const
786 return m_bOverlayBuffer_Writer
;
789 sal_Bool
SvtOptionsDrawinglayer_Impl::IsOverlayBuffer_DrawImpress() const
791 return m_bOverlayBuffer_DrawImpress
;
794 // #i74769#, #i75172#
795 sal_Bool
SvtOptionsDrawinglayer_Impl::IsPaintBuffer_Calc() const
797 return m_bPaintBuffer_Calc
;
800 sal_Bool
SvtOptionsDrawinglayer_Impl::IsPaintBuffer_Writer() const
802 return m_bPaintBuffer_Writer
;
805 sal_Bool
SvtOptionsDrawinglayer_Impl::IsPaintBuffer_DrawImpress() const
807 return m_bPaintBuffer_DrawImpress
;
811 sal_uInt32
SvtOptionsDrawinglayer_Impl::GetMaximumPaperWidth() const
813 return m_nMaximumPaperWidth
;
816 sal_uInt32
SvtOptionsDrawinglayer_Impl::GetMaximumPaperHeight() const
818 return m_nMaximumPaperHeight
;
821 sal_uInt32
SvtOptionsDrawinglayer_Impl::GetMaximumPaperLeftMargin() const
823 return m_nMaximumPaperLeftMargin
;
826 sal_uInt32
SvtOptionsDrawinglayer_Impl::GetMaximumPaperRightMargin() const
828 return m_nMaximumPaperRightMargin
;
831 sal_uInt32
SvtOptionsDrawinglayer_Impl::GetMaximumPaperTopMargin() const
833 return m_nMaximumPaperTopMargin
;
836 sal_uInt32
SvtOptionsDrawinglayer_Impl::GetMaximumPaperBottomMargin() const
838 return m_nMaximumPaperBottomMargin
;
841 //*****************************************************************************************************************
843 //*****************************************************************************************************************
844 void SvtOptionsDrawinglayer_Impl::SetOverlayBuffer( sal_Bool bState
)
846 if(m_bOverlayBuffer
!= bState
)
848 m_bOverlayBuffer
= bState
;
853 //*****************************************************************************************************************
855 //*****************************************************************************************************************
856 void SvtOptionsDrawinglayer_Impl::SetPaintBuffer( sal_Bool bState
)
858 if(m_bPaintBuffer
!= bState
)
860 m_bPaintBuffer
= bState
;
865 //*****************************************************************************************************************
867 //*****************************************************************************************************************
868 void SvtOptionsDrawinglayer_Impl::SetStripeColorA( Color aColor
)
870 if(m_bStripeColorA
!= aColor
)
872 m_bStripeColorA
= aColor
;
877 //*****************************************************************************************************************
879 //*****************************************************************************************************************
880 void SvtOptionsDrawinglayer_Impl::SetStripeColorB( Color aColor
)
882 if(m_bStripeColorB
!= aColor
)
884 m_bStripeColorB
= aColor
;
889 //*****************************************************************************************************************
891 //*****************************************************************************************************************
892 void SvtOptionsDrawinglayer_Impl::SetStripeLength( sal_uInt16 nLength
)
894 if(m_nStripeLength
!= nLength
)
896 m_nStripeLength
= nLength
;
902 void SvtOptionsDrawinglayer_Impl::SetOverlayBuffer_Calc( sal_Bool bState
)
904 if(m_bOverlayBuffer_Calc
!= bState
)
906 m_bOverlayBuffer_Calc
= bState
;
911 void SvtOptionsDrawinglayer_Impl::SetOverlayBuffer_Writer( sal_Bool bState
)
913 if(m_bOverlayBuffer_Writer
!= bState
)
915 m_bOverlayBuffer_Writer
= bState
;
920 void SvtOptionsDrawinglayer_Impl::SetOverlayBuffer_DrawImpress( sal_Bool bState
)
922 if(m_bOverlayBuffer_DrawImpress
!= bState
)
924 m_bOverlayBuffer_DrawImpress
= bState
;
929 // #i74769#, #i75172#
930 void SvtOptionsDrawinglayer_Impl::SetPaintBuffer_Calc( sal_Bool bState
)
932 if(m_bPaintBuffer_Calc
!= bState
)
934 m_bPaintBuffer_Calc
= bState
;
939 void SvtOptionsDrawinglayer_Impl::SetPaintBuffer_Writer( sal_Bool bState
)
941 if(m_bPaintBuffer_Writer
!= bState
)
943 m_bPaintBuffer_Writer
= bState
;
948 void SvtOptionsDrawinglayer_Impl::SetPaintBuffer_DrawImpress( sal_Bool bState
)
950 if(m_bPaintBuffer_DrawImpress
!= bState
)
952 m_bPaintBuffer_DrawImpress
= bState
;
958 void SvtOptionsDrawinglayer_Impl::SetMaximumPaperWidth( sal_uInt32 nNew
)
960 if(m_nMaximumPaperWidth
!= nNew
)
962 m_nMaximumPaperWidth
= nNew
;
967 void SvtOptionsDrawinglayer_Impl::SetMaximumPaperHeight( sal_uInt32 nNew
)
969 if(m_nMaximumPaperHeight
!= nNew
)
971 m_nMaximumPaperHeight
= nNew
;
976 void SvtOptionsDrawinglayer_Impl::SetMaximumPaperLeftMargin( sal_uInt32 nNew
)
978 if(m_nMaximumPaperLeftMargin
!= nNew
)
980 m_nMaximumPaperLeftMargin
= nNew
;
985 void SvtOptionsDrawinglayer_Impl::SetMaximumPaperRightMargin( sal_uInt32 nNew
)
987 if(m_nMaximumPaperRightMargin
!= nNew
)
989 m_nMaximumPaperRightMargin
= nNew
;
994 void SvtOptionsDrawinglayer_Impl::SetMaximumPaperTopMargin( sal_uInt32 nNew
)
996 if(m_nMaximumPaperTopMargin
!= nNew
)
998 m_nMaximumPaperTopMargin
= nNew
;
1003 void SvtOptionsDrawinglayer_Impl::SetMaximumPaperBottomMargin( sal_uInt32 nNew
)
1005 if(m_nMaximumPaperBottomMargin
!= nNew
)
1007 m_nMaximumPaperBottomMargin
= nNew
;
1013 sal_Bool
SvtOptionsDrawinglayer_Impl::IsAAPossibleOnThisSystem() const
1015 if(!m_bAllowAAChecked
)
1017 SvtOptionsDrawinglayer_Impl
* pThat
= const_cast< SvtOptionsDrawinglayer_Impl
* >(this);
1018 pThat
->m_bAllowAAChecked
= true;
1021 // WIN32 uses GDIPlus with VCL forthe first incarnation; this will be enhanced
1022 // in the future to use canvases and the canvas renderer, thus a AA-abled
1023 // canvas needs to be checked here in the future.
1024 // Currently, just allow AA for WIN32
1027 // check XRenderExtension
1028 if(m_bAllowAA
&& !Application::GetDefaultDevice()->supportsOperation( OutDevSupport_TransparentRect
))
1030 pThat
->m_bAllowAA
= false;
1038 sal_Bool
SvtOptionsDrawinglayer_Impl::IsAntiAliasing() const
1040 return m_bAntiAliasing
;
1043 sal_Bool
SvtOptionsDrawinglayer_Impl::IsSnapHorVerLinesToDiscrete() const
1045 return m_bSnapHorVerLinesToDiscrete
;
1048 sal_Bool
SvtOptionsDrawinglayer_Impl::IsSolidDragCreate() const
1050 return m_bSolidDragCreate
;
1053 sal_Bool
SvtOptionsDrawinglayer_Impl::IsRenderDecoratedTextDirect() const
1055 return m_bRenderDecoratedTextDirect
;
1058 sal_Bool
SvtOptionsDrawinglayer_Impl::IsRenderSimpleTextDirect() const
1060 return m_bRenderSimpleTextDirect
;
1063 sal_uInt32
SvtOptionsDrawinglayer_Impl::GetQuadratic3DRenderLimit() const
1065 return m_nQuadratic3DRenderLimit
;
1068 sal_uInt32
SvtOptionsDrawinglayer_Impl::GetQuadraticFormControlRenderLimit() const
1070 return m_nQuadraticFormControlRenderLimit
;
1073 void SvtOptionsDrawinglayer_Impl::SetAntiAliasing( sal_Bool bState
)
1075 if(m_bAntiAliasing
!= bState
)
1077 m_bAntiAliasing
= bState
;
1082 void SvtOptionsDrawinglayer_Impl::SetSnapHorVerLinesToDiscrete( sal_Bool bState
)
1084 if(m_bSnapHorVerLinesToDiscrete
!= bState
)
1086 m_bSnapHorVerLinesToDiscrete
= bState
;
1091 void SvtOptionsDrawinglayer_Impl::SetSolidDragCreate( sal_Bool bState
)
1093 if(m_bSolidDragCreate
!= bState
)
1095 m_bSolidDragCreate
= bState
;
1100 void SvtOptionsDrawinglayer_Impl::SetRenderDecoratedTextDirect( sal_Bool bState
)
1102 if(m_bRenderDecoratedTextDirect
!= bState
)
1104 m_bRenderDecoratedTextDirect
= bState
;
1109 void SvtOptionsDrawinglayer_Impl::SetRenderSimpleTextDirect( sal_Bool bState
)
1111 if(m_bRenderSimpleTextDirect
!= bState
)
1113 m_bRenderSimpleTextDirect
= bState
;
1118 void SvtOptionsDrawinglayer_Impl::SetQuadratic3DRenderLimit(sal_uInt32 nNew
)
1120 if(m_nQuadratic3DRenderLimit
!= nNew
)
1122 m_nQuadratic3DRenderLimit
= nNew
;
1127 void SvtOptionsDrawinglayer_Impl::SetQuadraticFormControlRenderLimit(sal_uInt32 nNew
)
1129 if(m_nQuadraticFormControlRenderLimit
!= nNew
)
1131 m_nQuadraticFormControlRenderLimit
= nNew
;
1136 // #i97672# selection settings
1137 sal_Bool
SvtOptionsDrawinglayer_Impl::IsTransparentSelection() const
1139 return m_bTransparentSelection
;
1142 void SvtOptionsDrawinglayer_Impl::SetTransparentSelection( sal_Bool bState
)
1144 if(m_bTransparentSelection
!= bState
)
1146 m_bTransparentSelection
= bState
;
1151 void SvtOptionsDrawinglayer_Impl::SetTransparentSelectionPercent( sal_uInt16 nPercent
)
1153 if(m_nTransparentSelectionPercent
!= nPercent
)
1155 m_nTransparentSelectionPercent
= nPercent
;
1160 sal_uInt16
SvtOptionsDrawinglayer_Impl::GetTransparentSelectionPercent() const
1162 return m_nTransparentSelectionPercent
;
1165 void SvtOptionsDrawinglayer_Impl::SetSelectionMaximumLuminancePercent( sal_uInt16 nPercent
)
1167 if(m_nSelectionMaximumLuminancePercent
!= nPercent
)
1169 m_nSelectionMaximumLuminancePercent
= nPercent
;
1174 sal_uInt16
SvtOptionsDrawinglayer_Impl::GetSelectionMaximumLuminancePercent() const
1176 return m_nSelectionMaximumLuminancePercent
;
1179 //*****************************************************************************************************************
1181 //*****************************************************************************************************************
1182 Sequence
< OUString
> SvtOptionsDrawinglayer_Impl::impl_GetPropertyNames()
1184 // Build static list of configuration key names.
1185 static const OUString pProperties
[] =
1187 PROPERTYNAME_OVERLAYBUFFER
,
1188 PROPERTYNAME_PAINTBUFFER
,
1189 PROPERTYNAME_STRIPE_COLOR_A
,
1190 PROPERTYNAME_STRIPE_COLOR_B
,
1191 PROPERTYNAME_STRIPE_LENGTH
,
1194 PROPERTYNAME_OVERLAYBUFFER_CALC
,
1195 PROPERTYNAME_OVERLAYBUFFER_WRITER
,
1196 PROPERTYNAME_OVERLAYBUFFER_DRAWIMPRESS
,
1198 // #i74769#, #i75172#
1199 PROPERTYNAME_PAINTBUFFER_CALC
,
1200 PROPERTYNAME_PAINTBUFFER_WRITER
,
1201 PROPERTYNAME_PAINTBUFFER_DRAWIMPRESS
,
1204 PROPERTYNAME_MAXIMUMPAPERWIDTH
,
1205 PROPERTYNAME_MAXIMUMPAPERHEIGHT
,
1206 PROPERTYNAME_MAXIMUMPAPERLEFTMARGIN
,
1207 PROPERTYNAME_MAXIMUMPAPERRIGHTMARGIN
,
1208 PROPERTYNAME_MAXIMUMPAPERTOPMARGIN
,
1209 PROPERTYNAME_MAXIMUMPAPERBOTTOMMARGIN
,
1212 PROPERTYNAME_ANTIALIASING
,
1213 PROPERTYNAME_SNAPHORVERLINESTODISCRETE
,
1214 PROPERTYNAME_SOLIDDRAGCREATE
,
1215 PROPERTYNAME_RENDERDECORATEDTEXTDIRECT
,
1216 PROPERTYNAME_RENDERSIMPLETEXTDIRECT
,
1217 PROPERTYNAME_QUADRATIC3DRENDERLIMIT
,
1218 PROPERTYNAME_QUADRATICFORMCONTROLRENDERLIMIT
,
1220 // #i97672# selection settings
1221 PROPERTYNAME_TRANSPARENTSELECTION
,
1222 PROPERTYNAME_TRANSPARENTSELECTIONPERCENT
,
1223 PROPERTYNAME_SELECTIONMAXIMUMLUMINANCEPERCENT
1226 // Initialize return sequence with these list ...
1227 static const Sequence
< OUString
> seqPropertyNames( pProperties
, PROPERTYCOUNT
);
1228 // ... and return it.
1229 return seqPropertyNames
;
1232 //*****************************************************************************************************************
1233 // initialize static member
1234 // DON'T DO IT IN YOUR HEADER!
1235 // see definition for further informations
1236 //*****************************************************************************************************************
1237 SvtOptionsDrawinglayer_Impl
* SvtOptionsDrawinglayer::m_pDataContainer
= NULL
;
1238 sal_Int32
SvtOptionsDrawinglayer::m_nRefCount
= 0;
1240 //*****************************************************************************************************************
1242 //*****************************************************************************************************************
1243 SvtOptionsDrawinglayer::SvtOptionsDrawinglayer()
1245 // Global access, must be guarded (multithreading!).
1246 MutexGuard
aGuard( GetOwnStaticMutex() );
1247 // Increase ouer refcount ...
1249 // ... and initialize ouer data container only if it not already!
1250 if( m_pDataContainer
== NULL
)
1252 m_pDataContainer
= new SvtOptionsDrawinglayer_Impl();
1256 //*****************************************************************************************************************
1258 //*****************************************************************************************************************
1259 SvtOptionsDrawinglayer::~SvtOptionsDrawinglayer()
1261 // Global access, must be guarded (multithreading!)
1262 MutexGuard
aGuard( GetOwnStaticMutex() );
1263 // Decrease ouer refcount.
1265 // If last instance was deleted ...
1266 // we must destroy ouer static data container!
1267 if( m_nRefCount
<= 0 )
1269 delete m_pDataContainer
;
1270 m_pDataContainer
= NULL
;
1274 //*****************************************************************************************************************
1276 //*****************************************************************************************************************
1277 sal_Bool
SvtOptionsDrawinglayer::IsOverlayBuffer() const
1279 MutexGuard
aGuard( GetOwnStaticMutex() );
1280 return m_pDataContainer
->IsOverlayBuffer();
1283 //*****************************************************************************************************************
1285 //*****************************************************************************************************************
1286 sal_Bool
SvtOptionsDrawinglayer::IsPaintBuffer() const
1288 MutexGuard
aGuard( GetOwnStaticMutex() );
1289 return m_pDataContainer
->IsPaintBuffer();
1292 //*****************************************************************************************************************
1294 //*****************************************************************************************************************
1295 Color
SvtOptionsDrawinglayer::GetStripeColorA() const
1297 MutexGuard
aGuard( GetOwnStaticMutex() );
1298 return m_pDataContainer
->GetStripeColorA();
1301 //*****************************************************************************************************************
1303 //*****************************************************************************************************************
1304 Color
SvtOptionsDrawinglayer::GetStripeColorB() const
1306 MutexGuard
aGuard( GetOwnStaticMutex() );
1307 return m_pDataContainer
->GetStripeColorB();
1310 //*****************************************************************************************************************
1312 //*****************************************************************************************************************
1313 sal_uInt16
SvtOptionsDrawinglayer::GetStripeLength() const
1315 MutexGuard
aGuard( GetOwnStaticMutex() );
1316 return m_pDataContainer
->GetStripeLength();
1320 sal_Bool
SvtOptionsDrawinglayer::IsOverlayBuffer_Calc() const
1322 MutexGuard
aGuard( GetOwnStaticMutex() );
1323 return m_pDataContainer
->IsOverlayBuffer_Calc();
1326 sal_Bool
SvtOptionsDrawinglayer::IsOverlayBuffer_Writer() const
1328 MutexGuard
aGuard( GetOwnStaticMutex() );
1329 return m_pDataContainer
->IsOverlayBuffer_Writer();
1332 sal_Bool
SvtOptionsDrawinglayer::IsOverlayBuffer_DrawImpress() const
1334 MutexGuard
aGuard( GetOwnStaticMutex() );
1335 return m_pDataContainer
->IsOverlayBuffer_DrawImpress();
1338 // #i74769#, #i75172#
1339 sal_Bool
SvtOptionsDrawinglayer::IsPaintBuffer_Calc() const
1341 MutexGuard
aGuard( GetOwnStaticMutex() );
1342 return m_pDataContainer
->IsPaintBuffer_Calc();
1345 sal_Bool
SvtOptionsDrawinglayer::IsPaintBuffer_Writer() const
1347 MutexGuard
aGuard( GetOwnStaticMutex() );
1348 return m_pDataContainer
->IsPaintBuffer_Writer();
1351 sal_Bool
SvtOptionsDrawinglayer::IsPaintBuffer_DrawImpress() const
1353 MutexGuard
aGuard( GetOwnStaticMutex() );
1354 return m_pDataContainer
->IsPaintBuffer_DrawImpress();
1358 sal_uInt32
SvtOptionsDrawinglayer::GetMaximumPaperWidth() const
1360 MutexGuard
aGuard( GetOwnStaticMutex() );
1361 return m_pDataContainer
->GetMaximumPaperWidth();
1364 sal_uInt32
SvtOptionsDrawinglayer::GetMaximumPaperHeight() const
1366 MutexGuard
aGuard( GetOwnStaticMutex() );
1367 return m_pDataContainer
->GetMaximumPaperHeight();
1370 sal_uInt32
SvtOptionsDrawinglayer::GetMaximumPaperLeftMargin() const
1372 MutexGuard
aGuard( GetOwnStaticMutex() );
1373 return m_pDataContainer
->GetMaximumPaperLeftMargin();
1376 sal_uInt32
SvtOptionsDrawinglayer::GetMaximumPaperRightMargin() const
1378 MutexGuard
aGuard( GetOwnStaticMutex() );
1379 return m_pDataContainer
->GetMaximumPaperRightMargin();
1382 sal_uInt32
SvtOptionsDrawinglayer::GetMaximumPaperTopMargin() const
1384 MutexGuard
aGuard( GetOwnStaticMutex() );
1385 return m_pDataContainer
->GetMaximumPaperTopMargin();
1388 sal_uInt32
SvtOptionsDrawinglayer::GetMaximumPaperBottomMargin() const
1390 MutexGuard
aGuard( GetOwnStaticMutex() );
1391 return m_pDataContainer
->GetMaximumPaperBottomMargin();
1394 //*****************************************************************************************************************
1396 //*****************************************************************************************************************
1397 void SvtOptionsDrawinglayer::SetOverlayBuffer( sal_Bool bState
)
1399 MutexGuard
aGuard( GetOwnStaticMutex() );
1400 m_pDataContainer
->SetOverlayBuffer( bState
);
1403 //*****************************************************************************************************************
1405 //*****************************************************************************************************************
1406 void SvtOptionsDrawinglayer::SetPaintBuffer( sal_Bool bState
)
1408 MutexGuard
aGuard( GetOwnStaticMutex() );
1409 m_pDataContainer
->SetPaintBuffer( bState
);
1412 //*****************************************************************************************************************
1414 //*****************************************************************************************************************
1415 void SvtOptionsDrawinglayer::SetStripeColorA( Color aColor
)
1417 MutexGuard
aGuard( GetOwnStaticMutex() );
1418 m_pDataContainer
->SetStripeColorA( aColor
);
1421 //*****************************************************************************************************************
1423 //*****************************************************************************************************************
1424 void SvtOptionsDrawinglayer::SetStripeColorB( Color aColor
)
1426 MutexGuard
aGuard( GetOwnStaticMutex() );
1427 m_pDataContainer
->SetStripeColorB( aColor
);
1430 //*****************************************************************************************************************
1432 //*****************************************************************************************************************
1433 void SvtOptionsDrawinglayer::SetStripeLength( sal_uInt16 nLength
)
1435 MutexGuard
aGuard( GetOwnStaticMutex() );
1436 m_pDataContainer
->SetStripeLength( nLength
);
1440 void SvtOptionsDrawinglayer::SetOverlayBuffer_Calc( sal_Bool bState
)
1442 MutexGuard
aGuard( GetOwnStaticMutex() );
1443 m_pDataContainer
->SetOverlayBuffer_Calc( bState
);
1446 void SvtOptionsDrawinglayer::SetOverlayBuffer_Writer( sal_Bool bState
)
1448 MutexGuard
aGuard( GetOwnStaticMutex() );
1449 m_pDataContainer
->SetOverlayBuffer_Writer( bState
);
1452 void SvtOptionsDrawinglayer::SetOverlayBuffer_DrawImpress( sal_Bool bState
)
1454 MutexGuard
aGuard( GetOwnStaticMutex() );
1455 m_pDataContainer
->SetOverlayBuffer_DrawImpress( bState
);
1458 // #i74769#, #i75172#
1459 void SvtOptionsDrawinglayer::SetPaintBuffer_Calc( sal_Bool bState
)
1461 MutexGuard
aGuard( GetOwnStaticMutex() );
1462 m_pDataContainer
->SetPaintBuffer_Calc( bState
);
1465 void SvtOptionsDrawinglayer::SetPaintBuffer_Writer( sal_Bool bState
)
1467 MutexGuard
aGuard( GetOwnStaticMutex() );
1468 m_pDataContainer
->SetPaintBuffer_Writer( bState
);
1471 void SvtOptionsDrawinglayer::SetPaintBuffer_DrawImpress( sal_Bool bState
)
1473 MutexGuard
aGuard( GetOwnStaticMutex() );
1474 m_pDataContainer
->SetPaintBuffer_DrawImpress( bState
);
1478 void SvtOptionsDrawinglayer::SetMaximumPaperWidth( sal_uInt32 nNew
)
1480 MutexGuard
aGuard( GetOwnStaticMutex() );
1481 m_pDataContainer
->SetMaximumPaperWidth( nNew
);
1484 void SvtOptionsDrawinglayer::SetMaximumPaperHeight( sal_uInt32 nNew
)
1486 MutexGuard
aGuard( GetOwnStaticMutex() );
1487 m_pDataContainer
->SetMaximumPaperHeight( nNew
);
1490 void SvtOptionsDrawinglayer::SetMaximumPaperLeftMargin( sal_uInt32 nNew
)
1492 MutexGuard
aGuard( GetOwnStaticMutex() );
1493 m_pDataContainer
->SetMaximumPaperLeftMargin( nNew
);
1496 void SvtOptionsDrawinglayer::SetMaximumPaperRightMargin( sal_uInt32 nNew
)
1498 MutexGuard
aGuard( GetOwnStaticMutex() );
1499 m_pDataContainer
->SetMaximumPaperRightMargin( nNew
);
1502 void SvtOptionsDrawinglayer::SetMaximumPaperTopMargin( sal_uInt32 nNew
)
1504 MutexGuard
aGuard( GetOwnStaticMutex() );
1505 m_pDataContainer
->SetMaximumPaperTopMargin( nNew
);
1508 void SvtOptionsDrawinglayer::SetMaximumPaperBottomMargin( sal_uInt32 nNew
)
1510 MutexGuard
aGuard( GetOwnStaticMutex() );
1511 m_pDataContainer
->SetMaximumPaperBottomMargin( nNew
);
1515 sal_Bool
SvtOptionsDrawinglayer::IsAAPossibleOnThisSystem() const
1517 return m_pDataContainer
->IsAAPossibleOnThisSystem();
1521 sal_Bool
SvtOptionsDrawinglayer::IsAntiAliasing() const
1523 MutexGuard
aGuard( GetOwnStaticMutex() );
1524 return m_pDataContainer
->IsAntiAliasing() && IsAAPossibleOnThisSystem();
1527 sal_Bool
SvtOptionsDrawinglayer::IsSnapHorVerLinesToDiscrete() const
1529 MutexGuard
aGuard( GetOwnStaticMutex() );
1530 return m_pDataContainer
->IsAntiAliasing() && m_pDataContainer
->IsSnapHorVerLinesToDiscrete();
1533 sal_Bool
SvtOptionsDrawinglayer::IsSolidDragCreate() const
1535 MutexGuard
aGuard( GetOwnStaticMutex() );
1536 return m_pDataContainer
->IsSolidDragCreate();
1539 sal_Bool
SvtOptionsDrawinglayer::IsRenderDecoratedTextDirect() const
1541 MutexGuard
aGuard( GetOwnStaticMutex() );
1542 return m_pDataContainer
->IsRenderDecoratedTextDirect();
1545 sal_Bool
SvtOptionsDrawinglayer::IsRenderSimpleTextDirect() const
1547 MutexGuard
aGuard( GetOwnStaticMutex() );
1548 return m_pDataContainer
->IsRenderSimpleTextDirect();
1551 sal_uInt32
SvtOptionsDrawinglayer::GetQuadratic3DRenderLimit() const
1553 MutexGuard
aGuard( GetOwnStaticMutex() );
1554 return m_pDataContainer
->GetQuadratic3DRenderLimit();
1557 sal_uInt32
SvtOptionsDrawinglayer::GetQuadraticFormControlRenderLimit() const
1559 MutexGuard
aGuard( GetOwnStaticMutex() );
1560 return m_pDataContainer
->GetQuadraticFormControlRenderLimit();
1563 void SvtOptionsDrawinglayer::SetAntiAliasing( sal_Bool bState
)
1565 MutexGuard
aGuard( GetOwnStaticMutex() );
1566 m_pDataContainer
->SetAntiAliasing( bState
);
1569 void SvtOptionsDrawinglayer::SetSnapHorVerLinesToDiscrete( sal_Bool bState
)
1571 MutexGuard
aGuard( GetOwnStaticMutex() );
1572 m_pDataContainer
->SetSnapHorVerLinesToDiscrete( bState
);
1575 void SvtOptionsDrawinglayer::SetSolidDragCreate( sal_Bool bState
)
1577 MutexGuard
aGuard( GetOwnStaticMutex() );
1578 m_pDataContainer
->SetSolidDragCreate( bState
);
1581 void SvtOptionsDrawinglayer::SetRenderDecoratedTextDirect( sal_Bool bState
)
1583 MutexGuard
aGuard( GetOwnStaticMutex() );
1584 m_pDataContainer
->SetRenderDecoratedTextDirect( bState
);
1587 void SvtOptionsDrawinglayer::SetRenderSimpleTextDirect( sal_Bool bState
)
1589 MutexGuard
aGuard( GetOwnStaticMutex() );
1590 m_pDataContainer
->SetRenderSimpleTextDirect( bState
);
1593 void SvtOptionsDrawinglayer::SetQuadratic3DRenderLimit(sal_uInt32 nNew
)
1595 MutexGuard
aGuard( GetOwnStaticMutex() );
1596 m_pDataContainer
->SetQuadratic3DRenderLimit( nNew
);
1599 void SvtOptionsDrawinglayer::SetQuadraticFormControlRenderLimit(sal_uInt32 nNew
)
1601 MutexGuard
aGuard( GetOwnStaticMutex() );
1602 m_pDataContainer
->SetQuadraticFormControlRenderLimit( nNew
);
1605 // #i97672# selection settings
1606 sal_Bool
SvtOptionsDrawinglayer::IsTransparentSelection() const
1608 MutexGuard
aGuard( GetOwnStaticMutex() );
1609 return m_pDataContainer
->IsTransparentSelection();
1612 void SvtOptionsDrawinglayer::SetTransparentSelection( sal_Bool bState
)
1614 MutexGuard
aGuard( GetOwnStaticMutex() );
1615 m_pDataContainer
->SetTransparentSelection( bState
);
1618 sal_uInt16
SvtOptionsDrawinglayer::GetTransparentSelectionPercent() const
1620 MutexGuard
aGuard( GetOwnStaticMutex() );
1621 sal_uInt16
aRetval(m_pDataContainer
->GetTransparentSelectionPercent());
1623 // crop to range [10% .. 90%]
1637 void SvtOptionsDrawinglayer::SetTransparentSelectionPercent( sal_uInt16 nPercent
)
1639 MutexGuard
aGuard( GetOwnStaticMutex() );
1641 // crop to range [10% .. 90%]
1652 m_pDataContainer
->SetTransparentSelectionPercent( nPercent
);
1655 sal_uInt16
SvtOptionsDrawinglayer::GetSelectionMaximumLuminancePercent() const
1657 MutexGuard
aGuard( GetOwnStaticMutex() );
1658 sal_uInt16
aRetval(m_pDataContainer
->GetSelectionMaximumLuminancePercent());
1660 // crop to range [0% .. 100%]
1669 void SvtOptionsDrawinglayer::SetSelectionMaximumLuminancePercent( sal_uInt16 nPercent
)
1671 MutexGuard
aGuard( GetOwnStaticMutex() );
1673 // crop to range [0% .. 100%]
1679 m_pDataContainer
->SetSelectionMaximumLuminancePercent( nPercent
);
1682 //*****************************************************************************************************************
1684 //*****************************************************************************************************************
1685 Mutex
& SvtOptionsDrawinglayer::GetOwnStaticMutex()
1687 // Initialize static mutex only for one time!
1688 static Mutex
* pMutex
= NULL
;
1689 // If these method first called (Mutex not already exist!) ...
1690 if( pMutex
== NULL
)
1692 // ... we must create a new one. Protect follow code with the global mutex -
1693 // It must be - we create a static variable!
1694 MutexGuard
aGuard( Mutex::getGlobalMutex() );
1695 // We must check our pointer again - because it can be that another instance of ouer class will be fastr then these!
1696 if( pMutex
== NULL
)
1698 // Create the new mutex and set it for return on static variable.
1699 static Mutex aMutex
;
1703 // Return new created or already existing mutex object.