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_formatpage3.inc,v $
13 '* last change: $Author: vg $ $Date: 2008-08-18 12:28:45 $
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 functionality of Page Formatting / Page Styles - 3
38 '************************************************************************
40 ' #1 tFormatPage_29 'check for same content on left/right pages in header
41 ' #1 tFormatPage_30 'check for different content on left/right pages in header
42 ' #1 tFormatPage_31 'check for same content on left/right pages in footer
43 ' #1 tFormatPage_32 'check for different content on left/right pages in footer
44 ' #1 tFormatPage_33 'cursor should jump to header when inserting a header via menu
45 ' #1 tFormatPage_34 'cursor shouldn't jump to header when inserting a header via checking 'Header on'
46 ' #1 tFormatPage_35 'cursor should jump to footer when inserting a footer via menu
47 ' #1 tFormatPage_36 'cursor shouldn't jump to footer when inserting a footer via checking 'Footer on'
48 ' #1 tFormatPage_37 'Header must be applied to the current page style when inserting via menu
49 ' #1 tFormatPage_38 'Footer must be applied to the current page style when inserting via menu
50 ' #1 tFormatPage_39 'Set multi column via controls in page dialog
51 ' #1 tFormatPage_40 'Set multi column via spinfield in page dialog
52 ' #1 tFormatPage_41 'create columns with different width
53 ' #1 tFormatPage_42 'vary distance between columns
54 ' #1 tFormatPage_43 'seperator line between columns - change height/position of seperator
55 ' #1 tFormatPage_44 'seperator line between columns - different line formats
56 ' #1 tFormatPage_45 'shouldn't exist spacing after remove separator line
57 ' #1 tFormatPage_46 'Check if the settings are kept after reopening the file
58 ' #1 tFormatPage_47 'Test Travel through the 5 columns preset boxes
60 '\***********************************************************************
62 testcase tFormatPage_29
64 Dim sTestFile as String , sNewContent as String
65 Dim sContentInHeaderInPage1 as String , sContentInHeaderInPage2 as String
67 sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\formatpage\testHeaderContent29.sxw")
68 sContentInHeaderInPage1 = "Header1"
69 sContentInHeaderInPage2 = "Header2"
70 sNewContent = "MyTest"
72 PrintLog "- check for same content on left/right pages in header"
73 '/// check for same content on left/right pages in header
77 '/// Open test file testHeaderContent29.sxw
78 '/// + (The test file include 2 pages , and the
79 '/// + content in header are different )
80 Call hFileOpen(sTestFile)
81 Call sMakeReadOnlyDocumentEditable
83 '/// formatPage , tabpage header , check 'same content left/right'
84 fFormatPageWriter("TabKopfzeile")
85 InhaltLinksRechtsGleich.Check
91 Kontext "FindAndReplace"
92 SearchFor.SetText sContentInHeaderInPage2
99 if Active.GetRT = 304 then Active.OK
101 warnlog "The content should be same after checking 'same content left/right' !"
104 Kontext "FindAndReplace"
107 '/// type some new content in the header in page1
110 Kontext "FindAndReplace"
111 SearchFor.SetText sContentInHeaderInPage1
117 Call wTypeKeys "<Right>"
118 Call wTypeKeys "<Backspace>" , 7
119 Call wTypeKeys sNewContent
122 '/// Check if the content in footer in page2 is changed
125 Kontext "FindAndReplace"
126 SearchFor.SetText sContentInHeaderInPage1
132 if Active.Exists then
133 if Active.GetRT = 304 then Active.OK
135 warnlog "The content should be same after changing content in header in 1st page!"
138 Kontext "FindAndReplace"
141 printlog " Close active document "
142 Do Until GetDocumentCount = 0
147 '-------------------------------------------------------------------------------------------
149 testcase tFormatPage_30
151 Dim sTestFile as String
152 Dim sContentInHeader as String , sNewContent as String
155 sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\formatpage\testHeaderContent30.sxw")
156 sContentInHeader = "Header"
157 sNewContent = "MyTest"
160 PrintLog "- check for different content on left/right pages in header"
161 '/// check for different content on left/right pages in header
165 '/// Open test file testHeaderContent30.sxw
166 '/// + (The test file include 2 pages , and the
167 '/// + content in header is same )
168 Call hFileOpen(sTestFile)
169 Call sMakeReadOnlyDocumentEditable
171 '/// formatPage , tabpage header , Uncheck 'same content left/right'
172 fFormatPageWriter("TabKopfzeile")
173 InhaltLinksRechtsGleich.UnCheck
176 '/// type some new content in the header in page1
179 Kontext "FindAndReplace"
180 SearchFor.SetText sContentInHeader
186 Call wTypeKeys "<Right>"
187 Call wTypeKeys "<Backspace>" , 6
188 Call wTypeKeys sNewContent
191 '/// Check if the content in footer in page2 is changed
194 Kontext "FindAndReplace"
195 SearchFor.SetText sContentInHeader
202 if Not Navigator.Exists then ViewNavigator
203 Kontext "NavigatorWriter"
205 if Seitennummer.GetText <> "1" then warnlog "Something wrong in Header in 1st page!"
208 printlog " Close active document "
209 Do Until GetDocumentCount = 0
214 '-------------------------------------------------------------------------------------------
217 testcase tFormatPage_31
219 Dim sTestFile as String , sNewContent as String
220 Dim sContentInFooterInPage1 as String , sContentInFooterInPage2 as String
222 sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\formatpage\testFooterContent31.sxw")
223 sContentInFooterInPage1 = "Footer1"
224 sContentInFooterInPage2 = "Footer2"
225 sNewContent = "MyTest"
227 PrintLog "- check for same content on left/right pages in footer"
228 '/// check for same content on left/right pages in footer
232 '/// Open test file testFooterContent31.sxw
233 '/// + (The test file include 2 pages , and the content
234 '/// + in footer are different )
235 Call hFileOpen(sTestFile)
236 Call sMakeReadOnlyDocumentEditable
238 '/// + formatPage , tabpage footer , check 'same content left/right'
239 fFormatPageWriter("TabFusszeile")
240 InhaltLinksRechtsGleich.Check
246 Kontext "FindAndReplace"
247 SearchFor.SetText sContentInFooterInPage2
253 if Active.Exists then
254 if Active.GetRT = 304 then Active.OK
256 warnlog "The content should be same after checking 'same content left/right' !"
259 Kontext "FindAndReplace"
262 '/// type some new content in the footer in page1
265 Kontext "FindAndReplace"
266 SearchFor.SetText sContentInFooterInPage1
272 Call wTypeKeys "<Right>"
273 Call wTypeKeys "<Backspace>" , 7
274 Call wTypeKeys sNewContent
277 '/// Check if the content in footer in page2 is changed
280 Kontext "FindAndReplace"
281 SearchFor.SetText sContentInFooterInPage1
287 if Active.Exists then
288 if Active.GetRT = 304 then Active.OK
290 warnlog "The content should be same after changing content in footer in 1st page!"
293 Kontext "FindAndReplace"
296 printlog " Close active document "
297 Do Until GetDocumentCount = 0
302 '-------------------------------------------------------------------------------------------
304 testcase tFormatPage_32
306 Dim sTestFile as String
307 Dim sContentInFooter as String , sNewContent as String
310 sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\formatpage\testFooterContent32.sxw")
311 sContentInFooter = "Footer"
312 sNewContent = "MyTest"
315 PrintLog "- check for different content on left/right pages in footer"
316 '/// check for different content on left/right pages in footer
320 '/// Open test file testFooterContent32.sxw
321 '/// + (The test file include 2 pages , and the
322 '/// + content in footer is same )
323 Call hFileOpen(sTestFile)
324 Call sMakeReadOnlyDocumentEditable
326 '/// formatPage , tabpage footer , Uncheck 'same content left/right'
327 fFormatPageWriter("TabFusszeile")
328 InhaltLinksRechtsGleich.UnCheck
331 '/// type some new content in the footer in page1
334 Kontext "FindAndReplace"
335 SearchFor.SetText sContentInFooter
341 Call wTypeKeys "<Right>"
342 Call wTypeKeys "<Backspace>" , 6
343 Call wTypeKeys sNewContent
346 '/// Check if the content in the footer in page2 is changed
349 Kontext "FindAndReplace"
350 SearchFor.SetText sContentInFooter
357 if Not Navigator.Exists then ViewNavigator
358 Kontext "NavigatorWriter"
360 if Seitennummer.GetText <> "1" then warnlog "Something wrong in Footer in 1st page!"
363 printlog " Close active document "
364 Do Until GetDocumentCount = 0
369 '-------------------------------------------------------------------------------------------
371 testcase tFormatPage_33
377 PrintLog "- cursor should jump to header when inserting a header via menu"
378 '/// cursor should jump to header when inserting a header via menu
382 '/// Input some test words
385 '/// Insert a header via menu
386 DocumentWriter.UseMenu
387 MenuSelect(Menugetitemid(4))
389 MenuSelect(Menugetitemid(9))
391 MenuSelect(Menugetitemid(1))
394 '/// type some test words -- it should be in the header
397 '/// check if the text in header is right
400 Kontext "FindAndReplace"
401 SearchFor.SetText sTest
411 if GetClipboardText <> sTest then warnlog "The content in the header isn't right, should be " &sTest & " but get " & GetClipboardText
413 '/// Remove the header
415 Kontext "DocumentWriter"
416 DocumentWriter.UseMenu
417 MenuSelect(Menugetitemid(4))
419 MenuSelect(Menugetitemid(9))
421 MenuSelect(Menugetitemid(1))
425 if Active.Exists then
426 if Active.GetRT = 304 then Active.Yes
428 warnlog "There should be a warning message appear when turn off header !"
432 '/// Check if the content in header is removed
435 Kontext "FindAndReplace"
436 SearchFor.SetText sTest
442 if Active.Exists then
443 if Active.GetRT = 304 then Active.OK
445 warnlog "The content in header should be removed!"
448 Kontext "FindAndReplace"
455 '-------------------------------------------------------------------------------------------
457 testcase tFormatPage_34
463 PrintLog "- cursor shouldn't jump to header when inserting a header via checking 'Header on'"
464 '/// cursor shouldn't jump to header when inserting a header via checking 'Header on'
470 '/// formatPage , tabpage header
471 fFormatPageWriter("TabKopfzeile")
473 '/// + turn on header (check Header on)
474 KopfzeileMitAbstand.Check
478 '/// type some test words -- it should be in the header
481 '/// check if the text in header is right
484 Kontext "FindAndReplace"
485 WholeWordsOnly.UnCheck
487 SearchFor.SetText sTest
497 if GetClipboardText <> "ABC"+sTest then warnlog "The content in the header isn't right, should be null"
503 '-------------------------------------------------------------------------------------------
505 testcase tFormatPage_35
511 PrintLog "- cursor should jump to footer when inserting a footer via menu"
512 '/// cursor should jump to footer when inserting a footer via menu
518 '/// Insert a footer via menu
519 DocumentWriter.UseMenu
520 MenuSelect(Menugetitemid(4))
522 MenuSelect(Menugetitemid(9))
524 MenuSelect(Menugetitemid(1))
527 '/// type some test words - it should be in the footer
530 '/// check if the text in footer is right
533 Kontext "FindAndReplace"
534 SearchFor.SetText sTest
544 if GetClipboardText <> sTest then warnlog "The content in the footer isn't right, should be " &sTest & " but get " & GetClipboardText
546 '/// Remove the footer
548 Kontext "DocumentWriter"
549 DocumentWriter.UseMenu
550 MenuSelect(Menugetitemid(4))
552 MenuSelect(Menugetitemid(9))
554 MenuSelect(Menugetitemid(1))
558 if Active.Exists then
559 if Active.GetRT = 304 then Active.Yes
561 warnlog "There should be a warning message appear when turn off footer !"
565 '/// Check if the content in footer is removed
568 Kontext "FindAndReplace"
569 SearchFor.SetText sTest
575 if Active.Exists then
576 if Active.GetRT = 304 then Active.OK
578 warnlog "The content in footer should be removed!"
581 Kontext "FindAndReplace"
588 '-------------------------------------------------------------------------------------------
590 testcase tFormatPage_36
596 PrintLog "- cursor shouldn't jump to footer when inserting a footer via checking 'Footer on'"
597 '/// cursor shouldn't jump to footer when inserting a footer via checking 'Footer on'
603 '/// formatPage , tabpage footer
604 fFormatPageWriter("TabKopfzeile")
606 '/// + turn on footer (check Footer on)
607 KopfzeileMitAbstand.Check
611 '/// type some test words - it should be in the footer
614 '/// check if the text in footer is right
617 Kontext "FindAndReplace"
618 WholeWordsOnly.UnCheck
620 SearchFor.SetText sTest
630 if GetClipboardText <> "ABC"+sTest then warnlog "The content in the footer isn't right, should be null"
636 '-------------------------------------------------------------------------------------------
638 testcase tFormatPage_37
640 Dim sHeader as String
643 case 01 : sHeader = "Header"
644 case 31 : sHeader = "Koptekst"
645 case 33 : sHeader = "En-tête"
646 case 34 : sHeader = "Encabezamiento"
647 case 39 : sHeader = "Riga d'intestazione"
648 case 46 : sHeader = "Sidhuvud"
649 case 49 : sHeader = "Kopfzeile"
650 case 55 : sHeader = "Cabeçalho"
651 case 81 : sHeader = "ヘッダ"
652 case 82 : sHeader = "머리글"
653 case 86 : sHeader = "页眉"
654 case 88 : sHeader = "頁首"
655 case else : QAErrorLog "The test does not support the language " + iSprache
659 PrintLog "- Header must be applied to the current page style when inserting via menu"
660 '/// Header must be applied to the current page style when inserting via menu
664 '/// Insert a header via menu
665 DocumentWriter.UseMenu
666 MenuSelect(Menugetitemid(4))
668 MenuSelect(Menugetitemid(9))
670 MenuSelect(Menugetitemid(1))
673 '/// Check if header can be seen in status bar
674 Kontext "TableObjectbar"
676 if Vorlage2.GetSelText <> sHeader then
677 warnlog "The header can't be seen in status bar ! "
684 '-------------------------------------------------------------------------------------------
686 testcase tFormatPage_38
688 Dim sFooter as String
691 case 01 : sFooter = "Footer"
692 case 31 : sFooter = "Voettekst"
693 case 33 : sFooter = "Pied de page"
694 case 34 : sFooter = "Pie de página"
695 case 39 : sFooter = "Piè di pagina"
696 case 46 : sFooter = "Sidfot"
697 case 49 : sFooter = "Fußzeile"
698 case 55 : sFooter = "Rodapé"
699 case 81 : sFooter = "フッタ"
700 case 82 : sFooter = "바닥글"
701 case 86 : sFooter = "页脚"
702 case 88 : sFooter = "頁尾"
703 case else : QAErrorLog "The test does not support the language " + iSprache
707 PrintLog "- Footer must be applied to the current page style when inserting via menu"
708 '/// Footer must be applied to the current page style when inserting via menu
712 '/// Insert a footer via menu
713 DocumentWriter.UseMenu
714 MenuSelect(Menugetitemid(4))
716 MenuSelect(Menugetitemid(10))
718 MenuSelect(Menugetitemid(1))
721 '/// Check if header can be seen in status bar
722 Kontext "TableObjectbar"
724 if Vorlage2.GetSelText <> sFooter then
725 warnlog "The footer can't be seen in status bar ! "
732 '-------------------------------------------------------------------------------------------
734 testcase tFormatPage_39
736 Dim sTestFile as String
737 Dim sColumn as String
739 sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\formatpage\testColumnInPage.sxw")
742 PrintLog "- Set multi column via controls in page dialog"
743 '/// Set multi column via controls in page dialog
747 '/// Open test file testColumnInPage.sxw
748 '/// + (The test file includes 2 pages , some text
749 '/// + is in 1st page and another is in 2nd page)
750 Call hFileOpen(sTestFile)
751 Call sMakeReadOnlyDocumentEditable
753 '/// formatPage , tabpage columns , change column to 3 via controls
754 fFormatPageWriter("TabSpalten")
755 Anzahl.TypeKeys "<Up>", 2
759 '/// Check if the text in 1st page in the 1st column
762 Kontext "FindAndReplace"
763 SearchFor.SetText "ABCD"
769 Call wTypeKeys "<Home>"
770 Call wTypeKeys "<Shift End>"
772 if Len(GetClipboardText) = 26 then warnlog "the first column isn't right!"
774 '/// Check if the text in 2nd page in the 2nd column
777 Kontext "FindAndReplace"
778 SearchFor.SetText "This"
785 if Not Navigator.Exists then ViewNavigator
786 Kontext "NavigatorWriter"
788 if Seitennummer.GetText <> "1" then warnlog "the second column isn't right!"
791 printlog " Close active document "
792 Do Until GetDocumentCount = 0
797 '-------------------------------------------------------------------------------------------
799 testcase tFormatPage_40
801 Dim sTestFile as String
802 Dim sColumn as String
804 sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\formatpage\testColumnInPage.sxw")
807 PrintLog "- Set multi column via spinfield in page dialog"
808 '/// Set multi column via spinfield in page dialog
812 '/// Open test file testColumnInPage.sxw
813 '/// + (The test file includes 2 pages , some text is
814 '/// + in 1st page and another is in 2nd page)
815 Call hFileOpen(sTestFile)
816 Call sMakeReadOnlyDocumentEditable
818 '/// formatPage , tabpage columns , change column to 3 via spinfield
819 fFormatPageWriter("TabSpalten")
820 ColumnValueset.TypeKeys "<Right>"
822 ColumnValueset.TypeKeys "<Right>"
824 ColumnValueset.TypeKeys "<Right>"
828 '/// Check if the text in 1st page in the 1st column
831 Kontext "FindAndReplace"
832 SearchFor.SetText "ABCD"
838 Call wTypeKeys "<Home>"
839 Call wTypeKeys "<Shift End>"
841 if Len(GetClipboardText) = 26 then warnlog "the first column isn't right!"
843 '/// Check if the text in 2nd page in the 2nd column
846 Kontext "FindAndReplace"
847 SearchFor.SetText "This"
854 if Not Navigator.Exists then ViewNavigator
855 Kontext "NavigatorWriter"
857 if Seitennummer.GetText <> "1" then warnlog "the second column isn't right!"
860 printlog " Close active document "
861 Do Until GetDocumentCount = 0
866 '-------------------------------------------------------------------------------------------
868 testcase tFormatPage_41
870 Dim sTestFile as String
871 Dim sColumn as String
872 Dim sWidthColumn1 as String
873 Dim sWidthColumn2 as String
874 Dim sWidthColumn3 as String
876 sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\formatpage\testColumnInPage2.sxw")
878 sWidthColumn1 = "2" + gSeperator + "00"
879 sWidthColumn2 = "4" + gSeperator + "00"
881 PrintLog "- create columns with different width "
882 '/// create columns with different width
886 '/// Open test file testColumnInPage2.sxw
887 '/// + (The test file includes 2 pages , some text is
888 '/// + in 1st page and another is in 2nd page)
889 Call hFileOpen(sTestFile)
890 Call sMakeReadOnlyDocumentEditable
892 '/// Create 3 with different columns . formatPage ,
893 '/// + tabpage columns , set 3 columns
894 Call fFormatPageWriter("TabSpalten")
895 Anzahl.TypeKeys "<Up>", 2
899 Spaltenbreite1.SetText sWidthColumn1
901 Spaltenbreite2.SetText sWidthColumn2
905 sWidthColumn3 = Spaltenbreite3.GetText
909 '/// Check if columns' width is right
910 fFormatPageWriter("TabSpalten")
911 if Left$(Spaltenbreite1.GetText,4) <> sWidthColumn1 then Warnlog "the column1's width isn't set correctly !"
912 if Left$(Spaltenbreite2.GetText,4) <> sWidthColumn2 then Warnlog "the column2's width isn't set correctly !"
913 if Spaltenbreite3.GetText <> sWidthColumn3 then Warnlog "the column3's width isn't set correctly !"
916 'detailed check for column1
919 Kontext "FindAndReplace"
920 SearchFor.SetText "ABCD"
926 Call wTypeKeys "<Home>"
927 Call wTypeKeys "<Shift End>"
929 if Len(GetClipboardText) > 8 then Warnlog "Something wrong in the column1"
931 'detailed check for column2
934 Kontext "FindAndReplace"
935 SearchFor.SetText "ZYXW"
941 Call wTypeKeys "<Home>"
942 Call wTypeKeys "<Shift End>"
944 if Len(GetClipboardText) > 14 then Warnlog "Something wrong in the column2"
946 printlog " Close active document "
947 Do Until GetDocumentCount = 0
952 '-------------------------------------------------------------------------------------------
954 testcase tFormatPage_42
956 Dim sTestFile as String
957 Dim sColumn as String
958 Dim sWidthColumn1 as String
959 Dim sWidthColumn2 as String
960 Dim sWidthColumn3 as String
961 Dim sSpacing1 as String
962 Dim sSpacing2 as String
964 sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\formatpage\testColumnInPage2.sxw")
967 sWidthColumn1 = "2" + gSeperator + "00" + gMeasurementUnit
968 sWidthColumn2 = "4" + gSeperator + "00" + gMeasurementUnit
969 sSpacing1 = "1" + gSeperator + "00" + gMeasurementUnit
970 sSpacing2 = "2" + gSeperator + "00" + gMeasurementUnit
972 PrintLog "- vary distance between columns "
973 '/// vary distance between columns
977 '/// Open test file testColumnInPage2.sxw
978 '/// + (The test file includes 2 pages , some text is
979 '/// + in 1st page and another is in 2nd page)
980 Call hFileOpen(sTestFile)
981 Call sMakeReadOnlyDocumentEditable
983 '/// formatPage , tabpage columns , set 3 columns
984 fFormatPageWriter("TabSpalten")
985 Anzahl.TypeKeys "<Up>", 2
989 '/// vary distance between columns
990 fFormatPageWriter("TabSpalten")
993 Spaltenbreite1.SetText sWidthColumn1
995 Spaltenbreite2.SetText sWidthColumn2
997 Abstand12.SetText sSpacing1
999 Abstand23.SetText sSpacing2
1003 sWidthColumn2 = "3" + gSeperator + "00" + gMeasurementUnit
1004 sWidthColumn3 = Spaltenbreite3.GetText
1008 '/// Check if columns' width and spacing are right
1009 fFormatPageWriter("TabSpalten")
1010 if Spaltenbreite1.GetText <> sWidthColumn1 then Warnlog "the column1's width isn't set correctly !"
1011 if Spaltenbreite2.GetText <> sWidthColumn2 then Warnlog "the column2's width isn't set correctly !"
1012 if Spaltenbreite3.GetText <> sWidthColumn3 then Warnlog "the column3's width isn't set correctly !"
1013 if Abstand12.GetText <> sSpacing1 then Warnlog "the spacing1 isn't correct!"
1014 if Abstand23.GetText <> sSpacing2 then Warnlog "the spacing1 isn't correct!"
1017 'detailed check for column2
1019 EditSearchAndReplace
1020 Kontext "FindAndReplace"
1021 SearchFor.SetText "ZYXW"
1025 FindAndReplace.Close
1027 Call wTypeKeys "<Home>"
1028 Call wTypeKeys "<Shift End>"
1030 if Len(GetClipboardText) > 11 then Warnlog "Somthing wrong in the column2"
1032 printlog " Close active document "
1033 Do Until GetDocumentCount = 0
1038 '-------------------------------------------------------------------------------------------
1040 testcase tFormatPage_43
1042 Dim sColumn as String
1043 Dim sHeight as String
1044 Dim iLine as Integer
1045 Dim iPosition as Integer
1052 PrintLog "- seperator line between columns - change height/position of seperator"
1053 '/// seperator line between columns - change height/position of seperator
1057 '/// formatPage , tabpage columns , set 2 columns
1058 fFormatPageWriter("TabSpalten")
1059 Anzahl.TypeKeys "<Up>"
1063 '/// + Change height/position of seperator
1064 fFormatPageWriter("TabSpalten")
1067 Hoehe.SetText sHeight
1069 Position.Select iPosition
1073 '/// Check if height/position of seperator is changed
1074 fFormatPageWriter("TabSpalten")
1075 if Hoehe.GetText <> sHeight then Warnlog "Height isn't correct!"
1077 if Position.GetSelIndex <> iPosition then Warnlog "Position isn't correct!"
1084 '-------------------------------------------------------------------------------------------
1086 testcase tFormatPage_44
1088 Dim sColumn as String
1093 PrintLog "- seperator line between columns - different line formats "
1094 '/// seperator line between columns - different line formats
1098 '/// formatPage , tabpage columns , set 2 columns
1099 fFormatPageWriter("TabSpalten")
1100 Anzahl.TypeKeys "<Up>"
1104 '/// + Change seperator line style
1106 '/// Check if height/position of seperator is changed
1108 fFormatPageWriter("TabSpalten")
1109 for i = 1 to Art.GetItemCount
1110 if i > 1 then fFormatPageWriter("TabSpalten")
1115 fFormatPageWriter("TabSpalten")
1116 if Art.GetSelIndex <> i then Warnlog "Seperator line isn't correct!"
1124 '-------------------------------------------------------------------------------------------
1126 testcase tFormatPage_45
1128 Dim sTestFile as String
1129 Dim sTestText as String
1130 Dim iTestTextLength as Integer
1132 sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\formatpage\testSeparatorLine.sxw")
1135 PrintLog "- shouldn't exist spacing after remove separator line"
1136 '/// shouldn't exist spacing after remove separator line
1140 '/// Open test file testSeparatorLine.sxw
1141 '/// + (The test file includes 6 columns , some
1142 '/// + test text lllll... is in 2nd column
1143 Call hFileOpen(sTestFile)
1144 Call sMakeReadOnlyDocumentEditable
1147 EditSearchAndReplace
1148 Kontext "FindAndReplace"
1149 SearchFor.SetText sTestText
1153 FindAndReplace.Close
1155 Call wTypeKeys "<Home>"
1156 Call wTypeKeys "<Shift End>"
1158 iTestTextLength = Len(GetClipboardText)
1160 '/// formatPage , tabpage columns, set Separator line to 5pt
1161 fFormatPageWriter("TabSpalten")
1162 Art.Select Art.GetItemCount
1167 EditSearchAndReplace
1168 Kontext "FindAndReplace"
1169 SearchFor.SetText sTestText
1173 FindAndReplace.Close
1175 Call wTypeKeys "<Home>"
1176 Call wTypeKeys "<Shift End>"
1178 if iTestTextLength <= Len(GetClipboardText) then Warnlog "Seperator line isn't correct!"
1180 '/// + set separator line to null
1181 fFormatPageWriter("TabSpalten")
1186 '/// Check if column is covered to former
1188 EditSearchAndReplace
1189 Kontext "FindAndReplace"
1190 SearchFor.SetText sTestText
1194 FindAndReplace.Close
1196 Call wTypeKeys "<Home>"
1197 Call wTypeKeys "<Shift End>"
1199 if iTestTextLength <> Len(GetClipboardText) then Warnlog "The column isn't covered to former! #112632"
1201 printlog " Close active document "
1202 Do Until GetDocumentCount = 0
1207 '-------------------------------------------------------------------------------------------
1209 testcase tFormatPage_46
1211 Dim sColumn as String
1212 Dim sWidthColumn1 as String
1213 Dim sWidthColumn2 as String
1214 Dim sWidthColumn3 as String
1215 Dim sSpacing1 as String
1216 Dim sSpacing2 as String
1217 Dim iLine as Integer
1218 Dim sLineHeight as String
1219 Dim iLinePosition as Integer
1222 sWidthColumn1 = "2" + gSeperator + "00" + gMeasurementUnit
1223 sWidthColumn2 = "4" + gSeperator + "00" + gMeasurementUnit
1224 sSpacing1 = "0" + gSeperator + "30" + gMeasurementUnit
1225 sSpacing2 = "0" + gSeperator + "50" + gMeasurementUnit
1230 PrintLog "- Check if the settings are kept after reopening the file"
1231 '/// Check if the settings are kept after reopening the file
1235 '/// Format/Page / columns , do some configurations
1238 fFormatPageWriter("TabSpalten")
1239 Anzahl.TypeKeys "<Up>", 2
1243 'UnCheck autowidth , set different width to 3 columns
1244 fFormatPageWriter("TabSpalten")
1247 Abstand12.SetText sSpacing1
1249 Abstand23.SetText sSpacing2
1251 Spaltenbreite1.SetText sWidthColumn1
1253 Spaltenbreite2.SetText sWidthColumn2
1257 Hoehe.SetText sLineHeight
1259 Position.Select iLinePosition
1261 sWidthColumn3 = Spaltenbreite3.GetText
1265 '/// Save the file , close the file and reopen it
1266 Call hFileSaveAsWithFilterKill(gOfficepath + "user\work\tFormatPage_46.odt", "writer8")
1270 Call hFileOpen(gOfficepath + "user\work\tFormatPage_46.odt")
1272 '/// Check if the setting are still kept
1273 fFormatPageWriter("TabSpalten")
1274 if AutomBreite.Ischecked = TRUE then Warnlog "Autowidth shouldn't be checked !"
1275 if Abstand12.GetText <> sSpacing1 then Warnlog "Spacing1 isn't right , should be " &sSpacing1 & " but get " &Abstand12.GetText
1276 if Abstand23.GetText <> sSpacing2 then Warnlog "Spacing2 isn't right , should be " &sSpacing2 & " but get " &Abstand23.GetText
1277 if Spaltenbreite1.GetText <> sWidthColumn1 then Warnlog "column1 isn't right , should be " &sWidthColumn1 & " but get " &Spaltenbreite1.GetText
1278 if Spaltenbreite2.GetText <> sWidthColumn2 then Warnlog "column1 isn't right , should be " &sWidthColumn2 & " but get " &Spaltenbreite2.GetText
1279 if Spaltenbreite3.GetText <> sWidthColumn3 then Warnlog "column1 isn't right , should be " &sWidthColumn2 & " but get " &Spaltenbreite3.GetText
1280 if Art.GetSelIndex <> iLine then Warnlog "Line style isn't right !"
1281 if Hoehe.GetText <> sLineHeight then Warnlog "Height isn't correct!"
1282 if Position.GetSelIndex <> iLinePosition then Warnlog "Position isn't correct!"
1289 '-------------------------------------------------------------------------------------------
1291 testcase tFormatPage_47
1293 Dim sWidth as String
1294 Dim sLeft as String , sRight as String ' set margin size
1295 Dim sWidth1 as String , sWidth2 as String , sWidth3 as String
1297 sWidth = "20" + gSeperator + "00" + gMeasurementUnit
1298 sLeft = "2" + gSeperator + "00" + gMeasurementUnit
1299 sRight = "3" + gSeperator + "00" + gMeasurementUnit
1301 PrintLog "- Test Travel through the 5 columns preset boxes "
1302 '/// Test Travel through the 5 columns preset boxes
1306 'Set page's width to 20cm and left margin: 3cm , right margin : 2cm
1307 fFormatPageWriter("TabSeite")
1308 Breite.SetText sWidth
1312 Rechts.SetText sRight
1316 '/// formatPage , tabpage columns
1317 fFormatPageWriter("TabSpalten")
1319 '/// - Select fisrt box ==> only 1 column
1320 ColumnValueset.TypeKeys "<Right>"
1322 if Len(Spaltenbreite1.GetText) <> 0 then Warnlog "width1 shouldn't be writable when there is only 1 column !"
1325 '/// - Select second box ==> 2 columns ( 1st = 2rd )
1326 ColumnValueset.TypeKeys "<Right>"
1328 sWidth1 = "7" + gSeperator + "50" + gMeasurementUnit
1329 sWidth2 = "7" + gSeperator + "50" + gMeasurementUnit
1330 if Spaltenbreite1.GetText <> sWidth1 then Warnlog "2.width1 should be " &sWidth1 & " but get " &Spaltenbreite1.GetText
1331 if Spaltenbreite2.GetText <> sWidth2 then Warnlog "2.width2 should be " &sWidth2 & " but get " &Spaltenbreite2.GetText
1332 if AutomBreite.IsChecked <> TRUE then Warnlog "2.Autowidth should be checked !"
1334 '/// - Select third box ==> 3 columns ( 1st = 2rd = third )
1335 ColumnValueset.TypeKeys "<Right>"
1337 sWidth1 = "5" + gSeperator + "00" + gMeasurementUnit
1338 sWidth2 = "5" + gSeperator + "00" + gMeasurementUnit
1339 sWidth3 = "5" + gSeperator + "00" + gMeasurementUnit
1340 if Spaltenbreite1.GetText <> sWidth1 then Warnlog "3.width1 should be " &sWidth1 & " but get " &Spaltenbreite1.GetText
1341 if Spaltenbreite2.GetText <> sWidth2 then Warnlog "3.width2 should be " &sWidth2 & " but get " &Spaltenbreite2.GetText
1342 if Spaltenbreite3.GetText <> sWidth3 then Warnlog "3.width3 should be " &sWidth2 & " but get " &Spaltenbreite3.GetText
1343 if AutomBreite.IsChecked <> TRUE then Warnlog "3.Autowidth should be checked !"
1345 '/// - Select forth box ==> 2 columns ( 1st : 2rd = 2:1 )
1346 ColumnValueset.TypeKeys "<Right>"
1348 sWidth1 = "10" + gSeperator + "00" + gMeasurementUnit
1349 sWidth2 = "5" + gSeperator + "00" + gMeasurementUnit
1350 if Spaltenbreite1.GetText <> sWidth1 then Warnlog "4.width1 should be " &sWidth1 & " but get " &Spaltenbreite1.GetText
1351 if Spaltenbreite2.GetText <> sWidth2 then Warnlog "4.width2 should be " &sWidth2 & " but get " &Spaltenbreite2.GetText
1352 if AutomBreite.IsChecked = TRUE then Warnlog "4.Autowidth should be Unchecked !"
1354 '/// - Select fifth box ==> 2 columns ( 1st : 2rd = 1:2 )
1355 ColumnValueset.TypeKeys "<Right>"
1357 sWidth1 = "5" + gSeperator + "00" + gMeasurementUnit
1358 sWidth2 = "10" + gSeperator + "00" + gMeasurementUnit
1359 if Spaltenbreite1.GetText <> sWidth1 then Warnlog "5.width1 should be " &sWidth1 & " but get " &Spaltenbreite1.GetText
1360 if Spaltenbreite2.GetText <> sWidth2 then Warnlog "5.width2 should be " &sWidth2 & " but get " &Spaltenbreite2.GetText
1361 if AutomBreite.IsChecked = TRUE then Warnlog "5.Autowidth should be Unchecked !"
1363 '/// - Press right key again, will get the first box
1364 ColumnValueset.TypeKeys "<Right>"
1366 if Anzahl.GetText <> "1" then Warnlog "The focus should be in the leftest box !"
1375 '-------------------------------------------------------------------------------------------