summaryrefslogtreecommitdiff
path: root/testautomation/writer/optional/includes/redlining/w_redlining1.inc
blob: b08faaf6d8d83302fb1fcd8c22f6bf49a2521a24 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
'encoding UTF-8  Do not remove or change this line!
'**************************************************************************
' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
'
' Copyright 2000, 2010 Oracle and/or its affiliates.
'
' OpenOffice.org - a multi-platform office productivity suite
'
' 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@oracle.com
'*
'* short description : Test of the Redlinig function - 1
'*
'************************************************************************
'*
' #1 tRedlining_1      'Test Default settings
' #1 tRedlining_2      'Inserted text : from Typing
' #1 tRedlining_3      'Inserted text : from Clipboard
' #1 tRedlining_4      'Inserted text : from another file
' #1 tRedlining_5      'Inserted text : from Autotext
' #1 tRedlining_6      'Deleteed text
' #1 tRedlining_7      'sorted text
' #1 tRedlining_8      'Searched and replaced text
' #1 tRedlining_9      'text attributs
' #1 tRedlining_10     'Inserted Section
' #1 tRedlining_11     'Inserted Table
' #1 tRedlining_12     'Inserted field (Date)
' #1 tRedlining_13     'Inserted footnotes
' #1 tRedlining_14     'Inserted headers
' #1 tRedlining_15     'Inserted footers
' #1 tRedlining_16     'moved paragraphs/chapters
'*
'\***********************************************************************

testcase tRedlining_1

  Dim iInsertionAttr as Integer
  Dim iInsertionColor as Integer
  Dim iDeletionAttr as Integer
  Dim iDeletionColor as Integer
  Dim iChangedAttr as Integer
  Dim iChangedColor as Integer
  Dim iLineChangedMark as Integer
  Dim iLineChangedColor as Integer

  iInsertionAttr   = 4  :  iInsertionColor   = 2
  iDeletionAttr    = 4  :  iDeletionColor    = 2
  iChangedAttr     = 2  :  iChangedColor     = 2
  iLineChangedMark = 2  :  iLineChangedColor = 1

  Call hNewDocument

  PrintLog "- Test Default settings"
  '/// Test Default settings

  '/// The default setting for Redlining is Off
   Call wTypeKeys "Redlining test"
   Call wTypeKeys "<Backspace>",2
   Sleep 1
   Call wTypeKeys "<End>"
   Call wTypeKeys "<Shift Left>" , 4
   EditCopy
   if GetClipboardText <> "g te" then Warnlog "The default setting for Redlining is NO Off"

  '/// Tools / Options / Textdocument / Changes
   ToolsOptions
   Call hToolsOptions("WRITER","CHANGES")

  '/// Check default settings

  '/// 1) Insertion Attributes , Insertion color
   if EinfuegenAttribute.GetSelIndex <> iInsertionAttr  then
      warnlog "The default settings for Insertion Attribute isn't correct, should be " +  EinfuegenAttribute.GetItemText(iInsertionAttr) + " but get " +EinfuegenAttribute.GetItemText(EinfuegenAttribute.GetSelIndex)
   end if
   if EinfuegenFarbe.GetSelIndex <> iInsertionColor  then
      warnlog "The default settings for Insertion color isn't correct, should be " +  EinfuegenFarbe.GetItemText(iInsertionColor) + " but get " +EinfuegenFarbe.GetItemText(EinfuegenFarbe.GetSelIndex)
   end if

  '/// 2) Deletion Attribute , Deletion color
   if LoeschenAttribute.GetSelIndex <> iDeletionAttr  then
      warnlog "The default settings for Deletion Attribute isn't correct, should be " +  LoeschenAttribute.GetItemText(iDeletionAttr) + " but get " +LoeschenAttribute.GetItemText(LoeschenAttribute.GetSelIndex)
   end if
   if LoeschenFarbe.GetSelIndex <> iDeletionColor  then
      warnlog "The default settings for Deletion color isn't correct, should be " +  LoeschenFarbe.GetItemText(iDeletionColor) + " but get " +LoeschenFarbe.GetItemText(LoeschenFarbe.GetSelIndex)
   end if

  '/// 3) Changed Attribute  , Changed  color
   if AendernAttribute.GetSelIndex <> iChangedAttr  then
      warnlog "The default settings for Changed Attribute isn't correct, should be " +  AendernAttribute.GetItemText(iChangedAttr) + " but get " +AendernAttribute.GetItemText(AendernAttribute.GetSelIndex)
   end if
   if AendernFarbe.GetSelIndex <> iChangedColor  then
      warnlog "The default settings for Changed color isn't correct, should be " +  AendernFarbe.GetItemText(iChangedColor) + " but get " +AendernFarbe.GetItemText(AendernFarbe.GetSelIndex)
   end if

  '/// 4) Lines changed Mark  , Lines changed color
   if ZeilenMarkierung.GetSelIndex <> iLineChangedMark  then
      warnlog "The default settings for Lines Changed Mark isn't correct, should be " +  ZeilenMarkierung.GetItemText(iLineChangedMark) + " but get " +ZeilenMarkierung.GetItemText(ZeilenMarkierung.GetSelIndex)
   end if
   if ZeilenFarbe.GetSelIndex <> iLineChangedColor  then
      warnlog "The default settings for Lines Changed color isn't correct, should be " +  ZeilenFarbe.GetItemText(iLineChangedColor) + " but get " +ZeilenFarbe.GetItemText(ZeilenFarbe.GetSelIndex)
   end if

  '/// Close the tools/option dialogue
    Kontext "ExtrasOptionenDlg"
   ExtrasOptionenDlg.Cancel

   Call hCloseDocument

