-
Notifications
You must be signed in to change notification settings - Fork 1
/
LibreOfficeCalc_Internal.au3
3398 lines (2980 loc) · 214 KB
/
LibreOfficeCalc_Internal.au3
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
#AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7
;~ #Tidy_Parameters=/sf
#include-once
; Main LibreOffice Includes
#include "LibreOffice_Constants.au3"
; Common includes for Calc
#include "LibreOfficeCalc_Constants.au3"
#include "LibreOfficeCalc_Helper.au3"
; #INDEX# =======================================================================================================================
; Title .........: LibreOffice UDF
; AutoIt Version : v3.3.16.1
; Description ...: Various functions for internal data processing, data retrieval, retrieving and applying settings for LibreOffice UDF.
; Author(s) .....: donnyh13, mLipok
; Dll ...........:
;
; ===============================================================================================================================
; #INTERNAL_USE_ONLY# ===========================================================================================================
; __LOCalc_AddTo1DArray
; __LOCalc_ArrayFill
; __LOCalc_CellAddressIsSame
; __LOCalc_CellBackColor
; __LOCalc_CellBorder
; __LOCalc_CellBorderPadding
; __LOCalc_CellEffect
; __LOCalc_CellFont
; __LOCalc_CellFontColor
; __LOCalc_CellNumberFormat
; __LOCalc_CellOverLine
; __LOCalc_CellProtection
; __LOCalc_CellShadow
; __LOCalc_CellStrikeOut
; __LOCalc_CellStyleBorder
; __LOCalc_CellTextAlign
; __LOCalc_CellTextOrient
; __LOCalc_CellTextProperties
; __LOCalc_CellUnderLine
; __LOCalc_CharPosition
; __LOCalc_CharSpacing
; __LOCalc_CommentAreaShadowModify
; __LOCalc_CommentArrowStyleName
; __LOCalc_CommentGetObjByCell
; __LOCalc_CommentLineStyleName
; __LOCalc_CreateStruct
; __LOCalc_FieldGetObj
; __LOCalc_FieldTypeServices
; __LOCalc_FilterNameGet
; __LOCalc_Internal_CursorGetType
; __LOCalc_InternalComErrorHandler
; __LOCalc_IntIsBetween
; __LOCalc_NamedRangeGetScopeObj
; __LOCalc_NumIsBetween
; __LOCalc_PageStyleBorder
; __LOCalc_PageStyleFooterBorder
; __LOCalc_PageStyleHeaderBorder
; __LOCalc_RangeAddressIsSame
; __LOCalc_SetPropertyValue
; __LOCalc_SheetCursorMove
; __LOCalc_TextCursorMove
; __LOCalc_TransparencyGradientConvert
; __LOCalc_TransparencyGradientNameInsert
; __LOCalc_UnitConvert
; __LOCalc_VarsAreNull
; __LOCalc_VersionCheck
; ===============================================================================================================================
; #INTERNAL_USE_ONLY# ===========================================================================================================
; Name ..........: __LOCalc_AddTo1DArray
; Description ...: Add data to a 1 Dimensional array.
; Syntax ........: __LOCalc_AddTo1DArray(ByRef $aArray, $vData[, $bCountInFirst = False])
; Parameters ....: $aArray - [in/out] an array of unknowns. The Array to directly add data to. Array will be directly modified.
; $vData - a variant value. The Data to add to the Array.
; $bCountInFirst - [optional] a boolean value. Default is False. If True the first element of the array is a count of contained elements.
; Return values .: Success: 1
; Failure: 0 and sets the @Error and @Extended flags to non-zero.
; --Input Errors--
; @Error 1 @Extended 1 Return 0 = $aArray not an Array
; @Error 1 @Extended 2 Return 0 = $bCountinFirst not a Boolean.
; @Error 1 @Extended 3 Return 0 = $aArray contains too many columns.
; @Error 1 @Extended 4 Return 0 = $aArray[0] contains non integer data or is not empty, and $bCountInFirst is set to True.
; --Success--
; @Error 0 @Extended 0 Return 1 = Success. Array item was successfully added.
; Author ........: donnyh13
; Modified ......:
; Remarks .......:
; Related .......:
; Link ..........:
; Example .......: No
; ===============================================================================================================================
Func __LOCalc_AddTo1DArray(ByRef $aArray, $vData, $bCountInFirst = False)
Local Const $UBOUND_COLUMNS = 2
If Not IsArray($aArray) Then Return SetError($__LO_STATUS_INPUT_ERROR, 1, 0)
If Not IsBool($bCountInFirst) Then Return SetError($__LO_STATUS_INPUT_ERROR, 2, 0)
If UBound($aArray, $UBOUND_COLUMNS) > 1 Then Return SetError($__LO_STATUS_INPUT_ERROR, 3, 0) ; Too many columns
If $bCountInFirst And (UBound($aArray) = 0) Then
ReDim $aArray[1]
$aArray[0] = 0
EndIf
If $bCountInFirst And (($aArray[0] <> "") And Not IsInt($aArray[0])) Then Return SetError($__LO_STATUS_INPUT_ERROR, 4, 0)
ReDim $aArray[UBound($aArray) + 1]
$aArray[UBound($aArray) - 1] = $vData
If $bCountInFirst Then $aArray[0] += 1
Return SetError($__LO_STATUS_SUCCESS, 0, 1)
EndFunc ;==>__LOCalc_AddTo1DArray
; #INTERNAL_USE_ONLY# ===========================================================================================================
; Name ..........: __LOCalc_ArrayFill
; Description ...: Fill an Array with data.
; Syntax ........: __LOCalc_ArrayFill(ByRef $aArrayToFill[, $vVar1 = Null[, $vVar2 = Null[, $vVar3 = Null[, $vVar4 = Null[, $vVar5 = Null[, $vVar6 = Null[, $vVar7 = Null[, $vVar8 = Null[, $vVar9 = Null[, $vVar10 = Null[, $vVar11 = Null[, $vVar12 = Null[, $vVar13 = Null[, $vVar14 = Null[, $vVar15 = Null[, $vVar16 = Null[, $vVar17 = Null[, $vVar18 = Null]]]]]]]]]]]]]]]]]])
; Parameters ....: $aArrayToFill - [in/out] an array of unknowns. The Array to Fill. Array will be directly modified.
; $vVar1 - [optional] a variant value. Default is Null. The Data to add to the Array.
; $vVar2 - [optional] a variant value. Default is Null. The Data to add to the Array.
; $vVar3 - [optional] a variant value. Default is Null. The Data to add to the Array.
; $vVar4 - [optional] a variant value. Default is Null. The Data to add to the Array.
; $vVar5 - [optional] a variant value. Default is Null. The Data to add to the Array.
; $vVar6 - [optional] a variant value. Default is Null. The Data to add to the Array.
; $vVar7 - [optional] a variant value. Default is Null. The Data to add to the Array.
; $vVar8 - [optional] a variant value. Default is Null. The Data to add to the Array.
; $vVar9 - [optional] a variant value. Default is Null. The Data to add to the Array.
; $vVar10 - [optional] a variant value. Default is Null. The Data to add to the Array.
; $vVar11 - [optional] a variant value. Default is Null. The Data to add to the Array.
; $vVar12 - [optional] a variant value. Default is Null. The Data to add to the Array.
; $vVar13 - [optional] a variant value. Default is Null. The Data to add to the Array.
; $vVar14 - [optional] a variant value. Default is Null. The Data to add to the Array.
; $vVar15 - [optional] a variant value. Default is Null. The Data to add to the Array.
; $vVar16 - [optional] a variant value. Default is Null. The Data to add to the Array.
; $vVar17 - [optional] a variant value. Default is Null. The Data to add to the Array.
; $vVar18 - [optional] a variant value. Default is Null. The Data to add to the Array.
; Return values .: None
; Author ........: donnyh13
; Modified ......:
; Remarks .......: Call only how many you parameters you need to add to the Array. Automatically resizes the Array if it is the incorrect size.
; Related .......:
; Link ..........:
; Example .......: No
; ===============================================================================================================================
Func __LOCalc_ArrayFill(ByRef $aArrayToFill, $vVar1 = Null, $vVar2 = Null, $vVar3 = Null, $vVar4 = Null, $vVar5 = Null, $vVar6 = Null, $vVar7 = Null, $vVar8 = Null, $vVar9 = Null, $vVar10 = Null, $vVar11 = Null, $vVar12 = Null, $vVar13 = Null, $vVar14 = Null, $vVar15 = Null, $vVar16 = Null, $vVar17 = Null, $vVar18 = Null)
#forceref $vVar1, $vVar2, $vVar3, $vVar4, $vVar5, $vVar6, $vVar7, $vVar8, $vVar9, $vVar10, $vVar11, $vVar12, $vVar13, $vVar14, $vVar15, $vVar16, $vVar17, $vVar18
If UBound($aArrayToFill) < (@NumParams - 1) Then ReDim $aArrayToFill[@NumParams - 1]
For $i = 0 To @NumParams - 2
$aArrayToFill[$i] = Eval("vVar" & $i + 1)
Next
EndFunc ;==>__LOCalc_ArrayFill
; #INTERNAL_USE_ONLY# ===========================================================================================================
; Name ..........: __LOCalc_CellAddressIsSame
; Description ...: Compare two Cell Addresses to see if they are the same.
; Syntax ........: __LOCalc_CellAddressIsSame(ByRef $tCellAddr1, ByRef $tCellAddr2)
; Parameters ....: $tCellAddr1 - a dll struct value. The first Cell Address Structure to compare.
; $tCellAddr2 - a dll struct value. The second Cell Address Structure to compare.
; Return values .: Success: Boolean
; Failure: 0 and sets the @Error and @Extended flags to non-zero.
; --Input Errors--
; @Error 1 @Extended 1 Return 0 = $tCellAddr1 not an Object.
; @Error 1 @Extended 2 Return 0 = $tCellAddr2 not an Object.
; --Success--
; @Error 0 @Extended 0 Return Boolean = Success. If the Cell Addresses are identical, True is returned, else False.
; Author ........: donnyh13
; Modified ......:
; Remarks .......:
; Related .......:
; Link ..........:
; Example .......: No
; ===============================================================================================================================
Func __LOCalc_CellAddressIsSame($tCellAddr1, $tCellAddr2)
Local $oCOM_ErrorHandler = ObjEvent("AutoIt.Error", __LOCalc_InternalComErrorHandler)
#forceref $oCOM_ErrorHandler
If Not IsObj($tCellAddr1) Then Return SetError($__LO_STATUS_INPUT_ERROR, 1, 0)
If Not IsObj($tCellAddr2) Then Return SetError($__LO_STATUS_INPUT_ERROR, 2, 0)
If ($tCellAddr1.Sheet() = $tCellAddr2.Sheet()) And _
($tCellAddr1.Column() = $tCellAddr2.Column()) And _
($tCellAddr1.Row() = $tCellAddr2.Row()) Then Return SetError($__LO_STATUS_SUCCESS, 0, True)
Return SetError($__LO_STATUS_SUCCESS, 0, False)
EndFunc ;==>__LOCalc_CellAddressIsSame
; #INTERNAL_USE_ONLY# ===========================================================================================================
; Name ..........: __LOCalc_CellBackColor
; Description ...: Internal function to Set or Retrieve the background color setting for a Cell, Cell Range, or Cell Style.
; Syntax ........: __LOCalc_CellBackColor(ByRef $oObj, $iBackColor, $bBackTransparent)
; Parameters ....: $oObj - [in/out] an object. A Cell, Cell Range or Cell Style Object returned from an applicable function.
; $iBackColor - an integer value (-1-16777215). The background color. Set in Long integer format. Can be a custom value, or one of the constants, $LOC_COLOR_* as defined in LibreOfficeCalc_Constants.au3. Set to $LOC_COLOR_OFF(-1), to turn Background color off.
; $bBackTransparent - a boolean value. If True, the background color is transparent.
; Return values .: Success: 1 or Array
; Failure: 0 and sets the @Error and @Extended flags to non-zero.
; --Input Errors--
; @Error 1 @Extended 3 Return 0 = Variable passed to internal function not an Object.
; @Error 1 @Extended 4 Return 0 = $iBackColor not an Integer, less than -1 or greater than 16777215.
; @Error 1 @Extended 5 Return 0 = $bBackTransparent not a Boolean.
; --Property Setting Errors--
; @Error 4 @Extended ? Return 0 = Some settings were not successfully set. Use BitAND to test @Extended for following values:
; | 1 = Error setting $iBackColor
; | 2 = Error setting $bBackTransparent
; --Success--
; @Error 0 @Extended 0 Return 1 = Success. Settings were successfully set.
; @Error 0 @Extended 1 Return Array = Success. All optional parameters were set to Null, returning current settings in a 2 Element Array with values in order of function parameters.
; Author ........: donnyh13
; Modified ......:
; Remarks .......: Call this function with only the required parameters (or with all other parameters set to Null keyword), to get the current settings.
; Call any optional parameter with Null keyword to skip it.
; Related .......:
; Link ..........:
; Example .......: No
; ===============================================================================================================================
Func __LOCalc_CellBackColor(ByRef $oObj, $iBackColor, $bBackTransparent)
Local $oCOM_ErrorHandler = ObjEvent("AutoIt.Error", __LOCalc_InternalComErrorHandler)
#forceref $oCOM_ErrorHandler
Local $iError = 0
Local $avColor[2]
If Not IsObj($oObj) Then Return SetError($__LO_STATUS_INPUT_ERROR, 3, 0)
If __LOCalc_VarsAreNull($iBackColor, $bBackTransparent) Then
__LOCalc_ArrayFill($avColor, $oObj.CellBackColor(), $oObj.IsCellBackgroundTransparent())
Return SetError($__LO_STATUS_SUCCESS, 1, $avColor)
EndIf
If ($iBackColor <> Null) Then
If Not __LOCalc_IntIsBetween($iBackColor, $LOC_COLOR_OFF, $LOC_COLOR_WHITE) Then Return SetError($__LO_STATUS_INPUT_ERROR, 4, 0)
$oObj.CellBackColor = $iBackColor
$iError = ($oObj.CellBackColor() = $iBackColor) ? ($iError) : (BitOR($iError, 1))
EndIf
If ($bBackTransparent <> Null) Then
If Not IsBool($bBackTransparent) Then Return SetError($__LO_STATUS_INPUT_ERROR, 5, 0)
$oObj.IsCellBackgroundTransparent = $bBackTransparent
$iError = ($oObj.IsCellBackgroundTransparent() = $bBackTransparent) ? ($iError) : (BitOR($iError, 2))
EndIf
Return ($iError > 0) ? (SetError($__LO_STATUS_PROP_SETTING_ERROR, $iError, 0)) : (SetError($__LO_STATUS_SUCCESS, 0, 1))
EndFunc ;==>__LOCalc_CellBackColor
; #INTERNAL_USE_ONLY# ===========================================================================================================
; Name ..........: __LOCalc_CellBorder
; Description ...: Internal function to Set and Retrieve the Cell, or Cell Range Border Line Width, Style, and Color. Libre Office Version 3.6 and Up.
; Syntax ........: __LOCalc_CellBorder(ByRef $oRange, $bWid, $bSty, $bCol, $iTop, $iBottom, $iLeft, $iRight, $iVert, $iHori, $iTLBRDiag, $iBLTRDiag)
; Parameters ....: $oRange - [in/out] an object. A Cell Range or Cell object returned by a previous _LOCalc_RangeGetCellByName, _LOCalc_RangeGetCellByPosition, _LOCalc_RangeColumnGetObjByPosition, _LOCalc_RangeColumnGetObjByName, _LOcalc_RangeRowGetObjByPosition, _LOCalc_SheetGetObjByName, or _LOCalc_SheetGetActive function.
; $bWid - a boolean value. If True, Border Width is being modified. Only one can be True at once.
; $bSty - a boolean value. If True, Border Style is being modified. Only one can be True at once.
; $bCol - a boolean value. If True, Border Color is being modified. Only one can be True at once.
; $iTop - an integer value. Modifies the top border line settings. See Width, Style or Color functions for values.
; $iBottom - an integer value. Modifies the bottom border line settings. See Width, Style or Color functions for values.
; $iLeft - an integer value. Modifies the left border line settings. See Width, Style or Color functions for values.
; $iRight - an integer value. Modifies the right border line settings. See Width, Style or Color functions for values.
; $iVert - an integer value. Modifies the vertical border line settings. See Width, Style or Color functions for values.
; $iHori - an integer value. Modifies the horizontal border line settings. See Width, Style or Color functions for values.
; $iTLBRDiag - an integer value. Modifies the top-left to bottom-right diagonal border line settings. See Width, Style or Color functions for values.
; $iBLTRDiag - an integer value. Modifies the bottom-left to top-right diagonal border line settings. See Width, Style or Color functions for values.
; Return values .: Success: 1 or Array.
; Failure: 0 and sets the @Error and @Extended flags to non-zero.
; --Input Errors--
; @Error 1 @Extended 11 Return 0 = Variable passed to internal function not an Object.
; --Initialization Errors--
; @Error 2 @Extended 1 Return 0 = Error Creating Object "com.sun.star.table.BorderLine2"
; --Processing Errors--
; @Error 3 @Extended 1 Return 0 = Internal command error. More than one set to True. UDF Must be fixed.
; @Error 3 @Extended 2 Return 0 = Error Retrieving TableBorder2 Object.
; --Property Setting Errors--
; @Error 4 @Extended 1 Return 0 = Cannot set Top Border Style/Color when Top Border width not set.
; @Error 4 @Extended 2 Return 0 = Cannot set Bottom Border Style/Color when Bottom Border width not set.
; @Error 4 @Extended 3 Return 0 = Cannot set Left Border Style/Color when Left Border width not set.
; @Error 4 @Extended 4 Return 0 = Cannot set Right Border Style/Color when Right Border width not set.
; @Error 4 @Extended 5 Return 0 = Cannot set Vertical Border Style/Color when Vertical Border width not set.
; @Error 4 @Extended 6 Return 0 = Cannot set Horizontal Border Style/Color when Horizontal Border width not set.
; @Error 4 @Extended 7 Return 0 = Cannot set Top-Left to Bottom-Right Diagonal Border Style/Color when Top-Left to Bottom-Right Diagonal Border width not set.
; @Error 4 @Extended 8 Return 0 = Cannot set Bottom-Left to Top-Right Diagonal Border Style/Color when Bottom-Left to Top-Right Diagonal Border width not set.
; --Version Related Errors--
; @Error 7 @Extended 1 Return 0 = Current Libre Office version lower than 3.6.
; --Success--
; @Error 0 @Extended 0 Return 1 = Success. Settings were successfully set.
; @Error 0 @Extended 1 Return Array = Success. All optional parameters were set to Null, returning current settings in a 8 Element Array with values in order of function parameters.
; Author ........: donnyh13
; Modified ......:
; Remarks .......: Call this function with only the required parameters (or with all other parameters set to Null keyword), to get the current settings.
; Call any optional parameter with Null keyword to skip it.
; Related .......:
; Link ..........:
; Example .......: No
; ===============================================================================================================================
Func __LOCalc_CellBorder(ByRef $oRange, $bWid, $bSty, $bCol, $iTop, $iBottom, $iLeft, $iRight, $iVert, $iHori, $iTLBRDiag, $iBLTRDiag)
Local $oCOM_ErrorHandler = ObjEvent("AutoIt.Error", __LOCalc_InternalComErrorHandler)
#forceref $oCOM_ErrorHandler
Local $avBorder[8]
Local $tBL2, $tTB2
If Not __LOCalc_VersionCheck(3.6) Then Return SetError($__LO_STATUS_VER_ERROR, 1, 0)
If Not IsObj($oRange) Then Return SetError($__LO_STATUS_INPUT_ERROR, 11, 0)
If (($bWid + $bSty + $bCol) <> 1) Then Return SetError($__LO_STATUS_PROCESSING_ERROR, 1, 0)
If __LOCalc_VarsAreNull($iTop, $iBottom, $iLeft, $iRight, $iVert, $iHori, $iTLBRDiag, $iBLTRDiag) Then
If $bWid Then
__LOCalc_ArrayFill($avBorder, $oRange.TableBorder2.TopLine.LineWidth(), $oRange.TableBorder2.BottomLine.LineWidth(), _
$oRange.TableBorder2.LeftLine.LineWidth(), $oRange.TableBorder2.RightLine.LineWidth(), $oRange.TableBorder2.VerticalLine.LineWidth(), _
$oRange.TableBorder2.HorizontalLine.LineWidth(), $oRange.DiagonalTLBR2.LineWidth(), $oRange.DiagonalBLTR2.LineWidth())
ElseIf $bSty Then
__LOCalc_ArrayFill($avBorder, $oRange.TableBorder2.TopLine.LineStyle(), $oRange.TableBorder2.BottomLine.LineStyle(), _
$oRange.TableBorder2.LeftLine.LineStyle(), $oRange.TableBorder2.RightLine.LineStyle(), $oRange.TableBorder2.VerticalLine.LineStyle(), _
$oRange.TableBorder2.HorizontalLine.LineStyle(), $oRange.DiagonalTLBR2.LineStyle(), $oRange.DiagonalBLTR2.LineStyle())
ElseIf $bCol Then
__LOCalc_ArrayFill($avBorder, $oRange.TableBorder2.TopLine.Color(), $oRange.TableBorder2.BottomLine.Color(), _
$oRange.TableBorder2.LeftLine.Color(), $oRange.TableBorder2.RightLine.Color(), $oRange.TableBorder2.VerticalLine.Color(), _
$oRange.TableBorder2.HorizontalLine.Color(), $oRange.DiagonalTLBR2.Color(), $oRange.DiagonalBLTR2.Color())
EndIf
Return SetError($__LO_STATUS_SUCCESS, 1, $avBorder)
EndIf
$tBL2 = __LOCalc_CreateStruct("com.sun.star.table.BorderLine2")
If Not IsObj($tBL2) Then Return SetError($__LO_STATUS_INIT_ERROR, 1, 0)
$tTB2 = $oRange.TableBorder2
If Not IsObj($tTB2) Then Return SetError($__LO_STATUS_PROCESSING_ERROR, 2, 0)
If $iTop <> Null Then
If Not $bWid And ($tTB2.TopLine.LineWidth() = 0) Then Return SetError($__LO_STATUS_PROP_SETTING_ERROR, 1, 0) ; If Width not set, cant set color or style.
; Top Line
$tBL2.LineWidth = ($bWid) ? ($iTop) : ($tTB2.TopLine.LineWidth()) ; copy Line Width over to new size structure
$tBL2.LineStyle = ($bSty) ? ($iTop) : ($tTB2.TopLine.LineStyle()) ; copy Line style over to new size structure
$tBL2.Color = ($bCol) ? ($iTop) : ($tTB2.TopLine.Color()) ; copy Color over to new size structure
$tTB2.TopLine = $tBL2
EndIf
If $iBottom <> Null Then
If Not $bWid And ($tTB2.BottomLine.LineWidth() = 0) Then Return SetError($__LO_STATUS_PROP_SETTING_ERROR, 2, 0) ; If Width not set, cant set color or style.
; Bottom Line
$tBL2.LineWidth = ($bWid) ? ($iBottom) : ($tTB2.BottomLine.LineWidth()) ; copy Line Width over to new size structure
$tBL2.LineStyle = ($bSty) ? ($iBottom) : ($tTB2.BottomLine.LineStyle()) ; copy Line style over to new size structure
$tBL2.Color = ($bCol) ? ($iBottom) : ($tTB2.BottomLine.Color()) ; copy Color over to new size structure
$tTB2.BottomLine = $tBL2
EndIf
If $iLeft <> Null Then
If Not $bWid And ($tTB2.LeftLine.LineWidth() = 0) Then Return SetError($__LO_STATUS_PROP_SETTING_ERROR, 3, 0) ; If Width not set, cant set color or style.
; Left Line
$tBL2.LineWidth = ($bWid) ? ($iLeft) : ($tTB2.LeftLine.LineWidth()) ; copy Line Width over to new size structure
$tBL2.LineStyle = ($bSty) ? ($iLeft) : ($tTB2.LeftLine.LineStyle()) ; copy Line style over to new size structure
$tBL2.Color = ($bCol) ? ($iLeft) : ($tTB2.LeftLine.Color()) ; copy Color over to new size structure
$tTB2.LeftLine = $tBL2
EndIf
If $iRight <> Null Then
If Not $bWid And ($tTB2.RightLine.LineWidth() = 0) Then Return SetError($__LO_STATUS_PROP_SETTING_ERROR, 4, 0) ; If Width not set, cant set color or style.
; Right Line
$tBL2.LineWidth = ($bWid) ? ($iRight) : ($tTB2.RightLine.LineWidth()) ; copy Line Width over to new size structure
$tBL2.LineStyle = ($bSty) ? ($iRight) : ($tTB2.RightLine.LineStyle()) ; copy Line style over to new size structure
$tBL2.Color = ($bCol) ? ($iRight) : ($tTB2.RightLine.Color()) ; copy Color over to new size structure
$tTB2.RightLine = $tBL2
EndIf
If $iVert <> Null Then
If Not $bWid And ($tTB2.VerticalLine.LineWidth() = 0) Then Return SetError($__LO_STATUS_PROP_SETTING_ERROR, 5, 0) ; If Width not set, cant set color or style.
; Vertical Line
$tBL2.LineWidth = ($bWid) ? ($iVert) : ($tTB2.VerticalLine.LineWidth()) ; copy Line Width over to new size structure
$tBL2.LineStyle = ($bSty) ? ($iVert) : ($tTB2.VerticalLine.LineStyle()) ; copy Line style over to new size structure
$tBL2.Color = ($bCol) ? ($iVert) : ($tTB2.VerticalLine.Color()) ; copy Color over to new size structure
$tTB2.VerticalLine = $tBL2
EndIf
If $iHori <> Null Then
If Not $bWid And ($tTB2.HorizontalLine.LineWidth() = 0) Then Return SetError($__LO_STATUS_PROP_SETTING_ERROR, 6, 0) ; If Width not set, cant set color or style.
; Horizontal Line
;~ $tBL2.LineWidth = ($bWid) ? ($iHori) : ($tTB2.HorizontalLine.LineWidth()) ; copy Line Width over to new size structure
; I have to use OuterLineWidth instead of LineWidth because LineWidth doesn't set for some reason for Horizontal
$tBL2.OuterLineWidth = ($bWid) ? ($iHori) : ($tTB2.HorizontalLine.LineWidth()) ; copy Line Width over to new size structure
$tBL2.LineStyle = ($bSty) ? ($iHori) : ($tTB2.HorizontalLine.LineStyle()) ; copy Line style over to new size structure
$tBL2.Color = ($bCol) ? ($iHori) : ($tTB2.HorizontalLine.Color()) ; copy Color over to new size structure
$tTB2.HorizontalLine = $tBL2
EndIf
$oRange.TableBorder2 = $tTB2
If $iTLBRDiag <> Null Then
If Not $bWid And ($oRange.DiagonalTLBR2.LineWidth() = 0) Then Return SetError($__LO_STATUS_PROP_SETTING_ERROR, 7, 0) ; If Width not set, cant set color or style.
; Top-Left to Bottom Right Diagonal Line
$tBL2.LineWidth = ($bWid) ? ($iTLBRDiag) : ($oRange.DiagonalTLBR2.LineWidth()) ; copy Line Width over to new size structure
$tBL2.LineStyle = ($bSty) ? ($iTLBRDiag) : ($oRange.DiagonalTLBR2.LineStyle()) ; copy Line style over to new size structure
$tBL2.Color = ($bCol) ? ($iTLBRDiag) : ($oRange.DiagonalTLBR2.Color()) ; copy Color over to new size structure
$oRange.DiagonalTLBR2 = $tBL2
EndIf
If $iBLTRDiag <> Null Then
If Not $bWid And ($oRange.DiagonalBLTR2.LineWidth() = 0) Then Return SetError($__LO_STATUS_PROP_SETTING_ERROR, 8, 0) ; If Width not set, cant set color or style.
; Bottom-Left to Top-Right Diagonal Line
$tBL2.LineWidth = ($bWid) ? ($iBLTRDiag) : ($oRange.DiagonalBLTR2.LineWidth()) ; copy Line Width over to new size structure
$tBL2.LineStyle = ($bSty) ? ($iBLTRDiag) : ($oRange.DiagonalBLTR2.LineStyle()) ; copy Line style over to new size structure
$tBL2.Color = ($bCol) ? ($iBLTRDiag) : ($oRange.DiagonalBLTR2.Color()) ; copy Color over to new size structure
$oRange.DiagonalBLTR2 = $tBL2
EndIf
EndFunc ;==>__LOCalc_CellBorder
; #INTERNAL_USE_ONLY# ===========================================================================================================
; Name ..........: __LOCalc_CellBorderPadding
; Description ...: Internal function to Set or retrieve the Cell, Cell Range, or Cell Style Border Padding settings.
; Syntax ........: __LOCalc_CellBorderPadding(ByRef $oObj, $iAll, $iTop, $iBottom, $iLeft, $iRight)
; Parameters ....: $oObj - [in/out] an object. A Cell, Cell Range or Cell Style Object returned from an applicable function.
; $iAll - an integer value. Set all four padding distances to one distance in Micrometers (uM).
; $iTop - an integer value. Set the Top Distance between the Border and Cell contents, in Micrometers(uM).
; $iBottom - an integer value. Set the Bottom Distance between the Border and Cell contents, in Micrometers(uM).
; $iLeft - an integer value. Set the Left Distance between the Border and Cell contents, in Micrometers(uM).
; $iRight - an integer value. Set the Right Distance between the Border and Cell contents, in Micrometers(uM).
; Return values .: Success: 1 or Array.
; Failure: 0 and sets the @Error and @Extended flags to non-zero.
; --Input Errors--
; @Error 1 @Extended 3 Return 0 = Variable passed to internal function not an Object.
; @Error 1 @Extended 4 Return 0 = $iAll not an Integer, or less than 0.
; @Error 1 @Extended 5 Return 0 = $iTop not an Integer, or less than 0.
; @Error 1 @Extended 6 Return 0 = $iBottom not an Integer, or less than 0.
; @Error 1 @Extended 7 Return 0 = $iLeft not an Integer, or less than 0.
; @Error 1 @Extended 8 Return 0 = $iRight not an Integer, or less than 0.
; --Property Setting Errors--
; @Error 4 @Extended ? Return 0 = Some settings were not successfully set. Use BitAND to test @Extended for following values:
; | 1 = Error setting $iTop
; | 2 = Error setting $iBottom
; | 4 = Error setting $iLeft
; | 8 = Error setting $iRight
; --Success--
; @Error 0 @Extended 0 Return 1 = Success. Settings were successfully set.
; @Error 0 @Extended 1 Return Array = Success. All optional parameters were set to Null, returning current settings in a 5 Element Array with values in order of function parameters.
; Author ........: donnyh13
; Modified ......:
; Remarks .......: Call this function with only the required parameters (or with all other parameters set to Null keyword), to get the current settings.
; Call any optional parameter with Null keyword to skip it.
; $iAll returns an integer value if all (Top, Bottom, Left, Right) padding values are equal, else Null is returned.
; Related .......:
; Link ..........:
; Example .......: No
; ===============================================================================================================================
Func __LOCalc_CellBorderPadding(ByRef $oObj, $iAll, $iTop, $iBottom, $iLeft, $iRight)
Local $oCOM_ErrorHandler = ObjEvent("AutoIt.Error", __LOCalc_InternalComErrorHandler)
#forceref $oCOM_ErrorHandler
Local $iError = 0
Local $aiBPadding[5]
If Not IsObj($oObj) Then Return SetError($__LO_STATUS_INPUT_ERROR, 3, 0)
If __LOCalc_VarsAreNull($iAll, $iTop, $iBottom, $iLeft, $iRight) Then ; Return Top Margin value for $iAll
__LOCalc_ArrayFill($aiBPadding, (($oObj.ParaTopMargin() = $oObj.ParaBottomMargin()) And ($oObj.ParaLeftMargin() = $oObj.ParaRightMargin()) And ($oObj.ParaBottomMargin() = $oObj.ParaLeftMargin())) ? ($oObj.ParaBottomMargin()) : (Null), _
$oObj.ParaTopMargin(), $oObj.ParaBottomMargin(), $oObj.ParaLeftMargin(), $oObj.ParaRightMargin())
Return SetError($__LO_STATUS_SUCCESS, 1, $aiBPadding)
EndIf
If ($iAll <> Null) Then
If Not __LOCalc_IntIsBetween($iAll, 0) Then Return SetError($__LO_STATUS_INPUT_ERROR, 4, 0)
$oObj.ParaTopMargin = $iAll
$oObj.ParaBottomMargin = $iAll
$oObj.ParaLeftMargin = $iAll
$oObj.ParaRightMargin = $iAll
$iError = ($iTop <> Null) ? ($iError) : (__LOCalc_IntIsBetween($oObj.ParaTopMargin(), $iAll - 1, $iAll + 1)) ? ($iError) : (BitOR($iError, 1))
$iError = ($iBottom <> Null) ? ($iError) : (__LOCalc_IntIsBetween($oObj.ParaBottomMargin(), $iAll - 1, $iAll + 1)) ? ($iError) : (BitOR($iError, 2))
$iError = ($iLeft <> Null) ? ($iError) : (__LOCalc_IntIsBetween($oObj.ParaLeftMargin(), $iAll - 1, $iAll + 1)) ? ($iError) : (BitOR($iError, 4))
$iError = ($iRight <> Null) ? ($iError) : (__LOCalc_IntIsBetween($oObj.ParaRightMargin(), $iAll - 1, $iAll + 1)) ? ($iError) : (BitOR($iError, 8))
EndIf
If ($iTop <> Null) Then
If Not __LOCalc_IntIsBetween($iTop, 0) Then Return SetError($__LO_STATUS_INPUT_ERROR, 5, 0)
$oObj.ParaTopMargin = $iTop
$iError = (__LOCalc_IntIsBetween($oObj.ParaTopMargin(), $iTop - 1, $iTop + 1)) ? ($iError) : (BitOR($iError, 1))
EndIf
If ($iBottom <> Null) Then
If Not __LOCalc_IntIsBetween($iBottom, 0) Then Return SetError($__LO_STATUS_INPUT_ERROR, 6, 0)
$oObj.ParaBottomMargin = $iBottom
$iError = (__LOCalc_IntIsBetween($oObj.ParaBottomMargin(), $iBottom - 1, $iBottom + 1)) ? ($iError) : (BitOR($iError, 2))
EndIf
If ($iLeft <> Null) Then
If Not __LOCalc_IntIsBetween($iLeft, 0) Then Return SetError($__LO_STATUS_INPUT_ERROR, 7, 0)
$oObj.ParaLeftMargin = $iLeft
$iError = (__LOCalc_IntIsBetween($oObj.ParaLeftMargin(), $iLeft - 1, $iLeft + 1)) ? ($iError) : (BitOR($iError, 4))
EndIf
If ($iRight <> Null) Then
If Not __LOCalc_IntIsBetween($iRight, 0) Then Return SetError($__LO_STATUS_INPUT_ERROR, 8, 0)
$oObj.ParaRightMargin = $iRight
$iError = (__LOCalc_IntIsBetween($oObj.ParaRightMargin(), $iRight - 1, $iRight + 1)) ? ($iError) : (BitOR($iError, 8))
EndIf
Return ($iError > 0) ? (SetError($__LO_STATUS_PROP_SETTING_ERROR, $iError, 0)) : (SetError($__LO_STATUS_SUCCESS, 0, 1))
EndFunc ;==>__LOCalc_CellBorderPadding
; #INTERNAL_USE_ONLY# ===========================================================================================================
; Name ..........: __LOCalc_CellEffect
; Description ...: Internal function to Set or Retrieve the Font Effect settings for a Cell, Cell Range, or Cell Style.
; Syntax ........: __LOCalc_CellEffect(ByRef $oObj, $iRelief, $bOutline, $bShadow)
; Parameters ....: $oObj - [in/out] an object. A Cell, Cell Range or Cell Style Object returned from an applicable function.
; $iRelief - an integer value (0-2). The Character Relief style. See Constants, $LOC_RELIEF_* as defined in LibreOfficeCalc_Constants.au3.
; $bOutline - a boolean value. If True, the characters have an outline around the outside.
; $bShadow - a boolean value. If True, the characters have a shadow.
; Return values .: Success: 1 or Array
; Failure: 0 and sets the @Error and @Extended flags to non-zero.
; --Input Errors--
; @Error 1 @Extended 3 Return 0 = Variable passed to internal function not an Object.
; @Error 1 @Extended 4 Return 0 = $iRelief not an Integer, less than 0 or greater than 2. See Constants, $LOC_RELIEF_* as defined in LibreOfficeCalc_Constants.au3.
; @Error 1 @Extended 5 Return 0 = $bOutline not a Boolean.
; @Error 1 @Extended 6 Return 0 = $bShadow not a Boolean.
; --Property Setting Errors--
; @Error 4 @Extended ? Return 0 = Some settings were not successfully set. Use BitAND to test @Extended for following values:
; | 1 = Error setting $iRelief
; | 2 = Error setting $bOutline
; | 4 = Error setting $bShadow
; --Success--
; @Error 0 @Extended 0 Return 1 = Success. Settings were successfully set.
; @Error 0 @Extended 1 Return Array = Success. All optional parameters were set to Null, returning current settings in a 3 Element Array with values in order of function parameters.
; Author ........: donnyh13
; Modified ......:
; Remarks .......: Call this function with only the required parameters (or with all other parameters set to Null keyword), to get the current settings.
; Call any optional parameter with Null keyword to skip it.
; Related .......:
; Link ..........:
; Example .......: No
; ===============================================================================================================================
Func __LOCalc_CellEffect(ByRef $oObj, $iRelief, $bOutline, $bShadow)
Local $oCOM_ErrorHandler = ObjEvent("AutoIt.Error", __LOCalc_InternalComErrorHandler)
#forceref $oCOM_ErrorHandler
Local $iError = 0
Local $avEffect[3]
If Not IsObj($oObj) Then Return SetError($__LO_STATUS_INPUT_ERROR, 3, 0)
If __LOCalc_VarsAreNull($iRelief, $bOutline, $bShadow) Then
__LOCalc_ArrayFill($avEffect, $oObj.CharRelief(), $oObj.CharContoured(), $oObj.CharShadowed())
Return SetError($__LO_STATUS_SUCCESS, 1, $avEffect)
EndIf
If ($iRelief <> Null) Then
If Not __LOCalc_IntIsBetween($iRelief, $LOC_RELIEF_NONE, $LOC_RELIEF_ENGRAVED) Then Return SetError($__LO_STATUS_INPUT_ERROR, 4, 0)
$oObj.CharRelief = $iRelief
$iError = ($oObj.CharRelief() = $iRelief) ? ($iError) : (BitOR($iError, 1))
EndIf
If ($bOutline <> Null) Then
If Not IsBool($bOutline) Then Return SetError($__LO_STATUS_INPUT_ERROR, 5, 0)
$oObj.CharContoured = $bOutline
$iError = ($oObj.CharContoured() = $bOutline) ? ($iError) : (BitOR($iError, 2))
EndIf
If ($bShadow <> Null) Then
If Not IsBool($bShadow) Then Return SetError($__LO_STATUS_INPUT_ERROR, 6, 0)
$oObj.CharShadowed = $bShadow
$iError = ($oObj.CharShadowed() = $bShadow) ? ($iError) : (BitOR($iError, 4))
EndIf
Return ($iError > 0) ? (SetError($__LO_STATUS_PROP_SETTING_ERROR, $iError, 0)) : (SetError($__LO_STATUS_SUCCESS, 0, 1))
EndFunc ;==>__LOCalc_CellEffect
; #INTERNAL_USE_ONLY# ===========================================================================================================
; Name ..........: __LOCalc_CellFont
; Description ...: Internal function to Set and Retrieve the Font Settings for a Cell, Cell Range, or Cell Style.
; Syntax ........: __LOCalc_CellFont(ByRef $oObj, $sFontName, $nFontSize, $iPosture, $iWeight)
; Parameters ....: $oObj - [in/out] an object. A Cell, Cell Range or Cell Style Object returned from an applicable function.
; $sFontName - a string value. The Font Name to use.
; $nFontSize - a general number value. The new Font size.
; $iPosture - an integer value (0-5). The Font Italic setting. See Constants, $LOC_POSTURE_* as defined in LibreOfficeCalc_Constants.au3. Also see remarks.
; $iWeight - an integer value (0, 50-200). The Font Bold settings see Constants, $LOC_WEIGHT_* as defined in LibreOfficeCalc_Constants.au3. Also see remarks.
; Return values .: Success: 1 or Array
; Failure: 0 and sets the @Error and @Extended flags to non-zero.
; --Input Errors--
; @Error 1 @Extended 5 Return 0 = Variable passed to internal function not an Object.
; @Error 1 @Extended 6 Return 0 = $sFontName not a String.
; @Error 1 @Extended 7 Return 0 = $nFontSize not a number.
; @Error 1 @Extended 8 Return 0 = $iPosture not an Integer, less than 0, or greater than 5. See Constants, $LOC_POSTURE_* as defined in LibreOfficeCalc_Constants.au3.
; @Error 1 @Extended 9 Return 0 = $iWeight not an Integer, less than 50 but not equal to 0, or greater than 200. See Constants, $LOC_WEIGHT_* as defined in LibreOfficeCalc_Constants.au3.
; --Property Setting Errors--
; @Error 4 @Extended ? Return 0 = Some settings were not successfully set. Use BitAND to test @Extended for following values:
; | 1 = Error setting $sFontName
; | 2 = Error setting $nFontSize
; | 4 = Error setting $iPosture
; | 8 = Error setting $iWeight
; --Success--
; @Error 0 @Extended 0 Return 1 = Success. Settings were successfully set.
; @Error 0 @Extended 1 Return Array = Success. All optional parameters were set to Null, returning current settings in a 4 Element Array with values in order of function parameters.
; Author ........: donnyh13
; Modified ......:
; Remarks .......: Call this function with only the required parameters (or with all other parameters set to Null keyword), to get the current settings.
; Call any optional parameter with Null keyword to skip it.
; Not every font accepts Bold and Italic settings, and not all settings for bold and Italic are accepted, such as oblique, ultra Bold etc.
; Libre Calc accepts only the predefined weight values, any other values are changed automatically to an acceptable value, which could trigger a settings error.
; Related .......:
; Link ..........:
; Example .......: No
; ===============================================================================================================================
Func __LOCalc_CellFont(ByRef $oObj, $sFontName, $nFontSize, $iPosture, $iWeight)
Local $oCOM_ErrorHandler = ObjEvent("AutoIt.Error", __LOCalc_InternalComErrorHandler)
#forceref $oCOM_ErrorHandler
Local $iError = 0
Local $avFont[4]
If Not IsObj($oObj) Then Return SetError($__LO_STATUS_INPUT_ERROR, 5, 0)
If __LOCalc_VarsAreNull($sFontName, $nFontSize, $iPosture, $iWeight) Then
__LOCalc_ArrayFill($avFont, $oObj.CharFontName(), $oObj.CharHeight(), $oObj.CharPosture(), $oObj.CharWeight())
Return SetError($__LO_STATUS_SUCCESS, 1, $avFont)
EndIf
If ($sFontName <> Null) Then
If Not IsString($sFontName) Then Return SetError($__LO_STATUS_INPUT_ERROR, 6, 0)
$oObj.CharFontName = $sFontName
$iError = ($oObj.CharFontName() = $sFontName) ? ($iError) : (BitOR($iError, 1))
EndIf
If ($nFontSize <> Null) Then
If Not IsNumber($nFontSize) Then Return SetError($__LO_STATUS_INPUT_ERROR, 7, 0)
$oObj.CharHeight = $nFontSize
$iError = ($oObj.CharHeight() = $nFontSize) ? ($iError) : (BitOR($iError, 2))
EndIf
If ($iPosture <> Null) Then
If Not __LOCalc_IntIsBetween($iPosture, $LOC_POSTURE_NONE, $LOC_POSTURE_ITALIC) Then Return SetError($__LO_STATUS_INPUT_ERROR, 8, 0)
$oObj.CharPosture = $iPosture
$iError = ($oObj.CharPosture() = $iPosture) ? ($iError) : (BitOR($iError, 4))
EndIf
If ($iWeight <> Null) Then
If Not __LOCalc_IntIsBetween($iWeight, $LOC_WEIGHT_THIN, $LOC_WEIGHT_BLACK, "", $LOC_WEIGHT_DONT_KNOW) Then Return SetError($__LO_STATUS_INPUT_ERROR, 9, 0)
$oObj.CharWeight = $iWeight
$iError = ($oObj.CharWeight() = $iWeight) ? ($iError) : (BitOR($iError, 8))
EndIf
Return ($iError > 0) ? (SetError($__LO_STATUS_PROP_SETTING_ERROR, $iError, 0)) : (SetError($__LO_STATUS_SUCCESS, 0, 1))
EndFunc ;==>__LOCalc_CellFont
; #INTERNAL_USE_ONLY# ===========================================================================================================
; Name ..........: __LOCalc_CellFontColor
; Description ...: Internal function to Set or Retrieve the Font Color for a Cell, Cell Range, or Cell Style.
; Syntax ........: __LOCalc_CellFontColor(ByRef $oObj, $iFontColor)
; Parameters ....: $oObj - [in/out] an object. A Cell, Cell Range or Cell Style Object returned from an applicable function.
; $iFontColor - an integer value (-1-16777215). The Color value in Long Integer format to make the font, can be a custom value, or one of the constants, $LOC_COLOR_* as defined in LibreOfficeCalc_Constants.au3. Set to $LOC_COLOR_OFF(-1) for Auto color.
; Return values .: Success: 1 or Integer.
; Failure: 0 and sets the @Error and @Extended flags to non-zero.
; --Input Errors--
; @Error 1 @Extended 3 Return 0 = Variable passed to internal function not an Object.
; @Error 1 @Extended 4 Return 0 = $iFontColor not an Integer, less than 0, or greater than 16777215.
; --Property Setting Errors--
; @Error 4 @Extended ? Return 0 = Some settings were not successfully set. Use BitAND to test @Extended for following values:
; | 1 = Error setting $iFontColor
; --Success--
; @Error 0 @Extended 0 Return 1 = Success. Settings were successfully set.
; @Error 0 @Extended 1 Return Integer = Success. All optional parameters were set to Null, returning current Font Color as an Integer.
; Author ........: donnyh13
; Modified ......:
; Remarks .......: Though Transparency is present on the Font Effects page in the UI, there is (as best as I can find) no setting for it available to read and modify. And further, it seems even in L.O. the setting does not affect the font's transparency, though it may change the color value.
; Call this function with only the required parameters (or with all other parameters set to Null keyword), to get the current settings.
; Related .......:
; Link ..........:
; Example .......: No
; ===============================================================================================================================
Func __LOCalc_CellFontColor(ByRef $oObj, $iFontColor)
Local $oCOM_ErrorHandler = ObjEvent("AutoIt.Error", __LOCalc_InternalComErrorHandler)
#forceref $oCOM_ErrorHandler
Local $iError = 0
If Not IsObj($oObj) Then Return SetError($__LO_STATUS_INPUT_ERROR, 3, 0)
If __LOCalc_VarsAreNull($iFontColor) Then
Return SetError($__LO_STATUS_SUCCESS, 1, $oObj.CharColor())
EndIf
If ($iFontColor <> Null) Then
If Not __LOCalc_IntIsBetween($iFontColor, $LOC_COLOR_OFF, $LOC_COLOR_WHITE) Then Return SetError($__LO_STATUS_INPUT_ERROR, 4, 0)
$oObj.CharColor = $iFontColor
$iError = ($oObj.CharColor() = $iFontColor) ? ($iError) : (BitOR($iError, 1))
EndIf
Return ($iError > 0) ? (SetError($__LO_STATUS_PROP_SETTING_ERROR, $iError, 0)) : (SetError($__LO_STATUS_SUCCESS, 0, 1))
EndFunc ;==>__LOCalc_CellFontColor
; #INTERNAL_USE_ONLY# ===========================================================================================================
; Name ..........: __LOCalc_CellNumberFormat
; Description ...: Internal function to Set or Retrieve Cell, Cell Range, or Cell Style Number Format settings.
; Syntax ........: __LOCalc_CellNumberFormat(ByRef $oDoc, ByRef $oObj, $iFormatKey)
; Parameters ....: $oDoc - [in/out] an object. A Document object returned by a previous _LOCalc_DocOpen, _LOCalc_DocConnect, or _LOCalc_DocCreate function.
; $oObj - [in/out] an object. A Cell, Cell Range or Cell Style Object returned from an applicable function.
; $iFormatKey - an integer value. A Format Key from a previous _LOCalc_FormatKeyCreate or _LOCalc_FormatKeyList function.
; Return values .: Success: 1 or Integer.
; Failure: 0 and sets the @Error and @Extended flags to non-zero.
; --Input Errors--
; @Error 1 @Extended 4 Return 0 = Variable passed to internal function not an Object.
; @Error 1 @Extended 5 Return 0 = $iFormatKey not an Integer.
; @Error 1 @Extended 6 Return 0 = Format Key called in $iFormatKey not found in document.
; --Property Setting Errors--
; @Error 4 @Extended ? Return 0 = Some settings were not successfully set. Use BitAND to test @Extended for following values:
; | 1 = Error setting $iFormatKey
; --Success--
; @Error 0 @Extended 0 Return 1 = Success. Settings were successfully set.
; @Error 0 @Extended 1 Return Array = Success. All optional parameters were set to Null, returning current setting as an Integer.
; Author ........: donnyh13
; Modified ......:
; Remarks .......: Call this function with only the required parameters (or with all other parameters set to Null keyword), to get the current settings.
; Call any optional parameter with Null keyword to skip it.
; Related .......:
; Link ..........:
; Example .......: No
; ===============================================================================================================================
Func __LOCalc_CellNumberFormat(ByRef $oDoc, ByRef $oObj, $iFormatKey)
Local $oCOM_ErrorHandler = ObjEvent("AutoIt.Error", __LOCalc_InternalComErrorHandler)
#forceref $oCOM_ErrorHandler
Local $iError = 0
If Not IsObj($oObj) Then Return SetError($__LO_STATUS_INPUT_ERROR, 4, 0)
If __LOCalc_VarsAreNull($iFormatKey) Then Return SetError($__LO_STATUS_SUCCESS, 1, $oObj.NumberFormat())
If Not IsInt($iFormatKey) Then Return SetError($__LO_STATUS_INPUT_ERROR, 5, 0)
If Not _LOCalc_FormatKeyExists($oDoc, $iFormatKey) Then Return SetError($__LO_STATUS_INPUT_ERROR, 6, 0)
$oObj.NumberFormat = $iFormatKey
$iError = ($oObj.NumberFormat() = $iFormatKey) ? ($iError) : (BitOR($iError, 1))
Return ($iError > 0) ? (SetError($__LO_STATUS_PROP_SETTING_ERROR, $iError, 0)) : (SetError($__LO_STATUS_SUCCESS, 0, 1))
EndFunc ;==>__LOCalc_CellNumberFormat
; #INTERNAL_USE_ONLY# ===========================================================================================================
; Name ..........: __LOCalc_CellOverLine
; Description ...: Internal function to Set and retrieve the OverLine settings for a Cell, Cell Range, or Cell Style.
; Syntax ........: __LOCalc_CellOverLine(ByRef $oObj, $bWordOnly, $iOverLineStyle, $bOLHasColor, $iOLColor)
; Parameters ....: $oObj - [in/out] an object. A Cell, Cell Range or Cell Style Object returned from an applicable function.
; $bWordOnly - a boolean value. If true, white spaces are not Overlined.
; $iOverLineStyle - an integer value (0-18). The style of the Overline line, see constants, $LOC_UNDERLINE_* as defined in LibreOfficeCalc_Constants.au3. See Remarks.
; $bOLHasColor - a boolean value. If True, the Overline is colored, must be set to true in order to set the Overline color.
; $iOLColor - an integer value (-1-16777215). The Overline color, set in Long integer format. Can be a custom value, or one of the constants, $LOC_COLOR_* as defined in LibreOfficeCalc_Constants.au3. Set to $LOC_COLOR_OFF(-1) for automatic color mode.
; Return values .: Success: 1 or Array
; Failure: 0 and sets the @Error and @Extended flags to non-zero.
; --Input Errors--
; @Error 1 @Extended 3 Return 0 = Variable passed to internal function not an Object.
; @Error 1 @Extended 4 Return 0 = $bWordOnly not a Boolean.
; @Error 1 @Extended 5 Return 0 = $iOverLineStyle not an Integer, less than 0, or greater than 18. See constants, $LOC_UNDERLINE_* as defined in LibreOfficeCalc_Constants.au3. See Remarks.
; @Error 1 @Extended 6 Return 0 = $bOLHasColor not a Boolean.
; @Error 1 @Extended 7 Return 0 = $iOLColor not an Integer, less than -1, or greater than 16777215.
; --Property Setting Errors--
; @Error 4 @Extended ? Return 0 = Some settings were not successfully set. Use BitAND to test @Extended for following values:
; | 1 = Error setting $bWordOnly
; | 2 = Error setting $iOverLineStyle
; | 4 = Error setting $bOLHasColor
; | 8 = Error setting $iOLColor
; --Success--
; @Error 0 @Extended 0 Return 1 = Success. Settings were successfully set.
; @Error 0 @Extended 1 Return Array = Success. All optional parameters were set to Null, returning current settings in a 4 Element Array with values in order of function parameters.
; Author ........: donnyh13
; Modified ......:
; Remarks .......: Overline line style uses the same constants as underline style.
; Call this function with only the required parameters (or with all other parameters set to Null keyword), to get the current settings.
; Call any optional parameter with Null keyword to skip it.
; Related .......:
; Link ..........:
; Example .......: No
; ===============================================================================================================================
Func __LOCalc_CellOverLine(ByRef $oObj, $bWordOnly, $iOverLineStyle, $bOLHasColor, $iOLColor)
Local $oCOM_ErrorHandler = ObjEvent("AutoIt.Error", __LOCalc_InternalComErrorHandler)
#forceref $oCOM_ErrorHandler
Local $iError = 0
Local $avOverLine[4]
If Not IsObj($oObj) Then Return SetError($__LO_STATUS_INPUT_ERROR, 3, 0)
If __LOCalc_VarsAreNull($bWordOnly, $iOverLineStyle, $bOLHasColor, $iOLColor) Then
__LOCalc_ArrayFill($avOverLine, $oObj.CharWordMode(), $oObj.CharOverline(), $oObj.CharOverlineHasColor(), $oObj.CharOverlineColor())
Return SetError($__LO_STATUS_SUCCESS, 1, $avOverLine)
EndIf
If ($bWordOnly <> Null) Then
If Not IsBool($bWordOnly) Then Return SetError($__LO_STATUS_INPUT_ERROR, 4, 0)
$oObj.CharWordMode = $bWordOnly
$iError = ($oObj.CharWordMode() = $bWordOnly) ? ($iError) : (BitOR($iError, 1))
EndIf
If ($iOverLineStyle <> Null) Then
If Not __LOCalc_IntIsBetween($iOverLineStyle, $LOC_UNDERLINE_NONE, $LOC_UNDERLINE_BOLD_WAVE) Then Return SetError($__LO_STATUS_INPUT_ERROR, 5, 0)
$oObj.CharOverline = $iOverLineStyle
$iError = ($oObj.CharOverline() = $iOverLineStyle) ? ($iError) : (BitOR($iError, 2))
EndIf
If ($bOLHasColor <> Null) Then
If Not IsBool($bOLHasColor) Then Return SetError($__LO_STATUS_INPUT_ERROR, 6, 0)
$oObj.CharOverlineHasColor = $bOLHasColor
$iError = ($oObj.CharOverlineHasColor() = $bOLHasColor) ? ($iError) : (BitOR($iError, 4))
EndIf
If ($iOLColor <> Null) Then
If Not __LOCalc_IntIsBetween($iOLColor, $LOC_COLOR_OFF, $LOC_COLOR_WHITE) Then Return SetError($__LO_STATUS_INPUT_ERROR, 7, 0)
$oObj.CharOverlineColor = $iOLColor
$iError = ($oObj.CharOverlineColor() = $iOLColor) ? ($iError) : (BitOR($iError, 8))
EndIf
Return ($iError > 0) ? (SetError($__LO_STATUS_PROP_SETTING_ERROR, $iError, 0)) : (SetError($__LO_STATUS_SUCCESS, 0, 1))
EndFunc ;==>__LOCalc_CellOverLine
; #INTERNAL_USE_ONLY# ===========================================================================================================
; Name ..........: __LOCalc_CellProtection
; Description ...: Internal function to Set or Retrieve Cell, Cell Range, or Cell Style protection settings.
; Syntax ........: __LOCalc_CellProtection(ByRef $oObj, $bHideAll, $bProtected, $bHideFormula, $bHideWhenPrint)
; Parameters ....: $oObj - [in/out] an object. A Cell, Cell Range or Cell Style Object returned from an applicable function.
; $bHideAll - a boolean value. If True, Hides formulas and contents of the cell.
; $bProtected - a boolean value. If True, Prevents the cell from being modified.
; $bHideFormula - a boolean value. If True, Hides formulas in the cell.
; $bHideWhenPrint - a boolean value. If True, the cell is kept from being printed.
; Return values .: Success: 1 or Array
; Failure: 0 and sets the @Error and @Extended flags to non-zero.
; --Input Errors--
; @Error 1 @Extended 3 Return 0 = Variable passed to internal function not an Object.
; @Error 1 @Extended 4 Return 0 = $bHideAll not a Boolean.
; @Error 1 @Extended 5 Return 0 = $bProtected not a Boolean.
; @Error 1 @Extended 6 Return 0 = $bHideFormula not a Boolean.
; @Error 1 @Extended 7 Return 0 = $bHideWhenPrint not a Boolean.
; --Processing Errors--
; @Error 3 @Extended 1 Return 0 = Failed to retrieve Cell Protection Structure.
; --Property Setting Errors--
; @Error 4 @Extended ? Return 0 = Some settings were not successfully set. Use BitAND to test @Extended for following values:
; | 1 = Error setting $bHideAll
; | 2 = Error setting $bProtected
; | 4 = Error setting $bHideFormula
; | 8 = Error setting $bHideWhenPrint
; --Success--
; @Error 0 @Extended 0 Return 1 = Success. Settings were successfully set.
; @Error 0 @Extended 1 Return Array = Success. All optional parameters were set to Null, returning current settings in a 4 Element Array with values in order of function parameters.
; Author ........: donnyh13
; Modified ......:
; Remarks .......: Call this function with only the required parameters (or with all other parameters set to Null keyword), to get the current settings.
; Call any optional parameter with Null keyword to skip it.
; Cell protection only takes effect if you also protect the sheet.
; Related .......:
; Link ..........:
; Example .......: No
; ===============================================================================================================================
Func __LOCalc_CellProtection(ByRef $oObj, $bHideAll, $bProtected, $bHideFormula, $bHideWhenPrint)
Local $oCOM_ErrorHandler = ObjEvent("AutoIt.Error", __LOCalc_InternalComErrorHandler)
#forceref $oCOM_ErrorHandler
Local $iError = 0
Local $abProtection[4]
Local $tCellProtection
If Not IsObj($oObj) Then Return SetError($__LO_STATUS_INPUT_ERROR, 3, 0)
$tCellProtection = $oObj.CellProtection()
If Not IsObj($tCellProtection) Then Return SetError($__LO_STATUS_PROCESSING_ERROR, 1, 0)
If __LOCalc_VarsAreNull($bHideAll, $bProtected, $bHideFormula, $bHideWhenPrint) Then
__LOCalc_ArrayFill($abProtection, $tCellProtection.IsHidden(), $tCellProtection.IsLocked(), $tCellProtection.IsFormulaHidden(), $tCellProtection.IsPrintHidden())
Return SetError($__LO_STATUS_SUCCESS, 1, $abProtection)
EndIf
If ($bHideAll <> Null) Then
If Not IsBool($bHideAll) Then Return SetError($__LO_STATUS_INPUT_ERROR, 4, 0)
$tCellProtection.IsHidden = $bHideAll
EndIf
If ($bProtected <> Null) Then
If Not IsBool($bProtected) Then Return SetError($__LO_STATUS_INPUT_ERROR, 5, 0)
$tCellProtection.IsLocked = $bProtected
EndIf
If ($bHideFormula <> Null) Then
If Not IsBool($bHideFormula) Then Return SetError($__LO_STATUS_INPUT_ERROR, 6, 0)
$tCellProtection.IsFormulaHidden = $bHideFormula
EndIf
If ($bHideWhenPrint <> Null) Then
If Not IsBool($bHideWhenPrint) Then Return SetError($__LO_STATUS_INPUT_ERROR, 7, 0)
$tCellProtection.IsPrintHidden = $bHideWhenPrint
EndIf
$oObj.CellProtection = $tCellProtection
$iError = ($bHideAll = Null) ? ($iError) : ($oObj.CellProtection.IsHidden() = $bHideAll) ? ($iError) : (BitOR($iError, 1))
$iError = ($bProtected = Null) ? ($iError) : ($oObj.CellProtection.IsLocked() = $bProtected) ? ($iError) : (BitOR($iError, 2))
$iError = ($bHideFormula = Null) ? ($iError) : ($oObj.CellProtection.IsFormulaHidden() = $bHideFormula) ? ($iError) : (BitOR($iError, 4))
$iError = ($bHideWhenPrint = Null) ? ($iError) : ($oObj.CellProtection.IsPrintHidden() = $bHideWhenPrint) ? ($iError) : (BitOR($iError, 8))
Return ($iError > 0) ? (SetError($__LO_STATUS_PROP_SETTING_ERROR, $iError, 0)) : (SetError($__LO_STATUS_SUCCESS, 0, 1))
EndFunc ;==>__LOCalc_CellProtection
; #INTERNAL_USE_ONLY# ===========================================================================================================
; Name ..........: __LOCalc_CellShadow
; Description ...: Internal function to Set or Retrieve the Shadow settings for a Cell, Cell Range, or Cell style.
; Syntax ........: __LOCalc_CellShadow(ByRef $oObj, $iWidth, $iColor, $bTransparent, $iLocation)
; Parameters ....: $oObj - [in/out] an object. A Cell, Cell Range or Cell Style Object returned from an applicable function.
; $iWidth - an integer value (0-5009). The shadow width, set in Micrometers.
; $iColor - an integer value (0-16777215). The color of the shadow, set in Long Integer format. Can be a custom value, or one of the constants, $LOC_COLOR_* as defined in LibreOfficeCalc_Constants.au3.
; $bTransparent - a boolean value. If True, the shadow is transparent.
; $iLocation - an integer value (0-4). The location of the shadow compared to the Cell. See Constants, $LOC_SHADOW_* as defined in LibreOfficeCalc_Constants.au3.
; Return values .: Success: 1 or Array.
; Failure: 0 and sets the @Error and @Extended flags to non-zero.
; --Input Errors--
; @Error 1 @Extended 3 Return 0 = Variable passed to internal function not an Object.
; @Error 1 @Extended 4 Return 0 = $iWidth not an Integer, less than 0, or greater than 5009.
; @Error 1 @Extended 5 Return 0 = $iColor not an Integer, less than 0, or greater than 16,777,215.
; @Error 1 @Extended 6 Return 0 = $bTransparent not a Boolean.
; @Error 1 @Extended 7 Return 0 = $iLocation not an Integer, less than 0, or greater than 4. See Constants, $LOC_SHADOW_* as defined in LibreOfficeCalc_Constants.au3.
; --Processing Errors--
; @Error 3 @Extended 1 Return 0 = Failed to retrieve Shadow Format Structure.
; --Property Setting Errors--
; @Error 4 @Extended ? Return 0 = Some settings were not successfully set. Use BitAND to test @Extended for following values:
; | 1 = Error setting $iWidth
; | 2 = Error setting $iColor
; | 4 = Error setting $bTransparent
; | 8 = Error setting $iLocation
; --Success--
; @Error 0 @Extended 0 Return 1 = Success. Settings were successfully set.
; @Error 0 @Extended 1 Return Array = Success. All optional parameters were set to Null, returning current settings in a 4 Element Array with values in order of function parameters.
; Author ........: donnyh13
; Modified ......:
; Remarks .......: Call this function with only the required parameters (or with all other parameters set to Null keyword), to get the current settings.
; Call any optional parameter with Null keyword to skip it.
; Related .......:
; Link ..........:
; Example .......: No
; ===============================================================================================================================
Func __LOCalc_CellShadow(ByRef $oObj, $iWidth, $iColor, $bTransparent, $iLocation)
Local $oCOM_ErrorHandler = ObjEvent("AutoIt.Error", __LOCalc_InternalComErrorHandler)
#forceref $oCOM_ErrorHandler
Local $iError = 0
Local $tShdwFrmt
Local $avShadow[4]
If Not IsObj($oObj) Then Return SetError($__LO_STATUS_INPUT_ERROR, 3, 0)
$tShdwFrmt = $oObj.ShadowFormat()
If Not IsObj($tShdwFrmt) Then Return SetError($__LO_STATUS_PROCESSING_ERROR, 1, 0)
If __LOCalc_VarsAreNull($iWidth, $iColor, $bTransparent, $iLocation) Then
__LOCalc_ArrayFill($avShadow, $tShdwFrmt.ShadowWidth(), $tShdwFrmt.Color(), $tShdwFrmt.IsTransparent(), $tShdwFrmt.Location())
Return SetError($__LO_STATUS_SUCCESS, 1, $avShadow)
EndIf
If ($iWidth <> Null) Then
If Not __LOCalc_IntIsBetween($iWidth, 0, 5009) Then Return SetError($__LO_STATUS_INPUT_ERROR, 4, 0)
$tShdwFrmt.ShadowWidth = $iWidth
EndIf
If ($iColor <> Null) Then
If Not __LOCalc_IntIsBetween($iColor, $LOC_COLOR_BLACK, $LOC_COLOR_WHITE) Then Return SetError($__LO_STATUS_INPUT_ERROR, 5, 0)
$tShdwFrmt.Color = $iColor
EndIf
If ($bTransparent <> Null) Then
If Not IsBool($bTransparent) Then Return SetError($__LO_STATUS_INPUT_ERROR, 6, 0)
$tShdwFrmt.IsTransparent = $bTransparent
EndIf
If ($iLocation <> Null) Then
If Not __LOCalc_IntIsBetween($iLocation, $LOC_SHADOW_NONE, $LOC_SHADOW_BOTTOM_RIGHT) Then Return SetError($__LO_STATUS_INPUT_ERROR, 7, 0)
$tShdwFrmt.Location = $iLocation
EndIf
$oObj.ShadowFormat = $tShdwFrmt
$iError = ($iWidth = Null) ? ($iError) : ((__LOCalc_IntIsBetween($oObj.ShadowFormat.ShadowWidth(), $iWidth - 1, $iWidth + 1)) ? ($iError) : (BitOR($iError, 1)))
$iError = ($iColor = Null) ? ($iError) : (($oObj.ShadowFormat.Color() = $iColor) ? ($iError) : (BitOR($iError, 2)))
$iError = ($bTransparent = Null) ? ($iError) : (($oObj.ShadowFormat.IsTransparent() = $bTransparent) ? ($iError) : (BitOR($iError, 4)))
$iError = ($iLocation = Null) ? ($iError) : (($oObj.ShadowFormat.Location() = $iLocation) ? ($iError) : (BitOR($iError, 8)))
Return ($iError > 0) ? (SetError($__LO_STATUS_PROP_SETTING_ERROR, $iError, 0)) : (SetError($__LO_STATUS_SUCCESS, 0, 1))
EndFunc ;==>__LOCalc_CellShadow
; #INTERNAL_USE_ONLY# ===========================================================================================================
; Name ..........: __LOCalc_CellStrikeOut
; Description ...: Internal function to Set or Retrieve the Strikeout settings for a Cell, Cell Range, or Cell Style.
; Syntax ........: __LOCalc_CellStrikeOut(ByRef $oObj, $bWordOnly, $bStrikeOut, $iStrikeLineStyle)
; Parameters ....: $oObj - [in/out] an object. A Cell, Cell Range or Cell Style Object returned from an applicable function.
; $bWordOnly - a boolean value. If True, strike out is applied to words only, skipping whitespaces.
; $bStrikeOut - a boolean value. If True, strikeout is applied to characters.
; $iStrikeLineStyle - an integer value (0-6). The Strikeout Line Style, see constants, $LOC_STRIKEOUT_* as defined in LibreOfficeCalc_Constants.au3.
; Return values .: Success: 1 or Array
; Failure: 0 and sets the @Error and @Extended flags to non-zero.
; --Input Errors--
; @Error 1 @Extended 3 Return 0 = Variable passed to internal function not an Object.
; @Error 1 @Extended 4 Return 0 = $bWordOnly not a Boolean.
; @Error 1 @Extended 5 Return 0 = $bStrikeOut not a Boolean.
; @Error 1 @Extended 6 Return 0 = $iStrikeLineStyle not an Integer, less than 0 or greater than 6. See constants, $LOC_STRIKEOUT_* as defined in LibreOfficeCalc_Constants.au3.
; --Property Setting Errors--
; @Error 4 @Extended ? Return 0 = Some settings were not successfully set. Use BitAND to test @Extended for following values:
; | 1 = Error setting $bWordOnly
; | 2 = Error setting $bStrikeOut
; | 4 = Error setting $iStrikeLineStyle
; --Success--
; @Error 0 @Extended 0 Return 1 = Success. Settings were successfully set.
; @Error 0 @Extended 1 Return Array = Success. All optional parameters were set to Null, returning current settings in a 3 Element Array with values in order of function parameters.
; Author ........: donnyh13
; Modified ......:
; Remarks .......: Call this function with only the required parameters (or with all other parameters set to Null keyword), to get the current settings.