1 'encoding UTF-8 Do not remove or change this line!
\r
2 '**************************************************************************
\r
3 '* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
\r
5 '* Copyright 2008 by Sun Microsystems, Inc.
\r
7 '* OpenOffice.org - a multi-platform office productivity suite
\r
9 '* $RCSfile: w_stylist.inc,v $
\r
13 '* last change: $Author: vg $ $Date: 2008-08-18 12:36:39 $
\r
15 '* This file is part of OpenOffice.org.
\r
17 '* OpenOffice.org is free software: you can redistribute it and/or modify
\r
18 '* it under the terms of the GNU Lesser General Public License version 3
\r
19 '* only, as published by the Free Software Foundation.
\r
21 '* OpenOffice.org is distributed in the hope that it will be useful,
\r
22 '* but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
23 '* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
24 '* GNU Lesser General Public License version 3 for more details
\r
25 '* (a copy is included in the LICENSE file that accompanied this code).
\r
27 '* You should have received a copy of the GNU Lesser General Public License
\r
28 '* version 3 along with OpenOffice.org. If not, see
\r
29 '* <http://www.openoffice.org/license.html>
\r
30 '* for a copy of the LGPLv3 License.
\r
32 '/************************************************************************
\r
34 '* owner : helge.delfs@sun.com
\r
36 '* short description : Test common stylist functions and assigning styles
\r
38 '************************************************************************
\r
40 ' #1 tFormatStylist1
\r
41 ' #1 tFormatStylist2
\r
42 ' #1 tFormatStylist3
\r
43 ' #1 tFormatStylist4
\r
44 ' #1 tFormatStylist5
\r
45 ' #1 tFormatStylist6
\r
46 ' #1 tFormatStylist7
\r
47 ' #1 tAssigningStyles1
\r
48 ' #1 tAssigningStyles2
\r
49 ' #1 tAssigningStyles3
\r
50 ' #1 tAssigningStyles4
\r
51 ' #1 tAssigningStyles5
\r
52 ' #1 tAssigningStyles6
\r
53 ' #1 tAssigningStyles7
\r
54 ' #1 tKeyboardShortcutToStyles
\r
56 '\***********************************************************************
\r
59 printLog Chr(13) + "--------- Level 1 - Format / Stylist ----------"
\r
61 Call tFormatStylist1 ' all methods on stylist
\r
62 Call tFormatStylist2 ' interacting between documents
\r
63 Call tFormatStylist3 ' show all templates
\r
64 Call tFormatStylist4 ' search/create templates
\r
65 Call tFormatStylist5 ' select templet in stylist
\r
66 Call tFormatStylist6 ' new template from selection
\r
67 Call tFormatStylist7 ' new template from selection, modified via ContextMenu.
\r
68 Call tAssigningStyles1
\r
69 Call tAssigningStyles2
\r
70 Call tAssigningStyles3
\r
71 Call tAssigningStyles4
\r
72 Call tAssigningStyles5
\r
73 Call tAssigningStyles6
\r
74 Call tAssigningStyles7
\r
75 Call tKeyboardShortcutToStyles
\r
79 ' **********************************************************************
\r
81 testcase tFormatStylist1
\r
87 printlog "- Format / Stylist : all methods with Navigator as window"
\r
88 printlog "New writerdocument"
\r
90 printlog " - Call Stylist with F11"
\r
91 printlog "Call stylist with <F11> aand proof all windowmethods at stylist"
\r
92 Call wTypeKeys "<F11>"
\r
94 if Stylist.NotExists then
\r
95 Warnlog "No Stylist with <F11>"
\r
98 xPos = Stylist.GetPosX
\r
99 yPos = Stylist.GetPosY
\r
100 xSize% = Stylist.GetSizeX
\r
101 ySize% = Stylist.GetSizeY
\r
103 printlog " - move Stylist"
\r
104 Stylist.Move 10, 10
\r
106 Stylist.Move 300, 400
\r
108 Stylist.Move 590, 790
\r
110 Stylist.Move xPos, yPos
\r
113 printlog " - size Stylist"
\r
115 Stylist.Size 300, 400
\r
117 Warnlog "Sizen Stylist doesn't work.. see #i32449"
\r
121 Stylist.Size xSize%, ySize%
\r
123 Warnlog "Sizen Stylist doesn't work.. see #i32449"
\r
127 printlog " - close Stylist and reopen ( has to be the same size )"
\r
128 xPos = Stylist.GetPosX
\r
129 yPos = Stylist.GetPosY
\r
130 xSize% = Stylist.GetSizeX
\r
131 ySize% = Stylist.GetSizeY
\r
135 if xPos <> Stylist.GetPosX then Warnlog "x-Pos. has been changed : Not -> "+ xPos + " but -> "+ Stylist.GetPosX
\r
136 if yPos <> Stylist.GetPosY then Warnlog "y-Pos. has been changed : Not -> "+ yPos + " but -> "+ Stylist.GetPosY
\r
137 if xSize% <> Stylist.GetSizeX then Warnlog "x-Size has been changed : Not -> "+ xSize% + " but -> "+ Stylist.GetSizeX
\r
138 if ySize% <> Stylist.GetSizeY then Warnlog "y-Size has been changed : Not -> "+ ySize% + " but -> "+ Stylist.GetSizeY
\r
140 printlog " - dock Stylist"
\r
143 if NOT Stylist.IsDocked then Warnlog "Stylist has not been docked in"
\r
148 printlog "Close document"
\r
149 Call hCloseDocument
\r
153 ' **********************************************************************
\r
155 testcase tFormatStylist2
\r
161 printlog "- Format/Stylist : Methods from Stylist as Window between more than one document"
\r
162 printlog " New document"
\r
164 printlog "check all methods of Stylist as Window between more than one document"
\r
165 Call wTypeKeys "Test the stylist functions"
\r
166 printlog " - Call Stylist in first document and check in a second document"
\r
169 If Not Stylist.Exists then FormatStylist
\r
172 Call wTypeKeys "Test the stylist functions"
\r
175 if Stylist.NotExists then Warnlog "No Stylist in new document"
\r
177 printlog " - Close all documents and reopen"
\r
179 Call hCloseDocument
\r
181 Call hCloseDocument
\r
185 Call wTypeKeys "Test the stylist functions"
\r
187 if Stylist.NotExists then Warnlog "No Stylist in a new document"
\r
189 printlog " - Dock Stylist in first document and check in a new if docked"
\r
194 Call wTypeKeys "Test the stylist functions"
\r
196 if NOT Stylist.IsDocked then Warnlog "Stylist is not docked in new document"
\r
198 printlog " - Close all documents, reopen one and check docked Stylist"
\r
199 Call hCloseDocument
\r
201 Call hCloseDocument
\r
205 if NOT Stylist.IsDocked then Warnlog "Stylist is not docked in new document"
\r
207 printlog " - Close Stylist with <F11>"
\r
210 Call wTypeKeys "<F11>"
\r
212 if NOT Stylist.NotExists then
\r
213 Warnlog "Stylist is still open"
\r
216 printlog "Close document"
\r
217 Call hCloseDocument
\r
221 ' **********************************************************************
\r
223 testcase tFormatStylist3
\r
225 Dim AllStyles as integer
\r
227 Dim RemString as string
\r
228 printlog "- Format / Stylist : select all Style properties"
\r
231 printlog " New writerdocument"
\r
233 printlog "Select all style properties in stylist"
\r
235 if Stylist.NotExists then FormatStylist
\r
236 printlog " - Paragraph Styles"
\r
237 Absatzvorlagen.Click
\r
239 for i=1 to Gruppenliste.GetItemCount
\r
240 Gruppenliste.Select i
\r
242 if i = 2 then ' All Styles
\r
243 Vorlagenliste.TypeKeys "<Home>"
\r
246 RemString = Vorlagenliste.Gettext
\r
247 'Include this, if you want to see the styles in writerdocument
\r
248 'SetClipboard Vorlagenliste.Gettext
\r
249 'Kontext "DocumentWriter"
\r
250 'DocumentWriter.TypeKeys GetClipboardtext + "<Return>"
\r
252 Vorlagenliste.TypeKeys "<Down>"
\r
253 if Vorlagenliste.Gettext <> RemString then
\r
254 AllStyles = AllStyles + 1
\r
257 if AllStyles <> "122" then
\r
258 Select Case iSprache
\r
260 warnlog "Double styles in stylist"
\r
262 warnlog "Missing Style in Stylist"
\r
264 warnlog "Missing Style in Stylist"
\r
266 Warnlog "There are " + AllStyles + " styles in this category and not 122!"
\r
269 printlog "There are " + AllStyles + " styles in this category!"
\r
277 Zeichenvorlagen.Click
\r
279 printlog " - Chapter Styles"
\r
280 for i=1 to Gruppenliste.GetItemCount
\r
281 Gruppenliste.Select i
\r
282 AllStyles = AllStyles + 1
\r
286 Rahmenvorlagen.Click
\r
288 printlog " - Frame Styles"
\r
289 for i=1 to Gruppenliste.GetItemCount
\r
290 Gruppenliste.Select i
\r
291 AllStyles = AllStyles + 1
\r
295 Seitenvorlagen.Click
\r
297 printlog " - Page Styles"
\r
298 for i=1 to Gruppenliste.GetItemCount
\r
299 Gruppenliste.Select i
\r
300 AllStyles = AllStyles + 1
\r
304 printlog "Close document"
\r
305 Call hCloseDocument
\r
308 ' **********************************************************************
\r
310 testcase tFormatStylist4
\r
315 printlog "- Format / Stylist : check created Styles"
\r
316 printlog "New writerdocument"
\r
318 printlog " - create Paragraph Style in Stylist"
\r
319 Call wStyleCreate ( "ATesttool", "Paragraph", true )
\r
321 printlog "Check if Style has been added in stylist"
\r
322 if wStyleSelect ( "ATesttool", "Paragraph" ) = false then Warnlog "Paragraph Style has not been found"
\r
324 printlog " - Create Character Style in Stylist"
\r
325 Call wStyleCreate ( "BTesttool", "Character", true )
\r
326 if wStyleSelect ( "BTesttool", "Character" ) = false then Warnlog "Character Style has not been found!"
\r
327 printlog " - Create Frame Style in Stylist"
\r
328 Call wStyleCreate ( "CTesttool", "Frame", true )
\r
329 if wStyleSelect ( "CTesttool", "Frame" ) = false then Warnlog "Frame Style has not been found!"
\r
331 printlog " - Create Page Style in Stylist"
\r
332 Call wStyleCreate ( "DTesttool", "Page", true )
\r
333 if wStyleSelect ( "DTesttool", "Page" ) = false then Warnlog "Page Style has not been found"
\r
335 printlog " - creating Styles should not have been affecting to new documents"
\r
336 ' To avoid focus problems on unix first close stylist
\r
338 if Stylist.Exists then FormatStylist
\r
341 if Not Stylist.Exists then FormatStylist
\r
343 if wStyleSelect ( "ATesttool", "Paragraph" ) = true then Warnlog "Paragraph Style has been found in new document"
\r
344 if wStyleSelect ( "BTesttool", "Character" ) = true then Warnlog "Character Style has been found in new document"
\r
345 'if wStyleSelect ( "CTesttool", "Frame" ) = true then Warnlog "Frame Style has been found in new document"
\r
346 if wStyleSelect ( "DTesttool", "Page" ) = true then Warnlog "Page Style has been found in new document"
\r
348 Call hCloseDocument
\r
349 printlog "Close document"
\r
350 Call hCloseDocument
\r
353 ' **********************************************************************
\r
355 testcase tFormatStylist5
\r
356 Dim SuchMal as string, i as integer
\r
357 Dim bStyleFound as boolean
\r
359 printlog "- Format / Stylist : select Style"
\r
360 printlog "New writerdocument"
\r
361 if bAsianLan = True then
\r
362 printlog "- Not in Asian languages!"
\r
366 Call wTypeKeys "Dies ist ein formatierter Text <Shift Home>"
\r
367 printlog " - format Text"
\r
370 Active.SetPage TabFontEffects
\r
371 Kontext "TabFontEffects"
\r
372 StrikeThrough.Select 2
\r
376 printlog " - adjust to Standard-Format through the Stylist"
\r
377 printlog "adjust to Standard-Format through the Stylist"
\r
380 if Stylist.NotExists then FormatStylist
\r
381 'Get name for 'default' template
\r
382 Kontext "TextObjectbar"
\r
383 SuchMal = Vorlage.GetSelText
\r
384 printlog "Using " & SuchMal & " as 'default'"
\r
387 Vorlagenliste.TypeKeys "<Home>"
\r
388 bStyleFound = false
\r
389 for i=1 to Vorlagenliste.GetItemCount
\r
390 Vorlagenliste.Select i
\r
391 if Vorlagenliste.GetText = Suchmal then
\r
392 Vorlagenliste.TypeKeys "<Return>"
\r
399 if bStyleFound = false then
\r
400 Warnlog "Style: " & Suchmal & " has not been found in Stylist"
\r
401 Call hCloseDocument
\r
405 printlog " - check format"
\r
408 Active.SetPage TabFontEffects
\r
409 Kontext "TabFontEffects"
\r
410 if StrikeThrough.GetSelIndex = 2 then Warnlog "Wrong entry selected in StrikeThrough"
\r
411 if Outline.IsChecked then Warnlog "Format Outline is still checked"
\r
414 printlog "Close document"
\r
415 Call hCloseDocument
\r
418 ' **********************************************************************
\r
420 testcase tFormatStylist6
\r
423 printlog "- Format / Stylist : new Style from selection"
\r
424 printlog "New writerdocument"
\r
426 Call wTypeKeys "Creating a style from selection <Return><Up><Shift End>"
\r
427 printlog "create a new style from selection"
\r
430 Active.SetPage TabFontEffects
\r
431 Kontext "TabFontEffects"
\r
433 StrikeThrough.Select 2
\r
435 OverlineColor.Select 6
\r
440 Active.Setpage TabHyperlinkZeichen
\r
441 Kontext "TabHyperlinkZeichen"
\r
442 URLName.SetText "www.mikeportnoy.com"
\r
443 TabHyperlinkZeichen.OK
\r
445 printlog " - Create Character Style from selection"
\r
447 if not Stylist.Exists then FormatStylist
\r
449 TBGestalter.Click ZeichenVorlagen
\r
452 AusSelektion.OpenMenu
\r
457 Kontext "VorlageErzeugen"
\r
458 if VorlageErzeugen.Exists then
\r
459 VorlagenName.SetText "Testtool"
\r
462 Warnlog "Creating Style did not work. Dialog not up!"
\r
465 printlog " - assign new Character Style to a new text"
\r
466 wTypeKeys "<Home><Down>",3
\r
467 wTypeKeys "This is some new text <Return><Up><Up><Shift End>"
\r
469 TBGestalter.Click ZeichenVorlagen
\r
470 if Vorlagenliste.GetSeltext <> "Testtool" then 'Go find the entry.
\r
471 Vorlagenliste.TypeKeys "<Home>"
\r
473 Vorlagenliste.TypeKeys "<Down>"
\r
474 if Vorlagenliste.GetSeltext = "Testtool" then 'Found it!
\r
479 Vorlagenliste.TypeKeys "<Return>" 'Assign to text.
\r
482 Warnlog "Created Style could not be found in Stylist!"
\r
484 Printlog " - check Style"
\r
487 Active.SetPage TabFontEffects
\r
488 Kontext "TabFontEffects"
\r
489 if NOT Shadow.IsChecked then Warnlog "Shadow is not checked anymore"
\r
490 if StrikeThrough.GetSelIndex <> 2 then Warnlog "Wrong entry selection in StrikeThrough"
\r
491 if Overline.GetSelIndex <> 2 then Warnlog "Overline is not checked anymore"
\r
492 if OverlineColor.GetSelIndex <> 6 then Warnlog "Wrong Overline Color selected"
\r
493 if NOT Outline.IsChecked then Warnlog "Outline is not checked anymore"
\r
494 if Effects.GetSelIndex <> 3 then Warnlog "Wrong effect selected"
\r
495 if NOT Blinking.IsChecked then Warnlog "Blinking is not checked anymore"
\r
497 Active.Setpage TabHyperlinkZeichen
\r
498 Kontext "TabHyperlinkZeichen"
\r
499 if URLName.GetText <> "http://www.mikeportnoy.com/" then Warnlog "#i41171#TabHyperlink: URL is wrong " + URLName.Gettext
\r
500 TabHyperlinkZeichen.OK
\r
503 printlog "Close document"
\r
504 Call hCloseDocument
\r
507 ' **********************************************************************
\r
509 testcase tFormatStylist7
\r
512 printlog "- Format / Stylist : new Style from selection, then modified via the ContextMenu."
\r
513 printlog "New writerdocument"
\r
515 Call wTypeKeys "Creating a style from selection <Return><Up><Shift End>"
\r
516 printlog "create a new style from selection"
\r
518 printlog " - Create Character Style from selection"
\r
520 if not Stylist.Exists then FormatStylist
\r
522 TBGestalter.Click ZeichenVorlagen
\r
525 AusSelektion.OpenMenu
\r
530 Kontext "VorlageErzeugen"
\r
531 if VorlageErzeugen.Exists then
\r
532 VorlagenName.SetText "Testtool"
\r
535 Warnlog "Creating Style did not work. Dialog not up!"
\r
538 printlog " Open ContextMenu over the 'Testtool' Style."
\r
540 if not Stylist.Exists then FormatStylist
\r
542 TBGestalter.Click ZeichenVorlagen
\r
543 if Vorlagenliste.GetSeltext <> "Testtool" then
\r
544 Vorlagenliste.TypeKeys "<Home>"
\r
546 Vorlagenliste.TypeKeys "<Down>"
\r
547 if Vorlagenliste.GetSeltext = "Testtool" then
\r
552 warnlog "No Testtool -Stylist found. Check if new stylists can be created. Test ends."
\r
556 Vorlagenliste.TypeKeys "<SHIFT F10>" 'Open ContextMenu
\r
558 printlog " Select 'Modify'"
\r
559 Call hMenuSelectNr(2) 'Modify
\r
562 printlog " Goto Tabpage 'Font Effects' and change some settings."
\r
564 Active.SetPage TabFontEffects
\r
565 Kontext "TabFontEffects"
\r
567 StrikeThrough.Select 2
\r
569 OverlineColor.Select 6
\r
575 printlog " - assign new Character Style to a new text"
\r
576 wTypeKeys "<Home><Down>",3
\r
577 wTypeKeys "This is some new text <Return><Up><Up><Shift End>"
\r
579 TBGestalter.Click ZeichenVorlagen
\r
581 if Vorlagenliste.GetSeltext <> "Testtool" then
\r
582 Vorlagenliste.TypeKeys "<Home>"
\r
584 Vorlagenliste.TypeKeys "<Down>"
\r
585 if Vorlagenliste.GetSeltext = "Testtool" then 'Found it!
\r
590 Vorlagenliste.TypeKeys "<Return>" 'Assign Style to Text.
\r
593 Warnlog "Created Style could not be found in Stylist!"
\r
595 Printlog " - check Style"
\r
598 Active.SetPage TabFontEffects
\r
599 Kontext "TabFontEffects"
\r
600 if NOT Shadow.IsChecked then Warnlog "Shadow is not checked anymore"
\r
601 if StrikeThrough.GetSelIndex <> 2 then Warnlog "Wrong entry selection in StrikeThrough"
\r
602 if Overline.GetSelIndex <> 2 then Warnlog "Overline is not checked anymore"
\r
603 if OverlineColor.GetSelIndex <> 6 then Warnlog "Wrong Overline Color selected"
\r
604 if NOT Outline.IsChecked then Warnlog "Outline is not checked anymore"
\r
605 if Effects.GetSelIndex <> 3 then Warnlog "Wrong effect selected"
\r
606 if NOT Blinking.IsChecked then Warnlog "Blinking is not checked anymore"
\r
610 printlog "Close document"
\r
611 Call hCloseDocument
\r
614 ' **********************************************************************
\r
616 testcase tAssigningStyles1
\r
618 Dim sStyles() as string
\r
619 Dim sTemp as string
\r
621 Dim bStyleInList as boolean
\r
623 printlog "UI and Strings check"
\r
625 printlog "Open a new writerdocument"
\r
626 printlog "Check if the following strings and only those strings are present:"
\r
627 printlog "Clear formatting"
\r
628 printlog "Heading 1"
\r
629 printlog "Heading 2"
\r
630 printlog "Heading 3"
\r
632 printlog "Text body"
\r
634 Select Case iSprache
\r
635 Case 01 : sStyles = Array("Clear formatting", "Default", "Heading 1", "Heading 2", "Heading 3", "Text body", "More...")
\r
636 Case 07 : sStyles = Array("Отменить форматирование", "Базовый", "Заголовок 1", "Заголовок 2", "Заголовок 3", "Основной текст", "Дополнительно...")
\r
637 Case 31 : sStyles = Array("Opmaak wissen", "Kop 1", "Kop 2", "Kop 3", "Standaard", "Tekstblok", "Meer...")
\r
638 Case 33 : sStyles = Array("Effacer le formatage", "Corps de texte", "Par défaut", "Titre 1", "Titre 2", "Titre 3", "Autres...")
\r
639 Case 34 : sStyles = Array("Borrar formato", "Cuerpo de texto", "Encabezado 1", "Encabezado 2", "Encabezado 3", "Predeterminado", "Más...")
\r
640 Case 36 : sStyles = Array("Formázás törlése", "Alapértelmezett", "Címsor 1", "Címsor 2", "Címsor 3", "Szövegtörzs", "További...")
\r
641 Case 39 : sStyles = Array("Cancella formattazione", "Corpo testo", "Intestazione 1", "Intestazione 2", "Intestazione 3", "Standard", "Extra...")
\r
642 Case 46 : sStyles = Array("Radera formatering", "Brödtext", "Överskrift 1", "Överskrift 2", "Överskrift 3", "Standard", "Mer...")
\r
643 Case 48 : sStyles = Array("Wyczyść formatowanie", "Domyślnie", "Nagłówek 1", "Nagłówek 2", "Nagłówek 3", "Treść tekstu", "Więcej...")
\r
644 Case 49 : sStyles = Array("Formatierung löschen", "Standard", "Textkörper", "Überschrift 1", "Überschrift 2", "Überschrift 3", "Weitere...")
\r
645 Case 55 : sStyles = Array("Limpar formatação", "Corpo do texto", "Padrão", "Título 1", "Título 2", "Título 3", "Mais...")
\r
646 Case 81 : sStyles = Array("書式設定の解除", "本文", "標準", "見出し 1", "見出し 2", "見出し 3", "詳細...")
\r
647 Case 82 : sStyles = Array("서식 지우기", "기본값", "제목 1", "제목 2", "제목 3", "텍스트 본문", "자세히...")
\r
648 Case 86 : sStyles = Array("清除格式", "默认", "标题 1", "标题 2", "标题 3", "正文", "更多(~M)...")
\r
649 Case 88 : sStyles = Array("清除格式", "內文", "標題 1", "標題 2", "標題 3", "預設", "更多...")
\r
650 Case 90 : sStyles = Array("Biçimlendirmeyi temizle", "Başlık 1", "Başlık 2", "Başlık 3", "Metin gövdesi", "Varsayılan", "Diğer...")
\r
651 Case else : Warnlog "Current language not supported. Please add styles to list!"
\r
652 Kontext "Textobjectbar"
\r
653 printlog "- Current Styles: "
\r
654 For i = 1 to Vorlage.GetItemCount
\r
656 printlog Vorlage.GetSelText
\r
658 Call hCloseDocument
\r
662 'Check number of entrys....have to be seven
\r
663 Kontext "Textobjectbar"
\r
664 if Vorlage.GetItemCount <> 7 then
\r
665 Select case iSprache
\r
666 case 82 : warnlog "Korean: Number of styles in styleslistbox wrong"
\r
667 case else : Warnlog "Not 7 entrys in Styles & Formatting combobox but: " & Vorlage.GetItemCount
\r
671 For i = 1 to Vorlage.GetItemCount
\r
673 sTemp = Vorlage.GetSelText
\r
674 printlog "- check style: " & sTemp
\r
675 bStyleInList = false
\r
677 if sStyles(j) = sTemp then
\r
678 bStyleInList = true
\r
682 if bStyleInList = true then
\r
683 printlog "- style " & sTemp & " found in list"
\r
685 if iSprache <> 82 then Warnlog "- style " & sTemp & " wasn't found in list!"
\r
689 Call hCloseDocument
\r
692 ' **********************************************************************
\r
694 testcase tAssigningStyles2
\r
696 Dim sTemp as string
\r
698 printlog "- Apply Style"
\r
699 printlog "New writerdocument"
\r
701 printlog "Insert dummytext"
\r
702 if wBlindtextEinfuegen = false then
\r
703 Call hCloseDocument
\r
707 printlog "Select whole dummytext"
\r
708 Call wTypeKeys "<Mod1 A>"
\r
709 printlog "Apply style 'Heading 1' through Styles & Formatting combobox"
\r
710 Kontext "Textobjectbar"
\r
711 for i = 1 to Vorlage.GetItemCount
\r
713 sTemp = Vorlage.GetSelText
\r
714 if Instr(sTemp, "1") then
\r
715 Vorlage.TypeKeys "<Return>"
\r
720 printlog "Check if style has been applied to paragraph"
\r
721 Call wTypeKeys "<Mod1 Home><End>"
\r
722 Call wTypeKeys "<Left>", 2
\r
724 Kontext "Textobjectbar"
\r
725 if Vorlage.GetSeltext <> sTemp then
\r
726 Warnlog "Seems style has not been completely applied to paragraph!"
\r
729 Call hCloseDocument
\r
732 ' **********************************************************************
\r
734 testcase tAssigningStyles3
\r
736 printlog "- Create a new style"
\r
737 printlog "Open a new writerdocument"
\r
739 printlog "Insert a dummy text"
\r
740 if wBlindtextEinfuegen = false then
\r
741 Call hCloseDocument
\r
745 printlog "Select the whole dummy text"
\r
746 Call wTypeKeys "<Mod1 A>"
\r
747 printlog "Format / Character"
\r
750 Active.Setpage TabFont
\r
752 printlog "Apply first font in list and select 2nd Typeface"
\r
753 if gAsianSup = True then
\r
762 printlog "Enter 'MyStyle' in Stylelistbox"
\r
763 Kontext "Textobjectbar"
\r
764 Vorlage.TypeKeys "<Mod1 A>"
\r
765 Vorlage.TypeKeys "MyStyle<Return>"
\r
767 printlog "Check if style has been applied to the combobox"
\r
768 Call wTypeKeys "<Mod1 End>"
\r
771 Kontext "Textobjectbar"
\r
773 Vorlage.Select "MyStyle"
\r
775 Warnlog "Seems style has not been applied to combobox"
\r
778 printlog "Check if style has been applied to paragraph"
\r
779 Call wTypeKeys "<Mod1 Home>"
\r
780 Call wTypeKeys "<Right>", 2
\r
782 Kontext "Textobjectbar"
\r
783 if Vorlage.GetSelText <> "MyStyle" then
\r
784 Warnlog "Seems style has not been applied to paragraph"
\r
787 printlog "Close Document"
\r
788 Call hCloseDocument
\r
791 ' **********************************************************************
\r
793 testcase tAssigningStyles4
\r
795 Dim sTemp as string
\r
796 Dim sStyle as integer
\r
798 printlog "- Clear formatting: whole paragraph"
\r
799 printlog "Open a new writer document"
\r
801 printlog "Insert a dummytext"
\r
802 if wBlindtextEinfuegen = false then
\r
803 Call hCloseDocument
\r
807 printlog "Select whole dummytext"
\r
808 Call wTypeKeys "<Mod1 A>"
\r
809 printlog "Apply style 'Heading 1' through Styles & Formatting combobox"
\r
810 Kontext "Textobjectbar"
\r
811 ' remeber default style
\r
812 sStyle = Vorlage.GetSelIndex
\r
813 for i = 1 to Vorlage.GetItemCount
\r
815 sTemp = Vorlage.GetSelText
\r
816 if Instr(sTemp, "1") then
\r
817 Vorlage.TypeKeys "<Return>"
\r
822 printlog "choose 'Clear formatting' in combobox"
\r
823 Kontext "Textobjectbar"
\r
825 Vorlage.TypeKeys "<Return>"
\r
827 printlog "Check if style has been set to default"
\r
828 Call wTypeKeys "<Mod1 Home>"
\r
829 Call wTypeKeys "<Right>", 3
\r
832 Kontext "Textobjectbar"
\r
833 if Vorlage.GetSelIndex <> sStyle then
\r
834 warnlog "Seems paragraph has not been set to default! " & Vorlage.GetSelText & "(" & Vorlage.GetSelIndex & ")"
\r
837 printlog "Close Document"
\r
838 Call hCloseDocument
\r
842 ' **********************************************************************
\r
844 testcase tAssigningStyles5
\r
846 printlog "- Clear formatting: whole paragraph with hard formatting of some characters"
\r
847 printlog " - 1. Cursor outside of hard formatted string"
\r
848 printlog "Open a new writer document"
\r
850 printlog "Insert a dummytext"
\r
851 if wBlindtextEinfuegen = false then
\r
852 Call hCloseDocument
\r
856 printlog "Highlight first line in dummy text"
\r
857 Call wTypeKeys "<Mod1 Home>"
\r
858 Call wTypeKeys "<Shift End>"
\r
860 printlog "Format / Bold"
\r
861 Kontext "TextObjectbar"
\r
862 if Not TextObjectbar.Exists then Call hToolbarSelect ( "FORMATTING", true )
\r
866 printlog "Set cursor outside of bold formatted text"
\r
867 Call wTypeKeys "<Mod1 Home>"
\r
868 Call wTypeKeys "<Down><Right>"
\r
870 printlog "Select 'Clear Formatting' in Style-Listbox"
\r
871 Kontext "Textobjectbar"
\r
873 Vorlage.TypeKeys "<Return>"
\r
876 printlog "Check that first line is still bold and has not been reset"
\r
877 Call wTypeKeys "<Mod1 Home>"
\r
878 Call wTypeKeys "<Right>"
\r
880 Kontext "TextObjectbar"
\r
881 if Fett.Getstate(2) = 0 then
\r
882 Warnlog "Style 'Bold' has been reset!"
\r
885 printlog "Close document"
\r
886 Call hCloseDocument
\r
889 ' **********************************************************************
\r
891 testcase tAssigningStyles6
\r
893 Dim iStandard as integer
\r
895 printlog "- Clear formatting: whole paragraph with hard formatting of some characters"
\r
896 printlog " - 2. Cursor inside of hard formatted string"
\r
897 printlog "Open a new writer document"
\r
899 printlog "Insert a dummytext"
\r
900 if wBlindtextEinfuegen = false then
\r
901 Call hCloseDocument
\r
905 printlog "Highlight first line in dummy text"
\r
906 Call wTypeKeys "<Mod1 Home>"
\r
907 Call wTypeKeys "<Shift End>"
\r
909 printlog "Format / Bold"
\r
910 Kontext "TextObjectbar"
\r
911 if Not TextObjectbar.Exists then Call hToolbarSelect ( "FORMATTING", true )
\r
915 printlog "Point cursor to first highlighted word of bold formatted text"
\r
916 Call wTypeKeys "<Mod1 Home>"
\r
917 Call wTypeKeys "<Right>"
\r
919 printlog "Select 'Format / Default Formatting' in Style-Listbox"
\r
920 FormatDefaultWriter
\r
923 printlog "first highlighted word should be set to 'Standard'"
\r
924 Call wTypeKeys "<Mod1 Home>"
\r
925 Call wTypeKeys "<Right>"
\r
926 Kontext "TextObjectbar"
\r
927 if Fett.Getstate(2) = 1 then
\r
928 Warnlog "Style 'Bold' has not been reset!"
\r
931 printlog "Check that rest of first line is still bold and has not been reset"
\r
932 Call wTypeKeys "<Mod1 Home>"
\r
933 Call wTypeKeys "<End><Left>"
\r
935 Kontext "TextObjectbar"
\r
936 if Fett.Getstate(2) = 1 then
\r
937 Warnlog "Style 'Bold' has not been reset!"
\r
940 printlog "Close document"
\r
941 Call hCloseDocument
\r
944 ' **********************************************************************
\r
946 testcase tAssigningStyles7
\r
948 printlog "More ..."
\r
949 printlog "Open a new writer document"
\r
952 printlog "Select 'More...' in Style-Listbox"
\r
953 Kontext "Textobjectbar"
\r
954 Vorlage.Select Vorlage.GetItemCount
\r
955 Vorlage.TypeKeys "<Return>"
\r
958 printlog "The Stylist should have been opened"
\r
960 if Not Stylist.Exists then
\r
961 Warnlog "'Styles and Formatting' doesn't open if 'More...' is selected in Style-Listbox"
\r
963 printlog "In Style group listbox 'Automatic' should be selected"
\r
964 if Gruppenliste.GetSelIndex <> 5 then
\r
965 Warnlog "Seems 'Automatic' is not selected per default in 'Styles and Formatting'"
\r
970 printlog "Close document"
\r
971 Call hCloseDocument
\r
974 ' **********************************************************************
\r
976 testcase tKeyboardShortcutToStyles()
\r
977 dim sTempa as string
\r
978 dim sTempb as string
\r
979 dim sTempc as string
\r
983 printlog "open new application document"
\r
984 call hNewDocument()
\r
986 printlog "get current default style from TextObjectBar"
\r
987 kontext "TextObjectBar"
\r
988 sTempa = Vorlage.getSelText
\r
990 for i = 3 to 0 step -1
\r
991 printlog "Perform the Keycombination <CTRL>+3 (2,1,0) and check, if Style in TextObjectBar changed"
\r
992 printlog "- <Ctrl>+<"+i+"> -> Heading "+i+" style"
\r
993 Call hTypeKeys("<Mod1 "+i+">")
\r
995 kontext "TextObjectBar"
\r
997 sTempa = Vorlage.getSelText
\r
998 if (sTempa <> sTempb) then
\r
999 printlog "OK: Heading changed: '" + sTempa + "'"
\r
1001 warnlog "Heading didn't change: '" + sTempa + "'"
\r
1004 kontext "DocumentWriter"
\r
1005 DocumentWriter.TypeKeys("<MOD1 SHIFT 0>")
\r
1007 kontext "TextObjectBar"
\r
1008 sTempa = Vorlage.getSelText
\r
1010 printlog "should now be the default from the beginning"
\r
1011 if (uCase(gApplication)<>"HTML") then
\r
1012 if (sTempa = sTempc) then
\r
1013 printlog "OK: Heading changed to default: '" + sTempa + "'"
\r
1015 warnlog "Heading didn't change to default. Should have been: '" + sTempc + "' but was: '" + sTempa + "'"
\r
1019 printlog "close document"
\r
1020 call hCloseDocument()
\r