endcase

'-------------------------------------------------------------------------------------------

testcase tRedlining_2

  '/// Test Inserted text : from Typing
  printlog "Inserted text : from Typing"

   '/// New document
   Call hNewDocument

   '/// Insert any sentence into document
   Call wTypeKeys "Redlining test => OK_1<Return>"

   UseBindings
   '/// Edit / Changes / Record
   EditChangesRecord

   '/// Insert some new sentence
   Call wTypeKeys "Redlining test => OK_2<Return>"

   '/// Edit / Changes / Accept or Reject
   EditChangesAcceptOrReject
   Kontext "Redlining"
   '/// + Select tabpage 'List' ///
   TabControl.SetPage TabListe
   '/// + Select 'Accept All'///
   AlleAkzeptieren.Click
   Sleep 2
   '/// + Close Redlining dialog
   Redlining.Close

   '/// Check if the changes have been accepted
   Call wTypeKeys "<Up>", 2
   Call wTypeKeys "<Down>"
   Call wTypeKeys "<End>"
   Call wTypeKeys "<Shift Left>"
   EditCopy
   Sleep 1
   if GetClipboardText <> "2" then Warnlog "The 2nd line is incorrect!"

   '/// Close the document
   Call hCloseDocument

endcase

'--------------------------------------------------------------------------

testcase tRedlining_3

  '/// Test Inserted text : from Clipboard
  printlog "Inserted text : from Clipboard"

   '/// New document
   Call hNewDocument

   '/// Insert any sentence into document , and copy it to clipboard
   Call wTypeKeys "Redlining test => OK_2<Return>"
   EditSelectAll
   EditCopy
   Sleep 1

   '/// Insert a new sentence into document
   Call wTypeKeys "Redlining test => OK_1<Return>"

   UseBindings
   '/// Edit / Changes / Record
   EditChangesRecord

   '/// copy the clipboard into the document
   EditPaste
   Sleep 1

   '/// Edit / Changes / Accept or Reject
   EditChangesAcceptOrReject
   Kontext "Redlining"
   '/// + Select tabpage 'List' ///
   TabControl.SetPage TabListe
   '/// + Select 'Accept All'///
   AlleAkzeptieren.Click
   Sleep 2
   '/// + Close Redlining dialog
   Redlining.Close

   '/// Check if the changes have been accepted
   Call wTypeKeys "<Up>", 2
   Call wTypeKeys "<Down>"
   Call wTypeKeys "<End>"
   Call wTypeKeys "<Shift Left>"
   EditCopy
   Sleep 1
   if GetClipboardText <> "2" then Warnlog "The 2nd Line is incorrect!"

   '/// Close the document
   Call hCloseDocument

endcase

'----------------------------------------------------------------------------

testcase tRedlining_4

  '/// Test Inserted text : from another file
  printlog "Inserted text : from another file"

   '/// New document
   Call hNewDocument

   '/// Insert a sentence into document
   Call wTypeKeys "Redlining test => OK_1<Return>"

   UseBindings
   '/// Edit / Changes / Record
   EditChangesRecord

   '/// insert a file - Insert/File
   InsertFileWriter
   Kontext "OeffnenDlg"
   Dateiname.Settext Convertpath (gTesttoolpath + "writer\optional\input\redlining\tRedlining_4.sxw")
   Oeffnen.Click
   Sleep 2

   '/// Edit / Changes / Accept or Reject
   EditChangesAcceptOrReject
   Kontext "Redlining"
   '/// + Select tabpage 'List' ///
   TabControl.SetPage TabListe
   '/// + Select 'Accept All'///
   AlleAkzeptieren.Click
   Sleep 2
   '/// + Close Redlining dialog
   Redlining.Close

   '/// Check if the changes have been accepted
   Call wTypeKeys "<Up>", 2
   Call wTypeKeys "<Down>"
   Call wTypeKeys "<End>"
   Call wTypeKeys "<Shift Left>"
   EditCopy
   Sleep 1
   if GetClipboardText <> "2" then Warnlog "i35222 - The 2nd Line is incorrect!"

   '/// Close the document
   Call hCloseDocument

endcase

'----------------------------------------------------------------------------

