1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#ifdef _MSC_VER
#pragma hdrstop
#endif
#include <optionsdrawinglayer.hxx>
#include <unotools/configmgr.hxx>
#include <unotools/configitem.hxx>
#include <tools/debug.hxx>
#include <com/sun/star/uno/Any.hxx>
#include <com/sun/star/uno/Sequence.hxx>
#include <vcl/svapp.hxx>
#include <vcl/outdev.hxx>
#include <rtl/instance.hxx>
//_________________________________________________________________________________________________________________
// namespaces
//_________________________________________________________________________________________________________________
using namespace ::utl ;
using namespace ::rtl ;
using namespace ::osl ;
using namespace ::com::sun::star::uno ;
#define ROOTNODE_START OUString("Office.Common/Drawinglayer" )
#define DEFAULT_OVERLAYBUFFER sal_True
#define DEFAULT_PAINTBUFFER sal_True
#define DEFAULT_STRIPE_COLOR_A 0
#define DEFAULT_STRIPE_COLOR_B 16581375
#define DEFAULT_STRIPE_LENGTH 4
// #i73602#
// #i74769#, #i75172# : Change default for Calc and Writer to True
#define DEFAULT_OVERLAYBUFFER_CALC sal_True
#define DEFAULT_OVERLAYBUFFER_WRITER sal_True
#define DEFAULT_OVERLAYBUFFER_DRAWIMPRESS sal_True
// #i74769#, #i75172#
#define DEFAULT_PAINTBUFFER_CALC sal_True
#define DEFAULT_PAINTBUFFER_WRITER sal_True
#define DEFAULT_PAINTBUFFER_DRAWIMPRESS sal_True
// #i4219#
#define DEFAULT_MAXIMUMPAPERWIDTH 300
#define DEFAULT_MAXIMUMPAPERHEIGHT 300
#define DEFAULT_MAXIMUMPAPERLEFTMARGIN 9999
#define DEFAULT_MAXIMUMPAPERRIGHTMARGIN 9999
#define DEFAULT_MAXIMUMPAPERTOPMARGIN 9999
#define DEFAULT_MAXIMUMPAPERBOTTOMMARGIN 9999
// primitives
#define DEFAULT_ANTIALIASING sal_True
#define DEFAULT_SNAPHORVERLINESTODISCRETE sal_True
#define DEFAULT_SOLIDDRAGCREATE sal_True
#define DEFAULT_RENDERDECORATEDTEXTDIRECT sal_True
#define DEFAULT_RENDERSIMPLETEXTDIRECT sal_True
#define DEFAULT_QUADRATIC3DRENDERLIMIT 1000000
#define DEFAULT_QUADRATICFORMCONTROLRENDERLIMIT 45000
// #i97672# selection settings
#define DEFAULT_TRANSPARENTSELECTION sal_True
#define DEFAULT_TRANSPARENTSELECTIONPERCENT 75
#define DEFAULT_SELECTIONMAXIMUMLUMINANCEPERCENT 70
#define PROPERTYNAME_OVERLAYBUFFER OUString("OverlayBuffer" )
#define PROPERTYNAME_PAINTBUFFER OUString("PaintBuffer" )
#define PROPERTYNAME_STRIPE_COLOR_A OUString("StripeColorA" )
#define PROPERTYNAME_STRIPE_COLOR_B OUString("StripeColorB" )
#define PROPERTYNAME_STRIPE_LENGTH OUString("StripeLength" )
// #i73602#
#define PROPERTYNAME_OVERLAYBUFFER_CALC OUString("OverlayBuffer_Calc")
#define PROPERTYNAME_OVERLAYBUFFER_WRITER OUString("OverlayBuffer_Writer")
#define PROPERTYNAME_OVERLAYBUFFER_DRAWIMPRESS OUString("OverlayBuffer_DrawImpress")
// #i74769#, #i75172#
#define PROPERTYNAME_PAINTBUFFER_CALC OUString("PaintBuffer_Calc")
#define PROPERTYNAME_PAINTBUFFER_WRITER OUString("PaintBuffer_Writer")
#define PROPERTYNAME_PAINTBUFFER_DRAWIMPRESS OUString("PaintBuffer_DrawImpress")
// #i4219#
#define PROPERTYNAME_MAXIMUMPAPERWIDTH OUString("MaximumPaperWidth")
#define PROPERTYNAME_MAXIMUMPAPERHEIGHT OUString("MaximumPaperHeight")
#define PROPERTYNAME_MAXIMUMPAPERLEFTMARGIN OUString("MaximumPaperLeftMargin")
#define PROPERTYNAME_MAXIMUMPAPERRIGHTMARGIN OUString("MaximumPaperRightMargin")
#define PROPERTYNAME_MAXIMUMPAPERTOPMARGIN OUString("MaximumPaperTopMargin")
#define PROPERTYNAME_MAXIMUMPAPERBOTTOMMARGIN OUString("MaximumPaperBottomMargin")
// primitives
#define PROPERTYNAME_ANTIALIASING OUString("AntiAliasing")
#define PROPERTYNAME_SNAPHORVERLINESTODISCRETE OUString("SnapHorVerLinesToDiscrete")
#define PROPERTYNAME_SOLIDDRAGCREATE OUString("SolidDragCreate")
#define PROPERTYNAME_RENDERDECORATEDTEXTDIRECT OUString("RenderDecoratedTextDirect")
#define PROPERTYNAME_RENDERSIMPLETEXTDIRECT OUString("RenderSimpleTextDirect")
#define PROPERTYNAME_QUADRATIC3DRENDERLIMIT OUString("Quadratic3DRenderLimit")
#define PROPERTYNAME_QUADRATICFORMCONTROLRENDERLIMIT OUString("QuadraticFormControlRenderLimit")
// #i97672# selection settings
#define PROPERTYNAME_TRANSPARENTSELECTION OUString("TransparentSelection")
#define PROPERTYNAME_TRANSPARENTSELECTIONPERCENT OUString("TransparentSelectionPercent")
#define PROPERTYNAME_SELECTIONMAXIMUMLUMINANCEPERCENT OUString("SelectionMaximumLuminancePercent")
#define PROPERTYHANDLE_OVERLAYBUFFER 0
#define PROPERTYHANDLE_PAINTBUFFER 1
#define PROPERTYHANDLE_STRIPE_COLOR_A 2
#define PROPERTYHANDLE_STRIPE_COLOR_B 3
#define PROPERTYHANDLE_STRIPE_LENGTH 4
// #i73602#
#define PROPERTYHANDLE_OVERLAYBUFFER_CALC 5
#define PROPERTYHANDLE_OVERLAYBUFFER_WRITER 6
#define PROPERTYHANDLE_OVERLAYBUFFER_DRAWIMPRESS 7
// #i74769#, #i75172#
#define PROPERTYHANDLE_PAINTBUFFER_CALC 8
#define PROPERTYHANDLE_PAINTBUFFER_WRITER 9
#define PROPERTYHANDLE_PAINTBUFFER_DRAWIMPRESS 10
// #i4219#
#define PROPERTYHANDLE_MAXIMUMPAPERWIDTH 11
#define PROPERTYHANDLE_MAXIMUMPAPERHEIGHT 12
#define PROPERTYHANDLE_MAXIMUMPAPERLEFTMARGIN 13
#define PROPERTYHANDLE_MAXIMUMPAPERRIGHTMARGIN 14
#define PROPERTYHANDLE_MAXIMUMPAPERTOPMARGIN 15
#define PROPERTYHANDLE_MAXIMUMPAPERBOTTOMMARGIN 16
// primitives
#define PROPERTYHANDLE_ANTIALIASING 17
#define PROPERTYHANDLE_SNAPHORVERLINESTODISCRETE 18
#define PROPERTYHANDLE_SOLIDDRAGCREATE 19
#define PROPERTYHANDLE_RENDERDECORATEDTEXTDIRECT 20
#define PROPERTYHANDLE_RENDERSIMPLETEXTDIRECT 21
#define PROPERTYHANDLE_QUADRATIC3DRENDERLIMIT 22
#define PROPERTYHANDLE_QUADRATICFORMCONTROLRENDERLIMIT 23
// #i97672# selection settings
#define PROPERTYHANDLE_TRANSPARENTSELECTION 24
#define PROPERTYHANDLE_TRANSPARENTSELECTIONPERCENT 25
#define PROPERTYHANDLE_SELECTIONMAXIMUMLUMINANCEPERCENT 26
#define PROPERTYCOUNT 27
class SvtOptionsDrawinglayer_Impl : public ConfigItem
{
public:
//---------------------------------------------------------------------------------------------------------
// constructor / destructor
//---------------------------------------------------------------------------------------------------------
SvtOptionsDrawinglayer_Impl();
~SvtOptionsDrawinglayer_Impl();
//---------------------------------------------------------------------------------------------------------
// overloaded methods of baseclass
//---------------------------------------------------------------------------------------------------------
virtual void Commit();
virtual void Notify( const com::sun::star::uno::Sequence<OUString>& aPropertyNames);
//---------------------------------------------------------------------------------------------------------
// public interface
//---------------------------------------------------------------------------------------------------------
sal_Bool IsOverlayBuffer() const;
sal_Bool IsPaintBuffer() const;
Color GetStripeColorA() const;
Color GetStripeColorB() const;
sal_uInt16 GetStripeLength() const;
// #i73602#
sal_Bool IsOverlayBuffer_Calc() const;
sal_Bool IsOverlayBuffer_Writer() const;
sal_Bool IsOverlayBuffer_DrawImpress() const;
// #i74769#, #i75172#
sal_Bool IsPaintBuffer_Calc() const;
sal_Bool IsPaintBuffer_Writer() const;
sal_Bool IsPaintBuffer_DrawImpress() const;
// #i4219#
sal_uInt32 GetMaximumPaperWidth() const;
sal_uInt32 GetMaximumPaperHeight() const;
sal_uInt32 GetMaximumPaperLeftMargin() const;
sal_uInt32 GetMaximumPaperRightMargin() const;
sal_uInt32 GetMaximumPaperTopMargin() const;
sal_uInt32 GetMaximumPaperBottomMargin() const;
// helper
sal_Bool IsAAPossibleOnThisSystem() const;
// primitives
sal_Bool IsAntiAliasing() const;
sal_Bool IsSnapHorVerLinesToDiscrete() const;
sal_Bool IsSolidDragCreate() const;
sal_Bool IsRenderDecoratedTextDirect() const;
sal_Bool IsRenderSimpleTextDirect() const;
sal_uInt32 GetQuadratic3DRenderLimit() const;
sal_uInt32 GetQuadraticFormControlRenderLimit() const;
void SetAntiAliasing( sal_Bool bState );
// #i97672# selection settings
sal_Bool IsTransparentSelection() const;
sal_uInt16 GetTransparentSelectionPercent() const;
sal_uInt16 GetSelectionMaximumLuminancePercent() const;
void SetTransparentSelection( sal_Bool bState );
void SetTransparentSelectionPercent( sal_uInt16 nPercent );
//-------------------------------------------------------------------------------------------------------------
// private methods
//-------------------------------------------------------------------------------------------------------------
private:
static Sequence< OUString > impl_GetPropertyNames();
//-------------------------------------------------------------------------------------------------------------
// private member
//-------------------------------------------------------------------------------------------------------------
private:
sal_Bool m_bOverlayBuffer;
sal_Bool m_bPaintBuffer;
Color m_bStripeColorA;
Color m_bStripeColorB;
sal_uInt16 m_nStripeLength;
// #i73602#
sal_Bool m_bOverlayBuffer_Calc;
sal_Bool m_bOverlayBuffer_Writer;
sal_Bool m_bOverlayBuffer_DrawImpress;
// #i74769#, #i75172#
sal_Bool m_bPaintBuffer_Calc;
sal_Bool m_bPaintBuffer_Writer;
sal_Bool m_bPaintBuffer_DrawImpress;
// #i4219#
sal_uInt32 m_nMaximumPaperWidth;
sal_uInt32 m_nMaximumPaperHeight;
sal_uInt32 m_nMaximumPaperLeftMargin;
sal_uInt32 m_nMaximumPaperRightMargin;
sal_uInt32 m_nMaximumPaperTopMargin;
sal_uInt32 m_nMaximumPaperBottomMargin;
// primitives
sal_Bool m_bAntiAliasing;
sal_Bool m_bSnapHorVerLinesToDiscrete;
sal_Bool m_bSolidDragCreate;
sal_Bool m_bRenderDecoratedTextDirect;
sal_Bool m_bRenderSimpleTextDirect;
sal_uInt32 m_nQuadratic3DRenderLimit;
sal_uInt32 m_nQuadraticFormControlRenderLimit;
// #i97672# selection settings
sal_uInt16 m_nTransparentSelectionPercent;
sal_uInt16 m_nSelectionMaximumLuminancePercent;
sal_Bool m_bTransparentSelection;
// local values
bool m_bAllowAA : 1;
bool m_bAllowAAChecked : 1;
};
//*****************************************************************************************************************
// constructor
//*****************************************************************************************************************
SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl() :
ConfigItem( ROOTNODE_START ),
m_bOverlayBuffer( DEFAULT_OVERLAYBUFFER ),
m_bPaintBuffer( DEFAULT_PAINTBUFFER ),
m_bStripeColorA(Color(DEFAULT_STRIPE_COLOR_A)),
m_bStripeColorB(Color(DEFAULT_STRIPE_COLOR_B)),
m_nStripeLength(DEFAULT_STRIPE_LENGTH),
// #i73602#
m_bOverlayBuffer_Calc( DEFAULT_OVERLAYBUFFER_CALC ),
m_bOverlayBuffer_Writer( DEFAULT_OVERLAYBUFFER_WRITER ),
m_bOverlayBuffer_DrawImpress( DEFAULT_OVERLAYBUFFER_DRAWIMPRESS ),
// #i74769#, #i75172#
m_bPaintBuffer_Calc( DEFAULT_PAINTBUFFER_CALC ),
m_bPaintBuffer_Writer( DEFAULT_PAINTBUFFER_WRITER ),
m_bPaintBuffer_DrawImpress( DEFAULT_PAINTBUFFER_DRAWIMPRESS ),
// #i4219#
m_nMaximumPaperWidth(DEFAULT_MAXIMUMPAPERWIDTH),
m_nMaximumPaperHeight(DEFAULT_MAXIMUMPAPERHEIGHT),
m_nMaximumPaperLeftMargin(DEFAULT_MAXIMUMPAPERLEFTMARGIN),
m_nMaximumPaperRightMargin(DEFAULT_MAXIMUMPAPERRIGHTMARGIN),
m_nMaximumPaperTopMargin(DEFAULT_MAXIMUMPAPERTOPMARGIN),
m_nMaximumPaperBottomMargin(DEFAULT_MAXIMUMPAPERBOTTOMMARGIN),
// primitives
m_bAntiAliasing(DEFAULT_ANTIALIASING),
m_bSnapHorVerLinesToDiscrete(DEFAULT_SNAPHORVERLINESTODISCRETE),
m_bSolidDragCreate(DEFAULT_SOLIDDRAGCREATE),
m_bRenderDecoratedTextDirect(DEFAULT_RENDERDECORATEDTEXTDIRECT),
m_bRenderSimpleTextDirect(DEFAULT_RENDERSIMPLETEXTDIRECT),
m_nQuadratic3DRenderLimit(DEFAULT_QUADRATIC3DRENDERLIMIT),
m_nQuadraticFormControlRenderLimit(DEFAULT_QUADRATICFORMCONTROLRENDERLIMIT),
// #i97672# selection settings
m_nTransparentSelectionPercent(DEFAULT_TRANSPARENTSELECTIONPERCENT),
m_nSelectionMaximumLuminancePercent(DEFAULT_SELECTIONMAXIMUMLUMINANCEPERCENT),
m_bTransparentSelection(DEFAULT_TRANSPARENTSELECTION),
// local values
m_bAllowAA(true),
m_bAllowAAChecked(false)
{
Sequence< OUString > seqNames( impl_GetPropertyNames() );
Sequence< Any > seqValues = GetProperties( seqNames ) ;
DBG_ASSERT( !(seqNames.getLength()!=seqValues.getLength()), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nI miss some values of configuration keys!\n" );
// Copy values from list in right order to our internal member.
sal_Int32 nPropertyCount = seqValues.getLength();
for(sal_Int32 nProperty=0; nProperty<nPropertyCount; ++nProperty )
{
if (seqValues[nProperty].hasValue()==sal_False)
continue;
switch( nProperty )
{
case PROPERTYHANDLE_OVERLAYBUFFER:
{
DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\OverlayBuffer\"?" );
seqValues[nProperty] >>= m_bOverlayBuffer;
}
break;
case PROPERTYHANDLE_PAINTBUFFER:
{
DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\PaintBuffer\"?" );
seqValues[nProperty] >>= m_bPaintBuffer;
}
break;
case PROPERTYHANDLE_STRIPE_COLOR_A:
{
DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_LONG), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\StripeColorA\"?" );
sal_Int32 nValue = 0;
seqValues[nProperty] >>= nValue;
m_bStripeColorA = nValue;
}
break;
case PROPERTYHANDLE_STRIPE_COLOR_B:
{
DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_LONG), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\StripeColorB\"?" );
sal_Int32 nValue = 0;
seqValues[nProperty] >>= nValue;
m_bStripeColorB = nValue;
}
break;
case PROPERTYHANDLE_STRIPE_LENGTH:
{
DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_SHORT), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\StripeLength\"?" );
seqValues[nProperty] >>= m_nStripeLength;
}
break;
// #i73602#
case PROPERTYHANDLE_OVERLAYBUFFER_CALC:
{
DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\OverlayBuffer_Calc\"?" );
seqValues[nProperty] >>= m_bOverlayBuffer_Calc;
}
break;
case PROPERTYHANDLE_OVERLAYBUFFER_WRITER:
{
DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\OverlayBuffer_Writer\"?" );
seqValues[nProperty] >>= m_bOverlayBuffer_Writer;
}
break;
case PROPERTYHANDLE_OVERLAYBUFFER_DRAWIMPRESS:
{
DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\OverlayBuffer_DrawImpress\"?" );
seqValues[nProperty] >>= m_bOverlayBuffer_DrawImpress;
}
break;
// #i74769#, #i75172#
case PROPERTYHANDLE_PAINTBUFFER_CALC:
{
DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\PaintBuffer_Calc\"?" );
seqValues[nProperty] >>= m_bPaintBuffer_Calc;
}
break;
case PROPERTYHANDLE_PAINTBUFFER_WRITER:
{
DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\PaintBuffer_Writer\"?" );
seqValues[nProperty] >>= m_bPaintBuffer_Writer;
}
break;
case PROPERTYHANDLE_PAINTBUFFER_DRAWIMPRESS:
{
DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\PaintBuffer_DrawImpress\"?" );
seqValues[nProperty] >>= m_bPaintBuffer_DrawImpress;
}
break;
// #i4219#
case PROPERTYHANDLE_MAXIMUMPAPERWIDTH:
{
DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_LONG), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\MaximumPaperWidth\"?" );
seqValues[nProperty] >>= m_nMaximumPaperWidth;
}
break;
case PROPERTYHANDLE_MAXIMUMPAPERHEIGHT:
{
DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_LONG), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\MaximumPaperHeight\"?" );
seqValues[nProperty] >>= m_nMaximumPaperHeight;
}
break;
case PROPERTYHANDLE_MAXIMUMPAPERLEFTMARGIN:
{
DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_LONG), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\MaximumPaperLeftMargin\"?" );
seqValues[nProperty] >>= m_nMaximumPaperLeftMargin;
}
break;
case PROPERTYHANDLE_MAXIMUMPAPERRIGHTMARGIN:
{
DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_LONG), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\MaximumPaperRightMargin\"?" );
seqValues[nProperty] >>= m_nMaximumPaperRightMargin;
}
break;
case PROPERTYHANDLE_MAXIMUMPAPERTOPMARGIN:
{
DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_LONG), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\MaximumPaperTopMargin\"?" );
seqValues[nProperty] >>= m_nMaximumPaperTopMargin;
}
break;
case PROPERTYHANDLE_MAXIMUMPAPERBOTTOMMARGIN:
{
DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_LONG), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\MaximumPaperBottomMargin\"?" );
seqValues[nProperty] >>= m_nMaximumPaperBottomMargin;
}
break;
// primitives
case PROPERTYHANDLE_ANTIALIASING:
{
DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\AntiAliasing\"?" );
seqValues[nProperty] >>= m_bAntiAliasing;
}
break;
// primitives
case PROPERTYHANDLE_SNAPHORVERLINESTODISCRETE:
{
DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\SnapHorVerLinesToDiscrete\"?" );
seqValues[nProperty] >>= m_bSnapHorVerLinesToDiscrete;
}
break;
case PROPERTYHANDLE_SOLIDDRAGCREATE:
{
DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\SolidDragCreate\"?" );
seqValues[nProperty] >>= m_bSolidDragCreate;
}
break;
case PROPERTYHANDLE_RENDERDECORATEDTEXTDIRECT:
{
DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\RenderDecoratedTextDirect\"?" );
seqValues[nProperty] >>= m_bRenderDecoratedTextDirect;
}
break;
case PROPERTYHANDLE_RENDERSIMPLETEXTDIRECT:
{
DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\RenderSimpleTextDirect\"?" );
seqValues[nProperty] >>= m_bRenderSimpleTextDirect;
}
break;
case PROPERTYHANDLE_QUADRATIC3DRENDERLIMIT:
{
DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_LONG), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\Quadratic3DRenderLimit\"?" );
seqValues[nProperty] >>= m_nQuadratic3DRenderLimit;
}
break;
case PROPERTYHANDLE_QUADRATICFORMCONTROLRENDERLIMIT:
{
DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_LONG), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\QuadraticFormControlRenderLimit\"?" );
seqValues[nProperty] >>= m_nQuadraticFormControlRenderLimit;
}
break;
// #i97672# selection settings
case PROPERTYHANDLE_TRANSPARENTSELECTION:
{
DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\TransparentSelection\"?" );
seqValues[nProperty] >>= m_bTransparentSelection;
}
break;
case PROPERTYHANDLE_TRANSPARENTSELECTIONPERCENT:
{
DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_SHORT), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\TransparentSelectionPercent\"?" );
seqValues[nProperty] >>= m_nTransparentSelectionPercent;
}
case PROPERTYHANDLE_SELECTIONMAXIMUMLUMINANCEPERCENT:
{
DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_SHORT), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\SelectionMaximumLuminancePercent\"?" );
seqValues[nProperty] >>= m_nSelectionMaximumLuminancePercent;
}
break;
}
}
}
//*****************************************************************************************************************
// destructor
//*****************************************************************************************************************
SvtOptionsDrawinglayer_Impl::~SvtOptionsDrawinglayer_Impl()
{
if( IsModified() )
Commit();
}
//*****************************************************************************************************************
// Commit
//*****************************************************************************************************************
void SvtOptionsDrawinglayer_Impl::Commit()
{
Sequence< OUString > aSeqNames( impl_GetPropertyNames() );
Sequence< Any > aSeqValues( aSeqNames.getLength() );
for( sal_Int32 nProperty = 0, nCount = aSeqNames.getLength(); nProperty < nCount; ++nProperty )
{
switch( nProperty )
{
case PROPERTYHANDLE_OVERLAYBUFFER:
aSeqValues[nProperty] <<= m_bOverlayBuffer;
break;
case PROPERTYHANDLE_PAINTBUFFER:
aSeqValues[nProperty] <<= m_bPaintBuffer;
break;
case PROPERTYHANDLE_STRIPE_COLOR_A:
aSeqValues[nProperty] <<= m_bStripeColorA.GetColor();
break;
case PROPERTYHANDLE_STRIPE_COLOR_B:
aSeqValues[nProperty] <<= m_bStripeColorB.GetColor();
break;
case PROPERTYHANDLE_STRIPE_LENGTH:
aSeqValues[nProperty] <<= m_nStripeLength;
break;
// #i73602#
case PROPERTYHANDLE_OVERLAYBUFFER_CALC:
aSeqValues[nProperty] <<= m_bOverlayBuffer_Calc;
break;
case PROPERTYHANDLE_OVERLAYBUFFER_WRITER:
aSeqValues[nProperty] <<= m_bOverlayBuffer_Writer;
break;
case PROPERTYHANDLE_OVERLAYBUFFER_DRAWIMPRESS:
aSeqValues[nProperty] <<= m_bOverlayBuffer_DrawImpress;
break;
// #i74769#, #i75172#
case PROPERTYHANDLE_PAINTBUFFER_CALC:
aSeqValues[nProperty] <<= m_bPaintBuffer_Calc;
break;
case PROPERTYHANDLE_PAINTBUFFER_WRITER:
aSeqValues[nProperty] <<= m_bPaintBuffer_Writer;
break;
case PROPERTYHANDLE_PAINTBUFFER_DRAWIMPRESS:
aSeqValues[nProperty] <<= m_bPaintBuffer_DrawImpress;
break;
// #i4219#
case PROPERTYHANDLE_MAXIMUMPAPERWIDTH:
aSeqValues[nProperty] <<= m_nMaximumPaperWidth;
break;
case PROPERTYHANDLE_MAXIMUMPAPERHEIGHT:
aSeqValues[nProperty] <<= m_nMaximumPaperHeight;
break;
case PROPERTYHANDLE_MAXIMUMPAPERLEFTMARGIN:
aSeqValues[nProperty] <<= m_nMaximumPaperLeftMargin;
break;
case PROPERTYHANDLE_MAXIMUMPAPERRIGHTMARGIN:
aSeqValues[nProperty] <<= m_nMaximumPaperRightMargin;
break;
case PROPERTYHANDLE_MAXIMUMPAPERTOPMARGIN:
aSeqValues[nProperty] <<= m_nMaximumPaperTopMargin;
break;
case PROPERTYHANDLE_MAXIMUMPAPERBOTTOMMARGIN:
aSeqValues[nProperty] <<= m_nMaximumPaperBottomMargin;
break;
// primitives
case PROPERTYHANDLE_ANTIALIASING:
aSeqValues[nProperty] <<= m_bAntiAliasing;
break;
case PROPERTYHANDLE_SNAPHORVERLINESTODISCRETE:
aSeqValues[nProperty] <<= m_bSnapHorVerLinesToDiscrete;
break;
case PROPERTYHANDLE_SOLIDDRAGCREATE:
aSeqValues[nProperty] <<= m_bSolidDragCreate;
break;
case PROPERTYHANDLE_RENDERDECORATEDTEXTDIRECT:
aSeqValues[nProperty] <<= m_bRenderDecoratedTextDirect;
break;
case PROPERTYHANDLE_RENDERSIMPLETEXTDIRECT:
aSeqValues[nProperty] <<= m_bRenderSimpleTextDirect;
break;
case PROPERTYHANDLE_QUADRATIC3DRENDERLIMIT:
aSeqValues[nProperty] <<= m_nQuadratic3DRenderLimit;
break;
case PROPERTYHANDLE_QUADRATICFORMCONTROLRENDERLIMIT:
aSeqValues[nProperty] <<= m_nQuadraticFormControlRenderLimit;
break;
// #i97672# selection settings
case PROPERTYHANDLE_TRANSPARENTSELECTION:
aSeqValues[nProperty] <<= m_bTransparentSelection;
break;
case PROPERTYHANDLE_TRANSPARENTSELECTIONPERCENT:
aSeqValues[nProperty] <<= m_nTransparentSelectionPercent;
break;
case PROPERTYHANDLE_SELECTIONMAXIMUMLUMINANCEPERCENT:
aSeqValues[nProperty] <<= m_nSelectionMaximumLuminancePercent;
break;
}
}
PutProperties( aSeqNames, aSeqValues );
}
void SvtOptionsDrawinglayer_Impl::Notify( const com::sun::star::uno::Sequence<OUString>& )
{
}
//*****************************************************************************************************************
// public method
//*****************************************************************************************************************
sal_Bool SvtOptionsDrawinglayer_Impl::IsOverlayBuffer() const
{
return m_bOverlayBuffer;
}
//*****************************************************************************************************************
// public method
//*****************************************************************************************************************
sal_Bool SvtOptionsDrawinglayer_Impl::IsPaintBuffer() const
{
return m_bPaintBuffer;
}
//*****************************************************************************************************************
// public method
//*****************************************************************************************************************
Color SvtOptionsDrawinglayer_Impl::GetStripeColorA() const
{
return m_bStripeColorA;
}
//*****************************************************************************************************************
// public method
//*****************************************************************************************************************
Color SvtOptionsDrawinglayer_Impl::GetStripeColorB() const
{
return m_bStripeColorB;
}
//*****************************************************************************************************************
// public method
//*****************************************************************************************************************
sal_uInt16 SvtOptionsDrawinglayer_Impl::GetStripeLength() const
{
return m_nStripeLength;
}
// #i73602#
sal_Bool SvtOptionsDrawinglayer_Impl::IsOverlayBuffer_Calc() const
{
return m_bOverlayBuffer_Calc;
}
sal_Bool SvtOptionsDrawinglayer_Impl::IsOverlayBuffer_Writer() const
{
return m_bOverlayBuffer_Writer;
}
sal_Bool SvtOptionsDrawinglayer_Impl::IsOverlayBuffer_DrawImpress() const
{
return m_bOverlayBuffer_DrawImpress;
}
// #i74769#, #i75172#
sal_Bool SvtOptionsDrawinglayer_Impl::IsPaintBuffer_Calc() const
{
return m_bPaintBuffer_Calc;
}
sal_Bool SvtOptionsDrawinglayer_Impl::IsPaintBuffer_Writer() const
{
return m_bPaintBuffer_Writer;
}
sal_Bool SvtOptionsDrawinglayer_Impl::IsPaintBuffer_DrawImpress() const
{
return m_bPaintBuffer_DrawImpress;
}
// #i4219#
sal_uInt32 SvtOptionsDrawinglayer_Impl::GetMaximumPaperWidth() const
{
return m_nMaximumPaperWidth;
}
sal_uInt32 SvtOptionsDrawinglayer_Impl::GetMaximumPaperHeight() const
{
return m_nMaximumPaperHeight;
}
sal_uInt32 SvtOptionsDrawinglayer_Impl::GetMaximumPaperLeftMargin() const
{
return m_nMaximumPaperLeftMargin;
}
sal_uInt32 SvtOptionsDrawinglayer_Impl::GetMaximumPaperRightMargin() const
{
return m_nMaximumPaperRightMargin;
}
sal_uInt32 SvtOptionsDrawinglayer_Impl::GetMaximumPaperTopMargin() const
{
return m_nMaximumPaperTopMargin;
}
sal_uInt32 SvtOptionsDrawinglayer_Impl::GetMaximumPaperBottomMargin() const
{
return m_nMaximumPaperBottomMargin;
}
// helper
sal_Bool SvtOptionsDrawinglayer_Impl::IsAAPossibleOnThisSystem() const
{
if(!m_bAllowAAChecked)
{
SvtOptionsDrawinglayer_Impl* pThat = const_cast< SvtOptionsDrawinglayer_Impl* >(this);
pThat->m_bAllowAAChecked = true;
#ifdef WIN32
// WIN32 uses GDIPlus with VCL forthe first incarnation; this will be enhanced
// in the future to use canvases and the canvas renderer, thus a AA-abled
// canvas needs to be checked here in the future.
// Currently, just allow AA for WIN32
#endif
// check XRenderExtension
if(m_bAllowAA && !Application::GetDefaultDevice()->supportsOperation( OutDevSupport_TransparentRect ))
{
pThat->m_bAllowAA = false;
}
}
return m_bAllowAA;
}
// primitives
sal_Bool SvtOptionsDrawinglayer_Impl::IsAntiAliasing() const
{
return m_bAntiAliasing;
}
sal_Bool SvtOptionsDrawinglayer_Impl::IsSnapHorVerLinesToDiscrete() const
{
return m_bSnapHorVerLinesToDiscrete;
}
sal_Bool SvtOptionsDrawinglayer_Impl::IsSolidDragCreate() const
{
return m_bSolidDragCreate;
}
sal_Bool SvtOptionsDrawinglayer_Impl::IsRenderDecoratedTextDirect() const
{
return m_bRenderDecoratedTextDirect;
}
sal_Bool SvtOptionsDrawinglayer_Impl::IsRenderSimpleTextDirect() const
{
return m_bRenderSimpleTextDirect;
}
sal_uInt32 SvtOptionsDrawinglayer_Impl::GetQuadratic3DRenderLimit() const
{
return m_nQuadratic3DRenderLimit;
}
sal_uInt32 SvtOptionsDrawinglayer_Impl::GetQuadraticFormControlRenderLimit() const
{
return m_nQuadraticFormControlRenderLimit;
}
void SvtOptionsDrawinglayer_Impl::SetAntiAliasing( sal_Bool bState )
{
if(m_bAntiAliasing != bState)
{
m_bAntiAliasing = bState;
SetModified();
}
}
// #i97672# selection settings
sal_Bool SvtOptionsDrawinglayer_Impl::IsTransparentSelection() const
{
return m_bTransparentSelection;
}
void SvtOptionsDrawinglayer_Impl::SetTransparentSelection( sal_Bool bState )
{
if(m_bTransparentSelection != bState)
{
m_bTransparentSelection = bState;
SetModified();
}
}
void SvtOptionsDrawinglayer_Impl::SetTransparentSelectionPercent( sal_uInt16 nPercent )
{
if(m_nTransparentSelectionPercent != nPercent)
{
m_nTransparentSelectionPercent = nPercent;
SetModified();
}
}
sal_uInt16 SvtOptionsDrawinglayer_Impl::GetTransparentSelectionPercent() const
{
return m_nTransparentSelectionPercent;
}
sal_uInt16 SvtOptionsDrawinglayer_Impl::GetSelectionMaximumLuminancePercent() const
{
return m_nSelectionMaximumLuminancePercent;
}
//*****************************************************************************************************************
// private method
//*****************************************************************************************************************
Sequence< OUString > SvtOptionsDrawinglayer_Impl::impl_GetPropertyNames()
{
// Build list of configuration key names.
const OUString pProperties[] =
{
PROPERTYNAME_OVERLAYBUFFER ,
PROPERTYNAME_PAINTBUFFER ,
PROPERTYNAME_STRIPE_COLOR_A ,
PROPERTYNAME_STRIPE_COLOR_B ,
PROPERTYNAME_STRIPE_LENGTH ,
// #i73602#
PROPERTYNAME_OVERLAYBUFFER_CALC,
PROPERTYNAME_OVERLAYBUFFER_WRITER,
PROPERTYNAME_OVERLAYBUFFER_DRAWIMPRESS,
// #i74769#, #i75172#
PROPERTYNAME_PAINTBUFFER_CALC,
PROPERTYNAME_PAINTBUFFER_WRITER,
PROPERTYNAME_PAINTBUFFER_DRAWIMPRESS,
// #i4219#
PROPERTYNAME_MAXIMUMPAPERWIDTH,
PROPERTYNAME_MAXIMUMPAPERHEIGHT,
PROPERTYNAME_MAXIMUMPAPERLEFTMARGIN,
PROPERTYNAME_MAXIMUMPAPERRIGHTMARGIN,
PROPERTYNAME_MAXIMUMPAPERTOPMARGIN,
PROPERTYNAME_MAXIMUMPAPERBOTTOMMARGIN,
// primitives
PROPERTYNAME_ANTIALIASING,
PROPERTYNAME_SNAPHORVERLINESTODISCRETE,
PROPERTYNAME_SOLIDDRAGCREATE,
PROPERTYNAME_RENDERDECORATEDTEXTDIRECT,
PROPERTYNAME_RENDERSIMPLETEXTDIRECT,
PROPERTYNAME_QUADRATIC3DRENDERLIMIT,
PROPERTYNAME_QUADRATICFORMCONTROLRENDERLIMIT,
// #i97672# selection settings
PROPERTYNAME_TRANSPARENTSELECTION,
PROPERTYNAME_TRANSPARENTSELECTIONPERCENT,
PROPERTYNAME_SELECTIONMAXIMUMLUMINANCEPERCENT
};
// Initialize return sequence with these list ...
const Sequence< OUString > seqPropertyNames( pProperties, PROPERTYCOUNT );
// ... and return it.
return seqPropertyNames;
}
//*****************************************************************************************************************
// initialize static member
// DON'T DO IT IN YOUR HEADER!
// see definition for further information
//*****************************************************************************************************************
SvtOptionsDrawinglayer_Impl* SvtOptionsDrawinglayer::m_pDataContainer = NULL;
sal_Int32 SvtOptionsDrawinglayer::m_nRefCount = 0;
//*****************************************************************************************************************
// constructor
//*****************************************************************************************************************
SvtOptionsDrawinglayer::SvtOptionsDrawinglayer()
{
// Global access, must be guarded (multithreading!).
MutexGuard aGuard( GetOwnStaticMutex() );
// Increase our refcount ...
++m_nRefCount;
// ... and initialize our data container only if it not already!
if( m_pDataContainer == NULL )
{
m_pDataContainer = new SvtOptionsDrawinglayer_Impl();
}
}
//*****************************************************************************************************************
// destructor
//*****************************************************************************************************************
SvtOptionsDrawinglayer::~SvtOptionsDrawinglayer()
{
// Global access, must be guarded (multithreading!)
MutexGuard aGuard( GetOwnStaticMutex() );
// Decrease our refcount.
--m_nRefCount;
// If last instance was deleted ...
// we must destroy our static data container!
if( m_nRefCount <= 0 )
{
delete m_pDataContainer;
m_pDataContainer = NULL;
}
}
//*****************************************************************************************************************
// public method
//*****************************************************************************************************************
sal_Bool SvtOptionsDrawinglayer::IsOverlayBuffer() const
{
MutexGuard aGuard( GetOwnStaticMutex() );
return m_pDataContainer->IsOverlayBuffer();
}
//*****************************************************************************************************************
// public method
//*****************************************************************************************************************
sal_Bool SvtOptionsDrawinglayer::IsPaintBuffer() const
{
MutexGuard aGuard( GetOwnStaticMutex() );
return m_pDataContainer->IsPaintBuffer();
}
//*****************************************************************************************************************
// public method
//*****************************************************************************************************************
Color SvtOptionsDrawinglayer::GetStripeColorA() const
{
MutexGuard aGuard( GetOwnStaticMutex() );
return m_pDataContainer->GetStripeColorA();
}
//*****************************************************************************************************************
// public method
//*****************************************************************************************************************
Color SvtOptionsDrawinglayer::GetStripeColorB() const
{
MutexGuard aGuard( GetOwnStaticMutex() );
return m_pDataContainer->GetStripeColorB();
}
//*****************************************************************************************************************
// public method
//*****************************************************************************************************************
sal_uInt16 SvtOptionsDrawinglayer::GetStripeLength() const
{
MutexGuard aGuard( GetOwnStaticMutex() );
return m_pDataContainer->GetStripeLength();
}
// #i73602#
sal_Bool SvtOptionsDrawinglayer::IsOverlayBuffer_Calc() const
{
MutexGuard aGuard( GetOwnStaticMutex() );
return m_pDataContainer->IsOverlayBuffer_Calc();
}
sal_Bool SvtOptionsDrawinglayer::IsOverlayBuffer_Writer() const
{
MutexGuard aGuard( GetOwnStaticMutex() );
return m_pDataContainer->IsOverlayBuffer_Writer();
}
sal_Bool SvtOptionsDrawinglayer::IsOverlayBuffer_DrawImpress() const
{
MutexGuard aGuard( GetOwnStaticMutex() );
return m_pDataContainer->IsOverlayBuffer_DrawImpress();
}
// #i74769#, #i75172#
sal_Bool SvtOptionsDrawinglayer::IsPaintBuffer_Calc() const
{
MutexGuard aGuard( GetOwnStaticMutex() );
return m_pDataContainer->IsPaintBuffer_Calc();
}
sal_Bool SvtOptionsDrawinglayer::IsPaintBuffer_Writer() const
{
MutexGuard aGuard( GetOwnStaticMutex() );
return m_pDataContainer->IsPaintBuffer_Writer();
}
sal_Bool SvtOptionsDrawinglayer::IsPaintBuffer_DrawImpress() const
{
MutexGuard aGuard( GetOwnStaticMutex() );
return m_pDataContainer->IsPaintBuffer_DrawImpress();
}
// #i4219#
sal_uInt32 SvtOptionsDrawinglayer::GetMaximumPaperWidth() const
{
MutexGuard aGuard( GetOwnStaticMutex() );
return m_pDataContainer->GetMaximumPaperWidth();
}
sal_uInt32 SvtOptionsDrawinglayer::GetMaximumPaperHeight() const
{
MutexGuard aGuard( GetOwnStaticMutex() );
return m_pDataContainer->GetMaximumPaperHeight();
}
sal_uInt32 SvtOptionsDrawinglayer::GetMaximumPaperLeftMargin() const
{
MutexGuard aGuard( GetOwnStaticMutex() );
return m_pDataContainer->GetMaximumPaperLeftMargin();
}
sal_uInt32 SvtOptionsDrawinglayer::GetMaximumPaperRightMargin() const
{
MutexGuard aGuard( GetOwnStaticMutex() );
return m_pDataContainer->GetMaximumPaperRightMargin();
}
sal_uInt32 SvtOptionsDrawinglayer::GetMaximumPaperTopMargin() const
{
MutexGuard aGuard( GetOwnStaticMutex() );
return m_pDataContainer->GetMaximumPaperTopMargin();
}
sal_uInt32 SvtOptionsDrawinglayer::GetMaximumPaperBottomMargin() const
{
MutexGuard aGuard( GetOwnStaticMutex() );
return m_pDataContainer->GetMaximumPaperBottomMargin();
}
// helper
sal_Bool SvtOptionsDrawinglayer::IsAAPossibleOnThisSystem() const
{
return m_pDataContainer->IsAAPossibleOnThisSystem();
}
// primitives
sal_Bool SvtOptionsDrawinglayer::IsAntiAliasing() const
{
MutexGuard aGuard( GetOwnStaticMutex() );
return m_pDataContainer->IsAntiAliasing() && IsAAPossibleOnThisSystem();
}
sal_Bool SvtOptionsDrawinglayer::IsSnapHorVerLinesToDiscrete() const
{
MutexGuard aGuard( GetOwnStaticMutex() );
return m_pDataContainer->IsAntiAliasing() && m_pDataContainer->IsSnapHorVerLinesToDiscrete();
}
sal_Bool SvtOptionsDrawinglayer::IsSolidDragCreate() const
{
MutexGuard aGuard( GetOwnStaticMutex() );
return m_pDataContainer->IsSolidDragCreate();
}
sal_Bool SvtOptionsDrawinglayer::IsRenderDecoratedTextDirect() const
{
MutexGuard aGuard( GetOwnStaticMutex() );
return m_pDataContainer->IsRenderDecoratedTextDirect();
}
sal_Bool SvtOptionsDrawinglayer::IsRenderSimpleTextDirect() const
{
MutexGuard aGuard( GetOwnStaticMutex() );
return m_pDataContainer->IsRenderSimpleTextDirect();
}
sal_uInt32 SvtOptionsDrawinglayer::GetQuadratic3DRenderLimit() const
{
MutexGuard aGuard( GetOwnStaticMutex() );
return m_pDataContainer->GetQuadratic3DRenderLimit();
}
sal_uInt32 SvtOptionsDrawinglayer::GetQuadraticFormControlRenderLimit() const
{
MutexGuard aGuard( GetOwnStaticMutex() );
return m_pDataContainer->GetQuadraticFormControlRenderLimit();
}
void SvtOptionsDrawinglayer::SetAntiAliasing( sal_Bool bState )
{
MutexGuard aGuard( GetOwnStaticMutex() );
m_pDataContainer->SetAntiAliasing( bState );
}
// #i97672# selection settings
sal_Bool SvtOptionsDrawinglayer::IsTransparentSelection() const
{
MutexGuard aGuard( GetOwnStaticMutex() );
return m_pDataContainer->IsTransparentSelection();
}
void SvtOptionsDrawinglayer::SetTransparentSelection( sal_Bool bState )
{
MutexGuard aGuard( GetOwnStaticMutex() );
m_pDataContainer->SetTransparentSelection( bState );
}
sal_uInt16 SvtOptionsDrawinglayer::GetTransparentSelectionPercent() const
{
MutexGuard aGuard( GetOwnStaticMutex() );
sal_uInt16 aRetval(m_pDataContainer->GetTransparentSelectionPercent());
// crop to range [10% .. 90%]
if(aRetval < 10)
{
aRetval = 10;
}
if(aRetval > 90)
{
aRetval = 90;
}
return aRetval;
}
void SvtOptionsDrawinglayer::SetTransparentSelectionPercent( sal_uInt16 nPercent )
{
MutexGuard aGuard( GetOwnStaticMutex() );
// crop to range [10% .. 90%]
if(nPercent < 10)
{
nPercent = 10;
}
if(nPercent > 90)
{
nPercent = 90;
}
m_pDataContainer->SetTransparentSelectionPercent( nPercent );
}
sal_uInt16 SvtOptionsDrawinglayer::GetSelectionMaximumLuminancePercent() const
{
MutexGuard aGuard( GetOwnStaticMutex() );
sal_uInt16 aRetval(m_pDataContainer->GetSelectionMaximumLuminancePercent());
// crop to range [0% .. 100%]
if(aRetval > 90)
{
aRetval = 90;
}
return aRetval;
}
Color SvtOptionsDrawinglayer::getHilightColor() const
{
Color aRetval(Application::GetSettings().GetStyleSettings().GetHighlightColor());
const basegfx::BColor aSelection(aRetval.getBColor());
const double fLuminance(aSelection.luminance());
const double fMaxLum(GetSelectionMaximumLuminancePercent() / 100.0);
if(fLuminance > fMaxLum)
{
const double fFactor(fMaxLum / fLuminance);
const basegfx::BColor aNewSelection(
aSelection.getRed() * fFactor,
aSelection.getGreen() * fFactor,
aSelection.getBlue() * fFactor);
aRetval = Color(aNewSelection);
}
return aRetval;
}
namespace
{
class theOptionsDrawinglayerMutex : public rtl::Static<osl::Mutex, theOptionsDrawinglayerMutex>{};
}
//*****************************************************************************************************************
// private method
//*****************************************************************************************************************
Mutex& SvtOptionsDrawinglayer::GetOwnStaticMutex()
{
return theOptionsDrawinglayerMutex::get();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|