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_formatparagraph1.inc,v $
13 '* last change: $Author: vg $ $Date: 2008-08-18 12:29:14 $
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 Paragraph Formatting - 1
38 '************************************************************************
40 ' #1 tFormatParagraph1 'Open format/paragraph dialog
41 ' #1 tParagraphIndent1 'Set values for Indent - Before text
42 ' #1 tParagraphIndent2 'Set values for Indent - after text
43 ' #1 tParagraphIndent3 'Set values for Indent - first line
44 ' #1 tParagraphIndent4 'Test checkbox - "automatic"
45 ' #1 tParagraphIndent5 'Set values for "Above paraghraph"
46 ' #1 tParagraphIndent6 'Set values for "Below paraghraph"
47 ' #1 tParagraphIndent7 'Test above and below spacing of successive paragraphs are not added up, the biggest one should be displayed
48 ' #1 tParagraphIndent8 'Test above and below spacing of successive paragraphs are added up
49 ' #1 tParagraphIndent9 'Test Line spacing - Single
50 ' #1 tParagraphIndent10 'Test Line spacing - 1.5 lines
51 ' #1 tParagraphIndent11 'Test Line spacing - Double lines
52 ' #1 tParagraphIndent12 'Test Line spacing - Proportional
53 ' #1 tParagraphIndent13 'Test Line spacing - At least
54 ' #1 tParagraphIndent14 'Test Line spacing - Leading
55 ' #1 tParagraphIndent15 'Test Line spacing - Fixed
56 ' #1 tParagraphIndent16 'Test Regester-true Active
57 ' #1 tParagraphIndent17 'Test "Add spacing between paragarph and talbes" when importing from MS-Word
58 ' #1 tParagraphIndent18 'Test Negativ indent
60 '\***********************************************************************
62 testcase tformatparagraph1
64 PrintLog "- 'Open format/paragraph dialog"
65 '/// <b>Open format/paragraph dialog</b>
69 '/// via Mouse clicks in Menu: Format-paragraph
71 Call fFormatParagraph("TabTextfluss")
76 '/// via shortcuts in menu (manual test is needed)
78 '/// via Context menu when Cursor is in the document
83 Active.SetPage TabTextfluss
84 Kontext "TabTextfluss"
93 '-------------------------------------------------------------------------------------------
95 testcase tParagraphIndent1
98 Dim iLenTest as Integer
99 Dim iLenHalf as Integer
100 Dim sPageWidth as String
101 Dim sMarginLeft as String
102 Dim sMarginRight as String
103 Dim sIndentLeft as String
105 sTest = "lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll"
106 sPageWidth = "8" + gSeperator + "00" + gMeasurementUnit
107 sMarginLeft = "2" + gSeperator + "00" + gMeasurementUnit
108 sMarginRight = "2" + gSeperator + "00" + gMeasurementUnit
109 sIndentLeft = "2" + gSeperator + "00" + gMeasurementUnit
111 PrintLog "- Set values for Indent - Before text"
112 '/// <b>Set values for Indent - Before text</b>
116 'Format/Page , tabpage Page , set page size and margin size
117 Call fFormatPageWriter("TabSeite")
118 Breite.SetText sPageWidth
119 Links.SetText sMarginLeft
120 Rechts.SetText sMarginRight
123 '/// Input some test words which should be longer than one line
125 Call wTypeKeys "<MOD1 Home>"
126 Call wTypeKeys "<Shift End>"
128 iLenTest = Len(getclipboardtext)
130 '/// Format/Paragraph / Indents & Spacing , set 2cm in "before Text"
131 Call fFormatParagraph("TabEinzuegeUndAbstaende")
132 Vonlinks.SetText sIndentLeft
133 TabEinzuegeUndAbstaende.OK
135 Call wTypeKeys "<MOD1 Home>"
136 Call wTypeKeys "<Shift End>"
138 iLenHalf = Len(getclipboardtext)
140 if iLenHalf <> Int(iLenTest/2) AND iLenHalf <> Int(iLenTest/2 +1) AND iLenHalf <> Int(iLenTest/2 -1) then
141 Warnlog "1.Indents - before Text is not right !"
144 Call wTypeKeys "<Right><Home>"
145 Call wTypeKeys "<Shift End>"
147 iLenHalf = Len(getclipboardtext)
149 if iLenHalf <> Int(iLenTest/2) AND iLenHalf <> Int(iLenTest/2 +1) AND iLenHalf <> Int(iLenTest/2 -1) then
150 Warnlog "2.Indents - before Text is not right !"
157 '-------------------------------------------------------------------------------------------
159 testcase tParagraphIndent2
162 Dim iLenTest as Integer
163 Dim iLenHalf as Integer
164 Dim sPageWidth as String
165 Dim sMarginLeft as String
166 Dim sMarginRight as String
167 Dim sIndentRight as String
169 sTest = "lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll"
170 sPageWidth = "8" + gSeperator + "00" + gMeasurementUnit
171 sMarginLeft = "2" + gSeperator + "00" + gMeasurementUnit
172 sMarginRight = "2" + gSeperator + "00" + gMeasurementUnit
173 sIndentRight = "2" + gSeperator + "00" + gMeasurementUnit
175 PrintLog "- Set values for Indent - after text"
176 '/// <b>Set values for Indent - after text</b>
180 'Format/Page , tabpage Page , set page size and margin size
181 Call fFormatPageWriter("TabSeite")
182 Breite.SetText sPageWidth
183 Links.SetText sMarginLeft
184 Rechts.SetText sMarginRight
187 '/// Input some test words which should be longer than one line
189 Call wTypeKeys "<MOD1 Home>"
190 Call wTypeKeys "<Shift End>"
192 iLenTest = Len(getclipboardtext)
194 '/// Format/Paragraph / Indents & Spacing , set 2cm in "after Text"
195 Call fFormatParagraph("TabEinzuegeUndAbstaende")
196 VonRechts.SetText sIndentRight
197 TabEinzuegeUndAbstaende.OK
199 Call wTypeKeys "<MOD1 Home>"
200 Call wTypeKeys "<Shift End>"
202 iLenHalf = Len(getclipboardtext)
204 if iLenHalf <> Int(iLenTest/2) AND iLenHalf <> Int(iLenTest/2 +1) AND iLenHalf <> Int(iLenTest/2 -1) then
205 Warnlog "1.Indents - after Text is not right !"
208 Call wTypeKeys "<Right><Home>"
209 Call wTypeKeys "<Shift End>"
211 iLenHalf = Len(getclipboardtext)
213 if iLenHalf <> Int(iLenTest/2) AND iLenHalf <> Int(iLenTest/2 +1) AND iLenHalf <> Int(iLenTest/2 -1) then
214 Warnlog "2.Indents - after Text is not right !"
221 '-------------------------------------------------------------------------------------------
223 testcase tParagraphIndent3
226 Dim iLenTest as Integer
227 Dim iLenNew as Integer
228 Dim sPageWidth as String
229 Dim sMarginLeft as String
230 Dim sMarginRight as String
231 Dim sIndentRight as String
232 Dim sIndentFirst as String
234 sTest = "lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll"
235 sPageWidth = "8" + gSeperator + "00" + gMeasurementUnit
236 sMarginLeft = "2" + gSeperator + "00" + gMeasurementUnit
237 sMarginRight = "2" + gSeperator + "00" + gMeasurementUnit
238 sIndentFirst = "2" + gSeperator + "00" + gMeasurementUnit
240 PrintLog "- Set values for Indent - First line"
241 '/// <b>Set values for Indent - First line</b>
245 'Format/Page , tabpage Page , set page size and margin size
246 Call fFormatPageWriter("TabSeite")
247 Breite.SetText sPageWidth
248 Links.SetText sMarginLeft
249 Rechts.SetText sMarginRight
252 '/// Input some test words which should be longer than one line
254 Call wTypeKeys "<MOD1 Home>"
255 Call wTypeKeys "<Shift End>"
257 iLenTest = Len(getclipboardtext)
259 '/// Format/Paragraph / Indents & Spacing , set 2cm in "first line"
260 Call fFormatParagraph("TabEinzuegeUndAbstaende")
261 ErsteZeile.SetText sIndentFirst
262 TabEinzuegeUndAbstaende.OK
264 Call wTypeKeys "<MOD1 Home>"
265 Call wTypeKeys "<Shift End>"
267 iLenNew = Len(getclipboardtext)
269 if iLenNew <> Int(iLenTest/2) AND iLenNew <> Int(iLenTest/2 +1) AND iLenNew <> Int(iLenTest/2 -1) then
270 Warnlog "1.Indents - First line is not right !"
273 Call wTypeKeys "<Right><Home>"
274 Call wTypeKeys "<Shift End>"
276 iLenNew = Len(getclipboardtext)
278 if iLenNew <> iLenTest then
279 Warnlog "2.Indents - first line is not right !"
286 '-------------------------------------------------------------------------------------------
288 testcase tParagraphIndent4
291 Dim iLenTest as Integer
292 Dim iLenNew as Integer
293 Dim sPageWidth as String
294 Dim sMarginLeft as String
295 Dim sMarginRight as String
296 Dim sIndentRight as String
297 Dim sIndentFirst as String
299 sTest = "lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll"
300 sPageWidth = "8" + gSeperator + "00" + gMeasurementUnit
301 sMarginLeft = "2" + gSeperator + "00" + gMeasurementUnit
302 sMarginRight = "2" + gSeperator + "00" + gMeasurementUnit
303 sIndentFirst = "2" + gSeperator + "00" + gMeasurementUnit
305 PrintLog "- Test checkbox - 'automatic'"
306 '/// <b>Test checkbox - "automatic"</b>
310 'Format/Page , tabpage Page , set page size and margin size
311 Call fFormatPageWriter("TabSeite")
312 Breite.SetText sPageWidth
313 Links.SetText sMarginLeft
314 Rechts.SetText sMarginRight
317 '/// Input some test words which should be longer than one line
319 Call wTypeKeys "<MOD1 Home>"
320 Call wTypeKeys "<Shift End>"
322 iLenTest = Len(getclipboardtext)
324 '/// Format/Paragraph / Indents & Spacing , Check "automatic"
325 Call fFormatParagraph("TabEinzuegeUndAbstaende")
328 if ErsteZeile.IsEnabled = TRUE then Warnlog "The first line shouldn't be enabled when checking automatic !"
329 TabEinzuegeUndAbstaende.OK
331 Call wTypeKeys "<MOD1 Home>"
332 Call wTypeKeys "<Shift End>"
334 iLenNew = Len(getclipboardtext)
336 'the first line should be shorter than before and longer then 1/2 previous length
337 if iLenNew >= iLenTest OR iLenNew < Int(iLenTest/2 -1) then
338 Warnlog "The 1st line length isn't right after checking 'automatic'!"
341 Call wTypeKeys "<Right><Home>"
342 Call wTypeKeys "<Shift End>"
344 iLenNew = Len(getclipboardtext)
346 'the 2nd line should be equal the previous length
347 if iLenNew <> iLenTest then
348 Warnlog "The 2nd line length isn't right after checking 'automatic'!"
355 '-------------------------------------------------------------------------------------------
357 testcase tParagraphIndent5
359 Dim sTestFile as String
361 Dim sTest2 as String 'the words in 2nd paragraph (sTest1 is head , sTest2 is end)
362 Dim sSpacing as String
364 sTest1 = "He2" : sTest2 = "endof2ndparagraph"
365 sSpacing = "10" + gSeperator + "00" + gMeasurementUnit
366 sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\formatparagraph\indent.sxw")
368 PrintLog "- Set values for 'Above paraghraph'"
369 '/// <b>Set values for "Above paraghraph"</b>
373 '/// Open the test file
374 '/// This file includes 2 paragraphs , and the end of 2nd paragraph is in 1st page
375 Call hFileOpen(sTestFile)
376 Call sMakeReadOnlyDocumentEditable
378 'Set the focus to 2nd paragraph
381 Kontext "FindAndReplace"
382 SearchFor.SetText sTest1
388 '/// Format/Paragraph / Indents & Spacing , set 10cm for "Above paraghraph"
389 Call fFormatParagraph("TabEinzuegeUndAbstaende")
390 Oben.SetText sSpacing
391 TabEinzuegeUndAbstaende.OK
393 'Set the focus to the end of the 2nd paragraph
396 Kontext "FindAndReplace"
397 SearchFor.SetText sTest2
403 '/// check if the 2nd paragraph is in 2nd page
405 if Not Navigator.Exists then ViewNavigator
406 Kontext "NavigatorWriter"
408 if Seitennummer.GetText <> "2" then warnlog "Something wrong in 'Above paraghraph'! The end of 2nd paragraph should be 2nd page !"
415 '-------------------------------------------------------------------------------------------
417 testcase tParagraphIndent6
419 Dim sTestFile as String
421 Dim sTest2 as String '(sTest1 is head of paragraph 1 , sTest2 is end of paragraph2)
422 Dim sSpacing as String
424 sTest1 = "He1" : sTest2 = "endof2ndparagraph"
425 sSpacing = "10" + gSeperator + "00" + gMeasurementUnit
426 sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\formatparagraph\indent.sxw")
428 PrintLog "- Set values for 'Below paraghraph'"
429 '/// <b>Set values for "Below paraghraph"</b>
433 '/// Open the test file
434 '/// This file includes 2 paragraphs , and the end of 2nd paragraph is in 1st page
435 Call hFileOpen(sTestFile)
436 Call sMakeReadOnlyDocumentEditable
438 'Set the focus to 1st paragraph
441 Kontext "FindAndReplace"
442 SearchFor.SetText sTest1
448 '/// Format/Paragraph / Indents & Spacing , set 10cm for "Below paraghraph"
449 Call fFormatParagraph("TabEinzuegeUndAbstaende")
450 Unten.SetText sSpacing
451 TabEinzuegeUndAbstaende.OK
453 'Set the focus to the end of the 2nd paragraph
456 Kontext "FindAndReplace"
457 SearchFor.SetText sTest2
463 '/// check if the 2nd paragraph is in 2nd page
465 if Not Navigator.Exists then ViewNavigator
466 Kontext "NavigatorWriter"
468 if Seitennummer.GetText <> "2" then warnlog "Something wrong in 'Above paraghraph'! The end of 2nd paragraph should be 2nd page !"
475 '-------------------------------------------------------------------------------------------
477 testcase tParagraphIndent7
479 Dim sTestFile as String
480 Dim sEndOfPara1 as String
481 Dim sStartPara2 as String
482 Dim sEndPara2 as String
483 Dim sParagraph2 as String
485 sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\formatparagraph\spacing.sxw")
486 sEndOfPara1 = "endpara1"
487 sStartPara2 = "StartPara2" : sEndPara2 = "endofpara2"
488 sParagraph2 = "StartPara2mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmendofpara2"
490 PrintLog "- Test above and below spacing of successive paragraphs are not added up, the biggest one should be displayed"
491 '/// <b>Test above and below spacing of successive paragraphs are not added up, the biggest one should be displayed"</b>
495 '/// Open the test file
496 '/// This file includes 1 paragraph which is design like
497 '/// spacing above : 1cm , spacing below : 2cm
498 '/// the checkbox ��Add spacing between paragraphs and tables�� in
499 '/// Tools -> Options... -> Text Document -> Compatibility is checked
500 '/// if the spacing is adopted 1cm ,2nd paragrahp will be in 1st page
501 '/// if the spacing is adopted 2cm ,2nd paragrahp part will be in 1st page , part will be in 2nd page
502 '/// if the spacing is adopted 3cm ,2nd paragrahp will be in 2nd page
503 Call hFileOpen(sTestFile)
504 Call sMakeReadOnlyDocumentEditable
506 'Set the focus to the end of the 1st paragraph
509 Kontext "FindAndReplace"
510 SearchFor.SetText sEndOfPara1
516 Call wTypeKeys "<End>"
519 Call wTypeKeys "<Return>"
522 '/// insert 2nd paragraph
523 Call wTypeKeys sParagraph2
526 '/// check if the head of paragraph2 is in 1st page and
527 '/// + the end of paragraph2 is in 2nd page
530 Kontext "FindAndReplace"
531 SearchFor.SetText sStartPara2
538 if Not Navigator.Exists then ViewNavigator
539 Kontext "NavigatorWriter"
541 if Seitennummer.GetText <> "1" then warnlog "The start of paragraph2 should be in 1st page !"
546 Kontext "FindAndReplace"
547 SearchFor.SetText sEndPara2
554 if Not Navigator.Exists then ViewNavigator
555 Kontext "NavigatorWriter"
557 if Seitennummer.GetText <> "2" then warnlog "The end of paragraph2 should be in 2nd page !"
564 '-------------------------------------------------------------------------------------------
566 testcase tParagraphIndent8
568 Dim sTestFile as String
569 Dim sEndOfPara1 as String
570 Dim sStartPara2 as String
571 Dim sParagraph2 as String
573 sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\formatparagraph\spacing1.sxw")
574 sEndOfPara1 = "endpara1"
575 sStartPara2 = "StartPara2"
576 sParagraph2 = "StartPara2mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmendofpara2"
578 PrintLog "- Test above and below spacing of successive paragraphs are added up"
579 '/// <b>Test above and below spacing of successive paragraphs are added up</b>
583 '/// Open the test file
584 '/// This file includes 1 paragraph which is design like
585 '/// spacing above : 1cm , spacing below : 2cm
586 '/// the checkbox "Add spacing between paragraphs and tables" in
587 '/// Tools -> Options... -> Text Document -> Compatibility is Unchecked
588 '/// if the spacing is adopted 1cm ,2nd paragrahp will be in 1st page
589 '/// if the spacing is adopted 2cm ,2nd paragrahp part will be in 1st page , part will be in 2nd page
590 '/// if the spacing is adopted 3cm ,2nd paragrahp will be in 2nd page
591 Call hFileOpen(sTestFile)
592 Call sMakeReadOnlyDocumentEditable
594 'Set the focus to the end of the 1st paragraph
597 Kontext "FindAndReplace"
598 SearchFor.SetText sEndOfPara1
604 Call wTypeKeys "<End>"
607 Call wTypeKeys "<Return>"
610 '/// insert 2nd paragraph
611 Call wTypeKeys sParagraph2
614 '/// check if the paragraph2 is in 2nd page
617 Kontext "FindAndReplace"
618 SearchFor.SetText sStartPara2
625 if Not Navigator.Exists then ViewNavigator
626 Kontext "NavigatorWriter"
628 if Seitennummer.GetText <> "2" then warnlog "The start of paragraph2 should be in 2nd page !"
635 '-------------------------------------------------------------------------------------------
637 testcase tParagraphIndent9
639 Dim sTestFile as String
641 sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\formatparagraph\eightline.sxw")
643 PrintLog "- Test Line spacing - Single"
644 '/// <b>Test Line spacing - Single</b>
648 '/// Open the test file
649 '/// This file includes 8 lines ,
650 '/// + when the spacing is single line , the 8 lines should be in 1 page as design.
651 Call hFileOpen(sTestFile)
652 Call sMakeReadOnlyDocumentEditable
654 '/// Format/Paragraph / Indents & Spacing , select single line in Line spacing
655 Call fFormatParagraph("TabEinzuegeUndAbstaende")
656 Zeilenabstand.Select 1
657 TabEinzuegeUndAbstaende.OK
659 'Set the focus to the end of the paragraph
660 Call wTypeKeys "<MOD1 End>"
663 '/// check if the last line is in 1 page (it should be)
665 if Not Navigator.Exists then ViewNavigator
666 Kontext "NavigatorWriter"
668 if Seitennummer.GetText <> "1" then warnlog "The end of paragraph should be in 1st page !"
675 '-------------------------------------------------------------------------------------------
677 testcase tParagraphIndent10
679 Dim sTestFile as String
681 sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\formatparagraph\eightline.sxw")
683 PrintLog "- Test Line spacing - 1.5 lines"
684 '/// <b>Test Line spacing - 1.5 lines</b> ///
688 '/// Open the test file
689 '/// This file includes 8 lines
690 '/// when the spacing is 1.5 lines ,
691 '/// + the last 2(or 3) lines should be in 2nd page.
692 Call hFileOpen(sTestFile)
693 Call sMakeReadOnlyDocumentEditable
695 '/// Format/Paragraph / Indents & Spacing , select 1.5 lines in Line spacing
696 Call fFormatParagraph("TabEinzuegeUndAbstaende")
697 Zeilenabstand.Select 2
699 TabEinzuegeUndAbstaende.OK
701 'Set the focus to the end of the paragraph
702 Call wTypeKeys "<MOD1 End>"
705 Call wTypeKeys "<Home>"
708 '/// check if the last 2 lines(7th and 8th) is in 2nd page (it should be)
710 if Not Navigator.Exists then ViewNavigator
711 Kontext "NavigatorWriter"
713 if Seitennummer.GetText <> "2" then warnlog "The 8th line should be in 2nd page !"
716 Call wTypeKeys "<Up>"
718 Call wTypeKeys "<Home>"
722 if Not Navigator.Exists then ViewNavigator
723 Kontext "NavigatorWriter"
725 if Seitennummer.GetText <> "2" then warnlog "The 7th line should be in 2nd page !"
728 Call wTypeKeys "<Up>" , 2
730 Call wTypeKeys "<Home>"
733 '/// check if the 5th lines is in 1st page (it should be)
735 if Not Navigator.Exists then ViewNavigator
736 Kontext "NavigatorWriter"
738 if Seitennummer.GetText <> "1" then warnlog "The 5th line should be in 1st page !"
745 '-------------------------------------------------------------------------------------------
747 testcase tParagraphIndent11
749 Dim sTestFile as String
751 sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\formatparagraph\eightline.sxw")
753 PrintLog "- Test Line spacing - Double lines"
754 '/// <b>Test Line spacing - Double lines</b>
757 Call wOptionsUndo ( "Grundschriften" )
758 '/// Open the test file
759 '/// This file includes 8 lines
760 '/// when the spacing is Double lines , the first 4 lines should be in 1st page
761 '/// + the last 4 lines should be in 2nd page.
762 Call hFileOpen(sTestFile)
763 Call sMakeReadOnlyDocumentEditable
765 '/// Format/Paragraph / Indents & Spacing , select Double lines in Line spacing
766 Call fFormatParagraph("TabEinzuegeUndAbstaende")
767 Zeilenabstand.Select 3
768 TabEinzuegeUndAbstaende.OK
770 'Set the focus to the end of the paragraph
771 Call wTypeKeys "<MOD1 End>"
774 Call wTypeKeys "<Home>"
777 '/// check if the last 4 lines is in 2nd page (it should be)
779 if Not Navigator.Exists then ViewNavigator
780 Kontext "NavigatorWriter"
782 if Seitennummer.GetText <> "2" then warnlog "The 8th line should be in 2nd page !"
785 Call wTypeKeys "<Up>" , 3
789 if Not Navigator.Exists then ViewNavigator
790 Kontext "NavigatorWriter"
792 if Seitennummer.GetText <> "2" then warnlog "The 5th line should be in 2nd page !"
795 Call wTypeKeys "<Up>"
798 '/// check if the first 4 lines is in 1st page (it should be)
800 if Not Navigator.Exists then ViewNavigator
801 Kontext "NavigatorWriter"
803 if Seitennummer.GetText <> "1" then warnlog "The 4th line should be in 1st page !"
806 'Set the focus to the end of the paragraph
807 Call wTypeKeys "<MOD1 End>"
812 if Not Navigator.Exists then ViewNavigator
813 Kontext "NavigatorWriter"
815 if Seitennummer.GetText <> "3" then warnlog "The 9th line should be in 3rd page !"
822 '-------------------------------------------------------------------------------------------
824 testcase tParagraphIndent12
826 Dim sTestFile as String
827 Dim sProportional as String
829 sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\formatparagraph\eightline.sxw")
830 sProportional = "130%"
832 PrintLog "- Test Line spacing - Proportional"
833 '/// <b>Test Line spacing - Proportional</b>
837 '/// 1.Test the max of Proportional is 200%
838 '/// Open the test file
839 '/// This file includes 8 lines
840 '/// when the spacing Proportional is more than 200% ,
841 '/// + then it will change to be Double line automatically
842 Call hFileOpen(sTestFile)
843 Call sMakeReadOnlyDocumentEditable
845 '/// Format/Paragraph / Indents & Spacing ,
846 '/// + select Proportional in Line spacing , and input 300%
847 Call fFormatParagraph("TabEinzuegeUndAbstaende")
848 Zeilenabstand.Select 4
851 TabEinzuegeUndAbstaende.OK
853 Call fFormatParagraph("TabEinzuegeUndAbstaende")
854 if Zeilenabstand.GetSelIndex <> 3 then warnlog "should get double line, but get " & Zeilenabstand.GetSelText(Zeilenabstand.GetSelIndex)
855 TabEinzuegeUndAbstaende.Cancel
857 '/// 2.Test when Proportional is 130%
859 '/// Format/Paragraph / Indents & Spacing ,
860 '/// + select Proportional in Line spacing , and input 130%
861 Call fFormatParagraph("TabEinzuegeUndAbstaende")
862 Zeilenabstand.Select 4
864 Um.SetText sProportional
865 TabEinzuegeUndAbstaende.OK
867 'Set the focus to the end of the paragraph
868 Call wTypeKeys "<MOD1 End>"
871 Call wTypeKeys "<Home>"
874 '/// check if the last 2 lines is in 2nd page (it should be)
876 if Not Navigator.Exists then ViewNavigator
877 Kontext "NavigatorWriter"
879 if Seitennummer.GetText <> "2" then warnlog "The 8th line should be in 2nd page !"
882 Call wTypeKeys "<Up>" , 2
886 if Not Navigator.Exists then ViewNavigator
887 Kontext "NavigatorWriter"
889 if Seitennummer.GetText <> "1" then warnlog "The 6th line should be in 2nd page !"
896 '-------------------------------------------------------------------------------------------
898 testcase tParagraphIndent13
900 Dim sTestFile as String
901 Dim sAtLeast as String
902 Dim sPositionY as String
904 sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\formatparagraph\eightLineAdd1Pic.sxw")
905 sAtLeast = "4" + gSeperator + "00" + gMeasurementUnit
907 PrintLog "- Test Line spacing - At least"
908 '/// <b>Test Line spacing - At least</b>
912 '/// Open the test file
913 '/// This file includes 8 lines and 1 pic is anchored as character in 1st line
914 '/// when the spacing is At least to 4cm, there should be 1 line/page
915 '/// + and the pic should move down
916 Call hFileOpen(sTestFile)
917 Call sMakeReadOnlyDocumentEditable
919 'Get the original coordinate-Y
920 Call wTypeKeys ( "<Shift F4>" )
924 Call fPositionAndSize("TabPositionAndSizeWriter")
925 sPositionY = Verticalby.Gettext
926 TabPositionAndSizeWriter.Cancel
927 FormatAnchorAsCharacter
929 Call wTypeKeys "<ESCAPE>"
932 '/// Format/Paragraph / Indents & Spacing , select At least in Line spacing and set 4cm
933 Call fFormatParagraph("TabEinzuegeUndAbstaende")
934 Zeilenabstand.Select 5
937 TabEinzuegeUndAbstaende.OK
939 'Set the focus to the end of the paragraph
940 Call wTypeKeys "<MOD1 End>"
943 '/// check if it is 1 line /page
945 if Not Navigator.Exists then ViewNavigator
946 Kontext "NavigatorWriter"
948 if Seitennummer.GetText <> "8" then Warnlog "#i73903#The 8th line should be in 8th page !"
951 '/// check if the pic moves
952 Call wTypeKeys ( "<Shift F4>" )
957 Call fPositionAndSize("TabPositionAndSizeWriter")
958 if sPositionY = Verticalby.Gettext then warnlog "The pic should move !"
959 TabPositionAndSizeWriter.Cancel
965 '-------------------------------------------------------------------------------------------
967 testcase tParagraphIndent14
969 Dim sTestFile as String
970 Dim sAtLeast as String
971 Dim sPositionY as String
973 sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\formatparagraph\eightLineAdd1Pic.sxw")
974 sAtLeast = "4" + gSeperator + "00" + gMeasurementUnit
976 PrintLog "- Test Line spacing - leading"
977 '/// <b>Test Line spacing - leading</b>
981 '/// Open the test file
982 '/// This file includes 8 lines and 1 pic is anchored as character in 1st line
983 '/// when the spacing is leading to 4cm, there should be 1 line/page
984 '/// + and the pic should NOT move
985 Call hFileOpen(sTestFile)
986 Call sMakeReadOnlyDocumentEditable
988 'Get the original coordinate-Y
989 Call wTypeKeys ( "<Shift F4>" )
993 Call fPositionAndSize("TabPositionAndSizeWriter")
994 sPositionY = Verticalby.Gettext
995 TabPositionAndSizeWriter.Cancel
996 FormatAnchorAsCharacter
998 Call wTypeKeys "<ESCAPE>"
1001 '/// Format/Paragraph / Indents & Spacing , select leading in Line spacing and set 4cm
1002 Call fFormatParagraph("TabEinzuegeUndAbstaende")
1003 Zeilenabstand.Select 6
1005 Von.SetText sAtLeast
1006 TabEinzuegeUndAbstaende.OK
1008 'Set the focus to the end of the paragraph
1009 Call wTypeKeys "<MOD1 End>"
1012 '/// check if it is 1 line /page
1014 if Not Navigator.Exists then ViewNavigator
1015 Kontext "NavigatorWriter"
1017 if Seitennummer.GetText <> "8" then Warnlog "#i73903#The 8th line should be in 8th page !"
1020 '/// check if the pic moves
1021 Call wTypeKeys ( "<Shift F4>" )
1026 Call fPositionAndSize("TabPositionAndSizeWriter")
1027 if sPositionY <> Verticalby.Gettext then warnlog "The pic should NOT move !"
1028 TabPositionAndSizeWriter.Cancel
1034 '-------------------------------------------------------------------------------------------
1036 testcase tParagraphIndent15
1038 Dim sTestFile as String
1039 Dim sFixed as String
1041 sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\formatparagraph\eightline.sxw")
1042 sFixed = "0" + gSeperator + "50" + gMeasurementUnit
1044 PrintLog "- Test Line spacing - Fixed lines"
1045 '/// <b>Test Line spacing - Fixed lines</b>
1049 '/// Open the test file
1050 '/// + This file includes 8 lines , and font size is 12
1051 Call hFileOpen(sTestFile)
1052 Call sMakeReadOnlyDocumentEditable
1054 '/// Format/Paragraph / Indents & Spacing ,
1055 '/// + select Fixed lines in Line spacing
1057 Call fFormatParagraph("TabEinzuegeUndAbstaende")
1058 Zeilenabstand.Select 7
1061 TabEinzuegeUndAbstaende.OK
1063 '/// Format/Character / Font ,Change font size to 24
1064 Call wTypeKeys "<MOD1 a>"
1066 Call fFormatCharacter("TabFont")
1068 SizeWest.Select "24"
1074 '/// check if there are still 8 lines/page and there
1075 '/// + should be 2 pages
1076 Call wTypeKeys "<MOD1 Home>"
1077 Call wTypeKeys "<Down>" , 7
1080 if Not Navigator.Exists then ViewNavigator
1081 Kontext "NavigatorWriter"
1083 if Seitennummer.GetText <> "1" then warnlog "The 8th line should be in 1st page !"
1084 Call fCloseNavigator
1086 Call wTypeKeys "<Down>"
1089 if Not Navigator.Exists then ViewNavigator
1090 Kontext "NavigatorWriter"
1092 if Seitennummer.GetText <> "2" then warnlog "The 9th line should be in 2nd page !"
1093 Call fCloseNavigator
1099 '-------------------------------------------------------------------------------------------
1101 testcase tParagraphIndent16
1103 Dim sTestFile as String
1104 Dim sPositionX as String
1105 Dim sPositionY as String
1107 sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\formatparagraph\registerTrue.sxw")
1109 PrintLog "- Test Regester-true Active"
1110 '/// <b>Test Regester-true Active</b>
1114 '/// Open the test file .
1115 '/// This file includes 2 paragraphs ,
1116 '/// + and 2 columns , in format/page / page ,
1117 '/// + regester-true has been checked as text body.
1118 '/// + You will find out the "He2 heard quiet steps"
1119 '/// + isn't at the same line with the context left it .
1120 '/// + There is a pic anchored "He2" .
1121 Call hFileOpen(sTestFile)
1122 Call sMakeReadOnlyDocumentEditable
1124 'Get the original location for the pic
1125 Call wTypeKeys ( "<Shift F4>" )
1129 Call fPositionAndSize("TabPositionAndSizeWriter")
1130 sPositionX = Horizontalby.Gettext
1131 sPositionY = Verticalby.Gettext
1132 TabPositionAndSizeWriter.Cancel
1134 FormatAnchorAsCharacter
1136 Call wTypeKeys "<ESCAPE>"
1138 Call wTypeKeys "<MOD1 A>"
1140 '/// Format/Paragraph / Indents & Spacing ,
1141 '/// + check Regester-true Active
1142 Call fFormatParagraph("TabEinzuegeUndAbstaende")
1143 Registerhaltigkeit.Check
1145 TabEinzuegeUndAbstaende.OK
1147 '/// Check if "He2 heard quiet steps" is at the same line with the context left it.
1148 Call wTypeKeys ( "<Shift F4>" )
1152 Call fPositionAndSize("TabPositionAndSizeWriter")
1153 if sPositionX <> Horizontalby.Gettext then warnlog "Position X should NOT be changed !"
1154 if sPositionY = Verticalby.Gettext then warnlog "Position Y should be changed !"
1155 TabPositionAndSizeWriter.Cancel
1161 '-------------------------------------------------------------------------------------------
1163 testcase tParagraphIndent17
1165 Dim sTestFile1 as String
1166 Dim sTestFile2 as String
1168 sTestFile1 = Convertpath (gTesttoolpath + "writer\optional\input\formatparagraph\AddSpacingShouldCheck.doc")
1169 sTestFile2 = Convertpath (gTesttoolpath + "writer\optional\input\formatparagraph\AddSpacingShouldNotCheck.doc")
1171 PrintLog "- Test 'Add spacing between paragarph and talbes' when importing from MS-Word"
1172 '/// <b>Test 'Add spacing between paragarph and talbes' when importing from MS-Word</b>
1176 '/// 1.Open the test file - AddSpacingShouldCheck.doc
1177 '/// In Tools/Optionis/Text Document/Compatibility,
1178 '/// + the 'Add spacing between paragarph and talbes'
1179 '/// + should be checked
1180 Call hFileOpen(sTestFile1)
1181 Call sMakeReadOnlyDocumentEditable
1184 Call hToolsOptions("WRITER","COMPATIBILITY")
1185 Kontext "TabCompatibility"
1187 Options.TypeKeys "<Down>"
1188 if Options.IsChecked <> TRUE then
1189 warnlog "'Add spacing between paragarph and talbes' should be checked"
1191 Kontext "ExtrasOptionenDlg"
1192 ExtrasOptionenDlg.OK
1198 '/// 2.Open the test file - AddSpacingShouldNotCheck.doc
1199 '/// In Tools/Optionis/Text Document/Compatibility,
1200 '/// + the 'Add spacing between paragarph and talbes'
1201 '/// + should NOT be checked
1202 Call hFileOpen(sTestFile2)
1203 Call sMakeReadOnlyDocumentEditable
1206 Call hToolsOptions("WRITER","COMPATIBILITY")
1207 Kontext "TabCompatibility"
1209 Options.TypeKeys "<Down>"
1210 if Options.IsChecked = TRUE then
1211 warnlog "'Add spacing between paragarph and talbes' should NOT be checked"
1213 Kontext "ExtrasOptionenDlg"
1214 ExtrasOptionenDlg.OK
1220 '-------------------------------------------------------------------------------------------
1222 testcase tParagraphIndent18
1224 Dim sPageWidth as String
1225 Dim sMarginLeft as String
1226 Dim sMarginRight as String
1227 Dim sBeforeText as String
1228 Dim sAfterText as String
1230 sPageWidth = "8" + gSeperator + "00" + gMeasurementUnit
1231 sMarginLeft = "2" + gSeperator + "00" + gMeasurementUnit
1232 sMarginRight = "2" + gSeperator + "00" + gMeasurementUnit
1233 sBeforeText = "-10" + gSeperator + "00" + gMeasurementUnit
1234 sAfterText = "-12" + gSeperator + "00" + gMeasurementUnit
1236 PrintLog "- Test Negativ indent"
1237 '/// <b>Test Negativ indent</b> ///
1241 '/// Format/Page , tabpage Page , set page size and margin size ///
1242 Call fFormatPageWriter("TabSeite")
1243 Breite.SetText sPageWidth
1244 Links.SetText sMarginLeft
1245 Rechts.SetText sMarginRight
1248 '/// Format/Paragraph / Indents & Spacing , ///
1249 '/// + set -10cm in 'before text' ///
1250 '/// + set -12cm in 'after text' ///
1251 Call fFormatParagraph("TabEinzuegeUndAbstaende")
1252 Vonlinks.SetText sBeforeText
1253 VonRechts.SetText sAfterText
1254 TabEinzuegeUndAbstaende.OK
1256 '/// Check if the configuration is right ///
1257 Call fFormatParagraph("TabEinzuegeUndAbstaende")
1258 if Vonlinks.GetText <> sBeforeText then warnlog "Before text is wrong , get :" &Vonlinks.GetText
1259 if VonRechts.GetText <> sAfterText then warnlog "After text is wrong , get :" &VonRechts.SetText
1260 TabEinzuegeUndAbstaende.Cancel
1266 '-------------------------------------------------------------------------------------------