testcase tRedlining_5

    Dim j as Integer
    Dim iAll as Integer

    '/// Test Inserted text : from Autotext
    printlog "Inserted text : from Autotext"

    '/// New document
    Call hNewDocument

    'insert a category
    Call wCreateAutotextCategory("1-MyTest")
    
    Kontext "Autotext"
    Autotext.Close

    'insert a autotext
    '-----------------------------------------------------
    Call wTypeKeys "Redlining test => OK_2<Return>"
    Sleep 1
    EditSelectAll
    Sleep 1

    EditAutotext
    Sleep 2
    Kontext "Autotext"
    Sleep 1
    Liste.Select 1   '1-MyTest'
    Sleep 1

    'Insert a name for the Autotext and a Shortcut
    NameText.Settext "AutotextForRedlininggTest"
    Sleep 1
    Kuerzel.Settext "AFT"

    'Select 'New' in Menubutton 'Autotext'
    Sleep 2
    Menue.Click
    Sleep 2
    Call hMenuSelectNr ( 1 )
    Sleep 2

    Autotext.Close
    '-----------------------------------------------------

    '/// Insert a sentence into document
    Kontext "DocumentWriter"
    EditSelectAll
    Call wTypeKeys "Redlining test => OK_1<Return>"

    UseBindings
    '/// Edit / Changes / Record
    EditChangesRecord

    '/// Insert autotext
    Call wTypeKeys "AFT"
    Call wTypeKeys "<F3>"
    Sleep 1

    '/// Edit / Changes / Accept or Reject
    EditChangesAcceptOrReject
    Kontext "Redlining"
    '/// Select tabpage 'List' ///
    TabControl.SetPage TabListe
    '/// Select 'Accept All'///
    AlleAkzeptieren.Click
    Sleep 2
    '/// Close Redlining dialog
    Redlining.Close

    '/// Check if the changes have been accepted
    Call wTypeKeys "<Up>", 2
    Call wTypeKeys "<Down>"
    Call wTypeKeys "<End>"
    Call wTypeKeys "<Shift Left>"
    EditCopy
    Sleep 1
    if GetClipboardText <> "2" then Warnlog "The 2nd Line is incorrect!"
    
    ' Delete the new category
    ' ------------------------------------------------
    EditAutotext
    Sleep 2
    Kontext "Autotext"
    Sleep 1
    Bereiche.Click
    Sleep 5
    Kontext "BereicheBearbeitenAutoText"
    Liste.Select 1
    Sleep 2
    Loeschen.Click
    Sleep 5
    BereicheBearbeitenAutoText.OK
    Sleep 2
    Kontext "Active"
    if Active.Exists then Active.Yes
    Kontext "Autotext"
    Autotext.Close
    '-------------------------------------------------
    
    '/// Close the document
    Call hCloseDocument

endcase

'----------------------------------------------------------------------------

testcase tRedlining_6

  '/// Test Deleted text
  printlog "Deleted text"

   '/// New document
   Call hNewDocument

   '/// Insert a sentence into document
   Call wTypeKeys "Redlining test => OK_1"

   UseBindings
   '/// Edit / Changes / Record
   EditChangesRecord

   '/// Delete the last 2 characters
   Call wTypeKeys "<Backspace>",2
   Sleep 1

   '/// Check if the changes is OK => The characters are deleted ,
   '/// + but their location exists
   Call wTypeKeys "<End>"
   Sleep 1
   Call wTypeKeys "<Shift Left>" , 2
   Sleep 1

   Editcopy
   if Len(GetClipboardText)>0 then Warnlog "Something is wrong in deleting text before accepting the changes!"

   '/// Edit / Changes / Accept or Reject
   EditChangesAcceptOrReject
   Sleep 2
   Kontext "Redlining"
   Sleep 1
   '/// + Select tabpage 'List' ///
   TabControl.SetPage TabListe
   Sleep 2
   '/// + Select 'Accept All'///
   AlleAkzeptieren.Click
   Sleep 2
   '/// + Close Redlining dialog
   Redlining.Close

   '/// Check if the changes have been accepted => The
   '/// + characters are deleted , and their location doesn't exist
   Call wTypeKeys "<End>"
   Sleep 1
   Call wTypeKeys "<Shift Left>" , 2
   Sleep 1

   EditCopy
   Sleep 1
   if GetClipboardText <> "OK" then Warnlog "Something is wrong in deleting text after accepting the changes! Getting " + GetClipboardText

   '/// Close the document
   Call hCloseDocument

endcase

'----------------------------------------------------------------------------

