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 : Perform standard operations on all samples/templates etc.
32 '\***********************************************************************
34 private const MAX_FILE_COUNT = 3000 ' the max number of templates or samples
36 ' NOTE: Usually we have only about a 100 templates but in multi-language
37 ' installations there are more than 2100. You should not run these
38 ' tests on multi language installations. Really.
40 testcase tShowAllObjectsAsPreview( cCategory as string )
43 dim iObjectFolder as Integer ' the current folder in loops
44 dim iObjectFolders as integer ' the number of template/sample-folders
46 dim iObject as Integer ' the current template/sample within loops
47 dim iObjectCount( 20 ) as integer ' number of templates/samples in the folders
54 if ( TemplateAndDocuments.exists( 1 ) ) then
57 hSelectCategory( cCategory )
59 iObjectFolders = FileList.getItemCount()
61 for iObject = 1 to iObjectFolders
63 '//<li>grab a folder below cCategory and open it</li>
64 hSelectFileFolder( iObject , true )
66 '<li>get the number of items</li>
67 iObjectCount( iObject ) = FileList.getItemCount()
69 '<li>step up one level to the root of cCategory</li>
77 printlog( "Displaying documents in preview pane" )
80 for iObjectFolder = 1 to iObjectFolders
82 kontext "TemplateAndDocuments"
84 hSelectCategory( cCategory )
86 hSelectFileFolder( iObjectFolder , false )
88 for iObject = 1 to iObjectCount( iObjectFolder )
90 printlog( "Object-Folder: " & iObjectFolder & " Entry: " & iObject )
92 hSelectDocumentObject( iObject , 0 )
94 'Problem: Cannot verify the content of preview window.
103 Kontext "TemplateAndDocuments"
104 TemplateAndDocuments.cancel()
107 warnlog( "Failed to open Templates And Documents dialog" )