diff options
Diffstat (limited to 'qadevOOo/tests/basic/mod/xmloff')
52 files changed, 2896 insertions, 0 deletions
diff --git a/qadevOOo/tests/basic/mod/xmloff/Chart/XMLContentExporter/script.xlb b/qadevOOo/tests/basic/mod/xmloff/Chart/XMLContentExporter/script.xlb new file mode 100644 index 000000000000..ae6a259d82c9 --- /dev/null +++ b/qadevOOo/tests/basic/mod/xmloff/Chart/XMLContentExporter/script.xlb @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd"> +<library:library xmlns:library="http://openoffice.org/2000/library" library:name="xmloff_Chart_XMLContentExporter" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="xmloff_Chart_XMLContentExporter"/> +"</library:library> diff --git a/qadevOOo/tests/basic/mod/xmloff/Chart/XMLContentExporter/xmloff_Chart_XMLContentExporter.xba b/qadevOOo/tests/basic/mod/xmloff/Chart/XMLContentExporter/xmloff_Chart_XMLContentExporter.xba new file mode 100644 index 000000000000..c8a21a08aa86 --- /dev/null +++ b/qadevOOo/tests/basic/mod/xmloff/Chart/XMLContentExporter/xmloff_Chart_XMLContentExporter.xba @@ -0,0 +1,111 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="xmloff_Chart_XMLContentExporter" script:language="StarBasic"> + + +'************************************************************************* +' +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' 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. +' +'************************************************************************* +'************************************************************************* + + + +' Be sure that all variables are dimensioned: +option explicit + + +' REQUIRED VARIABLES for interface/service tests: + +'Required for com.sun.star.document.XFilter +Global oFilterDescriptor As Variant + +'Required for com.sun.star.lang.XInitialization +Global aInitArgs() As Variant + +'Required for com.sun.star.document.XExporter +Global oSrcDocument As Object + + +Sub CreateObj() + +'************************************************************************* +' COMPONENT: +' xmloff.Chart.XMLContentExporter +'************************************************************************* +On error goto ErrHndl + Dim initArgs(0) As Object + Dim oMSF As Object + Dim oChartTitle As Variant + Dim filter As Variant + Dim Tag1, Tag2, Tag3 As Variant + Dim printXML As Boolean + Dim expString As String + + printXML = true + expString = "a - b" + expString = "NewTitleOfDiagram" + oMSF = getProcessServiceManager() + oDoc = utils.loadTestDocument("emptyChart.sds", cObjectName) + oDocHandler = oMSF.createInstanceWithArguments("basichelper.DocumentHandler", Array(printXML)) + + Tag1 = Array("office:document-content") + Tag2 = Array("office:body") + Tag3 = Array("chart:title") + filter = Array( _ + Array("TagExists", Tag1), _ + Array("TagEnclosed", Tag2, Tag1), _ + Array("CharsEnclosed", Tag3, expString) _ + ) + + oDocHandler.initialize(filter) + + initArgs(0) = oDocHandler + aInitArgs = initArgs() + oObj = oMSF.createInstanceWithArguments("com.sun.star.comp.Chart.XMLContentExporter", initArgs()) + + oChartTitle = oDoc.getTitle() + oChartTitle.setPropertyValue("String", expString) + + oObj.setSourceDocument(oDoc) + + Dim aFilterDescr(0) As New com.sun.star.beans.PropertyValue + aFilterDescr(0).Name = "FilterName" + aFilterDescr(0).Value = "schart: StarOffice XML (Chart)" + oFilterDescriptor = aFilterDescr() + + oSrcDocument = oDoc +Exit Sub +ErrHndl: + Test.Exception() +End Sub + +Global oDocHandler As Object + +Function checkFilter() As Boolean + checkFilter = oDocHandler.getByName("XMLIsCorrect") + Out.Log(oDocHandler.getByName("XMLCode")) +End Function +</script:module> diff --git a/qadevOOo/tests/basic/mod/xmloff/Chart/XMLContentImporter/script.xlb b/qadevOOo/tests/basic/mod/xmloff/Chart/XMLContentImporter/script.xlb new file mode 100644 index 000000000000..0443584ec192 --- /dev/null +++ b/qadevOOo/tests/basic/mod/xmloff/Chart/XMLContentImporter/script.xlb @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd"> +<library:library xmlns:library="http://openoffice.org/2000/library" library:name="xmloff_Chart_XMLContentImporter" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="xmloff_Chart_XMLContentImporter"/> +"</library:library> diff --git a/qadevOOo/tests/basic/mod/xmloff/Chart/XMLContentImporter/xmloff_Chart_XMLContentImporter.xba b/qadevOOo/tests/basic/mod/xmloff/Chart/XMLContentImporter/xmloff_Chart_XMLContentImporter.xba new file mode 100644 index 000000000000..4a854600f820 --- /dev/null +++ b/qadevOOo/tests/basic/mod/xmloff/Chart/XMLContentImporter/xmloff_Chart_XMLContentImporter.xba @@ -0,0 +1,101 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="xmloff_Chart_XMLContentImporter" script:language="StarBasic"> + + +'************************************************************************* +' +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' 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. +' +'************************************************************************* +'************************************************************************* + + + +' Be sure that all variables are dimensioned: +option explicit + + +' REQUIRED VARIABLES for interface/service tests: + +' Required for com.sun.star.xml.sax.XDocumentHandler + Global vXMLData As Variant + +' Required for procedure CheckImport + Global sValue As String + +' Required for com.sun.star.document.XImporter: + Global oSrcDocument As Object + + +Sub CreateObj() + +'************************************************************************* +' COMPONENT: +' xmloff.Chart.XMLContentImporter +'************************************************************************* +On Error Goto ErrHndl + oDoc = utils.loadTestDocument("emptyChart.sds", cObjectName) + oObj = createUnoService("com.sun.star.comp.Chart.XMLContentImporter") + + oSrcDocument = oDoc + oObj.setTargetDocument(oDoc) + + sValue = "XMLContentImporter_test" + vXMLData = Array( _ + Array("start", "office:document-content", _ + "xmlns:office", "CDATA", "http://openoffice.org/2000/office", _ + "xmlns:text", "CDATA", "http://openoffice.org/2000/text", _ + "xmlns:chart", "CDATA", "http://openoffice.org/2000/chart", _ + "xmlns:table", "CDATA", "http://openoffice.org/2000/table", _ + "xmlns:svg", "CDATA", "http://openoffice.org/2000/svg", _ + "office:class", "CDATA", "chart", _ + "office:version", "CDATA", "1.0"), _ + Array("start", "office:body"), _ + Array("start", "chart:chart"), _ + Array("start", "chart:title"), _ + Array("start", "text:p"), _ + Array("chars", sValue), _ + Array("end", "text:p"), _ + Array("end", "chart:title"), _ + Array("end", "chart:chart"), _ + Array("end", "office:body"), _ + Array("end", "office:document-content")) +Exit Sub +ErrHndl: + Test.Exception() +End Sub + +Function CheckImport() As Boolean + Dim res As Boolean + Dim oTitle As Object + Dim title As String + out.log("checking of import...") + oTitle = oDoc.getTitle() + title = oTitle.getPropertyValue("String") + res = (title = sValue) + out.log("checking result: " + res) + CheckImport() = res +End Function +</script:module> diff --git a/qadevOOo/tests/basic/mod/xmloff/Chart/XMLExporter/script.xlb b/qadevOOo/tests/basic/mod/xmloff/Chart/XMLExporter/script.xlb new file mode 100644 index 000000000000..f45b86cbbf74 --- /dev/null +++ b/qadevOOo/tests/basic/mod/xmloff/Chart/XMLExporter/script.xlb @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd"> +<library:library xmlns:library="http://openoffice.org/2000/library" library:name="xmloff_Chart_XMLExporter" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="xmloff_Chart_XMLExporter"/> +"</library:library> diff --git a/qadevOOo/tests/basic/mod/xmloff/Chart/XMLExporter/xmloff_Chart_XMLExporter.xba b/qadevOOo/tests/basic/mod/xmloff/Chart/XMLExporter/xmloff_Chart_XMLExporter.xba new file mode 100644 index 000000000000..d43b51b06c35 --- /dev/null +++ b/qadevOOo/tests/basic/mod/xmloff/Chart/XMLExporter/xmloff_Chart_XMLExporter.xba @@ -0,0 +1,112 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="xmloff_Chart_XMLExporter" script:language="StarBasic"> + + +'************************************************************************* +' +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' 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. +' +'************************************************************************* +'************************************************************************* + + + +' Be sure that all variables are dimensioned: +option explicit + + +' REQUIRED VARIABLES for interface/service tests: + +'Required for com.sun.star.document.XFilter +Global oFilterDescriptor As Variant + +'Required for com.sun.star.lang.XInitialization +Global aInitArgs() As Variant + +'Required for com.sun.star.document.XExporter +Global oSrcDocument As Object + + +Sub CreateObj() + +'************************************************************************* +' COMPONENT: +' xmloff.Chart.XMLExporter +'************************************************************************* +On error goto ErrHndl + Dim initArgs(0) As Object + Dim oMSF As Object + Dim docInfo As Variant + Dim filter As Variant + Dim Tag1, Tag2, Tag3, Tag4 As Variant + Dim printXML As Boolean + Dim expString As String + + printXML = true + expString = "NewTitleOfChartDocument" + oMSF = getProcessServiceManager() + oDoc = utils.loadTestDocument("emptyChart.sds", cObjectName) + oDocHandler = oMSF.createInstanceWithArguments("basichelper.DocumentHandler", Array(printXML)) + + Tag1 = Array("office:document") + Tag2 = Array("office:meta") + Tag3 = Array("office:body") + Tag4 = Array("dc:title") + filter = Array( _ + Array("TagExists", Tag1), _ + Array("CharsEnclosed", Tag4, expString), _ + Array("TagEnclosed", Tag2, Tag1), _ + Array("TagEnclosed", Tag3, Tag1) _ + ) + + oDocHandler.initialize(filter) + + initArgs(0) = oDocHandler + aInitArgs = initArgs() + oObj = oMSF.createInstanceWithArguments("com.sun.star.comp.Chart.XMLExporter", initArgs()) + + docInfo = oDoc.getDocumentInfo() + docInfo.setPropertyValue("Title", expString) + + oObj.setSourceDocument(oDoc) + + Dim aFilterDescr(0) As New com.sun.star.beans.PropertyValue + aFilterDescr(0).Name = "FilterName" + aFilterDescr(0).Value = "schart: StarOffice XML (Chart)" + oFilterDescriptor = aFilterDescr() + + oSrcDocument = oDoc +Exit Sub +ErrHndl: + Test.Exception() +End Sub + +Global oDocHandler As Object + +Function checkFilter() As Boolean + checkFilter = oDocHandler.getByName("XMLIsCorrect") + Out.Log(oDocHandler.getByName("XMLCode")) +End Function +</script:module> diff --git a/qadevOOo/tests/basic/mod/xmloff/Chart/XMLImporter/script.xlb b/qadevOOo/tests/basic/mod/xmloff/Chart/XMLImporter/script.xlb new file mode 100644 index 000000000000..a7cc190ecb02 --- /dev/null +++ b/qadevOOo/tests/basic/mod/xmloff/Chart/XMLImporter/script.xlb @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd"> +<library:library xmlns:library="http://openoffice.org/2000/library" library:name="xmloff_Chart_XMLImporter" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="xmloff_Chart_XMLImporter"/> +"</library:library> diff --git a/qadevOOo/tests/basic/mod/xmloff/Chart/XMLImporter/xmloff_Chart_XMLImporter.xba b/qadevOOo/tests/basic/mod/xmloff/Chart/XMLImporter/xmloff_Chart_XMLImporter.xba new file mode 100644 index 000000000000..4df7ddd9642b --- /dev/null +++ b/qadevOOo/tests/basic/mod/xmloff/Chart/XMLImporter/xmloff_Chart_XMLImporter.xba @@ -0,0 +1,101 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="xmloff_Chart_XMLImporter" script:language="StarBasic"> + + +'************************************************************************* +' +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' 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. +' +'************************************************************************* +'************************************************************************* + + + +' Be sure that all variables are dimensioned: +option explicit + + +' REQUIRED VARIABLES for interface/service tests: + +' Required for com.sun.star.xml.sax.XDocumentHandler + Global vXMLData As Variant + +' Required for procedure CheckImport + Global sValue As String + +' Required for com.sun.star.document.XImporter: + Global oSrcDocument As Object + + +Sub CreateObj() + +'************************************************************************* +' COMPONENT: +' xmloff.Chart.XMLImporter +'************************************************************************* +On Error Goto ErrHndl + oDoc = utils.loadTestDocument("emptyChart.sds", cObjectName) + oObj = createUnoService("com.sun.star.comp.Chart.XMLImporter") + + oSrcDocument = oDoc + oObj.setTargetDocument(oDoc) + + sValue = "XMLContentImporter_test" + vXMLData = Array( _ + Array("start", "office:document", _ + "xmlns:office", "CDATA", "http://openoffice.org/2000/office", _ + "xmlns:text", "CDATA", "http://openoffice.org/2000/text", _ + "xmlns:chart", "CDATA", "http://openoffice.org/2000/chart", _ + "xmlns:table", "CDATA", "http://openoffice.org/2000/table", _ + "xmlns:svg", "CDATA", "http://openoffice.org/2000/svg", _ + "office:class", "CDATA", "chart", _ + "office:version", "CDATA", "1.0"), _ + Array("start", "office:body"), _ + Array("start", "chart:chart"), _ + Array("start", "chart:title"), _ + Array("start", "text:p"), _ + Array("chars", sValue), _ + Array("end", "text:p"), _ + Array("end", "chart:title"), _ + Array("end", "chart:chart"), _ + Array("end", "office:body"), _ + Array("end", "office:document-content")) +Exit Sub +ErrHndl: + Test.Exception() +End Sub + +Function CheckImport() As Boolean + Dim res As Boolean + Dim oTitle As Object + Dim title As String + out.log("checking of import...") + oTitle = oDoc.getTitle() + title = oTitle.getPropertyValue("String") + res = (title = sValue) + out.log("checking result: " + res) + CheckImport() = res +End Function +</script:module> diff --git a/qadevOOo/tests/basic/mod/xmloff/Chart/XMLStylesExporter/script.xlb b/qadevOOo/tests/basic/mod/xmloff/Chart/XMLStylesExporter/script.xlb new file mode 100644 index 000000000000..ba88f29b9a7e --- /dev/null +++ b/qadevOOo/tests/basic/mod/xmloff/Chart/XMLStylesExporter/script.xlb @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd"> +<library:library xmlns:library="http://openoffice.org/2000/library" library:name="xmloff_Chart_XMLStylesExporter" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="xmloff_Chart_XMLStylesExporter"/> +"</library:library> diff --git a/qadevOOo/tests/basic/mod/xmloff/Chart/XMLStylesExporter/xmloff_Chart_XMLStylesExporter.xba b/qadevOOo/tests/basic/mod/xmloff/Chart/XMLStylesExporter/xmloff_Chart_XMLStylesExporter.xba new file mode 100644 index 000000000000..b544f6aa2250 --- /dev/null +++ b/qadevOOo/tests/basic/mod/xmloff/Chart/XMLStylesExporter/xmloff_Chart_XMLStylesExporter.xba @@ -0,0 +1,99 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="xmloff_Chart_XMLStylesExporter" script:language="StarBasic"> + + +'************************************************************************* +' +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' 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. +' +'************************************************************************* +'************************************************************************* + + + +' Be sure that all variables are dimensioned: +option explicit + + +' REQUIRED VARIABLES for interface/service tests: + +'Required for com.sun.star.document.XFilter +Global oFilterDescriptor As Variant + +'Required for com.sun.star.lang.XInitialization +Global aInitArgs() As Variant + +'Required for com.sun.star.document.XExporter +Global oSrcDocument As Object + + +Sub CreateObj() + +'************************************************************************* +' COMPONENT: +' xmloff.Chart.XMLStylesExporter +'************************************************************************* +On error goto ErrHndl + Dim initArgs(0) As Object + Dim oMSF As Object + Dim filter As Variant + Dim printXML As Boolean + + printXML = true + oMSF = getProcessServiceManager() + oDoc = utils.loadTestDocument("emptyChart.sds", cObjectName) + oDocHandler = oMSF.createInstanceWithArguments("basichelper.DocumentHandler", Array(printXML)) + + filter = Array( _ + Array("TagExists", Array("office:document-styles")) _ + ) + + oDocHandler.initialize(filter) + + initArgs(0) = oDocHandler + aInitArgs = initArgs() + oObj = oMSF.createInstanceWithArguments("com.sun.star.comp.Chart.XMLStylesExporter", initArgs()) + + oObj.setSourceDocument(oDoc) + + Dim aFilterDescr(0) As New com.sun.star.beans.PropertyValue + aFilterDescr(0).Name = "FilterName" + aFilterDescr(0).Value = "schart: StarOffice XML (Chart)" + oFilterDescriptor = aFilterDescr() + + oSrcDocument = oDoc +Exit Sub + +ErrHndl: + Test.Exception() +End Sub + +Global oDocHandler As Object + +Function checkFilter() + checkFilter = oDocHandler.getByName("XMLIsCorrect") + Out.Log(oDocHandler.getByName("XMLCode")) +End Function +</script:module> diff --git a/qadevOOo/tests/basic/mod/xmloff/Chart/XMLStylesImporter/script.xlb b/qadevOOo/tests/basic/mod/xmloff/Chart/XMLStylesImporter/script.xlb new file mode 100644 index 000000000000..d2c3fe8f2d7e --- /dev/null +++ b/qadevOOo/tests/basic/mod/xmloff/Chart/XMLStylesImporter/script.xlb @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd"> +<library:library xmlns:library="http://openoffice.org/2000/library" library:name="xmloff_Chart_XMLStylesImporter" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="xmloff_Chart_XMLStylesImporter"/> +"</library:library> diff --git a/qadevOOo/tests/basic/mod/xmloff/Chart/XMLStylesImporter/xmloff_Chart_XMLStylesImporter.xba b/qadevOOo/tests/basic/mod/xmloff/Chart/XMLStylesImporter/xmloff_Chart_XMLStylesImporter.xba new file mode 100644 index 000000000000..92dbd9fba8fa --- /dev/null +++ b/qadevOOo/tests/basic/mod/xmloff/Chart/XMLStylesImporter/xmloff_Chart_XMLStylesImporter.xba @@ -0,0 +1,87 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="xmloff_Chart_XMLStylesImporter" script:language="StarBasic"> + + +'************************************************************************* +' +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' 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. +' +'************************************************************************* +'************************************************************************* + + + +' Be sure that all variables are dimensioned: +option explicit + + +' REQUIRED VARIABLES for interface/service tests: + +' Required for com.sun.star.xml.sax.XDocumentHandler + Global vXMLData As Variant + +' Required for com.sun.star.document.XImporter: + Global oSrcDocument As Object + + +Sub CreateObj() + +'************************************************************************* +' COMPONENT: +' xmloff.Chart.XMLStylesImporter +'************************************************************************* +On Error Goto ErrHndl + oDoc = utils.loadTestDocument("emptyChart.sds", cObjectName) + oObj = createUnoService("com.sun.star.comp.Chart.XMLStylesImporter") + + oSrcDocument = oDoc + oObj.setTargetDocument(oDoc) + + vXMLData = Array( _ + Array("start", "office:document-styles", _ + "xmlns:office", "CDATA", "http://openoffice.org/2000/office", _ + "xmlns:text", "CDATA", "http://openoffice.org/2000/text", _ + "xmlns:chart", "CDATA", "http://openoffice.org/2000/chart", _ + "xmlns:style", "CDATA", "http://openoffice.org/2000/style", _ + "xmlns:svg", "CDATA", "http://openoffice.org/2000/svg", _ + "office:class", "CDATA", "chart", _ + "office:version", "CDATA", "1.0"), _ + Array("start", "office:styles"), _ + Array("end", "office:styles"), _ + Array("end", "office:document-styles")) +Exit Sub +ErrHndl: + Test.Exception() +End Sub + +Function CheckImport() As Boolean + Dim res As Boolean + out.log("checking of import...") + out.log("No ways to check styles import were not found.") + res = True + out.log("checking result: " + res) + CheckImport() = res +End Function +</script:module> diff --git a/qadevOOo/tests/basic/mod/xmloff/Draw/XMLContentExporter/script.xlb b/qadevOOo/tests/basic/mod/xmloff/Draw/XMLContentExporter/script.xlb new file mode 100644 index 000000000000..bf64ff5788c9 --- /dev/null +++ b/qadevOOo/tests/basic/mod/xmloff/Draw/XMLContentExporter/script.xlb @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd"> +<library:library xmlns:library="http://openoffice.org/2000/library" library:name="xmloff_Draw_XMLContentExporter" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="xmloff_Draw_XMLContentExporter"/> +"</library:library> diff --git a/qadevOOo/tests/basic/mod/xmloff/Draw/XMLContentExporter/xmloff_Draw_XMLContentExporter.xba b/qadevOOo/tests/basic/mod/xmloff/Draw/XMLContentExporter/xmloff_Draw_XMLContentExporter.xba new file mode 100644 index 000000000000..268c2ea34ca7 --- /dev/null +++ b/qadevOOo/tests/basic/mod/xmloff/Draw/XMLContentExporter/xmloff_Draw_XMLContentExporter.xba @@ -0,0 +1,115 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="xmloff_Draw_XMLContentExporter" script:language="StarBasic"> + + +'************************************************************************* +' +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' 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. +' +'************************************************************************* +'************************************************************************* + + + +' Be sure that all variables are dimensioned: +option explicit + + +' REQUIRED VARIABLES for interface/service tests: + +'Required for com.sun.star.document.XFilter +Global oFilterDescriptor As Variant + +'Required for com.sun.star.lang.XInitialization +Global aInitArgs() As Variant + +'Required for com.sun.star.document.XExporter +Global oSrcDocument As Object + + +Sub CreateObj() + +'************************************************************************* +' COMPONENT: +' xmloff.Draw.XMLContentExporter +'************************************************************************* +On error goto ErrHndl + Dim initArgs(0) As Object + Dim oMSF As Object + Dim oDrawPages As Variant + Dim printXML As Boolean + Dim expString1 As String + Dim expString2 As String + Dim filter As Variant + Dim Tag1, Tag2, Tag3, Tag4, Tag5 As Variant + + printXML = true + expString1 = "NewSlide1" + expString2 = "NewSlide2" + oMSF = getProcessServiceManager() + oDoc = utils.createDocument("sdraw", cObjectName) + oDocHandler = oMSF.createInstanceWithArguments("basichelper.DocumentHandler", Array(printXML)) + + Tag1 = Array("office:document-content") + Tag2 = Array("office:body") + Tag3 = Array("draw:page","draw:name","NewSlide1") + Tag4 = Array("draw:page","draw:name","NewSlide2") + Tag5 = Array("draw:page") + filter = Array( _ + Array("TagExists", Tag1, Tag2, Tag3, Tag4), _ + Array("TagEnclosed", Tag5, Tag2) _ + ) + + oDocHandler.initialize(filter) + + initArgs(0) = oDocHandler + aInitArgs = initArgs() + oObj = oMSF.createInstanceWithArguments("com.sun.star.comp.Draw.XMLContentExporter", initArgs()) + + oDrawPages = oDoc.getDrawPages() + oDrawPages.insertNewByIndex(1) + oDrawPages.getByIndex(0).setName(expString1) + oDrawPages.getByIndex(1).setName(expString2) + + oObj.setSourceDocument(oDoc) + + Dim aFilterDescr(0) As New com.sun.star.beans.PropertyValue + aFilterDescr(0).Name = "FilterName" + aFilterDescr(0).Value = "sdraw: StarOffice XML (Draw)" + oFilterDescriptor = aFilterDescr() + + oSrcDocument = oDoc +Exit Sub +ErrHndl: + Test.Exception() +End Sub + +Global oDocHandler As Object + +Function checkFilter() As Boolean + checkFilter = oDocHandler.getByName("XMLIsCorrect") + Out.Log(oDocHandler.getByName("XMLCode")) +End Function +</script:module> diff --git a/qadevOOo/tests/basic/mod/xmloff/Draw/XMLContentImporter/script.xlb b/qadevOOo/tests/basic/mod/xmloff/Draw/XMLContentImporter/script.xlb new file mode 100644 index 000000000000..87b4c637710b --- /dev/null +++ b/qadevOOo/tests/basic/mod/xmloff/Draw/XMLContentImporter/script.xlb @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd"> +<library:library xmlns:library="http://openoffice.org/2000/library" library:name="xmloff_Draw_XMLContentImporter" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="xmloff_Draw_XMLContentImporter"/> +"</library:library> diff --git a/qadevOOo/tests/basic/mod/xmloff/Draw/XMLContentImporter/xmloff_Draw_XMLContentImporter.xba b/qadevOOo/tests/basic/mod/xmloff/Draw/XMLContentImporter/xmloff_Draw_XMLContentImporter.xba new file mode 100644 index 000000000000..beb1cb9e159d --- /dev/null +++ b/qadevOOo/tests/basic/mod/xmloff/Draw/XMLContentImporter/xmloff_Draw_XMLContentImporter.xba @@ -0,0 +1,115 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="xmloff_Draw_XMLContentImporter" script:language="StarBasic"> + + +'************************************************************************* +' +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' 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. +' +'************************************************************************* +'************************************************************************* + + + +' Be sure that all variables are dimensioned: +option explicit + + +' REQUIRED VARIABLES for interface/service tests: + +' Required for com.sun.star.xml.sax.XDocumentHandler + Global vXMLData As Variant + +' Required for procedure CheckImport + Global sName1, sName2 As String + +' Required for com.sun.star.document.XImporter: + Global oSrcDocument As Object + + +Sub CreateObj() + +'************************************************************************* +' COMPONENT: +' xmloff.Draw.XMLContentImporter +'************************************************************************* +On Error Goto ErrHndl + oDoc = utils.createDocument("sdraw", cObjectName) + oObj = createUnoService("com.sun.star.comp.Draw.XMLContentImporter") + + oSrcDocument = oDoc + oObj.setTargetDocument(oDoc) + + sName1 = "NewSlide1" + sName2 = "NewSlide2" + vXMLData = Array( _ + Array("start", "office:document", _ + "xmlns:office", "CDATA", "http://openoffice.org/2000/office", _ + "xmlns:draw", "CDATA", "http://openoffice.org/2000/drawing", _ + "office:class", "CDATA", "drawing", _ + "office:version", "CDATA", "1.0"), _ + Array("start", "office:body"), _ + Array("start", "draw:page", _ + "draw:name", "CDATA", sName1, _ + "draw:master-page-name", "CDATA", "Default"), _ + Array("end", "draw:page"), _ + Array("start", "draw:page", _ + "draw:name", "CDATA", sName2, _ + "draw:master-page-name", "CDATA", "Default"), _ + Array("end","draw:page"), _ + Array("end", "draw:page"), _ + Array("end", "office:body"), _ + Array("end", "office:document")) +Exit Sub +ErrHndl: + Test.Exception() +End Sub + +Function CheckImport() As Boolean + Dim i As Integer + Dim res, res1, res2 As Boolean + Dim oPages, oPage As Object + Dim pageName As String + out.log("checking of import...") + res1 = False + res2 = False + oPages = oDoc.getDrawPages() + out.log("Draw pages:") + For i = 0 to ( oPages.getCount() - 1 ) + oPage = oPages.getByIndex(i) + pageName = oPage.getName() + out.log(pageName) + If pageName = sName1 then + res1 = True + EndIf + If pageName = sName2 then + res2 = True + EndIf + Next i + res = res1 and res2 + out.log("checking result: " + res) + CheckImport() = res +End Function +</script:module> diff --git a/qadevOOo/tests/basic/mod/xmloff/Draw/XMLExporter/script.xlb b/qadevOOo/tests/basic/mod/xmloff/Draw/XMLExporter/script.xlb new file mode 100644 index 000000000000..80ede1c7381b --- /dev/null +++ b/qadevOOo/tests/basic/mod/xmloff/Draw/XMLExporter/script.xlb @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd"> +<library:library xmlns:library="http://openoffice.org/2000/library" library:name="xmloff_Draw_XMLExporter" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="xmloff_Draw_XMLExporter"/> +"</library:library> diff --git a/qadevOOo/tests/basic/mod/xmloff/Draw/XMLExporter/xmloff_Draw_XMLExporter.xba b/qadevOOo/tests/basic/mod/xmloff/Draw/XMLExporter/xmloff_Draw_XMLExporter.xba new file mode 100644 index 000000000000..a05ce5775cc6 --- /dev/null +++ b/qadevOOo/tests/basic/mod/xmloff/Draw/XMLExporter/xmloff_Draw_XMLExporter.xba @@ -0,0 +1,110 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="xmloff_Draw_XMLExporter" script:language="StarBasic"> + + +'************************************************************************* +' +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' 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. +' +'************************************************************************* +'************************************************************************* + + + +' Be sure that all variables are dimensioned: +option explicit + + +' REQUIRED VARIABLES for interface/service tests: + +'Required for com.sun.star.document.XFilter +Global oFilterDescriptor As Variant + +'Required for com.sun.star.lang.XInitialization +Global aInitArgs() As Variant + +'Required for com.sun.star.document.XExporter +Global oSrcDocument As Object + + +Sub CreateObj() + +'************************************************************************* +' COMPONENT: +' xmloff.Draw.XMLExporter +'************************************************************************* +On error goto ErrHndl + Dim initArgs(0) As Object + Dim oMSF As Object + Dim oDocInfo As Variant + Dim printXML As Boolean + Dim filter As Variant + Dim expString As String + Dim Tag1, Tag2, Tag3, Tag4, Tag5 As Variant + + printXML = true + expString = "NewTitleOfDrawDocument" + oMSF = getProcessServiceManager() + oDoc = utils.createDocument("sdraw", cObjectName) + oDocHandler = oMSF.createInstanceWithArguments("basichelper.DocumentHandler", Array(printXML)) + + Tag1 = Array("office:document") + Tag2 = Array("office:meta") + Tag3 = Array("dc:title") + filter = Array( _ + Array("TagExists", Tag1, Tag2, Tag3), _ + Array("TagEnclosed", Tag3, Tag2), _ + Array("CharsEnclosed", Tag3, expString) _ + ) + + oDocHandler.initialize(filter) + + initArgs(0) = oDocHandler + aInitArgs = initArgs() + oObj = oMSF.createInstanceWithArguments("com.sun.star.comp.Draw.XMLExporter", initArgs()) + + oDocInfo = oDoc.getDocumentInfo() + oDocInfo.setPropertyValue("Title", expString) + + oObj.setSourceDocument(oDoc) + + Dim aFilterDescr(0) As New com.sun.star.beans.PropertyValue + aFilterDescr(0).Name = "FilterName" + aFilterDescr(0).Value = "sdraw: StarOffice XML (Draw)" + oFilterDescriptor = aFilterDescr() + + oSrcDocument = oDoc +Exit Sub +ErrHndl: + Test.Exception() +End Sub + +Global oDocHandler As Object + +Function checkFilter() As Boolean + checkFilter = oDocHandler.getByName("XMLIsCorrect") + Out.Log(oDocHandler.getByName("XMLCode")) +End Function +</script:module> diff --git a/qadevOOo/tests/basic/mod/xmloff/Draw/XMLImporter/script.xlb b/qadevOOo/tests/basic/mod/xmloff/Draw/XMLImporter/script.xlb new file mode 100644 index 000000000000..32a461e579e6 --- /dev/null +++ b/qadevOOo/tests/basic/mod/xmloff/Draw/XMLImporter/script.xlb @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd"> +<library:library xmlns:library="http://openoffice.org/2000/library" library:name="xmloff_Draw_XMLImporter" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="xmloff_Draw_XMLImporter"/> +"</library:library> diff --git a/qadevOOo/tests/basic/mod/xmloff/Draw/XMLImporter/xmloff_Draw_XMLImporter.xba b/qadevOOo/tests/basic/mod/xmloff/Draw/XMLImporter/xmloff_Draw_XMLImporter.xba new file mode 100644 index 000000000000..c51248716507 --- /dev/null +++ b/qadevOOo/tests/basic/mod/xmloff/Draw/XMLImporter/xmloff_Draw_XMLImporter.xba @@ -0,0 +1,115 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="xmloff_Draw_XMLImporter" script:language="StarBasic"> + + +'************************************************************************* +' +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' 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. +' +'************************************************************************* +'************************************************************************* + + + +' Be sure that all variables are dimensioned: +option explicit + + +' REQUIRED VARIABLES for interface/service tests: + +' Required for com.sun.star.xml.sax.XDocumentHandler + Global vXMLData As Variant + +' Required for procedure CheckImport + Global sName1, sName2 As String + +' Required for com.sun.star.document.XImporter: + Global oSrcDocument As Object + + +Sub CreateObj() + +'************************************************************************* +' COMPONENT: +' xmloff.Draw.XMLImporter +'************************************************************************* +On Error Goto ErrHndl + oDoc = utils.createDocument("sdraw", cObjectName) + oObj = createUnoService("com.sun.star.comp.Draw.XMLImporter") + + oSrcDocument = oDoc + oObj.setTargetDocument(oDoc) + + sName1 = "NewSlide1" + sName2 = "NewSlide2" + vXMLData = Array( _ + Array("start", "office:document", _ + "xmlns:office", "CDATA", "http://openoffice.org/2000/office", _ + "xmlns:draw", "CDATA", "http://openoffice.org/2000/drawing", _ + "office:class", "CDATA", "drawing", _ + "office:version", "CDATA", "1.0"), _ + Array("start", "office:body"), _ + Array("start", "draw:page", _ + "draw:name", "CDATA", sName1, _ + "draw:master-page-name", "CDATA", "Default"), _ + Array("end", "draw:page"), _ + Array("start", "draw:page", _ + "draw:name", "CDATA", sName2, _ + "draw:master-page-name", "CDATA", "Default"), _ + Array("end","draw:page"), _ + Array("end", "draw:page"), _ + Array("end", "office:body"), _ + Array("end", "office:document")) +Exit Sub +ErrHndl: + Test.Exception() +End Sub + +Function CheckImport() As Boolean + Dim i As Integer + Dim res, res1, res2 As Boolean + Dim oPages, oPage As Object + Dim pageName As String + out.log("checking of import...") + res1 = False + res2 = False + oPages = oDoc.getDrawPages() + out.log("Draw pages:") + For i = 0 to ( oPages.getCount() - 1 ) + oPage = oPages.getByIndex(i) + pageName = oPage.getName() + out.log(pageName) + If pageName = sName1 then + res1 = True + EndIf + If pageName = sName2 then + res2 = True + EndIf + Next i + res = res1 and res2 + out.log("checking result: " + res) + CheckImport() = res +End Function +</script:module> diff --git a/qadevOOo/tests/basic/mod/xmloff/Draw/XMLMetaExporter/script.xlb b/qadevOOo/tests/basic/mod/xmloff/Draw/XMLMetaExporter/script.xlb new file mode 100644 index 000000000000..96e8b72ced2c --- /dev/null +++ b/qadevOOo/tests/basic/mod/xmloff/Draw/XMLMetaExporter/script.xlb @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd"> +<library:library xmlns:library="http://openoffice.org/2000/library" library:name="xmloff_Draw_XMLMetaExporter" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="xmloff_Draw_XMLMetaExporter"/> +"</library:library> diff --git a/qadevOOo/tests/basic/mod/xmloff/Draw/XMLMetaExporter/xmloff_Draw_XMLMetaExporter.xba b/qadevOOo/tests/basic/mod/xmloff/Draw/XMLMetaExporter/xmloff_Draw_XMLMetaExporter.xba new file mode 100644 index 000000000000..5f753854404b --- /dev/null +++ b/qadevOOo/tests/basic/mod/xmloff/Draw/XMLMetaExporter/xmloff_Draw_XMLMetaExporter.xba @@ -0,0 +1,111 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="xmloff_Draw_XMLMetaExporter" script:language="StarBasic"> + + +'************************************************************************* +' +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' 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. +' +'************************************************************************* +'************************************************************************* + + + +' Be sure that all variables are dimensioned: +option explicit + + +' REQUIRED VARIABLES for interface/service tests: + +'Required for com.sun.star.document.XFilter +Global oFilterDescriptor As Variant + +'Required for com.sun.star.lang.XInitialization +Global aInitArgs() As Variant + +'Required for com.sun.star.document.XExporter +Global oSrcDocument As Object + + +Sub CreateObj() + +'************************************************************************* +' COMPONENT: +' xmloff.Draw.XMLMetaExporter +'************************************************************************* +On error goto ErrHndl + Dim initArgs(0) As Object + Dim oMSF As Object + Dim oDocInfo As Variant + Dim filter As Variant + Dim Tag1, Tag2, Tag3 As Variant + Dim printXML As Boolean + Dim expString As String + + printXML = true + expString = "NewTitleOfDrawDocument" + oMSF = getProcessServiceManager() + oDoc = utils.createDocument("sdraw", cObjectName) + oDocHandler = oMSF.createInstanceWithArguments("basichelper.DocumentHandler", Array(printXML)) + + Tag1 = Array("office:document-meta") + Tag2 = Array("office:meta") + Tag3 = Array("dc:title") + filter = Array( _ + Array("TagExists", Tag1), _ + Array("TagEnclosed", Tag2, Tag1), _ + Array("TagEnclosed", Tag3, Tag2), _ + Array("CharsEnclosed", Tag3, expString) _ + ) + + oDocHandler.initialize(filter) + + initArgs(0) = oDocHandler + aInitArgs = initArgs() + oObj = oMSF.createInstanceWithArguments("com.sun.star.comp.Draw.XMLMetaExporter", initArgs()) + + oDocInfo = oDoc.getDocumentInfo() + oDocInfo.setPropertyValue("Title", expString) + + oObj.setSourceDocument(oDoc) + + Dim aFilterDescr(0) As New com.sun.star.beans.PropertyValue + aFilterDescr(0).Name = "FilterName" + aFilterDescr(0).Value = "sdraw: StarOffice XML (Draw)" + oFilterDescriptor = aFilterDescr() + + oSrcDocument = oDoc +Exit Sub +ErrHndl: + Test.Exception() +End Sub + +Global oDocHandler As Object + +Function checkFilter() As Boolean + checkFilter = oDocHandler.getByName("XMLIsCorrect") + Out.Log(oDocHandler.getByName("XMLCode")) +End Function +</script:module> diff --git a/qadevOOo/tests/basic/mod/xmloff/Draw/XMLMetaImporter/script.xlb b/qadevOOo/tests/basic/mod/xmloff/Draw/XMLMetaImporter/script.xlb new file mode 100644 index 000000000000..a6badc66cb20 --- /dev/null +++ b/qadevOOo/tests/basic/mod/xmloff/Draw/XMLMetaImporter/script.xlb @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd"> +<library:library xmlns:library="http://openoffice.org/2000/library" library:name="xmloff_Draw_XMLMetaImporter" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="xmloff_Draw_XMLMetaImporter"/> +"</library:library> diff --git a/qadevOOo/tests/basic/mod/xmloff/Draw/XMLMetaImporter/xmloff_Draw_XMLMetaImporter.xba b/qadevOOo/tests/basic/mod/xmloff/Draw/XMLMetaImporter/xmloff_Draw_XMLMetaImporter.xba new file mode 100644 index 000000000000..01cd7d4e03bd --- /dev/null +++ b/qadevOOo/tests/basic/mod/xmloff/Draw/XMLMetaImporter/xmloff_Draw_XMLMetaImporter.xba @@ -0,0 +1,94 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="xmloff_Draw_XMLMetaImporter" script:language="StarBasic"> + + +'************************************************************************* +' +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' 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. +' +'************************************************************************* +'************************************************************************* + + + +' Be sure that all variables are dimensioned: +option explicit + + +' REQUIRED VARIABLES for interface/service tests: + +' Required for com.sun.star.xml.sax.XDocumentHandler + Global vXMLData As Variant + +' Required for procedure CheckImport + Global sTitle As String + +' Required for com.sun.star.document.XImporter: + Global oSrcDocument As Object + + +Sub CreateObj() + +'************************************************************************* +' COMPONENT: +' xmloff.Draw.XMLMetaImporter +'************************************************************************* +On Error Goto ErrHndl + oDoc = utils.createDocument("sdraw", cObjectName) + oObj = createUnoService("com.sun.star.comp.Draw.XMLMetaImporter") + + oSrcDocument = oDoc + oObj.setTargetDocument(oDoc) + + sTitle = "XMLMetaImporter_Title" + vXMLData = Array( _ + Array("start", "office:document-meta", _ + "xmlns:office", "CDATA", "http://openoffice.org/2000/office", _ + "xmlns:meta", "CDATA", "http://openoffice.org/2000/meta", _ + "xmlns:dc", "CDATA", "http://purl.org/dc/elements/1.1/"), _ + Array("start", "office:meta"), _ + Array("start", "dc:title"), _ + Array("chars", sTitle), _ + Array("end", "dc:title"), _ + Array("end", "office:meta"), _ + Array("end", "office:document-meta")) +Exit Sub +ErrHndl: + Test.Exception() +End Sub + +Function CheckImport() As Boolean + Dim res As Boolean + Dim oDocInfo As Object + Dim title As String + out.log("checking of import...") + oDocInfo = oDoc.getDocumentInfo() + title = oDocInfo.getPropertyValue("Title") + out.log("Title: " + title) + res = (title = sTitle) + out.log("checking result: " + res) + CheckImport() = res +End Function +</script:module> diff --git a/qadevOOo/tests/basic/mod/xmloff/Draw/XMLSettingsExporter/script.xlb b/qadevOOo/tests/basic/mod/xmloff/Draw/XMLSettingsExporter/script.xlb new file mode 100644 index 000000000000..8377839ac00c --- /dev/null +++ b/qadevOOo/tests/basic/mod/xmloff/Draw/XMLSettingsExporter/script.xlb @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd"> +<library:library xmlns:library="http://openoffice.org/2000/library" library:name="xmloff_Draw_XMLSettingsExporter" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="xmloff_Draw_XMLSettingsExporter"/> +"</library:library> diff --git a/qadevOOo/tests/basic/mod/xmloff/Draw/XMLSettingsExporter/xmloff_Draw_XMLSettingsExporter.xba b/qadevOOo/tests/basic/mod/xmloff/Draw/XMLSettingsExporter/xmloff_Draw_XMLSettingsExporter.xba new file mode 100644 index 000000000000..d8ccb9fa0b4f --- /dev/null +++ b/qadevOOo/tests/basic/mod/xmloff/Draw/XMLSettingsExporter/xmloff_Draw_XMLSettingsExporter.xba @@ -0,0 +1,119 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="xmloff_Draw_XMLSettingsExporter" script:language="StarBasic"> + + +'************************************************************************* +' +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' 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. +' +'************************************************************************* +'************************************************************************* + + + +' Be sure that all variables are dimensioned: +option explicit + + +' REQUIRED VARIABLES for interface/service tests: + +'Required for com.sun.star.document.XFilter +Global oFilterDescriptor As Variant + +'Required for com.sun.star.lang.XInitialization +Global aInitArgs() As Variant + +'Required for com.sun.star.document.XExporter +Global oSrcDocument As Object + + +Sub CreateObj() + +'************************************************************************* +' COMPONENT: +' xmloff.Draw.XMLSettingsExporter +'************************************************************************* +On error goto ErrHndl + Dim initArgs(0) As Object + Dim oMSF As Object + Dim oController As Object + Dim oProp, oPropToSet As Boolean + Dim filter As Variant + Dim Tag1, Tag2, Tag3, Tag4, Tag5 As Variant + Dim printXML As Boolean + + printXML = true + oMSF = getProcessServiceManager() + oDoc = utils.createDocument("sdraw", cObjectName) + oDocHandler = oMSF.createInstanceWithArguments("basichelper.DocumentHandler", Array(printXML)) + + oController = oDoc.getCurrentController() + oProp = oController.getPropertyValue("IsLayerMode") + if (oProp = false) then + oPropToSet = true + else + oPropToSet = false + endif + + Tag1 = Array("office:document-settings") + Tag2 = Array("office:settings") + Tag3 = Array("config:config-item-set") + Tag4 = Array("config:config-item-map-indexed") + Tag5 = Array("config:config-item", "config:name", "IsLayerMode") + filter = Array( _ + Array("TagExists", Tag1), _ + Array("TagEnclosed", Tag2, Tag1), _ + Array("TagEnclosed", Tag3, Tag2), _ + Array("TagEnclosed", Tag4, Tag3), _ + Array("CharsEnclosed", Tag5, LCase(oPropToSet)) _ + ) + oDocHandler.initialize(filter) + + initArgs(0) = oDocHandler + aInitArgs = initArgs() + oObj = oMSF.createInstanceWithArguments("com.sun.star.comp.Draw.XMLSettingsExporter", initArgs()) + + oController.setPropertyValue("IsLayerMode", oPropToSet) + + oObj.setSourceDocument(oDoc) + + Dim aFilterDescr(0) As New com.sun.star.beans.PropertyValue + aFilterDescr(0).Name = "FilterName" + aFilterDescr(0).Value = "sdraw: StarOffice XML (Draw)" + oFilterDescriptor = aFilterDescr() + + oSrcDocument = oDoc +Exit Sub +ErrHndl: + Test.Exception() +End Sub + +Global oDocHandler As Object + +Function checkFilter() As Boolean + checkFilter = oDocHandler.getByName("XMLIsCorrect") + Out.Log(oDocHandler.getByName("XMLCode")) +End Function +</script:module> diff --git a/qadevOOo/tests/basic/mod/xmloff/Draw/XMLSettingsImporter/script.xlb b/qadevOOo/tests/basic/mod/xmloff/Draw/XMLSettingsImporter/script.xlb new file mode 100644 index 000000000000..86c163212d91 --- /dev/null +++ b/qadevOOo/tests/basic/mod/xmloff/Draw/XMLSettingsImporter/script.xlb @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd"> +<library:library xmlns:library="http://openoffice.org/2000/library" library:name="xmloff_Draw_XMLSettingsImporter" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="xmloff_Draw_XMLSettingsImporter"/> +"</library:library> diff --git a/qadevOOo/tests/basic/mod/xmloff/Draw/XMLSettingsImporter/xmloff_Draw_XMLSettingsImporter.xba b/qadevOOo/tests/basic/mod/xmloff/Draw/XMLSettingsImporter/xmloff_Draw_XMLSettingsImporter.xba new file mode 100644 index 000000000000..684ecd815318 --- /dev/null +++ b/qadevOOo/tests/basic/mod/xmloff/Draw/XMLSettingsImporter/xmloff_Draw_XMLSettingsImporter.xba @@ -0,0 +1,95 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="xmloff_Draw_XMLSettingsImporter" script:language="StarBasic"> + + +'************************************************************************* +' +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' 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. +' +'************************************************************************* +'************************************************************************* + + + +' Be sure that all variables are dimensioned: +option explicit + + +' REQUIRED VARIABLES for interface/service tests: + +' Required for com.sun.star.xml.sax.XDocumentHandler + Global vXMLData As Variant + +' Required for com.sun.star.document.XImporter: + Global oSrcDocument As Object + + +Sub CreateObj() + +'************************************************************************* +' COMPONENT: +' xmloff.Draw.XMLSettingsImporter +'************************************************************************* +On Error Goto ErrHndl + oDoc = utils.createDocument("sdraw", cObjectName) + oObj = createUnoService("com.sun.star.comp.Draw.XMLSettingsImporter") + + oSrcDocument = oDoc + oObj.setTargetDocument(oDoc) + + vXMLData = Array( _ + Array("start", "office:document-settings", _ + "xmlns:office", "CDATA", "http://openoffice.org/2000/office", _ + "xmlns:config", "CDATA", "http://openoffice.org/2001/config"), _ + Array("start", "office:settings"), _ + Array("start", "config:config-item-set", _ + "config:name", "CDATA", "view-settings"), _ + Array("start", "config:config-item-map-indexed", _ + "config:name", "CDATA", "Views"), _ + Array("start", "config:config-item-map-entry"), _ + Array("start", "config:config-item", _ + "config:name", "CDATA", "IsLayerMode", _ + "config:type", "CDATA", "boolean"), _ + Array("chars", "true"), _ + Array("end", "config:config-item"), _ + Array("end", "config:config-item-map-entry"), _ + Array("end", "config:config-item-map-indexed"), _ + Array("end", "config:config-item-set"), _ + Array("end", "office:settings"), _ + Array("end", "office:document-settings")) +Exit Sub +ErrHndl: + Test.Exception() +End Sub + +Function CheckImport() As Boolean + Dim res As Boolean + Dim oController As Object + oController = oDoc.getCurrentController() + res = oController.getPropertyValue("IsLayerMode") + out.log("Value after import: " + res) + CheckImport() = res +End Function +</script:module> diff --git a/qadevOOo/tests/basic/mod/xmloff/Draw/XMLStylesExporter/script.xlb b/qadevOOo/tests/basic/mod/xmloff/Draw/XMLStylesExporter/script.xlb new file mode 100644 index 000000000000..7e90b5d6abd4 --- /dev/null +++ b/qadevOOo/tests/basic/mod/xmloff/Draw/XMLStylesExporter/script.xlb @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd"> +<library:library xmlns:library="http://openoffice.org/2000/library" library:name="xmloff_Draw_XMLStylesExporter" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="xmloff_Draw_XMLStylesExporter"/> +"</library:library> diff --git a/qadevOOo/tests/basic/mod/xmloff/Draw/XMLStylesExporter/xmloff_Draw_XMLStylesExporter.xba b/qadevOOo/tests/basic/mod/xmloff/Draw/XMLStylesExporter/xmloff_Draw_XMLStylesExporter.xba new file mode 100644 index 000000000000..cf46fdafd941 --- /dev/null +++ b/qadevOOo/tests/basic/mod/xmloff/Draw/XMLStylesExporter/xmloff_Draw_XMLStylesExporter.xba @@ -0,0 +1,116 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="xmloff_Draw_XMLStylesExporter" script:language="StarBasic"> + + +'************************************************************************* +' +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' 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. +' +'************************************************************************* +'************************************************************************* + + + +' Be sure that all variables are dimensioned: +option explicit + + +' REQUIRED VARIABLES for interface/service tests: + +'Required for com.sun.star.document.XFilter +Global oFilterDescriptor As Variant + +'Required for com.sun.star.lang.XInitialization +Global aInitArgs() As Variant + +'Required for com.sun.star.document.XExporter +Global oSrcDocument As Object + +Dim counter As Integer + + +Sub CreateObj() + +'************************************************************************* +' COMPONENT: +' xmloff.Draw.XMLStylesExporter +'************************************************************************* +On error goto ErrHndl + Dim initArgs(0), oMSF, oStyleFamilies, oFamily, oStyle As Object + Dim oSFNames As Variant + Dim oFamilyName As String + Dim printXML As Boolean + Dim Tag1, Tag2, Tag3 As Variant + Dim expString As String + Dim filter As Variant + + printXML = true + expString = "NewStyle" + counter = counter +1 + oMSF = getProcessServiceManager() + oDoc = utils.createDocument("sdraw", cObjectName) + oDocHandler = oMSF.createInstanceWithArguments("basichelper.DocumentHandler", Array(printXML)) + + Tag1 = Array("office:document-styles") + Tag2 = Array("office:styles") + Tag3 = Array("style:style", "style:name", expString) + filter = Array( _ + Array("TagExists", Tag1, Tag2, Tag3), _ + Array("TagEnclosed", Tag3, Tag2) _ + ) + + oDocHandler.initialize(filter) + + initArgs(0) = oDocHandler + aInitArgs = initArgs() + oObj = oMSF.createInstanceWithArguments("com.sun.star.comp.Draw.XMLStylesExporter", initArgs()) + + oStyleFamilies = oDoc.getStyleFamilies() + oSFNames = oStyleFamilies.getElementNames() + oFamilyName = oSFNames(0) + oFamily = oStyleFamilies.getByName(oFamilyName) + oStyle = oDoc.createInstance("com.sun.star.style.Style") + oFamily.insertByName(expString, oStyle) + + oObj.setSourceDocument(oDoc) + + Dim aFilterDescr(0) As New com.sun.star.beans.PropertyValue + aFilterDescr(0).Name = "FilterName" + aFilterDescr(0).Value = "sdraw: StarOffice XML (Draw)" + oFilterDescriptor = aFilterDescr() + + oSrcDocument = oDoc +Exit Sub +ErrHndl: + Test.Exception() +End Sub + +Global oDocHandler As Object + +Function checkFilter() As Boolean + checkFilter = oDocHandler.getByName("XMLIsCorrect") + Out.Log(oDocHandler.getByName("XMLCode")) +End Function +</script:module> diff --git a/qadevOOo/tests/basic/mod/xmloff/Draw/XMLStylesImporter/script.xlb b/qadevOOo/tests/basic/mod/xmloff/Draw/XMLStylesImporter/script.xlb new file mode 100644 index 000000000000..1f6b8de5ef0c --- /dev/null +++ b/qadevOOo/tests/basic/mod/xmloff/Draw/XMLStylesImporter/script.xlb @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd"> +<library:library xmlns:library="http://openoffice.org/2000/library" library:name="xmloff_Draw_XMLStylesImporter" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="xmloff_Draw_XMLStylesImporter"/> +"</library:library> diff --git a/qadevOOo/tests/basic/mod/xmloff/Draw/XMLStylesImporter/xmloff_Draw_XMLStylesImporter.xba b/qadevOOo/tests/basic/mod/xmloff/Draw/XMLStylesImporter/xmloff_Draw_XMLStylesImporter.xba new file mode 100644 index 000000000000..4d8793134d31 --- /dev/null +++ b/qadevOOo/tests/basic/mod/xmloff/Draw/XMLStylesImporter/xmloff_Draw_XMLStylesImporter.xba @@ -0,0 +1,93 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="xmloff_Draw_XMLStylesImporter" script:language="StarBasic"> + + +'************************************************************************* +' +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' 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. +' +'************************************************************************* +'************************************************************************* + + + +' Be sure that all variables are dimensioned: +option explicit + + +' REQUIRED VARIABLES for interface/service tests: + +' Required for com.sun.star.xml.sax.XDocumentHandler + Global vXMLData As Variant + +' Required for procedure CheckImport + Global sStyleName, sFamilyName As String + +' Required for com.sun.star.document.XImporter: + Global oSrcDocument As Object + + +Sub CreateObj() + +'************************************************************************* +' COMPONENT: +' xmloff.Draw.XMLStylesImporter +'************************************************************************* +On Error Goto ErrHndl + oDoc = utils.createDocument("sdraw", cObjectName) + oObj = createUnoService("com.sun.star.comp.Draw.XMLStylesImporter") + + oSrcDocument = oDoc + oObj.setTargetDocument(oDoc) + + sStyleName = "New style for test XMLStylesImporter" + sFamilyName = "graphics" + vXMLData = Array( _ + Array("start", "office:document-styles", _ + "xmlns:office", "CDATA", "http://openoffice.org/2000/office", _ + "xmlns:style", "CDATA", "http://openoffice.org/2000/style"), _ + Array("start", "office:styles"), _ + Array("start", "style:style", _ + "style:name", "CDATA", sStyleName, _ + "style:family", "CDATA", sFamilyName), _ + Array("end", "style:style"), _ + Array("end", "office:styles"), _ + Array("end", "office:document")) +Exit Sub +ErrHndl: + Test.Exception() +End Sub + +Function CheckImport() As Boolean + Dim res As Boolean + Dim oStyleFamilies, oFamily As Object + out.log("checking of import...") + oStyleFamilies = oDoc.getStyleFamilies() + oFamily = oStyleFamilies.getByName(sFamilyName) + res = oFamily.hasByName(sStyleName) + out.log("checking result: " + res) + CheckImport() = res +End Function +</script:module> diff --git a/qadevOOo/tests/basic/mod/xmloff/Impress/XMLContentExporter/script.xlb b/qadevOOo/tests/basic/mod/xmloff/Impress/XMLContentExporter/script.xlb new file mode 100644 index 000000000000..21db72258f7f --- /dev/null +++ b/qadevOOo/tests/basic/mod/xmloff/Impress/XMLContentExporter/script.xlb @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd"> +<library:library xmlns:library="http://openoffice.org/2000/library" library:name="xmloff_Impress_XMLContentExporter" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="xmloff_Impress_XMLContentExporter"/> +"</library:library> diff --git a/qadevOOo/tests/basic/mod/xmloff/Impress/XMLContentExporter/xmloff_Impress_XMLContentExporter.xba b/qadevOOo/tests/basic/mod/xmloff/Impress/XMLContentExporter/xmloff_Impress_XMLContentExporter.xba new file mode 100644 index 000000000000..ecae9c11962c --- /dev/null +++ b/qadevOOo/tests/basic/mod/xmloff/Impress/XMLContentExporter/xmloff_Impress_XMLContentExporter.xba @@ -0,0 +1,112 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="xmloff_Impress_XMLContentExporter" script:language="StarBasic"> + + +'************************************************************************* +' +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' 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. +' +'************************************************************************* +'************************************************************************* + + + +' Be sure that all variables are dimensioned: +option explicit + + +' REQUIRED VARIABLES for interface/service tests: + +'Required for com.sun.star.document.XFilter +Global oFilterDescriptor As Variant + +'Required for com.sun.star.lang.XInitialization +Global aInitArgs() As Variant + +'Required for com.sun.star.document.XExporter +Global oSrcDocument As Object + + +Sub CreateObj() + +'************************************************************************* +' COMPONENT: +' xmloff.Impress.XMLContentExporter +'************************************************************************* +On error goto ErrHndl + Dim initArgs(0) As Object + Dim oMSF As Object + Dim oDrawPages As Object + Dim oDrawPage As Object + Dim printXML As Boolean + Dim filter As Variant + Dim expString As String + Dim Tag1, Tag2, Tag3 As Variant + + printXML = true + expString = "NewNameOfDrawPage" + oMSF = getProcessServiceManager() + oDoc = utils.createImpressDocument(cObjectName) + oDocHandler = oMSF.createInstanceWithArguments("basichelper.DocumentHandler", Array(printXML)) + + Tag1 = Array("office:document-content") + Tag2 = Array("office:body") + Tag3 = Array("draw:page", "draw:name", expString) + filter = Array( _ + Array("TagExists", Tag1), _ + Array("TagEnclosed", Tag2, Tag1), _ + Array("TagEnclosed", Tag3, Tag2) _ + ) + + oDocHandler.initialize(filter) + + initArgs(0) = oDocHandler + aInitArgs = initArgs() + oObj = oMSF.createInstanceWithArguments("com.sun.star.comp.Impress.XMLContentExporter", initArgs()) + + oDrawPages = oDoc.getDrawPages() + oDrawPage = oDrawPages.getByIndex(0) + oDrawPage.setName(expString) + + oObj.setSourceDocument(oDoc) + + Dim aFilterDescr(0) As New com.sun.star.beans.PropertyValue + aFilterDescr(0).Name = "FilterName" + aFilterDescr(0).Value = "simpress: StarOffice XML (Impress)" + oFilterDescriptor = aFilterDescr() + + oSrcDocument = oDoc +Exit Sub +ErrHndl: + Test.Exception() +End Sub + +Global oDocHandler As Object + +Function checkFilter() As Boolean + checkFilter = oDocHandler.getByName("XMLIsCorrect") + Out.Log(oDocHandler.getByName("XMLCode")) +End Function +</script:module> diff --git a/qadevOOo/tests/basic/mod/xmloff/Impress/XMLContentImporter/script.xlb b/qadevOOo/tests/basic/mod/xmloff/Impress/XMLContentImporter/script.xlb new file mode 100644 index 000000000000..3e9ff2fc3259 --- /dev/null +++ b/qadevOOo/tests/basic/mod/xmloff/Impress/XMLContentImporter/script.xlb @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd"> +<library:library xmlns:library="http://openoffice.org/2000/library" library:name="xmloff_Impress_XMLContentImporter" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="xmloff_Impress_XMLContentImporter"/> +"</library:library> diff --git a/qadevOOo/tests/basic/mod/xmloff/Impress/XMLContentImporter/xmloff_Impress_XMLContentImporter.xba b/qadevOOo/tests/basic/mod/xmloff/Impress/XMLContentImporter/xmloff_Impress_XMLContentImporter.xba new file mode 100644 index 000000000000..4a2ed5d7f7b7 --- /dev/null +++ b/qadevOOo/tests/basic/mod/xmloff/Impress/XMLContentImporter/xmloff_Impress_XMLContentImporter.xba @@ -0,0 +1,128 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="xmloff_Impress_XMLContentImporter" script:language="StarBasic"> + + +'************************************************************************* +' +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' 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. +' +'************************************************************************* +'************************************************************************* + + + +' Be sure that all variables are dimensioned: +option explicit + + +' REQUIRED VARIABLES for interface/service tests: + +' Required for com.sun.star.xml.sax.XDocumentHandler + Global vXMLData As Variant + +' Required for procedure CheckImport + Global sPageName As String + +' Required for com.sun.star.document.XImporter: + Global oSrcDocument As Object + + +Sub CreateObj() + +'************************************************************************* +' COMPONENT: +' xmloff.Impress.XMLContentImporter +'************************************************************************* +On Error Goto ErrHndl + oDoc = utils.createImpressDocument(cObjectName) + oObj = createUnoService("com.sun.star.comp.Draw.XMLContentImporter") + + oSrcDocument = oDoc + oObj.setTargetDocument(oDoc) + + sPageName = "XMLImporterPage" + vXMLData = Array( _ + Array("start", "office:document", _ + "xmlns:office", "CDATA", "http://openoffice.org/2000/office", _ + "xmlns:presentation", "CDATA", "http://openoffice.org/2000/presentation", _ + "xmlns:svg", "CDATA", "http://openoffice.org/2000/svg", _ + "xmlns:draw", "CDATA", "http://openoffice.org/2000/drawing", _ + "office:class", "CDATA", "presentation", _ + "office:version", "CDATA", "1.0"), _ + Array("start", "office:body"), _ + Array("start", "draw:page", _ + "draw:name", "CDATA", sPageName, _ + "draw:master-page-name", "CDATA", "Default"), _ + Array("start", "presentation:notes"), _ + Array("start", "draw:page-thumbnail", _ + "draw:style-name", "CDATA", "gr1", _ + "draw:layer", "CDATA", "layout", _ + "svg:width", "CDATA", "12.768cm", _ + "svg:height", "CDATA", "9.576cm", _ + "svg:x", "CDATA", "4.411cm", _ + "svg:y", "CDATA", "2.794cm", _ + "presentation:class", "CDATA", "page", _ + "draw:page-number", "CDATA", "1"), _ + Array("end", "draw:page-thumbnail"), _ + Array("start", "draw:text-box", _ + "presentation:style-name", "CDATA", "Default-notes", _ + "draw:layer", "CDATA", "layout", _ + "svg:width", "CDATA", "15.021cm", _ + "svg:height", "CDATA", "10.63cm", _ + "svg:x", "CDATA", "3.292cm", _ + "svg:y", "CDATA", "13.299cm", _ + "presentation:class", "CDATA", "notes", _ + "presentation:placeholder", "CDATA", "true"), _ + Array("end", "draw:text-box"), _ + Array("end", "presentation:notes"), _ + Array("end", "draw:page"), _ + Array("end", "office:body"), _ + Array("end", "office:document")) +Exit Sub +ErrHndl: + Test.Exception() +End Sub + +Function CheckImport() As Boolean + Dim i As Integer + Dim res As Boolean + Dim oPages, oPage As Object + Dim pageName As String + res = False + out.log("checking of import...") + oPages = oDoc.getDrawPages() + out.log("Draw pages:") + For i = 0 to oPages.getCount() - 1 + oPage = oPages.getByIndex(i) + pageName = oPage.getName() + out.log(pageName) + If pageName = sPageName then + res = True + EndIf + Next i + out.log("checking result: " + res) + CheckImport() = res +End Function +</script:module> diff --git a/qadevOOo/tests/basic/mod/xmloff/Impress/XMLExporter/script.xlb b/qadevOOo/tests/basic/mod/xmloff/Impress/XMLExporter/script.xlb new file mode 100644 index 000000000000..c2bc67de1188 --- /dev/null +++ b/qadevOOo/tests/basic/mod/xmloff/Impress/XMLExporter/script.xlb @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd"> +<library:library xmlns:library="http://openoffice.org/2000/library" library:name="xmloff_Impress_XMLExporter" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="xmloff_Impress_XMLExporter"/> +"</library:library> diff --git a/qadevOOo/tests/basic/mod/xmloff/Impress/XMLExporter/xmloff_Impress_XMLExporter.xba b/qadevOOo/tests/basic/mod/xmloff/Impress/XMLExporter/xmloff_Impress_XMLExporter.xba new file mode 100644 index 000000000000..7d7f74a9a5c5 --- /dev/null +++ b/qadevOOo/tests/basic/mod/xmloff/Impress/XMLExporter/xmloff_Impress_XMLExporter.xba @@ -0,0 +1,112 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="xmloff_Impress_XMLExporter" script:language="StarBasic"> + + +'************************************************************************* +' +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' 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. +' +'************************************************************************* +'************************************************************************* + + + +' Be sure that all variables are dimensioned: +option explicit + + +' REQUIRED VARIABLES for interface/service tests: + +'Required for com.sun.star.document.XFilter +Global oFilterDescriptor As Variant + +'Required for com.sun.star.lang.XInitialization +Global aInitArgs() As Variant + +'Required for com.sun.star.document.XExporter +Global oSrcDocument As Object + + +Sub CreateObj() + +'************************************************************************* +' COMPONENT: +' xmloff.Impress.XMLExporter +'************************************************************************* +On error goto ErrHndl + Dim initArgs(0) As Object + Dim oMSF As Object + Dim oDrawPages, oDrawPage As Object + Dim printXML As Boolean + Dim filter As Variant + Dim expString As String + Dim Tag1, Tag2, Tag3 As Variant + + printXML = true + expString = "NewNameOfDrawPageInserted" + oMSF = getProcessServiceManager() + oDoc = utils.createImpressDocument(cObjectName) + oDocHandler = oMSF.createInstanceWithArguments("basichelper.DocumentHandler", Array(printXML)) + + Tag1 = Array("office:document") + Tag2 = Array("office:body") + Tag3 = Array("draw:page", "draw:name", expString) + filter = Array( _ + Array("TagExists", Tag1), _ + Array("TagEnclosed", Tag2, Tag1), _ + Array("TagEnclosed", Tag3, Tag2) _ + ) + + oDocHandler.initialize(filter) + + initArgs(0) = oDocHandler + aInitArgs = initArgs() + oObj = oMSF.createInstanceWithArguments("com.sun.star.comp.Impress.XMLExporter", initArgs()) + + oDrawPages = oDoc.getDrawPages() + oDrawPages.insertNewByIndex(0) + oDrawPage = oDrawPages.getByIndex(0) + oDrawPage.setName(expString) + + oObj.setSourceDocument(oDoc) + + Dim aFilterDescr(0) As New com.sun.star.beans.PropertyValue + aFilterDescr(0).Name = "FilterName" + aFilterDescr(0).Value = "simpress: StarOffice XML (Impress)" + oFilterDescriptor = aFilterDescr() + + oSrcDocument = oDoc +Exit Sub +ErrHndl: + Test.Exception() +End Sub + +Global oDocHandler As Object + +Function checkFilter() As Boolean + checkFilter = oDocHandler.getByName("XMLIsCorrect") + Out.Log(oDocHandler.getByName("XMLCode")) +End Function +</script:module> diff --git a/qadevOOo/tests/basic/mod/xmloff/Impress/XMLImporter/script.xlb b/qadevOOo/tests/basic/mod/xmloff/Impress/XMLImporter/script.xlb new file mode 100644 index 000000000000..156d8a1320c4 --- /dev/null +++ b/qadevOOo/tests/basic/mod/xmloff/Impress/XMLImporter/script.xlb @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd"> +<library:library xmlns:library="http://openoffice.org/2000/library" library:name="xmloff_Impress_XMLImporter" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="xmloff_Impress_XMLImporter"/> +"</library:library> diff --git a/qadevOOo/tests/basic/mod/xmloff/Impress/XMLImporter/xmloff_Impress_XMLImporter.xba b/qadevOOo/tests/basic/mod/xmloff/Impress/XMLImporter/xmloff_Impress_XMLImporter.xba new file mode 100644 index 000000000000..f2b748ae0932 --- /dev/null +++ b/qadevOOo/tests/basic/mod/xmloff/Impress/XMLImporter/xmloff_Impress_XMLImporter.xba @@ -0,0 +1,90 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="xmloff_Impress_XMLImporter" script:language="StarBasic"> + + +'************************************************************************* +' +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' 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. +' +'************************************************************************* +'************************************************************************* + + + +' Be sure that all variables are dimensioned: +option explicit + + +' REQUIRED VARIABLES for interface/service tests: + +' Required for com.sun.star.xml.sax.XDocumentHandler + Global vXMLData As Variant + +' Required for procedure CheckImport + Global sName As String + +' Required for com.sun.star.document.XImporter: + Global oSrcDocument As Object + + +Sub CreateObj() + +'************************************************************************* +' COMPONENT: +' xmloff.Impress.XMLImporter +'************************************************************************* +On Error Goto ErrHndl + oDoc = utils.createImpressDocument(cObjectName) + oObj = createUnoService("com.sun.star.comp.Impress.XMLImporter") + + oSrcDocument = oDoc + oObj.setTargetDocument(oDoc) + + sName = "XMLImporter" + vXMLData = Array( _ + Array("start", "office:document", _ + "xmlns:office", "CDATA", "http://openoffice.org/2000/office", _ + "xmlns:draw", "CDATA", "http://openoffice.org/2000/drawing"), _ + Array("start", "office:body"), _ + Array("start", "draw:page", _ + "draw:name", "CDATA", sName), _ + Array("end", "draw:page"), _ + Array("end", "office:body"), _ + Array("end", "office:document")) +Exit Sub +ErrHndl: + Test.Exception() +End Sub + +Function CheckImport() As Boolean + Dim res As Boolean + Dim oPages As Object + out.log("checking of import...") + oPages = oDoc.getDrawPages() + res = oPages.hasByName(sName) + out.log("checking result: " + res) + CheckImport() = res +End Function +</script:module> diff --git a/qadevOOo/tests/basic/mod/xmloff/Impress/XMLMetaExporter/script.xlb b/qadevOOo/tests/basic/mod/xmloff/Impress/XMLMetaExporter/script.xlb new file mode 100644 index 000000000000..626859cbd89f --- /dev/null +++ b/qadevOOo/tests/basic/mod/xmloff/Impress/XMLMetaExporter/script.xlb @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd"> +<library:library xmlns:library="http://openoffice.org/2000/library" library:name="xmloff_Impress_XMLMetaExporter" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="xmloff_Impress_XMLMetaExporter"/> +"</library:library> diff --git a/qadevOOo/tests/basic/mod/xmloff/Impress/XMLMetaExporter/xmloff_Impress_XMLMetaExporter.xba b/qadevOOo/tests/basic/mod/xmloff/Impress/XMLMetaExporter/xmloff_Impress_XMLMetaExporter.xba new file mode 100644 index 000000000000..35b08c5b9ae6 --- /dev/null +++ b/qadevOOo/tests/basic/mod/xmloff/Impress/XMLMetaExporter/xmloff_Impress_XMLMetaExporter.xba @@ -0,0 +1,111 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="xmloff_Impress_XMLMetaExporter" script:language="StarBasic"> + + +'************************************************************************* +' +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' 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. +' +'************************************************************************* +'************************************************************************* + + + +' Be sure that all variables are dimensioned: +option explicit + + +' REQUIRED VARIABLES for interface/service tests: + +'Required for com.sun.star.document.XFilter +Global oFilterDescriptor As Variant + +'Required for com.sun.star.lang.XInitialization +Global aInitArgs() As Variant + +'Required for com.sun.star.document.XExporter +Global oSrcDocument As Object + + +Sub CreateObj() + +'************************************************************************* +' COMPONENT: +' xmloff.Impress.XMLMetaExporter +'************************************************************************* +On error goto ErrHndl + Dim initArgs(0) As Object + Dim oMSF As Object + Dim oDocInfo As Object + Dim printXML As Boolean + Dim expString As String + Dim Tag1, Tag2, Tag3 As Variant + Dim filter As Variant + + printXML = true + expString = "NewTitleOfDrawDocument" + oMSF = getProcessServiceManager() + oDoc = utils.createImpressDocument(cObjectName) + oDocHandler = oMSF.createInstanceWithArguments("basichelper.DocumentHandler", Array(printXML)) + + Tag1 = Array("office:document-meta") + Tag2 = Array("office:meta") + Tag3 = Array("dc:title") + filter = Array( _ + Array("TagExists", Tag1), _ + Array("TagEnclosed", Tag2, Tag1), _ + Array("TagEnclosed", Tag3, Tag2), _ + Array("CharsEnclosed", Tag3, expString) _ + ) + + oDocHandler.initialize(filter) + + initArgs(0) = oDocHandler + aInitArgs = initArgs() + oObj = oMSF.createInstanceWithArguments("com.sun.star.comp.Impress.XMLMetaExporter", initArgs()) + + oDocInfo = oDoc.getDocumentInfo() + oDocInfo.setPropertyValue("Title", expString) + + oObj.setSourceDocument(oDoc) + + Dim aFilterDescr(0) As New com.sun.star.beans.PropertyValue + aFilterDescr(0).Name = "FilterName" + aFilterDescr(0).Value = "simpress: StarOffice XML (Impress)" + oFilterDescriptor = aFilterDescr() + + oSrcDocument = oDoc +Exit Sub +ErrHndl: + Test.Exception() +End Sub + +Global oDocHandler As Object + +Function checkFilter() As Boolean + checkFilter = oDocHandler.getByName("XMLIsCorrect") + Out.Log(oDocHandler.getByName("XMLCode")) +End Function +</script:module> diff --git a/qadevOOo/tests/basic/mod/xmloff/Impress/XMLMetaImporter/script.xlb b/qadevOOo/tests/basic/mod/xmloff/Impress/XMLMetaImporter/script.xlb new file mode 100644 index 000000000000..d14b4ba77dec --- /dev/null +++ b/qadevOOo/tests/basic/mod/xmloff/Impress/XMLMetaImporter/script.xlb @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd"> +<library:library xmlns:library="http://openoffice.org/2000/library" library:name="xmloff_Impress_XMLMetaImporter" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="xmloff_Impress_XMLMetaImporter"/> +"</library:library> diff --git a/qadevOOo/tests/basic/mod/xmloff/Impress/XMLMetaImporter/xmloff_Impress_XMLMetaImporter.xba b/qadevOOo/tests/basic/mod/xmloff/Impress/XMLMetaImporter/xmloff_Impress_XMLMetaImporter.xba new file mode 100644 index 000000000000..02cc5904d961 --- /dev/null +++ b/qadevOOo/tests/basic/mod/xmloff/Impress/XMLMetaImporter/xmloff_Impress_XMLMetaImporter.xba @@ -0,0 +1,93 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="xmloff_Impress_XMLMetaImporter" script:language="StarBasic"> + + +'************************************************************************* +' +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' 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. +' +'************************************************************************* +'************************************************************************* + + + +' Be sure that all variables are dimensioned: +option explicit + + +' REQUIRED VARIABLES for interface/service tests: + +' Required for com.sun.star.xml.sax.XDocumentHandler + Global vXMLData As Variant + +' Required for procedure CheckImport + Global sTitle As String + +' Required for com.sun.star.document.XImporter: + Global oSrcDocument As Object + + +Sub CreateObj() + +'************************************************************************* +' COMPONENT: +' xmloff.Impress.XMLMetaImporter +'************************************************************************* +On Error Goto ErrHndl + oDoc = utils.createImpressDocument(cObjectName) + oObj = createUnoService("com.sun.star.comp.Impress.XMLMetaImporter") + + oSrcDocument = oDoc + oObj.setTargetDocument(oDoc) + + sTitle = "XMLMetaImporter_Title" + vXMLData = Array( _ + Array("start", "office:document-meta", _ + "xmlns:office", "CDATA", "http://openoffice.org/2000/office", _ + "xmlns:dc", "CDATA", "http://purl.org/dc/elements/1.1/"), _ + Array("start", "office:meta"), _ + Array("start", "dc:title"), _ + Array("chars", sTitle), _ + Array("end", "dc:title"), _ + Array("end", "office:meta"), _ + Array("end", "office:document-meta")) +Exit Sub +ErrHndl: + Test.Exception() +End Sub + +Function CheckImport() As Boolean + Dim res As Boolean + Dim oDocInfo As Object + Dim title As String + out.log("checking of import...") + oDocInfo = oDoc.getDocumentInfo() + title = oDocInfo.getPropertyValue("Title") + out.log("Title: " + title) + res = (title = sTitle) + out.log("checking result: " + res) + CheckImport() = res +End Function +</script:module> diff --git a/qadevOOo/tests/basic/mod/xmloff/Impress/XMLSettingsExporter/script.xlb b/qadevOOo/tests/basic/mod/xmloff/Impress/XMLSettingsExporter/script.xlb new file mode 100644 index 000000000000..68a37fac28ca --- /dev/null +++ b/qadevOOo/tests/basic/mod/xmloff/Impress/XMLSettingsExporter/script.xlb @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd"> +<library:library xmlns:library="http://openoffice.org/2000/library" library:name="xmloff_Impress_XMLSettingsExporter" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="xmloff_Impress_XMLSettingsExporter"/> +"</library:library> diff --git a/qadevOOo/tests/basic/mod/xmloff/Impress/XMLSettingsExporter/xmloff_Impress_XMLSettingsExporter.xba b/qadevOOo/tests/basic/mod/xmloff/Impress/XMLSettingsExporter/xmloff_Impress_XMLSettingsExporter.xba new file mode 100644 index 000000000000..e379102d46f3 --- /dev/null +++ b/qadevOOo/tests/basic/mod/xmloff/Impress/XMLSettingsExporter/xmloff_Impress_XMLSettingsExporter.xba @@ -0,0 +1,123 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="xmloff_Impress_XMLSettingsExporter" script:language="StarBasic"> + + +'************************************************************************* +' +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' 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. +' +'************************************************************************* +'************************************************************************* + + + +' Be sure that all variables are dimensioned: +option explicit + + +' REQUIRED VARIABLES for interface/service tests: + +'Required for com.sun.star.document.XFilter +Global oFilterDescriptor As Variant + +'Required for com.sun.star.lang.XInitialization +Global aInitArgs() As Variant + +'Required for com.sun.star.document.XExporter +Global oSrcDocument As Object + + +Sub CreateObj() + +'************************************************************************* +' COMPONENT: +' xmloff.Impress.XMLSettingsExporter +'************************************************************************* +On error goto ErrHndl + Dim initArgs(0) As Object + Dim oMSF As Object + Dim oController As Object + Dim oProp, oPropToSet As Boolean + Dim printXML As Boolean + Dim filter As Variant + Dim Tag1, Tag2, Tag3, Tag4, Tag5, Tag6, Tag7 As Variant + + printXML = true + oMSF = getProcessServiceManager() + oDoc = utils.createImpressDocument(cObjectName) + oDocHandler = oMSF.createInstanceWithArguments("basichelper.DocumentHandler", Array(printXML)) + + oController = oDoc.getCurrentController() + oProp = oController.getPropertyValue("IsLayerMode") + if (oProp = false) then + oPropToSet = true + else + oPropToSet = false + endif + + Tag1 = Array("office:settings") + Tag2 = Array("office:document-settings") + Tag3 = Array("config:config-item-set") + Tag4 = Array("config:config-item-map-indexed") + Tag5 = Array("config:config-item-map-entry") + Tag6 = Array("config:config-item") + Tag7 = Array("config:config-item","config:name","IsLayerMode") + filter = Array( _ + Array("TagEnclosed", Tag1, Tag2), _ + Array("TagEnclosed", Tag3, Tag2), _ + Array("TagEnclosed", Tag4, Tag3), _ + Array("TagEnclosed", Tag5, Tag4), _ + Array("TagEnclosed", Tag6, Tag5), _ + Array("CharsEnclosed", Tag7, LCase(oPropToSet)) _ + ) + + oDocHandler.initialize(filter) + + initArgs(0) = oDocHandler + aInitArgs = initArgs() + oObj = oMSF.createInstanceWithArguments("com.sun.star.comp.Impress.XMLSettingsExporter", initArgs()) + + oController.setPropertyValue("IsLayerMode", oPropToSet) + + oObj.setSourceDocument(oDoc) + + Dim aFilterDescr(0) As New com.sun.star.beans.PropertyValue + aFilterDescr(0).Name = "FilterName" + aFilterDescr(0).Value = "simpress: StarOffice XML (Impress)" + oFilterDescriptor = aFilterDescr() + + oSrcDocument = oDoc +Exit Sub +ErrHndl: + Test.Exception() +End Sub + +Global oDocHandler As Object + +Function checkFilter() As Boolean + checkFilter = oDocHandler.getByName("XMLIsCorrect") + Out.Log(oDocHandler.getByName("XMLCode")) +End Function +</script:module> diff --git a/qadevOOo/tests/basic/mod/xmloff/Impress/XMLSettingsImporter/script.xlb b/qadevOOo/tests/basic/mod/xmloff/Impress/XMLSettingsImporter/script.xlb new file mode 100644 index 000000000000..9e2d4d8544c2 --- /dev/null +++ b/qadevOOo/tests/basic/mod/xmloff/Impress/XMLSettingsImporter/script.xlb @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd"> +<library:library xmlns:library="http://openoffice.org/2000/library" library:name="xmloff_Impress_XMLSettingsImporter" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="xmloff_Impress_XMLSettingsImporter"/> +"</library:library> diff --git a/qadevOOo/tests/basic/mod/xmloff/Impress/XMLSettingsImporter/xmloff_Impress_XMLSettingsImporter.xba b/qadevOOo/tests/basic/mod/xmloff/Impress/XMLSettingsImporter/xmloff_Impress_XMLSettingsImporter.xba new file mode 100644 index 000000000000..63478a532853 --- /dev/null +++ b/qadevOOo/tests/basic/mod/xmloff/Impress/XMLSettingsImporter/xmloff_Impress_XMLSettingsImporter.xba @@ -0,0 +1,95 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="xmloff_Impress_XMLSettingsImporter" script:language="StarBasic"> + + +'************************************************************************* +' +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' 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. +' +'************************************************************************* +'************************************************************************* + + + +' Be sure that all variables are dimensioned: +option explicit + + +' REQUIRED VARIABLES for interface/service tests: + +' Required for com.sun.star.xml.sax.XDocumentHandler + Global vXMLData As Variant + +' Required for com.sun.star.document.XImporter: + Global oSrcDocument As Object + + +Sub CreateObj() + +'************************************************************************* +' COMPONENT: +' xmloff.Impress.XMLSettingsImporter +'************************************************************************* +On Error Goto ErrHndl + oDoc = utils.createImpressDocument(cObjectName) + oObj = createUnoService("com.sun.star.comp.Impress.XMLSettingsImporter") + + oSrcDocument = oDoc + oObj.setTargetDocument(oDoc) + + vXMLData = Array( _ + Array("start", "office:document-settings", _ + "xmlns:office", "CDATA", "http://openoffice.org/2000/office", _ + "xmlns:xlink", "CDATA", "http://www.w3.org/1999/xlink", _ + "xmlns:presentation", "CDATA", "http://openoffice.org/2000/presentation", _ + "xmlns:config", "CDATA", "http://openoffice.org/2001/config", _ + "office:version", "CDATA", "1.0"), _ + Array("start", "office:settings"), _ + Array("start", "config:config-item-map-indexed", _ + "config:name", "CDATA", "Views"), _ + Array("start", "config:config-item-map-entry"), _ + Array("start","config:config-item", _ + "config:name", "CDATA", "IsLayerMode"), _ + Array("chars", "true"), _ + Array("end", "config:config-item"), _ + Array("end", "config:config-item-map-entry"), _ + Array("end", "config:config-item-map-indexed"), _ + Array("end", "office:settings"), _ + Array("end", "office:document-settings")) +Exit Sub +ErrHndl: + Test.Exception() +End Sub + +Function CheckImport() As Boolean + Dim res As Boolean + Dim oController As Object + out.log("checking of import...") + oController = oDoc.getCurrentController() + res = oController.getPropertyValue("IsLayerMode") + out.log("checking result: " + res) + CheckImport() = res +End Function +</script:module> diff --git a/qadevOOo/tests/basic/mod/xmloff/Impress/XMLStylesExporter/script.xlb b/qadevOOo/tests/basic/mod/xmloff/Impress/XMLStylesExporter/script.xlb new file mode 100644 index 000000000000..7125cbfe7aa1 --- /dev/null +++ b/qadevOOo/tests/basic/mod/xmloff/Impress/XMLStylesExporter/script.xlb @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd"> +<library:library xmlns:library="http://openoffice.org/2000/library" library:name="xmloff_Impress_XMLStylesExporter" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="xmloff_Impress_XMLStylesExporter"/> +"</library:library> diff --git a/qadevOOo/tests/basic/mod/xmloff/Impress/XMLStylesExporter/xmloff_Impress_XMLStylesExporter.xba b/qadevOOo/tests/basic/mod/xmloff/Impress/XMLStylesExporter/xmloff_Impress_XMLStylesExporter.xba new file mode 100644 index 000000000000..37c940dbc2cd --- /dev/null +++ b/qadevOOo/tests/basic/mod/xmloff/Impress/XMLStylesExporter/xmloff_Impress_XMLStylesExporter.xba @@ -0,0 +1,113 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="xmloff_Impress_XMLStylesExporter" script:language="StarBasic"> + + +'************************************************************************* +' +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' 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. +' +'************************************************************************* +'************************************************************************* + + + +' Be sure that all variables are dimensioned: +option explicit + + +' REQUIRED VARIABLES for interface/service tests: + +'Required for com.sun.star.document.XFilter +Global oFilterDescriptor As Variant + +'Required for com.sun.star.lang.XInitialization +Global aInitArgs() As Variant + +'Required for com.sun.star.document.XExporter +Global oSrcDocument As Object + + +Sub CreateObj() + +'************************************************************************* +' COMPONENT: +' xmloff.Impress.XMLStylesExporter +'************************************************************************* +On error goto ErrHndl + Dim initArgs(0), oMSF, oStyleFamilies, oFamily, oStyle As Object + Dim oSFNames As Variant + Dim oFamilyName As String + Dim printXML As Boolean + Dim filter As Variant + Dim expString As String + Dim Tag1, Tag2, Tag3 As Variant + + printXML = true + expString = "NewStyle" + oMSF = getProcessServiceManager() + oDoc = utils.createImpressDocument(cObjectName) + oDocHandler = oMSF.createInstanceWithArguments("basichelper.DocumentHandler", Array(printXML)) + + Tag1 = Array("office:document-styles") + Tag2 = Array("office:styles") + Tag3 = Array("style:style", "style:name", expString) + filter = Array( _ + Array("TagEnclosed", Tag2, Tag1), _ + Array("TagEnclosed", Tag3, Tag2) _ + ) + + oDocHandler.initialize(filter) + + initArgs(0) = oDocHandler + aInitArgs = initArgs() + oObj = oMSF.createInstanceWithArguments("com.sun.star.comp.Impress.XMLStylesExporter", initArgs()) + + oStyleFamilies = oDoc.getStyleFamilies() + oSFNames = oStyleFamilies.getElementNames() + oFamilyName = oSFNames(0) + oFamily = oStyleFamilies.getByName(oFamilyName) + oStyle = oDoc.createInstance("com.sun.star.style.Style") + oFamily.insertByName(expString, oStyle) + + oObj.setSourceDocument(oDoc) + + Dim aFilterDescr(0) As New com.sun.star.beans.PropertyValue + aFilterDescr(0).Name = "FilterName" + aFilterDescr(0).Value = "simpress: StarOffice XML (Impress)" + oFilterDescriptor = aFilterDescr() + + oSrcDocument = oDoc +Exit Sub +ErrHndl: + Test.Exception() +End Sub + +Global oDocHandler As Object + +Function checkFilter() As Boolean + checkFilter = oDocHandler.getByName("XMLIsCorrect") + Out.Log(oDocHandler.getByName("XMLCode")) +End Function +</script:module> diff --git a/qadevOOo/tests/basic/mod/xmloff/Impress/XMLStylesImporter/script.xlb b/qadevOOo/tests/basic/mod/xmloff/Impress/XMLStylesImporter/script.xlb new file mode 100644 index 000000000000..ca13dec7f9c1 --- /dev/null +++ b/qadevOOo/tests/basic/mod/xmloff/Impress/XMLStylesImporter/script.xlb @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd"> +<library:library xmlns:library="http://openoffice.org/2000/library" library:name="xmloff_Impress_XMLStylesImporter" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="xmloff_Impress_XMLStylesImporter"/> +"</library:library> diff --git a/qadevOOo/tests/basic/mod/xmloff/Impress/XMLStylesImporter/xmloff_Impress_XMLStylesImporter.xba b/qadevOOo/tests/basic/mod/xmloff/Impress/XMLStylesImporter/xmloff_Impress_XMLStylesImporter.xba new file mode 100644 index 000000000000..9b64c3997631 --- /dev/null +++ b/qadevOOo/tests/basic/mod/xmloff/Impress/XMLStylesImporter/xmloff_Impress_XMLStylesImporter.xba @@ -0,0 +1,95 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="xmloff_Impress_XMLStylesImporter" script:language="StarBasic"> + + +'************************************************************************* +' +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' 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. +' +'************************************************************************* +'************************************************************************* + + + +' Be sure that all variables are dimensioned: +option explicit + + +' REQUIRED VARIABLES for interface/service tests: + +' Required for com.sun.star.xml.sax.XDocumentHandler + Global vXMLData As Variant + +' Required for procedure CheckImport + Global sStyleName As String + +' Required for com.sun.star.document.XImporter: + Global oSrcDocument As Object + + +Sub CreateObj() + +'************************************************************************* +' COMPONENT: +' xmloff.Impress.XMLStylesImporter +'************************************************************************* +On Error Goto ErrHndl + oDoc = utils.createImpressDocument(cObjectName) + oObj = createUnoService("com.sun.star.comp.Impress.XMLStylesImporter") + + oSrcDocument = oDoc + oObj.setTargetDocument(oDoc) + + sStyleName = "New style for test XMLStylesImporter" + vXMLData = Array( _ + Array("start", "office:document-styles", _ + "xmlns:office", "CDATA", "http://openoffice.org/2000/office", _ + "xmlns:style", "CDATA", "http://openoffice.org/2000/style", _ + "xmlns:fo", "CDATA", "http://www.w3.org/1999/XSL/Format", _ + "xmlns:table", "CDATA", "http://openoffice.org/2000/table"), _ + Array("start", "office:styles"), _ + Array("start", "style:style", _ + "style:name", "CDATA", sStyleName, _ + "style:family", "CDATA", "graphics", _ + "style:parent-style-name", "CDATA", "standard"), _ + Array("end", "style:style"), _ + Array("end", "office:styles"), _ + Array("end", "office:document-styles")) +Exit Sub +ErrHndl: + Test.Exception() +End Sub + +Function CheckImport() As Boolean + Dim res As Boolean + Dim oStyleFamilies, oFamily As Object + out.log("checking of import...") + oStyleFamilies = oDoc.getStyleFamilies() + oFamily = oStyleFamilies.getByName("graphics") + res = oFamily.hasByName(sStyleName) + out.log("checking result: " + res) + CheckImport() = res +End Function +</script:module> |