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_204a_.inc,v $
13 '* last change: $Author: vg $ $Date: 2008-08-18 12:37:02 $
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 : Test the table functionality in Writer
38 '\***********************************************************************
45 Call TableSplit_copy_heading
46 Call TableSplit_custom_heading
47 Call TableSplit_custom_heading_apply_style
48 Call TableSplit_no_heading
57 ' ----------------------------------------------------------------------
60 dim temp(10) as string
63 Call TBOhTabelleEinfuegen ("dummy" ,0,1,0,1,"1",tHeight:="1") ' insert table
64 Call wTypeKeys "<mod1 end><mod1 end>"
66 Call TBOhTabelleEinfuegen (temp (1) ,0,1,0,1,"10",tHeight:="7") ' insert table
68 printlog "'/// Format table via Format->Table ///"
69 Printlog "'/// change tablename ///"
70 TableTableProperties ' get into existing table
72 Kontext "TabelleEinfuegenWriter"
75 Active.SetPage TabTabelle
78 ' 0. right table ?? ///'
79 if (TabellenName.GetText <> temp (1) ) then warnlog " --- wrong table? schould be : "+temp (1)+ ", is : "+TabellenName.GetText
81 '/// 1. try: space included ///'
82 temp (1) = "Gar field"
84 TabellenName.SetText temp (1)
86 printlog " - couldn't insert : " + temp (1)
88 if (TabellenName.GetText = temp (1) ) then warnlog " --- ups, could insert smth. with space? : "+TabellenName.GetText
90 '/// 2. try: dot included ///'
91 temp (1) = "Gar.field"
93 TabellenName.SetText temp (1)
95 printlog " - couldn't insert : "+temp (1)
97 if (TabellenName.GetText = temp (1) ) then warnlog " --- ups, could insert smth. with dot? : "+TabellenName.GetText
103 ' ----------------------------------------------------------------------
105 testcase sTableAlignment
106 dim temp(10) as string
107 dim PAGEWIDTH as double
108 dim ac as integer, fc as integer
113 Call TBOhTabelleEinfuegen ("dummy" ,0,1,0,1,"1",tHeight:="1") ' insert table
114 Call wTypeKeys "<mod1 end><mod1 end>"
115 temp (1) = "Garfield"
116 Call TBOhTabelleEinfuegen (temp (1) ,0,1,0,1,"10",tHeight:="7") ' insert table
118 ' ' get text to init some constances for this test
119 ' temp(2) = NachOben.GetText '----------------------------------------------------
120 ' initialisation of some constantzen for this test '------------------------------
121 PAGEWIDTH = hGetPageWidth()
122 printlog "--- Pagewidth is: " + PAGEWIDTH
123 'MEASUNIT = GetMeasUnit (temp(2))
124 'DECSEP = GetDecimalSeperator(temp(2))
126 Printlog "'/// set alignment of table ///"
129 Active.SetPage TabTabelle
131 Printlog "'/// Left ///"
134 if ((Breite.IsWritable AND NachRechts.IsWritable) <> TRUE) then warnlog "edit field not active "
135 if (LiberalMeasurement(PAGEWIDTH ,(StrToDouble (Breite.GetText) + StrToDouble (NachRechts.GetText))) <> TRUE) then
136 if PAGEWIDTH < 0 then
137 warnlog "Cdbl returns wrong values"
139 warnlog "measurement value error "+ "is: "+(StrToDouble (Breite.GetText) + StrToDouble (NachRechts.GetText))+" should: " + PAGEWIDTH
142 NachRechts.SetText "2"
144 temp(1) = NachRechts.GetText
148 Active.SetPage TabTabelle
150 if (Links.Ischecked <> TRUE) then warnlog "links state changed"
151 if ((Breite.IsWritable AND NachRechts.IsWritable) <> TRUE) then warnlog "edit field not active"
152 if (temp(1) <> NachRechts.GetText) then warnlog "value changed"
153 if (LiberalMeasurement(PAGEWIDTH ,(StrToDouble (Breite.GetText) + StrToDouble (NachRechts.GetText))) <> TRUE) then
154 if PAGEWIDTH < 0 then
155 warnlog "Cdbl returns wrong values"
157 warnlog "measurement value error "+ "is: "+(StrToDouble (Breite.GetText) + StrToDouble (NachRechts.GetText))+" should: "+PAGEWIDTH
160 '--------------------------------
161 NachRechts.SetText "0"
163 Printlog "'/// FromLeft ///"
166 if ((Breite.IsWritable AND NachLinks.IsWritable) <> TRUE) then warnlog "edit field not active "
167 if (LiberalMeasurement(PAGEWIDTH ,StrToDouble (Breite.GetText) + StrToDouble(NachLinks.GetText)) <> TRUE) then
168 if PAGEWIDTH < 0 then
169 warnlog "Cdbl returns wrong values"
171 warnlog "measurement value error "+ "is: "+(StrToDouble (Breite.GetText) + StrToDouble (NachLinks.GetText))+" should: "+PAGEWIDTH
174 NachLinks.SetText "2"
176 temp(1) = NachLinks.GetText
180 Kontext "TabelleEinfuegenWriter"
182 Active.SetPage TabTabelle
184 if (VonLinks.Ischecked <> TRUE) then warnlog "VonLinks state changed"
185 'sBug = NachLinks.GetText
186 if ((Breite.IsEnabled AND NachLinks.IsEnabled) <> TRUE) then warnlog "edit field not active "
187 'if (NachLinks.IsWritable <> TRUE) then warnlog "edit field not active "
188 'if sBug <> NachLinks.GetText then warnlog "TESTOOL BUG; is writable loescht feld "
189 if (temp(1) <> NachLinks.GetText) then warnlog "value changed"+" should: "+temp(1)+" is: "+ NachLinks.GetText
190 if (LiberalMeasurement(PAGEWIDTH ,StrToDouble (Breite.GetText) + StrToDouble(NachLinks.GetText)) <> TRUE) then
191 if PAGEWIDTH < 0 then
192 warnlog "Cdbl returns wrong values"
194 warnlog "measurement value error "+ "is: "+(StrToDouble (Breite.GetText) + StrToDouble (NachLinks.GetText))+" should: "+PAGEWIDTH
197 '--------------------------------
198 NachLinks.SetText "0"
199 Printlog "'/// Right ///"
202 if ((Breite.IsWritable AND NachLinks.IsWritable) <> TRUE) then warnlog "edit field not active "
203 if (LiberalMeasurement(PAGEWIDTH ,StrToDouble (Breite.GetText) + StrToDouble(NachLinks.GetText)) <> TRUE) then
204 if PAGEWIDTH < 0 then
205 warnlog "Cdbl returns wrong values"
207 warnlog "measurement value error "+ "is: "+(StrToDouble (Breite.GetText) + StrToDouble (NachLinks.GetText))+" should: "+PAGEWIDTH
210 NachLinks.SetText "2"
212 temp(1) = NachLinks.GetText
216 Active.SetPage TabTabelle
218 if (rechts.Ischecked <> TRUE) then warnlog "rechts state changed"
219 if ((Breite.IsWritable AND NachLinks.IsWritable) <> TRUE) then warnlog "edit field not active "
220 if (temp(1) <> NachLinks.GetText) then warnlog "value changed"
221 if (LiberalMeasurement(PAGEWIDTH ,StrToDouble (Breite.GetText) + StrToDouble(NachLinks.GetText)) <> TRUE) then
222 if PAGEWIDTH < 0 then
223 warnlog "Cdbl returns wrong values"
225 warnlog "measurement value error "+ "is: "+(StrToDouble (Breite.GetText) + StrToDouble (NachLinks.GetText))+" should: "+PAGEWIDTH
228 '--------------------------------
229 NachLinks.SetText "0"
230 Printlog "'/// center ///"
233 if ((Breite.IsWritable AND NachLinks.IsWritable) <> TRUE) then warnlog "edit field not active "
234 if (LiberalMeasurement(PAGEWIDTH ,StrToDouble (Breite.GetText) + (2 * StrToDouble (NachLinks.GetText))) <> TRUE) then
235 if PAGEWIDTH < 0 then
236 warnlog "Cdbl returns wrong values"
238 warnlog "measurement value error "+ "is: "+(StrToDouble (Breite.GetText) + StrToDouble (NachLinks.GetText))+" should: "+PAGEWIDTH
241 NachLinks.SetText "2"
243 temp(1) = NachLinks.GetText
247 Active.SetPage TabTabelle
249 if (Zentriert.Ischecked <> TRUE) then warnlog "state changed"
250 if ((Breite.IsWritable AND NachLinks.IsWritable) <> TRUE) then warnlog "edit field not active "
251 if (temp(1) <> NachLinks.GetText) then warnlog "value changed"
252 if (LiberalMeasurement(PAGEWIDTH ,StrToDouble (Breite.GetText) + (2 * StrToDouble (NachLinks.GetText))) <> TRUE) then
253 if PAGEWIDTH < 0 then
254 warnlog "Cdbl returns wrong values"
256 warnlog "measurement value error "+ "is: "+(StrToDouble (Breite.GetText) + StrToDouble (NachLinks.GetText))+" should: "+PAGEWIDTH
259 '--------------------------------
260 NachLinks.SetText "0"
261 Printlog "'/// manual ///"
264 if ((Breite.IsWritable AND NachLinks.IsWritable AND NachRechts.IsWritable) <> TRUE) then warnlog "edit field not active "
265 if (LiberalMeasurement(PAGEWIDTH ,StrToDouble (Breite.GetText) + StrToDouble (NachLinks.GetText) + StrToDouble (NachRechts.GetText)) <> TRUE) then
266 if PAGEWIDTH < 0 then
267 warnlog "Cdbl returns wrong values"
269 warnlog "measurement value error "+ "is: "+(StrToDouble (Breite.GetText) + StrToDouble (NachLinks.GetText)+ StrToDouble (NachRechts.GetText))+" should: "+PAGEWIDTH
272 NachLinks.SetText "2"
273 NachRechts.SetText "2"
275 temp(1) = NachLinks.GetText
276 temp(2) = NachRechts.GetText
280 Active.SetPage TabTabelle
282 if (Manuell.Ischecked <> TRUE) then warnlog "state changed"
283 if ((Breite.IsWritable AND NachLinks.IsWritable) <> TRUE) then warnlog "edit field not active "
284 if (temp(1) <> NachLinks.GetText) then warnlog "value changed"
285 if (temp(2) <> NachRechts.GetText) then warnlog "value changed"
286 if (LiberalMeasurement(PAGEWIDTH ,StrToDouble (Breite.GetText) + StrToDouble (NachLinks.GetText) + StrToDouble (NachRechts.GetText)) <> TRUE) then
287 if PAGEWIDTH < 0 then
288 warnlog "Cdbl returns wrong values"
290 warnlog "measurement value error "+ "is: "+(StrToDouble (Breite.GetText) + StrToDouble (NachLinks.GetText)+ StrToDouble (NachRechts.GetText))+" should: "+PAGEWIDTH
293 '--------------------------------
294 NachLinks.SetText "0"
295 NachRechts.SetText "0"
297 Printlog "'/// <font color=#FF0000>TODO TBO automatical ---------- MISSING yet </FONT> ///"
301 ' ----------------------------------------------------------------------
303 testcase sTablePagebreak
304 Dim temp(10) as string
307 Call TBOhTabelleEinfuegen ("dummy" ,0,1,0,1,"1",tHeight:="1") ' insert table
308 Call wTypeKeys "<mod1 end><mod1 end>"
309 temp (1) = "Garfield"
310 Call TBOhTabelleEinfuegen (temp (1) ,0,1,0,1,"10",tHeight:="7") ' insert table
312 Printlog "'/// Check TextFlow: pagebreak ///"
314 InsertFieldsPagenumbers ' get pagenumber & leave it for next calculation
315 Call wTypeKeys "<shift home>"
317 temp(1) = val(GetClipboardText)
320 Kontext "TabelleEinfuegenWriter"
322 Active.SetPage TabTextFlusstabelle
323 Kontext "TabTextFlusstabelle"
325 if ((Seite.IsChecked AND Davor.IsChecked) <> TRUE) then
326 printlog "--- defaultvalue changed..."
330 TabTextFlusstabelle.OK
332 ToolsUpdateUpdateAll ' update field & get pagenumber & clear
333 Call wTypeKeys "<shift end>"
335 temp(2) = val(GetClipboardText)
336 if ((val(temp(1))+1) <> temp(2)) then
337 warnlog "--- Table didn't move, that's not good "+ "from: "+val(temp(1))+" to: "+ temp(2) +" 1+1= "+(val(temp(1))+1)
339 printlog " works , moved, ok!"
342 Call wTypeKeys "<mod1 end><mod1 end><return>"
347 ' ----------------------------------------------------------------------
349 testcase sTableMergeCell
350 dim temp(10) as string
352 dim PAGEWIDTH as double
353 dim ac as integer, fc as integer
359 Call wTypeKeys "NULL<return>"
360 Call wTypeKeys "Start<return>"
361 Call wTypeKeys "End<return>"
362 Call wTypeKeys "NULL<return><up><up>"
365 '/// Insert a table with 10 columns and 7 rows
366 Call TBOhTabelleEinfuegen (temp (1) ,0,1,0,1,"10",tHeight:="7") ' insert table
367 Call wTypeKeys "<MOD1 END>", 2
368 Call wTypeKeys "<up><up>"
370 '/// Insert a table with 10 columns and 10 rows
372 Call TBOhTabelleEinfuegen (temp (1) ,0,0,1,1,"10",tHeight:="10") ' insert table
374 Printlog "merging of cells & undo"
375 temp (2) = hGetTableName()
376 if (temp(2) <> temp(1)) then warnlog " --- wrong table? schould be : "+temp (1)+ ", is : "+temp(2)
378 Printlog " - merging of cells"
381 Call wTypeKeys "<down><shift right>" ' 2 horizontal (0,1) & (1,1) (x,y)
382 TableMergeCells : inc ac : dec fc ' FormatZelleVerbinden
383 Call wTypeKeys "<down><shift down>" ' 2 vertical (1,2) & (1,3)
384 TableMergeCells : inc ac : dec fc
385 Call wTypeKeys "<down><up><shift down><shift up>" ' merge again
386 'Warnlog "Merge cells will crash when only one cell is selected (#i33394)"
389 ' go to top of table, move to end & count
390 Call wTypeKeys "<mod1 home>"
392 Call wTypeKeys "<right>"
394 Call wTypeKeys "<down>"
395 Call wTypeKeys "<shift end>" ' right after/outside the table ->
399 Warnlog "Test didn't find the end of the table, stops here!"
403 if (GetClipboardText <> "End") then
404 Warnlog "Test didn't find the end of the table, stops here! Found:" & GetClipboardtext
408 ' undo & check where we are
414 temp (2) = hGetTableName()
415 if (temp(2) <> temp(1)) then warnlog " --- wrong table? schould be : "+temp (1)+ ", is : "+temp(2)
416 EditUndo ' go one step further
417 EditUndo ' go one step further
418 Call wTypeKeys "<up><shift end>"
420 temp(2) = GetClipboardText
421 Call wTypeKeys "<down><shift home>"
423 temp(3) = GetClipboardText
424 if ((temp(2) <> "Start") AND (temp(3) <> "End")) then
425 warnlog "there is smth. wrong with the undo stuff !!! is:"+temp(3) +" and:"+temp(2)+" should:End Start"
432 ' ----------------------------------------------------------------------
434 testcase sTableBorder
435 dim temp(10) as string
438 dim PAGEWIDTH as double
439 dim ac as integer, fc as integer
444 Call wTypeKeys "<mod1 end><mod1 end>"
445 Call wTypeKeys "NULL<return>"
446 Call wTypeKeys "Start<return>"
447 Call wTypeKeys "End<return>"
448 Call wTypeKeys "NULL<return><up><up>"
450 Call TBOhTabelleEinfuegen (temp (1) ,0,1,0,1,"10",tHeight:="7") ' insert table
452 Printlog "'/// set border & undo ///"
453 ' assign border to whole table
454 Call wTypeKeys "<shift mod1 end>"
455 TableTableProperties ' get into existing table
457 Kontext "TabelleEinfuegenWriter"
460 if active.exists (5) then
461 Active.SetPage TabUmrandung
463 Kontext "TabUmrandung"
465 Vorgaben.Typekeys "<end>" ' set border
466 StilFarbe.Select StilFarbe.GetItemCount
468 'links.IsWriteable 'si checkable, but not now!...
469 Position.TypeKeys "<home><right><right><right>" ' 3. from the left
470 if (groesse.IsEnabled <> TRUE) then warnlog "position of shadow is not changeable "
471 SchattenFarbe.Select SchattenFarbe.GetItemCount - 1
473 TableTableProperties ' get into existing table
474 Kontext "TabelleEinfuegenWriter"
478 if active.exists (5) then
479 Active.SetPage TabUmrandung
481 Kontext "TabUmrandung"
483 Vorgaben.Typekeys "<end>" ' set border
484 StilFarbe.Select StilFarbe.GetItemCount
486 'links.IsWriteable 'si checkable, but not now!...
487 Position.TypeKeys "<home><right><right><right>" ' 3. from the left
488 if (groesse.IsEnabled <> TRUE) then warnlog "position of shadow is not changeable "
489 SchattenFarbe.Select SchattenFarbe.GetItemCount - 1
495 Active.SetPage TabHintergrund
497 Kontext "TabHintergrund"
499 Hintergrundfarbe.TypeKeys "<home><down><right><down><right><down><right><down><right>"
501 ' just an idea of checking this type of control
503 TableTableProperties ' get into existing table
505 Kontext "TabelleEinfuegenWriter"
508 Active.SetPage TabUmrandung
510 Kontext "TabUmrandung"
512 while (groesse.IsEnabled)
513 Position.TypeKeys "<left>"
517 if (i <> 3) then warnlog "wrong shadow selected should be 3, was: "+i
519 ' undo & check where we are ///'
521 temp (2) = hGetTableName()
522 if (temp(2) <> temp(1)) then warnlog " --- wrong table? schould be : "+temp (1)+ ", is : "+temp(2)
523 EditUndo ' go one step further
524 Call wTypeKeys "<up><shift end>"
526 temp(2) = GetClipboardText
527 Call wTypeKeys "<down><shift home>"
529 temp(3) = GetClipboardText
530 if ((temp(2) <> "Start") AND (temp(3) <> "End")) then
531 warnlog "there is smth. wrong with the undo stuff !!!"
532 print "whats wrong with the undo stuff"
534 EditRedo ' and back again
535 Call wTypeKeys "<up><mod1 home>" ' now we are in (0,0)
539 ' ----------------------------------------------------------------------
541 testcase sTableIndent
542 dim temp(10) as string
543 dim ac as integer, fc as integer
547 Call wTypeKeys "NULL<return>"
548 Call wTypeKeys "Start<return>"
549 Call wTypeKeys "End<return>"
550 Call wTypeKeys "NULL<return><up><up>"
552 temp (1) = "Garfield"
553 Call TBOhTabelleEinfuegen (temp (1) ,0,1,0,1,"10",tHeight:="7") ' insert table
555 Printlog "'/// tab, paragraph indent & UNDO ///"
562 Active.SetPage TabTabulator
564 Kontext "TabTabulator"
569 FuellzeichenZeichen.SetText "%"
572 Active.SetPage TabEinzuegeUndAbstaende
574 Kontext "TabEinzuegeUndAbstaende"
576 Vonlinks.SetText "-1"
577 VonRechts.SetText "-1"
578 TabEinzuegeUndAbstaende.OK
581 Printlog "'/// text attributes ///"
582 Call wTypeKeys "John" : inc ac
583 Call wTypeKeys "<shift home>"
586 Active.SetPage TabFontEffects
588 Kontext "TabFontEffects"
590 FontColor.Select FontColor.GetItemCount - 1
592 Active.SetPage TabFontPosition
594 Kontext "TabFontPosition"
603 Printlog "'/// cell protection ///"
604 Call wTypeKeys "<LEFT><UP>", 10
605 Call wTypeKeys "<DOWN>", 3
606 Call wTypeKeys "<down><shift down><shift right><Right><Left><Shift right><Shift left>"
608 Call wTypeKeys "<LEFT>"
611 if (Active.Exists <> TRUE) then
612 Call wTypeKeys "<LEFT><UP>", 10
613 Call wTypeKeys "<DOWN>", 3
614 Call wTypeKeys "<down><shift down><shift right><Right><Left><Shift right><Shift left>"
619 if GetClipboardtext <> "" then
620 QAErrorLog "#110549#Protection of cell does not work correct!"
622 ' If protection fails, reselect table with Navigator!
623 Call wNavigatorAuswahl(2,1)
629 if (Active.Exists = TRUE) then
630 Warnlog "ReProtection of table does not work!" + Active.GetText
636 'Printlog "undoCheck is here"
637 temp (2) = hGetTableName()
638 if (temp(2) <> temp(1)) then warnlog " --- wrong table? schould be : "+temp (1)+ ", is : "+temp(2)
639 EditUndo ' go one step further
640 Call wTypeKeys "<up><shift end>"
642 temp(2) = GetClipboardText
643 Call wTypeKeys "<down><shift home>"
645 temp(3) = GetClipboardText
646 if ((temp(2) <> "Start") AND (temp(3) <> "End")) then
647 warnlog "there is smth. wrong with the undo stuff !!! is: "+temp(2)+" should: Start; is: "+temp(3)+" should: End;"
649 EditRedo ' and back again
650 Call wTypeKeys "<up><mod1 home>" ' now we are in (0,0)
653 Printlog "'/// Set graphic in table as background ///"
657 Warnlog "Dialog 'Insert Table' not up!"
664 Active.SetPage TabHintergrund
666 Kontext "TabHintergrund"
668 Fuer.Select(2) ' Zeile
669 Als.Select(2) ' Grafik
671 Kontext "GrafikEinfuegenDlg"
672 Dateiname.SetText convertPath(gTesttoolPath +"writer\optional\input\options\ga000907.gif")
674 Kontext "TabHintergrund"
677 FormatColumnWidthWriter ' thre is a bigger test in the option test
678 Kontext "SpaltenBreite"
683 Kontext "ZellenHoehe"
691 ' Printlog "undoCheck is here"
693 temp (2) = hGetTableName()
694 if (temp(2) <> temp(1)) then warnlog " --- wrong table? schould be : "+temp (1)+ ", is : "+temp(2)
695 EditUndo ' go one step further
696 Call wTypeKeys "<up><shift end>"
698 temp(2) = GetClipboardText
699 Call wTypeKeys "<down><shift home>"
701 temp(3) = GetClipboardText
702 if ((temp(2) <> "Start") AND (temp(3) <> "End")) then
703 warnlog "there is smth. wrong with the undo stuff !!! is: "+temp(2)+" should: Start; is: "+temp(3)+" should: End;"
705 EditRedo ' and back again
706 Call wTypeKeys "<mod1 end>" ' go to end of doc
708 Warnlog "Dialog 'Insert Table' not up!"
713 ' ----------------------------------------------------------------------
716 dim temp(10) as string
717 dim PAGEWIDTH as double
718 dim ac as integer, fc as integer
722 ' Kontext "DocumentWriter"
723 Call TBOhTabelleEinfuegen ("dummy" ,0,1,0,1,"1",tHeight:="1") ' insert table
724 Call wTypeKeys "<mod1 end><mod1 end>"
726 Call TBOhTabelleEinfuegen (temp (1) ,0,1,0,1,"10",tHeight:="10") ' insert table
731 Call wTypeKeys str(rnd()) + "<right>"
733 Call wTypeKeys "<shift mod1 home>"
734 ToolsSort '-----------------------------------------------------------11111111111111111
736 Spalten.Check 'direction 1
737 for i = 1 to Schluesseltyp1.GetItemCount
738 Schluesseltyp1.select i
739 printlog "possible values for sorting :" + Schluesseltyp1.Getseltext
743 if active.exists (5) then printlog "active1: "+active.gettext
744 Call wTypeKeys "<shift mod1 end>",2
746 ToolsSort '-----------------------------------------------------------22222222222222222
748 printlog "WorkAround only seen on linux, can't select immediately, cursor movement needed "
749 Call wTypeKeys "<right><left>"
750 Call wTypeKeys "<shift mod1 end>",2
754 if active.exists (5) then
755 printlog "active2: "+active.gettext
762 if active.exists (5) then
763 printlog "active3: "+active.gettext
794 ' ----------------------------------------------------------------------
796 testcase TableSplit_copy_heading
797 printlog "'/// Splitting Tables & UNDO ///"
798 printlog "'/// check 'copy heading' ///"
799 dim temp(10) as string
800 dim PAGEWIDTH as double
801 dim ac as integer, fc as integer
805 ' Kontext "DocumentWriter"
806 Call TBOhTabelleEinfuegen ("dummy" ,0,1,0,1,"1",tHeight:="1") ' insert table
807 Call wTypeKeys "<mod1 end><mod1 end>"
809 Call TBOhTabelleEinfuegen (temp (1) ,1,1,0,1,"10",tHeight:="10") ' insert table
811 Printlog "'/// Splitting Tables & UNDO ///"
812 Printlog "'/// check 'copy heading' ///"
814 Call wTypeKeys temp(2)+"<down>"
816 Kontext "TabelleAuftrennen"
817 UeberschriftKopieren.Check '<------------- this is the key
820 temp (6) = hGetTableName ()
821 if (temp(6) <> (fLocaleString("LocaleTable")+"1")) then warnlog "Split table didn't work! is: "+temp(6)+"; should: "+(fLocaleString("LocaleTable")+"1")
822 ' if (temp(6) <> (fLocaleString("LocaleTable")+"2")) then warnlog "Split table didn't work! is: "+temp(6)+"; should: "+(fLocaleString("LocaleTable")+"2")
824 Call wTypeKeys "<up>" ' im in the content of the table
826 ' -------------check if heading (style)
827 Kontext "TextObjectbar"
828 if (Vorlage.GetSelText <> fLocaleString("LocaleTableHeading")) then
829 Warnlog "tabel heading did not work!is: " & Vorlage.GetSelText & ", should " & fLocaleString("LocaleTableHeading")
831 '----------------------------------
832 Call wTypeKeys "<end><shift home>" ' check heading in 'new' table (content)
834 temp(3) = GetClipboardText
835 if (temp(2) <> temp(3)) then warnlog "wrong heading! Is: "+temp(3)+" Should: "+temp(2)
836 Call wTypeKeys "<up><up>"
837 if (hGetTableName () <> (temp(1))) then warnlog "Split table didn't work?"
838 Call wTypeKeys "<end><shift home>" ' check heading in 'old' table
840 temp(3) = GetClipboardText
841 if (temp(2) <> temp(3)) then warnlog "wrong heading! is: "+temp(3)+" should: "+temp(2)
845 Printlog "'/// check 'custom heading (apply style)' ///"
846 ' splitting headers doesn't work -> move down 1 line
848 Call wTypeKeys temp(2)
849 ' set some style to verify
852 Active.SetPage TabEinzuegeUndAbstaende
854 Kontext "TabEinzuegeUndAbstaende"
856 Vonlinks.SetText "-1"
857 VonRechts.SetText "-1"
858 temp (4) = Vonlinks.GetText
859 temp (5) = Vonrechts.GetText
860 TabEinzuegeUndAbstaende.OK
861 Call wTypeKeys "<down>",2
863 Kontext "TabelleAuftrennen"
864 EigeneMitVorlage.Check '<------------- this is the key
867 temp (6) = hGetTableName ()
868 if (temp(6) <> (fLocaleString("LocaleTable")+"1")) then
869 warnlog "Split table didn't work! is: "+temp(6)+"; should: "+(fLocaleString("LocaleTable")+"1")
871 ' -------------check if heading
872 Kontext "TextObjectbar"
873 if (Vorlage.GetSelText <> fLocaleString("LocaleTableHeading")) then
874 Warnlog "Table heading did not work!"
875 Warnlog "is: " & Vorlage.GetSelText & ", should " & fLocaleString("LocaleTableHeading")
876 Call wTypeKeys "<Escape>"
878 '----------------------------------
880 FormatParagraph ' check style
882 Active.SetPage TabEinzuegeUndAbstaende
884 Kontext "TabEinzuegeUndAbstaende"
886 ' if ((Vonlinks.GetText <>temp (4) ) OR (Vonrechts.GetText <>temp (5) )) then warnlog "style didn't get inherited. is: "+Vonlinks.GetText+"; should: "+temp (4) +";; is: "+Vonrechts.GetText+"; should: "+temp (5) +";;"
887 TabEinzuegeUndAbstaende.OK
888 Call wTypeKeys "<up><up><up>" ' goto old table
889 if (hGetTableName () <> (temp(1))) then warnlog "Split table didn't work? "
890 Call wTypeKeys "<end><shift home>" ' check heading in 'old' table
892 temp(3) = GetClipboardText
893 if (temp(2) <> temp(3)) then warnlog "wrong heading! is: "+temp(3)+"; should: "+temp(2)
899 ' ----------------------------------------------------------------------
901 testcase TableSplit_custom_heading
902 dim temp(10) as string
903 dim PAGEWIDTH as double
904 dim ac as integer, fc as integer
908 Call TBOhTabelleEinfuegen ("dummy" ,0,1,0,1,"1",tHeight:="1") ' insert table
909 Call wTypeKeys "<mod1 end><mod1 end>"
911 Call TBOhTabelleEinfuegen (temp (1) ,1,1,0,1,"10",tHeight:="10") ' insert table
912 Printlog "'/// check 'custom heading' ///"
913 Call wTypeKeys "Header"
914 FormatStylesCatalog ' set a style to verify
915 Kontext "Vorlagenkatalog"
916 Ansicht.TypeKeys "<up><up><up><up>"
917 temp (4) = Ansicht.GetText
919 ' set some style to verify
922 Active.SetPage TabEinzuegeUndAbstaende
924 Kontext "TabEinzuegeUndAbstaende"
926 Vonlinks.SetText "-1"
927 VonRechts.SetText "-1"
928 temp (2) = Vonlinks.GetText
929 temp (3) = Vonrechts.GetText
930 TabEinzuegeUndAbstaende.OK
931 Call wTypeKeys ("<down>")
933 Kontext "TabelleAuftrennen"
934 Eigene.Check '<------------- this is the key
937 temp (5) = hGetTableName ()
938 if (temp(5) <> ( fLocaleString("LocaleTable") + "1" )) then warnlog "Split table didn't work! is: "+ temp(5) + "; should: "+(fLocaleString("LocaleTable") + "1")
939 ' -------------check if NO heading (would be a custom style...))
940 Call wTypeKeys "<Up>",2
941 Call wTypeKeys "<mod1 a>"
943 temp(6) = GetClipboardText
944 FormatParagraph ' check style
946 Active.SetPage TabEinzuegeUndAbstaende
948 Kontext "TabEinzuegeUndAbstaende"
950 if temp (2) <> Vonlinks.GetText then Warnlog "Indent 'Before text' has been changed!"
951 if temp (3) <> Vonrechts.GetText then Warnlog "Indent 'After text' has been changed!"
952 TabEinzuegeUndAbstaende.OK
953 FormatStylesCatalog ' verify
954 Kontext "Vorlagenkatalog"
955 if Ansicht.Gettext <> temp(4) then Warnlog "Style in Header has been changed!"
956 Vorlagenkatalog.Cancel
957 if (hGetTableName () <> temp(1)) then warnlog "Split table didn't work? is: "+hGetTableName () +"; should: "+temp(1)
958 if (temp(6) <> temp(1)) then warnlog "wrong heading! is: " + temp(6) + " should: " + temp(1)
962 ' ----------------------------------------------------------------------
964 testcase TableSplit_custom_heading_apply_style
965 ' SHOULD BE EASIER TO WORK ON ODIE TOOOOOO
966 dim temp(10) as string
967 dim PAGEWIDTH as double
968 dim ac as integer, fc as integer
972 Call TBOhTabelleEinfuegen ("dummy" ,0,1,0,1,"1",tHeight:="1") ' insert table
973 Call wTypeKeys "<mod1 end><mod1 end>"
975 TBOhTabelleEinfuegen (temp (1) ,1,1,0,1,"10",tHeight:="10") ' insert table
977 Printlog "'/// Splitting Tables & UNDO ///"
978 Printlog "'/// check 'custom heading (apply style)' ///"
980 Call wTypeKeys temp(2)
981 ' set some style to verify
983 Kontext "TabTabulator"
985 Active.SetPage TabEinzuegeUndAbstaende
987 Kontext "TabEinzuegeUndAbstaende"
989 Vonlinks.SetText "-1"
990 VonRechts.SetText "-1"
991 temp (4) = Vonlinks.GetText
992 temp (5) = Vonrechts.GetText
993 TabEinzuegeUndAbstaende.OK
994 Call wTypeKeys "<down>",2
996 Kontext "TabelleAuftrennen"
997 EigeneMitVorlage.Check '<------------- this is the key
1000 temp (6) = hGetTableName ()
1001 if (temp(6) <> (fLocaleString("LocaleTable")+"1")) then
1002 warnlog "Split table didn't work! is: "+temp(6)+"; should: "+(fLocaleString("LocaleTable")+"1")
1004 ' -------------check if heading
1005 Kontext "TextObjectbar"
1006 if (Vorlage.GetSelText <> fLocaleString("LocaleTableHeading")) then
1007 Warnlog "table heading did not work!"
1008 warnlog "is: " & Vorlage.GetSelText & ", should " & fLocaleString("LocaleTableHeading")
1009 'GetSelText bleibt in der box
1010 Call wTypeKeys "<Escape>"
1012 '----------------------------------
1013 FormatParagraph ' check style
1014 Kontext "TabTabulator"
1016 Active.SetPage TabEinzuegeUndAbstaende
1018 Kontext "TabEinzuegeUndAbstaende"
1020 TabEinzuegeUndAbstaende.OK
1021 Call wTypeKeys "<up><up><up>" ' goto old table
1022 if (hGetTableName () <> (temp(1))) then warnlog "Split table didn't work? "
1023 Call wTypeKeys "<end><shift home>" ' check heading in 'old' table
1025 temp(3) = GetClipboardText
1026 if (temp(2) <> temp(3)) then warnlog "wrong heading! is: "+temp(3)+"; should: "+temp(2)
1031 ' ----------------------------------------------------------------------
1033 testcase TableSplit_no_heading
1034 ' SHOULD BE EASIER TO WORK ON ODIE TOOOOOO
1035 dim temp(10) as string
1036 dim PAGEWIDTH as double
1037 dim ac as integer, fc as integer
1041 Call TBOhTabelleEinfuegen ("dummy" ,0,1,0,1,"1",tHeight:="1") ' insert table
1042 Call wTypeKeys "<mod1 end><mod1 end>"
1044 Call TBOhTabelleEinfuegen (temp (1) ,1,1,0,1,"10",tHeight:="10") ' insert table
1046 Printlog "'/// Splitting Tables & UNDO ///"
1047 Printlog "'/// check 'no heading' ///"
1050 Call wTypeKeys ( temp(2) )
1051 Call wTypeKeys ( "<down>" )
1052 Call wTypeKeys ( temp(3) )
1053 Call wTypeKeys ( "<Home>" )
1054 ' set some style to verify
1057 Active.SetPage TabEinzuegeUndAbstaende
1059 Kontext "TabEinzuegeUndAbstaende"
1061 Vonlinks.SetText "-1"
1062 VonRechts.SetText "-1"
1063 temp (4) = Vonlinks.GetText
1064 temp (5) = Vonrechts.GetText
1065 TabEinzuegeUndAbstaende.OK
1067 Kontext "TabelleAuftrennen"
1069 TabelleAuftrennen.OK
1071 temp (6) = hGetTableName ()
1072 if (temp(6) <> ( fLocaleString("LocaleTable") + "1" )) then warnlog "Split table didn't work! is: " + temp(6) + "; should: " + (fLocaleString("LocaleTable") + "1" )
1073 ' -------------check if NO heading (would be a custom style...))
1074 Kontext "TextObjectbar"
1075 Call wTypeKeys "<end><shift home>" ' check heading in 'new' table
1078 ' Should be 'Content'
1079 if (GetClipboardText <> temp(3)) then warnlog "wrong content! is: " + GetClipboardText + " should: " + temp(3)
1081 Warnlog "Unable to copy content! Maybe not selected!"
1083 FormatParagraph ' check style
1085 Active.SetPage TabEinzuegeUndAbstaende
1087 Kontext "TabEinzuegeUndAbstaende"
1089 if ((Vonlinks.GetText <>temp (4) ) OR (Vonrechts.GetText <>temp (5) )) then warnlog "style didn't get inherited"
1090 TabEinzuegeUndAbstaende.OK
1091 Call wTypeKeys "<up><up>" ' goto header
1092 if (hGetTableName () <> (temp(1))) then warnlog "Split table didn't work? "
1093 Call wTypeKeys "<Mod1 A>" ' check heading in 'old' table
1097 Warnlog "Unable to copy content! Maybe not selected!"
1099 if (GetClipboardText <> temp(2)) then warnlog "wrong heading! is: " + GetClipboardText + " should: " + temp(2)
1103 ' ----------------------------------------------------------------------
1105 testcase sTableMerge
1106 dim temp(10) as string
1109 Call wTypeKeys "<return><mod1 end><mod1 end>"
1110 Call wTypeKeys "<mod1 end><mod1 end>"
1116 Call TBOhTabelleEinfuegen (temp (2) ,0,1,0,1,"10",tHeight:="7") ' insert table Arlene
1118 Call wTypeKeys "<mod1 end><mod1 end>"
1119 Call TBOhTabelleEinfuegen (temp (3) ,0,1,0,1,"10",tHeight:="7") ' insert table Pooky
1121 Call wTypeKeys "<mod1 end><mod1 end>"
1122 Call TBOhTabelleEinfuegen (temp (4) ,0,1,0,1,"10",tHeight:="7") ' insert table Nermal
1125 Printlog "'/// Join tables & UNDO///"
1126 Printlog "'/// insert 3 tables: 'Arlene' 'Pooky' 'Nermal' ///"
1128 ' usually lowwer to upper one...
1129 ' update formulars ....
1130 Printlog "'/// join Nermal with pooky -> Nermal has to be under Arlene -> undo ///"
1132 if (hGetTableName () <> temp(4)) then warnlog "Merge table didn't work? 1 "
1133 Call wTypeKeys "<mod1 home><up>"
1134 if (hGetTableName () <> temp(2)) then warnlog "Merge table didn't work? 1+ "
1136 Call wTypeKeys "<up><mod1 home>"
1138 Printlog "'/// join Nermal with pooky -> choose lowerTable -> Nermal has to be under Arlene again -> undo ///"
1140 Kontext "TabellenVerbinden"
1141 if TabellenVerbinden.exists (5) <> TRUE then
1142 warnlog "there is only one table around no question for which table should be connected "
1144 MitNachfolgenderTabelleVerbinden.Check
1145 TabellenVerbinden.OK
1146 temp (5) = hGetTableName ()
1147 if (temp (5) <> temp(3)) then warnlog "Merge table didn't work? 2 is:"+temp (5)+" should: "+temp(3)
1148 Call wTypeKeys "<up>"
1149 if (hGetTableName () <> temp(2)) then warnlog "Merge table didn't work? 2+ "
1151 Call wTypeKeys "<up><mod1 home>"
1153 Printlog "'/// join Pooky with Arlene -> choose upperTable -> Pooky is now above Nermal -> undo ///"
1155 Kontext "TabellenVerbinden"
1156 MitVorherigerTabelleVerbinden.Check
1157 TabellenVerbinden.OK
1158 temp (5) = hGetTableName ()
1159 if (temp (5) <> temp(3)) then warnlog "Merge table didn't work? 3 is:"+temp (5)+" should: "+temp(3)
1160 Call wTypeKeys "<up>"
1161 if (hGetTableName () <> temp(3)) then warnlog "Merge table didn't work? 3+ "
1163 Call wTypeKeys "<up><mod1 home>"
1165 Printlog "'/// join Arlene with Pooky -> Pooky is above Nermal -> undo ///"
1167 Kontext "TabellenVerbinden"
1168 if TabellenVerbinden.exists then
1169 warnlog "tzhere shouldn't be a table connect dialog; yust one table to connect to available "
1170 TabellenVerbinden.cancel
1173 temp (5) = hGetTableName ()
1174 if (temp (5) <> temp(2)) then warnlog "Merge table didn't work? 4 is:"+temp (5)+" should: "+temp(2)
1176 Call wTypeKeys "<mod1 end><down>"
1178 if (hGetTableName () <> temp(4)) then warnlog "Merge table didn't work? 4+ "
1185 ' ----------------------------------------------------------------------
1187 function hGetPageWidth() as double
1188 Dim tWidth as double
1192 warnlog ":couldn't get menuentry: FormatPageWriter"
1196 Active.SetPage TabSeite
1198 printlog "Test: "+ Breite.GetText +" " +Links.GetText +" " +Rechts.GetText
1199 tWidth = (StrToDouble(Breite.GetText) - ( StrToDouble(Links.GetText) + StrToDouble(Rechts.GetText)) )
1200 hGetPageWidth = tWidth