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 2000, 2010 Oracle and/or its affiliates.
7 ' OpenOffice.org - a multi-platform office productivity suite
9 ' This file is part of OpenOffice.org.
11 ' OpenOffice.org is free software: you can redistribute it and/or modify
12 ' it under the terms of the GNU Lesser General Public License version 3
13 ' only, as published by the Free Software Foundation.
15 ' OpenOffice.org is distributed in the hope that it will be useful,
16 ' but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ' GNU Lesser General Public License version 3 for more details
19 ' (a copy is included in the LICENSE file that accompanied this code).
21 ' You should have received a copy of the GNU Lesser General Public License
22 ' version 3 along with OpenOffice.org. If not, see
23 ' <http://www.openoffice.org/license.html>
24 ' for a copy of the LGPLv3 License.
26 '/************************************************************************
28 '* owner : thorsten.bosbach@oracle.com
30 '* short description : Options - StarOffice - path settings
32 '\******************************************************************************
36 Dim lsPathOptions(50) as String
37 Dim lsDialtype(50) as String
38 Dim lsPaths(10,50) as String
39 Dim lsEntry(50) as String
40 Dim i, j, a as Integer
41 Dim sTTInputPath as String
42 dim iTypeOfDialog as integer
46 dim iCountOfDialogs(3) as integer
51 sTTInputPath = ConvertPath ( gOfficePath + "user\work" )
52 ' Name; which open dialog; Count of Paths
53 ' call GetPathList ( lsPathOptions (), lsDialtype (), lsEntry () )
54 ' which open dialog: 1: File Open; Else (2): Paths dialog
55 'call DumpPathList( lsPathOptions (), lsDialtype (), lsEntry () )
58 hToolsOptions("StarOffice", "Paths")
60 'reset everything to default; changes made in master.inc are undone for this test.
61 Typ.TypeKeys("<down><HOME>")
62 iTyp = Typ.getItemCount
64 warnlog "Unexpected count of File Types: should: " + 8 + "; is: " + iTyp
66 printlog "Count of Path Types: " + iTyp
72 qaerrorlog "Unexpected: No Standard"
74 Typ.TypeKeys( "<DOWN>" )
77 printlog("save settings")
87 aPath() = split(Typ.getItemText(i,2),";")
88 lsPathOptions(i) = sTyp
92 if active.exists(5) then
93 qaerrorlog "Active: " + active.getText
97 if OeffnenDlg.Exists(5) then
99 inc(iCountOfDialogs(1))
101 kontext "PfadeAuswaehlen"
102 if PfadeAuswaehlen.Exists(5) then
104 inc(iCountOfDialogs(2))
107 warnlog "No kind of File Dialog is open - exiting test"
113 lsDialtype(i) = iTypeOfDialog
114 select case iTypeOfDialog
115 case 1:' printlog( " - Dialogtype: FileOpen" )
117 if OeffnenDlg.Exists(2) then
118 lsPaths(1,i) = Pfad.GetSelText
120 Pfad.SetText sTTInputPath
124 qaErrorlog "Catch -1-?"
125 OeffnenDlg.typekeys("<MOD+S>")
127 printlog "" + i + "/1: " + right(lsPaths(1,i),10) + " : " + sTyp + " " + lsPaths(1,i)
129 warnlog "No Path dialog available"
131 case 2:' printlog( " - Dialogtype: PathDialog" )
132 kontext "PfadeAuswaehlen"
133 if PfadeAuswaehlen.Exists(2) then
135 iPaths = Pfade.GetItemCount
137 qaErrorLog "#i68646# Path Multilistbox is invisible to TestTool application"
143 if (2 <> iPaths) then
144 warnlog "Unexpected count of paths; Should: " + 2 + "; Is: " + iPaths
148 lsPaths(j,i) = Pfade.GetItemtext(j)
152 if OeffnenDlg.exists(5) then
153 Pfad.SetText sTTInputPath
154 lsPaths(iPaths+1,i) = sTTInputPath
159 OeffnenDlg.typekeys( "<MOD+S>" )
162 if active.exists(5) then
163 qaErrorLog "Active about already existsing path?: '" + active.getText + "' + '" + sTTInputPath + "'"
167 warnlog "No Path dialog available"
169 kontext "PfadeAusWaehlen"
171 printlog "" + i + "/"+iPaths+": " + right(lsPaths(1,i),10) + " : " + sTyp
172 printlog "" + i + "/-: " + right(lsPaths(2,i),10) + " : " + sTyp
174 warnlog "No Path dialog available"
176 case else: warnlog "Unexpected kind of Path dialog available"
179 ' double cross check of Paths in both dialogs
180 if (uBound(aPath()) <> (iTypeOfDialog-1)) then
181 qaErrorLog ("Sanity check failed.")
185 printlog "Path changed to, or added: '" + sTTInputPath + "'"
187 'Check if count of kinds of dialogs match
188 if iCountOfDialogs(1) <> 4 then
189 warnlog "Unexpected count of File Open Dialogs: should: " + 4 + "; is: " + iCountOfDialogs(1)
191 printlog "Count of File Open Dialogs: " + iCountOfDialogs(1)
193 if iCountOfDialogs(2) <> 4 then
194 warnlog "Unexpected count of File Open Dialogs: should: " + 4 + "; is: " + iCountOfDialogs(2)
196 printlog "Count of File Open Dialogs: " + iCountOfDialogs(2)
199 kontext "ExtrasOptionenDlg"
202 printlog("Exit/restart StarOffice")
204 printlog( "Check changes")
206 hToolsOptions ( "StarOffice", "Paths" )
209 ' It's a treelistbox with multiselection;
210 ' .select would select an additional item :-(
211 ' a lonely <home> wouldn't change the selction :-<
213 Typ.typeKeys("<down>")
215 Typ.typeKeys("<down>")
216 Typ.typeKeys("<Home>")
223 warnlog "Multiselection ?"
226 if active.exists(5) then
227 warnlog "#i72017# '"+active.getText+"'"
230 select case lsDialtype(i)
233 if OeffnenDlg.Exists(5) then
234 sTyp = Pfad.GetSelText
235 if (sTyp <> sTTInputPath) then
236 if (sTyp <> ( sTTInputPath + gPathSigne)) then
237 Warnlog "'" + lsPathOptions(i) + "' options is not saved! => must: '" + sTTInputPath + "' is: '" + sTyp +"'"
241 ' compute path's that were changed in TestStartUp (work and temp)
242 if ((Right(lsPaths(1,i),5)="work"+gPathSigne) OR (Right(lsPaths(1,i),4)="work")) then
243 Pfad.SetText(lsPaths(1,i))
248 if Standard.IsEnabled then
251 warnlog "Can't reset to standard"
256 kontext "PfadeAuswaehlen"
257 if PfadeAuswaehlen.exists (5) then
259 iPaths = Pfade.GetItemCount
265 if (lsPaths(j,i) <> Pfade.GetItemtext(j)) then
266 Warnlog "'" + lsPathOptions(i) + "': " + j + ". options is not saved! Path found: '" + Pfade.GetItemtext(j) + "'; expected: '" + lsPaths(j,i) +"'"
269 PfadeAuswaehlen.Cancel
273 if Standard.IsEnabled then
276 warnlog "Can't reset to standard"
278 case else: warnlog "Unexpected kind of file open dialog"
284 printlog("Reset to default ( with default-button )")
285 if gPlatgroup = "unx" then
286 hToolsOptions ( "StarOffice", "General" )
289 kontext "ExtrasOptionenDlg"
290 ExtrasOptionenDlg.OK()
292 printlog("Check the reset")
294 hToolsOptions ( "StarOffice", "Paths" )
297 Typ.TypeKeys "<Down>"
299 Typ.TypeKeys "<Down>"
300 Typ.TypeKeys "<Home>"
305 if active.exists(5) then
306 qaerrorlog active.getText
309 select case lsDialtype(i)
312 if OeffnenDlg.Exists(5) then
313 sTyp = Pfad.GetSelText
314 if (sTyp <> lsPaths(1,i)) then
315 Warnlog "'" + lsPathOptions(i) + "' options is not saved! => must: '" + lsPaths(1,i) + "' is: '" + sTyp +"'"
320 kontext "PfadeAuswaehlen"
321 if PfadeAuswaehlen.exists(5) then
323 iPaths = Pfade.GetItemCount
329 if (lsPaths(j,i) <> Pfade.GetItemtext(j)) then
330 Warnlog "'" + lsPathOptions(i) + "': " + j + ". options is not saved! Path found: '" + Pfade.GetItemtext(j) + "'; expected: '" + lsPaths(j,i) +"'"
333 PfadeAuswaehlen.Cancel
335 case else: warnlog "Unexpected kind of file open dialog"
340 if gPlatgroup = "unx" then
341 hToolsOptions ( "StarOffice", "General" )
344 kontext "ExtrasOptionenDlg"
346 printlog("Exit/restart StarOffice")