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 : gregor.hartmann@oracle.com
30 '* short description : Access document properties
32 '\******************************************************************************
34 testcase tFiledlgDocumentProperties()
37 dim cFileName as string
38 cFileName = "DigitalSignature" & hGetSuffix( "current" )
40 dim cFilePath as string
41 cFilePath = gTesttoolPath & "framework\optional\input\security"
42 cFilePath = convertpath( cFilePath )
44 dim cFileURL as string : cFileURL = cFilePath & gPathSigne & cFileName
47 dim cFileSize as string
48 dim iFileSizeInfo as long
49 dim cSignatureCreator as string
51 dim cTestExpression as string
53 dim cSelectAll as string
58 printlog( "Using filename: " & cFileName )
59 printlog( "Using filepath: " & cFilePath )
61 if ( FileExists( cFileURL ) ) then
62 iFileSize = FileLen( cFileURL )
63 printlog( "Testfile size is: " & iFileSize & " Bytes" )
65 warnlog( "The workfile does not exist. aborting test" )
73 brc = hDocumentInfoSelectTab( "General" )
75 warnlog( "Unable to switch to the requested tabpage, trying to recover" )
81 cTestExpression = hGetStringFromStaticTextField( FileLocationInfo )
82 if ( cTestExpression = cFilePath ) then
83 printlog( "Path is correct" )
85 warnlog( "The path string is incorrect: " & cTestExpression )
89 cFileSize = hGetStringFromStaticTextField( FileSizeInfo )
90 iFileSizeInfo = hConvertStringToLong( cFileSize )
91 if ( iFileSize <> iFileSizeInfo ) then
92 warnlog( "Filesize does not match, please check" )
93 printlog( "Found...: " & iFileSizeInfo )
94 printlog( "Expected: " & iFileSize )
96 printlog( "Filesize is correct" )
107 '*******************************************************************************
109 function hDocumentInfoSelectTab( cTabPage as string ) as boolean
112 '///<h3>Switch between the tabpages in the document info dialog</h3>
113 '///<i>The declaration of the document info dialog is not complete which
114 '///+ enforces special treatment</i><br><br>
116 '///<u>Parameter(s):</u><br>
119 '///+<li>The name of the tabpage to be activated (String)</li>
121 '///+<li>"General"</li>
122 '///+<li>"Description"</li>
123 '///+<li>"User"</li>
124 '///+<li>"Internet"</li>
125 '///+<li>"Statistics"</li>
126 '///+<li>The string is case insensitive</li>
133 '///<u>Returns:</u><br>
135 '///+<li>Errorcondition (Boolean)</li>
137 '///+<li>TRUE if tabpage is known and switching worked</li>
138 '///+<li>FALSE on icorrect input parameter</li>
139 '///+<li>FALSE on any other error</li>
143 const CFN = "hDocumentInfoSelectTab::"
144 printlog( CFN & "Enter with option (tabpage): " & cTabPage )
145 dim brc as boolean 'a multi purpose boolean returnvalue
148 '///<u>Description:</u>
150 '///+<li>Kontext to the dialog</li>
153 '///+<li>Select the page to switch to, context to the new page</li>
154 select case ( ucase( cTabPage ) )
155 case "GENERAL" : active.setPage TabDokument : kontext "TabDokument"
156 case "DESCRIPTION" : active.setPage TabBeschreibung : kontext "TabBeschreibung"
157 case "USER" : warnlog( "#i95523# - Cannot access controls on Custom page" )
159 'active.setPage TabBenutzer : kontext "TabBenutzer"
160 case "INTERNET" : active.setPage TabInternet : kontext "TabInternet"
161 case "STATISTICS" : active.setPage TabStatistik : kontext "TabStatistik"
162 case default : brc = false
167 printlog( CFN & "Exit with result: " & brc )
168 hDocumentInfoSelectTab() = brc