testcase tRedlining_7

    '/// Test sorted text
    printlog "sorted text"
    
    '/// New document
    Call hNewDocument
    
    '/// Insert some test text
    Call wTypeKeys "XYZ<Return>"
    Call wTypeKeys "ABC"
    
    UseBindings
    '/// Edit / Changes / Record
    EditChangesRecord
    
    '/// Select Tools / Sort , Language (English USA) , Alphanumeric
    EditSelectAll
    ToolsSort
    Kontext "Sortieren"
    Schluesseltyp1.Select 1
    Aufsteigend1.Check
    Sortieren.OK
    
    '/// Check if the changes is OK => The characters are changed ,
    '/// + but their location exists
    Call wTypeKeys "<Down>" , 4
    Call wTypeKeys "<End>"
    Call wTypeKeys "<Shift Home>"
    EditCopy
    if Len(GetClipboardText)>0 then Warnlog "Something is wrong in sorting text before accepting the changes!"
    
    Call wTypeKeys "<Up>" , 4
    Call wTypeKeys "<End>"
    Call wTypeKeys "<Shift Home>"
    EditCopy
    if GetClipboardText <> "ABC" then Warnlog "Should get ABC in the first line, but get " +GetClipboardText + "  before accepting the changes!"
    
    '/// Edit / Changes / Accept or Reject
    EditChangesAcceptOrReject
    Sleep 2
    Kontext "Redlining"
    '/// + Select tabpage 'List' ///
    TabControl.SetPage TabListe
    Sleep 2
    '/// + Select 'Accept All'///
    AlleAkzeptieren.Click
    Sleep 2
    '/// + Close Redlining dialog
    Redlining.Close
    
    '/// Check if the changes have been accepted => The characters
    '/// + are changed , and their location doesn't exist
    Call wTypeKeys "<Down>" , 4
    Call wTypeKeys "<End><Backspace>"
    Call wTypeKeys "<Shift Home>"
    EditCopy
    if Len(GetClipboardText) <> 3 then Warnlog "Something is wrong in sorting text after accepting the changes!"
    
    Call wTypeKeys "<Up>" , 4
    Call wTypeKeys "<End>"
    Call wTypeKeys "<Shift Home>"
    EditCopy
    if GetClipboardText <> "ABC" then Warnlog "Should get ABC in the first line, but get " +GetClipboardText + "  after accepting the changes!"
    
    '/// Close the document
    Call hCloseDocument
    
endcase

'----------------------------------------------------------------------------

testcase tRedlining_8

  '/// Test searched and replaced text
  printlog "searched and replaced text"

   '/// New document
   Call hNewDocument

   '/// Insert a sentence into document
   Call wTypeKeys "Redlining test => OK_1"

   UseBindings
   '/// Edit / Changes / Record
   EditChangesRecord

   '/// Select Edit / Find & Replace
   EditSearchAndReplace
   Kontext "FindAndReplace"

   '/// + Set OK_1 in search for editbox
   SearchFor.SetText "OK_1"
   Sleep 2

   '/// + set OK_2 in replace with editbox
   ReplaceWith.SetText "OK_2"
   Sleep 2

   '/// + Replace all and close the dialogue
   ReplaceAll.Click
   sleep 2
   Kontext "Active"
   if Active.Exists then
      if Active.GetRT = 304 then
         Active.OK
         Sleep 1
      else
         Warnlog "Messagebox, how often replaced, not up !"
      end if
   end if

   Kontext "FindAndReplace"
   FindAndReplace.close

   '/// Check if the changes is OK => The characters are changed ,
   '/// + but their location exists
   Call wTypeKeys "<End>"
   wait 500
   Call wTypeKeys "<Shift Left>"
   wait 500
   Editcopy
   wait 500
   if GetClipboardText <> "2" then Warnlog "Something is wrong in changing text before accepting the changes!"

   Call wTypeKeys "<Left>" , 3
   Sleep 1
   Call wTypeKeys "<Shift Left>" , 4
   Sleep 1
   Editcopy
   wait 500
   if Len(GetClipboardText) > 0 then Warnlog "Something is wrong in changing text before accepting the changes!"

   '/// Edit / Changes / Accept or Reject
   EditChangesAcceptOrReject
   Sleep 2
   Kontext "Redlining"
   Sleep 2
   '/// + Select tabpage 'List' ///
   TabControl.SetPage TabListe
   Sleep 2
   '/// + Select 'Accept All'///
   AlleAkzeptieren.Click
   Sleep 2
   '/// + Close Redlining dialog
   Redlining.Close

   '/// Check if the changes have been accepted => The characters
   '/// + are changed , and their location doesn't exist
   Call wTypeKeys "<End>"
   Call wTypeKeys "<Shift Left>"

   EditCopy
   Sleep 1
   if GetClipboardText <> "2" then Warnlog "Something is wrong in changing text after accepting the changes!"

   Call wTypeKeys "<Left>" , 3
   Sleep 1
   Call wTypeKeys "<Shift Left>" , 4
   Sleep 1
   Editcopy
   if Len(GetClipboardText) <> 4 then Warnlog "Something is wrong in changing text after accepting the changes!"

   '/// Close the document
   Call hCloseDocument

endcase

'----------------------------------------------------------------------------

