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
|
'encoding UTF-8 Do not remove or change this line!
'**************************************************************************
'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
'*
'* Copyright 2008 by Sun Microsystems, Inc.
'*
'* OpenOffice.org - a multi-platform office productivity suite
'*
'* $RCSfile: w_formatparagraph3.inc,v $
'*
'* $Revision: 1.2 $
'*
'* last change: $Author: vg $ $Date: 2008-08-18 12:29:37 $
'*
'* This file is part of OpenOffice.org.
'*
'* OpenOffice.org is free software: you can redistribute it and/or modify
'* it under the terms of the GNU Lesser General Public License version 3
'* only, as published by the Free Software Foundation.
'*
'* OpenOffice.org is distributed in the hope that it will be useful,
'* but WITHOUT ANY WARRANTY; without even the implied warranty of
'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
'* GNU Lesser General Public License version 3 for more details
'* (a copy is included in the LICENSE file that accompanied this code).
'*
'* You should have received a copy of the GNU Lesser General Public License
'* version 3 along with OpenOffice.org. If not, see
'* <http://www.openoffice.org/license.html>
'* for a copy of the LGPLv3 License.
'*
'/************************************************************************
'*
'* owner : helge.delfs@sun.com
'*
'* short description : Test the functionality of Paragraph Formatting - 3
'*
'************************************************************************
'*
' #1 tParagraphTabs1 'Test Tab stops - Left
' #1 tParagraphTabs2 'Test Tab stops - Right
' #1 tParagraphTabs3 'Test Tab stops - Centered
' #1 tParagraphTabs4 'Test Tab stops - Decimal
' #1 tParagraphTabs5 'Delete a selected tab stop
' #1 tParagraphTabs6 'Delete all tab stops
' #1 tParagraphDropCaps1 'Test Drop Caps - Default
' #1 tParagraphDropCaps2 'Test Drop Caps - select a word
' #1 tParagraphDropCaps3 'Test Drop Caps - select different Number of characters
' #1 tParagraphDropCaps4 'Test Drop Caps - select different number of Lines
' #1 tParagraphDropCaps5 'Test Drop Caps - Set different 'Space to text'
' #1 tParagraphDropCaps6 'Test max 'Space to text'
' #1 tParagraphDropCaps7 'Test text in Contents "Text" field
' #1 tParagraphDropCaps8 'Test 'Character Style' with given template
' #1 tParagraphDropCaps9 'Test 'Character Style' with user-defined template
' #1 tParagraphNumbering1 'Test Numbering
' #1 tParagraphBorder1 'Test Default borders
' #1 tParagraphBorder2 'All 'spacing to contents' spin boxes are limited to 5cm
' #1 tParagraphBorder3 'Test Uncheck 'Synchronize'
' #1 tParagraphBorder4 'Test check 'Synchronize'
' #1 tParagraphBorder5 'Test default shadow color
' #1 tParagraphBorder6 'Test shadow setting
'*
'\***********************************************************************
testcase tParagraphTabs1
Dim sTestFile as String
Dim sTabs as String
Dim sPosition as String
sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\formatparagraph\TabsTest.sxw")
sTabs = "3" + gSeperator + "00" + gMeasurementUnit
sPosition = "5" + gSeperator + "00" + gMeasurementUnit
PrintLog "- Test Tab stops - Left"
'/// Test Tab stops - Left
Call hNewDocument
'/// Open the test file
'/// + There is 1 pic which is anchored as character in the file
Call hFileOpen(sTestFile)
Call sMakeReadOnlyDocumentEditable
'/// Format/Paragraph / Tabs ,
'/// + check Left in the type area , and input 3cm in Position
Call fFormatParagraph("TabTabulatoren")
TypLinks.Check
Position.SetText sTabs
TabTabulatoren.OK
Call wTypeKeys "<MOD1 Home>"
'/// Press TAB
Call wTypeKeys "<TAB>"
'/// Check if TAB is configurated correctly
Call wTypeKeys ( "<Shift F4>" )
FormatAnchorToPage
Sleep 1
Call fPositionAndSize("TabPositionAndSizeWriter")
if fCalculateTolerance(Horizontalby.Gettext , sPosition) > 0.02 then Warnlog "Tab type (left) doesn't work !"
TabPositionAndSizeWriter.Cancel
Call hCloseDocument
endcase
'-------------------------------------------------------------------------------------------
testcase tParagraphTabs2
Dim sTestFile as String
Dim sTabs as String
Dim sPosition as String
sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\formatparagraph\TabsTest.sxw")
sTabs = "3" + gSeperator + "00" + gMeasurementUnit
sPosition = "4" + gSeperator + "00" + gMeasurementUnit
PrintLog "- Test Tab stops - Right"
'/// Test Tab stops - Right
Call hNewDocument
'/// Open the test file
'/// + There is 1 pic which is anchored as character in the file
Call hFileOpen(sTestFile)
Call sMakeReadOnlyDocumentEditable
'/// Format/Paragraph / Tabs ,
'/// + check Right in the type area , and input 3cm in Position
Call fFormatParagraph("TabTabulatoren")
TypRechts.Check
Position.SetText sTabs
TabTabulatoren.OK
Call wTypeKeys "<MOD1 Home>"
'/// Press TAB
Call wTypeKeys "<TAB>"
'/// Check if TAB is configurated correctly
Call wTypeKeys ( "<Shift F4>" )
FormatAnchorToPage
Sleep 1
Call fPositionAndSize("TabPositionAndSizeWriter")
if fCalculateTolerance(Horizontalby.Gettext , sPosition) > 0.02 then Warnlog "Tab type (Right) doesn't work !"
TabPositionAndSizeWriter.Cancel
Call hCloseDocument
endcase
'-------------------------------------------------------------------------------------------
testcase tParagraphTabs3
Dim sTestFile as String
Dim sTabs as String
Dim sPosition as String
sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\formatparagraph\TabsTest.sxw")
sTabs = "3" + gSeperator + "00" + gMeasurementUnit
sPosition = "4" + gSeperator + "50" + gMeasurementUnit
PrintLog "- Test Tab stops - Centered"
'/// Test Tab stops - Centered
Call hNewDocument
'/// Open the test file
'/// + There is 1 pic which is anchored as character in the file
Call hFileOpen(sTestFile)
Call sMakeReadOnlyDocumentEditable
'/// Format/Paragraph / Tabs ,
'/// + check Centered in the type area , and input 3cm in Position
Call fFormatParagraph("TabTabulatoren")
TypZentriert.Check
Position.SetText sTabs
TabTabulatoren.OK
Call wTypeKeys "<MOD1 Home>"
'/// Press TAB
Call wTypeKeys "<TAB>"
'/// Check if TAB is configurated correctly
Call wTypeKeys ( "<Shift F4>" )
FormatAnchorToPage
Sleep 1
Call fPositionAndSize("TabPositionAndSizeWriter")
if fCalculateTolerance(Horizontalby.Gettext , sPosition) > 0.02 then Warnlog "Tab type (Centered) doesn't work !"
TabPositionAndSizeWriter.Cancel
Call hCloseDocument
endcase
'-------------------------------------------------------------------------------------------
testcase tParagraphTabs4
Dim sTestFile as String
Dim sTabs as String
Dim sPosition as String
sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\formatparagraph\TabsDecimal.sxw")
sTabs = "5" + gSeperator + "00" + gMeasurementUnit
sPosition = "7" + gSeperator + "11" + gMeasurementUnit
PrintLog "- Test Tab stops - Decimal"
'/// Test Tab stops - Decimal
Call hNewDocument
'/// Open the test file
'/// + There is 1 pic which is anchored as character in the file ,
'/// + and there are 1 "." seperator in front of the pic
Call hFileOpen(sTestFile)
Call sMakeReadOnlyDocumentEditable
'/// Format/Paragraph / Tabs ,
'/// + check Decimal in the type area ,
'/// + input "." in 'character' and input 5cm in 'Position'
Call fFormatParagraph("TabTabulatoren")
TypDezimal.Check
Sleep 1
TypZeichen.SetText "." 'I use seperator as '.' in this case
Position.SetText sTabs
TabTabulatoren.OK
Call wTypeKeys "<MOD1 Home>"
'/// Press TAB
Call wTypeKeys "<TAB>"
'/// Check if TAB is configurated correctly
'/// + [Check . should be at distance 5.00cm]
Call wTypeKeys ( "<Shift F4>" )
FormatAnchorToPage
Sleep 1
Call fPositionAndSize("TabPositionAndSizeWriter")
if fCalculateTolerance(Horizontalby.Gettext , sPosition) > 0.03 then Warnlog "Tab type (Decimal) doesn't work !"
TabPositionAndSizeWriter.Cancel
Call hCloseDocument
endcase
'-------------------------------------------------------------------------------------------
testcase tParagraphTabs5
Dim sTab1 , sTab2 , sTab3 as String
sTab1 = "1" + gSeperator + "00" + gMeasurementUnit
sTab2 = "2" + gSeperator + "00" + gMeasurementUnit
sTab3 = "3" + gSeperator + "00" + gMeasurementUnit
PrintLog "- Delete a selected tab stop"
'/// Delete a selected tab stop
Call hNewDocument
'/// Format/Paragraph / Tabs ,
'/// + insert 3 new tab stops
Call fFormatParagraph("TabTabulatoren")
Position.SetText sTab1
Neu.Click
Sleep 1
Position.SetText sTab2
Neu.Click
Sleep 1
Position.SetText sTab3
Neu.Click
Sleep 1
TabTabulatoren.OK
'/// Delete the selected tab stop
'/// + Select 2.00cm , and press delete key
Call fFormatParagraph("TabTabulatoren")
Position.Select 2
Sleep 2
Loeschen.Click
Sleep 2
Position.Select 1
if Position.GetSelText <> sTab1 then warnlog "should get " &sTab1 & " but get " &Position.GetSelText
Position.Select 2
if Position.GetSelText <> sTab3 then warnlog "should get " &sTab3 & " but get " &Position.GetSelText
if Position.GetItemCount <> 2 then warnlog "should only be 2 items in the listbox !"
TabTabulatoren.Cancel
Call hCloseDocument
endcase
'-------------------------------------------------------------------------------------------
testcase tParagraphTabs6
Dim sTab1 , sTab2 , sTab3 as String
sTab1 = "1" + gSeperator + "00" + gMeasurementUnit
sTab2 = "2" + gSeperator + "00" + gMeasurementUnit
sTab3 = "3" + gSeperator + "00" + gMeasurementUnit
PrintLog "- Delete all tab stops"
'/// Delete all tab stops
Call hNewDocument
'/// Format/Paragraph / Tabs ,
'/// + insert 3 new tab stops
Call fFormatParagraph("TabTabulatoren")
Position.SetText sTab1
Neu.Click
Sleep 1
Position.SetText sTab2
Neu.Click
Sleep 1
Position.SetText sTab3
Neu.Click
Sleep 1
TabTabulatoren.OK
'/// Delete all tab stops
'/// + Press 'Delete All' Key
Call fFormatParagraph("TabTabulatoren")
AlleLoeschen.Click
Sleep 2
if Position.GetItemCount <> 0 then warnlog "should be no items in the listbox !"
TabTabulatoren.Cancel
Call hCloseDocument
endcase
'-------------------------------------------------------------------------------------------
testcase tParagraphDropCaps1
Dim sTestFile as String
Dim sPositionX as String
Dim sPositionY as String
sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\formatparagraph\DropCapsTest.sxw")
sPositionX = "4" + gSeperator + "00" + gMeasurementUnit
sPositionY = "3" + gSeperator + "00" + gMeasurementUnit
PrintLog "- Test Drop Caps - Default"
'/// Test Drop Caps - Default
Call hNewDocument
'/// Open the test file
'/// + There is 1 pic which is anchored as character in the file
Call hFileOpen(sTestFile)
Call sMakeReadOnlyDocumentEditable
'/// Format/Paragraph / Drop Caps ,
'/// + Check 'Display Drop Caps' , close the dialog
Call fFormatParagraph("TabInitialen")
Anzeigen.Check
Sleep 1
if Initialentext.GetText <> "H" then
warnlog "The text is wrong : should be H , but get " &Initialentext.GetText
TabInitialen.OK
goto endsub
end if
if Zeilen.GetText <> "3" then
warnlog "The default number should be 3 lines , but get " &Zeilen.GetText
TabInitialen.OK
goto endsub
end if
TabInitialen.OK
'/// Set focus to the pic , check if its position is changed correctly
Call wTypeKeys ( "<Shift F4>" )
FormatAnchorToPage
Sleep 1
Call fPositionAndSize("TabPositionAndSizeWriter")
if fCalculateTolerance(Horizontalby.Gettext , sPositionX) > 0.4 then Warnlog "X position isn't right !"
if fCalculateTolerance(Verticalby.Gettext , sPositionY) > 0.4 then Warnlog "Y position isn't right !"
TabPositionAndSizeWriter.Cancel
Call hCloseDocument
endcase
'-------------------------------------------------------------------------------------------
testcase tParagraphDropCaps2
Dim sTestFile as String
Dim sPositionX as String
Dim sPositionY as String
sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\formatparagraph\DropCapsTest.sxw")
sPositionX = "6" + gSeperator + "00" + gMeasurementUnit
sPositionY = "3" + gSeperator + "00" + gMeasurementUnit
PrintLog "- Test Drop Caps - select a word"
'/// Test Drop Caps - select a word
Call hNewDocument
'/// Open the test file
'/// + There is 1 pic which is anchored as character in the file
Call hFileOpen(sTestFile)
Call sMakeReadOnlyDocumentEditable
'/// Format/Paragraph / Drop Caps ,
'/// + Check 'Display Drop Caps' , then check 'whole word' , then close the dialog
Call fFormatParagraph("TabInitialen")
Anzeigen.Check
Sleep 1
GanzesWort.Check
Sleep 1
if Initialentext.GetText <> "He" then
warnlog "The text is wrong : should be He , but get " &Initialentext.GetText
TabInitialen.OK
goto endsub
end if
if Zeilen.GetText <> "3" then
warnlog "The default number should be 3 lines , but get " &Zeilen.GetText
TabInitialen.OK
goto endsub
end if
TabInitialen.OK
'/// Set focus to the pic , check if its position is changed correctly
Call wTypeKeys ( "<Shift F4>" )
FormatAnchorToPage
Sleep 1
Call fPositionAndSize("TabPositionAndSizeWriter")
if fCalculateTolerance(Horizontalby.Gettext , sPositionX) > 0.4 then Warnlog "X position isn't right !"
if fCalculateTolerance(Verticalby.Gettext , sPositionY) > 0.4 then Warnlog "Y position isn't right !"
TabPositionAndSizeWriter.Cancel
Call hCloseDocument
endcase
'-------------------------------------------------------------------------------------------
testcase tParagraphDropCaps3
Dim sTestFile as String
Dim sPositionX as String
Dim sPositionY as String
sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\formatparagraph\DropCapsTest.sxw")
sPositionX = "4" + gSeperator + "50" + gMeasurementUnit
sPositionY = "4" + gSeperator + "00" + gMeasurementUnit
PrintLog "- Test Drop Caps - select different Number of characters"
'/// Test Drop Caps - select different Number of characters
Call hNewDocument
'/// Open the test file
'/// + There is 1 pic which is anchored as character in the file
Call hFileOpen(sTestFile)
Call sMakeReadOnlyDocumentEditable
'/// Format/Paragraph / Drop Caps ,
'/// + Check 'Display Drop Caps' , then set '6' in 'number of characters' ,then close the dialog
Call fFormatParagraph("TabInitialen")
Anzeigen.Check
Sleep 1
Anzahl.SetText "6"
Sleep 1
if Initialentext.GetText <> "He hea" then
warnlog "The text is wrong : should be 'He hea' , but get " &Initialentext.GetText
TabInitialen.OK
goto endsub
end if
if Zeilen.GetText <> "3" then
warnlog "The default number should be 3 lines , but get " &Zeilen.GetText
TabInitialen.OK
goto endsub
end if
TabInitialen.OK
'/// Set focus to the pic , check if its position is changed correctly
Call wTypeKeys ( "<Shift F4>" )
FormatAnchorToPage
Sleep 1
Call fPositionAndSize("TabPositionAndSizeWriter")
if fCalculateTolerance(Horizontalby.Gettext , sPositionX) > 0.4 then Warnlog "X position isn't right !"
if fCalculateTolerance(Verticalby.Gettext , sPositionY) > 0.4 then Warnlog "Y position isn't right !"
TabPositionAndSizeWriter.Cancel
Call hCloseDocument
endcase
'-------------------------------------------------------------------------------------------
testcase tParagraphDropCaps4
Dim sTestFile as String
Dim sPositionX as String
Dim sPositionY as String
sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\formatparagraph\DropCapsTest.sxw")
sPositionX = "7" + gSeperator + "50" + gMeasurementUnit
sPositionY = "2" + gSeperator + "80" + gMeasurementUnit
PrintLog "- Test Drop Caps - select different number of Lines"
'/// Test Drop Caps - select different number of Lines
Call hNewDocument
'/// Open the test file
'/// + There is 1 pic which is anchored as character in the file
Call hFileOpen(sTestFile)
Call sMakeReadOnlyDocumentEditable
'/// Format/Paragraph / Drop Caps ,
'/// + Check 'Display Drop Caps' , then set '6' in 'Lines' ,then close the dialog
Call fFormatParagraph("TabInitialen")
Anzeigen.Check
Sleep 1
Zeilen.SetText "6"
Sleep 1
if Initialentext.GetText <> "H" then
warnlog "The text is wrong : should be 'H' , but get " &Initialentext.GetText
TabInitialen.OK
goto endsub
end if
TabInitialen.OK
'/// Set focus to the pic , check if its position is changed correctly
Call wTypeKeys ( "<Shift F4>" )
FormatAnchorToPage
Sleep 1
Call fPositionAndSize("TabPositionAndSizeWriter")
if fCalculateTolerance(Horizontalby.Gettext , sPositionX) > 0.5 then Warnlog "X position isn't right !"
if fCalculateTolerance(Verticalby.Gettext , sPositionY) > 0.5 then Warnlog "Y position isn't right !"
TabPositionAndSizeWriter.Cancel
Call hCloseDocument
endcase
'-------------------------------------------------------------------------------------------
testcase tParagraphDropCaps5
Dim sTestFile as String
Dim sSpace as String
Dim sPositionX as String
Dim sPositionY as String
sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\formatparagraph\DropCapsTest.sxw")
sSpace = "1" + gSeperator + "00" + gMeasurementUnit
sPositionX = "6" + gSeperator + "00" + gMeasurementUnit
sPositionY = "3" + gSeperator + "00" + gMeasurementUnit
PrintLog "- Test Drop Caps - Set different 'Space to text'"
'/// Test Drop Caps - Set different 'Space to text'
Call hNewDocument
'/// Open the test file
'/// + There is 1 pic which is anchored as character in the file
Call hFileOpen(sTestFile)
Call sMakeReadOnlyDocumentEditable
'/// Format/Paragraph / Drop Caps ,
'/// + Check 'Display Drop Caps' ,then set 'Space to text' to be 1cm , close the dialog
Call fFormatParagraph("TabInitialen")
Anzeigen.Check
Sleep 1
AbstandZumText.SetText sSpace
if Initialentext.GetText <> "H" then
warnlog "The text is wrong : should be H , but get " &Initialentext.GetText
TabInitialen.OK
goto endsub
end if
if Zeilen.GetText <> "3" then
warnlog "The default number should be 3 lines , but get " &Zeilen.GetText
TabInitialen.OK
goto endsub
end if
TabInitialen.OK
'/// Set focus to the pic , check if its position is changed correctly
Call wTypeKeys ( "<Shift F4>" )
FormatAnchorToPage
Sleep 1
Call fPositionAndSize("TabPositionAndSizeWriter")
if fCalculateTolerance(Horizontalby.Gettext , sPositionX) > 0.4 then Warnlog "X position isn't right !"
if fCalculateTolerance(Verticalby.Gettext , sPositionY) > 0.4 then Warnlog "Y position isn't right !"
TabPositionAndSizeWriter.Cancel
Call hCloseDocument
endcase
'-------------------------------------------------------------------------------------------
testcase tParagraphDropCaps6
Dim sSpace , sMaxSpace as String
sSpace = "3" + gSeperator + "00" + gMeasurementUnit
sSpace = "2" + gSeperator + "00" + gMeasurementUnit
PrintLog "- Test max 'Space to text'"
'/// Test max 'Space to text'
Call hNewDocument
'/// Format/Paragraph / Drop Caps ,
'/// + Check 'Display Drop Caps' ,then set 'Space to text' to be 3cm , close the dialog
Call fFormatParagraph("TabInitialen")
Anzeigen.Check
Sleep 1
AbstandZumText.SetText sSpace
Sleep 1
TabInitialen.OK
'/// Reopen Format/Paragraph / Drop Caps ,
'/// + 'Space to text' should be 2cm
Call fFormatParagraph("TabInitialen")
if AbstandZumText.GetText <> sSpace then Warnlog "Max 'Space to text' should be 2cm!"
TabInitialen.Cancel
Call hCloseDocument
endcase
'-------------------------------------------------------------------------------------------
testcase tParagraphDropCaps7
Dim sTestFile as String
Dim sTestText as String
Dim sHopeResult as String
sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\formatparagraph\DropCapsTest.sxw")
sTestText = "Xyz"
sHopeResult = "Xyzhe"
PrintLog "- Test text in Contents 'Text' field"
'/// Test text in Contents "Text" field
Call hNewDocument
'/// Open the test file
'/// + There is 1 pic which is anchored as character in the file
Call hFileOpen(sTestFile)
Call sMakeReadOnlyDocumentEditable
'/// Format/Paragraph / Drop Caps ,
'/// + Check 'Display Drop Caps' ,then set Xyz in Contents 'Text' field , close the dialog
Call fFormatParagraph("TabInitialen")
Anzeigen.Check
Sleep 1
Initialentext.SetText sTestText
Sleep 1
TabInitialen.OK
'/// Check if the head of the artile is changed to be "Xyzhe"
Call wTypeKeys "<MOD1 Home>"
Call wTypeKeys "<Shift Right>" , 5
EditCopy
if GetClipboardText <> sHopeResult then
warnlog "Get the wrong result : " & GetClipboardText
end if
Call hCloseDocument
endcase
'-------------------------------------------------------------------------------------------
testcase tParagraphDropCaps8
Dim iCharacterStyle as Integer
iCharacterStyle = 3
PrintLog "- Test 'Character Style' with given template"
'/// Test 'Character Style' with given template
Call hNewDocument
'/// Format/Paragraph / Drop Caps ,
'/// + Check 'Display Drop Caps' ,then select 3rd in Contents 'Character Style' field , close the dialog
Call fFormatParagraph("TabInitialen")
Anzeigen.Check
Sleep 1
Zeichenvorlage.Select iCharacterStyle
Sleep 1
TabInitialen.OK
'/// Check if the set is OK
Call fFormatParagraph("TabInitialen")
if Zeichenvorlage.GetSelIndex <> iCharacterStyle then
warnlog "Get the wrong result : " & iCharacterStyle
end if
TabInitialen.OK
Call hCloseDocument
endcase
'-------------------------------------------------------------------------------------------
testcase tParagraphDropCaps9
Dim sCharacterStyle as String
Dim i as Integer
sCharacterStyle = "aNewTestStyle"
PrintLog "- Test 'Character Style' with user-defined template"
'/// Test 'Character Style' with user-defined template
Call hNewDocument
'/// Make a user-defined template
'/// Stylist , select 'Character Styles'
'/// Press New button to add a new character style
Call wStyleCreate ( sCharacterStyle, "Character" )
'/// Format/Paragraph / Drop Caps ,
'/// + Check 'Display Drop Caps' ,then select the character style which you just inserted
'/// + in Contents 'Character Style' field , close the dialog
Call fFormatParagraph("TabInitialen")
Anzeigen.Check
Sleep 1
Zeichenvorlage.Select sCharacterStyle
Sleep 1
TabInitialen.OK
'/// Check if the set is OK
Call fFormatParagraph("TabInitialen")
if Zeichenvorlage.GetSelText <> sCharacterStyle then
Warnlog "Get the wrong result : " & Zeichenvorlage.GetSelText
end if
TabInitialen.Cancel
'/// Delete Style
Call wStyleDelete( sCharacterStyle, "Character" )
Call hCloseDocument
endcase
'-------------------------------------------------------------------------------------------
testcase tParagraphNumbering1
Dim sTestFile as String
Dim sTest1 , sTest2 as String
Dim iNumberingStyle1 as Integer
Dim sNumberingStartWith1 as String
Dim sLineNumberingStartWith1 as String
Dim iNumberingStyle2 as Integer
Dim sNumberingStartWith2 as String
Dim sLineNumberingStartWith2 as String
sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\formatparagraph\paragraphNumbering.sxw")
sTest1 = "He1"
iNumberingStyle1 = 3
sNumberingStartWith1 = "2"
sLineNumberingStartWith1 = "3"
sTest2 = "He2"
iNumberingStyle2 = 8
sNumberingStartWith2 = "4"
sLineNumberingStartWith2 = "5"
PrintLog "- Test Numbering"
'/// Test Numbering
Call hNewDocument
'/// Open the test file ,
'/// + there are 2 paragraphes in the file
Call hFileOpen(sTestFile)
Call sMakeReadOnlyDocumentEditable
'/// Find the test word , set the focus to 1st paragraph
Call fFindWord( sTest1 )
'/// Format/Paragraph / Numbering , select 3rd in Numbering Style ,
'/// + Check "Restart at this paragraph" ,
'/// + check "Start with" in Numbering area , input 2
'/// + check "include this paragraph in line numbering" ,
'/// + check "Restart at this paragraph" in Line numbering area ,
'/// + check "Start with" in Line Numbering area , input 3
Call fFormatParagraph("TabNumerierungAbsatz")
Vorlage.Select iNumberingStyle1
Sleep 1
NumerierungNeuBeginnen.Check
Sleep 1
StartWith.Check
Sleep 1
NumerierungBeginnenBei.SetText sNumberingStartWith1
ZeilenumerierungZeilenMitzaehlen.Check
Sleep 1
ZeilenumerierungNeuBeginnen.Check
Sleep 1
ZeilenumerierungBeginnenBei.SetText sLineNumberingStartWith1
TabNumerierungAbsatz.OK
'/// Find the test word , set the focus to 2nd paragraph
Call fFindWord( sTest2 )
'/// Format/Paragraph / Numbering , select 8th in Numbering Style ,
'/// + Check "Restart at this paragraph" ,
'/// + check "Start with" in Numbering area , input 4
'/// + check "include this paragraph in line numbering" ,
'/// + check "Restart at this paragraph" in Line numbering area ,
'/// + check "Start with" in Line Numbering area , input 5
Call fFormatParagraph("TabNumerierungAbsatz")
Vorlage.Select iNumberingStyle2
Sleep 1
NumerierungNeuBeginnen.Check
Sleep 1
StartWith.Check
Sleep 1
NumerierungBeginnenBei.SetText sNumberingStartWith2
ZeilenumerierungZeilenMitzaehlen.Check
Sleep 1
ZeilenumerierungNeuBeginnen.Check
Sleep 1
ZeilenumerierungBeginnenBei.SetText sLineNumberingStartWith2
TabNumerierungAbsatz.OK
'/// Check if the configuration in paragraph1 is correct
PrintLog "- Check if the configuration in paragraph1 is correct"
Call fFindWord( sTest1 )
Call fFormatParagraph("TabNumerierungAbsatz")
if Vorlage.GetSelIndex <> iNumberingStyle1 then
Warnlog "The numbering Style is wrong , get " & Vorlage.GetSelIndex
end if
if NumerierungNeuBeginnen.IsChecked <> TRUE then
Warnlog "'Restart at this paragraph' should be checked !"
end if
if StartWith.IsChecked <> TRUE then
Warnlog "'Start with' in Numbering area should be checked !"
end if
if NumerierungBeginnenBei.GetText <> sNumberingStartWith1 then
Warnlog "'Start with' in Numbering area is wrong , get " & NumerierungBeginnenBei.GetText
end if
if ZeilenumerierungZeilenMitzaehlen.IsChecked <> TRUE then
Warnlog "'include this paragraph in line numbering' should be checked!"
end if
if ZeilenumerierungNeuBeginnen.IsChecked <> TRUE then
Warnlog "'Restart at this paragraph' in Line numbering area should be checked!"
end if
if ZeilenumerierungBeginnenBei.GetText <> sLineNumberingStartWith1 then
Warnlog "'Restart at this paragraph' in Line numbering area is wrong , get " & ZeilenumerierungBeginnenBei.GetText
end if
TabNumerierungAbsatz.Cancel
'/// Check if the configuration in paragraph2 is correct
PrintLog "- Check if the configuration in paragraph2 is correct"
Call fFindWord( sTest2 )
Call fFormatParagraph("TabNumerierungAbsatz")
if Vorlage.GetSelIndex <> iNumberingStyle2 then
Warnlog "The numbering Style is wrong , get " & Vorlage.GetSelIndex
end if
if NumerierungNeuBeginnen.IsChecked <> TRUE then
Warnlog "'Restart at this paragraph' should be checked !"
end if
if StartWith.IsChecked <> TRUE then
Warnlog "'Start with' in Numbering area should be checked !"
end if
if NumerierungBeginnenBei.GetText <> sNumberingStartWith2 then
Warnlog "'Start with' in Numbering area is wrong , get " & NumerierungBeginnenBei.GetText
end if
if ZeilenumerierungZeilenMitzaehlen.IsChecked <> TRUE then
Warnlog "'include this paragraph in line numbering' should be checked!"
end if
if ZeilenumerierungNeuBeginnen.IsChecked <> TRUE then
Warnlog "'Restart at this paragraph' in Line numbering area should be checked!"
end if
if ZeilenumerierungBeginnenBei.GetText <> sLineNumberingStartWith2 then
Warnlog "'Restart at this paragraph' in Line numbering area is wrong , get " & ZeilenumerierungBeginnenBei.GetText
end if
TabNumerierungAbsatz.Cancel
Call hCloseDocument
endcase
'-------------------------------------------------------------------------------------------
testcase tParagraphBorder1
Dim sSpacingToContentsNoBorder as String 'no border in the page
Dim sSpacingToContentsYesBorder as String 'border exists in the page
sSpacingToContentsNoBorder = "0" + gSeperator + "00" + gMeasurementUnit
sSpacingToContentsYesBorder = "0" + gSeperator + "05" + gMeasurementUnit
PrintLog "Test Default borders"
'/// <b> Test Default borders </b> ///
PrintLog "- when no border is set, 'spacing to contents'"
'/// 1. When no border is set ///
Call hNewDocument
'/// Check if "spacing to contents" is unable ///
'/// format/Paragraph , tabpage borders
Call fFormatParagraph("TabUmrandung")
if Links.GetText <> sSpacingToContentsNoBorder then
Warnlog "Default of left Spacing to contents is wrong !"
end if
if Rechts.GetText <> sSpacingToContentsNoBorder then
Warnlog "Default of right Spacing to contents is wrong !"
end if
if Oben.GetText <> sSpacingToContentsNoBorder then
Warnlog "Default of up Spacing to contents is wrong !"
end if
if Unten.GetText <> sSpacingToContentsNoBorder then
Warnlog "Default of bottom Spacing to contents is wrong !"
end if
TabUmrandung.Cancel
PrintLog "Check if 'spacing to contents' is 0.05cm when there are borders in the paragraph"
'/// 2. Check if "spacing to contents" is 0.05cm when there are borders in the paragraph ///
'/// format/Paragraph , tabpage borders ///
'/// + select 2nd in Default area ///
Call fFormatParagraph("TabUmrandung")
Vorgaben.TypeKeys "<Right>" , 2
Sleep 2
if Links.GetText <> sSpacingToContentsYesBorder then
Warnlog "Default of left Spacing to contents is wrong !"
end if
if Rechts.GetText <> sSpacingToContentsYesBorder then
Warnlog "Default of right Spacing to contents is wrong !"
end if
if Oben.GetText <> sSpacingToContentsYesBorder then
Warnlog "Default of up Spacing to contents is wrong !"
end if
if Unten.GetText <> sSpacingToContentsYesBorder then
Warnlog "Default of bottom Spacing to contents is wrong !"
end if
TabUmrandung.Cancel
Call hCloseDocument
endcase
'-------------------------------------------------------------------------------------------
testcase tParagraphBorder2
Dim sSpacingToContents as String 'the max spacing to content
Dim sSpacingToContentsL as String
Dim sSpacingToContentsR as String
Dim sSpacingToContentsU as String
Dim sSpacingToContentsB as String
sSpacingToContents = "5" + gSeperator + "00" + gMeasurementUnit
sSpacingToContentsL = "6" + gSeperator + "00" + gMeasurementUnit
sSpacingToContentsR = "7" + gSeperator + "00" + gMeasurementUnit
sSpacingToContentsU = "8" + gSeperator + "00" + gMeasurementUnit
sSpacingToContentsB = "9" + gSeperator + "00" + gMeasurementUnit
PrintLog "- All 'spacing to contents' spin boxes are limited to 5cm"
'///<b> All "spacing to contents" spin boxes are limited to 5cm </b>///
Call hNewDocument
'/// format/Page , tabpage borders , ///
'/// + set border exists in the paragraph ///
'/// + set all spacing to content's size ///
'/// + more than 5.00cm ///
Call fFormatParagraph("TabUmrandung")
Vorgaben.TypeKeys "<Right>" , 2
Sleep 2
Synchronisieren.Uncheck
Sleep 1
Links.SetText sSpacingToContentsL
Rechts.SetText sSpacingToContentsR
Oben.SetText sSpacingToContentsU
Unten.SetText sSpacingToContentsB
TabUmrandung.OK
'/// Check if all "spacing to contents" is 5.00cm ///
Call fFormatParagraph("TabUmrandung")
if Links.GetText <> sSpacingToContents then
Warnlog "left Spacing to contents is wrong !"
end if
if Rechts.GetText <> sSpacingToContents then
Warnlog "right Spacing to contents is wrong !"
end if
if Oben.GetText <> sSpacingToContents then
Warnlog "up Spacing to contents is wrong !"
end if
if Unten.GetText <> sSpacingToContents then
Warnlog "bottom Spacing to contents is wrong !"
end if
TabUmrandung.Cancel
Call hCloseDocument
endcase
'-------------------------------------------------------------------------------------------
testcase tParagraphBorder3
Dim sSpacingToContentsL as String
Dim sSpacingToContentsR as String
Dim sSpacingToContentsU as String
Dim sSpacingToContentsB as String
sSpacingToContentsL = "0" + gSeperator + "50" + gMeasurementUnit
sSpacingToContentsR = "0" + gSeperator + "60" + gMeasurementUnit
sSpacingToContentsU = "0" + gSeperator + "70" + gMeasurementUnit
sSpacingToContentsB = "0" + gSeperator + "80" + gMeasurementUnit
PrintLog "- Test Uncheck 'Synchronize'"
'///<b> Test Uncheck 'Synchronize' </b>///
Call hNewDocument
'/// format/Page , tabpage borders , ///
'/// + set border exists in the paragraph ///
'/// + Uncheck synchronize ///
'/// + Set all spacing to contents ///
Call fFormatParagraph("TabUmrandung")
Vorgaben.TypeKeys "<Right>" , 2
Sleep 2
Synchronisieren.Uncheck
Sleep 1
Links.SetText sSpacingToContentsL
Rechts.SetText sSpacingToContentsR
Oben.SetText sSpacingToContentsU
Unten.SetText sSpacingToContentsB
TabUmrandung.OK
'/// + Check if all "spacing to contents" is correct
Call fFormatParagraph("TabUmrandung")
if Links.GetText <> sSpacingToContentsL then
Warnlog "left Spacing to contents is wrong !"
end if
if Rechts.GetText <> sSpacingToContentsR then
Warnlog "right Spacing to contents is wrong !"
end if
if Oben.GetText <> sSpacingToContentsU then
Warnlog "up Spacing to contents is wrong !"
end if
if Unten.GetText <> sSpacingToContentsB then
Warnlog "bottom Spacing to contents is wrong !"
end if
TabUmrandung.Cancel
Call hCloseDocument
endcase
'-------------------------------------------------------------------------------------------
testcase tParagraphBorder4
Dim sSpacingToContentsL as String
Dim sSpacingToContentsR as String
Dim sSpacingToContentsU as String
Dim sSpacingToContentsB as String
sSpacingToContentsL = "0" + gSeperator + "50" + gMeasurementUnit
sSpacingToContentsR = "0" + gSeperator + "60" + gMeasurementUnit
sSpacingToContentsU = "0" + gSeperator + "70" + gMeasurementUnit
sSpacingToContentsB = "0" + gSeperator + "80" + gMeasurementUnit
PrintLog "- Test Check 'Synchronize'"
'/// <b> Test Check 'Synchronize' </b> ///
Call hNewDocument
'/// format/Page , tabpage borders , ///
'/// + set border exists in the paragraph ///
'/// + check synchronize ///
'/// + Set all spacing to contents ///
Call fFormatParagraph("TabUmrandung")
Vorgaben.TypeKeys "<Right>" , 2
Sleep 2
Synchronisieren.Check
Sleep 1
Links.SetText sSpacingToContentsL
Rechts.SetText sSpacingToContentsR
Oben.SetText sSpacingToContentsU
Unten.SetText sSpacingToContentsB
TabUmrandung.OK
'/// + Check if all "spacing to contents" is correct
Call fFormatParagraph("TabUmrandung")
if Links.GetText <> sSpacingToContentsB then
Warnlog "left Spacing to contents is wrong !"
end if
if Rechts.GetText <> sSpacingToContentsB then
Warnlog "right Spacing to contents is wrong !"
end if
if Oben.GetText <> sSpacingToContentsB then
Warnlog "up Spacing to contents is wrong !"
end if
if Unten.GetText <> sSpacingToContentsB then
Warnlog "bottom Spacing to contents is wrong !"
end if
TabUmrandung.Cancel
Call hCloseDocument
endcase
'-------------------------------------------------------------------------------------------
testcase tParagraphBorder5
Dim sDefaultShadowColor as String
Select case iSprache
case 01 : sDefaultShadowColor = "Gray"
case 31: sDefaultShadowColor = "Grijs"
case 33 : sDefaultShadowColor = "Gris"
case 34 : sDefaultShadowColor = "Gris"
case 39 : sDefaultShadowColor = "Grigio"
case 46 : sDefaultShadowColor = "Grått"
case 49 : sDefaultShadowColor = "Grau"
case 55 : sDefaultShadowColor = "Cinza"
case 81 : sDefaultShadowColor = "灰色"
case 82 : sDefaultShadowColor = "회색"
case 86 : sDefaultShadowColor = "灰色"
case 88 : sDefaultShadowColor = "灰色"
case else : QAErrorLog "The test does not support the language " + iSprache
Goto endsub
end select
PrintLog "- Test default shadow color"
'/// <b> Test default shadow color </b>///
Call hNewDocument
'/// + format/Paragraph , tabpage borders
'/// + Check if the default shadow color is gray
Call fFormatParagraph("TabUmrandung")
if SchattenFarbe.GetSelText <> sDefaultShadowColor then
Warnlog "Shadow default color is wrong , get " & SchattenFarbe.GetSelText
end if
TabUmrandung.Cancel
Call hCloseDocument
endcase
'-------------------------------------------------------------------------------------------
testcase tParagraphBorder6
Dim iBorderColor , iShadowColor as Integer
Dim sShadowDistance as String
iBorderColor = 5 : iShadowColor = 4
sShadowDistance = "0" + gSeperator + "40" + gMeasurementUnit
PrintLog "- Test shadow setting"
'/// <b> Test shadow setting </b>///
Call hNewDocument
'/// Format/Paragraph , tabpage borders , do some configuration => ///
'/// + select 2nd border in default , select 5th border color ,///
'/// + select 5th shadow , select 4th shadow color , set shadow distance to 0.40cm ///
'/// + and close the dialog ///
Call fFormatParagraph("TabUmrandung")
Vorgaben.TypeKeys "<Right>" , 2
Sleep 2
StilFarbe.Select iBorderColor 'set border color
Position.TypeKeys "<Right>" , 4
Sleep 2
Groesse.SetText sShadowDistance
SchattenFarbe.Select iShadowColor 'set shadow color
Sleep 1
TabUmrandung.OK
'/// + format/Page , check if the configuration is all right
Call fFormatParagraph("TabUmrandung")
if StilFarbe.GetSelIndex <> iBorderColor then Warnlog "border color is wrong !"
if Groesse.GetText <> sShadowDistance then Warnlog "shadow distance is wrong !"
if SchattenFarbe.GetSelindex <> iShadowColor then Warnlog "shadow color is wrong !"
TabUmrandung.Cancel
Call hCloseDocument
endcase
|