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: t_option.inc,v $
13 '* last change: $Author: jsi $ $Date: 2008-06-13 10:27:10 $
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 : thorsten.bosbach@sun.com
36 '* short description : General option test (sub-routines for options tests)
38 '\******************************************************************************
40 function hToolsOptions ( Applicationname as string, Tabpagename as string, OPTIONAL bSilent as Boolean ) as Boolean
42 const CFN = "global::tools::includes::required::t_option.inc:"
44 Dim bCorPage as Boolean
47 Dim InitialNodeCount as Integer ' All nodes collapsed
48 Dim CurrentNodeCount as Integer ' Number of nodes when a top node is expanded
49 Dim iCurrentPage as Integer ' Increment variable for stepping through the nodes
50 Dim startpos as integer
52 Applicationname = ucase( Applicationname )
53 Tabpagename = ucase( Tabpagename )
55 '///<i>hToolsOptions</i>: Routine to select the correct option page
56 '///+<u>input</u>: The groupname as string, name of optionpage as string
57 '///+<u>note</u>: The options dialog has to be opened
58 '///+<u>OPTIONAL</u>: TRUE as an additional parameter if you want a printlog instead of a warning if a page has not been found.
60 if IsMissing(bSilent) then
66 if Active.Exists(1) then Active.OK
68 if Active.Exists(1) then Active.No
71 '///+<ul><li>"StarOffice"</li>
72 '///+<li>"LoadSave"</li>
73 '///+<li>"LanguageSettings"</li>
74 '///+<li>"Internet"</li>
75 '///+<li>"Textdocument"</li>
76 '///+<li>"HTMLDocument"</li>
77 '///+<li>"Spreadsheet"</li>
78 '///+<li>"Presentation"</li>
79 '///+<li>"Drawing"</li>
80 '///+<li>"Formula"</li>
81 '///+<li>"Chart"</li>
82 '///+<li>"Datasource"</li></ul>
83 Kontext "ExtrasOptionenDlg"
85 if ExtrasOptionenDlg.Exists then
86 Optionsliste.TypeKeys "<HOME>"
87 for iCurrentPage = 1 to 12+1
88 Optionsliste.TypeKeys "-<DOWN>"
90 'Optionsliste.TypeKeys "<HOME>"
91 InitialNodeCount = Optionsliste.GetItemCount
92 select case Applicationname
93 case "STAROFFICE" : startpos = 1
94 case "LOADSAVE" : startpos = 2
95 case "LANGUAGESETTINGS" : startpos = 3
96 case "WRITER" : startpos = 4
97 case "MASTERDOCUMENT" : startpos = 4
98 case "HTML" : startpos = 5
99 case "CALC" : startpos = 4
100 case "IMPRESS" : startpos = 4
101 case "DRAW" : startpos = 4
102 case "MATH" : startpos = 4
103 case "DATASOURCES" : startpos = InitialNodeCount -2
104 case "CHART" : startpos = InitialNodeCount -1
105 case "INTERNET" : startpos = InitialNodeCount ' always the last one
107 warnlog( CFN & "Invalid Application name specified: " & Applicationname )
108 printlog( "Valid options are:" )
109 printlog( "gApplications: WRITER, CALC, MASTERDOCUMENT, DRAW, IMPRESS, HTML, MATH, CHART" )
110 printlog( "additionally.: STAROFFICE, LOADSAVE, LANGUAGESETTINGS, DATASOURCES, INTERNET" )
111 printlog( "All names must be uppercase" )
115 Optionsliste.select Startpos
116 Optionsliste.typekeys "+"
117 CurrentNodeCount = Optionsliste.GetItemCount
119 for iCurrentPage = 1 to CurrentNodeCount - InitialNodeCount
121 Kontext "ExtrasOptionenDlg"
122 Optionsliste.TypeKeys "<DOWN>"
123 WaitSlot() ' Some sort of NOOP
124 select case Applicationname
126 '///Pages in group "StarOffice"are:
127 '///+<ul><li>"UserData"</li>
128 '///+<li>"General"</li>
129 '///+<li>"Memory"</li>
130 '///+<li>"View"</li>
131 '///+<li>"Print"</li>
132 '///+<li>"Paths"</li>
133 '///+<li>"Colors"</li>
134 '///+<li>"FontReplacement"</li>
135 '///+<li>"Security"</li>
136 '///+<li>"Appearence"</li>
137 '///+<li>"Accessibility"</li>
138 '///+<li>"Java"</li></ul>
139 select case Tabpagename
141 Kontext "TabBenutzerdaten"
142 if TabBenutzerdaten.exists then bCorPage = TRUE
144 if bFirst = TRUE then Optionsliste.Select ( startpos + 2 )
146 Kontext "TabSonstigesAllgemein"
147 If TabSonstigesAllgemein.exists(2) then bCorPage = TRUE
149 if bFirst = TRUE then Optionsliste.Select ( startpos + 3 )
152 If TabMemory.exists(2) then bCorPage = TRUE
154 if bFirst = TRUE then Optionsliste.Select ( startpos + 4 )
156 Kontext "TabAnsichtAllgemein"
157 If TabAnsichtAllgemein.exists(2) then bCorPage = TRUE
159 if bFirst = TRUE then Optionsliste.Select ( startpos + 5 )
161 Kontext "TabPrintStarOffice"
162 if TabPrintStarOffice.exists(2) then bCorPage = TRUE
164 if bFirst = TRUE then Optionsliste.Select ( startpos + 6 )
167 If TabPfade.exists(2) then bCorPage = TRUE
169 if bFirst = TRUE then Optionsliste.Select ( startpos + 7 )
172 If TabFarben.exists(4) then bCorPage = TRUE
173 case "FONTREPLACEMENT"
174 if bFirst = TRUE then Optionsliste.Select ( startpos + 8 )
176 Kontext "TabSchriftErsetzung"
177 If TabSchriftErsetzung.exists(2) then bCorPage = TRUE
179 if bFirst = TRUE then Optionsliste.Select ( startpos + 9 )
181 Kontext "TabSecurity"
182 If TabSecurity.exists(2) then bCorPage = TRUE
184 if bFirst = TRUE then Optionsliste.Select ( startpos + 10 )
186 Kontext "TabAppearance"
187 If TabAppearance.exists(2) then bCorPage = TRUE
189 if bFirst = TRUE then Optionsliste.Select ( startpos + 11 )
191 Kontext "TabAccessibility"
192 If TabAccessibility.exists(2) then bCorPage = TRUE
194 if bFirst = TRUE then Optionsliste.Select ( startpos + 12 )
197 If TabJava.exists(2) then bCorPage = TRUE
199 if bFirst = TRUE then Optionsliste.Select ( startpos + 13 )
201 Kontext "TabOnlineUpdate"
202 If TabOnlineUpdate.exists(2) then bCorPage = TRUE
204 if bFirst = TRUE then Optionsliste.Select ( startpos + 14 )
206 Kontext "TabOOoImprovement"
207 If TabOOoImprovement.exists(2) then bCorPage = TRUE
208 case else : bCorPage = FALSE
211 '///Pages in group "LoadSave"are:
212 '///+<ul><li>"General"</li>
213 '///+<li>"VBAProperties"</li>
214 '///+<li>"MicrosoftOffice"</li>
215 '///+<li>"HTMLCompatibility"</li></ul>
216 select case Tabpagename
218 Kontext "TabSpeichern"
219 if TabSpeichern.exists then bCorPage = TRUE
221 if bFirst = TRUE then Optionsliste.Select ( startpos + 2 )
223 Kontext "TabMicrosoftOffice97"
224 If WinwordBasicLaden.exists(4) then bCorPage = TRUE
225 case "MICROSOFTOFFICE"
226 if bFirst = TRUE then Optionsliste.Select ( startpos + 3 )
228 Kontext "TabMicrosoftOffice2"
229 If Auswahl.exists(4) then bCorPage = TRUE
230 case "HTMLCOMPATIBILITY"
231 if bFirst = TRUE then Optionsliste.Select ( startpos + 4 )
234 If TabHtml.exists(2) then bCorPage = TRUE
235 case else : bCorPage = FALSE
237 case "LANGUAGESETTINGS"
238 '///Pages in group "LanguageSettings"are:
239 '///+<ul><li>"Language"</li>
240 '///+<li>"WritingAids"</li>
241 '///+<li>"SearchingJapanese"</li>
242 '///+<li>"AsianLayout"</li></ul>
243 '///+<li>"Complex Text Layout"</li></ul>
245 if Active.Exists then Active.OK
246 Kontext "ExtrasOptionenDlg"
247 select case Tabpagename
249 Kontext "TabSprachen"
250 If TabSprachen.exists(2) then bCorPage = TRUE
252 if bFirst = TRUE then Optionsliste.Select ( startpos + 2 )
254 Kontext "TabLinguistik"
255 If TabLinguistik.exists(2) then bCorPage = TRUE
256 case "SEARCHINGINJAPANESE"
257 if bFirst = TRUE then Optionsliste.Select ( startpos + 3 )
259 Kontext "TabJapaneseFind"
260 if TabJapaneseFind.exists(2) then bCorPage = TRUE
262 if bFirst = TRUE then Optionsliste.Select ( startpos + 4 )
264 Kontext "TabAsianLayoutOptions"
265 if TabAsianLayoutOptions.exists(2) then bCorPage = TRUE
266 case "COMPLEXTEXTLAYOUT"
267 if bFirst = TRUE then Optionsliste.Select ( startpos + 5 )
269 Kontext "TabComplexTextLayout"
270 if TabComplexTextLayout.exists(2) then bCorPage = TRUE
271 case else : bCorPage = FALSE
274 '///Pages in group "Internet"are:
275 '///+<ul><li>"Proxy"</li>
276 '///+<li>"Search"</li></ul>
278 if Active.Exists then Active.OK
279 Kontext "ExtrasOptionenDlg"
280 select case Tabpagename
282 Kontext "ProxyWarnung"
283 if ProxyWarnung.Exists then
284 NichtMehrAnzeigen.Check
287 Kontext "TabProxyServer"
288 if TabProxyServer.exists(2) then bCorPage = TRUE
290 if bFirst = TRUE then Optionsliste.Select ( startpos + 2 )
293 If TabSuche.exists(2) then bCorPage = TRUE
295 if bFirst = TRUE then Optionsliste.Select ( startpos + 3 )
298 If TabEmail.exists(2) then bCorPage = TRUE
299 case else : bCorPage = FALSE
302 '///Pages in group "TextDocument"are:
303 '///+<ul><li>"General"</li>
304 '///+<li>"View"</li>
305 '///+<li>"FormattinAids"</li>
306 '///+<li>"Grid"</li>
307 '///+<li>"BasicFonts"</li>
308 '///+<li>"BasicFontsAsian"</li>
309 '///+<li>"BasicFontsCTL"</li>
310 '///+<li>"Print"</li>
311 '///+<li>"Table"</li>
312 '///+<li>"Changes"</li></ul>
313 select case Tabpagename
316 If TabLaden.exists then bCorPage = TRUE
318 if bFirst = TRUE then Optionsliste.Select ( startpos + 2 )
320 Kontext "TabInhalteWriter"
321 If TabInhalteWriter.exists(2) then bCorPage = TRUE
322 case "FORMATTINGAIDS"
323 if bFirst = TRUE then Optionsliste.Select ( startpos + 3 )
325 Kontext "TabDirektCursor"
326 If TabDirektCursor.exists(2) then bCorPage = TRUE
328 if bFirst = TRUE then Optionsliste.Select ( startpos + 4 )
331 If TabRaster.exists(2) then bCorPage = TRUE
333 if bFirst = TRUE then Optionsliste.Select ( startpos + 5 )
335 Kontext "TabGrundschriften"
336 If TabGrundschriften.exists(2) then bCorPage = TRUE
337 case "BASICFONTSASIAN"
338 if bFirst = TRUE then Optionsliste.Select ( startpos + 6 )
340 Kontext "TabGrundschriftenASIAN"
341 If TabGrundschriftenASIAN.exists(2) then bCorPage = TRUE
343 if bFirst = TRUE then Optionsliste.Select ( startpos + 6 )
345 Kontext "TabGrundschriftenCTL"
346 If TabGrundschriftenCTL.exists(2) then bCorPage = TRUE
348 if bFirst = TRUE then Optionsliste.Select ( startpos + 6 )
350 Kontext "TabDruckenWriter"
351 If TabDruckenWriter.exists(2) then bCorPage = TRUE
353 if bFirst = TRUE then Optionsliste.Select ( startpos + 7 )
355 Kontext "TabTabelleOptionen"
356 If TabTabelleOptionen.exists(2) then bCorPage = TRUE
358 if bFirst = TRUE then Optionsliste.Select ( startpos + 8 )
360 Kontext "TabAenderungenWriter"
361 If TabAenderungenWriter.exists(2) then bCorPage = TRUE
363 if bFirst = TRUE then Optionsliste.Select ( startpos + 9 )
365 Kontext "TabCompatibility"
366 If TabCompatibility.exists(2) then bCorPage = TRUE
368 if bFirst = TRUE then Optionsliste.Select ( startpos + 10 )
370 Kontext "TabAutoCaption"
371 If TabAutoCaption.exists(2) then bCorPage = TRUE
372 case "MAILMERGEEMAIL"
373 if bFirst = TRUE then Optionsliste.Select ( startpos + 11 )
375 Kontext "TabMailMergeEMail"
376 If TabMailMergeEMail.exists(2) then bCorPage = TRUE
378 case else : bCorPage = FALSE
381 '///Pages in group "HTMLDocument"are:
382 '///+<ul><li>"General"</li>
383 '///+<li>"View"</li>
384 '///+<li>"Grid"</li>
385 '///+<li>"Print"</li>
386 '///+<li>"Table"</li>
387 '///+<li>"Source"</li>
388 '///+<li>"Background"</li></ul>
389 select case Tabpagename
391 Kontext "TabInhalteHTML"
392 If TabInhalteHTML.exists then bCorPage = TRUE
393 case "FORMATTINGAIDS"
394 if bFirst = TRUE then Optionsliste.Select ( startpos + 2 )
396 Kontext "TabDirektCursor"
397 If TabDirektCursor.exists(2) then bCorPage = TRUE
399 if bFirst = TRUE then Optionsliste.Select ( startpos + 3 )
402 If TabRaster.exists(2) then bCorPage = TRUE
404 if bFirst = TRUE then Optionsliste.Select ( startpos + 4 )
406 Kontext "TabDruckenHTML"
407 If TabDruckenHTML.exists(2) then bCorPage = TRUE
409 if bFirst = TRUE then Optionsliste.Select ( startpos + 5 )
411 Kontext "TabTabelleOptionen"
412 If TabTabelleOptionen.exists(2) then bCorPage = TRUE
414 if bFirst = TRUE then Optionsliste.Select ( startpos + 6 )
416 Kontext "TabHintergrund"
417 If TabHintergrund.exists then bCorPage = TRUE
418 case else : bCorPage = FALSE
421 '///Pages in group "Spreadsheet"are:
422 '///+<ul><li>"General"</li>
423 '///+<li>"View"</li>
424 '///+<li>"Calculate"</li>
425 '///+<li>"Sortlists"</li>
426 '///+<li>"Changes"</li>
427 '///+<li>"Grid"</li>
428 '///+<li>"Print"</li></ul>
429 select case Tabpagename
431 Kontext "TabLayoutCalc"
432 If TabLayoutCalc.exists(2) then bCorPage = TRUE
434 if bFirst = TRUE then Optionsliste.Select ( startpos + 2 )
436 Kontext "TabInhaltCalc"
437 If TabInhaltCalc.exists(2) then bCorPage = TRUE
439 if bFirst = TRUE then Optionsliste.Select ( startpos + 3 )
441 Kontext "TabBerechnen"
442 If TabBerechnen.exists(2) then bCorPage = TRUE
444 if bFirst = TRUE then Optionsliste.Select ( startpos + 4 )
446 Kontext "TabSortierlisten"
447 If TabSortierlisten.exists(2) then bCorPage = TRUE
449 if bFirst = TRUE then Optionsliste.Select ( startpos + 5 )
451 Kontext "TabAenderungenCalc"
452 If TabAenderungenCalc.exists(2) then bCorPage = TRUE
454 if bFirst = TRUE then Optionsliste.Select ( startpos + 6 )
457 If TabRaster.exists(2) then bCorPage = TRUE
459 if bFirst = TRUE then Optionsliste.Select ( startpos + 7 )
461 Kontext "TabPrintCalcOptions"
462 If TabPrintCalcOptions.exists(2) then bCorPage = TRUE
463 case else : bCorPage = FALSE
466 '///Pages in group "Presentation"are:
467 '///+<ul><li>"General"</li>
468 '///+<li>"View"</li>
469 '///+<li>"Grid"</li>
470 '///+<li>"Print"</li></ul>
471 select case Tabpagename
473 Kontext "TabSonstigesDraw"
474 If TabSonstigesDraw.exists then bCorPage = TRUE
476 if bFirst = TRUE then Optionsliste.Select ( startpos + 2 )
478 Kontext "TabInhalteDraw"
479 If TabInhalteDraw.exists(2) then bCorPage = TRUE
481 if bFirst = TRUE then Optionsliste.Select ( startpos + 3 )
484 If TabRaster.exists(2) then bCorPage = TRUE
486 if bFirst = TRUE then Optionsliste.Select ( startpos + 4 )
488 Kontext "TabDruckenDraw"
489 If TabDruckenDraw.exists(2) then bCorPage = TRUE
490 case else : bCorPage = FALSE
493 '///Pages in group "Drawing"are:
494 '///+<ul><li>"General"</li>
495 '///+<li>"View"</li>
496 '///+<li>"Grid"</li>
497 '///+<li>"Print"</li></ul>
498 select case Tabpagename
500 Kontext "TabSonstigesDraw"
501 If TabSonstigesDraw.exists then bCorPage = TRUE
503 if bFirst = TRUE then Optionsliste.Select ( startpos + 2 )
505 Kontext "TabInhalteDraw"
506 If TabInhalteDraw.exists(2) then bCorPage = TRUE
508 if bFirst = TRUE then Optionsliste.Select ( startpos + 3 )
511 If TabRaster.exists(2) then bCorPage = TRUE
513 if bFirst = TRUE then Optionsliste.Select ( startpos + 4 )
515 Kontext "TabDruckenDraw"
516 If TabDruckenDraw.exists(2) then bCorPage = TRUE
517 case else : bCorPage = FALSE
520 '///Page(s) in group "Formula"are:
521 '///+<ul><li>"Settings"</li></ul>
522 select case Tabpagename
524 Kontext "TabDruckenMath"
525 If TabDruckenMath.exists then bCorPage = TRUE
526 case else : bCorPage = FALSE
529 '///Pages in group "Chart"are:
530 '///+<ul><li>"DefaultColors"</li></ul>
531 select case Tabpagename
533 Kontext "TabGrundfarben"
534 If TabGrundfarben.exists(4) then bCorPage = TRUE
535 case else : bCorPage = FALSE
538 '///Pages in group "Datasource"are:
539 '///+<ul><li>"Connetions"</li></ul>
540 select case Tabpagename
542 Kontext "TabConnections"
543 If TabConnections.exists(4) then bCorPage = TRUE
545 Kontext "TabRegisteredDatabase"
546 If TabRegisteredDatabase.exists(4) then bCorPage = TRUE
547 case else : bCorPage = FALSE
552 If bCorPage = TRUE then Exit for
554 if ( NOT bCorPage ) then
555 if ( NOT bSilent ) then
556 warnlog CFN & Applicationname + " / " + Tabpagename + " could not be found! Please review your test!"
558 printlog CFN & Applicationname + " / " + Tabpagename + " could not be found!"
563 warnlog CFN & "Please open the option-dialog with 'ToolsOptions' before you called this routine!"
565 hToolsOptions = bCorPage