diff options
author | Rüdiger Timm <rt@openoffice.org> | 2008-07-11 09:15:59 +0000 |
---|---|---|
committer | Rüdiger Timm <rt@openoffice.org> | 2008-07-11 09:15:59 +0000 |
commit | 9efeb65ebd29f876621344efa8eaa16c6de4a57b (patch) | |
tree | e59ecec6de5277390af3f73724b6e1bccb08c128 /testautomation/xml/tools/includes | |
parent | d1a9ae508b6c3a7f5bc9071b8d3453233ddd9b52 (diff) |
INTEGRATION: CWS autotestfixes01 (1.1.2); FILE ADDED
2008/07/04 17:08:17 jsi 1.1.2.1: #i91336#
Adding the modul xml to testautomation
Issue number:
Submitted by:
Reviewed by:
Diffstat (limited to 'testautomation/xml/tools/includes')
-rwxr-xr-x | testautomation/xml/tools/includes/itools1.inc | 66 | ||||
-rwxr-xr-x | testautomation/xml/tools/includes/xmltool1.inc | 90 |
2 files changed, 156 insertions, 0 deletions
diff --git a/testautomation/xml/tools/includes/itools1.inc b/testautomation/xml/tools/includes/itools1.inc new file mode 100755 index 000000000000..52d683b07afc --- /dev/null +++ b/testautomation/xml/tools/includes/itools1.inc @@ -0,0 +1,66 @@ +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: itools1.inc,v $ +'* +'* $Revision: 1.2 $ +'* +'* last change: $Author: rt $ $Date: 2008-07-11 10:15:49 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : joerg.sievers@sun.com +'* +'* short description : Internet- and XML Tools +'* +'*************************************************************************************** +'* +' #1 hGetXMLRoot +'* +'\*********************************************************************************** +function hGetXMLRoot ( XMLFileName as string ) as boolean +'/// <i>hGetXML</i> +'/// +checks the initial XML-tag in the StarOffice-XML-document. This function is CASE SENSITIVE! +'/// +INPUT : <Filename as string> +'/// +RETURN : TRUE, FALSE + Dim FileNum as Integer + Dim xmlZeile as String + + hGetXMLRoot = FALSE + FileNum = FreeFile + + Open XMLFileName For Input As #FileNum + Do until EOF(#FileNum) = TRUE + Line input #FileNum, xmlZeile + xmlZeile = Trim ( xmlZeile ) + if xmlZeile = "<?xml version=" & CHR$(34) & "1.0" & CHR$(34) & " encoding=" & CHR$(34) & "UTF-8" & CHR$(34) & "?>" then + hGetXMLRoot = TRUE + Exit Function + end if + Loop + Close #FileNum +end function + +'------------------------------------------------------------------------- + diff --git a/testautomation/xml/tools/includes/xmltool1.inc b/testautomation/xml/tools/includes/xmltool1.inc new file mode 100755 index 000000000000..e4fffb249b6c --- /dev/null +++ b/testautomation/xml/tools/includes/xmltool1.inc @@ -0,0 +1,90 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: xmltool1.inc,v $ +'* +'* $Revision: 1.2 $ +'* +'* last change: $Author: rt $ $Date: 2008-07-11 10:15:59 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* <http://www.openoffice.org/license.html> +'* for a copy of the LGPLv3 License. +'* +'/************************************************************************ +'* +'* owner : joerg.sievers@sun.com +'* +'* short description : XML Tools +'* +'*************************************************************************************** +'* +' #1 CreateWorkXMLExportDir +' #1 hEnablePrettyPrinting +'* +'\*********************************************************************************** +sub CreateWorkXMLExportDir ( DirName as string ) +'/*** <i>CreateWorkXMLExportDir</i> creates in the StarOffice/work- +'/*** +directory a directory. If the same name exists the content (files only) +'/*** +will be deleted. + Dim OutputPath as string + Dim Isliste(200) as string + Dim i, BornToKill + printlog "Checking work-dir & creating '" & gOfficePath & ConvertPath(DirName) & "'." + if hDirectoryExists ( gOfficePath & ConvertPath(DirName) ) = TRUE then + OutputPath = gOfficePath & ConvertPath(DirName) + IsListe(0) = 0 + GetFileList ( OutputPath , "*", IsListe() ) + BornToKill = KillFileList ( IsListe() ) + for i = 1 to BornToKill + warnlog IsListe(i) & " could not be deleted!" + next i + else + app.mkDir( gOfficePath & ConvertPath(DirName)) + end if +end sub +'------------------------------------------------------------------------- +sub hEnablePrettyPrinting (OPTIONAL A) +'/// <i>hEnablePrettyPrinting</i> enables the pretty printing (=better +'/// +formated view) in XML file export. It takes >10 percent more time +'/// +to save files!!! OPTIONAL parameter is used to DISABLE it. + ToolsOptions + Kontext "ExtrasOptionenDLG" + call hToolsOptions("loadsave","general") + Kontext "TabSpeichern" + if IsMissing(A) then + if NoPrettyPrinting.IsChecked = TRUE then + NoPrettyPrinting.Uncheck + sleep(1) + printlog "- XML pretty printing enabled ( xmltool1.inc )" + end if + else + if NoPrettyPrinting.IsChecked = FALSE then + NoPrettyPrinting.Check + sleep(1) + printlog "- XML pretty printing disabled ( xmltool1.inc )" + end if + end if + Kontext "ExtrasOptionenDLG" + ExtrasOptionenDLG.OK +end sub +'------------------------------------------------------------------------- + |