1 /**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License. You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied. See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22
23 // MARKER(update_precomp.py): autogen include statement, do not remove
24 #include "precompiled_svtools.hxx"
25
26 #ifdef _MSC_VER
27 #pragma hdrstop
28 #endif
29
30 //_________________________________________________________________________________________________________________
31 // includes
32 //_________________________________________________________________________________________________________________
33
34 #include <svtools/optionsdrawinglayer.hxx>
35 #include <unotools/configmgr.hxx>
36 #include <unotools/configitem.hxx>
37 #include <tools/debug.hxx>
38 #include <com/sun/star/uno/Any.hxx>
39 #include <com/sun/star/uno/Sequence.hxx>
40 #include <vcl/svapp.hxx>
41 #include <vcl/outdev.hxx>
42
43 //_________________________________________________________________________________________________________________
44 // namespaces
45 //_________________________________________________________________________________________________________________
46
47 using namespace ::utl ;
48 using namespace ::rtl ;
49 using namespace ::osl ;
50 using namespace ::com::sun::star::uno ;
51
52 //_________________________________________________________________________________________________________________
53 // const
54 //_________________________________________________________________________________________________________________
55
56 #define ROOTNODE_START OUString(RTL_CONSTASCII_USTRINGPARAM("Office.Common/Drawinglayer" ))
57 #define DEFAULT_OVERLAYBUFFER sal_True
58 #define DEFAULT_PAINTBUFFER sal_True
59 #define DEFAULT_STRIPE_COLOR_A 0
60 #define DEFAULT_STRIPE_COLOR_B 16581375
61 #define DEFAULT_STRIPE_LENGTH 4
62
63 // #i73602#
64 // #i74769#, #i75172# : Change default for Calc and Writer to True
65 #define DEFAULT_OVERLAYBUFFER_CALC sal_True
66 #define DEFAULT_OVERLAYBUFFER_WRITER sal_True
67 #define DEFAULT_OVERLAYBUFFER_DRAWIMPRESS sal_True
68
69 // #i74769#, #i75172#
70 #define DEFAULT_PAINTBUFFER_CALC sal_True
71 #define DEFAULT_PAINTBUFFER_WRITER sal_True
72 #define DEFAULT_PAINTBUFFER_DRAWIMPRESS sal_True
73
74 // #i4219#
75 #define DEFAULT_MAXIMUMPAPERWIDTH 300
76 #define DEFAULT_MAXIMUMPAPERHEIGHT 300
77 #define DEFAULT_MAXIMUMPAPERLEFTMARGIN 9999
78 #define DEFAULT_MAXIMUMPAPERRIGHTMARGIN 9999
79 #define DEFAULT_MAXIMUMPAPERTOPMARGIN 9999
80 #define DEFAULT_MAXIMUMPAPERBOTTOMMARGIN 9999
81
82 // primitives
83 #define DEFAULT_ANTIALIASING sal_True
84 #define DEFAULT_SNAPHORVERLINESTODISCRETE sal_True
85 #define DEFAULT_SOLIDDRAGCREATE sal_True
86 #define DEFAULT_RENDERDECORATEDTEXTDIRECT sal_True
87 #define DEFAULT_RENDERSIMPLETEXTDIRECT sal_True
88 #define DEFAULT_QUADRATIC3DRENDERLIMIT 1000000
89 #define DEFAULT_QUADRATICFORMCONTROLRENDERLIMIT 45000
90
91 // #i97672# selection settings
92 #define DEFAULT_TRANSPARENTSELECTION sal_True
93 #define DEFAULT_TRANSPARENTSELECTIONPERCENT 75
94 #define DEFAULT_SELECTIONMAXIMUMLUMINANCEPERCENT 70
95
96 #define PROPERTYNAME_OVERLAYBUFFER OUString(RTL_CONSTASCII_USTRINGPARAM("OverlayBuffer" ))
97 #define PROPERTYNAME_PAINTBUFFER OUString(RTL_CONSTASCII_USTRINGPARAM("PaintBuffer" ))
98 #define PROPERTYNAME_STRIPE_COLOR_A OUString(RTL_CONSTASCII_USTRINGPARAM("StripeColorA" ))
99 #define PROPERTYNAME_STRIPE_COLOR_B OUString(RTL_CONSTASCII_USTRINGPARAM("StripeColorB" ))
100 #define PROPERTYNAME_STRIPE_LENGTH OUString(RTL_CONSTASCII_USTRINGPARAM("StripeLength" ))
101
102 // #i73602#
103 #define PROPERTYNAME_OVERLAYBUFFER_CALC OUString(RTL_CONSTASCII_USTRINGPARAM("OverlayBuffer_Calc"))
104 #define PROPERTYNAME_OVERLAYBUFFER_WRITER OUString(RTL_CONSTASCII_USTRINGPARAM("OverlayBuffer_Writer"))
105 #define PROPERTYNAME_OVERLAYBUFFER_DRAWIMPRESS OUString(RTL_CONSTASCII_USTRINGPARAM("OverlayBuffer_DrawImpress"))
106
107 // #i74769#, #i75172#
108 #define PROPERTYNAME_PAINTBUFFER_CALC OUString(RTL_CONSTASCII_USTRINGPARAM("PaintBuffer_Calc"))
109 #define PROPERTYNAME_PAINTBUFFER_WRITER OUString(RTL_CONSTASCII_USTRINGPARAM("PaintBuffer_Writer"))
110 #define PROPERTYNAME_PAINTBUFFER_DRAWIMPRESS OUString(RTL_CONSTASCII_USTRINGPARAM("PaintBuffer_DrawImpress"))
111
112 // #i4219#
113 #define PROPERTYNAME_MAXIMUMPAPERWIDTH OUString(RTL_CONSTASCII_USTRINGPARAM("MaximumPaperWidth"))
114 #define PROPERTYNAME_MAXIMUMPAPERHEIGHT OUString(RTL_CONSTASCII_USTRINGPARAM("MaximumPaperHeight"))
115 #define PROPERTYNAME_MAXIMUMPAPERLEFTMARGIN OUString(RTL_CONSTASCII_USTRINGPARAM("MaximumPaperLeftMargin"))
116 #define PROPERTYNAME_MAXIMUMPAPERRIGHTMARGIN OUString(RTL_CONSTASCII_USTRINGPARAM("MaximumPaperRightMargin"))
117 #define PROPERTYNAME_MAXIMUMPAPERTOPMARGIN OUString(RTL_CONSTASCII_USTRINGPARAM("MaximumPaperTopMargin"))
118 #define PROPERTYNAME_MAXIMUMPAPERBOTTOMMARGIN OUString(RTL_CONSTASCII_USTRINGPARAM("MaximumPaperBottomMargin"))
119
120 // primitives
121 #define PROPERTYNAME_ANTIALIASING OUString(RTL_CONSTASCII_USTRINGPARAM("AntiAliasing"))
122 #define PROPERTYNAME_SNAPHORVERLINESTODISCRETE OUString(RTL_CONSTASCII_USTRINGPARAM("SnapHorVerLinesToDiscrete"))
123 #define PROPERTYNAME_SOLIDDRAGCREATE OUString(RTL_CONSTASCII_USTRINGPARAM("SolidDragCreate"))
124 #define PROPERTYNAME_RENDERDECORATEDTEXTDIRECT OUString(RTL_CONSTASCII_USTRINGPARAM("RenderDecoratedTextDirect"))
125 #define PROPERTYNAME_RENDERSIMPLETEXTDIRECT OUString(RTL_CONSTASCII_USTRINGPARAM("RenderSimpleTextDirect"))
126 #define PROPERTYNAME_QUADRATIC3DRENDERLIMIT OUString(RTL_CONSTASCII_USTRINGPARAM("Quadratic3DRenderLimit"))
127 #define PROPERTYNAME_QUADRATICFORMCONTROLRENDERLIMIT OUString(RTL_CONSTASCII_USTRINGPARAM("QuadraticFormControlRenderLimit"))
128
129 // #i97672# selection settings
130 #define PROPERTYNAME_TRANSPARENTSELECTION OUString(RTL_CONSTASCII_USTRINGPARAM("TransparentSelection"))
131 #define PROPERTYNAME_TRANSPARENTSELECTIONPERCENT OUString(RTL_CONSTASCII_USTRINGPARAM("TransparentSelectionPercent"))
132 #define PROPERTYNAME_SELECTIONMAXIMUMLUMINANCEPERCENT OUString(RTL_CONSTASCII_USTRINGPARAM("SelectionMaximumLuminancePercent"))
133
134 #define PROPERTYHANDLE_OVERLAYBUFFER 0
135 #define PROPERTYHANDLE_PAINTBUFFER 1
136 #define PROPERTYHANDLE_STRIPE_COLOR_A 2
137 #define PROPERTYHANDLE_STRIPE_COLOR_B 3
138 #define PROPERTYHANDLE_STRIPE_LENGTH 4
139
140 // #i73602#
141 #define PROPERTYHANDLE_OVERLAYBUFFER_CALC 5
142 #define PROPERTYHANDLE_OVERLAYBUFFER_WRITER 6
143 #define PROPERTYHANDLE_OVERLAYBUFFER_DRAWIMPRESS 7
144
145 // #i74769#, #i75172#
146 #define PROPERTYHANDLE_PAINTBUFFER_CALC 8
147 #define PROPERTYHANDLE_PAINTBUFFER_WRITER 9
148 #define PROPERTYHANDLE_PAINTBUFFER_DRAWIMPRESS 10
149
150 // #i4219#
151 #define PROPERTYHANDLE_MAXIMUMPAPERWIDTH 11
152 #define PROPERTYHANDLE_MAXIMUMPAPERHEIGHT 12
153 #define PROPERTYHANDLE_MAXIMUMPAPERLEFTMARGIN 13
154 #define PROPERTYHANDLE_MAXIMUMPAPERRIGHTMARGIN 14
155 #define PROPERTYHANDLE_MAXIMUMPAPERTOPMARGIN 15
156 #define PROPERTYHANDLE_MAXIMUMPAPERBOTTOMMARGIN 16
157
158 // primitives
159 #define PROPERTYHANDLE_ANTIALIASING 17
160 #define PROPERTYHANDLE_SNAPHORVERLINESTODISCRETE 18
161 #define PROPERTYHANDLE_SOLIDDRAGCREATE 19
162 #define PROPERTYHANDLE_RENDERDECORATEDTEXTDIRECT 20
163 #define PROPERTYHANDLE_RENDERSIMPLETEXTDIRECT 21
164 #define PROPERTYHANDLE_QUADRATIC3DRENDERLIMIT 22
165 #define PROPERTYHANDLE_QUADRATICFORMCONTROLRENDERLIMIT 23
166
167 // #i97672# selection settings
168 #define PROPERTYHANDLE_TRANSPARENTSELECTION 24
169 #define PROPERTYHANDLE_TRANSPARENTSELECTIONPERCENT 25
170 #define PROPERTYHANDLE_SELECTIONMAXIMUMLUMINANCEPERCENT 26
171
172 #define PROPERTYCOUNT 27
173
174 class SvtOptionsDrawinglayer_Impl : public ConfigItem
175 {
176 public:
177
178 //---------------------------------------------------------------------------------------------------------
179 // constructor / destructor
180 //---------------------------------------------------------------------------------------------------------
181
182 SvtOptionsDrawinglayer_Impl();
183 ~SvtOptionsDrawinglayer_Impl();
184
185 //---------------------------------------------------------------------------------------------------------
186 // overloaded methods of baseclass
187 //---------------------------------------------------------------------------------------------------------
188
189 virtual void Commit();
190 virtual void Notify( const com::sun::star::uno::Sequence<rtl::OUString>& aPropertyNames);
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 //*****************************************************************************************************************
SvtOptionsDrawinglayer_Impl()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 //*****************************************************************************************************************
~SvtOptionsDrawinglayer_Impl()599 SvtOptionsDrawinglayer_Impl::~SvtOptionsDrawinglayer_Impl()
600 {
601 if( IsModified() )
602 Commit();
603 }
604
605 //*****************************************************************************************************************
606 // Commit
607 //*****************************************************************************************************************
Commit()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
Notify(const com::sun::star::uno::Sequence<rtl::OUString> &)735 void SvtOptionsDrawinglayer_Impl::Notify( const com::sun::star::uno::Sequence<rtl::OUString>& )
736 {
737 }
738
739 //*****************************************************************************************************************
740 // public method
741 //*****************************************************************************************************************
IsOverlayBuffer() const742 sal_Bool SvtOptionsDrawinglayer_Impl::IsOverlayBuffer() const
743 {
744 return m_bOverlayBuffer;
745 }
746
747 //*****************************************************************************************************************
748 // public method
749 //*****************************************************************************************************************
IsPaintBuffer() const750 sal_Bool SvtOptionsDrawinglayer_Impl::IsPaintBuffer() const
751 {
752 return m_bPaintBuffer;
753 }
754
755 //*****************************************************************************************************************
756 // public method
757 //*****************************************************************************************************************
GetStripeColorA() const758 Color SvtOptionsDrawinglayer_Impl::GetStripeColorA() const
759 {
760 return m_bStripeColorA;
761 }
762
763 //*****************************************************************************************************************
764 // public method
765 //*****************************************************************************************************************
GetStripeColorB() const766 Color SvtOptionsDrawinglayer_Impl::GetStripeColorB() const
767 {
768 return m_bStripeColorB;
769 }
770
771 //*****************************************************************************************************************
772 // public method
773 //*****************************************************************************************************************
GetStripeLength() const774 sal_uInt16 SvtOptionsDrawinglayer_Impl::GetStripeLength() const
775 {
776 return m_nStripeLength;
777 }
778
779 // #i73602#
IsOverlayBuffer_Calc() const780 sal_Bool SvtOptionsDrawinglayer_Impl::IsOverlayBuffer_Calc() const
781 {
782 return m_bOverlayBuffer_Calc;
783 }
784
IsOverlayBuffer_Writer() const785 sal_Bool SvtOptionsDrawinglayer_Impl::IsOverlayBuffer_Writer() const
786 {
787 return m_bOverlayBuffer_Writer;
788 }
789
IsOverlayBuffer_DrawImpress() const790 sal_Bool SvtOptionsDrawinglayer_Impl::IsOverlayBuffer_DrawImpress() const
791 {
792 return m_bOverlayBuffer_DrawImpress;
793 }
794
795 // #i74769#, #i75172#
IsPaintBuffer_Calc() const796 sal_Bool SvtOptionsDrawinglayer_Impl::IsPaintBuffer_Calc() const
797 {
798 return m_bPaintBuffer_Calc;
799 }
800
IsPaintBuffer_Writer() const801 sal_Bool SvtOptionsDrawinglayer_Impl::IsPaintBuffer_Writer() const
802 {
803 return m_bPaintBuffer_Writer;
804 }
805
IsPaintBuffer_DrawImpress() const806 sal_Bool SvtOptionsDrawinglayer_Impl::IsPaintBuffer_DrawImpress() const
807 {
808 return m_bPaintBuffer_DrawImpress;
809 }
810
811 // #i4219#
GetMaximumPaperWidth() const812 sal_uInt32 SvtOptionsDrawinglayer_Impl::GetMaximumPaperWidth() const
813 {
814 return m_nMaximumPaperWidth;
815 }
816
GetMaximumPaperHeight() const817 sal_uInt32 SvtOptionsDrawinglayer_Impl::GetMaximumPaperHeight() const
818 {
819 return m_nMaximumPaperHeight;
820 }
821
GetMaximumPaperLeftMargin() const822 sal_uInt32 SvtOptionsDrawinglayer_Impl::GetMaximumPaperLeftMargin() const
823 {
824 return m_nMaximumPaperLeftMargin;
825 }
826
GetMaximumPaperRightMargin() const827 sal_uInt32 SvtOptionsDrawinglayer_Impl::GetMaximumPaperRightMargin() const
828 {
829 return m_nMaximumPaperRightMargin;
830 }
831
GetMaximumPaperTopMargin() const832 sal_uInt32 SvtOptionsDrawinglayer_Impl::GetMaximumPaperTopMargin() const
833 {
834 return m_nMaximumPaperTopMargin;
835 }
836
GetMaximumPaperBottomMargin() const837 sal_uInt32 SvtOptionsDrawinglayer_Impl::GetMaximumPaperBottomMargin() const
838 {
839 return m_nMaximumPaperBottomMargin;
840 }
841
842 //*****************************************************************************************************************
843 // public method
844 //*****************************************************************************************************************
SetOverlayBuffer(sal_Bool bState)845 void SvtOptionsDrawinglayer_Impl::SetOverlayBuffer( sal_Bool bState )
846 {
847 if(m_bOverlayBuffer != bState)
848 {
849 m_bOverlayBuffer = bState;
850 SetModified();
851 }
852 }
853
854 //*****************************************************************************************************************
855 // public method
856 //*****************************************************************************************************************
SetPaintBuffer(sal_Bool bState)857 void SvtOptionsDrawinglayer_Impl::SetPaintBuffer( sal_Bool bState )
858 {
859 if(m_bPaintBuffer != bState)
860 {
861 m_bPaintBuffer = bState;
862 SetModified();
863 }
864 }
865
866 //*****************************************************************************************************************
867 // public method
868 //*****************************************************************************************************************
SetStripeColorA(Color aColor)869 void SvtOptionsDrawinglayer_Impl::SetStripeColorA( Color aColor )
870 {
871 if(m_bStripeColorA != aColor)
872 {
873 m_bStripeColorA = aColor;
874 SetModified();
875 }
876 }
877
878 //*****************************************************************************************************************
879 // public method
880 //*****************************************************************************************************************
SetStripeColorB(Color aColor)881 void SvtOptionsDrawinglayer_Impl::SetStripeColorB( Color aColor )
882 {
883 if(m_bStripeColorB != aColor)
884 {
885 m_bStripeColorB = aColor;
886 SetModified();
887 }
888 }
889
890 //*****************************************************************************************************************
891 // public method
892 //*****************************************************************************************************************
SetStripeLength(sal_uInt16 nLength)893 void SvtOptionsDrawinglayer_Impl::SetStripeLength( sal_uInt16 nLength )
894 {
895 if(m_nStripeLength != nLength)
896 {
897 m_nStripeLength = nLength;
898 SetModified();
899 }
900 }
901
902 // #i73602#
SetOverlayBuffer_Calc(sal_Bool bState)903 void SvtOptionsDrawinglayer_Impl::SetOverlayBuffer_Calc( sal_Bool bState )
904 {
905 if(m_bOverlayBuffer_Calc != bState)
906 {
907 m_bOverlayBuffer_Calc = bState;
908 SetModified();
909 }
910 }
911
SetOverlayBuffer_Writer(sal_Bool bState)912 void SvtOptionsDrawinglayer_Impl::SetOverlayBuffer_Writer( sal_Bool bState )
913 {
914 if(m_bOverlayBuffer_Writer != bState)
915 {
916 m_bOverlayBuffer_Writer = bState;
917 SetModified();
918 }
919 }
920
SetOverlayBuffer_DrawImpress(sal_Bool bState)921 void SvtOptionsDrawinglayer_Impl::SetOverlayBuffer_DrawImpress( sal_Bool bState )
922 {
923 if(m_bOverlayBuffer_DrawImpress != bState)
924 {
925 m_bOverlayBuffer_DrawImpress = bState;
926 SetModified();
927 }
928 }
929
930 // #i74769#, #i75172#
SetPaintBuffer_Calc(sal_Bool bState)931 void SvtOptionsDrawinglayer_Impl::SetPaintBuffer_Calc( sal_Bool bState )
932 {
933 if(m_bPaintBuffer_Calc != bState)
934 {
935 m_bPaintBuffer_Calc = bState;
936 SetModified();
937 }
938 }
939
SetPaintBuffer_Writer(sal_Bool bState)940 void SvtOptionsDrawinglayer_Impl::SetPaintBuffer_Writer( sal_Bool bState )
941 {
942 if(m_bPaintBuffer_Writer != bState)
943 {
944 m_bPaintBuffer_Writer = bState;
945 SetModified();
946 }
947 }
948
SetPaintBuffer_DrawImpress(sal_Bool bState)949 void SvtOptionsDrawinglayer_Impl::SetPaintBuffer_DrawImpress( sal_Bool bState )
950 {
951 if(m_bPaintBuffer_DrawImpress != bState)
952 {
953 m_bPaintBuffer_DrawImpress = bState;
954 SetModified();
955 }
956 }
957
958 // #i4219#
SetMaximumPaperWidth(sal_uInt32 nNew)959 void SvtOptionsDrawinglayer_Impl::SetMaximumPaperWidth( sal_uInt32 nNew )
960 {
961 if(m_nMaximumPaperWidth != nNew)
962 {
963 m_nMaximumPaperWidth = nNew;
964 SetModified();
965 }
966 }
967
SetMaximumPaperHeight(sal_uInt32 nNew)968 void SvtOptionsDrawinglayer_Impl::SetMaximumPaperHeight( sal_uInt32 nNew )
969 {
970 if(m_nMaximumPaperHeight != nNew)
971 {
972 m_nMaximumPaperHeight = nNew;
973 SetModified();
974 }
975 }
976
SetMaximumPaperLeftMargin(sal_uInt32 nNew)977 void SvtOptionsDrawinglayer_Impl::SetMaximumPaperLeftMargin( sal_uInt32 nNew )
978 {
979 if(m_nMaximumPaperLeftMargin != nNew)
980 {
981 m_nMaximumPaperLeftMargin = nNew;
982 SetModified();
983 }
984 }
985
SetMaximumPaperRightMargin(sal_uInt32 nNew)986 void SvtOptionsDrawinglayer_Impl::SetMaximumPaperRightMargin( sal_uInt32 nNew )
987 {
988 if(m_nMaximumPaperRightMargin != nNew)
989 {
990 m_nMaximumPaperRightMargin = nNew;
991 SetModified();
992 }
993 }
994
SetMaximumPaperTopMargin(sal_uInt32 nNew)995 void SvtOptionsDrawinglayer_Impl::SetMaximumPaperTopMargin( sal_uInt32 nNew )
996 {
997 if(m_nMaximumPaperTopMargin != nNew)
998 {
999 m_nMaximumPaperTopMargin = nNew;
1000 SetModified();
1001 }
1002 }
1003
SetMaximumPaperBottomMargin(sal_uInt32 nNew)1004 void SvtOptionsDrawinglayer_Impl::SetMaximumPaperBottomMargin( sal_uInt32 nNew )
1005 {
1006 if(m_nMaximumPaperBottomMargin != nNew)
1007 {
1008 m_nMaximumPaperBottomMargin = nNew;
1009 SetModified();
1010 }
1011 }
1012
1013 // helper
IsAAPossibleOnThisSystem() const1014 sal_Bool SvtOptionsDrawinglayer_Impl::IsAAPossibleOnThisSystem() const
1015 {
1016 if(!m_bAllowAAChecked)
1017 {
1018 SvtOptionsDrawinglayer_Impl* pThat = const_cast< SvtOptionsDrawinglayer_Impl* >(this);
1019 pThat->m_bAllowAAChecked = true;
1020
1021 #ifdef WIN32
1022 // WIN32 uses GDIPlus with VCL forthe first incarnation; this will be enhanced
1023 // in the future to use canvases and the canvas renderer, thus a AA-abled
1024 // canvas needs to be checked here in the future.
1025 // Currently, just allow AA for WIN32
1026 #endif
1027
1028 // check XRenderExtension
1029 if(m_bAllowAA && !Application::GetDefaultDevice()->supportsOperation( OutDevSupport_TransparentRect ))
1030 {
1031 pThat->m_bAllowAA = false;
1032 }
1033 }
1034
1035 return m_bAllowAA;
1036 }
1037
1038 // primitives
IsAntiAliasing() const1039 sal_Bool SvtOptionsDrawinglayer_Impl::IsAntiAliasing() const
1040 {
1041 return m_bAntiAliasing;
1042 }
1043
IsSnapHorVerLinesToDiscrete() const1044 sal_Bool SvtOptionsDrawinglayer_Impl::IsSnapHorVerLinesToDiscrete() const
1045 {
1046 return m_bSnapHorVerLinesToDiscrete;
1047 }
1048
IsSolidDragCreate() const1049 sal_Bool SvtOptionsDrawinglayer_Impl::IsSolidDragCreate() const
1050 {
1051 return m_bSolidDragCreate;
1052 }
1053
IsRenderDecoratedTextDirect() const1054 sal_Bool SvtOptionsDrawinglayer_Impl::IsRenderDecoratedTextDirect() const
1055 {
1056 return m_bRenderDecoratedTextDirect;
1057 }
1058
IsRenderSimpleTextDirect() const1059 sal_Bool SvtOptionsDrawinglayer_Impl::IsRenderSimpleTextDirect() const
1060 {
1061 return m_bRenderSimpleTextDirect;
1062 }
1063
GetQuadratic3DRenderLimit() const1064 sal_uInt32 SvtOptionsDrawinglayer_Impl::GetQuadratic3DRenderLimit() const
1065 {
1066 return m_nQuadratic3DRenderLimit;
1067 }
1068
GetQuadraticFormControlRenderLimit() const1069 sal_uInt32 SvtOptionsDrawinglayer_Impl::GetQuadraticFormControlRenderLimit() const
1070 {
1071 return m_nQuadraticFormControlRenderLimit;
1072 }
1073
SetAntiAliasing(sal_Bool bState)1074 void SvtOptionsDrawinglayer_Impl::SetAntiAliasing( sal_Bool bState )
1075 {
1076 if(m_bAntiAliasing != bState)
1077 {
1078 m_bAntiAliasing = bState;
1079 SetModified();
1080 }
1081 }
1082
SetSnapHorVerLinesToDiscrete(sal_Bool bState)1083 void SvtOptionsDrawinglayer_Impl::SetSnapHorVerLinesToDiscrete( sal_Bool bState )
1084 {
1085 if(m_bSnapHorVerLinesToDiscrete != bState)
1086 {
1087 m_bSnapHorVerLinesToDiscrete = bState;
1088 SetModified();
1089 }
1090 }
1091
SetSolidDragCreate(sal_Bool bState)1092 void SvtOptionsDrawinglayer_Impl::SetSolidDragCreate( sal_Bool bState )
1093 {
1094 if(m_bSolidDragCreate != bState)
1095 {
1096 m_bSolidDragCreate = bState;
1097 SetModified();
1098 }
1099 }
1100
SetRenderDecoratedTextDirect(sal_Bool bState)1101 void SvtOptionsDrawinglayer_Impl::SetRenderDecoratedTextDirect( sal_Bool bState )
1102 {
1103 if(m_bRenderDecoratedTextDirect != bState)
1104 {
1105 m_bRenderDecoratedTextDirect = bState;
1106 SetModified();
1107 }
1108 }
1109
SetRenderSimpleTextDirect(sal_Bool bState)1110 void SvtOptionsDrawinglayer_Impl::SetRenderSimpleTextDirect( sal_Bool bState )
1111 {
1112 if(m_bRenderSimpleTextDirect != bState)
1113 {
1114 m_bRenderSimpleTextDirect = bState;
1115 SetModified();
1116 }
1117 }
1118
SetQuadratic3DRenderLimit(sal_uInt32 nNew)1119 void SvtOptionsDrawinglayer_Impl::SetQuadratic3DRenderLimit(sal_uInt32 nNew)
1120 {
1121 if(m_nQuadratic3DRenderLimit != nNew)
1122 {
1123 m_nQuadratic3DRenderLimit = nNew;
1124 SetModified();
1125 }
1126 }
1127
SetQuadraticFormControlRenderLimit(sal_uInt32 nNew)1128 void SvtOptionsDrawinglayer_Impl::SetQuadraticFormControlRenderLimit(sal_uInt32 nNew)
1129 {
1130 if(m_nQuadraticFormControlRenderLimit != nNew)
1131 {
1132 m_nQuadraticFormControlRenderLimit = nNew;
1133 SetModified();
1134 }
1135 }
1136
1137 // #i97672# selection settings
IsTransparentSelection() const1138 sal_Bool SvtOptionsDrawinglayer_Impl::IsTransparentSelection() const
1139 {
1140 return m_bTransparentSelection;
1141 }
1142
SetTransparentSelection(sal_Bool bState)1143 void SvtOptionsDrawinglayer_Impl::SetTransparentSelection( sal_Bool bState )
1144 {
1145 if(m_bTransparentSelection != bState)
1146 {
1147 m_bTransparentSelection = bState;
1148 SetModified();
1149 }
1150 }
1151
SetTransparentSelectionPercent(sal_uInt16 nPercent)1152 void SvtOptionsDrawinglayer_Impl::SetTransparentSelectionPercent( sal_uInt16 nPercent )
1153 {
1154 if(m_nTransparentSelectionPercent != nPercent)
1155 {
1156 m_nTransparentSelectionPercent = nPercent;
1157 SetModified();
1158 }
1159 }
1160
GetTransparentSelectionPercent() const1161 sal_uInt16 SvtOptionsDrawinglayer_Impl::GetTransparentSelectionPercent() const
1162 {
1163 return m_nTransparentSelectionPercent;
1164 }
1165
SetSelectionMaximumLuminancePercent(sal_uInt16 nPercent)1166 void SvtOptionsDrawinglayer_Impl::SetSelectionMaximumLuminancePercent( sal_uInt16 nPercent )
1167 {
1168 if(m_nSelectionMaximumLuminancePercent != nPercent)
1169 {
1170 m_nSelectionMaximumLuminancePercent = nPercent;
1171 SetModified();
1172 }
1173 }
1174
GetSelectionMaximumLuminancePercent() const1175 sal_uInt16 SvtOptionsDrawinglayer_Impl::GetSelectionMaximumLuminancePercent() const
1176 {
1177 return m_nSelectionMaximumLuminancePercent;
1178 }
1179
1180 //*****************************************************************************************************************
1181 // private method
1182 //*****************************************************************************************************************
impl_GetPropertyNames()1183 Sequence< OUString > SvtOptionsDrawinglayer_Impl::impl_GetPropertyNames()
1184 {
1185 // Build static list of configuration key names.
1186 static const OUString pProperties[] =
1187 {
1188 PROPERTYNAME_OVERLAYBUFFER ,
1189 PROPERTYNAME_PAINTBUFFER ,
1190 PROPERTYNAME_STRIPE_COLOR_A ,
1191 PROPERTYNAME_STRIPE_COLOR_B ,
1192 PROPERTYNAME_STRIPE_LENGTH ,
1193
1194 // #i73602#
1195 PROPERTYNAME_OVERLAYBUFFER_CALC,
1196 PROPERTYNAME_OVERLAYBUFFER_WRITER,
1197 PROPERTYNAME_OVERLAYBUFFER_DRAWIMPRESS,
1198
1199 // #i74769#, #i75172#
1200 PROPERTYNAME_PAINTBUFFER_CALC,
1201 PROPERTYNAME_PAINTBUFFER_WRITER,
1202 PROPERTYNAME_PAINTBUFFER_DRAWIMPRESS,
1203
1204 // #i4219#
1205 PROPERTYNAME_MAXIMUMPAPERWIDTH,
1206 PROPERTYNAME_MAXIMUMPAPERHEIGHT,
1207 PROPERTYNAME_MAXIMUMPAPERLEFTMARGIN,
1208 PROPERTYNAME_MAXIMUMPAPERRIGHTMARGIN,
1209 PROPERTYNAME_MAXIMUMPAPERTOPMARGIN,
1210 PROPERTYNAME_MAXIMUMPAPERBOTTOMMARGIN,
1211
1212 // primitives
1213 PROPERTYNAME_ANTIALIASING,
1214 PROPERTYNAME_SNAPHORVERLINESTODISCRETE,
1215 PROPERTYNAME_SOLIDDRAGCREATE,
1216 PROPERTYNAME_RENDERDECORATEDTEXTDIRECT,
1217 PROPERTYNAME_RENDERSIMPLETEXTDIRECT,
1218 PROPERTYNAME_QUADRATIC3DRENDERLIMIT,
1219 PROPERTYNAME_QUADRATICFORMCONTROLRENDERLIMIT,
1220
1221 // #i97672# selection settings
1222 PROPERTYNAME_TRANSPARENTSELECTION,
1223 PROPERTYNAME_TRANSPARENTSELECTIONPERCENT,
1224 PROPERTYNAME_SELECTIONMAXIMUMLUMINANCEPERCENT
1225 };
1226
1227 // Initialize return sequence with these list ...
1228 static const Sequence< OUString > seqPropertyNames( pProperties, PROPERTYCOUNT );
1229 // ... and return it.
1230 return seqPropertyNames;
1231 }
1232
1233 //*****************************************************************************************************************
1234 // initialize static member
1235 // DON'T DO IT IN YOUR HEADER!
1236 // see definition for further informations
1237 //*****************************************************************************************************************
1238 SvtOptionsDrawinglayer_Impl* SvtOptionsDrawinglayer::m_pDataContainer = NULL;
1239 sal_Int32 SvtOptionsDrawinglayer::m_nRefCount = 0;
1240
1241 //*****************************************************************************************************************
1242 // constructor
1243 //*****************************************************************************************************************
SvtOptionsDrawinglayer()1244 SvtOptionsDrawinglayer::SvtOptionsDrawinglayer()
1245 {
1246 // Global access, must be guarded (multithreading!).
1247 MutexGuard aGuard( GetOwnStaticMutex() );
1248 // Increase ouer refcount ...
1249 ++m_nRefCount;
1250 // ... and initialize ouer data container only if it not already!
1251 if( m_pDataContainer == NULL )
1252 {
1253 m_pDataContainer = new SvtOptionsDrawinglayer_Impl();
1254 }
1255 }
1256
1257 //*****************************************************************************************************************
1258 // destructor
1259 //*****************************************************************************************************************
~SvtOptionsDrawinglayer()1260 SvtOptionsDrawinglayer::~SvtOptionsDrawinglayer()
1261 {
1262 // Global access, must be guarded (multithreading!)
1263 MutexGuard aGuard( GetOwnStaticMutex() );
1264 // Decrease ouer refcount.
1265 --m_nRefCount;
1266 // If last instance was deleted ...
1267 // we must destroy ouer static data container!
1268 if( m_nRefCount <= 0 )
1269 {
1270 delete m_pDataContainer;
1271 m_pDataContainer = NULL;
1272 }
1273 }
1274
1275 //*****************************************************************************************************************
1276 // public method
1277 //*****************************************************************************************************************
IsOverlayBuffer() const1278 sal_Bool SvtOptionsDrawinglayer::IsOverlayBuffer() const
1279 {
1280 MutexGuard aGuard( GetOwnStaticMutex() );
1281 return m_pDataContainer->IsOverlayBuffer();
1282 }
1283
1284 //*****************************************************************************************************************
1285 // public method
1286 //*****************************************************************************************************************
IsPaintBuffer() const1287 sal_Bool SvtOptionsDrawinglayer::IsPaintBuffer() const
1288 {
1289 MutexGuard aGuard( GetOwnStaticMutex() );
1290 return m_pDataContainer->IsPaintBuffer();
1291 }
1292
1293 //*****************************************************************************************************************
1294 // public method
1295 //*****************************************************************************************************************
GetStripeColorA() const1296 Color SvtOptionsDrawinglayer::GetStripeColorA() const
1297 {
1298 MutexGuard aGuard( GetOwnStaticMutex() );
1299 return m_pDataContainer->GetStripeColorA();
1300 }
1301
1302 //*****************************************************************************************************************
1303 // public method
1304 //*****************************************************************************************************************
GetStripeColorB() const1305 Color SvtOptionsDrawinglayer::GetStripeColorB() const
1306 {
1307 MutexGuard aGuard( GetOwnStaticMutex() );
1308 return m_pDataContainer->GetStripeColorB();
1309 }
1310
1311 //*****************************************************************************************************************
1312 // public method
1313 //*****************************************************************************************************************
GetStripeLength() const1314 sal_uInt16 SvtOptionsDrawinglayer::GetStripeLength() const
1315 {
1316 MutexGuard aGuard( GetOwnStaticMutex() );
1317 return m_pDataContainer->GetStripeLength();
1318 }
1319
1320 // #i73602#
IsOverlayBuffer_Calc() const1321 sal_Bool SvtOptionsDrawinglayer::IsOverlayBuffer_Calc() const
1322 {
1323 MutexGuard aGuard( GetOwnStaticMutex() );
1324 return m_pDataContainer->IsOverlayBuffer_Calc();
1325 }
1326
IsOverlayBuffer_Writer() const1327 sal_Bool SvtOptionsDrawinglayer::IsOverlayBuffer_Writer() const
1328 {
1329 MutexGuard aGuard( GetOwnStaticMutex() );
1330 return m_pDataContainer->IsOverlayBuffer_Writer();
1331 }
1332
IsOverlayBuffer_DrawImpress() const1333 sal_Bool SvtOptionsDrawinglayer::IsOverlayBuffer_DrawImpress() const
1334 {
1335 MutexGuard aGuard( GetOwnStaticMutex() );
1336 return m_pDataContainer->IsOverlayBuffer_DrawImpress();
1337 }
1338
1339 // #i74769#, #i75172#
IsPaintBuffer_Calc() const1340 sal_Bool SvtOptionsDrawinglayer::IsPaintBuffer_Calc() const
1341 {
1342 MutexGuard aGuard( GetOwnStaticMutex() );
1343 return m_pDataContainer->IsPaintBuffer_Calc();
1344 }
1345
IsPaintBuffer_Writer() const1346 sal_Bool SvtOptionsDrawinglayer::IsPaintBuffer_Writer() const
1347 {
1348 MutexGuard aGuard( GetOwnStaticMutex() );
1349 return m_pDataContainer->IsPaintBuffer_Writer();
1350 }
1351
IsPaintBuffer_DrawImpress() const1352 sal_Bool SvtOptionsDrawinglayer::IsPaintBuffer_DrawImpress() const
1353 {
1354 MutexGuard aGuard( GetOwnStaticMutex() );
1355 return m_pDataContainer->IsPaintBuffer_DrawImpress();
1356 }
1357
1358 // #i4219#
GetMaximumPaperWidth() const1359 sal_uInt32 SvtOptionsDrawinglayer::GetMaximumPaperWidth() const
1360 {
1361 MutexGuard aGuard( GetOwnStaticMutex() );
1362 return m_pDataContainer->GetMaximumPaperWidth();
1363 }
1364
GetMaximumPaperHeight() const1365 sal_uInt32 SvtOptionsDrawinglayer::GetMaximumPaperHeight() const
1366 {
1367 MutexGuard aGuard( GetOwnStaticMutex() );
1368 return m_pDataContainer->GetMaximumPaperHeight();
1369 }
1370
GetMaximumPaperLeftMargin() const1371 sal_uInt32 SvtOptionsDrawinglayer::GetMaximumPaperLeftMargin() const
1372 {
1373 MutexGuard aGuard( GetOwnStaticMutex() );
1374 return m_pDataContainer->GetMaximumPaperLeftMargin();
1375 }
1376
GetMaximumPaperRightMargin() const1377 sal_uInt32 SvtOptionsDrawinglayer::GetMaximumPaperRightMargin() const
1378 {
1379 MutexGuard aGuard( GetOwnStaticMutex() );
1380 return m_pDataContainer->GetMaximumPaperRightMargin();
1381 }
1382
GetMaximumPaperTopMargin() const1383 sal_uInt32 SvtOptionsDrawinglayer::GetMaximumPaperTopMargin() const
1384 {
1385 MutexGuard aGuard( GetOwnStaticMutex() );
1386 return m_pDataContainer->GetMaximumPaperTopMargin();
1387 }
1388
GetMaximumPaperBottomMargin() const1389 sal_uInt32 SvtOptionsDrawinglayer::GetMaximumPaperBottomMargin() const
1390 {
1391 MutexGuard aGuard( GetOwnStaticMutex() );
1392 return m_pDataContainer->GetMaximumPaperBottomMargin();
1393 }
1394
1395 //*****************************************************************************************************************
1396 // public method
1397 //*****************************************************************************************************************
SetOverlayBuffer(sal_Bool bState)1398 void SvtOptionsDrawinglayer::SetOverlayBuffer( sal_Bool bState )
1399 {
1400 MutexGuard aGuard( GetOwnStaticMutex() );
1401 m_pDataContainer->SetOverlayBuffer( bState );
1402 }
1403
1404 //*****************************************************************************************************************
1405 // public method
1406 //*****************************************************************************************************************
SetPaintBuffer(sal_Bool bState)1407 void SvtOptionsDrawinglayer::SetPaintBuffer( sal_Bool bState )
1408 {
1409 MutexGuard aGuard( GetOwnStaticMutex() );
1410 m_pDataContainer->SetPaintBuffer( bState );
1411 }
1412
1413 //*****************************************************************************************************************
1414 // public method
1415 //*****************************************************************************************************************
SetStripeColorA(Color aColor)1416 void SvtOptionsDrawinglayer::SetStripeColorA( Color aColor )
1417 {
1418 MutexGuard aGuard( GetOwnStaticMutex() );
1419 m_pDataContainer->SetStripeColorA( aColor );
1420 }
1421
1422 //*****************************************************************************************************************
1423 // public method
1424 //*****************************************************************************************************************
SetStripeColorB(Color aColor)1425 void SvtOptionsDrawinglayer::SetStripeColorB( Color aColor )
1426 {
1427 MutexGuard aGuard( GetOwnStaticMutex() );
1428 m_pDataContainer->SetStripeColorB( aColor );
1429 }
1430
1431 //*****************************************************************************************************************
1432 // public method
1433 //*****************************************************************************************************************
SetStripeLength(sal_uInt16 nLength)1434 void SvtOptionsDrawinglayer::SetStripeLength( sal_uInt16 nLength )
1435 {
1436 MutexGuard aGuard( GetOwnStaticMutex() );
1437 m_pDataContainer->SetStripeLength( nLength );
1438 }
1439
1440 // #i73602#
SetOverlayBuffer_Calc(sal_Bool bState)1441 void SvtOptionsDrawinglayer::SetOverlayBuffer_Calc( sal_Bool bState )
1442 {
1443 MutexGuard aGuard( GetOwnStaticMutex() );
1444 m_pDataContainer->SetOverlayBuffer_Calc( bState );
1445 }
1446
SetOverlayBuffer_Writer(sal_Bool bState)1447 void SvtOptionsDrawinglayer::SetOverlayBuffer_Writer( sal_Bool bState )
1448 {
1449 MutexGuard aGuard( GetOwnStaticMutex() );
1450 m_pDataContainer->SetOverlayBuffer_Writer( bState );
1451 }
1452
SetOverlayBuffer_DrawImpress(sal_Bool bState)1453 void SvtOptionsDrawinglayer::SetOverlayBuffer_DrawImpress( sal_Bool bState )
1454 {
1455 MutexGuard aGuard( GetOwnStaticMutex() );
1456 m_pDataContainer->SetOverlayBuffer_DrawImpress( bState );
1457 }
1458
1459 // #i74769#, #i75172#
SetPaintBuffer_Calc(sal_Bool bState)1460 void SvtOptionsDrawinglayer::SetPaintBuffer_Calc( sal_Bool bState )
1461 {
1462 MutexGuard aGuard( GetOwnStaticMutex() );
1463 m_pDataContainer->SetPaintBuffer_Calc( bState );
1464 }
1465
SetPaintBuffer_Writer(sal_Bool bState)1466 void SvtOptionsDrawinglayer::SetPaintBuffer_Writer( sal_Bool bState )
1467 {
1468 MutexGuard aGuard( GetOwnStaticMutex() );
1469 m_pDataContainer->SetPaintBuffer_Writer( bState );
1470 }
1471
SetPaintBuffer_DrawImpress(sal_Bool bState)1472 void SvtOptionsDrawinglayer::SetPaintBuffer_DrawImpress( sal_Bool bState )
1473 {
1474 MutexGuard aGuard( GetOwnStaticMutex() );
1475 m_pDataContainer->SetPaintBuffer_DrawImpress( bState );
1476 }
1477
1478 // #i4219#
SetMaximumPaperWidth(sal_uInt32 nNew)1479 void SvtOptionsDrawinglayer::SetMaximumPaperWidth( sal_uInt32 nNew )
1480 {
1481 MutexGuard aGuard( GetOwnStaticMutex() );
1482 m_pDataContainer->SetMaximumPaperWidth( nNew );
1483 }
1484
SetMaximumPaperHeight(sal_uInt32 nNew)1485 void SvtOptionsDrawinglayer::SetMaximumPaperHeight( sal_uInt32 nNew )
1486 {
1487 MutexGuard aGuard( GetOwnStaticMutex() );
1488 m_pDataContainer->SetMaximumPaperHeight( nNew );
1489 }
1490
SetMaximumPaperLeftMargin(sal_uInt32 nNew)1491 void SvtOptionsDrawinglayer::SetMaximumPaperLeftMargin( sal_uInt32 nNew )
1492 {
1493 MutexGuard aGuard( GetOwnStaticMutex() );
1494 m_pDataContainer->SetMaximumPaperLeftMargin( nNew );
1495 }
1496
SetMaximumPaperRightMargin(sal_uInt32 nNew)1497 void SvtOptionsDrawinglayer::SetMaximumPaperRightMargin( sal_uInt32 nNew )
1498 {
1499 MutexGuard aGuard( GetOwnStaticMutex() );
1500 m_pDataContainer->SetMaximumPaperRightMargin( nNew );
1501 }
1502
SetMaximumPaperTopMargin(sal_uInt32 nNew)1503 void SvtOptionsDrawinglayer::SetMaximumPaperTopMargin( sal_uInt32 nNew )
1504 {
1505 MutexGuard aGuard( GetOwnStaticMutex() );
1506 m_pDataContainer->SetMaximumPaperTopMargin( nNew );
1507 }
1508
SetMaximumPaperBottomMargin(sal_uInt32 nNew)1509 void SvtOptionsDrawinglayer::SetMaximumPaperBottomMargin( sal_uInt32 nNew )
1510 {
1511 MutexGuard aGuard( GetOwnStaticMutex() );
1512 m_pDataContainer->SetMaximumPaperBottomMargin( nNew );
1513 }
1514
1515 // helper
IsAAPossibleOnThisSystem() const1516 sal_Bool SvtOptionsDrawinglayer::IsAAPossibleOnThisSystem() const
1517 {
1518 return m_pDataContainer->IsAAPossibleOnThisSystem();
1519 }
1520
1521 // primitives
IsAntiAliasing() const1522 sal_Bool SvtOptionsDrawinglayer::IsAntiAliasing() const
1523 {
1524 MutexGuard aGuard( GetOwnStaticMutex() );
1525 return m_pDataContainer->IsAntiAliasing() && IsAAPossibleOnThisSystem();
1526 }
1527
IsSnapHorVerLinesToDiscrete() const1528 sal_Bool SvtOptionsDrawinglayer::IsSnapHorVerLinesToDiscrete() const
1529 {
1530 MutexGuard aGuard( GetOwnStaticMutex() );
1531 return m_pDataContainer->IsAntiAliasing() && m_pDataContainer->IsSnapHorVerLinesToDiscrete();
1532 }
1533
IsSolidDragCreate() const1534 sal_Bool SvtOptionsDrawinglayer::IsSolidDragCreate() const
1535 {
1536 MutexGuard aGuard( GetOwnStaticMutex() );
1537 return m_pDataContainer->IsSolidDragCreate();
1538 }
1539
IsRenderDecoratedTextDirect() const1540 sal_Bool SvtOptionsDrawinglayer::IsRenderDecoratedTextDirect() const
1541 {
1542 MutexGuard aGuard( GetOwnStaticMutex() );
1543 return m_pDataContainer->IsRenderDecoratedTextDirect();
1544 }
1545
IsRenderSimpleTextDirect() const1546 sal_Bool SvtOptionsDrawinglayer::IsRenderSimpleTextDirect() const
1547 {
1548 MutexGuard aGuard( GetOwnStaticMutex() );
1549 return m_pDataContainer->IsRenderSimpleTextDirect();
1550 }
1551
GetQuadratic3DRenderLimit() const1552 sal_uInt32 SvtOptionsDrawinglayer::GetQuadratic3DRenderLimit() const
1553 {
1554 MutexGuard aGuard( GetOwnStaticMutex() );
1555 return m_pDataContainer->GetQuadratic3DRenderLimit();
1556 }
1557
GetQuadraticFormControlRenderLimit() const1558 sal_uInt32 SvtOptionsDrawinglayer::GetQuadraticFormControlRenderLimit() const
1559 {
1560 MutexGuard aGuard( GetOwnStaticMutex() );
1561 return m_pDataContainer->GetQuadraticFormControlRenderLimit();
1562 }
1563
SetAntiAliasing(sal_Bool bState)1564 void SvtOptionsDrawinglayer::SetAntiAliasing( sal_Bool bState )
1565 {
1566 MutexGuard aGuard( GetOwnStaticMutex() );
1567 m_pDataContainer->SetAntiAliasing( bState );
1568 }
1569
SetSnapHorVerLinesToDiscrete(sal_Bool bState)1570 void SvtOptionsDrawinglayer::SetSnapHorVerLinesToDiscrete( sal_Bool bState )
1571 {
1572 MutexGuard aGuard( GetOwnStaticMutex() );
1573 m_pDataContainer->SetSnapHorVerLinesToDiscrete( bState );
1574 }
1575
SetSolidDragCreate(sal_Bool bState)1576 void SvtOptionsDrawinglayer::SetSolidDragCreate( sal_Bool bState )
1577 {
1578 MutexGuard aGuard( GetOwnStaticMutex() );
1579 m_pDataContainer->SetSolidDragCreate( bState );
1580 }
1581
SetRenderDecoratedTextDirect(sal_Bool bState)1582 void SvtOptionsDrawinglayer::SetRenderDecoratedTextDirect( sal_Bool bState )
1583 {
1584 MutexGuard aGuard( GetOwnStaticMutex() );
1585 m_pDataContainer->SetRenderDecoratedTextDirect( bState );
1586 }
1587
SetRenderSimpleTextDirect(sal_Bool bState)1588 void SvtOptionsDrawinglayer::SetRenderSimpleTextDirect( sal_Bool bState )
1589 {
1590 MutexGuard aGuard( GetOwnStaticMutex() );
1591 m_pDataContainer->SetRenderSimpleTextDirect( bState );
1592 }
1593
SetQuadratic3DRenderLimit(sal_uInt32 nNew)1594 void SvtOptionsDrawinglayer::SetQuadratic3DRenderLimit(sal_uInt32 nNew)
1595 {
1596 MutexGuard aGuard( GetOwnStaticMutex() );
1597 m_pDataContainer->SetQuadratic3DRenderLimit( nNew );
1598 }
1599
SetQuadraticFormControlRenderLimit(sal_uInt32 nNew)1600 void SvtOptionsDrawinglayer::SetQuadraticFormControlRenderLimit(sal_uInt32 nNew)
1601 {
1602 MutexGuard aGuard( GetOwnStaticMutex() );
1603 m_pDataContainer->SetQuadraticFormControlRenderLimit( nNew );
1604 }
1605
1606 // #i97672# selection settings
IsTransparentSelection() const1607 sal_Bool SvtOptionsDrawinglayer::IsTransparentSelection() const
1608 {
1609 MutexGuard aGuard( GetOwnStaticMutex() );
1610 return m_pDataContainer->IsTransparentSelection();
1611 }
1612
SetTransparentSelection(sal_Bool bState)1613 void SvtOptionsDrawinglayer::SetTransparentSelection( sal_Bool bState )
1614 {
1615 MutexGuard aGuard( GetOwnStaticMutex() );
1616 m_pDataContainer->SetTransparentSelection( bState );
1617 }
1618
GetTransparentSelectionPercent() const1619 sal_uInt16 SvtOptionsDrawinglayer::GetTransparentSelectionPercent() const
1620 {
1621 MutexGuard aGuard( GetOwnStaticMutex() );
1622 sal_uInt16 aRetval(m_pDataContainer->GetTransparentSelectionPercent());
1623
1624 // crop to range [10% .. 90%]
1625 if(aRetval < 10)
1626 {
1627 aRetval = 10;
1628 }
1629
1630 if(aRetval > 90)
1631 {
1632 aRetval = 90;
1633 }
1634
1635 return aRetval;
1636 }
1637
SetTransparentSelectionPercent(sal_uInt16 nPercent)1638 void SvtOptionsDrawinglayer::SetTransparentSelectionPercent( sal_uInt16 nPercent )
1639 {
1640 MutexGuard aGuard( GetOwnStaticMutex() );
1641
1642 // crop to range [10% .. 90%]
1643 if(nPercent < 10)
1644 {
1645 nPercent = 10;
1646 }
1647
1648 if(nPercent > 90)
1649 {
1650 nPercent = 90;
1651 }
1652
1653 m_pDataContainer->SetTransparentSelectionPercent( nPercent );
1654 }
1655
GetSelectionMaximumLuminancePercent() const1656 sal_uInt16 SvtOptionsDrawinglayer::GetSelectionMaximumLuminancePercent() const
1657 {
1658 MutexGuard aGuard( GetOwnStaticMutex() );
1659 sal_uInt16 aRetval(m_pDataContainer->GetSelectionMaximumLuminancePercent());
1660
1661 // crop to range [0% .. 100%]
1662 if(aRetval > 90)
1663 {
1664 aRetval = 90;
1665 }
1666
1667 return aRetval;
1668 }
1669
getHilightColor() const1670 Color SvtOptionsDrawinglayer::getHilightColor() const
1671 {
1672 Color aRetval(Application::GetSettings().GetStyleSettings().GetHighlightColor());
1673 const basegfx::BColor aSelection(aRetval.getBColor());
1674 const double fLuminance(aSelection.luminance());
1675 const double fMaxLum(GetSelectionMaximumLuminancePercent() / 100.0);
1676
1677 if(fLuminance > fMaxLum)
1678 {
1679 const double fFactor(fMaxLum / fLuminance);
1680 const basegfx::BColor aNewSelection(
1681 aSelection.getRed() * fFactor,
1682 aSelection.getGreen() * fFactor,
1683 aSelection.getBlue() * fFactor);
1684
1685 aRetval = Color(aNewSelection);
1686 }
1687
1688 return aRetval;
1689 }
1690
SetSelectionMaximumLuminancePercent(sal_uInt16 nPercent)1691 void SvtOptionsDrawinglayer::SetSelectionMaximumLuminancePercent( sal_uInt16 nPercent )
1692 {
1693 MutexGuard aGuard( GetOwnStaticMutex() );
1694
1695 // crop to range [0% .. 100%]
1696 if(nPercent > 90)
1697 {
1698 nPercent = 90;
1699 }
1700
1701 m_pDataContainer->SetSelectionMaximumLuminancePercent( nPercent );
1702 }
1703
1704 //*****************************************************************************************************************
1705 // private method
1706 //*****************************************************************************************************************
GetOwnStaticMutex()1707 Mutex& SvtOptionsDrawinglayer::GetOwnStaticMutex()
1708 {
1709 // Initialize static mutex only for one time!
1710 static Mutex* pMutex = NULL;
1711 // If these method first called (Mutex not already exist!) ...
1712 if( pMutex == NULL )
1713 {
1714 // ... we must create a new one. Protect follow code with the global mutex -
1715 // It must be - we create a static variable!
1716 MutexGuard aGuard( Mutex::getGlobalMutex() );
1717 // We must check our pointer again - because it can be that another instance of ouer class will be fastr then these!
1718 if( pMutex == NULL )
1719 {
1720 // Create the new mutex and set it for return on static variable.
1721 static Mutex aMutex;
1722 pMutex = &aMutex;
1723 }
1724 }
1725 // Return new created or already existing mutex object.
1726 return *pMutex;
1727 }
1728
1729 // eof
1730
1731