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: xmltool1.inc,v $
13 '* last change: $Author: rt $ $Date: 2008-07-11 10:15:59 $
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 : wolfram.garten@sun.com
36 '* short description : XML Tools
38 '***************************************************************************************
40 ' #1 CreateWorkXMLExportDir
41 ' #1 hEnablePrettyPrinting
43 '\***********************************************************************************
44 sub CreateWorkXMLExportDir ( DirName as string )
45 '/*** <i>CreateWorkXMLExportDir</i> creates in the StarOffice/work-
46 '/*** +directory a directory. If the same name exists the content (files only)
47 '/*** +will be deleted.
48 Dim OutputPath as string
49 Dim Isliste(200) as string
51 printlog "Checking work-dir & creating '" & gOfficePath & ConvertPath(DirName) & "'."
52 if hDirectoryExists ( gOfficePath & ConvertPath(DirName) ) = TRUE then
53 OutputPath = gOfficePath & ConvertPath(DirName)
55 GetFileList ( OutputPath , "*", IsListe() )
56 BornToKill = KillFileList ( IsListe() )
57 for i = 1 to BornToKill
58 warnlog IsListe(i) & " could not be deleted!"
61 app.mkDir( gOfficePath & ConvertPath(DirName))
64 '-------------------------------------------------------------------------
65 sub hEnablePrettyPrinting (OPTIONAL A)
66 '/// <i>hEnablePrettyPrinting</i> enables the pretty printing (=better
67 '/// +formated view) in XML file export. It takes >10 percent more time
68 '/// +to save files!!! OPTIONAL parameter is used to DISABLE it.
70 Kontext "ExtrasOptionenDLG"
71 call hToolsOptions("loadsave","general")
72 Kontext "TabSpeichern"
74 if NoPrettyPrinting.IsChecked = TRUE then
75 NoPrettyPrinting.Uncheck
77 printlog "- XML pretty printing enabled ( xmltool1.inc )"
80 if NoPrettyPrinting.IsChecked = FALSE then
81 NoPrettyPrinting.Check
83 printlog "- XML pretty printing disabled ( xmltool1.inc )"
86 Kontext "ExtrasOptionenDLG"
89 '-------------------------------------------------------------------------