1 'encoding UTF-8 Do not remove or change this line!
2 '**************************************************************************
3 '* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 '* Copyright 2008 by Sun Microsystems, Inc.
7 '* OpenOffice.org - a multi-platform office productivity suite
9 '* $RCSfile: w_204_.inc,v $
13 '* last change: $Author: vg $ $Date: 2008-08-18 12:36:50 $
15 '* This file is part of OpenOffice.org.
17 '* OpenOffice.org is free software: you can redistribute it and/or modify
18 '* it under the terms of the GNU Lesser General Public License version 3
19 '* only, as published by the Free Software Foundation.
21 '* OpenOffice.org is distributed in the hope that it will be useful,
22 '* but WITHOUT ANY WARRANTY; without even the implied warranty of
23 '* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 '* GNU Lesser General Public License version 3 for more details
25 '* (a copy is included in the LICENSE file that accompanied this code).
27 '* You should have received a copy of the GNU Lesser General Public License
28 '* version 3 along with OpenOffice.org. If not, see
29 '* <http://www.openoffice.org/license.html>
30 '* for a copy of the LGPLv3 License.
32 '/************************************************************************
34 '* owner : helge.delfs@sun.com
36 '* short description : Writer Table Test
38 '*************************************************************************
52 '\***********************************************************************
61 Call tTableNumberFormat
69 '/// Check Tables' default Option ///
70 printlog "/// Check Tables' default Option ///"
74 '/// TOOLS->OPTIONS->StarOffice Writer->Table ///"
75 '/// Number recognition should be OFF by default///"
76 '/// two boxes below are checked but disabled ///"
79 Call hToolsOptions ("WRITER","Table")
80 if AutomatischeZahlenerkennung.IsChecked then
81 warnlog "The default for 'Number recognition' should be OFF => 114166 "
82 AutomatischeZahlenerkennung.UnCheck
84 if AutomatischeAusrichtung.IsChecked then
86 AutomatischeAusrichtung.UnCheck
87 warnlog "'Number format recognition' should be disabled => 114166 "
91 warnlog "'Number format recognition' should be checked => 114166 "
93 if Zahlenformaterkennung.IsChecked then
95 Zahlenformaterkennung.UnCheck
96 warnlog "'Alignment' should be disabled => 114166 "
100 warnlog "'Alignment' should be checked => 114166 "
103 Kontext "ExtrasOptionenDlg"
104 ExtrasOptionenDlg.Cancel
110 ' --------------------------------------------------------------------
112 testcase tTableInsert1
116 Kontext "DocumentWriter"
118 Printlog "'/// 1. Insert Toolbox -> Insert Table ///"
119 Call hToolbarSelect ( "Insert", True )
122 Kontext "TabelleEinfuegenWriter"
123 TabellenName.SetText "one"
125 TabelleEinfuegenWriter.OK
126 Call wTypeKeys "one<down>"
128 Printlog "'///+ ... play with number recognition in TOOLS->OPTIONS->TextDoc->Table ///"
129 Printlog "'///+ ... Number recognition OFF ///"
131 Call hToolsOptions ("WRITER","Table")
132 AutomatischeZahlenerkennung.UnCheck
133 Kontext "ExtrasOptionenDlg"
137 Call hToolbarSelect ( "Table", true )
139 Call wTypeKeys "<down>11111<Tab>1"+cSep+"116111<Tab>1"+cDecSep+"116111<Tab>abcd<shift tab><shift tab><shift tab>"
143 Kontext "Zahlenformat"
144 if (Kategorie.GetSelText <> fLocaleString("LocaleText")) then
145 warnlog "wrong format; is: "+Kategorie.GetSelText+" should: "+fLocaleString("LocaleText") ' Text
150 Active.SetPage tabAusrichtungAbsatz
151 Kontext "tabAusrichtungAbsatz"
152 if (links.isChecked <> true) then warnlog "wrong alignment of tablefield: "+i
153 TabAusrichtungAbsatz.Cancel
154 Call wTypeKeys "<Tab>"
156 ' go back to start of table
157 Call wTypeKeys "<Mod1 Home><Down>"
159 Printlog "'///+ ... Number recognition ON - ///"
161 Call hToolsOptions ("WRITER","Table")
162 AutomatischeZahlenerkennung.Check ' even with that, everything is a TEXT :-(????
163 Zahlenformaterkennung.UnCheck ' much better with that! everything with numbers&decimalsep is number with 2 decimal places displayed, but all kept!!!
164 AutomatischeAusrichtung.UnCheck ' just the allignment does change too!
165 Kontext "ExtrasOptionenDlg"
168 Call hToolbarSelect ( "Table", true )
170 Call wTypeKeys "<down>11111<Tab>1"+cSep+"116111<Tab>1"+cDecSep+"116111<Tab>abcd<shift tab><shift tab><shift tab>"
173 Kontext "Zahlenformat"
174 if (Kategorie.GetSelText <> fLocaleString("LocaleText")) then
175 warnlog "wrong format; is: "+Kategorie.GetSelText+" should: "+fLocaleString("LocaleText") ' Text
180 Active.SetPage tabAusrichtungAbsatz
181 Kontext "TabAusrichtungAbsatz"
182 if (Links.IsChecked = false) then warnlog "wrong alignment of tablefield: "+i
183 TabAusrichtungAbsatz.Cancel
184 Call wTypeKeys "<Tab>"
186 Call wTypeKeys "<Mod1 Home><Down>"
188 Printlog "'///+ ... Number recognition ON - Number format recognition ///"
190 Call hToolsOptions ("WRITER","Table")
191 AutomatischeZahlenerkennung.Check ' even with that, everything is a TEXT :-(????
192 Zahlenformaterkennung.Check ' much better with that! everything with numbers&decimalsep is number with 2 decimal places displayed, but all kept!!!
193 AutomatischeAusrichtung.UnCheck ' just the allignment does change too!
194 Kontext "ExtrasOptionenDlg"
196 Call hToolbarSelect ( "Table", true )
198 Call wTypeKeys "<down>11111<Tab>1"+cSep+"116111<Tab>1"+cDecSep+"116111<Tab>abcd<shift tab><shift tab><shift tab>"
199 ' number, text, number, text
202 Kontext "Zahlenformat"
205 if (Kategorie.GetSelText <> fLocaleString("LocaleNumber")) then
206 warnlog "wrong format; "+ i +"; is: "+Kategorie.GetSelText+" should: "+fLocaleString("LocaleNumber") ' Number
209 if (Kategorie.GetSelText <> fLocaleString("LocaleText")) then
210 warnlog "wrong format; "+ i +"; is: "+Kategorie.GetSelText+" should: "+fLocaleString("LocaleText") ' Text
214 Call wTypeKeys "<Tab>"
216 Call wTypeKeys "<Mod1 Home><Down>"
218 Printlog "'///+ ... Number recognition ON - Number format recognition - Alignment ///"
220 Call hToolsOptions ("WRITER","Table")
221 AutomatischeZahlenerkennung.Check ' even with that, everything is a TEXT :-(????
222 Zahlenformaterkennung.Check ' much better with that! everything with numbers&decimalsep is number with 2 decimal places displayed, but all kept!!!
223 AutomatischeAusrichtung.Check ' just the allignment does change too!
224 Kontext "ExtrasOptionenDlg"
226 Call hToolbarSelect ( "Table", true )
228 Call wTypeKeys "<down>11111<Tab>1"+cSep+"116111<Tab>1"+cDecSep+"116111<Tab>abcd<shift tab><shift tab><shift tab>"
229 ' number-right, text-left, number-right, text-left
234 Kontext "Zahlenformat"
235 if (Kategorie.GetSelText <> fLocaleString("LocaleNumber")) then
236 warnlog "wrong format; "+ i +"; is: "+Kategorie.GetSelText+" should: "+fLocaleString("LocaleNumber") ' number
241 Active.SetPage tabAusrichtungAbsatz
242 Kontext "tabAusrichtungAbsatz"
243 if (rechts.isChecked <> true) then warnlog "wrong alignment of tablefield: "+i +"; should: right"
244 tabausrichtungabsatz.Cancel
247 Kontext "Zahlenformat"
248 if (Kategorie.GetSelText <> fLocaleString("LocaleText")) then
249 warnlog "wrong format; is: "+ i +"; "+Kategorie.GetSelText+" should: "+fLocaleString("LocaleText") ' Text
254 Active.SetPage TabAusrichtungAbsatz
255 Kontext "TabAusrichtungAbsatz"
256 if (links.isChecked <> true) then warnlog "wrong alignment of tablefield: "+i+"; should: left"
257 TabAusrichtungAbsatz.Cancel
259 Call wTypeKeys "<Tab>"
266 ' --------------------------------------------------------------------
268 testcase tTableInsert2
271 Printlog "'/// 2. Insert Toolbox -> Insert Table -> Autoformat ///"
273 Call hToolbarSelect ( "Insert", True )
276 Kontext "TabelleEinfuegenWriter"
280 Kontext "AutoformatTabelle"
282 Kontext "TabelleEinfuegenWriter"
283 TabellenName.SetText "two"
284 TabelleEinfuegenWriter.OK
291 ' --------------------------------------------------------------------
292 testcase tTableInsert3
295 dim itemp(3) as integer
298 Printlog "'/// 3. Menu: Insert -> Table (Shortcut): {strg} + {F12} ///"
299 Printlog "'///+ Test Options on 'Insert Table' ///"
300 Printlog "'///+ Header ON ///"
301 ' table heading active
302 ' Don't split table INactive
303 ' table border unchecked
304 Call wTypeKeys "<Mod1 F12>"
305 Kontext "TabelleEinfuegenWriter"
307 TabellenName.SetText "three"
311 TabelleEinfuegenWriter.OK
312 Call wTypeKeys "three"
314 ' -------------check if heading 1
315 ' if checked: heading; else: contents !! SystemLanguage dependent !! :-(
316 Printlog "'///+ check if Header ON ///"
317 Kontext "TextObjectbar"
319 sTemp = Vorlage.GetSelText
320 if (sTemp <> fLocaleString("LocaleTableHeading")) then
321 Warnlog "--- table heading did not work!"
322 warnlog "--- is:" + sTemp + ", should :" + fLocaleString("LocaleTableHeading")
324 '----------------------------------
325 Call wTypeKeys "<down>"
326 ' -------------check if splitting; it HAS TO split
327 Printlog "'///+ check if Table gets splitted - it HAS TO split ///"
329 InsertFieldsPagenumbers ' get pagenumber & leave it for next calculation
330 Call wTypeKeys "<Mod1 A>"
332 itemp(1) = val(GetClipboardText)
333 Call hToolbarSelect ( "Table", true )
335 ZeileEinfuegen.Click ' inserted below the current row
338 ToolsUpdateUpdateAll ' update field & get pagenumber & clear
339 Call wTypeKeys "<Left><Right>" ' Seems there are focus problems on Solaris...workaround
340 Call wTypeKeys "<Mod1 A>"
342 itemp(2) = val(GetClipboardText)
343 if (itemp(1)+1 = itemp(2)) then warnlog "--- Table moved to seconde page"
345 Call wTypeKeys "got start3"
347 Call wTypeKeys "<Mod1 end>" ' move to last cell in table
348 InsertFieldsPagenumbers ' get pagenumber & clear
349 Call wTypeKeys "<Mod1 A>"
351 itemp(3) = val(GetClipboardText)
352 if (itemp(2) <> itemp(3)) then
353 printlog "--- Table splitted" + itemp(3)
355 warnlog "put some more rows in!!!"
361 ' --------------------------------------------------------------------
362 testcase tTableInsert4
366 '/// Open a new writer document
368 '/// Insert some dummy text
369 if wBlindTextEinfuegen() = false then
373 '/// Insert a table with parameters:
375 Kontext "TabelleEinfuegenWriter"
377 '/// - Set table name: four
378 TabellenName.SetText "four"
379 '/// - number of columns: 5
381 '/// - number of rows: 16
383 '/// - Header: uncheck
385 '/// - Don't split table: check
386 TabelleNichtTrennen.Check
389 TabelleEinfuegenWriter.OK
391 '/// check if table has no header
392 Printlog "check if Header OFF"
393 Kontext "TextObjectbar"
395 if wStyleGet(fLocaleString("LocaleTableHeading")) = true then
396 Warnlog "Seems tableheader is activated though header is off"
399 '/// Cursor leaves table with <Up> and <End>
400 Printlog "check if Table gets splitted"
401 Call wTypeKeys "<Up><End><SPACE>"
402 '/// Insert dummy text again 3 times
403 Call wBlindtextEinfuegen
405 Call wBlindtextEinfuegen
407 Call wBlindtextEinfuegen
408 '/// check if table has been moved to Page 2
410 Call wTypeKeys "<Mod1 End>" ' jump to documents end
411 Call wTypeKeys "<Up>" ' move cursor into table
412 Call wTypeKeys "<Mod1 Home>" ' move cursor to first cell
414 '/// Insert / Fields / Pagenumbers to check on which page table is
415 InsertFieldsPagenumbers
416 Call wTypeKeys "<shift home>"
419 if (GetClipboardText = "2") or (GetClipboardText = "3") then
420 printlog "Table has been moved correctly"
422 warnlog " It seems table has been splitted"
425 '/// <B>Table should split if table is bigger than one page</B>
426 Call wTypeKeys "<Up>"
427 Call wTypeKeys "<shift mod1 home>"
428 Call wTypeKeys "<delete>"
429 Call wBlindtextEinfuegen
430 Call wTypeKeys "<mod1 End>"
431 Call wTypeKeys "<up>"
432 Call wTypeKeys "<mod1 Home>"
434 Printlog "Table should split"
435 Call hToolbarSelect ( "Table", true )
437 ZeileEinfuegen.Click ' inserted below the current row
439 Call wTypeKeys "<shift end>"
441 stemp = GetClipboardText
442 Call wTypeKeys "<ESCAPE>"
443 Call wTypeKeys "<mod1 End>"
444 InsertFieldsPagenumbers
445 Call wTypeKeys "<shift home>"
447 if (GetClipboardText <> stemp) then
448 printlog "Table has been splitted"
450 warnlog " It seems table has not been splitted"
456 ' --------------------------------------------------------------------
457 testcase tTableInsert5
460 '/// Insert Text with delimeter & call Tools -> Text<->Table
461 Printlog "'/// Insert Text with delimeter & call Tools -> Text<->Table ///"
462 Call wTypeKeys "five;2;3;4;5;<return>"
463 Call wTypeKeys "a;b;c;d;e;<return>"
464 Call wTypeKeys "A;B;C;D;E;"
465 Call wTypeKeys "<shift home>"
466 Call wTypeKeys "<shift up>"
467 Call wTypeKeys "<shift up>"
470 Kontext "TextInTabelleUmwandeln"
473 TextInTabelleUmwandeln.OK
474 Call wTypeKeys "<end><Mod1 end><down><return>"
479 ' --------------------------------------------------------------------
481 testcase tTableNumberFormat
484 Printlog "'/// Fill table with content: Tools->Options->TextDoc->Number formating/recognition check ALL ///"
485 '/// use table 5x10; and try to get every entry from format->numberFormat->Categorie ///'
487 Call TBOhTabelleEinfuegen ("six",0, 0, 0, 1,"5", "10" )
488 Call wTypeKeys "six<down>"
490 ToolsOptions ' set options for this test
491 Call hToolsOptions ("WRITER","Table")
492 AutomatischeZahlenerkennung.Check
493 Zahlenformaterkennung.Check
494 AutomatischeAusrichtung.Check
495 Kontext "ExtrasOptionenDlg"
498 printlog "Checking numberformater"
500 printlog " - Currency"
501 call wTypeKeys(fLocaleString("LocaleCurrencyValue"))
502 call wTypeKeys "<Tab><shift tab>"
504 Kontext "Zahlenformat"
505 if (Kategorie.GetSelIndex <> 5) then
506 warnlog "The value is not recognized as currency, it is " & Kategorie.GetSelText
508 printlog " - Value is correctly recognized as currency"
513 Active.SetPage tabAusrichtungAbsatz
514 Kontext "tabAusrichtungAbsatz"
515 if (rechts.isChecked <> true) then
516 warnlog "wrong alignment of number"
518 printlog " - Currencyvalue is correctly alligned"
520 TabAusrichtungAbsatz.Cancel
521 Call wTypeKeys "<home><shift end>"
523 if (GetClipboardText <> fLocaleString("LocaleCurrencyValue")) then
524 warnlog "The number is not correctly formated. It is: " & GetClipboardText & " but should be: " & fLocaleString("LocaleCurrencyValue")
526 printlog " - Currencyvalue is correctly formated"
529 '///+ - Unknown currency
530 printlog " - Unknown currency"
531 call wTypeKeys("10.78 §")
532 call wTypeKeys "<Tab><shift tab>"
535 Kontext "Zahlenformat"
536 if (Kategorie.GetSelIndex <> 11) then
537 warnlog "The value is not recognized as string, it is " & Kategorie.GetSelText
539 printlog " - Value is correctly recognized as string"
544 Active.SetPage tabAusrichtungAbsatz
545 Kontext "tabAusrichtungAbsatz"
546 if (links.isChecked <> true) then
547 warnlog "wrong alignment of number"
549 printlog " - Value is correctly alligned"
551 TabAusrichtungAbsatz.Cancel
552 Call wTypeKeys "<home><shift end>"
554 if (GetClipboardText <> "10.78 §") then
555 warnlog "The number is not correctly formated: should be 10.78 §, but is " & GetClipboardText
557 printlog " - Value is correctly formated"
562 call wTypeKeys(fLocaleString("LocaleDateValue"))
563 call wTypeKeys "<Tab><shift tab>"
566 Kontext "Zahlenformat"
567 if (Kategorie.GetSelIndex <> 6) then
568 warnlog "The value is not recognized as date, it is " & Kategorie.GetSelText
570 printlog " - Value is correctly recognized as date"
575 Active.SetPage tabAusrichtungAbsatz
576 Kontext "tabAusrichtungAbsatz"
577 if (rechts.isChecked <> true) then
578 warnlog "wrong alignment of number"
580 printlog " - Datevalue is correctly alligned"
582 TabAusrichtungAbsatz.Cancel
583 Call wTypeKeys "<home><shift end>"
585 if (GetClipboardText <> fLocaleString("LocaleDateOutput")) then
586 warnlog "The number is not correctly formated: should be " & fLocaleString("LocaleDateOutput") & ", but is " & GetClipboardText
588 printlog " - Datevalue is correctly formated"
593 call wTypeKeys(fLocaleString("LocaleTimeInput"))
594 call wTypeKeys "<Tab><shift tab>"
597 Kontext "Zahlenformat"
598 if (Kategorie.GetSelIndex <> 7) then
599 warnlog "The value is not recognized as time, it is " & Kategorie.GetSelText
601 printlog " - Value is correctly recognized as date"
606 Active.SetPage tabAusrichtungAbsatz
607 Kontext "tabAusrichtungAbsatz"
608 if (rechts.isChecked <> true) then
609 warnlog "wrong alignment of number"
611 printlog " - Timevalue is correctly alligned"
613 TabAusrichtungAbsatz.Cancel
614 Call wTypeKeys "<home><shift end>"
616 if (GetClipboardText <> fLocaleString("LocaleTimeValue")) then
617 warnlog "The number is not correctly formated: should be " & fLocaleString("LocaleTimeValue") & ", but is " & GetClipboardText
619 printlog " - Timevalue is correctly formated"
623 printlog " - Percent"
624 call wTypeKeys(fLocaleString("LocalePercentValue"))
625 call wTypeKeys "<Tab><shift tab>"
628 Kontext "Zahlenformat"
629 if (Kategorie.GetSelIndex <> 4) then
630 warnlog "The value is not recognized as percent, it is " & Kategorie.GetSelText
632 printlog " - Value is correctly recognized as percent"
637 Active.SetPage tabAusrichtungAbsatz
638 Kontext "tabAusrichtungAbsatz"
639 if (rechts.isChecked <> true) then
640 warnlog "wrong alignment of number"
642 printlog " - Percentvalue is correctly alligned"
644 TabAusrichtungAbsatz.Cancel
645 Call wTypeKeys "<home><shift end>"
647 if (GetClipboardText <> fLocaleString("LocalePercentValue")) then
648 warnlog "The number is not correctly formated: should be " & fLocaleString("LocalePercentValue") & ", but is " & GetClipboardText
650 printlog " - Percentvalue is correctly formated"
654 printlog " - Scientific"
655 call wTypeKeys(fLocaleString("LocaleScientificValue"))
656 call wTypeKeys "<Tab><shift tab>"
659 Kontext "Zahlenformat"
660 if (Kategorie.GetSelIndex <> 8) then
661 warnlog "The value is not recognized as scientific, it is " & Kategorie.GetSelText
663 printlog " - Value is correctly recognized as scientific"
668 Active.SetPage tabAusrichtungAbsatz
669 Kontext "tabAusrichtungAbsatz"
670 if (rechts.isChecked <> true) then
671 warnlog "wrong alignment of number"
673 printlog " - Scientificvalue is correctly alligned"
675 TabAusrichtungAbsatz.Cancel
676 Call wTypeKeys "<home><shift end>"
678 if (GetClipboardText <> fLocaleString("LocaleScientificValue")) then
679 warnlog "The number is not correctly formated: should be " & fLocaleString("LocaleScientificValue") & ", but is " & GetClipboardText
681 printlog " - Scientificvalue is correctly formated"
685 printlog " - Fraction"
686 call wTypeKeys("58 11/4")
687 call wTypeKeys "<Tab><shift tab>"
690 Kontext "Zahlenformat"
691 if (Kategorie.GetSelIndex <> 9) then
692 warnlog "The value is not recognized as fraction, it is " & Kategorie.GetSelText
694 printlog " - Value is correctly recognized as fraction"
699 Active.SetPage tabAusrichtungAbsatz
700 Kontext "tabAusrichtungAbsatz"
701 if (rechts.isChecked <> true) then
702 warnlog "wrong alignment of number"
704 printlog " - Fractionvalue is correctly alligned"
706 TabAusrichtungAbsatz.Cancel
707 Call wTypeKeys "<home><shift end>"
709 if (GetClipboardText <> "60 3/4") then
710 warnlog "The number is not correctly formated: should be 60 3/4, but is " & GetClipboardText
712 printlog " - Fractionvalue is correctly formated"
716 printlog " - Boolean"
717 call wTypeKeys(fLocaleString("LocaleBooleanValue"))
718 call wTypeKeys "<Tab><shift tab>"
721 Kontext "Zahlenformat"
723 if (Kategorie.GetSelIndex = 10) then
724 printlog " - Value is correctly recognized as boolean"
725 elseif iSprache = 86 or iSprache = 82 or iSprache =88 then
726 warnlog "Boolean value in chinese and korean not recognized"
728 warnlog "The value " & fLocaleString("LocaleBooleanValue") & "is not recognized as boolean, it is " & Kategorie.GetSelText
734 Active.SetPage tabAusrichtungAbsatz
735 Kontext "tabAusrichtungAbsatz"
736 if (rechts.isChecked = true) then
737 printlog " - Booleanvalue is correctly alligned"
738 elseif iSprache = 86 or iSprache = 82 or iSprache = 88 then
739 warnlog "Boolean value in chinese and korean not recognized"
741 warnlog "wrong alignment of number"
744 TabAusrichtungAbsatz.Cancel
745 Call wTypeKeys "<home><shift end>"
747 if (GetClipboardText <> fLocaleString("LocaleBooleanValue")) then
748 warnlog "The number is not correctly formated: should be " & fLocaleString("LocaleBooleanValue") & ", but is " & GetClipboardText
750 printlog " - Booleanvalue is correctly formated"
755 call wTypeKeys("testtext")
756 call wTypeKeys "<Tab><shift tab>"
759 Kontext "Zahlenformat"
760 if (Kategorie.GetSelIndex <> 11) then
761 warnlog "The value is not recognized as string, it is " & Kategorie.GetSelText
763 printlog " - Value is correctly recognized as string"
768 Active.SetPage tabAusrichtungAbsatz
769 Kontext "tabAusrichtungAbsatz"
770 if (links.isChecked <> true) then
771 warnlog "wrong alignment of string"
773 printlog " - String is correctly alligned"
775 TabAusrichtungAbsatz.Cancel
776 Call wTypeKeys "<home><shift end>"
778 if (GetClipboardText <> "Testtext") then
779 warnlog "The string is not correctly formated: should be Testtext, but is " & GetClipboardText
781 printlog " - String is correctly formated"
784 '/// finished the file, now some hardwired tests ///'
785 '///+ check, if all decimals are saved, even if not displayed ///'
786 Call wTypeKeys "123" & cDecSep & "123456789"
787 Call wTypeKeys "<Tab><shift tab>"
788 Call wTypeKeys "<home><shift end>"
791 if (GetClipboardText <> "123" & cDecSep & "12") then warnlog "wrong reformating of text tablefield 1; should: " & "123" & cDecSep & "12 is: "+GetClipboardText
793 Call wTypeKeys "<home><shift end>"
795 if (GetClipboardText <> "123" & cDecSep & "123456789") then warnlog "wrong reformating of text tablefield 2; should: 123" & cDecSep & "123456789 is: "+GetClipboardText
797 Call hCloseDocument ()
800 ' --------------------------------------------------------------------
802 testcase tTableDelete
806 Printlog "'/// delete rows/columns in a table ///"
808 Call TBOhTabelleEinfuegen ("seven",0, 0, 0, 1,"20", "20" )
809 ' Point cursor to upper left cell
810 Call wTypeKeys "<Mod1 Home>", 2
813 Call wTypeKeys "<down><right>"
814 Call wTypeKeys CStr(i)
816 Call wTypeKeys "<Mod1 Home>", 2
818 Printlog "'/// via keys {alt delete} {cursor} -> delete row/column ///"
819 ' delete some rows/columns using shortcuts del 2rows 2cols
820 Call wTypeKeys "<mod2 delete><right>"
821 Call wTypeKeys "<right>"
822 Call wTypeKeys "<mod2 delete><left>"
823 Call wTypeKeys "<left>"
824 Call wTypeKeys "<mod2 delete><down>"
825 Call wTypeKeys "<down>"
826 Call wTypeKeys "<mod2 delete><up>"
827 Call wTypeKeys "<up>"
828 Call SpaltenTesten ( 18 )
829 Call wTypeKeys "<Mod1 Home>", 2
830 Call wTypeKeys "<Mod1 A>"
832 if GetClipboardtext <> "2" then
833 Warnlog "Deleting rows/columns via keys has not been worked as accepted! -> Test failed!"
838 Printlog "'/// via menue Format[Zeile|Spalte]Loeschen ///"
839 for i = 1 to 17 ' delete some rows/columns
845 Call wTypeKeys "<Mod1 A>"
847 if GetClipboardtext <> "20" then
848 Warnlog "Deleting rows/columns via keys has not been worked as accepted! -> Test failed!"
853 Printlog "'/// via keys {alt insert} {cursor} -> insert row/column ///"
854 Call wTypeKeys "<ESCAPE>"
855 Call wTypeKeys "<mod2 insert><left>"
856 Call wTypeKeys "<mod2 insert><right>"
857 Call wTypeKeys "<mod2 insert><down>"
858 Call wTypeKeys "<mod2 insert><up>"
859 Call SpaltenTesten ( 3 )
860 Call wTypeKeys "<Mod1 Home>", 2
861 Call wTypeKeys "<Shift End>"
864 Warnlog "Maybe no columns have been inserted!"
866 Call wTypeKeys "<Right>", 2
867 Call wTypeKeys "<Shift End>"
870 if GetClipboardtext <> "20" then
871 Warnlog "Maybe no columns have been inserted!"
874 Warnlog "Maybe no columns have been inserted!"
878 Printlog "'/// delete whole table ///"
879 Call wTypeKeys "<mod1 home>", 2 ' delete hole table
880 Call wTypeKeys "<Mod1 A>"
882 Call wTypeKeys "<MOD1 SHIFT DELETE>" 'EditCut
883 Call wTypeKeys "<return>"
885 Warnlog "Unable to delete table!"
890 '--------------------------------------------------------------------------------------------------------
896 Printlog "'/// +++ table to text ///"
898 Call TBOhTabelleEinfuegen ("seven",0, 0, 0, 1,"10", "10" )
900 for i = 1 to 99 ' fill every cell
901 Call wTypeKeys CStr(i)
902 Call wTypeKeys "<Tab>"
905 ToolsTextInTable ' convert with '+' seperator
906 Kontext "TextInTabelleUmwandeln"
908 AndereText.settext "+"
909 TextInTabelleUmwandeln.OK
911 Call wTypeKeys "<home>" ' calculate every row
913 Call wTypeKeys "<shift end>"
915 Call wTypeKeys "<shift insert>"
916 Call wTypeKeys "+<delete>"
918 Call wTypeKeys "<backspace>0<shift home>"
920 if (GetClipboardText <> "12645") then warnlog "wrong table converting table<->text "
921 Call wTypeKeys "<shift insert><return>"
923 Call hCloseDocument ()
926 '-------------------------------------------------------------------------------------------
928 testcase tTableCalculate
929 Printlog "'/// calculating in table ///"
932 Call TBOhTabelleEinfuegen ()
933 Call wTypeKeys "1<Tab>2<Tab>3<Tab>4<Tab>5<Tab>6<Tab>7<Tab>8<Tab>"
934 Call wTypeKeys "<end><Mod1 end><down><return>"
935 Call TBOhTabelleEinfuegen ("eight",0, 0, 0, 1,"5", "5" )
937 '///' should look like: <pre> ///
939 '///+1 1,.1 2,.2 =3,.3 4,.4 =summe<:4,.4 ///
940 '///+2 1 2 =3 4 =summe<:4 ///
941 '///+3 =2,.1 =18,.9 =2 =-0,31 =32,.6926671... <1.check> ///
942 '///+4 =14 =16 gone =<2.check> = ...table1 ?? ///
945 '/// this table gets generated one by one ///'
947 Call wTypeKeys "1"+cDecSep+"1<Tab>" ' insert input A1
948 Call wTypeKeys "2"+cDecSep+"2<Tab>"
950 Kontext "OL_SW_Rechenleiste" ' C1
951 Eingabefeld.SetText "<A1>+<B1>"
953 Call wTypeKeys "<Tab>"
954 Call wTypeKeys "4"+cDecSep+"4<Tab>"
955 Call wTypeKeys "<Tab>"
957 Call wTypeKeys "1<Tab>" ' A2
958 Call wTypeKeys "2<Tab>"
959 Call wTypeKeys "<Tab>"
960 Call wTypeKeys "4<shift tab>"
962 Kontext "OL_SW_Rechenleiste" ' C2
963 Eingabefeld.SetText "<D2>-<A2>"
965 Call wTypeKeys "<Tab>"
966 Call wTypeKeys "<Tab>"
968 ' automatic sum works only to next formula :-< ///'
969 Call hToolbarSelect ( "Table", true )
971 Kontext "OL_SW_Rechenleiste"
973 Call wTypeKeys "<up>"
975 Call hToolbarSelect ( "Table", true )
977 Kontext "OL_SW_Rechenleiste"
979 Call wTypeKeys "<down><Tab>"
981 Call wTypeKeys "=" ' slip into calculation area
982 Kontext "OL_SW_Rechenleiste" ' A3
983 Eingabefeld.SetText "sum <A1:A2>"
985 Call wTypeKeys "<Tab>"
986 Call wTypeKeys "<F2>" '
987 Kontext "OL_SW_Rechenleiste"
988 Eingabefeld.SetText "sum <D2:B1>"
990 Call wTypeKeys "<Tab>"
991 Call wTypeKeys "<F2>" '
992 Kontext "OL_SW_Rechenleiste"
993 Eingabefeld.SetText "sqrt <E2>"
995 Call wTypeKeys "<Tab>"
996 Call wTypeKeys "<F2>" '
997 Kontext "OL_SW_Rechenleiste"
998 Eingabefeld.SetText "cos <E1>"
1000 Call wTypeKeys "<Tab>"
1002 Call wTypeKeys "<F2>" ' E3 check this out :-)
1003 Kontext "OL_SW_Rechenleiste"
1004 Eingabefeld.SetText "sum <A2:D3>"
1006 Call wTypeKeys "<shift home>"
1008 if (GetClipboardText <> "32" & cDecSep & "69") then warnlog "wrong calculation should: 32" & cDecSep & "69 is: "+GetClipboardText
1009 Call wTypeKeys "<end><Tab>"
1011 Call wTypeKeys "<F2>" ' A4
1012 Kontext "OL_SW_Rechenleiste"
1013 Eingabefeld.SetText "2+3*4"
1015 Call wTypeKeys "<shift home>"
1017 if (GetClipboardText <> "14") then warnlog "wrong calculation should: "+"14"+" is: "+GetClipboardText
1018 Call wTypeKeys "<end><Tab>"
1020 Call wTypeKeys "<F2>" ' B4
1021 Kontext "OL_SW_Rechenleiste"
1022 Eingabefeld.SetText "2*2 pow 3"
1024 Call wTypeKeys "<shift home>"
1026 if (GetClipboardText <> "16") then warnlog "wrong calculation should: "+"16"+" is: "+GetClipboardText
1027 Call wTypeKeys "<end><Tab>"
1028 Call wTypeKeys "<shift tab>"
1030 Call wTypeKeys "<Tab>"
1033 '/// one row gets deleted///'
1034 FormatSpalteLoeschen ' grumel: have to find a cell :-(
1035 Call wTypeKeys "<F2>" ' C4
1036 Kontext "OL_SW_Rechenleiste"
1037 Eingabefeld.SetText "sum <A1:D3>"
1039 Call wTypeKeys "<shift home>"
1041 if (GetClipboardText <> "58" & cDecSep & "89") then warnlog "wrong calculation should: " & "58" & cDecSep & "89" & " is: " & GetClipboardText
1042 Call wTypeKeys "<end><Tab>"
1043 Call wTypeKeys "<F2>" ' C4
1044 Kontext "OL_SW_Rechenleiste"
1045 Eingabefeld.SetText "sum <"+fLocaleString("LocaleTable")+"1.B1:E1> / <A2:D2>"
1048 Call wTypeKeys "<shift home>"
1050 if (GetClipboardText <> "1" & cDecSep & "27") then warnlog "wrong calculation should: 1" & cDecSep & "27 is: " & GetClipboardText
1051 Call wTypeKeys "<end><Tab>"
1053 Call wTypeKeys "<end><Mod1 end><down><return>"
1054 Call hCloseDocument ()
1057 '-------------------------------------------------------------------------------------------
1060 dim itemp(5) as integer
1063 Printlog "'/// edit table ///"
1065 Call TBOhTabelleEinfuegen ("nine-dumy",0, 0, 0, 1,"5", "3" )
1066 Call wTypeKeys "<end><Mod1 end><Mod1 end><return>"
1067 Call TBOhTabelleEinfuegen ("nine",0, 0, 0, 1,"5", "3" )
1068 Call wTypeKeys "nine<Tab>"
1070 Printlog "'/// insert Frame & Graphic in heading ///"
1077 Call wTypeKeys "<escape>"
1079 Call hGrafikEinfuegen (gTesttoolPath +"writer\optional\input\options\ga000907.gif")
1081 Call wTypeKeys "<escape>"
1083 Call wTypeKeys "<mod1 end><up><up>"
1086 Printlog "'/// insert Frame & Graphic in body ///"
1093 Call wTypeKeys "<escape>"
1095 Call hGrafikEinfuegen (gTesttoolPath +"writer\optional\input\options\ga000907.gif")
1097 Call wTypeKeys "<escape>"
1099 Call wTypeKeys "<mod1 end><up><up><Tab>"
1101 Printlog "'/// insert Frame & Table in body ///"
1108 Call wTypeKeys "<return>"
1111 Call hTabelleEinfuegen ()
1112 Call wTypeKeys "<mod1 end><mod1 end><up><up><Tab><Tab>"
1114 Warnlog "Hit <Enter>-Key should enable edit mode for selected frames! (srx642z or greater)"
1115 Call wTypeKeys "<escape>"
1116 Call wTypeKeys "<down>"
1120 Printlog "'/// insert PageBreak ///"
1121 '/// TBO: check test / insert dummy table ' doesn't work, if the first 'stuff' in a document is the table ///'
1122 InsertFieldsPagenumbers
1123 Call wTypeKeys "<shift home>"
1127 itemp(1) = val(GetClipboardText)
1131 Kontext "UmbruchEinfuegen"
1135 InsertFieldsPagenumbers
1136 Call wTypeKeys "<shift home>"
1140 itemp(3) = val(GetClipboardText)
1141 if (itemp(1) <> itemp(3)) then
1142 printlog "--- Pagebreak works in Table, that's good :-)"
1144 warnlog " Pagebreak doesn't work in Table, that's not good :-("+itemp(1) +" "+ itemp(3)
1148 Call wTypeKeys "<end><Mod1 end><down><return>"
1150 Printlog "'/// the following may not be possible ///"
1151 Printlog "'///+ Insert table in footnote ///"
1153 Kontext "FussnoteEinfuegen"
1154 FussnoteEinfuegen.OK
1157 warnlog " Table in Footnote is possible, that's not good :-("
1161 Call wTypeKeys "<end><Mod1 end><return>"