1 '**************************************************************************
2 '* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 '* Copyright 2008 by Sun Microsystems, Inc.
6 '* OpenOffice.org - a multi-platform office productivity suite
8 '* $RCSfile: wr_o_a.inc,v $
12 '* last change: $Author: vg $ $Date: 2008-08-18 12:33:41 $
14 '* This file is part of OpenOffice.org.
16 '* OpenOffice.org is free software: you can redistribute it and/or modify
17 '* it under the terms of the GNU Lesser General Public License version 3
18 '* only, as published by the Free Software Foundation.
20 '* OpenOffice.org is distributed in the hope that it will be useful,
21 '* but WITHOUT ANY WARRANTY; without even the implied warranty of
22 '* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 '* GNU Lesser General Public License version 3 for more details
24 '* (a copy is included in the LICENSE file that accompanied this code).
26 '* You should have received a copy of the GNU Lesser General Public License
27 '* version 3 along with OpenOffice.org. If not, see
28 '* <http://www.openoffice.org/license.html>
29 '* for a copy of the LGPLv3 License.
31 '/************************************************************************
33 '* owner : helge.delfs@sun.com
35 '* short description : Writer options test
37 '************************************************************************
39 ' #1 tToolsOptionsWriterPrint
40 ' #1 tToolsOptionsWriterTableMove
41 ' #1 tToolsOptionsWriterTableInsert
42 ' #1 tToolsOptionsWriterTableEffects
43 ' #1 tToolsOptionsWriterTableEffects2
44 ' #1 tToolsOptionsWriterDirectCursor2
46 '\***********************************************************************
48 testcase tToolsOptionsWriterPrint
49 ' called after my save/restart testing
50 ' The real print with paper to touch - and to get from the printer :-(
53 printlog "- Tools/Options/Writer: PrintWriter (real print)"
54 Call hFileOpen ( gTesttoolPath + "writer\optional\input\options\options3.sxw" )
55 Call sMakeReadOnlyDocumentEditable
57 Printlog " - check all (real print)"
59 Call hToolsOptions("WRITER","PRINT")
74 AusDruckereinstellung.Check
76 Kontext "ExtrasOptionenDlg"
79 if (NO_REAL_PRINT = False) Then
81 kontext "funktionsleiste"
84 Kontext "Druckbestaetigung"
85 if Druckbestaetigung.Exists then
95 Call hToolsOptions("WRITER","PRINT")
97 Printlog " - uncheck everything"
102 Kontrollfelder.UnCheck
104 SchwarzDrucken.UnCheck
105 LinkeSeiten.Check ' that's so, otherwise there will be no printing
106 RechteSeiten.Check ' that's so, otherwise there will be no printing
110 AusDruckereinstellung.UnCheck
112 Kontext "ExtrasOptionenDlg"
116 if (NO_REAL_PRINT = False) Then
117 Printlog " - print 2"
118 kontext "funktionsleiste"
121 Kontext "Druckbestaetigung"
122 if Druckbestaetigung.Exists then
131 Do Until GetDocumentCount = 0
134 Call wOptionsUndo ( "Drucken" )
137 '------------------------------------------------------------------------------
139 testcase tToolsOptionsWriterTableMove
141 Dim Spalte1 as Double
142 Dim Spalte2 as Double
145 Dim Abstaende(3) as Double
148 Dim VerschubZeile as Double
149 Dim VerschubSpalte as Double
150 Dim sSeparator as string
153 ' Hints if there are some errors:
154 ' win2000: Start::Systemsteuerung::Laendereinstellungen::Gebietsschema
155 ' winXP : Sart::ControlPanel::Regional and Language Options:: Region Options:: Standards&formats
157 '/// New writerdocument
159 ToolsOptions ' Measurement unit should be set to cm
160 Call hToolsOptions("WRITER","GENERAL")
161 '/// Set measurement unit to cm in options
163 sSeparator = GetDecimalSeperator ( Tabulatorenabstand.GetText )
164 Kontext "ExtrasOptionenDlg"
166 printlog "'///- Tools / Options / Table: Move"
167 '/// Tools / Options / Table
169 Call hToolsOptions("WRITER","TABLE")
171 Printlog "'/// - check minimum settings"
172 '/// check minimum settings
173 if gPlatform="solaris" then
174 sLager$ = sSeparator + "25" + mUnit
176 sLager$ = "0" + sSeparator + "25" + mUnit
178 VerschiebenZeile.ToMin
179 if sLager$ <> VerschiebenZeile.GetText then Warnlog "Move cells: Row isn't min ( " + sLager$ + " ) but " +VerschiebenZeile.GetText
180 VerschiebenSpalte.ToMin
181 if sLager$ <> VerschiebenSpalte.GetText then Warnlog "Move cells: Column isn't min ( " + sLager$ + " ) but " +VerschiebenZeile.GetText
183 Printlog "- make settings"
184 '/// make the following settings
185 '/// set move cells: row to 1.00
186 '/// set move cells: column to 1.25
187 VerschiebenZeile.SetText "1" + sSeparator + "00"
188 VerschiebenSpalte.SetText "1" + sSeparator + "25"
190 VerschubSpalte = 1.25
192 '/// check radiobutton 'Variable'
195 Kontext "ExtrasOptionenDlg"
198 Printlog "- Insert table"
201 Kontext "TabelleEinfuegenWriter"
202 '/// set rows an columns to 2
205 TabelleEinfuegenWriter.OK
207 Printlog "remember column width of inserted table"
208 Call wTypeKeys "<Left><Mod2 Down>"
209 Call wTypeKeys "<Left><Mod2 Up>"
211 ' ** Grundwerte der Tabelle holen ( alles schon in Double und rechenbar ) since 05.02.2001 ;-)
212 Spalte1 = SpaltenBreiteHolen
215 Kontext "Zellenhoehe"
216 sRow1 = Hoehe.GetText
219 Zeile1 = ZeilenHoeheHolen
220 Call wTypeKeys "<Right>"
221 Spalte2 = SpaltenBreiteHolen
222 Call wTypeKeys "<Down>"
224 Call wTypeKeys "<Up><Left>"
225 SeitenAbstaendeHolen ( Abstaende() )
229 Printlog "Startwerte"
230 Printlog "Width : Column 1: " & Spalte1 & " Column 2: " & Spalte2
231 Printlog "Height : Row 1: " & Zeile1 & " Row 2: " & Zeile2 & Chr(13)
233 Printlog "- with <Alt Left> downsize 1. column from right side"
234 Call wTypeKeys "<Mod2 Left>"
235 Call SpaltenBreiteTesten ( Spalte1-VerschubZeile )
236 Call SeitenAbstaendeTesten ( 0.00, VerschubZeile )
238 Printlog "- with <Shift Alt Right> downsize 1. column from left side"
239 Call wTypeKeys "<Shift Mod2 Right>"
240 Call SpaltenBreiteTesten ( Spalte1 - VerschubZeile *2 )
241 Call SeitenAbstaendeTesten ( VerschubZeile, VerschubZeile )
243 Printlog "- with <Alt Right> upsize 1. column to the right 2 times"
244 Call wTypeKeys "<Mod2 Right>"
245 Call wTypeKeys "<Mod2 Right>"
246 Call SpaltenBreiteTesten ( Spalte1 )
247 Call SeitenAbstaendeTesten ( VerschubZeile, 0 )
249 Printlog "- check size of 2. column"
250 Call wTypeKeys "<Right>"
251 Call SpaltenBreiteTesten ( Spalte2 - VerschubZeile )
252 Call SeitenAbstaendeTesten ( VerschubZeile, 0 )
254 Printlog "- with <Alt Left> upsize 2. column from left"
255 Call wTypeKeys "<Mod2 Left>"
257 Call SpaltenBreiteTesten ( Spalte2 - VerschubZeile*2 )
258 Call SeitenAbstaendeTesten ( VerschubZeile, VerschubZeile )
260 Printlog "- with <Shift Alt Right> downsize 2. column from left"
261 Call wTypeKeys "<Shift Mod2 Right>"
262 Call SpaltenBreiteTesten ( Spalte2 - VerschubZeile*3 )
263 Call SeitenAbstaendeTesten ( VerschubZeile*2, VerschubZeile )
265 Printlog "- with <Shift Alt Left> upsize 2. column to the left 2 times"
266 Call wTypeKeys "<Shift Mod2 Left>"
267 Call wTypeKeys "<Shift Mod2 Left>"
268 Call SpaltenBreiteTesten ( Spalte2-VerschubZeile )
269 Call SeitenAbstaendeTesten ( 0, VerschubZeile )
271 Printlog "- with <Shift Alt Left> upsize 2. column to the right"
272 Call wTypeKeys "<Shift Mod2 Left>"
273 Call SpaltenBreiteTesten ( Spalte2 )
274 Call SeitenAbstaendeTesten ( 0, 0 )
276 Printlog "- with <Alt Down> upsize 1. column down"
277 Call wTypeKeys "<Left><Mod2 Down>"
278 Call ZeilenHoeheTesten ( Zeile1+VerschubSpalte )
279 Call SeitenAbstaendeTesten ( 0, 0 )
281 Printlog "- with <Alt Up> downsize 1. column up"
282 Call wTypeKeys "<Mod2 Up>"
283 Call ZeilenHoeheTesten ( ( Zeile1 ) )
284 Call SeitenAbstaendeTesten ( 0, 0 )
287 Kontext "Zellenhoehe"
288 if (StrToDouble ( Hoehe.Gettext ) <> Zeile1 ) then
290 printlog " from now on, there is an offset to the original of 10mm"
291 Zeile2 = Zeile2 + ( StrToDouble ( Hoehe.Gettext ) - Zeile2 )
295 Printlog "- with <Alt Down> upsize 2. column down"
296 Call wTypeKeys "<Right><Mod2 Down>"
297 Call ZeilenHoeheTesten ( Zeile2+VerschubSpalte*2/2 )
298 Call SeitenAbstaendeTesten ( 0, 0 )
300 Printlog "- with <Alt Up> downsize 2. column up"
301 Call wTypeKeys "<Mod2 Up>"
302 Call ZeilenHoeheTesten ( Zeile2 )
303 Call SeitenAbstaendeTesten ( 0, 0 )
305 Do Until GetDocumentCount = 0
308 Call wOptionsUndo "Tabelle"
311 '------------------------------------------------------------------------------
313 testcase tToolsOptionsWriterTableInsert
315 Dim Spalte1 as Double
316 Dim Spalte2 as Double
318 Dim VerschubZeile as Double
319 Dim VerschubSpalte as Double
320 Dim sSeparator as string
324 printlog "- Tools / Options / Table"
326 Call hToolsOptions("WRITER","TABLE")
328 Printlog "- make settings"
329 sSeparator = GetDecimalSeperator(EinfuegenZeile.GetText)
330 EinfuegenZeile.SetText "0" + sSeparator + "73"
332 EinfuegenSpalte.SetText "3" + sSeparator + "15"
333 VerschubSpalte = 3.15
336 Kontext "ExtrasOptionenDlg"
339 Printlog "- Insert a table"
342 Kontext "TabelleEinfuegenWriter"
345 TabelleEinfuegenWriter.OK
347 ' ** Grundwerte der Tabelle holen ( alles schon in Double und rechenbar )
348 Spalte1 = SpaltenBreiteHolen
349 Zeile = ZeilenHoeheHolen
350 Call wTypeKeys "<Right>"
351 Spalte2 = SpaltenBreiteHolen
354 Printlog "- with <Alt Insert><Up> insert a row from top"
355 Call wTypeKeys "<Mod2 Insert><Up>"
356 Call ZeilenHoeheTesten ( VerschubZeile )
357 Call SeitenAbstaendeTesten ( 0.00, 0.00 )
358 Call ZeilenTesten ( 3 )
359 Call SpaltenTesten ( 2 )
361 Printlog "- with <Alt Insert><Down> insert a row from downside"
362 Call wTypeKeys "<Down><Mod2 Insert><Down>"
363 Call ZeilenHoeheTesten ( VerschubZeile )
364 Call ZeilenTesten ( 4 )
365 Call SpaltenTesten ( 2 )
367 Printlog "- with <Alt Delete><Up> delete 1. row from top"
368 Call wTypeKeys "<Mod2 Delete><Up>"
369 Call ZeilenHoeheTesten ( 0.01 )
370 Call ZeilenTesten ( 3 )
371 Call SpaltenTesten ( 2 )
373 Printlog "- with <Alt Delete><Down> delete 1. row from the button"
374 Call wTypeKeys "<Mod2 Delete><Down>"
375 Call ZeilenHoeheTesten ( VerschubZeile )
376 Call ZeilenTesten ( 2 )
377 Call SpaltenTesten ( 2 )
379 Printlog "- with <Alt Insert><Left> insert a column from left side"
380 Call wTypeKeys "<Mod2 Insert><Left>"
381 Call SpaltenBreiteTesten ( VerschubSpalte )
382 Call SeitenAbstaendeTesten ( 0.00, 0.00 )
383 Call ZeilenTesten ( 2 )
384 Call SpaltenTesten ( 3 )
386 Printlog "- with <Alt Insert><Right> insert a rown from right side"
387 Call wTypeKeys "<Right><Right><Mod2 Insert><Right>"
388 Call SpaltenBreiteTesten ( VerschubSpalte )
389 Call ZeilenTesten ( 2 )
390 Call SpaltenTesten ( 4 )
392 Printlog "- with <Alt Delete><Left> delete 1. Column from left side"
393 Call wTypeKeys "<Mod2 Delete><Left>"
394 DocumentWriter.TypeKeys "<Up>"
395 Call SpaltenBreiteTesten ( Spalte1-VerschubSpalte )
396 Call ZeilenTesten ( 2 )
397 Call SpaltenTesten ( 3 )
398 Call wTypeKeys "<Right>"
399 Call SeitenAbstaendeTesten ( VerschubSpalte, 0.00 )
401 Printlog "- with <Alt Delete><Right> delete last column from right side"
402 Call wTypeKeys "<Right><Right><Mod2 Delete><Right>"
403 Call SpaltenBreiteTesten ( Spalte2-VerschubSpalte )
404 Call ZeilenTesten ( 2 )
405 Call SpaltenTesten ( 2 )
406 Call SeitenAbstaendeTesten ( VerschubSpalte, Spalte2 -VerschubSpalte )
408 Do Until GetDocumentCount = 0
411 Call wOptionsUndo "Tabelle"
414 ' ************************************************************************
416 testcase tToolsOptionsWriterTableEffects
417 Dim Spalte1 as Double
418 Dim Spalte2 as Double
419 Dim Spalte3 as Double
420 Dim VerschubZeile as Double
424 printlog "- Tools / Options / Table"
426 Call hToolsOptions("WRITER","TABLE")
427 VerschubZeile = ZahlAusSpinnfield ( VerschiebenZeile.GetText )
429 Kontext "ExtrasOptionenDlg"
432 printlog "- Fixed: changes affect the adjacent area only"
435 Kontext "TabelleEinfuegenWriter"
438 TabelleEinfuegenWriter.OK
440 Spalte1 = SpaltenBreiteHolen
441 Call wTypeKeys "<Right>"
442 Spalte2 = SpaltenBreiteHolen
443 Call wTypeKeys "<Right>"
444 Spalte3 = SpaltenBreiteHolen
445 Kontext "DocumentWriter"
446 DocumentWriter.TypeKeys "<Left>", 3
448 Printlog "- with <Alt Left> downsize 1. Column from right side"
449 Call wTypeKeys "<Mod2 Left>"
450 Call SpaltenBreiteTesten ( Spalte1-VerschubZeile )
451 Call wTypeKeys "<Right>"
452 Call SpaltenBreiteTesten ( Spalte2+VerschubZeile )
453 Call wTypeKeys "<Right>"
454 Call SpaltenBreiteTesten ( Spalte3 )
455 Call SeitenAbstaendeTesten ( 0.00, 0.00 )
457 Kontext "DocumentWriter"
458 DocumentWriter.TypeKeys "<Left>", 3
459 Printlog "- with <Alt Shift Right> no changes should be happen"
460 Call wTypeKeys "<Mod2 Shift Left>"
461 Call SpaltenBreiteTesten ( Spalte1-VerschubZeile )
462 Call wTypeKeys "<Right>"
463 Call SpaltenBreiteTesten ( Spalte2+VerschubZeile )
464 Call wTypeKeys "<Right>"
465 Call SpaltenBreiteTesten ( Spalte3 )
466 Call SeitenAbstaendeTesten ( 0.00, 0.00 )
468 Kontext "DocumentWriter"
469 DocumentWriter.TypeKeys "<Left>", 3
470 Printlog "- with <Alt Right> re-establish initial state ///"
471 Call wTypeKeys "<Mod2 Right>"
472 Call SpaltenBreiteTesten ( Spalte1 )
473 Call wTypeKeys "<Right>"
474 SpaltenBreiteTesten ( Spalte2 )
475 Call wTypeKeys "<Right>"
476 SpaltenBreiteTesten ( Spalte3 )
477 SeitenAbstaendeTesten ( 0.00, 0.00 )
479 Printlog "- with <Alt Down> row will be upsized ///"
480 Call wTypeKeys "<Mod2 Down>"
481 Call ZeilenHoeheTesten ( 1.17 )
482 Call SeitenAbstaendeTesten ( 0.00, 0.00 )
484 if iSprache <> 01 then
485 Printlog "- with <Alt Up> row gets initial state"
486 Call wTypeKeys "<Mod2 Up>"
487 Call ZeilenHoeheTesten ( 0.7 )
488 Call SeitenAbstaendeTesten ( 0.00, 0.00 )
490 Printlog "- with <Alt Shift Up> row will be upsized"
491 Call wTypeKeys "<Mod2 Shift Up>"
492 Call ZeilenHoeheTesten ( 1.17 )
493 Call SeitenAbstaendeTesten ( 0.00, 0.00 )
495 Printlog "- with <Alt Shift Down> column gets initial state"
496 Call wTypeKeys "<Mod2 Shift Down>"
497 Call ZeilenHoeheTesten ( 0.7 )
498 Call SeitenAbstaendeTesten ( 0.00, 0.00 )
503 printlog "- Fixed, proportional: Changes affect the entire table"
505 Call hToolsOptions("WRITER","TABLE"
506 FixProportional.Check
507 Kontext "ExtrasOptionenDlg"
511 Kontext "TabelleEinfuegenWriter"
514 TabelleEinfuegenWriter.OK
516 Printlog "- with <Alt Left> downsize 1. column from right"
517 Call wTypeKeys "<Mod2 Left>"
518 Call SpaltenBreiteTesten ( Spalte1-VerschubZeile )
519 Call wTypeKeys "<Right>"
520 Call SpaltenBreiteTesten ( Spalte2+VerschubZeile/2 )
521 Call wTypeKeys "<Right>"
522 Call SpaltenBreiteTesten ( Spalte3+VerschubZeile/2 )
523 Call SeitenAbstaendeTesten ( 0.00, 0.00 )
525 Kontext "DocumentWriter"
526 DocumentWriter.TypeKeys "<Left>", 3
527 Printlog "- with <Alt Shift Right> nothing should happen"
528 Call wTypeKeys "<Mod2 Shift Left>"
529 Call SpaltenBreiteTesten ( Spalte1-VerschubZeile )
530 Call wTypeKeys "<Right>"
531 Call SpaltenBreiteTesten ( Spalte2+VerschubZeile/2 )
532 Call wTypeKeys "<Right>"
533 Call SpaltenBreiteTesten ( Spalte3+VerschubZeile/2 )
534 Call SeitenAbstaendeTesten ( 0.00, 0.00 )
536 Kontext "DocumentWriter"
537 DocumentWriter.TypeKeys "<Left>", 3
538 Printlog "- with <Alt Right> reach initial state"
539 Call wTypeKeys "<Mod2 Right>"
540 Call SpaltenBreiteTesten ( Spalte1 )
541 Call wTypeKeys "<Right>"
542 Call SpaltenBreiteTesten ( Spalte2 )
543 Call wTypeKeys "<Right>"
544 Call SpaltenBreiteTesten ( Spalte3 )
545 Call SeitenAbstaendeTesten ( 0.00, 0.00 )
547 if iSprache <> 01 then
548 Printlog "- with <Alt Down> row will be upsized"
549 Call wTypeKeys "<Mod2 Down>"
550 Call ZeilenHoeheTesten ( 1.2 )
551 Call SeitenAbstaendeTesten ( 0.00, 0.00 )
553 Printlog "- with <Alt Up> column gets intitial state"
554 Call wTypeKeys "<Mod2 Up>"
555 Call ZeilenHoeheTesten ( 0.7 )
556 Call SeitenAbstaendeTesten ( 0.00, 0.00 )
558 Printlog "- with <Alt Shift Up> column will be upsized"
559 Call wTypeKeys "<Mod2 Shift Up>"
560 Call ZeilenHoeheTesten ( 1.2 )
561 Call SeitenAbstaendeTesten ( 0.00, 0.00 )
563 Printlog "- with <Alt Shift Down> column gets initial state"
564 Call wTypeKeys "<Mod2 Shift Down>"
565 Call ZeilenHoeheTesten ( 0.7 )
566 Call SeitenAbstaendeTesten ( 0.00, 0.00 )
568 Call wOptionsUndo "Tabelle"
570 Do Until GetDocumentCount = 0
575 '------------------------------------------------------------------------------
577 testcase tToolsOptionsWriterTableEffects2
578 Dim Spalte1 as Double
579 Dim vSeparator as string
580 Dim VerschubZeile as Double
582 vSeparator = GetDecimalSeperator
584 printlog "- Tools / Options / Table"
585 printlog "- Effect options should work immediately"
590 Kontext "TabelleEinfuegenWriter"
593 TabelleEinfuegenWriter.OK
595 Spalte1 = SpaltenBreiteHolen
598 Call hToolsOptions("WRITER","TABLE")
599 VerschubZeile = ZahlAusSpinnfield ( VerschiebenZeile.GetText )
600 if NOT Variabel.IsChecked then
601 Warnlog "Variable is not checked so test will be interrupted here"
604 printlog "- change 'Behaviour of columns/rows to 'Fix'"
607 Kontext "ExtrasOptionenDlg"
610 printlog "- resize cell with <Alt Left>"
611 Call wTypeKeys "<Mod2 Left>"
612 Call SpaltenBreiteTesten ( ( Spalte1-VerschubZeile ) )
616 Active.SetPage TabTabelle
618 if ZahlAusSpinnfield ( NachRechts.GetText ) <> "0" then
619 Warnlog "Table size has been changed though 'Behaviour of rows/columns has been set to 'Fix'"
623 Do Until GetDocumentCount = 0
626 Call wOptionsUndo "Tabelle"
629 '------------------------------------------------------------------------------
631 testcase tToolsOptionsWriterDirectCursor2
632 printlog "- Tools / Options / Direct Cursor / Left paragraph margin"
640 Printlog "- set left paragraph margin"
642 Call hToolsOptions("WRITER","FORMATTINGAIDS")
644 LinkerAbsatzrand.Check
645 Kontext "ExtrasOptionenDlg"
647 Printlog "- set cursor to the right"
648 Kontext "DocumentWriter"
649 DocumentWriter.MouseDoubleClick 80, 60
650 DocumentWriter.Mousemove 20, 50
651 DocumentWriter.TypeKeys "Right"
654 Active.SetPage TabAusrichtungAbsatz
655 Kontext "TabAusrichtungAbsatz"
656 if NOT Links.IsChecked then Warnlog "Cursor set to right but it isn't left aligned"
657 TabAusrichtungAbsatz.Cancel
658 Kontext "DocumentWriter"
659 DocumentWriter.TypeKeys "<Shift Home>"
662 if GetClipboardText = "" then Warnlog "Maybe tabs or spaces inserted"
666 Vergroesserung100.Check
669 Do Until GetDocumentCount = 0
672 Call wOptionsUndo "Cursor"
675 '------------------------------------------------------------------------------