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_formatparagraph3.inc,v $
13 '* last change: $Author: vg $ $Date: 2008-08-18 12:29:37 $
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 - 3
38 '************************************************************************
40 ' #1 tParagraphTabs1 'Test Tab stops - Left
41 ' #1 tParagraphTabs2 'Test Tab stops - Right
42 ' #1 tParagraphTabs3 'Test Tab stops - Centered
43 ' #1 tParagraphTabs4 'Test Tab stops - Decimal
44 ' #1 tParagraphTabs5 'Delete a selected tab stop
45 ' #1 tParagraphTabs6 'Delete all tab stops
46 ' #1 tParagraphDropCaps1 'Test Drop Caps - Default
47 ' #1 tParagraphDropCaps2 'Test Drop Caps - select a word
48 ' #1 tParagraphDropCaps3 'Test Drop Caps - select different Number of characters
49 ' #1 tParagraphDropCaps4 'Test Drop Caps - select different number of Lines
50 ' #1 tParagraphDropCaps5 'Test Drop Caps - Set different 'Space to text'
51 ' #1 tParagraphDropCaps6 'Test max 'Space to text'
52 ' #1 tParagraphDropCaps7 'Test text in Contents "Text" field
53 ' #1 tParagraphDropCaps8 'Test 'Character Style' with given template
54 ' #1 tParagraphDropCaps9 'Test 'Character Style' with user-defined template
55 ' #1 tParagraphNumbering1 'Test Numbering
56 ' #1 tParagraphBorder1 'Test Default borders
57 ' #1 tParagraphBorder2 'All 'spacing to contents' spin boxes are limited to 5cm
58 ' #1 tParagraphBorder3 'Test Uncheck 'Synchronize'
59 ' #1 tParagraphBorder4 'Test check 'Synchronize'
60 ' #1 tParagraphBorder5 'Test default shadow color
61 ' #1 tParagraphBorder6 'Test shadow setting
63 '\***********************************************************************
65 testcase tParagraphTabs1
67 Dim sTestFile as String
69 Dim sPosition as String
71 sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\formatparagraph\TabsTest.sxw")
72 sTabs = "3" + gSeperator + "00" + gMeasurementUnit
73 sPosition = "5" + gSeperator + "00" + gMeasurementUnit
75 PrintLog "- Test Tab stops - Left"
76 '/// Test Tab stops - Left
80 '/// Open the test file
81 '/// + There is 1 pic which is anchored as character in the file
82 Call hFileOpen(sTestFile)
83 Call sMakeReadOnlyDocumentEditable
85 '/// Format/Paragraph / Tabs ,
86 '/// + check Left in the type area , and input 3cm in Position
87 Call fFormatParagraph("TabTabulatoren")
89 Position.SetText sTabs
92 Call wTypeKeys "<MOD1 Home>"
95 Call wTypeKeys "<TAB>"
97 '/// Check if TAB is configurated correctly
98 Call wTypeKeys ( "<Shift F4>" )
101 Call fPositionAndSize("TabPositionAndSizeWriter")
102 if fCalculateTolerance(Horizontalby.Gettext , sPosition) > 0.02 then Warnlog "Tab type (left) doesn't work !"
103 TabPositionAndSizeWriter.Cancel
109 '-------------------------------------------------------------------------------------------
111 testcase tParagraphTabs2
113 Dim sTestFile as String
115 Dim sPosition as String
117 sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\formatparagraph\TabsTest.sxw")
118 sTabs = "3" + gSeperator + "00" + gMeasurementUnit
119 sPosition = "4" + gSeperator + "00" + gMeasurementUnit
121 PrintLog "- Test Tab stops - Right"
122 '/// Test Tab stops - Right
126 '/// Open the test file
127 '/// + There is 1 pic which is anchored as character in the file
128 Call hFileOpen(sTestFile)
129 Call sMakeReadOnlyDocumentEditable
131 '/// Format/Paragraph / Tabs ,
132 '/// + check Right in the type area , and input 3cm in Position
133 Call fFormatParagraph("TabTabulatoren")
135 Position.SetText sTabs
138 Call wTypeKeys "<MOD1 Home>"
141 Call wTypeKeys "<TAB>"
143 '/// Check if TAB is configurated correctly
144 Call wTypeKeys ( "<Shift F4>" )
147 Call fPositionAndSize("TabPositionAndSizeWriter")
148 if fCalculateTolerance(Horizontalby.Gettext , sPosition) > 0.02 then Warnlog "Tab type (Right) doesn't work !"
149 TabPositionAndSizeWriter.Cancel
155 '-------------------------------------------------------------------------------------------
157 testcase tParagraphTabs3
159 Dim sTestFile as String
161 Dim sPosition as String
163 sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\formatparagraph\TabsTest.sxw")
164 sTabs = "3" + gSeperator + "00" + gMeasurementUnit
165 sPosition = "4" + gSeperator + "50" + gMeasurementUnit
167 PrintLog "- Test Tab stops - Centered"
168 '/// Test Tab stops - Centered
172 '/// Open the test file
173 '/// + There is 1 pic which is anchored as character in the file
174 Call hFileOpen(sTestFile)
175 Call sMakeReadOnlyDocumentEditable
177 '/// Format/Paragraph / Tabs ,
178 '/// + check Centered in the type area , and input 3cm in Position
179 Call fFormatParagraph("TabTabulatoren")
181 Position.SetText sTabs
184 Call wTypeKeys "<MOD1 Home>"
187 Call wTypeKeys "<TAB>"
189 '/// Check if TAB is configurated correctly
190 Call wTypeKeys ( "<Shift F4>" )
193 Call fPositionAndSize("TabPositionAndSizeWriter")
194 if fCalculateTolerance(Horizontalby.Gettext , sPosition) > 0.02 then Warnlog "Tab type (Centered) doesn't work !"
195 TabPositionAndSizeWriter.Cancel
201 '-------------------------------------------------------------------------------------------
203 testcase tParagraphTabs4
205 Dim sTestFile as String
207 Dim sPosition as String
209 sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\formatparagraph\TabsDecimal.sxw")
210 sTabs = "5" + gSeperator + "00" + gMeasurementUnit
211 sPosition = "7" + gSeperator + "11" + gMeasurementUnit
213 PrintLog "- Test Tab stops - Decimal"
214 '/// Test Tab stops - Decimal
218 '/// Open the test file
219 '/// + There is 1 pic which is anchored as character in the file ,
220 '/// + and there are 1 "." seperator in front of the pic
221 Call hFileOpen(sTestFile)
222 Call sMakeReadOnlyDocumentEditable
224 '/// Format/Paragraph / Tabs ,
225 '/// + check Decimal in the type area ,
226 '/// + input "." in 'character' and input 5cm in 'Position'
227 Call fFormatParagraph("TabTabulatoren")
230 TypZeichen.SetText "." 'I use seperator as '.' in this case
231 Position.SetText sTabs
234 Call wTypeKeys "<MOD1 Home>"
237 Call wTypeKeys "<TAB>"
239 '/// Check if TAB is configurated correctly
240 '/// + [Check . should be at distance 5.00cm]
241 Call wTypeKeys ( "<Shift F4>" )
244 Call fPositionAndSize("TabPositionAndSizeWriter")
245 if fCalculateTolerance(Horizontalby.Gettext , sPosition) > 0.03 then Warnlog "Tab type (Decimal) doesn't work !"
246 TabPositionAndSizeWriter.Cancel
252 '-------------------------------------------------------------------------------------------
254 testcase tParagraphTabs5
256 Dim sTab1 , sTab2 , sTab3 as String
258 sTab1 = "1" + gSeperator + "00" + gMeasurementUnit
259 sTab2 = "2" + gSeperator + "00" + gMeasurementUnit
260 sTab3 = "3" + gSeperator + "00" + gMeasurementUnit
262 PrintLog "- Delete a selected tab stop"
263 '/// Delete a selected tab stop
267 '/// Format/Paragraph / Tabs ,
268 '/// + insert 3 new tab stops
269 Call fFormatParagraph("TabTabulatoren")
270 Position.SetText sTab1
273 Position.SetText sTab2
276 Position.SetText sTab3
281 '/// Delete the selected tab stop
282 '/// + Select 2.00cm , and press delete key
283 Call fFormatParagraph("TabTabulatoren")
289 if Position.GetSelText <> sTab1 then warnlog "should get " &sTab1 & " but get " &Position.GetSelText
291 if Position.GetSelText <> sTab3 then warnlog "should get " &sTab3 & " but get " &Position.GetSelText
293 if Position.GetItemCount <> 2 then warnlog "should only be 2 items in the listbox !"
294 TabTabulatoren.Cancel
300 '-------------------------------------------------------------------------------------------
302 testcase tParagraphTabs6
304 Dim sTab1 , sTab2 , sTab3 as String
306 sTab1 = "1" + gSeperator + "00" + gMeasurementUnit
307 sTab2 = "2" + gSeperator + "00" + gMeasurementUnit
308 sTab3 = "3" + gSeperator + "00" + gMeasurementUnit
310 PrintLog "- Delete all tab stops"
311 '/// Delete all tab stops
315 '/// Format/Paragraph / Tabs ,
316 '/// + insert 3 new tab stops
317 Call fFormatParagraph("TabTabulatoren")
318 Position.SetText sTab1
321 Position.SetText sTab2
324 Position.SetText sTab3
329 '/// Delete all tab stops
330 '/// + Press 'Delete All' Key
331 Call fFormatParagraph("TabTabulatoren")
334 if Position.GetItemCount <> 0 then warnlog "should be no items in the listbox !"
335 TabTabulatoren.Cancel
341 '-------------------------------------------------------------------------------------------
343 testcase tParagraphDropCaps1
345 Dim sTestFile as String
346 Dim sPositionX as String
347 Dim sPositionY as String
349 sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\formatparagraph\DropCapsTest.sxw")
350 sPositionX = "4" + gSeperator + "00" + gMeasurementUnit
351 sPositionY = "3" + gSeperator + "00" + gMeasurementUnit
353 PrintLog "- Test Drop Caps - Default"
354 '/// Test Drop Caps - Default
358 '/// Open the test file
359 '/// + There is 1 pic which is anchored as character in the file
360 Call hFileOpen(sTestFile)
361 Call sMakeReadOnlyDocumentEditable
363 '/// Format/Paragraph / Drop Caps ,
364 '/// + Check 'Display Drop Caps' , close the dialog
365 Call fFormatParagraph("TabInitialen")
368 if Initialentext.GetText <> "H" then
369 warnlog "The text is wrong : should be H , but get " &Initialentext.GetText
373 if Zeilen.GetText <> "3" then
374 warnlog "The default number should be 3 lines , but get " &Zeilen.GetText
380 '/// Set focus to the pic , check if its position is changed correctly
381 Call wTypeKeys ( "<Shift F4>" )
384 Call fPositionAndSize("TabPositionAndSizeWriter")
385 if fCalculateTolerance(Horizontalby.Gettext , sPositionX) > 0.4 then Warnlog "X position isn't right !"
386 if fCalculateTolerance(Verticalby.Gettext , sPositionY) > 0.4 then Warnlog "Y position isn't right !"
387 TabPositionAndSizeWriter.Cancel
393 '-------------------------------------------------------------------------------------------
395 testcase tParagraphDropCaps2
397 Dim sTestFile as String
398 Dim sPositionX as String
399 Dim sPositionY as String
401 sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\formatparagraph\DropCapsTest.sxw")
402 sPositionX = "6" + gSeperator + "00" + gMeasurementUnit
403 sPositionY = "3" + gSeperator + "00" + gMeasurementUnit
405 PrintLog "- Test Drop Caps - select a word"
406 '/// Test Drop Caps - select a word
410 '/// Open the test file
411 '/// + There is 1 pic which is anchored as character in the file
412 Call hFileOpen(sTestFile)
413 Call sMakeReadOnlyDocumentEditable
415 '/// Format/Paragraph / Drop Caps ,
416 '/// + Check 'Display Drop Caps' , then check 'whole word' , then close the dialog
417 Call fFormatParagraph("TabInitialen")
422 if Initialentext.GetText <> "He" then
423 warnlog "The text is wrong : should be He , but get " &Initialentext.GetText
427 if Zeilen.GetText <> "3" then
428 warnlog "The default number should be 3 lines , but get " &Zeilen.GetText
434 '/// Set focus to the pic , check if its position is changed correctly
435 Call wTypeKeys ( "<Shift F4>" )
438 Call fPositionAndSize("TabPositionAndSizeWriter")
439 if fCalculateTolerance(Horizontalby.Gettext , sPositionX) > 0.4 then Warnlog "X position isn't right !"
440 if fCalculateTolerance(Verticalby.Gettext , sPositionY) > 0.4 then Warnlog "Y position isn't right !"
441 TabPositionAndSizeWriter.Cancel
447 '-------------------------------------------------------------------------------------------
449 testcase tParagraphDropCaps3
451 Dim sTestFile as String
452 Dim sPositionX as String
453 Dim sPositionY as String
455 sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\formatparagraph\DropCapsTest.sxw")
456 sPositionX = "4" + gSeperator + "50" + gMeasurementUnit
457 sPositionY = "4" + gSeperator + "00" + gMeasurementUnit
459 PrintLog "- Test Drop Caps - select different Number of characters"
460 '/// Test Drop Caps - select different Number of characters
464 '/// Open the test file
465 '/// + There is 1 pic which is anchored as character in the file
466 Call hFileOpen(sTestFile)
467 Call sMakeReadOnlyDocumentEditable
469 '/// Format/Paragraph / Drop Caps ,
470 '/// + Check 'Display Drop Caps' , then set '6' in 'number of characters' ,then close the dialog
471 Call fFormatParagraph("TabInitialen")
476 if Initialentext.GetText <> "He hea" then
477 warnlog "The text is wrong : should be 'He hea' , but get " &Initialentext.GetText
481 if Zeilen.GetText <> "3" then
482 warnlog "The default number should be 3 lines , but get " &Zeilen.GetText
488 '/// Set focus to the pic , check if its position is changed correctly
489 Call wTypeKeys ( "<Shift F4>" )
492 Call fPositionAndSize("TabPositionAndSizeWriter")
493 if fCalculateTolerance(Horizontalby.Gettext , sPositionX) > 0.4 then Warnlog "X position isn't right !"
494 if fCalculateTolerance(Verticalby.Gettext , sPositionY) > 0.4 then Warnlog "Y position isn't right !"
495 TabPositionAndSizeWriter.Cancel
501 '-------------------------------------------------------------------------------------------
503 testcase tParagraphDropCaps4
505 Dim sTestFile as String
506 Dim sPositionX as String
507 Dim sPositionY as String
509 sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\formatparagraph\DropCapsTest.sxw")
510 sPositionX = "7" + gSeperator + "50" + gMeasurementUnit
511 sPositionY = "2" + gSeperator + "80" + gMeasurementUnit
513 PrintLog "- Test Drop Caps - select different number of Lines"
514 '/// Test Drop Caps - select different number of Lines
518 '/// Open the test file
519 '/// + There is 1 pic which is anchored as character in the file
520 Call hFileOpen(sTestFile)
521 Call sMakeReadOnlyDocumentEditable
523 '/// Format/Paragraph / Drop Caps ,
524 '/// + Check 'Display Drop Caps' , then set '6' in 'Lines' ,then close the dialog
525 Call fFormatParagraph("TabInitialen")
530 if Initialentext.GetText <> "H" then
531 warnlog "The text is wrong : should be 'H' , but get " &Initialentext.GetText
537 '/// Set focus to the pic , check if its position is changed correctly
538 Call wTypeKeys ( "<Shift F4>" )
541 Call fPositionAndSize("TabPositionAndSizeWriter")
542 if fCalculateTolerance(Horizontalby.Gettext , sPositionX) > 0.5 then Warnlog "X position isn't right !"
543 if fCalculateTolerance(Verticalby.Gettext , sPositionY) > 0.5 then Warnlog "Y position isn't right !"
544 TabPositionAndSizeWriter.Cancel
550 '-------------------------------------------------------------------------------------------
552 testcase tParagraphDropCaps5
554 Dim sTestFile as String
556 Dim sPositionX as String
557 Dim sPositionY as String
559 sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\formatparagraph\DropCapsTest.sxw")
560 sSpace = "1" + gSeperator + "00" + gMeasurementUnit
561 sPositionX = "6" + gSeperator + "00" + gMeasurementUnit
562 sPositionY = "3" + gSeperator + "00" + gMeasurementUnit
564 PrintLog "- Test Drop Caps - Set different 'Space to text'"
565 '/// Test Drop Caps - Set different 'Space to text'
569 '/// Open the test file
570 '/// + There is 1 pic which is anchored as character in the file
571 Call hFileOpen(sTestFile)
572 Call sMakeReadOnlyDocumentEditable
574 '/// Format/Paragraph / Drop Caps ,
575 '/// + Check 'Display Drop Caps' ,then set 'Space to text' to be 1cm , close the dialog
576 Call fFormatParagraph("TabInitialen")
579 AbstandZumText.SetText sSpace
580 if Initialentext.GetText <> "H" then
581 warnlog "The text is wrong : should be H , but get " &Initialentext.GetText
585 if Zeilen.GetText <> "3" then
586 warnlog "The default number should be 3 lines , but get " &Zeilen.GetText
592 '/// Set focus to the pic , check if its position is changed correctly
593 Call wTypeKeys ( "<Shift F4>" )
596 Call fPositionAndSize("TabPositionAndSizeWriter")
597 if fCalculateTolerance(Horizontalby.Gettext , sPositionX) > 0.4 then Warnlog "X position isn't right !"
598 if fCalculateTolerance(Verticalby.Gettext , sPositionY) > 0.4 then Warnlog "Y position isn't right !"
599 TabPositionAndSizeWriter.Cancel
605 '-------------------------------------------------------------------------------------------
607 testcase tParagraphDropCaps6
609 Dim sSpace , sMaxSpace as String
611 sSpace = "3" + gSeperator + "00" + gMeasurementUnit
612 sSpace = "2" + gSeperator + "00" + gMeasurementUnit
614 PrintLog "- Test max 'Space to text'"
615 '/// Test max 'Space to text'
619 '/// Format/Paragraph / Drop Caps ,
620 '/// + Check 'Display Drop Caps' ,then set 'Space to text' to be 3cm , close the dialog
621 Call fFormatParagraph("TabInitialen")
624 AbstandZumText.SetText sSpace
628 '/// Reopen Format/Paragraph / Drop Caps ,
629 '/// + 'Space to text' should be 2cm
630 Call fFormatParagraph("TabInitialen")
631 if AbstandZumText.GetText <> sSpace then Warnlog "Max 'Space to text' should be 2cm!"
638 '-------------------------------------------------------------------------------------------
640 testcase tParagraphDropCaps7
642 Dim sTestFile as String
643 Dim sTestText as String
644 Dim sHopeResult as String
646 sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\formatparagraph\DropCapsTest.sxw")
648 sHopeResult = "Xyzhe"
650 PrintLog "- Test text in Contents 'Text' field"
651 '/// Test text in Contents "Text" field
655 '/// Open the test file
656 '/// + There is 1 pic which is anchored as character in the file
657 Call hFileOpen(sTestFile)
658 Call sMakeReadOnlyDocumentEditable
660 '/// Format/Paragraph / Drop Caps ,
661 '/// + Check 'Display Drop Caps' ,then set Xyz in Contents 'Text' field , close the dialog
662 Call fFormatParagraph("TabInitialen")
665 Initialentext.SetText sTestText
669 '/// Check if the head of the artile is changed to be "Xyzhe"
670 Call wTypeKeys "<MOD1 Home>"
671 Call wTypeKeys "<Shift Right>" , 5
674 if GetClipboardText <> sHopeResult then
675 warnlog "Get the wrong result : " & GetClipboardText
682 '-------------------------------------------------------------------------------------------
684 testcase tParagraphDropCaps8
686 Dim iCharacterStyle as Integer
690 PrintLog "- Test 'Character Style' with given template"
691 '/// Test 'Character Style' with given template
695 '/// Format/Paragraph / Drop Caps ,
696 '/// + Check 'Display Drop Caps' ,then select 3rd in Contents 'Character Style' field , close the dialog
697 Call fFormatParagraph("TabInitialen")
700 Zeichenvorlage.Select iCharacterStyle
704 '/// Check if the set is OK
705 Call fFormatParagraph("TabInitialen")
706 if Zeichenvorlage.GetSelIndex <> iCharacterStyle then
707 warnlog "Get the wrong result : " & iCharacterStyle
715 '-------------------------------------------------------------------------------------------
717 testcase tParagraphDropCaps9
719 Dim sCharacterStyle as String
722 sCharacterStyle = "aNewTestStyle"
724 PrintLog "- Test 'Character Style' with user-defined template"
725 '/// Test 'Character Style' with user-defined template
729 '/// Make a user-defined template
730 '/// Stylist , select 'Character Styles'
731 '/// Press New button to add a new character style
732 Call wStyleCreate ( sCharacterStyle, "Character" )
734 '/// Format/Paragraph / Drop Caps ,
735 '/// + Check 'Display Drop Caps' ,then select the character style which you just inserted
736 '/// + in Contents 'Character Style' field , close the dialog
737 Call fFormatParagraph("TabInitialen")
740 Zeichenvorlage.Select sCharacterStyle
744 '/// Check if the set is OK
745 Call fFormatParagraph("TabInitialen")
746 if Zeichenvorlage.GetSelText <> sCharacterStyle then
747 Warnlog "Get the wrong result : " & Zeichenvorlage.GetSelText
752 Call wStyleDelete( sCharacterStyle, "Character" )
758 '-------------------------------------------------------------------------------------------
760 testcase tParagraphNumbering1
762 Dim sTestFile as String
763 Dim sTest1 , sTest2 as String
764 Dim iNumberingStyle1 as Integer
765 Dim sNumberingStartWith1 as String
766 Dim sLineNumberingStartWith1 as String
767 Dim iNumberingStyle2 as Integer
768 Dim sNumberingStartWith2 as String
769 Dim sLineNumberingStartWith2 as String
771 sTestFile = Convertpath (gTesttoolpath + "writer\optional\input\formatparagraph\paragraphNumbering.sxw")
774 sNumberingStartWith1 = "2"
775 sLineNumberingStartWith1 = "3"
778 sNumberingStartWith2 = "4"
779 sLineNumberingStartWith2 = "5"
781 PrintLog "- Test Numbering"
786 '/// Open the test file ,
787 '/// + there are 2 paragraphes in the file
788 Call hFileOpen(sTestFile)
789 Call sMakeReadOnlyDocumentEditable
791 '/// Find the test word , set the focus to 1st paragraph
792 Call fFindWord( sTest1 )
794 '/// Format/Paragraph / Numbering , select 3rd in Numbering Style ,
795 '/// + Check "Restart at this paragraph" ,
796 '/// + check "Start with" in Numbering area , input 2
797 '/// + check "include this paragraph in line numbering" ,
798 '/// + check "Restart at this paragraph" in Line numbering area ,
799 '/// + check "Start with" in Line Numbering area , input 3
800 Call fFormatParagraph("TabNumerierungAbsatz")
801 Vorlage.Select iNumberingStyle1
803 NumerierungNeuBeginnen.Check
807 NumerierungBeginnenBei.SetText sNumberingStartWith1
808 ZeilenumerierungZeilenMitzaehlen.Check
810 ZeilenumerierungNeuBeginnen.Check
812 ZeilenumerierungBeginnenBei.SetText sLineNumberingStartWith1
813 TabNumerierungAbsatz.OK
815 '/// Find the test word , set the focus to 2nd paragraph
816 Call fFindWord( sTest2 )
818 '/// Format/Paragraph / Numbering , select 8th in Numbering Style ,
819 '/// + Check "Restart at this paragraph" ,
820 '/// + check "Start with" in Numbering area , input 4
821 '/// + check "include this paragraph in line numbering" ,
822 '/// + check "Restart at this paragraph" in Line numbering area ,
823 '/// + check "Start with" in Line Numbering area , input 5
824 Call fFormatParagraph("TabNumerierungAbsatz")
825 Vorlage.Select iNumberingStyle2
827 NumerierungNeuBeginnen.Check
831 NumerierungBeginnenBei.SetText sNumberingStartWith2
832 ZeilenumerierungZeilenMitzaehlen.Check
834 ZeilenumerierungNeuBeginnen.Check
836 ZeilenumerierungBeginnenBei.SetText sLineNumberingStartWith2
837 TabNumerierungAbsatz.OK
839 '/// Check if the configuration in paragraph1 is correct
840 PrintLog "- Check if the configuration in paragraph1 is correct"
841 Call fFindWord( sTest1 )
843 Call fFormatParagraph("TabNumerierungAbsatz")
844 if Vorlage.GetSelIndex <> iNumberingStyle1 then
845 Warnlog "The numbering Style is wrong , get " & Vorlage.GetSelIndex
847 if NumerierungNeuBeginnen.IsChecked <> TRUE then
848 Warnlog "'Restart at this paragraph' should be checked !"
850 if StartWith.IsChecked <> TRUE then
851 Warnlog "'Start with' in Numbering area should be checked !"
853 if NumerierungBeginnenBei.GetText <> sNumberingStartWith1 then
854 Warnlog "'Start with' in Numbering area is wrong , get " & NumerierungBeginnenBei.GetText
856 if ZeilenumerierungZeilenMitzaehlen.IsChecked <> TRUE then
857 Warnlog "'include this paragraph in line numbering' should be checked!"
859 if ZeilenumerierungNeuBeginnen.IsChecked <> TRUE then
860 Warnlog "'Restart at this paragraph' in Line numbering area should be checked!"
862 if ZeilenumerierungBeginnenBei.GetText <> sLineNumberingStartWith1 then
863 Warnlog "'Restart at this paragraph' in Line numbering area is wrong , get " & ZeilenumerierungBeginnenBei.GetText
865 TabNumerierungAbsatz.Cancel
867 '/// Check if the configuration in paragraph2 is correct
868 PrintLog "- Check if the configuration in paragraph2 is correct"
869 Call fFindWord( sTest2 )
871 Call fFormatParagraph("TabNumerierungAbsatz")
872 if Vorlage.GetSelIndex <> iNumberingStyle2 then
873 Warnlog "The numbering Style is wrong , get " & Vorlage.GetSelIndex
875 if NumerierungNeuBeginnen.IsChecked <> TRUE then
876 Warnlog "'Restart at this paragraph' should be checked !"
878 if StartWith.IsChecked <> TRUE then
879 Warnlog "'Start with' in Numbering area should be checked !"
881 if NumerierungBeginnenBei.GetText <> sNumberingStartWith2 then
882 Warnlog "'Start with' in Numbering area is wrong , get " & NumerierungBeginnenBei.GetText
884 if ZeilenumerierungZeilenMitzaehlen.IsChecked <> TRUE then
885 Warnlog "'include this paragraph in line numbering' should be checked!"
887 if ZeilenumerierungNeuBeginnen.IsChecked <> TRUE then
888 Warnlog "'Restart at this paragraph' in Line numbering area should be checked!"
890 if ZeilenumerierungBeginnenBei.GetText <> sLineNumberingStartWith2 then
891 Warnlog "'Restart at this paragraph' in Line numbering area is wrong , get " & ZeilenumerierungBeginnenBei.GetText
893 TabNumerierungAbsatz.Cancel
899 '-------------------------------------------------------------------------------------------
901 testcase tParagraphBorder1
903 Dim sSpacingToContentsNoBorder as String 'no border in the page
904 Dim sSpacingToContentsYesBorder as String 'border exists in the page
906 sSpacingToContentsNoBorder = "0" + gSeperator + "00" + gMeasurementUnit
907 sSpacingToContentsYesBorder = "0" + gSeperator + "05" + gMeasurementUnit
909 PrintLog "Test Default borders"
910 '/// <b> Test Default borders </b> ///
912 PrintLog "- when no border is set, 'spacing to contents'"
913 '/// 1. When no border is set ///
917 '/// Check if "spacing to contents" is unable ///
918 '/// format/Paragraph , tabpage borders
919 Call fFormatParagraph("TabUmrandung")
920 if Links.GetText <> sSpacingToContentsNoBorder then
921 Warnlog "Default of left Spacing to contents is wrong !"
923 if Rechts.GetText <> sSpacingToContentsNoBorder then
924 Warnlog "Default of right Spacing to contents is wrong !"
926 if Oben.GetText <> sSpacingToContentsNoBorder then
927 Warnlog "Default of up Spacing to contents is wrong !"
929 if Unten.GetText <> sSpacingToContentsNoBorder then
930 Warnlog "Default of bottom Spacing to contents is wrong !"
934 PrintLog "Check if 'spacing to contents' is 0.05cm when there are borders in the paragraph"
935 '/// 2. Check if "spacing to contents" is 0.05cm when there are borders in the paragraph ///
936 '/// format/Paragraph , tabpage borders ///
937 '/// + select 2nd in Default area ///
938 Call fFormatParagraph("TabUmrandung")
939 Vorgaben.TypeKeys "<Right>" , 2
942 if Links.GetText <> sSpacingToContentsYesBorder then
943 Warnlog "Default of left Spacing to contents is wrong !"
945 if Rechts.GetText <> sSpacingToContentsYesBorder then
946 Warnlog "Default of right Spacing to contents is wrong !"
948 if Oben.GetText <> sSpacingToContentsYesBorder then
949 Warnlog "Default of up Spacing to contents is wrong !"
951 if Unten.GetText <> sSpacingToContentsYesBorder then
952 Warnlog "Default of bottom Spacing to contents is wrong !"
960 '-------------------------------------------------------------------------------------------
962 testcase tParagraphBorder2
964 Dim sSpacingToContents as String 'the max spacing to content
965 Dim sSpacingToContentsL as String
966 Dim sSpacingToContentsR as String
967 Dim sSpacingToContentsU as String
968 Dim sSpacingToContentsB as String
970 sSpacingToContents = "5" + gSeperator + "00" + gMeasurementUnit
971 sSpacingToContentsL = "6" + gSeperator + "00" + gMeasurementUnit
972 sSpacingToContentsR = "7" + gSeperator + "00" + gMeasurementUnit
973 sSpacingToContentsU = "8" + gSeperator + "00" + gMeasurementUnit
974 sSpacingToContentsB = "9" + gSeperator + "00" + gMeasurementUnit
976 PrintLog "- All 'spacing to contents' spin boxes are limited to 5cm"
977 '///<b> All "spacing to contents" spin boxes are limited to 5cm </b>///
981 '/// format/Page , tabpage borders , ///
982 '/// + set border exists in the paragraph ///
983 '/// + set all spacing to content's size ///
984 '/// + more than 5.00cm ///
985 Call fFormatParagraph("TabUmrandung")
986 Vorgaben.TypeKeys "<Right>" , 2
988 Synchronisieren.Uncheck
990 Links.SetText sSpacingToContentsL
991 Rechts.SetText sSpacingToContentsR
992 Oben.SetText sSpacingToContentsU
993 Unten.SetText sSpacingToContentsB
996 '/// Check if all "spacing to contents" is 5.00cm ///
997 Call fFormatParagraph("TabUmrandung")
998 if Links.GetText <> sSpacingToContents then
999 Warnlog "left Spacing to contents is wrong !"
1001 if Rechts.GetText <> sSpacingToContents then
1002 Warnlog "right Spacing to contents is wrong !"
1004 if Oben.GetText <> sSpacingToContents then
1005 Warnlog "up Spacing to contents is wrong !"
1007 if Unten.GetText <> sSpacingToContents then
1008 Warnlog "bottom Spacing to contents is wrong !"
1016 '-------------------------------------------------------------------------------------------
1018 testcase tParagraphBorder3
1020 Dim sSpacingToContentsL as String
1021 Dim sSpacingToContentsR as String
1022 Dim sSpacingToContentsU as String
1023 Dim sSpacingToContentsB as String
1025 sSpacingToContentsL = "0" + gSeperator + "50" + gMeasurementUnit
1026 sSpacingToContentsR = "0" + gSeperator + "60" + gMeasurementUnit
1027 sSpacingToContentsU = "0" + gSeperator + "70" + gMeasurementUnit
1028 sSpacingToContentsB = "0" + gSeperator + "80" + gMeasurementUnit
1030 PrintLog "- Test Uncheck 'Synchronize'"
1031 '///<b> Test Uncheck 'Synchronize' </b>///
1035 '/// format/Page , tabpage borders , ///
1036 '/// + set border exists in the paragraph ///
1037 '/// + Uncheck synchronize ///
1038 '/// + Set all spacing to contents ///
1039 Call fFormatParagraph("TabUmrandung")
1040 Vorgaben.TypeKeys "<Right>" , 2
1042 Synchronisieren.Uncheck
1044 Links.SetText sSpacingToContentsL
1045 Rechts.SetText sSpacingToContentsR
1046 Oben.SetText sSpacingToContentsU
1047 Unten.SetText sSpacingToContentsB
1050 '/// + Check if all "spacing to contents" is correct
1051 Call fFormatParagraph("TabUmrandung")
1052 if Links.GetText <> sSpacingToContentsL then
1053 Warnlog "left Spacing to contents is wrong !"
1055 if Rechts.GetText <> sSpacingToContentsR then
1056 Warnlog "right Spacing to contents is wrong !"
1058 if Oben.GetText <> sSpacingToContentsU then
1059 Warnlog "up Spacing to contents is wrong !"
1061 if Unten.GetText <> sSpacingToContentsB then
1062 Warnlog "bottom Spacing to contents is wrong !"
1070 '-------------------------------------------------------------------------------------------
1072 testcase tParagraphBorder4
1074 Dim sSpacingToContentsL as String
1075 Dim sSpacingToContentsR as String
1076 Dim sSpacingToContentsU as String
1077 Dim sSpacingToContentsB as String
1079 sSpacingToContentsL = "0" + gSeperator + "50" + gMeasurementUnit
1080 sSpacingToContentsR = "0" + gSeperator + "60" + gMeasurementUnit
1081 sSpacingToContentsU = "0" + gSeperator + "70" + gMeasurementUnit
1082 sSpacingToContentsB = "0" + gSeperator + "80" + gMeasurementUnit
1084 PrintLog "- Test Check 'Synchronize'"
1085 '/// <b> Test Check 'Synchronize' </b> ///
1089 '/// format/Page , tabpage borders , ///
1090 '/// + set border exists in the paragraph ///
1091 '/// + check synchronize ///
1092 '/// + Set all spacing to contents ///
1093 Call fFormatParagraph("TabUmrandung")
1094 Vorgaben.TypeKeys "<Right>" , 2
1096 Synchronisieren.Check
1098 Links.SetText sSpacingToContentsL
1099 Rechts.SetText sSpacingToContentsR
1100 Oben.SetText sSpacingToContentsU
1101 Unten.SetText sSpacingToContentsB
1104 '/// + Check if all "spacing to contents" is correct
1105 Call fFormatParagraph("TabUmrandung")
1106 if Links.GetText <> sSpacingToContentsB then
1107 Warnlog "left Spacing to contents is wrong !"
1109 if Rechts.GetText <> sSpacingToContentsB then
1110 Warnlog "right Spacing to contents is wrong !"
1112 if Oben.GetText <> sSpacingToContentsB then
1113 Warnlog "up Spacing to contents is wrong !"
1115 if Unten.GetText <> sSpacingToContentsB then
1116 Warnlog "bottom Spacing to contents is wrong !"
1124 '-------------------------------------------------------------------------------------------
1126 testcase tParagraphBorder5
1128 Dim sDefaultShadowColor as String
1130 Select case iSprache
1131 case 01 : sDefaultShadowColor = "Gray"
1132 case 31: sDefaultShadowColor = "Grijs"
1133 case 33 : sDefaultShadowColor = "Gris"
1134 case 34 : sDefaultShadowColor = "Gris"
1135 case 39 : sDefaultShadowColor = "Grigio"
1136 case 46 : sDefaultShadowColor = "Grått"
1137 case 49 : sDefaultShadowColor = "Grau"
1138 case 55 : sDefaultShadowColor = "Cinza"
1139 case 81 : sDefaultShadowColor = "灰色"
1140 case 82 : sDefaultShadowColor = "회색"
1141 case 86 : sDefaultShadowColor = "灰色"
1142 case 88 : sDefaultShadowColor = "灰色"
1143 case else : QAErrorLog "The test does not support the language " + iSprache
1147 PrintLog "- Test default shadow color"
1148 '/// <b> Test default shadow color </b>///
1152 '/// + format/Paragraph , tabpage borders
1153 '/// + Check if the default shadow color is gray
1154 Call fFormatParagraph("TabUmrandung")
1155 if SchattenFarbe.GetSelText <> sDefaultShadowColor then
1156 Warnlog "Shadow default color is wrong , get " & SchattenFarbe.GetSelText
1164 '-------------------------------------------------------------------------------------------
1166 testcase tParagraphBorder6
1168 Dim iBorderColor , iShadowColor as Integer
1169 Dim sShadowDistance as String
1171 iBorderColor = 5 : iShadowColor = 4
1172 sShadowDistance = "0" + gSeperator + "40" + gMeasurementUnit
1174 PrintLog "- Test shadow setting"
1175 '/// <b> Test shadow setting </b>///
1179 '/// Format/Paragraph , tabpage borders , do some configuration => ///
1180 '/// + select 2nd border in default , select 5th border color ,///
1181 '/// + select 5th shadow , select 4th shadow color , set shadow distance to 0.40cm ///
1182 '/// + and close the dialog ///
1183 Call fFormatParagraph("TabUmrandung")
1184 Vorgaben.TypeKeys "<Right>" , 2
1186 StilFarbe.Select iBorderColor 'set border color
1187 Position.TypeKeys "<Right>" , 4
1189 Groesse.SetText sShadowDistance
1190 SchattenFarbe.Select iShadowColor 'set shadow color
1194 '/// + format/Page , check if the configuration is all right
1195 Call fFormatParagraph("TabUmrandung")
1196 if StilFarbe.GetSelIndex <> iBorderColor then Warnlog "border color is wrong !"
1197 if Groesse.GetText <> sShadowDistance then Warnlog "shadow distance is wrong !"
1198 if SchattenFarbe.GetSelindex <> iShadowColor then Warnlog "shadow color is wrong !"