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_formatparagraph2.inc,v $
13 '* last change: $Author: vg $ $Date: 2008-08-18 12:29:26 $
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 - 2
38 '************************************************************************
40 ' #1 tParagraphAlignment1 'Test 'Left' alignment
41 ' #1 tParagraphAlignment2 'Test 'Right' alignment
42 ' #1 tParagraphAlignment3 'Test 'Center' alignment
43 ' #1 tParagraphAlignment4 'Test 'Justified' alignment - Default
44 ' #1 tParagraphAlignment5 'Test 'Justified' alignment - Centered
45 ' #1 tParagraphAlignment6 'Test 'Justified' alignment - Justified
46 ' #1 tParagraphAlignment7 'Test 'Expand single word'
47 ' #1 tParagraphAlignment8 'Test Uncheck 'Snap to text grid(if active)'
48 ' #1 tParagraphAlignment9 'Test Check 'Snap to text grid(if active)'
49 ' #1 tParagraphTextFlow1 'Hyphenation must be processed while entering text WITHOUT inquiry
50 ' #1 tParagraphTextFlow2 'Hyphenation - Characters at line end
51 ' #1 tParagraphTextFlow3 'Hyphenation - Characters at line begin
52 ' #1 tParagraphTextFlow4 'Hyphenation - maxinum number of consecutive typhens
53 ' #1 tParagraphTextFlow5 'Paragraph break before Column
54 ' #1 tParagraphTextFlow6 'Paragraph break after Column
55 ' #1 tParagraphTextFlow7 'Paragraph break before Page
56 ' #1 tParagraphTextFlow8 'Paragraph break after Page
57 ' #1 tParagraphTextFlow9 'Do not split paragraph
58 ' #1 tParagraphTextFlow10 'Keep with next paragraph
59 ' #1 tParagraphTextFlow11 'Orphan control
60 ' #1 tParagraphTextFlow12 'widow control
61 ' #1 tParagraphTextFlow13 'Special test for Hyphenation
63 '\***********************************************************************
65 testcase tParagraphAlignment1
67 Dim sTestFile as String
68 Dim sPositionX as String
70 sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\formatparagraph\alignmentTest.sxw")
72 PrintLog "- Test 'Left' alignment"
73 '/// Test 'Left' alignment
77 '/// + Open the test file
78 '/// + This file includes 1 paragraphs , and a pic is anchored to the character
79 Call hFileOpen(sTestFile)
80 Call sMakeReadOnlyDocumentEditable
82 'Get the original coordinate-X
83 Call wTypeKeys ( "<Shift F4>" )
87 Call fPositionAndSize("TabPositionAndSizeWriter")
88 sPositionX = Horizontalby.Gettext
89 TabPositionAndSizeWriter.Cancel
90 FormatAnchorAsCharacter
92 Call wTypeKeys "<ESCAPE>"
94 '/// + Format/Paragraph / Alignment , choose Left/Top option
95 Call fFormatParagraph("TabAusrichtungAbsatz")
97 TabAusrichtungAbsatz.OK
99 '/// + check if the alignment is moved to left
100 Call wTypeKeys ( "<Shift F4>" )
104 Call fPositionAndSize("TabPositionAndSizeWriter")
105 if sPositionX <> Horizontalby.Gettext then warnlog "Alignment Left doesn't work !"
106 TabPositionAndSizeWriter.Cancel
111 '-------------------------------------------------------------------------------------------
113 testcase tParagraphAlignment2
115 Dim sTestFile as String
116 Dim sPositionX as String
118 sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\formatparagraph\alignmentTestRight.sxw")
119 sPositionX = "11" + gSeperator + "00" + gMeasurementUnit
121 PrintLog "- Test 'Right' alignment"
122 '/// Test 'Right' alignment
126 '/// + Open the test file
127 '/// + This file includes 1 paragraphs , and a pic is anchored to the laste character
128 Call hFileOpen(sTestFile)
129 Call sMakeReadOnlyDocumentEditable
131 '/// + Format/Paragraph / Alignment , choose Right/Bottom option
132 Call fFormatParagraph("TabAusrichtungAbsatz")
134 TabAusrichtungAbsatz.OK
136 '/// + check if the alignment is moved to Right
137 Call wTypeKeys ( "<Shift F4>" )
141 Call fPositionAndSize("TabPositionAndSizeWriter")
142 if fCalculateTolerance(Horizontalby.Gettext , sPositionX) > 0.02 then
143 warnlog "Alignment Right doesn't work !"
145 TabPositionAndSizeWriter.Cancel
150 '-------------------------------------------------------------------------------------------
152 testcase tParagraphAlignment3
154 Dim sTestFile as String
156 sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\formatparagraph\alignmentTest.sxw")
158 PrintLog "- Test 'Center' alignment"
159 '/// Test 'Center' alignment
163 '/// + Open the test file
164 '/// + This file includes 1 paragraphs , and a pic is anchored to the character
165 Call hFileOpen(sTestFile)
166 Call sMakeReadOnlyDocumentEditable
168 '/// + Format/Paragraph / Alignment , choose Center option
169 Call fFormatParagraph("TabAusrichtungAbsatz")
171 TabAusrichtungAbsatz.OK
173 '/// + check if the alignment is moved to Center
174 Call wTypeKeys ( "<Shift F4>" )
178 Call fPositionAndSize("TabPositionAndSizeWriter")
179 if Int( Left(Horizontalby.Gettext , 1) ) > 7 OR Int( Left(Horizontalby.Gettext , 1) ) < 4 then
180 warnlog "Alignment Center doesn't work !"
182 TabPositionAndSizeWriter.Cancel
187 '-------------------------------------------------------------------------------------------
189 testcase tParagraphAlignment4
191 Dim sTestFile as String
192 Dim sPositionX1 as String
193 Dim sPositionX2 as String
195 sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\formatparagraph\alignmentTestJustified.sxw")
196 sPositionX1 = "12" + gSeperator + "84" + gMeasurementUnit
198 PrintLog "- Test 'Justified' alignment - Default"
199 '/// Test 'Justified' alignment - Default
203 '/// Open the test file
204 '/// + This file includes 1 paragraphs , and a pic is anchored to the last character
205 Call hFileOpen(sTestFile)
206 Call sMakeReadOnlyDocumentEditable
208 Call wTypeKeys ( "<Shift F4>" )
213 Call fPositionAndSize("TabPositionAndSizeWriter")
214 sPositionX2 = Horizontalby.Gettext
215 TabPositionAndSizeWriter.Cancel
216 Call wTypeKeys "<ESCAPE>"
218 '/// Format/Paragraph / Alignment , choose Justified option , and select default in last line
219 Call fFormatParagraph("TabAusrichtungAbsatz")
223 TabAusrichtungAbsatz.OK
225 '/// check if the alignment is moved as Justified
226 Call wTypeKeys ( "<Shift F4>" )
227 Call wTypeKeys "<Tab>"
232 Call fPositionAndSize("TabPositionAndSizeWriter")
233 if fCalculateTolerance(Horizontalby.Gettext , sPositionX1) > 0.02 then
234 if gPlatGroup = "unx" then
235 QaErrorLog "#i94769# - Different font-sizes under Linux/Unix compared with windows."
237 Warnlog "Alignment Justified doesn't work -1 !"
240 TabPositionAndSizeWriter.Cancel
242 Call wTypeKeys "<Tab>"
245 Call fPositionAndSize("TabPositionAndSizeWriter")
246 if Horizontalby.Gettext <> sPositionX2 then
247 if gPlatGroup = "unx" then
248 QaErrorLog "#i94769# - Different font-sizes under Linux/Unix compared with windows."
250 warnlog "Alignment Justified doesn't work -2 !"
253 TabPositionAndSizeWriter.Cancel
258 '-------------------------------------------------------------------------------------------
260 testcase tParagraphAlignment5
262 Dim sTestFile as String
264 sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\formatparagraph\alignmentTestJustified.sxw")
266 PrintLog "- Test 'Justified' alignment - Centered"
267 '/// Test 'Justified' alignment - Centered
271 '/// Open the test file
272 '/// + This file includes 1 paragraphs , and a pic is anchored to the last character
273 Call hFileOpen(sTestFile)
274 Call sMakeReadOnlyDocumentEditable
276 '/// Format/Paragraph / Alignment ,
277 '/// + choose Justified option , and select centered in last line
278 Call fFormatParagraph("TabAusrichtungAbsatz")
282 TabAusrichtungAbsatz.OK
284 '/// check if the alignment is moved as Justified
285 Call wTypeKeys ( "<Shift F4>" )
288 Call fPositionAndSize("TabPositionAndSizeWriter")
289 if StrToDouble(Horizontalby.Gettext) < 7.5 OR StrToDouble(Horizontalby.Gettext) > 8.8 then
290 warnlog "Alignment Justified - Centered doesn't work !"
292 TabPositionAndSizeWriter.Cancel
297 '-------------------------------------------------------------------------------------------
299 testcase tParagraphAlignment6
301 Dim sTestFile as String
302 Dim sPositionX1 as String
303 Dim sPositionX2 as String
305 sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\formatparagraph\alignmentTestJustifiedCentered.sxw")
306 sPositionX2 = "11" + gSeperator + "15" + gMeasurementUnit
308 PrintLog "- Test 'Justified' alignment - Justified"
309 '/// Test 'Justified' alignment - Justified
313 '/// Open the test file
314 '/// + This file includes 1 paragraphs,
315 '/// + and 2 pics are in 2nd line
316 Call hFileOpen(sTestFile)
317 Call sMakeReadOnlyDocumentEditable
319 Call wTypeKeys ( "<Shift F4>" )
320 Call wTypeKeys "<TAB>"
325 Call fPositionAndSize("TabPositionAndSizeWriter")
326 sPositionX1 = Horizontalby.Gettext
327 TabPositionAndSizeWriter.Cancel
328 FormatAnchorAsCharacter
330 Call wTypeKeys "<ESCAPE>"
332 '/// Format/Paragraph / Alignment ,
333 '/// + choose Justified option , and select Justified in last line
334 Call fFormatParagraph("TabAusrichtungAbsatz")
338 TabAusrichtungAbsatz.OK
340 '/// check if the alignment is moved as Justified
341 Call wTypeKeys "<MOD1 Home>"
342 Call wTypeKeys ( "<Shift F4>" )
347 Call fPositionAndSize("TabPositionAndSizeWriter")
348 if Horizontalby.Gettext <> sPositionX1 then
349 if gPlatGroup = "unx" then
350 QaErrorLog "#i94769# - Different font-sizes under Linux/Unix compared with windows."
352 warnlog "Alignment Justified doesn't work -1 !"
355 TabPositionAndSizeWriter.Cancel
357 Call wTypeKeys "<Tab>"
360 Call fPositionAndSize("TabPositionAndSizeWriter")
361 if fCalculateTolerance(Horizontalby.Gettext , sPositionX2) > 0.02 then Warnlog "Alignment Justified doesn't work -2 !"
362 TabPositionAndSizeWriter.Cancel
367 '--------------------------------------------------------------------------
369 testcase tParagraphAlignment7
371 Dim sTestFile as String
372 Dim sPositionX as String
374 sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\formatparagraph\testExpand.sxw")
376 Printlog "- Test 'Expand single word'"
379 '/// Open the test file
380 '/// + This file includes 1 paragraphs ,
381 '/// + there is only 1 word - "That" in last line ,
382 '/// + and a drawring object is anchored as character after "That"
383 Call hFileOpen(sTestFile)
384 Call sMakeReadOnlyDocumentEditable
386 printlog "Select the object."
388 Call wTypeKeys ( "<Shift F4>" )
391 printlog "Note the position of the drawing object"
392 Call fPositionAndSize("TabPositionAndSizeWriter")
393 sPositionX = Horizontalby.Gettext
394 TabPositionAndSizeWriter.Cancel
396 printlog "Deselect the object"
398 Call wTypeKeys ( "<ESCAPE>" )
400 '/// Format/Paragraph / Alignment ,
401 '/// + choose Justified option , select Justified in 'last line'
402 '/// + check 'expand single word'
403 Call fFormatParagraph("TabAusrichtungAbsatz")
408 EinzelnesWortAustreiben.Check
410 TabAusrichtungAbsatz.OK
412 printlog "Select the drawing object , Format/Anchor / To page"
413 Call wTypeKeys ( "<Shift F4>" )
419 printlog "Check if the drawing object has moved from where it was before."
420 Call fPositionAndSize("TabPositionAndSizeWriter")
421 if Horizontalby.Gettext = sPositionX then QAErrorLog "#114314# Expand single word doesn't work"
422 TabPositionAndSizeWriter.Cancel
427 '--------------------------------------------------------------------------
429 testcase tParagraphAlignment8
431 Dim bAsianLanguage as Boolean
432 Dim sTestFile as String
433 Dim sPositionX as String
434 Dim sPositionY as String
436 sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\formatparagraph\testExpand.sxw")
437 sPositionY = "2" + gSeperator + "80" + gMeasurementUnit
439 PrintLog "- Test Uncheck 'Snap to text grid'"
440 '/// <b> Test Uncheck 'Snap to text grid' </b> ///
444 '/// Set 'Asian Language support' on ///
445 bAsianLanguage = ActiveDeactivateAsianSupport(TRUE)
447 '/// Open the test file
448 '/// + This file includes 1 paragraphs ,
449 '/// + and a drawring object is anchored as character after "That"
450 Call hFileOpen(sTestFile)
451 Call sMakeReadOnlyDocumentEditable
453 '/// Get the drawing object original position ///
454 Call wTypeKeys ( "<Shift F4>" )
458 Call fPositionAndSize("TabPositionAndSizeWriter")
459 sPositionX = Horizontalby.Gettext
460 TabPositionAndSizeWriter.Cancel
461 FormatAnchorAsCharacter
463 Call wTypeKeys "<ESCAPE>"
465 '/// Format/Paragraph / Alignment ,
466 '/// + Uncheck 'Snap to text grid'
467 Call fFormatParagraph("TabAusrichtungAbsatz")
468 TextrasterFangen.UnCheck
470 TabAusrichtungAbsatz.OK
472 '/// Format/page / Text Grid
473 '/// + Check 'Grid (lines only)
474 '/// + close the dialog
475 Call fFormatPageWriter("TabGrid")
480 '/// Check if the drawing object is in the same position
481 Call wTypeKeys ( "<Shift F4>" )
485 Call fPositionAndSize("TabPositionAndSizeWriter")
486 if Horizontalby.Gettext <> sPositionX then warnlog "Uncheck 'Snap to text grid' doesn't work - x position!"
487 if fCalculateTolerance(Verticalby.Gettext , sPositionY) > 0.1 then Warnlog "Uncheck 'Snap to text grid' doesn't work - y position!"
488 TabPositionAndSizeWriter.Cancel
490 '/// Set the 'Asian Language support' to default
491 if bAsianLanguage = FALSE then
492 Call ActiveDeactivateAsianSupport(FALSE)
498 '--------------------------------------------------------------------------
500 testcase tParagraphAlignment9
502 Dim bAsianLanguage as Boolean
503 Dim sTestFile as String
504 Dim sPositionX as String
505 Dim sPositionY as String
507 sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\formatparagraph\testExpand.sxw")
508 sPositionY = "3" + gSeperator + "61" + gMeasurementUnit
510 PrintLog "- Test check 'Snap to text grid'"
511 '/// <b> Test check 'Snap to text grid' </b> ///
515 '/// Set 'Asian Language support' on ///
516 bAsianLanguage = ActiveDeactivateAsianSupport(TRUE)
518 '/// Open the test file
519 '/// + This file includes 1 paragraphs ,
520 '/// + and a drawring object is anchored as character after "That"
521 Call hFileOpen(sTestFile)
522 Call sMakeReadOnlyDocumentEditable
524 '/// Get the drawing object original position ///
525 Call wTypeKeys ( "<Shift F4>" )
529 Call fPositionAndSize("TabPositionAndSizeWriter")
530 sPositionX = Horizontalby.Gettext
531 TabPositionAndSizeWriter.Cancel
532 FormatAnchorAsCharacter
534 Call wTypeKeys "<ESCAPE>"
536 '/// Format/Paragraph / Alignment ,
537 '/// + check 'Snap to text grid'
538 Call fFormatParagraph("TabAusrichtungAbsatz")
539 TextrasterFangen.Check
541 TabAusrichtungAbsatz.OK
543 '/// Format/page / Text Grid
544 '/// + Check 'Grid (lines only)
545 '/// + close the dialog
546 Call fFormatPageWriter("TabGrid")
551 '/// Check if the drawing object is in the same position
552 Call wTypeKeys ( "<Shift F4>" )
556 Call fPositionAndSize("TabPositionAndSizeWriter")
557 if Horizontalby.Gettext <> sPositionX then warnlog "check 'Snap to text grid' doesn't work - x position!"
558 if fCalculateTolerance(Verticalby.Gettext , sPositionY) > 0.1 then Warnlog "check 'Snap to text grid' doesn't work - y position!"
559 TabPositionAndSizeWriter.Cancel
561 '/// Set the 'Asian Language support' to default
562 if bAsianLanguage = FALSE then
563 Call ActiveDeactivateAsianSupport(FALSE)
569 '--------------------------------------------------------------------------
571 testcase tParagraphTextFlow1
573 Dim sTestFile as String
574 Dim sTestText as String
577 sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\formatparagraph\hyphenation.sxw")
580 PrintLog "- Hyphenation must be processed while entering text WITHOUT inquiry"
581 '/// Hyphenation must be processed while entering text WITHOUT inquiry
585 '/// Open the test file
586 '/// + This file includes 2 words : AAA and Kilometerhigh
587 Call hFileOpen(sTestFile)
588 Call sMakeReadOnlyDocumentEditable
590 'the focus is in front of Kilometerhigh
591 Call wTypeKeys "<Home>"
593 '/// 1. Test there is no Hyphenation configuratioin
596 Call wTypeKeys "<End>"
597 Call wTypeKeys "<Shift Left>"
599 if GetClipboardText <> sTestText then
600 if GetClipboardText = "A" then
603 warnlog "no Hyphenation configuratioin doesn't work !"
606 Call wTypeKeys "<Home>"
609 warnlog "1.Something wrong in Hyphenation test !"
616 Call hFileOpen(sTestFile)
617 Call sMakeReadOnlyDocumentEditable
619 '/// 2. Test there is the Hyphenation configuratioin
620 '/// + Format/Paragraph / Text Flow ,
621 '/// + Check Hyphenation 'Automatically'
622 Call fFormatParagraph("TabTextfluss")
626 Call wTypeKeys "<Home>"
630 Call wTypeKeys "<End>"
631 Call wTypeKeys "<Shift Left>"
633 if GetClipboardText <> sTestText then
634 if GetClipboardText = "t" then
637 warnlog "Hyphenation configuratioin doesn't work !"
640 Call wTypeKeys "<Home>"
642 warnlog "2.Something wrong in Hyphenation test !"
648 '-------------------------------------------------------------------------------------------
650 testcase tParagraphTextFlow2
652 Dim sTestFile as String
653 Dim sTestText as String
656 sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\formatparagraph\hyphenation.sxw")
657 sTestText = "Kilomet"
659 PrintLog "- Hyphenation - Characters at line end"
660 '/// Hyphenation - Characters at line end
664 '/// Open the test file
665 '/// + This file includes 2 words : AAA and Kilometerhigh
666 Call hFileOpen(sTestFile)
667 Call sMakeReadOnlyDocumentEditable
669 '/// 1.Test Characters at line end ==> 6
670 '/// + Format/Paragraph / Text Flow ,
671 '/// + Check Hyphenation 'Automatically'
672 '/// + Set 6 in 'Characters at line end'
673 Call fFormatParagraph("TabTextfluss")
676 AbZeichenende.SetText "6"
679 'the focus is in front of Kilometerhigh
680 Call wTypeKeys "<Home>"
684 Call wTypeKeys "<End>"
685 Call wTypeKeys "<Shift Left>" , 7
688 if GetClipboardText = sTestText then Goto GoON1
689 Call wTypeKeys "<Home>"
691 warnlog "Something wrong in Characters at line end = > 6"
698 Call hFileOpen(sTestFile)
699 Call sMakeReadOnlyDocumentEditable
701 '/// 2.Test Characters at line end ==> 8
702 '/// + Format/Paragraph / Text Flow ,
703 '/// + Check Hyphenation 'Automatically'
704 '/// + Set 8 in 'Characters at line end'
705 Call fFormatParagraph("TabTextfluss")
708 AbZeichenende.SetText "8"
711 'the focus is in front of Kilometerhigh
712 Call wTypeKeys "<Home>"
716 Call wTypeKeys "<End>"
717 Call wTypeKeys "<Shift Left>" , 6
719 if GetClipboardText = sTestText then warnlog "Something wrong in Characters at line end = > 8"
720 Call wTypeKeys "<Home>"
726 '--------------------------------------------------------------------------
728 testcase tParagraphTextFlow3
730 Dim sTestFile as String
731 Dim sTestText as String
734 sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\formatparagraph\hyphenation.sxw")
737 PrintLog "- Hyphenation - Characters at line begin"
738 '/// Hyphenation - Characters at line begin
742 '/// Open the test file
743 '/// + This file includes 2 words : AAA and Kilometerhigh
744 Call hFileOpen(sTestFile)
745 Call sMakeReadOnlyDocumentEditable
747 '/// 1.Test Characters at line begin ==> 4
748 '/// + Format/Paragraph / Text Flow ,
749 '/// + Check Hyphenation 'Automatically'
750 '/// + Set 4 in 'Characters at line begin'
751 Call fFormatParagraph("TabTextfluss")
754 AbZeichenAnfang.SetText "4"
757 'the focus is in front of Kilometerhigh
758 Call wTypeKeys "<Home>"
762 Call wTypeKeys "<End>"
763 Call wTypeKeys "<Shift Left>" , 5
765 if GetClipboardText = sTestText then Goto GoON1
766 Call wTypeKeys "<Home>"
768 warnlog "Something wrong in Characters at line end = > 4"
775 Call hFileOpen(sTestFile)
776 Call sMakeReadOnlyDocumentEditable
778 '/// 2.Test Characters at line end ==> 6
779 '/// + Format/Paragraph / Text Flow ,
780 '/// + Check Hyphenation 'Automatically'
781 '/// + Set 8 in 'Characters at line end'
782 Call fFormatParagraph("TabTextfluss")
785 AbZeichenAnfang.SetText "6"
788 'the focus is in front of Kilometerhigh
789 Call wTypeKeys "<Home>"
793 Call wTypeKeys "<End>"
794 Call wTypeKeys "<Shift Left>" , 5
797 if GetClipboardText = sTestText then Goto GoON2
798 Call wTypeKeys "<Home>"
801 warnlog "Something wrong in Characters at line end = > 6"
807 '--------------------------------------------------------------------------
809 testcase tParagraphTextFlow4
811 Dim sTestFile as String
814 Dim sTestText() as Variant
816 sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\formatparagraph\hyphenationNew.odt")
818 PrintLog "- Hyphenation - maxinum number of consecutive typhens"
819 '/// Hyphenation - maxinum number of consecutive typhens
823 '/// Open the test file
824 '/// + This file includes 4 words : KiloAmterhigh1 kiloAmeterhigh2 kiloAmeterhigh3 kiloAmeterhigh4
825 '/// + the words' length is longer then page length
826 Call hFileOpen(sTestFile)
827 Call sMakeReadOnlyDocumentEditable
829 '/// 1.Test maxinum number of consecutive typhens (default => 0)
830 '/// + Format/Paragraph / Text Flow ,
831 '/// + Check Hyphenation 'Automatically'
832 '/// + Set 0 in 'maxinum number of consecutive typhens'
840 j = UBound(sTestText)
842 Call fFormatParagraph("TabTextfluss")
845 Trennstellen.SetText "0"
848 Call wTypeKeys "<MOD1 Home>"
849 Call wTypeKeys "<Down>"
851 Call wTypeKeys "<Down>" , i*2
852 Call wTypeKeys "<Shift End>"
854 if GetClipboardText <> sTestText(i) then
855 warnlog " Something wrong in Consecutive typhens 0 : " &i
858 Call wTypeKeys "<MOD1 Home>"
859 Call wTypeKeys "<Down>"
862 '/// 2.Test maxinum number of consecutive typhens = >1
863 '/// + Format/Paragraph / Text Flow ,
864 '/// + Check Hyphenation 'Automatically'
865 '/// + Set 0 in 'maxinum number of consecutive typhens'
873 Call fFormatParagraph("TabTextfluss")
876 Trennstellen.SetText "1"
879 Call wTypeKeys "<MOD1 Home>"
880 Call wTypeKeys "<Down>"
882 Call wTypeKeys "<Down>" , i*2
883 Call wTypeKeys "<Shift End>"
885 if GetClipboardText <> sTestText(i) then
886 warnlog " Something wrong in Consecutive typhens 1 : " &i
889 Call wTypeKeys "<MOD1 Home>"
890 Call wTypeKeys "<Down>"
893 '/// 3.Test maxinum number of consecutive typhens = >2
894 '/// + Format/Paragraph / Text Flow ,
895 '/// + Check Hyphenation 'Automatically'
896 '/// + Set 0 in 'maxinum number of consecutive typhens'
904 Call fFormatParagraph("TabTextfluss")
907 Trennstellen.SetText "2"
910 Call wTypeKeys "<MOD1 Home>"
911 Call wTypeKeys "<Down>"
913 Call wTypeKeys "<Down>" , i*2
914 Call wTypeKeys "<Shift End>"
916 if GetClipboardText <> sTestText(i) then
917 warnlog " Something wrong in Consecutive typhens 2 : " &i
920 Call wTypeKeys "<MOD1 Home>"
921 Call wTypeKeys "<Down>"
927 '--------------------------------------------------------------------------
929 testcase tParagraphTextFlow5
931 Dim sTestFile as String
933 sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\formatparagraph\columnBreakParagraphBefore.sxw")
935 PrintLog "- Paragraph break before Column"
936 '/// Paragraph break before Column
940 '/// Open the test file
941 '/// + There are 2 columns/page ,includes 2 paragraph
942 '/// + the 1st paragraph is in 1st and 2nd column
943 '/// + the 2nd paragraph is is 2nd and 3rd column
944 Call hFileOpen(sTestFile)
945 Call sMakeReadOnlyDocumentEditable
947 '/// Set the focus to 2nd paragraph
950 Kontext "FindAndReplace"
951 SearchFor.SetText "She"
957 '/// Format/Paragraph / Text Flow
958 '/// + Set 'Breaks' enable
959 '/// + Select column in Type' and select Before in 'Position'
960 Call fFormatParagraph("TabTextfluss")
965 UmbruchPosition.Select 1
968 '/// + check if the 2nd paragraph is in 2nd page
970 if Not Navigator.Exists then ViewNavigator
971 Kontext "NavigatorWriter"
973 if Seitennummer.GetText <> "2" then warnlog "Something wrong in 'Paragraph break before Column'!"
979 '--------------------------------------------------------------------------
981 testcase tParagraphTextFlow6
983 Dim sTestFile as String
985 sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\formatparagraph\columnBreakParagraphAfter.sxw")
987 PrintLog "- Paragraph break after Column"
988 '/// Paragraph break after Column
992 '/// Open the test file
993 '/// + There are 2 columns/page ,includes 1 paragraph
994 '/// + the paragraph is in 1st and 2nd column
995 '/// + and it is NOT full of 2nd column
996 Call hFileOpen(sTestFile)
997 Call sMakeReadOnlyDocumentEditable
999 '/// Format/Paragraph / Text Flow
1000 '/// + Set 'Breaks' enable
1001 '/// + Select column in Type' and select After in 'Position'
1002 Call fFormatParagraph("TabTextfluss")
1007 UmbruchPosition.Select 2
1010 '/// Set the focus to the end of the paragraph
1011 Call wTypeKeys "<MOD1 End>"
1012 Call wTypeKeys "<Return>"
1014 '/// + check if the 2nd paragraph is in 2nd page
1016 if Not Navigator.Exists then ViewNavigator
1017 Kontext "NavigatorWriter"
1019 if Seitennummer.GetText <> "2" then warnlog "Something wrong in 'Paragraph break after Column'! "
1025 '--------------------------------------------------------------------------
1027 testcase tParagraphTextFlow7
1029 Dim sTestFile as String
1031 sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\formatparagraph\pageBreakBefore.sxw")
1033 PrintLog "- Paragraph break before Page"
1034 '/// Paragraph break before Page
1038 '/// Open the test file
1039 '/// + There are 2 paragraphs in 1 page
1040 Call hFileOpen(sTestFile)
1041 Call sMakeReadOnlyDocumentEditable
1043 '/// Set the focus to 2nd paragraph
1045 EditSearchAndReplace
1046 Kontext "FindAndReplace"
1047 SearchFor.SetText "She"
1051 FindAndReplace.Close
1053 '/// Format/Paragraph / Text Flow
1054 '/// + Set 'Breaks' enable
1055 '/// + Select page in 'Type' and select Before in 'Position'
1056 '/// + Select 3rd in 'with page style' and set 4 in 'page number'
1057 Call fFormatParagraph("TabTextfluss")
1062 UmbruchPosition.Select 1
1064 MitSeitenvorlage.Check
1067 Seitenzahl.SetText "4"
1070 '/// + check if the 2nd paragraph is in 4th page
1072 if Not Navigator.Exists then ViewNavigator
1073 Kontext "NavigatorWriter"
1075 if Seitennummer.GetText <> "2" then warnlog "Something wrong in ' Column break after paragraph'! "
1078 Call fFormatParagraph("TabTextfluss")
1079 if Vorlage.GetSelIndex <> 3 then warnlog "Should select the 3rd in with page style , but get " &Vorlage.GetSelIndex
1080 if Seitenzahl.GetText <> "4" then warnlog "Should get 4 in with page number , but get " &Seitenzahl.GetText
1086 '--------------------------------------------------------------------------
1088 testcase tParagraphTextFlow8
1090 Dim sTestFile as String
1092 sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\formatparagraph\pageBreakAfter.sxw")
1094 PrintLog "- Paragraph break after page"
1095 '/// Paragraph break after page
1099 '/// Open the test file
1100 '/// + There is 1 paragraph in the file
1101 Call hFileOpen(sTestFile)
1102 Call sMakeReadOnlyDocumentEditable
1104 '/// Format/Paragraph / Text Flow
1105 '/// + Set 'Breaks' enable
1106 '/// + Select page in Type' and select After in 'Position'
1107 Call fFormatParagraph("TabTextfluss")
1112 UmbruchPosition.Select 2
1115 '/// Set the focus to the end of the paragraph
1116 Call wTypeKeys "<MOD1 End>"
1117 Call wTypeKeys "<Return>"
1119 '/// + check if the 2nd paragraph is in 2nd page
1121 if Not Navigator.Exists then ViewNavigator
1122 Kontext "NavigatorWriter"
1124 if Seitennummer.GetText <> "2" then warnlog "Something wrong in 'Paragraph break after page'! "
1130 '--------------------------------------------------------------------------
1132 testcase tParagraphTextFlow9
1134 Dim sTestFile as String
1135 Dim sPage1 as String
1136 Dim sPage2 as String
1139 sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\formatparagraph\textFlowOptions.sxw")
1141 PrintLog "- Don't split paragraph"
1142 '/// Don't split paragraph
1146 '/// Open the test file
1147 '/// + There is 1 paragraph which cross 2 pages
1148 Call hFileOpen(sTestFile)
1149 Call sMakeReadOnlyDocumentEditable
1150 Call wTypeKeys "<MOD1 Home>"
1152 Call fFindWord("She")
1153 Call wTypeKeys "<Home>"
1155 PrintLog "- Uncheck Don't split paragraph"
1156 '/// 1. Test unchecking "Don't split paragraph"
1157 '/// Format/Paragraph / Text Flow
1158 '/// + UnCheck "Don't split paragraph"
1159 Call fFormatParagraph("TabTextfluss")
1160 AbsatzNichtTrennen.UnCheck
1164 if Not Navigator.Exists then ViewNavigator
1165 Kontext "NavigatorWriter"
1167 if Seitennummer.GetText <> "1" then warnlog "The head of the paragraph should be in 1st page !"
1170 Call wTypeKeys "<MOD1 End>"
1172 if Not Navigator.Exists then ViewNavigator
1173 Kontext "NavigatorWriter"
1175 if Seitennummer.GetText <> "2" then warnlog "The end of the paragraph should be in 2nd page !"
1180 PrintLog "- Check Don't split paragraph"
1182 Call hFileOpen(sTestFile)
1183 Call sMakeReadOnlyDocumentEditable
1185 Call wTypeKeys "<MOD1 Home>"
1187 Call fFindWord("She")
1188 Call wTypeKeys "<Home>"
1190 '/// 2. Test checking "Don't split paragraph"
1191 '/// Format/Paragraph / Text Flow
1192 '/// + Check "Don't split paragraph"
1193 Call fFormatParagraph("TabTextfluss")
1194 AbsatzNichtTrennen.Check
1198 if Not Navigator.Exists then ViewNavigator
1199 Kontext "NavigatorWriter"
1201 if Seitennummer.GetText <> "2" then warnlog "The head of the paragraph should be in 2nd page !"
1204 Call wTypeKeys "<MOD1 End>"
1206 if Not Navigator.Exists then ViewNavigator
1207 Kontext "NavigatorWriter"
1209 if Seitennummer.GetText <> "2" then warnlog "The end of the paragraph should be in 2nd page !"
1215 '--------------------------------------------------------------------------
1217 testcase tParagraphTextFlow10
1219 Dim sTestFile as String
1220 Dim sPage1 as String
1221 Dim sPage2 as String
1224 sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\formatparagraph\textFlowOptions1.sxw")
1226 PrintLog "- Keep with next paragraph"
1227 '/// Keep with next paragraph
1231 '/// Open the test file
1232 '/// There are 2 paragraphes in the file , 1st one crosses
1233 '/// + 1st and 2nd page , 2nd one is in 2nd page
1234 Call hFileOpen(sTestFile)
1235 Call sMakeReadOnlyDocumentEditable
1236 EditSearchAndReplace
1237 Kontext "FindAndReplace"
1238 SearchFor.SetText "He1"
1242 FindAndReplace.Close
1243 Call wTypeKeys "<Home>"
1245 PrintLog "- Uncheck Keep with next paragraph"
1246 '/// 1. Test unchecking "Keep with next paragraph"
1247 '/// Format/Paragraph / Text Flow
1248 '/// + UnCheck "Keep with next paragraph"
1249 Call fFormatParagraph("TabTextfluss")
1250 AbsaetzeZusammenhalten.UnCheck
1254 if Not Navigator.Exists then ViewNavigator
1255 Kontext "NavigatorWriter"
1257 if Seitennummer.GetText <> "1" then warnlog "The head of the 1st paragraph should be in 1st page ! == " &i
1260 EditSearchAndReplace
1261 Kontext "FindAndReplace"
1262 SearchFor.SetText "He2"
1266 FindAndReplace.Close
1268 if Not Navigator.Exists then ViewNavigator
1269 Kontext "NavigatorWriter"
1271 if Seitennummer.GetText <> "2" then warnlog "The head of the 2nd paragraph should be in 2nd page !"
1278 Call hFileOpen(sTestFile)
1279 Call sMakeReadOnlyDocumentEditable
1281 PrintLog "- Check Keep with next paragraph"
1282 '/// 2. Test checking "Keep with next paragraph"
1283 '/// Set focus to first paragraph ,Format/Paragraph / Text Flow
1284 '/// + Check "Keep with next paragraph"
1285 EditSearchAndReplace
1286 Kontext "FindAndReplace"
1287 SearchFor.SetText "He1"
1291 FindAndReplace.Close
1292 Call wTypeKeys "<Home>"
1293 Call fFormatParagraph("TabTextfluss")
1294 AbsaetzeZusammenhalten.Check
1298 if Not Navigator.Exists then ViewNavigator
1299 Kontext "NavigatorWriter"
1301 if Seitennummer.GetText <> "2" then warnlog "The head of the 1st paragraph should be in 2nd page !"
1304 'Get the head of 2nd paragarph's location
1305 EditSearchAndReplace
1306 Kontext "FindAndReplace"
1307 SearchFor.SetText "He2"
1311 FindAndReplace.Close
1314 if Not Navigator.Exists then ViewNavigator
1315 Kontext "NavigatorWriter"
1317 if Seitennummer.GetText <> "2" then warnlog "The head of the 2nd paragraph should be in 2nd page !"
1323 '--------------------------------------------------------------------------
1325 testcase tParagraphTextFlow11
1327 Dim sTestFile as String
1328 Dim sLines as String
1330 sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\formatparagraph\eightline.sxw")
1333 PrintLog "- Orphan control"
1334 '/// 'Orphan control
1338 '/// Open the test file
1339 '/// + There is 1 paragraph (8 lines) in the file
1340 Call hFileOpen(sTestFile)
1341 Call sMakeReadOnlyDocumentEditable
1343 '/// Format/Paragraph / Text Flow
1344 '/// + Check 'Orphan control' , set 3 in 'Lines'
1345 Call fFormatParagraph("TabTextfluss")
1346 Hurenkinderregelung.Check
1348 HurenkinderZeilen.SetText sLines
1351 '/// Press return 5 times to let only 3 lines are in 1st page
1352 Call wTypeKeys "<MOD1 Home>"
1353 Call wTypeKeys "<Return>" , 5
1355 '/// + check if the 1st line is in 1st page
1357 if Not Navigator.Exists then ViewNavigator
1358 Kontext "NavigatorWriter"
1360 if Seitennummer.GetText <> "1" then warnlog "The 1st line should be in 1st page!"
1363 '/// Press Return again
1364 Call wTypeKeys "<Return>"
1366 '/// + check if the 1st line is in 2nd page
1368 if Not Navigator.Exists then ViewNavigator
1369 Kontext "NavigatorWriter"
1371 if Seitennummer.GetText <> "2" then warnlog "The 1st line should be in 2nd page!"
1377 '--------------------------------------------------------------------------
1379 testcase tParagraphTextFlow12
1381 Dim sTestFile as String
1382 Dim sLines as String
1384 sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\formatparagraph\eightline.sxw")
1387 PrintLog "- Widow control"
1392 '/// Open the test file
1393 '/// + There is 1 paragraph (8 lines) in the file
1394 Call hFileOpen(sTestFile)
1395 Call sMakeReadOnlyDocumentEditable
1397 '/// Format/Paragraph / Text Flow
1398 '/// + Check 'Widow control' , set 3 in 'Lines'
1399 Call fFormatParagraph("TabTextfluss")
1400 Schusterjungenregelung.Check
1402 SchusterZeilen.SetText sLines
1405 '/// Press return to let the lastest line into 2nd page
1406 Call wTypeKeys "<MOD1 Home><Return>"
1408 '/// + check if the lastest 3rd line(6th line) is in 2nd page
1409 Call wTypeKeys "<Down>" , 5
1411 if Not Navigator.Exists then ViewNavigator
1412 Kontext "NavigatorWriter"
1414 if Seitennummer.GetText <> "2" then warnlog "The 6th line should be in 2nd page!"
1417 '/// + check if the 5th line is in 1st page
1418 Call wTypeKeys "<Up>"
1420 if Not Navigator.Exists then ViewNavigator
1421 Kontext "NavigatorWriter"
1423 if Seitennummer.GetText <> "1" then warnlog "The 5th line should be in 1st page!"
1429 '--------------------------------------------------------------------------
1431 testcase tParagraphTextFlow13
1433 Dim sTestFile as String
1436 sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\formatparagraph\specialHyphenation.sxw")
1438 PrintLog "- Special test for Hyphenation"
1439 '/// <b> 'Widow control </b> ///
1443 '/// Open the test file
1444 '/// + There is 1 word TABC in the end of the first line
1445 Call hFileOpen(sTestFile)
1446 Call sMakeReadOnlyDocumentEditable
1448 '/// Press spaces in the head of the first line , we hope
1449 '/// + the whole word - 'TABC' will go to 2nd line at one time
1451 Call wTypeKeys "<Home>"
1453 Call wTypeKeys "<End>"
1454 Call wTypeKeys "<Shift Left>"
1456 if GetClipboardText = "B" then
1457 QAErrorLog "#114094#"
1460 if GetClipboardText <> "C" then
1469 '--------------------------------------------------------------------------