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: c_print_scale.inc,v $
13 '* last change: $Author: jsi $ $Date: 2008-06-16 08:05:52 $
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 : oliver.craemer@sun.com
36 '* short description : Check correct print scaling settings
38 '*************************************************************************************************
43 '\*************************************************************************************************
45 printLog Chr(13) + "--------- Print scaling settings ----------"
50 '*************************************************************************************************
51 testcase tPrintScaling
52 printlog "Check correct print scaling settings"
57 dim sOutputFile as STRING
58 sOutputFile = gOfficePath & ConvertPath( "user\work\printScaling.ods" )
60 dim sNameSheet1 as STRING
62 dim sNameSheet2 as STRING
64 dim sNameSheet3 as STRING
67 dim sNameStyle1 as STRING
68 sNameStyle1 = "1stStyle"
69 dim sNameStyle2 as STRING
70 sNameStyle2 = "2ndStyle"
71 dim sNameStyle3 as STRING
72 sNameStyle3 = "3rdStyle"
74 dim sPagesToPrint as STRING
76 printlog "Open test document"
80 printlog "Add minimal content to all sheets"
82 Kontext "RechenleisteCalc"
83 if not RechenleisteCalc.isvisible then
84 ViewToolbarsFormulaBar
87 printlog "* Create simple data area on sheet" & iIndex
88 Kontext "RechenleisteCalc"
89 Bereich.TypeKeys "<MOD1 A>"
91 Bereich.TypeKeys "A1:B2"
92 printlog "* Type 'A1:B2' in Name Box to select area"
94 Bereich.TypeKeys "A1:AF400"
95 printlog "* Type 'A1:AF400' in Name Box to select area"
98 printlog "* Press <RETURN>"
99 Bereich.TypeKeys "<RETURN>"
100 Kontext "DocumentCalc"
101 printlog "* Fill area with '13' by typing 13<SHIFT MOD1 RETURN>"
102 DocumentCalc.TypeKeys "=13<SHIFT MOD1 RETURN>"
104 printlog "* Assign specific name for sheet to avoid language dependencies by Format - Sheet - Rename"
106 Kontext "TabelleUmbenennen"
108 case 1 : Tabellenname.SetText sNameSheet1
109 case 2 : Tabellenname.SetText sNameSheet2
110 case 3 : Tabellenname.SetText sNameSheet3
115 printlog "* Switch to next sheet by Edit - Sheet - Select"
117 Kontext "SelectSheets"
119 printlog "* At the end return to the first sheet"
120 SheetSelectionBox.Select sNameSheet1
122 SheetSelectionBox.Select ( iIndex + 1 )
128 printlog "Invoke Style catalog"
130 Kontext "Vorlagenkatalog"
131 printlog "Switch to Pagestyles"
132 Vorlagen.select ( 2 )
134 printlog "Create three styles using different page scaling features"
136 Kontext "Vorlagenkatalog"
137 printlog "* Click new"
140 printlog "* (Page format dialog should appear)"
141 printlog "* Select Page 'Organizer'"
142 active.SetPage TabVerwalten
143 printlog "* Close MsgBox when appeared"
144 if Active.Exists(2) then
145 if Active.GetRT = 304 then
146 Printlog Active.GetText
150 Kontext "TabVerwalten"
151 printlog "* Assign name for each style"
153 case 1 : VorlagenName.setText sNameStyle1
154 case 2 : VorlagenName.setText sNameStyle2
155 case 3 : VorlagenName.setText sNameStyle3
158 printlog "* Select Page 'Sheet'"
159 active.SetPage TabTabelleCalc
160 Kontext "TabTabelleCalc"
161 printlog "* For all three styles use different page scaling features"
162 scalingMode.Select ( iIndex )
164 case 1 : SkalierungProzent.setText "444%"
165 printlog "* Scale size to 444%"
166 printlog "* NOTE: Maximum scale is 400%! Entering 444% should be decreased to 400%."
167 case 2 : ScalePageWidth.setText "3"
168 ScalePageHeight.setText "3"
169 printlog "* Scale output to 3 pages wide and 3 pages high"
170 case 3 : AnzahlMaxSeiten.setText "4"
171 printlog "* Scale output to a total of 4 pages"
173 printlog "* Leave page format dialog using OK"
176 printlog "Close style catalog using OK"
177 Kontext "Vorlagenkatalog"
180 printlog "Assign the three styles created to the three sheets in document"
182 printlog "* Select sheet" & iIndex & " by Edit - Sheet - Select"
184 Kontext "SelectSheets"
185 SheetSelectionBox.Select ( iIndex )
188 printlog "* Open the stylist if it is not opened"
190 if NOT Gestalter.exists(2) then
193 printlog "* Assign style" & iIndex & " using the stylist"
196 Kontext "Vorlagenliste"
197 Vorlagenliste.TypeKeys "<HOME>"
199 Vorlagenliste.Select ( iIndex )
200 Vorlagenliste.TypeKeys "<RETURN>"
202 printlog "Close stylist"
204 if Gestalter.exists(2) then
208 printlog "Save in current default format"
209 if hFileSaveAsWithFilterKill ( sOutputFile , "calc8" ) = FALSE then
210 warnlog "Saving " & sOutputFile & " failed! -> Exiting test!"
213 printlog "... and close"
216 printlog "Reopen document"
217 call hFileOpen ( sOutputFile )
219 printlog "Invoke File - Print"
223 printlog "Check if a MsgBox pops up due to misconfigured printer settings"
224 if Active.Exists(2) then
225 if Active.GetRT = 304 then
226 qaErrorlog "OOPS, are you sure that a printer is configured at all?"
234 printlog "Check if print dialog exists"
236 if DruckenDlg.Exists(2) then
238 printlog "Check for string '1-12' in pages textbox"
239 sPagesToPrint = SeitenText.getText
240 if sPagesToPrint = "1-12" then
241 printlog " OK, expected number of pages for output"
243 warnlog "Unexpected number of pages for print output: " & sPagesToPrint & " -> Check this out!"
247 qaErrorlog "OOPS, are you sure that a printer is configured at all?"
249 printlog "For all sheets ..."
251 printlog "* ... select currently desired one"
253 Kontext "SelectSheets"
254 SheetSelectionBox.Select ( iIndex )
257 printlog "* Invoke Format - Page..."
260 printlog "* Select Page 'Sheet'"
261 active.SetPage TabTabelleCalc
262 printlog "* Close MsgBox when appeared"
263 if Active.Exists(2) then
264 if Active.GetRT = 304 then
265 Printlog Active.GetText
269 Kontext "TabTabelleCalc"
270 if scalingMode.GetSelIndex = iIndex then
271 printlog "* Check if styles for print scaling have be appropriately assign"
274 if SkalierungProzent.GetText <> "400%" then
275 warnlog "Unexpected scaling factor detected -> Check this out!"
277 printlog "* Correct scaling mode selected"
279 if ScalePageWidth.GetText <> "3" then
280 warnlog "Unexpected page width detected -> Check this out!"
282 if ScalePageHeight.GetText <> "3" then
283 warnlog "Unexpected page height detected -> Check this out!"
285 printlog "* Correct scaling mode selected"
287 if AnzahlMaxSeiten.GetText <> "4" then
288 warnlog "Unexpected page height detected -> Check this out!"
290 printlog "* Correct scaling mode selected"
293 warnlog "Unexpected scaling mode found -> Check this out!"
295 printlog "* Quit dialog"
296 TabTabelleCalc.Cancel
298 printlog "Close document"