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 : Tools->Options Load/Save: General
32 '\******************************************************************************
34 testcase tLoadSaveGeneral
35 Dim lbSave(15) as Boolean
36 Dim lsSave(20) as String
37 Dim AppCount as Integer
42 hToolsOptions("LoadSave","General")
43 printlog " - save old settings"
44 lbSave(13) = BenutzerspezifischeEinstellungen.IsChecked
45 lbSave(1) = DokumenteigenschaftenBearbeiten.IsChecked
46 lbSave(2) = Sicherungskopie.IsChecked
47 lbSave(3) = AutomatischSpeichern.IsChecked
49 if AutomatischSpeichern.IsChecked then
50 lsSave(1) = Minuten.GetText
53 lbSave(10) = NoPrettyPrinting.IsChecked
54 lbSave(11) = URLimDateisystem.IsChecked
55 lbSave(12) = URLimInternet.IsChecked
57 printlog("Listed Documenttypes are: ")
58 AppCount = Dokumenttyp.GetItemCount
59 if (AppCount > 7) then
60 Warnlog( "Seven applications should be listed, there are " & AppCount )
63 printlog( " - " & DokumentTyp.getSelText)
69 lsSave(2+i) = Dokumenttyp.GetSelText
70 lsSave(2+AppCount+i) = Filter.GetSelText
73 printlog " - invert/change settings"
75 BenutzerspezifischeEinstellungen.UnCheck
77 BenutzerspezifischeEinstellungen.Check
81 DokumenteigenschaftenBearbeiten.Uncheck
83 DokumenteigenschaftenBearbeiten.Check
87 Sicherungskopie.Uncheck
93 AutomatischSpeichern.Uncheck
95 AutomatischSpeichern.Check
98 if AutomatischSpeichern.IsChecked then
99 lsSave(1) = Minuten.GetText
104 NoPrettyPrinting.Uncheck
106 NoPrettyPrinting.Check
110 URLimDateisystem.Uncheck
112 URLimDateisystem.Check
116 URLimInternet.Uncheck
121 printlog( "Setting filters for documenttypes: Select third item from every list" )
124 Dokumenttyp.Select(i)
126 printlog( "Doctype: " & Dokumenttyp.getSelText() & " has filter: " & Filter.getSelText() )
129 printlog " - close options-dlg with OK"
130 kontext "ExtrasOptionenDlg"
131 hCloseDialog( ExtrasOptionenDlg, "ok" )
133 printlog " - exit/restart StarOffice"
136 printlog " - check inverting/changes"
138 hToolsOptions ( "LoadSave", "General" )
140 if BenutzerspezifischeEinstellungen.IsChecked = lbSave ( 13 ) then
141 Warnlog "'Load user setting with document' => changes not saved"
144 if DokumenteigenschaftenBearbeiten.IsChecked = lbSave ( 1 ) then
145 Warnlog "'Edit document properties before saving' => changes not saved"
148 if Sicherungskopie.IsChecked = lbSave ( 2 ) then
149 Warnlog "'Create backup copy' => changes not saved"
152 if AutomatischSpeichern.IsChecked = lbSave ( 3 ) then
153 printlog "AutoSave => changes not saved"
156 if AutomatischSpeichern.IsChecked then
157 if Minuten.GetText <> "23" then
158 Warnlog "Minutes for AutoSave => changes not saved"
161 if NoPrettyPrinting.IsChecked = lbSave ( 10 ) then
162 Warnlog "no pretty printing => changes not saved"
165 if URLimDateisystem.IsChecked = lbSave ( 11 ) then
166 Warnlog "URL: File system => changes not saved"
169 if URLimInternet.IsChecked = lbSave ( 12 ) then
170 Warnlog "URL: Internet => changes not saved"
173 printlog( "Verifying filters for documenttypes: Select third item from every list" )
175 Dokumenttyp.Select(i)
176 printlog( "Doctype: " & Dokumenttyp.getSelText() & " has filter: " & Filter.getSelText() )
178 if Filter.GetSelIndex <> 3 then
180 warnlog( "Some options in Tools/Options->Load/Save->General are not saved" )
184 printlog " - make other changes"
185 BenutzerspezifischeEinstellungen.Uncheck
186 DokumenteigenschaftenBearbeiten.Check
187 Sicherungskopie.Uncheck
188 AutomatischSpeichern.Check
190 NoPrettyPrinting.Uncheck
191 URLimDateisystem.Uncheck
192 URLimInternet.Uncheck
195 Dokumenttyp.Select(i)
199 printlog " - close options-dlg with OK"
201 kontext "extrasoptionendlg"
202 hCloseDialog( ExtrasOptionenDlg, "ok" )
204 printlog " - react on messageboxes for loosing settings after changing default-filters"
205 kontext "FilterWarning"
207 if FilterWarning.Exists(5) then
215 printlog " - check second changes"
217 hToolsOptions ( "LoadSave", "General" )
219 if BenutzerspezifischeEinstellungen.IsChecked <> FALSE then
220 Warnlog "'Load user setting with document' => changes not saved"
223 if DokumenteigenschaftenBearbeiten.IsChecked <> TRUE then
224 Warnlog "'Edit document properties before saving' => changes not saved"
227 if Sicherungskopie.IsChecked <> FALSE then
228 Warnlog "'Create backup copy' => changes not saved"
231 if AutomatischSpeichern.IsChecked <> TRUE then
232 Warnlog "AutoSave => changes not saved"
235 if Minuten.GetText <> "1" then
236 Warnlog "Minutes for AutoSave => changes not saved"
239 if NoPrettyPrinting.IsChecked <> FALSE then
240 Warnlog "no pretty printing => changes not saved"
243 if URLimDateisystem.IsChecked <> FALSE then
244 Warnlog "URL: File system => changes not saved"
247 if URLimInternet.IsChecked <> FALSE then
248 Warnlog "URL: Internet => changes not saved"
252 Dokumenttyp.Select(i)
253 if Filter.GetSelIndex <> 4 then
254 Warnlog "Document '" + Dokumenttyp.GetSelText + "': changes not saved"
258 printlog " - reset to saved settings"
259 if lbSave ( 13 ) = FALSE then
260 BenutzerspezifischeEinstellungen.UnCheck else BenutzerspezifischeEinstellungen.Check
263 if lbSave ( 1 ) = FALSE then
264 DokumenteigenschaftenBearbeiten.UnCheck else DokumenteigenschaftenBearbeiten.Check
266 if lbSave ( 2 ) = FALSE then
267 Sicherungskopie.Uncheck else Sicherungskopie.Check
270 AutomatischSpeichern.Check
271 Minuten.SetText lsSave ( 1 )
273 if lbSave ( 3 ) = FALSE then
274 AutomatischSpeichern.Uncheck else AutomatischSpeichern.Check
277 if lbSave ( 10 ) = FALSE then
278 NoPrettyPrinting.Uncheck else NoPrettyPrinting.Check
281 if lbSave ( 11 ) = FALSE then
282 URLimDateisystem.UnCheck else URLimDateisystem.Check
285 if lbSave ( 12 ) = FALSE then
286 URLimInternet.UnCheck else URLimInternet.Check
290 Dokumenttyp.Select(i)
291 if Dokumenttyp.GetSelText <> lsSave ( 2 + i ) then
292 Warnlog "The sorting of the document-listbox has been changed!"
294 Filter.Select(lsSave(2+AppCount+i))
297 kontext "ExtrasOptionenDlg"
298 hCloseDialog( ExtrasOptionenDlg, "ok" )
301 printlog " - check settings"
303 hToolsOptions ( "LoadSave", "General" )
305 if BenutzerspezifischeEinstellungen.IsChecked <> lbSave ( 13 ) then
306 Warnlog "'Load user setting with document' => changes not saved"
309 if DokumenteigenschaftenBearbeiten.IsChecked <> lbSave ( 1 ) then
310 Warnlog "'Edit document properties before saving' => changes not saved"
313 if Sicherungskopie.IsChecked <> lbSave ( 2 ) then
314 Warnlog "'Create backup copy' => changes not saved"
317 if AutomatischSpeichern.IsChecked <> lbSave ( 3 ) then
318 Warnlog "AutoSave => changes not saved"
321 if AutomatischSpeichern.IsChecked then
322 if Minuten.GetText <> lsSave( 1 ) then
323 Warnlog "Minutes for AutoSave => changes not saved"
327 if NoPrettyPrinting.IsChecked <> lbSave ( 10 ) then
328 Warnlog "no pretty printing => changes not saved"
331 if URLimDateisystem.IsChecked <> lbSave ( 11 ) then
332 Warnlog "URL: File system => changes not saved"
335 if URLimInternet.IsChecked <> lbSave ( 12 ) then
336 Warnlog "URL: Internet => changes not saved"
340 Dokumenttyp.Select(i)
341 if Dokumenttyp.GetSelText <> lsSave ( 2 + i ) then
342 Warnlog "The sorting of the document-listbox has been changed!"
344 if Filter.GetSelText <> lsSave ( 2 + AppCount + i ) then
345 Warnlog "Document '" + Dokumenttyp.GetSelText + "': changes not saved"
349 kontext "extrasoptionendlg"
350 hCloseDialog( ExtrasOptionenDlg, "ok" )