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_section_2.inc,v $
13 '* last change: $Author: vg $ $Date: 2008-08-18 12:35:05 $
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 : Hide section / Protect section / Display of dialogues
38 '************************************************************************
43 ' #1 tProtectSection_1
44 ' #1 tDisplaySection_1
45 ' #1 tDisplaySection_2
46 ' #1 tDisplaySection_3
47 ' #1 tDisplaySection_4
48 ' #1 tDisplaySection_5
49 ' #1 tDisplaySection_6
50 ' #1 tDisplaySection_7
51 ' #1 tDisplaySection_8
52 ' #1 tDisplaySection_9
54 '\***********************************************************************
58 printLog Chr(13) + "--------- Hide Section ----------"
59 Call tHideSection_1 'Hide Section without condition
60 Call tHideSection_2 'Hide Section with condition
61 Call tHideSection_3 'Headings and index entries in hidden section should disappear from an index (after actualizing the index)
63 printLog Chr(13) + "--------- Protect Section ----------"
64 Call tProtectSection_1 'Protect Section
66 printLog Chr(13) + "--------- Display of dialogues (Insert - Section) ----------"
67 Call tDisplaySection_1 'Check display of dialogues -- Insert Section
69 printLog Chr(13) + "--------- Display of dialogues (Format - Section) ----------"
70 Call tDisplaySection_2 'Check display of dialogues -- Format Section -1
71 Call tDisplaySection_3 'Check display of dialogues -- Format Section -2
72 Call tDisplaySection_4 'hiding a section hierarchy hides all subsections
74 printLog Chr(13) + "--------- Display of dialogues (Navigator) ----------"
75 Call tDisplaySection_5 'Sections are displayed in row of their insertion in Navigator
76 Call tDisplaySection_6 'Jump to a section by double-clicking it in navigator
77 Call tDisplaySection_7 'Activate Navigator, insert a section , it must be displayed
78 Call tDisplaySection_8 'Select a section in the Navigator, call context menu, choose "Edit"
79 Call tDisplaySection_9 'Check to insert a paragraph before and after a section
83 '***********************************************************************
85 testcase tHideSection_1
86 '/// <b>Hide Section without condition </b>
87 printlog "Hide Section without condition "
89 '/// 1. Test from insert/section
90 '/// Open a new document.
93 '/// Press Return and then input some test words
94 Call wTypeKeys "<Return>"
95 Call wTypeKeys "Section: hidden without condition"
97 '/// Select the test words with SHIFT and HOME keys.
98 Call wTypeKeys "<Shift Home>"
100 '/// Insert/Section / Section, check 'Hide' in Hide area
103 Active.Setpage TabBereiche
104 Kontext "TabBereiche"
109 '/// Edit / SelectAll
113 'Edit / Copy should NOT be available because the words in the section are hidden.
116 warnlog "Hide Section without condition doesn't work in insert/section!"
122 '/// 2.Test from format/section
125 '/// Press Return and then input some test words
126 Call wTypeKeys "<Return>"
127 Call wTypeKeys "Section: hidden without condition"
129 '/// Select the test words with SHIFT and HOME keys.
130 Call wTypeKeys "<Shift Home>"
132 '/// Insert a section
133 Call fInsertSection("HideSection")
135 '/// Format/Section and check 'Hide' in Hide area
137 Kontext "BereicheBearbeiten"
139 BereicheBearbeiten.OK
141 '/// Edit / SelectAll
145 'Edit / Copy should NOT be available , because the words in the section are hided
148 warnlog "Hide Section without condition doesn't work in format/section!"
151 '///Close the document.
155 '----------------------------------------------------------
157 testcase tHideSection_2
158 Dim rightCondition as String
159 Dim wrongCondition as String
160 '/// <b> Hide Section with condition </b>
161 printlog "Hide Section with condition "
162 '/// Open a new document.
164 '/// Press RETURN and then input some test words.
165 Call wTypeKeys "<Return>"
166 Call wTypeKeys "Section: hidden with condition<return>"
168 '/// Select test words with UP- then HOME-key. Press SHIFT- and END-keys together.
169 Call wTypeKeys "<Up><Home><Shift End>"
171 '/// Insert a section.
172 Call fInsertSection("HideSection")
174 '/// Place the cursor out of the section with DOWN key.
175 Call wTypeKeys "<Down>"
177 '/// Insert a user field
178 '/// Insert/Fields/Others , Tabpage Variables ,
179 '/// + select 'User field' in 'Type' area ,
180 '/// + then select 'Text' in 'Format' area ,
181 '/// + input 'myTest' in Name and 'a' in Value ,
182 '/// + click insert button , and close the dialog
185 Active.SetPage TabVariablen
186 Kontext "TabVariablen"
187 Feldtyp.Select Feldtyp.GetItemCount 'User Field
188 Zahlenformat.Select(1) 'Text
189 NameText.SetText "myTest"
191 Einfuegen.Click '--insert button
195 '/// Format/Section, click Hide and enter condition
197 Kontext "BereicheBearbeiten"
199 '/// -- enter wrong condition should NOT hide section
200 '/// => wrong Condition is (myTest eq "B")
201 wrongCondition = "myTest eq " + String(1,34) + "B" + String(1,34)
202 Bedingung.SetText wrongCondition
203 BereicheBearbeiten.OK
206 'Tools/Update/Fields to ensure to hide the section if the section can be hided
210 '/// Use UP-, then HOME-keys, then SHIFT- and END-keys together to
211 '///+ check if the test words in section is hidden.
212 Call wTypeKeys "<Up><Home><Shift End>"
216 warnlog "Hide Section with wrong condition should NOT hide the section!"
220 if GetClipboardText = "Section: hidden with condition" then
222 Call wTypeKeys "<Down>"
224 '/// Format / Sections
226 Kontext "BereicheBearbeiten"
227 '/// Check 'Hide'-checkbox.
229 '/// -- enter right condition should hide section
230 '/// => rightCondition is (myTest eq "A")
231 rightCondition = "myTest eq " + String(1,34) + "a" + String(1,34)
232 Bedingung.SetText rightCondition
233 '/// Close the dialogue with OK.
234 BereicheBearbeiten.OK
236 '/// Tools / Update / Fields
240 '/// Check if the test words in section are hidden.
241 Call wTypeKeys "<Up><Home><Shift End>"
244 if GetClipboardText = "Section: hidden with condition" then
245 warnlog "Hide Section with wrong condition should NOT hide the section!"
247 warnlog "Something wrong, need to check! -- II"
252 warnlog "Something wrong, need to check! -- I"
254 '///Close the document.
258 '----------------------------------------------------------
260 testcase tHideSection_3
262 '/// Headings and index entries in hidden section should disappear from an index (after actualizing the index)
263 printlog " -- Headings and index entries in hidden section should disappear from an index (after actualizing the index)"
267 '/// Insert some test words
268 Call wTypeKeys "Test for Heading and Index in section<Return>"
269 Call wTypeKeys "<Up>"
270 Call wTypeKeys "<Home><Shift End>"
272 '/// Insert a section
273 fInsertSection("HeadAndIndexInSection")
275 '/// select part in the section.
276 Call wTypeKeys "<Home><Shift Mod1 Right>"
278 '/// Select Insert/Indexes and Tables/Entrys and add this part to an index
281 Kontext "VerzeichniseintragEinfuegen"
283 '/// generate testing index - myTest
286 Kontext "BenutzerverzeichnisDefinieren"
287 NameBenutzerverzeichnis.Settext "myTest"
288 BenutzerverzeichnisDefinieren.Ok
291 Kontext "VerzeichniseintragEinfuegen"
294 VerzeichniseintragEinfuegen.close
296 '/// Move the cursor out of the section
297 Call wTypeKeys "<down>"
299 '/// Insert/Indexes and Tables/Indexes and Tables ...
303 Active.SetPage TabVerzeichnisseVerzeichnis
304 Kontext "TabVerzeichnisseVerzeichnis"
305 Verzeichnistyp.Select "myTest"
306 '/// protected against manual changes UNcheck
307 VerzeichnisGeschuetzt.UnCheck
308 TabVerzeichnisseVerzeichnis.OK
310 '/// Edit section with Format/Section and choose 'Hide'
311 Call wTypeKeys "<Up>"
314 Kontext "BereicheBearbeiten"
316 BereicheBearbeiten.OK
318 ToolsUpdateAllIndexes
323 if InStr( GetClipboardText , "Test" ) <> 0 then warnlog "Headings and index entries in hidden section don't disappear from an index:" + GetClipboardText
329 '----------------------------------------------------------
331 testcase tProtectSection_1
333 printlog " - Protect Section"
334 '/// Protect Section ///
338 '/// Open options and check 'Direct-Cursor' in options ///
341 Call wTypeKeys "Should be edited<return>"
342 Call wTypeKeys "Section: protected"
343 Call wTypeKeys "<Shift Home>"
345 '/// Insert a protected section in the bottom ///
350 Active.Setpage TabBereiche
351 Kontext "TabBereiche"
352 Bereichsliste.Settext "protect section"
359 '/// 1) Warning should appear when trying to write in protected area! ///
360 if GetClipBoardtext = "Section: protected" then
361 Call wTypeKeys "<Home>"
362 Call wTypeKeys "<Space>"
364 If Active.Exists then
367 warnlog "- No warning when trying to write in protected area!"
370 warnlog "Testtool couldn't find the protected area!"
373 Call wTypeKeys "<Up>"
374 Call wTypeKeys "<Home><Shift End>"
378 '/// 2) Warning should NOT appear when trying to write in un-protected area
379 '/// + even the protected section at the end of document
380 if GetClipBoardtext = "Should be edited" then
382 Call wTypeKeys "<Home>"
383 Call wTypeKeys "Can you see what I am doing?"
384 Call wTypeKeys "<Home><Shift End>"
386 If GetClipBoardtext <> "Can you see what I am doing?Should be edited" then warnlog "Should edit in the no-protected area"
389 warnlog "Testtool couldn't find the edited area!"
395 '----------------------------------------------------------
397 testcase tDisplaySection_1
399 '/// Check display of dialogues -- Insert Section
400 printlog " - Check display of dialogues -- Insert Section"
402 Dim SectionName() as String
403 Dim correctSequence() as String
404 Dim selectName as String
408 SectionName = Array( _
409 "a1","b2","c3","d4","e5","f6","g7", _
410 "h1","i2","j3","k4","l5","m6","n7", _
411 "H1","I2","J3","K4","L5","M6","N7", _
412 "A1","B2","C3","D4","E5","F6","G7", _
415 Select case iSystemSprache
416 case 81,82,86,88 : correctSequence = Array( _
417 "a1","A1","b2","B2","c3","C3","d4","D4", _
418 "e5","E5","f6","F6","g7","G7", _
419 "h1","H1","i2","I2","j3","J3","k4","K4", _
420 "l5","L5","m6","M6","n7","N7", _
422 case else : correctSequence = Array( _
423 "a1","A1","b2","B2","c3","C3","d4","D4", _
424 "e5","E5","f6","F6","g7","G7", _
425 "h1","H1","i2","I2","j3","J3","k4","K4", _
426 "l5","L5","m6","M6","n7","N7", _
430 ' correctSequence = Array( _
431 ' "A1","a1","B2","b2","C3","c3","D4","d4", _
432 ' "E5","e5","F6","f6","G7","g7", _
433 ' "H1","h1","I2","i2","J3","j3","K4","k4", _
434 ' "L5","l5","M6","m6","N7","n7", _
437 j = UBound(SectionName)
441 '/// insert a lot of sections
443 fInsertSection(SectionName(i))
449 Active.Setpage TabBereiche
450 Kontext "TabBereiche"
452 '/// Check if Section name display alphabetically
454 Bereichsliste.Select i
455 selectName = Bereichsliste.GetSelText
456 if selectName <> correctSequence(i-1) then warnlog "Section name displays alphabetically wrong! Getting section name:"+ selectName +" The section name should be: "+ correctSequence(i-1)
459 '/// check if vertical scrollbar display
460 if (Bereichsliste.HasScrollbar (AlignRight)) = FALSE then warnlog "Vertical scrollbar should be displayed !"
469 '/// Insert a section with a long name
470 fInsertSection("a loooooooooooooooooooooooooooooooooooooooooooooooong name section")
475 Active.Setpage TabBereiche
476 Kontext "TabBereiche"
478 '/// check if horizontal scrollbar display
479 if (Bereichsliste.HasScrollbar (AlignBottom)) = FALSE then warnlog "horizontal scrollbar should be displayed"
488 '----------------------------------------------------------
490 testcase tDisplaySection_2
492 Dim SectionName() as String
495 if Dir (gOfficePath + "user\work\testlink1.odt") <> "" then kill (gOfficePath + "user\work\testlink1.odt")
496 if Dir (gOfficePath + "user\work\testlink2.odt") <> "" then kill (gOfficePath + "user\work\testlink2.odt")
498 '/// Check display of dialogues -- Format Section -1
499 printlog " - Check display of dialogues -- Format Section"
500 '/// -- Section names are displayed in row of their insertion
501 SectionName = Array("a2","A1","a4","A5")
502 j = UBound(SectionName)
507 fInsertSection(SectionName(i))
512 Kontext "BereicheBearbeiten"
513 Bereich.TypeKeys "<Up>",4
516 if BereichsName.GetText <> SectionName(i) then warnlog "Section names are NOT displayed in row of their insertion"
517 Bereich.TypeKeys "<Down>"
520 BereicheBearbeiten.Cancel
525 '/// -- An exception is the hierarchical order; this is diplayed by an indentation
526 SectionName = Array("A2","testlink1","A1","testlink2")
527 j = UBound(SectionName)
530 fInsertSection("testlink1")
531 Call hFileSaveAsKill (gOfficePath + "user\work\testlink1.odt")
535 fInsertSection("testlink2")
536 Call hFileSaveAsKill (gOfficePath + "user\work\testlink2.odt")
539 '/// insert fisrt section linked a test file which include a section
544 Active.Setpage TabBereiche
545 Kontext "TabBereiche"
546 Bereichsliste.Settext "A2"
549 DateiVerknuepfung.Settext ConvertPath(gOfficePath + "user\work\testlink1.odt")
552 '/// insert another section linked another test file which include another section
556 Active.Setpage TabBereiche
557 Kontext "TabBereiche"
558 Bereichsliste.Settext "A1"
561 DateiVerknuepfung.Settext ConvertPath(gOfficePath + "user\work\testlink2.odt")
566 Kontext "BereicheBearbeiten"
568 Bereich.TypeKeys "<Up>",4
571 if BereichsName.GetText <> SectionName(i) then warnlog "Section names are NOT displayed in row of their insertion"
572 Bereich.TypeKeys "<Down>"
575 BereicheBearbeiten.Cancel
582 '----------------------------------------------------------
584 testcase tDisplaySection_3
586 '/// Check display of dialogues -- Format Section -2
587 '/// + double clicking a section with subsections hides the subsections,
588 '/// + another double-click displays them again
590 if Dir (gOfficePath + "user\work\DisplaySection_3.odt") <> "" then kill (gOfficePath + "user\work\DisplaySection_3.odt")
592 printlog " - Check display of dialogues -- Format Section -2"
595 fInsertSection("testlink1")
596 Call hFileSaveAsKill (gOfficePath + "user\work\DisplaySection_3.odt")
599 '/// insert a section(A2) linked a test file which include a section(testlink1)
604 Active.Setpage TabBereiche
605 Kontext "TabBereiche"
606 Bereichsliste.Settext "A2"
609 DateiVerknuepfung.Settext ConvertPath(gOfficePath + "user\work\DisplaySection_3.odt")
614 Kontext "BereicheBearbeiten"
617 if Bereich.GetItemCount < 2 then warnlog "Should be 2 sections in the list tree, now get " +Bereich.GetItemCount
619 if Bereich.GetItemCount > 1 then warnlog "Should be 1 section in the list tree, get " +Bereich.GetItemCount
621 if Bereich.GetItemCount < 2 then warnlog "Should be 2 sections in the list tree, now get " +Bereich.GetItemCount
623 if Bereich.GetItemCount > 1 then warnlog "Should be 1 section in the list tree, get " +Bereich.GetItemCount
625 BereicheBearbeiten.Cancel
632 '----------------------------------------------------------
634 testcase tDisplaySection_4
635 Dim mMessage as String
636 Dim allMessage as String
637 '///<u>Goal</u>: Hiding a section hierarchy hides all subsections.
638 '///+(Except if the section which should be hided is the whole document - than this feature is disabled!)
639 '///+<u>Note</u>: The display in the dialog should not affected by changes in the document view.
640 printlog " - Check hiding a section hierarchy hides all subsections -- Format Section -3"
642 '/// Creating a new document.
643 Call wTypeKeys "This is Section_s<Shift Home>"
644 '/// Writing This is Section_s, marking it and use Insert / Section to create a <i>Section_s</i>.
645 Call fInsertSection("Section_s")
646 '/// Saving it as DisplaySection_4.odt in the user-work-dir.
647 Call hFileSaveAsKill (gOfficePath & "user\work\DisplaySection_4.odt")
648 '/// Closing the document.
650 '/// Creating a new document.
652 '/// <b>Entering a RETURN at the beginning of the new document</b>!
653 Call wTypeKeys "<RETURN>"
654 '/// Writing <i>This is Section_m</i> and marking it.
655 '/// Insert a section named <i>Section_m</i>.
656 Call wTypeKeys "This is Section_m<Shift Home>"
657 Call fInsertSection("Section_m")
658 '/// Create a new line with END and RETURN in the actual section.
659 Call wTypeKeys "<END><RETURN>"
660 '/// Write <i>This Section should be Section_s</i> and mark it.
661 Call wTypeKeys "This Section should be Section_s<Shift Home>"
663 '/// Insert / Section
666 Active.Setpage TabBereiche
667 Kontext "TabBereiche"
668 '/// Name it <i>Section_u</i>.
669 Bereichsliste.Settext "Section_u"
670 '/// <b>Link it</b> to the first created document and the section in it.
671 '///+ There should be pop up a warning! Press OK on it!
674 if Active.Exists then
675 if Active.GetRT = 304 then
678 warnlog "No messagebox warns of deleting content of the current section!"
681 Kontext "TabBereiche"
682 Dateiverknuepfung.Settext ConvertPath(gOfficePath & "user\work\DisplaySection_4.odt")
683 '/// Unprotect it if it is protected.
685 '/// be sure that it is visible.
687 '/// OK on the <i>section</i> dialog.
691 Call wTypeKeys "<MOD1 HOME>",2
692 '/// Type the keys <CTRL HOME> together and twice.
693 Call wTypeKeys "<SHIFT END>"
694 '/// Type the keys <SHIFT END> together.
696 '/// Copy it to the clipboard (Edit / Copy).
697 '/// <i>This is Section_m</i> should be now in the clipboard.
698 if GetClipboardText = "This is Section_m" then
699 '/// Type keys <DOWN> and then <HOME>
700 Call wTypeKeys "<DOWN><HOME>"
701 '/// Type keys <SHIFT END> together
702 Call wTypeKeys "<SHIFT END>"
704 '/// Copy it to the clipboard (Edit / Copy).
705 if GetClipboardText = "This is Section_s" then
706 '/// <i>This is Section_s</i> should be visible/in the clipboard because the top section should not be affected if a lower section has been hided.
708 '/// Format / Sections
710 Kontext "BereicheBearbeiten"
711 '/// Hide the <i>Section_s</i> (Middle section).
712 Bereich.TypeKeys "<Down>"
714 '/// OK on the dialog.
715 BereicheBearbeiten.OK
718 Call wTypeKeys "<HOME>"
720 Call wTypeKeys "<SHIFT END>"
721 '/// Type key <SHIFT END> together
723 '/// Copy it to the clipboard (Edit / Copy).
724 if GetClipboardText <> "This is Section_m" then warnlog "Should only display the content in section_m, but '" & GetClipboardText & "' is visible."
725 '/// <i>This is Section_m</i> should be in the clipboard, nothing more.
727 '/// Format / Sections
729 Kontext "BereicheBearbeiten"
730 '/// Verify that all sections we have created are visible in the dialog.
731 Bereich.TypeKeys "<Up>" , 2
732 if BereichsName.GetText <> "Section_m" then warnlog "The display in dialogue is affected: '" & BereichsName.GetText & "'."
733 Bereich.TypeKeys "<Down>"
734 if BereichsName.GetText <> "Section_u" then warnlog "The display in dialogue is affected: '" & BereichsName.GetText & "'."
735 Bereich.TypeKeys "<Down>"
736 if BereichsName.GetText <> "Section_s" then warnlog "The display in dialogue is affected: '" & BereichsName.GetText & "'."
737 '/// Unhide all Sections.
739 '/// Go to the top section (<i>Section_m</i>
740 Bereich.TypeKeys "<UP>" , 2
741 '/// Hide the top section.
743 '/// OK on the dialog.
744 BereicheBearbeiten.OK
746 '/// Edit / Select all
749 '/// Verify that Edit / Copy is NOT usable! There is nothing selected because all sections should be hided!
751 warnlog "It was possible to use Edit / Copy but it should be an empty document and the menu item should be disabled!"
753 printlog "Edit / Copy was disabled because there should be nothing in the document which could be copied."
756 '/// Format / Sections
758 '///+ Verify that hidintg <i>section_m</i> in the document does not affect the dialog:
759 Kontext "BereicheBearbeiten"
760 Bereich.TypeKeys "<UP>" , 3
761 if BereichsName.GetText <> "Section_m" then warnlog "the display in dialogue is affected" +BereichsName.GetText
762 Bereich.TypeKeys "<DOWN>"
763 if BereichsName.GetText <> "Section_u" then warnlog "the display in dialogue is affected" +BereichsName.GetText
764 Bereich.TypeKeys "<DOWN>"
765 if BereichsName.GetText <> "Section_s" then warnlog "the display in dialogue is affected" +BereichsName.GetText
766 BereicheBearbeiten.Cancel
767 '/// Cancel the dialog.
769 warnlog "Don't get the correct content of Section_s"
772 warnlog "Don't get the correct content of Section_m"
778 '----------------------------------------------------------
780 testcase tDisplaySection_5
782 Dim sectionName() as String
783 Dim correctSequence() as String
787 if Dir (gOfficePath + "user\work\NavigatorSection_1.odt") <> "" then kill (gOfficePath + "user\work\NavigatorSection_1.odt")
789 '/// Sections are displayed in row of their insertion in Navigator.
790 '///+Hierarchies, protected and hidden sections have no special mark.
791 printlog " - Check Section name display in navigator"
793 'Generate a .odt file which include a section
795 fInsertSection("Section_S")
796 Call wTypeKeys "<up>This is section_S"
797 Call hFileSaveAsKill (gOfficePath + "user\work\NavigatorSection_1.odt")
802 '/// Input some test words
803 Call wTypeKeys "Test is in sectionNormal<return>"
804 Call wTypeKeys "Test is in sectionHide<return>"
805 Call wTypeKeys "Test is in sectionProtect<return>"
807 sectionName = Array( _
815 correctSequence = Array( _
823 j = UBound(sectionName)
825 Call wTypeKeys "<Up>",4
828 Call wTypeKeys "<Home><Shift End>"
829 fInsertSection(sectionName(i))
830 Call wTypeKeys "<Down>"
835 Kontext "BereicheBearbeiten"
837 '/// insert a normal section
838 Bereich.TypeKeys "<Up>",4
840 '/// insert a section with hide option
841 Bereich.TypeKeys "<Down>"
842 if BereichsName.GetText = sectionName(1) then
845 warnlog "The second section should be " +sectionName(1) +" bug get" +BereichsName.GetText
848 '/// insert a section with protect option
849 Bereich.TypeKeys "<Down>"
850 if BereichsName.GetText = sectionName(2) then
853 warnlog "The second section should be " +sectionName(2) +" bug get" +BereichsName.GetText
856 '/// insert a section with Link option
857 Bereich.TypeKeys "<Down>"
858 if BereichsName.GetText = sectionName(3) then
860 Dateiname.Settext ConvertPath(gOfficePath + "user\work\NavigatorSection_1.odt")
862 warnlog "The second section should be " +sectionName(3) +" bug get" +BereichsName.GetText
865 BereicheBearbeiten.OK
869 Call wNavigatorAuswahl(7,1, true)
871 printlog " -- check if the section name in navigator is right "
873 if Auswahlliste.GetitemText(8+i) <> correctSequence(i) then QAErrorLog "The Section Name may be wrong, should be " + sectionName(i) +" but get " & Auswahlliste.GetitemText(i+2)
876 'Close Navigator before close the document
883 '----------------------------------------------------------
885 testcase tDisplaySection_6
887 Dim sectionContent() as String
890 '/// Jump to a section by double-clicking it in navigator
891 '/// +instead of 'double-click', we choose return
892 printlog " - Check Jump to a section by double-clicking it in navigator"
896 sectionContent = Array( _
897 "Test is in Section1", _
898 "Test is in Section2", _
901 '/// Input some test words
902 Call wTypeKeys sectionContent(0)
903 Call wTypeKeys "<return>"
904 Call wTypeKeys sectionContent(1)
906 Call wTypeKeys "<up><home><Shift End>"
907 fInsertSection("section1")
909 Call wTypeKeys "<down><home><Shift End>"
910 fInsertSection("section2")
913 Call wNavigatorAuswahl(7,1, true)
915 'Jump to a section by double-clicking it
916 printlog " -- check Jump to a section by double-clicking it "
918 Auswahlliste.TypeKeys "<return>"
920 Call wTypeKeys "<home><Shift End>"
922 if GetClipboardText <> sectionContent(j-1) then warnlog "The focus is NOT in the correct location"
923 Kontext "NavigatorWriter"
924 Auswahlliste.TypeKeys "<down>"
927 'Close Navigator before close the document
934 '----------------------------------------------------------
936 testcase tDisplaySection_7
940 '/// Activate Navigator, insert a section , it must be displayed
941 '/// + immediately in the Navigator .
942 printlog " - Check inserting a section must be displayed immediately in the Navigator "
946 'start up Navigator first
947 Call wNavigatorAuswahl(7,1)
949 fInsertSection("sectionNormal")
952 Call wNavigatorAuswahl(7,1)
954 Kontext "NavigatorWriter"
955 Auswahlliste.TypeKeys "<return>"
957 printlog " -- check if the section name in navigator is right "
958 if Auswahlliste.GetitemText(8) <> "sectionNormal" then warnlog "The section can't be displayed immediately in the Navigator. Found this: '" + Auswahlliste.GetitemText(8) + "' instead."
960 'Close Navigator before close the document
967 '----------------------------------------------------------
969 testcase tDisplaySection_8
973 '/// Select a section in the Navigator, call context menu, choose "Edit"
974 '///+ Format-Section dialogue must appear
975 printlog " - Check if the context menu should work in navigator / section "
979 fInsertSection("sectionNormal")
982 Call wNavigatorAuswahl(7,1, true)
984 Auswahlliste.OpenContextMenu
988 'Check if the edit section dialog is up
989 Kontext "BereicheBearbeiten"
990 if NOT BereicheBearbeiten.Exists then
991 warnlog "- Dialog to eidt section isn't up!"
993 BereicheBearbeiten.Cancel
996 'Close Navigator before close the document
1002 '----------------------------------------------------------
1004 testcase tDisplaySection_9
1007 Dim shouldbe as string
1009 '/// Check to insert a paragraph before and after a section"
1010 printlog " - Check to insert a paragraph before and after a section"
1011 '/// Open a new writerdocument ///
1013 '/// Write some text, selct it and insert a section named 'My Section' ///
1014 Call wTypeKeys "Add a paragraph before and after a section!<Shift Home>"
1015 fInsertSection("My Section")
1017 '/// Point cursor before text and press Alt+Return ///
1018 Call wTypeKeys "<Home>"
1019 Call wTypeKeys "<Mod2 Return>"
1020 '/// A paragraph should have been inserted before section ///
1021 Call wTypeKeys "Paragraph before a section"
1022 '/// Point cursor at end of text in section and press Alt + Return ///
1023 Call wTypeKeys "<Down><End>"
1024 Call wTypeKeys "<Mod2 Return>"
1025 '/// A paragraph should have been inserted after section ///
1026 Call wTypeKeys "Paragraph after a section"
1027 '/// Check settings ///
1028 Call wTypeKeys "<Home><Up>",4
1032 Call wTypeKeys "<Shift End>"
1034 if GetClipBoardtext <> "Paragraph before a section" then
1035 warnlog "Problem with paragraph before section"
1038 Call wTypeKeys "<Shift Down>"
1040 if gPlatGroup = "unx" then
1041 shouldbe = "Add a paragraph before and after a section!" + CHR$(10)
1043 shouldbe = "Add a paragraph before and after a section!" + CHR$(13) & CHR$(10)
1046 if GetClipBoardtext <> shouldbe then
1047 qaerrorlog "#i85766# - Copied text not correctly exported through the clipboard" ' "Problem with section"
1050 Call wTypeKeys "<Shift End>"
1052 if GetClipBoardtext <> "Paragraph after a section" then
1053 warnlog "Problem with paragraph after section"
1056 Call wTypeKeys "<Home><Down>"