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
|
'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: ch2_lvl1_wizard.inc,v $
'*
'* $Revision: 1.2 $
'*
'* last change: $Author: obo $ $Date: 2008-07-22 10:36:56 $
'*
'* 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 : joerg.sievers@sun.com
'*
'* short description : Chart wizard general functionality
'*
'************************************************************************
'*
' #1 tCreateNew3DChart ' Create a new 3D chart and check the preserved values
' #1 tCreateNewLineChart ' Create a new line chart and check the preserved values
'*
'\************************************************************************
testcase tCreateNew3DChart
Dim sInputFile as STRING
Dim sOutputFile as STRING
Dim sControlString as STRING
Dim iChartVariant as integer
Dim iChartVariantText as string
sInputFile = convertpath ( gTesttoolPath & "chart2/optional/input/randomData.ods" )
sOutputFile = convertpath ( gOfficePath & "user/work/tCreateNew3DChart.ods" )
printlog "Load test document TesttoolPath/chart2/optional/input/randomData.ods"
call hFileOpen(sInputFile)
sleep(2)
printlog "Save document as OfficePath/user/work/tCreateNew3DChart.ods"
if NOT hFileSaveAsWithFilterKill ( sOutputFile , "calc8" ) then
warnlog "Saving test document localy failed -> Aborting"
call hCloseDocument
goto endsub
endif
printlog "Insert / Chart"
InsertChart
sleep(5)
Kontext "ChartType"
printlog "Choose the Chart type bar (should be the second in the top-down list)"
if fSetChartType( "bar" ) > 0 then
warnlog "Something went wrong setting chart type to BAR."
endif
printlog "Select 2nd chart variant from left"
if fSetChartTypeVariant( 2 ) > 0 then
warnlog "Something went wrong setting chart type VARIANT."
endif
printlog "Check 3D Look checkbox"
if fSetChartType3D( TRUE ) > 0 then
warnlog "Something went wrong setting 3D chart."
endif
printlog "Change Chart type look to simple"
if fSetChartLook3D( "simple" ) > 0 then
warnlog "Something went wrong setting 3D look."
endif
printlog "Change Chart shape to cone"
if fSetChartShape3D( "cone" ) > 0 then
warnlog "Something went wrong setting 3D shape."
endif
printlog "Change to Data Range tab page by clicking the Next-button"
Kontext "ChartWizard"
GoNext.Click
Kontext "TabChartTypeDataRange"
printlog "Set data range text box to $Sheet1.$A$2:$E$13"
if fSetTextBox ( DataRange , "$Sheet1.$A$2:$E$13" ) > 0 then
warnlog "Something went wrong setting Text."
endif
printlog "Select data series in Rows radiobox"
if fSetRadioButton ( Rows ) > 0 then
warnlog "Something went wrong selecting 'Data Series in: Rows'."
endif
printlog "Uncheck First row as label checkbox"
if fSetCheckBox ( FirstRowAsLabel , FALSE ) > 0 then
warnlog "Something went wrong unselecting 'First row as label'."
endif
printlog "Change to Data Series tab page by clicking the Next-button"
Kontext "ChartWizard"
GoNext.Click
Kontext "TabChartTypeDataSeries"
printlog "Select last (12th) entry in Data Series list on the left"
if fSetListBoxByItem ( DataSeries , 12 ) > 0 then
warnlog "Something went wrong selecting 'Data Series' item no. 12."
endif
printlog "Click on the add-button"
AddButton.Click
printlog "Set Range for Name text field to A17"
if fSetTextBox ( RangeFor , "A17" ) > 0 then
warnlog "Something went wrong setting Text."
endif
printlog "Select 2nd entry in Data Ranges (Y-Values) list on the right"
if fSetListBoxByItem ( DataRanges , 2 ) > 0 then
warnlog "Something went wrong selecting 'Data Ranges' item No. 2."
endif
printlog "Set Range for Y-Values text field to B17:E17"
if fSetTextBox ( RangeFor , "B17:E17" ) > 0 then
warnlog "Something went wrong setting Text."
endif
printlog "Change to Chart Elements tab-page by clicking the Next-button"
Kontext "ChartWizard"
GoNext.Click
Kontext "TabChartTypeChartElements"
printlog "Set 'Title' text box to MyTitle"
if fSetTextBox ( Title , "MyTitle" ) > 0 then
warnlog "Something went wrong setting Text."
endif
printlog "Set 'Subtitle' text box to 1 2 3"
if fSetTextBox ( Subtitle , "1 2 3" ) > 0 then
warnlog "Something went wrong setting Text."
endif
printlog "Set 'X Title' text box to Grått"
if fSetTextBox ( TitleXAxis , "Grått" ) > 0 then
warnlog "Something went wrong setting Text."
endif
printlog "Set 'Y Title' text box to Gräulich"
if fSetTextBox ( TitleYAxis , "Gräulich" ) > 0 then
warnlog "Something went wrong setting Text."
endif
printlog "Set 'Z Title' text box to 灰色"
if fSetTextBox ( TitleZAxis , "灰色" ) > 0 then
warnlog "Something went wrong setting Text."
endif
printlog "Check X Axis-checkbox"
if fSetCheckBox ( GridLinesXAxis , TRUE ) > 0 then
warnlog "Something went wrong checking 'X Axis'."
endif
printlog "Uncheck Y Axis-checkbox"
if fSetCheckBox ( GridLinesYAxis , FALSE ) > 0 then
warnlog "Something went wrong unchecking 'Y Axis'."
endif
printlog "heck Z Axis-checkbox"
if fSetCheckBox ( GridLinesZAxis , TRUE ) > 0 then
warnlog "Something went wrong checking 'Z Axis'."
endif
printlog "Select under Legend (on the right) the Left radio-button"
if fSetRadioButton ( PositionLeft ) > 0 then
warnlog "Something went wrong selecting 'Legend Display Left'."
endif
printlog "Click the Finish-button"
Kontext "ChartWizard"
ChartWizard.OK
sleep(2)
printlog "File / Save"
FileSave
Kontext "DocumentCalc"
printlog "Press ESCAPE button (deselecting the OLE object)"
DocumentCalc.TypeKeys "<Escape>"
printlog "Close the document"
Call hCloseDocument
sleep(2)
printlog "Open saved file again"
call hFileOpen(sOutputFile)
sleep(2)
printlog "Select chart OLE using navigator"
call fSelectFirstOLE
printlog "Edit / Object / Edit to enter inplace mode of the chart"
printlog "(enabling the chart menus and editing possibilities)"
EditObjectEdit
printlog "Format / Chart Type"
FormatChartType
sleep(1)
Kontext "ChartType"
printlog "Check if chart type is 'bar'"
if ChooseType.GetSelIndex <> 2 Then
warnlog "Selected chart type (bar) wasn't preserved after save and reload."
endif
printlog "Check that variant is 'stacked'"
iChartVariant = variant.GetSelIndex
iChartVariantText = variant.GetSelText(iChartVariant)
printlog "Check that the chart variant is 'Stacked' (2nd entry)"
if iChartVariant <> 2 then
warnlog "Instead of chart variant 'Stacked' (2) the variant " & iChartVariant & "(" & iChartVariantText & ") has been used - FAILED"
end if
printlog "Check the the '3D Look' box is checked"
if NOT Look3D.IsChecked then
warnlog "Check box 3D (enabled) wasn't preserved after save and reload."
endif
printlog "Check that 3D look is 'simple' (=default)"
if Scheme3D.GetSelIndex <> 1 then
warnlog "Default 3D Look ('simple') has not been preserved after save and reload."
endif
printlog "Check that 3D shape 'cone' is selected"
if BarColumnShape.GetSelIndex <> 3 Then
warnlog "3D Shape CONE wasn't preserved after save and reload."
endif
Kontext "ChartType"
printlog "Leave dialog with CANCEL button."
ChartType.CANCEL
printlog "Invoke Format / Data Ranges"
FormatDataRanges
printlog "Goto tab-page Data Range"
printlog "Verify now the made settings in the 'Data Ranges' dialog:"
Kontext
Active.SetPage TabFormatDataRangesDataRange
Kontext "TabFormatDataRangesDataRange"
if TabFormatDataRangesDataRange.Exists(2) then
printlog "Check substrings $A$2:$E$13 and $A$17:$E$17 in 'Data Range'"
sControlString = DataRange.GetText
if instr ( sControlString , "$A$2:$E$13" ) = 0 Then
warnlog "Data range wasn't correctly preserved after save and reload and does not caontain $A$2:$E$13."
endif
if instr ( sControlString , "$A$17:$E$17" ) = 0 Then
warnlog "#i72241# - Data range wasn't correctly preserved after save and reload and does not contain $A$17:$E$17."
endif
printlog "Check that radio button 'rows' is checked"
if NOT Rows.IsChecked then
warnlog "Radio Button ROWS (enabled) wasn't preserved after save and reload."
endif
printlog "Check that radio button 'columns is unchecked."
if Columns.IsChecked then
warnlog "Radio Button COLUMNS (disabled) wasn't preserved after save and reload."
endif
printlog "Check if 'First row as label' checkbox is unchecked"
if FirstRowAsLabel.IsChecked then
warnlog "Check box 'First row as label' (disabled) wasn't preserved after save and reload."
endif
printlog "Check that 'First column as label' checkbox is checked."
if NOT FirstColumnAsLabel.IsChecked then
warnlog "#i72241# - Check box 'First column as label' (enabled) wasn't preserved after save and reload."
endif
else
warnlog "Tab page 'Data Range' not visible!"
end if
printlog "Go to tab page 'Data Series'"
Kontext
Active.SetPage TabFormatDataRangesDataSeries
Kontext "TabFormatDataRangesDataSeries"
if TabFormatDataRangesDataSeries.Exists(2) then
printlog "Check if added range (13 in list on the left) was preserved."
if fSetListBoxByItem ( DataSeries , 13 ) > 0 then
warnlog "Selecting 13th item in Data Series seems to fail. Added range wasn't preserved."
else
printlog "Select 'Name'-entry in Data Ranges list on the right."
if fSetListBoxByItem ( DataRanges , 1 ) > 0 then
warnlog "Something went wrong selecting 'Data Ranges' item No. 1."
else
printlog "Check that the string $A$17 exists in range for 'Name'"
sControlString = RangeFor.GetText
printlog "'Range for name' is: " & sControlString
if instr ( sControlString , "$A$17" ) = 0 Then
warnlog "#i72241# - 'Range for name' wasn't correctly preserved after save and reload."
else
printlog "Select 'Y-Values' in Data Ranges list on the right."
if fSetListBoxByItem ( DataRanges , 2 ) > 0 then
warnlog "Something went wrong selecting 'Data Ranges' item No. 2."
else
printlog "Check that the string $B$17:$E$17 is in range for 'Y-Values'"
sControlString = RangeFor.GetText
if instr ( sControlString , "$B$17:$E$17" ) = 0 Then
warnlog "'Range for Y-Values' wasn't correctly preserved after save and reload."
endif
endif
endif
endif
endif
printlog "Close the dialog with 'cancel'-button"
TabFormatDataRangesDataSeries.Cancel
else
warnlog "Tab page 'Data series' not visible!"
end if
if fInvokeTitlesDialog() = 0 then
printlog "Insert / Title"
printlog "Verify now the made settings in the 'Titles' dialog:"
Kontext "InsertTitleDialog"
printlog "Check that 'Title' text field contains 'MyTitle'"
sControlString = MainTitle.GetText
if sControlString <> "MyTitle" then
warnlog "Title string 'MyTitle' wasn't preserved after save and reload."
endif
printlog "Check that 'Subtitle'text field contains 1 2 3"
sControlString = SubTitle.GetText
if sControlString <> "1 2 3" then
warnlog "Subtitle string '1 2 3' wasn't preserved after save and reload."
endif
printlog "Check that 'X Title' text field contains Grått"
sControlString = TitleXAxis.GetText
printlog "'X Title' is: " & sControlString
if sControlString <> "Grått" then
warnlog "X Title string 'Grått' wasn't preserved after save and reload."
endif
printlog "Check that 'Y Title' text field contains 'Gräulich'"
sControlString = TitleYAxis.GetText
if sControlString <> "Gräulich" then
warnlog "Y Title string 'Gräulich' wasn't preserved after save and reload."
endif
printlog "Check that 'Z Title' text field contains 灰色"
sControlString = TitleZAxis.GetText
printlog "'Z Title' is: " & sControlString
if sControlString <> "灰色" then
warnlog "Z Title string '灰色' wasn't preserved after save and reload."
endif
printlog "Close the Title-dialog by pressing 'Cancel'-button"
InsertTitleDialog.Cancel
endif
if fInvokeGridsDialog() = 0 then
printlog "Insert / Grid"
Kontext "InsertGridsDialog"
printlog "Check that 'Main Grid X Axis' checkbox is checked"
if NOT MainGridXaxis.IsChecked then
warnlog "Check box 'Gridlines X Axis' (checked) wasn't preserved after save and reload."
endif
printlog "Check that 'Main Grid Y Axis' checkbox is checked"
if MainGridYaxis.IsChecked then
warnlog "Check box 'Gridlines Y Axis' (unchecked) wasn't preserved after save and reload."
endif
printlog "Check that 'Main Grid Z Axis' checkbox is checked"
if NOT MainGridZaxis.IsChecked then
warnlog "Check box 'Gridlines Z Axis' (checked) wasn't preserved after save and reload."
endif
printlog "Check that 'Minor Grid X Axis' checkbox is unchecked"
if MinorGridXaxis.IsChecked then
warnlog "Check box 'Minor Grid X Axis' (unchecked) wasn't preserved after save and reload."
endif
printlog "Check that 'Minor Grid Y Axis' checkbox is unchecked"
if MinorGridYaxis.IsChecked then
warnlog "Check box 'Minor Grid Y Axis' (unchecked) wasn't preserved after save and reload."
endif
printlog "Check that 'Minor Grid Z Axis' checkbox is unchecked"
if MinorGridZaxis.IsChecked then
warnlog "Check box 'Minor Grid Z Axis' (unchecked) wasn't preserved after save and reload."
endif
printlog "Leave dialog with Cancel-button."
InsertGridsDialog.Cancel
endif
if fInvokeLegendDialog() = 0 then
printlog "Insert / Legend"
Kontext "InsertLegendDialog"
printlog "Check that 'Legend Display' checkbox is checked"
if NOT Display.IsChecked then
warnlog "Check box 'Legend Display' (enabled) wasn't preserved after save and reload."
endif
printlog "Check that 'Left' radio button is selected"
if NOT PositionLeft.IsChecked then
warnlog "Radio button 'Left' (enabled) wasn't preserved after save and reload."
endif
printlog "Cancel InsertLegend-dialog"
Kontext "InsertLegendDialog"
InsertLegendDialog.Cancel
end if
Kontext "DocumentCalc"
DocumentCalc.TypeKeys "<Escape>"
printlog "Close document"
Call hCloseDocument
endcase
'
'--------------------------------------------------------------------
'
testcase tCreateNewLineChart
dim sInputFile as STRING
dim sOutputFile as STRING
dim sControlString as STRING
sInputFile = convertpath ( gTesttoolPath & "chart2/optional/input/randomData.ods" )
sOutputFile = convertpath ( gOfficepath & "user/work/tCreateNewLineChart.ods" )
printlog "File / Load TesttoolPath/chart2/optional/input/randomData.ods"
call hFileOpen(sInputFile)
sleep(2)
printlog "Save document as Officepath/user/work/tCreateNewLineChart.ods"
if NOT hFileSaveAsWithFilterKill ( sOutputFile , "calc8" ) then
warnlog "Saving test document localy failed -> Aborting"
call hCloseDocument
goto endsub
endif
printlog "Insert / Chart"
InsertChart
printlog "Change Chart type to LINE (5th entry from the top)"
Kontext "ChartType"
if NOT ChartType.Exists(5) then
warnlog "Chart Wizard was not visible. EXITING!"
goto endsub
else
printlog "Chart Wizard visible."
end if
if fSetChartType ( "line" ) > 0 then
warnlog "Something went wrong setting chart type to LINE."
endif
printlog "Select 3rd Change chart type variant (lines only)"
if fSetChartTypeVariant ( 3 ) > 0 then
warnlog "Something went wrong setting chart type to 3rd variant (lines only)."
endif
printlog "Enable 'Stack Series' and select 'Percent'"
if fSetStackSeries ( "percent" ) > 0 then
warnlog "Something went wrong setting Stack Series to Percent."
endif
'/// Enable 'Smooth Lines'
printlog "Enable 'Smooth Lines'"
if fSetSmoothLines ( TRUE ) > 0 then
warnlog "Something went wrong enabling Smooth Lines."
endif
printlog "Invoke 'Smooth Lines' dialog"
if fInvokeSmoothLineProperties() > 0 then
warnlog "Something went wrong invoking Smooth Lines Dialog."
endif
printlog "Check B-Spline"
BSpline.check
printlog "Set Resolution to 33"
Resolution.SetText "33"
printlog "et Data Points Order to 5"
DataPointsOrder.SetText "5"
printlog "Close 'Smooth Lines' dialog"
if fCloseSmoothLinePropertiesOK() > 0 then
warnlog "Something went wrong closing Smooth Lines Dialog."
endif
printlog "Change to Data Range tab-page"
Kontext "ChartWizard"
GoNext.Click
Kontext "TabChartTypeDataRange"
printlog "Set Data Range text box to $Sheet1.$A$1:$F$13;$Sheet1.$A$17:$F$17"
if fSetTextBox ( DataRange , "$Sheet1.$A$1:$F$13;$Sheet1.$A$17:$F$17" ) > 0 then
warnlog "Something went wrong setting Text."
endif
printlog "Change to Data Series tab-page"
Kontext "ChartWizard"
GoNext.Click
Kontext "TabChartTypeDataSeries"
printlog "Select 3rd entry in Data Series"
if fSetListBoxByItem ( DataSeries , 3 ) > 0 then
warnlog "Something went wrong selecting 'Data Series' item No. 3."
endif
printlog "Remove series labeled 'John'"
RemoveButton.Click
printlog "Select 4th entry in Data Series"
if fSetListBoxByItem ( DataSeries , 4 ) > 0 then
warnlog "Something went wrong selecting 'Data Series' item No. 4."
endif
printlog "Select 2nd entry in Data Ranges"
if fSetListBoxByItem ( DataRanges , 2 ) > 0 then
warnlog "Something went wrong selecting 'Data Ranges' item No. 2."
endif
printlog "Set 'Range for Y-Values' text box to $Sheet1.$F$2:$F$13;$Sheet1.$D$17"
if fSetTextBox ( RangeFor , "$Sheet1.$F$2:$F$13;$Sheet1.$D$17" ) > 0 then
warnlog "Something went wrong setting Text."
endif
printlog "Set 'Categories' text box to $Sheet1.$A$2:$A$13;$Sheet1.$A$1"
if fSetTextBox ( Categories , "$Sheet1.$A$2:$A$13;$Sheet1.$A$19" ) > 0 then
warnlog "Something went wrong setting Text."
endif
printlog "Change to Chart Elements tab-page"
Kontext "ChartWizard"
GoNext.Click
Kontext "TabChartTypeChartElements"
printlog "Uncheck 'Y Axis'"
if fSetCheckBox ( GridLinesYAxis , FALSE ) > 0 then
warnlog "Something went wrong unselecting 'Y Axis'."
endif
printlog "Uncheck 'Legend Display'"
if fSetCheckBox ( Display , FALSE ) > 0 then
warnlog "Something went wrong unselecting 'Legend Display'."
endif
printlog "Create Chart by clicking Finish-button"
Kontext "ChartWizard"
ChartWizard.OK
sleep(2)
printlog "File / Save"
FileSave
Kontext "DocumentCalc"
printlog "Press twice <ESCAPE>-key"
DocumentCalc.TypeKeys "<Escape>" , 2
printlog "File / Close document"
Call hCloseDocument
sleep(2)
printlog "Open saved file again"
call hFileOpen(sOutputFile)
sleep(2)
printlog "Open the Navigator (F5)"
printlog "Select the first OLE object in the Navigator"
call fSelectFirstOLE
printlog "Edit / Object / Edit to enter Inplace Mode"
EditObjectEdit
printlog "Format / Chart Type"
FormatChartType
Kontext "ChartType"
if ChartType.Exists(2) then
printlog "Check if chart type is LINE"
if ChooseType.GetSelIndex <> 5 then
warnlog "Selected chart type wasn't preserved after save and reload."
endif
printlog "Check if chart variant is LINES ONLY (third variant in non-CTL versions from the left)"
if Variant.GetSelIndex <> 3 then
warnlog "Selected chart type variant wasn't preserved after save and reload."
end if
printlog "Check if 'Stack Series' box is checked"
if NOT StackSeries.IsChecked then
warnlog "Check box 'Stack Series' (enabled) wasn't preserved after save and reload."
endif
printlog "Check if 'Percent' radio button is checked"
if NOT Percent.IsChecked then
warnlog "Radio button box 'Percent' (enabled) wasn't preserved after save and reload."
endif
printlog "Check if 'Smooth Lines' box is checked"
if NOT SmoothLines.IsChecked then
warnlog "Check box 'Smooth Lines' (enabled) wasn't preserved after save and reload."
endif
printlog "Invoke 'Smooth Lines' dialog"
if fInvokeSmoothLineProperties() > 0 then
warnlog "Something went wrong invoking Smooth Lines dialog."
endif
printlog "Check if 'B-Spline' radio button is checked"
if NOT BSpline.IsChecked then
warnlog "Radio button box 'B-Spline' (enabled) wasn't preserved after save and reload."
endif
printlog "Check if 'Resolution' has value '33'"
if Resolution.GetText <> "33" then
warnlog "Value for Resolution '33' wasn't preserved after save and reload."
endif
printlog "Check if 'Data Points Order' has value '5'"
if DataPointsOrder.GetText <> "5" then
warnlog "Value for Data Points Order '5' wasn't preserved after save and reload."
endif
printlog "Close 'Smooth Lines' dialog"
if fCloseSmoothLinePropertiesOK() > 0 then
warnlog "Something went wrong closing Smooth Lines Dialog."
endif
printlog "Leave Chart Type dialog with Cancel"
Kontext "ChartType"
if ChartType.Exists(2) then
ChartType.Cancel
else
warnlog "ChartType dialog was not visible!?"
end if
else
warnlog "Chart Type dialog was not up!"
end if
printlog "Format / Data Ranges"
FormatDataRanges
Kontext
Active.SetPage TabChartTypeDataRange
Kontext "TabChartTypeDataRange"
if TabChartTypeDataRange.Exists(2) then
printlog "Check substrings '$A$2:$C$13', '$A$19', '$B$1:$C$13', '$E$1:$F$13' and '$B$17:$E$17' in Data Range"
sControlString = DataRange.GetText
printlog "Data Range is: " & sControlString
if instr ( sControlString , "$A$2:$C$13" ) = 0 Then
warnlog "Data range wasn't correctly preserved after save and reload."
endif
if instr ( sControlString , "$A$19" ) = 0 Then
warnlog "Data range wasn't correctly preserved after save and reload."
endif
if instr ( sControlString , "$B$1:$C$13" ) = 0 Then
warnlog "Data range wasn't correctly preserved after save and reload."
endif
if instr ( sControlString , "$E$1:$F$13" ) = 0 Then
warnlog "Data range wasn't correctly preserved after save and reload."
endif
if instr ( sControlString , "$B$17:$E$17" ) = 0 Then
warnlog "Data range wasn't correctly preserved after save and reload."
endif
printlog "Check if Radio Button ROWS is checked"
if Rows.IsChecked then
warnlog "Radio Button ROWS (disabled) wasn't preserved after save and reload."
endif
printlog "Check if Radio Button COLUMNS is unchecked"
if NOT Columns.IsChecked then
warnlog "Radio Button COLUMNS (enabled) wasn't preserved after save and reload."
endif
printlog "Check if 'First row as label' box is unchecked"
if NOT FirstRowAsLabel.IsChecked then
warnlog "Check box 'First row as label' (enabled) wasn't preserved after save and reload."
endif
printlog "Check if 'First column as label' box is checked"
if NOT FirstColumnAsLabel.IsChecked then
warnlog "Check box 'First column as label' (enabled) wasn't preserved after save and reload."
endif
else
warnlog "Tab page Data Range was not up!"
FormatDataRanges
end if
printlog "Switch to tab page Data Series"
Kontext
Active.SetPage TabFormatDataRangesDataSeries
Kontext "TabChartTypeDataSeries"
if TabChartTypeDataSeries.Exists(2) then
printlog "Select 4th entry in Data Series"
if fSetListBoxByItem ( DataSeries , 4 ) > 0 then
warnlog "Selecting 4th item in Data Series failed. EXITING!"
TabChartTypeDataSeries.Cancel
call hCloseDocument
goto endsub
endif
printlog "Select Name in Data Ranges"
if fSetListBoxByItem ( DataRanges , 1 ) > 0 then
warnlog "Something went wrong selecting 'Data Ranges' item No. 1."
endif
printlog "Check substring '$F$1' in Range for Name"
sControlString = RangeFor.GetText
printlog "'Range for name' is: " & sControlString
if instr ( sControlString , "$F$1" ) = 0 Then
warnlog "'Range for name' wasn't correctly preserved after save and reload."
endif
printlog "Select Y-Values in Data Ranges"
if fSetListBoxByItem ( DataRanges , 2 ) > 0 then
warnlog "Something went wrong selecting 'Data Ranges' item No. 2. EXITING!"
TabChartTypeDataSeries.Cancel
call hCloseDocument
goto endsub
endif
printlog "Check substring '$F$2:$F$13' and '$D$17'in Range for Name"
sControlString = RangeFor.GetText
if instr ( sControlString , "$F$2:$F$13" ) = 0 Then
warnlog "'Range for Y-Values' wasn't correctly preserved after save and reload."
endif
if instr ( sControlString , "$D$17" ) = 0 Then
warnlog "'Range for Y-Values' wasn't correctly preserved after save and reload."
endif
printlog "Check substring '$A$2:$A$13' and '$A$19'in Categories"
sControlString = Categories.GetText
if instr ( sControlString , "$A$2:$A$13" ) = 0 Then
warnlog "'Categories' wasn't correctly preserved after save and reload."
endif
if instr ( sControlString , "$A$19" ) = 0 Then
warnlog "'Categories' wasn't correctly preserved after save and reload."
endif
printlog "Leave tab page data series with CANCEL"
TabChartTypeDataSeries.Cancel
else
warnlog "Tab page Data Series was not up!"
end if
printlog "Insert / Title"
InsertTitle
Kontext "InsertTitleDialog"
if InsertTitleDialog.Exists(2) then
printlog "Check if 'Title' text box is empty"
sControlString = MainTitle.GetText
if sControlString <> "" then
warnlog "Empty Title string wasn't preserved after save and reload."
endif
printlog "Check if 'Subtitle' text box is empty"
sControlString = SubTitle.GetText
if sControlString <> "" then
warnlog "Empty Subtitle string wasn't preserved after save and reload."
endif
printlog "Check if 'X Title' text box is empty"
sControlString = TitleXaxis.GetText
if sControlString <> "" then
warnlog "Empty X Title string wasn't preserved after save and reload."
endif
printlog "Check if 'Y Title' text box is empty"
sControlString = TitleYaxis.GetText
if sControlString <> "" then
warnlog "Empty Y Title string wasn't preserved after save and reload."
endif
printlog "Check if 'Z Title' text box is empty"
sControlString = TitleZaxis.GetText
if sControlString <> "" then
warnlog "Empty Z Title string wasn't preserved after save and reload."
endif
printlog "Leaving Title dialog with Cancel"
InsertTitleDialog.Cancel
else
warnlog "Title dialog was not up!"
end if
printlog "Insert / Grids"
If fInvokeGridsDialog = 0 then
Kontext "InsertGridsDialog"
printlog "Check if 'Gridlines X Axis' box is checked"
if MainGridXaxis.IsChecked then
warnlog "Check box 'Gridlines X Axis' (disabled) wasn't preserved after save and reload."
endif
printlog "Check if 'Gridlines Y Axis' box is unchecked"
if MainGridYaxis.IsChecked then
warnlog "Check box 'Gridlines Y Axis' (disabled) wasn't preserved after save and reload."
endif
printlog "Check if 'Gridlines Z Axis' box is checked"
if MainGridZaxis.IsEnabled then
warnlog "Check box 'Gridlines Z Axis' shouldn't be enabled after save and reload."
endif
printlog "Leave dialog with CANCEL"
InsertGridsDialog.Cancel
else
warnlog "Insert Grids dialog was not up!"
end if
printlog "Insert / Legend"
if fInvokeLegendDialog() = 0 then
printlog "Check if 'Legend Display' box is checked"
Kontext "InsertLegendDialog"
if Display.IsChecked then
warnlog "Check box 'Legend Display' (disabled) wasn't preserved after save and reload."
endif
printlog "Leave dialog with CANCEL."
InsertLegendDialog.Cancel
else
warnlog "Insert Legend dialog was not up!"
end if
printlog "Press ESCAPE button (deselecting the OLE object)"
Kontext "DocumentCalc"
DocumentCalc.TypeKeys "<Escape>"
printlog "Close document"
Call hCloseDocument
endcase
|