testcase tRedlining_9

	Dim iComparison1$,iComparison2$,iComparison3$,iComparison4$
	
	'/// Test text attributs
	printlog "Test text attributs"
	
	'/// New document
	Call hNewDocument
	
	'/// Insert a sentence into document
	Call wTypeKeys "Redlining test => OK_1<Home>"
	Call wTypeKeys "<Shift Right>" , 9
	Sleep 1
	
	UseBindings
	'/// Edit / Changes / Record
	EditChangesRecord
	
	'/// Select Format / Character , changes some font Attributes
	FormatCharacter
	Kontext
	Active.SetPage TabFont
	kontext "TabFont"
	
	if gAsianSup = True then
		FontWest.Select  5
		iComparison1$ = FontWest.GetSelText
		try
            StyleWest.Select 3
        catch
            StyleWest.Select StyleWest.GetItemCount
        endcatch            
		iComparison2$ = StyleWest.GetSelText
		SizeWest.Select  5
		iComparison3$ = SizeWest.GetSelText
	else
		Font.Select  5
		iComparison1$ = Font.GetSelText
		try
            Style.Select 3
        catch
            Style.Select Style.GetItemCount
        endcatch
		iComparison2$ = Style.GetSelText
		Size.Select  5
		iComparison3$ = Size.GetSelText
	end if
	wait 100
	Kontext
	Active.Setpage TabHyperlinkZeichen
	Kontext "TabHyperlinkZeichen"
	UrlName.Settext "http://www.sun.com/"
	Sleep 1
	TargetFrame.Select 2
	Sleep 1
	iComparison4$ = TargetFrame.GetSelText
	wait 500
	TabHyperlinkZeichen.Ok
	
	Sleep 1
	Call wTypeKeys "<Left>"  , 2
	Sleep 1
	
	'/// Check if the Attribute changes id OK before accepting the changes
	printlog "Check if the Attribute changes id OK before accepting the changes"
	FormatCharacter
	Kontext
	Active.SetPage TabFont
	Kontext "TabFont"
	if gAsianSup = True then
		if iComparison1$ <> FontWest.GetSelText  then Warnlog "Wrong Font in Autotext!"
		if iComparison2$ <> StyleWest.GetSelText then Warnlog "Wrong Fontstyle in Autotext!"
		if iComparison3$ <> SizeWest.GetSelText  then QAErrorlog "#108881#Wrong Fontsize in Autotext!"
	else
		if iComparison1$ <> Font.GetSelText  then Warnlog "Wrong Font in Autotext!"
		if iComparison2$ <> Style.GetSelText then Warnlog "Wrong Fontstyle in Autotext!"
		if iComparison3$ <> Size.GetSelText  then Warnlog "Wrong Fontsize in Autotext!"
	end if
	wait 100
	Kontext
	Active.Setpage TabHyperlinkZeichen
	Kontext "TabHyperlinkZeichen"
	if UrlName.Gettext <> "http://www.sun.com/"  then Warnlog "Wrong hyperlink has been added to text!"
	if iComparison4$   <> TargetFrame.GetSelText then Warnlog "Wrong targetFrame has been added to text!"
	TabHyperlinkZeichen.Cancel
	
	'/// Edit / Changes / Accept or Reject
	EditChangesAcceptOrReject
	Kontext "Redlining"
	'/// + Select tabpage 'List' ///
	TabControl.SetPage TabListe
	'/// + Select 'Accept All'///
	AlleAkzeptieren.Click
	Sleep 2
	'/// + Close Redlining dialog
	Redlining.Close
	
	'/// Check if the Attribute changes id OK after accepting the changes
	printlog "Check if the Attribute changes id OK after accepting the changes"
	FormatCharacter
	Kontext
	Active.SetPage TabFont
	Kontext "TabFont"
	if gAsianSup = True then
		if iComparison1$ <> FontWest.GetSelText  then Warnlog "Wrong Font in Autotext!"
		if iComparison2$ <> StyleWest.GetSelText then Warnlog "Wrong Fontstyle in Autotext!"
		if iComparison3$ <> SizeWest.GetSelText  then QAErrorlog "#108881#Wrong Fontsize in Autotext!"
	else
		if iComparison1$ <> Font.GetSelText  then Warnlog "Wrong Font in Autotext!"
		if iComparison2$ <> Style.GetSelText then Warnlog "Wrong Fontstyle in Autotext!"
		if iComparison3$ <> Size.GetSelText  then Warnlog "Wrong Fontsize in Autotext!"
	end if
	wait 100
	Kontext
	Active.Setpage TabHyperlinkZeichen
	Kontext "TabHyperlinkZeichen"
	if UrlName.Gettext <> "http://www.sun.com/"   then Warnlog "Wrong hyperlink has been added to text!"
	if iComparison4$   <> TargetFrame.GetSelText  then Warnlog "Wrong targetFrame has been added to text!"
	TabHyperlinkZeichen.Cancel
	
	'/// Close the document
	Call hCloseDocument
endcase

'----------------------------------------------------------------------------

