diff options
Diffstat (limited to 'qadevOOo/tests/basic/mod/sd')
40 files changed, 1938 insertions, 0 deletions
diff --git a/qadevOOo/tests/basic/mod/sd/AccessibleDrawDocumentView/script.xlb b/qadevOOo/tests/basic/mod/sd/AccessibleDrawDocumentView/script.xlb new file mode 100644 index 000000000000..749d06a8e422 --- /dev/null +++ b/qadevOOo/tests/basic/mod/sd/AccessibleDrawDocumentView/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="sd_AccessibleDrawDocumentView" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sd_AccessibleDrawDocumentView"/> +"</library:library> diff --git a/qadevOOo/tests/basic/mod/sd/AccessibleDrawDocumentView/sd_AccessibleDrawDocumentView.xba b/qadevOOo/tests/basic/mod/sd/AccessibleDrawDocumentView/sd_AccessibleDrawDocumentView.xba new file mode 100644 index 000000000000..8a1a5c077e68 --- /dev/null +++ b/qadevOOo/tests/basic/mod/sd/AccessibleDrawDocumentView/sd_AccessibleDrawDocumentView.xba @@ -0,0 +1,82 @@ +<?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="sd_AccessibleDrawDocumentView" 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: + +Global oDP1 As Object, oDP2 As Object + + +Sub CreateObj() + +'************************************************************************* +' COMPONENT: +' sd.AccessibleDrawDocumentView +'************************************************************************* +On Error Goto ErrHndl + Dim oDPs As Object + Dim oWin As Object, xRoot As Object, oShape As Object + Dim oSearchedContext As Object + + oDoc = utils.createDocument("sdraw", cObjectName) + Out.Log("Getting drawpages...") + oDPs = oDoc.getDrawPages() + oDP1 = oDPs.insertNewByIndex(1) + oDP2 = oDPs.getByIndex(0) + Out.Log("Inserting a shape...") + oShape = toolkittools.addShapeToDrawDoc(oDP2,1000,2000,"Rectangle") + oWin = utils.at_getCurrentWindow(oDoc) + xRoot = utils.at_getAccessibleObject(oWin) + oSearchedContext = utils.at_getAccessibleObjectForRole(xRoot, com.sun.star.accessibility.AccessibleRole.DOCUMENT) + oObj = oSearchedContext + +Exit Sub +ErrHndl: + Test.Exception() +End Sub + +Sub DisposeObj() + utils.closeObject(oDoc) +End Sub + +Sub fireEvent() + oDoc.getCurrentController().setCurrentPage(oDP2) + oDoc.getCurrentController().setCurrentPage(oDP1) +End Sub + +</script:module> diff --git a/qadevOOo/tests/basic/mod/sd/AccessibleOutlineView/script.xlb b/qadevOOo/tests/basic/mod/sd/AccessibleOutlineView/script.xlb new file mode 100644 index 000000000000..5d66d87def30 --- /dev/null +++ b/qadevOOo/tests/basic/mod/sd/AccessibleOutlineView/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="sd_AccessibleOutlineView" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sd_AccessibleOutlineView"/> +"</library:library> diff --git a/qadevOOo/tests/basic/mod/sd/AccessibleOutlineView/sd_AccessibleOutlineView.xba b/qadevOOo/tests/basic/mod/sd/AccessibleOutlineView/sd_AccessibleOutlineView.xba new file mode 100644 index 000000000000..d44233ef697f --- /dev/null +++ b/qadevOOo/tests/basic/mod/sd/AccessibleOutlineView/sd_AccessibleOutlineView.xba @@ -0,0 +1,136 @@ +<?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="sd_AccessibleOutlineView" 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: +Global oDPn As Variant +Global fireCount as Integer + + +Sub CreateObj() + +'************************************************************************* +' COMPONENT: +' sd.AccessibleOutlineView +'************************************************************************* +On Error Goto ErrHndl + Dim aSlotID As String + Dim urls As Variant + Dim url as new com.sun.star.util.URL + Dim UrlTransformer As Object, xDispatcher As Object + Dim oCntr As Object, oWin As Object, xRoot As Object + Dim oSearchedContext As Object + + oDoc = utils.createImpressDocument(cObjectName) + oCntr = oDoc.getCurrentController() + + Out.log("Switching to outline view...") + switchOutlineView(oDoc) + + oWin = utils.at_getCurrentWindow(oDoc) + xRoot = utils.at_getAccessibleObject(oWin) + oSearchedContext = utils.at_getAccessibleObjectForRole(xRoot, com.sun.star.accessibility.AccessibleRole.DOCUMENT) + oObj = oSearchedContext + oDPn = oDoc.getDrawPages() + fireCount = 0 + +Exit Sub +ErrHndl: + Test.Exception() +End Sub + +Sub DisposeObj() + utils.closeObject(oDoc) +End Sub + + +' This method is used for XAccessibleEventBroadcaster interface +Sub fireEvent() + fireCount = fireCount + 1 + Out.log("fire event...") + Dim oDP as Object + oDP = oDPn.getByIndex(0) + addShape(oDP, fireCount * 500, fireCount * 500) + + + wait(500) +End Sub + +Sub AddShape(oPage as Object, nPosX as Integer, nPosY as Integer) + Dim aPoint As New com.sun.star.awt.Point + Dim aSize As New com.sun.star.awt.Size + Dim oRectangleShape As Object + + aPoint.x = nPosX + aPoint.y = nPosY + aSize.Width = 10000 + aSize.Height = 10000 + oRectangleShape = oDoc.createInstance("com.sun.star.drawing.RectangleShape") + oRectangleShape.Size = aSize + oRectangleShape.Position = aPoint + oRectangleShape.FillColor = RGB(255, 0, 0) + oPage.add(oRectangleShape) +End Sub + +Sub switchOutlineView(xDoc as Object) +On Error Goto ErrHndl + + Dim Contrl as Variant, disp as Variant, transf as Object + Dim URL as new com.sun.star.util.URL + Dim noProps() + Dim res as Boolean + + Contrl = xDoc.getCurrentController() + URL.Complete = "slot:27010" + transf = createUnoService("com.sun.star.util.URLTransformer") + res = transf.parseStrict(URL) + + out.log("URL parsed :" + res) + + disp = Contrl.queryDispatch(URL, "", 0) + + out.log("disp get.") + + disp.dispatch(URL, noProps()) +Exit Sub +ErrHndl: + Test.Exception() +End Sub + + +</script:module> diff --git a/qadevOOo/tests/basic/mod/sd/AccessibleSlideView/script.xlb b/qadevOOo/tests/basic/mod/sd/AccessibleSlideView/script.xlb new file mode 100644 index 000000000000..ab6b9acb40d2 --- /dev/null +++ b/qadevOOo/tests/basic/mod/sd/AccessibleSlideView/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="sd_AccessibleSlideView" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sd_AccessibleSlideView"/> +"</library:library> diff --git a/qadevOOo/tests/basic/mod/sd/AccessibleSlideView/sd_AccessibleSlideView.xba b/qadevOOo/tests/basic/mod/sd/AccessibleSlideView/sd_AccessibleSlideView.xba new file mode 100644 index 000000000000..7e2686874f69 --- /dev/null +++ b/qadevOOo/tests/basic/mod/sd/AccessibleSlideView/sd_AccessibleSlideView.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="sd_AccessibleSlideView" 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: +Global oDP1 As Object +Global oDP2 As Object +Global oCntr As Object +Global multiSelection As Boolean + + +Sub CreateObj() + +'************************************************************************* +' COMPONENT: +' sd.AccessibleSlideView +'************************************************************************* +On Error Goto ErrHndl + Dim oDPs As Object + Dim oWin As Object, xRoot As Object + Dim oSearchedContext As Object + + oDoc = utils.createImpressDocument(cObjectName) + Out.Log("Getting drawpages...") + oDPs = oDoc.getDrawPages() + oDP1 = oDPs.insertNewByIndex(1) + oDP2 = oDPs.insertNewByIndex(2) + switchOutlineView(oDoc) + oWin = utils.at_getCurrentWindow(oDoc) + xRoot = utils.at_getAccessibleObject(oWin) + oSearchedContext = utils.at_getAccessibleObjectForRole(xRoot, com.sun.star.accessibility.AccessibleRole.DOCUMENT) + oObj = oSearchedContext + oCntr = oDoc.getCurrentController() + multiSelection = true + +Exit Sub +ErrHndl: + Test.Exception() +End Sub + +Sub switchOutlineView(xDoc as Object) +On Error Goto ErrHndl + + Dim Contrl as Variant, disp as Variant, transf as Object + Dim URL as new com.sun.star.util.URL + Dim noProps() + Dim res as Boolean + + Contrl = xDoc.getCurrentController() + URL.Complete = "slot:27011" + transf = createUnoService("com.sun.star.util.URLTransformer") + res = transf.parseStrict(URL) + + out.log("URL parsed :" + res) + + disp = Contrl.queryDispatch(URL, "", 0) + + out.log("disp get.") + + disp.dispatch(URL, noProps()) +Exit Sub +ErrHndl: + Test.Exception() +End Sub + + + +Sub DisposeObj() + utils.closeObject(oDoc) +End Sub + +' This method is used for XAccessibleEventBroadcaster interface +Sub fireEvent() + oCntr.setCurrentPage(oDP1) + oCntr.setCurrentPage(oDP2) +End Sub + +</script:module> diff --git a/qadevOOo/tests/basic/mod/sd/SdDocLinkTargets/script.xlb b/qadevOOo/tests/basic/mod/sd/SdDocLinkTargets/script.xlb new file mode 100644 index 000000000000..766c8a8b244d --- /dev/null +++ b/qadevOOo/tests/basic/mod/sd/SdDocLinkTargets/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="sd_SdDocLinkTargets" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sd_SdDocLinkTargets"/> +"</library:library> diff --git a/qadevOOo/tests/basic/mod/sd/SdDocLinkTargets/sd_SdDocLinkTargets.xba b/qadevOOo/tests/basic/mod/sd/SdDocLinkTargets/sd_SdDocLinkTargets.xba new file mode 100644 index 000000000000..bd597de6e243 --- /dev/null +++ b/qadevOOo/tests/basic/mod/sd/SdDocLinkTargets/sd_SdDocLinkTargets.xba @@ -0,0 +1,54 @@ +<?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="sd_SdDocLinkTargets" 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 + + + +Sub CreateObj() + +'************************************************************************* +' COMPONENT: +' sd.SdDocLinkTargets +'************************************************************************* +On Error Goto ErrHndl + oDoc = utils.createDocument("sdraw", cObjectName) + oObj = oDoc.Links +Exit Sub +ErrHndl: + Test.Exception() +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/mod/sd/SdDrawPage/script.xlb b/qadevOOo/tests/basic/mod/sd/SdDrawPage/script.xlb new file mode 100644 index 000000000000..3caf8119a5c1 --- /dev/null +++ b/qadevOOo/tests/basic/mod/sd/SdDrawPage/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="sd_SdDrawPage" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sd_SdDrawPage"/> +"</library:library> diff --git a/qadevOOo/tests/basic/mod/sd/SdDrawPage/sd_SdDrawPage.xba b/qadevOOo/tests/basic/mod/sd/SdDrawPage/sd_SdDrawPage.xba new file mode 100644 index 000000000000..847e390bb839 --- /dev/null +++ b/qadevOOo/tests/basic/mod/sd/SdDrawPage/sd_SdDrawPage.xba @@ -0,0 +1,107 @@ +<?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="sd_SdDrawPage" 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. +' +'************************************************************************* +'************************************************************************* + + + + +' REQUIRED VARIABLES for interface/service tests: +Global oXShapeInstance As Object +Global oGrouperCollection AS Object +Global oCombinerCollection As Object +Global oBinderCollection As Object + + +Sub CreateObj() + +'************************************************************************* +' COMPONENT: +' sd.SdDrawPage +'************************************************************************* +On Error Goto ErrHndl + + Dim bOK As Boolean + bOK = true + + oDoc = utils.createDocument("sdraw", cObjectName) + + oXShapeInstance = oDoc.createInstance("com.sun.star.drawing.RectangleShape") + + oObj = oDoc.DrawPages.getByIndex(0) + oGrouperCollection = createUNOService("com.sun.star.drawing.ShapeCollection") + oCombinerCollection = createUNOService("com.sun.star.drawing.ShapeCollection") + oBinderCollection = createUNOService("com.sun.star.drawing.ShapeCollection") + + addShape(oObj, 1000, 1000) + addShape(oObj, 5000, 5000) + addShape(oObj, 2000, 2000) + addShape(oObj, 3000, 3000) + addShape(oObj, 4000, 4000) + addShape(oObj, 5000, 5000) + addShape(oObj, 6000, 6000) + addShape(oObj, 7000, 7000) + + oGrouperCollection.Add(oObj.getByIndex(0)) + oGrouperCollection.Add(oObj.getByIndex(1)) + oCombinerCollection.Add(oObj.getByIndex(2)) + oCombinerCollection.Add(oObj.getByIndex(3)) + oBinderCollection.Add(oObj.getByIndex(4)) + oBinderCollection.Add(oObj.getByIndex(5)) + + +Exit Sub +ErrHndl: + Test.Exception() +End Sub + +sub AddShape(oPage as Object, nPosX as Integer, nPosY as Integer) + Dim aPoint As New com.sun.star.awt.Point + Dim aSize As New com.sun.star.awt.Size + Dim oRectangleShape As Object + + aPoint.x = nPosX + aPoint.y = nPosY + aSize.Width = 10000 + aSize.Height = 10000 + oRectangleShape = oDoc.createInstance("com.sun.star.drawing.RectangleShape") + oRectangleShape.Size = aSize + oRectangleShape.Position = aPoint + oRectangleShape.FillColor = RGB(255, 0, 0) + oPage.add(oRectangleShape) +End Sub + +Sub DisposeObj() + if hasUnoInterfaces(oDoc, "com.sun.star.lang.XComponent") then + oDoc.Dispose() + end if +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/mod/sd/SdDrawPagesAccess/script.xlb b/qadevOOo/tests/basic/mod/sd/SdDrawPagesAccess/script.xlb new file mode 100644 index 000000000000..3edb0cacc218 --- /dev/null +++ b/qadevOOo/tests/basic/mod/sd/SdDrawPagesAccess/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="sd_SdDrawPagesAccess" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sd_SdDrawPagesAccess"/> +"</library:library> diff --git a/qadevOOo/tests/basic/mod/sd/SdDrawPagesAccess/sd_SdDrawPagesAccess.xba b/qadevOOo/tests/basic/mod/sd/SdDrawPagesAccess/sd_SdDrawPagesAccess.xba new file mode 100644 index 000000000000..fd9ed80e1d5b --- /dev/null +++ b/qadevOOo/tests/basic/mod/sd/SdDrawPagesAccess/sd_SdDrawPagesAccess.xba @@ -0,0 +1,61 @@ +<?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="sd_SdDrawPagesAccess" 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. +' +'************************************************************************* +'************************************************************************* + + + + + +Sub CreateObj() + +'************************************************************************* +' COMPONENT: +' sd.SdDrawPagesAccess +'************************************************************************* +On Error Goto ErrHndl + + Dim bOK As Boolean + bOK = true + + oDoc = utils.createDocument("sdraw", cObjectName) + + + oObj = oDoc.DrawPages + oObj.insertNewByIndex(oObj.count) + oObj.insertNewByIndex(oObj.count) + + +Exit Sub +ErrHndl: + Test.Exception() +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/mod/sd/SdGenericDrawPage/script.xlb b/qadevOOo/tests/basic/mod/sd/SdGenericDrawPage/script.xlb new file mode 100644 index 000000000000..3f1e419281e6 --- /dev/null +++ b/qadevOOo/tests/basic/mod/sd/SdGenericDrawPage/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="sd_SdGenericDrawPage" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sd_SdGenericDrawPage"/> +"</library:library> diff --git a/qadevOOo/tests/basic/mod/sd/SdGenericDrawPage/sd_SdGenericDrawPage.xba b/qadevOOo/tests/basic/mod/sd/SdGenericDrawPage/sd_SdGenericDrawPage.xba new file mode 100644 index 000000000000..49ef3a47be08 --- /dev/null +++ b/qadevOOo/tests/basic/mod/sd/SdGenericDrawPage/sd_SdGenericDrawPage.xba @@ -0,0 +1,109 @@ +<?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="sd_SdGenericDrawPage" 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: +Global oGrouperCollection AS Object +Global oCombinerCollection As Object +Global oBinderCollection As Object + +'Required for com.sun.star.drawing.XShapes +Global oXShapeInstance As Object 'to add/remove + + +Sub CreateObj() + +'************************************************************************* +' COMPONENT: +' sd.SdGenericDrawPage +'************************************************************************* +On Error Goto ErrHndl + Dim oDrawPage As Object + + oDoc = utils.createDocument("sdraw", cObjectName) + + oDrawPage = oDoc.DrawPages(0) + oGrouperCollection = createUNOService("com.sun.star.drawing.ShapeCollection") + oCombinerCollection = createUNOService("com.sun.star.drawing.ShapeCollection") + oBinderCollection = createUNOService("com.sun.star.drawing.ShapeCollection") + + oObj = oDrawPage + + addShape(oObj, 1000, 1000) + addShape(oObj, 5000, 5000) + addShape(oObj, 2000, 2000) + addShape(oObj, 3000, 3000) + addShape(oObj, 4000, 4000) + addShape(oObj, 5000, 5000) + addShape(oObj, 6000, 6000) + addShape(oObj, 7000, 7000) + + oGrouperCollection.Add(oObj.getByIndex(0)) + oGrouperCollection.Add(oObj.getByIndex(1)) + oCombinerCollection.Add(oObj.getByIndex(2)) + oCombinerCollection.Add(oObj.getByIndex(3)) + oBinderCollection.Add(oObj.getByIndex(4)) + oBinderCollection.Add(oObj.getByIndex(5)) + + oXShapeInstance = oDoc.createInstance("com.sun.star.drawing.RectangleShape") +Exit Sub +ErrHndl: + Test.Exception() +End Sub + +Sub AddShape(oPage as Object, nPosX as Integer, nPosY as Integer) + Dim aPoint As New com.sun.star.awt.Point + Dim aSize As New com.sun.star.awt.Size + Dim oRectangleShape As Object + aPoint.x = nPosX + aPoint.y = nPosY + aSize.Width = 10000 + aSize.Height = 10000 + oRectangleShape = oDoc.createInstance("com.sun.star.drawing.RectangleShape") + oRectangleShape.Size = aSize + oRectangleShape.Position = aPoint + oRectangleShape.FillColor = RGB(255,0,0) + oPage.add(oRectangleShape) +End Sub + +Sub DisposeObj() + if hasUnoInterfaces(oDoc, "com.sun.star.lang.XComponent") then + oDoc.dispose() + end if +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/mod/sd/SdLayer/script.xlb b/qadevOOo/tests/basic/mod/sd/SdLayer/script.xlb new file mode 100644 index 000000000000..809c1d5b1bd6 --- /dev/null +++ b/qadevOOo/tests/basic/mod/sd/SdLayer/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="sd_SdLayer" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sd_SdLayer"/> +"</library:library> diff --git a/qadevOOo/tests/basic/mod/sd/SdLayer/sd_SdLayer.xba b/qadevOOo/tests/basic/mod/sd/SdLayer/sd_SdLayer.xba new file mode 100644 index 000000000000..0bd8fb5b929d --- /dev/null +++ b/qadevOOo/tests/basic/mod/sd/SdLayer/sd_SdLayer.xba @@ -0,0 +1,58 @@ +<?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="sd_SdLayer" 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. +' +'************************************************************************* +'************************************************************************* + + + + + +Sub CreateObj() + +'************************************************************************* +' COMPONENT: +' sd.SdLayer +'************************************************************************* +On Error Goto ErrHndl + + Dim bOK As Boolean + bOK = true + + oDoc = utils.createDocument("sdraw", cObjectName) + + oObj = oDoc.LayerManager.getByIndex(0) + + +Exit Sub +ErrHndl: + Test.Exception() +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/mod/sd/SdLayerManager/script.xlb b/qadevOOo/tests/basic/mod/sd/SdLayerManager/script.xlb new file mode 100644 index 000000000000..5eb4e7cd2fa9 --- /dev/null +++ b/qadevOOo/tests/basic/mod/sd/SdLayerManager/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="sd_SdLayerManager" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sd_SdLayerManager"/> +"</library:library> diff --git a/qadevOOo/tests/basic/mod/sd/SdLayerManager/sd_SdLayerManager.xba b/qadevOOo/tests/basic/mod/sd/SdLayerManager/sd_SdLayerManager.xba new file mode 100644 index 000000000000..9df4a862b3aa --- /dev/null +++ b/qadevOOo/tests/basic/mod/sd/SdLayerManager/sd_SdLayerManager.xba @@ -0,0 +1,59 @@ +<?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="sd_SdLayerManager" 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. +' +'************************************************************************* +'************************************************************************* + + + + + +Sub CreateObj() + +'************************************************************************* +' COMPONENT: +' sd.SdLayerManager +'************************************************************************* +On Error Goto ErrHndl + + Dim bOK As Boolean + bOK = true + + oDoc = utils.createDocument("sdraw", cObjectName) + + oObj = oDoc.LayerManager + nGlobalLong = oObj.Count + + +Exit Sub +ErrHndl: + Test.Exception() +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/mod/sd/SdMasterPage/script.xlb b/qadevOOo/tests/basic/mod/sd/SdMasterPage/script.xlb new file mode 100644 index 000000000000..d0d4f390c1ad --- /dev/null +++ b/qadevOOo/tests/basic/mod/sd/SdMasterPage/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="sd_SdMasterPage" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sd_SdMasterPage"/> +"</library:library> diff --git a/qadevOOo/tests/basic/mod/sd/SdMasterPage/sd_SdMasterPage.xba b/qadevOOo/tests/basic/mod/sd/SdMasterPage/sd_SdMasterPage.xba new file mode 100644 index 000000000000..4d7506dacdf8 --- /dev/null +++ b/qadevOOo/tests/basic/mod/sd/SdMasterPage/sd_SdMasterPage.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="sd_SdMasterPage" 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: +Global oGrouperCollection AS Object +Global oCombinerCollection As Object +Global oBinderCollection As Object + +'Required for com.sun.star.drawing.XShapes +Global oXShapeInstance As Object 'to add/remove + + +Sub CreateObj() + +'************************************************************************* +' COMPONENT: +' sd.SdMasterPage +'************************************************************************* +On Error Goto ErrHndl + Dim oMasterPages As Object + + oDoc = utils.createDocument("sdraw", cObjectName) + + oXShapeInstance = oDoc.createInstance("com.sun.star.drawing.RectangleShape") + oGrouperCollection = createUNOService("com.sun.star.drawing.ShapeCollection") + oCombinerCollection = createUNOService("com.sun.star.drawing.ShapeCollection") + oBinderCollection = createUNOService("com.sun.star.drawing.ShapeCollection") + + oMasterPages = oDoc.MasterPages + oObj = oMasterPages(0) + + addShape(oObj, 1000, 1000) + addShape(oObj, 5000, 5000) + addShape(oObj, 2000, 2000) + addShape(oObj, 3000, 3000) + addShape(oObj, 4000, 4000) + addShape(oObj, 5000, 5000) + addShape(oObj, 6000, 6000) + addShape(oObj, 7000, 7000) + + oGrouperCollection.Add(oObj.getByIndex(0)) + oGrouperCollection.Add(oObj.getByIndex(1)) + oCombinerCollection.Add(oObj.getByIndex(2)) + oCombinerCollection.Add(oObj.getByIndex(3)) + oBinderCollection.Add(oObj.getByIndex(4)) + oBinderCollection.Add(oObj.getByIndex(5)) +Exit Sub +ErrHndl: + Test.Exception() +End Sub + +Sub AddShape(oPage as Object, nPosX as Integer, nPosY as Integer) + Dim aPoint As New com.sun.star.awt.Point + Dim aSize As New com.sun.star.awt.Size + Dim oRectangleShape As Object + + aPoint.x = nPosX + aPoint.y = nPosY + aSize.Width = 10000 + aSize.Height = 10000 + oRectangleShape = oDoc.createInstance("com.sun.star.drawing.RectangleShape") + oRectangleShape.Size = aSize + oRectangleShape.Position = aPoint + oRectangleShape.FillColor = RGB(255, 0, 0) + oPage.add(oRectangleShape) +End Sub + +Sub DisposeObj() + if hasUnoInterfaces(oDoc, "com.sun.star.lang.XComponent") then + oDoc.dispose() + end if +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/mod/sd/SdMasterPagesAccess/script.xlb b/qadevOOo/tests/basic/mod/sd/SdMasterPagesAccess/script.xlb new file mode 100644 index 000000000000..a709ee13a2c7 --- /dev/null +++ b/qadevOOo/tests/basic/mod/sd/SdMasterPagesAccess/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="sd_SdMasterPagesAccess" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sd_SdMasterPagesAccess"/> +"</library:library> diff --git a/qadevOOo/tests/basic/mod/sd/SdMasterPagesAccess/sd_SdMasterPagesAccess.xba b/qadevOOo/tests/basic/mod/sd/SdMasterPagesAccess/sd_SdMasterPagesAccess.xba new file mode 100644 index 000000000000..fc828ab1f6d9 --- /dev/null +++ b/qadevOOo/tests/basic/mod/sd/SdMasterPagesAccess/sd_SdMasterPagesAccess.xba @@ -0,0 +1,58 @@ +<?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="sd_SdMasterPagesAccess" 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. +' +'************************************************************************* +'************************************************************************* + + + + + +Sub CreateObj() + +'************************************************************************* +' COMPONENT: +' sd.SdMasterPagesAccess +'************************************************************************* +On Error Goto ErrHndl + + Dim bOK As Boolean + bOK = true + + oDoc = utils.createDocument("sdraw", cObjectName) + + oObj = oDoc.MasterPages + + +Exit Sub +ErrHndl: + Test.Exception() +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/mod/sd/SdPageLinkTargets/script.xlb b/qadevOOo/tests/basic/mod/sd/SdPageLinkTargets/script.xlb new file mode 100644 index 000000000000..6f0236efd0b8 --- /dev/null +++ b/qadevOOo/tests/basic/mod/sd/SdPageLinkTargets/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="sd_SdPageLinkTargets" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sd_SdPageLinkTargets"/> +"</library:library> diff --git a/qadevOOo/tests/basic/mod/sd/SdPageLinkTargets/sd_SdPageLinkTargets.xba b/qadevOOo/tests/basic/mod/sd/SdPageLinkTargets/sd_SdPageLinkTargets.xba new file mode 100644 index 000000000000..d55b34d3f0b9 --- /dev/null +++ b/qadevOOo/tests/basic/mod/sd/SdPageLinkTargets/sd_SdPageLinkTargets.xba @@ -0,0 +1,79 @@ +<?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="sd_SdPageLinkTargets" 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 + + + +Sub CreateObj() + +'************************************************************************* +' COMPONENT: +' sd.SdPageLinkTargets +'************************************************************************* +On Error Goto ErrHndl + Dim oPage As Object + Dim oShape As Object + + oDoc = utils.createDocument("sdraw", cObjectName) + oPage = oDoc.DrawPages(0) + + oShape = addShape(oPage, 1000, 1000) + oShape.setPropertyValue("CLSID","12DCAE26-281F-416F-a234-c3086127382e") + + oObj = oPage.getLinks() +Exit Sub +ErrHndl: + Test.Exception() +End Sub + +Function AddShape(oPage as Object, nPosX as Integer, nPosY as Integer) as Object + Dim aPoint As New com.sun.star.awt.Point + Dim aSize As New com.sun.star.awt.Size + Dim oShape As Object + + aPoint.x = nPosX + aPoint.y = nPosY + aSize.Width = 10000 + aSize.Height = 10000 + oShape = oDoc.createInstance("com.sun.star.drawing.OLE2Shape") + oShape.Size = aSize + oShape.Position = aPoint + + oPage.add(oShape) + AddShape = oShape +End Function +</script:module> diff --git a/qadevOOo/tests/basic/mod/sd/SdUnoDrawView/script.xlb b/qadevOOo/tests/basic/mod/sd/SdUnoDrawView/script.xlb new file mode 100644 index 000000000000..e9b771303803 --- /dev/null +++ b/qadevOOo/tests/basic/mod/sd/SdUnoDrawView/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="sd_SdUnoDrawView" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sd_SdUnoDrawView"/> +"</library:library> diff --git a/qadevOOo/tests/basic/mod/sd/SdUnoDrawView/sd_SdUnoDrawView.xba b/qadevOOo/tests/basic/mod/sd/SdUnoDrawView/sd_SdUnoDrawView.xba new file mode 100644 index 000000000000..66fca1b31e45 --- /dev/null +++ b/qadevOOo/tests/basic/mod/sd/SdUnoDrawView/sd_SdUnoDrawView.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="sd_SdUnoDrawView" 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 drawing.XDrawView +Global oPages As Object + +' Required for frame.XController +Global oFrameToAttach As Object +Global oModelToAttach As Object +Global bHasNoViewData As Boolean +Global oObjToSuspend As Object +Global bHasNoModel As Boolean + +' Required for lang.XComponent +Global oComponentInstance As Object + +' Required for frame.XDispatchProvider +Global dispatchUrl As String + +' Required for view.XSelectionSupplier +Global SelectableObj1 As Object +Global SelectableObj2 As Object + +Global oSecDoc As Object + + +Sub CreateObj() + +'************************************************************************* +' COMPONENT: +' sd.SdUnoDrawView +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + bOK = true + + oDoc = utils.createDocument("sdraw", cObjectName) + + oObj = oDoc.getCurrentController() + + oPages = oDoc.getDrawPages() + + oSecDoc = utils.createDocument("sdraw", "For frame.XController") + bHasNoViewData = false + bHasNoModel = false + oObjToSuspend = oObj + oFrameToAttach = StarDesktop.getCurrentFrame() + oModelToAttach = oSecDoc + + oComponentInstance = oObj + + dispatchUrl = "slot:27009" + + Dim page As Object + page = oPages.getByIndex(0) + AddShape(page, 100, 100) + AddShape(page, 12000, 100) + + SelectableObj1 = page.getByIndex(0) + SelectableObj2 = page.getByIndex(1) +Exit Sub +ErrHndl: + Test.Exception() +End Sub + +Sub DisposeObj() + oSecDoc.dispose() +End Sub + +sub AddShape(oPage as Object, nPosX as Integer, nPosY as Integer) + Dim aPoint As New com.sun.star.awt.Point + Dim aSize As New com.sun.star.awt.Size + Dim oRectangleShape As Object + + aPoint.x = nPosX + aPoint.y = nPosY + aSize.Width = 10000 + aSize.Height = 10000 + oRectangleShape = oDoc.createInstance("com.sun.star.drawing.RectangleShape") + oRectangleShape.Size = aSize + oRectangleShape.Position = aPoint + oRectangleShape.FillColor = RGB(255, 0, 0) + oPage.add(oRectangleShape) +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/mod/sd/SdUnoOutlineView/script.xlb b/qadevOOo/tests/basic/mod/sd/SdUnoOutlineView/script.xlb new file mode 100644 index 000000000000..d7108b233a4e --- /dev/null +++ b/qadevOOo/tests/basic/mod/sd/SdUnoOutlineView/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="sd_SdUnoOutlineView" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sd_SdUnoOutlineView"/> +"</library:library> diff --git a/qadevOOo/tests/basic/mod/sd/SdUnoOutlineView/sd_SdUnoOutlineView.xba b/qadevOOo/tests/basic/mod/sd/SdUnoOutlineView/sd_SdUnoOutlineView.xba new file mode 100644 index 000000000000..edea9b2a0dd5 --- /dev/null +++ b/qadevOOo/tests/basic/mod/sd/SdUnoOutlineView/sd_SdUnoOutlineView.xba @@ -0,0 +1,130 @@ +<?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="sd_SdUnoOutlineView" 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 frame.XController +Global oFrameToAttach As Object +Global oModelToAttach As Object +Global bHasNoViewData As Boolean +Global oObjToSuspend As Object +Global bHasNoModel As Boolean + +' Required for lang.XComponent +Global oComponentInstance As Object + +' Required for frame.XDispatchProvider +Global dispatchUrl As String + +' Required for awt.XWindow +Global oXWindow As Object +Global oCtrlShape as Object + + +Global oSecDoc As Object +Global oXComponentDoc as Object + +Sub CreateObj() + +'************************************************************************* +' COMPONENT: +' sd.SdUnoOutlineView +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + bOK = true + + oDoc = utils.createImpressDocument(cObjectName) + oXComponentDoc = utils.createImpressDocument(cObjectName+ "XComponent") + + oObj = oDoc.getCurrentController() + oComponentInstance = oXComponentDoc.getCurrentController() + + Out.log("Change to Outline view") + Dim aSlotID As String + aSlotID = "slot:27010" + + Dim url as new com.sun.star.util.URL + url.Complete = aSlotID + + Dim UrlTransformer As Object + UrlTransformer = createUnoService("com.sun.star.util.URLTransformer") + UrlTransformer.parseStrict(url) + + Dim xDispatcher As Object + xDispatcher = oObj.queryDispatch( url,"",0) + if Not IsNULL(xDispatcher) then + xDispatcher.dispatch( url, DimArray() ) + wait(5000) + else + Out.log("queryDispatch FAILED... Object SdUnoOutlineView can't be created") + oObj = NULL_OBJECT + endif + + xDispatcher = oComponentInstance.queryDispatch( url,"",0) + if Not IsNULL(xDispatcher) then + xDispatcher.dispatch( url, DimArray() ) + wait(5000) + else + Out.log("queryDispatch FAILED... Object SdUnoOutlineView can't be created") + endif + + oSecDoc = utils.createImpressDocument("For frame.XController") + bHasNoViewData = false + bHasNoModel = false + oObjToSuspend = oObj + oFrameToAttach = StarDesktop.getCurrentFrame() + oModelToAttach = oSecDoc + + + dispatchUrl = "slot:27069" + + ' For awt.XWindow + oXWindow = utils.at_getCurrentWindow(oSecDoc) + +Exit Sub +ErrHndl: + Test.Exception() +End Sub + +Sub DisposeObj() + utils.closeObject(oSecDoc) +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/mod/sd/SdUnoPresView/script.xlb b/qadevOOo/tests/basic/mod/sd/SdUnoPresView/script.xlb new file mode 100644 index 000000000000..85375cd665b4 --- /dev/null +++ b/qadevOOo/tests/basic/mod/sd/SdUnoPresView/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="sd_SdUnoPresView" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sd_SdUnoPresView"/> +"</library:library> diff --git a/qadevOOo/tests/basic/mod/sd/SdUnoPresView/sd_SdUnoPresView.xba b/qadevOOo/tests/basic/mod/sd/SdUnoPresView/sd_SdUnoPresView.xba new file mode 100644 index 000000000000..305dc5da6571 --- /dev/null +++ b/qadevOOo/tests/basic/mod/sd/SdUnoPresView/sd_SdUnoPresView.xba @@ -0,0 +1,137 @@ +<?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="sd_SdUnoPresView" 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 frame.XController +Global oFrameToAttach As Object +Global oModelToAttach As Object +Global bHasNoViewData As Boolean +Global oObjToSuspend As Object +Global bHasNoModel As Boolean + +' Required for lang.XComponent +Global oComponentInstance As Object + +' Required for frame.XDispatchProvider +Global dispatchUrl As String + +' Required for drawing.XDrawView +Global oPages As Variant + +' Required for awt.XWindow +Global oXWindow As Object +Global oCtrlShape as Object + +Global oSecDoc As Object + + +Sub CreateObj() + +'************************************************************************* +' COMPONENT: +' sd.SdUnoPresView +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim oDP As Object, oDP1 As Object + Dim oDPs As Object + bOK = true + + oDoc = utils.createImpressDocument(cObjectName) + oSecDoc = utils.createImpressDocument(cObjectName+"1") + wait(500) + + oDPs = oDoc.getDrawPages() + oDP = oDPs.getByIndex(0) + oDPs.insertNewByIndex(0) + oDP1 = oDPs.getByIndex(1) + + addShape(oDP, 1000, 1000, "Rectangle") + addShape(oDP, 5000, 5000, "Ellipse") + + oObj = oDoc.getCurrentController() + + ' For XDrawPages + oPages = oDoc.getDrawPages() + + ' For XComponent + oComponentInstance = oObj + + ' For XDispatchProvider + dispatchUrl = "slot:27009" + + ' For frame.XController + oFrameToAttach = StarDesktop.getCurrentFrame() + oModelToAttach = oSecDoc + bHasNoViewData = false + bHasNoModel = false + oObjToSuspend = oObj + + ' For awt.XWindow + oXWindow = utils.at_getCurrentWindow(oSecDoc) + +Exit Sub +ErrHndl: + Test.Exception() +End Sub + +Sub DisposeObj() + oDoc.dispose() + oSecDoc.dispose() +End Sub + +Sub addShape(oPage as Object, nPosX as Integer, nPosY as Integer, oType As String) + Dim aPoint As New com.sun.star.awt.Point + Dim aSize As New com.sun.star.awt.Size + Dim oRectangleShape As Object + + aPoint.x = nPosX + aPoint.y = nPosY + aSize.Width = 2000 + aSize.Height = 1000 + oRectangleShape = oDoc.createInstance("com.sun.star.drawing."+oType+"Shape") + oRectangleShape.Size = aSize + oRectangleShape.Position = aPoint + oRectangleShape.FillColor = RGB(128, 255, 0) + oPage.add(oRectangleShape) +End Sub + +</script:module> diff --git a/qadevOOo/tests/basic/mod/sd/SdXCustomPresentation/script.xlb b/qadevOOo/tests/basic/mod/sd/SdXCustomPresentation/script.xlb new file mode 100644 index 000000000000..eff48affc0c0 --- /dev/null +++ b/qadevOOo/tests/basic/mod/sd/SdXCustomPresentation/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="sd_SdXCustomPresentation" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sd_SdXCustomPresentation"/> +"</library:library> diff --git a/qadevOOo/tests/basic/mod/sd/SdXCustomPresentation/sd_SdXCustomPresentation.xba b/qadevOOo/tests/basic/mod/sd/SdXCustomPresentation/sd_SdXCustomPresentation.xba new file mode 100644 index 000000000000..c02a4a34970d --- /dev/null +++ b/qadevOOo/tests/basic/mod/sd/SdXCustomPresentation/sd_SdXCustomPresentation.xba @@ -0,0 +1,84 @@ +<?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="sd_SdXCustomPresentation" 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.container.XIndexContainer +Global oInstance As Object 'for InsertByName + +' Required for XIndexReplace +Global oIdxReplaceInstance As Object + + +Sub CreateObj() + +'************************************************************************* +' COMPONENT: +' sd.SdXCustomPresentation +'************************************************************************* +On Error Goto ErrHndl + Dim oPresentations As Object + Dim oPresentation As Object + Dim oDrawPages As Object + + oDoc = utils.createImpressDocument(cObjectName) + + oPresentations = oDoc.getCustomPresentations() + oDrawPages = oDoc.getDrawPages + oDrawPages.insertNewByIndex(oDrawPages.getCount()) + oDrawPages.insertNewByIndex(oDrawPages.getCount()) + oDrawPages.insertNewByIndex(oDrawPages.getCount()) + oDrawPages.insertNewByIndex(oDrawPages.getCount()) + + oPresentation = oPresentations.createInstance() + oPresentations.insertByName(cObjectName, oPresentation) + oIdxReplaceInstance = oDrawPages.getByIndex(3) + + oObj = oPresentations.getByName(oPresentations.elementNames(0)) + + oObj.insertByIndex(oObj.Count, oDrawPages.getByIndex(0)) + oObj.insertByIndex(oObj.Count, oDrawPages.getByIndex(1)) + oObj.insertByIndex(oObj.Count, oDrawPages.getByIndex(2)) + oInstance = oDrawPages.getByIndex(3) + +Exit Sub +ErrHndl: + Test.Exception() +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/mod/sd/SdXCustomPresentationAccess/script.xlb b/qadevOOo/tests/basic/mod/sd/SdXCustomPresentationAccess/script.xlb new file mode 100644 index 000000000000..92f8c79f7d0d --- /dev/null +++ b/qadevOOo/tests/basic/mod/sd/SdXCustomPresentationAccess/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="sd_SdXCustomPresentationAccess" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sd_SdXCustomPresentationAccess"/> +"</library:library> diff --git a/qadevOOo/tests/basic/mod/sd/SdXCustomPresentationAccess/sd_SdXCustomPresentationAccess.xba b/qadevOOo/tests/basic/mod/sd/SdXCustomPresentationAccess/sd_SdXCustomPresentationAccess.xba new file mode 100644 index 000000000000..d626a83a2256 --- /dev/null +++ b/qadevOOo/tests/basic/mod/sd/SdXCustomPresentationAccess/sd_SdXCustomPresentationAccess.xba @@ -0,0 +1,77 @@ +<?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="sd_SdXCustomPresentationAccess" 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.container.XNameContainer +Global oInstance As Object 'instance to insert + +'Required for com.sun.star.container.XNameReplace +Global oReplaceInstance As Object +Global cNameToReplace As String + +'For lang.XSingleServiceFactory +Global aMustSupportInterface As Variant + + +Sub CreateObj() + +'************************************************************************* +' COMPONENT: +' sd.SdXCustomPresentationAccess +'************************************************************************* +On Error Goto ErrHndl + oDoc = utils.createImpressDocument(cObjectName) + oObj = oDoc.getCustomPresentations() + + oInstance = oObj.createInstance() + oObj.insertByName("FirstPresentation", oInstance) + oInstance = oObj.createInstance() + oObj.insertByName("SecondPresentation", oInstance) + oInstance = oObj.createInstance() + + cNameToReplace = "SecondPresentation" + oReplaceInstance = oObj.createInstance() + + aMustSupportInterface = Array("com.sun.star.container.XIndexContainer") +Exit Sub +ErrHndl: + Test.Exception() +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/mod/sd/SdXImpressDocument/script.xlb b/qadevOOo/tests/basic/mod/sd/SdXImpressDocument/script.xlb new file mode 100644 index 000000000000..54c30454d5df --- /dev/null +++ b/qadevOOo/tests/basic/mod/sd/SdXImpressDocument/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="sd_SdXImpressDocument" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sd_SdXImpressDocument"/> +"</library:library> diff --git a/qadevOOo/tests/basic/mod/sd/SdXImpressDocument/sd_SdXImpressDocument.xba b/qadevOOo/tests/basic/mod/sd/SdXImpressDocument/sd_SdXImpressDocument.xba new file mode 100644 index 000000000000..5b7aee65ec94 --- /dev/null +++ b/qadevOOo/tests/basic/mod/sd/SdXImpressDocument/sd_SdXImpressDocument.xba @@ -0,0 +1,100 @@ +<?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="sd_SdXImpressDocument" 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: + +' Requiered for com.sun.star.lang.XMultiServiceFactory + Global cServiceName As String ' ex. "com.sun.star.drawing.RectangleShape" + Global bCreateInstanceWithoutArguments As Boolean + Global aArguments() As Variant + +' Requiered for com.sun.star.drawing.XDrawPageDuplicator + Global oCollection As Object ' = oDoc.DrawPages(0) + +' com.sun.star.frame.XModel + Global oXModelController as Object + Global oXModelSel as Object + Global oXModelToSel as Object + + + Global oComponentInstance As Object +Sub CreateObj() + +'************************************************************************* +' COMPONENT: +' sd.SdXImpressDocument +'************************************************************************* +On Error Goto ErrHndl + Dim oControllerDoc as Object + Dim oRectangleShape as Object + Dim oPage as Object + + oDoc = utils.createImpressDocument(cObjectName) + oControllerDoc = utils.createImpressDocument(cObjectName + "XModel") + oComponentInstance = utils.createImpressDocument(cObjectName + "XComponent") + + oCollection = oDoc.DrawPages(0) + oObj = oDoc + + cServiceName = "com.sun.star.drawing.RectangleShape" + bCreateInstanceWithoutArguments = true + aArguments() = noargs() + + oRectangleShape = oDoc.createInstance("com.sun.star.drawing.RectangleShape") + oPage = oDoc.getDrawPages().getByIndex(0) + oPage.add(oRectangleShape) + + oXModelToSel = oRectangleShape + oXModelController = oControllerDoc.getCurrentController() + oXModelSel = oDoc.getCurrentController() + +Exit Sub +ErrHndl: + Test.Exception() +End Sub + +Sub DisposeObj() + if NOT isNULL(oComponentInstance) then oComponentInstance.dispose() + + ' To successfully dispose oControllerDoc re-open it first. + Dim oControllerDoc As Object + oControllerDoc = utils.createDocument(cObjectName + "XModel") + oControllerDoc.dispose() +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/mod/sd/SdXPresentation/script.xlb b/qadevOOo/tests/basic/mod/sd/SdXPresentation/script.xlb new file mode 100644 index 000000000000..20b9fca530b8 --- /dev/null +++ b/qadevOOo/tests/basic/mod/sd/SdXPresentation/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="sd_SdXPresentation" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sd_SdXPresentation"/> +"</library:library> diff --git a/qadevOOo/tests/basic/mod/sd/SdXPresentation/sd_SdXPresentation.xba b/qadevOOo/tests/basic/mod/sd/SdXPresentation/sd_SdXPresentation.xba new file mode 100644 index 000000000000..2ef0232aafe2 --- /dev/null +++ b/qadevOOo/tests/basic/mod/sd/SdXPresentation/sd_SdXPresentation.xba @@ -0,0 +1,63 @@ +<?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="sd_SdXPresentation" 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 + + + +Sub CreateObj() + +'************************************************************************* +' COMPONENT: +' sd.SdXPresentation +'************************************************************************* +On Error Goto ErrHndl + Dim oPres As Object + Dim oInst As Object + + oDoc = utils.createImpressDocument(cObjectName) + oPres = oDoc.getCustomPresentations() + oInst = oPres.createInstance() + oPres.insertByName("FirstPresentation", oInst) + oInst = oPres.createInstance() + oPres.insertByName("SecondPresentation", oInst) + + oObj = oDoc.getPresentation() +Exit Sub +ErrHndl: + Test.Exception() +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/mod/sd/SdXShape/script.xlb b/qadevOOo/tests/basic/mod/sd/SdXShape/script.xlb new file mode 100644 index 000000000000..55ca6e4df6fa --- /dev/null +++ b/qadevOOo/tests/basic/mod/sd/SdXShape/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="sd_SdXShape" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sd_SdXShape"/> +"</library:library> diff --git a/qadevOOo/tests/basic/mod/sd/SdXShape/sd_SdXShape.xba b/qadevOOo/tests/basic/mod/sd/SdXShape/sd_SdXShape.xba new file mode 100644 index 000000000000..0e719ec6a88a --- /dev/null +++ b/qadevOOo/tests/basic/mod/sd/SdXShape/sd_SdXShape.xba @@ -0,0 +1,98 @@ +<?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="sd_SdXShape" 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.lang.XComponent +Global oComponentInstance as Object + + +Sub CreateObj() + +'************************************************************************* +' COMPONENT: +' sd.SdXShape +'************************************************************************* +On Error Goto ErrHndl + Dim oDrawPage As Object + Dim oDrawPages As Object + Dim oCollection As Object + + oDoc = utils.createDocument("sdraw", cObjectName) + + oDrawPages = oDoc.DrawPages + oDrawPage = oDrawPages.getByIndex(0) + addShape(oDrawPage, 1000, 1000) + addShape(oDrawPage, 5000, 5000) + oCollection = oDrawPage + oObj = oDrawPage.getByIndex(0) + oComponentInstance = oDrawPage.getByIndex(1) + + + Dim oLayerManager As Object + Dim nLayer As Integer + Dim oLayer As Object + + oLayerManager = oDoc.LayerManager + nLayer = oLayerManager.Count + oLayer = oLayerManager.insertNewByIndex(nLayer) + oLayer.Name = "Test" + oLayerManager.attachShapeToLayer(oObj, oLayer) + +Exit Sub +ErrHndl: + Test.Exception() +End Sub + +Sub AddShape(oPage as Object, nPosX as Integer, nPosY as Integer) + Dim aPoint As New com.sun.star.awt.Point + Dim aSize As New com.sun.star.awt.Size + Dim oRectangleShape As Object + + aPoint.x = nPosX + aPoint.y = nPosY + aSize.Width = 10000 + aSize.Height = 10000 + oRectangleShape = oDoc.createInstance("com.sun.star.drawing.RectangleShape") + oRectangleShape.Size = aSize + oRectangleShape.Position = aPoint + oRectangleShape.FillColor = RGB(255, 0, 0) + oPage.add(oRectangleShape) +End Sub +</script:module> |