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