testcase tRedlining_10

  Dim sSectionName as String

  sSectionName = "testForRedlining"

  '/// Test inserted sections
  printlog "inserted sections"

   '/// New document
   Call hNewDocument

   '/// Insert a sentence into document
   Call wTypeKeys "Redlining test => OK_1<Shift Home>"

   UseBindings
   '/// Edit / Changes / Record
   EditChangesRecord

   '/// Insert a section in the testing sentence , insert / section
   InsertSection
   wait 500
   Kontext
   Active.Setpage TabBereiche
   Kontext "TabBereiche"
   Bereichsliste.Settext sSectionName
   TabBereiche.OK
   wait 500

   '/// Check if the section is inserted correctly before accepting the changes , format / sections
   FormatSections
   Kontext "BereicheBearbeiten"
   if BereichsName.GetText <> sSectionName then warnlog "the section is NOt inserted correctly before accepting the changes "
   BereicheBearbeiten.Cancel

   '/// Edit / Changes / Accept or Reject
   EditChangesAcceptOrReject
   Kontext "Redlining"
   '/// + Select tabpage 'List' ///
   TabControl.SetPage TabListe
   '/// + Select 'Accept All'///
   AlleAkzeptieren.Click
   Sleep 2
   '/// + Close Redlining dialog
   Redlining.Close

   '/// Check if the section is inserted correctly after accepting the changes , format / sections
   FormatSections
   Kontext "BereicheBearbeiten"
   if BereichsName.GetText <> sSectionName then warnlog "the section is NOt inserted correctly after accepting the changes "
   BereicheBearbeiten.Cancel

   '/// Close the document
   Call hCloseDocument
endcase

'----------------------------------------------------------------------------

testcase tRedlining_11

  '/// Test inserted tables
  printlog "inserted tables"

   '/// New document
   Call hNewDocument

   UseBindings
   '/// Edit / Changes / Record
   EditChangesRecord

   '/// Insert a table
   Call hTabelleEinfuegen

   '/// Check if the table is inserted correctly before accepting the changes
   Call wOpenContextMenu
   hMenuSelectNr(10)

   try
      Kontext
      Active.Setpage TabTabelle
      Kontext "TabTabelle"
      if Right(TabellenName.GetText , 1) <> "1"  then warnlog "the table is NOt inserted correctly before accepting the changes "
      TabTabelle.Cancel
   catch
      Warnlog "Something wrong in inserting table  before accepting the changes!"
   endcatch

   '/// Edit / Changes / Accept or Reject
   EditChangesAcceptOrReject
   Kontext "Redlining"
   '/// + Select tabpage 'List' ///
   TabControl.SetPage TabListe
   '/// + Select 'Accept All'///
   AlleAkzeptieren.Click
   Sleep 2
   '/// + Close Redlining dialog
   Redlining.Close

   '/// Check if the table is inserted correctly after accepting the changes
   Call wOpenContextMenu
   hMenuSelectNr(10)

   try
      Kontext
      Active.Setpage TabTabelle
      Kontext "TabTabelle"
      if Right(TabellenName.GetText , 1) <> "1"  then warnlog "the table is NOt inserted correctly after accepting the changes "
      TabTabelle.Cancel
   catch
      Warnlog "Something wrong in inserting table  after accepting the changes!"
   endcatch

   '/// Close the document
   Call hCloseDocument
endcase

'----------------------------------------------------------------------------

testcase tRedlining_12

  '/// Test inserted field (date)
  printlog "inserted field (date)"

   '/// New document
   Call hNewDocument

   UseBindings
   '/// Edit / Changes / Record
   EditChangesRecord

   '/// Insert a date , insert / field / date
   InsertFieldsDate

   Call wTypeKeys "<Home>"
   Sleep 1

   '/// Check if the date is inserted correctly before accepting the changes
   try
      EditFields
      Kontext "FeldbefehlBearbeitenDokument"
      FeldbefehlBearbeitenDokument.Cancel
   catch
      Warnlog "Something wrong in inserting date  before accepting the changes!"
   endcatch

   '/// Edit / Changes / Accept or Reject
   EditChangesAcceptOrReject
   Kontext "Redlining"
   '/// + Select tabpage 'List' ///
   TabControl.SetPage TabListe
   '/// + Select 'Accept All'///
   AlleAkzeptieren.Click
   Sleep 2
   '/// + Close Redlining dialog
   Redlining.Close
   Sleep 1

   Call wTypeKeys "<Home>"

   '/// Check if the date is inserted correctly after accepting the changes
   try
      EditFields
      Kontext "FeldbefehlBearbeitenDokument"
      FeldbefehlBearbeitenDokument.Cancel
   catch
      Warnlog "Something wrong in inserting date after accepting the changes!"
   endcatch

   '/// Close the document
   Call hCloseDocument
endcase

'----------------------------------------------------------------------------

