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: basic_dialog_export.inc,v $
13 '* last change: $Author: jsi $ $Date: 2008-06-16 12:19:03 $
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 : joerg.skottke@sun.com
36 '* short description : Update test for the dialog export feature
38 '\******************************************************************************
40 testcase tUpdtDialogExport
43 '///<h3>Update test for the dialog export feature</h3>
45 if ( gBuild < 9196 ) then
46 printlog( "Test disabled for Build-Id < 9196" )
53 dim cDlgName as string
54 cDlgName = hGetWorkPath() & "DialogTest"
56 const DLG_SUFFIX = ".xdl"
60 '///+<li>Create a new document</li>
63 '///+<li>Open the Macro Organizer</li>
64 '///+<li>Create a new module for the document</li>
65 '///+<li>Open the BASIC IDE</li>
66 '///+<li>Create a new Dialog via the tabbar at the bottom of the IDE</li>
67 printlog( "Test init: Setting up environment" )
68 brc = hInitFormControls( "DialogExport" )
70 warnlog( "Failed to initialize BAIC IDE/Dialog editor, aborting" )
74 '///+<li>Access the DialogBar, it should be visible by default</li>
75 printlog( "Test begin" )
77 if ( not DialogBar.exists() ) then
78 warnlog( "DialogBar does not exist, aborting" )
84 '///+<li>Just click the export button to open the Export dialog</li>
85 printlog( "Click the Export button on the DialogBar" )
89 '///+<li>Verify that the Export Dialog comes up</li>
90 kontext "ExportierenDlg"
91 if ( not ExportierenDlg.exists( 1 ) ) then
92 warnlog( "Export dialog is not open, aborting" )
98 printlog( "Export dialog is open. Good." )
100 '///+<li>Save the dialog without providing an extension</li>
101 kontext "ExportierenDlg"
102 DateiName.setText( cDlgName )
106 if ( Active.exists() ) then
107 cMsg = active.getText()
108 cMsg = hRemoveLineBreaks( cMsg )
109 printlog( "File appears to exist, overwriting: " & cMsg )
113 '///+<li>Verify that we are back on the BASIC IDE</li>
115 if ( not DialogBar.exists() ) then
116 warnlog( "DialogBar is not visible, please check." )
119 printlog( "Back on the Basic IDE / Dialog Editor. Good." )
121 '///+<li>Verify that the file has been saved (on filesystem level)</li>
122 '///+<li>Delete it if found</li>
123 cDlgName = cDlgName & DLG_SUFFIX
124 if ( dir( cDlgName ) = "" ) then
125 warnlog( "The dialog was not saved to the expected location" )
127 hDeleteFile( cDlgName )
128 printlog( "Dialog was exported and deleted. Good." )
131 '///+<li>Close the BASIC IDE and the document</li>
132 printlog( "Test end. Cleanup" )