1 'encoding UTF-8 Do not remove or change this line!
2 '*******************************************************************************
4 '* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 '* Copyright 2008 by Sun Microsystems, Inc.
8 '* OpenOffice.org - a multi-platform office productivity suite
10 '* $RCSfile: filedlg_rename.inc,v $
12 '* $Revision: 1.2.14.1 $
14 '* This file is part of OpenOffice.org.
16 '* OpenOffice.org is free software: you can redistribute it and/or modify
17 '* it under the terms of the GNU Lesser General Public License version 3
18 '* only, as published by the Free Software Foundation.
20 '* OpenOffice.org is distributed in the hope that it will be useful,
21 '* but WITHOUT ANY WARRANTY; without even the implied warranty of
22 '* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 '* GNU Lesser General Public License version 3 for more details
24 '* (a copy is included in the LICENSE file that accompanied this code).
26 '* You should have received a copy of the GNU Lesser General Public License
27 '* version 3 along with OpenOffice.org. If not, see
28 '* <http://www.openoffice.org/license.html>
29 '* for a copy of the LGPLv3 License.
31 '/******************************************************************************
33 '* owner : Joerg.Skottke@Sun.Com
35 '* short description : Remane files dialog
37 '\******************************************************************************
42 cPath = convertpath( gOfficePath & "user/work/" )
45 cFile = "tFileRename.odt"
47 dim iCurrentFile as integer
48 dim cCurrentFile as string
49 dim iFileCount as integer
50 dim bFileFound as boolean : bFileFound = false
53 Printlog( "Rename file dialog" )
55 gApplication = "WRITER"
57 DocumentWriter.typeKeys( "framework/optional/filedlg_dialogtest.bas::tFileRename" )
59 hFileSaveAsKill( cPath & cFile )
63 if ( OeffnenDlg.exists( 2 ) ) then
65 DateiName.setText( cPath )
67 iFileCount = DateiAuswahl.getItemCount()
68 printlog( iFileCount & " files listed" )
69 DateiAuswahl.typeKeys( "<HOME>" )
71 for iCurrentFile = 1 to iFileCount
74 DateiAuswahl.typeKeys( "<SPACE>" )
77 cCurrentFile = DateiAuswahl.getSelText()
78 printlog( " * " & cCurrentFile )
80 if ( cCurrentFile = cFile ) then
81 printlog( "File found" )
82 DateiAuswahl.openContextMenu()
84 DateiAuswahl.typeKeys( "<ESCAPE>" )
91 DateiAuswahl.typeKeys( "<DOWN>" )
97 if ( FileExists( cPath & cFile ) ) then kill( cPath & cFile )