testcase tRedlining_13

  '/// Test inserted footnotes
  printlog "inserted footnotes"

   '/// New document
   Call hNewDocument

   UseBindings
   '/// Edit / Changes / Record
   EditChangesRecord

   '/// Insert a footnote , insert / footnotes
   InsertFootnote
   Kontext "FussnoteEinfuegen"
   Sleep 1
   FussnoteEinfuegen.OK

   Call wTypeKeys "<PageUp><Home>"

   '/// Check if the footnote is inserted correctly before
   '/// + accepting the changes
   try
      EditFootnote
      Kontext "FussnoteBearbeiten"
      FussnoteBearbeiten.Cancel
   catch
      Warnlog "Something wrong in inserting footnote before accepting the changes!"
   endcatch

   '/// Edit / Changes / Accept or Reject
   EditChangesAcceptOrReject
   Kontext "Redlining"
   '/// + Select tabpage 'List' ///
   TabControl.SetPage TabListe
   '/// + Select 'Accept All'///
   AlleAkzeptieren.Click
   Sleep 2
   '/// + Close Redlining dialog
   Redlining.Close

   Call wTypeKeys "<Home>"

   '/// Check if the footnote is inserted correctly after accepting the changes
   try
      EditFootnote
      Kontext "FussnoteBearbeiten"
      FussnoteBearbeiten.Cancel
   catch
      Warnlog "Something wrong in inserting footnote after accepting the changes!"
   endcatch

   '/// Close the document
   Call hCloseDocument

endcase

'----------------------------------------------------------------------------

testcase tRedlining_14

  '/// Test inserted header
  printlog "inserted header"

  '/// New document
  Call hNewDocument

  '/// Edit / Changes / Record
  EditChangesRecord

  '/// Insert a header , insert / header
  DocumentWriter.UseMenu
  MenuSelect(Menugetitemid(4))
  Sleep 2
  MenuSelect(Menugetitemid(9))
  Sleep 2
  MenuSelect(Menugetitemid(1))
  Sleep 2

  '/// input some test words in the header
  Call wTypeKeys "Header Test"

  '/// Check if the header is inserted correctly before
  '/// + accepting the changes
  FormatPageWriter
  Kontext
  Active.SetPage TabKopfzeile
  Kontext "TabKopfzeile"
  if Not KopfzeileMitAbstand.IsChecked then Warnlog "The header is NOT inserted correctly before accepting the changes!"
  TabKopfzeile.Cancel

  '/// Edit / Changes / Accept or Reject
  EditChangesAcceptOrReject
  Kontext "Redlining"
  '/// + Select tabpage 'List' ///
  TabControl.SetPage TabListe
  '/// + Select 'Accept All'///
  AlleAkzeptieren.Click
  Sleep 2
  '/// + Close Redlining dialog
  Redlining.Close

  '/// Check if the header is inserted correctly after accepting the changes
  FormatPageWriter
  Kontext
  Active.SetPage TabKopfzeile
  Kontext "TabKopfzeile"
  if Not KopfzeileMitAbstand.IsChecked then Warnlog "The header is NOT inserted correctly after accepting the changes!"
  TabKopfzeile.Cancel

  '/// Close the document
  Call hCloseDocument

endcase

'----------------------------------------------------------------------------

testcase tRedlining_15

  '/// Test inserted footer
  printlog "inserted footer"

  '/// New document
  Call hNewDocument

  '/// Edit / Changes / Record
  EditChangesRecord

  '/// Insert a footer , insert / footer
  DocumentWriter.UseMenu
  MenuSelect(Menugetitemid(4))
  Sleep 2
  MenuSelect(Menugetitemid(10))
  Sleep 2
  MenuSelect(Menugetitemid(1))
  Sleep 2

  Call wTypeKeys "Footer Test"

  '/// Check if the footer is inserted correctly before
  '/// + accepting the changes
  FormatPageWriter
  Kontext
  Active.SetPage TabFusszeile
  Kontext "TabFusszeile"
  if Not FusszeileMitAbstand.IsChecked then Warnlog "The footer is NOT inserted correctly before accepting the changes!"
  TabFusszeile.Cancel

  '/// Edit / Changes / Accept or Reject
  EditChangesAcceptOrReject
  Kontext "Redlining"
  '/// + Select tabpage 'List' ///
  TabControl.SetPage TabListe
  '/// + Select 'Accept All'///
  AlleAkzeptieren.Click
  Sleep 2
  '/// + Close Redlining dialog
  Redlining.Close

  '/// Check if the footer is inserted correctly after accepting the changes
  FormatPageWriter
  Kontext
  Active.SetPage TabFusszeile
  Kontext "TabFusszeile"
  if Not FusszeileMitAbstand.IsChecked then Warnlog "The footer is NOT inserted correctly after accepting the changes!"
  TabFusszeile.Cancel

  '/// Close the document
  Call hCloseDocument

endcase

'----------------------------------------------------------------------------

