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: options_ooo_security.inc,v $
13 '* last change: $Author: jsi $ $Date: 2008-06-16 12:18:15 $
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 : Tools->Options: OpenOffice.org Security
38 '\******************************************************************************
41 '///Test the OpenOffice.org/Security-Tabpage in Tools/Options
45 '///<li>check defaults</li>
46 if ( getDocumentCount() < 1 ) then call hNewDocument()
47 _file = gTesttoolPath & "framework\optional\input\options\ooo_security_defaults.ref"
48 checkSecurityPage( _file )
50 '///<li>change the settings</li>
51 if ( getDocumentCount() < 1 ) then call hNewDocument()
52 _file = gTesttoolPath & "framework\optional\input\options\ooo_security_changed.ref"
53 changeSecurityPage( _file )
55 '///<li>check the changes</li>
56 if ( getDocumentCount() < 1 ) then call hNewDocument()
57 checkSecurityPage( _file )
59 '///<li>revert to default settings</li>
60 if ( getDocumentCount() < 1 ) then call hNewDocument()
61 _file = gTesttoolPath & "framework\optional\input\options\ooo_security_defaults.ref"
62 changeSecurityPage( _file )
64 '///<li>check the changes</li>
65 if ( getDocumentCount() < 1 ) then call hNewDocument()
66 checkSecurityPage( _file )
69 kontext "ExtrasOptionenDlg"
70 if ( ExtrasOptionenDlg.exists() ) then
71 ExtrasOptionenDlg.ok()
73 warnlog( "options dialog not available"
75 if ( getDocumentCount() > 0 ) then call hCloseDocument()
79 '*******************************************************************************
81 sub checkSecurityPage( _file as string )
82 _file = convertpath( _file )
84 printlog( " * Testing current settings against a reference list." )
85 printlog( " * Using settings from file: " & _file )
88 call hToolsOptions("StarOffice", "Security")
91 if ( TabSecurity.exists() ) then
95 Kontext "TabSecurityOptionsAndWarnings"
96 if ( TabSecurityOptionsAndWarnings.exists( 2 ) ) then
97 checkCheckBox( _file , "*" , SavingOrSendingDocuments )
98 checkCheckBox( _file , "*" , SigningDocuments )
99 checkCheckBox( _file , "*" , PrintingDocuments )
100 checkCheckBox( _file , "*" , CreatingPDFfiles )
101 checkCheckBox( _file , "*" , RemovePersonalInformationOnSaving )
102 checkCheckBox( _file , "*" , RecommendPasswordProtectionOnSaving )
103 TabSecurityOptionsAndWarnings.cancel
105 warnlog( "Failed to open Security options" )
108 Kontext "TabSecurity"
109 if ( TabSecurity.exists() ) then
110 checkCheckBox( _file , "*" , RecommendToOpenDocumentReadOnly )
111 checkCheckBox( _file , "*" , RecordChanges )
113 warnlog( "Could not return to Security Tabpage" )
116 warnlog( "Security Tabpage not available" )
120 '*******************************************************************************
122 sub changeSecurityPage( _file as string )
123 _file = convertpath( _file )
125 printlog( " * Changing current settings according to the reference list." )
126 printlog( " * Using settings from file: " & _file )
129 Kontext "TabSecurityOptionsAndWarnings"
130 setCheckBox( _file , "*" , SavingOrSendingDocuments )
131 setCheckBox( _file , "*" , SigningDocuments )
132 setCheckBox( _file , "*" , PrintingDocuments )
133 setCheckBox( _file , "*" , CreatingPDFfiles )
134 setCheckBox( _file , "*" , RemovePersonalInformationOnSaving )
135 setCheckBox( _file , "*" , RecommendPasswordProtectionOnSaving )
136 TabSecurityOptionsAndWarnings.cancel
137 Kontext "TabSecurity"
138 setCheckBox( _file , "*" , RecommendToOpenDocumentReadOnly )
139 setCheckBox( _file , "*" , RecordChanges )
141 Kontext "OptionenDLG"
145 call exitRestartTheOffice()