diff options
Diffstat (limited to 'qadevOOo/tests/basic/mod/xmloff/Impress')
20 files changed, 1122 insertions, 0 deletions
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> |