testcase tRedlining_16

  Dim iComparison1$ , iComparison2$

  '/// Test moved paragraphs/chapters
  printlog "moved paragraphs/chapters"

   '/// New document
   Call hNewDocument

   '/// Insert a paragraph ( Open the test file )
   '/// + There are 3 lines
   '/// + Redlining test => OK_1  <--  No numbering
   '/// + Redlining test => OK_2  <--  Numbering style : list 2
   '/// + Redlining test => OK_3  <--  Numbering style : list 3

   hFileOpenLocally(  gTesttoolPath + "writer\optional\input\redlining\tRedlining_15.sxw" )
   

   Call wTypeKeys "<Up>" , 3

   Call wTypeKeys "<Down>"
   FormatParagraph
   Kontext
   Active.SetPage TabNumerierungAbsatz
   Kontext "TabNumerierungAbsatz"
   iComparison1$ = Vorlage.GetSelText
   TabNumerierungAbsatz.Cancel

   Call wTypeKeys "<Down>"
   FormatParagraph
   Kontext
   Active.SetPage TabNumerierungAbsatz
   Kontext "TabNumerierungAbsatz"
   iComparison2$ = Vorlage.GetSelText
   TabNumerierungAbsatz.Cancel

   UseBindings
   '/// Edit / Changes / Record
   EditChangesRecord

   Call wTypeKeys "<Up><End>"
   Call wTypeKeys "<Shift Down Right>"
   '/// Cut the selection
   EditCut

   Call wTypeKeys "<Up>" , 3
   Call wTypeKeys "<End><Return>"
   '/// paste under the first line
   EditPaste

   Call wTypeKeys "<Up><Up><End><Delete>"

   '/// Check if the paragraph is moved correctly before
   '/// + accepting the changes
   Call wTypeKeys "<Up>" , 3
   Call wTypeKeys "<Down><End>"
   Call wTypeKeys "<Shift Left>"
   try
       EditCopy
   catch
       Warnlog "#i41424# Bullets cannot be removed by Del key"
       Call wTypeKeys "<Down><End>"
       Call wTypeKeys "<Shift Left>"
       EditCopy
   endcatch

   if GetClipboardText <> "3" then Warnlog "A.The paragraph is moved incorrect before accepting the changes - 2nd line"

   FormatParagraph
   Kontext
   Active.SetPage TabNumerierungAbsatz
   Kontext "TabNumerierungAbsatz"
   if iComparison2$ <> Vorlage.GetSelText then Warnlog "B.The paragraph is moved incorrect before accepting the changes - 2nd line"
   TabNumerierungAbsatz.Cancel

   Call wTypeKeys "<Down><End>"
   Call wTypeKeys "<Shift Left>"
   EditCopy
   if GetClipboardText <> "2" then Warnlog "A. The paragraph is moved incorrect before accepting the changes - 3rd line"

   FormatParagraph
   Kontext
   Active.SetPage TabNumerierungAbsatz
   Kontext "TabNumerierungAbsatz"
   if iComparison1$ <> Vorlage.GetSelText then Warnlog "B . The paragraph is moved incorrect before accepting the changes - 3rd line"
   TabNumerierungAbsatz.Cancel

   '/// Edit / Changes / Accept or Reject
   EditChangesAcceptOrReject
   Sleep 2
   Kontext "Redlining"
   Sleep 2
   '/// + Select tabpage 'List' ///
   TabControl.SetPage TabListe
   Sleep 2
   '/// + Select 'Accept All'///
   AlleAkzeptieren.Click
   Sleep 2
   '/// + Close Redlining dialog
   Redlining.Close
   Sleep 2

   '/// Check if the footnote is inserted correctly after
   '/// + accepting the changes
   Call wTypeKeys "<Up>" , 3
   Call wTypeKeys "<Down><End>"
   Call wTypeKeys "<Shift Left>"
   try
       EditCopy
   catch
       Warnlog "#i41424# Bullets cannot be removed by Del key"
       Call wTypeKeys "<Down><End>"
       Call wTypeKeys "<Shift Left>"
       EditCopy
   endcatch
   if GetClipboardText <> "3" then Warnlog "A.The paragraph is moved incorrect after accepting the changes - 2nd line"

   FormatParagraph
   Kontext
   Active.SetPage TabNumerierungAbsatz
   Kontext "TabNumerierungAbsatz"
   if iComparison2$ <> Vorlage.GetSelText then Warnlog "B.The paragraph is moved incorrect after accepting the changes - 2nd line"
   TabNumerierungAbsatz.Cancel

   Call wTypeKeys "<Down><End>"
   Call wTypeKeys "<Shift Left>"
   EditCopy
   if GetClipboardText <> "2" then Warnlog "A. The paragraph is moved incorrect after accepting the changes - 3rd line"

   FormatParagraph
   Kontext
   Active.SetPage TabNumerierungAbsatz
   Kontext "TabNumerierungAbsatz"
   if iComparison1$ <> Vorlage.GetSelText then Warnlog "The paragraph is moved incorrect after accepting the changes - 3rd line"
   TabNumerierungAbsatz.Cancel

    PrintLog "Close active documents"
    Do Until GetDocumentCount = 0
        Call hCloseDocument
    Loop
endcase