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: OpenOffice.org View
32 '\******************************************************************************
39 printlog "Check if the defaults are correct"
40 sFile = gTesttoolPath + "framework\optional\input\options\ooo_view_defaults.ref"
41 call checkPage( sFile , false )
43 printlog "Change all settings to something different to the default"
44 sFile = gTesttoolPath + "framework\optional\input\options\ooo_view_changed.ref"
45 call changePage( sFile , true, 1 )
47 printlog "Verify that all changes persist after a restart"
48 sFile = gTesttoolPath + "framework\optional\input\options\ooo_view_changed.ref"
49 call checkPage( sFile , true, 1 )
51 printlog "Re-apply the defaults to all controls and restart the application"
52 sFile = gTesttoolPath + "framework\optional\input\options\ooo_view_defaults.ref"
53 call changePage( sFile , false )
55 printlog "Verify that all settings have indeed been reset to defaults"
56 call checkPage( sFile , false )
60 '*******************************************************************************
62 sub checkPage( sFile as string , bDisabled as boolean, optional iMiddleMouseButtonControl as integer)
63 dim iMiddleMouseButton as integer
64 dim iMiddleMouseButtonExtern as integer
67 ' depends on if defaults or chnges are checked;
70 if isMissing(iMiddleMouseButtonControl) then
71 iMiddleMouseButtonExtern = 0
73 iMiddleMouseButtonExtern = iMiddleMouseButtonControl
75 sFile = convertpath( sFile )
77 printlog( " * Testing current settings against a reference list." )
78 printlog( " * Using settings from file: " & sFile )
81 call hToolsOptions( "StarOffice" , "View" )
83 ' Antialiasing settings only exist for Linux and Solaris
84 if ( gPlatgroup() <> "w95" ) then
86 checkCheckBox( sFile , "*" , FontAntiAliasing)
87 checkEntryField( sFile , "state_aapixel" , AAPixel)
89 checkEntryField( sFile , "*" , AAPixel)
90 checkCheckBox( sFile , "*" , FontAntiAliasing)
93 if ( FontAntiAliasing.exists() ) then
94 warnlog( "Antialiasing controls not expected on Windows" )
96 if ( AAPixel.exists() ) then
97 warnlog( "Antialiasing controls not expected on Windows" )
101 checkEntryField( sFile , "*" , FontScale)
102 checkListBox( sFile , "*" , IconScale )
103 checkListBox( sFile , "*" , IconStyle )
104 checkListBox( sFile , "*" , IconsInMenueAnzeigen )
105 checkListBox( sFile , "*" , IconStyle )
106 checkCheckBox( sFile , "*" , VorschauInSchriftlisten )
107 checkCheckBox( sFile , "*" , SchriftenHistorie )
109 if ( UseHardwareAcceleration.isEnabled ) then
110 checkCheckBox( sFile , "*" , UseHardwareAcceleration )
112 printlog( "Hardware acceleration is not available on this system" )
115 if ( UseAntiAliasing.isEnabled() ) then
116 checkCheckBox( sFile , "*" , UseAntiAliasing )
118 printlog( "Antialiasing is not available on this system" )
121 checkListBox( sFile , "*" , MousePositioning)
122 ' needs to get handled differently on platforms!
123 iMiddleMouseButton = MausAktion.getSelIndex
124 if iMiddleMouseButtonExtern = 1 then
125 checkListBox( sFile , "*" , MausAktion)
127 if gPlatGroup = "unx" then
128 iTemp = 3 ' Paste clipboard
130 iTemp = 2 ' Automatic scrolling
132 if Itemp = iMiddleMouseButton then
133 printlog " * Middle mouse button: ok"
135 warnlog "Middle mouse button: expected: '" + iTemp + "' '" _
136 + MausAktion.getItemText(iTemp) + "'; is: '" _
137 + iMiddleMouseButton + "' '" _
138 + MausAktion.getItemText(iMiddleMouseButton) + "'"
142 if ( Transparency.isEnabled() ) then
143 if ( Transparency.isChecked() ) then
144 checkCheckBox( sFile , "*" , transparency )
145 checkEntryField( sFile , "*", selectionopacity )
148 checkEntryField( sFile , "*", selectionopacity, "i104150" )
149 Transparency.unCheck()
152 printlog( "Transparency is not available on this system" )
155 Kontext "OptionenDLG"
158 call exitRestartTheOffice
161 '*******************************************************************************
163 sub changePage( sFile as string , bInverted as boolean, optional iMiddleMouseButtonControl as integer )
164 dim iMiddleMouseButtonExtern as integer
166 ' depends on if defaults or chnges are checked;
169 if isMissing(iMiddleMouseButtonControl) then
170 iMiddleMouseButtonExtern = 0
172 iMiddleMouseButtonExtern = iMiddleMouseButtonControl
175 sFile = convertpath( sFile )
176 printlog( " * Changing current settings according to the reference list." )
177 printlog( " * Using settings from file: " & sFile )
180 call hToolsOptions( "StarOffice" , "View" )
183 ' Antialiasing settings only exist for Linux and Solaris
184 if ( gPlatGroup <> "w95" ) then
185 if ( bInverted ) then
186 setEntryField( sFile , "*" , AAPixel )
187 setCheckBox( sFile , "*" , FontAntiAliasing )
189 setCheckBox( sFile , "*" , FontAntiAliasing )
190 setEntryField( sFile , "*" , AAPixel )
194 setEntryField( sFile , "*" , FontScale )
195 setListBox( sFile , "*" , IconScale )
196 setListBox( sFile , "*" , IconStyle )
197 setListBox( sFile , "*" , IconsInMenueAnzeigen )
198 setCheckBox( sFile , "*" , VorschauInSchriftlisten )
199 setCheckBox( sFile , "*" , SchriftenHistorie )
201 if ( UseHardwareAcceleration.isEnabled() ) then
202 setCheckBox( sFile , "*" , UseHardwareAcceleration )
204 printlog( "Harware acceleration is not available on this system" )
207 if ( UseAntiAliasing.isEnabled() ) then
208 setCheckBox( sFile , "*" , useantialiasing )
210 printlog( "Antialiasing is not available on this system" )
213 setListBox( sFile , "*" , MousePositioning )
214 ' needs to get handled differently on platforms!
215 if iMiddleMouseButtonExtern = 1 then
216 setListBox( sFile , "*" , MausAktion )
218 if gPlatGroup = "unx" then
219 MausAktion.select(3) ' Paste clipboard
221 MausAktion.select(2) ' Automatic scrolling
225 if ( Transparency.isEnabled() ) then
226 if ( Transparency.isChecked() ) then
227 setEntryField( sFile , "*", selectionopacity )
228 setCheckBox( sFile , "*" , transparency )
230 setCheckBox( sFile , "*" , transparency )
231 setEntryField( sFile , "*", selectionopacity )
234 printlog( "Transparency is not available on this system" )
237 Kontext "OptionenDLG"
240 call exitRestartTheOffice