summaryrefslogtreecommitdiff
path: root/testautomation/framework/optional/includes/options_ooo_print.inc
blob: 35e83eb0d5f23849520ba31adb25d20060503310 (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
'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 : thorsten.bosbach@oracle.com
'*
'* short description : Tools->Options: OpenOffice.org Print
'*
'\******************************************************************************


testcase tOOoPrint

  Dim lbSave ( 3 ) as Boolean
  Dim lsSavePrinter ( 3 ) as String
  Dim lbSavePrinter ( 13 ) as Boolean
  Dim lsSaveFile ( 3 ) as String
  Dim lbSaveFile ( 13 ) as Boolean

   ToolsOptions
   hToolsOptions ( "StarOffice", "Print" )

 printlog " - save old settings"
 printlog "    - save settings for 'printer'"
  Printer.Check
  Sleep (2)
   lbSavePrinter (1)  = ReduceTransparency.IsChecked
   ReduceTransparency.Uncheck
   lbSave(3) = Transparency.IsChecked
   ReduceTransparency.Check
   lbSavePrinter (2)  = Automatically.IsChecked
   lbSavePrinter (3)  = NoTransparency.IsChecked

   lbSavePrinter (4)  = ReduceGradients.IsChecked
   ReduceGradients.Check
   lbSavePrinter (5)  = GradientStripes.IsChecked
   lbSavePrinter (6)  = IntermediateColor.IsChecked
   GradientStripes.Check
   lsSavePrinter (1)  = Stripes.GetText

   lbSavePrinter (7)  = ReduceBitmaps.IsChecked
   ReduceBitmaps.Check
   lbSavePrinter (8)  = GoodPrintQuality.IsChecked
   lbSavePrinter (9)  = NormalPrintQuality.IsChecked
   lbSavePrinter (10) = Resolution.IsChecked
   lbSavePrinter (11) = IncludeTransparentObjects.IsChecked
   Resolution.Check
   lsSavePrinter (2)  = DPI.GetSelText

   lbSavePrinter (12) = ConvertColorsToGrayscale.IsChecked

 printlog "    - save settings for 'print to file'"
  PrintToFile.Check
  Sleep (2)
   lbSaveFile (1)  = ReduceTransparency.IsChecked
   ReduceTransparency.Check
   lbSaveFile (2)  = Automatically.IsChecked
   lbSaveFile (3)  = NoTransparency.IsChecked

   lbSaveFile (4)  = ReduceGradients.IsChecked
   ReduceGradients.Check
   lbSaveFile (5)  = GradientStripes.IsChecked
   lbSaveFile (6)  = IntermediateColor.IsChecked
   GradientStripes.Check
   lsSaveFile (1)  = Stripes.GetText

   lbSaveFile (7)  = ReduceBitmaps.IsChecked
   ReduceBitmaps.Check
   lbSaveFile (8)  = GoodPrintQuality.IsChecked
   lbSaveFile (9)  = NormalPrintQuality.IsChecked
   lbSaveFile (10) = Resolution.IsChecked
   lbSaveFile (11) = IncludeTransparentObjects.IsChecked
   Resolution.Check
   lsSaveFile (2)  = DPI.GetSelText

   lbSaveFile (12) = ConvertColorsToGrayscale.IsChecked

 printlog "    - save general settings "
   lbSave(1) = PaperOrientation.IsChecked
   lbSave(2) = PaperSize.IsChecked

 printlog " - invert/change settings"
 printlog "    - changes for 'printer'"
  Printer.Check
  Sleep (2)
   if lbSavePrinter (1) = FALSE then ReduceTransparency.Check else ReduceTransparency.UnCheck
   if ReduceTransparency.IsChecked then
      NoTransparency.Check
   else
      if lbSave(3)         = FALSE then Transparency.Check else Transparency.UnCheck
   end if

   if lbSavePrinter (4) = FALSE then ReduceGradients.Check else ReduceGradients.UnCheck
   if ReduceGradients.IsChecked then
      IntermediateColor.Check
   end if

   if lbSavePrinter (7)  = FALSE then ReduceBitmaps.Check else ReduceBitmaps.UnCheck
   if ReduceBitmaps.IsChecked then
      Resolution.Check
      DPI.select 1
      if lbSavePrinter (11) = FALSE then IncludeTransparentObjects.Check else IncludeTransparentObjects.UnCheck
   end if

   if lbSavePrinter (12) = FALSE then ConvertColorsToGrayscale.Check else ConvertColorsToGrayscale.UnCheck

 printlog "    - changes for 'print to file'"
  PrintToFile.Check
  Sleep (2)
   if lbSaveFile (1) = FALSE then ReduceTransparency.Check else ReduceTransparency.UnCheck
   if ReduceTransparency.IsChecked then
      Automatically.Check
   end if

   if lbSaveFile (4) = FALSE then ReduceGradients.Check else ReduceGradients.UnCheck
   if ReduceGradients.IsChecked then
      GradientStripes.Check
      Stripes.SetText "30"
   end if

   if lbSaveFile (7)  = FALSE then ReduceBitmaps.Check else ReduceBitmaps.UnCheck
   if ReduceBitmaps.IsChecked then
      GoodPrintQuality.Check
      if lbSaveFile (11) = FALSE then IncludeTransparentObjects.Check else IncludeTransparentObjects.UnCheck
   end if

   if lbSaveFile (12) = FALSE then ConvertColorsToGrayscale.Check else ConvertColorsToGrayscale.UnCheck

 printlog "    - changes for general settings"
   if lbSave(1) = FALSE then PaperOrientation.Check else PaperOrientation.UnCheck
   if lbSave(2) = FALSE then PaperSize.Check else PaperSize.UnCheck

   Kontext "ExtrasOptionenDlg"
   ExtrasOptionenDlg.OK
   Sleep (3)

 printlog " - exit/restart StarOffice"
   ExitRestartTheOffice

 printlog " - check invertation/changes"
   ToolsOptions
   hToolsOptions ( "StarOffice", "Print" )

 printlog "    - check for 'printer'"
  Printer.Check
  Sleep (2)
   if ReduceTransparency.IsChecked = lbSavePrinter (1) then Warnlog "Reduce transparency => changes not saved! => BugID 87446"
   if ReduceTransparency.IsChecked then
      if NoTransparency.IsChecked <> TRUE              then Warnlog "No transparency => changes not saved!"
   else
      if Transparency.IsChecked = lbSave(2)            then Warnlog "Transparency => changes not saved!"
   end if


   if ReduceGradients.IsChecked = lbSavePrinter (4)    then Warnlog "ReduceGradients => changes not saved!"
   if ReduceGradients.IsChecked then
      if IntermediateColor.IsChecked <> TRUE           then Warnlog "Intermediate color => changes not saved!"
   end if

   if ReduceBitmaps.IsChecked = lbSavePrinter (7)      then Warnlog "Reduce bitmaps => changes not saved!"
   if ReduceBitmaps.IsChecked then
      if Resolution.IsChecked <> TRUE then
         Warnlog "Resolution => changes not saved!"
      else
         if DPI.GetSelIndex <> 1                       then Warnlog "DPI => changes not saved!"
      end if
      if IncludeTransparentObjects.IsChecked = lbSavePrinter (11) then Warnlog "Include Transparent Objects => changes not saved!"
   end if

   if ConvertColorsToGrayscale.IsChecked = lbSavePrinter (12) then Warnlog "Convert Colors To Grayscale => changes not saved!"

 printlog "    - check for 'print to file'"
  PrintToFile.Check
  Sleep (2)
   if ReduceTransparency.IsChecked = lbSaveFile (1)    then Warnlog "Reduce transparency => changes not saved!"
   if ReduceTransparency.IsChecked then
      if Automatically.IsChecked  <> TRUE              then Warnlog "Automatically => changes not saved!"
   end if

   if ReduceGradients.IsChecked = lbSaveFile (4)       then Warnlog "Reduce gradients => changes not saved!"
   if ReduceGradients.IsChecked then
      if GradientStripes.IsChecked <> TRUE             then Warnlog "GradientStripes => changes not saved!"
      if GradientStripes.IsChecked then
         if Stripes.GetText <> "30"                    then Warnlog "Stripes => changes not saved!"
      end if
   end if

   if ReduceBitmaps.IsChecked = lbSaveFile (7)         then Warnlog "Reduce bitmaps => changes not saved!"

   if ReduceBitmaps.IsChecked then
      if GoodPrintQuality.IsChecked <> TRUE            then Warnlog "Good print quality => changes not saved!"
      if IncludeTransparentObjects.IsChecked = lbSaveFile (11) then Warnlog "Include transparent objects = changes not saved!"
   end if

   if ConvertColorsToGrayscale.IsChecked = lbSaveFile (12) then warnlog "Convert colors to grayscale => changes not saved!"

 printlog "    - check for general settings"
   if PaperOrientation.IsChecked = lbSave(1)           then warnlog "Paper orientation => changes not saved! #i29960"
   if PaperSize.IsChecked        = lbSave(2)           then Warnlog "Paper size => changes not saved! #i29960"

 printlog " - 2. changes"
 printlog "    - 'printer'"
  Printer.Check
  Sleep (2)
   ReduceTransparency.UnCheck
   ReduceGradients.Check
    GradientStripes.Check
    Stripes.SetText "120"
   ReduceBitmaps.Check
    GoodPrintQuality.Check
    IncludeTransparentObjects.Check
   ConvertColorsToGrayscale.UnCheck

 printlog "    - 'print to file'"
  PrintToFile.Check
   ReduceTransparency.Check
    NoTransparency.Check
   ReduceGradients.Uncheck
   ReduceBitmaps.UnCheck
   ConvertColorsToGrayscale.Check

 printlog "    - general settings"
   PaperOrientation.UnCheck
   PaperSize.Check

   Kontext "ExtrasOptionenDlg"
   ExtrasOptionenDlg.OK
   Sleep (3)

 printlog " - check 2. changes"
   ToolsOptions
   hToolsOptions ( "StarOffice", "Print" )

 printlog "    - check for 'printer'"
  Printer.Check
  Sleep (2)
   if ReduceTransparency.IsChecked <> FALSE then Warnlog "Reduce transparency => changes not saved!"
   if ReduceGradients.IsChecked    <> TRUE  then
      Warnlog "ReduceGradients => changes not saved!"
   else
      if GradientStripes.IsChecked <> TRUE  then
         Warnlog "GradientStripes => changes not saved!"
      else
         if Stripes.GetText <> "120"        then Warnlog "Stripes => changes not saved!"
      end if
   end if
   if ReduceBitmaps.IsChecked <> TRUE then
      Warnlog "Reduce bitmaps => changes not saved!"
   else
      if GoodPrintQuality.IsChecked <> TRUE          then Warnlog "Good print quality => changes not saved!"
      if IncludeTransparentObjects.IsChecked <> TRUE then Warnlog "Include Transparent Objects => changes not saved!"
   end if
   if ConvertColorsToGrayscale.IsChecked <> FALSE    then Warnlog "Convert Colors To Grayscale => changes not saved!"

 printlog "    - check 'print to file'"
  PrintToFile.Check
  Sleep (2)
   if ReduceTransparency.IsChecked <> TRUE then
      Warnlog "Reduce transparency => changes not saved!"
   else
      if NoTransparency.IsChecked <> TRUE then Warnlog "No transpanency => changes not saved!"
   end if
   if ReduceGradients.IsChecked <> FALSE then Warnlog "Reduce gradients => changes not saved!"
   if ReduceBitmaps.IsChecked <> FALSE then Warnlog "Reduce bitmaps => changes not saved!"
   if ConvertColorsToGrayscale.IsChecked <> TRUE then Warnlog "Convert colors to grayscale => changes not saved!"

 printlog "    - check general settings"
   if PaperOrientation.IsChecked <> FALSE then warnlog "Paper orientation => changes not saved!"
   if PaperSize.IsChecked        <> TRUE  then Warnlog "Paper size => changes not saved! #i29960"

 printlog " - reset to saved settings"
 printlog "    - 'printer'"
  Printer.Check
  Sleep (2)
   ReduceTransparency.Check
   if lbSavePrinter (2)  = TRUE then Automatically.Check
   if lbSavePrinter (3)  = TRUE then NoTransparency.Check
   ReduceTransparency.UnCheck
   if lbSave(3)          = TRUE then Transparency.Check       else Transparency.Uncheck
   if lbSavePrinter (1)  = TRUE then ReduceTransparency.check else ReduceTransparency.Uncheck

   ReduceGradients.Check
   GradientStripes.Check
   Stripes.SetText lsSavePrinter (1)
   if lbSavePrinter (5)  = TRUE then GradientStripes.Check
   if lbSavePrinter (6)  = TRUE then IntermediateColor.Check
   if lbSavePrinter (4)  = TRUE then ReduceGradients.Check else ReduceGradients.UnCheck
   if lbSavePrinter (4)  = TRUE then ReduceGradients.Check else ReduceGradients.UnCheck

   ReduceBitmaps.Check
   Resolution.Check
   DPI.Select lsSavePrinter (2)
   if lbSavePrinter (8)  = TRUE then GoodPrintQuality.Check
   if lbSavePrinter (9)  = TRUE then NormalPrintQuality.Check
   if lbSavePrinter (10) = TRUE then Resolution.Check
   if lbSavePrinter (11) = TRUE then IncludeTransparentObjects.Check else IncludeTransparentObjects.UnCheck
   if lbSavePrinter (7)  = TRUE then ReduceBitmaps.Check else ReduceBitmaps.UnCheck

   if lbSavePrinter (12) = TRUE then ConvertColorsToGrayscale.Check else ConvertColorsToGrayscale.UnCheck

 printlog "    - 'print to file'"
  PrintToFile.Check
  Sleep (2)
   ReduceTransparency.Check
   if lbSaveFile (2)  = TRUE then Automatically.Check
   if lbSaveFile (3)  = TRUE then NoTransparency.Check
   if lbSaveFile (1)  = TRUE then ReduceTransparency.Check else ReduceTransparency.UnCheck

   ReduceGradients.Check
   GradientStripes.Check
   Stripes.SetText lsSaveFile (1)
   if lbSaveFile (5)  = TRUE then GradientStripes.Check
   if lbSaveFile (6)  = TRUE then IntermediateColor.Check
   if lbSaveFile (4)  = TRUE then ReduceGradients.Check else ReduceGradients.UnCheck

   ReduceBitmaps.Check
   Resolution.Check
   DPI.Select lsSaveFile (2)
   if lbSaveFile (8)  = TRUE then GoodPrintQuality.Check
   if lbSaveFile (9)  = TRUE then NormalPrintQuality.Check
   if lbSaveFile (10) = TRUE then Resolution.Check
   if lbSaveFile (11) = TRUE then IncludeTransparentObjects.Check else IncludeTransparentObjects.UnCheck
   if lbSaveFile (7)  = TRUE then ReduceBitmaps.Check else ReduceBitmaps.Uncheck

   if lbSaveFile (12) = TRUE then ConvertColorsToGrayscale.Check else ConvertColorsToGrayscale.UnCheck

 printlog "    - general settings"
   if lbSave(1) = TRUE then PaperOrientation.check else PaperOrientation.Uncheck
   if lbSave(2) = TRUE then PaperSize.Check else PaperSize.UnCheck

   Kontext "ExtrasOptionenDlg"
   ExtrasOptionenDlg.OK
   Sleep (3)

 printlog " - check changes"
   ToolsOptions
   hToolsOptions ( "StarOffice", "Print" )

 printlog "    - check for 'printer'"
  Printer.Check
  Sleep (2)
   if ReduceTransparency.IsChecked        <> lbSavePrinter (1)  then Warnlog "Reduce transparency => changes not saved!"
   ReduceTransparency.Check
   if Automatically.IsChecked             <> lbSavePrinter (2)  then Warnlog "Automatically => changes not saved!"
   if NoTransparency.IsChecked            <> lbSavePrinter (3)  then Warnlog "No transparency => changes not saved!"
   ReduceTransparency.UnCheck
   if Transparency.IsChecked              <> lbSave(3)          then Warnlog "Transparency => changes not saved!"
   if lbSavePrinter (1) = TRUE then ReduceTransparency.Check else ReduceTransparency.UnCheck

   if ReduceGradients.IsChecked           <> lbSavePrinter (4) then Warnlog "Reduce Gradients => changes not saved!"
   ReduceGradients.Check
   if GradientStripes.IsChecked           <> lbSavePrinter (5)  then Warnlog "GradientStripes => changes not saved!"
   if IntermediateColor.IsChecked         <> lbSavePrinter (6)  then Warnlog "Intermediate color => changes not saved!"
   GradientStripes.Check
   if Stripes.GetText <> lsSavePrinter (1)                      then Warnlog "Stripes => changes not saved!"
   if lbSavePrinter (5) = TRUE then GradientStripes.Check else IntermediateColor.Check
   if lbSavePrinter (4)  = TRUE then ReduceGradients.Check else ReduceGradients.UnCheck

   if ReduceBitmaps.IsChecked <> lbSavePrinter (7) then Warnlog "Reduce Bitmaps => changes not saved!"
   ReduceBitmaps.Check
   if GoodPrintQuality.IsChecked          <> lbSavePrinter (8)  then Warnlog "Good print quality => changes not saved!"
   if NormalPrintQuality.IsChecked        <> lbSavePrinter (9)  then Warnlog "Normal print quality => changes not saved!"
   if Resolution.IsChecked                <> lbSavePrinter (10) then Warnlog "Resolution => changes not saved!"
   if IncludeTransparentObjects.IsChecked <> lbSavePrinter (11) then Warnlog "Include transparent objects => changes not saved!"
   Resolution.Check
   if DPI.GetSelText <> lsSavePrinter (2)                       then Warnlog "DPI => changes not saved!"
   if lbSavePrinter (8)  = TRUE then GoodPrintQuality.Check
   if lbSavePrinter (9)  = TRUE then NormalPrintQuality.Check
   if lbSavePrinter (10) = TRUE then Resolution.Check
   if lbSavePrinter (7)  = TRUE then ReduceBitmaps.Check else ReduceBitmaps.Uncheck

   if ConvertColorsToGrayscale.IsChecked  <> lbSavePrinter (12) then Warnlog "Convert colors to grayscale => changes not saved!"

 printlog "    - 'print to file'"
  PrintToFile.Check
  Sleep (2)
   if ReduceTransparency.IsChecked        <> lbSaveFile (1)  then Warnlog "Reduce transparency => changes not saved!"
   ReduceTransparency.Check
   if Automatically.IsChecked             <> lbSaveFile (2)  then Warnlog "Automatically => changes not saved!"
   if NoTransparency.IsChecked            <> lbSaveFile (3)  then Warnlog "No transparency => changes not saved!"
   if lbSaveFile (1) = TRUE then ReduceTransparency.Check else ReduceTransparency.UnCheck

   if ReduceGradients.IsChecked           <> lbSaveFile (4) then Warnlog "Reduce Gradients => changes not saved!"
   ReduceGradients.Check
   if GradientStripes.IsChecked           <> lbSaveFile (5)  then Warnlog "GradientStripes => changes not saved!"
   if IntermediateColor.IsChecked         <> lbSaveFile (6)  then Warnlog "Intermediate color => changes not saved!"
   GradientStripes.Check
   if Stripes.GetText <> lsSaveFile (1)                      then Warnlog "Stripes => changes not saved!"
   if lbSaveFile (5) = TRUE then GradientStripes.Check else IntermediateColor.Check
   if lbSaveFile (4)  = TRUE then ReduceGradients.Check else ReduceGradients.UnCheck

   if ReduceBitmaps.IsChecked <> lbSaveFile (7) then Warnlog "Reduce Bitmaps => changes not saved!"
   ReduceBitmaps.Check
   if GoodPrintQuality.IsChecked          <> lbSaveFile (8)  then Warnlog "Good print quality => changes not saved!"
   if NormalPrintQuality.IsChecked        <> lbSaveFile (9)  then Warnlog "Normal print quality => changes not saved!"
   if Resolution.IsChecked                <> lbSaveFile (10) then Warnlog "Resolution => changes not saved!"
   if IncludeTransparentObjects.IsChecked <> lbSaveFile (11) then Warnlog "Include transparent objects => changes not saved!"
   Resolution.Check
   if DPI.GetSelText <> lsSavePrinter (2)                       then Warnlog "DPI => changes not saved!"
   if lbSaveFile (8)  = TRUE then GoodPrintQuality.Check
   if lbSaveFile (9)  = TRUE then NormalPrintQuality.Check
   if lbSaveFile (10) = TRUE then Resolution.Check
   if lbSaveFile (7)  = TRUE then ReduceBitmaps.Check else ReduceBitmaps.Uncheck

   if ConvertColorsToGrayscale.IsChecked  <> lbSaveFile (12) then Warnlog "Convert colors to grayscale => changes not saved!"

 printlog "    - general settings"
   if PaperOrientation.Ischecked          <> lbSave(1)       then Warnlog "Paper orientation => changes not saved!"
   if PaperSize.IsChecked                 <> lbSave(2)       then Warnlog "Paper size. => changes not saved!"

   Kontext "ExtrasOptionenDlg"
   ExtrasOptionenDlg.OK
   Sleep (3)
endcase