diff options
Diffstat (limited to 'qadevOOo/tests/basic/ifc')
1075 files changed, 55363 insertions, 0 deletions
diff --git a/qadevOOo/tests/basic/ifc/accessibility/XAccessible/accessibility_XAccessible.xba b/qadevOOo/tests/basic/ifc/accessibility/XAccessible/accessibility_XAccessible.xba new file mode 100644 index 000000000000..73b58c04b061 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/accessibility/XAccessible/accessibility_XAccessible.xba @@ -0,0 +1,64 @@ +<?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="accessibility_XAccessible" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.accessibility.XAccessible +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim ac As Variant + + Test.StartMethod("getAccessibleContext()") + bOK = true + ac = oObj.getAccessibleContext() + bOK = bOK AND NOT isNull(ac) + Test.MethodTested("getAccessibleContext()",bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/accessibility/XAccessible/script.xlb b/qadevOOo/tests/basic/ifc/accessibility/XAccessible/script.xlb new file mode 100644 index 000000000000..acd98036701d --- /dev/null +++ b/qadevOOo/tests/basic/ifc/accessibility/XAccessible/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="accessibility_XAccessible" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="accessibility_XAccessible"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/accessibility/XAccessibleAction/accessibility_XAccessibleAction.xba b/qadevOOo/tests/basic/ifc/accessibility/XAccessibleAction/accessibility_XAccessibleAction.xba new file mode 100644 index 000000000000..c45d4d3e7cbd --- /dev/null +++ b/qadevOOo/tests/basic/ifc/accessibility/XAccessibleAction/accessibility_XAccessibleAction.xba @@ -0,0 +1,99 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="accessibility_XAccessibleAction" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.accessibility.XAccessibleAction +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Test.StartMethod("getAccessibleActionCount()") + Dim count As Long + bOK = true + count = oObj.getAccessibleActionCount() + bOK = bOK AND (count > 0) + Test.MethodTested("getAccessibleActionCount()",bOK) + + Test.StartMethod("getAccessibleActionDescription()") + Dim i As Long + Dim desc As String + bOK = true + i = 0 + while ( i < count) + desc = oObj.getAccessibleActionDescription(i) + Out.Log("Found action "+i+": "+desc) + bOK = bOK AND NOT isNull(desc) + i = i + 1 + wend + Test.MethodTested("getAccessibleActionDescription()",bOK) + + Test.StartMethod("getAccessibleActionKeyBinding()") + Dim key As Variant + bOK = true + i = 0 + while ( i < count) + key = oObj.getAccessibleActionKeyBinding(i) + if not isNull(key) then + out.Log("Found key in " + i) + end if + i = i + 1 + wend + Test.MethodTested("getAccessibleActionKeyBinding()",bOK) + + Test.StartMethod("doAccessibleAction()") + bOK = true + bOK = bOK AND oObj.doAccessibleAction(0) + Test.MethodTested("doAccessibleAction()",bOK) + + 'This delay is REQUIRED here to avoid soffice blocking + wait(1000) + ReCreateObj() + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/accessibility/XAccessibleAction/script.xlb b/qadevOOo/tests/basic/ifc/accessibility/XAccessibleAction/script.xlb new file mode 100644 index 000000000000..87edd989cbaa --- /dev/null +++ b/qadevOOo/tests/basic/ifc/accessibility/XAccessibleAction/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="accessibility_XAccessibleAction" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="accessibility_XAccessibleAction"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/accessibility/XAccessibleComponent/accessibility_XAccessibleComponent.xba b/qadevOOo/tests/basic/ifc/accessibility/XAccessibleComponent/accessibility_XAccessibleComponent.xba new file mode 100644 index 000000000000..2c85baced3be --- /dev/null +++ b/qadevOOo/tests/basic/ifc/accessibility/XAccessibleComponent/accessibility_XAccessibleComponent.xba @@ -0,0 +1,247 @@ +<?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="accessibility_XAccessibleComponent" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.accessibility.XAccessibleComponent +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Test.StartMethod("getBounds()") + Dim bounds As new com.sun.star.awt.Rectangle + Dim X1,Y1 As Integer + bOK = true + bounds = oObj.getBounds() + X1 = bounds.X+bounds.Width + Y1 = bounds.Y+bounds.Height + Out.Log("Object's bounding box: ("+bounds.X+","+bounds.Y+","+X1+","+Y1+").") + bOK = bOK AND (NOT isNull(bounds)) AND (bounds.X >= 0) AND (bounds.Y >= 0) _ + AND (bounds.Width > 0) AND (bounds.Height > 0) + Test.MethodTested("getBounds()",bOK) + + Test.StartMethod("contains()") + Dim point1 As new com.sun.star.awt.Point + Dim point2 As new com.sun.star.awt.Point + bOK = true + point1.X = bounds.Width + 1 + point1.Y = bounds.Height + 1 + point2.X = 0 + point2.Y = 0 + bOK = bOK AND (NOT oObj.contains(point1)) AND oObj.contains(point2) + Test.MethodTested("contains()",bOK) + + Test.StartMethod("getAccessibleAt()") + Dim accAt As Object, oChild As Object + Dim i As Integer, childCount As Long, mCount As Integer + Dim chBounds As new com.sun.star.awt.Rectangle + Dim locRes As Boolean + Dim ComponentFound As Boolean + Dim visibleFound as Boolean + Dim XAccessibleSelection as Boolean + + bOK = true + childCount = oObj.getAccessibleChildCount() + if (childCount = 0) then + Out.Log("There are no children supported by XAccessibleComponent...") + else + Out.Log("There are "+childCount+" children supported by XAccessibleComponent.") + if (childCount > 50) then + mCount = 50 + Out.Log("Checking only first 50 children...") + else + mCount = childCount + End If + ComponentFound = false + visibleFound = false + XAccessibleSelection = hasUNOInterfaces(oObj, "drafts.com.sun.star.accessibility.XAccessibleSelection") + for i = 0 to (mCount - 1) + oChild = oObj.getAccessibleChild(i) + if NOT hasUNOInterfaces(oChild,"drafts.com.sun.star.accessibility.XAccessibleContext") then + oChild = oChild.getAccessibleContext() + End If + if hasUNOInterfaces(oChild,"drafts.com.sun.star.accessibility.XAccessibleComponent") then + ComponentFound = TRUE + if XAccessibleSelection then + if oObj.isAccessibleChildSelected(i) then + visibleFound = TRUE + End If + End If + oChild = oChild.getAccessibleContext() + chBounds = oChild.getBounds() + point1.X = chBounds.X + point1.Y = chBounds.Y + accAt = oObj.getAccessibleAt(point1) + locRes = utils.at_equals(accAt,oChild) + Out.log(" getAccessibleAt() with valid points with child " + i + ": " + locRes) + bOK = bOK AND locRes + point2.X = chBounds.X - 1 + point2.Y = chBounds.Y - 1 + accAt = oObj.getAccessibleAt(point2) + locRes = NOT utils.at_equals(accAt,oChild) + Out.log(" getAccessibleAt() with invalid points with child " + i + ": " + locRes) + bOK = bOK AND locRes + End If + next i + if not ComponentFound then + Out.Log("Could not find any children which supports XAccessibleComponent!") + bOK = TRUE + end if + if not visibleFound then + Out.Log("Could not find any children which is visible!") + bOK = TRUE + end if + End If + Test.MethodTested("getAccessibleAt()",bOK) + + Test.StartMethod("getLocation()") + bOK = true + point1 = oObj.getLocation() + bOK = bOK AND (point1.X = bounds.X) AND (point1.Y = bounds.Y) + Test.MethodTested("getLocation()",bOK) + + Test.StartMethod("getLocationOnScreen()") + Dim accParent As Object + bOK = true + accParent = getParentComponent() + point1 = oObj.getLocationOnScreen() + if NOT isNull(accParent) then + point2 = accParent.getLocationOnScreen() + bOK = bOK AND (point2.X + bounds.X = point1.X) + bOK = bOK AND (point2.Y + bounds.Y = point1.Y) + else + Out.Log("Component's parent is null.") + End If + Test.MethodTested("getLocationOnScreen()",bOK) + + Test.StartMethod("getSize()") + Dim oSize As new com.sun.star.awt.Size + bOK = true + oSize = oObj.getSize() + bOK = bOK AND (oSize.Width = bounds.Width) AND (oSize.Height = bounds.Height) + Test.MethodTested("getSize()",bOK) + + Test.StartMethod("grabFocus()") + bOK = true + oObj.grabFocus() + Test.MethodTested("grabFocus()",bOK) + + Test.StartMethod("getForeground()") + Dim fColor As Long + bOK = true + fColor = oObj.getForeground() + Out.Log("Foreground color is: "+fColor) + Test.MethodTested("getForeground()",bOK) + + Test.StartMethod("getBackground()") + Dim bColor As Long + bOK = true + bColor = oObj.getBackground() + Out.Log("Background color is: "+bColor) + Test.MethodTested("getBackground()",bOK) + + + + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub + + +Function getAccessibleChildren() As Variant + Dim accCount As Integer, i As Integer, j As Integer + Dim accChContext As Object, accCh As Object + Dim resArray(50) As Variant + Dim emptyArray() As Variant + j = 0 + i = 0 + if NOT hasUNOInterfaces(oObj,"drafts.com.sun.star.accessibility.XAccessible") then + Out.Log("An object does not support XAccessible interface!") + Exit Function + End If + accCount = oObj.getAccessibleChildCount() + if (accCount > 50) then accCount = 50 + while (i < accCount) + accCh = oObj.getAccessibleChild(i) + accChContext = accCh.getAccessibleContext() + if hasUNOInterfaces(accChContext,"drafts.com.sun.star.accessibility.XAccessibleComponent") then + resArray(j) = accChContext + j = j + 1 + End If + i = i + 1 + wend + if (accCount <> 0) then + Dim returnArray(j - 1) As Variant + For i = 0 to (j - 1) + returnArray(i) = resArray(i) + next i + getAccessibleChildren() = returnArray() + else + getAccessibleChildren() = emptyArray() + End If +End Function + +Function getParentComponent() As Object + Dim accParent As Object + Dim accParContext As Object + if NOT hasUNOInterfaces(oObj,"drafts.com.sun.star.accessibility.XAccessible") then + Out.Log("An object does not support XAccessible interface!") + Exit Function + End If + accParent = oObj.getAccessibleParent() + if isNull(accParent) then + Out.Log("The component has no accessible parent!") + Exit Function + End If + accParContext = accParent.getAccessibleContext() + if NOT hasUNOInterfaces(accParContext,"drafts.com.sun.star.accessibility.XAccessibleComponent") then + Out.Log("Accessible parent doesn't support XAccessibleComponent!") + Exit Function + else + getParentComponent() = accParContext + End If +End Function +</script:module> diff --git a/qadevOOo/tests/basic/ifc/accessibility/XAccessibleComponent/script.xlb b/qadevOOo/tests/basic/ifc/accessibility/XAccessibleComponent/script.xlb new file mode 100644 index 000000000000..a1c29c03c632 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/accessibility/XAccessibleComponent/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="accessibility_XAccessibleComponent" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="accessibility_XAccessibleComponent"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/accessibility/XAccessibleContext/accessibility_XAccessibleContext.xba b/qadevOOo/tests/basic/ifc/accessibility/XAccessibleContext/accessibility_XAccessibleContext.xba new file mode 100644 index 000000000000..22e672bda823 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/accessibility/XAccessibleContext/accessibility_XAccessibleContext.xba @@ -0,0 +1,156 @@ +<?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="accessibility_XAccessibleContext" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.accessibility.XAccessibleContext +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim childCount As Long, i As Integer + Dim oParent As Object + + Test.StartMethod("getAccessibleChildCount()") + bOK = true + childCount = oObj.getAccessibleChildCount() + bOK = bOK AND (childCount > -1) + Test.MethodTested("getAccessibleChildCount()",bOK) + + + Test.StartMethod("getAccessibleChild()") + Dim childContext As Object + Dim mCount As Integer + bOK = true + i = 0 + if (childCount > 50) then + mCount = 50 + else + mCount = childCount + End If + while (i < mCount) + childContext = oObj.getAccessibleChild(i).getAccessibleContext() + Out.Log(" Child " + i + ": " + childContext.getAccessibleDescription()) + bOK = bOK AND utils.at_equals(childContext.getAccessibleParent(), oObj) + i = i + 1 + wend + Test.MethodTested("getAccessibleChild()",bOK) + + + Test.StartMethod("getAccessibleParent()") + bOK = true + oParent = oObj.getAccessibleParent() + bOK = bOK AND NOT isNull(oParent) + Test.MethodTested("getAccessibleParent()",bOK) + + + Test.StartMethod("getAccessibleIndexInParent()") + Dim idx As Integer + Dim parentAC As Object + bOK = true + idx = oObj.getAccessibleIndexInParent() + parentAC = oParent.getAccessibleContext() + bOK = bOK AND utils.at_equals(parentAC.getAccessibleChild(idx), oObj) + Test.MethodTested("getAccessibleIndexInParent()",bOK) + + + Test.StartMethod("getAccessibleRole()") + Dim role As Integer + bOK = true + role = oObj.getAccessibleRole() + Out.Log("The role is " + role) + bOK = bOK AND (role > -1) + Test.MethodTested("getAccessibleRole()",bOK) + + + Test.StartMethod("getAccessibleDescription()") + Dim descr As String + bOK = true + descr = oObj.getAccessibleDescription() + Out.Log("The description is " + descr) + bOK = bOK AND NOT isNull(descr) + Test.MethodTested("getAccessibleDescription()",bOK) + + + Test.StartMethod("getAccessibleName()") + Dim oName As String + bOK = true + oName = oObj.getAccessibleName() + Out.Log("The name is " + oName) + bOK = bOK AND NOT isNull(oName) + Test.MethodTested("getAccessibleName()",bOK) + + + Test.StartMethod("getAccessibleRelationSet()") + Dim oSet As Variant + bOK = true + oSet = oObj.getAccessibleRelationSet() + ' Relationset could be null + if not isNull(oSet) then + oSet.getRelationCount() + end if + Test.MethodTested("getAccessibleRelationSet()",bOK) + + + Test.StartMethod("getAccessibleStateSet()") + bOK = true + oSet = oObj.getAccessibleStateSet() + bOK = bOK AND NOT isNull(oSet) + if NOT bOK then Out.Log("This object does not support states") + Test.MethodTested("getAccessibleStateSet()",bOK) + + + Test.StartMethod("getLocale()") + Dim oLoc As Variant + bOK = true + oLoc = oObj.getLocale() + Out.Log("The locale is "+oLoc.Language+", "+oLoc.Country) + bOK = bOK AND NOT isNull(oLoc) AND (len(oLoc.Language) > 0) AND (len(oLoc.Country) > 0) + Test.MethodTested("getLocale()",bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/accessibility/XAccessibleContext/script.xlb b/qadevOOo/tests/basic/ifc/accessibility/XAccessibleContext/script.xlb new file mode 100644 index 000000000000..5e4280103263 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/accessibility/XAccessibleContext/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="accessibility_XAccessibleContext" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="accessibility_XAccessibleContext"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/accessibility/XAccessibleEditableText/accessibility_XAccessibleEditableText.xba b/qadevOOo/tests/basic/ifc/accessibility/XAccessibleEditableText/accessibility_XAccessibleEditableText.xba new file mode 100644 index 000000000000..df3cfba9d9e0 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/accessibility/XAccessibleEditableText/accessibility_XAccessibleEditableText.xba @@ -0,0 +1,181 @@ +<?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="accessibility_XAccessibleEditableText" 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 + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' global hasChangeableAttrs as boolean + +'************************************************************************* + + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.accessibility.XAccessibleEditableText +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean, locRes As Boolean + Dim oldText As String, curText As String + Dim length As Integer, initialText As String + + oldText = oObj.getText() + initialText = oldText + length = oObj.getCharacterCount() + Out.Log("Text: "+oldText) + Out.Log("Length: "+length) + + + Test.StartMethod("cutText()") + bOK = true + locRes = oObj.cutText(0,length) + curText = oObj.getText() + bOK = bOK AND (len(curText) = 0) AND locRes + Test.MethodTested("cutText()",bOK) + + + Test.StartMethod("pasteText()") + bOK = true + locRes = oObj.pasteText(0) + curText = oObj.getText() + bOK = bOK AND (len(curText) = length) AND locRes + Test.MethodTested("pasteText()",bOK) + + + Test.StartMethod("insertText()") + Dim insString As String + bOK = true + insString = "Inserted String" + locRes = oObj.insertText(insString,length) + curText = oObj.getText() + bOK = bOK AND (curText = oldText + insString) AND locRes + Test.MethodTested("insertText()",bOK) + + + Test.StartMethod("deleteText()") + bOK = true + locRes = oObj.deleteText(len(curText) - len(insString),len(curText)) + curText = oObj.getText() + bOK = bOK AND (curText = oldText) AND locRes + Test.MethodTested("deleteText()",bOK) + + + Test.StartMethod("replaceText()") + Dim replacement As String + Dim endIndex As Integer + bOK = true + oObj.setText(oldText+"(part of string to replace)") + endIndex = len(oObj.getText) + replacement = "Replacement string" + locRes = oObj.replaceText(len(oldText),endIndex,replacement) + curText = oObj.getText() + bOK = bOK AND (curText = oldText + replacement) AND locRes + Test.MethodTested("replaceText()",bOK) + + + Test.StartMethod("setAttributes()") + if hasChangeableAttrs then + Dim attrs As Variant, newAttrs As Variant + Dim i As Integer + bOK = true + length = oObj.getCharacterCount() + attrs = oObj.getCharacterAttributes(0) + for i=0 to ubound(attrs()) + if attrs(i).Name = "CharBackColor" then attrs(i).Value = RGB(120,205,40) + if attrs(i).Name = "CharHeight" then attrs(i).Value = 30 + if attrs(i).Name = "CharColor" then attrs(i).Value = RGB(255,255,255) + next i + locRes = oObj.setAttributes(0,length,attrs) + bOK = bOK AND locRes + newAttrs = oObj.getCharacterAttributes(0) + bOK = bOK AND PropertyTester.equals(attrs,newAttrs) + else + Out.Log("Object has no changeable attributes.") + bOK = true + End If + Test.MethodTested("setAttributes()",bOK) + + + Test.StartMethod("setText()") + Dim newText As String + bOK = true + oldText = oObj.getText() + newText = "New string" + locRes = oObj.setText(newText) + curText = oObj.getText() + bOK = bOK AND (curText = newText) AND locRes + if locRes then + Out.Log("Test 1 passed OK.") + else + Out.Log("Test 1 failed.") + End If + newText = "" + locRes = oObj.setText(newText) + curText = oObj.getText() + bOK = bOK AND (newText = curText) AND locRes + if locRes then + Out.Log("Test 2 passed OK.") + else + Out.Log("Test 2 failed.") + End If + locRes = oObj.setText(oldText) + curText = oObj.getText() + bOK = bOK AND (curText = oldText) AND locRes + if locRes then + Out.Log("Test 3 passed OK.") + else + Out.Log("Test 3 failed.") + End If + Test.MethodTested("setText()",bOK) + + out.dbg("Setting initial text: " + initialText ) + oObj.setText(initialText) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/accessibility/XAccessibleEditableText/script.xlb b/qadevOOo/tests/basic/ifc/accessibility/XAccessibleEditableText/script.xlb new file mode 100644 index 000000000000..d2109838e813 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/accessibility/XAccessibleEditableText/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="accessibility_XAccessibleEditableText" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="accessibility_XAccessibleEditableText"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/accessibility/XAccessibleEventBroadcaster/accessibility_XAccessibleEventBroadcaster.xba b/qadevOOo/tests/basic/ifc/accessibility/XAccessibleEventBroadcaster/accessibility_XAccessibleEventBroadcaster.xba new file mode 100644 index 000000000000..e8dd62a677cb --- /dev/null +++ b/qadevOOo/tests/basic/ifc/accessibility/XAccessibleEventBroadcaster/accessibility_XAccessibleEventBroadcaster.xba @@ -0,0 +1,149 @@ +<?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="accessibility_XAccessibleEventBroadcaster" 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 + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' fireEvent() precedure +' located in component test + +'************************************************************************* + + + + + +Dim oListener1 As Object +Dim oListener2 As Object +Dim bL1called As Boolean +Dim bL2called As Boolean + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.accessibility.XAccessibleEventBroadcaster +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim isTransient As Boolean + Dim stateSet As Variant + bOK = true + + 'out.log("Creating Listeners...") + oListener1 = createUNOListener("EL1_","com.sun.star.accessibility.XAccessibleEventListener") + oListener2 = createUNOListener("EL2_","com.sun.star.accessibility.XAccessibleEventListener") + bOK = bOK AND NOT isNULL(oListener1) AND NOT isNULL(oListener2) + if NOT bOK then out.log( "ERROR: Cannot create listeners...") + + if NOT hasUNOInterfaces(oObj,"com.sun.star.accessibility.XAccessibleContext") then + 'out.log("Object does not implement XAccessibleContext.") + isTransient = false + else + stateSet = oObj.getAccessibleStateSet() + isTransient = stateSet.contains(27) + End If + + Test.StartMethod("addEventListener()") + bOK = true + bL1called = false + bL2called = false + 'out.log("Adding two listeners...") + oObj.com_sun_star_accessibility_XAccessibleEventBroadcaster_addEventListener(oListener1) + oObj.com_sun_star_accessibility_XAccessibleEventBroadcaster_addEventListener(oListener2) + 'out.log("fire event") + fireEvent() + wait(500) + out.log("Listener1 called: "+bL1called) + out.log("Listener2 called: "+bL2called) + if NOT isTransient then + bOK = bOK AND bL1called AND bL2called + else + 'out.log("Object is transient, listeners aren't expected to call.") + bOK = true + End If + Test.MethodTested("addEventListener()",bOK) + + + Test.StartMethod("removeEventListener()") + bOK = true + bL1called = false + bL2called = false + 'out.log("Removing one listener...") + oObj.com_sun_star_accessibility_XAccessibleEventBroadcaster_removeEventListener(oListener1) + 'out.log("fire event") + fireEvent() + wait(500) + out.log("Listener1 called: "+bL1called) + out.log("Listener2 called: "+bL2called) + if NOT isTransient then + bOK = bOK AND NOT bL1called AND bL2called + else + 'out.log("Object is transient, listeners aren't expected to call.") + bOK = true + End If + Test.MethodTested("removeEventListener()",bOK) + + ' Removing the second listener... + oObj.com_sun_star_accessibility_XAccessibleEventBroadcaster_removeEventListener(oListener2) + + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub + +Sub EL1_notifyEvent(ev As Variant) + 'out.log("CallBack for Listener1 notifyEvent was called.") + bL1called = true +End Sub + +Sub EL1_disposing() +End Sub + +Sub EL2_notifyEvent(ev As Variant) + 'out.log("CallBack for Listener2 notifyEvent was called.") + bL2called = true +End Sub + +Sub EL2_disposing() +End Sub + +</script:module>
\ No newline at end of file diff --git a/qadevOOo/tests/basic/ifc/accessibility/XAccessibleEventBroadcaster/script.xlb b/qadevOOo/tests/basic/ifc/accessibility/XAccessibleEventBroadcaster/script.xlb new file mode 100644 index 000000000000..9a06ecd1c438 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/accessibility/XAccessibleEventBroadcaster/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="accessibility_XAccessibleEventBroadcaster" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="accessibility_XAccessibleEventBroadcaster"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/accessibility/XAccessibleExtendedComponent/accessibility_XAccessibleExtendedComponent.xba b/qadevOOo/tests/basic/ifc/accessibility/XAccessibleExtendedComponent/accessibility_XAccessibleExtendedComponent.xba new file mode 100644 index 000000000000..202adf953a6a --- /dev/null +++ b/qadevOOo/tests/basic/ifc/accessibility/XAccessibleExtendedComponent/accessibility_XAccessibleExtendedComponent.xba @@ -0,0 +1,86 @@ +<?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="accessibility_XAccessibleExtendedComponent" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.accessibility.XAccessibleExtendedComponent +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Test.StartMethod("getFont()") + Dim font As Variant + Dim fDescr As new com.sun.star.awt.FontDescriptor + bOK = true + font = oObj.getFont() + if NOT isNull(font) then + fDescr = font.getFontDescriptor() + Out.Log("Font: "+fDescr.Name) + else + Out.Log("Font: null") + End If + Test.MethodTested("getFont()",bOK) + + Test.StartMethod("getTitledBorderText()") + Dim tbText As String + bOK = true + tbText = oObj.getTitledBorderText() + Out.Log("TitledBorderText: "+tbText) + bOK = bOK AND NOT isNull(tbText) + Test.MethodTested("getTitledBorderText()",bOK) + + Test.StartMethod("getToolTipText()") + Dim ttText As String + bOK = true + ttText = oObj.getToolTipText() + Out.Log("TitledBorderText: "+ttText) + bOK = bOK AND NOT isNull(ttText) + Test.MethodTested("getToolTipText()",bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/accessibility/XAccessibleExtendedComponent/script.xlb b/qadevOOo/tests/basic/ifc/accessibility/XAccessibleExtendedComponent/script.xlb new file mode 100644 index 000000000000..de17e5c2c8c1 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/accessibility/XAccessibleExtendedComponent/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="accessibility_XAccessibleExtendedComponent" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="accessibility_XAccessibleExtendedComponent"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/accessibility/XAccessibleImage/accessibility_XAccessibleImage.xba b/qadevOOo/tests/basic/ifc/accessibility/XAccessibleImage/accessibility_XAccessibleImage.xba new file mode 100644 index 000000000000..5278d8faaca7 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/accessibility/XAccessibleImage/accessibility_XAccessibleImage.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="accessibility_XAccessibleImage" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.accessibility.XAccessibleImage +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Test.StartMethod("getAccessibleImageDescription()") + Dim descr As String + bOK = true + descr = oObj.getAccessibleImageDescription() + Out.Log("AccessibleImageDescription: "+descr) + bOK = bOK AND NOT isNull(descr) + Test.MethodTested("getAccessibleImageDescription()",bOK) + + Test.StartMethod("getAccessibleImageHeight()") + Dim height As Long + bOK = true + height = oObj.getAccessibleImageHeight() + Out.Log("AccessibleImageHeight: "+height) + Test.MethodTested("getAccessibleImageHeight()",bOK) + + Test.StartMethod("getAccessibleImageWidth()") + Dim width As Long + bOK = true + width = oObj.getAccessibleImageWidth() + Out.Log("AccessibleImageWidth: "+width) + Test.MethodTested("getAccessibleImageWidth()",bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/accessibility/XAccessibleImage/script.xlb b/qadevOOo/tests/basic/ifc/accessibility/XAccessibleImage/script.xlb new file mode 100644 index 000000000000..71df8d188c26 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/accessibility/XAccessibleImage/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="accessibility_XAccessibleImage" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="accessibility_XAccessibleImage"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/accessibility/XAccessibleSelection/accessibility_XAccessibleSelection.xba b/qadevOOo/tests/basic/ifc/accessibility/XAccessibleSelection/accessibility_XAccessibleSelection.xba new file mode 100644 index 000000000000..584749823d72 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/accessibility/XAccessibleSelection/accessibility_XAccessibleSelection.xba @@ -0,0 +1,259 @@ +<?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="accessibility_XAccessibleSelection" 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 + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' Global multiSelection As Boolean + +'************************************************************************* + + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.accessibility.XAccessibleSelection +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean, locRes As Boolean + Dim chCount As Long, selCount As Long + Dim i As Long, mCount As Integer + + if multiSelection then + Out.Log("Object allows multiple selection!") + else + Out.Log("Object does not allow multiple selection!") + End If + + chCount = oObj.getAccessibleChildCount() + selCount = oObj.getSelectedAccessibleChildCount() + Out.Log("Object has "+chCount+" child(ren), "+selCount+" of them selected.") + If (chCount > 50) then + mCount = 50 + Out.Log("Object has too many children. Testing only first 50.") + else + mCount = chCount + End If + + clearSelection() + + Test.StartMethod("selectAccessibleChild()") + bOK = true + if (mCount > 0) then + i = mCount - 1 + while (oObj.isAccessibleChildSelected(i) OR itemDisabled(oObj.getAccessibleChild(i))) AND (i > 0) + i = i - 1 + wend + if (i >= 0) then + Out.Log("Selecting child #"+i+"...") + oObj.selectAccessibleChild(i) + wait(500) + locRes = oObj.isAccessibleChildSelected(i) + Out.Log("Child #"+i+" selected: "+locRes) + bOK = bOK AND locRes + End If + End If + clearSelection() + Test.MethodTested("selectAccessibleChild()",bOK) + + Test.StartMethod("isAccessibleChildSelected()") + bOK = true + if (mCount > 0) then + i = mCount - 1 + while (oObj.isAccessibleChildSelected(i) OR itemDisabled(oObj.getAccessibleChild(i))) AND (i > 0) + i = i - 1 + wend + if (i >= 0) then + Out.Log("Selecting child #"+i+"...") + oObj.selectAccessibleChild(i) + wait(500) + locRes = oObj.isAccessibleChildSelected(i) + Out.Log("Child #"+i+" selected: "+locRes) + bOK = bOK AND locRes + End If + End If + clearSelection() + Test.MethodTested("isAccessibleChildSelected()",bOK) + + Test.StartMethod("clearAccessibleSelection()") + bOK = true + if (mCount > 0) AND (multiSelection) then + oObj.selectAccessibleChild(chCount - 1) + wait(500) + oObj.clearAccessibleSelection() + wait(500) + bOK = bOK AND NOT oObj.isAccessibleChildSelected(mCount - 1) + else + Out.Log("Cannot clear all selection for this object!") + End If + Test.MethodTested("clearAccessibleSelection()",bOK) + +' ### The following property was not found in correspond IDL file! ### + Test.StartMethod("selectAllAccessibleChildren()") + bOK = true + i = 0 + if ((mCount > 0) AND multiSelection) then +' ### The following property was not found in correspond IDL file! ### + oObj.selectAllAccessibleChildren() + wait(500) + while (i < mCount) + bOK = bOK AND oObj.isAccessibleChildSelected(i) + i = i + 1 + wend + else + Out.Log("Cannot select all children for this object!") + End If + clearSelection() + Test.MethodTested("selectAllAccessibleChildren()",bOK) + + Test.StartMethod("getSelectedAccessibleChildCount()") + bOK = true + Out.Log("Selecting all...") + oObj.selectAllAccessibleChildren() + wait(500) + selCount = oObj.getSelectedAccessibleChildCount() + Out.Log("Selected "+selCount+" child(ren).") + If (multiSelection) then + bOK = bOK AND (selCount = chCount) + else + bOK = bOK AND (selCount = 1) + End If + clearSelection() + selCount = oObj.getSelectedAccessibleChildCount() + if (multiSelection) then + bOK = bOK AND (selCount = 0) + else + bOK = bOK AND (selCount = 1) + End If + Test.MethodTested("getSelectedAccessibleChildCount()",bOK) + + Test.StartMethod("getSelectedAccessibleChild()") + Dim selAccChild As Object, accChild As Object + bOK = true + if (mCount > 0) then + i = mCount - 1 + while (oObj.isAccessibleChildSelected(i) OR itemDisabled(oObj.getAccessibleChild(i))) AND (i > 0) + i = i - 1 + wend + if (i >= 0) then + Out.Log("Selecting child #"+i+"...") + oObj.selectAccessibleChild(i) + wait(500) + Out.Log("Child #"+i+" selected: "+oObj.isAccessibleChildSelected(i)) + Out.Log("Now "+oObj.getSelectedAccessibleChildCount()+" child(ren) selected.") + selCount = oObj.getSelectedAccessibleChildCount() + if (selCount > 0) then + selAccChild = oObj.getSelectedAccessibleChild(selCount-1) + accChild = oObj.getAccessibleChild(i) + bOK = bOK AND utils.at_equals(accChild,selAccChild) + else + Out.Log("There are no selected children. Test fails.") + bOK = false + End If + End If + End If + Test.MethodTested("getSelectedAccessibleChild()",bOK) + + Test.StartMethod("deselectAccessibleChild()") + Dim newSelCount As Long + Dim isSelected as Boolean + bOK = true + oObj.selectAllAccessibleChildren() + wait(500) + selCount = oObj.getSelectedAccessibleChildCount() + Out.Log("There was "+selCount+" selected child(ren)") + Out.Log("Deselecting child...") + for i = 0 to mCount - 1 + if oObj.isAccessibleChildSelected(i) then + isSelected = true + end if + oObj.deselectAccessibleChild(i) + wait(500) + newSelCount = oObj.getSelectedAccessibleChildCount() + Out.Log("selCount = " + selCount + " newSelCount = " + newSelCount) + if (multiSelection) then + if isSelected then + Out.Log("isSelected") + bOK = bOK AND (selCount - 1 = newSelCount) + else + bOK = bOK AND (selCount = newSelCount) + end if + else + Out.Log("is not multi") + bOK = bOK AND (newSelCount <= 1) + End If + selCount = newSelCount + next + Test.MethodTested("deselectAccessibleChild()",bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub + +Sub clearSelection() + if NOT multiSelection then Exit Sub + Dim selCount As Long + selCount = oObj.getSelectedAccessibleChildCount() + if (selCount = 0) then Exit Sub + oObj.clearAccessibleSelection() + wait(500) + selCount = oObj.getSelectedAccessibleChildCount() + if selCount = 0 then + Out.Log("Deselect all: success") + else + Out.Log("Deselect all: error!. "+selCount+" child(ren) remains selected.") + End If +End Sub + +Function itemDisabled(oChild As Object) As Boolean + if NOT hasUNOInterfaces(oChild,"com.sun.star.accessibility.XAccessibleContext") then + oChild = oChild.getAccessibleContext() + End If + itemDisabled = NOT oChild.getAccessibleStateSet().contains(21) +End Function + +</script:module> diff --git a/qadevOOo/tests/basic/ifc/accessibility/XAccessibleSelection/script.xlb b/qadevOOo/tests/basic/ifc/accessibility/XAccessibleSelection/script.xlb new file mode 100644 index 000000000000..6f5d862cdcd3 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/accessibility/XAccessibleSelection/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="accessibility_XAccessibleSelection" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="accessibility_XAccessibleSelection"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/accessibility/XAccessibleTable/accessibility_XAccessibleTable.xba b/qadevOOo/tests/basic/ifc/accessibility/XAccessibleTable/accessibility_XAccessibleTable.xba new file mode 100644 index 000000000000..5b02f88e703d --- /dev/null +++ b/qadevOOo/tests/basic/ifc/accessibility/XAccessibleTable/accessibility_XAccessibleTable.xba @@ -0,0 +1,291 @@ +<?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="accessibility_XAccessibleTable" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.accessibility.XAccessibleTable +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim implSel As Boolean + + implSel = hasUNOInterfaces(oObj,"drafts.com.sun.star.accessibility.XAccessibleSelection") + if (NOT implSel) then + Out.Log("!!! The component doesn't implement the interface XAccessibleSelection.") + Out.Log("!!! This interface is required for more detailed tests.") + End If + + Test.StartMethod("getAccessibleRowCount()") + Dim rowCount As Long + bOK = true + rowCount = oObj.getAccessibleRowCount() + Out.Log("Accessible row count: "+rowCount) + Test.MethodTested("getAccessibleRowCount()",bOK) + + Test.StartMethod("getAccessibleColumnCount()") + Dim colCount As Long + bOK = true + colCount = oObj.getAccessibleColumnCount() + Out.Log("Accessible column count: "+colCount) + Test.MethodTested("getAccessibleColumnCount()",bOK) + + Test.StartMethod("getAccessibleRowDescription()") + Dim rowDescr As String + bOK = true + if (rowCount > 0) then + rowDescr = oObj.getAccessibleRowDescription(rowCount - 1) + Out.Log("Row "+(rowCount-1)+" description: "+rowDescr) + bOK = bOK AND NOT isNull(rowDescr) + else + Out.Log("!!! RowCount is 0. Could not test this method.") + End If + Test.MethodTested("getAccessibleRowDescription()",bOK) + + Test.StartMethod("getAccessibleColumnDescription()") + Dim colDescr As String + bOK = true + if (colCount > 0) then + colDescr = oObj.getAccessibleRowDescription(colCount - 1) + Out.Log("Column "+(colCount-1)+" description: "+colDescr) + bOK = bOK AND NOT isNull(colDescr) + else + Out.Log("!!! ColumnCount is 0. Could not test this method.") + End If + Test.MethodTested("getAccessibleColumnDescription()",bOK) + + Test.StartMethod("getAccessibleRowExtentAt()") + Dim ext As Long + bOK = true + ext = oObj.getAccessibleRowExtentAt(rowCount - 1, colCount - 1) + Out.Log(ext) + bOK = bOK AND (ext >= 1) + Test.MethodTested("getAccessibleRowExtentAt()",bOK) + + Test.StartMethod("getAccessibleColumnExtentAt()") + bOK = true + ext = oObj.getAccessibleColumnExtentAt(rowCount - 1, colCount - 1) + Out.Log(ext) + bOK = bOK AND (ext >= 1) + Test.MethodTested("getAccessibleColumnExtentAt()",bOK) + + Test.StartMethod("getAccessibleRowHeaders()") + Dim rowHeaders As Object + bOK = true + rowHeaders = oObj.getAccessibleRowHeaders() + bOK = bOK AND NOT isNull(rowHeaders) + Test.MethodTested("getAccessibleRowHeaders()",bOK) + + Test.StartMethod("getAccessibleColumnHeaders()") + Dim colHeaders As Object + bOK = true + colHeaders = oObj.getAccessibleColumnHeaders() + bOK = bOK AND NOT isNull(colHeaders) + Test.MethodTested("getAccessibleColumnHeaders()",bOK) + + Test.StartMethod("getSelectedAccessibleRows()") + Dim selRows As Variant + Dim elCount As Long, i As Integer + Dim locRes As Boolean + bOK = true + if implSel then + oObj.selectAllAccessible() + End If + selRows = oObj.getSelectedAccessibleRows() + elCount = ubound(selRows) - 1 + Out.Log("Returned sequence has "+elCount+" elements") + if implSel then + bOK = bOK AND (elCount = rowCount) + else + bOK = bOK AND (elCount = 0) + End If + if (elCount > 0) then + Out.Log("Checking that returned sequence is in ascending order") + End If + i = 1 + while (i < elCount) + locRes = (selRows(i) >= selRows(i-1)) + bOK = bOK AND locRes + if NOT locRes then + Out.Log("Element "+i+" : Returned sequence is not in accending order.") + break + End If + wend + Test.MethodTested("getSelectedAccessibleRows()",bOK) + + Test.StartMethod("getSelectedAccessibleColumns()") + Dim selCols As Variant + bOK = true + selCols = oObj.getSelectedAccessibleRows() + elCount = ubound(selCols) - 1 + Out.Log("Returned sequence has "+elCount+" elements") + if implSel then + bOK = bOK AND (elCount = colCount) + else + bOK = bOK AND (elCount = 0) + End If + if (elCount > 0) then + Out.Log("Checking that returned sequence is in ascending order") + End If + i = 1 + while (i < elCount) + locRes = (selCols(i) >= selCols(i-1)) + bOK = bOK AND locRes + if NOT locRes then + Out.Log("Element "+i+" : Returned sequence is not in accending order.") + break + End If + wend + Test.MethodTested("getSelectedAccessibleColumns()",bOK) + + Test.StartMethod("isAccessibleRowSelected()") + Dim mCount As Integer + bOK = true + locRes = true + if (rowCount > 299) then + mCount = 299 + else + mCount = rowCount - 1 + End If + for i=0 to mCount + locRes = oObj.isAccessibleRowSelected(i) + if implSel then + bOK = bOK AND locRes + else + bOK = bOK AND NOT locRes + End If + next i + Out.Log("Checked "+i+" of "+rowCount+" rows.") + Test.MethodTested("isAccessibleRowSelected()",bOK) + + Test.StartMethod("isAccessibleColumnSelected()") + bOK = true + locRes = true + if (colCount > 299) then + mCount = 299 + else + mCount = colCount - 1 + End If + for i=0 to mCount + locRes = oObj.isAccessibleColumnSelected(i) + if implSel then + bOK = bOK AND locRes + else + bOK = bOK AND NOT locRes + End If + next i + Out.Log("Checked "+i+" of "+colCount+" columns.") + Test.MethodTested("isAccessibleColumnSelected()",bOK) + + Test.StartMethod("getAccessibleCellAt()") + Dim xAccCell As Object + bOK = true + xAccCell = oObj.getAccessibleCellAt(rowCount - 1, colCount - 1) + bOK = bOK AND NOT isNull(xAccCell) + Test.MethodTested("getAccessibleCellAt()",bOK) + + Test.StartMethod("getAccessibleCaption()") + Dim caption As Object + bOK = true + caption = oObj.getAccessibleCaption() + Test.MethodTested("getAccessibleCaption()",bOK) + + Test.StartMethod("getAccessibleSummary()") + Dim summary As Object + bOK = true + summary = oObj.getAccessibleSummary() + Test.MethodTested("getAccessibleSummary()",bOK) + + Test.StartMethod("isAccessibleSelected()") + bOK = true + locRes = oObj.isAccessibleSelected(rowCount - 1, colCount - 1) + if implSel then + bOK = bOK AND locRes + else + bOK = bOK AND NOT locRes + End If + Test.MethodTested("isAccessibleSelected()",bOK) + + Test.StartMethod("getAccessibleIndex()") + Dim ind As Long, expIndex As Long + bOK = true + ind = oObj.getAccessibleIndex(rowCount - 1, colCount - 1) + Out.Log("AccessibleIndex is: "+ind) + if NOT isNull(xAccCell) then + expIndex = xAccCell.getAccessibleContext().getAccessibleIndexInParent() + Out.Log("Expected index is: "+expIndex) + bOK = bOK AND (ind = expIndex) + End If + Test.MethodTested("getAccessibleIndex()",bOK) + + Test.StartMethod("getAccessibleRow()") + Dim rowIndex As Long + Dim chCount As Long + bOK = true + if hasUNOInterfaces(oObj,"drafts.com.sun.star.accessibility.XAccessibleContext") then + chCount = oObj.getAccessibleChildCount() + rowIndex = oObj.getAccessibleRow(chCount - 1) + bOK = bOK AND (rowIndex >= 0) AND (rowIndex <= rowCount) + End If + rowIndex = oObj.getAccessibleRow(0) + bOK = bOK AND (rowIndex >= 0) AND (rowIndex <= rowCount) + Test.MethodTested("getAccessibleRow()",bOK) + + Test.StartMethod("getAccessibleColumn()") + Dim colIndex As Long + bOK = true + if hasUNOInterfaces(oObj,"drafts.com.sun.star.accessibility.XAccessibleContext") then + chCount = oObj.getAccessibleChildCount() + colIndex = oObj.getAccessibleColumn(chCount - 1) + bOK = bOK AND (colIndex >= 0) AND (colIndex <= colCount) + End If + colIndex = oObj.getAccessibleColumn(0) + bOK = bOK AND (colIndex >= 0) AND (colIndex <= colCount) + Test.MethodTested("getAccessibleColumn()",bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/accessibility/XAccessibleTable/script.xlb b/qadevOOo/tests/basic/ifc/accessibility/XAccessibleTable/script.xlb new file mode 100644 index 000000000000..4620dadd95c2 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/accessibility/XAccessibleTable/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="accessibility_XAccessibleTable" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="accessibility_XAccessibleTable"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/accessibility/XAccessibleText/accessibility_XAccessibleText.xba b/qadevOOo/tests/basic/ifc/accessibility/XAccessibleText/accessibility_XAccessibleText.xba new file mode 100644 index 000000000000..1ec8ddc02c6b --- /dev/null +++ b/qadevOOo/tests/basic/ifc/accessibility/XAccessibleText/accessibility_XAccessibleText.xba @@ -0,0 +1,197 @@ +<?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="accessibility_XAccessibleText" 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 + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' Global accText as String +' Global readOnly as Boolean + +'************************************************************************* + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.accessibility.XAccessibleText +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim chCount As Integer + Dim accTextSegment as new com.sun.star.accessibility.TextSegment + + Test.StartMethod("getCharacterCount()") + bOK = true + chCount = oObj.getCharacterCount() + Out.Log("Character count: "+chCount) + bOK = bOK AND (len(accText) = chCount) + Test.MethodTested("getCharacterCount()",bOK) + + Test.StartMethod("getCaretPosition()") + Test.StartMethod("setCaretPosition()") + bOK = true + Dim carPos As Integer + oObj.setCaretPosition(chCount - 1) + carPos = oObj.getCaretPosition() + if not readOnly then + Out.Log("getCaretPosition: " + carPos) + bOK = bOK AND (carPos = chCount - 1) + else + Out.Log("Object is read only and Caret position couldn't be set") + end if + Test.MethodTested("getCaretPosition()",bOK) + Test.MethodTested("setCaretPosition()",bOK) + + Test.StartMethod("getCharacter()") + Dim i As Integer + bOK = true + for i = 0 to chCount-1 + bOK = bOK AND (chr(oObj.getCharacter(i)) = _ + utils.getCharacter(i+1,accText)) + next i + Test.MethodTested("getCharacter()",bOK) + + Test.StartMethod("getCharacterAttributes()") + Dim attrs() As Variant + Dim ReqAttrs(0) as String + bOK = true + attrs = oObj.getCharacterAttributes(chCount - 1, ReqAttrs()) + bOK = bOK AND NOT isNull(attrs) + Out.Log("Properties ubound: "+ubound(attrs)) + Test.MethodTested("getCharacterAttributes()",bOK) + + Test.StartMethod("getCharacterBounds()") + Dim chBounds As new com.sun.star.awt.Rectangle + bOK = true + chBounds = oObj.getCharacterBounds(chCount - 1) + Out.Log("Character boundbox: "+chBounds.X+", "+chBounds.Y+", "+ _ + chBounds.Width+", "+chBounds.Height) + bOK = bOK AND NOT isNull(chBounds) + Test.MethodTested("getCharacterBounds()",bOK) + + Test.StartMethod("getIndexAtPoint()") + Dim index As Integer + Dim point As new com.sun.star.awt.Point + bOK = true + point.X = chBounds.X + 1 + point.Y = chBounds.Y + 1 + index = oObj.getIndexAtPoint(point) + bOK = bOK AND (index = chCount -1) + Test.MethodTested("getIndexAtPoint()",bOK) + + Test.StartMethod("getSelectedText()") + bOK = true + oObj.setSelection(0, chCount) + if not readOnly then + bOK = bOK AND (accText = oObj.getSelectedText()) + else + Out.Log("Object is unselectable") + end if + Test.MethodTested("getSelectedText()",bOK) + + Test.StartMethod("getSelectionStart()") + bOK = true + oObj.setSelection(chCount-1,chCount) + if not readOnly then + bOK = bOK AND (oObj.getSelectionStart() = chCount -1) + else + Out.Log("Object is unselectable") + end if + Test.MethodTested("getSelectionStart()",bOK) + + Test.StartMethod("getSelectionEnd()") + bOK = true + oObj.setSelection(0,chCount - 1) + if not readOnly then + bOK = bOK AND (oObj.getSelectionEnd() = chCount - 1) + else + Out.Log("Object is unselectable") + end if + Test.MethodTested("getSelectionEnd()",bOK) + + Test.StartMethod("setSelection()") + bOK = true + if not readOnly then + bOK = bOK AND oObj.setSelection(0,chCount) + else + Out.Log("Object is unselectable") + end if + Test.MethodTested("setSelection()",bOK) + + Test.StartMethod("getText()") + bOK = true + bOK = bOK AND (accText = oObj.getText()) + Test.MethodTested("getText()",bOK) + + Test.StartMethod("getTextRange()") + bOK = true + bOK = bOK AND (accText = oObj.getTextRange(0,chCount)) + Test.MethodTested("getTextRange()",bOK) + + Test.StartMethod("getTextAtIndex()") + bOK = true + accTextSegment = oObj.getTextAtIndex(chCount - 1, 4) + bOK = bOK AND (accText = accTextSegment.SegmentText) + Test.MethodTested("getTextAtIndex()",bOK) + + Test.StartMethod("getTextBeforeIndex()") + bOK = true + accTextSegment = oObj.getTextBeforeIndex(1, 1) + bOK = bOK AND (accTextSegment.SegmentText = utils.getCharacter(1,accText)) + Test.MethodTested("getTextBeforeIndex()",bOK) + + Test.StartMethod("getTextBehindIndex()") + bOK = true + accTextSegment = oObj.getTextBehindIndex(chCount-2,1) + bOK = bOK AND (accTextSegment.SegmentText = utils.getCharacter(chCount,accText)) + Test.MethodTested("getTextBehindIndex()",bOK) + + Test.StartMethod("copyText()") + bOK = true + bOK = bOK AND oObj.copyText(0,chCount) + if readOnly then bOK = true + Test.MethodTested("copyText()",bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/accessibility/XAccessibleText/script.xlb b/qadevOOo/tests/basic/ifc/accessibility/XAccessibleText/script.xlb new file mode 100644 index 000000000000..26416634cad1 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/accessibility/XAccessibleText/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="accessibility_XAccessibleText" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="accessibility_XAccessibleText"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/accessibility/XAccessibleValue/accessibility_XAccessibleValue.xba b/qadevOOo/tests/basic/ifc/accessibility/XAccessibleValue/accessibility_XAccessibleValue.xba new file mode 100644 index 000000000000..d5a665a9842b --- /dev/null +++ b/qadevOOo/tests/basic/ifc/accessibility/XAccessibleValue/accessibility_XAccessibleValue.xba @@ -0,0 +1,119 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="accessibility_XAccessibleValue" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.accessibility.XAccessibleValue +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Test.StartMethod("getMinimumValue()") + Dim minVal As Variant + bOK = true + minVal = oObj.getMinimumValue() + Out.Log("Minimum value is "+minVal) + Test.MethodTested("getMinimumValue()",bOK) + + Test.StartMethod("getMaximumValue()") + Dim maxVal As Variant + bOK = true + maxVal = oObj.getMaximumValue() + Out.Log("Maximum value is "+maxVal) + Test.MethodTested("getMaximumValue()",bOK) + + Test.StartMethod("getCurrentValue()") + Dim curVal As Variant + bOK = true + curVal = oObj.getCurrentValue() + bOK = bOK AND (curVal >= minVal) AND (curVal <= maxVal) + Test.MethodTested("getCurrentValue()",bOK) + + + Test.StartMethod("setCurrentValue()") + Dim newVal As Variant, resVal As Variant + bOK = true + newVal = curVal + 1 + if (newVal > maxVal) then newVal = newVal - 2 + + Out.Log("Setting new value: "+newVal) + bOK = bOK AND oObj.setCurrentValue(newVal) + resVal = oObj.getCurrentValue() + Out.Log("Result: "+resVal) + bOK = bOK AND (Abs(newVal - resVal) < 0.00001) + + Out.Log("Setting new value: "+minVal) + bOK = bOK AND oObj.setCurrentValue(minVal) + resVal = oObj.getCurrentValue() + Out.Log("Result: "+resVal) + bOK = bOK AND (Abs(minVal - resVal) < 0.00001) + + Out.Log("Setting new value: "+maxVal) + bOK = bOK AND oObj.setCurrentValue(maxVal) + resVal = oObj.getCurrentValue() + Out.Log("Result: "+resVal) + bOK = bOK AND (Abs(maxVal - resVal) < 0.00001) + + newVal = minVal - 1 + Out.Log("Setting new value: "+newVal) + bOK = bOK AND oObj.setCurrentValue(newVal) + resVal = oObj.getCurrentValue() + Out.Log("Result: "+resVal) + bOK = bOK AND (Abs(minVal - resVal) < 0.00001) + + newVal = maxVal + 1 + Out.Log("Setting new value: "+newVal) + bOK = bOK AND oObj.setCurrentValue(newVal) + resVal = oObj.getCurrentValue() + Out.Log("Result: "+resVal) + bOK = bOK AND (Abs(maxVal - resVal) < 0.00001) + + Test.MethodTested("setCurrentValue()",bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/accessibility/XAccessibleValue/script.xlb b/qadevOOo/tests/basic/ifc/accessibility/XAccessibleValue/script.xlb new file mode 100644 index 000000000000..24a50a082374 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/accessibility/XAccessibleValue/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="accessibility_XAccessibleValue" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="accessibility_XAccessibleValue"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/awt/UnoControlButtonModel/awt_UnoControlButtonModel.xba b/qadevOOo/tests/basic/ifc/awt/UnoControlButtonModel/awt_UnoControlButtonModel.xba new file mode 100644 index 000000000000..d55c0adca69a --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/UnoControlButtonModel/awt_UnoControlButtonModel.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="awt_UnoControlButtonModel" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.awt.UnoControlButtonModel +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + PropertyTester.TestProperty("BackgroundColor") + + PropertyTester.TestProperty("DefaultButton") + + PropertyTester.TestProperty("Enabled") + + PropertyTester.TestProperty("FontDescriptor") + + PropertyTester.TestProperty("Label") + + PropertyTester.TestProperty("Printable") + + PropertyTester.TestProperty("Tabstop") + + PropertyTester.TestProperty("TextColor") + + PropertyTester.TestProperty("HelpText") + + PropertyTester.TestProperty("HelpURL") + + PropertyTester.TestProperty("PushButtonType", Array(0,1,2,3)) + + PropertyTester.TestProperty("FontEmphasisMark") + + PropertyTester.TestProperty("FontRelief") + + PropertyTester.TestProperty("ImageAlign") + + PropertyTester.TestProperty("ImageURL") + + PropertyTester.TestProperty("State") + + PropertyTester.TestProperty("TextLineColor") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/awt/UnoControlButtonModel/script.xlb b/qadevOOo/tests/basic/ifc/awt/UnoControlButtonModel/script.xlb new file mode 100644 index 000000000000..575dc0d406db --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/UnoControlButtonModel/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="awt_UnoControlButtonModel" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="awt_UnoControlButtonModel"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/awt/UnoControlCheckBoxModel/awt_UnoControlCheckBoxModel.xba b/qadevOOo/tests/basic/ifc/awt/UnoControlCheckBoxModel/awt_UnoControlCheckBoxModel.xba new file mode 100644 index 000000000000..779c47611918 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/UnoControlCheckBoxModel/awt_UnoControlCheckBoxModel.xba @@ -0,0 +1,80 @@ +<?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="awt_UnoControlCheckBoxModel" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.awt.UnoControlCheckBoxModel +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + PropertyTester.TestProperty("Enabled") + + PropertyTester.TestProperty("FontDescriptor") + + PropertyTester.TestProperty("Label") + + PropertyTester.TestProperty("Printable") + + PropertyTester.TestProperty("State", Array(0, 1, 2)) + + PropertyTester.TestProperty("Tabstop") + + PropertyTester.TestProperty("TextColor") + + PropertyTester.TestProperty("TriState") + + PropertyTester.TestProperty("HelpText") + + PropertyTester.TestProperty("HelpURL") + + PropertyTester.TestProperty("FontEmphasisMark") + + PropertyTester.TestProperty("FontRelief") + + PropertyTester.TestProperty("TextLineColor") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/awt/UnoControlCheckBoxModel/script.xlb b/qadevOOo/tests/basic/ifc/awt/UnoControlCheckBoxModel/script.xlb new file mode 100644 index 000000000000..bb8edace5f96 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/UnoControlCheckBoxModel/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="awt_UnoControlCheckBoxModel" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="awt_UnoControlCheckBoxModel"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/awt/UnoControlComboBoxModel/awt_UnoControlComboBoxModel.xba b/qadevOOo/tests/basic/ifc/awt/UnoControlComboBoxModel/awt_UnoControlComboBoxModel.xba new file mode 100644 index 000000000000..781b03931675 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/UnoControlComboBoxModel/awt_UnoControlComboBoxModel.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="awt_UnoControlComboBoxModel" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.awt.UnoControlComboBoxModel +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + PropertyTester.TestProperty("Autocomplete") + + PropertyTester.TestProperty("BackgroundColor") + + PropertyTester.TestProperty("Border") + + PropertyTester.TestProperty("Dropdown") + + PropertyTester.TestProperty("Enabled") + + PropertyTester.TestProperty("FontDescriptor") + + PropertyTester.TestProperty("LineCount") + + PropertyTester.TestProperty("MaxTextLen") + + PropertyTester.TestProperty("Printable") + + PropertyTester.TestProperty("ReadOnly") + + PropertyTester.TestProperty("StringItemList") + + PropertyTester.TestProperty("Tabstop") + + PropertyTester.TestProperty("Text") + + PropertyTester.TestProperty("TextColor") + + PropertyTester.TestProperty("HelpText") + + PropertyTester.TestProperty("HelpURL") + + + PropertyTester.TestProperty("FontEmphasisMark") + + PropertyTester.TestProperty("FontRelief") + + PropertyTester.TestProperty("TextLineColor") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/awt/UnoControlComboBoxModel/script.xlb b/qadevOOo/tests/basic/ifc/awt/UnoControlComboBoxModel/script.xlb new file mode 100644 index 000000000000..042089bbce64 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/UnoControlComboBoxModel/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="awt_UnoControlComboBoxModel" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="awt_UnoControlComboBoxModel"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/awt/UnoControlContainerModel/awt_UnoControlContainerModel.xba b/qadevOOo/tests/basic/ifc/awt/UnoControlContainerModel/awt_UnoControlContainerModel.xba new file mode 100644 index 000000000000..6c313fbc79c9 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/UnoControlContainerModel/awt_UnoControlContainerModel.xba @@ -0,0 +1,65 @@ +<?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="awt_UnoControlContainerModel" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.awt.UnoControlContainerModel +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + PropertyTester.TestProperty("BackgroundColor") + + PropertyTester.TestProperty("Enabled") + + PropertyTester.TestProperty("Border") + + PropertyTester.TestProperty("Printable") + + PropertyTester.TestProperty("Text") + + PropertyTester.TestProperty("HelpText") + + PropertyTester.TestProperty("HelpURL") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/awt/UnoControlContainerModel/script.xlb b/qadevOOo/tests/basic/ifc/awt/UnoControlContainerModel/script.xlb new file mode 100644 index 000000000000..9cf1130d81fd --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/UnoControlContainerModel/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="awt_UnoControlContainerModel" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="awt_UnoControlContainerModel"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/awt/UnoControlCurrencyFieldModel/awt_UnoControlCurrencyFieldModel.xba b/qadevOOo/tests/basic/ifc/awt/UnoControlCurrencyFieldModel/awt_UnoControlCurrencyFieldModel.xba new file mode 100644 index 000000000000..929b2f044ea2 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/UnoControlCurrencyFieldModel/awt_UnoControlCurrencyFieldModel.xba @@ -0,0 +1,134 @@ +<?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="awt_UnoControlCurrencyFieldModel" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.awt.UnoControlCurrencyFieldModel +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim newVal, oldVal As Long + + + PropertyTester.TestProperty("BackgroundColor") + + PropertyTester.TestProperty("Border") + + PropertyTester.TestProperty("CurrencySymbol") + + PropertyTester.TestProperty("DecimalAccuracy") + + PropertyTester.TestProperty("Enabled") + + PropertyTester.TestProperty("FontDescriptor") + + PropertyTester.TestProperty("ShowThousandsSeparator") + + PropertyTester.TestProperty("Printable") + + PropertyTester.TestProperty("ReadOnly") + + PropertyTester.TestProperty("Spin") + + PropertyTester.TestProperty("StrictFormat") + + PropertyTester.TestProperty("Tabstop") + + PropertyTester.TestProperty("TextColor") + + Test.StartMethod("Value") + bOK = true + oldVal = oObj.Value + Out.Log("value before: "+oldVal) + if (oldVal <> 999) then + oObj.Value = 999 + else + oObj.Value = 1000 + endif + newVal = oObj.Value + Out.Log("value after: "+newVal) + bOK = bOK AND (newVal <> oldVal) + Test.MethodTested("Value",bOK) + + Test.StartMethod("ValueMax") + bOK = true + oldVal = oObj.ValueMax + Out.Log("value before: "+oldVal) + if (oldVal <> 1000000) then + oObj.ValueMax = 1000000 + else + oObj.ValueMax = 1000001 + endif + newVal = oObj.ValueMax + Out.Log("value after: "+newVal) + bOK = bOK AND (newVal <> oldVal) + Test.MethodTested("ValueMax",bOK) + + Test.StartMethod("ValueMin") + bOK = true + oldVal = oObj.ValueMin + Out.Log("value before: "+oldVal) + if (oldVal <> -1000000) then + oObj.ValueMin = -1000000 + else + oObj.ValueMin = -1000001 + endif + newVal = oObj.ValueMin + Out.Log("value after: "+newVal) + bOK = bOK AND (newVal <> oldVal) + Test.MethodTested("ValueMin",bOK) + + PropertyTester.TestProperty("ValueStep") + + PropertyTester.TestProperty("HelpText") + + PropertyTester.TestProperty("HelpURL") + + PropertyTester.TestProperty("FontEmphasisMark") + + PropertyTester.TestProperty("FontRelief") + + PropertyTester.TestProperty("PrependCurrencySymbol") + + PropertyTester.TestProperty("TextLineColor") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/awt/UnoControlCurrencyFieldModel/script.xlb b/qadevOOo/tests/basic/ifc/awt/UnoControlCurrencyFieldModel/script.xlb new file mode 100644 index 000000000000..5c30de64c3d9 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/UnoControlCurrencyFieldModel/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="awt_UnoControlCurrencyFieldModel" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="awt_UnoControlCurrencyFieldModel"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/awt/UnoControlDateFieldModel/awt_UnoControlDateFieldModel.xba b/qadevOOo/tests/basic/ifc/awt/UnoControlDateFieldModel/awt_UnoControlDateFieldModel.xba new file mode 100644 index 000000000000..f4ce19b0c3c3 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/UnoControlDateFieldModel/awt_UnoControlDateFieldModel.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="awt_UnoControlDateFieldModel" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.awt.UnoControlDateFieldModel +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + PropertyTester.TestProperty("BackgroundColor") + + PropertyTester.TestProperty("Border") + + PropertyTester.TestProperty("Date") + + PropertyTester.TestProperty("DateMax") + + PropertyTester.TestProperty("DateMin") + + PropertyTester.TestProperty("Enabled") + + PropertyTester.TestProperty("DateFormat") + + PropertyTester.TestProperty("FontDescriptor") + + PropertyTester.TestProperty("Printable") + + PropertyTester.TestProperty("ReadOnly") + + PropertyTester.TestProperty("Spin") + + PropertyTester.TestProperty("StrictFormat") + + PropertyTester.TestProperty("Tabstop") + + PropertyTester.TestProperty("TextColor") + + PropertyTester.TestProperty("HelpText") + + PropertyTester.TestProperty("HelpURL") + + PropertyTester.TestProperty("DateShowCentury") + + PropertyTester.TestProperty("Dropdown") + + PropertyTester.TestProperty("FontEmphasisMark") + + PropertyTester.TestProperty("FontRelief") + + PropertyTester.TestProperty("TextLineColor") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/awt/UnoControlDateFieldModel/script.xlb b/qadevOOo/tests/basic/ifc/awt/UnoControlDateFieldModel/script.xlb new file mode 100644 index 000000000000..e6df7c36ad13 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/UnoControlDateFieldModel/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="awt_UnoControlDateFieldModel" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="awt_UnoControlDateFieldModel"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/awt/UnoControlDialogElement/awt_UnoControlDialogElement.xba b/qadevOOo/tests/basic/ifc/awt/UnoControlDialogElement/awt_UnoControlDialogElement.xba new file mode 100644 index 000000000000..e43f59078e63 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/UnoControlDialogElement/awt_UnoControlDialogElement.xba @@ -0,0 +1,66 @@ +<?xml version="1.0" encoding="UTF-8"?> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="awt_UnoControlDialogElement" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.awt.UnoControlDialogElement +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + PropertyTester.TestProperty("Height") + + PropertyTester.TestProperty("Name") + + PropertyTester.TestProperty("PositionX") + + PropertyTester.TestProperty("PositionY") + + PropertyTester.TestProperty("Step") + + PropertyTester.TestProperty("TabIndex") + + PropertyTester.TestProperty("Tag") + + PropertyTester.TestProperty("Width") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/awt/UnoControlDialogElement/script.xlb b/qadevOOo/tests/basic/ifc/awt/UnoControlDialogElement/script.xlb new file mode 100644 index 000000000000..89e4478a99ea --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/UnoControlDialogElement/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="awt_UnoControlDialogElement" library:readonly="false" library:passwordprotected="false"> + <library:element library:name="awt_UnoControlDialogElement"/> + </library:library> diff --git a/qadevOOo/tests/basic/ifc/awt/UnoControlDialogModel/awt_UnoControlDialogModel.xba b/qadevOOo/tests/basic/ifc/awt/UnoControlDialogModel/awt_UnoControlDialogModel.xba new file mode 100644 index 000000000000..803bb0f589fa --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/UnoControlDialogModel/awt_UnoControlDialogModel.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="awt_UnoControlDialogModel" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.awt.UnoControlDialogModel +'************************************************************************* +On Error Goto ErrHndl + + + PropertyTester.TestProperty("BackgroundColor") + + PropertyTester.TestProperty("Enabled") + + PropertyTester.TestProperty("FontDescriptor") + + PropertyTester.TestProperty("Title") + + PropertyTester.TestProperty("TextColor") + + PropertyTester.TestProperty("Sizeable") + + PropertyTester.TestProperty("Closeable") + + PropertyTester.TestProperty("FontEmphasisMark") + + PropertyTester.TestProperty("FontRelief") + + PropertyTester.TestProperty("HelpText") + + PropertyTester.TestProperty("HelpURL") + + PropertyTester.TestProperty("Moveable") + + PropertyTester.TestProperty("TextLineColor") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/awt/UnoControlDialogModel/script.xlb b/qadevOOo/tests/basic/ifc/awt/UnoControlDialogModel/script.xlb new file mode 100644 index 000000000000..2620497dbca1 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/UnoControlDialogModel/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="awt_UnoControlDialogModel" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="awt_UnoControlDialogModel"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/awt/UnoControlEditModel/awt_UnoControlEditModel.xba b/qadevOOo/tests/basic/ifc/awt/UnoControlEditModel/awt_UnoControlEditModel.xba new file mode 100644 index 000000000000..8b8897e24304 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/UnoControlEditModel/awt_UnoControlEditModel.xba @@ -0,0 +1,96 @@ +<?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="awt_UnoControlEditModel" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.awt.UnoControlEditModel +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + PropertyTester.TestProperty("Align") + + PropertyTester.TestProperty("BackgroundColor") + + PropertyTester.TestProperty("Border") + + PropertyTester.TestProperty("EchoChar") + + PropertyTester.TestProperty("Enabled") + + PropertyTester.TestProperty("FontDescriptor") + + PropertyTester.TestProperty("HardLineBreaks") + + PropertyTester.TestProperty("HScroll") + + PropertyTester.TestProperty("MaxTextLen") + + PropertyTester.TestProperty("MultiLine") + + PropertyTester.TestProperty("Printable") + + PropertyTester.TestProperty("ReadOnly") + + PropertyTester.TestProperty("Tabstop") + + PropertyTester.TestProperty("Text") + + PropertyTester.TestProperty("TextColor") + + PropertyTester.TestProperty("VScroll") + + PropertyTester.TestProperty("HelpText") + + PropertyTester.TestProperty("HelpURL") + + PropertyTester.TestProperty("FontEmphasisMark") + + PropertyTester.TestProperty("FontRelief") + + PropertyTester.TestProperty("TextLineColor") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/awt/UnoControlEditModel/script.xlb b/qadevOOo/tests/basic/ifc/awt/UnoControlEditModel/script.xlb new file mode 100644 index 000000000000..2d5fed3dde2a --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/UnoControlEditModel/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="awt_UnoControlEditModel" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="awt_UnoControlEditModel"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/awt/UnoControlFileControlModel/awt_UnoControlFileControlModel.xba b/qadevOOo/tests/basic/ifc/awt/UnoControlFileControlModel/awt_UnoControlFileControlModel.xba new file mode 100644 index 000000000000..e1503c8db41b --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/UnoControlFileControlModel/awt_UnoControlFileControlModel.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="awt_UnoControlFileControlModel" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.awt.UnoControlFileControlModel +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + PropertyTester.TestProperty("BackgroundColor") + + PropertyTester.TestProperty("Border") + + PropertyTester.TestProperty("Enabled") + + PropertyTester.TestProperty("FontDescriptor") + + PropertyTester.TestProperty("FontEmphasisMark") + + PropertyTester.TestProperty("FontRelief") + + PropertyTester.TestProperty("Printable") + + PropertyTester.TestProperty("Tabstop") + + PropertyTester.TestProperty("Text") + + PropertyTester.TestProperty("TextColor") + + PropertyTester.TestProperty("TextLineColor") + + PropertyTester.TestProperty("HelpText") + + PropertyTester.TestProperty("HelpURL") + + PropertyTester.TestProperty("ReadOnly") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/awt/UnoControlFileControlModel/script.xlb b/qadevOOo/tests/basic/ifc/awt/UnoControlFileControlModel/script.xlb new file mode 100644 index 000000000000..6a8d0cd06aa6 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/UnoControlFileControlModel/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="awt_UnoControlFileControlModel" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="awt_UnoControlFileControlModel"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/awt/UnoControlFixedLineModel/awt_UnoControlFixedLineModel.xba b/qadevOOo/tests/basic/ifc/awt/UnoControlFixedLineModel/awt_UnoControlFixedLineModel.xba new file mode 100644 index 000000000000..06143238c33c --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/UnoControlFixedLineModel/awt_UnoControlFixedLineModel.xba @@ -0,0 +1,78 @@ +<?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="awt_UnoControlFixedLineModel" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.awt.UnoControlFixedLineModel +'************************************************************************* +On Error Goto ErrHndl + + + PropertyTester.TestProperty("Enabled") + + PropertyTester.TestProperty("FontDescriptor") + + PropertyTester.TestProperty("HelpText") + + PropertyTester.TestProperty("HelpURL") + + PropertyTester.TestProperty("Label") + + PropertyTester.TestProperty("Orientation") + + PropertyTester.TestProperty("Printable") + + PropertyTester.TestProperty("TextColor") + + PropertyTester.TestProperty("FontEmphasisMark") + + PropertyTester.TestProperty("FontRelief") + + PropertyTester.TestProperty("TextLineColor") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/awt/UnoControlFixedLineModel/script.xlb b/qadevOOo/tests/basic/ifc/awt/UnoControlFixedLineModel/script.xlb new file mode 100644 index 000000000000..8a4820d1748c --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/UnoControlFixedLineModel/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="awt_UnoControlFixedLineModel" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="awt_UnoControlFixedLineModel"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/awt/UnoControlFixedTextModel/awt_UnoControlFixedTextModel.xba b/qadevOOo/tests/basic/ifc/awt/UnoControlFixedTextModel/awt_UnoControlFixedTextModel.xba new file mode 100644 index 000000000000..a6266d0f68cd --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/UnoControlFixedTextModel/awt_UnoControlFixedTextModel.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="awt_UnoControlFixedTextModel" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.awt.UnoControlFixedTextModel +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + PropertyTester.TestProperty("Align") + + PropertyTester.TestProperty("BackgroundColor") + + PropertyTester.TestProperty("Border") + + PropertyTester.TestProperty("Enabled") + + PropertyTester.TestProperty("FontDescriptor") + + PropertyTester.TestProperty("Label") + + PropertyTester.TestProperty("MultiLine") + + PropertyTester.TestProperty("Printable") + + PropertyTester.TestProperty("TextColor") + + PropertyTester.TestProperty("HelpText") + + PropertyTester.TestProperty("HelpURL") + + PropertyTester.TestProperty("FontEmphasisMark") + + PropertyTester.TestProperty("FontRelief") + + PropertyTester.TestProperty("TextLineColor") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/awt/UnoControlFixedTextModel/script.xlb b/qadevOOo/tests/basic/ifc/awt/UnoControlFixedTextModel/script.xlb new file mode 100644 index 000000000000..1afae23f637f --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/UnoControlFixedTextModel/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="awt_UnoControlFixedTextModel" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="awt_UnoControlFixedTextModel"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/awt/UnoControlFormattedFieldModel/awt_UnoControlFormattedFieldModel.xba b/qadevOOo/tests/basic/ifc/awt/UnoControlFormattedFieldModel/awt_UnoControlFormattedFieldModel.xba new file mode 100644 index 000000000000..13123db2711c --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/UnoControlFormattedFieldModel/awt_UnoControlFormattedFieldModel.xba @@ -0,0 +1,141 @@ +<?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="awt_UnoControlFormattedFieldModel" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.awt.UnoControlFormattedFieldModel +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim newVal, oldVal As Long + + PropertyTester.TestProperty("Align") + + PropertyTester.TestProperty("BackgroundColor") + + PropertyTester.TestProperty("Border") + + PropertyTester.TestProperty("EffectiveDefault") + + Test.StartMethod("EffectiveValue") + bOK = true + oldVal = oObj.EffectiveValue + Out.Log("value before: "+oldVal) + if (oldVal <> 9999) then + oObj.EffectiveValue = 9999 + else + oObj.EffectiveValue = 10000 + endif + newVal = oObj.EffectiveValue + Out.Log("value after: "+newVal) + bOK = bOK AND (newVal <> oldVal) + Test.MethodTested("EffectiveValue",bOK) + + Test.StartMethod("EffectiveMax") + bOK = true + oldVal = oObj.EffectiveMax + Out.Log("value before: "+oldVal) + if (oldVal <> 100000) then + oObj.EffectiveMax = 100000 + else + oObj.EffectiveMax = 100001 + endif + newVal = oObj.EffectiveMax + Out.Log("value after: "+newVal) + bOK = bOK AND (newVal <> oldVal) + Test.MethodTested("EffectiveMax",bOK) + + Test.StartMethod("EffectiveMin") + bOK = true + oldVal = oObj.EffectiveMin + Out.Log("value before: "+oldVal) + if (oldVal <> -100000) then + oObj.EffectiveMin = -100000 + else + oObj.EffectiveMin = -100001 + endif + newVal = oObj.EffectiveMin + Out.Log("value after: "+newVal) + bOK = bOK AND (newVal <> oldVal) + Test.MethodTested("EffectiveMin",bOK) + + + PropertyTester.TestProperty("Enabled") + + PropertyTester.TestProperty("FontDescriptor") + + PropertyTester.TestProperty("FormatKey") + + PropertyTester.TestProperty("FormatsSupplier") + + PropertyTester.TestProperty("MaxTextLen") + + PropertyTester.TestProperty("Printable") + + PropertyTester.TestProperty("ReadOnly") + + PropertyTester.TestProperty("Spin") + + PropertyTester.TestProperty("StrictFormat") + + PropertyTester.TestProperty("Tabstop") + + PropertyTester.TestProperty("Text") + + PropertyTester.TestProperty("TextColor") + + PropertyTester.TestProperty("HelpText") + + PropertyTester.TestProperty("HelpURL") + + PropertyTester.TestProperty("FontEmphasisMark") + + PropertyTester.TestProperty("FontRelief") + + PropertyTester.TestProperty("TextLineColor") + + PropertyTester.TestProperty("TreatAsNumber") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/awt/UnoControlFormattedFieldModel/script.xlb b/qadevOOo/tests/basic/ifc/awt/UnoControlFormattedFieldModel/script.xlb new file mode 100644 index 000000000000..323535b485e2 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/UnoControlFormattedFieldModel/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="awt_UnoControlFormattedFieldModel" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="awt_UnoControlFormattedFieldModel"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/awt/UnoControlGroupBoxModel/awt_UnoControlGroupBoxModel.xba b/qadevOOo/tests/basic/ifc/awt/UnoControlGroupBoxModel/awt_UnoControlGroupBoxModel.xba new file mode 100644 index 000000000000..2be838ae72a0 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/UnoControlGroupBoxModel/awt_UnoControlGroupBoxModel.xba @@ -0,0 +1,74 @@ +<?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="awt_UnoControlGroupBoxModel" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.awt.UnoControlGroupBoxModel +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + PropertyTester.TestProperty("Enabled") + + PropertyTester.TestProperty("FontDescriptor") + + PropertyTester.TestProperty("Label") + + PropertyTester.TestProperty("Printable") + + PropertyTester.TestProperty("TextColor") + + PropertyTester.TestProperty("HelpText") + + PropertyTester.TestProperty("HelpURL") + + PropertyTester.TestProperty("FontEmphasisMark") + + PropertyTester.TestProperty("FontRelief") + + PropertyTester.TestProperty("TextLineColor") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/awt/UnoControlGroupBoxModel/script.xlb b/qadevOOo/tests/basic/ifc/awt/UnoControlGroupBoxModel/script.xlb new file mode 100644 index 000000000000..8bf009c7ad32 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/UnoControlGroupBoxModel/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="awt_UnoControlGroupBoxModel" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="awt_UnoControlGroupBoxModel"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/awt/UnoControlImageControlModel/awt_UnoControlImageControlModel.xba b/qadevOOo/tests/basic/ifc/awt/UnoControlImageControlModel/awt_UnoControlImageControlModel.xba new file mode 100644 index 000000000000..c77f88d0042c --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/UnoControlImageControlModel/awt_UnoControlImageControlModel.xba @@ -0,0 +1,72 @@ +<?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="awt_UnoControlImageControlModel" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.awt.UnoControlImageControlModel +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + PropertyTester.TestProperty("BackgroundColor") + + PropertyTester.TestProperty("Border") + + PropertyTester.TestProperty("Enabled") + + PropertyTester.TestProperty("ImageURL") + + PropertyTester.TestProperty("Printable") + + PropertyTester.TestProperty("HelpText") + + PropertyTester.TestProperty("HelpURL") + + PropertyTester.TestProperty("ScaleImage") + + PropertyTester.TestProperty("Tabstop") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/awt/UnoControlImageControlModel/script.xlb b/qadevOOo/tests/basic/ifc/awt/UnoControlImageControlModel/script.xlb new file mode 100644 index 000000000000..78f757c5fae6 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/UnoControlImageControlModel/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="awt_UnoControlImageControlModel" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="awt_UnoControlImageControlModel"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/awt/UnoControlListBoxModel/awt_UnoControlListBoxModel.xba b/qadevOOo/tests/basic/ifc/awt/UnoControlListBoxModel/awt_UnoControlListBoxModel.xba new file mode 100644 index 000000000000..5de3bb3a9794 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/UnoControlListBoxModel/awt_UnoControlListBoxModel.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="awt_UnoControlListBoxModel" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.awt.UnoControlListBoxModel +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + PropertyTester.TestProperty("BackgroundColor") + + PropertyTester.TestProperty("Border") + + PropertyTester.TestProperty("Dropdown") + + PropertyTester.TestProperty("Enabled") + + PropertyTester.TestProperty("FontDescriptor") + + PropertyTester.TestProperty("LineCount") + + PropertyTester.TestProperty("MultiSelection") + + PropertyTester.TestProperty("Printable") + + PropertyTester.TestProperty("SelectedItems") + + PropertyTester.TestProperty("StringItemList") + + PropertyTester.TestProperty("Tabstop") + + PropertyTester.TestProperty("TextColor") + + PropertyTester.TestProperty("HelpText") + + PropertyTester.TestProperty("HelpURL") + + PropertyTester.TestProperty("FontEmphasisMark") + + PropertyTester.TestProperty("FontRelief") + + PropertyTester.TestProperty("ReadOnly") + + PropertyTester.TestProperty("TextLineColor") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/awt/UnoControlListBoxModel/script.xlb b/qadevOOo/tests/basic/ifc/awt/UnoControlListBoxModel/script.xlb new file mode 100644 index 000000000000..1748dfbeff32 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/UnoControlListBoxModel/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="awt_UnoControlListBoxModel" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="awt_UnoControlListBoxModel"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/awt/UnoControlModel/awt_UnoControlModel.xba b/qadevOOo/tests/basic/ifc/awt/UnoControlModel/awt_UnoControlModel.xba new file mode 100644 index 000000000000..bdffcb1337e8 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/UnoControlModel/awt_UnoControlModel.xba @@ -0,0 +1,59 @@ +<?xml version="1.0" encoding="UTF-8"?> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="awt_UnoControlModel" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.awt.UnoControlModel +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + +' + PropertyTester.TestProperty("DefaultControl") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/awt/UnoControlModel/script.xlb b/qadevOOo/tests/basic/ifc/awt/UnoControlModel/script.xlb new file mode 100644 index 000000000000..583895a0bcd4 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/UnoControlModel/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="awt_UnoControlModel" library:readonly="false" library:passwordprotected="false"> + <library:element library:name="awt_UnoControlModel"/> + </library:library> diff --git a/qadevOOo/tests/basic/ifc/awt/UnoControlNumericFieldModel/awt_UnoControlNumericFieldModel.xba b/qadevOOo/tests/basic/ifc/awt/UnoControlNumericFieldModel/awt_UnoControlNumericFieldModel.xba new file mode 100644 index 000000000000..55c389124214 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/UnoControlNumericFieldModel/awt_UnoControlNumericFieldModel.xba @@ -0,0 +1,132 @@ +<?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="awt_UnoControlNumericFieldModel" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.awt.UnoControlNumericFieldModel +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim newVal, oldVal As Long + + PropertyTester.TestProperty("BackgroundColor") + + PropertyTester.TestProperty("Border") + + PropertyTester.TestProperty("DecimalAccuracy") + + PropertyTester.TestProperty("Enabled") + + PropertyTester.TestProperty("FontDescriptor") + + PropertyTester.TestProperty("ShowThousandsSeparator") + + PropertyTester.TestProperty("Printable") + + PropertyTester.TestProperty("ReadOnly") + + PropertyTester.TestProperty("Spin") + + PropertyTester.TestProperty("StrictFormat") + + PropertyTester.TestProperty("Tabstop") + + PropertyTester.TestProperty("TextColor") + + Test.StartMethod("Value") + bOK = true + oldVal = oObj.Value + Out.Log("value before: "+oldVal) + if (oldVal <> 999) then + oObj.Value = 999 + else + oObj.Value = 1000 + endif + newVal = oObj.Value + Out.Log("value after: "+newVal) + bOK = bOK AND (newVal <> oldVal) + Test.MethodTested("Value",bOK) + + Test.StartMethod("ValueMax") + bOK = true + oldVal = oObj.ValueMax + Out.Log("value before: "+oldVal) + if (oldVal <> 10000) then + oObj.ValueMax = 10000 + else + oObj.ValueMax = 10001 + endif + newVal = oObj.ValueMax + Out.Log("value after: "+newVal) + bOK = bOK AND (newVal <> oldVal) + Test.MethodTested("ValueMax",bOK) + + Test.StartMethod("ValueMin") + bOK = true + oldVal = oObj.ValueMin + Out.Log("value before: "+oldVal) + if (oldVal <> -10000) then + oObj.ValueMin = -10000 + else + oObj.ValueMin = -10001 + endif + newVal = oObj.ValueMin + Out.Log("value after: "+newVal) + bOK = bOK AND (newVal <> oldVal) + Test.MethodTested("ValueMin",bOK) + + PropertyTester.TestProperty("ValueStep") + + PropertyTester.TestProperty("HelpText") + + PropertyTester.TestProperty("HelpURL") + + PropertyTester.TestProperty("FontEmphasisMark") + + PropertyTester.TestProperty("FontRelief") + + PropertyTester.TestProperty("TextLineColor") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/awt/UnoControlNumericFieldModel/script.xlb b/qadevOOo/tests/basic/ifc/awt/UnoControlNumericFieldModel/script.xlb new file mode 100644 index 000000000000..0755e1320b9a --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/UnoControlNumericFieldModel/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="awt_UnoControlNumericFieldModel" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="awt_UnoControlNumericFieldModel"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/awt/UnoControlPatternFieldModel/awt_UnoControlPatternFieldModel.xba b/qadevOOo/tests/basic/ifc/awt/UnoControlPatternFieldModel/awt_UnoControlPatternFieldModel.xba new file mode 100644 index 000000000000..096ee101f54c --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/UnoControlPatternFieldModel/awt_UnoControlPatternFieldModel.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="awt_UnoControlPatternFieldModel" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.awt.UnoControlPatternFieldModel +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + PropertyTester.TestProperty("BackgroundColor") + + PropertyTester.TestProperty("Border") + + PropertyTester.TestProperty("EditMask") + + PropertyTester.TestProperty("Enabled") + + PropertyTester.TestProperty("FontDescriptor") + + PropertyTester.TestProperty("LiteralMask") + + PropertyTester.TestProperty("Printable") + + PropertyTester.TestProperty("ReadOnly") + + PropertyTester.TestProperty("StrictFormat") + + PropertyTester.TestProperty("Tabstop") + + PropertyTester.TestProperty("Text") + + PropertyTester.TestProperty("TextColor") + + PropertyTester.TestProperty("HelpText") + + PropertyTester.TestProperty("HelpURL") + + PropertyTester.TestProperty("FontEmphasisMark") + + PropertyTester.TestProperty("FontRelief") + + PropertyTester.TestProperty("MaxTextLen") + + PropertyTester.TestProperty("TextLineColor") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/awt/UnoControlPatternFieldModel/script.xlb b/qadevOOo/tests/basic/ifc/awt/UnoControlPatternFieldModel/script.xlb new file mode 100644 index 000000000000..b37bb62f8f7e --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/UnoControlPatternFieldModel/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="awt_UnoControlPatternFieldModel" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="awt_UnoControlPatternFieldModel"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/awt/UnoControlProgressBarModel/awt_UnoControlProgressBarModel.xba b/qadevOOo/tests/basic/ifc/awt/UnoControlProgressBarModel/awt_UnoControlProgressBarModel.xba new file mode 100644 index 000000000000..c14ed80fd151 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/UnoControlProgressBarModel/awt_UnoControlProgressBarModel.xba @@ -0,0 +1,74 @@ +<?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="awt_UnoControlProgressBarModel" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.awt.UnoControlProgressBarModel +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + PropertyTester.TestProperty("BackgroundColor") + + PropertyTester.TestProperty("Border") + + PropertyTester.TestProperty("Enabled") + + PropertyTester.TestProperty("FillColor") + + PropertyTester.TestProperty("HelpText") + + PropertyTester.TestProperty("HelpURL") + + PropertyTester.TestProperty("Printable") + + PropertyTester.TestProperty("ProgressValue") + + PropertyTester.TestProperty("ProgressValueMax") + + PropertyTester.TestProperty("ProgressValueMin") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/awt/UnoControlProgressBarModel/script.xlb b/qadevOOo/tests/basic/ifc/awt/UnoControlProgressBarModel/script.xlb new file mode 100644 index 000000000000..388de9e782d6 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/UnoControlProgressBarModel/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="awt_UnoControlProgressBarModel" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="awt_UnoControlProgressBarModel"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/awt/UnoControlRadioButtonModel/awt_UnoControlRadioButtonModel.xba b/qadevOOo/tests/basic/ifc/awt/UnoControlRadioButtonModel/awt_UnoControlRadioButtonModel.xba new file mode 100644 index 000000000000..4babfe686c5b --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/UnoControlRadioButtonModel/awt_UnoControlRadioButtonModel.xba @@ -0,0 +1,78 @@ +<?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="awt_UnoControlRadioButtonModel" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.awt.UnoControlRadioButtonModel +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + PropertyTester.TestProperty("Enabled") + + PropertyTester.TestProperty("FontDescriptor") + + PropertyTester.TestProperty("Label") + + PropertyTester.TestProperty("Printable") + + PropertyTester.TestProperty("State", Array(0,1)) + + PropertyTester.TestProperty("Tabstop") + + PropertyTester.TestProperty("TextColor") + + PropertyTester.TestProperty("HelpText") + + PropertyTester.TestProperty("HelpURL") + + PropertyTester.TestProperty("FontEmphasisMark") + + PropertyTester.TestProperty("FontRelief") + + PropertyTester.TestProperty("TextLineColor") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/awt/UnoControlRadioButtonModel/script.xlb b/qadevOOo/tests/basic/ifc/awt/UnoControlRadioButtonModel/script.xlb new file mode 100644 index 000000000000..e3e8530eb508 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/UnoControlRadioButtonModel/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="awt_UnoControlRadioButtonModel" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="awt_UnoControlRadioButtonModel"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/awt/UnoControlScrollBarModel/awt_UnoControlScrollBarModel.xba b/qadevOOo/tests/basic/ifc/awt/UnoControlScrollBarModel/awt_UnoControlScrollBarModel.xba new file mode 100644 index 000000000000..103266b45df2 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/UnoControlScrollBarModel/awt_UnoControlScrollBarModel.xba @@ -0,0 +1,76 @@ +<?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="awt_UnoControlScrollBarModel" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.awt.UnoControlScrollBarModel +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + PropertyTester.TestProperty("BlockIncrement") + + PropertyTester.TestProperty("Border") + + PropertyTester.TestProperty("Enabled") + + PropertyTester.TestProperty("HelpText") + + PropertyTester.TestProperty("HelpURL") + + PropertyTester.TestProperty("LineIncrement") + + PropertyTester.TestProperty("Orientation") + + PropertyTester.TestProperty("Printable") + + PropertyTester.TestProperty("ScrollValue") + + PropertyTester.TestProperty("ScrollValueMax") + + PropertyTester.TestProperty("VisibleSize") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/awt/UnoControlScrollBarModel/script.xlb b/qadevOOo/tests/basic/ifc/awt/UnoControlScrollBarModel/script.xlb new file mode 100644 index 000000000000..00d8fd9cf3e7 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/UnoControlScrollBarModel/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="awt_UnoControlScrollBarModel" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="awt_UnoControlScrollBarModel"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/awt/UnoControlTimeFieldModel/awt_UnoControlTimeFieldModel.xba b/qadevOOo/tests/basic/ifc/awt/UnoControlTimeFieldModel/awt_UnoControlTimeFieldModel.xba new file mode 100644 index 000000000000..f7fbdf2c94a1 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/UnoControlTimeFieldModel/awt_UnoControlTimeFieldModel.xba @@ -0,0 +1,91 @@ +<?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="awt_UnoControlTimeFieldModel" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.awt.UnoControlTimeFieldModel +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + PropertyTester.TestProperty("BackgroundColor") + + PropertyTester.TestProperty("Border") + + PropertyTester.TestProperty("Enabled") + + PropertyTester.TestProperty("FontDescriptor") + + PropertyTester.TestProperty("FontEmphasisMark") + + PropertyTester.TestProperty("FontRelief") + + PropertyTester.TestProperty("HelpText") + + PropertyTester.TestProperty("HelpURL") + + PropertyTester.TestProperty("Printable") + + PropertyTester.TestProperty("ReadOnly") + + PropertyTester.TestProperty("Spin") + + PropertyTester.TestProperty("StrictFormat") + + PropertyTester.TestProperty("Tabstop") + + PropertyTester.TestProperty("TextColor") + + PropertyTester.TestProperty("TextLineColor") + + PropertyTester.TestProperty("Time") + + PropertyTester.TestProperty("TimeFormat") + + PropertyTester.TestProperty("TimeMax") + + PropertyTester.TestProperty("TimeMin") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/awt/UnoControlTimeFieldModel/script.xlb b/qadevOOo/tests/basic/ifc/awt/UnoControlTimeFieldModel/script.xlb new file mode 100644 index 000000000000..482f6d802418 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/UnoControlTimeFieldModel/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="awt_UnoControlTimeFieldModel" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="awt_UnoControlTimeFieldModel"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/awt/XButton/awt_XButton.xba b/qadevOOo/tests/basic/ifc/awt/XButton/awt_XButton.xba new file mode 100644 index 000000000000..c01f3669a326 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/XButton/awt_XButton.xba @@ -0,0 +1,92 @@ +<?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="awt_XButton" 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 + + +Dim bAL_actionPerformed As Boolean + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.awt.XButton +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim oListener As Object + + Out.Log("create com.sun.star.awt.XActionListener") + oListener = createUNOListener("AL_", "com.sun.star.awt.XActionListener") + + Test.StartMethod("addActionListener()") + bAL_actionPerformed = False + oObj.addActionListener(oListener) + Out.Log("Can be checked only interactively !!!") + bOK = True + Test.MethodTested("addActionListener()", bOK) + + Test.StartMethod("removeActionListener()") + oObj.removeActionListener(oListener) + bOK = true + Test.MethodTested("removeActionListener()", bOK) + + Test.StartMethod("setLabel()") + oObj.setLabel("XButton Label") + bOK = True + Test.MethodTested("setLabel()", bOK) + + Test.StartMethod("setActionCommand()") + oObj.setActionCommand("XButtonComand") + bOK = True + Test.MethodTested("setActionCommand()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub + +Sub AL_disposing +End Sub + +Sub AL_actionPerformed + Out.Log("CallBack for ActionListener actionPerformed was called.") + bAL_actionPerformed = true +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/awt/XButton/script.xlb b/qadevOOo/tests/basic/ifc/awt/XButton/script.xlb new file mode 100644 index 000000000000..7ef5c2ab0762 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/XButton/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="awt_XButton" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="awt_XButton"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/awt/XCheckBox/awt_XCheckBox.xba b/qadevOOo/tests/basic/ifc/awt/XCheckBox/awt_XCheckBox.xba new file mode 100644 index 000000000000..30036638c4a2 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/XCheckBox/awt_XCheckBox.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="awt_XCheckBox" 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 + + +Dim bIL_itemStateChanged As Boolean + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.awt.XCheckBox +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim oListener As Object + + bIL_itemStateChanged = False + out.log("create listener for item events") + oListener = createUnoListener("IL_", "com.sun.star.awt.XItemListener") + + Test.StartMethod("addItemListener()") + oObj.addItemListener(oListener) + out.log("Can be checked only interactively !!!") + bOK = True + Test.MethodTested("addItemListener()", bOK) + + Test.StartMethod("removeItemListener()") + oObj.removeItemListener(oListener) + bOK = True + Test.MethodTested("removeItemListener()", bOK) + + Test.StartMethod("getState()") + Test.StartMethod("setState()") + Dim state, newState As Integer + state = oObj.getState() + Out.Log("current state of check-box: " + state) + newState = 0 + If state = 0 Then + newState = 1 + EndIf + Out.Log("set new state: " + newState) + oObj.setState(newState) + bOK = (newState = oObj.getState()) + Test.MethodTested("getState()", bOK) + Test.MethodTested("setState()", bOK) + + Test.StartMethod("setLabel()") + oObj.setLabel("XCheckBox test") + bOK = true + Test.MethodTested("setLabel()", bOK) + + Test.StartMethod("enableTriState()") + oObj.enableTriState(True) + bOK = true + Test.MethodTested("enableTriState()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub + +Sub IL_disposing +End Sub + +Sub IL_itemStateChanged + Out.Log("CallBack for ItemListener itemStateChanged was called.") + bIL_itemStateChanged = true +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/awt/XCheckBox/script.xlb b/qadevOOo/tests/basic/ifc/awt/XCheckBox/script.xlb new file mode 100644 index 000000000000..2b7206d80a00 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/XCheckBox/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="awt_XCheckBox" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="awt_XCheckBox"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/awt/XComboBox/awt_XComboBox.xba b/qadevOOo/tests/basic/ifc/awt/XComboBox/awt_XComboBox.xba new file mode 100644 index 000000000000..574a6f6576a0 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/XComboBox/awt_XComboBox.xba @@ -0,0 +1,146 @@ +<?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="awt_XComboBox" 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 + + +Dim bIL_itemStateChanged, bAL_actionPerformed As Boolean + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.awt.XComboBox +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim oIListener, oAListener As Object + + bIL_itemStateChanged = False + oIListener = createUnoListener("IL_", "com.sun.star.awt.XItemListener") + + Test.StartMethod("addItemListener()") + oObj.addItemListener(oIListener) + bOK = True + Test.MethodTested("addItemListener()", bOK) + + Test.StartMethod("removeItemListener()") + oObj.removeItemListener(oIListener) + bOK = True + Test.MethodTested("removeItemListener()", bOK) + + bAL_actionPerformed = False + oAListener = createUnoListener("AL_", "com.sun.star.awt.XActionListener") + Test.StartMethod("addActionListener()") + oObj.addActionListener(oAListener) + bOK = True + Test.MethodTested("addActionListener()", bOK) + + Test.StartMethod("removeActionListener()") + oObj.removeActionListener(oAListener) + bOK = True + Test.MethodTested("removeActionListener()", bOK) + + Dim itemCount As Integer + Test.StartMethod("getItemCount()") + itemCount = oObj.getItemCount() + bOK = itemCount > 0 or itemCount = 0 + Test.MethodTested("getItemCount()", bOK) + + Test.StartMethod("addItem()") + oObj.addItem("Item1", itemCount) + bOK = oObj.getItemCount() = (itemCount + 1) + Test.MethodTested("addItem()", bOK) + + Dim itemNames As Variant + itemNames = Array("Item2", "Item3") + Dim oldCount As Integer + oldCount = oObj.getItemCount() + Test.StartMethod("addItems()") + oObj.addItems(itemNames(), oldCount) + bOK = (oldCount + 2) = oObj.getItemCount() + Test.MethodTested("addItems()", bOK) + + Test.StartMethod("getItem()") + bOK = (oObj.getItem(itemCount) = "Item1") + Test.MethodTested("getItem()", bOK) + + Test.StartMethod("getItems()") + itemNames = oObj.getItems() + Dim i As Integer + bOK = True + Dim iname As String + For i = itemCount to itemCount + 2 + iname = "Item" + (i + 1) + bOK = bOK and itemNames(i) = iname + out.log(iname + " " + itemNames(i)) + Next i + Test.MethodTested("getItems()", bOK) + + Test.StartMethod("removeItems()") + oObj.removeItems(0, oObj.getItemCount()) + bOK = oObj.getItemCount = 0 + Test.MethodTested("removeItems()", bOK) + + Dim lineCount As Integer + Test.StartMethod("getDropDownLineCount()") + lineCount = oObj.getDropDownLineCount() + bOK = True + Test.MethodTested("getDropDownLineCount()", bOK) + + Test.StartMethod("setDropDownLineCount()") + oObj.setDropDownLineCount(lineCount + 1) + bOK = oObj.getDropDownLineCount() = lineCount + 1 + Test.MethodTested("setDropDownLineCount()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub + +Sub IL_itemStateChanged + Out.Log("CallBack for ItemListener itemStateChanged was called.") + bIL_itemStateChanged = true +End Sub + +Sub AL_actionPerformed + Out.Log("CallBack for ActionListener actionPerformed was called.") + bAL_actionPerformed = true +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/awt/XComboBox/script.xlb b/qadevOOo/tests/basic/ifc/awt/XComboBox/script.xlb new file mode 100644 index 000000000000..042993e00091 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/XComboBox/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="awt_XComboBox" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="awt_XComboBox"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/awt/XControl/awt_XControl.xba b/qadevOOo/tests/basic/ifc/awt/XControl/awt_XControl.xba new file mode 100644 index 000000000000..e66aadc3b22b --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/XControl/awt_XControl.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="awt_XControl" 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 + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +'Global oModel As Object +'Global oContext As Object +'Global oWinpeer As Object +'Global oToolkit As Object + +'************************************************************************* + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.awt.XControl +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + If isNull(oContext) then + Out.Log("'oContext' as global variable required!") + End If + If isNull(oWinpeer) then + Out.Log("'oWinper' as global variable required!") + End If + If isNull(oToolkit) then + Out.Log("'oToolkit' as global variable required!") + End If + + Test.StartMethod("setContext()") + bOK = true + oObj.setContext(oContext) + Test.MethodTested("setContext()", bOK) + + Test.StartMethod("getContext()") + bOK = hasUnoInterfaces(oObj.getContext(), "com.sun.star.uno.XInterface") + Test.MethodTested("getContext()", bOK) + + Test.StartMethod("createPeer()") + bOK = true + oObj.createPeer(oToolkit, oWinpeer) + Test.MethodTested("createPeer()", bOK) + + Test.StartMethod("getPeer()") + bOK = hasUnoInterfaces(oObj.getPeer(),"com.sun.star.awt.XWindowPeer") + Test.MethodTested("getPeer()", bOK) + + Test.StartMethod("setModel()") + bOK = true + oObj.setModel(oModel) + Test.StartMethod("getModel()") + bOK = bOK AND hasUnoInterfaces(oObj.getModel(), "com.sun.star.awt.XControlModel") + Test.MethodTested("setModel()", bOK) + Test.MethodTested("getModel()", bOK) + + Test.StartMethod("getView()") + bOK = hasUnoInterfaces(oObj.getView(), "com.sun.star.awt.XView") + Test.MethodTested("getView()", bOK) + + Test.StartMethod("setDesignMode()") + bOK = true + oObj.setDesignMode(true) + Test.StartMethod("isDesignMode()") + bOk = bOk AND oObj.isDesignMode() + oObj.setDesignMode(false) + bOk = bOk AND NOT oObj.isDesignMode() + Test.MethodTested("setDesignMode()", bOK) + Test.MethodTested("isDesignMode()", bOK) + + Test.StartMethod("isTransparent()") + bOk = VarType(oObj.isTransparent()) = 11 + Test.MethodTested("isTransparent()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/awt/XControl/script.xlb b/qadevOOo/tests/basic/ifc/awt/XControl/script.xlb new file mode 100644 index 000000000000..1f8c19a30aa1 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/XControl/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="awt_XControl" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="awt_XControl"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/awt/XControlContainer/awt_XControlContainer.xba b/qadevOOo/tests/basic/ifc/awt/XControlContainer/awt_XControlContainer.xba new file mode 100644 index 000000000000..518671293db0 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/XControlContainer/awt_XControlContainer.xba @@ -0,0 +1,104 @@ +<?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="awt_XControlContainer" 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. +' +'************************************************************************* +'************************************************************************* + + + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +'Global oXControl1 as Object +'Global oXControl2 as Object + +'************************************************************************* + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.awt.XControlContainer +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + If isNull(oXControl1) then + Out.Log("'oXControl1' as global variable required!") + End If + If isNull(oXControl2) then + Out.Log("'oXControl2' as global variable required!") + End If + + Dim vGetControls As Variant + Dim oGetControl As Object + + Test.StartMethod("setStatusText()") + bOK = true + oObj.setStatusText("testing XControlContainer::setStatusText(String)") + Test.MethodTested("setStatusText()", bOK) + + Test.StartMethod("addControl()") + bOK = true + oObj.addControl("Control1", oXControl1) + oObj.addControl("Control2", oXControl2) + Test.StartMethod("getControls()") + vGetControls = oObj.getControls() +Dim nControls As Integer + nControls = uBound(vGetControls) + bOK = bOK AND (nControls >= 1) + Test.MethodTested("addControl()", bOK) + Test.MethodTested("getControls()", bOK) + + Test.StartMethod("getControl()") + oGetControl = oObj.getControl("Control1") + bOK = bOK AND NOT isNull(oGetControl) + Test.MethodTested("getControl()", bOK) + + Test.StartMethod("removeControl()") + bOK = true + oObj.removeControl(oXControl2) + Test.StartMethod("getControls()") + vGetControls = oObj.getControls() + bOK = bOK AND ((nControls - ubound(vGetControls)) = 1) + Test.MethodTested("removeControl()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/awt/XControlContainer/script.xlb b/qadevOOo/tests/basic/ifc/awt/XControlContainer/script.xlb new file mode 100644 index 000000000000..a9d5ee8ca37b --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/XControlContainer/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="awt_XControlContainer" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="awt_XControlContainer"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/awt/XCurrencyField/awt_XCurrencyField.xba b/qadevOOo/tests/basic/ifc/awt/XCurrencyField/awt_XCurrencyField.xba new file mode 100644 index 000000000000..94e0acfe8bc2 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/XCurrencyField/awt_XCurrencyField.xba @@ -0,0 +1,144 @@ +<?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="awt_XCurrencyField" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.awt.XCurrencyField +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Test.StartMethod("getValue()") + Dim value As Double + value = oObj.getValue() + bOK = True + Test.MethodTested("getValue()", bOK) + + Test.StartMethod("setValue()") + oObj.setValue(value + 1.1) + bOK = oObj.getValue() = (value + 1.1) + Test.MethodTested("setValue()", bOK) + + Test.StartMethod("getMin()") + Dim min As Double + min = oObj.getMin() + bOK = True + Test.MethodTested("getMin()", bOK) + + Test.StartMethod("setMin()") + oObj.setMin(min + 1.1) + bOK = oObj.getMin() = (min + 1.1) + Test.MethodTested("setMin()", bOK) + + Test.StartMethod("getMax()") + Dim max As Double + max = oObj.getMax() + bOK = True + Test.MethodTested("getMax()", bOK) + + Test.StartMethod("setMax()") + oObj.setMax(max + 1.1) + bOK = oObj.getMax() = (max + 1.1) + Test.MethodTested("setMax()", bOK) + + Test.StartMethod("getFirst()") + Dim first As Double + first = oObj.getFirst() + bOK = True + Test.MethodTested("getFirst()", bOK) + + Test.StartMethod("setFirst()") + oObj.setFirst(first + 1.1) + bOK = oObj.getFirst() = first + 1.1 + Test.MethodTested("setFirst()", bOK) + + Test.StartMethod("getLast()") + Dim last As Double + last = oObj.getLast() + bOK = True + Test.MethodTested("getLast()", bOK) + + Test.StartMethod("setLast()") + oObj.setLast(last + 1.1) + bOK = oObj.getLast() = (last + 1.1) + Test.MethodTested("setLast()", bOK) + + Test.StartMethod("getSpinSize()") + Dim spinSize As Double + spinSize = oObj.getSpinSize() + bOK = True + Test.MethodTested("getSpinSize()", bOK) + + Test.StartMethod("setSpinSize()") + oObj.setSpinSize(spinSize + 1.1) + bOK = oObj.getSpinSize() = (spinSize + 1.1) + Test.MethodTested("setSpinSize()", bOK) + + Test.StartMethod("getDecimalDigits()") + Dim digits As Integer + digits = oObj.getDecimalDigits() + bOK = True + Test.MethodTested("getDecimalDigits()", bOK) + + Test.StartMethod("setDecimalDigits()") + oObj.setDecimalDigits(digits + 1) + bOK = oObj.getDecimalDigits() = (digits + 1) + Test.MethodTested("setDecimalDigits()", bOK) + + Test.StartMethod("isStrictFormat()") + Dim strict As Boolean + strict = oObj.isStrictFormat() + bOK = True + Test.MethodTested("isStrictFormat()", bOK) + + Test.StartMethod("setStrictFormat()") + oObj.setStrictFormat(Not strict) + bOK = oObj.isStrictFormat() <> strict + Test.MethodTested("setStrictFormat()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/awt/XCurrencyField/script.xlb b/qadevOOo/tests/basic/ifc/awt/XCurrencyField/script.xlb new file mode 100644 index 000000000000..54cb2fa783c1 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/XCurrencyField/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="awt_XCurrencyField" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="awt_XCurrencyField"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/awt/XDataTransferProviderAccess/awt_XDataTransferProviderAccess.xba b/qadevOOo/tests/basic/ifc/awt/XDataTransferProviderAccess/awt_XDataTransferProviderAccess.xba new file mode 100644 index 000000000000..7184cc654875 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/XDataTransferProviderAccess/awt_XDataTransferProviderAccess.xba @@ -0,0 +1,117 @@ +<?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="awt_XDataTransferProviderAccess" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.awt.XDataTransferProviderAccess +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + ' Here create a window for testing getDragGestureRecognizer(), getDragSource(), getDropTarget() methods + Dim oWndDescr As new com.sun.star.awt.WindowDescriptor + Dim oBounds As new com.sun.star.awt.Rectangle + oWndDescr.Type = com.sun.star.awt.WindowClass.TOP + oWndDescr.WindowServiceName = "" + oWndDescr.ParentIndex = -1 + oBounds.X = 10 : oBounds.Y = 20 + oBounds.Width = 110 : oBounds.Height = 120 + oWndDescr.Bounds = oBounds + with com.sun.star.awt.WindowAttribute + oWndDescr.WindowAttributes = .CLOSEABLE AND .MOVEABLE AND .SIZEABLE AND .BORDER AND .SHOW + end with + + Dim oWnd As Object + oWnd = oObj.createWindow(oWndDescr) + + Test.StartMethod("getDragGestureRecognizer()") + bOK = true + Dim oRecognizer As Object + oRecognizer = oObj.getDragGestureRecognizer(oWnd) + Out.Log("Recognizer is NULL : " & isNULL(oRecognizer)) + bOK = bOK AND NOT isNULL(oRecognizer) + if (bOK) then + bOK = bOK AND hasUnoInterfaces(oRecognizer, "com.sun.star.datatransfer.dnd.XDragGestureRecognizer") + if (NOT bOK) then Out.Log("Returned object doesn't support XDragGestureRecognizer interface.") + end if + Test.MethodTested("getDragGestureRecognizer()", bOK) + + Test.StartMethod("getDragSource()") + bOK = true + Dim oDragSource As Object + oDragSource = oObj.getDragSource(oWnd) + Out.Log("DragSource is NULL : " & isNULL(oDragSource)) + bOK = bOK AND NOT isNULL(oDragSource) + if (bOK) then + bOK = bOK AND hasUnoInterfaces(oDragSource, "com.sun.star.datatransfer.dnd.XDragSource") + if (NOT bOK) then Out.Log("Returned object doesn't support XDragSource interface.") + end if + Test.MethodTested("getDragSource()", bOK) + + Test.StartMethod("getDropTarget()") + bOK = true + Dim oDropTarget As Object + oDropTarget = oObj.getDropTarget(oWnd) + Out.Log("DropTarget is NULL : " & isNULL(oDropTarget)) + bOK = bOK AND NOT isNULL(oDropTarget) + if (bOK) then + bOK = bOK AND hasUnoInterfaces(oDropTarget, "com.sun.star.datatransfer.dnd.XDropTarget") + if (NOT bOK) then Out.Log("Returned object doesn't support XDropTarget interface.") + end if + Test.MethodTested("getDropTarget()", bOK) + + Test.StartMethod("getClipboard()") + bOK = true + Dim oClipboard As Object + oClipboard = oObj.getClipboard("") + Out.Log("Clipboard is NULL : " & isNULL(oClipboard)) + bOK = bOK AND NOT isNULL(oClipboard) + if (bOK) then + bOK = bOK AND hasUnoInterfaces(oClipboard, "com.sun.star.datatransfer.clipboard.XClipboard") + if (NOT bOK) then Out.Log("Returned object doesn't support XClipboard interface.") + end if + Test.MethodTested("getClipboard()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/awt/XDataTransferProviderAccess/script.xlb b/qadevOOo/tests/basic/ifc/awt/XDataTransferProviderAccess/script.xlb new file mode 100644 index 000000000000..e574ae92bd2b --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/XDataTransferProviderAccess/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="awt_XDataTransferProviderAccess" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="awt_XDataTransferProviderAccess"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/awt/XDateField/awt_XDateField.xba b/qadevOOo/tests/basic/ifc/awt/XDateField/awt_XDateField.xba new file mode 100644 index 000000000000..c6b2d9589415 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/XDateField/awt_XDateField.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="awt_XDateField" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.awt.XDateField +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + Test.StartMethod("setDate()") + bOK = true + oObj.setDate(5087) + Test.StartMethod("getDate()") + bOK = bOK AND (oObj.getDate() = 5087) + Test.MethodTested("setDate()", bOK) + Test.MethodTested("getDate()", bOK) + + Test.StartMethod("setMin()") + bOK = true + oObj.setMin(4978) + Test.StartMethod("getMin()") + bOK = bOK AND (oObj.getMin() = 4978) + Test.MethodTested("setMin()", bOK) + Test.MethodTested("getMin()", bOK) + + Test.StartMethod("setMax()") + bOK = true + oObj.setMax(27856) + Test.StartMethod("getMax()") + bOK = bOK AND (oObj.getMax() = 27856) + Test.MethodTested("setMax()", bOK) + Test.MethodTested("getMax()", bOK) + + Test.StartMethod("setFirst()") + bOK = true + oObj.setFirst(5118) + Test.StartMethod("getFirst()") + bOK = bOK AND (oObj.getfirst() = 5118) + Test.MethodTested("setFirst()", bOK) + Test.MethodTested("getFirst()", bOK) + + Test.StartMethod("setLast()") + bOK = true + oObj.setLast(23450) + Test.StartMethod("getLast()") + bOK = bOK AND (oObj.getLast() = 23450) + Test.MethodTested("setLast()", bOK) + Test.MethodTested("getLast()", bOK) + + Test.StartMethod("setLongFormat()") + bOK = true + oObj.setLongFormat(true) + Test.StartMethod("isLongFormat()") + bOK = bOK AND oObj.isLongFormat() + oObj.setLongFormat(false) + bOK = bOK AND NOT oObj.isLongFormat() + Test.MethodTested("setLongFormat()", bOK) + Test.MethodTested("isLongFormat()", bOK) + + Test.StartMethod("isEmpty()") + bOK = true + oObj.setDate(6321) + bOK = bOK AND NOT oObj.isEmpty() + Test.StartMethod("setEmpty()") + oObj.setEmpty() + Test.MethodTested("setEmpty()", bOK) + Test.MethodTested("isEmpty()", bOK) + + Test.StartMethod("setStrictFormat()") + bOK = true + oObj.setStrictFormat(true) + Test.StartMethod("isStrictFormat()") + bOK = bOK AND oObj.isStrictFormat() + oObj.setStrictFormat(false) + bOK = bOK AND NOT oObj.isStrictFormat() + Test.MethodTested("setStrictFormat()", bOK) + Test.MethodTested("isStrictFormat()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/awt/XDateField/script.xlb b/qadevOOo/tests/basic/ifc/awt/XDateField/script.xlb new file mode 100644 index 000000000000..afba59a0a5b0 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/XDateField/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="awt_XDateField" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="awt_XDateField"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/awt/XDialog/awt_XDialog.xba b/qadevOOo/tests/basic/ifc/awt/XDialog/awt_XDialog.xba new file mode 100644 index 000000000000..2e4e4608324d --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/XDialog/awt_XDialog.xba @@ -0,0 +1,73 @@ +<?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="awt_XDialog" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.awt.XDialog +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Test.StartMethod("setTitle()") + oObj.setTitle("XDialog test") + bOK = True + Test.MethodTested("setTitle()", bOK) + + Test.StartMethod("getTitle()") + bOK = oObj.getTitle() = "XDialog test" + Test.MethodTested("getTitle()", bOK) + + Test.StartMethod("execute()") + bOK = True + Test.MethodTested("execute()", bOK) + + Test.StartMethod("endExecute()") + bOK = True + Test.MethodTested("endExecute()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/awt/XDialog/script.xlb b/qadevOOo/tests/basic/ifc/awt/XDialog/script.xlb new file mode 100644 index 000000000000..6a9a7b8477c2 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/XDialog/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="awt_XDialog" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="awt_XDialog"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/awt/XFixedText/awt_XFixedText.xba b/qadevOOo/tests/basic/ifc/awt/XFixedText/awt_XFixedText.xba new file mode 100644 index 000000000000..c318aec30576 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/XFixedText/awt_XFixedText.xba @@ -0,0 +1,87 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="awt_XFixedText" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.awt.XFixedText +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Test.StartMethod("getText()") + Dim strText As String + strText = oObj.getText() + If IsNULL(strText) Then + strText = "XFixedText" + EndIf + bOK = True + Test.MethodTested("getText()", bOK) + + Test.StartMethod("setText()") + bOK = true + oObj.setText(strText + "_") + bOK = oObj.getText() = (strText + "_") + Test.MethodTested("setText()", bOK) + + Test.StartMethod("getAlignment()") + Dim align As Integer + align = oObj.getAlignment() + bOK = True + Test.MethodTested("getAlignment()", bOK) + + Test.StartMethod("setAlignment()") + If align = com.sun.star.awt.TextAlign.CENTER Then + align = com.sun.star.awt.TextAlign.LEFT + Else + align = com.sun.star.awt.TextAlign.CENTER + EndIf + oObj.setAlignment(align) + bOK = oObj.getAlignment() = align + Test.MethodTested("setAlignment()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/awt/XFixedText/script.xlb b/qadevOOo/tests/basic/ifc/awt/XFixedText/script.xlb new file mode 100644 index 000000000000..7692bb7aabc4 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/XFixedText/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="awt_XFixedText" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="awt_XFixedText"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/awt/XItemListener/awt_XItemListener.xba b/qadevOOo/tests/basic/ifc/awt/XItemListener/awt_XItemListener.xba new file mode 100644 index 000000000000..b40c8505ee24 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/XItemListener/awt_XItemListener.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="awt_XItemListener" 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 + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +'Global bIL_itemStateChanged As Boolean +'Global oEventItemListener As Object + +'************************************************************************* + + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.awt.XItemListener +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Dim event As new com.sun.star.awt.ItemEvent + event.Selected = 1 + event.Highlighted = 2 + Test.StartMethod("itemStateChanged()") + oObj.itemStateChanged(event) + wait(200) + if isNull(oEventItemListener) OR isEmpty(oEventItemListener) then + Out.Log("Event object is NULL, listener was called: " + bIL_itemStateChanged) + bOK = false + else + bOK = bIL_itemStateChanged And (oEventItemListener.Selected = 1) And (oEventItemListener.Highlighted = 2) + end if + Test.MethodTested("itemStateChanged()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/awt/XItemListener/script.xlb b/qadevOOo/tests/basic/ifc/awt/XItemListener/script.xlb new file mode 100644 index 000000000000..efe46b4089dd --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/XItemListener/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="awt_XItemListener" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="awt_XItemListener"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/awt/XLayoutConstrains/awt_XLayoutConstrains.xba b/qadevOOo/tests/basic/ifc/awt/XLayoutConstrains/awt_XLayoutConstrains.xba new file mode 100644 index 000000000000..df864affc44e --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/XLayoutConstrains/awt_XLayoutConstrains.xba @@ -0,0 +1,75 @@ +<?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="awt_XLayoutConstrains" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.awt.XLayoutConstrains +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim oSize As Object + + Test.StartMethod("getMinimumSize()") + bOK = true + oSize = oObj.com_sun_star_awt_XLayoutConstrains_getMinimumSize() + Out.Log("Size is (" & oSize.Width & " X " & oSize.Height & ")") + Test.MethodTested("getMinimumSize()", bOK) + + Test.StartMethod("getPreferredSize()") + bOK = true + oSize = oObj.getPreferredSize() + Out.Log("Size is (" & oSize.Width & " X " & oSize.Height & ")") + Test.MethodTested("getPreferredSize()", bOK) + + Test.StartMethod("calcAdjustedSize()") + bOK = true + oSize = oObj.calcAdjustedSize(oSize) + Out.Log("Size is (" & oSize.Width & " X " & oSize.Height & ")") + Test.MethodTested("calcAdjustedSize()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/awt/XLayoutConstrains/script.xlb b/qadevOOo/tests/basic/ifc/awt/XLayoutConstrains/script.xlb new file mode 100644 index 000000000000..f303a250268e --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/XLayoutConstrains/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="awt_XLayoutConstrains" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="awt_XLayoutConstrains"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/awt/XListBox/awt_XListBox.xba b/qadevOOo/tests/basic/ifc/awt/XListBox/awt_XListBox.xba new file mode 100644 index 000000000000..f7ebe0b1603d --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/XListBox/awt_XListBox.xba @@ -0,0 +1,239 @@ +<?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="awt_XListBox" 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 + + +Dim bIL_itemStateChanged, bAL_actionPerformed As Boolean + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.awt.XListBox +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + Test.StartMethod("addItemListener()") + Dim oIListener As Object + oIListener = createUnoListener("IL_", "com.sun.star.awt.XItemListener") + bIL_itemStateChanged = False + oObj.addItemListener(oIListener) + Out.Log("Can be checked only interactively !!!") + bOK = True + Test.MethodTested("addItemListener()", bOK) + + Test.StartMethod("removeItemListener()") + oObj.removeItemListener(oIListener) + bOK = True + Test.MethodTested("removeItemListener()", bOK) + + Test.StartMethod("addActionListener()") + Dim oAListener As Object + oAListener = createUnoListener("AL_", "com.sun.star.awt.XActionListener") + bAL_actionPerformed = False + Out.Log("Can be checked only interactively !!!") + oObj.addActionListener(oAListener) + bOK = True + Test.MethodTested("addActionListener()", bOK) + + Test.StartMethod("removeActionListener()") + oObj.removeActionListener(oAListner) + bOK = True + Test.MethodTested("removeActionListener()", bOK) + + Test.StartMethod("getItemCount()") + Dim itemCount As Integer + itemCount = oObj.getItemCount() + bOK = itemCount > 0 Or itemCount = 0 + Test.MethodTested("getItemCount()", bOK) + + Test.StartMethod("addItem()") + oObj.addItem("Item1", itemCount) + bOK = oObj.getItemCount() = (itemCount + 1) + Test.MethodTested("addItem()", bOK) + + Test.StartMethod("addItems()") + Dim oldCount As Integer + oldCount = oObj.getItemCount() + Dim items As Variant + items = Array("Item2", "Item3") + oObj.addItems(items, oldCount) + bOK = oObj.getItemCount() = (oldCount + 2) + Test.MethodTested("addItems()", bOK) + + Test.StartMethod("getItem()") + Dim item As String + item = oObj.getItem(itemCount) + bOK = (item = "Item1") + Test.MethodTested("getItem()", bOK) + + Test.StartMethod("getItems()") + Dim itms As Variant + itms = oObj.getItems() + bOK = True + Dim i As Integer + Dim iName As String + For i = itemCount to itemCount + 2 + iName = "Item" + (i + 1) + bOK = bOK And (iName = itms(i)) + Next i + Test.MethodTested("getItems()", bOK) + + Test.StartMethod("getSelectedItemPos()") + oObj.selectItemPos(1, True) + bOK = (oObj.getSelectedItemPos() = 1) + Test.MethodTested("getSelectedItemPos()", bOK) + + Test.StartMethod("setMultipleMode()") + oObj.setMultipleMode(True) + bOK = True + Test.MethodTested("setMultipleMode()", bOK) + + Test.StartMethod("selectItemsPos()") + Dim selItems As Variant + selItems = Array(0, 2) + oObj.selectItemsPos(selItems, True) + bOK = True + Test.MethodTested("selectItemsPos()", bOK) + + Test.StartMethod("getSelectedItemsPos()") + Dim cnt As Integer + cnt = oObj.getItemCount() + For i = 0 to cnt + oObj.selectItemPos(i, False) + Next i + selItems = Array(0, 2) + oObj.selectItemsPos(selItems, True) + Dim selItemsPos As Variant + selItemsPos = oObj.getSelectedItemsPos() + Out.Log("Selected items position:") + For i = 0 to ubound(selItemsPos) + Out.log(selItemsPos(i)) + Next i + bOK = (ubound(selItemsPos) = 1) And (selItemsPos(0) = "0") And (selItemsPos(1) = "2") + Test.MethodTested("getSelectedItemsPos()", bOK) + + Test.StartMethod("selectItem()") + bOK = true + oObj.selectItem("Item3", True) + Test.MethodTested("selectItem()", bOK) + + Test.StartMethod("getSelectedItem()") + cnt = oObj.getItemCount() + For i = 0 to cnt + oObj.selectItemPos(i, False) + Next i + oObj.selectItem("Item3", True) + bOK = (oObj.getSelectedItem() = "Item3") + Test.MethodTested("getSelectedItem()", bOK) + + Test.StartMethod("getSelectedItems()") + bOK = true + cnt = oObj.getItemCount() + For i = 0 to cnt + oObj.selectItemPos(i, False) + Next i + oObj.selectItemsPos(selItems, True) + items = oObj.getSelectedItems() + Out.Log("Selected items:") + For i = 0 to ubound(items) + Out.log(items(i)) + Next i + bOK = (ubound(items) = 1) And (oObj.getItem(0) = items(0)) And (oObj.getItem(2) = items(1)) + Test.MethodTested("getSelectedItems()", bOK) + + Test.StartMethod("selectItemPos()") + cnt = oObj.getItemCount() + For i = 0 to cnt + oObj.selectItemPos(i, False) + Next i + oObj.selectItemPos(1, True) + bOK = True + Test.MethodTested("selectItemPos()", bOK) + + Test.StartMethod("isMutipleMode()") + bOK = oObj.isMutipleMode() + Test.MethodTested("isMutipleMode()", bOK) + + Test.StartMethod("makeVisible()") + bOK = true + oObj.makeVisible(2) + Test.MethodTested("makeVisible()", bOK) + + Test.StartMethod("getDropDownLineCount()") + Dim lineCount As Integer + lineCount = oObj.getDropDownLineCount() + bOK = True + Test.MethodTested("getDropDownLineCount()", bOK) + + Test.StartMethod("setDropDownLineCount()") + oObj.setDropDownLineCount(lineCount + 1) + bOK = oObj.getDropDownLineCount() = (lineCount + 1) + Test.MethodTested("setDropDownLineCount()", bOK) + + Test.StartMethod("removeItems()") + cnt = oObj.getItemCount() + oObj.removeItems(0, cnt) + bOK = oObj.getItemCount() = 0 + Test.MethodTested("removeItems()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub + +Sub IL_itemStateChanged + bIL_itemStateChanged = True + Out.Log("CallBack for ItemListener itemStateChanged was called.") +End Sub + +Sub AL_actionPerformed + bAL_actionPerformed = True + Out.Log("CallBack for ActionListener actionPerformed was called.") +End Sub + +Sub AL_disposing +End Sub + +Sub IL_disposing +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/awt/XListBox/script.xlb b/qadevOOo/tests/basic/ifc/awt/XListBox/script.xlb new file mode 100644 index 000000000000..ddb31adf4ec6 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/XListBox/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="awt_XListBox" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="awt_XListBox"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/awt/XNumericField/awt_XNumericField.xba b/qadevOOo/tests/basic/ifc/awt/XNumericField/awt_XNumericField.xba new file mode 100644 index 000000000000..672245ed381b --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/XNumericField/awt_XNumericField.xba @@ -0,0 +1,157 @@ +<?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="awt_XNumericField" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.awt.XNumericField +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim oldVal, newVal As Variant + + Test.StartMethod("getValue()") + Test.StartMethod("setValue()") + bOK = true + oldVal = oObj.getValue() + Out.Log("value before: "+oldVal) + oObj.setValue(oldVal+20) + newVal = oObj.getValue() + Out.Log("value after: "+newVal) + bOK = bOK AND (oldVal <> newVal) + Test.MethodTested("setValue()", bOK) + Test.MethodTested("getValue()", bOK) + + Test.StartMethod("getMin()") + Test.StartMethod("setMin()") + bOK = true + oldVal = oObj.getMin() + Out.Log("value before: "+oldVal) + oObj.setMin(oldVal+20) + newVal = oObj.getMin() + Out.Log("value after: "+newVal) + bOK = bOK AND (oldVal <> newVal) + Test.MethodTested("setMin()", bOK) + Test.MethodTested("getMin()", bOK) + + Test.StartMethod("getMax()") + Test.StartMethod("setMax()") + bOK = true + oldVal = oObj.getMax() + Out.Log("value before: "+oldVal) + oObj.setMax(oldVal+20) + newVal = oObj.getMax() + Out.Log("value after: "+newVal) + bOK = bOK AND (oldVal <> newVal) + Test.MethodTested("setMax()", bOK) + Test.MethodTested("getMax()", bOK) + + Test.StartMethod("getFirst()") + Test.StartMethod("setFirst()") + bOK = true + oldVal = oObj.getFirst() + Out.Log("value before: "+oldVal) + oObj.setFirst(oldVal+20) + newVal = oObj.getFirst() + Out.Log("value after: "+newVal) + bOK = bOK AND (oldVal <> newVal) + Test.MethodTested("setFirst()", bOK) + Test.MethodTested("getFirst()", bOK) + + Test.StartMethod("getLast()") + Test.StartMethod("setLast()") + bOK = true + oldVal = oObj.getLast() + Out.Log("value before: "+oldVal) + oObj.setLast(oldVal+20) + newVal = oObj.getLast() + Out.Log("value after: "+newVal) + bOK = bOK AND (oldVal <> newVal) + Test.MethodTested("setLast()", bOK) + Test.MethodTested("getLast()", bOK) + + Test.StartMethod("getSpinSize()") + Test.StartMethod("setSpinSize()") + bOK = true + oldVal = oObj.getSpinSize() + Out.Log("value before: "+oldVal) + oObj.setSpinSize(oldVal+20) + newVal = oObj.getSpinSize() + Out.Log("value after: "+newVal) + bOK = bOK AND (oldVal <> newVal) + Test.MethodTested("setSpinSize()", bOK) + Test.MethodTested("getSpinSize()", bOK) + + Test.StartMethod("getDecimalDigits()") + Test.StartMethod("setDecimalDigits()") + bOK = true + oldVal = oObj.getDecimalDigits() + Out.Log("value before: "+oldVal) + oObj.setDecimalDigits(oldVal+20) + newVal = oObj.getDecimalDigits() + Out.Log("value after: "+newVal) + bOK = bOK AND (oldVal <> newVal) + Test.MethodTested("setDecimalDigits()", bOK) + Test.MethodTested("getDecimalDigits()", bOK) + + Test.StartMethod("isStrictFormat()") + Test.StartMethod("setStrictFormat()") + bOK = true + oldVal = oObj.isStrictFormat() + Out.Log("value before: "+oldVal) + if (oldVal) then + oObj.setStrictFormat(false) + else + oObj.setStrictFormat(true) + endif + newVal = oObj.isStrictFormat() + Out.Log("value after: "+newVal) + bOK = bOK AND (oldVal <> newVal) + Test.MethodTested("setStrictFormat()", bOK) + Test.MethodTested("isStrictFormat()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/awt/XNumericField/script.xlb b/qadevOOo/tests/basic/ifc/awt/XNumericField/script.xlb new file mode 100644 index 000000000000..3c306c572dc4 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/XNumericField/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="awt_XNumericField" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="awt_XNumericField"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/awt/XPatternField/awt_XPatternField.xba b/qadevOOo/tests/basic/ifc/awt/XPatternField/awt_XPatternField.xba new file mode 100644 index 000000000000..142cce73bf34 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/XPatternField/awt_XPatternField.xba @@ -0,0 +1,99 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="awt_XPatternField" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.awt.XPatternField +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim oldVal, newVal As Variant + Dim eMask, lMask, eMaskOld, lMaskOld As String + + Test.StartMethod("getMasks()") + Test.StartMethod("setMasks()") + bOK = true + oObj.getMasks(eMaskOld, lMaskOld) + Out.Log("value before: {"+eMaskOld+", "+lMaskOld+"}") + oObj.setMasks(eMaskOld+"__NEW", lMaskOld+"__NEW") + oObj.getMasks(eMask, lMask) + Out.Log("value after: {"+eMask+", "+lMask+"}") + bOK = bOK AND (eMask <> eMaskOld) AND (lMask <> lMaskOld) + Test.MethodTested("setMasks()", bOK) + Test.MethodTested("getMasks()", bOK) + + Test.StartMethod("getString()") + Test.StartMethod("setString()") + bOK = true + oldVal = oObj.getString() + Out.Log("value before: "+oldVal) + oObj.setString(oldVal+"__NEW") + newVal = oObj.getString() + Out.Log("value after: "+newVal) + bOK = bOK AND (oldVal <> newVal) + Test.MethodTested("setString()", bOK) + Test.MethodTested("getString()", bOK) + + Test.StartMethod("isStrictFormat()") + Test.StartMethod("setStrictFormat()") + bOK = true + oldVal = oObj.isStrictFormat() + Out.Log("value before: "+oldVal) + if (oldVal) then + oObj.setStrictFormat(false) + else + oObj.setStrictFormat(true) + endif + newVal = oObj.isStrictFormat() + Out.Log("value after: "+newVal) + bOK = bOK AND (oldVal <> newVal) + Test.MethodTested("setStrictFormat()", bOK) + Test.MethodTested("isStrictFormat()", bOK) + + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/awt/XPatternField/script.xlb b/qadevOOo/tests/basic/ifc/awt/XPatternField/script.xlb new file mode 100644 index 000000000000..5ff8b132fb5e --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/XPatternField/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="awt_XPatternField" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="awt_XPatternField"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/awt/XRadioButton/awt_XRadioButton.xba b/qadevOOo/tests/basic/ifc/awt/XRadioButton/awt_XRadioButton.xba new file mode 100644 index 000000000000..df81b1fe7ea0 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/XRadioButton/awt_XRadioButton.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="awt_XRadioButton" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.awt.XRadioButton +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim newVal, oldVal As Variant + Dim oListener As Object + Dim listenerCalled As Boolean + + 'Flag should be 'true', because itemStateListener called only interactively + listenerCalled = true + oListener = createUNOListener("iSC_","com.sun.star.awt.XItemListener") + + Test.StartMethod("addItemListener()") + Test.StartMethod("removeItemListener()") + oObj.addItemListener(oListener) + oObj.removeItemListener(oListener) + bOK = true AND listenerCalled + Test.MethodTested("addItemListener()", bOK) + Test.MethodTested("removeItemListener()", bOK) + + Test.StartMethod("getState()") + Test.StartMethod("setState()") + bOK = true + oldVal = oObj.getState() + Out.Log("value before: "+oldVal) + if (oldVal) then + oObj.setState(false) + else + oObj.setState(true) + endif + newVal = oObj.getState() + Out.Log("value after: "+newVal) + bOK = bOK AND (oldVal <> newVal) + Test.MethodTested("getState()", bOK) + Test.MethodTested("setState()", bOK) + + Test.StartMethod("setLabel()") + bOK = true + oObj.setLabel("newLabel") + Test.MethodTested("setLabel()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub + +Sub iSC_itemStateChanged() + Out.Log("CallBack for oListener itemStateChanged was called.") + listenerCalled = true +End Sub + +</script:module> diff --git a/qadevOOo/tests/basic/ifc/awt/XRadioButton/script.xlb b/qadevOOo/tests/basic/ifc/awt/XRadioButton/script.xlb new file mode 100644 index 000000000000..64dc7ba570bf --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/XRadioButton/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="awt_XRadioButton" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="awt_XRadioButton"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/awt/XSpinField/awt_XSpinField.xba b/qadevOOo/tests/basic/ifc/awt/XSpinField/awt_XSpinField.xba new file mode 100644 index 000000000000..c2322aa120ff --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/XSpinField/awt_XSpinField.xba @@ -0,0 +1,126 @@ +<?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="awt_XSpinField" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.awt.XSpinField +'************************************************************************* +On Error Goto ErrHndl + + Test.StartMethod("addSpinListener()") + Dim oListener As Object + oListener = createUnoListener("SL_", "com.sun.star.awt.XSpinListener") + initListener() + oObj.addSpinListener(oListener) + Test.MethodTested("addSpinListener()", True) + + Test.StartMethod("up()") + oObj.up() + wait(1000) + Test.MethodTested("up()", bUpCalled) + + Test.StartMethod("down()") + oObj.down() + wait(1000) + Test.MethodTested("down()", bDownCalled) + + Test.StartMethod("first()") + oObj.first() + wait(1000) + Test.MethodTested("first()", bFirstCalled) + + Test.StartMethod("last()") + oObj.last() + wait(1000) + Test.MethodTested("last()", bLastCalled) + + Test.StartMethod("removeSpinListener()") + oObj.removeSpinListener(oListener) + initListener() + oObj.up() + wait(1000) + Test.MethodTested("removeSpinListener()", Not bUpCalled) + + Test.StartMethod("enableRepeat()") + oObj.enableRepeat(true) + oObj.enableRepeat(false) + Test.MethodTested("enableRepeat()", True) +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub + +Dim bUpCalled As Boolean +Dim bDownCalled As Boolean +Dim bFirstCalled As Boolean +Dim bLastCalled As Boolean + +Sub initListener() + bUpCalled = false + bDownCalled = false + bFirstCalled = false + bLastCalled = false +End Sub + +Sub SL_up() + Out.log("Listener up called") + bUpCalled = true +End Sub + +Sub SL_down() + Out.log("Listener down called") + bDownCalled = true +End Sub + +Sub SL_first() + Out.log("Listener first called") + bFirstCalled = true +End Sub + +Sub SL_last() + Out.log("Listener last called") + bLastCalled = true +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/awt/XSpinField/script.xlb b/qadevOOo/tests/basic/ifc/awt/XSpinField/script.xlb new file mode 100644 index 000000000000..40bea8c120fe --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/XSpinField/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="awt_XSpinField" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="awt_XSpinField"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/awt/XTabController/awt_XTabController.xba b/qadevOOo/tests/basic/ifc/awt/XTabController/awt_XTabController.xba new file mode 100644 index 000000000000..50a77a5c8411 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/XTabController/awt_XTabController.xba @@ -0,0 +1,116 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="awt_XTabController" 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 + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' Global oXTabControllerModel as Object +' Global oXTabControllerContainer as Object +' Global bHasNoModel as Boolean + +'************************************************************************* + + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.awt.XTabController +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim vControls As Variant + Dim n As Integer + + Out.Log("This interface is DEPRECATED !!!") + Out.Log("All test results are OK now") + + Test.StartMethod("setModel()") + Test.StartMethod("getModel()") + oObj.setModel(oXTabControllerModel) + bOK = (bHasNoModel = True) or hasUnoInterfaces(oObj.getModel(), "com.sun.star.awt.XTabControllerModel") + Test.MethodTested("setModel()", true) + Test.MethodTested("getModel()", bOK) + + Test.StartMethod("setContainer()") + Test.StartMethod("getContainer()") + oObj.setContainer(oXTabControllerContainer) + bOK = hasUnoInterfaces(oObj.getContainer(), "com.sun.star.awt.XControlContainer") + Test.MethodTested("setContainer()", true) + Test.MethodTested("getContainer()", bOK) + + Test.StartMethod("getControls()") + bOK = true + vControls = oObj.getcontrols() + For n = uBound(vControls) To lBound(vControls) + bOK = bOK AND hasUnoInterfaces(vControls(n), "com.sun.star.awt.XControl") + Next + Test.MethodTested("getControls()", true) + + Test.StartMethod("autoTabOrder()") + oObj.autoTabOrder() + bOK = true + Test.MethodTested("autoTabOrder()", true) + + Test.StartMethod("activateTabOrder()") + oObj.activateTabOrder() + bOK = true + Test.MethodTested("activateTabOrder()", true) + + Test.StartMethod("activateFirst()") + oObj.activateFirst() + bOK = true + Test.MethodTested("activateFirst()", true) + + Test.StartMethod("activateLast()") + oObj.activateLast() + bOK = true + Test.MethodTested("activateLast()", true) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/awt/XTabController/script.xlb b/qadevOOo/tests/basic/ifc/awt/XTabController/script.xlb new file mode 100644 index 000000000000..e49913869b6d --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/XTabController/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="awt_XTabController" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="awt_XTabController"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/awt/XTabControllerModel/awt_XTabControllerModel.xba b/qadevOOo/tests/basic/ifc/awt/XTabControllerModel/awt_XTabControllerModel.xba new file mode 100644 index 000000000000..df229ef05820 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/XTabControllerModel/awt_XTabControllerModel.xba @@ -0,0 +1,117 @@ +<?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="awt_XTabControllerModel" 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 + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' Global XTabControlModel1 as Object +' Global XTabControlModel2 as Object + +'************************************************************************* + + + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.awt.XTabControllerModel +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim ModelSeq1(0), ModelSeq2(0) As Variant + Dim ReturnModel(), ReturnSeq2(), ReturnSeq1() As Variant + Dim ReturnName, cName As String + + cName = "XTabControllerModel" + + Test.StartMethod("setGroupControl()") + bOK = true + oObj.setGroupControl(false) + Test.StartMethod("getGroupControl()") + bOK = bOK AND NOT oObj.getGroupControl() + oObj.setGroupControl(true) + bOK = bOK AND oObj.getGroupControl() + Test.MethodTested("getGroupControl()", bOK) + Test.MethodTested("setGroupControl()", bOK) + + Test.StartMethod("setControlModels()") + bOK = true + ModelSeq1(0) = XTabControlModel1 + oObj.setControlModels(ModelSeq1()) + Test.StartMethod("getControlModels()") + ReturnSeq1 = oObj.getControlModels() + bOK = bOk AND (uBound(ReturnSeq1()) = uBound(ModelSeq1())) + Test.MethodTested("setControlModels()", bOK) + Test.MethodTested("getControlModels()", bOK) + + Test.StartMethod("setGroup()") + bOK = true + ModelSeq2(0) = XTabControlModel2 + oObj.setGroup(ModelSeq2(), cName) + Test.StartMethod("getGroup()") + oObj.getGroup(0,ReturnSeq2(), ReturnName) + bOK = bOK AND (ReturnName = cName) + bOK = bOK AND (uBound(ReturnSeq2()) = uBound(ModelSeq2())) + Test.MethodTested("setGroup()", bOK) + Test.MethodTested("getGroup()", bOK) + + Test.StartMethod("getGroupCount()") + bOK = true + bOK = bOK AND (oObj.getGroupCount() > 0) + bOK = bOK AND isNumeric(oObj.getGroupCount()) + Test.MethodTested("getGroupCount()", bOK) + + Test.StartMethod("getGroupByName()") + bOK = true + oObj.getGroupByName(cName, ReturnModel()) + Test.MethodTested("getGroupByName()", bOK) + + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/awt/XTabControllerModel/script.xlb b/qadevOOo/tests/basic/ifc/awt/XTabControllerModel/script.xlb new file mode 100644 index 000000000000..43a9143774e6 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/XTabControllerModel/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="awt_XTabControllerModel" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="awt_XTabControllerModel"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/awt/XTextComponent/awt_XTextComponent.xba b/qadevOOo/tests/basic/ifc/awt/XTextComponent/awt_XTextComponent.xba new file mode 100644 index 000000000000..29e77fe4b900 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/XTextComponent/awt_XTextComponent.xba @@ -0,0 +1,191 @@ +<?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="awt_XTextComponent" 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 + + +Dim bCB1_textChanged As Boolean +Dim bCB2_textChanged As Boolean + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.awt.XTextComponent +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim oListener1 As Object, oListener2 As Object + Dim vSelection As new com.sun.star.awt.Selection + Dim vSelectionSelection As new com.sun.star.awt.Selection + Dim vGetSelection As new com.sun.star.awt.Selection + Dim vInsertSelection As new com.sun.star.awt.Selection + Dim cGetText As String + Dim len2set As Integer + + Out.Log("create two com.sun.star.awt.XTextListener") + oListener1 = createUNOListener("CB1_", "com.sun.star.awt.XTextListener") + oListener2 = createUNOListener("CB2_", "com.sun.star.awt.XTextListener") + + Test.StartMethod("setText()") + bOK = true + Dim cText As String + cText = "XTextComponent: setText()" + oObj.setText(cText) + Test.StartMethod("getText()") + bOK = bOK AND (cText = oObj.getText()) + Test.MethodTested("setText()", bOK) + Test.MethodTested("getText()", bOK) + + Test.StartMethod("insertText()") + bOK = true + oObj.setText("setSelection") + vInsertSelection.Min = 0 + vInsertSelection.Max = 3 + oObj.insertText(vInsertSelection,"new") + Out.Log("result of getText is: '" + oObj.getText() +"'. It sould be 'newSelection'") + bOK = bOK AND (oObj.getText() = "newSelection") + Test.MethodTested("insertText()", bOK) + + + Test.StartMethod("setSelection()") + bOK = true + vSelectionSelection.Min = 2 + vSelectionSelection.Max = 3 + oObj.setSelection(vSelectionSelection) + Test.StartMethod("getSelection()") + vGetSelection = oObj.getSelection() + bOK = bOK AND (vGetSelection.Min = vSelectionSelection.Min) AND _ + (vGetSelection.Max = vSelectionSelection.Max) + Test.MethodTested("setSelection()", bOK) + Test.MethodTested("getSelection()", bOK) + + Test.StartMethod("getSelectedText()") + bOK = true + oObj.setText("getSelectedText") + vSelectionSelection.Min = 0 + vSelectionSelection.Max = 3 + oObj.setSelection(vSelectionSelection) + Out.Log("result of getSelectedText is: '" + oObj.getSelectedText() +"'. It sould be 'get'") + bOK = bOK AND (oObj.getSelectedText() = "get") + Test.MethodTested("getSelectedText()", bOK) + + Test.StartMethod("setEditable()") + bOK = true + oObj.setEditable(true) + Test.StartMethod("isEditable()") + bOK = bOK AND oObj.isEditable() + oObj.setEditable(false) + bOK = bOK AND NOT oObj.isEditable() + oObj.setEditable(true) + bOK = bOK AND oObj.isEditable() + Test.MethodTested("setEditable()", bOK) + Test.MethodTested("isEditable()", bOK) + + Test.StartMethod("setMaxTextLen()") + bOK = true + if (oObj.getMaxTextLen = 12) then + len2set = 10 + else + len2set = 12 + endif + oObj.setMaxTextLen(len2set) + oObj.setText("0123456789ABCDE") + cGetText = oObj.getText() + Out.Log("result of Len(cGetText) is: '" + Len(cGetText) + "'. It sould be >'" + len2set+"' ") + bOK = bOK AND (Len(cGetText) > len2set) + Test.MethodTested("setMaxTextLen()", bOK) + + Test.StartMethod("getMaxTextLen()") + bOK = true + if (oObj.getMaxTextLen = 12) then + len2set = 10 + else + len2set = 12 + endif + oObj.setMaxTextLen(len2set) + Out.Log("result of getMaxTextLen is: '" + oObj.getMaxTextLen() +"'. It sould be '"+len2set+"'") + bOK = bOK AND (oObj.getMaxTextLen() = len2set) + Test.MethodTested("getMaxTextLen()", bOK) + + bCB1_textChanged = false + bCB2_textChanged = false + + Test.StartMethod("addTextListener()") + bOK = true + oObj.addTextListener(oListener1) + oObj.addTextListener(oListener2) + oObj.setText("addTextListener") + Wait(500) + bOK = bOK AND bCB1_textChanged AND bCB2_textChanged + Test.MethodTested("addTextListener()", bOK) + + bCB1_textChanged = false + bCB2_textChanged = false + + Test.StartMethod("removeTextListener()") + bOK = true + oObj.removeTextListener(oListener1) + oObj.setText("removeTextListener") + Wait(500) + bOK = bOK AND NOT bCB1_textChanged AND bCB2_textChanged + oObj.removeTextListener(oListener2) + Test.MethodTested("removeTextListener()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub + +Sub CB1_disposing() +End Sub + +Sub CB2_disposing() +End Sub + +' Listener call backs for com.sun.star.awt.XTextListener +Sub CB1_textChanged + Out.Log("CallBack for Listener1 textChanged was called.") + bCB1_textChanged = true +End Sub +Sub CB2_TextChanged + Out.Log("CallBack for Listener2 textChanged was called.") + bCB2_textChanged = true +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/awt/XTextComponent/script.xlb b/qadevOOo/tests/basic/ifc/awt/XTextComponent/script.xlb new file mode 100644 index 000000000000..d684dbfe551a --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/XTextComponent/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="awt_XTextComponent" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="awt_XTextComponent"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/awt/XTextLayoutConstrains/awt_XTextLayoutConstrains.xba b/qadevOOo/tests/basic/ifc/awt/XTextLayoutConstrains/awt_XTextLayoutConstrains.xba new file mode 100644 index 000000000000..4460b1797620 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/XTextLayoutConstrains/awt_XTextLayoutConstrains.xba @@ -0,0 +1,70 @@ +<?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="awt_XTextLayoutConstrains" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.awt.XTextLayoutConstrains +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim nCols, nLines As Integer + Dim nSize As new com.sun.star.awt.Size + + Test.StartMethod("getMinimumSize()") + bOK = true + nSize = oObj.com_sun_star_awt_XTextLayoutContrains_getMinimumSize(0,0) + bOK = bOK AND (nSize.Width <> 0) AND (nSize.Height <> 0) + Test.MethodTested("getMinimumSize()", bOK) + + Test.StartMethod("getColumnsAndLines()") + bOK = true + oObj.getColumnsAndLines(nCols, nLines) + bOK = bOK AND (nCols <> 0) AND (nLines <> 0) + Test.MethodTested("getColumnsAndLines()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/awt/XTextLayoutConstrains/script.xlb b/qadevOOo/tests/basic/ifc/awt/XTextLayoutConstrains/script.xlb new file mode 100644 index 000000000000..93f6fb13380c --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/XTextLayoutConstrains/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="awt_XTextLayoutConstrains" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="awt_XTextLayoutConstrains"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/awt/XTextListener/awt_XTextListener.xba b/qadevOOo/tests/basic/ifc/awt/XTextListener/awt_XTextListener.xba new file mode 100644 index 000000000000..a5a2a5b56d5f --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/XTextListener/awt_XTextListener.xba @@ -0,0 +1,62 @@ +<?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="awt_XTextListener" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.awt.XTextListener +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim tEvent As new com.sun.star.awt.TextEvent + + Test.StartMethod("textChanged()") + bOK = true + oObj.textChanged(tEvent) + Test.MethodTested("textChanged()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/awt/XTextListener/script.xlb b/qadevOOo/tests/basic/ifc/awt/XTextListener/script.xlb new file mode 100644 index 000000000000..3fe2449e8555 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/XTextListener/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="awt_XTextListener" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="awt_XTextListener"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/awt/XTimeField/awt_XTimeField.xba b/qadevOOo/tests/basic/ifc/awt/XTimeField/awt_XTimeField.xba new file mode 100644 index 000000000000..15b1847754c7 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/XTimeField/awt_XTimeField.xba @@ -0,0 +1,145 @@ +<?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="awt_XTimeField" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.awt.XTimeField +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim oldVal, newVal As Variant + + Test.StartMethod("getTime()") + Test.StartMethod("setTime()") + bOK = true + oldVal = oObj.getTime() + Out.Log("value before: "+oldVal) + oObj.setTime(oldVal+20) + newVal = oObj.getTime() + Out.Log("value after: "+newVal) + bOK = bOK AND (oldVal <> newVal) + Test.MethodTested("setTime()", bOK) + Test.MethodTested("getTime()", bOK) + + Test.StartMethod("getMin()") + Test.StartMethod("setMin()") + bOK = true + oldVal = oObj.getMin() + Out.Log("value before: "+oldVal) + oObj.setMin(oldVal+20) + newVal = oObj.getMin() + Out.Log("value after: "+newVal) + bOK = bOK AND (oldVal <> newVal) + Test.MethodTested("setMin()", bOK) + Test.MethodTested("getMin()", bOK) + + Test.StartMethod("getMax()") + Test.StartMethod("setMax()") + bOK = true + oldVal = oObj.getMax() + Out.Log("value before: "+oldVal) + oObj.setMax(oldVal+20) + newVal = oObj.getMax() + Out.Log("value after: "+newVal) + bOK = bOK AND (oldVal <> newVal) + Test.MethodTested("setMax()", bOK) + Test.MethodTested("getMax()", bOK) + + Test.StartMethod("getFirst()") + Test.StartMethod("setFirst()") + bOK = true + oldVal = oObj.getFirst() + Out.Log("value before: "+oldVal) + oObj.setFirst(oldVal+20) + newVal = oObj.getFirst() + Out.Log("value after: "+newVal) + bOK = bOK AND (oldVal <> newVal) + Test.MethodTested("setFirst()", bOK) + Test.MethodTested("getFirst()", bOK) + + Test.StartMethod("getLast()") + Test.StartMethod("setLast()") + bOK = true + oldVal = oObj.getLast() + Out.Log("value before: "+oldVal) + oObj.setLast(oldVal+20) + newVal = oObj.getLast() + Out.Log("value after: "+newVal) + bOK = bOK AND (oldVal <> newVal) + Test.MethodTested("setLast()", bOK) + Test.MethodTested("getLast()", bOK) + + + Test.StartMethod("isEmpty()") + Test.StartMethod("setEmpty()") + bOK = true + oldVal = oObj.isEmpty() + if ( NOT oldVal) then + oObj.setEmpty() + bOK = oObj.isEmpty() + endif + Test.MethodTested("setEmpty()", bOK) + Test.MethodTested("isEmpty()", bOK) + + Test.StartMethod("isStrictFormat()") + Test.StartMethod("setStrictFormat()") + bOK = true + oldVal = oObj.isStrictFormat() + Out.Log("value before: "+oldVal) + if (oldVal) then + oObj.setStrictFormat(false) + else + oObj.setStrictFormat(true) + endif + newVal = oObj.isStrictFormat() + Out.Log("value after: "+newVal) + bOK = bOK AND (oldVal <> newVal) + Test.MethodTested("setStrictFormat()", bOK) + Test.MethodTested("isStrictFormat()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/awt/XTimeField/script.xlb b/qadevOOo/tests/basic/ifc/awt/XTimeField/script.xlb new file mode 100644 index 000000000000..1f318d574a02 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/XTimeField/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="awt_XTimeField" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="awt_XTimeField"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/awt/XToolkit/awt_XToolkit.xba b/qadevOOo/tests/basic/ifc/awt/XToolkit/awt_XToolkit.xba new file mode 100644 index 000000000000..57afd42d5139 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/XToolkit/awt_XToolkit.xba @@ -0,0 +1,168 @@ +<?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="awt_XToolkit" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.awt.XToolkit +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Test.StartMethod("getDesktopWindow()") + bOK = true + Dim oWindow As Object + oWindow = oObj.getDesktopWindow() + Out.Log("Desktop window is NULL : " & isNULL(oWindow)) + ' Has "OK" status always, because Desktop component + ' currently is not supported as visible. + Test.MethodTested("getDesktopWindow()", bOK) + + Test.StartMethod("getWorkArea()") + bOK = true + Dim oRect As Object + oRect = oObj.getWorkArea() + Out.Log("WorkArea is NULL : " & isNULL(oRect)) + if (NOT isNULL(oRect)) then + Out.Log("Returned rectangle is: (" & oRect.X & ", " & oRect.Y & ", " & oRect.Width & ", " & oRect.Height & ")") + end if + Test.MethodTested("getWorkArea()", bOK) + + Test.StartMethod("createWindow()") + bOK = true + Dim oWndDescr As new com.sun.star.awt.WindowDescriptor + Dim oBounds As new com.sun.star.awt.Rectangle + oWndDescr.Type = com.sun.star.awt.WindowClass.TOP + oWndDescr.WindowServiceName = "" + oWndDescr.ParentIndex = -1 + oBounds.X = 10 : oBounds.Y = 20 + oBounds.Width = 110 : oBounds.Height = 120 + oWndDescr.Bounds = oBounds + with com.sun.star.awt.WindowAttribute + oWndDescr.WindowAttributes = .CLOSEABLE AND .MOVEABLE AND .SIZEABLE AND .BORDER AND .SHOW + end with + + Dim oWnd As Object + oWnd = oObj.createWindow(oWndDescr) + Out.Log("Window is NULL : " & isNULL(oWnd)) + bOK = bOK AND NOT isNULL(oWnd) + if (bOK) then + bOK = bOK AND hasUnoInterfaces(oWnd, "com.sun.star.awt.XWindowPeer") + if (NOT bOK) then Out.Log("Returned object doesn't support XWindowPeer interface.") + end if + Test.MethodTested("createWindow()", bOK) + + Test.StartMethod("createWindows()") + bOK = true + Dim oWndDescrs(1) As Object + Dim oWndDescr1 As new com.sun.star.awt.WindowDescriptor + Dim oBounds1 As new com.sun.star.awt.Rectangle + oWndDescr1.Type = com.sun.star.awt.WindowClass.TOP + oWndDescr1.WindowServiceName = "" + 'oWndDescr1.Parent = 0 + oWndDescr1.ParentIndex = -1 + oBounds1.X = 10 : oBounds1.Y = 20 + oBounds1.Width = 110 : oBounds1.Height = 120 + oWndDescr1.Bounds = oBounds1 + with com.sun.star.awt.WindowAttribute + oWndDescr1.WindowAttributes = .CLOSEABLE AND .MOVEABLE AND .SIZEABLE AND .BORDER AND .SHOW + end with + Dim oWndDescr2 As new com.sun.star.awt.WindowDescriptor + Dim oBounds2 As new com.sun.star.awt.Rectangle + oWndDescr2.Type = com.sun.star.awt.WindowClass.TOP + oWndDescr2.WindowServiceName = "" + 'oWndDescr2.Parent = 0 + oWndDescr2.ParentIndex = -1 + oBounds2.X = 10 : oBounds2.Y = 20 + oBounds2.Width = 110 : oBounds2.Height = 120 + oWndDescr2.Bounds = oBounds2 + with com.sun.star.awt.WindowAttribute + oWndDescr2.WindowAttributes = .CLOSEABLE AND .MOVEABLE AND .SIZEABLE AND .BORDER AND .SHOW + end with + + oWndDescrs(0) = oWndDescr1 + oWndDescrs(1) = oWndDescr2 + + Dim oWindows As Object + + oWindows = oObj.createWindows(oWndDescrs()) + bOK = bOK AND ubound(oWindows) = 1 + bOK = bOK AND hasUnoInterfaces(oWindows(0), "com.sun.star.awt.XWindowPeer") + bOK = bOK AND hasUnoInterfaces(oWindows(1), "com.sun.star.awt.XWindowPeer") + + Test.MethodTested("createWindows()", bOK) + + Test.StartMethod("createScreenCompatibleDevice()") + bOK = true + Dim oDevice As Object + oDevice = oObj.createScreenCompatibleDevice(123, 456) + Out.Log("Device is NULL : " & isNULL(oDevice)) + bOK = bOK AND NOT isNULL(oDevice) + if (bOK) then + bOK = bOK AND hasUnoInterfaces(oDevice, "com.sun.star.awt.XDevice") + if (NOT bOK) then Out.Log("Returned object doesn't support XDevice interface.") + end if + Test.MethodTested("createScreenCompatibleDevice()", bOK) + + Test.StartMethod("createRegion()") + bOK = true + Dim oRegion As Object + oRegion = oObj.createRegion() + Out.Log("Region is NULL : " & isNULL(oRegion)) + bOK = bOK AND NOT isNULL(oRegion) + if (bOK) then + bOK = bOK AND hasUnoInterfaces(oRegion, "com.sun.star.awt.XRegion") + if (NOT bOK) then Out.Log("Returned object doesn't support XRegion interface.") + if (bOK) then + oRect = oRegion.getBounds + Out.Log("Returned region's bounds are: (" & oRect.X & ", " & oRect.Y & ", " & oRect.Width & ", " & oRect.Height & ")") + end if + end if + + Test.MethodTested("createRegion()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/awt/XToolkit/script.xlb b/qadevOOo/tests/basic/ifc/awt/XToolkit/script.xlb new file mode 100644 index 000000000000..24a288f1f84a --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/XToolkit/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="awt_XToolkit" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="awt_XToolkit"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/awt/XTopWindow/awt_XTopWindow.xba b/qadevOOo/tests/basic/ifc/awt/XTopWindow/awt_XTopWindow.xba new file mode 100644 index 000000000000..7e69cee5760b --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/XTopWindow/awt_XTopWindow.xba @@ -0,0 +1,138 @@ +<?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="awt_XTopWindow" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.awt.XTopWindow +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim list1 As Object, list2 As Object + Dim aDoc As Object + + list1 = createUnoListener("L1_", "com.sun.star.awt.XTopWindowListener") + list2 = createUnoListener("L2_", "com.sun.star.awt.XTopWindowListener") + + l1Called = false + l2Called = false + + Test.StartMethod("addTopWindowListener()") + bOK = true + + oObj.addTopWindowListener(list1) + oObj.addTopWindowListener(list2) + + Test.StartMethod("removeTopWindowListener()") + oObj.removeTopWindowListener(list1) + + Out.Log("Creating a doc ...") + aDoc = utils.createDocument("swriter", "Window On Top") + Out.Log("Doc created.") + wait(1000) + + Test.StartMethod("toFront()") + bOK = true + activated = false + deactivated = false + oObj.toFront() + wait(1000) + bOK = bOK AND activated AND NOT deactivated + Test.MethodTested("toFront()", bOK) + + Test.StartMethod("toBack()") + bOK = true + activated = false + deactivated = false + oObj.toBack() + wait(1000) + bOK = bOK AND deactivated AND NOT activated + Test.MethodTested("toBack()", bOK) + + Out.Log("Disposing a doc ...") + aDoc.dispose() + Out.Log("Doc disposed.") + wait(1000) + + bOK = L2Called + Test.MethodTested("addTopWindowListener()", bOK) + bOK = bOK AND NOT L1Called + Test.MethodTested("removeTopWindowListener()", bOK) + + Test.StartMethod("setMenuBar()") + bOK = true + Dim menu As Object + menu = createUnoService("com.sun.star.awt.MenuBar") + menu.insertItem(1, "MenuItem", com.sun.star.awt.MenuItemStyle.CHECKABLE, 1) + oObj.setMenuBar(menu) + Test.MethodTested("setMenuBar()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub + +Dim L1Called As Boolean +Dim L2Called As Boolean + +Dim activated As Boolean +Dim deactivated As Boolean + +Sub L1_windowActivated() + L1Called = true +End Sub +Sub L1_windowDeactivated() + L1Called = true +End Sub + +Sub L2_windowActivated() + L2Called = true + activated = true + Out.Log("Activated ...") +End Sub +Sub L2_windowDeactivated() + L2Called = true + deactivated = true + Out.Log("Deactivated ...") +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/awt/XTopWindow/script.xlb b/qadevOOo/tests/basic/ifc/awt/XTopWindow/script.xlb new file mode 100644 index 000000000000..3d6045b6752d --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/XTopWindow/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="awt_XTopWindow" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="awt_XTopWindow"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/awt/XView/awt_XView.xba b/qadevOOo/tests/basic/ifc/awt/XView/awt_XView.xba new file mode 100644 index 000000000000..18911ee8be17 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/XView/awt_XView.xba @@ -0,0 +1,92 @@ +<?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="awt_XView" 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 + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' Global oGraphics as Object + +'************************************************************************* + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.awt.XView +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim oGetGraphics As Object + Dim vSize As Variant + + Test.StartMethod("setGraphics()") + bOK = true + oObj.setGraphics(oGraphics) + Test.StartMethod("getGraphics()") + oGetGraphics = oObj.getGraphics() + bOK = bOK AND hasUnoInterfaces(oGetGraphics , "com.sun.star.awt.XGraphics") + Test.MethodTested("setGraphics()", bOK) + Test.MethodTested("getGraphics()", bOK) + + Test.StartMethod("getSize()") + vSize = oObj.getSize() + bOK = (vSize.Height <> 0) + Test.MethodTested("getSize()", bOK) + + Test.StartMethod("draw()") + bOk = true + oObj.draw(20,20) + Test.MethodTested("draw()", bOK) + + Test.StartMethod("setZoom()") + bOK = true + oObj.setZoom(2,2) + Test.MethodTested("setZoom()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/awt/XView/script.xlb b/qadevOOo/tests/basic/ifc/awt/XView/script.xlb new file mode 100644 index 000000000000..b65b2ad1e3ee --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/XView/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="awt_XView" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="awt_XView"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/awt/XWindow/awt_XWindow.xba b/qadevOOo/tests/basic/ifc/awt/XWindow/awt_XWindow.xba new file mode 100644 index 000000000000..175ff95d1ef5 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/XWindow/awt_XWindow.xba @@ -0,0 +1,482 @@ +<?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="awt_XWindow" 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 + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + + +'************************************************************************* +' Global oXWindow as Object +' Global oCtrlShape as Variant (could be NULL) + + +Dim bCB1_windowResized As Boolean +Dim bCB2_windowResized As Boolean +Dim bCB1_windowMoved As Boolean +Dim bCB2_windowMoved As Boolean +Dim bCB1_windowHidden As Boolean +Dim bCB2_windowHidden As Boolean +Dim bCB1_windowShown As Boolean +Dim bCB2_windowShown As Boolean +Dim bCB1_disposing As Boolean +Dim bCB2_disposing As Boolean +Dim bCB3_focusGained As Boolean +Dim bCB4_focusGained As Boolean +Dim bCB3_focusLost As Boolean +Dim bCB4_focusLost As Boolean + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.awt.XWindow +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + If isNull(oXWindow) Then + Out.Log("Could not get relation 'oXWindow' !") + End If + Dim oListener1 As Object, oListener2 As Object + Dim oListener3 As Object, oListener4 As Object + Dim oListener5 As Object, oListener6 As Object + Dim oListener7 As Object, oListener8 As Object + Dim oListener9 As Object, oListener10 As Object + Dim oListener11 As Object, oListener12 As Object + Dim size As Variant, pos As Variant + + bCB1_windowResized = false + bCB2_windowResized = false + bCB1_windowMoved = false + bCB2_windowMoved = false + bCB1_windowHidden = false + bCB2_windowHidden = false + bCB1_windowShown = false + bCB2_windowShown = false + bCB1_disposing = false + bCB2_disposing = false + bCB3_focusGained = false + bCB4_focusLost = false + bCB3_focusGained = false + bCB4_focusLost = false + + Out.Log("create two com.sun.star.awt.XWindowListener") + oListener1 = createUNOListener("CB1_", "com.sun.star.awt.XWindowListener") + oListener2 = createUNOListener("CB2_", "com.sun.star.awt.XWindowListener") + Out.Log("create two com.sun.star.awt.XFocusListener") + oListener3 = createUNOListener("CB3_", "com.sun.star.awt.XFocusListener") + oListener4 = createUNOListener("CB4_", "com.sun.star.awt.XFocusListener") + Out.Log("create two com.sun.star.awt.XKeyListener") + oListener5 = createUNOListener("CB5_", "com.sun.star.awt.XKeyListener") + oListener6 = createUNOListener("CB6_", "com.sun.star.awt.XKeyListener") + Out.Log("create two com.sun.star.awt.XMouseListener") + oListener7 = createUNOListener("CB7_", "com.sun.star.awt.XMouseListener") + oListener8 = createUNOListener("CB8_", "com.sun.star.awt.XMouseListener") + Out.Log("create two com.sun.star.awt.XMouseMotionListener") + oListener9 = createUNOListener("CB9_", "com.sun.star.awt.XMouseMotinListener") + oListener10 = createUNOListener("CB10_", "com.sun.star.awt.XMouseMotinListener") + Out.Log("create two com.sun.star.awt.XPaintListener") + oListener11 = createUNOListener("CB11_", "com.sun.star.awt.XPaintListener") + oListener12 = createUNOListener("CB12_", "com.sun.star.awt.XPaintListener") + + Test.StartMethod("setPosSize()") + bOK = true + oObj.setPosSize(250,250,250,250,com.sun.star.awt.PosSize.POSSIZE) + Out.Log("oObj.setPosSize(250,250,250,250,com.sun.star.awt.PosSize.POSSIZE") + Test.StartMethod("getPosSize()") + Dim vRectangle As Variant + vRectangle = oObj.getPosSize() + Out.Log("Returned Values: X=" + vRectangle.X + " Y=" + vRectangle.Y _ + + " WIDTH=" + vRectangle.WIDTH + " HEIGTH=" + vRectangle.HEIGHT + bOK = bOK AND vRectangle.X = 250 + bOK = bOK AND vRectangle.Y = 250 + bOK = bOK AND vRectangle.Width = 250 + bOK = bOK AND vRectangle.Height = 250 + Test.MethodTested("setPosSize()", bOK) + Test.MethodTested("getPosSize()", bOK) + + Test.StartMethod("setVisible()") + bOK = true + oObj.setVisible(false) + oObj.setVisible(true) + Test.MethodTested("setVisible()", bOK) + + Test.StartMethod("setEnable()") + bOK = true + oObj.setEnable(false) + oObj.setEnable(true) + Test.MethodTested("setEnable()", bOK) + + Test.StartMethod("setFocus()") + bOK = true + oObj.setFocus() + oXWindow.setFocus() + oObj.setFocus() + Test.MethodTested("setFocus()", bOK) + + Test.StartMethod("addWindowListener()") + bOK = true + oObj.addWindowListener(oListener1) + oObj.addWindowListener(oListener2) + oObj.setVisible(false) + oObj.setVisible(true) + if NOT isNull(oCtrlShape) then + size = oCtrlShape.Size + size.Width = size.Width + 100 + size.Height = size.Height + 100 + oCtrlShape.Size = size + + pos = oCtrlShape.Position + pos.X = pos.X + 100 + pos.Y = pos.Y + 100 + oCtrlShape.Position = pos + else + Out.Log("oObj.setPosSize(300,300,300,300,com.sun.star.awt.PosSize.POSSIZE)") + oObj.setPosSize(300,300,300,300,com.sun.star.awt.PosSize.POSSIZE) + end if + wait(1000) + bOK = bOK AND bCB1_windowResized AND bCB2_windowResized AND bCB1_windowMoved AND _ + bCB2_windowMoved AND bCB1_windowHidden AND bCB2_windowHidden AND _ + bCB1_windowShown AND bCB2_windowShown AND NOT bCB1_disposing AND NOT _ + bCB2_disposing + Test.MethodTested("addWindowListener()", bOK) + + Test.StartMethod("removeWindowListener()") + bOK = true + bCB1_windowResized = false + bCB2_windowResized = false + bCB1_windowMoved = false + bCB2_windowMoved = false + bCB1_windowHidden = false + bCB2_windowHidden = false + bCB1_windowShown = false + bCB2_windowShown = false + bCB1_disposing = false + bCB2_disposing = false + oObj.removeWindowListener(oListener2) + oObj.setVisible(false) + oObj.setVisible(true) + oObj.setVisible(false) + oObj.setVisible(true) + if NOT isNull(oCtrlShape) then + size = oCtrlShape.Size + size.Width = size.Width + 100 + size.Height = size.Height + 100 + oCtrlShape.Size = size + + pos = oCtrlShape.Position + pos.X = pos.X + 100 + pos.Y = pos.Y + 100 + oCtrlShape.Position = pos + else + Out.Log("oObj.setPosSize(300,300,300,300,com.sun.star.awt.PosSize.POSSIZE)") + oObj.setPosSize(301,301,301,301,com.sun.star.awt.PosSize.POSSIZE) + end if + wait(200) + bOK = bOK AND bCB1_windowResized AND NOT bCB2_windowResized AND bCB1_windowMoved AND NOT _ + bCB2_windowMoved AND bCB1_windowHidden AND NOT bCB2_windowHidden AND _ + bCB1_windowShown AND NOT bCB2_windowShown AND NOT bCB1_disposing AND NOT _ + bCB2_disposing + oObj.removeWindowListener(oListener1) + Test.MethodTested("removeWindowListener()", bOK) + + Test.StartMethod("addFocusListener()") + bOK = true + oObj.addFocusListener(oListener3) + oObj.addFocusListener(oListener4) + oObj.setFocus() + wait(200) + oXWindow.setFocus() + wait(200) + oObj.setFocus() + wait(200) + bOK = bOK AND bCB3_focusGained AND bCB4_focusLost AND bCB3_focusGained AND bCB4_focusLost + Test.MethodTested("addFocusListener()", bOK) + + Test.StartMethod("removeFocusListener()") + bOK = true + bCB3_focusGained = false + bCB4_focusLost = false + bCB3_focusGained = false + bCB4_focusLost = false + oObj.removeFocusListener(oListener4) + oObj.setFocus() + wait(200) + oXWindow.setFocus() + wait(200) + oObj.setFocus() + wait(200) + bOK = bOK AND bCB3_focusGained AND NOT bCB4_focusLost AND bCB3_focusGained AND NOT bCB4_focusLost + oObj.removeFocusListener(oListener3) + Test.MethodTested("removeFocusListener()", bOK) + +'*************************************************************************************** +'* LISTENERS which needs interactions * +'*************************************************************************************** +'* +'* The following listener tests need interactions. That means i.e. a +'* com.sun.star.awt.XKeyListener needs action from the keyboard. This is not possible in +'* the automatic API-Testing. To test the listener you can set a breakpoint at the +'* specific function call. Then do interaction which should call the listener. It must be +'* pop up a message box. +'* +'*************************************************************************************** + + Test.StartMethod("addKeyListener()") + bOK = true + Out.Log("Not realy tested! Please see comments in Basic-Source.") + oObj.addKeyListener(oListener5) + oObj.addKeyListener(oListener6) + bOK = bOK AND true + Test.MethodTested("addKeyListener()", bOK) + + Test.StartMethod("removeKeyListener()") + bOK = true + Out.Log("Not realy tested! Please see comments in Basic-Source.") + oObj.removeKeyListener(oListener5) + bOK = bOK AND true + oObj.removeKeyListener(oListener6) + Test.MethodTested("removeKeyListener()", bOK) + + Test.StartMethod("addMouseListener()") + bOK = true + Out.Log("Not realy tested! Please see comments in Basic-Source.") + oObj.addMouseListener(oListener7) + oObj.addMouseListener(oListener8) + bOK = bOK AND true + Test.MethodTested("addMouseListener()", bOK) + + Test.StartMethod("removeMouseListener()") + bOK = true + Out.Log("Not realy tested! Please see comments in Basic-Source.") + oObj.removeMouseListener(oListener7) + bOK = bOK AND true + oObj.removeMouseListener(oListener8) + Test.MethodTested("removeMouseListener()", bOK) + + Test.StartMethod("addMouseMotionListener()") + bOK = true + Out.Log("Not realy tested! Please see comments in Basic-Source.") + oObj.addMouseMotionListener(oListener9) + oObj.addMouseMotionListener(oListener10) + bOK = bOK AND true + Test.MethodTested("addMouseMotionListener()", bOK) + + Test.StartMethod("removeMouseMotionListener()") + bOK = true + Out.Log("Not realy tested! Please see comments in Basic-Source.") + oObj.removeMouseMotionListener(oListener9) + bOK = bOK AND true + oObj.removeMouseMotionListener(oListener10) + Test.MethodTested("removeMouseMotionListener()", bOK) + + Test.StartMethod("addPaintListener()") + bOK = true + Out.Log("Not realy tested! Please see comments in Basic-Source.") + oObj.addPaintListener(oListener11) + oObj.addPaintListener(oListener12) + bOK = bOK AND true + Test.MethodTested("addPaintListener()", bOK) + + Test.StartMethod("removePaintListener()") + bOK = true + Out.Log("Not realy tested! Please see comments in Basic-Source.") + oObj.removePaintListener(oListener11) + bOK = bOK AND true + oObj.removePaintListener(oListener12) + Test.MethodTested("removePaintListener()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub + +' Listener call backs for com.sun.star.awt.XWindowListener +Sub CB1_windowResized + Out.Log("CallBack for Listener1 windowResized was called.") + bCB1_windowResized = true +End Sub +Sub CB2_windowResized + Out.Log("CallBack for Listener2 windowResized was called.") + bCB2_windowResized = true +End Sub +Sub CB1_windowMoved + Out.Log("CallBack for Listener1 windowMoved was called.") + bCB1_windowMoved = true +End Sub +Sub CB2_windowMoved + Out.Log("CallBack for Listener2 windowMoved was called.") + bCB2_windowMoved = true +End Sub +Sub CB1_windowHidden + Out.Log("CallBack for Listener1 windowHidden was called.") + bCB1_windowHidden = true +End Sub +Sub CB2_windowHidden + Out.Log("CallBack for Listener2 windowHidden was called.") + bCB2_windowHidden = true +End Sub +Sub CB1_windowShown + Out.Log("CallBack for Listener1 windowShown was called.") + bCB1_windowShown = true +End Sub +Sub CB2_windowShown + Out.Log("CallBack for Listener2 windowShown was called.") + bCB2_windowShown = true +End Sub +Sub CB1_disposing + Out.Log("CallBack for Listener1 disposing was called") + bCB1_disposing = true +End Sub +Sub CB2_disposing + Out.Log("CallBack for Listener2 disposing was called") + bCB2_disposing = true +End Sub + +' Listener call backs for com.sun.star.awt.XFocusListener +Sub CB3_focusGained + Out.Log("CallBack for Listener3 'focusGained' was called") + bCB3_focusGained = true +End Sub +Sub CB4_focusGained + Out.Log("CallBack for Listener4 'focusGained' was called") + bCB4_focusGained = true +End Sub +Sub CB3_focusLost + Out.Log("CallBack for Listener3 'focusLost' was called") + bCB3_focusLost = true +End Sub +Sub CB4_focusLost + Out.Log("CallBack for Listener4 'focusLost' was called") + bCB4_focusLost = true +End Sub +Sub CB3_disposing +End Sub +Sub CB4_disposing +End Sub + +' Listener call backs for com.sun.star.awt.XKeyListener +' They will never be called beause of no interaction in API-Testing +Sub CB5_keyPressed + MsgBox("CallBack for Listener5 'keyPressed' was called") +End Sub +Sub CB6_keyPressed + MsgBox("CallBack for Listener6 'keyPressed' was called") +End Sub +Sub CB5_keyReleased + MsgBox("CallBack for Listener5 'keyReleased' was called") +End Sub +Sub CB6_keyReleased + MsgBox("CallBack for Listener6 'keyReleased' was called") +End Sub +Sub CB5_disposing +End Sub +Sub CB6_disposing +End Sub + + +' Listener call backs for com.sun.star.awt.XMouseListener +' They will never be called beause of no interaction in API-Testing +Sub CB7_mousePressed + MsgBox("CallBack for Listener7 'mousePressed' was called") +End Sub +Sub CB8_mousePressed + MsgBox("CallBack for Listener8 'mousePressed' was called") +End Sub +Sub CB7_mouseReleased + MsgBox("CallBack for Listener8 'mouseReleased' was called") +End Sub +Sub CB8_mouseReleased + MsgBox("CallBack for Listener8 'mouseReleased' was called") +End Sub +Sub CB7_mouseEntered + MsgBox("CallBack for Listener7 'mouseEntered' was called") +End Sub +Sub CB8_mouseEntered + MsgBox("CallBack for Listener8 'mouseEntered' was called") +End Sub +Sub CB7_mouseExited + MsgBox("CallBack for Listener7 'mouseExited' was called") +End Sub +Sub CB8_mouseExited + MsgBox("CallBack for Listener8 'mouseExited' was called") +End Sub +Sub CB7_disposing +End Sub +Sub CB8_disposing +End Sub + + +' Listener call backs for com.sun.star.awt.XMouseMotionListener +' They will never be called beause of no interaction in API-Testing +Sub CB9_mouseDragged + MsgBox("CallBack for Listener9 'mouseDragged' was called") +End Sub +Sub CB10_mouseDragged + MsgBox("CallBack for Listener10 'mouseDragged' was called") +End Sub +Sub CB9_mouseMoved + MsgBox("CallBack for Listener9 'mouseMoved' was called") +End Sub +Sub CB10_mouseMoved + MsgBox("CallBack for Listener10 'mouseMoved' was called") +End Sub +Sub CB9_disposing +End Sub +Sub CB10_disposing +End Sub + + +' Listener call backs for com.sun.star.awt.XMouseMotionListener +' They will never be called beause of no interaction in API-Testing +Sub CB11_windowPaint + MsgBox("CallBack for Listener11 'windowPaint' was called") +End Sub +Sub CB12_windowPaint + MsgBox("CallBack for Listener12 'windowPaint' was called") +End Sub +Sub CB11_disposing +End Sub +Sub CB12_disposing +End Sub + +</script:module> diff --git a/qadevOOo/tests/basic/ifc/awt/XWindow/script.xlb b/qadevOOo/tests/basic/ifc/awt/XWindow/script.xlb new file mode 100644 index 000000000000..4ae24a18c765 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/awt/XWindow/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="awt_XWindow" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="awt_XWindow"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/beans/XExactName/beans_XExactName.xba b/qadevOOo/tests/basic/ifc/beans/XExactName/beans_XExactName.xba new file mode 100644 index 000000000000..d22b00f4efaa --- /dev/null +++ b/qadevOOo/tests/basic/ifc/beans/XExactName/beans_XExactName.xba @@ -0,0 +1,85 @@ +<?xml version="1.0" encoding="UTF-8"?> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="XExactName" 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. +' +'************************************************************************* +'************************************************************************* + +'************************************************************************* +' This Interface/Service test depends on the following object relations +' variables, which must be specified in the object creation: + +' ObjectRelation: oObjRelation(0).Name = "expectedName" +' ObjectRelation: oObjRelation(0).Value = "MyExpectedName" + +'************************************************************************* + +' Be sure that all variables are dimensioned: +option explicit + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.beans.XExactName +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Dim cExpectedName as Variant + cExpectedName = utils.getObjectRelation("expectedName") + if isNull(cExpectedName) then + out.log("Object relation 'expectedName' is missing") + end if + + Test.StartMethod("getExactName()") + + out.log("getting exact name for " + cExpectedName) + bOK = TRUE + Dim cResult as String + cResult = oObj.getExactName(cExpectedName) + bOK = bOK AND (cResult = cExpectedName) + + out.log("getting exact name for " + LCase(cExpectedName)) + bOK = TRUE + cResult = oObj.getExactName(LCase(cExpectedName)) + bOK = bOK AND (cResult = cExpectedName) + + out.log("getting exact name for " + UCase(cExpectedName)) + bOK = TRUE + cResult = oObj.getExactName(UCase(cExpectedName)) + bOK = bOK AND (cResult = cExpectedName) + + Test.MethodTested("getExactName()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/beans/XExactName/script.xlb b/qadevOOo/tests/basic/ifc/beans/XExactName/script.xlb new file mode 100644 index 000000000000..bd759a0334b8 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/beans/XExactName/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="beans_XExactName" library:readonly="false" library:passwordprotected="false"> + <library:element library:name="beans_XExactName"/> + </library:library> diff --git a/qadevOOo/tests/basic/ifc/beans/XFastPropertySet/beans_XFastPropertySet.xba b/qadevOOo/tests/basic/ifc/beans/XFastPropertySet/beans_XFastPropertySet.xba new file mode 100644 index 000000000000..8961bec8d24c --- /dev/null +++ b/qadevOOo/tests/basic/ifc/beans/XFastPropertySet/beans_XFastPropertySet.xba @@ -0,0 +1,122 @@ +<?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="beans_XFastPropertySet" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.beans.XFastPropertySet +'************************************************************************* +On Error Goto ErrHndl + + Dim bOK As Boolean + Dim oPropertySetInfo As Object + Dim oProperties As Variant + Dim nIndex As Long, nHanlde As Long + Dim nCount As Integer + Dim vMemVal As Variant, vNewVal As Variant + Dim bBoolean As Boolean + Dim nInteger As Integer + Dim nLong As Long + Dim nSingle As Single + Dim nDouble As Double + + oPropertySetInfo = oObj.GetPropertySetInfo() + oProperties = oPropertySetInfo.Properties + nCount = uBound(oProperties) + + nIndex = 0 + nMem = nIndex + 'find at first a Boolean Value, if not available a String Property + While (NOT bFound) AND (nCount >= nIndex) + If VarType(oObj.getFastPropertyValue(oProperties(nIndex).Handle)) = 11 Then ' it is a Boolean Proerty + bFound = true + nMem = nIndex + else + If VarType(oObj.getFastPropertyValue(oProperties(nIndex).Handle)) = 8 Then ' it is a String Property + nMem = nIndex + end if + end if + nIndex = nIndex + 1 + Wend + nIndex = nMem + Out.Log("Property selected: '" + oProperties(nIndex).Name + "'") + + 'memory the old Value + vMemVal = oObj.getFastPropertyValue(oProperties(nIndex).Handle) + ' change the Value + select case VarType(oObj.getFastPropertyValue(oProperties(nIndex).Handle) + case 11 'boolean + bBoolean = NOT oObj.getFastPropertyValue(oProperties(nIndex).Handle) + vNewVal = bBoolean + case 2 'integer + nInteger = oObj.getFastPropertyValue(oProperties(nIndex).Handle) + 1 + vNewVal = nInteger + case 3 'long + nLong = oObj.getFastPropertyValue(oProperties(nIndex).Handle) + 1 + vNewVal = nLong + case 4 'single + nSingle = oObj.getFastPropertyValue(oProperties(nIndex).Handle) + 1 + vNewVal = nSingle + case 5 'double + nDouble = oObj.getFastPropertyValue(oProperties(nIndex).Handle) + 1 + vNewVal = nDouble + case 8 'string + vNewVal = oObj.getPropertyValue(oProperties(nIndex).Name) + cIfcShortName + end select + + nHandle = oProperties(nIndex).Handle + + Test.StartMethod("getFastPropertyValue()") + bOK = true + bOK = bOK AND (vMemVal = oObj.getFastPropertyValue(nHandle)) + Test.MethodTested("getFastPropertyValue()", bOK) + + Test.StartMethod("setFastPropertyValue()") + bOK = true + oObj.setFastPropertyValue(nHandle, vNewVal) + bOK = bOK AND (vMemVal <> oObj.getFastPropertyValue(nHandle)) + Test.MethodTested("setFastPropertyValue()", bOK) + + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/beans/XFastPropertySet/script.xlb b/qadevOOo/tests/basic/ifc/beans/XFastPropertySet/script.xlb new file mode 100644 index 000000000000..3f8c3c6736e5 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/beans/XFastPropertySet/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="beans_XFastPropertySet" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="beans_XFastPropertySet"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/beans/XIntrospection/beans_XIntrospection.xba b/qadevOOo/tests/basic/ifc/beans/XIntrospection/beans_XIntrospection.xba new file mode 100644 index 000000000000..40209b24e54d --- /dev/null +++ b/qadevOOo/tests/basic/ifc/beans/XIntrospection/beans_XIntrospection.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="beans_XIntrospection" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.beans.XIntrospection +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim xInspAccess As Object + + + Test.StartMethod("inspect()") + bOK = true + xInspAccess = oObj.inspect(oObj) + bOK = bOK AND hasUnoInterfaces(xInspAccess, "com.sun.star.beans.XIntrospectionAccess") + Test.MethodTested("inspect()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/beans/XIntrospection/script.xlb b/qadevOOo/tests/basic/ifc/beans/XIntrospection/script.xlb new file mode 100644 index 000000000000..69ffa481df6d --- /dev/null +++ b/qadevOOo/tests/basic/ifc/beans/XIntrospection/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="beans_XIntrospection" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="beans_XIntrospection"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/beans/XMultiPropertySet/beans_XMultiPropertySet.xba b/qadevOOo/tests/basic/ifc/beans/XMultiPropertySet/beans_XMultiPropertySet.xba new file mode 100644 index 000000000000..7ad82a14a229 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/beans/XMultiPropertySet/beans_XMultiPropertySet.xba @@ -0,0 +1,261 @@ +<?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="beans_XMultiPropertySet" 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 + + +Dim nCB1Val As Integer, nCB2Val As Integer + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.beans.XMultiPropertySet +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim oPropertySetInfo As Object + Dim oProperties As Variant + Dim aProp(0 to 1) As new com.sun.star.beans.PropertyValue + Dim cType As String + Dim oListener1 As Object, oListener2 As Object + Dim n As Integer, nMem As Integer, nIndex As Integer + Dim m As Integer + Dim bFound As Boolean + Dim nCount As Integer + Dim bBoolean As Boolean + Dim nInteger As Integer + Dim nLong As Long + Dim nSingle As Single + Dim nDouble As Double + Dim vMemVal As Variant + Dim nCB1ValMem As Integer + Dim nCB2ValMem As Integer + + bOK = true + bFound = false + nCB1Val = 0 + nCB2Val = 0 + m = 0 + oPropertySetInfo = oObj.GetPropertySetInfo + oProperties = oPropertySetInfo.Properties + nCount = uBound(oProperties) + Out.Log("The Object has " + nCount + " properties" + + Out.Log("Create linsteners...") + oListener1 = createUNOListener("CB1_","com.sun.star.beans.XPropertiesChangeListener") + oListener2 = createUNOListener("CB2_","com.sun.star.beans.XPropertiesChangeListener") + Out.Log("oListener1 and oListener2 created" + + 'create sequences of Propertie-Names and Values + 'fist get the amount of valid properties + for n = 0 to (nCount) + 'look for readonly-properties + If (oProperties(n).Attributes AND com.sun.star.beans.PropertyAttribute.READONLY) = 0 Then + 'look for MAYBEVOID-Properties + If (oProperties(n).Attributes AND com.sun.star.beans.PropertyAttribute.MAYBEVOID) = 0 Then + 'is the Property testable + m = m + 1 + End If + End If + next n + + Out.Log("Amount of testable properites (without readonly and MAYBEVOID) is " + m) + + 'now store the names in sProperites + Dim searchProperties(0 to m-1) As String + m = 0 + for n = 0 to (nCount) + 'kick off readonly-properties + If (oProperties(n).Attributes AND com.sun.star.beans.PropertyAttribute.READONLY) = 0 Then + 'kick off MYBEVOID-Properties + If (oProperties(n).Attributes AND com.sun.star.beans.PropertyAttribute.MAYBEVOID) = 0 Then + searchProperties(m) = oProperties(n).Name + Out.Log("" + m + " " + searchProperties(m) + " " + oObj.getPropertySetInfo.getPropertyByName(searchProperties(m)).Type.Name + " " + n) + Dim pVal As Variant + + pVal = oObj.getPropertyValue(searchProperties(m)) + oObj.setPropertyValues(Array(searchProperties(m)), Array(pVal)) + m = m + 1 + End If + End If + next n + nCount = m - 1 + + Dim sProperties(0 to nCount) As String + Dim vValues(0 to nCount) As Variant + For n = 0 to nCount + sProperties(n) = searchProperties(n) + next n + + vValues() = oObj.getPropertyValues(sProperties()) + + 'add ChangeListener + oObj.addPropertiesChangeListener(sProperties(),oListener1) + oObj.addPropertiesChangeListener(sProperties(),oListener2) + Out.Log("oListener1 and oListener2 added to object") + + nIndex = 0 + nMem = nIndex + 'find at first a Boolean Value, if not available a String Property + While (NOT bFound) AND ((nCount >= nIndex)) + 'get the property-type + cType = oObj.getPropertySetInfo.getPropertyByName(sProperties(nIndex)).Type.Name + If cType = "boolean" Then ' it is a Boolean Proerty + bFound = true + nMem = nIndex + else + If cType = "string" Then ' it is a String Property + nMem = nIndex + end if + end if + nIndex = nIndex + 1 + Wend + + nIndex = nIndex - 1 + Out.Log("Property to change is: """ + sProperties(nIndex) + """ Type: """ + oObj.getPropertySetInfo.getPropertyByName(sProperties(nIndex)).Type.Name + """") + nIndex = nMem + + 'memory the old Value + vMemVal = vValues(nIndex) + + 'change a value of a property, hopefully a boolean or string property + select case VarType(vValues(nIndex) + case 11 'boolean + bBoolean = NOT vValues(nIndex) + vValues(nIndex) = bBoolean + case 2 'integer + nInteger = vValues(nIndex) + 1 + vValues(nIndex) = nInteger + case 3 'long + nLong = vValues(nIndex) + 1 + vValues(nIndex) = nLong + case 4 'single + nSingle = vValues(nIndex) + 1 + vValues(nIndex) = nSingle + case 5 'double + nDouble = vValues(nIndex) + 1 + vValues(nIndex) = nDouble + case 8 'string + vValues(nIndex) = vValues(nIndex) + cIfcShortName + end select + + Test.StartMethod("getPropertySetInfo()") + bOK = bOK AND (uBound(oProperties) > 0) + Test.MethodTested("getPropertySetInfo()", bOK) + + Test.StartMethod("getPropertyValues()") + bOK = bOK AND (uBound(vValues()) > 0) + Test.MethodTested("getPropertyValues()", bOK) + + Test.StartMethod("setPropertyValues()") + oObj.setPropertyValues(sProperties(), vValues()) + vValues() = oObj.getPropertyValues(sProperties()) + bOK = bOK AND (vValues(nIndex) <> vMemVal) + Test.MethodTested("setPropertyValues()", bOK) + + Test.StartMethod("addPropertiesChangeListener()") + bOK = (nCB1Val >= 1) AND (nCB2Val >= 1) + nCB1ValMem = nCB1Val + nCB2ValMem = nCb2Val + Test.MethodTested("addPropertiesChangeListener()", bOK) + + 'fire !!! + Out.Log("Try to fire property change event...") + oObj.firePropertiesChangeEvent(sProperties(),oListener1) + oObj.firePropertiesChangeEvent(sProperties(),oListener2) + + Test.StartMethod("firePropertiesChangeEvent()") + bOK = (nCB1Val >= nCB1ValMem) AND (nCB2Val >= nCB2ValMem) + Test.MethodTested("firePropertiesChangeEvent()", bOK) + nCB1ValMem = nCB1Val + nCB2ValMem = nCb2Val + + + 'remove one Listener and fire + Test.StartMethod("removePropertiesChangeListener()") + oObj.removePropertiesChangeListener(oListener1) + Out.Log("oListener1 removed") + select case VarType(vValues(nIndex) + case 11 'boolean + bBoolean = NOT vValues(nIndex) + vValues(nIndex) = bBoolean + case 2 'integer + nInteger = vValues(nIndex) + 1 + vValues(nIndex) = nInteger + case 3 'long + nLong = vValues(nIndex) + 1 + vValues(nIndex) = nLong + case 4 'single + nSingle = vValues(nIndex) + 1 + vValues(nIndex) = nSingle + case 5 'double + nDouble = vValues(nIndex) + 1 + vValues(nIndex) = nDouble + case 8 'string + vValues(nIndex) = vValues(nIndex) + cIfcShortName + end select + + Out.Log("The property '" + sProperties(nIndex) + "' was changed") + + oObj.setPropertyValues(sProperties(), vValues()) + + bOK = (nCB1Val = nCB1ValMem) AND (nCB2Val >= nCB2ValMem) + Test.MethodTested("removePropertiesChangeListener()", bOK) + + 'remove the last Listener + oObj.removePropertiesChangeListener(oListener2) + Out.Log("oListener2 removed") + + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +'callback routine called firePropertiesChangeEvent +Sub CB1_propertiesChange + Out.Log("CallBack for Listener 1 was called.") + nCB1Val = nCB1Val + 1 +end Sub + +Sub CB2_propertiesChange + Out.Log("CallBack for Listener 2 was called.") + nCB2Val = nCB2Val + 1 +end Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/beans/XMultiPropertySet/script.xlb b/qadevOOo/tests/basic/ifc/beans/XMultiPropertySet/script.xlb new file mode 100644 index 000000000000..55637429dd36 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/beans/XMultiPropertySet/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="beans_XMultiPropertySet" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="beans_XMultiPropertySet"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/beans/XMultiPropertyStates/beans_XMultiPropertyStates.xba b/qadevOOo/tests/basic/ifc/beans/XMultiPropertyStates/beans_XMultiPropertyStates.xba new file mode 100644 index 000000000000..6858ab51a28f --- /dev/null +++ b/qadevOOo/tests/basic/ifc/beans/XMultiPropertyStates/beans_XMultiPropertyStates.xba @@ -0,0 +1,183 @@ +<?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="beans_XMultiPropertyStates" 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 + + +Function getPropNames(xPropSet As Object) As Variant + Dim props As Variant + Dim propNames As Variant + Dim i As Integer, propCount As Integer + + props = xPropSet.getPropertySetInfo().getProperties() + propCount = 0 + for i = 0 to ubound (props) + if (props(i).Attributes AND com.sun.star.beans.PropertyAttribute.READONLY) = 0 _ + then propCount = propCount + 1 + next i + + propNames = DimArray(propCount - 1) + aProps = DimArray(propCount - 1) + + propCount = 0 + for i = 0 to ubound(props) + if (props(i).Attributes AND com.sun.star.beans.PropertyAttribute.READONLY) = 0 then + propNames(propCount) = props(i).Name + aProps(propCount) = props(i) + propCount = propCount + 1 + endif + next i + + getPropNames = propNames +End Function + +Dim aProps As Variant + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.beans.XMultiPropertyStates +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Dim aPropNames As Variant + Dim aDefaults As Variant + Dim aStates As Variant + + if NOT hasUnoInterfaces(oObj, "com.sun.star.beans.XPropertySet") then + Out.Log("The compoent doesn't support XPropertySet this test must be reviewed !!!") + exit sub + end if + + bOK = true + aPropNames = getPropNames(oObj) + + if NOT utils.isSorted(aPropNames) then + Out.Log("Property names are not sorted : sorting ...") + utils.bubbleSort(aPropNames, false, aProps) + end if + + Out.Log("Totally " + (ubound(aPropNames) + 1) + " properties encountered.") + + Test.StartMethod("getPropertyDefaults()") + + aDefaults = oObj.getPropertyDefaults(aPropNames) + Out.Log("Number of default values: " + (ubound(aDefaults) + 1)) + bOK = ubound(aDefaults) = ubound(aPropNames) + + Test.MethodTested("getPropertyDefaults()", bOK) + + + Test.StartMethod("getPropertyStates()") + bOK = true + + aStates = oObj.getPropertyStates(aPropNames) + Out.Log("Number of states: " + (ubound(aStates) + 1)) + bOK = ubound(aStates) = ubound(aPropNames) + + Test.MethodTested("getPropertyStates()", bOK) + + Test.StartMethod("setPropertiesToDefault()") + bOK = true + + Dim propName As String + Dim propIdx As Integer + Dim mayBeDef As Boolean + Dim i As Integer + propName = aPropNames(0) + propIdx = 0 + mayBeDef = false + + ' searching for property which currently don't have default value and preferable has MAYBEDEFAULT attr + ' if no such properties are found then the first one is selected + for i = 0 to ubound(aPropNames) + if NOT mayBeDef AND aStates(i) <> com.sun.star.beans.PropertyState.DEFAULT_VALUE then + propName = aPropNames(i) + propIdx = i + if (aProps(i).Attributes AND com.sun.star.beans.PropertyAttribute.MAYBEDEFAULT) > 0 then + Out.Log("Property " + propName + " 'may be default' and doesn't have default value") + mayBeDef = true + end if + end if + next i + Out.Log("The property " + propName + " selected") + + oObj.setPropertiesToDefault(Array(propName)) + + aStates = oObj.getPropertyStates(aPropNames) + if aStates(propIdx) <> com.sun.star.beans.PropertyState.DEFAULT_VALUE then + Out.Log("The property didn't change its state to default ...") + if mayBeDef then + Out.Log(" ... and it may be default - FAILED") + bOK = false + else + Out.Log(" ... but it may not be default - OK") + end if + end if + + Test.MethodTested("setPropertiesToDefault()", bOK) + + Test.StartMethod("setAllPropertiesToDefault()") + bOK = true + + oObj.setAllPropertiesToDefault() + + Out.Log("Checking that all properties are now in DEFAULT state excepting may be those which 'cann't be default'") + aStates = oObj.getPropertyStates(aPropNames) + for i = 0 to ubound(aStates) + if aStates(i) <> com.sun.star.beans.PropertyState.DEFAULT_VALUE then + Out.Log("The property " + aPropNames(i) + " didn't change its state to default ...") + if (aProps(i).Attributes AND com.sun.star.beans.PropertyAttribute.MAYBEDEFAULT) > 0 then + Out.Log(" ... and it has MAYBEDEFAULT attribute - FAILED") + bOK = false + else + Out.Log(" ... but it has no MAYBEDEFAULT attribute - OK") + end if + end if + next i + + Test.MethodTested("setAllPropertiesToDefault()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/beans/XMultiPropertyStates/script.xlb b/qadevOOo/tests/basic/ifc/beans/XMultiPropertyStates/script.xlb new file mode 100644 index 000000000000..283aa20cf01e --- /dev/null +++ b/qadevOOo/tests/basic/ifc/beans/XMultiPropertyStates/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="beans_XMultiPropertyStates" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="beans_XMultiPropertyStates"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/beans/XProperty/beans_XProperty.xba b/qadevOOo/tests/basic/ifc/beans/XProperty/beans_XProperty.xba new file mode 100644 index 000000000000..b6c372df2ea3 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/beans/XProperty/beans_XProperty.xba @@ -0,0 +1,58 @@ +<?xml version="1.0" encoding="UTF-8"?> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="XProperty" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.beans.XProperty +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Test.StartMethod("getAsProperty()") + bOK = TRUE + Dim vProperty as new com.sun.star.beans.Property + vProperty = oObj.getAsProperty() + bOK = bOK and not isNull(vProperty) + Test.MethodTested("getAsProperty()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/beans/XProperty/script.xlb b/qadevOOo/tests/basic/ifc/beans/XProperty/script.xlb new file mode 100644 index 000000000000..733318087ab3 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/beans/XProperty/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="beans_XProperty" library:readonly="false" library:passwordprotected="false"> + <library:element library:name="beans_XProperty"/> + </library:library> diff --git a/qadevOOo/tests/basic/ifc/beans/XPropertySet/beans_XPropertySet.xba b/qadevOOo/tests/basic/ifc/beans/XPropertySet/beans_XPropertySet.xba new file mode 100644 index 000000000000..ace2dc6775f3 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/beans/XPropertySet/beans_XPropertySet.xba @@ -0,0 +1,357 @@ +<?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="beans_XPropertySet" 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. +' +'************************************************************************* +'************************************************************************* + + + +'************************************************************************* +'Change-Listener needs bound-Properties +'Veto-Listener needs constrained-Propperties + +'************************************************************************* + + + + +Const BOUND = 2 +Const CONSTRAINED = 4 +Const MAYBENULL = 8 +Const READONLY = 16 + +Dim aBoundProps() As String +Dim aConstrainedProps() As String +Dim aNormalProps() As String +Dim aReadOnlyProps() As String + +Dim nBoundCount As Integer +Dim nConstrainedCount As Integer +Dim nNormalCount As Integer +Dim nReadOnlyCount As Integer + +Dim aAllProps As Object + +Dim vetoCalled1 As Boolean +Dim propCalled1 As Boolean +Dim vetoCalled2 As Boolean +Dim propCalled2 As Boolean + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.beans.XPropertySet +'************************************************************************* +On Error Goto ErrHndl +If (bErrHndl) Then On Error Goto ErrHndl + Dim oPCListener1 As Object + Dim oVListener1 As Object + Dim oPCListener2 As Object + Dim oVListener2 As Object + Dim bOK As boolean + + Test.StartMethod("getPropertySetInfo()") + bOK = true + bOK = NOT isNULL(oObj.PropertySetInfo) + Test.MethodTested("getPropertySetInfo()", bOK) + + Out.Log("Get properties()") + bOK = GetProps() + + Out.Log("Create Listeners") + oPCListener1 = createUNOListener("CB1_","com.sun.star.beans.XPropertyChangeListener") + oVListener1 = createUNOListener("CB1_","com.sun.star.beans.XVetoableChangeListener") + oPCListener2 = createUNOListener("CB2_","com.sun.star.beans.XPropertyChangeListener") + oVListener2 = createUNOListener("CB2_","com.sun.star.beans.XVetoableChangeListener") + + Test.StartMethod("getPropertyValue()") + bOK = true + bOK = bOK AND test_getPropertyValue() + Test.MethodTested("getPropertyValue()", bOK) + + Test.StartMethod("setPropertyValue()") + bOK = true + Dim bReadOnlyOK As Boolean + Dim bNormalOK As Boolean + bReadOnlyOK = false + bNormalOK = false + Dim bCVOK As boolean + + if (nReadOnlyCount = 0) then + bReadOnlyOK = true + Out.Log("No ReadOnly properties!") + else + for i = 0 to nReadOnlyCount - 1 + Out.Log("READONLY: '" & aReadOnlyProps(i) & "'") + if (aReadOnlyProps(i) = "Preview") then + bCVOK = true + else + bCVOK = PropertyTester.TestPropertyWithoutParams(aReadOnlyProps(i), true) + end if + Out.Log(bCVOK) + Out.Log("") + bReadOnlyOK = bReadOnlyOK OR bCVOK + next i + end if + + bOK = bOK AND bReadOnlyOK + + if (nNormalCount = 0) then + bNormalOK = true + Out.Log("No Normal properties!") + else + for i = 0 to nNormalCount - 1 + Out.Log("NORMAL: '" & aNormalProps(i) & "'") + bCVOK = PropertyTester.TestPropertyWithoutParams(aNormalProps(i), false) + Out.Log(bCVOK) + Out.Log("") + bNormalOK = bNormalOK OR bCVOK + next i + end if + + bOK = bOK AND bNormalOK + + Test.MethodTested("setPropertyValue()", bOK) + + Test.StartMethod("addVetoableChangeListener()") + Test.StartMethod("removeVetoableChangeListener()") + Dim bAddVeto As Boolean + Dim bRmvVeto As Boolean + bRmvVeto = true + bAddVeto = true + + if (nConstrainedCount = 0) then + Out.Log("No Constrained properties!") + bAddVeto = true + bRmvVeto = true + else + for i = 0 to nConstrainedCount - 1 + vetoCalled1 = false + vetoCalled2 = false + oObj.addVetoableChangeListener(aConstrainedProps(i), oVListener1) + oObj.addVetoableChangeListener(aConstrainedProps(i), oVListener2) + PropertyTester.TestPropertyWithoutParams(aConstrainedProps(i), false) + bAddVeto = bAddVeto OR (vetoCalled1 AND vetoCalled2) + Out.Log("addVetoableChangeListener: " & aConstrainedProps(i) & " Listener1 must be called: " & vetoCalled1) + Out.Log("addVetoableChangeListener: " & aConstrainedProps(i) & " Listener2 must be called: " & vetoCalled2) + + vetoCalled1 = false + vetoCalled2 = false + oObj.removeVetoableChangeListener(aConstrainedProps(i), oVListener1) + PropertyTester.TestPropertyWithoutParams(aConstrainedProps(i), false) + bRmvVeto = bRmvVeto OR (NOT vetoCalled1 AND vetoCalled2) + Out.Log("removeVetoableChangeListener: " & aConstrainedProps(i) & " Listener1 must not be called: " & NOT vetoCalled1) + Out.Log("removeVetoableChangeListener: " & aConstrainedProps(i) & " Listener2 must not be called: " & NOT vetoCalled2) + oObj.removeVetoableChangeListener(aConstrainedProps(i), oVListener2) + next i + end if + Test.MethodTested("addVetoableChangeListener()", bAddVeto) + Test.MethodTested("removeVetoableChangeListener()", bRmvVeto) + + Test.StartMethod("addPropertyChangeListener()") + Test.StartMethod("removePropertyChangeListener()") + Dim bAddProp As Boolean + Dim bRmvProp As Boolean + bRmvProp = true + bAddProp = true + + if (nBoundCount = 0) then + Out.Log("No Bound properties!") + bAddProp = true + bRmvProp = true + else + for i = 0 to nBoundCount - 1 + propCalled1 = false + propCalled2 = false + oObj.addPropertyChangeListener(aBoundProps(i), oPCListener1) + oObj.addPropertyChangeListener(aBoundProps(i), oPCListener2) + PropertyTester.TestPropertyWithoutParams(aBoundProps(i), false) + bAddProp = bAddProp OR (propCalled1 AND propCalled2) + Out.Log("addPropertyChangeListener: " & aBoundProps(i) & " Listener1 must be called :" & propCalled1) + Out.Log("addPropertyChangeListener: " & aBoundProps(i) & " Listener2 must be called :" & propCalled2) + + propCalled1 = false + propCalled2 = false + oObj.removePropertyChangeListener(aBoundProps(i), oPCListener1) + PropertyTester.TestPropertyWithoutParams(aBoundProps(i), false) + bRmvProp = bRmvProp OR (NOT propCalled1 AND propCalled2) + Out.Log("removePropertyChangeListener: " & aBoundProps(i) & " Listener must not be called: " & NOT propCalled) + oObj.removePropertyChangeListener(aBoundProps(i), oPCListener2) + next i + end if + + Test.MethodTested("addPropertyChangeListener()", bAddProp) + Test.MethodTested("removePropertyChangeListener()", bRmvProp) + + ReCreateObj() + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub + +Function GetProps() As Boolean +On Error Goto ErrHndl + Dim bOK as Boolean + Dim i As Integer + Dim attr As Variant + bOK = true + + aAllProps = oObj.propertySetInfo.getProperties + nNormalCount = 0 + nBoundCount = 0 + nConstrainedCount = 0 + nReadOnlyCount = 0 + + 'first we should find out how many properties of different kinds exists + for i = lbound(aAllProps) to ubound(aAllProps) + attr = aAllProps(i).Attributes + if (attr AND READONLY) OR (attr AND BOUND) OR (attr AND CONSTRAINED) then + if (attr AND BOUND) then + nBoundCount = nBoundCount + 1 + end if + if (attr AND CONSTRAINED) then + nConstrainedCount = nConstrainedCount + 1 + end if + if (attr AND READONLY) then + nReadOnlyCount = nReadOnlyCount + 1 + end if + else + if (NOT isNULL(oObj.getPropertyValue(aAllProps(i).Name))) then + nNormalCount = nNormalCount + 1 + end if + end if + next i + + Out.Log("" & nNormalCount & " Normal properties found") + Out.Log("" & nBoundCount & " Bound properties found") + Out.Log("" & nConstrainedCount & " Constrained properties found") + Out.Log("" & nReadOnlyCount & " ReadOnly properties found") + + Dim AN(nNormalCount) As String + aNormalProps = AN() + + Dim AB(nBoundCount) As String + aBoundProps = AB() + + Dim AC(nConstrainedCount) As String + aConstrainedProps = AC() + + Dim AR(nReadOnlyCount) As String + aReadOnlyProps = AR() + + 'Filling up arrays... + + nNormalCount = 0 + nBoundCount = 0 + nConstrainedCount = 0 + nReadOnlyCount = 0 + for i = lbound(aAllProps) to ubound(aAllProps) + attr = aAllProps(i).Attributes + if (attr AND READONLY) OR (attr AND BOUND) OR (attr AND CONSTRAINED) then + if (attr AND BOUND) then + aBoundProps(nBoundCount) = aAllProps(i).Name + nBoundCount = nBoundCount + 1 + end if + if (attr AND CONSTRAINED) then + aConstrainedProps(nConstrainedCount) = aAllProps(i).Name + nConstrainedCount = nConstrainedCount + 1 + end if + if (attr AND READONLY) then + aReadOnlyProps(nReadOnlyCount) = aAllProps(i).Name + nReadOnlyCount = nReadOnlyCount + 1 + end if + else + if (NOT isNULL(oObj.getPropertyValue(aAllProps(i).Name))) then + aNormalProps(nNormalCount) = aAllProps(i).Name + nNormalCount = nNormalCount + 1 + end if + end if + next i + + GetProps = bOK +Exit Function +ErrHndl: + Test.Exception() + resume next +End Function + +Function test_GetPropertyValue() As Boolean +On Error goto ErrHndl + + Dim bOK As Boolean + Dim i As Integer + Dim propName As String + Dim propVal As Variant + bOK = false + + for i = lbound(aAllProps) to ubound(aAllProps) + propName = aAllProps(i).Name + propVal = oObj.getPropertyValue(propName) + bOK = true + if (isNULL(propVal)) AND NOT(aAllProps(i).Attributes AND MAYBENULL) then + Out.Log(cIfcShortName & " " & aAllProps(i).Name & " is NULL, but it is not MAYBENULL") + end if + next i + + test_GetPropertyValue() = bOK +Exit Function +ErrHndl: + Test.Exception() + bOK = false + resume next +End Function + +Sub CB1_propertyChange + Out.Log("CallBack 'PropertyChange' for listener 1 was called.") + propCalled1 = true + CB1_propertyChange = true +End Sub + +Sub CB1_vetoableChange + Out.Log("CallBack 'vetoableChange' for listener 1 was called.") + vetoCalled1 = true +End Sub + +Sub CB2_propertyChange + Out.Log("CallBack 'PropertyChange' for listener 2 was called.") + propCalled2 = true + CB2_propertyChange = true +End Sub + +Sub CB2_vetoableChange + Out.Log("CallBack 'vetoableChange' for listener 2 was called.") + vetoCalled2 = true +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/beans/XPropertySet/script.xlb b/qadevOOo/tests/basic/ifc/beans/XPropertySet/script.xlb new file mode 100644 index 000000000000..b5800efed317 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/beans/XPropertySet/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="beans_XPropertySet" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="beans_XPropertySet"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/beans/XPropertySetInfo/beans_XPropertySetInfo.xba b/qadevOOo/tests/basic/ifc/beans/XPropertySetInfo/beans_XPropertySetInfo.xba new file mode 100644 index 000000000000..4907ef848c4b --- /dev/null +++ b/qadevOOo/tests/basic/ifc/beans/XPropertySetInfo/beans_XPropertySetInfo.xba @@ -0,0 +1,74 @@ +<?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="beans_XPropertySetInfo" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.beans.XPropertySetInfo +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim aProperties As Variant + Dim vPropertie As Variant + + + Test.StartMethod("getProperties()") + bOK = true + aProperties = oObj.getProperties() + bOK = bOk AND not isNull(aProperties) + Test.MethodTested("getProperties()", bOK) + + Test.StartMethod("getPropertyByName()") + bOK = true + vPropertie = oObj.getPropertyByName(aProperties(0).Name) + bOK = bOK AND NOT isNull(vPropertie) + Test.MethodTested("getPropertyByName()", bOK) + + Test.StartMethod("hasPropertyByName()") + bOK = true + bOK = bOK AND oObj.hasPropertyByName(aProperties(0).Name) + Test.MethodTested("hasPropertyByName()", bOK) + + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/beans/XPropertySetInfo/script.xlb b/qadevOOo/tests/basic/ifc/beans/XPropertySetInfo/script.xlb new file mode 100644 index 000000000000..702547f945d2 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/beans/XPropertySetInfo/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="beans_XPropertySetInfo" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="beans_XPropertySetInfo"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/beans/XPropertyState/beans_XPropertyState.xba b/qadevOOo/tests/basic/ifc/beans/XPropertyState/beans_XPropertyState.xba new file mode 100644 index 000000000000..ef5b7d797864 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/beans/XPropertyState/beans_XPropertyState.xba @@ -0,0 +1,178 @@ +<?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="beans_XPropertyState" 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. +' +'************************************************************************* +'************************************************************************* + + + + +Const BOUND = 2 +Const CONSTRAINED = 4 +Const MAYBENULL = 8 +Const READONLY = 16 + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.beans.XPropertyState +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Dim oProperties As Variant + Dim nAllProps As Integer + Dim aValue As Variant + Dim n As Integer + Dim oCoreRefl As Object + Dim bTypesEq As Boolean + + bOK = true + + oCoreRefl = createUnoService("com.sun.star.reflection.CoreReflection") + + oProperties = oObj.GetPropertySetInfo().Properties + nAllProps = uBound(oProperties) + Dim AllPropsNames(nAllProps) As String + Out.Log("Found " & nAllProps & " properties.") + + for n = 0 to (nAllProps) + AllPropsNames(n) = oProperties(n).Name + next n + + Test.StartMethod("getPropertyStates()") + Out.Log("getting states for all properties.") + bOK = true + + Dim aStates As Variant + + aStates() = oObj.getPropertyStates(AllPropsNames()) + bOK = bOK AND isArray(aStates()) + if (bOK) then Out.Log("Length of returned array is " & ubound(aStates())) + bOK = bOK AND ubound(aStates()) = nAllProps + + Dim nState As Integer + nState = aStates(nAllProps / 2) + bOK = bOK AND (nState = com.sun.star.beans.PropertyState.DIRECT_VALUE OR _ + nState = com.sun.star.beans.PropertyState.DEFAULT_VALUE OR _ + nState = com.sun.star.beans.PropertyState.AMBIGUOUS_VALUE) + Test.MethodTested("getPropertyStates()", bOK) + + Test.StartMethod("getPropertyState()") + bOK = false + n = 0 + + ' Here testing getPropertyState method. Method is OK when at least one + ' property works correctly. + + while (bOK = false AND n < nAllProps) + bOK = true + nState = oObj.getPropertyState(AllPropsNames(n)) + bOK = bOK AND (nState = com.sun.star.beans.PropertyState.DIRECT_VALUE OR _ + nState = com.sun.star.beans.PropertyState.DEFAULT_VALUE OR _ + nState = com.sun.star.beans.PropertyState.AMBIGUOUS_VALUE) + n = n + 1 + wend + Test.MethodTested("getPropertyState()", bOK) + + Test.StartMethod("getPropertyDefault()") + bOK = false + n = 0 + + ' Here testing getPropertyDefault method. Method is OK when at least one + ' property works correctly. + + while (bOK = false AND n < nAllProps) + bOK = true + aValue = oObj.getPropertyDefault(AllPropsNames(n)) + bOK = bOK AND (oProperties(n).Type.Name = oCoreRefl.getType(aValue).Name) + n = n + 1 + wend + Test.MethodTested("getPropertyDefault()", bOK) + + Test.StartMethod("setPropertyToDefault()") + bOK = false + n = 0 + + ' Here testing setPropertyToDefault method. Method is OK when at least one + ' property works correctly. + + while (bOK = false AND n < nAllProps) + bOK = true + oObj.setPropertyToDefault(AllPropsNames(n)) + n = n + 1 + wend + Test.MethodTested("setPropertyToDefault()", bOK) + + + ' Here testing getPropertyState for ALL properties. This will + ' put all exceptions to .log file (if this method doesn't work with some properties) + ' but without any affect to test status. + + n = 0 + while (n < nAllProps) + bOK = true + nState = oObj.getPropertyState(AllPropsNames(n)) + bOK = bOK AND (nState = com.sun.star.beans.PropertyState.DIRECT_VALUE OR _ + nState = com.sun.star.beans.PropertyState.DEFAULT_VALUE OR _ + nState = com.sun.star.beans.PropertyState.AMBIGUOUS_VALUE) + + if (NOT bOK) then + Out.Log("Error while testing getPropertyState() for '" & AllPropsNames(n) & "' FAILED.") + else + Out.Log("getPropertyState() for property '" & AllPropsNames(n) & "' is OK") + end if + + bOK = true + aValue = oObj.getPropertyDefault(AllPropsNames(n)) + bTypesEq = false + if (bOK AND (TypeName(aValue) <> "Empty")) then + bTypesEq = (oProperties(n).Type.Name = oCoreRefl.getType(aValue).Name) + end if + + if (NOT bOK) then ' exception was occurred + Out.Log("Error while testing getPropertyDefault() for '" & AllPropsNames(n) & "' FAILED.") + elseif ((TypeName(aValue) <> "Empty") AND (NOT bTypesEq)) then + Out.Log("Types: '" & oProperties(n).Type.Name & "' and '" & oCoreRefl.getType(aValue).Name & "' are different.") + else + Out.Log("getPropertyDefault() for property '" & AllPropsNames(n) & "' is OK") + end if + n = n + 1 + wend + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/beans/XPropertyState/script.xlb b/qadevOOo/tests/basic/ifc/beans/XPropertyState/script.xlb new file mode 100644 index 000000000000..4a57254d9d4c --- /dev/null +++ b/qadevOOo/tests/basic/ifc/beans/XPropertyState/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="beans_XPropertyState" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="beans_XPropertyState"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/bridge/XBridge/bridge_XBridge.xba b/qadevOOo/tests/basic/ifc/bridge/XBridge/bridge_XBridge.xba new file mode 100644 index 000000000000..5fa2afa34cdc --- /dev/null +++ b/qadevOOo/tests/basic/ifc/bridge/XBridge/bridge_XBridge.xba @@ -0,0 +1,88 @@ +<?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="bridge_XBridge" 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. +' +'************************************************************************* +'************************************************************************* + + + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' Global sBridgeName As String +' Global sConnectionString As String + +'************************************************************************* + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.bridge.XBridge +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim sName As String + Dim sDscr As String + Dim oInstance As Object + + + Test.StartMethod("getInstance()") + bOK = true + oInstance = oObj.getInstance("StarOffice.ServiceManager") + bOK = bOK AND NOT isNULL(oInstance) + Test.MethodTested("getInstance()", bOK) + + Test.StartMethod("getName()") + bOK = true + sName = oObj.getName() + Out.Log("Bridge's name is '" & sName & "', expected name is '" & sBridgeName & "'") + bOK = bOK AND sBridgeName = sName + Test.MethodTested("getName()", bOK) + + Test.StartMethod("getDescription()") + bOK = true + sDscr = oObj.getDescription() + Out.Log("Description is '" & sDscr & "'") + bOK = bOK AND (inStr(sDscr, sConnectionString) > 0) + Test.MethodTested("getDescription()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/bridge/XBridge/script.xlb b/qadevOOo/tests/basic/ifc/bridge/XBridge/script.xlb new file mode 100644 index 000000000000..4d8c253b2e17 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/bridge/XBridge/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="bridge_XBridge" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="bridge_XBridge"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/bridge/XBridgeFactory/bridge_XBridgeFactory.xba b/qadevOOo/tests/basic/ifc/bridge/XBridgeFactory/bridge_XBridgeFactory.xba new file mode 100644 index 000000000000..eae78d84178c --- /dev/null +++ b/qadevOOo/tests/basic/ifc/bridge/XBridgeFactory/bridge_XBridgeFactory.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="bridge_XBridgeFactory" 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 + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' Global sProtocol As String + +'************************************************************************* + + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.bridge.XBridgeFactory +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim connectionStr As String + Dim oConnector As Object, oAcceptor As Object + Dim xConnection As Object + Dim oBridge As Object + Dim aBridges As Variant, args(1) As Variant + oConnector = createUnoService("basichelper.Connector") + oAcceptor = createUnoService("com.sun.star.connection.Acceptor") + + Dim iPos1 As Integer, iPos2 As Integer + + iPos1 = inStr(1, CNCSTR, "socket") + iPos2 = inStr(iPos1, CNCSTR, "port=") + + connectionStr = mid(CNCSTR, iPos1, iPos2 - iPos1 + 5) + "18888" + + Out.Log("Connection string is '" + connectionStr + "'") + + args(0) = createUnoService("com.sun.star.connection.Connector") + args(1) = connectionStr + + ' When call initialize() method, a new thread is created and tries to + ' connect to Acceptor after some seconds. + + oConnector.initialize(args()) + + xConnection = oAcceptor.accept(connectionStr) + +' wait(5000) + +' xConnection = oConnector.getByName("Connection") + + if (isNull(xConnector)) then + Out.Log("Connection was not created !!!") + end if + Out.Log("State of connector: " + oConnector.getByName("State")) + + Test.StartMethod("createBridge()") + bOK = true + oBridge = oObj.createBridge("NewBasicBridge", sProtocol, xConnection, NULL_OBJECT) + bOK = bOK AND hasUnoInterfaces(oBridge, "com.sun.star.bridge.XBridge") + Test.MethodTested("createBridge()", bOK) + + Test.StartMethod("getBridge()") + bOK = true + oBridge = oObj.getBridge("NewBasicBridge") + bOK = bOK AND NOT isNull(oBridge) AND (oBridge.Name = "NewBasicBridge") + Test.MethodTested("getBridge()", bOK) + + Test.StartMethod("getExistingBridges()") + bOK = true + aBridges = oObj.getExistingBridges() + bOK = bOK AND NOT isNull(aBridges) AND ubound(aBridges()) > -1 + Test.MethodTested("getExistingBridges()", bOK) + + Out.Log("Finally the bridge must be disposed ...") + xConnection.close() + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/bridge/XBridgeFactory/script.xlb b/qadevOOo/tests/basic/ifc/bridge/XBridgeFactory/script.xlb new file mode 100644 index 000000000000..554366c6a09d --- /dev/null +++ b/qadevOOo/tests/basic/ifc/bridge/XBridgeFactory/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="bridge_XBridgeFactory" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="bridge_XBridgeFactory"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/bridge/XUnoUrlResolver/bridge_XUnoUrlResolver.xba b/qadevOOo/tests/basic/ifc/bridge/XUnoUrlResolver/bridge_XUnoUrlResolver.xba new file mode 100644 index 000000000000..a70b1a78cad1 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/bridge/XUnoUrlResolver/bridge_XUnoUrlResolver.xba @@ -0,0 +1,62 @@ +<?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="bridge_XUnoUrlResolver" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.bridge.XUnoUrlResolver +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim ORegSrv As Object + + Test.StartMethod("resolve()") + bOK = true + ORegSrv = oObj.resolve("uno:" & CNCSTR & ";urp;StarOffice.ServiceManager") + bOK = bOK AND NOT isNULL(ORegSrv) + Test.MethodTested("resolve()", bOK) +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/bridge/XUnoUrlResolver/script.xlb b/qadevOOo/tests/basic/ifc/bridge/XUnoUrlResolver/script.xlb new file mode 100644 index 000000000000..c24c330f546e --- /dev/null +++ b/qadevOOo/tests/basic/ifc/bridge/XUnoUrlResolver/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="bridge_XUnoUrlResolver" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="bridge_XUnoUrlResolver"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/chart/BarDiagram/chart_BarDiagram.xba b/qadevOOo/tests/basic/ifc/chart/BarDiagram/chart_BarDiagram.xba new file mode 100644 index 000000000000..794190a93d8a --- /dev/null +++ b/qadevOOo/tests/basic/ifc/chart/BarDiagram/chart_BarDiagram.xba @@ -0,0 +1,101 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="chart_BarDiagram" 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 + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' Global oBarDiagram As Object +' Global nGlobalBarDiagram As Long + +'************************************************************************* + + + + + + +Sub RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.chart.BarDiagram +'************************************************************************* +On Error Goto ErrHndl + Dim oObject As Object + Dim i As Integer + + ' Change an object to test here! + oObject = oObj + oObj = oBarDiagram + + if isEmpty(oObj) then + Out.Log("Global oBarDiagram As Object is required for this test!") + end if + + if oObj.supportsService("com.sun.star.chart.Dim3DDiagram") then + oObj.Dim3D = true + end if + + + PropertyTester.TestProperty("Vertical") + + PropertyTester.TestProperty("Deep") + + PropertyTester.TestProperty("StackedBarsConnected") + + if oObj.supportsService("com.sun.star.chart.Dim3DDiagram") then + oObj.Dim3D = false + end if + oObj.Vertical = false + + + Dim aNumberOfLines(nGlobalBarDiagram) As Integer + for i = 0 to nGlobalBarDiagram + aNumberOfLines(i) = i + next i + PropertyTester.TestProperty("NumberOfLines",aNumberOfLines()) + + ' Change an object back! + oObj = oObject +Exit Sub +ErrHndl: + Test.Exception() + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/chart/BarDiagram/script.xlb b/qadevOOo/tests/basic/ifc/chart/BarDiagram/script.xlb new file mode 100644 index 000000000000..c98a69dade8c --- /dev/null +++ b/qadevOOo/tests/basic/ifc/chart/BarDiagram/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="chart_BarDiagram" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="chart_BarDiagram"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/chart/Chart3DBarProperties/chart_Chart3DBarProperties.xba b/qadevOOo/tests/basic/ifc/chart/Chart3DBarProperties/chart_Chart3DBarProperties.xba new file mode 100644 index 000000000000..12c151847372 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/chart/Chart3DBarProperties/chart_Chart3DBarProperties.xba @@ -0,0 +1,56 @@ +<?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="chart_Chart3DBarProperties" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.chart.Chart3DBarProperties +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + PropertyTester.TestProperty("SolidType") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/chart/Chart3DBarProperties/script.xlb b/qadevOOo/tests/basic/ifc/chart/Chart3DBarProperties/script.xlb new file mode 100644 index 000000000000..097265920816 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/chart/Chart3DBarProperties/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="chart_Chart3DBarProperties" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="chart_Chart3DBarProperties"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/chart/ChartAxis/chart_ChartAxis.xba b/qadevOOo/tests/basic/ifc/chart/ChartAxis/chart_ChartAxis.xba new file mode 100644 index 000000000000..e95822265dc2 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/chart/ChartAxis/chart_ChartAxis.xba @@ -0,0 +1,105 @@ +<?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="chart_ChartAxis" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.chart.ChartAxis +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + oObj.AutoMax = false + PropertyTester.TestProperty("Max") + + oObj.AutoMin = false + Dim vMin(0 to 2) As Double + vMin(0) = oObj.Origin - 1 + vMin(1) = oObj.Origin - 1.333 + vMin(2) = oObj.AutoMin + PropertyTester.TestProperty("Min",vMin()) + + oObj.AutoOrigin = false + PropertyTester.TestProperty("Origin") + + oObj.AutoStepMain = false + PropertyTester.TestProperty("StepMain") + + oObj.AutoStepHelp = false + PropertyTester.TestProperty("StepHelp") + + PropertyTester.TestProperty("AutoMax") + + PropertyTester.TestProperty("AutoMin") + + PropertyTester.TestProperty("AutoOrigin") + + PropertyTester.TestProperty("AutoStepHelp") + + PropertyTester.TestProperty("AutoStepMain") + + PropertyTester.TestProperty("Logarithmic") + + PropertyTester.TestProperty("DisplayLabels") + + PropertyTester.TestProperty("TextRotation") + + PropertyTester.TestProperty("Marks") + + PropertyTester.TestProperty("HelpMarks") + + PropertyTester.TestProperty("Overlap") + + PropertyTester.TestProperty("GapWidth") + + PropertyTester.TestProperty("ArrangeOrder") + + PropertyTester.TestProperty("TextBreak") + + PropertyTester.TestProperty("TextCanOverlap") + + PropertyTester.TestProperty("NumberFormat") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/chart/ChartAxis/script.xlb b/qadevOOo/tests/basic/ifc/chart/ChartAxis/script.xlb new file mode 100644 index 000000000000..98571281ce05 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/chart/ChartAxis/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="chart_ChartAxis" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="chart_ChartAxis"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/chart/ChartAxisXSupplier/chart_ChartAxisXSupplier.xba b/qadevOOo/tests/basic/ifc/chart/ChartAxisXSupplier/chart_ChartAxisXSupplier.xba new file mode 100644 index 000000000000..6ef3958aaaa2 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/chart/ChartAxisXSupplier/chart_ChartAxisXSupplier.xba @@ -0,0 +1,68 @@ +<?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="chart_ChartAxisXSupplier" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.chart.ChartAxisXSupplier +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + PropertyTester.TestProperty("HasXAxis") + + oObj.HasXAxis = true + PropertyTester.TestProperty("HasXAxisDescription") + + PropertyTester.TestProperty("HasXAxisGrid") + + PropertyTester.TestProperty("HasXAxisHelpGrid") + + PropertyTester.TestProperty("HasXAxisTitle") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/chart/ChartAxisXSupplier/script.xlb b/qadevOOo/tests/basic/ifc/chart/ChartAxisXSupplier/script.xlb new file mode 100644 index 000000000000..c56c3d43895b --- /dev/null +++ b/qadevOOo/tests/basic/ifc/chart/ChartAxisXSupplier/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="chart_ChartAxisXSupplier" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="chart_ChartAxisXSupplier"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/chart/ChartAxisYSupplier/chart_ChartAxisYSupplier.xba b/qadevOOo/tests/basic/ifc/chart/ChartAxisYSupplier/chart_ChartAxisYSupplier.xba new file mode 100644 index 000000000000..7c434f5a8102 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/chart/ChartAxisYSupplier/chart_ChartAxisYSupplier.xba @@ -0,0 +1,67 @@ +<?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="chart_ChartAxisYSupplier" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.chart.ChartAxisYSupplier +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + PropertyTester.TestProperty("HasYAxis") + + oObj.HasYAxis = true + PropertyTester.TestProperty("HasYAxisDescription") + + PropertyTester.TestProperty("HasYAxisGrid") + + PropertyTester.TestProperty("HasYAxisHelpGrid") + + PropertyTester.TestProperty("HasYAxisTitle") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/chart/ChartAxisYSupplier/script.xlb b/qadevOOo/tests/basic/ifc/chart/ChartAxisYSupplier/script.xlb new file mode 100644 index 000000000000..19a8df66c70e --- /dev/null +++ b/qadevOOo/tests/basic/ifc/chart/ChartAxisYSupplier/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="chart_ChartAxisYSupplier" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="chart_ChartAxisYSupplier"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/chart/ChartAxisZSupplier/chart_ChartAxisZSupplier.xba b/qadevOOo/tests/basic/ifc/chart/ChartAxisZSupplier/chart_ChartAxisZSupplier.xba new file mode 100644 index 000000000000..e8a190225631 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/chart/ChartAxisZSupplier/chart_ChartAxisZSupplier.xba @@ -0,0 +1,68 @@ +<?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="chart_ChartAxisZSupplier" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.chart.ChartAxisZSupplier +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + PropertyTester.TestProperty("HasZAxis") + + oObj.HasZAxis = true + PropertyTester.TestProperty("HasZAxisDescription") + + PropertyTester.TestProperty("HasZAxisGrid") + + PropertyTester.TestProperty("HasZAxisHelpGrid") + + PropertyTester.TestProperty("HasZAxisTitle") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/chart/ChartAxisZSupplier/script.xlb b/qadevOOo/tests/basic/ifc/chart/ChartAxisZSupplier/script.xlb new file mode 100644 index 000000000000..e178b40cd5df --- /dev/null +++ b/qadevOOo/tests/basic/ifc/chart/ChartAxisZSupplier/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="chart_ChartAxisZSupplier" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="chart_ChartAxisZSupplier"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/chart/ChartDataPointProperties/chart_ChartDataPointProperties.xba b/qadevOOo/tests/basic/ifc/chart/ChartDataPointProperties/chart_ChartDataPointProperties.xba new file mode 100644 index 000000000000..bd3c543023e3 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/chart/ChartDataPointProperties/chart_ChartDataPointProperties.xba @@ -0,0 +1,72 @@ +<?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="chart_ChartDataPointProperties" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.chart.ChartDataPointProperties +'************************************************************************* +On Error Goto ErrHndl + Dim aCaptions(4) As Integer + aCaptions(0) = com.sun.star.chart.ChartDataCaption.NONE + aCaptions(1) = com.sun.star.chart.ChartDataCaption.VALUE + aCaptions(2) = com.sun.star.chart.ChartDataCaption.PERCENT + aCaptions(3) = com.sun.star.chart.ChartDataCaption.TEXT + aCaptions(4) = com.sun.star.chart.ChartDataCaption.SYMBOL + PropertyTester.TestProperty("DataCaption", aCaptions()) + + PropertyTester.TestProperty("SymbolType") + + Test.StartMethod("SymbolBitmapURL") + Dim sURL1 As String + Dim sURL2 As String + oObj.setPropertyValue("SymbolBitmapURL", utils.Path2URL(cTestDocsDir) & "crazy-blue.jpg") + sURL1 = oObj.getPropertyValue("SymbolBitmapURL") + oObj.setPropertyValue("SymbolBitmapURL", utils.Path2URL(cTestDocsDir) & "space-metal.jpg") + sURL2 = oObj.getPropertyValue("SymbolBitmapURL") + Test.MethodTested("SymbolBitmapURL", sURL1 <> sURL2) + +Exit Sub +ErrHndl: + Test.Exception() + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/chart/ChartDataPointProperties/script.xlb b/qadevOOo/tests/basic/ifc/chart/ChartDataPointProperties/script.xlb new file mode 100644 index 000000000000..461713249f6c --- /dev/null +++ b/qadevOOo/tests/basic/ifc/chart/ChartDataPointProperties/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="chart_ChartDataPointProperties" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="chart_ChartDataPointProperties"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/chart/ChartDataRowProperties/chart_ChartDataRowProperties.xba b/qadevOOo/tests/basic/ifc/chart/ChartDataRowProperties/chart_ChartDataRowProperties.xba new file mode 100644 index 000000000000..af8c2af6e53b --- /dev/null +++ b/qadevOOo/tests/basic/ifc/chart/ChartDataRowProperties/chart_ChartDataRowProperties.xba @@ -0,0 +1,62 @@ +<?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="chart_ChartDataRowProperties" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.chart.ChartDataRowProperties +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + PropertyTester.TestProperty("Axis") + + PropertyTester.TestProperty("DataRegressionProperties") + + PropertyTester.TestProperty("DataErrorProperties") + + PropertyTester.TestProperty("DataMeanValueProperties") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/chart/ChartDataRowProperties/script.xlb b/qadevOOo/tests/basic/ifc/chart/ChartDataRowProperties/script.xlb new file mode 100644 index 000000000000..21ddb4431bb9 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/chart/ChartDataRowProperties/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="chart_ChartDataRowProperties" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="chart_ChartDataRowProperties"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/chart/ChartDocument/chart_ChartDocument.xba b/qadevOOo/tests/basic/ifc/chart/ChartDocument/chart_ChartDocument.xba new file mode 100644 index 000000000000..23db1de23d59 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/chart/ChartDocument/chart_ChartDocument.xba @@ -0,0 +1,60 @@ +<?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="chart_ChartDocument" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.chart.ChartDocument +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + PropertyTester.TestProperty("HasMainTitle") + + PropertyTester.TestProperty("HasSubTitle") + + PropertyTester.TestProperty("HasLegend") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/chart/ChartDocument/script.xlb b/qadevOOo/tests/basic/ifc/chart/ChartDocument/script.xlb new file mode 100644 index 000000000000..c49800c91fda --- /dev/null +++ b/qadevOOo/tests/basic/ifc/chart/ChartDocument/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="chart_ChartDocument" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="chart_ChartDocument"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/chart/ChartLegend/chart_ChartLegend.xba b/qadevOOo/tests/basic/ifc/chart/ChartLegend/chart_ChartLegend.xba new file mode 100644 index 000000000000..5c657f62e354 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/chart/ChartLegend/chart_ChartLegend.xba @@ -0,0 +1,56 @@ +<?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="chart_ChartLegend" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.chart.ChartLegend +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + PropertyTester.TestProperty("Alignment") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/chart/ChartLegend/script.xlb b/qadevOOo/tests/basic/ifc/chart/ChartLegend/script.xlb new file mode 100644 index 000000000000..2ffdad5a3274 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/chart/ChartLegend/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="chart_ChartLegend" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="chart_ChartLegend"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/chart/ChartStatistics/chart_ChartStatistics.xba b/qadevOOo/tests/basic/ifc/chart/ChartStatistics/chart_ChartStatistics.xba new file mode 100644 index 000000000000..94f34978b537 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/chart/ChartStatistics/chart_ChartStatistics.xba @@ -0,0 +1,70 @@ +<?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="chart_ChartStatistics" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.chart.ChartStatistics +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + PropertyTester.TestProperty("ConstantErrorLow") + + PropertyTester.TestProperty("ConstantErrorHigh") + + PropertyTester.TestProperty("MeanValue") + + PropertyTester.TestProperty("ErrorCategory") + + PropertyTester.TestProperty("PercentageError") + + PropertyTester.TestProperty("ErrorMargin") + + PropertyTester.TestProperty("ErrorIndicator") + + PropertyTester.TestProperty("RegressionCurves") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/chart/ChartStatistics/script.xlb b/qadevOOo/tests/basic/ifc/chart/ChartStatistics/script.xlb new file mode 100644 index 000000000000..98806825e5ff --- /dev/null +++ b/qadevOOo/tests/basic/ifc/chart/ChartStatistics/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="chart_ChartStatistics" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="chart_ChartStatistics"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/chart/ChartTableAddressSupplier/chart_ChartTableAddressSupplier.xba b/qadevOOo/tests/basic/ifc/chart/ChartTableAddressSupplier/chart_ChartTableAddressSupplier.xba new file mode 100644 index 000000000000..579ae05ad90a --- /dev/null +++ b/qadevOOo/tests/basic/ifc/chart/ChartTableAddressSupplier/chart_ChartTableAddressSupplier.xba @@ -0,0 +1,62 @@ +<?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="chart_ChartTableAddressSupplier" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.chart.ChartTableAddressSupplier +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + PropertyTester.TestProperty("CategoriesRangeAddress") + + PropertyTester.TestProperty("SeriesAddresses") + + PropertyTester.TestProperty("MainTitleAddress") + + PropertyTester.TestProperty("SubTitleAddress") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/chart/ChartTableAddressSupplier/script.xlb b/qadevOOo/tests/basic/ifc/chart/ChartTableAddressSupplier/script.xlb new file mode 100644 index 000000000000..71adea8c2158 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/chart/ChartTableAddressSupplier/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="chart_ChartTableAddressSupplier" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="chart_ChartTableAddressSupplier"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/chart/ChartTitle/chart_ChartTitle.xba b/qadevOOo/tests/basic/ifc/chart/ChartTitle/chart_ChartTitle.xba new file mode 100644 index 000000000000..825fb3627b25 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/chart/ChartTitle/chart_ChartTitle.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="chart_ChartTitle" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.chart.ChartTitle +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + PropertyTester.TestProperty("TextRotation") + + PropertyTester.TestProperty("String") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/chart/ChartTitle/script.xlb b/qadevOOo/tests/basic/ifc/chart/ChartTitle/script.xlb new file mode 100644 index 000000000000..315635fecd24 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/chart/ChartTitle/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="chart_ChartTitle" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="chart_ChartTitle"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/chart/ChartTwoAxisXSupplier/chart_ChartTwoAxisXSupplier.xba b/qadevOOo/tests/basic/ifc/chart/ChartTwoAxisXSupplier/chart_ChartTwoAxisXSupplier.xba new file mode 100644 index 000000000000..b88a0c8a3947 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/chart/ChartTwoAxisXSupplier/chart_ChartTwoAxisXSupplier.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="chart_ChartTwoAxisXSupplier" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.chart.ChartTwoAxisXSupplier +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + PropertyTester.TestProperty("HasSecondaryXAxis") + + PropertyTester.TestProperty("HasSecondaryXAxisDescription") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/chart/ChartTwoAxisXSupplier/script.xlb b/qadevOOo/tests/basic/ifc/chart/ChartTwoAxisXSupplier/script.xlb new file mode 100644 index 000000000000..315e3105d221 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/chart/ChartTwoAxisXSupplier/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="chart_ChartTwoAxisXSupplier" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="chart_ChartTwoAxisXSupplier"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/chart/ChartTwoAxisYSupplier/chart_ChartTwoAxisYSupplier.xba b/qadevOOo/tests/basic/ifc/chart/ChartTwoAxisYSupplier/chart_ChartTwoAxisYSupplier.xba new file mode 100644 index 000000000000..ad632a404d0d --- /dev/null +++ b/qadevOOo/tests/basic/ifc/chart/ChartTwoAxisYSupplier/chart_ChartTwoAxisYSupplier.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="chart_ChartTwoAxisYSupplier" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.chart.ChartTwoAxisYSupplier +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + PropertyTester.TestProperty("HasSecondaryYAxis") + + PropertyTester.TestProperty("HasSecondaryYAxisDescription") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/chart/ChartTwoAxisYSupplier/script.xlb b/qadevOOo/tests/basic/ifc/chart/ChartTwoAxisYSupplier/script.xlb new file mode 100644 index 000000000000..3ff36ef423a8 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/chart/ChartTwoAxisYSupplier/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="chart_ChartTwoAxisYSupplier" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="chart_ChartTwoAxisYSupplier"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/chart/Diagram/chart_Diagram.xba b/qadevOOo/tests/basic/ifc/chart/Diagram/chart_Diagram.xba new file mode 100644 index 000000000000..1beb2480cfc2 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/chart/Diagram/chart_Diagram.xba @@ -0,0 +1,65 @@ +<?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="chart_Diagram" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.chart.Diagram +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + PropertyTester.TestProperty("DataRowSource") + + Dim nDataCaption(0 to 4) As Long + nDataCaption(0) = 0 + nDataCaption(1) = 1 + nDataCaption(2) = 2 + nDataCaption(3) = 4 + 'nDataCaption(4) = 8 deprecated + nDataCaption(4) = 16 + PropertyTester.TestProperty("DataCaption",nDataCaption()) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/chart/Diagram/script.xlb b/qadevOOo/tests/basic/ifc/chart/Diagram/script.xlb new file mode 100644 index 000000000000..c7cc1e56dd64 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/chart/Diagram/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="chart_Diagram" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="chart_Diagram"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/chart/Dim3DDiagram/chart_Dim3DDiagram.xba b/qadevOOo/tests/basic/ifc/chart/Dim3DDiagram/chart_Dim3DDiagram.xba new file mode 100644 index 000000000000..8fd613796a70 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/chart/Dim3DDiagram/chart_Dim3DDiagram.xba @@ -0,0 +1,56 @@ +<?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="chart_Dim3DDiagram" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.chart.Dim3DDiagram +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + PropertyTester.TestProperty("Dim3D") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/chart/Dim3DDiagram/script.xlb b/qadevOOo/tests/basic/ifc/chart/Dim3DDiagram/script.xlb new file mode 100644 index 000000000000..d636a65edc73 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/chart/Dim3DDiagram/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="chart_Dim3DDiagram" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="chart_Dim3DDiagram"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/chart/LineDiagram/chart_LineDiagram.xba b/qadevOOo/tests/basic/ifc/chart/LineDiagram/chart_LineDiagram.xba new file mode 100644 index 000000000000..7de157b35aec --- /dev/null +++ b/qadevOOo/tests/basic/ifc/chart/LineDiagram/chart_LineDiagram.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="chart_LineDiagram" 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 + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' Global oLineDiagram As Object + +'************************************************************************* + + + + + + +Sub RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.chart.LineDiagram +'************************************************************************* +On Error Goto ErrHndl + Dim oObject As Object + ' Change an object to test here! + oObject = oObj + oObj = oLineDiagram + + if isEmpty(oObj) then + Out.Log("Global oLineDiagram As Object is required for this test!") + End If + + Dim nSymbolType(1) As Integer + nSymbolType(0) = com.sun.star.chart.ChartSymbolType.NONE + nSymbolType(1) = com.sun.star.chart.ChartSymbolType.AUTO + PropertyTester.TestProperty("SymbolType", nSymbolType()) + + oObj.SymbolType = com.sun.star.chart.ChartSymbolType.SYMBOL0 + Dim newSize As new com.sun.star.awt.Size + newSize.Width = 300 + newSize.Height = 300 + PropertyTester.TestProperty("SymbolSize", Array(newSize)) + + Test.StartMethod("SymbolBitmapURL") + Dim sURL1 As String + Dim sURL2 As String + oObj.setPropertyValue("SymbolBitmapURL", utils.Path2URL(cTestDocsDir) + "crazy-blue.jpg") + sURL1 = oObj.getPropertyValue("SymbolBitmapURL") + oObj.setPropertyValue("SymbolBitmapURL", utils.Path2URL(cTestDocsDir) + "space-metal.jpg") + sURL2 = oObj.getPropertyValue("SymbolBitmapURL") + Test.MethodTested("SymbolBitmapURL", sURL1 <> sURL2) + + PropertyTester.TestProperty("Lines") + + Dim nSpline(1) As Long + nSpline(0) = 0 + nSpline(1) = 2 + PropertyTester.TestProperty("SplineType", nSpline()) + + PropertyTester.TestProperty("SplineOrder") + + PropertyTester.TestProperty("SplineResolution") + + ' Change an object back! + oObj = oObject + +Exit Sub +ErrHndl: + Test.Exception() + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/chart/LineDiagram/script.xlb b/qadevOOo/tests/basic/ifc/chart/LineDiagram/script.xlb new file mode 100644 index 000000000000..521f4f8d6088 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/chart/LineDiagram/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="chart_LineDiagram" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="chart_LineDiagram"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/chart/StackableDiagram/chart_StackableDiagram.xba b/qadevOOo/tests/basic/ifc/chart/StackableDiagram/chart_StackableDiagram.xba new file mode 100644 index 000000000000..469bdfba2131 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/chart/StackableDiagram/chart_StackableDiagram.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="chart_StackableDiagram" 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 + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +'Global oStackDiagram As Object + +'************************************************************************* + + + + + + +Sub RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.chart.StackableDiagram +'************************************************************************* +On Error Goto ErrHndl + Dim oObject As Object + ' Change an object to test here! + oObject = oObj + oObj = oStackDiagram + + if isEmpty(oObj) then + Out.Log("Global oStackDiagram As Object is required for this test!") + end if + + PropertyTester.TestProperty("Percent") + + PropertyTester.TestProperty("Stacked") + + ' Change an object back! + oObj = oObject +Exit Sub +ErrHndl: + Test.Exception() + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/chart/StackableDiagram/script.xlb b/qadevOOo/tests/basic/ifc/chart/StackableDiagram/script.xlb new file mode 100644 index 000000000000..8f18c62bc326 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/chart/StackableDiagram/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="chart_StackableDiagram" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="chart_StackableDiagram"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/chart/StockDiagram/chart_StockDiagram.xba b/qadevOOo/tests/basic/ifc/chart/StockDiagram/chart_StockDiagram.xba new file mode 100644 index 000000000000..bafaa29d10cc --- /dev/null +++ b/qadevOOo/tests/basic/ifc/chart/StockDiagram/chart_StockDiagram.xba @@ -0,0 +1,78 @@ +<?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="chart_StockDiagram" 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 + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' Global oStockDiagram As Object + +'************************************************************************* + + + + + +Sub RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.chart.StockDiagram +'************************************************************************* +On Error Goto ErrHndl + Dim oObject As Object + ' Change an object to test here! + oObject = oObj + oObj = oStockDiagram + + if isEmpty(oObj) then + Out.Log("Global oStockDiagram As Object is required for this test!") + end if + + PropertyTester.TestProperty("Volume") + + PropertyTester.TestProperty("UpDown") + + ' Change an object back! + oObj = oObject +Exit Sub +ErrHndl: + Test.Exception() + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/chart/StockDiagram/script.xlb b/qadevOOo/tests/basic/ifc/chart/StockDiagram/script.xlb new file mode 100644 index 000000000000..a44cabf4ce14 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/chart/StockDiagram/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="chart_StockDiagram" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="chart_StockDiagram"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/chart/X3DDisplay/chart_X3DDisplay.xba b/qadevOOo/tests/basic/ifc/chart/X3DDisplay/chart_X3DDisplay.xba new file mode 100644 index 000000000000..b75b8acc5751 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/chart/X3DDisplay/chart_X3DDisplay.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="chart_X3DDisplay" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.chart.X3DDisplay +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Test.StartMethod("getWall()") + bOK = NOT isNULL(oObj.getWall()) + Test.MethodTested("getWall()", bOK) + + Test.StartMethod("getFloor()") + bOK = NOT isNULL(oObj.getFloor()) + Test.MethodTested("getFloor()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/chart/X3DDisplay/script.xlb b/qadevOOo/tests/basic/ifc/chart/X3DDisplay/script.xlb new file mode 100644 index 000000000000..7eb194eab6c3 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/chart/X3DDisplay/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="chart_X3DDisplay" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="chart_X3DDisplay"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/chart/XAxisXSupplier/chart_XAxisXSupplier.xba b/qadevOOo/tests/basic/ifc/chart/XAxisXSupplier/chart_XAxisXSupplier.xba new file mode 100644 index 000000000000..906e5eecf2d8 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/chart/XAxisXSupplier/chart_XAxisXSupplier.xba @@ -0,0 +1,69 @@ +<?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="chart_XAxisXSupplier" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.chart.XAxisXSupplier +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Test.StartMethod("getXAxisTitle()") + bOK = NOT isNULL(oObj.getXAxisTitle()) + Test.MethodTested("getXAxisTitle()", bOK) + + Test.StartMethod("getXAxis()") + bOK = NOT isNULL(oObj.getXAxis()) + Test.MethodTested("getXAxis()", bOK) + + Test.StartMethod("getXMainGrid()") + bOK = NOT isNULL(oObj.getXMainGrid()) + Test.MethodTested("getXMainGrid()", bOK) + + Test.StartMethod("getXHelpGrid()") + bOK = NOT isNULL(oObj.getXHelpGrid()) + Test.MethodTested("getXHelpGrid()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/chart/XAxisXSupplier/script.xlb b/qadevOOo/tests/basic/ifc/chart/XAxisXSupplier/script.xlb new file mode 100644 index 000000000000..1916f3a2802b --- /dev/null +++ b/qadevOOo/tests/basic/ifc/chart/XAxisXSupplier/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="chart_XAxisXSupplier" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="chart_XAxisXSupplier"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/chart/XAxisYSupplier/chart_XAxisYSupplier.xba b/qadevOOo/tests/basic/ifc/chart/XAxisYSupplier/chart_XAxisYSupplier.xba new file mode 100644 index 000000000000..2d6fba33a104 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/chart/XAxisYSupplier/chart_XAxisYSupplier.xba @@ -0,0 +1,69 @@ +<?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="chart_XAxisYSupplier" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.chart.XAxisYSupplier +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Test.StartMethod("getYAxisTitle()") + bOK = NOT isNULL(oObj.getYAxisTitle()) + Test.MethodTested("getYAxisTitle()", bOK) + + Test.StartMethod("getYAxis()") + bOK = NOT isNULL(oObj.getYAxis()) + Test.MethodTested("getYAxis()", bOK) + + Test.StartMethod("getYMainGrid()") + bOK = NOT isNULL(oObj.getYMainGrid()) + Test.MethodTested("getYMainGrid()", bOK) + + Test.StartMethod("getYHelpGrid()") + bOK = NOT isNULL(oObj.getYHelpGrid()) + Test.MethodTested("getYHelpGrid()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/chart/XAxisYSupplier/script.xlb b/qadevOOo/tests/basic/ifc/chart/XAxisYSupplier/script.xlb new file mode 100644 index 000000000000..3fb6f9844872 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/chart/XAxisYSupplier/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="chart_XAxisYSupplier" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="chart_XAxisYSupplier"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/chart/XAxisZSupplier/chart_XAxisZSupplier.xba b/qadevOOo/tests/basic/ifc/chart/XAxisZSupplier/chart_XAxisZSupplier.xba new file mode 100644 index 000000000000..dc2db677d1c6 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/chart/XAxisZSupplier/chart_XAxisZSupplier.xba @@ -0,0 +1,69 @@ +<?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="chart_XAxisZSupplier" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.chart.XAxisZSupplier +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Test.StartMethod("getZAxisTitle()") + bOK = NOT isNULL(oObj.getZAxisTitle()) + Test.MethodTested("getZAxisTitle()", bOK) + + Test.StartMethod("getZAxis()") + bOK = NOT isNULL(oObj.getZAxis()) + Test.MethodTested("getZAxis()", bOK) + + Test.StartMethod("getZMainGrid()") + bOK = NOT isNULL(oObj.getZMainGrid()) + Test.MethodTested("getZMainGrid()", bOK) + + Test.StartMethod("getZHelpGrid()") + bOK = NOT isNULL(oObj.getZHelpGrid()) + Test.MethodTested("getZHelpGrid()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/chart/XAxisZSupplier/script.xlb b/qadevOOo/tests/basic/ifc/chart/XAxisZSupplier/script.xlb new file mode 100644 index 000000000000..e3ab9d5cc44e --- /dev/null +++ b/qadevOOo/tests/basic/ifc/chart/XAxisZSupplier/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="chart_XAxisZSupplier" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="chart_XAxisZSupplier"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/chart/XChartData/chart_XChartData.xba b/qadevOOo/tests/basic/ifc/chart/XChartData/chart_XChartData.xba new file mode 100644 index 000000000000..7d5f1b34d5f9 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/chart/XChartData/chart_XChartData.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="chart_XChartData" 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 + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' Global oCellToChange As Object + +'************************************************************************* + + + + + +Dim nCB1Val as Integer, nCB2Val As Integer + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.chart.XChartData +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim nNumber As Double + Dim oListener1 As Object + Dim oListener2 As Object + + nCB1Val = 0 + nCB2Val = 0 + + + Test.StartMethod("getNotANumber()") + bOK = true + bOK = bOK AND (VarType(oObj.getNotANumber()) = 5) + Test.MethodTested("getNotANumber()", bOK) + + Test.StartMethod("isNotANumber()") + bOK = true + nNumber = oObj.getNotANumber() + bOK = bOK AND oObj.IsNotANumber(nNumber) + bOK = bOK AND NOT oObj.IsNotANumber(nNumber + 1) + Test.MethodTested("isNotANumber()", bOK) + + Out.Log("create listeners...") + oListener1 = createUNOListener("CB1_", "com.sun.star.chart.XChartDataChangeEventListener") + oListener2 = createUNOListener("CB2_", "com.sun.star.chart.XChartDataChangeEventListener") + + 'add listeners to object if initialized + if NOT(isNull(oListener1)) then + oObj.addChartDataChangeEventListener(oListener1) + end if + if NOT(isNull(oListener2)) then + oObj.addChartDataChangeEventListener(oListener2) + end if + + Test.StartMethod("addChartDataChangeEventListener()") + bOK = true + oCellToChange.Value = 100 + wait 2000 + bOK = bOK AND ((nCB1Val = 1) AND (nCB2Val = 1)) + Test.MethodTested("addChartDataChangeEventListener()", bOK) + + Test.StartMethod("removeChartDataChangeEventListener()") + bOK = true + oObj.removeChartDataChangeEventListener(oListener2) + oCellToChange.Value = 10 + wait 2000 + bOK = bOK AND ((nCB1Val = 2 ) AND (nCB2Val = 1)) + Test.MethodTested("removeChartDataChangeEventListener()", bOK) + + Out.Log("Removing last listener.") + oObj.removeChartDataChangeEventListener(oListener1) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub + +' callback routine called chartDataChanged for listener1 +Sub CB1_chartDataChanged + Out.Log("CallBack for Listener 1 was called.") + nCB1Val = nCB1Val + 1 +End Sub + +' callback routine called chartDataChanged for listener2 +Sub CB2_chartDataChanged + Out.Log("CallBack for Listener 2 was called.") + nCB2Val = nCB2Val + 1 +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/chart/XChartData/script.xlb b/qadevOOo/tests/basic/ifc/chart/XChartData/script.xlb new file mode 100644 index 000000000000..317ed8da3725 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/chart/XChartData/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="chart_XChartData" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="chart_XChartData"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/chart/XChartDataArray/chart_XChartDataArray.xba b/qadevOOo/tests/basic/ifc/chart/XChartDataArray/chart_XChartDataArray.xba new file mode 100644 index 000000000000..f0d0c705b4ec --- /dev/null +++ b/qadevOOo/tests/basic/ifc/chart/XChartDataArray/chart_XChartDataArray.xba @@ -0,0 +1,179 @@ +<?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="chart_XChartDataArray" 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 + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' Global nTableH As Integer +' Global nTableW As Integer + +'************************************************************************* + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.chart.XChartDataArray +'************************************************************************* +On Error Goto ErrHndl + + Dim bOK As Boolean + Dim i As Integer, j As Integer + Dim objRowDsc As Variant, objColDsc As Variant + Dim objEl As Variant, newEl As Variant + Dim chData As Variant + + Out.Log("Object is '" + cObjectName + "'") + if (cObjectName = "sw.SwXTextTable") then + Out.Log("Object is 'SwXTextTable'. First, remove labels.") + oObj.setPropertyValue("ChartRowAsLabel", false) + oObj.setPropertyValue("ChartColumnAsLabel", false) + end if + + Test.StartMethod("getData()") + bOK = true + + Dim oData As Object + oData = oObj.getData() + bOK = bOK AND NOT isNULL(oData) + Test.MethodTested("getData()", bOK) + + Test.StartMethod("setData()") + bOK = true + + Dim newData(nTableH - 1) As Variant + Dim a(nTableW - 1) As Double + + for i = 0 to nTableH - 1 + ReDim a(nTableW - 1) As Double + for j = 0 to nTableW - 1 + a(j) = ((nTableW * 4) / (i + 2) + j * 2) + 16 + next j + newData(i) = a() + next i + + oObj.setData(newData()) + chData = oObj.getData() + + bOK = bOK AND ubound(oObj.getRowDescriptions()) = nTableH - 1 + bOK = bOK AND ubound(oObj.getColumnDescriptions()) = nTableW - 1 + + for i = 0 to nTableH - 1 + objEl = chData(i) + newEl = newData(i) + for j = 0 to nTableW - 1 + bOK = bOK AND objEl(j) = newEl(j) + next j + next i + + Test.MethodTested("setData()", bOK) + + if (cObjectName = "sw.SwXTextTable") then + Out.Log("Object is 'SwXTextTable'. Initialize labels.") + oObj.setPropertyValue("ChartRowAsLabel", true) + oObj.setPropertyValue("ChartColumnAsLabel", true) + end if + + Test.StartMethod("getRowDescriptions()") + bOK = true + + Dim oRowDsc() As String + oRowDsc = oObj.getRowDescriptions() + bOK = bOK AND NOT isNULL(oRowDsc) + Test.MethodTested("getRowDescriptions()", bOK) + + Test.StartMethod("setRowDescriptions()") + bOK = true + + Dim newRowDsc(nTableH - 2) As String + for i = 0 to nTableH - 2 ' -1 for 0-index and -1 for columns labels + newRowDsc(i) = "RowDsc " + i + next i + + oObj.setRowDescriptions(newRowDsc()) + + objRowDsc = oObj.getRowDescriptions() + + for i = 0 to nTableH - 2 + bOK = bOK AND newRowDsc(i) = objRowDsc(i) + next i + + Test.MethodTested("setRowDescriptions()", bOK) + + Test.StartMethod("getColumnDescriptions()") + bOK = true + bOK = bOK AND NOT isNULL(oObj.getColumnDescriptions()) + Test.MethodTested("getColumnDescriptions()", bOK) + + Test.StartMethod("setColumnDescriptions()") + bOK = true + + Dim newColDsc(nTableW - 2) As String + for i = 0 to nTableW - 2 + newColDsc(i) = "ColDsc " + i + next i + + oObj.setColumnDescriptions(newColDsc()) + + objColDsc = oObj.getColumnDescriptions() + + for i = 0 to nTableW - 2 + bOK = bOK AND newColDsc(i) = objColDsc(i) + next i + + if (cObjectName = "sw.SwXTextTable") then + Out.Log("Object is 'SwXTextTable'. Remove labels finally.") + oObj.setPropertyValue("ChartRowAsLabel", false) + oObj.setPropertyValue("ChartColumnAsLabel", false) + end if + + Test.MethodTested("setColumnDescriptions()", bOK) + + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/chart/XChartDataArray/script.xlb b/qadevOOo/tests/basic/ifc/chart/XChartDataArray/script.xlb new file mode 100644 index 000000000000..3c3b763d4073 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/chart/XChartDataArray/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="chart_XChartDataArray" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="chart_XChartDataArray"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/chart/XChartDocument/chart_XChartDocument.xba b/qadevOOo/tests/basic/ifc/chart/XChartDocument/chart_XChartDocument.xba new file mode 100644 index 000000000000..a3db3fdd658f --- /dev/null +++ b/qadevOOo/tests/basic/ifc/chart/XChartDocument/chart_XChartDocument.xba @@ -0,0 +1,129 @@ +<?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="chart_XChartDocument" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.chart.XChartDocument +'************************************************************************* +On Error Goto ErrHndl + + Dim bOK As Boolean + Dim oGetArea As Object + Dim oGetData As Object + Dim oGetDiagram As Object, oNewDiagram As Object + Dim oGetLegend As Object + Dim oGetSubTitle As Object + Dim oGetTitle As Object + Dim oSetDiagram As Object + Dim oAttachData As Object + Dim oRange As Object + Dim oXChartData As Variant + Dim sColumn As Variant, sColumnNew As Variant + Dim vColumnNew As Variant, vColumn As Variant + + + Test.StartMethod("getArea()") + bOK = true + oGetArea = oObj.GetArea + bOK = bOK AND isNumeric(oGetArea.fillStyle) + Test.MethodTested("getArea()", bOK) + + Test.StartMethod("getData()") + bOK = true + oGetData = oObj.getData() + bOK = bOK AND (oGetData.RowDescriptions(0) > "") + Test.MethodTested("getData()", bOK) + + Test.StartMethod("getDiagram()") + bOK = true + oGetDiagram = oObj.getDiagram + bOK = bOK AND isNumeric(oGetDiagram.constantErrorHigh) + Test.MethodTested("getDiagram()", bOK) + + Test.StartMethod("getLegend()") + bOK = true + oGetLegend = oObj.getLegend + bOK = bOK AND isNumeric(oGetLegend.fillStyle) + Test.MethodTested("getLegend()", bOK) + + Test.StartMethod("getSubTitle()") + bOK = true + oGetSubTitle = oObj.getSubTitle + bOK = bOK AND isNumeric(ogetSubTitle.fillStyle) + Test.MethodTested("getSubTitle()", bOK) + + Test.StartMethod("getTitle()") + bOK = true + oGetTitle = oObj.getTitle() + bOK = bOK AND isNumeric(oGetTitle.fillStyle) + Test.MethodTested("getTitle()", bOK) + + Test.StartMethod("setDiagram()") + bOK = true + 'oGetDiagram = oObj.GetDiagram + oNewDiagram = oDoc.createInstance("com.sun.star.chart.PieDiagram") + oNewDiagram.DataCaption = oGetDiagram.DataCaption + 1 + oObj.setDiagram(oNewDiagram) + oGetDiagram = oObj.GetDiagram + bOK = bOK AND oGetDiagram.DataCaption = oNewDiagram.DataCaption + Test.MethodTested("setDiagram()", bOK) + + Test.StartMethod("attachData()") + bOK = true + oXChartData = oObj.getData() + vColumn = oXChartData.ColumnDescriptions + sColumn = vColumn(0) + vColumnNew = vColumn + vColumnNew(0) = vColumnNew(0) + cIfcShortName + oXChartData.ColumnDescriptions = vColumnNew + oObj.attachData(oXChartData) + sColumnNew = oXChartData.ColumnDescriptions + bOK = bOK AND (sColumn <> vColumnNew(0)) + Test.MethodTested("attachData()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/chart/XChartDocument/script.xlb b/qadevOOo/tests/basic/ifc/chart/XChartDocument/script.xlb new file mode 100644 index 000000000000..e4b41cdaf2f0 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/chart/XChartDocument/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="chart_XChartDocument" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="chart_XChartDocument"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/chart/XDiagram/chart_XDiagram.xba b/qadevOOo/tests/basic/ifc/chart/XDiagram/chart_XDiagram.xba new file mode 100644 index 000000000000..6b347b758637 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/chart/XDiagram/chart_XDiagram.xba @@ -0,0 +1,73 @@ +<?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="chart_XDiagram" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.chart.XDiagram +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim oGDPProp As Object + Dim oGDRProp As Object + + Test.StartMethod("getDataPointProperties()") + bOK = true + oGDPProp = oObj.GetDataPointProperties(2,2) + bOK = bOK AND NOT (isNull(oGDPProp)) + Test.MethodTested("getDataPointProperties()", bOK) + + Test.StartMethod("getDataRowProperties()") + bOK = true + oGDRProp = oObj.GetDataRowProperties(2) + bOK = bOK AND NOT (isNull(oGDRProp)) + Test.MethodTested("getDataRowProperties()", bOK) + + Test.StartMethod("getDiagramType()") + bOK = true + bOK = bOK AND (VarType(oObj.getDiagramType) = 8) + Test.MethodTested("getDiagramType()", bOK) + + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/chart/XDiagram/script.xlb b/qadevOOo/tests/basic/ifc/chart/XDiagram/script.xlb new file mode 100644 index 000000000000..e5304e270473 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/chart/XDiagram/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="chart_XDiagram" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="chart_XDiagram"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/chart/XStatisticDisplay/chart_XStatisticDisplay.xba b/qadevOOo/tests/basic/ifc/chart/XStatisticDisplay/chart_XStatisticDisplay.xba new file mode 100644 index 000000000000..76643f2cf520 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/chart/XStatisticDisplay/chart_XStatisticDisplay.xba @@ -0,0 +1,74 @@ +<?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="chart_XStatisticDisplay" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.chart.XStatisticDisplay +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim oUpBar As Object + Dim oDownBar As Object + Dim oMMLine As Object + + Test.StartMethod("getUpBar()") + bOK = true + oUpBar = oObj.getUpBar() + bOK = bOK AND NOT isNULL(oUpBar) + Test.MethodTested("getUpBar()", bOK) + + Test.StartMethod("getDownBar()") + bOK = true + oDownBar = oObj.getDownBar() + bOK = bOK AND NOT isNULL(oDownBar) + Test.MethodTested("getDownBar()", bOK) + + Test.StartMethod("getMinMaxLine()") + bOK = true + oMMLine = oObj.getMinMaxLine() + bOK = bOK AND NOT isNULL(oMMLine) + Test.MethodTested("getMinMaxLine()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/chart/XStatisticDisplay/script.xlb b/qadevOOo/tests/basic/ifc/chart/XStatisticDisplay/script.xlb new file mode 100644 index 000000000000..641673941507 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/chart/XStatisticDisplay/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="chart_XStatisticDisplay" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="chart_XStatisticDisplay"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/chart/XTwoAxisXSupplier/chart_XTwoAxisXSupplier.xba b/qadevOOo/tests/basic/ifc/chart/XTwoAxisXSupplier/chart_XTwoAxisXSupplier.xba new file mode 100644 index 000000000000..ae0724232cff --- /dev/null +++ b/qadevOOo/tests/basic/ifc/chart/XTwoAxisXSupplier/chart_XTwoAxisXSupplier.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="chart_XTwoAxisXSupplier" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.chart.XTwoAxisXSupplier +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim oAxis As Object + + Test.StartMethod("getSecondaryXAxis()") + bOK = true + oAxis = oObj.getSecondaryXAxis() + bOK = bOK AND NOT isNULL(oAxis) + bOK = bOK AND hasUnoInterfaces(oAxis, "com.sun.star.beans.XPropertySet") + Test.MethodTested("getSecondaryXAxis()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/chart/XTwoAxisXSupplier/script.xlb b/qadevOOo/tests/basic/ifc/chart/XTwoAxisXSupplier/script.xlb new file mode 100644 index 000000000000..4360a5980282 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/chart/XTwoAxisXSupplier/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="chart_XTwoAxisXSupplier" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="chart_XTwoAxisXSupplier"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/chart/XTwoAxisYSupplier/chart_XTwoAxisYSupplier.xba b/qadevOOo/tests/basic/ifc/chart/XTwoAxisYSupplier/chart_XTwoAxisYSupplier.xba new file mode 100644 index 000000000000..045fc963226d --- /dev/null +++ b/qadevOOo/tests/basic/ifc/chart/XTwoAxisYSupplier/chart_XTwoAxisYSupplier.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="chart_XTwoAxisYSupplier" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.chart.XTwoAxisYSupplier +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim oAxis As Object + + Test.StartMethod("getSecondaryYAxis()") + bOK = true + oAxis = oObj.getSecondaryYAxis() + bOK = bOK AND NOT isNULL(oAxis) + bOK = bOK AND hasUnoInterfaces(oAxis, "com.sun.star.beans.XPropertySet") + Test.MethodTested("getSecondaryYAxis()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/chart/XTwoAxisYSupplier/script.xlb b/qadevOOo/tests/basic/ifc/chart/XTwoAxisYSupplier/script.xlb new file mode 100644 index 000000000000..2f9e1c0b9715 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/chart/XTwoAxisYSupplier/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="chart_XTwoAxisYSupplier" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="chart_XTwoAxisYSupplier"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/connection/XAcceptor/connection_XAcceptor.xba b/qadevOOo/tests/basic/ifc/connection/XAcceptor/connection_XAcceptor.xba new file mode 100644 index 000000000000..56c15e60858a --- /dev/null +++ b/qadevOOo/tests/basic/ifc/connection/XAcceptor/connection_XAcceptor.xba @@ -0,0 +1,132 @@ +<?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="connection_XAcceptor" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.connection.XAcceptor +'************************************************************************* +On Error Goto ErrHndl + + Dim bOK As Boolean + Dim oConnector As Object + Dim xConnection As Object + Dim sConnectionString As String + Dim args(1) As Variant + + bOK = true + + Test.startMethod("accept()") + + oConnector = createUnoService("basichelper.Connector") + + Dim iPos1 As Integer, iPos2 As Integer + + iPos1 = inStr(1, CNCSTR, "socket") + iPos2 = inStr(iPos1, CNCSTR, "port=") + + sConnectionString = mid(CNCSTR, iPos1, iPos2 - iPos1 + 5) & "18888" + + Out.Log("Connection string is '" & sConnectionString & "'") + + args(0) = createUnoService("com.sun.star.connection.Connector") + args(1) = sConnectionString + + ' When call initialize() method, a new thread is created and tries to + ' connect to Acceptor after some seconds. + + oConnector.initialize(args()) + + ' Starting acception. + xConnection = oObj.accept(sConnectionString) + wait(500) 'Just to be sure that component had a chance to change it's state. + + bOK = bOK AND hasUNOInterfaces(xConnection, "com.sun.star.connection.XConnection") + Out.Log("Connector's state is '" & oConnector.getByName("State") & "'") + bOK = bOK AND oConnector.getByName("State") = "connected" ' This means that connection was established. + + if (bOK) then + Out.Log("Connection established! Trying to get data from stream.") + + Dim aStr As String + Dim aByte As Integer + Dim readData() As Variant + aStr = "" + aByte = 1 + while (aByte <> 0) + ReDim readData() As Variant + xConnection.read(readData, 1) + aByte = readData(0) + if (aByte <> 0) then + aStr = aStr & chr(aByte) + end if + wend + + Out.Log("Returned data from stream is " & aStr) + bOK = bOK AND aStr = sConnectionString + end if + + Test.MethodTested("accept()", bOK) + + Test.startMethod("stopAccepting()") + bOK = true + ' Now stopping acception and trying to connect again + ' (we can do this, if connection string is the same.) + oObj.stopAccepting() + + Out.Log("Trying to connect after stopping accepting...") + oConnector.initialize(args()) + Out.Log("Connector's state is '" & oConnector.getByName("State") & "'") + + ' Now oConnector shouldn't connect. So, check it's state + ' after few seconds (= Connection's Timeout + 3 sec) + wait(3000 + oConnector.getByName("Timeout")) + Out.Log("Connector's state is '" & oConnector.getByName("State") & "'") + bOK = bOK AND oConnector.getByName("State") = "NoConnectException" + + Test.MethodTested("stopAccepting()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/connection/XAcceptor/script.xlb b/qadevOOo/tests/basic/ifc/connection/XAcceptor/script.xlb new file mode 100644 index 000000000000..3162d8a46614 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/connection/XAcceptor/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="connection_XAcceptor" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="connection_XAcceptor"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/connection/XConnector/connection_XConnector.xba b/qadevOOo/tests/basic/ifc/connection/XConnector/connection_XConnector.xba new file mode 100644 index 000000000000..08d413dbcffa --- /dev/null +++ b/qadevOOo/tests/basic/ifc/connection/XConnector/connection_XConnector.xba @@ -0,0 +1,70 @@ +<?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="connection_XConnector" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.connection.XConnector +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim xConn As Object + Dim sConnStr As String + + + Test.StartMethod("connect()") + bOK = true + + sConnStr = mid(CNCSTR, inStr(CNCSTR, "socket")) + Out.Log("Trying to connect with '" & sConnStr & "'") + xConn = oObj.connect(sConnStr) + bOK = bOK AND hasUNOInterfaces(xConn, "com.sun.star.connection.XConnection") + if (bOK) then + Out.Log("Connected! Connection description: " & xConn.getDescription()) + Out.Log("Closing connection...") + xConn.close() + end if + Test.MethodTested("connect()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/connection/XConnector/script.xlb b/qadevOOo/tests/basic/ifc/connection/XConnector/script.xlb new file mode 100644 index 000000000000..c4424716f1cc --- /dev/null +++ b/qadevOOo/tests/basic/ifc/connection/XConnector/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="connection_XConnector" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="connection_XConnector"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/container/XChild/container_XChild.xba b/qadevOOo/tests/basic/ifc/container/XChild/container_XChild.xba new file mode 100644 index 000000000000..99c689d1074d --- /dev/null +++ b/qadevOOo/tests/basic/ifc/container/XChild/container_XChild.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="container_XChild" 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. +' +'************************************************************************* +'************************************************************************* + +'************************************************************************* +' This Interface/Service test depends on the followingobject relations +' variables, which must be specified in the object creation: + +' ObjectRelation: oObjRelation(0).Name = "cannotSwitchParent" +' ObjectRelation: oObjRelation(0).Value = "configmgr: BasicElement::setParent: cannot move Entry" + +'************************************************************************* + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.container.XChild +'************************************************************************* +On Error Goto ErrHndl + + Dim bOK As Boolean + Dim oXInterface As Object + Dim vRaises As Variant + + Test.StartMethod("getParent()") + bOK = isObject(oObj.getParent()) + Test.MethodTested("getParent()", bOK) + + Test.StartMethod("setParent()") + bOK = true + Dim cObjRelation as Variant + cObjRelation = utils.getObjectRelation("cannotSwitchParent") + if isNull(cObjRelation) then + oXInterface = oObj.getParent() + vRaises = oObj.setParent(oXInterface) + bOK = bOK AND isEmpty(vRaises) + else + out.Log(cObjRelation) + end if + Test.MethodTested("setParent()", bOK) + + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/container/XChild/script.xlb b/qadevOOo/tests/basic/ifc/container/XChild/script.xlb new file mode 100644 index 000000000000..c2d2f44eccf7 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/container/XChild/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="container_XChild" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="container_XChild"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/container/XContainer/container_XContainer.xba b/qadevOOo/tests/basic/ifc/container/XContainer/container_XContainer.xba new file mode 100644 index 000000000000..2dd3e397d408 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/container/XContainer/container_XContainer.xba @@ -0,0 +1,228 @@ +<?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="container_XContainer" 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. +' +'************************************************************************* +'************************************************************************* + + + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' Global oElementToInsert As Object +' Global oContainer As Object in case if the component tested does +' not support XNameContainer + +'************************************************************************* + +Dim ElIns1 As Integer +Dim ElIns2 As Integer +Dim ElRem1 As Integer +Dim ElRem2 As Integer +Dim ElRep1 As Integer +Dim ElRep2 As Integer + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.container.XContainer +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim oListener1 as Object + Dim oListener2 as Object + + oListener1 = createUNOListener("CB1_", "com.sun.star.container.XContainerListener") + oListener2 = createUNOListener("CB2_", "com.sun.star.container.XContainerListener") + bOK = NOT isNULL(oListener1) AND NOT isNULL(oListener2) + Out.Log("Listeners creation : " + bOK) + + Test.StartMethod("addContainerListener()") + bOK = true + oObj.addContainerListener(oListener1) + Out.Log("Listener1 was added") + oObj.addContainerListener(oListener2) + Out.Log("Listener2 was added") + + insertElement() + + Dim bInsOK As Boolean + bInsOK = ElIns1 >= 1 AND ElIns2 >= 1 + Out.Log("... " + bInsOK) + bOK = bOK AND bInsOK + + removeElement() + + bRemOK = ElRem1 >= 1 AND ElRem2 >= 1 + Out.Log("... " + bRemOK) + bOK = bOK AND bRemOK + + Dim bNothingToReplace as Boolean + bNothingToReplace = replaceElement() + + bRepOK = (ElRep1 >= 1 AND ElRep2 >= 1) OR bNothingToReplace + Out.Log("... " + bRepOK) + bOK = bOK AND bRepOK + + Test.MethodTested("addContainerListener()", bOK) + + + Test.StartMethod("removeContainerListener()") + bOK = true + oObj.removeContainerListener(oListener1) + Out.Log("Listener1 was removed") + + insertElement() + + bInsOK = ElIns1 = 0 AND ElIns2 >= 1 + Out.Log("... " + bInsOK) + bOK = bOK AND bInsOK + + removeElement() + + bRemOK = ElRem1 = 0 AND ElRem2 >= 1 + Out.Log("... " + bRemOK) + bOK = bOK AND bRemOK + + bNothingToReplace = replaceElement() + + bRepOK = (ElRep1 = 0 AND ElRep2 >= 1) or bNothingToReplace + Out.Log("... " + bRepOK) + bOK = bOK AND bRepOK + Test.MethodTested("removeContainerListener()", bOK) + + oObj.removeContainerListener(oListener2) + Out.Log("Listener2 was removed") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub + +Sub insertElement() + Out.Log("Inserting element ... ") + ResetCounters() + if hasUnoInterfaces(oObj, "com.sun.star.container.XNameContainer") then + oObj.InsertByName(cIfcShortName, oElementToInsert) + elseif hasUnoInterfaces(oContainer, "com.sun.star.container.XNameContainer") then + oContainer.InsertByName(cIfcShortName, oElementToInsert) + elseif hasUnoInterfaces(oContainer, "com.sun.star.awt.XControlContainer") then + oContainer.addControl("NewControl", oElementToInsert) + else + Out.LOG("There is nothig to trigger the Listener!") + end if +end Sub + + +Sub removeElement() + Out.Log("Removing element ... ") + ResetCounters() + if hasUnoInterfaces(oObj, "com.sun.star.container.XNameContainer") then + oObj.RemoveByName(cIfcShortName) + elseif hasUnoInterfaces(oContainer, "com.sun.star.container.XNameContainer") then + oContainer.RemoveByName(cIfcShortName) + elseif hasUnoInterfaces(oContainer, "com.sun.star.awt.XControlContainer") then + oContainer.removeControl(oElementToInsert) + end if +end Sub + +Function replaceElement() as Boolean + Out.Log("Replacing element ... ") + ResetCounters() + Dim bNothingToReplace as Boolean + bNothingToReplace = FALSE + Dim old As Variant + if hasUnoInterfaces(oObj, "com.sun.star.container.XIndexReplace") then + old = oObj.getByIndex(0) + oObj.ReplaceByIndex(0, oElementToInsert) + oObj.ReplaceByIndex(0, old) + elseif hasUnoInterfaces(oContainer, "com.sun.star.container.XIndexReplace") then + old = oContainer.getByIndex(0) + oContainer.ReplaceByIndex(0, oElementToInsert) + oContainer.ReplaceByIndex(0, old) + elseif (hasUnoInterfaces(oContainer, "com.sun.star.container.XNameAccess") and _ + hasUnoInterfaces(oContainer, "com.sun.star.container.XNameReplace")) then + Dim cNames() as String + cNames = oObj.getElementNames() + old = oContainer.getByName(cNames(0)) + oContainer.ReplaceByName(cNames(0), oElementToInsert) + oContainer.ReplaceByName(cNames(0), old) + elseif hasUnoInterfaces(oContainer, "com.sun.star.awt.XControlContainer") then + bNothingToReplace = TRUE + else + Out.LOG("There is nothig to trigger the Listener!") + end if + replaceElement() = bNothingToReplace +end Function + +Sub CB1_elementInserted(ev As Object) + Out.Log("CB1 called: element was inserted") + ElIns1 = ElIns1 + 1 +End Sub + +Sub CB1_elementRemoved(ev As Object) + Out.Log("CB1 called: element was removed") + ElRem1 = ElRem1 + 1 +End Sub + +Sub CB1_elementReplaced(ev As Object) + Out.Log("CB1 called: element was replaced") + ElRep1 = ElRep1 + 1 +End Sub + +Sub CB2_elementInserted(ev As Object) + Out.Log("CB2 called: element was inserted") + ElIns2 = ElIns2 + 1 +End Sub + +Sub CB2_elementRemoved(ev As Object) + Out.Log("CB2 called: element was removed") + ElRem2 = ElRem2 + 1 +End Sub + +Sub CB2_elementReplaced(ev As Object) + Out.Log("CB2 called: element was replaced") + ElRep2 = ElRep2 + 1 +End Sub + +Sub ResetCounters() + ElIns1 = 0 + ElIns2 = 0 + ElRem1 = 0 + ElRem2 = 0 + ElRep1 = 0 + ElRep2 = 0 +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/container/XContainer/script.xlb b/qadevOOo/tests/basic/ifc/container/XContainer/script.xlb new file mode 100644 index 000000000000..91f039fed92a --- /dev/null +++ b/qadevOOo/tests/basic/ifc/container/XContainer/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="container_XContainer" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="container_XContainer"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/container/XContentEnumerationAccess/container_XContentEnumerationAccess.xba b/qadevOOo/tests/basic/ifc/container/XContentEnumerationAccess/container_XContentEnumerationAccess.xba new file mode 100644 index 000000000000..42c81cc2f676 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/container/XContentEnumerationAccess/container_XContentEnumerationAccess.xba @@ -0,0 +1,65 @@ +<?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="container_XContentEnumerationAccess" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.container.XContentEnumerationAccess +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Test.StartMethod("getAvailableServiceNames()") + bOK = true + aNames = oObj.getAvailableServiceNames() + bOK = bOK AND NOT isNULL(aNames) + Test.MethodTested("getAvailableServiceNames()", bOK) + + Test.StartMethod("createContentEnumeration()") + bOK = true + oEnum = oObj.createContentEnumeration(aNames(0)) + bOK = bOK AND hasUnoInterfaces(oEnum, "com.sun.star.container.XEnumeration") + Test.MethodTested("createContentEnumeration()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/container/XContentEnumerationAccess/script.xlb b/qadevOOo/tests/basic/ifc/container/XContentEnumerationAccess/script.xlb new file mode 100644 index 000000000000..05077a300f27 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/container/XContentEnumerationAccess/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="container_XContentEnumerationAccess" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="container_XContentEnumerationAccess"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/container/XElementAccess/container_XElementAccess.xba b/qadevOOo/tests/basic/ifc/container/XElementAccess/container_XElementAccess.xba new file mode 100644 index 000000000000..6a8aa0348ba4 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/container/XElementAccess/container_XElementAccess.xba @@ -0,0 +1,67 @@ +<?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="container_XElementAccess" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.container.XElementAccess +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim oType As Object + + Test.StartMethod("hasElements()") + bOK = oObj.hasElements() + Test.MethodTested("hasElements()", bOK) + + Test.StartMethod("getElementType()") + bOK = true + oType = oObj.getElementType() + Out.Log("Element type is " & oType.Name) + Test.MethodTested("getElementType()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/container/XElementAccess/script.xlb b/qadevOOo/tests/basic/ifc/container/XElementAccess/script.xlb new file mode 100644 index 000000000000..3460dde77388 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/container/XElementAccess/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="container_XElementAccess" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="container_XElementAccess"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/container/XEnumeration/container_XEnumeration.xba b/qadevOOo/tests/basic/ifc/container/XEnumeration/container_XEnumeration.xba new file mode 100644 index 000000000000..3f826f988d54 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/container/XEnumeration/container_XEnumeration.xba @@ -0,0 +1,64 @@ +<?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="container_XEnumeration" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.container.XEnumeration +'************************************************************************* +On Error goto ErrHndl + Dim bOK As Boolean + + Test.StartMethod("hasMoreElements()") + bOK = oObj.hasMoreElements() + Test.MethodTested("hasMoreElements()", bOK) + + Test.StartMethod("nextElement()") + bOK = NOT isNULL (oObj.nextElement()) + Test.MethodTested("nextElement()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/container/XEnumeration/script.xlb b/qadevOOo/tests/basic/ifc/container/XEnumeration/script.xlb new file mode 100644 index 000000000000..bca9e4edf129 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/container/XEnumeration/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="container_XEnumeration" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="container_XEnumeration"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/container/XEnumerationAccess/container_XEnumerationAccess.xba b/qadevOOo/tests/basic/ifc/container/XEnumerationAccess/container_XEnumerationAccess.xba new file mode 100644 index 000000000000..91762f537688 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/container/XEnumerationAccess/container_XEnumerationAccess.xba @@ -0,0 +1,64 @@ +<?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="container_XEnumerationAccess" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.container.XEnumerationAccess +'************************************************************************* +On Error Goto ErrHndl + Dim oEnum As Object + Dim bOK As Boolean + + Test.StartMethod("createEnumeration()") + bOK = true + oEnum = oObj.createEnumeration() + bOK = bOK AND (NOT isNull(oEnum)) + bOK = bOK AND hasUnoInterfaces(oEnum, "com.sun.star.container.XEnumeration") + Test.MethodTested("createEnumeration()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/container/XEnumerationAccess/script.xlb b/qadevOOo/tests/basic/ifc/container/XEnumerationAccess/script.xlb new file mode 100644 index 000000000000..5c72301ebb22 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/container/XEnumerationAccess/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="container_XEnumerationAccess" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="container_XEnumerationAccess"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/container/XHierarchicalName/container_XHierarchicalName.xba b/qadevOOo/tests/basic/ifc/container/XHierarchicalName/container_XHierarchicalName.xba new file mode 100644 index 000000000000..8170e8a97de7 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/container/XHierarchicalName/container_XHierarchicalName.xba @@ -0,0 +1,97 @@ +<?xml version="1.0" encoding="UTF-8"?> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="container_XHierarchicalName" 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. +' +'************************************************************************* +'************************************************************************* + +' This Interface/Service test depends on the followingobject relations +' variables, which must be specified in the object creation: + +' ObjectRelation: oObjRelation(0).Name = "ElementName" +' ObjectRelation: oObjRelation(0).Value = "MyAccessibleElementName" +' ObjectRelation: oObjRelation(1).Name = "HierarchicalName" +' ObjectRelation: oObjRelation(1).Value = "MyHierachicalName" + +'************************************************************************* + +' Be sure that all variables are dimensioned: +option explicit + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.container.XHierarchicalName +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Dim cElemName as Variant + cElemName = utils.getObjectRelation("ElementName") + if isNull(cElemName) then + out.log("Could not get relation 'ElenemtName' -> FALSE") + end if + + Dim cExpName as Variant + cExpName = utils.getObjectRelation("HierarchicalName") + if isNull(cExpName) then + out.log("Could not get relation 'HierarchicalName' -> FALSE") + end if + + Test.StartMethod("getHierarchicalName()") + bOK = TRUE + Dim cHName as String + cHName = oObj.getHierarchicalName() + Dim result as String + result = instr(cHName, cExpName) + if len(result) = 0 then + olt.log("Getting: " + cHName + " but expected it to start with " + _ + cExpName) + bOK = FALSE + end if + Test.MethodTested("getHierarchicalName()", bOK) + + Test.StartMethod("composeHierarchicalName()") + bOK = TRUE + Dim gettedName as String + gettedName = oObj.composeHierarchicalName(cElemName) + result = instr(gettedName, cElemName) + if len(result) = 0 then + olt.log("Getting: " + gettedName + " but expected it to start with " + _ + cElemetName) + bOK = FALSE + end if + Test.MethodTested("composeHierarchicalName()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/container/XHierarchicalName/script.xlb b/qadevOOo/tests/basic/ifc/container/XHierarchicalName/script.xlb new file mode 100644 index 000000000000..e9f49c898c1c --- /dev/null +++ b/qadevOOo/tests/basic/ifc/container/XHierarchicalName/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="container_XHierarchicalName" library:readonly="false" library:passwordprotected="false"> + <library:element library:name="container_XHierarchicalName"/> + </library:library> diff --git a/qadevOOo/tests/basic/ifc/container/XHierarchicalNameAccess/container_XHierarchicalNameAccess.xba b/qadevOOo/tests/basic/ifc/container/XHierarchicalNameAccess/container_XHierarchicalNameAccess.xba new file mode 100644 index 000000000000..841c4481e19c --- /dev/null +++ b/qadevOOo/tests/basic/ifc/container/XHierarchicalNameAccess/container_XHierarchicalNameAccess.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="container_XHierarchicalNameAccess" 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. +' +'************************************************************************* +'************************************************************************* + +' This Interface/Service test depends on the following object relations +' variables, which must be specified in the object creation: + +' ObjectRelation: oObjRelation(0).Name = "ElementName" +' ObjectRelation: oObjRelation(0).Value = "MyAccessibleElementName" + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.container.XHierarchicalNameAccess +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Dim cObjRelation as Variant + cObjRelation = utils.getObjectRelation("ElementName") + if isNull(cObjRelation) then + cObjRelation = cIfcLongName + end if + + Test.StartMethod("getByHierarchicalName()") + bOK = true + Dim oRet as Variant + oRet = oObj.getByHierarchicalName(cObjRelation) + if TypeName(oRet) = "String" then + out.log("oRet = " + oRet) + bOK = bOK and (oRet = cObjRelation) + else + bOK = bOK AND oRet.Name = cObjRelation + end if + Test.MethodTested("getByHierarchicalName()", bOK) + + Test.StartMethod("hasByHierarchicalName()") + bOK = true + bOK = bOK AND oObj.hasByHierarchicalName(cObjRelation) + bOK = bOK AND NOT oObj.hasByHierarchicalName(cObjRelation + "ThisIsAnInvalidName") + Test.MethodTested("hasByHierarchicalName()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/container/XHierarchicalNameAccess/script.xlb b/qadevOOo/tests/basic/ifc/container/XHierarchicalNameAccess/script.xlb new file mode 100644 index 000000000000..26b107612f8b --- /dev/null +++ b/qadevOOo/tests/basic/ifc/container/XHierarchicalNameAccess/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="container_XHierarchicalNameAccess" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="container_XHierarchicalNameAccess"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/container/XIndexAccess/container_XIndexAccess.xba b/qadevOOo/tests/basic/ifc/container/XIndexAccess/container_XIndexAccess.xba new file mode 100644 index 000000000000..77ce846ea255 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/container/XIndexAccess/container_XIndexAccess.xba @@ -0,0 +1,73 @@ +<?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="container_XIndexAccess" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.container.XIndexAccess +'************************************************************************* +On Error Goto ErrHndl + Dim nCount As Integer + Dim bOK As Boolean + + Test.StartMethod("getCount()") + bOK = true + nCount = oObj.Count + bOK = bOK AND nCount + Test.MethodTested("getCount()", bOK) + + Test.StartMethod("getByIndex()") + bOK = true + if (nCount) then + bOK = bOK AND NOT isNull(oObj.getByIndex(nCount - 1)) + Test.MethodTested("getByIndex()", bOK) + else + Out.Log("No elements") + end if + + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/container/XIndexAccess/script.xlb b/qadevOOo/tests/basic/ifc/container/XIndexAccess/script.xlb new file mode 100644 index 000000000000..a27bd13b282e --- /dev/null +++ b/qadevOOo/tests/basic/ifc/container/XIndexAccess/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="container_XIndexAccess" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="container_XIndexAccess"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/container/XIndexContainer/container_XIndexContainer.xba b/qadevOOo/tests/basic/ifc/container/XIndexContainer/container_XIndexContainer.xba new file mode 100644 index 000000000000..c35d5f4ffd3e --- /dev/null +++ b/qadevOOo/tests/basic/ifc/container/XIndexContainer/container_XIndexContainer.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="container_XIndexContainer" 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 + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' Global oInstance As Object for InsertByName + +'************************************************************************* + + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.container.XIndexContainer +'************************************************************************* +On Error Goto ErrHndl + + Dim bOK As Boolean + Dim nCount As Integer + + nCount = oObj.count + + Test.StartMethod("insertByIndex()") + bOK = true + oObj.insertByIndex(nCount, oInstance) + bOK = bOK AND (oObj.count > nCount) + Test.MethodTested("insertByIndex()", bOK) + + Test.StartMethod("removeByIndex()") + bOK = true + oObj.removeByIndex(nCount) + bOK = bOK AND (oObj.Count = nCount) + Test.MethodTested("removeByIndex()", bOK) +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/container/XIndexContainer/script.xlb b/qadevOOo/tests/basic/ifc/container/XIndexContainer/script.xlb new file mode 100644 index 000000000000..085014bd065a --- /dev/null +++ b/qadevOOo/tests/basic/ifc/container/XIndexContainer/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="container_XIndexContainer" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="container_XIndexContainer"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/container/XIndexReplace/container_XIndexReplace.xba b/qadevOOo/tests/basic/ifc/container/XIndexReplace/container_XIndexReplace.xba new file mode 100644 index 000000000000..c7d0cdee17ee --- /dev/null +++ b/qadevOOo/tests/basic/ifc/container/XIndexReplace/container_XIndexReplace.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="container_XIndexReplace" 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 + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' the Test-Object must contain two diffrent named Objects +' Global oIdxReplaceInstance as Object + +'************************************************************************* + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.container.XIndexReplace +'************************************************************************* +On Error Goto ErrHndl + + Dim bOK As Boolean + Dim nCount As Integer + Dim oOld As Object + Dim oNew As Object + + Test.StartMethod("replaceByIndex()") + bOK = true + + nCount = oObj.count + Out.Log("There are " & nCount & " objects") + oOld = oObj.getByIndex(nCount - 1) + + oObj.replaceByIndex(nCount - 1, oIdxReplaceInstance) + oNew = oObj.getByIndex(nCount - 1) + bOK = bOK AND (oOld.Name <> oNew.Name) + + Test.MethodTested("replaceByIndex()", bOK) + + Out.Log("replace old Object.") + oObj.replaceByIndex(nCount - 1, oOld) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/container/XIndexReplace/script.xlb b/qadevOOo/tests/basic/ifc/container/XIndexReplace/script.xlb new file mode 100644 index 000000000000..568e937677d5 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/container/XIndexReplace/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="container_XIndexReplace" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="container_XIndexReplace"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/container/XNameAccess/container_XNameAccess.xba b/qadevOOo/tests/basic/ifc/container/XNameAccess/container_XNameAccess.xba new file mode 100644 index 000000000000..3bee5352a307 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/container/XNameAccess/container_XNameAccess.xba @@ -0,0 +1,81 @@ +<?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="container_XNameAccess" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.container.XNameAccess +'************************************************************************* +On Error Goto ErrHndl + Dim aElementNames() As Variant + Dim bOK As Boolean + Dim oElem As Variant + Dim cName As String + + Test.StartMethod("getElementNames()") + bOK = true + aElementnames() = oObj.getElementNames() + if hasUnoInterfaces(oObj, "com.sun.star.container.XIndexAccess") then + bOK = bOK AND (uBound(aElementnames()) = oObj.count - 1) + else + bOK = bOK AND (uBound(aElementnames()) > -1) + end if + Test.MethodTested("getElementNames()", bOK) + + Test.StartMethod("getByName()") + bOK = true + oElem = oObj.getByName(aElementNames(0)) + bOK = bOK AND NOT isNull(oElem) + Test.MethodTested("getByName()", bOK) + + Test.StartMethod("hasByName()") + bOK = true + cName = aElementNames(uBound(aElementNames())) + bOK = bOK AND oObj.hasByName(cName) + Test.MethodTested("hasByName()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/container/XNameAccess/script.xlb b/qadevOOo/tests/basic/ifc/container/XNameAccess/script.xlb new file mode 100644 index 000000000000..df0fdb783771 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/container/XNameAccess/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="container_XNameAccess" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="container_XNameAccess"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/container/XNameContainer/container_XNameContainer.xba b/qadevOOo/tests/basic/ifc/container/XNameContainer/container_XNameContainer.xba new file mode 100644 index 000000000000..9250232df7ad --- /dev/null +++ b/qadevOOo/tests/basic/ifc/container/XNameContainer/container_XNameContainer.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="container_XNameContainer" 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 + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' Global oInstance As Object instance to insert + +'************************************************************************* + + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.container.XNameContainer +'************************************************************************* +On Error Goto ErrHndl + + Dim bOK As Boolean + + Test.StartMethod("insertByName()") + bOK = true + oObj.insertByName(cIfcShortName, oInstance) + bOK = bOK AND oObj.hasByName(cIfcShortName) + Test.MethodTested("insertByName()", bOK) + + Test.StartMethod("removeByName()") + bOK = true + oObj.removeByName(cIfcShortName) + bOK = bOK AND NOT oObj.hasByName(cIfcShortName) + Test.MethodTested("removeByName()", bOK) +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/container/XNameContainer/script.xlb b/qadevOOo/tests/basic/ifc/container/XNameContainer/script.xlb new file mode 100644 index 000000000000..69c98b8f0573 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/container/XNameContainer/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="container_XNameContainer" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="container_XNameContainer"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/container/XNameReplace/container_XNameReplace.xba b/qadevOOo/tests/basic/ifc/container/XNameReplace/container_XNameReplace.xba new file mode 100644 index 000000000000..ca0c7086d9a2 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/container/XNameReplace/container_XNameReplace.xba @@ -0,0 +1,116 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="container_XNameReplace" 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 + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' Global cNameToReplace As String 'name of instance to be replased +' Global oReplaceInstance As Variant 'instance, that will be inserted +' instead old one + +'************************************************************************* + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.container.XNameReplace +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim oOldObject As Object + Dim cOldObjName As String + Dim oNewControl As Object + Dim cNewObjName As String + Dim NewAddress As Object + Dim InstAddress As Object + Dim cReplInstName As String + + Test.StartMethod("replaceByName()") + bOK = true + + if (cObjectName = "sc.ScCellRangesObj") then + oOldObject = oObj.getByName(cNameToReplace) + InstAddress = oReplaceInstance.getRangeAddress + + oObj.replaceByName(cNameToReplace, oReplaceInstance) + + oNewControl = oObj.getByName(cNameToReplace) + NewAddress = oNewControl.getRangeAddress + + bOK = bOK AND NewAddress.Sheet = InstAddress.Sheet + bOK = bOK AND NewAddress.StartColumn = InstAddress.StartColumn + bOK = bOK AND NewAddress.EndColumn = InstAddress.EndColumn + bOK = bOK AND NewAddress.StartRow = InstAddress.StartRow + bOK = bOK AND NewAddress.EndRow = InstAddress.EndRow + + elseif typename(oReplaceInstance) = "String" then + Dim oNewObj as Variant + Dim oOldObj as Variant + oOldObj = oObj.getByName(cNameToReplace) + oObj.replaceByName(cNameToReplace, oReplaceInstance) + oNewObj = oObj.getByName(cNameToReplace) + bOK = bOK and not PropertyTester.equals(oOldObj, oNewObj) + else + oOldObject = oObj.getByName(cNameToReplace) + cReplInstName = oReplaceInstance.Name + Out.Log("ReplaceInstance.name = '" & cReplInstName & "'") + cOldObjName = oOldObject.Name + Out.Log("OldObject.name = '" & cOldObjName & "'") + + oObj.replaceByName(cNameToReplace, oReplaceInstance) + oNewControl = oObj.getByName(cNameToReplace) + + cReplInstName = oReplaceInstance.Name + Out.Log("ReplaceInstance.name = '" & cReplInstName & "'") + cNewObjName = oNewControl.Name + Out.Log("NewObject.name = '" & cNewObjName & "'") + + bOK = bOK AND (oReplaceInstance.Name = cNameToReplace) + end if + + Test.MethodTested("replaceByName()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/container/XNameReplace/script.xlb b/qadevOOo/tests/basic/ifc/container/XNameReplace/script.xlb new file mode 100644 index 000000000000..268ac95bb0f9 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/container/XNameReplace/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="container_XNameReplace" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="container_XNameReplace"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/container/XNamed/container_XNamed.xba b/qadevOOo/tests/basic/ifc/container/XNamed/container_XNamed.xba new file mode 100644 index 000000000000..da0f6ad1f3c7 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/container/XNamed/container_XNamed.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="container_XNamed" 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 + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' Global cNameToSet As String "fixed" if name is fixed + +'************************************************************************* + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.container.XNamed +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim cName As String, cNewName As String + + if VarType(cNameToSet) = 8 then + if cNameToSet = "" then + cNewName = cIfcShortName + else + cNewName = cNameToSet + endif + else + cNewName = cIfcShortName + endif + + Test.StartMethod("getName()") + bOK = true + cName = oObj.getName() + Out.Log("Name is '" + cName + "'") + bOK = bOK AND NOT isNULL(cName) + bOK = bOK AND (VarType(oObj.Name) = 8 ) + Test.MethodTested("getName()", bOK) + + Test.StartMethod("setName()") + bOK = true + Out.Log("nameToSet is '" + cNewName + "'") + + if (cNewName = "fixed") then + Out.Log("Object " + cObjectName + " has fixed name.") + on error goto ex1: + Out.Log("Trying to change fixed name") + oObj.setName(cNewName) + Out.Log("After setting name, oObj.Name is '" + oObj.Name + "'") + bOK = bOK AND oObj.Name <> cNameToSet + if (NOT bOK) then Out.Log("Fixed name was changed! - FAILED") + goto cont1: + ex1: + Out.Log("Expected exception - OK") + resume next + cont1: + else + oObj.setName(cNewName) + Out.Log("After setting name, oObj.Name is '" + oObj.Name + "'") + bOK = bOK AND (cName <> oObj.Name) + oObj.Name = cName + bOK = bOK AND (cName = oObj.Name) + end if + Test.MethodTested("setName()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/container/XNamed/script.xlb b/qadevOOo/tests/basic/ifc/container/XNamed/script.xlb new file mode 100644 index 000000000000..6feab3be05c3 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/container/XNamed/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="container_XNamed" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="container_XNamed"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/container/XSet/container_XSet.xba b/qadevOOo/tests/basic/ifc/container/XSet/container_XSet.xba new file mode 100644 index 000000000000..0c422451bf2e --- /dev/null +++ b/qadevOOo/tests/basic/ifc/container/XSet/container_XSet.xba @@ -0,0 +1,78 @@ +<?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="container_XSet" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.container.XSet +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Out.Log("Creating enumeration... ") + oEnum = oObj.createEnumeration() + if oEnum.hasMoreElements then + oElem = oEnum.nextElement + end if + bOK = bOK AND NOT inNULL(oElem) + Out.Log("Enumeration creationg - " & bOK) + + Test.StartMethod("has()") + bOK = true + bOK = bOK AND oObj.has(oElem) + Test.MethodTested("has()", bOK) + + Test.StartMethod("remove()") + bOK = true + oObj.remove(oElem) + bOK = bOK AND NOT oObj.has(oElem) + Test.MethodTested("remove()", bOK) + + Test.StartMethod("insert()") + bOK = true + oObj.insert(oElem) + bOK = bOK AND oObj.has(oElem) + Test.MethodTested("insert()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/container/XSet/script.xlb b/qadevOOo/tests/basic/ifc/container/XSet/script.xlb new file mode 100644 index 000000000000..2ccfbb891f4e --- /dev/null +++ b/qadevOOo/tests/basic/ifc/container/XSet/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="container_XSet" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="container_XSet"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/datatransfer/XDataFormatTranslator/datatransfer_XDataFormatTranslator.xba b/qadevOOo/tests/basic/ifc/datatransfer/XDataFormatTranslator/datatransfer_XDataFormatTranslator.xba new file mode 100644 index 000000000000..506edac5a612 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/datatransfer/XDataFormatTranslator/datatransfer_XDataFormatTranslator.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="datatransfer_XDataFormatTranslator" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.datatransfer.XDataFormatTranslator +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim dataFlavor As new com.sun.star.datatransfer.DataFlavor + Dim oCoreRefl As Object + Dim sysDataType As Variant + Dim sysDataFlavour As Variant + + oCoreRefl = createUNOService("com.sun.star.reflection.CoreReflection") + + Test.StartMethod("getSystemDataTypeFromDataFlavor()") + bOK = true + dataFlavor.MimeType = "text/plain" + dataFlavor.HumanPresentableName = "MyDataFlavor" + + sysDataType = oObj.getSystemDataTypeFromDataFlavor(dataFlavor) + + bOK = bOK AND NOT isNULL(sysDataType) + bOK = bOK AND NOT isEmpty(sysDataType) + + if (bOK) then + Out.Log("Type of SystemDataType is: " & oCoreRefl.getType(sysDataType).Name) + else + Out.Log("Can't get system data type.") + end if + + Test.MethodTested("getSystemDataTypeFromDataFlavor()", bOK) + + Test.StartMethod("getDataFlavorFromSystemDataType()") + if (NOT bOK) then + Out.Log("Can't test getDataFlavorFromSystemDataType() without getSystemDataTypeFromDataFlavor()") + else + sysDataFlavour = oObj.getDataFlavorFromSystemDataType(sysDataType) + + bOK = bOK AND NOT isNULL(sysDataFlavour) + bOK = bOK AND NOT isEmpty(sysDataFlavour) + + if (bOK) then + Out.Log("Type of DataFlavor is: " & oCoreRefl.getType(sysDataFlavour).Name) + bOK = bOK AND oCoreRefl.getType(sysDataFlavour).Name = "com.sun.star.datatransfer.DataFlavor" + else + Out.Log("Can't get data flavor.") + end if + Test.MethodTested("getDataFlavorFromSystemDataType()", bOK) + end if + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/datatransfer/XDataFormatTranslator/script.xlb b/qadevOOo/tests/basic/ifc/datatransfer/XDataFormatTranslator/script.xlb new file mode 100644 index 000000000000..40b326cccaea --- /dev/null +++ b/qadevOOo/tests/basic/ifc/datatransfer/XDataFormatTranslator/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="datatransfer_XDataFormatTranslator" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="datatransfer_XDataFormatTranslator"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/datatransfer/XMimeContentTypeFactory/datatransfer_XMimeContentTypeFactory.xba b/qadevOOo/tests/basic/ifc/datatransfer/XMimeContentTypeFactory/datatransfer_XMimeContentTypeFactory.xba new file mode 100644 index 000000000000..84fe82fd69a3 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/datatransfer/XMimeContentTypeFactory/datatransfer_XMimeContentTypeFactory.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="datatransfer_XMimeContentTypeFactory" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.datatransfer.XMimeContentTypeFactory +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim sMIMEType As String + Dim oMIMEType As Object + + + Test.StartMethod("createMimeContentType()") + bOK = true + sMIMEType = "text/plain" + oMIMEType = oObj.createMimeContentType(sMIMEType) + bOK = bOK AND hasUNOInterfaces(oMIMEType, "com.sun.star.datatransfer.XMimeContentType") + Test.MethodTested("createMimeContentType()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/datatransfer/XMimeContentTypeFactory/script.xlb b/qadevOOo/tests/basic/ifc/datatransfer/XMimeContentTypeFactory/script.xlb new file mode 100644 index 000000000000..c05f05e37f9c --- /dev/null +++ b/qadevOOo/tests/basic/ifc/datatransfer/XMimeContentTypeFactory/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="datatransfer_XMimeContentTypeFactory" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="datatransfer_XMimeContentTypeFactory"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/datatransfer/clipboard/XClipboard/datatransfer_clipboard_XClipboard.xba b/qadevOOo/tests/basic/ifc/datatransfer/clipboard/XClipboard/datatransfer_clipboard_XClipboard.xba new file mode 100644 index 000000000000..775071a010a2 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/datatransfer/clipboard/XClipboard/datatransfer_clipboard_XClipboard.xba @@ -0,0 +1,105 @@ +<?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="datatransfer_clipboard_XClipboard" 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 + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' - Global oOwner As Object +' Global trans1 As Object +' Global trans2 As Object + +'************************************************************************* + + + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.datatransfer.clipboard.XClipboard +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim transDat1 As Variant, transDat2 As Variant, trans As Variant + Dim cont As Variant + +' owner = createUnoService("basichelper.ClipboardOwner") + + transDat1 = trans1.getTransferData(NULL_OBJECT) + transDat2 = trans2.getTransferData(NULL_OBJECT) + + Test.StartMethod("setContents()") + bOK = true + oObj.setContents(trans1, NULL_OBJECT) + wait(500) + + 'Out.Log(owner.hasElements()) + +' trans = oOwner.getByName("transferable") +' bOK = bOK AND (trans.getTransferData(NULL_OBJECT) = transDat1) + + Test.StartMethod("getContents()") + bOK = true + trans = oObj.getContents() + +' msgbox trans.dbg_supportedInterfaces() + + bOK = bOK AND (trans.getTransferData(NULL_OBJECT) = transDat1) + Test.MethodTested("setContents()", bOK) + Test.MethodTested("getContents()", bOK) + + Test.StartMethod("getName()") + Dim cbName As String + + bOK = true + cbName = oObj.getName() + Out.Log("The name of clipboard is '" + cbName + "'") + Test.MethodTested("getName()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/datatransfer/clipboard/XClipboard/script.xlb b/qadevOOo/tests/basic/ifc/datatransfer/clipboard/XClipboard/script.xlb new file mode 100644 index 000000000000..0652aa0bfc1d --- /dev/null +++ b/qadevOOo/tests/basic/ifc/datatransfer/clipboard/XClipboard/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="datatransfer_clipboard_XClipboard" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="datatransfer_clipboard_XClipboard"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/datatransfer/clipboard/XClipboardEx/datatransfer_clipboard_XClipboardEx.xba b/qadevOOo/tests/basic/ifc/datatransfer/clipboard/XClipboardEx/datatransfer_clipboard_XClipboardEx.xba new file mode 100644 index 000000000000..1347630e9271 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/datatransfer/clipboard/XClipboardEx/datatransfer_clipboard_XClipboardEx.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="datatransfer_clipboard_XClipboardEx" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.datatransfer.clipboard.XClipboardEx +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim iCap As Integer + + + Test.StartMethod("getRenderingCapabilities()") + bOK = true + iCap = oObj.getRenderingCapabilities() + Out.Log("Returned flag is " & iCap) + bOK = bOK AND (((iCap AND com.sun.star.datatransfer.clipboard.RenderingCapabilities.Delayed) <> 0) OR _ + ((iCap AND com.sun.star.datatransfer.clipboard.RenderingCapabilities.Persistant)> 0)) + Test.MethodTested("getRenderingCapabilities()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/datatransfer/clipboard/XClipboardEx/script.xlb b/qadevOOo/tests/basic/ifc/datatransfer/clipboard/XClipboardEx/script.xlb new file mode 100644 index 000000000000..f0afac5881f2 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/datatransfer/clipboard/XClipboardEx/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="datatransfer_clipboard_XClipboardEx" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="datatransfer_clipboard_XClipboardEx"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/datatransfer/clipboard/XClipboardNotifier/datatransfer_clipboard_XClipboardNotifier.xba b/qadevOOo/tests/basic/ifc/datatransfer/clipboard/XClipboardNotifier/datatransfer_clipboard_XClipboardNotifier.xba new file mode 100644 index 000000000000..e42fc02691d6 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/datatransfer/clipboard/XClipboardNotifier/datatransfer_clipboard_XClipboardNotifier.xba @@ -0,0 +1,133 @@ +<?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="datatransfer_clipboard_XClipboardNotifier" 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. +' +'************************************************************************* +'************************************************************************* + + + + +Dim iCB1_changedContents As Integer +Dim iCB2_changedContents As Integer +Dim bListenerWasCalled As Boolean + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.datatransfer.clipboard.XClipboardNotifier +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim oListener1 As Object + Dim oListener2 As Object + Dim iTime As Integer + + iCB1_changedContents = 0 : iCB2_changedContents = 0 + + oListener1 = createUNOListener("CB1_", "com.sun.star.datatransfer.clipboard.XClipboardListener") + oListener2 = createUNOListener("CB2_", "com.sun.star.datatransfer.clipboard.XClipboardListener") + + Test.StartMethod("addClipboardListener()") + bOK = true + Out.Log("Adding two listeners...") + oObj.addClipboardListener(oListener1) + oObj.addClipboardListener(oListener2) + if (bPerformInteractiveTests) then + bListenerWasCalled = false + MsgBox("After closing this window try to copy something into clipboard... You have aprox. 10 sec. for this...") + iTime = 0 + while ((NOT bListenerWasCalled) AND (iTime < 10)) + wait 1000 + iTime = iTime + 1 + wend + if (NOT bListenerWasCalled) then + Out.Log("No listener was called in 10 sec!") + MsgBox("No listener was called in 10 sec!") + bOK = false + else + MsgBox("Listener was called!") + bOK = bOK AND (iCB1_changedContents = 1) AND (iCB2_changedContents = 1) + end if + else + Out.Log("This is an interactive test. To test this use parameter PERFORMINTERACTIVETESTS in ini file.") + end if + Test.MethodTested("addClipboardListener()", bOK) + + Test.StartMethod("removeClipboardListener()") + bOK = true + iCB1_changedContents = 0 : iCB2_changedContents = 0 + + Out.Log("Removing second listener...") + oObj.removeClipboardListener(oListener2) + if (bPerformInteractiveTests) then + bListenerWasCalled = false + MsgBox("Repeat again: After closing this window try to copy something into clipboard... You have aprox. 10 sec. for this...") + iTime = 0 + while ((NOT bListenerWasCalled) AND (iTime < 10)) + wait 1000 + iTime = iTime + 1 + wend + if (NOT bListenerWasCalled) then + Out.Log("No listener was called in 10 sec!") + MsgBox("No listener was called in 10 sec!") + bOK = false + else + MsgBox("Listener was called!") + bOK = bOK AND (iCB1_changedContents = 1) AND (iCB2_changedContents = 0) + end if + else + Out.Log("This is an interactive test. To test this use parameter PERFORMINTERACTIVETESTS in ini file.") + end if + Test.MethodTested("removeClipboardListener()", bOK) + + Out.Log("Removing first listener...") + oObj.removeClipboardListener(oListener1) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub + +Sub CB1_changedContents(event As Object) + iCB1_changedContents = iCB1_changedContents + 1 + Out.Log("CB1_changedContents() was called!") + bListenerWasCalled = true +End Sub + +Sub CB2_changedContents(event As Object) + iCB2_changedContents = iCB2_changedContents + 1 + Out.Log("CB2_changedContents() was called!") + bListenerWasCalled = true +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/datatransfer/clipboard/XClipboardNotifier/script.xlb b/qadevOOo/tests/basic/ifc/datatransfer/clipboard/XClipboardNotifier/script.xlb new file mode 100644 index 000000000000..59f680bb9471 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/datatransfer/clipboard/XClipboardNotifier/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="datatransfer_clipboard_XClipboardNotifier" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="datatransfer_clipboard_XClipboardNotifier"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/datatransfer/clipboard/XFlushableClipboard/datatransfer_clipboard_XFlushableClipboard.xba b/qadevOOo/tests/basic/ifc/datatransfer/clipboard/XFlushableClipboard/datatransfer_clipboard_XFlushableClipboard.xba new file mode 100644 index 000000000000..587eda1771c0 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/datatransfer/clipboard/XFlushableClipboard/datatransfer_clipboard_XFlushableClipboard.xba @@ -0,0 +1,67 @@ +<?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="datatransfer_clipboard_XFlushableClipboard" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.datatransfer.clipboard.XFlushableClipboard +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + Test.StartMethod("flushClipboard()") + bOK = true + + if ((oObj.getRenderingCapabilities() AND com.sun.star.datatransfer.clipboard.RenderingCapabilities.Persistant) <> 0) then + oObj.flushClipboard() + else + Out.Log("getRenderingCapabilities() doesn't return Persistant. this " & _ + "interface is only available if the method getRenderingCapabilities " & _ + "of the interface XClipboardEx returns Persistant") + end if + + Test.MethodTested("flushClipboard()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/datatransfer/clipboard/XFlushableClipboard/script.xlb b/qadevOOo/tests/basic/ifc/datatransfer/clipboard/XFlushableClipboard/script.xlb new file mode 100644 index 000000000000..a84b1c6c93b5 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/datatransfer/clipboard/XFlushableClipboard/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="datatransfer_clipboard_XFlushableClipboard" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="datatransfer_clipboard_XFlushableClipboard"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/document/DocumentInfo/document_DocumentInfo.xba b/qadevOOo/tests/basic/ifc/document/DocumentInfo/document_DocumentInfo.xba new file mode 100644 index 000000000000..4364dae08e03 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/document/DocumentInfo/document_DocumentInfo.xba @@ -0,0 +1,206 @@ +<?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="document_DocumentInfo" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.document.DocumentInfo +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim pval As Variant, resVal As Variant + + PropertyTester.TestProperty("Author") + + PropertyTester.TestProperty("BlindCopiesTo") + + PropertyTester.TestProperty("CopyTo") + + testDateTime("CreationDate") + + PropertyTester.TestProperty("Description") + + PropertyTester.TestProperty("InReplyTo") + + PropertyTester.TestProperty("Keywords") + + PropertyTester.TestProperty("MIMEType") + + testDateTime("ModifyDate") + + PropertyTester.TestProperty("ModifiedBy") + + PropertyTester.TestProperty("Newsgroups") + + PropertyTester.TestProperty("Original") + + Test.StartMethod("Priority") + + bOK =true + + pval = oObj.Priority + Out.Log("Was:" + pval) + oObj.Priority = pval + 1 + resVal = oObj.Priority + Out.Log("Res:" + resVal) + bOK = bOK AND (pval + 1 = resVal) + + Test.MethodTested("Priority", bOK) + + PropertyTester.TestProperty("Recipient") + + PropertyTester.TestProperty("References") + + PropertyTester.TestProperty("ReplyTo") + + PropertyTester.TestProperty("Theme") + + PropertyTester.TestProperty("Title") + + PropertyTester.TestProperty("Template") + + testDateTime("TemplateDate") + + PropertyTester.TestProperty("IsEncrypted") + + testDateTime("PrintDate") + + PropertyTester.TestProperty("PrintedBy") + + PropertyTester.TestProperty("AutoloadEnabled") + + PropertyTester.TestProperty("AutoloadURL") + + Test.StartMethod("AutoloadSecs") + + bOK =true + + pval = oObj.AutoloadSecs + Out.Log("Was:" + pval) + oObj.AutoloadSecs = pval + 10 + resVal = oObj.AutoloadSecs + Out.Log("Res:" + resval) + bOK = bOK AND (pval + 10 = resVal) + + Test.MethodTested("AutoloadSecs", bOK) + + PropertyTester.TestProperty("DefaultTarget") + + PropertyTester.TestProperty("Generator") + + PropertyTester.TestProperty("CreationDate") + + PropertyTester.TestProperty("Subject") + + PropertyTester.TestProperty("Language") + + PropertyTester.TestProperty("ModifyDate") + + PropertyTester.TestProperty("PrintDate") + + PropertyTester.TestProperty("TemplateDate") + +Exit Sub +ErrHndl: + Test.Exception() + resume next +End Sub + +Sub testDateTime(propName As String) + Dim oldVal As Variant, resVal As Variant + Dim newVal As New com.sun.star.util.DateTime + Dim bOK As Boolean + bOK = true + + Test.StartMethod(propName) + + oldVal = oObj.getPropertyValue(propName) + Out.Log("OldVal :" + dateTime2String(oldVal)) + if isNull(oldVal) then + newVal.Year = 2001 + newVal.Month = 11 + newVal.Day = 12 + newVal.Hours = 16 + newVal.Minutes = 14 + newVal.Seconds = 48 + newVal.HundredthSeconds = 0 + else + newVal.Year = oldVal.Year + newVal.Month = oldVal.Month + newVal.Day = oldVal.Day + newVal.Hours = oldVal.Hours + newVal.Minutes = oldVal.Minutes + newVal.HundredthSeconds = oldVal.HundredthSeconds + newVal.Seconds = oldVal.Seconds + 1 + if (newVal.Seconds > 59) then newVal.Seconds = 0 + end if + + Out.Log("NewVal :" + dateTime2String(newVal)) + oObj.setPropertyValue(propName, newVal) + resVal = oObj.getPropertyValue(propName) + Out.Log("ResVal :" + dateTime2String(resVal)) + + bOK = bOK AND (newVal.Year = resVal.Year) + bOK = bOK AND (newVal.Month = resVal.Month) + bOK = bOK AND (newVal.Day = resVal.Day) + bOK = bOK AND (newVal.Hours = resVal.Hours) + bOK = bOK AND (newVal.Minutes = resVal.Minutes) + bOK = bOK AND (newVal.Seconds = resVal.Seconds) + bOK = bOK AND (newVal.HundredthSeconds = resVal.HundredthSeconds) + +' ### The following property was not found in correspond IDL file! ### + Test.MethodTested(propName, bOK) + + Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub + +Function dateTime2String (dT As Variant) As String + + dateTime2String = "" + dT.Day + "." + dT.Month + "." + dT.Year + _ + " " + dT.Hours + ":" + dT.Minutes + ":" + dT.Seconds + "." + _ + dT.HundredthSeconds + +End Function +</script:module> diff --git a/qadevOOo/tests/basic/ifc/document/DocumentInfo/script.xlb b/qadevOOo/tests/basic/ifc/document/DocumentInfo/script.xlb new file mode 100644 index 000000000000..ea8a16fe0ef1 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/document/DocumentInfo/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="document_DocumentInfo" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="document_DocumentInfo"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/document/OfficeDocument/document_OfficeDocument.xba b/qadevOOo/tests/basic/ifc/document/OfficeDocument/document_OfficeDocument.xba new file mode 100644 index 000000000000..a0130a98c040 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/document/OfficeDocument/document_OfficeDocument.xba @@ -0,0 +1,55 @@ +<?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="document_OfficeDocument" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.document.OfficeDocument +'************************************************************************* +On Error Goto ErrHndl + PropertyTester.TestProperty("AutomaticControlFocus") + PropertyTester.TestProperty("ApplyFormDesignMode") +Exit Sub +ErrHndl: + Test.Exception() + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/document/OfficeDocument/script.xlb b/qadevOOo/tests/basic/ifc/document/OfficeDocument/script.xlb new file mode 100644 index 000000000000..543fca16b872 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/document/OfficeDocument/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="document_OfficeDocument" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="document_OfficeDocument"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/document/XActionLockable/document_XActionLockable.xba b/qadevOOo/tests/basic/ifc/document/XActionLockable/document_XActionLockable.xba new file mode 100644 index 000000000000..b395819bb6b5 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/document/XActionLockable/document_XActionLockable.xba @@ -0,0 +1,85 @@ +<?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="document_XActionLockable" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.document.XActionLockable +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim bResetOK As Boolean + + Test.StartMethod("resetActionLocks()") + bOK = true + oObj.resetActionLocks() + bResetOK = bOK + + Test.StartMethod("isActionLocked()") + Test.StartMethod("addActionLock()") + bOK = true + bOK = bOK AND NOT oObj.isActionLocked() + oObj.addActionLock() + bOK = bOK AND oObj.isActionLocked() + Test.MethodTested("addActionLock()", bOK) + Test.MethodTested("isActionLocked()", bOK) + + Test.StartMethod("removeActionLock()") + bOK = true + oObj.removeActionLock() + bOK = bOK AND NOT oObj.isActionLocked() + Test.MethodTested("removeActionLock()", bOK) + + Test.StartMethod("setActionLocks()") + bOK = true + oObj.setActionLocks(5) + bOK = bOK AND oObj.resetActionLocks() = 5 + bResetOK = bResetOK AND bOK + Test.MethodTested("setActionLocks()", bOK) + Test.MethodTested("resetActionLocks()", bResetOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/document/XActionLockable/script.xlb b/qadevOOo/tests/basic/ifc/document/XActionLockable/script.xlb new file mode 100644 index 000000000000..e10e4c90a117 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/document/XActionLockable/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="document_XActionLockable" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="document_XActionLockable"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/document/XDocumentInfo/document_XDocumentInfo.xba b/qadevOOo/tests/basic/ifc/document/XDocumentInfo/document_XDocumentInfo.xba new file mode 100644 index 000000000000..42b8f25b0bf3 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/document/XDocumentInfo/document_XDocumentInfo.xba @@ -0,0 +1,94 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="document_XDocumentInfo" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.document.XDocumentInfo +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim fieldCnt As Variant + Dim oldProp As String, newProp As String, resProp As String + + Test.StartMethod("getUserFieldCount()") + bOK = true + fieldCnt = oObj.getUserFieldCount() + bOK = bOK AND (fieldCnt > 0) + Test.MethodTested("getUserFieldCount()", bOK) + + Test.StartMethod("getUserFieldName()") + bOK = true + oldProp = oObj.getUserFieldName(0) + bOK = bOK AND NOT isNull(oldProp) + Test.MethodTested("getUserFieldName()", bOK) + + Test.StartMethod("setUserFieldName()") + bOK = true + newProp = "_" + oldProp + oObj.setUserFieldName(0, newProp) + resProp = oObj.getUserFieldName(0) + Out.Log("Was: '" + oldProp + "', New: '" + newProp + "', Get: '" + resProp + "'") + bOK = bOK AND (resProp = newProp) + Test.MethodTested("setUserFieldName()", bOK) + + Test.StartMethod("getUserFieldValue()") + bOK = true + oldProp = oObj.getUserFieldValue(0) + bOK = bOK AND NOT isNull(oldProp) + Test.MethodTested("getUserFieldValue()", bOK) + + Test.StartMethod("setUserFieldValue()") + bOK = true + newProp = "_" + oldProp + oObj.setUserFieldValue(0, newProp) + resProp = oObj.getUserFieldValue(0) + Out.Log("Was: '" + oldProp + "', New: '" + newProp + "', Get: '" + resProp + "'") + bOK = bOK AND (resProp = newProp) + Test.MethodTested("setUserFieldValue()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/document/XDocumentInfo/script.xlb b/qadevOOo/tests/basic/ifc/document/XDocumentInfo/script.xlb new file mode 100644 index 000000000000..812b5ccb7e7e --- /dev/null +++ b/qadevOOo/tests/basic/ifc/document/XDocumentInfo/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="document_XDocumentInfo" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="document_XDocumentInfo"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/document/XDocumentInfoSupplier/document_XDocumentInfoSupplier.xba b/qadevOOo/tests/basic/ifc/document/XDocumentInfoSupplier/document_XDocumentInfoSupplier.xba new file mode 100644 index 000000000000..20199ab5d306 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/document/XDocumentInfoSupplier/document_XDocumentInfoSupplier.xba @@ -0,0 +1,61 @@ +<?xml version="1.0" encoding="UTF-8"?> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="document_XDocumentInfoSupplier" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.document.XDocumentInfoSupplier +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + Test.StartMethod("getDocumentInfo()") + bOK = TRUE + bOK = bOK AND isObject(oObj.getDocumentInfo()) + Test.MethodTested("getDocumentInfo()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/document/XDocumentInfoSupplier/script.xlb b/qadevOOo/tests/basic/ifc/document/XDocumentInfoSupplier/script.xlb new file mode 100644 index 000000000000..3b44c76a9c99 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/document/XDocumentInfoSupplier/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="document_XDocumentInfoSupplier" library:readonly="false" library:passwordprotected="false"> + <library:element library:name="document_XDocumentInfoSupplier"/> + </library:library> diff --git a/qadevOOo/tests/basic/ifc/document/XDocumentInsertable/document_XDocumentInsertable.xba b/qadevOOo/tests/basic/ifc/document/XDocumentInsertable/document_XDocumentInsertable.xba new file mode 100644 index 000000000000..f2f508bc0f65 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/document/XDocumentInsertable/document_XDocumentInsertable.xba @@ -0,0 +1,64 @@ +<?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="document_XDocumentInsertable" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.document.XDocumentInsertable +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim sURL As String + + Test.StartMethod("insertDocumentFromURL()") + bOK = true + sURL = utils.Path2URL(cTestDocsDir + "SwXTextSection.sdw") + oObj.insertDocumentFromURL(sURL, DimArray()) + bOK = bOK AND InStr(oDoc.Text.String, "SwXTextSection") > 0 + Test.MethodTested("insertDocumentFromURL()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/document/XDocumentInsertable/script.xlb b/qadevOOo/tests/basic/ifc/document/XDocumentInsertable/script.xlb new file mode 100644 index 000000000000..4ad1f6c4b1ae --- /dev/null +++ b/qadevOOo/tests/basic/ifc/document/XDocumentInsertable/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="document_XDocumentInsertable" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="document_XDocumentInsertable"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/document/XEmbeddedObjectSupplier/document_XEmbeddedObjectSupplier.xba b/qadevOOo/tests/basic/ifc/document/XEmbeddedObjectSupplier/document_XEmbeddedObjectSupplier.xba new file mode 100644 index 000000000000..bc962faf4660 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/document/XEmbeddedObjectSupplier/document_XEmbeddedObjectSupplier.xba @@ -0,0 +1,64 @@ +<?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="document_XEmbeddedObjectSupplier" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.document.XEmbeddedObjectSupplier +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim oEObj As Object + + Test.StartMethod("getEmbeddedObject()") + bOK = true + oEObj = oObj.getEmbeddedObject() + bOK = bOK AND NOT isNULL(oEObj) + bOK = bOK AND hasUnoInterfaces(oEObj, "com.sun.star.lang.XComponent") + Test.MethodTested("getEmbeddedObject()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/document/XEmbeddedObjectSupplier/script.xlb b/qadevOOo/tests/basic/ifc/document/XEmbeddedObjectSupplier/script.xlb new file mode 100644 index 000000000000..6cb0db4671af --- /dev/null +++ b/qadevOOo/tests/basic/ifc/document/XEmbeddedObjectSupplier/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="document_XEmbeddedObjectSupplier" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="document_XEmbeddedObjectSupplier"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/document/XEventsSupplier/document_XEventsSupplier.xba b/qadevOOo/tests/basic/ifc/document/XEventsSupplier/document_XEventsSupplier.xba new file mode 100644 index 000000000000..f36518f9debb --- /dev/null +++ b/qadevOOo/tests/basic/ifc/document/XEventsSupplier/document_XEventsSupplier.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="document_XEventsSupplier" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.document.XEventsSupplier +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Test.StartMethod("getEvents()") + bOK = true + bOK = bOK AND hasUnoInterfaces(oObj.getEvents(), "com.sun.star.container.XNameReplace") + Test.MethodTested("getEvents()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/document/XEventsSupplier/script.xlb b/qadevOOo/tests/basic/ifc/document/XEventsSupplier/script.xlb new file mode 100644 index 000000000000..9962039c40a8 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/document/XEventsSupplier/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="document_XEventsSupplier" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="document_XEventsSupplier"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/document/XExporter/document_XExporter.xba b/qadevOOo/tests/basic/ifc/document/XExporter/document_XExporter.xba new file mode 100644 index 000000000000..d69d1676cc97 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/document/XExporter/document_XExporter.xba @@ -0,0 +1,71 @@ +<?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="document_XExporter" 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 + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' - Global oSrcDocument As Object + +'************************************************************************* + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.document.XExporter +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Test.StartMethod("setSourceDocument()") + bOK = true + oObj.setSourceDocument(oSrcDocument) + Test.MethodTested("setSourceDocument()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/document/XExporter/script.xlb b/qadevOOo/tests/basic/ifc/document/XExporter/script.xlb new file mode 100644 index 000000000000..cbf12e52cd18 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/document/XExporter/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="document_XExporter" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="document_XExporter"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/document/XFilter/document_XFilter.xba b/qadevOOo/tests/basic/ifc/document/XFilter/document_XFilter.xba new file mode 100644 index 000000000000..d6eb1e62d281 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/document/XFilter/document_XFilter.xba @@ -0,0 +1,89 @@ +<?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="document_XFilter" 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 + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' - Global oFilterDescriptor As Variant +' - Global oDocHandler As Object + +'************************************************************************* + + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.document.XFilter +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim iniParam(1) as Variant + Dim oFilter as Object + + Test.StartMethod("filter()") + bOK = true + bOK = bOK AND oObj.filter(oFilterDescriptor) + bOK = bOK AND checkFilter() + + Test.MethodTested("filter()", bOK) + Test.StartMethod("cancel()") + bOK = true + + oFilter = createUnoService("basichelper.Filter") + + iniParam(0) = oObj + iniParam(1) = oFilterDescriptor + oFilter.initialize(iniParam()) + oObj.Cancel() + + bOK = bOK AND NOT oFilter.getByName("Result") + Test.MethodTested("cancel()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/document/XFilter/script.xlb b/qadevOOo/tests/basic/ifc/document/XFilter/script.xlb new file mode 100644 index 000000000000..0375a4bdac03 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/document/XFilter/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="document_XFilter" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="document_XFilter"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/document/XImporter/document_XImporter.xba b/qadevOOo/tests/basic/ifc/document/XImporter/document_XImporter.xba new file mode 100644 index 000000000000..7ee18b8e87b5 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/document/XImporter/document_XImporter.xba @@ -0,0 +1,71 @@ +<?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="document_XImporter" 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 + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' - Global oSrcDocument As Object + +'************************************************************************* + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.document.XImporter +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Test.StartMethod("setTargetDocument()") + bOK = true + oObj.setTargetDocument(oSrcDocument) + Test.MethodTested("setTargetDocument()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/document/XImporter/script.xlb b/qadevOOo/tests/basic/ifc/document/XImporter/script.xlb new file mode 100644 index 000000000000..cd4492011a8a --- /dev/null +++ b/qadevOOo/tests/basic/ifc/document/XImporter/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="document_XImporter" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="document_XImporter"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/document/XLinkTargetSupplier/document_XLinkTargetSupplier.xba b/qadevOOo/tests/basic/ifc/document/XLinkTargetSupplier/document_XLinkTargetSupplier.xba new file mode 100644 index 000000000000..5ca9bed047e5 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/document/XLinkTargetSupplier/document_XLinkTargetSupplier.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="document_XLinkTargetSupplier" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.document.XLinkTargetSupplier +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Test.StartMethod("getLinks()") + bOK = true + oLinks = oObj.getLinks() + bOK = bOK AND isObject(oLinks) + bOK = bOK AND hasUnoInterfaces(oLinks, "com.sun.star.container.XNameAccess") + Test.MethodTested("getLinks()", bOK) + + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/document/XLinkTargetSupplier/script.xlb b/qadevOOo/tests/basic/ifc/document/XLinkTargetSupplier/script.xlb new file mode 100644 index 000000000000..bbf245a7347b --- /dev/null +++ b/qadevOOo/tests/basic/ifc/document/XLinkTargetSupplier/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="document_XLinkTargetSupplier" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="document_XLinkTargetSupplier"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/document/XMimeTypeInfo/document_XMimeTypeInfo.xba b/qadevOOo/tests/basic/ifc/document/XMimeTypeInfo/document_XMimeTypeInfo.xba new file mode 100644 index 000000000000..e2ba8676a170 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/document/XMimeTypeInfo/document_XMimeTypeInfo.xba @@ -0,0 +1,67 @@ +<?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="document_XMimeTypeInfo" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.document.XMimeTypeInfo +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Test.StartMethod("getSupportedMimeTypeNames()") + Dim names As Variant + names = oObj.getSupportedMimeTypeNames() + bOK = ubound(names) > 0 + out.log("Number of supported mime types: " + ubound(names)) + Test.MethodTested("getSupportedMimeTypeNames()", bOK) + + Test.StartMethod("supportsMimeType()") + bOK = oObj.supportsMimeType(names(0)) + Test.MethodTested("supportsMimeType()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/document/XMimeTypeInfo/script.xlb b/qadevOOo/tests/basic/ifc/document/XMimeTypeInfo/script.xlb new file mode 100644 index 000000000000..8257ee12fc6b --- /dev/null +++ b/qadevOOo/tests/basic/ifc/document/XMimeTypeInfo/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="document_XMimeTypeInfo" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="document_XMimeTypeInfo"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/document/XStandaloneDocumentInfo/document_XStandaloneDocumentInfo.xba b/qadevOOo/tests/basic/ifc/document/XStandaloneDocumentInfo/document_XStandaloneDocumentInfo.xba new file mode 100644 index 000000000000..8ccb9db3d012 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/document/XStandaloneDocumentInfo/document_XStandaloneDocumentInfo.xba @@ -0,0 +1,85 @@ +<?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="document_XStandaloneDocumentInfo" 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 + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' - Global documentURL As String + +'************************************************************************* + + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.document.XStandaloneDocumentInfo +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim oldProp As Variant, newProp As Variant, resProp As Variant + + Test.StartMethod("loadFromURL()") + Test.StartMethod("storeIntoURL()") + + bOK = true + oObj.loadFromURL(documentURL) + oldProp = oObj.Author + newProp = oldProp + "_" + oObj.Author = newProp + oObj.storeIntoURL(documentURL) + oObj.loadFromURL(documentURL) + resProp = oObj.Author + Out.Log("Was: '" + oldProp + "',Set: '" + newProp + "', New: " + resProp + "'") + bOK = bOK AND (resProp = newProp) + + Test.MethodTested("loadFromURL()", bOK) + Test.MethodTested("storeIntoURL()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/document/XStandaloneDocumentInfo/script.xlb b/qadevOOo/tests/basic/ifc/document/XStandaloneDocumentInfo/script.xlb new file mode 100644 index 000000000000..76eb171f19a2 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/document/XStandaloneDocumentInfo/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="document_XStandaloneDocumentInfo" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="document_XStandaloneDocumentInfo"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/document/XTypeDetection/document_XTypeDetection.xba b/qadevOOo/tests/basic/ifc/document/XTypeDetection/document_XTypeDetection.xba new file mode 100644 index 000000000000..f6cb7a6099cc --- /dev/null +++ b/qadevOOo/tests/basic/ifc/document/XTypeDetection/document_XTypeDetection.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="document_XTypeDetection" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.document.XTypeDetection +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Test.StartMethod("queryTypeByURL()") + bOK = true + Dim docURL As String + docURL = Path2URL(cTestDocsDir) + "XTypeDetection.sxw" + + Dim typ As String + typ = oObj.queryTypeByURL(docURL) + Out.log("queryTypeByURL(" + docURL + "): " + typ) + bOK = instr(typ, "writer") > 0 + Test.MethodTested("queryTypeByURL()", bOK) + + Test.StartMethod("queryTypeByDescriptor()") + Dim mediaDescr(0) As new com.sun.star.beans.PropertyValue + mediaDescr(0).Name = "URL" + mediaDescr(0).Value = docURL + typ = oObj.queryTypeByDescriptor(mediaDescr(), false) + Out.log("queryTypeByDescriptor(descr, false): " + typ) + bOK = instr(typ, "writer") > 0 + typ = oObj.queryTypeByDescriptor(mediaDescr(), true) + Out.log("queryTypeByDescriptor(descr, false): " + typ) + bOK = instr(typ, "calc") > 0 + Test.MethodTested("queryTypeByDescriptor()", bOK) +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/document/XTypeDetection/script.xlb b/qadevOOo/tests/basic/ifc/document/XTypeDetection/script.xlb new file mode 100644 index 000000000000..aa9d1b3da865 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/document/XTypeDetection/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="document_XTypeDetection" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="document_XTypeDetection"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/document/XViewDataSupplier/document_XViewDataSupplier.xba b/qadevOOo/tests/basic/ifc/document/XViewDataSupplier/document_XViewDataSupplier.xba new file mode 100644 index 000000000000..1142755128a9 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/document/XViewDataSupplier/document_XViewDataSupplier.xba @@ -0,0 +1,62 @@ +<?xml version="1.0" encoding="UTF-8"?> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="document_XViewDataSupplier" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.document.XViewDataSupplier +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim oDat as Object + + Test.StartMethod("getViewData()") + bOK = TRUE + oDat = oObj.getViewData() + bOK = bOK AND hasUnoInterfaces(oDat, "com.sun.star.container.XIndexAccess") + Test.MethodTested("getViewData()", bOK) + + Test.StartMethod("setViewData()") + bOK = TRUE + oObj.setViewData(oDat) + Test.MethodTested("setViewData()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/document/XViewDataSupplier/script.xlb b/qadevOOo/tests/basic/ifc/document/XViewDataSupplier/script.xlb new file mode 100644 index 000000000000..e1afb0f1af9f --- /dev/null +++ b/qadevOOo/tests/basic/ifc/document/XViewDataSupplier/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="document_XViewDataSupplier" library:readonly="false" library:passwordprotected="false"> + <library:element library:name="document_XViewDataSupplier"/> + </library:library> diff --git a/qadevOOo/tests/basic/ifc/drawing/ConnectorProperties/drawing_ConnectorProperties.xba b/qadevOOo/tests/basic/ifc/drawing/ConnectorProperties/drawing_ConnectorProperties.xba new file mode 100644 index 000000000000..768064a4c1f4 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/drawing/ConnectorProperties/drawing_ConnectorProperties.xba @@ -0,0 +1,75 @@ +<?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="drawing_ConnectorProperties" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.drawing.ConnectorProperties +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Test.StartMethod("EdgeKind") + bOK = true + + oObj.EdgeKind = com.sun.star.drawing.ConnectorType.STANDARD + bOK = bOK AND oObj.EdgeKind = com.sun.star.drawing.ConnectorType.STANDARD + + oObj.EdgeKind = com.sun.star.drawing.ConnectorType.LINES + bOK = bOK AND oObj.EdgeKind = com.sun.star.drawing.ConnectorType.LINES + + Test.MethodTested("EdgeKind", bOK) + + PropertyTester.TestProperty("EdgeNode1HorzDist") + + PropertyTester.TestProperty("EdgeNode1VertDist") + + PropertyTester.TestProperty("EdgeNode2HorzDist") + + PropertyTester.TestProperty("EdgeNode2VertDist") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/drawing/ConnectorProperties/script.xlb b/qadevOOo/tests/basic/ifc/drawing/ConnectorProperties/script.xlb new file mode 100644 index 000000000000..8486237b69e7 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/drawing/ConnectorProperties/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="drawing_ConnectorProperties" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="drawing_ConnectorProperties"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/drawing/ConnectorShape/drawing_ConnectorShape.xba b/qadevOOo/tests/basic/ifc/drawing/ConnectorShape/drawing_ConnectorShape.xba new file mode 100644 index 000000000000..6109e3548b54 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/drawing/ConnectorShape/drawing_ConnectorShape.xba @@ -0,0 +1,74 @@ +<?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="drawing_ConnectorShape" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.drawing.ConnectorShape +'************************************************************************* +On Error Goto ErrHndl + + + PropertyTester.TestProperty("StartShape") + + PropertyTester.TestProperty("StartGluePointIndex", Array(0,1)) + + PropertyTester.TestProperty("StartPosition") + + PropertyTester.TestProperty("EndShape") + + PropertyTester.TestProperty("EndPosition") + + PropertyTester.TestProperty("EndGluePointIndex", Array(0,1)) + + PropertyTester.TestProperty("EdgeLine1Delta") + + PropertyTester.TestProperty("EdgeLine2Delta") + + PropertyTester.TestProperty("EdgeLine3Delta") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/drawing/ConnectorShape/script.xlb b/qadevOOo/tests/basic/ifc/drawing/ConnectorShape/script.xlb new file mode 100644 index 000000000000..6043a5acb53b --- /dev/null +++ b/qadevOOo/tests/basic/ifc/drawing/ConnectorShape/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="drawing_ConnectorShape" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="drawing_ConnectorShape"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/drawing/DrawingDocument/drawing_DrawingDocument.xba b/qadevOOo/tests/basic/ifc/drawing/DrawingDocument/drawing_DrawingDocument.xba new file mode 100644 index 000000000000..658471297968 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/drawing/DrawingDocument/drawing_DrawingDocument.xba @@ -0,0 +1,62 @@ +<?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="drawing_DrawingDocument" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.drawing.DrawingDocument +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + PropertyTester.TestProperty("TabStop") + + PropertyTester.TestProperty("CharLocale") + + PropertyTester.TestProperty("VisibleArea") + + PropertyTester.TestProperty("ForbiddenCharacters") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/drawing/DrawingDocument/script.xlb b/qadevOOo/tests/basic/ifc/drawing/DrawingDocument/script.xlb new file mode 100644 index 000000000000..91f58d890555 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/drawing/DrawingDocument/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="drawing_DrawingDocument" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="drawing_DrawingDocument"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/drawing/DrawingDocumentDrawView/drawing_DrawingDocumentDrawView.xba b/qadevOOo/tests/basic/ifc/drawing/DrawingDocumentDrawView/drawing_DrawingDocumentDrawView.xba new file mode 100644 index 000000000000..5a1491b9b715 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/drawing/DrawingDocumentDrawView/drawing_DrawingDocumentDrawView.xba @@ -0,0 +1,73 @@ +<?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="drawing_DrawingDocumentDrawView" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.drawing.DrawingDocumentDrawView +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + PropertyTester.TestProperty("IsMasterPageMode") + + PropertyTester.TestProperty("IsLayerMode") + + PropertyTester.TestProperty("CurrentPage") + + PropertyTester.TestProperty("VisibleArea") + + oObj.IsMasterPageMode = false + oObj.IsLayerMode = false + + PropertyTester.TestProperty("ZoomType") + + PropertyTester.TestProperty("ZoomValue") + + PropertyTester.TestProperty("ViewOffset") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/drawing/DrawingDocumentDrawView/script.xlb b/qadevOOo/tests/basic/ifc/drawing/DrawingDocumentDrawView/script.xlb new file mode 100644 index 000000000000..b10a16611319 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/drawing/DrawingDocumentDrawView/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="drawing_DrawingDocumentDrawView" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="drawing_DrawingDocumentDrawView"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/drawing/EllipseShape/drawing_EllipseShape.xba b/qadevOOo/tests/basic/ifc/drawing/EllipseShape/drawing_EllipseShape.xba new file mode 100644 index 000000000000..9b26d43e597d --- /dev/null +++ b/qadevOOo/tests/basic/ifc/drawing/EllipseShape/drawing_EllipseShape.xba @@ -0,0 +1,71 @@ +<?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="drawing_EllipseShape" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.drawing.EllipseShape +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Test.StartMethod("CircleKind") + bOK = true + + oObj.CircleKind = com.sun.star.drawing.CircleKind.FULL + bOK = bOK AND oObj.CircleKind = com.sun.star.drawing.CircleKind.FULL + + oObj.CircleKind = com.sun.star.drawing.CircleKind.SECTION + bOK = bOK AND oObj.CircleKind = com.sun.star.drawing.CircleKind.SECTION + + Test.MethodTested("CircleKind", bOK) + + PropertyTester.TestProperty("CircleStartAngle") + + PropertyTester.TestProperty("CircleEndAngle") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/drawing/EllipseShape/script.xlb b/qadevOOo/tests/basic/ifc/drawing/EllipseShape/script.xlb new file mode 100644 index 000000000000..d0870d674175 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/drawing/EllipseShape/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="drawing_EllipseShape" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="drawing_EllipseShape"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/drawing/FillProperties/drawing_FillProperties.xba b/qadevOOo/tests/basic/ifc/drawing/FillProperties/drawing_FillProperties.xba new file mode 100644 index 000000000000..c21e4e4e261b --- /dev/null +++ b/qadevOOo/tests/basic/ifc/drawing/FillProperties/drawing_FillProperties.xba @@ -0,0 +1,121 @@ +<?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="drawing_FillProperties" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.drawing.FillProperties +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + PropertyTester.TestProperty("FillStyle") + oObj.FillStyle = com.sun.star.drawing.FillStyle.SOLID + + PropertyTester.TestProperty("FillColor") + + PropertyTester.TestProperty("FillTransparence") + + Dim aTranspNames(1) As String + aTranspNames(0) = "Transparency 2" + aTranspNames(1) = "Transparency 1" + PropertyTester.TestProperty("FillTransparenceGradientName", aTranspNames()) + + PropertyTester.TestProperty("FillTransparenceGradient") + + Dim aGradientNames(1) As String + aGradientNames(0) = "Gradient 2" + aGradientNames(1) = "Gradient 1" + PropertyTester.TestProperty("FillGradientName", aGradientNames()) + + PropertyTester.TestProperty("FillGradient") + + Dim aHatchNames(1) As String + aHatchNames(0) = "Black 0 Degrees" + aHatchNames(1) = "Black 45 Degrees" + PropertyTester.TestProperty("FillHatchName", aHatchNames()) + + PropertyTester.TestProperty("FillHatch") + + Dim aBitmapNames(1) As String + aBitmapNames(0) = "Sky" + aBitmapNames(1) = "Metal" + PropertyTester.TestProperty("FillBitmapName", aBitmapNames()) + + PropertyTester.TestProperty("FillBitmap") + + Test.StartMethod("FillBitmapURL") + Dim sURL1 As String + Dim sURL2 As String + oObj.setPropertyValue("FillBitmapURL", utils.Path2URL(cTestDocsDir) & "crazy-blue.jpg") + sURL1 = oObj.getPropertyValue("FillBitmapURL") + oObj.setPropertyValue("FillBitmapURL", utils.Path2URL(cTestDocsDir) & "space-metal.jpg") + sURL2 = oObj.getPropertyValue("FillBitmapURL") + Test.MethodTested("FillBitmapURL", sURL1 <> sURL2) + + Dim aOffsets(1) As Integer + aOffsets(0) = 10 + aOffsets(1) = -10 + PropertyTester.TestProperty("FillBitmapOffsetX", aOffsets()) + + PropertyTester.TestProperty("FillBitmapOffsetY", aOffsets()) + + PropertyTester.TestProperty("FillBitmapPositionOffsetX", aOffsets()) + + PropertyTester.TestProperty("FillBitmapPositionOffsetY", aOffsets()) + + PropertyTester.TestProperty("FillBitmapRectanglePoint") + + PropertyTester.TestProperty("FillBitmapLogicalSize") + + PropertyTester.TestProperty("FillBitmapSizeX") + + PropertyTester.TestProperty("FillBitmapSizeY") + + PropertyTester.TestProperty("FillBitmapMode") + + PropertyTester.TestProperty("FillBackground") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/drawing/FillProperties/drawing__FillProperties.xba b/qadevOOo/tests/basic/ifc/drawing/FillProperties/drawing__FillProperties.xba new file mode 100644 index 000000000000..153acfcb9ae3 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/drawing/FillProperties/drawing__FillProperties.xba @@ -0,0 +1,121 @@ +<?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="drawing__FillProperties" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.drawing.FillProperties +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + PropertyTester.TestProperty("FillStyle") + oObj.FillStyle = com.sun.star.drawing.FillStyle.SOLID + + PropertyTester.TestProperty("FillColor") + + PropertyTester.TestProperty("FillTransparence") + + Dim aTranspNames(1) As String + aTranspNames(0) = "Transparency 2" + aTranspNames(1) = "Transparency 1" + PropertyTester.TestProperty("FillTransparenceGradientName", aTranspNames()) + + PropertyTester.TestProperty("FillTransparenceGradient") + + Dim aGradientNames(1) As String + aGradientNames(0) = "Gradient 2" + aGradientNames(1) = "Gradient 1" + PropertyTester.TestProperty("FillGradientName", aGradientNames()) + + PropertyTester.TestProperty("FillGradient") + + Dim aHatchNames(1) As String + aHatchNames(0) = "Black 0 Degrees" + aHatchNames(1) = "Black 45 Degrees" + PropertyTester.TestProperty("FillHatchName", aHatchNames()) + + PropertyTester.TestProperty("FillHatch") + + Dim aBitmapNames(1) As String + aBitmapNames(0) = "Sky" + aBitmapNames(1) = "Metal" + PropertyTester.TestProperty("FillBitmapName", aBitmapNames()) + + PropertyTester.TestProperty("FillBitmap") + + Test.StartMethod("FillBitmapURL") + Dim sURL1 As String + Dim sURL2 As String + oObj.setPropertyValue("FillBitmapURL", utils.Path2URL(cTestDocsDir) & "crazy-blue.jpg") + sURL1 = oObj.getPropertyValue("FillBitmapURL") + oObj.setPropertyValue("FillBitmapURL", utils.Path2URL(cTestDocsDir) & "space-metal.jpg") + sURL2 = oObj.getPropertyValue("FillBitmapURL") + Test.MethodTested("FillBitmapURL", sURL1 <> sURL2) + + Dim aOffsets(1) As Integer + aOffsets(0) = 10 + aOffsets(1) = -10 + PropertyTester.TestProperty("FillBitmapOffsetX", aOffsets()) + + PropertyTester.TestProperty("FillBitmapOffsetY", aOffsets()) + + PropertyTester.TestProperty("FillBitmapPositionOffsetX", aOffsets()) + + PropertyTester.TestProperty("FillBitmapPositionOffsetY", aOffsets()) + + PropertyTester.TestProperty("FillBitmapRectanglePoint") + + PropertyTester.TestProperty("FillBitmapLogicalSize") + + PropertyTester.TestProperty("FillBitmapSizeX") + + PropertyTester.TestProperty("FillBitmapSizeY") + + PropertyTester.TestProperty("FillBitmapMode") + + PropertyTester.TestProperty("FillBackground") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/drawing/FillProperties/script.xlb b/qadevOOo/tests/basic/ifc/drawing/FillProperties/script.xlb new file mode 100644 index 000000000000..5f614032af7f --- /dev/null +++ b/qadevOOo/tests/basic/ifc/drawing/FillProperties/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="drawing__FillProperties" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="drawing__FillProperties"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/drawing/GenericDrawPage/drawing_GenericDrawPage.xba b/qadevOOo/tests/basic/ifc/drawing/GenericDrawPage/drawing_GenericDrawPage.xba new file mode 100644 index 000000000000..5fd135250122 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/drawing/GenericDrawPage/drawing_GenericDrawPage.xba @@ -0,0 +1,71 @@ +<?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="drawing_GenericDrawPage" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.drawing.GenericDrawPage +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + PropertyTester.TestProperty("BorderBottom") + + PropertyTester.TestProperty("BorderLeft") + + PropertyTester.TestProperty("BorderRight") + + PropertyTester.TestProperty("BorderTop") + + PropertyTester.TestProperty("Height") + + PropertyTester.TestProperty("Width") + + PropertyTester.TestProperty("Number") + + PropertyTester.TestProperty("Orientation") + + PropertyTester.TestProperty("UserDefinedAttributes") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/drawing/GenericDrawPage/script.xlb b/qadevOOo/tests/basic/ifc/drawing/GenericDrawPage/script.xlb new file mode 100644 index 000000000000..d8c0d476a667 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/drawing/GenericDrawPage/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="drawing_GenericDrawPage" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="drawing_GenericDrawPage"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/drawing/GraphicObjectShape/drawing_GraphicObjectShape.xba b/qadevOOo/tests/basic/ifc/drawing/GraphicObjectShape/drawing_GraphicObjectShape.xba new file mode 100644 index 000000000000..2c2d98de63a8 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/drawing/GraphicObjectShape/drawing_GraphicObjectShape.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="drawing_GraphicObjectShape" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.drawing.GraphicObjectShape +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Dim bitmapURL As Variant + bitmapURL = Array(Path2URL(cTestDocsDir + "space-metal.jpg")) + PropertyTester.TestProperty("GraphicURL", bitmapURL) + + PropertyTester.TestProperty("GraphicStreamURL", bitmapURL) + + PropertyTester.TestProperty("GraphicObjectFillBitmap") + + PropertyTester.TestProperty("AdjustLuminance") + + PropertyTester.TestProperty("AdjustContrast") + + PropertyTester.TestProperty("AdjustRed") + + PropertyTester.TestProperty("AdjustGreen") + + PropertyTester.TestProperty("AdjustBlue") + + PropertyTester.TestProperty("Gamma") + + PropertyTester.TestProperty("Transparency") + + PropertyTester.TestProperty("GraphicColorMode") + + PropertyTester.TestProperty("ImageMap") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/drawing/GraphicObjectShape/script.xlb b/qadevOOo/tests/basic/ifc/drawing/GraphicObjectShape/script.xlb new file mode 100644 index 000000000000..9d98198fb73a --- /dev/null +++ b/qadevOOo/tests/basic/ifc/drawing/GraphicObjectShape/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="drawing_GraphicObjectShape" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="drawing_GraphicObjectShape"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/drawing/Layer/drawing_Layer.xba b/qadevOOo/tests/basic/ifc/drawing/Layer/drawing_Layer.xba new file mode 100644 index 000000000000..5f51a9ba1370 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/drawing/Layer/drawing_Layer.xba @@ -0,0 +1,62 @@ +<?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="drawing_Layer" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.drawing.Layer +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + PropertyTester.TestProperty("Name") + + PropertyTester.TestProperty("IsVisible") + + PropertyTester.TestProperty("IsPrintable") + + PropertyTester.TestProperty("IsLocked") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/drawing/Layer/script.xlb b/qadevOOo/tests/basic/ifc/drawing/Layer/script.xlb new file mode 100644 index 000000000000..0d4e2808bfae --- /dev/null +++ b/qadevOOo/tests/basic/ifc/drawing/Layer/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="drawing_Layer" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="drawing_Layer"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/drawing/LineProperties/drawing_LineProperties.xba b/qadevOOo/tests/basic/ifc/drawing/LineProperties/drawing_LineProperties.xba new file mode 100644 index 000000000000..753424d0d24d --- /dev/null +++ b/qadevOOo/tests/basic/ifc/drawing/LineProperties/drawing_LineProperties.xba @@ -0,0 +1,92 @@ +<?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="drawing_LineProperties" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.drawing.LineProperties +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim dash As Variant + + PropertyTester.TestProperty("LineStyle") + + dash = oObj.LineDash + dash.Style = com.sun.star.drawing.DashStyle.RECT + dash.Dots = dash.Dots + 1 + PropertyTester.TestProperty("LineDash", Array(dash)) + + PropertyTester.TestProperty("LineColor") + + PropertyTester.TestProperty("LineTransparence") + + Dim aLineWidth(1) As Integer + aLineWidth(0) = 12 + aLineWidth(1) = 7 + PropertyTester.TestProperty("LineWidth", aLineWidth()) + + PropertyTester.TestProperty("LineJoint") + + Dim LineName(0 to 1) As String + LineName(0) = "Arrow" + LineName(1) = "Square" + PropertyTester.TestProperty("LineStartName",LineName()) + + PropertyTester.TestProperty("LineStart") + + PropertyTester.TestProperty("LineEnd") + + PropertyTester.TestProperty("LineStartCenter") + + PropertyTester.TestProperty("LineStartWidth") + + PropertyTester.TestProperty("LineEndCenter") + + PropertyTester.TestProperty("LineEndWidth") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/drawing/LineProperties/script.xlb b/qadevOOo/tests/basic/ifc/drawing/LineProperties/script.xlb new file mode 100644 index 000000000000..92aa636c37b4 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/drawing/LineProperties/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="drawing_LineProperties" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="drawing_LineProperties"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/drawing/MeasureProperties/drawing_MeasureProperties.xba b/qadevOOo/tests/basic/ifc/drawing/MeasureProperties/drawing_MeasureProperties.xba new file mode 100644 index 000000000000..70f7a945d2b4 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/drawing/MeasureProperties/drawing_MeasureProperties.xba @@ -0,0 +1,120 @@ +<?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="drawing_MeasureProperties" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.drawing.MeasureProperties +'************************************************************************* +On Error Goto ErrHndl + + Dim bOK As Boolean + + PropertyTester.TestProperty("MeasureBelowReferenceEdge") + + PropertyTester.TestProperty("MeasureHelpLine1Length") + + PropertyTester.TestProperty("MeasureHelpLine2Length") + + PropertyTester.TestProperty("MeasureHelpLineDistance") + + PropertyTester.TestProperty("MeasureHelpLineOverhang") + + Test.StartMethod("MeasureKind") + bOK = true + + oObj.MeasureKind = com.sun.star.drawing.MeasureKind.STANDARD + bOK = bOK AND oObj.MeasureKind = com.sun.star.drawing.MeasureKind.STANDARD + + oObj.MeasureKind = com.sun.star.drawing.MeasureKind.RADIUS + bOK = bOK AND oObj.MeasureKind = com.sun.star.drawing.MeasureKind.RADIUS + + Test.MethodTested("MeasureKind", bOK) + + PropertyTester.TestProperty("MeasureLineDistance") + + PropertyTester.TestProperty("MeasureOverhang") + + PropertyTester.TestProperty("MeasureShowUnit") + + PropertyTester.TestProperty("MeasureTextAutoAngle") + + PropertyTester.TestProperty("MeasureTextAutoAngleView") + + PropertyTester.TestProperty("MeasureTextFixedAngle") + + Test.StartMethod("MeasureTextHorizontalPosition") + bOK = true + + oObj.MeasureTextHorizontalPosition = com.sun.star.drawing.MeasureTextHorzPos.AUTO + bOK = bOK AND oObj.MeasureTextHorizontalPosition = com.sun.star.drawing.MeasureTextHorzPos.AUTO + + oObj.MeasureTextHorizontalPosition = com.sun.star.drawing.MeasureTextHorzPos.LEFTOUTSIDE + bOK = bOK AND oObj.MeasureTextHorizontalPosition = com.sun.star.drawing.MeasureTextHorzPos.LEFTOUTSIDE + + Test.MethodTested("MeasureTextHorizontalPosition", bOK) + + Test.StartMethod("MeasureTextVerticalPosition") + bOK = true + + oObj.MeasureTextVerticalPosition = com.sun.star.drawing.MeasureTextVertPos.AUTO + bOK = bOK AND oObj.MeasureTextVerticalPosition = com.sun.star.drawing.MeasureTextVertPos.AUTO + + oObj.MeasureTextVerticalPosition = com.sun.star.drawing.MeasureTextVertPos.EAST + bOK = bOK AND oObj.MeasureTextVerticalPosition = com.sun.star.drawing.MeasureTextVertPos.EAST + + Test.MethodTested("MeasureTextVerticalPosition", bOK) + + PropertyTester.TestProperty("MeasureTextIsFixedAngle") + + PropertyTester.TestProperty("MeasureTextRotate90") + + PropertyTester.TestProperty("MeasureTextUpsideDown") + + PropertyTester.TestProperty("MeasureDecimalPlaces") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/drawing/MeasureProperties/script.xlb b/qadevOOo/tests/basic/ifc/drawing/MeasureProperties/script.xlb new file mode 100644 index 000000000000..5be031e60bb7 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/drawing/MeasureProperties/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="drawing_MeasureProperties" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="drawing_MeasureProperties"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/drawing/MeasureShape/drawing_MeasureShape.xba b/qadevOOo/tests/basic/ifc/drawing/MeasureShape/drawing_MeasureShape.xba new file mode 100644 index 000000000000..9157106d7201 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/drawing/MeasureShape/drawing_MeasureShape.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="drawing_MeasureShape" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.drawing.MeasureShape +'************************************************************************* +On Error Goto ErrHndl + + Dim bOK As Boolean + + PropertyTester.TestProperty("StartPosition") + + PropertyTester.TestProperty("EndPosition") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/drawing/MeasureShape/script.xlb b/qadevOOo/tests/basic/ifc/drawing/MeasureShape/script.xlb new file mode 100644 index 000000000000..6e5ca92a8d58 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/drawing/MeasureShape/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="drawing_MeasureShape" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="drawing_MeasureShape"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/drawing/PolyPolygonBezierDescriptor/drawing_PolyPolygonBezierDescriptor.xba b/qadevOOo/tests/basic/ifc/drawing/PolyPolygonBezierDescriptor/drawing_PolyPolygonBezierDescriptor.xba new file mode 100644 index 000000000000..bf855ddd6ddb --- /dev/null +++ b/qadevOOo/tests/basic/ifc/drawing/PolyPolygonBezierDescriptor/drawing_PolyPolygonBezierDescriptor.xba @@ -0,0 +1,60 @@ +<?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="drawing_PolyPolygonBezierDescriptor" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.drawing.PolyPolygonBezierDescriptor +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + PropertyTester.TestProperty("PolygonKind") + + PropertyTester.TestProperty("PolyPolygonBezier") + + PropertyTester.TestProperty("Geometry") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/drawing/PolyPolygonBezierDescriptor/script.xlb b/qadevOOo/tests/basic/ifc/drawing/PolyPolygonBezierDescriptor/script.xlb new file mode 100644 index 000000000000..6533bbbf6b56 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/drawing/PolyPolygonBezierDescriptor/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="drawing_PolyPolygonBezierDescriptor" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="drawing_PolyPolygonBezierDescriptor"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/drawing/PolyPolygonDescriptor/drawing_PolyPolygonDescriptor.xba b/qadevOOo/tests/basic/ifc/drawing/PolyPolygonDescriptor/drawing_PolyPolygonDescriptor.xba new file mode 100644 index 000000000000..f98b2c204bb3 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/drawing/PolyPolygonDescriptor/drawing_PolyPolygonDescriptor.xba @@ -0,0 +1,60 @@ +<?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="drawing_PolyPolygonDescriptor" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.drawing.PolyPolygonDescriptor +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + PropertyTester.TestProperty("PolygonKind") + + PropertyTester.TestProperty("PolyPolygon") + + PropertyTester.TestProperty("Geometry") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/drawing/PolyPolygonDescriptor/script.xlb b/qadevOOo/tests/basic/ifc/drawing/PolyPolygonDescriptor/script.xlb new file mode 100644 index 000000000000..78c42a61d5ca --- /dev/null +++ b/qadevOOo/tests/basic/ifc/drawing/PolyPolygonDescriptor/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="drawing_PolyPolygonDescriptor" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="drawing_PolyPolygonDescriptor"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/drawing/RotationDescriptor/drawing_RotationDescriptor.xba b/qadevOOo/tests/basic/ifc/drawing/RotationDescriptor/drawing_RotationDescriptor.xba new file mode 100644 index 000000000000..018b938f8883 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/drawing/RotationDescriptor/drawing_RotationDescriptor.xba @@ -0,0 +1,64 @@ +<?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="drawing_RotationDescriptor" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.drawing.RotationDescriptor +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Dim newRot As Variant + newRot = Array( oObj.RotateAngle + 200 ) + PropertyTester.TestProperty("RotateAngle", newRot) + + Dim newShAn As Variant + newShAn = Array( oObj.ShearAngle + 200 ) + PropertyTester.TestProperty("ShearAngle", newShAn) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/drawing/RotationDescriptor/script.xlb b/qadevOOo/tests/basic/ifc/drawing/RotationDescriptor/script.xlb new file mode 100644 index 000000000000..f6f8b90e5734 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/drawing/RotationDescriptor/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="drawing_RotationDescriptor" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="drawing_RotationDescriptor"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/drawing/ShadowProperties/drawing_ShadowProperties.xba b/qadevOOo/tests/basic/ifc/drawing/ShadowProperties/drawing_ShadowProperties.xba new file mode 100644 index 000000000000..c69dc78d7615 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/drawing/ShadowProperties/drawing_ShadowProperties.xba @@ -0,0 +1,64 @@ +<?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="drawing_ShadowProperties" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.drawing.ShadowProperties +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + PropertyTester.TestProperty("Shadow") + + PropertyTester.TestProperty("ShadowColor") + + PropertyTester.TestProperty("ShadowTransparence") + + PropertyTester.TestProperty("ShadowXDistance") + + PropertyTester.TestProperty("ShadowYDistance") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/drawing/ShadowProperties/script.xlb b/qadevOOo/tests/basic/ifc/drawing/ShadowProperties/script.xlb new file mode 100644 index 000000000000..8ab2fdc4f855 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/drawing/ShadowProperties/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="drawing_ShadowProperties" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="drawing_ShadowProperties"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/drawing/Shape/drawing_Shape.xba b/qadevOOo/tests/basic/ifc/drawing/Shape/drawing_Shape.xba new file mode 100644 index 000000000000..5662f10cd1a4 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/drawing/Shape/drawing_Shape.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="drawing_Shape" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.drawing.Shape +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Dim ZOrderArr As Variant + ZOrderArr = Array(1, 0) + PropertyTester.TestProperty("ZOrder",ZOrderArr) + + PropertyTester.TestProperty("LayerID", ZOrderArr) + + Dim aLayersNames As Variant + If oObj.LayerName = "layout" Then + aLayersNames = Array("controls") + Else If oObj.LayerName = "Hell" Then + aLayersNames = Array("Heaven") + Else + aLayersNames = Array("layout") + End If + End If + + PropertyTester.TestProperty("LayerName", aLayersNames) + + PropertyTester.TestProperty("Printable") + + PropertyTester.TestProperty("MoveProtect") + + PropertyTester.TestProperty("Name") + + PropertyTester.TestProperty("SizeProtect") + + PropertyTester.TestProperty("Style") + + If cObjectName = "svx.SvxShapeConnector" Then + Test.StartMethod("Transformation") + Test.MethodTested("Transformation", True) + Else + PropertyTester.TestProperty("Transformation") + End If + + PropertyTester.TestProperty("ShapeUserDefinedAttributes") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/drawing/Shape/script.xlb b/qadevOOo/tests/basic/ifc/drawing/Shape/script.xlb new file mode 100644 index 000000000000..7978b2c1b73c --- /dev/null +++ b/qadevOOo/tests/basic/ifc/drawing/Shape/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="drawing_Shape" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="drawing_Shape"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/drawing/TextProperties/drawing_TextProperties.xba b/qadevOOo/tests/basic/ifc/drawing/TextProperties/drawing_TextProperties.xba new file mode 100644 index 000000000000..f86a3bc1bdc9 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/drawing/TextProperties/drawing_TextProperties.xba @@ -0,0 +1,104 @@ +<?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="drawing_TextProperties" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.drawing.TextProperties +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + PropertyTester.TestProperty("IsNumbering") + + PropertyTester.TestProperty("NumberingRules") + + PropertyTester.TestProperty("TextContourFrame") + + PropertyTester.TestProperty("TextAutoGrowHeight") + + PropertyTester.TestProperty("TextAutoGrowWidth") + + PropertyTester.TestProperty("TextFitToSize") + + PropertyTester.TestProperty("TextHorizontalAdjust") + + PropertyTester.TestProperty("TextVerticalAdjust") + + PropertyTester.TestProperty("TextLeftDistance") + + PropertyTester.TestProperty("TextRightDistance") + + PropertyTester.TestProperty("TextUpperDistance") + + PropertyTester.TestProperty("TextLowerDistance") + + PropertyTester.TestProperty("TextMaximumFrameHeight") + + PropertyTester.TestProperty("TextMaximumFrameWidth") + + PropertyTester.TestProperty("TextMinimumFrameHeight") + + PropertyTester.TestProperty("TextMinimumFrameWidth") + + PropertyTester.TestProperty("TextAnimationAmount") + + PropertyTester.TestProperty("TextAnimationCount") + + PropertyTester.TestProperty("TextAnimationDelay") + + PropertyTester.TestProperty("TextAnimationDirection") + + PropertyTester.TestProperty("TextAnimationKind") + + PropertyTester.TestProperty("TextAnimationStartInside") + + PropertyTester.TestProperty("TextAnimationStopInside") + + PropertyTester.TestProperty("TextWritingMode") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/drawing/TextProperties/script.xlb b/qadevOOo/tests/basic/ifc/drawing/TextProperties/script.xlb new file mode 100644 index 000000000000..edd89b72ce37 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/drawing/TextProperties/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="drawing_TextProperties" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="drawing_TextProperties"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/drawing/TextShape/drawing_TextShape.xba b/qadevOOo/tests/basic/ifc/drawing/TextShape/drawing_TextShape.xba new file mode 100644 index 000000000000..29dfba17ec86 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/drawing/TextShape/drawing_TextShape.xba @@ -0,0 +1,56 @@ +<?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="drawing_TextShape" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.drawing.TextShape +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + PropertyTester.TestProperty("CornerRadius") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/drawing/TextShape/script.xlb b/qadevOOo/tests/basic/ifc/drawing/TextShape/script.xlb new file mode 100644 index 000000000000..4a03ef26f435 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/drawing/TextShape/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="drawing_TextShape" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="drawing_TextShape"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/drawing/XControlShape/drawing_XControlShape.xba b/qadevOOo/tests/basic/ifc/drawing/XControlShape/drawing_XControlShape.xba new file mode 100644 index 000000000000..194dbef71636 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/drawing/XControlShape/drawing_XControlShape.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="drawing_XControlShape" 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. +' +'************************************************************************* +'************************************************************************* + + + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' - Global oControlToSet As Object + +'************************************************************************* + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.drawing.XControlShape +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Test.StartMethod("getControl()") + bOK = true + oControl = oObj.getControl() + bOK = bOK AND NOT isNULL(oControl) + bOK = bOK AND hasUnoInterfaces(oControl, "com.sun.star.awt.XControlModel") + + Test.MethodTested("getControl()", bOK) + + Test.StartMethod("setControl()") + bOK = true + if NOT hasUnoInterfaces(oControlToSet, "com.sun.star.awt.XControlModel") then + Out.Log("oControlToSet wasn't correctly set while object creation ... ") + bOK = false + else + oObj.setControl(oControlToSet) + bOK = bOK AND oControlToSet.implementationName = oObj.getControl().implementationName + end if + + Test.MethodTested("setControl()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/drawing/XControlShape/script.xlb b/qadevOOo/tests/basic/ifc/drawing/XControlShape/script.xlb new file mode 100644 index 000000000000..97e313291ee0 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/drawing/XControlShape/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="drawing_XControlShape" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="drawing_XControlShape"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/drawing/XDrawPageDuplicator/drawing_XDrawPageDuplicator.xba b/qadevOOo/tests/basic/ifc/drawing/XDrawPageDuplicator/drawing_XDrawPageDuplicator.xba new file mode 100644 index 000000000000..a1eb32c56bce --- /dev/null +++ b/qadevOOo/tests/basic/ifc/drawing/XDrawPageDuplicator/drawing_XDrawPageDuplicator.xba @@ -0,0 +1,74 @@ +<?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="drawing_XDrawPageDuplicator" 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. +' +'************************************************************************* +'************************************************************************* + + + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' - Global oCollection As Object = oDoc.DrawPages(0) + +'************************************************************************* + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.drawing.XDrawPageDuplicator +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim oCopy As Object + + Test.StartMethod("duplicate()") + bOK = true + oCopy = oObj.duplicate(oCollection) + if NOT isNull(oCopy) Then + bOK = bOK AND (oCollection.dbg_properties = oCopy.dbg_properties) + else + bOK = false + end if + Test.MethodTested("duplicate()", bOK) + + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/drawing/XDrawPageDuplicator/script.xlb b/qadevOOo/tests/basic/ifc/drawing/XDrawPageDuplicator/script.xlb new file mode 100644 index 000000000000..8670b4bbe277 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/drawing/XDrawPageDuplicator/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="drawing_XDrawPageDuplicator" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="drawing_XDrawPageDuplicator"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/drawing/XDrawPageExpander/drawing_XDrawPageExpander.xba b/qadevOOo/tests/basic/ifc/drawing/XDrawPageExpander/drawing_XDrawPageExpander.xba new file mode 100644 index 000000000000..8628c720cf6c --- /dev/null +++ b/qadevOOo/tests/basic/ifc/drawing/XDrawPageExpander/drawing_XDrawPageExpander.xba @@ -0,0 +1,64 @@ +<?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="drawing_XDrawPageExpander" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.drawing.XDrawPageExpander +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + Test.StartMethod("expand()") + bOK = true + Dim Pages As Object + + Pages = oObj.Expand(oObj(0)) + bOK = bOK AND NOT isNULL(Pages) + bOK = bOK AND hasUnoInterfaces(Pages, "com.sun.star.drawing.XDrawPages") + Test.MethodTested("expand()", bOK) + + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/drawing/XDrawPageExpander/script.xlb b/qadevOOo/tests/basic/ifc/drawing/XDrawPageExpander/script.xlb new file mode 100644 index 000000000000..4eb58e1452d7 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/drawing/XDrawPageExpander/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="drawing_XDrawPageExpander" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="drawing_XDrawPageExpander"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/drawing/XDrawPageSummarizer/drawing_XDrawPageSummarizer.xba b/qadevOOo/tests/basic/ifc/drawing/XDrawPageSummarizer/drawing_XDrawPageSummarizer.xba new file mode 100644 index 000000000000..0b40602ee4e4 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/drawing/XDrawPageSummarizer/drawing_XDrawPageSummarizer.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="drawing_XDrawPageSummarizer" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.drawing.XDrawPageSummarizer +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim oSummary As Object + + + Test.StartMethod("summarize()") + bOK = true + oSummary = oObj.Summarize(oObj) + bOK = NOT isNULL(oSummary) + bOK = bOK AND hasUnoInterfaces(oSummary, "com.sun.star.drawing.XDrawPage") + Test.MethodTested("summarize()", bOK) + + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/drawing/XDrawPageSummarizer/script.xlb b/qadevOOo/tests/basic/ifc/drawing/XDrawPageSummarizer/script.xlb new file mode 100644 index 000000000000..a3d8a8fd5a86 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/drawing/XDrawPageSummarizer/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="drawing_XDrawPageSummarizer" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="drawing_XDrawPageSummarizer"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/drawing/XDrawPageSupplier/drawing_XDrawPageSupplier.xba b/qadevOOo/tests/basic/ifc/drawing/XDrawPageSupplier/drawing_XDrawPageSupplier.xba new file mode 100644 index 000000000000..6e3366aef41f --- /dev/null +++ b/qadevOOo/tests/basic/ifc/drawing/XDrawPageSupplier/drawing_XDrawPageSupplier.xba @@ -0,0 +1,57 @@ +<?xml version="1.0" encoding="UTF-8"?> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="drawing_XDrawPageSupplier" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.drawing.XDrawPageSupplier +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim oDrawPage as Object + + Test.startMethod("getDrawPage()" + bOK = TRUE + oDrawPage = oObj.getDrawPage() + bOK = bOK AND hasUnoInterfaces(oDrawPage, "com.sun.star.drawing.XDrawPage") + Test.MethodTested("getDrawPage()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/drawing/XDrawPageSupplier/script.xlb b/qadevOOo/tests/basic/ifc/drawing/XDrawPageSupplier/script.xlb new file mode 100644 index 000000000000..0c7dd82c381d --- /dev/null +++ b/qadevOOo/tests/basic/ifc/drawing/XDrawPageSupplier/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="drawing_XDrawPageSupplier" library:readonly="false" library:passwordprotected="false"> + <library:element library:name="drawing_XDrawPageSupplier"/> + </library:library> diff --git a/qadevOOo/tests/basic/ifc/drawing/XDrawPages/drawing_XDrawPages.xba b/qadevOOo/tests/basic/ifc/drawing/XDrawPages/drawing_XDrawPages.xba new file mode 100644 index 000000000000..680eb2d778d3 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/drawing/XDrawPages/drawing_XDrawPages.xba @@ -0,0 +1,71 @@ +<?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="drawing_XDrawPages" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.drawing.XDrawPages +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim nCount As Integer + Dim oPage As Object + + Test.StartMethod("insertNewByIndex()") + bOK = true + nCount = oObj.Count + oPage = oObj.insertNewByIndex(nCount) + bOK = bOK AND nCount <> oObj.Count() + Test.MethodTested("insertNewByIndex()", bOK) + + Test.StartMethod("remove()") + bOK = true + oObj.remove(oPage) + bOK = bOK AND nCount = oObj.Count + Test.MethodTested("remove()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/drawing/XDrawPages/script.xlb b/qadevOOo/tests/basic/ifc/drawing/XDrawPages/script.xlb new file mode 100644 index 000000000000..13a057bea7ad --- /dev/null +++ b/qadevOOo/tests/basic/ifc/drawing/XDrawPages/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="drawing_XDrawPages" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="drawing_XDrawPages"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/drawing/XDrawPagesSupplier/drawing_XDrawPagesSupplier.xba b/qadevOOo/tests/basic/ifc/drawing/XDrawPagesSupplier/drawing_XDrawPagesSupplier.xba new file mode 100644 index 000000000000..df376a73bea7 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/drawing/XDrawPagesSupplier/drawing_XDrawPagesSupplier.xba @@ -0,0 +1,60 @@ +<?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="drawing_XDrawPagesSupplier" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.drawing.XDrawPagesSupplier +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Test.StartMethod("getDrawPages()") + bOK = true + oDrawPages = oObj.getDrawPages() + bOK = bOK AND NOT isNull(oDrawPages) + bOK = bOK AND hasUnoInterfaces(oDrawPages, "com.sun.star.drawing.XDrawPages") + Test.MethodTested("getDrawPages()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/drawing/XDrawPagesSupplier/script.xlb b/qadevOOo/tests/basic/ifc/drawing/XDrawPagesSupplier/script.xlb new file mode 100644 index 000000000000..2f038f684eb3 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/drawing/XDrawPagesSupplier/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="drawing_XDrawPagesSupplier" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="drawing_XDrawPagesSupplier"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/drawing/XDrawView/drawing_XDrawView.xba b/qadevOOo/tests/basic/ifc/drawing/XDrawView/drawing_XDrawView.xba new file mode 100644 index 000000000000..a68a5bd32bcd --- /dev/null +++ b/qadevOOo/tests/basic/ifc/drawing/XDrawView/drawing_XDrawView.xba @@ -0,0 +1,89 @@ +<?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="drawing_XDrawView" 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 + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' - Global oPages As Object Collection of pages + +'************************************************************************* + + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.drawing.XDrawView +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim oCurrPage As Object + Dim oOldCurPage As Object + Dim newPage As Object + + Test.StartMethod("setCurrentPage()") + bOK = true + oPages.insertNewByIndex(0) + newPage = oPages(0) + oOldCurPage = oObj.getCurrentPage() + oObj.setCurrentPage(newPage) + bOK = bOK AND newPage.dbg_methods = oObj.getCurrentPage().dbg_methods + Test.MethodTested("setCurrentPage()", bOK) + + Test.StartMethod("getCurrentPage()") + bOK = true + oCurrPage = oObj.getCurrentPage() + bOK = bOK AND NOT isNULL(oCurrPage) + bOK = bOK AND hasUnoInterfaces(oCurrPage, "com.sun.star.drawing.XDrawPage") + Test.MethodTested("getCurrentPage()", bOK) + + 'back to the old current page + oObj.setCurrentPage(oOldCurPage) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/drawing/XDrawView/script.xlb b/qadevOOo/tests/basic/ifc/drawing/XDrawView/script.xlb new file mode 100644 index 000000000000..a0ce1b7caeca --- /dev/null +++ b/qadevOOo/tests/basic/ifc/drawing/XDrawView/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="drawing_XDrawView" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="drawing_XDrawView"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/drawing/XGluePointsSupplier/drawing_XGluePointsSupplier.xba b/qadevOOo/tests/basic/ifc/drawing/XGluePointsSupplier/drawing_XGluePointsSupplier.xba new file mode 100644 index 000000000000..5c7ed5e74505 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/drawing/XGluePointsSupplier/drawing_XGluePointsSupplier.xba @@ -0,0 +1,69 @@ +<?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="drawing_XGluePointsSupplier" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.drawing.XGluePointsSupplier +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim aPoints As Variant + + Test.StartMethod("getGluePoints()") + bOK = true + aPoints = oObj.getGluePoints() + Out.Log("getGluePoints() returned " & aPoints.getCount()) + if (aPoints.getCount() > 0) then + bOK = bOK AND isUNOStruct(aPoints.getByIndex(0)) + if (bOK) then + Out.Log("First point is: " & aPoints.getByIndex(0).Position.X & ", " & aPoints.getByIndex(0).Position.Y) + end if + end if + Test.MethodTested("getGluePoints()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/drawing/XGluePointsSupplier/script.xlb b/qadevOOo/tests/basic/ifc/drawing/XGluePointsSupplier/script.xlb new file mode 100644 index 000000000000..60b81fd1245f --- /dev/null +++ b/qadevOOo/tests/basic/ifc/drawing/XGluePointsSupplier/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="drawing_XGluePointsSupplier" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="drawing_XGluePointsSupplier"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/drawing/XLayerManager/drawing_XLayerManager.xba b/qadevOOo/tests/basic/ifc/drawing/XLayerManager/drawing_XLayerManager.xba new file mode 100644 index 000000000000..0ac672ca4362 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/drawing/XLayerManager/drawing_XLayerManager.xba @@ -0,0 +1,94 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="drawing_XLayerManager" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.drawing.XLayerManager +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Dim oShape As Variant + Dim oLayer As Variant + Dim nCount As Integer + Dim oDrawPage As Object + Dim oGetLayer As Object + + + bOK = true + 'create a new Shape and add to drawpage + oShape = oDoc.createInstance("com.sun.star.drawing.RectangleShape") + oDrawPage = oDoc.DrawPages.getByIndex(0) + oDrawPage.add(oShape) + 'get Layer from LayerManager + oLayer = oObj.getByIndex(0) + oLayer.Name = cIfcShortName + + Test.StartMethod("attachShapeToLayer()") + oObj.attachShapeToLayer(oShape, oLayer) + oGetLayer = oObj.getLayerForShape(oShape) + bOK = bOK AND (oLayer.Name = oGetLayer.Name) + Test.MethodTested("attachShapeToLayer()", bOK) + + Test.StartMethod("getLayerForShape()") + bOK = bOK AND (oLayer.Name = oGetLayer.Name) + Test.MethodTested("getLayerForShape()", bOK) + + Test.StartMethod("insertNewByIndex()") + bOK = true + nCount = oObj.Count + oObj.insertNewByIndex(nCount) + bOK = bOk AND (nCount <> oObj.Count) + Test.MethodTested("insertNewByIndex()", bOK) + + Test.StartMethod("remove()") + bOK = true + nCount = oObj.Count + oObj.remove(oLayer) + bOK = bOK AND (nCount <> oObj.Count) + Test.MethodTested("remove()", bOK) + + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/drawing/XLayerManager/script.xlb b/qadevOOo/tests/basic/ifc/drawing/XLayerManager/script.xlb new file mode 100644 index 000000000000..553799d022ea --- /dev/null +++ b/qadevOOo/tests/basic/ifc/drawing/XLayerManager/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="drawing_XLayerManager" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="drawing_XLayerManager"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/drawing/XLayerSupplier/drawing_XLayerSupplier.xba b/qadevOOo/tests/basic/ifc/drawing/XLayerSupplier/drawing_XLayerSupplier.xba new file mode 100644 index 000000000000..2ebe1ebfbfcc --- /dev/null +++ b/qadevOOo/tests/basic/ifc/drawing/XLayerSupplier/drawing_XLayerSupplier.xba @@ -0,0 +1,62 @@ +<?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="drawing_XLayerSupplier" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.drawing.XLayerSupplier +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + Test.StartMethod("getLayerManager()") + bOK = true + oLayer = oObj.getLayerManager() + bOK = bOK AND NOT isNull(oLayer) + bOK = bOK AND hasUnoInterfaces(oLayer, "com.sun.star.container.XNameAccess") + Test.MethodTested("getLayerManager()", bOK) + + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/drawing/XLayerSupplier/script.xlb b/qadevOOo/tests/basic/ifc/drawing/XLayerSupplier/script.xlb new file mode 100644 index 000000000000..1f6cb3a085f5 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/drawing/XLayerSupplier/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="drawing_XLayerSupplier" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="drawing_XLayerSupplier"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/drawing/XMasterPageTarget/drawing_XMasterPageTarget.xba b/qadevOOo/tests/basic/ifc/drawing/XMasterPageTarget/drawing_XMasterPageTarget.xba new file mode 100644 index 000000000000..73b167ef4094 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/drawing/XMasterPageTarget/drawing_XMasterPageTarget.xba @@ -0,0 +1,74 @@ +<?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="drawing_XMasterPageTarget" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.drawing.XMasterPageTarget +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Dim oGetMaster As Object + Dim oNewMaster As Object + Dim oMaster As Object + + + Test.StartMethod("getMasterPage()") + bOK = true + oMaster = oDoc.getMasterPages() + oNewMaster = oMaster.insertNewByIndex(oMaster.getCount()) + oNewMaster.Name = "NewMaster" + bOK = bOK AND NOT isNull(oObj.getMasterPage()) + Test.MethodTested("getMasterPage()", bOK) + + + Test.StartMethod("setMasterPage()") + bOK = true + oObj.setMasterPage(oNewMaster) + oGetMaster = oObj.getMasterPage() + bOK = bOK AND (oGetMaster.Name = oNewMaster.Name) + Test.MethodTested("setMasterPage()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/drawing/XMasterPageTarget/script.xlb b/qadevOOo/tests/basic/ifc/drawing/XMasterPageTarget/script.xlb new file mode 100644 index 000000000000..e0a12d52bc14 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/drawing/XMasterPageTarget/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="drawing_XMasterPageTarget" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="drawing_XMasterPageTarget"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/drawing/XMasterPagesSupplier/drawing_XMasterPagesSupplier.xba b/qadevOOo/tests/basic/ifc/drawing/XMasterPagesSupplier/drawing_XMasterPagesSupplier.xba new file mode 100644 index 000000000000..fe02677e8c00 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/drawing/XMasterPagesSupplier/drawing_XMasterPagesSupplier.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="drawing_XMasterPagesSupplier" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.drawing.XMasterPagesSupplier +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim oMaster As Object + + Test.StartMethod("getMasterPages()") + bOK = true + oMaster = oObj.getMasterPages() + bOK = bOK AND NOT isNull(oMaster) + bOK = bOK AND hasUnoInterfaces(oMaster, "com.sun.star.drawing.XDrawPages") + Test.MethodTested("getMasterPages()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/drawing/XMasterPagesSupplier/script.xlb b/qadevOOo/tests/basic/ifc/drawing/XMasterPagesSupplier/script.xlb new file mode 100644 index 000000000000..02cac0d66758 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/drawing/XMasterPagesSupplier/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="drawing_XMasterPagesSupplier" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="drawing_XMasterPagesSupplier"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/drawing/XShape/drawing_XShape.xba b/qadevOOo/tests/basic/ifc/drawing/XShape/drawing_XShape.xba new file mode 100644 index 000000000000..cced868bb1aa --- /dev/null +++ b/qadevOOo/tests/basic/ifc/drawing/XShape/drawing_XShape.xba @@ -0,0 +1,133 @@ +<?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="drawing_XShape" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.drawing.XShape +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim oPosition As Object + Dim oSetPos As New com.sun.star.awt.Point + Dim objPosition As Object + + Dim oSize As Object + Dim oSetSize As New com.sun.star.awt.Size + Dim objSize As Object + Dim bRO As Boolean + + + Test.StartMethod("setPosition()") + Test.StartMethod("getPosition()") + + bOK = true + + if (cObjectName = "sw.SwXTextEmbeddedObject") OR _ + (cObjectName = "sw.SwXTextGraphicObject") OR _ + (cObjectName = "sw.SwXTextFrame") OR _ + (cObjectName = "svx.SvxShapeConnector") then + Out.Log("Methods get/setPosition doesn't work with this object.") + else + oPosition = oObj.getPosition() + Out.Log("Current object's position (" + oPosition.X + ", " + oPosition.Y + ")") + + oSetPos.X = 1234 + oSetPos.Y = 4321 + + Out.Log("Trying to set object's position to (" + oSetPos.X + ", " + oSetPos.Y + ")") + oObj.setPosition(oSetPos) + + objPosition = oObj.getPosition() + Out.Log("Actual position is (" + objPosition.X + ", " + objPosition.Y + ")") + + + bOK = bOK AND ((abs(objPosition.X - oSetPos.X) <= 1) AND (abs(objPosition.Y - oSetPos.Y) <= 1)) + + Out.Log("Return previous position...") + oObj.setPosition(oPosition) + end if + + Test.MethodTested("getPosition()", bOK) + Test.MethodTested("setPosition()", bOK) + + + Test.StartMethod("setSize()") + Test.StartMethod("getSize()") + bOK = true + + bRO = (cObjectName = "sch.ChartLegend") OR _ + (cObjectName = "sch.ChartTitle") OR _ + (cObjectName = "svx.SvxShapeConnector") + if (bRO) then + Out.Log("Size cannot be changed for this object.") + end if + + oSize = oObj.getSize() + Out.Log("Current object's size (" + oSize.Width + " x " + oSize.Height + ")") + + oSetSize.Width = 1235 + oSetSize.Height = 4322 + + Out.Log("Trying to set object's size to (" + oSetSize.Width + " x " + oSetSize.Height + ")") + oObj.setSize(oSetSize) + objSize = oObj.getSize() + Out.Log("Actual size is (" + objSize.Width + " x " + objSize.Height + ")") + + if (bRO) then + bOK = bOK AND ((abs(objSize.Width - oSize.Width) <= 1) AND (abs(objSize.Height - oSize.Height) <= 1)) + else + bOK = bOK AND ((abs(objSize.Width - oSetSize.Width) <= 1) AND (abs(objSize.Height - oSetSize.Height) <= 1)) + end if + + Out.Log("Return previous size...") + oObj.setSize(oSize) + + Test.MethodTested("getSize()", bOK) + Test.MethodTested("setSize()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/drawing/XShape/script.xlb b/qadevOOo/tests/basic/ifc/drawing/XShape/script.xlb new file mode 100644 index 000000000000..44d5e67ace32 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/drawing/XShape/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="drawing_XShape" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="drawing_XShape"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/drawing/XShapeBinder/drawing_XShapeBinder.xba b/qadevOOo/tests/basic/ifc/drawing/XShapeBinder/drawing_XShapeBinder.xba new file mode 100644 index 000000000000..39eeb51dab39 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/drawing/XShapeBinder/drawing_XShapeBinder.xba @@ -0,0 +1,94 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="drawing_XShapeBinder" 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. +' +'************************************************************************* +'************************************************************************* + + + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' - Global oBinderCollection As Object + +'************************************************************************* + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.drawing.XShapeBinder +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + ReCreateObj() + + Test.StartMethod("bind()") + bOK = true + if hasUnoInterfaces(oObj, "com.sun.star.container.XIndexAccess") then + nCount = oObj.getCount() + Out.Log("" & nCount & " elements in collection") + oBind = oObj.bind(oBinderCollection) + if (isNULL(oBind)) then Out.Log("bind() returned NULL.") + Out.Log("" & oObj.getCount & " elements in collection") + bOK = bOK AND (NOT isNull(oBind)) AND (nCount <> oObj.getCount) + else + oBind = oObj.bind(oBinderCollection) + if (isNULL(oBind)) then Out.Log("bind() returned NULL.") + bOK = bOK AND NOT isNull(oBind) + end if + Test.MethodTested("bind()", bOK) + + Test.StartMethod("unbind()") + if (NOT bOK) then + Out.Log("Can't test unbind() without bind()") + else + if hasUnoInterfaces( oObj, "com.sun.star.container.XIndexAccess" ) then + oObj.unbind(oBind) + Out.Log("" & oObj.count & " elements in collection") + bOK = bOK AND (nCount <= oObj.getCount) + Test.MethodTested("unbind()", bOK) + else + oObj.unbind(oBind) + end if + end if + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/drawing/XShapeBinder/script.xlb b/qadevOOo/tests/basic/ifc/drawing/XShapeBinder/script.xlb new file mode 100644 index 000000000000..7cfc992216a4 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/drawing/XShapeBinder/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="drawing_XShapeBinder" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="drawing_XShapeBinder"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/drawing/XShapeCombiner/drawing_XShapeCombiner.xba b/qadevOOo/tests/basic/ifc/drawing/XShapeCombiner/drawing_XShapeCombiner.xba new file mode 100644 index 000000000000..ed74a532fe79 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/drawing/XShapeCombiner/drawing_XShapeCombiner.xba @@ -0,0 +1,86 @@ +<?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="drawing_XShapeCombiner" 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. +' +'************************************************************************* +'************************************************************************* + + + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' - Global oCombinerCollection As Object + +'************************************************************************* + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.drawing.XShapeCombiner +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim oCombine As Object + Dim nCount As Integer + + ReCreateObj() + + Test.StartMethod("combine()") + bOK = true + nCount = oObj.count + Out.Log("" & nCount & " elements in collection") + oCombine = oObj.combine(oCombinerCollection) + if (isNULL(oCombine)) then Out.Log("combine() returned NULL") + bOK = bOK AND (nCount <> oObj.count) AND NOT isNull(oCombine) + bOK = bOK AND hasUnoInterfaces(oCombine, "com.sun.star.drawing.XShape") + Test.MethodTested("combine()", bOK) + + Test.StartMethod("split()") + if (NOT bOK) then + Out.Log("Can't test split() without combine()") + else + oObj.split(oCombine) + Out.Log("" & oObj.count & " elements in collection") + bOK = bOK AND (nCount = oObj.count) + Test.MethodTested("split()", bOK) + end if + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/drawing/XShapeCombiner/script.xlb b/qadevOOo/tests/basic/ifc/drawing/XShapeCombiner/script.xlb new file mode 100644 index 000000000000..2eb08b47a4f5 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/drawing/XShapeCombiner/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="drawing_XShapeCombiner" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="drawing_XShapeCombiner"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/drawing/XShapeDescriptor/drawing_XShapeDescriptor.xba b/qadevOOo/tests/basic/ifc/drawing/XShapeDescriptor/drawing_XShapeDescriptor.xba new file mode 100644 index 000000000000..26becd8ce2a3 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/drawing/XShapeDescriptor/drawing_XShapeDescriptor.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="drawing_XShapeDescriptor" 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 + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' - Global cShapeType As String optional +' expected shape type + +'************************************************************************* + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.drawing.XShapeDescriptor +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim sType As Variant + + Test.StartMethod("getShapeType()") + bOK = true + + sType = oObj.getShapeType() + bOK = bOK AND (VarType(sType = 8 )) + if bOK then + On Error Goto NocShapeType + if VarType(cShapeType) = 8 then + Out.Log("Comparing expected shape type (" + cShapeType + ")") + Out.Log("with obtained (" + sType + ")") + bOK = bOK AND sType = cShapeType + else + Out.Log("!!! No expected value for shape '" + sType + "'") + endif + endif + +EndTest: + Test.MethodTested("getShapeType()", bOK) + +Exit Sub +NocShapeType: + Out.Log("!!! No expected value for shape '" + sType + "'") + goto EndTest +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/drawing/XShapeDescriptor/script.xlb b/qadevOOo/tests/basic/ifc/drawing/XShapeDescriptor/script.xlb new file mode 100644 index 000000000000..d6a8efbc2599 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/drawing/XShapeDescriptor/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="drawing_XShapeDescriptor" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="drawing_XShapeDescriptor"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/drawing/XShapeGroup/drawing_XShapeGroup.xba b/qadevOOo/tests/basic/ifc/drawing/XShapeGroup/drawing_XShapeGroup.xba new file mode 100644 index 000000000000..6f89f6086ad8 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/drawing/XShapeGroup/drawing_XShapeGroup.xba @@ -0,0 +1,67 @@ +<?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="drawing_XShapeGroup" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.drawing.XShapeGroup +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + Test.StartMethod("enterGroup()") + bOK = true + oObj.enterGroup() + Test.MethodTested("enterGroup()", bOK) + + Test.StartMethod("leaveGroup()") + bOK = true + oObj.leaveGroup() + Test.MethodTested("leaveGroup()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/drawing/XShapeGroup/script.xlb b/qadevOOo/tests/basic/ifc/drawing/XShapeGroup/script.xlb new file mode 100644 index 000000000000..b61ec7de14e8 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/drawing/XShapeGroup/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="drawing_XShapeGroup" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="drawing_XShapeGroup"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/drawing/XShapeGrouper/drawing_XShapeGrouper.xba b/qadevOOo/tests/basic/ifc/drawing/XShapeGrouper/drawing_XShapeGrouper.xba new file mode 100644 index 000000000000..6ca918774d38 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/drawing/XShapeGrouper/drawing_XShapeGrouper.xba @@ -0,0 +1,78 @@ +<?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="drawing_XShapeGrouper" 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. +' +'************************************************************************* +'************************************************************************* + + + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' - Global oGrouperCollection As Object groupable objects + +'************************************************************************* + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.drawing.XShapeGrouper +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim oGroup As Object + Dim nCount As Integer + + Test.StartMethod("group()") + bOK = true + oGroup = oObj.group(oGrouperCollection) + bOK = bOK AND NOT isNull(oGroup) + bOK = bOK AND hasUnoInterfaces(oGroup, "com.sun.star.drawing.XShapeGroup") + Test.MethodTested("group()", bOK) + + Test.StartMethod("ungroup()") + bOK = true + nCount = oObj.Count + oObj.ungroup(oGroup) + bOK = bOK AND nCount <> oObj.Count + Test.MethodTested("ungroup()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/drawing/XShapeGrouper/script.xlb b/qadevOOo/tests/basic/ifc/drawing/XShapeGrouper/script.xlb new file mode 100644 index 000000000000..0f605aed8da9 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/drawing/XShapeGrouper/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="drawing_XShapeGrouper" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="drawing_XShapeGrouper"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/drawing/XShapes/drawing_XShapes.xba b/qadevOOo/tests/basic/ifc/drawing/XShapes/drawing_XShapes.xba new file mode 100644 index 000000000000..000e7cf2d010 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/drawing/XShapes/drawing_XShapes.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="drawing_XShapes" 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 + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' - Global oXShapeInstance As Object to add/remove + +'************************************************************************* + + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.drawing.XShapes +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim nCount As Integer + + Test.StartMethod("add()") + bOK = true + nCount = oObj.Count + + oObj.add(oXShapeInstance) + bOK = bOK AND (nCount <> oObj.Count) + Test.MethodTested("add()", bOK) + + Test.StartMethod("remove()") + bOK = true + oObj.remove(oXShapeInstance) + bOK = bOK AND (nCount = oObj.Count) + Test.MethodTested("remove()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/drawing/XShapes/script.xlb b/qadevOOo/tests/basic/ifc/drawing/XShapes/script.xlb new file mode 100644 index 000000000000..87feea7ea29a --- /dev/null +++ b/qadevOOo/tests/basic/ifc/drawing/XShapes/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="drawing_XShapes" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="drawing_XShapes"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/form/DataAwareControlModel/form_DataAwareControlModel.xba b/qadevOOo/tests/basic/ifc/form/DataAwareControlModel/form_DataAwareControlModel.xba new file mode 100644 index 000000000000..0c9db8458419 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/form/DataAwareControlModel/form_DataAwareControlModel.xba @@ -0,0 +1,60 @@ +<?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="form_DataAwareControlModel" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.form.DataAwareControlModel +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + PropertyTester.TestProperty("DataField") + + PropertyTester.TestProperty("BoundField") + + PropertyTester.TestProperty("LabelControl") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/form/DataAwareControlModel/script.xlb b/qadevOOo/tests/basic/ifc/form/DataAwareControlModel/script.xlb new file mode 100644 index 000000000000..cbe78d65b476 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/form/DataAwareControlModel/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="form_DataAwareControlModel" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="form_DataAwareControlModel"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/form/FormComponent/form_FormComponent.xba b/qadevOOo/tests/basic/ifc/form/FormComponent/form_FormComponent.xba new file mode 100644 index 000000000000..f11a8be4f78d --- /dev/null +++ b/qadevOOo/tests/basic/ifc/form/FormComponent/form_FormComponent.xba @@ -0,0 +1,56 @@ +<?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="form_FormComponent" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.form.FormComponent +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + PropertyTester.TestProperty("Name") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/form/FormComponent/script.xlb b/qadevOOo/tests/basic/ifc/form/FormComponent/script.xlb new file mode 100644 index 000000000000..f999080e1a7b --- /dev/null +++ b/qadevOOo/tests/basic/ifc/form/FormComponent/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="form_FormComponent" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="form_FormComponent"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/form/FormControlModel/form_FormControlModel.xba b/qadevOOo/tests/basic/ifc/form/FormControlModel/form_FormControlModel.xba new file mode 100644 index 000000000000..53bedcab043b --- /dev/null +++ b/qadevOOo/tests/basic/ifc/form/FormControlModel/form_FormControlModel.xba @@ -0,0 +1,60 @@ +<?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="form_FormControlModel" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.form.FormControlModel +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + PropertyTester.TestProperty("ClassId") + + PropertyTester.TestProperty("TabIndex") + + PropertyTester.TestProperty("Tag") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/form/FormControlModel/script.xlb b/qadevOOo/tests/basic/ifc/form/FormControlModel/script.xlb new file mode 100644 index 000000000000..a6243bd9efbe --- /dev/null +++ b/qadevOOo/tests/basic/ifc/form/FormControlModel/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="form_FormControlModel" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="form_FormControlModel"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/form/XApproveActionBroadcaster/form_XApproveActionBroadcaster.xba b/qadevOOo/tests/basic/ifc/form/XApproveActionBroadcaster/form_XApproveActionBroadcaster.xba new file mode 100644 index 000000000000..0ef5c09973a3 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/form/XApproveActionBroadcaster/form_XApproveActionBroadcaster.xba @@ -0,0 +1,99 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="form_XApproveActionBroadcaster" 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 + +Dim L1called as Boolean +Dim L2called as Boolean + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.form.XApproveActionBroadcaster +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim list1 As Object, list2 As Object + + Test.StartMethod("addApproveActionListener()") + bOK = true + + list1 = createUnoListener("L1_", "com.sun.star.form.XApproveActionListener") + list2 = createUnoListener("L2_", "com.sun.star.form.XApproveActionListener") + + oObj.addApproveActionListener(list1) + oObj.addApproveActionListener(list2) + + Test.StartMethod("removeApproveActionListener()") + + oObj.removeApproveActionListener(list1) + + L1called = false + L2called = false + + Out.Log("The action for listener calling must be perfomed interactively") + bOK = bOK AND L2called + Test.MethodTested("addApproveActionListener()", TRUE) + + bOK = bOK AND NOT L1called + Test.MethodTested("removeApproveActionListener()", TRUE) + + oObj.removeApproveActionListener(list2) + + Out.Log("Skipping all XApproveActionBroadcaster methods, since they need user interaction") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub + + +Function L1_approveAction() As Boolean + L1called = true + Out.Log("Listener 1 is called") + L1_approveAction = true +End Function + +Function L2_approveAction() As Boolean + L2called = true + Out.Log("Listener 2 is called") + L2_approveAction = true +End Function +</script:module> diff --git a/qadevOOo/tests/basic/ifc/form/XApproveActionBroadcaster/script.xlb b/qadevOOo/tests/basic/ifc/form/XApproveActionBroadcaster/script.xlb new file mode 100644 index 000000000000..5d5f874e601f --- /dev/null +++ b/qadevOOo/tests/basic/ifc/form/XApproveActionBroadcaster/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="form_XApproveActionBroadcaster" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="form_XApproveActionBroadcaster"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/form/XBoundComponent/form_XBoundComponent.xba b/qadevOOo/tests/basic/ifc/form/XBoundComponent/form_XBoundComponent.xba new file mode 100644 index 000000000000..905a7717374e --- /dev/null +++ b/qadevOOo/tests/basic/ifc/form/XBoundComponent/form_XBoundComponent.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="form_XBoundComponent" 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 + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' - Sub prepareCommit() +' Function checkCommit() As Boolean + +'************************************************************************* + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.form.XBoundComponent +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + Test.StartMethod("commit()") + bOK = true + + prepareCommit() + + bOK = bOK AND oObj.commit() + + bOK = bOK AND checkCommit() + Test.MethodTested("commit()", bOK) + + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/form/XBoundComponent/script.xlb b/qadevOOo/tests/basic/ifc/form/XBoundComponent/script.xlb new file mode 100644 index 000000000000..8923e06adb1b --- /dev/null +++ b/qadevOOo/tests/basic/ifc/form/XBoundComponent/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="form_XBoundComponent" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="form_XBoundComponent"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/form/XBoundControl/form_XBoundControl.xba b/qadevOOo/tests/basic/ifc/form/XBoundControl/form_XBoundControl.xba new file mode 100644 index 000000000000..8e422769893d --- /dev/null +++ b/qadevOOo/tests/basic/ifc/form/XBoundControl/form_XBoundControl.xba @@ -0,0 +1,70 @@ +<?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="form_XBoundControl" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.form.XBoundControl +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim old As Boolean, res As Boolean + + + Test.StartMethod("getLock()") + bOK = true + old = oObj.getLock() + Test.MethodTested("getLock()", bOK) + + Test.StartMethod("setLock()") + bOK = true + oObj.setLock(NOT old) + res = oObj.getLock() + bOK = bOK AND (NOT old = res) + Test.MethodTested("setLock()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/form/XBoundControl/script.xlb b/qadevOOo/tests/basic/ifc/form/XBoundControl/script.xlb new file mode 100644 index 000000000000..51aa56875df6 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/form/XBoundControl/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="form_XBoundControl" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="form_XBoundControl"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/form/XChangeBroadcaster/form_XChangeBroadcaster.xba b/qadevOOo/tests/basic/ifc/form/XChangeBroadcaster/form_XChangeBroadcaster.xba new file mode 100644 index 000000000000..ea8649cafa1f --- /dev/null +++ b/qadevOOo/tests/basic/ifc/form/XChangeBroadcaster/form_XChangeBroadcaster.xba @@ -0,0 +1,103 @@ +<?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="form_XChangeBroadcaster" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.form.XChangeBroadcaster +'************************************************************************* +On Error Goto ErrHndl + Dim list1 As Object, list2 As Object + Dim bOK As Boolean + + + Test.StartMethod("addChangeListener()") + bOK = true + + + list1 = createUnoListener("L1_", "com.sun.star.form.XChangeListener") + list2 = createUnoListener("L2_", "com.sun.star.form.XChangeListener") + + oObj.addChangeListener(list1) + oObj.addChangeListener(list2) + + Test.StartMethod("removeChangeListener()") + + oObj.removeChangeListener(list1) + + L1called = false + L2called = false + + Out.Log("The action for listener calling must be perfomed interactively") + + bOK = bOK AND L2called + Test.MethodTested("addChangeListener()", bOK) + + bOK = bOK AND NOT L1called + Test.MethodTested("removeChangeListener()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub + +Dim L1called as Boolean +Dim L2called as Boolean + +Sub L1_disposing() +End Sub + +Sub L2_disposing() +End Sub + +Sub L1_changed() + L1called = true + +End Sub + +Sub L2_changed() + L2called = true + +End Sub + +</script:module> diff --git a/qadevOOo/tests/basic/ifc/form/XChangeBroadcaster/script.xlb b/qadevOOo/tests/basic/ifc/form/XChangeBroadcaster/script.xlb new file mode 100644 index 000000000000..0d0a0564d411 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/form/XChangeBroadcaster/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="form_XChangeBroadcaster" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="form_XChangeBroadcaster"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/form/XFormController/form_XFormController.xba b/qadevOOo/tests/basic/ifc/form/XFormController/form_XFormController.xba new file mode 100644 index 000000000000..d36eb98b1bb6 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/form/XFormController/form_XFormController.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="form_XFormController" 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 + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' - Global otherWin As Object + +'************************************************************************* + + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.form.XFormController +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim cntrl As Object + Dim list1 As Object, list2 As Object + + Test.StartMethod("getCurrentControl()") + bOK = true + cntrl = oObj.getCurrentControl() + bOK = bOK AND NOT isNull(cntrl) + Test.MethodTested("getCurrentControl()", bOK) + + Test.StartMethod("addActivateListener()") + bOK = true + list1 = createUnoListener("L1_", "com.sun.star.form.XFormControllerListener") + list2 = createUnoListener("L2_", "com.sun.star.form.XFormControllerListener") + oObj.addActivateListener(list1) + oObj.addActivateListener(list2) + + Test.StartMethod("removeActivateListener()") + oObj.removeActivateListener(list1) + + if NOT hasUnoInterfaces(cntrl, "com.sun.star.awt.XWindow") then + Out.Log("The oObj.getCurrentControl() return object doesn't support") + Out.Log("com.sun.star.awt.XWindow interface required for testing !!!") + Out.Log("Interface test must be redesigned thus !!!") + else + cntrl.setFocus() + wait(500) + otherWin.setFocus() + wait(500) + end if + + Test.MethodTested("addActivateListener()", L2called) + Test.MethodTested("removeActivateListener()", _ + L2called AND NOT L1called) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub + +Dim L1called As Boolean +Dim L2called As Boolean + +Sub L1_formActivated(ev As Object) + L1called = true + Out.Log("L1 activated Called !!!!!!!!!") +end Sub + +Sub L1_formDeactivated(ev As Object) + L1called = true + Out.Log("L1 deactivated Called !!!!!!!!!") +end Sub + +Sub L2_formActivated() + L2called = true + Out.Log("L2 activated Called !!!!!!!!!") +end Sub + +Sub L2_formDeactivated() + L2called = true + Out.Log("L2 deactivated Called !!!!!!!!!") +end Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/form/XFormController/script.xlb b/qadevOOo/tests/basic/ifc/form/XFormController/script.xlb new file mode 100644 index 000000000000..e917316626d8 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/form/XFormController/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="form_XFormController" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="form_XFormController"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/form/XFormsSupplier/form_XFormsSupplier.xba b/qadevOOo/tests/basic/ifc/form/XFormsSupplier/form_XFormsSupplier.xba new file mode 100644 index 000000000000..7331731b5827 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/form/XFormsSupplier/form_XFormsSupplier.xba @@ -0,0 +1,57 @@ +<?xml version="1.0" encoding="UTF-8"?> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="form_XFormsSupplier" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.form.XFormsSupplier +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim oForms as Object +' + Test.StartMethod("getForms()") + bOK = TRUE + oForms = oObj.getForms() + bOK = bOK AND hasUnoInterfaces(oForms, "com.sun.star.container.XNameContainer") + Test.MethodTested("getForms()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/form/XFormsSupplier/script.xlb b/qadevOOo/tests/basic/ifc/form/XFormsSupplier/script.xlb new file mode 100644 index 000000000000..40d6cbcd2aa6 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/form/XFormsSupplier/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="form_XFormsSupplier" library:readonly="false" library:passwordprotected="false"> + <library:element library:name="form_XFormsSupplier"/> + </library:library> diff --git a/qadevOOo/tests/basic/ifc/form/XGrid/form_XGrid.xba b/qadevOOo/tests/basic/ifc/form/XGrid/form_XGrid.xba new file mode 100644 index 000000000000..05bf75dda434 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/form/XGrid/form_XGrid.xba @@ -0,0 +1,73 @@ +<?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="form_XGrid" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.form.XGrid +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim oldPos As Long, newPos as Long, getPos as Long + + Test.StartMethod("getCurrentColumnPosition()") + Test.StartMethod("setCurrentColumnPosition()") + + bOK = true + oldPos = oObj.getCurrentColumnPosition() + if oldPos = 0 then newPos = 1 else newPos = 0 + oObj.setCurrentColumnPosition(newPos) + getPos = oObj.getCurrentColumnPosition() + + bOK = bOK AND (newPos = getPos) + Out.Log("Position was " + oldPos + ", set to " + newPos + _ + ", get " + getPos) + + Test.MethodTested("getCurrentColumnPosition()", bOK) + Test.MethodTested("setCurrentColumnPosition()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/form/XGrid/script.xlb b/qadevOOo/tests/basic/ifc/form/XGrid/script.xlb new file mode 100644 index 000000000000..6cd1f0fe06df --- /dev/null +++ b/qadevOOo/tests/basic/ifc/form/XGrid/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="form_XGrid" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="form_XGrid"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/form/XGridColumnFactory/form_XGridColumnFactory.xba b/qadevOOo/tests/basic/ifc/form/XGridColumnFactory/form_XGridColumnFactory.xba new file mode 100644 index 000000000000..d5a0ee2539b4 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/form/XGridColumnFactory/form_XGridColumnFactory.xba @@ -0,0 +1,65 @@ +<?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="form_XGridColumnFactory" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.form.XGridColumnFactory +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim aTypes As Variant + Dim nCount As Integer + + Test.StartMethod("createColumn()") + bOK = true + bOk = bOK AND isObject(oObj.createColumn("CheckBox")) + Test.MethodTested("createColumn()", bOK) + + Test.StartMethod("getColumnTypes()") + bOK = true + bOK = bOK AND (uBound(oObj.getColumnTypes()) >= 1) + Test.MethodTested("getColumnTypes()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/form/XGridColumnFactory/script.xlb b/qadevOOo/tests/basic/ifc/form/XGridColumnFactory/script.xlb new file mode 100644 index 000000000000..601f0fd987d8 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/form/XGridColumnFactory/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="form_XGridColumnFactory" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="form_XGridColumnFactory"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/form/XGridFieldDataSupplier/form_XGridFieldDataSupplier.xba b/qadevOOo/tests/basic/ifc/form/XGridFieldDataSupplier/form_XGridFieldDataSupplier.xba new file mode 100644 index 000000000000..92f9a21b2006 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/form/XGridFieldDataSupplier/form_XGridFieldDataSupplier.xba @@ -0,0 +1,91 @@ +<?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="form_XGridFieldDataSupplier" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.form.XGridFieldDataSupplier +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim types As Variant + Dim data As Variant + Dim tmp as String + Dim i as Integer + Dim fieldCount as Integer + Dim row As Long + Dim dat As Variant + + Test.StartMethod("queryFieldDataType()") + bOK = true + types = oObj.queryFieldDataType(oCoreRefl.forName("string")) + + tmp = "" + fieldCount = 0 + for i = lbound(types()) to ubound(types()) + tmp = tmp + " " + types(i) + if types(i) then fieldCount = fieldCount + 1 + next i + Out.Log("array returned : (" + tmp + ")") + bOK = bOK AND (ubound(types()) > 0) + + Test.MethodTested("queryFieldDataType()", bOK) + + Test.StartMethod("queryFieldData()") + bOK = true + row = 1 + dat = oObj.queryFieldData(row, oCoreRefl.forName("string")) + if isNull(dat) OR isEmpty(dat) then + Out.Log("NULL value returned.") + bOK = false + else + Out.Log("The length of array returned :" + (ubound(data()) + 1) + bOK = bOK AND ((ubound(data()) + 1) = fieldCount) + end if + Test.MethodTested("queryFieldData()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/form/XGridFieldDataSupplier/script.xlb b/qadevOOo/tests/basic/ifc/form/XGridFieldDataSupplier/script.xlb new file mode 100644 index 000000000000..1d5d8440227a --- /dev/null +++ b/qadevOOo/tests/basic/ifc/form/XGridFieldDataSupplier/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="form_XGridFieldDataSupplier" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="form_XGridFieldDataSupplier"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/form/XImageProducerSupplier/form_XImageProducerSupplier.xba b/qadevOOo/tests/basic/ifc/form/XImageProducerSupplier/form_XImageProducerSupplier.xba new file mode 100644 index 000000000000..5bbab625e604 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/form/XImageProducerSupplier/form_XImageProducerSupplier.xba @@ -0,0 +1,62 @@ +<?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="form_XImageProducerSupplier" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.form.XImageProducerSupplier +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim oProducer As Object + + Test.StartMethod("getImageProducer()") + bOK = true + oProducer = oObj.getImageProducer() + bOK = bOK AND NOT isNull(oProducer) + bOK = bOK AND hasUnoInterfaces(oProducer, "com.sun.star.awt.XImageProducer") + Test.MethodTested("getImageProducer()", bOK) + + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/form/XImageProducerSupplier/script.xlb b/qadevOOo/tests/basic/ifc/form/XImageProducerSupplier/script.xlb new file mode 100644 index 000000000000..fe2be29da26d --- /dev/null +++ b/qadevOOo/tests/basic/ifc/form/XImageProducerSupplier/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="form_XImageProducerSupplier" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="form_XImageProducerSupplier"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/form/XLoadListener/form_XLoadListener.xba b/qadevOOo/tests/basic/ifc/form/XLoadListener/form_XLoadListener.xba new file mode 100644 index 000000000000..1e94cd458653 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/form/XLoadListener/form_XLoadListener.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="form_XLoadListener" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.form.XLoadListener +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + Test.StartMethod("loaded()") + bOK = true + Out.Log("nothing to test here") + Test.MethodTested("loaded()", bOK) + + Test.StartMethod("unloading()") + bOK = true + Out.Log("nothing to test here") + Test.MethodTested("unloading()", bOK) + + Test.StartMethod("unloaded()") + bOK = true + Out.Log("nothing to test here") + Test.MethodTested("unloaded()", bOK) + + Test.StartMethod("reloading()") + bOK = true + Out.Log("nothing to test here") + Test.MethodTested("reloading()", bOK) + + Test.StartMethod("reloaded()") + bOK = true + Out.Log("nothing to test here") + Test.MethodTested("reloaded()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/form/XLoadListener/script.xlb b/qadevOOo/tests/basic/ifc/form/XLoadListener/script.xlb new file mode 100644 index 000000000000..5848d5f258f7 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/form/XLoadListener/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="form_XLoadListener" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="form_XLoadListener"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/form/XLoadable/form_XLoadable.xba b/qadevOOo/tests/basic/ifc/form/XLoadable/form_XLoadable.xba new file mode 100644 index 000000000000..d1d9e77f8f28 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/form/XLoadable/form_XLoadable.xba @@ -0,0 +1,139 @@ +<?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="form_XLoadable" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.form.XLoadable +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim bLoaded As Boolean + Dim list As Object + + list = createUnoListener("L_", "com.sun.star.form.XLoadListener") + initListener() + + Test.StartMethod("isLoaded()") + bOK = true + bLoaded = oObj.isLoaded() + if bLoaded then oObj.unload() + bLoaded = oObj.isLoaded() + bOK = bOK AND NOT bLoaded + Test.MethodTested("isLoaded()", bOK) + + Test.StartMethod("addLoadListener()") + oObj.addLoadListener(list) + + Test.StartMethod("load()") + bOK = true + oObj.load() + bOK = bOK AND oObj.isLoaded() + bOK = bOK AND loaded + Test.MethodTested("load()", bOK) + + Test.StartMethod("reload()") + bOK = true + oObj.reload() + bOK = bOK AND oObj.isLoaded() + bOK = bOK AND reloaded + Test.MethodTested("reload()", bOK) + + Test.StartMethod("unload()") + bOK = true + oObj.unload() + bOK = bOK AND NOT oObj.isLoaded() + bOK = bOK AND unloaded + Test.MethodTested("unload()", bOK) + + bOK = loaded AND reloaded AND reloading AND unloaded AND unloading + Test.MethodTested("addLoadListener()", bOK) + + Test.StartMethod("removeLoadListener()") + bOK = true + oObj.removeLoadListener(list) + initListener() + oObj.load() + bOK = bOK AND NOT loaded + Test.MethodTested("removeLoadListener()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub + +Sub initListener() + loaded = false + reloaded = false + reloading = false + unloaded = false + unloading = false +End Sub + +Dim loaded As Boolean +Dim reloaded As Boolean +Dim reloading As Boolean +Dim unloaded As Boolean +Dim unloading As Boolean + +Sub L_loaded() + Out.Log("Listener: loaded") + loaded = true +End Sub +Sub L_reloaded() + Out.Log("Listener: reloaded") + reloaded = true +End Sub +Sub L_reloading() + Out.Log("Listener: reloading") + reloading = true +End Sub +Sub L_unloaded() + Out.Log("Listener: unloaded") + unloaded = true +End Sub +Sub L_unloading() + Out.Log("Listener: unloading") + unloading = true +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/form/XLoadable/script.xlb b/qadevOOo/tests/basic/ifc/form/XLoadable/script.xlb new file mode 100644 index 000000000000..ca0a5811fed2 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/form/XLoadable/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="form_XLoadable" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="form_XLoadable"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/form/XReset/form_XReset.xba b/qadevOOo/tests/basic/ifc/form/XReset/form_XReset.xba new file mode 100644 index 000000000000..dddd3f2bdc1d --- /dev/null +++ b/qadevOOo/tests/basic/ifc/form/XReset/form_XReset.xba @@ -0,0 +1,116 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="form_XReset" 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. +' +'************************************************************************* +'************************************************************************* + + + +Dim nCB1Val as Integer, nCB2Val As Integer + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.form.XReset +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim oListener1 as Object, oListener2 As Object + Dim nCount As Integer + + bOK = true + nCount = 0 'oCollection.count + nCB1Val = 0 + nCB2Val = 0 + + Out.Log("create two listeners...") + oListener1 = createUNOListener("CB1_", "com.sun.star.form.XResetListener") + oListener2 = createUNOListener("CB2_", "com.sun.star.form.XResetListener") + + ' add listeners to objectif initialized + if NOT (isNull(oListener1)) then + oObj.addResetListener(oListener1) + end if + if NOT (isNull(oListener2)) then + oObj.addResetListener(oListener2) + end if + + + Test.StartMethod("addResetListener()") + oObj.reset() + wait(1000) + bOK = bOK AND (nCB1Val = 1) AND (nCB2Val = 1) + Test.MethodTested("addResetListener()", bOK) + + Test.StartMethod("removeResetListener()") + Out.Log("removing Listener 2") + oObj.removeResetListener(oListener2) + oObj.reset() + wait(1000) + bOK = bOK AND (nCB1Val = 2) AND (nCB2Val = 1) + Test.MethodTested("removeResetListener()", bOK) + + Test.StartMethod("reset()") + bOK = bOK AND (nCB1Val = 2) AND (nCB2Val = 1) + Test.MethodTested("reset()", bOK) + + Out.Log("removing Listener 1") + oObj.removeResetListener(oListener1) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +' callback routine called resetting for listener1 +Sub CB1_resetted + Out.Log("Callback CB1 resetted") + nCB1Val = nCB1Val + 1 +End Sub' callback routine called resetting for listener2 + +Sub CB2_resetted + Out.Log("Callback CB2 resetted") + nCB2Val = nCB2Val + 1 +End Sub + +' callback routine is invoked before resetting a component. +Function CB1_approveReset() as Boolean + Out.Log("Callback CB1 approve Reset") + CB1_approveReset = true +end Function + +Function CB2_approveReset() as Boolean + Out.Log("Callback CB2 approve Reset") + CB2_approveReset = true +end Function +</script:module> diff --git a/qadevOOo/tests/basic/ifc/form/XReset/script.xlb b/qadevOOo/tests/basic/ifc/form/XReset/script.xlb new file mode 100644 index 000000000000..a50d97e7218d --- /dev/null +++ b/qadevOOo/tests/basic/ifc/form/XReset/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="form_XReset" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="form_XReset"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/form/XSubmit/form_XSubmit.xba b/qadevOOo/tests/basic/ifc/form/XSubmit/form_XSubmit.xba new file mode 100644 index 000000000000..596faa3e214e --- /dev/null +++ b/qadevOOo/tests/basic/ifc/form/XSubmit/form_XSubmit.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="form_XSubmit" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.form.XSubmit +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim list1 As Object, list2 As Object + Dim event As new com.sun.star.awt.MouseEvent + + Test.StartMethod("addSubmitListener()") + + l1Called = 0 : l2Called = 0 + + bOK = true + list1 = createUnoListener("L1_", "com.sun.star.form.XSubmitListener") + list2 = createUnoListener("L2_", "com.sun.star.form.XSubmitListener") + + Out.Log("add two listeners") + oObj.addSubmitListener(list1) + oObj.addSubmitListener(list2) + + Test.StartMethod("removeSubmitListener()") + Out.Log("remove listener 1") + oObj.removeSubmitListener(list1) + + Test.StartMethod("submit()") + + l1Called = false + l2Called = false + + oObj.TargetURL = "someserver" + oObj.submit(NULL_OBJECT, event) + + wait(500) + + Out.Log("Listener1 was called " + l1Called + " times." + Out.Log("Listener2 was called " + l2Called + " times." + + Test.MethodTested("addSubmitListener()", l2Called = 1) + Test.MethodTested("submit()", l2Called > 0) + Test.MethodTested("removeSubmitListener()", l1Called = 0) + + Out.Log("remove listener 2") + oObj.removeSubmitListener(list2) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub + +Dim l1Called As Integer +Dim l2Called As Integer + +Function L1_approveSubmit() As Boolean + l1Called = l1Called + 1 + L1_approveSubmit = true +End Function + +Function L2_approveSubmit() As Boolean + l2Called = l2Called + 1 + L2_approveSubmit = true +End Function +</script:module> diff --git a/qadevOOo/tests/basic/ifc/form/XSubmit/script.xlb b/qadevOOo/tests/basic/ifc/form/XSubmit/script.xlb new file mode 100644 index 000000000000..6950c8f3fac2 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/form/XSubmit/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="form_XSubmit" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="form_XSubmit"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/form/XUpdateBroadcaster/form_XUpdateBroadcaster.xba b/qadevOOo/tests/basic/ifc/form/XUpdateBroadcaster/form_XUpdateBroadcaster.xba new file mode 100644 index 000000000000..818646f50657 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/form/XUpdateBroadcaster/form_XUpdateBroadcaster.xba @@ -0,0 +1,172 @@ +<?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="form_XUpdateBroadcaster" 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 + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' - Global bCustomUpdate As Boolean +' properties are not changed to call listener +' Sub UpdateComponent() + +'************************************************************************* + + + + +Const BOUND = 2 +Const CONSTRAINED = 4 +Const MAYBENULL = 8 +Const READONLY = 16 + +Dim oListener1 As Object +Dim oListener2 As Object +Dim nCB1appVal As Boolean +Dim nCB2appVal As Boolean +Dim nCB1updVal As Boolean +Dim nCB2updVal As Boolean + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.form.XUpdateBroadcaster +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim bAllOK As Boolean + + Out.Log("Creating Listeners...") + oListener1 = createUNOListener("CB1_","com.sun.star.form.XUpdateListener") + oListener2 = createUNOListener("CB2_","com.sun.star.form.XUpdateListener") + bOK = NOT isNULL(oListener1) AND NOT isNULL(oListener2) + + CountersReset() + + bAllOK = bOK + + Test.StartMethod("addUpdateListener()") + bOK = true + oObj.addUpdateListener(oListener1) + oObj.addUpdateListener(oListener2) + + if bCustomUpdate then + Out.Log("Object specific update function was called.") + UpdateComponent() + else + Out.Log("Interfacetest update function was called.") + TryToUpdate() + end if + wait(1000) + + bOK = bOK AND nCB1appVal AND nCB2appVal AND nCB1updVal AND nCB2updVal + + Test.MethodTested("addUpdateListener()", bOK) + + Test.StartMethod("removeUpdateListener()") + bOK = true + Out.Log("Removing Listener 1") + oObj.removeUpdateListener(oListener1) + countersReset() + + if bCustomUpdate then + Out.Log("Object specific update function was called.") + UpdateComponent() + else + Out.Log("Interfacetest update function was called.") + TryToUpdate() + end if + wait(1000) + + bOK = bOK AND NOT nCB1appVal AND nCB2appVal AND NOT nCB1updVal AND nCB2updVal + Test.MethodTested("removeUpdateListener()", bOK) + + Out.Log("Removing Listener 2") + oObj.removeUpdateListener(oListener2) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +Function CB1_approveUpdate As Boolean + Out.Log("CallBack for Listener1 approveUpdate was called.") + nCB1appVal = TRUE + CB1_approveUpdate = TRUE +End Function + +Function CB2_approveUpdate As Boolean + Out.Log("CallBack for Listener2 approveUpdate was called.") + nCB2appVal = TRUE + CB2_approveUpdate = TRUE +End Function + +Sub CB1_Updated + Out.Log("CallBack for Listener1 Updated was called.") + nCB1updVal = TRUE +End Sub + +Sub CB2_Updated + Out.Log("CallBack for Listener2 Updated was called.") + nCB2updVal = TRUE +End Sub + +Sub TryToUpdate() + Dim i as Integer + Dim props as Variant, attr As Variant + + if hasUnoInterfaces(oObj, "com.sun.star.beans.XPropertySet") then + props() = oObj.getPropertySetInfo().getProperties() + + for i = lbound(props()) to ubound(props()) + PropertyTester.TestProperty(props(i).Name) + next i + else + Out.Log("XPropertySet isn't supported.") + end if +End Sub + +Sub countersReset() + nCB1updVal = FALSE + nCB2updVal = FALSE + nCB1appVal = FALSE + nCB2appVal = FALSE +End sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/form/XUpdateBroadcaster/script.xlb b/qadevOOo/tests/basic/ifc/form/XUpdateBroadcaster/script.xlb new file mode 100644 index 000000000000..d0484c6b2661 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/form/XUpdateBroadcaster/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="form_XUpdateBroadcaster" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="form_XUpdateBroadcaster"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/form/component/CheckBox/form_component_CheckBox.xba b/qadevOOo/tests/basic/ifc/form/component/CheckBox/form_component_CheckBox.xba new file mode 100644 index 000000000000..9ef151888d79 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/form/component/CheckBox/form_component_CheckBox.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="form_component_CheckBox" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.form.component.CheckBox +'************************************************************************* +On Error Goto ErrHndl + + Dim bOK As Boolean + + PropertyTester.TestProperty("DefaultState") + + PropertyTester.TestProperty("RefValue") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/form/component/CheckBox/script.xlb b/qadevOOo/tests/basic/ifc/form/component/CheckBox/script.xlb new file mode 100644 index 000000000000..e67dd95c1988 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/form/component/CheckBox/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="form_component_CheckBox" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="form_component_CheckBox"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/form/component/ComboBox/form_component_ComboBox.xba b/qadevOOo/tests/basic/ifc/form/component/ComboBox/form_component_ComboBox.xba new file mode 100644 index 000000000000..fd80cd4913f9 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/form/component/ComboBox/form_component_ComboBox.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="form_component_ComboBox" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.form.component.ComboBox +'************************************************************************* +On Error Goto ErrHndl + + Dim bOK As Boolean + + PropertyTester.TestProperty("DefaultText") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/form/component/ComboBox/script.xlb b/qadevOOo/tests/basic/ifc/form/component/ComboBox/script.xlb new file mode 100644 index 000000000000..9add91431d91 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/form/component/ComboBox/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="form_component_ComboBox" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="form_component_ComboBox"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/form/component/CommandButton/form_component_CommandButton.xba b/qadevOOo/tests/basic/ifc/form/component/CommandButton/form_component_CommandButton.xba new file mode 100644 index 000000000000..937c8010fe17 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/form/component/CommandButton/form_component_CommandButton.xba @@ -0,0 +1,78 @@ +<?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="form_component_CommandButton" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.form.component.CommandButton +'************************************************************************* +On Error Goto ErrHndl + + Dim bOK As Boolean + Dim n as Integer + + Test.StartMethod("ButtonType") + bOK = true + Dim ButtonTypes(4) as Variant + ButtonTypes(0) = com.sun.star.form.FormButtonType.PUSH + ButtonTypes(1) = com.sun.star.form.FormButtonType.SUBMIT + ButtonTypes(2) = com.sun.star.form.FormButtonType.URL + ButtonTypes(3) = com.sun.star.form.FormButtonType.RESET + + for n = 0 to ubound(ButtonTypes())-1 + oObj.setPropertyValue("ButtonType", _ + createUnoValue("byte", ButtonTypes(n))) + bOK = bOK AND (oObj.getPropertyValue("ButtonType") = ButtonTypes(n)) + next + + Test.MethodTested("ButtonType", bOK) + + PropertyTester.TestProperty("TargetFrame") + + PropertyTester.TestProperty("TargetURL") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/form/component/CommandButton/script.xlb b/qadevOOo/tests/basic/ifc/form/component/CommandButton/script.xlb new file mode 100644 index 000000000000..461782f0c8b5 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/form/component/CommandButton/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="form_component_CommandButton" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="form_component_CommandButton"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/form/component/CurrencyField/form_component_CurrencyField.xba b/qadevOOo/tests/basic/ifc/form/component/CurrencyField/form_component_CurrencyField.xba new file mode 100644 index 000000000000..d728c99eb801 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/form/component/CurrencyField/form_component_CurrencyField.xba @@ -0,0 +1,71 @@ +<?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="form_component_CurrencyField" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.form.component.CurrencyField +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim newVal, oldVal As Double + + bOK = true + oldVal = oObj.DefaultValue + Test.StartMethod("DefaultValue") + Out.Log("value before: "+oldVal) + if (oldVal <> 30) then + oObj.DefaultValue = 30 + else + oObj.DefaultValue = 35 + endif + newVal = oObj.DefaultValue + Out.Log("value after: "+newVal) + bOK = bOK AND (newVal <> oldVal) + Test.MethodTested("DefaultValue", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/form/component/CurrencyField/script.xlb b/qadevOOo/tests/basic/ifc/form/component/CurrencyField/script.xlb new file mode 100644 index 000000000000..ed12a18c8d2f --- /dev/null +++ b/qadevOOo/tests/basic/ifc/form/component/CurrencyField/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="form_component_CurrencyField" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="form_component_CurrencyField"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/form/component/DataForm/form_component_DataForm.xba b/qadevOOo/tests/basic/ifc/form/component/DataForm/form_component_DataForm.xba new file mode 100644 index 000000000000..40d43ad36c84 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/form/component/DataForm/form_component_DataForm.xba @@ -0,0 +1,89 @@ +<?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="form_component_DataForm" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.form.component.DataForm +'************************************************************************* +On Error Goto ErrHndl + + Dim bOK As Boolean + + PropertyTester.TestProperty("MasterFields") + + PropertyTester.TestProperty("DetailFields") + + Test.StartMethod("Cycle") + bOK = true + + oObj.Cycle = com.sun.star.form.TabulatorCycle.RECORDS + bOK = bOK AND oObj.Cycle = com.sun.star.form.TabulatorCycle.RECORDS + + oObj.Cycle = com.sun.star.form.TabulatorCycle.CURRENT + bOK = bOK AND oObj.Cycle = com.sun.star.form.TabulatorCycle.CURRENT + + Test.MethodTested("Cycle", bOK) + + Test.StartMethod("NavigationBarMode") + bOK = true + + oObj.NavigationBarMode = com.sun.star.form.NavigationBarMode.NONE + bOK = bOK AND oObj.NavigationBarMode = com.sun.star.form.NavigationBarMode.NONE + + oObj.NavigationBarMode = com.sun.star.form.NavigationBarMode.CURRENT + bOK = bOK AND oObj.NavigationBarMode = com.sun.star.form.NavigationBarMode.CURRENT + + Test.MethodTested("NavigationBarMode", bOK) + + PropertyTester.TestProperty("AllowInserts") + + PropertyTester.TestProperty("AllowUpdates") + + PropertyTester.TestProperty("AllowDeletes") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/form/component/DataForm/script.xlb b/qadevOOo/tests/basic/ifc/form/component/DataForm/script.xlb new file mode 100644 index 000000000000..664644c5a8e7 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/form/component/DataForm/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="form_component_DataForm" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="form_component_DataForm"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/form/component/DatabaseComboBox/form_component_DatabaseComboBox.xba b/qadevOOo/tests/basic/ifc/form/component/DatabaseComboBox/form_component_DatabaseComboBox.xba new file mode 100644 index 000000000000..2e7fea0b24ac --- /dev/null +++ b/qadevOOo/tests/basic/ifc/form/component/DatabaseComboBox/form_component_DatabaseComboBox.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="form_component_DatabaseComboBox" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.form.component.DatabaseComboBox +'************************************************************************* +On Error Goto ErrHndl + + Dim bOK As Boolean + + PropertyTester.TestProperty("ConvertEmptyToNull") + + PropertyTester.TestProperty("ListSource") + + PropertyTester.TestProperty("ListSourceType") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/form/component/DatabaseComboBox/script.xlb b/qadevOOo/tests/basic/ifc/form/component/DatabaseComboBox/script.xlb new file mode 100644 index 000000000000..9a13df9ecbaf --- /dev/null +++ b/qadevOOo/tests/basic/ifc/form/component/DatabaseComboBox/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="form_component_DatabaseComboBox" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="form_component_DatabaseComboBox"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/form/component/DatabaseFormattedField/form_component_DatabaseFormattedField.xba b/qadevOOo/tests/basic/ifc/form/component/DatabaseFormattedField/form_component_DatabaseFormattedField.xba new file mode 100644 index 000000000000..04d2e1c889c4 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/form/component/DatabaseFormattedField/form_component_DatabaseFormattedField.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="form_component_DatabaseFormattedField" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.form.component.DatabaseFormattedField +'************************************************************************* +On Error Goto ErrHndl + + Dim bOK As Boolean + + PropertyTester.TestProperty("ConvertEmptyToNull") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/form/component/DatabaseFormattedField/script.xlb b/qadevOOo/tests/basic/ifc/form/component/DatabaseFormattedField/script.xlb new file mode 100644 index 000000000000..d7a0d5757768 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/form/component/DatabaseFormattedField/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="form_component_DatabaseFormattedField" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="form_component_DatabaseFormattedField"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/form/component/DatabaseImageControl/form_component_DatabaseImageControl.xba b/qadevOOo/tests/basic/ifc/form/component/DatabaseImageControl/form_component_DatabaseImageControl.xba new file mode 100644 index 000000000000..728949a09f2f --- /dev/null +++ b/qadevOOo/tests/basic/ifc/form/component/DatabaseImageControl/form_component_DatabaseImageControl.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="form_component_DatabaseImageControl" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.form.component.DatabaseImageControl +'************************************************************************* +On Error Goto ErrHndl + + Dim bOK As Boolean + + PropertyTester.TestProperty("ReadOnly") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/form/component/DatabaseImageControl/script.xlb b/qadevOOo/tests/basic/ifc/form/component/DatabaseImageControl/script.xlb new file mode 100644 index 000000000000..a83e10101fba --- /dev/null +++ b/qadevOOo/tests/basic/ifc/form/component/DatabaseImageControl/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="form_component_DatabaseImageControl" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="form_component_DatabaseImageControl"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/form/component/DatabaseListBox/form_component_DatabaseListBox.xba b/qadevOOo/tests/basic/ifc/form/component/DatabaseListBox/form_component_DatabaseListBox.xba new file mode 100644 index 000000000000..de6ec59f2c4a --- /dev/null +++ b/qadevOOo/tests/basic/ifc/form/component/DatabaseListBox/form_component_DatabaseListBox.xba @@ -0,0 +1,76 @@ +<?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="form_component_DatabaseListBox" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.form.component.DatabaseListBox +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim newVal, oldVal As Variant + + bOK = true + oldVal = oObj.BoundColumn + Test.StartMethod("BoundColumn") + Out.Log("value before: "+oldVal) + + if (oldVal <> 30) then + oObj.BoundColumn = 30 + else + oObj.BoundColumn = 35 + endif + + newVal = oObj.BoundColumn + Out.Log("value after: "+newVal) + + bOK = bOK AND (newVal <> oldVal) + Test.MethodTested("BoundColumn", bOK) + + PropertyTester.TestProperty("ListSourceType") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/form/component/DatabaseListBox/script.xlb b/qadevOOo/tests/basic/ifc/form/component/DatabaseListBox/script.xlb new file mode 100644 index 000000000000..7f028d823990 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/form/component/DatabaseListBox/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="form_component_DatabaseListBox" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="form_component_DatabaseListBox"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/form/component/DatabasePatternField/form_component_DatabasePatternField.xba b/qadevOOo/tests/basic/ifc/form/component/DatabasePatternField/form_component_DatabasePatternField.xba new file mode 100644 index 000000000000..c8293ba62987 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/form/component/DatabasePatternField/form_component_DatabasePatternField.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="form_component_DatabasePatternField" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.form.component.DatabasePatternField +'************************************************************************* +On Error Goto ErrHndl + + Dim bOK As Boolean + + PropertyTester.TestProperty("ConvertEmptyToNull") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/form/component/DatabasePatternField/script.xlb b/qadevOOo/tests/basic/ifc/form/component/DatabasePatternField/script.xlb new file mode 100644 index 000000000000..143700c9c972 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/form/component/DatabasePatternField/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="form_component_DatabasePatternField" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="form_component_DatabasePatternField"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/form/component/DatabaseTextField/form_component_DatabaseTextField.xba b/qadevOOo/tests/basic/ifc/form/component/DatabaseTextField/form_component_DatabaseTextField.xba new file mode 100644 index 000000000000..8881952ded1d --- /dev/null +++ b/qadevOOo/tests/basic/ifc/form/component/DatabaseTextField/form_component_DatabaseTextField.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="form_component_DatabaseTextField" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.form.component.DatabaseTextField +'************************************************************************* +On Error Goto ErrHndl + + Dim bOK As Boolean + + PropertyTester.TestProperty("ConvertEmptyToNull") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/form/component/DatabaseTextField/script.xlb b/qadevOOo/tests/basic/ifc/form/component/DatabaseTextField/script.xlb new file mode 100644 index 000000000000..7b30d30e1de3 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/form/component/DatabaseTextField/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="form_component_DatabaseTextField" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="form_component_DatabaseTextField"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/form/component/DateField/form_component_DateField.xba b/qadevOOo/tests/basic/ifc/form/component/DateField/form_component_DateField.xba new file mode 100644 index 000000000000..2f8be6b80641 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/form/component/DateField/form_component_DateField.xba @@ -0,0 +1,71 @@ +<?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="form_component_DateField" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.form.component.DateField +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim newVal, oldVal As Long + + Test.StartMethod("DefaultDate") + bOK = true + oldVal = oObj.DefaultDate + Out.Log("value before: "+oldVal) + if (oldVal <> 111111) then + oObj.DefaultDate = 111111 + else + oObj.DefaultDate = 222222 + endif + newVal = oObj.DefaultDate + Out.Log("value after: "+newVal) + bOK = bOK AND (newVal <> oldVal) + Test.MethodTested("DefaultDate", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/form/component/DateField/script.xlb b/qadevOOo/tests/basic/ifc/form/component/DateField/script.xlb new file mode 100644 index 000000000000..4d8344ba21c9 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/form/component/DateField/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="form_component_DateField" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="form_component_DateField"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/form/component/FileControl/form_component_FileControl.xba b/qadevOOo/tests/basic/ifc/form/component/FileControl/form_component_FileControl.xba new file mode 100644 index 000000000000..002b38e433b0 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/form/component/FileControl/form_component_FileControl.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="form_component_FileControl" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.form.component.FileControl +'************************************************************************* +On Error Goto ErrHndl + + Dim bOK As Boolean + + PropertyTester.TestProperty("DefaultText") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/form/component/FileControl/script.xlb b/qadevOOo/tests/basic/ifc/form/component/FileControl/script.xlb new file mode 100644 index 000000000000..642acb13e896 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/form/component/FileControl/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="form_component_FileControl" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="form_component_FileControl"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/form/component/GridControl/form_component_GridControl.xba b/qadevOOo/tests/basic/ifc/form/component/GridControl/form_component_GridControl.xba new file mode 100644 index 000000000000..e35443864828 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/form/component/GridControl/form_component_GridControl.xba @@ -0,0 +1,69 @@ +<?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="form_component_GridControl" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.form.component.GridControl +'************************************************************************* +On Error Goto ErrHndl + + Dim bOK As Boolean + + PropertyTester.TestProperty("Border") + + PropertyTester.TestProperty("Enabled") + + PropertyTester.TestProperty("FontDescriptor") + + PropertyTester.TestProperty("RowHeight") + + PropertyTester.TestProperty("Tabstop") + + PropertyTester.TestProperty("TextColor") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/form/component/GridControl/script.xlb b/qadevOOo/tests/basic/ifc/form/component/GridControl/script.xlb new file mode 100644 index 000000000000..f1a7c5df658f --- /dev/null +++ b/qadevOOo/tests/basic/ifc/form/component/GridControl/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="form_component_GridControl" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="form_component_GridControl"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/form/component/HTMLForm/form_component_HTMLForm.xba b/qadevOOo/tests/basic/ifc/form/component/HTMLForm/form_component_HTMLForm.xba new file mode 100644 index 000000000000..e6f3b9711297 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/form/component/HTMLForm/form_component_HTMLForm.xba @@ -0,0 +1,83 @@ +<?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="form_component_HTMLForm" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.form.component.HTMLForm +'************************************************************************* +On Error Goto ErrHndl + + Dim bOK As Boolean + + PropertyTester.TestProperty("TargetFrame") + + PropertyTester.TestProperty("TargetURL") + + Test.StartMethod("SubmitMethod") + bOK = true + + oObj.SubmitMethod = com.sun.star.form.FormSubmitMethod.GET + bOK = bOK AND oObj.SubmitMethod = com.sun.star.form.FormSubmitMethod.GET + + oObj.SubmitMethod = com.sun.star.form.FormSubmitMethod.POST + bOK = bOK AND oObj.SubmitMethod = com.sun.star.form.FormSubmitMethod.POST + + Test.MethodTested("SubmitMethod", bOK) + + Test.StartMethod("SubmitEncoding") + bOK = true + + oObj.SubmitEncoding = com.sun.star.form.FormSubmitEncoding.URL + bOK = bOK AND oObj.SubmitEncoding = com.sun.star.form.FormSubmitEncoding.URL + + oObj.SubmitEncoding = com.sun.star.form.FormSubmitEncoding.MULTIPART + bOK = bOK AND oObj.SubmitEncoding = com.sun.star.form.FormSubmitEncoding.MULTIPART + + Test.MethodTested("SubmitEncoding", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/form/component/HTMLForm/script.xlb b/qadevOOo/tests/basic/ifc/form/component/HTMLForm/script.xlb new file mode 100644 index 000000000000..002789e0051e --- /dev/null +++ b/qadevOOo/tests/basic/ifc/form/component/HTMLForm/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="form_component_HTMLForm" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="form_component_HTMLForm"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/form/component/HiddenControl/form_component_HiddenControl.xba b/qadevOOo/tests/basic/ifc/form/component/HiddenControl/form_component_HiddenControl.xba new file mode 100644 index 000000000000..58e460bc3651 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/form/component/HiddenControl/form_component_HiddenControl.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="form_component_HiddenControl" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.form.component.HiddenControl +'************************************************************************* +On Error Goto ErrHndl + + Dim bOK As Boolean + + PropertyTester.TestProperty("HiddenValue") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/form/component/HiddenControl/script.xlb b/qadevOOo/tests/basic/ifc/form/component/HiddenControl/script.xlb new file mode 100644 index 000000000000..4a6708a28552 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/form/component/HiddenControl/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="form_component_HiddenControl" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="form_component_HiddenControl"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/form/component/ImageButton/form_component_ImageButton.xba b/qadevOOo/tests/basic/ifc/form/component/ImageButton/form_component_ImageButton.xba new file mode 100644 index 000000000000..217989a6c0be --- /dev/null +++ b/qadevOOo/tests/basic/ifc/form/component/ImageButton/form_component_ImageButton.xba @@ -0,0 +1,72 @@ +<?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="form_component_ImageButton" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.form.component.ImageButton +'************************************************************************* +On Error Goto ErrHndl + + Dim bOK As Boolean + + Test.StartMethod("ButtonType") + bOK = true + + oObj.ButtonType = com.sun.star.form.FormButtonType.PUSH + bOK = bOK AND oObj.ButtonType = com.sun.star.form.FormButtonType.PUSH + + oObj.ButtonType = com.sun.star.form.FormButtonType.SUBMIT + bOK = bOK AND oObj.ButtonType = com.sun.star.form.FormButtonType.SUBMIT + + Test.MethodTested("ButtonType", bOK) + + PropertyTester.TestProperty("TargetFrame") + + PropertyTester.TestProperty("TargetURL") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/form/component/ImageButton/script.xlb b/qadevOOo/tests/basic/ifc/form/component/ImageButton/script.xlb new file mode 100644 index 000000000000..3a543d2069ad --- /dev/null +++ b/qadevOOo/tests/basic/ifc/form/component/ImageButton/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="form_component_ImageButton" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="form_component_ImageButton"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/form/component/ListBox/form_component_ListBox.xba b/qadevOOo/tests/basic/ifc/form/component/ListBox/form_component_ListBox.xba new file mode 100644 index 000000000000..dd3859fd789d --- /dev/null +++ b/qadevOOo/tests/basic/ifc/form/component/ListBox/form_component_ListBox.xba @@ -0,0 +1,80 @@ +<?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="form_component_ListBox" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.form.component.ListBox +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim newVal, oldVal As Variant + + bOK = true + Test.StartMethod("DefaultSelection") + + oldVal = oObj.DefaultSelection(0) + Out.Log("value before: "+oldVal) + + if (oldVal <> 3) then + Out.Log("setting to 3") + oObj.DefaultSelection = Array(3) + else + Out.Log("setting to 5") + oObj.DefaultSelection = Array(5) + endif + + newVal = oObj.DefaultSelection(0) + Out.Log("value after: "+newVal) + + bOK = bOK AND (newVal <> oldVal) + Test.MethodTested("DefaultSelection", bOK) + + + PropertyTester.TestProperty("ListSource") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/form/component/ListBox/script.xlb b/qadevOOo/tests/basic/ifc/form/component/ListBox/script.xlb new file mode 100644 index 000000000000..10420c2c5b72 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/form/component/ListBox/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="form_component_ListBox" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="form_component_ListBox"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/form/component/NumericField/form_component_NumericField.xba b/qadevOOo/tests/basic/ifc/form/component/NumericField/form_component_NumericField.xba new file mode 100644 index 000000000000..3346a612858b --- /dev/null +++ b/qadevOOo/tests/basic/ifc/form/component/NumericField/form_component_NumericField.xba @@ -0,0 +1,74 @@ +<?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="form_component_NumericField" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.form.component.NumericField +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim newVal, oldVal As Variant + + bOK = true + Test.StartMethod("DefaultValue") + oldVal = oObj.DefaultValue + Out.Log("value before: "+oldVal) + if (oldVal <> 3) then + Out.Log("setting to 3") + oObj.DefaultValue = 3 + else + Out.Log("setting to 5") + oObj.DefaultValue = 5 + endif + newVal = oObj.DefaultValue + Out.Log("value after: "+newVal) + bOK = bOK AND (newVal <> oldVal) + Test.MethodTested("DefaultValue", bOK) + + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/form/component/NumericField/script.xlb b/qadevOOo/tests/basic/ifc/form/component/NumericField/script.xlb new file mode 100644 index 000000000000..078c55194b6a --- /dev/null +++ b/qadevOOo/tests/basic/ifc/form/component/NumericField/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="form_component_NumericField" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="form_component_NumericField"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/form/component/PatternField/form_component_PatternField.xba b/qadevOOo/tests/basic/ifc/form/component/PatternField/form_component_PatternField.xba new file mode 100644 index 000000000000..154b73b09bae --- /dev/null +++ b/qadevOOo/tests/basic/ifc/form/component/PatternField/form_component_PatternField.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="form_component_PatternField" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.form.component.PatternField +'************************************************************************* +On Error Goto ErrHndl + + Dim bOK As Boolean + + PropertyTester.TestProperty("DefaultText") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/form/component/PatternField/script.xlb b/qadevOOo/tests/basic/ifc/form/component/PatternField/script.xlb new file mode 100644 index 000000000000..6c5bdae42648 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/form/component/PatternField/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="form_component_PatternField" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="form_component_PatternField"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/form/component/RadioButton/form_component_RadioButton.xba b/qadevOOo/tests/basic/ifc/form/component/RadioButton/form_component_RadioButton.xba new file mode 100644 index 000000000000..7f3f60369f5e --- /dev/null +++ b/qadevOOo/tests/basic/ifc/form/component/RadioButton/form_component_RadioButton.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="form_component_RadioButton" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.form.component.RadioButton +'************************************************************************* +On Error Goto ErrHndl + + Dim bOK As Boolean + + PropertyTester.TestProperty("DefaultState") + + PropertyTester.TestProperty("RefValue") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/form/component/RadioButton/script.xlb b/qadevOOo/tests/basic/ifc/form/component/RadioButton/script.xlb new file mode 100644 index 000000000000..f51b6fb36ba2 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/form/component/RadioButton/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="form_component_RadioButton" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="form_component_RadioButton"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/form/component/TextField/form_component_TextField.xba b/qadevOOo/tests/basic/ifc/form/component/TextField/form_component_TextField.xba new file mode 100644 index 000000000000..03f0215bbe96 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/form/component/TextField/form_component_TextField.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="form_component_TextField" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.form.component.TextField +'************************************************************************* +On Error Goto ErrHndl + + Dim bOK As Boolean + + PropertyTester.TestProperty("DefaultText") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/form/component/TextField/script.xlb b/qadevOOo/tests/basic/ifc/form/component/TextField/script.xlb new file mode 100644 index 000000000000..c6725494a9ee --- /dev/null +++ b/qadevOOo/tests/basic/ifc/form/component/TextField/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="form_component_TextField" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="form_component_TextField"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/form/component/TimeField/form_component_TimeField.xba b/qadevOOo/tests/basic/ifc/form/component/TimeField/form_component_TimeField.xba new file mode 100644 index 000000000000..35ad56c293ae --- /dev/null +++ b/qadevOOo/tests/basic/ifc/form/component/TimeField/form_component_TimeField.xba @@ -0,0 +1,71 @@ +<?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="form_component_TimeField" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.form.component.TimeField +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim newVal, oldVal As Long + + bOK = true + oldVal = oObj.DefaultTime + Test.StartMethod("DefaultTime") + Out.Log("value before: "+oldVal) + if (oldVal <> 4322) then + oObj.DefaultTime = 4321 + else + oObj.DefaultTime = 4322 + endif + newVal = oObj.DefaultTime + Out.Log("value after: "+newVal) + bOK = bOK AND (newVal <> oldVal) + Test.MethodTested("DefaultTime", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/form/component/TimeField/script.xlb b/qadevOOo/tests/basic/ifc/form/component/TimeField/script.xlb new file mode 100644 index 000000000000..8ad20ef90241 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/form/component/TimeField/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="form_component_TimeField" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="form_component_TimeField"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/formula/FormulaProperties/formula_FormulaProperties.xba b/qadevOOo/tests/basic/ifc/formula/FormulaProperties/formula_FormulaProperties.xba new file mode 100644 index 000000000000..73a22a3c7991 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/formula/FormulaProperties/formula_FormulaProperties.xba @@ -0,0 +1,170 @@ +<?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="formula_FormulaProperties" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.formula.FormulaProperties +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim align(1) As Integer + + align(0) = 1 + align(1) = 0 + + PropertyTester.TestProperty("Alignment",align()) + + PropertyTester.TestProperty("BaseFontHeight") + + PropertyTester.TestProperty("CustomFontNameFixed") + + PropertyTester.TestProperty("FontFixedIsItalic") + + PropertyTester.TestProperty("FontFixedIsBold") + + PropertyTester.TestProperty("CustomFontNameSans") + + PropertyTester.TestProperty("FontSansIsItalic") + + PropertyTester.TestProperty("FontSansIsBold") + + PropertyTester.TestProperty("CustomFontNameSerif") + + PropertyTester.TestProperty("FontSerifIsItalic") + + PropertyTester.TestProperty("FontSerifIsBold") + + PropertyTester.TestProperty("FontNameFunctions") + + PropertyTester.TestProperty("FontFunctionsIsItalic") + + PropertyTester.TestProperty("FontFunctionsIsBold") + + PropertyTester.TestProperty("FontNameNumbers") + + PropertyTester.TestProperty("FontNumbersIsItalic") + + PropertyTester.TestProperty("FontNumbersIsBold") + + PropertyTester.TestProperty("FontNameText") + + PropertyTester.TestProperty("FontTextIsItalic") + + PropertyTester.TestProperty("FontTextIsBold") + + PropertyTester.TestProperty("FontNameVariables") + + PropertyTester.TestProperty("FontVariablesIsItalic") + + PropertyTester.TestProperty("FontVariablesIsBold") + + PropertyTester.TestProperty("Formula") + + PropertyTester.TestProperty("IsScaleAllBrackets") + + PropertyTester.TestProperty("IsTextMode") + + PropertyTester.TestProperty("RelativeFontHeightFunctions") + + PropertyTester.TestProperty("RelativeFontHeightIndices") + + PropertyTester.TestProperty("RelativeFontHeightLimits") + + PropertyTester.TestProperty("RelativeFontHeightOperators") + + PropertyTester.TestProperty("RelativeFontHeightText") + + PropertyTester.TestProperty("RelativeBracketDistance") + + PropertyTester.TestProperty("RelativeBracketExcessSize") + + PropertyTester.TestProperty("RelativeFractionBarExcessLength") + + PropertyTester.TestProperty("RelativeFractionBarLineWeight") + + PropertyTester.TestProperty("RelativeFractionDenominatorDepth") + + PropertyTester.TestProperty("RelativeFractionNumeratorHeight") + + PropertyTester.TestProperty("RelativeIndexSubscript") + + PropertyTester.TestProperty("RelativeIndexSuperscript") + + PropertyTester.TestProperty("RelativeLineSpacing") + + PropertyTester.TestProperty("RelativeLowerLimitDistance") + + PropertyTester.TestProperty("RelativeMatrixColumnSpacing") + + PropertyTester.TestProperty("RelativeMatrixLineSpacing") + + PropertyTester.TestProperty("RelativeOperatorExcessSize") + + PropertyTester.TestProperty("RelativeOperatorSpacing") + + PropertyTester.TestProperty("RelativeRootSpacing") + + PropertyTester.TestProperty("RelativeScaleBracketExcessSize") + + PropertyTester.TestProperty("RelativeSpacing") + + PropertyTester.TestProperty("RelativeSymbolMinimumHeight") + + PropertyTester.TestProperty("RelativeSymbolPrimaryHeight") + + PropertyTester.TestProperty("RelativeUpperLimitDistance") + + PropertyTester.TestProperty("TopMargin") + + PropertyTester.TestProperty("BottomMargin") + + PropertyTester.TestProperty("LeftMargin") + + PropertyTester.TestProperty("RightMargin") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/formula/FormulaProperties/script.xlb b/qadevOOo/tests/basic/ifc/formula/FormulaProperties/script.xlb new file mode 100644 index 000000000000..5046056bdcd1 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/formula/FormulaProperties/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="formula_FormulaProperties" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="formula_FormulaProperties"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/frame/Frame/frame_Frame.xba b/qadevOOo/tests/basic/ifc/frame/Frame/frame_Frame.xba new file mode 100644 index 000000000000..8c7a29c93f72 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/frame/Frame/frame_Frame.xba @@ -0,0 +1,61 @@ +<?xml version="1.0" encoding="UTF-8"?> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="frame_Frame" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.frame.Frame +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + +' + PropertyTester.TestProperty("Title") + + PropertyTester.TestProperty("RecorderSupplier") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/frame/Frame/script.xlb b/qadevOOo/tests/basic/ifc/frame/Frame/script.xlb new file mode 100644 index 000000000000..cdac70151a1c --- /dev/null +++ b/qadevOOo/tests/basic/ifc/frame/Frame/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="frame_Frame" library:readonly="false" library:passwordprotected="false"> + <library:element library:name="frame_Frame"/> + </library:library> diff --git a/qadevOOo/tests/basic/ifc/frame/XComponentLoader/frame_XComponentLoader.xba b/qadevOOo/tests/basic/ifc/frame/XComponentLoader/frame_XComponentLoader.xba new file mode 100644 index 000000000000..d731c3e1a766 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/frame/XComponentLoader/frame_XComponentLoader.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="frame_XComponentLoader" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.frame.XComponentLoader +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim frameName As String + Dim doc As Object + + Test.StartMethod("loadComponentFromURL()") + bOK = true + frameName = "_blank" + + Dim szArgs(0) As new com.sun.star.beans.PropertyValue + szArgs(0).Name = "OpenFlags" + szArgs(0).Value = "S" + szArgs(0).Handle = -1 + szArgs(0).State = com.sun.star.beans.PropertyState.DEFAULT_VALUE + + Out.log("load a blank impress doc") + doc = oObj.loadComponentFromURL("private:factory/simpress", frameName, 0, szArgs()) + bOK = Not isNull(doc) + Out.log("disposing impress doc") + doc.dispose() + + Dim szEmptyArgs() + + Out.log("load a blank writer doc") + doc = oObj.loadComponentFromURL("private:factory/swriter", frameName, 0, szEmptyArgs()) + bOK = bOK and Not isNull(doc) + Out.log("disposing writer doc") + doc.dispose() + + Out.log("load a blank calc doc") + doc = oObj.loadComponentFromURL("private:factory/scalc", frameName, 0, szEmptyArgs()) + bOK = bOK and Not isNull(doc) + Out.log("disposing calc doc") + doc.dispose() + + Out.log("load a blank draw doc") + doc = oObj.loadComponentFromURL("private:factory/sdraw", frameName, 0, szEmptyArgs()) + bOK = bOK and Not isNull(doc) + Out.log("disposing draw doc") + doc.dispose() + + Out.log("load a blank math doc") + oDoc = oObj.loadComponentFromURL("private:factory/smath", frameName, 0, szEmptyArgs()) + bOK = bOK and Not isNull(doc) + Out.log("disposing math doc") + doc.dispose() + + Out.log("load a blank chart doc") + oDoc = oObj.loadComponentFromURL("private:factory/schart", frameName, 0, szEmptyArgs()) + bOK = bOK and Not isNull(doc) + Out.log("disposing schart doc") + doc.dispose() + + Test.MethodTested("loadComponentFromURL()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/frame/XComponentLoader/script.xlb b/qadevOOo/tests/basic/ifc/frame/XComponentLoader/script.xlb new file mode 100644 index 000000000000..47e576eca7ca --- /dev/null +++ b/qadevOOo/tests/basic/ifc/frame/XComponentLoader/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="frame_XComponentLoader" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="frame_XComponentLoader"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/frame/XController/frame_XController.xba b/qadevOOo/tests/basic/ifc/frame/XController/frame_XController.xba new file mode 100644 index 000000000000..31c2e434ca73 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/frame/XController/frame_XController.xba @@ -0,0 +1,134 @@ +<?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="frame_XController" 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. +' +'************************************************************************* +'************************************************************************* + + + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' - Global oFrameToAttach As Object +' - Global oModelToAttach As Object +' - Global bHasNoViewData As Boolean +' - Global oObjToSuspend As Object +' - Global bHasNoModel As Boolean + +'************************************************************************* + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.frame.XController +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Test.StartMethod("getViewData()") + bOK = true + if (bHasNoViewData) then + Out.Log("This object has no ViewData - nothing to test") + else + oViewData = oObj.getViewData() + bOK = bOK AND NOT isNULL(oViewData) + end if + Test.MethodTested("getViewData()", bOK) + + Test.StartMethod("restoreViewData()") + bOK = true + if (bHasNoViewData) then + Out.Log("This object has no ViewData - nothing to test") + else + oObj.restoreViewData(oViewData) + end if + Test.MethodTested("restoreViewData()", bOK) + + Test.StartMethod("getFrame()") + bOK = true + oFrame = oObj.getFrame() + bOK = bOK AND hasUnoInterfaces(oFrame, "com.sun.star.frame.XFrame") + Test.MethodTested("getFrame()", bOK) + + Test.StartMethod("getModel()") + bOK = true + oModel = oObj.getModel() + if (bHasNoModel) then + bOK = bOK AND isNull(oModel) + Out.Log("The object has no Model. Retunrned value must be NULL") + else + bOK = bOK AND NOT isNull(oModel) AND hasUnoInterfaces(oModel, "com.sun.star.frame.XModel") + end if + Test.MethodTested("getModel()", bOK) + + Test.StartMethod("attachFrame()") + bOK = true + Dim attachedFrame As Object + attachedFrame = oObj.getFrame() + oFrameToAttach.Name = "XController" + oObj.attachFrame(oFrameToAttach) + bOK = bOK AND oObj.getFrame.Name = oFrameToAttach.Name + ' return previous frame. + oObj.attachFrame(attachedFrame) + Test.MethodTested("attachFrame()", bOK) + + Test.StartMethod("attachModel()") + bOK = true + if bHasNoModel then + Out.Log("The object has no Model. Nothing to test.") + else + oObj.attachModel(oModelToAttach) + if isNull(oObj.getModel()) then + Out.Log("The model is NULL after setModel() call") + bOK = false + else + bOK = bOK AND oModelToAttach.location = oObj.getModel.location + end if + end if + Test.MethodTested("attachModel()", bOK) + + Test.StartMethod("suspend()") + bOK = true + bOK = bOK AND oObjToSuspend.suspend(true) + Test.MethodTested("suspend()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/frame/XController/script.xlb b/qadevOOo/tests/basic/ifc/frame/XController/script.xlb new file mode 100644 index 000000000000..3f34e466dd72 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/frame/XController/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="frame_XController" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="frame_XController"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/frame/XDesktop/frame_XDesktop.xba b/qadevOOo/tests/basic/ifc/frame/XDesktop/frame_XDesktop.xba new file mode 100644 index 000000000000..35e5201add01 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/frame/XDesktop/frame_XDesktop.xba @@ -0,0 +1,97 @@ +<?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="frame_XDesktop" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.frame.XDesktop +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Test.StartMethod("getComponents()") + bOK = true + Dim components As Object + components = oObj.getComponents() + if (Not isNull(components)) then + Dim enum As Object + enum = components.createEnumeration() + while(enum.hasMoreElements()) + enum.nextElement() + wend + bOK = true + else + bOK = false + end if + Test.MethodTested("getComponents()", bOK) + + Test.StartMethod("terminate()") + bOK = true + Test.MethodTested("terminate()", bOK) + + Test.StartMethod("addTerminateListener()") + bOK = true + Test.MethodTested("addTerminateListener()", bOK) + + Test.StartMethod("removeTerminateListener()") + bOK = true + Test.MethodTested("removeTerminateListener()", bOK) + + Test.StartMethod("getCurrentComponent()") + bOK = true + Dim curComp As Object + curComp = oObj.getCurrentComponent() + bOK = Not isNull(curComp) + Test.MethodTested("getCurrentComponent()", bOK) + + Test.StartMethod("getCurrentFrame()") + bOK = true + Dim curFrame As Object + curFrame = oObj.getCurrentFrame() + bOK = Not isNull(curFrame) + Test.MethodTested("getCurrentFrame()", bOK) +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/frame/XDesktop/script.xlb b/qadevOOo/tests/basic/ifc/frame/XDesktop/script.xlb new file mode 100644 index 000000000000..8fc67d07830b --- /dev/null +++ b/qadevOOo/tests/basic/ifc/frame/XDesktop/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="frame_XDesktop" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="frame_XDesktop"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/frame/XDispatch/frame_XDispatch.xba b/qadevOOo/tests/basic/ifc/frame/XDispatch/frame_XDispatch.xba new file mode 100644 index 000000000000..d373311716b8 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/frame/XDispatch/frame_XDispatch.xba @@ -0,0 +1,120 @@ +<?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="frame_XDispatch" 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 + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' - Global dispatchURL As String + +'************************************************************************* + + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.frame.XDispatch +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim listener1 As Object, listener2 As Object + Dim URL As New com.sun.star.util.URL + + URL.Complete = dispatchURL + + Out.Log("Dispatch URL is '" + dispatchURL + "'") + if isNull(oObj) then Out.Log("Component is NULL !!!!") + + Test.StartMethod("addStatusListener()") + listener1 = createUnoListener("SL1_", "com.sun.star.frame.XStatusListener") + listener2 = createUnoListener("SL2_", "com.sun.star.frame.XStatusListener") + + if NOT(isNull(listener1) OR isNull(listener2)) then + Out.Log("Listeners were created") + else + Out.Log("Listeners were NOT created !!!") + EndIf + + oObj.addStatusListener(listener1, URL) + oObj.addStatusListener(listener2, URL) + Out.Log("Listeners were added") + + Test.StartMethod("removeStatusListener()") + oObj.removeStatusListener(listener1, URL) + + Test.StartMethod("dispatch()") + + SL1Called = false + SL2Called = false + + Out.Log("Dispatching ...") + oObj.dispatch(URL, DimArray()) + wait(500) + Out.Log("Dispatched.") + Test.MethodTested("dispatch()", true) + + bOK = SL2Called + Test.MethodTested("addStatusListener()", bOK) + bOK = bOK AND NOT SL1Called + Test.MethodTested("removeStatusListener()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub + +Dim SL1Called As Boolean +Dim SL2Called As Boolean + +Sub SL1_StatusChanged(ev As Variant) + SL1Called = true + Out.Log("SL1_StatusChanged() called.") +End Sub + +Sub SL2_StatusChanged(ev As Variant) + SL2Called = true + Out.Log("SL2_StatusChanged() called.") +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/frame/XDispatch/script.xlb b/qadevOOo/tests/basic/ifc/frame/XDispatch/script.xlb new file mode 100644 index 000000000000..ef87a042701b --- /dev/null +++ b/qadevOOo/tests/basic/ifc/frame/XDispatch/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="frame_XDispatch" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="frame_XDispatch"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/frame/XDispatchProvider/frame_XDispatchProvider.xba b/qadevOOo/tests/basic/ifc/frame/XDispatchProvider/frame_XDispatchProvider.xba new file mode 100644 index 000000000000..75cdafc27a6d --- /dev/null +++ b/qadevOOo/tests/basic/ifc/frame/XDispatchProvider/frame_XDispatchProvider.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="frame_XDispatchProvider" 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 + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' - Global dispatchUrl As String + +'************************************************************************* + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.frame.XDispatchProvider +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim url As new com.sun.star.util.URL + Dim dispatcher As Object + Dim descriptors(1) As new com.sun.star.frame.DispatchDescriptor + Dim dispatchers As Variant + + Out.Log("Using Url for dispatch : " + dispatchUrl) + + url.Complete = dispatchUrl + + Dim oURLTransformer As Object + oURLTransformer = createUnoService("com.sun.star.util.URLTransformer") + Dim aUrl As Variant + aUrl = Array(url) + oURLTransformer.parseStrict(aUrl) + + Test.StartMethod("queryDispatch()") + dispatcher = oObj.queryDispatch(aUrl(0), "frame", _ + com.sun.star.frame.FrameSearchFlag.ALL) + bOK = NOT isNull(dispatcher) + Out.Log("Dispatch is null : " + isNull(dispatcher)) + bOK = bOK AND hasUnoInterfaces(dispatcher, "com.sun.star.frame.XDispatch") + Test.MethodTested("queryDispatch()", bOK) + + Test.StartMethod("queryDispatches()") + bOK = true + descriptors(0).FeatureURL = url + descriptors(0).FrameName = "Frame1" + descriptors(0).SearchFlags = com.sun.star.frame.FrameSearchFlag.ALL + descriptors(1).FeatureURL = url + descriptors(1).FrameName = "Frame2" + descriptors(1).SearchFlags = com.sun.star.frame.FrameSearchFlag.ALL + dispatchers = oObj.queryDispatches(descriptors()) + if isArray(dispatchers) then + if ubound(descriptors()) <> ubound(dispatchers()) then + bOK = false + Out.Log("Number of returned dispatchers : " + _ + ubound(dispatchers()) + " - FAILED") + endIf + else + bOK = false + Out.Log("Returned value is not Array") + EndIf + + Test.MethodTested("queryDispatches()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/frame/XDispatchProvider/script.xlb b/qadevOOo/tests/basic/ifc/frame/XDispatchProvider/script.xlb new file mode 100644 index 000000000000..a9c846861c62 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/frame/XDispatchProvider/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="frame_XDispatchProvider" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="frame_XDispatchProvider"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/frame/XDispatchProviderInterception/frame_XDispatchProviderInterception.xba b/qadevOOo/tests/basic/ifc/frame/XDispatchProviderInterception/frame_XDispatchProviderInterception.xba new file mode 100644 index 000000000000..cd394226a759 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/frame/XDispatchProviderInterception/frame_XDispatchProviderInterception.xba @@ -0,0 +1,71 @@ +<?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="frame_XDispatchProviderInterception" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.frame.XDispatchProviderInterception +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim ceptor As Object + + + Test.StartMethod("registerDispatchProviderInterceptor()") + bOK = true + ceptor = createUnoService("basichelper.DispatchProviderInterceptor") + oObj.registerDispatchProviderInterceptor(ceptor) + bOK = bOK AND NOT isNull(ceptor.getMasterDispatchProvider()) + Test.MethodTested("registerDispatchProviderInterceptor()", bOK) + + Test.StartMethod("releaseDispatchProviderInterceptor()") + bOK = true + oObj.releaseDispatchProviderInterceptor(ceptor) + bOK = bOK AND isNull(ceptor.getMasterDispatchProvider()) + Test.MethodTested("releaseDispatchProviderInterceptor()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/frame/XDispatchProviderInterception/script.xlb b/qadevOOo/tests/basic/ifc/frame/XDispatchProviderInterception/script.xlb new file mode 100644 index 000000000000..7a88a6895533 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/frame/XDispatchProviderInterception/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="frame_XDispatchProviderInterception" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="frame_XDispatchProviderInterception"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/frame/XDispatchRecorder/frame_XDispatchRecorder.xba b/qadevOOo/tests/basic/ifc/frame/XDispatchRecorder/frame_XDispatchRecorder.xba new file mode 100644 index 000000000000..4839ec766dae --- /dev/null +++ b/qadevOOo/tests/basic/ifc/frame/XDispatchRecorder/frame_XDispatchRecorder.xba @@ -0,0 +1,154 @@ +<?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="frame_XDispatchRecorder" 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 + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' - Global dispRecFrame As Object + +'************************************************************************* + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.frame.XDispatchRecorder +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Test.StartMethod("startRecording()") + bOK = true + oObj.startRecording(dispRecFrame) + Test.MethodTested("startRecording()", bOK) + + Test.StartMethod("endRecording()") + bOK = true + Dim dispURL As com.sun.star.util.URL + dispURL = parseURL(".uno:InsertText") + Dim dispArgs(0) As new com.sun.star.beans.PropertyValue + dispArgs(0).Name = "Text" + dispArgs(0).Value = "XDispatchRecorder.endRecording()" + Out.log("Dispatching event for frame ...") + Dim disp As Object + disp = dispRecFrame.queryDispatch(dispURL, "", 0) + disp.dispatch(dispURL, dispArgs()) + wait(2000) + Out.log("Ending record ...") + oObj.endRecording() + Out.log("Getting macro ... :") + Dim macro As String + macro = oObj.getRecordedMacro() + Out.log("'" + macro + "'") + if (len(macro) <> 0) then + bOK = instr(macro, dispURL.Complete) > -1 and _ + instr(macro, dispArgs(0).Value) > -1 + if (Not bOK) then + Out.log("Dispatch URL '" + dispURL.Complete _ + + "' or its argument '" + dispArgs(0).Value _ + + "' was not found in macro returned - FAILED") + end if + else + bOK = false + end if + Test.MethodTested("endRecording()", bOK) + + Test.StartMethod("recordDispatch()") + bOK = true + Out.log("Recording dispatch ...") + oObj.recordDispatch(dispURL, dispArgs()) + Out.log("Getting macro ... :") + macro = oObj.getRecordedMacro() + Out.log("'" + macro + "'") + if (len(macro) <> 0) then + bOK = instr(macro, dispURL.Complete) > -1 and _ + instr(macro, dispArgs(0).Value) > -1 + if (Not bOK) then + Out.log("Dispatch URL '" + dispURL.Complete _ + + "' or its argument '" + dispArgs(0).Value _ + + "' was not found in macro returned - FAILED") + end if + else + bOK = false + end if + Test.MethodTested("recordDispatch()", bOK) + + Test.StartMethod("recordDispatchAsComment()") + bOK = true + Out.log("Recording dispatch ...") + oObj.recordDispatchAsComment(dispURL, dispArgs()) + Out.log("Getting macro ... :") + macro = oObj.getRecordedMacro() + Out.log("'" + macro + "'") + if (len(macro) <> 0) then + bOK = instr(macro, dispURL.Complete) > -1 and _ + instr(macro, dispArgs(0).Value) > -1 + if (Not bOK) then + Out.log("Dispatch URL '" + dispURL.Complete _ + + "' or its argument '" + dispArgs(0).Value _ + + "' was not found in macro returned - FAILED") + end if + else + bOK = false + end if + Test.MethodTested("recordDispatchAsComment()", bOK) + + Test.StartMethod("getRecordedMacro()") + bOK = true + Test.MethodTested("getRecordedMacro()", bOK) +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub + +Function parseURL(complURL As String) As com.sun.star.util.URL + Dim url As new com.sun.star.util.URL + url.Complete = complURL + Dim urlTrans As Object + urlTrans = createUnoService("com.sun.star.util.URLTransformer") + urlTrans.parseStrict(url) + parseURL = url +End Function +</script:module> diff --git a/qadevOOo/tests/basic/ifc/frame/XDispatchRecorder/script.xlb b/qadevOOo/tests/basic/ifc/frame/XDispatchRecorder/script.xlb new file mode 100644 index 000000000000..e88e65a85b50 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/frame/XDispatchRecorder/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="frame_XDispatchRecorder" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="frame_XDispatchRecorder"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/frame/XDispatchRecorderSupplier/frame_XDispatchRecorderSupplier.xba b/qadevOOo/tests/basic/ifc/frame/XDispatchRecorderSupplier/frame_XDispatchRecorderSupplier.xba new file mode 100644 index 000000000000..e41cd4b49018 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/frame/XDispatchRecorderSupplier/frame_XDispatchRecorderSupplier.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="frame_XDispatchRecorderSupplier" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.frame.XDispatchRecorderSupplier +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim oldRecorder As Object + + Test.StartMethod("getDispatchRecorder()") + oldRecorder = oObj.getDispatchRecorder() + + Test.StartMethod("setDispatchRecorder()") + Dim newRecorder As Object + newRecorder = createUnoService("com.sun.star.comp.framework.DispatchRecorder") + oObj.setDispatchRecorder(newRecorder) + + Test.StartMethod("dispatchAndRecord()") + bOK = true + oDoc = createDocument("swriter", cObjectName) + Dim desktop As Object + desktop = createUnoService("com.sun.star.frame.Desktop") + Dim curFrame As Object + curFrame = desktop.getCurrentFrame() + Dim dispURL As com.sun.star.util.URL + dispURL = parseURL(".uno:InsertText") + Dim disp As Object + disp = curFrame.queryDispatch(dispURL, "", 0) + Dim dispArgs(0) As new com.sun.star.beans.PropertyValue + dispArgs(0).Name = "Text" + dispArgs(0).Value = "XDispatchRecorderSupplier" + Out.log("Dispatching and recording ...") + oObj.dispatchAndRecord(dispURL, dispArgs(), disp) + + Dim macro As String + macro = newRecorder.getRecordedMacro() + Out.log("Recorder macro :" + chr(10) + macro) + if (len(macro) <> 0) then + bOK = instr(macro, dispURL.Complete) > -1 and _ + instr(macro, dispArgs(0).Value) > -1 + end if + Test.MethodTested("dispatchAndRecord()", bOK) + + bOK = true + if (isNull(oldRecorder)) then + bOK = true + else + Dim oldMacro As String + oldMacro = oldRecorder.getRecordedMacro() + Out.log("RecordedMacro of previous dispatch recorder: " + chr(10) + oldMacro) + bOK = oldMacro = macro + endif + Test.MethodTested("getDispatchRecorder()", bOK) + Test.MethodTested("setDispatchRecorder()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub + +Function parseURL(complURL As String) As com.sun.star.util.URL + Dim url As new com.sun.star.util.URL + url.Complete = complURL + Dim urlTrans As Object + urlTrans = createUnoService("com.sun.star.util.URLTransformer") + urlTrans.parseStrict(url) + parseURL = url +End Function +</script:module> diff --git a/qadevOOo/tests/basic/ifc/frame/XDispatchRecorderSupplier/script.xlb b/qadevOOo/tests/basic/ifc/frame/XDispatchRecorderSupplier/script.xlb new file mode 100644 index 000000000000..a50e5693014c --- /dev/null +++ b/qadevOOo/tests/basic/ifc/frame/XDispatchRecorderSupplier/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="frame_XDispatchRecorderSupplier" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="frame_XDispatchRecorderSupplier"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/frame/XDocumentTemplates/frame_XDocumentTemplates.xba b/qadevOOo/tests/basic/ifc/frame/XDocumentTemplates/frame_XDocumentTemplates.xba new file mode 100644 index 000000000000..639af5868d02 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/frame/XDocumentTemplates/frame_XDocumentTemplates.xba @@ -0,0 +1,191 @@ +<?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="frame_XDocumentTemplates" 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 + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' - Global oStore As Object + +'************************************************************************* + + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.frame.XDocumentTemplates +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim content As Object, groupContent As Object + Dim result as Object, statRes As Object + Dim res As Boolean + + Test.StartMethod("getContent()") + bOK = true + content = oObj.getContent() + Out.Log("Content list :") + Out.Log(getContentList(content)) + + bOK = bOK AND NOT isNull(content) + Test.MethodTested("getContent()", bOK) + + Test.StartMethod("addGroup()") + bOK = true + res = oObj.addGroup("XDocumentTemplatesTemp") + Out.Log("Method returned: " + res) + bOK = bOK AND res AND NOT isNull(getSubContent(content, "XDocumentTemplatesTemp")) + Test.MethodTested("addGroup()", bOK) + + Test.StartMethod("renameGroup()") + bOK = true + res = oObj.renameGroup("XDocumentTemplatesTemp", "XDocumentTemplates") + Out.Log("Method returned: " + res) + groupContent = getSubContent(content, "XDocumentTemplates") + bOK = bOK AND res AND isNull(getSubContent(content, "XDocumentTemplatesTemp")) _ + AND NOT isNull(groupContent) + Test.MethodTested("renameGroup()", bOK) + + Test.StartMethod("addTemplate()") + Dim testDoc As String + testDoc = utils.Path2URL(cTestDocsDir) + "report.stw" + Out.Log("Adding template from " + testDoc + + bOK = true + res = oObj.addTemplate("XDocumentTemplates", "ANewTemplateTemp", testDoc) + Out.Log("Method returned: " + res) + bOK = bOK AND res AND NOT isNull(getSubContent(groupContent, "ANewTemplateTemp")) + Test.MethodTested("addTemplate()", bOK) + + Test.StartMethod("renameTemplate()") + bOK = true + res = oObj.renameTemplate("XDocumentTemplates", "ANewTemplateTemp", "ANewTemplate") + Out.Log("Method returned: " + res) + bOK = bOK AND res AND isNull(getSubContent(groupContent, "ANewTemplateTemp")) _ + AND NOT isNull(getSubContent(groupContent, "ANewTemplate")) + Test.MethodTested("renameTemplate()", bOK) + + Test.StartMethod("storeTemplate()") + bOK = true + res = oObj.storeTemplate("XDocumentTemplates", "NewStoreTemplate", oStore) + Out.Log("Method returned: " + res) + bOK = bOK AND res AND NOT isNull(getSubContent(groupContent, "NewStoreTemplate")) + Test.MethodTested("storeTemplate()", bOK) + + Test.StartMethod("removeTemplate()") + bOK = true + res = oObj.removeTemplate("XDocumentTemplates", "ANewTemplate") + Out.Log("Method returned: " + res) + bOK = bOK AND res AND isNull(getSubContent(groupContent, "ANewTemplate") + Test.MethodTested("removeTemplate()", bOK) + + Test.StartMethod("removeGroup()") + bOK = true + res = oObj.removeGroup("XDocumentTemplates") + Out.Log("Method returned: " + res) + bOK = bOK AND res AND isNull(getSubContent(content, "XDocumentTemplatesTemp") + Test.MethodTested("removeGroup()", bOK) + + Test.StartMethod("update()") + bOK = true + oObj.update() + Test.MethodTested("update()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub + +Function getDynaResultSet(content As Object) As Object + Dim command as new com.sun.star.ucb.Command + Dim comArg as new com.sun.star.ucb.OpenCommandArgument2 + Dim comProps(0) as new com.sun.star.beans.Property + Dim result as Object, statRes As Object + + comArg.Mode = com.sun.star.ucb.OpenMode.ALL + comProps(0).Name = "Title" + comArg.Properties = comProps() + + command.Name = "open" + command.Handle = -1 + command.Argument = comArg + + getDynaResultSet = content.execute(command, 0, NULL_OBJECT) +End Function + +Function getStatResultSet(content As Object) As Object + getStatResultSet = getDynaResultSet(content).getStaticResultSet() +End Function + +Function getContentList(content As Object) As String + Dim statRes As Object + Dim ret As String + + statRes = getStatResultSet(content) + statRes.first() + ret = "" + while NOT statRes.isAfterLast() + ret = ret + " " + statRes.getString(1) + chr(13) + statRes.next() + wend + getContentList = ret +End Function + +Function getSubContent(content As Object, subName As String) As Object + Dim statRes As Object + Dim ret As Object + + statRes = getStatResultSet(content) + statRes.first() + while NOT statRes.isAfterLast() + if subName = statRes.getString(1) then + ret = statRes.queryContent() + endif + statRes.next() + wend + + getSubContent = ret +End Function +</script:module> diff --git a/qadevOOo/tests/basic/ifc/frame/XDocumentTemplates/script.xlb b/qadevOOo/tests/basic/ifc/frame/XDocumentTemplates/script.xlb new file mode 100644 index 000000000000..fde55a9f49ec --- /dev/null +++ b/qadevOOo/tests/basic/ifc/frame/XDocumentTemplates/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="frame_XDocumentTemplates" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="frame_XDocumentTemplates"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/frame/XFrame/frame_XFrame.xba b/qadevOOo/tests/basic/ifc/frame/XFrame/frame_XFrame.xba new file mode 100644 index 000000000000..2b6f01fccdef --- /dev/null +++ b/qadevOOo/tests/basic/ifc/frame/XFrame/frame_XFrame.xba @@ -0,0 +1,347 @@ +<?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="frame_XFrame" 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 + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' - Global XFrame As Object optional + +'************************************************************************* + + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.frame.XFrame +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Test.StartMethod("getName()") + bOK = true + Dim oldName As String + oldName = oObj.getName() + Out.log("getName(): " + oldName) + bOK = Not isNull(oldName) + Test.MethodTested("getName()", bOK) + + Test.StartMethod("setName()") + bOK = true + Dim sName As String, gName As String + sName = "XFrame" + oObj.setName(sName) + gName = oObj.getName() + bOK = gName = sName + Out.log("setName('" + sName + "'), getName() return '" + gName + "'") + oObj.setName(oldName) + Test.MethodTested("setName()", bOK) + + Test.StartMethod("activate()") + bOK = true + oObj.activate() + Test.MethodTested("activate()", bOK) + + Test.StartMethod("deactivate()") + bOK = true + oObj.deactivate() + Test.MethodTested("deactivate()", bOK) + + Test.StartMethod("isActive()") + bOK = true + if (instr(cObjectName,"Desktop") > -1) then + Out.log("Desktop is always active") + bOK = oObj.isActive() + else + oObj.activate() + bOK = oObj.isActive() + if (Not bOK) then + Out.log("after activate() method call, isActive() returned false") + end if + oObj.deactivate() + bOK = Not oObj.isActive() + if (oObj.isActive()) then + Out.log("after deactivate() method call, isActive() returned true") + end if + end if + Test.MethodTested("isActive()", bOK) + + Test.StartMethod("getCreator()") + bOK = true + Dim creator As Object + creator = oObj.getCreator() + if (instr(cObjectName,"Desktop") > -1) then + Out.log("Desktop has no creator") + else + bOK = Not isNull(creator) + end if + Test.MethodTested("getCreator()", bOK) + + Test.StartMethod("getComponentWindow()") + bOK = true + Dim compWin As Object + compWin = oObj.getComponentWindow() + if (instr(cObjectName,"Desktop") > -1) then + Out.log("Desktop has no component window") + else + bOK = Not isNull(compWin) + end if + Test.MethodTested("getComponentWindow()", bOK) + + Test.StartMethod("getContainerWindow()") + bOK = true + Dim contWin As Object + contWin = oObj.getContainerWindow() + if (instr(cObjectName,"Desktop") > -1) then + Out.log("Desktop has no container window") + else + bOK = Not isNull(contWin) + end if + Test.MethodTested("getContainerWindow()", bOK) + + Test.StartMethod("getController()") + bOK = true + Dim controller As Object + controller = oObj.getController() + if (instr(cObjectName,"Desktop") > -1) then + Out.log("Desktop has no controller") + else + if (isNull(controller)) then + Out.log("getController() returns null") + bOK = false + else + Dim frm As Object + frm = controller.getFrame() + if (frm.getName() <> oObj.getName()) then + Out.log("Frame returned by controller not " + _ + "equals to frame testing") + bOK = false + end if + end if + end if + Test.MethodTested("getController()", bOK) + + Test.StartMethod("isTop()") + bOK = true + Out.log("isTop() = " + oObj.isTop()) + Test.MethodTested("isTop()", bOK) + + Test.StartMethod("findFrame()") + bOK = true + if (Not isNull(XFrame)) then + Out.log("Trying to find a frame with name 'XFrame' ...") + Dim aFrame As Object + aFrame = oObj.findFrame("XFrame", com.sun.star.frame.FrameSearchFlag.GLOBAL) + if (isNull(aFrame)) then + Out.log("findFrame('XFrame',com.sun.star.frame.FrameSearchFlag.GLOBAL) returns null") + bOK = false + elseif (XFrame.getName() <> aFrame.getName()) then + Out.log("findFrame('XFrame',com.sun.star.frame.FrameSearchFlag.GLOBAL)" _ + + " returns frame which is not equal to passed in relation") + bOK = false + end if + end if + Out.log("Trying to find a frame with name '_self' ...") + Dim frame As Object + frame = oObj.findFrame("_self", com.sun.star.frame.FrameSearchFlag.AUTO) + if (isNull(frame)) then + Out.log("findFrame('_self') returns null") + bOK = false + elseif (frame.getName() <> oObj.getName()) then + Out.log("findFrame('_self') returns frame which is not equal to tested") + bOK = false + end if + Test.MethodTested("findFrame()", bOK) + + Test.StartMethod("setCreator()") + bOK = true + oObj.setCreator(NULL_OBJECT) + if (instr(cObjectName,"Desktop") > -1) then + Out.log("Desktop has no creator") + else + bOK = isNull(oObj.getCreator()) + oObj.setCreator(creator) + end if + Test.MethodTested("setCreator()", bOK) + + Test.StartMethod("setComponent()") + bOK = true + Dim res As Boolean + res = oObj.setComponent(NULL_OBJECT, NULL_OBJECT) + if (res) then + ' component must be changed + bOK = isNull(oObj.getComponentWindow()) + bOK = bOK and isNull(oObj.getController()) + if (Not bOK) then + Out.log("setComponent() returns true, but component is not changed.") + end if + else + Out.log("frame is not allowed to change component") + end if + oObj.setComponent(compWin, controller) + Test.MethodTested("setComponent()", bOK) + + Test.StartMethod("initialize()") + bOK = true + oObj.initialize(contWin) + Test.MethodTested("initialize()", bOK) + + Test.StartMethod("addFrameActionListener()") + bOK = true + Dim listener1 As Object, listener2 As Object + listener1 = createUnoListener("FA1_", "com.sun.star.frame.XFrameActionListener") + listener2 = createUnoListener("FA2_", "com.sun.star.frame.XFrameActionListener") + initListeners() + oObj.activate() + oObj.deactivate() + oObj.activate() + if (instr(cObjectName,"Desktop") > -1) then + Out.log("No actions supported by Desktop") + else + wait(1000) + if (Not listener1Called) then + bOK = false + Out.log("Listener1 wasn't called") + end if + if (Not listener2Called) then + bOK = false + Out.log("Listener2 wasn't called") + end if + if (Not activatedCalled1 or Not activatedCalled2) then + bOK = false + Out.log("Listener was called, FRAME_ACTIVATED was not") + endif + if (Not deactivatedCalled1 or Not deactivatedCalled2) then + bOK = false + Out.log("Listener was called, FRAME_DEACTIVATED was not") + endif + end if + Test.MethodTested("addFrameActionListener()", bOK) + + Test.StartMethod("removeFrameActionListener()") + bOK = true + Out.log("removes listener2") + oObj.removeFrameActionListener(listener2) + initListeners() + oObj.activate() + oObj.deactivate() + oObj.activate() + if (instr(cObjectName,"Desktop") > -1) then + Out.log("No actions supported by Desktop") + else + wait(1000) + if (Not listener1Called) then + bOK = false + Out.log("Listener1 wasn't called") + end if + if (listener2Called) then + bOK = false + Out.log("Listener2 was called, but it was removed") + end if + end if + Test.MethodTested("removeFrameActionListener()", bOK) + + Test.StartMethod("contextChanged()") + bOK = true + oObj.addFrameActionListener(listener1) + initListeners() + oObj.contextChanged() + if (instr(cObjectName,"Desktop") > -1) then + Out.log("Desktop cann't change context") + elseif(contextChanged1) then + bOK = true + elseif(listener1Called) then + bOK = false + Out.log("listener was called, but Action != CONTEXT_CHANGED") + else + bOK = false + Out.log("listener was not called on contextChanged() call") + end if + Test.MethodTested("contextChanged()", bOK) +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub + +Dim listener1Called As Boolean +Dim listener2Called As Boolean +Dim activatedCalled1 As Boolean +Dim deactivatedCalled1 As Boolean +Dim contextChanged1 As Boolean +Dim activatedCalled2 As Boolean +Dim deactivatedCalled2 As Boolean + +Sub initListeners() + listener1Called = false + listener2Called = false + contextChanged1 = false + activatedCalled1 = false + deactivatedCalled1 = false + activatedCalled2 = false + deactivatedCalled2 = false +End Sub + +Sub FA1_frameAction(event As Object) + listener1Called = true + Out.Log("Listener1: frameAction: " + event.Action) + if (event.Action = com.sun.star.frame.FrameAction.FRAME_ACTIVATED) then + activatedCalled1 = true + elseif (event.Action = com.sun.star.frame.FrameAction.FRAME_DEACTIVATING) then + deactivatedCalled1 = true + elseif (event.Action = com.sun.star.frame.FrameAction.CONTEXT_CHANGED) then + contextChanged1 = true + endif +End Sub + +Sub FA2_frameAction(event As Object) + listener2Called = true + Out.Log("Listener2: frameAction: " + event.Action) + if (event.Action = com.sun.star.frame.FrameAction.FRAME_ACTIVATED) then + activatedCalled2 = true + elseif (event.Action = com.sun.star.frame.FrameAction.FRAME_DEACTIVATING) then + deactivatedCalled2 = true + endif +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/frame/XFrame/script.xlb b/qadevOOo/tests/basic/ifc/frame/XFrame/script.xlb new file mode 100644 index 000000000000..6d254d7d6afd --- /dev/null +++ b/qadevOOo/tests/basic/ifc/frame/XFrame/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="frame_XFrame" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="frame_XFrame"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/frame/XFrameLoader/frame_XFrameLoader.xba b/qadevOOo/tests/basic/ifc/frame/XFrameLoader/frame_XFrameLoader.xba new file mode 100644 index 000000000000..713cbbf827dd --- /dev/null +++ b/qadevOOo/tests/basic/ifc/frame/XFrameLoader/frame_XFrameLoader.xba @@ -0,0 +1,127 @@ +<?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="frame_XFrameLoader" 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 + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' Global FrameLoaderURL As String +'Global FrameLoaderFrame As Object ' optional +'Global FrameLoaderArgs As Variant ' optional + +'************************************************************************* + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.form.XFrameLoader +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim frame As Object + Dim args As Variant + Dim listener As Object + + if IsNULL(FrameLoaderFrame) then + Out.log("Frame is NULL") + Dim oDsk As Object + oDsk = createUnoService("com.sun.star.frame.Desktop") + frame = oDsk.getCurrentFrame() + else + frame = FrameLoaderFrame + endif + + if IsArray(FrameLoaderArgs) then + Out.log("Args isn't array") + Dim emptyAr As Variant + args = emptyAr + else + args = FrameLoaderArgs + endif + + listener = createUnoListener("L_", "com.sun.star.frame.XLoadEventListener") + initListener() + + Test.StartMethod("cancel()") + + oObj.load(frame, FrameLoaderURL, args, listener) + oObj.cancel() + wait(200) + + bOK = loadCancelled OR loadFinished + + Test.MethodTested("cancel()", bOK) + + Test.StartMethod("load()") + + initListener() + oObj.load(frame, FrameLoaderURL, args, listener) + wait(200) + bOK = loadFinished AND Not loadCancelled + + Test.MethodTested("load()", bOK) +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub + +Sub initListener() + loadFinished = false + loadCancelled = false +End Sub + +Dim loadFinished As Boolean +Dim loadCancelled As Boolean + +Sub L_loadFinished() + Out.Log("Listener: loadFinished") + loadFinished = true +End Sub + +Sub L_loadCancelled() + Out.Log("Listener: loadCancelled") + loadCancelled = true +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/frame/XFrameLoader/script.xlb b/qadevOOo/tests/basic/ifc/frame/XFrameLoader/script.xlb new file mode 100644 index 000000000000..ec903f42eeed --- /dev/null +++ b/qadevOOo/tests/basic/ifc/frame/XFrameLoader/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="frame_XFrameLoader" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="frame_XFrameLoader"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/frame/XFramesSupplier/frame_XFramesSupplier.xba b/qadevOOo/tests/basic/ifc/frame/XFramesSupplier/frame_XFramesSupplier.xba new file mode 100644 index 000000000000..b3217b33fdd4 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/frame/XFramesSupplier/frame_XFramesSupplier.xba @@ -0,0 +1,129 @@ +<?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="frame_XFramesSupplier" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.frame.XFramesSupplier +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Test.StartMethod("getFrames()") + bOK = true + Dim frames As Object + frames = oObj.getFrames() + Dim cnt As Integer + if (Not isNull(frames) ) then + cnt = frames.getCount() + bOK = cnt <> 0 + Out.log("There are " + cnt + " frames.") + else + Out.log("getFrames() returned null !!!") + bOK = false + end if + Dim i As Integer + for i = 0 to (cnt - 1) + Dim fr As Object + fr = frames.getByIndex(i) + if (isNull(fr)) then + Out.log("Frame(" + i + ") == null") + bOK = false + end if + next i + Test.MethodTested("getFrames()", bOK) + + Test.StartMethod("getActiveFrame()") + bOK = true + Dim active As Object + active = oObj.getActiveFrame() + active.setName("ActiveFrame") + Dim hasActiveFrame As Boolean + Dim activeIndex As Integer + if (isNull(active)) then + bOK = false + Out.log("getActiveFrame() returned null") + else + hasActiveFrame = false + for i = 0 to (cnt - 1) + fr = frames.getByIndex(i) + if (fr.getName() = "ActiveFrame") then + hasActiveFrame = true + activeIndex = i + end if + next i + if (Not hasActiveFrame) then + Out.log("getActiveFrame() isn't contained in getFrames() collection") + bOK = false + end if + end if + Test.MethodTested("getActiveFrame()", bOK) + + Test.StartMethod("setActiveFrame()") + bOK = true + Dim sFrame As Object + if (cnt > 1) then + if (activeIndex <> 0) then + sFrame = frames.getByIndex(0) + else + sFrame = frame.getByIndex(1) + end if + else + sFrame = active + end if + sFrame.setName("Frame for set") + oObj.setActiveFrame(sFrame) + Dim gFrame As Object + gFrame = oObj.getActiveFrame() + if (gFrame.getName() <> "Frame for set") then + bOK = false + Out.log("Active frame set is not equal frame get: FAILED") + end if + Test.MethodTested("setActiveFrame()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/frame/XFramesSupplier/script.xlb b/qadevOOo/tests/basic/ifc/frame/XFramesSupplier/script.xlb new file mode 100644 index 000000000000..296097706b89 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/frame/XFramesSupplier/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="frame_XFramesSupplier" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="frame_XFramesSupplier"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/frame/XModel/frame_XModel.xba b/qadevOOo/tests/basic/ifc/frame/XModel/frame_XModel.xba new file mode 100644 index 000000000000..0c13d0c3d710 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/frame/XModel/frame_XModel.xba @@ -0,0 +1,145 @@ +<?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="frame_XModel" 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 + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' - Global oXModelController as Object +' - Global oXModelSel as Object +' - Global oXModelToSel as Object + +'************************************************************************* + + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.frame.XModel +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Dim oController As Object + Dim oSelection As Object + Dim aArgs(0 to 0) As Variant + Dim oCursor As Object + Dim cURL As String + Dim i As Integer + Dim args1(0) As New com.sun.star.beans.PropertyValue + + Test.StartMethod("attachResource()") + args1(0).Name = "XModel" + bOK = oObj.attachResource(".component:DB/DataSourceBrowser", args1()) + Test.MethodTested("attachResource()", bOK) + + Test.StartMethod("getURL()") + bOK = true + cURL = oObj.getURL() + bOK = bOK AND (cURL = ".component:DB/DataSourceBrowser") + Test.MethodTested("getURL()", bOK) + + Test.StartMethod("getArgs()") + bOK = true + aArgs() = oObj.Args + bOK = bOK AND NOT isNull(aArgs()) '(0).Name = "XModel" + Test.MethodTested("getArgs()", bOK) + + Test.StartMethod("getCurrentController()") + bOK = true + Dim oCurrCtrl As Object + oCurrCtrl = oObj.getCurrentController() + bOK = bOK AND isObject(oCurrCtrl) + bOK = bOK AND hasUnoInterfaces(oCurrCtrl, "com.sun.star.frame.XController") + Test.MethodTested("getCurrentController()", bOK) + + Test.StartMethod("getCurrentSelection()") + bOK = true + Dim oCurrSelection As Object + oXModelSel.select(oXModelToSel) + oCurrSelection = oObj.getCurrentSelection() + bOK = bOK AND hasUnoInterfaces(oCurrSelection, "com.sun.star.uno.XInterface") + Test.MethodTested("getCurrentSelection()", bOK) + + Test.StartMethod("hasControllersLocked()") + bOK = true + ' there should no controllers be locked + bOK = bOK AND NOT oObj.hasControllersLocked() + Test.MethodTested("hasControllersLocked()", bOK) + + ' now lock controllers + Test.StartMethod("lockControllers()") + bOK = true + oObj.lockControllers() + ' controllers should be locked + bOK = bOK AND oObj.hasControllersLocked() + Test.MethodTested("lockControllers()", bOK) + + ' unlock controllers and check success + Test.StartMethod("unlockControllers()") + bOK = true + oObj.unlockControllers() + bOK = bOK AND NOT oObj.hasControllersLocked() + Test.MethodTested("unlockControllers()", bOK) + + Test.StartMethod("connectController()") + oObj.connectController(oXModelController) + Test.MethodTested("connectController()", bOK) + + Test.StartMethod("disconnectController()") + oObj.disconnectController(oXModelController) + oObj.connectController(oCurrCtrl) + Test.MethodTested("disconnectController()", bOK) + + Test.StartMethod("setCurrentController()") + oObj.setCurrentController(oCurrCtrl) + Test.MethodTested("setCurrentController()", bOK) + + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/frame/XModel/script.xlb b/qadevOOo/tests/basic/ifc/frame/XModel/script.xlb new file mode 100644 index 000000000000..079f98424e95 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/frame/XModel/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="frame_XModel" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="frame_XModel"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/frame/XStorable/frame_XStorable.xba b/qadevOOo/tests/basic/ifc/frame/XStorable/frame_XStorable.xba new file mode 100644 index 000000000000..eb16431b0f7b --- /dev/null +++ b/qadevOOo/tests/basic/ifc/frame/XStorable/frame_XStorable.xba @@ -0,0 +1,116 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="frame_XStorable" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.frame.XStorable +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim cLocation, cLocation1 As String + Dim i As Integer + Dim oDoc1 As Object + + bOK = true + cLocation = utils.getTempFileURL(cObjectName & "." & "XStorable.tmp") + if (FileExists(cLocation)) then + Kill(cLocation) + end if + + if (FileExists(cLocation & ".bak")) then + Kill(cLocation & ".bak") + end if + + Out.Log("cLocation: "+cLocation) + + Test.StartMethod("storeAsURL()") + bOK = true + oObj.storeAsURL(cLocation, DimArray()) + bOK = bOK AND oObj.hasLocation() + Test.MethodTested("storeAsURL()", bOK) + + Test.StartMethod("hasLocation()") + bOK = true + bOK = bOK AND oObj.hasLocation() + Test.MethodTested("hasLocation()", bOK) + + Test.StartMethod("isReadonly()") + bOK = true + bOK = bOK AND NOT oObj.isReadOnly() + Test.MethodTested("isReadonly()", bOK) + + Test.StartMethod("getLocation()") + bOK = true + bOK = bOK AND (oObj.getLocation = cLocation) + Out.Log("Location is: " & oObj.getLocation & " It should be: " & cLocation) + Test.MethodTested("getLocation()", bOK) + + Test.StartMethod("storeToURL()") + bOK = true + cLocation1 = cLocation + ".bak" + Out.Log("New Location: " + cLocation1) + oDoc.getDocumentInfo().setPropertyValue("Title", "frame_XStorable") + oObj.storeToURL(cLocation1, DimArray()) + oDoc1 = StarDesktop.loadComponentFromUrl(cLocation1, "sc.ScModelObj.XStorable.tmp.bak", 40, DimArray() ) + bOK = bOK AND (oDoc1.getDocumentInfo().getPropertyValue("Title") = "frame_XStorable") + if bOK then Out.Log("Document titles are equal") + oDoc1.dispose() + Test.MethodTested("storeToURL()", bOK) + + Test.StartMethod("store()") + bOK = true + oObj.storeAsURL(cLocation1, DimArray()) + oDoc.getDocumentInfo().setPropertyValue("Title", "frame_XStorable12345") + oObj.store() + oDoc1 = StarDesktop.loadComponentFromUrl(cLocation1, "sc.ScModelObj.XStorable.tmp.bak", 40, DimArray() ) + bOK = bOK AND (oDoc1.getDocumentInfo().getPropertyValue("Title") = "frame_XStorable12345") + if bOK then Out.Log("Document titles are equal") + oDoc1.dispose() + Test.MethodTested("store()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/frame/XStorable/script.xlb b/qadevOOo/tests/basic/ifc/frame/XStorable/script.xlb new file mode 100644 index 000000000000..f52674f15c6a --- /dev/null +++ b/qadevOOo/tests/basic/ifc/frame/XStorable/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="frame_XStorable" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="frame_XStorable"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/frame/XSynchronousFrameLoader/frame_XSynchronousFrameLoader.xba b/qadevOOo/tests/basic/ifc/frame/XSynchronousFrameLoader/frame_XSynchronousFrameLoader.xba new file mode 100644 index 000000000000..918fafd7d6e9 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/frame/XSynchronousFrameLoader/frame_XSynchronousFrameLoader.xba @@ -0,0 +1,87 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="frame_XSynchronousFrameLoader" 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 + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' - Global oFrame As Object +' Global sURL As String + +'************************************************************************* + + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.frame.XSynchronousFrameLoader +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + Test.StartMethod("load()") + + Dim url As new com.sun.star.util.URL + url.Complete = sURL + Dim prop(0) As new com.sun.star.beans.PropertyValue + prop(0).Name = "URL" + prop(0).Value = url + + out.log("Load document with URL: " + sURL) + bOK = oObj.load(prop(), oFrame) + + Test.MethodTested("load()", bOK) + + Test.StartMethod("cancel()") + oObj.cancel() + bOK = True + Test.MethodTested("cancel()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/frame/XSynchronousFrameLoader/script.xlb b/qadevOOo/tests/basic/ifc/frame/XSynchronousFrameLoader/script.xlb new file mode 100644 index 000000000000..14ff69fcef13 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/frame/XSynchronousFrameLoader/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="frame_XSynchronousFrameLoader" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="frame_XSynchronousFrameLoader"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/i18n/XBreakIterator/i18n_XBreakIterator.xba b/qadevOOo/tests/basic/ifc/i18n/XBreakIterator/i18n_XBreakIterator.xba new file mode 100644 index 000000000000..caea03d8e837 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/i18n/XBreakIterator/i18n_XBreakIterator.xba @@ -0,0 +1,408 @@ +<?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="i18n_XBreakIterator" 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 + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' - Global oLocale As Object +' - Global UnicodeString As String +' - Global ScriptType(2, 1) As Integer + +'************************************************************************* + + + + + +const arrSize = 300 + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.i18n.XBreakIterator +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim i As Integer + Dim nCharacterIteratorMode As Integer + Dim lDone As Long + Dim lRes As Long + Dim wordType As Integer + Dim Boundary As Variant + Dim BoundsToTest(arrSize) As new com.sun.star.i18n.Boundary + Dim Types(arrSize) As Integer + Dim nBoundsToTest As Integer + Dim iPos As Integer + Dim iType As Integer + Dim bFound As Boolean + Dim j As Integer + Dim NextCharacters(2, 3) As Integer + Dim PreviousCharacters(2, 3) As Integer + + Test.StartMethod("nextCharacters()") + bOK = true + nCharacterIteratorMode = com.sun.star.i18n.CharacterIteratorMode.SKIPCHARACTER + + 'Start from position : Travel ... chars : Actual position after : How many chars traveled + NextCharacters(0, 0) = 1 : NextCharacters(0, 1) = 5000 : NextCharacters(0, 2) = len(UnicodeString) : NextCharacters(0, 3) = len(UnicodeString) - 1 + NextCharacters(1, 0) = 5 : NextCharacters(1, 1) = -5000 : NextCharacters(1, 2) = 0 : NextCharacters(1, 3) = -5 + NextCharacters(2, 0) = 10 : NextCharacters(2, 1) = 6 : NextCharacters(2, 2) = 16 : NextCharacters(2, 3) = 6 + + for i = 0 to 2 + lRes = oObj.nextCharacters(UnicodeString, NextCharacters(i, 0), _ + oLocale, nCharacterIteratorMode, NextCharacters(i, 1), lDone) + Out.Log("Expected result is: lRes = " + NextCharacters(i, 2) + _ + "; lDone = " + NextCharacters(i, 3)) + Out.Log("Actual result is: lRes = " + lRes + "; lDone = " + lDone) + + bOK = bOK AND lRes = NextCharacters(i, 2) + bOK = bOK AND lDone = NextCharacters(i, 3) + next i + + Test.MethodTested("nextCharacters()", bOK) + + Test.StartMethod("previousCharacters()") + bOK = true + nCharacterIteratorMode = com.sun.star.i18n.CharacterIteratorMode.SKIPCHARACTER + + 'Start from position : Travel ... chars : Actual position after : How many chars traveled + PreviousCharacters(0, 0) = 10 : PreviousCharacters(0, 1) = -5000 : PreviousCharacters(0, 2) = len(UnicodeString) : PreviousCharacters(0, 3) = len(UnicodeString) - 10 + PreviousCharacters(1, 0) = 5 : PreviousCharacters(1, 1) = 5000 : PreviousCharacters(1, 2) = 0 : PreviousCharacters(1, 3) = 5 + PreviousCharacters(2, 0) = 10 : PreviousCharacters(2, 1) = 6 : PreviousCharacters(2, 2) = 4 : PreviousCharacters(2, 3) = 6 + + for i = 0 to 2 + lRes = oObj.previousCharacters(UnicodeString, PreviousCharacters(i, 0), _ + oLocale, nCharacterIteratorMode, PreviousCharacters(i, 1), lDone) + Out.Log("Expected result is: lRes = " + PreviousCharacters(i, 2) + _ + "; lDone = " + PreviousCharacters(i, 3)) + Out.Log("Actual result is: lRes = " + lRes + "; lDone = " + lDone) + + bOK = bOK AND lRes = PreviousCharacters(i, 2) + bOK = bOK AND lDone = PreviousCharacters(i, 3) + next i + + Test.MethodTested("previousCharacters()", bOK) + + + Test.StartMethod("nextWord()") + Test.StartMethod("previousWord()") + bOK = true + wordType = com.sun.star.i18n.WordType.ANYWORD_IGNOREWHITESPACES + Dim wordCount1 As Integer + Dim wordCount2 As Integer + wordCount1 = 0 + wordCount2 = 0 + i = 0 + nBoundsToTest = 0 + + while i < len(UnicodeString) - 1 + Boundary = oObj.nextWord(UnicodeString, i, oLocale, wordType) + i = Boundary.endPos - 1 + wordCount1 = wordCount1 + 1 + if ((nBoundsToTest < arrSize) AND (Boundary.endPos - Boundary.startPos > 3)) then + BoundsToTest(nBoundsToTest).startPos = Boundary.startPos + BoundsToTest(nBoundsToTest).endPos = Boundary.endPos ' Here we find out some words and + nBoundsToTest = nBoundsToTest + 1 ' get their bounds to test in future + end if + Out.Log("Word " + wordCount1 + "(" + Boundary.startPos + "," + Boundary.endPos + "): '" + _ + mid(UnicodeString, Boundary.startPos + 1, Boundary.endPos - Boundary.startPos) + "'") + wend + Out.Log("In text there are " + wordCount1 + " words, if count from left to right") + + while i > 0 + Boundary = oObj.previousWord(UnicodeString, i, oLocale, wordType) + i = Boundary.startPos + wordCount2 = wordCount2 + 1 + Out.Log("Word " + wordCount2 + "(" + Boundary.startPos + "," + Boundary.endPos + "): '" + _ + mid(UnicodeString, Boundary.startPos + 1, Boundary.endPos - Boundary.startPos) + "'") + wend + Out.Log("In text there are " + wordCount2 + " words, if count from right to left") + + bOK = bOK AND wordCount1 = wordCount2 + Test.MethodTested("previousWord()", bOK) + Test.MethodTested("nextWord()", bOK) + + Test.StartMethod("getWordBoundary()") + bOK = true + if (nBoundsToTest = 0) then + Out.Log("Couldn't find words longer than 3 letters.") + bOK = false + end if + + for i = 0 to nBoundsToTest - 1 + iPos = (BoundsToTest(i).endPos - BoundsToTest(i).startPos) / 2 + BoundsToTest(i).startPos ' calculate middle of the word + Boundary = oObj.getWordBoundary(UnicodeString, iPos, oLocale, wordType, true) + Out.Log("Expected result is: startPos = " + BoundsToTest(i).startPos + _ + "; endPos = " + BoundsToTest(i).endPos) + Out.Log("Actual result is: startPos = " + Boundary.startPos + "; endPos = " + Boundary.endPos + _ + " Word is: '" + mid(UnicodeString, Boundary.startPos + 1, Boundary.endPos - Boundary.startPos) + "'") + + bOK = bOK AND BoundsToTest(i).startPos = Boundary.startPos + bOK = bOK AND BoundsToTest(i).endPos = Boundary.endPos + next i + + Test.MethodTested("getWordBoundary()", bOK) + + Test.StartMethod("getWordType()") + bOK = true + for i = 0 to nBoundsToTest - 1 + iPos = (BoundsToTest(i).endPos - BoundsToTest(i).startPos) / 2 + BoundsToTest(i).startPos ' calculate middle of the word + wordType = oObj.getWordType(UnicodeString, iPos, oLocale) + bOK = bOK AND wordType >= 0 AND wordType <= 2 + next i + Test.MethodTested("getWordType()", bOK) + + Test.StartMethod("isBeginWord()") + bOK = true + if (nBoundsToTest = 0) then + Out.Log("Couldn't find words longer than 3 letters.") + bOK = false + end if + + for i = 0 to nBoundsToTest - 1 + bOK = bOK AND oObj.isBeginWord(UnicodeString, BoundsToTest(i).startPos, oLocale, com.sun.star.i18n.WordType.ANY_WORD) + bOK = bOK AND NOT oObj.isBeginWord(UnicodeString, BoundsToTest(i).startPos + 1, oLocale, com.sun.star.i18n.WordType.ANY_WORD) + next i + Test.MethodTested("isBeginWord()", bOK) + + Test.StartMethod("isEndWord()") + bOK = true + if (nBoundsToTest = 0) then + Out.Log("Couldn't find words longer than 3 letters.") + bOK = false + end if + + for i = 0 to nBoundsToTest - 1 + bOK = bOK AND oObj.isEndWord(UnicodeString, BoundsToTest(i).endPos, oLocale, com.sun.star.i18n.WordType.ANY_WORD) + bOK = bOK AND NOT oObj.isEndWord(UnicodeString, BoundsToTest(i).endPos - 1, oLocale, com.sun.star.i18n.WordType.ANY_WORD) + next i + Test.MethodTested("isEndWord()", bOK) + + Test.StartMethod("beginOfSentence()") + Test.StartMethod("endOfSentence()") + Dim sStart As Integer + Dim sEnd As Integer + + bOK = true + iPos = 0 + while (iPos <= len(UnicodeString))' AND bOK) + sStart = oObj.beginOfSentence(UnicodeString, iPos, oLocale) + sEnd = oObj.endOfSentence(UnicodeString, iPos, oLocale) + if (iPos < sStart OR iPos > sEnd) then + bOK = false + Out.Log("From position " + iPos + " sentence range is [" + sStart + ", " + sEnd + "]") + Out.Log("'" + mid(UnicodeString, sStart + 1, sEnd - sStart) + "'") + end if + iPos = iPos + 1 + wend + + if (bOK) then + bOK = oObj.beginOfSentence(UnicodeString, -10, oLocale) = -1 + bOK = oObj.endOfSentence(UnicodeString, -10, oLocale) = -1 + bOK = oObj.beginOfSentence(UnicodeString, len(UnicodeString) + 1, oLocale) = -1 + bOK = oObj.endOfSentence(UnicodeString, len(UnicodeString) + 1, oLocale) = -1 + if (NOT bOK) then Out.Log("When invalid position, returned range is NOT [-1, -1]") + end if + + Test.MethodTested("beginOfSentence()", bOK) + Test.MethodTested("endOfSentence()", bOK) + + Test.StartMethod("getLineBreak()") + bOK = true + Dim LineBreakResults As Variant + Dim _LineBreakHyphenationOptions As new com.sun.star.i18n.LineBreakHyphenationOptions + Dim _LineBreakUserOptions As new com.sun.star.i18n.LineBreakUserOptions + Dim breakPos As Long, pos As Long + _LineBreakUserOptions.applyForbiddenRules = false + _LineBreakUserOptions.allowHyphenateEnglish = false + + breakPos = 0 : pos = 0 + + while breakPos = 0 AND pos < len(UnicodeString) + LineBreakResults = oObj.getLineBreak(UnicodeString, pos, oLocale, 0, _LineBreakHyphenationOptions, _LineBreakUserOptions) + breakPos = LineBreakResults.BreakIndex + pos = pos + 1 + wend + + ' finally the position of break must be found in the middle and + ' it must be before the break position specified + bOK = (breakPos <= pos AND breakPos > 0) + + if (NOT bOK) then + Out.Log("The last position was: " + pos + ", and the break position was: " + breakPos) + end if + + Test.MethodTested("getLineBreak()", bOK) + + + Test.StartMethod("beginOfScript()") + Test.StartMethod("endOfScript()") + bOK = true + Out.Log("Searching for scripts...") + iPos = 0 + nBoundsToTest = 0 + + while iPos < len(UnicodeString) AND iPos > -1 AND nBoundsToTest < arrSize + iType = oObj.getScriptType(UnicodeString, iPos) + BoundsToTest(nBoundsToTest).startPos = oObj.beginOfScript(UnicodeString, iPos, iType) + BoundsToTest(nBoundsToTest).endPos = oObj.endOfScript(UnicodeString, iPos, iType) + Types(nBoundsToTest) = iType + iPos = BoundsToTest(nBoundsToTest).endPos + Out.Log("Type: " + iType + "; Bounds: [" + BoundsToTest(nBoundsToTest).startPos + "," + BoundsToTest(nBoundsToTest).endPos + "]") + nBoundsToTest = nBoundsToTest + 1 + wend + bOK = bOK AND nBoundsToTest > 0 + + Test.MethodTested("beginOfScript()", bOK) + Test.MethodTested("endOfScript()", bOK) + + + Test.StartMethod("nextScript()") + bOK = true + i = 1 + iPos = -1 + while i < nBoundsToTest AND bOK + iPos = oObj.nextScript(UnicodeString, iPos, Types(i)) + Out.Log("Expected index for Type " + Types(i) + " for nextScript is " + BoundsToTest(i).startPos) + bOK = bOK AND iPos = BoundsToTest(i).startPos + Out.Log("NextScript returned " + iPos + ";") + i = i + 1 + wend + Test.MethodTested("nextScript()", bOK) + + Test.StartMethod("previousScript()") + bOK = true + i = nBoundsToTest - 2 + iPos = len(UnicodeString) + 1 + while i >= 0 AND bOK + iPos = oObj.previousScript(UnicodeString, iPos, Types(i)) + Out.Log("Expected index for Type " + Types(i) + " for previousScript is " + BoundsToTest(i).startPos) + bOK = bOK AND iPos = BoundsToTest(i).startPos + Out.Log("PreviousScript returned " + iPos + ";") + i = i - 1 + wend + Test.MethodTested("previousScript()", bOK) + + Test.StartMethod("getScriptType()") + bOK = true + for i = 0 to 2 + iPos = oObj.getScriptType(UnicodeString, ScriptType(i, 0)) + Out.Log("Expected result is: ScriptType = " + ScriptType(i, 1)) + Out.Log("Actual result is: ScriptType = " + iPos) + bOK = bOK AND iPos = ScriptType(i, 1) + next i + Test.MethodTested("getScriptType()", bOK) + + Test.StartMethod("beginOfCharBlock()") + Test.StartMethod("endOfCharBlock()") + bOK = true + Out.Log("getting CharBlocks bounds...") + iPos = 0 + nBoundsToTest = 0 + + while iPos < len(UnicodeString) AND iPos > -1 AND nBoundsToTest < arrSize + iType = getCharBlockType(iPos) + BoundsToTest(nBoundsToTest).startPos = oObj.beginOfCharBlock(UnicodeString, iPos, oLocale, iType) + BoundsToTest(nBoundsToTest).endPos = oObj.endOfCharBlock(UnicodeString, iPos, oLocale, iType) + iPos = BoundsToTest(nBoundsToTest).endPos + Out.Log("" + nBoundsToTest + "). Bounds: [" + BoundsToTest(nBoundsToTest).startPos + "," + BoundsToTest(nBoundsToTest).endPos + "]; Type = " + iType) + Types(nBoundsToTest) = iType + nBoundsToTest = nBoundsToTest + 1 + wend + + for i = 0 to nBoundsToTest - 2 + bOK = bOK AND BoundsToTest(i).endPos = BoundsToTest(i + 1).startPos + next + Out.Log("Testing for no intersections : " + bOK) + bOK = bOK AND BoundsToTest(0).startPos = 0 + bOK = bOK AND BoundsToTest(nBoundsToTest - 1).endPos = len(UnicodeString) + Out.Log("Regions should starts with 0 and ends with " + len(UnicodeString)) + + Test.MethodTested("beginOfCharBlock()", bOK) + Test.MethodTested("endOfCharBlock()", bOK) + + Test.StartMethod("nextCharBlock()") + bOK = true + for i = 0 to nBoundsToTest - 1 + iPos = oObj.nextCharBlock(UnicodeString, BoundsToTest(i).startPos - 1, oLocale, Types(i)) + if (iPos <> BoundsToTest(i).startPos) then + bOK = false + Out.Log("nextCharBlock(UnicodeString, " + BoundsToTest(i).startPos - 1 + ", oLocale, " + Types(i) + ") should return " + BoundsToTest(i).startPos) + Out.Log("... and actual value is " + iPos) + end if + next i + Test.MethodTested("nextCharBlock()", bOK) + + Test.StartMethod("previousCharBlock()") + bOK = true + for i = 0 to nBoundsToTest - 1 + iPos = oObj.previousCharBlock(UnicodeString, BoundsToTest(i).endPos + 1, oLocale, Types(i)) + if (iPos <> BoundsToTest(i).startPos) then + bOK = false + Out.Log("previousCharBlock(UnicodeString, " + BoundsToTest(i).startPos - 1 +", oLocale, " + Types(i) + ") should return " + BoundsToTest(i).startPos) + Out.Log("... and actual value is " + iPos) + end if + next i + Test.MethodTested("previousCharBlock()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +Function getCharBlockType(pos As Integer) As Integer + Dim i As Integer + Dim cType As Integer + + cType = 0 + i = 1 + while (i < 31) + if (oObj.beginOfCharBlock(UnicodeString, pos, oLocale, i) <> -1) then + cType = i + i = 100 + end if + i = i + 1 + wend + + getCharBlockType = cType +End Function +</script:module> diff --git a/qadevOOo/tests/basic/ifc/i18n/XBreakIterator/script.xlb b/qadevOOo/tests/basic/ifc/i18n/XBreakIterator/script.xlb new file mode 100644 index 000000000000..245750532c7b --- /dev/null +++ b/qadevOOo/tests/basic/ifc/i18n/XBreakIterator/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="i18n_XBreakIterator" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="i18n_XBreakIterator"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/i18n/XCalendar/i18n_XCalendar.xba b/qadevOOo/tests/basic/ifc/i18n/XCalendar/i18n_XCalendar.xba new file mode 100644 index 000000000000..c3d7befd4987 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/i18n/XCalendar/i18n_XCalendar.xba @@ -0,0 +1,306 @@ +<?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="i18n_XCalendar" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.i18n.XCalendar +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim oLocaleData As Object + Dim oLocale As Object + Dim allLocales As Variant + Dim allCalendars As Variant + Dim uniqueID As String + Dim oCalendar As Object + Dim dDateTime As Double + Dim aValue As Variant + Dim oldValue As Variant + Dim newValue As Variant + Dim i As Integer + + oLocaleData = createUnoService("com.sun.star.i18n.LocaleData") + allLocales = oLocaleData.getAllInstalledLocaleNames() + Out.Log("Found " + ubound(allLocales) + " Loacales registered in the system") + Randomize + oLocale = allLocales(rnd * ubound(allLocales)) + Out.Log("Choose for testing : " + oLocale.Country) + + Test.StartMethod("getAllCalendars()") + bOK = true + allCalendars = oObj.getAllCalendars(oLocale) + Out.Log("There are " + ubound(allCalendars) + 1 + " calendars for this locale.") + bOK = bOK AND NOT isNULL(allCalendars) + Test.MethodTested("getAllCalendars()", bOK) + + Test.StartMethod("loadDefaultCalendar()") + bOK = true + oObj.loadDefaultCalendar(oLocale) + bOK = bOK AND oObj.getLoadedCalendar().Default + Test.MethodTested("loadDefaultCalendar()", bOK) + + Test.StartMethod("getUniqueID()") + bOK = true + uniqueID = oObj.getUniqueID() + Out.Log("UniqueID for loaded calendar is " + uniqueID) + bOK = bOK AND (uniqueID = allCalendars(0)) + Test.MethodTested("getUniqueID()", bOK) + + Test.StartMethod("loadCalendar()") + bOK = true + oObj.loadCalendar(allCalendars(0), oLocale) + bOK = bOK AND NOT isNULL(oObj.getLoadedCalendar()) + Test.MethodTested("loadCalendar()", bOK) + + Test.StartMethod("getLoadedCalendar()") + bOK = true + oCalendar = oObj.getLoadedCalendar() + Out.Log("Loaded calendar's name is '" + oCalendar.Name + "'") + bOK = bOK AND NOT isNULL(oCalendar) + Test.MethodTested("getLoadedCalendar()", bOK) + + Test.StartMethod("setDateTime()") + Test.StartMethod("getDateTime()") + bOK = true + oObj.setDateTime(12345.25) + dDateTime = oObj.getDateTime() + bOK = bOK AND dDateTime = 12345.25 + Out.Log("Expected: 12345,25; Actual: " + dDateTime) + Test.MethodTested("setDateTime()", bOK) + Test.MethodTested("getDateTime()", bOK) + + Test.StartMethod("getFirstDayOfWeek()") + Test.StartMethod("setFirstDayOfWeek()") + bOK = true + oObj.setFirstDayOfWeek(com.sun.star.i18n.Weekdays.SATURDAY) + Out.Log("Expected: " + com.sun.star.i18n.Weekdays.SATURDAY + ", Actual: " + oObj.getFirstDayOfWeek()) + bOK = bOK AND oObj.getFirstDayOfWeek() = com.sun.star.i18n.Weekdays.SATURDAY + oObj.setFirstDayOfWeek(com.sun.star.i18n.Weekdays.SUNDAY) + Out.Log("Expected: " + com.sun.star.i18n.Weekdays.SUNDAY + ", Actual: " + oObj.getFirstDayOfWeek()) + bOK = bOK AND oObj.getFirstDayOfWeek() = com.sun.star.i18n.Weekdays.SUNDAY + + Test.MethodTested("getFirstDayOfWeek()", bOK) + Test.MethodTested("setFirstDayOfWeek()", bOK) + + Test.StartMethod("setValue()") + Test.StartMethod("getValue()") + bOK = true + bOK = bOK AND TestValue(1, com.sun.star.i18n.Months.JANUARY, 2001, com.sun.star.i18n.WeekDays.MONDAY, 1, 1) + '1.01.2001 - Monday, 1-st week of month, 1-st week of year + bOK = bOK AND TestValue(12, com.sun.star.i18n.Months.JULY, 2001, com.sun.star.i18n.WeekDays.THURSDAY, 2, 28) + '12.07.2001 - Thursday, 2-nd week of month, 28-st week of year + + Test.MethodTested("setValue()", bOK) + Test.MethodTested("getValue()", bOK) + + Test.StartMethod("addValue()") + bOK = true + + bOK = bOK AND TestAddValue("DST_OFFSET", com.sun.star.i18n.CalendarFieldIndex.DST_OFFSET, 1, 0) + bOK = bOK AND TestAddValue("DAY_OF_MONTH", com.sun.star.i18n.CalendarFieldIndex.DAY_OF_MONTH, 1, 0) + bOK = bOK AND TestAddValue("MONTH", com.sun.star.i18n.CalendarFieldIndex.MONTH, 3, 12) + bOK = bOK AND TestAddValue("YEAR", com.sun.star.i18n.CalendarFieldIndex.YEAR, -1, 0) + bOK = bOK AND TestAddValue("HOUR", com.sun.star.i18n.CalendarFieldIndex.HOUR, 7, 24) + bOK = bOK AND TestAddValue("MINUTE", com.sun.star.i18n.CalendarFieldIndex.MINUTE, 31, 60) + bOK = bOK AND TestAddValue("SECOND", com.sun.star.i18n.CalendarFieldIndex.SECOND, 13, 60) + bOK = bOK AND TestAddValue("MILLISECOND", com.sun.star.i18n.CalendarFieldIndex.MILLISECOND, 67, 1000) + bOK = bOK AND TestAddValue("ERA", com.sun.star.i18n.CalendarFieldIndex.ERA, -1, 0) + + Test.MethodTested("addValue()", bOK) + + Test.StartMethod("getNumberOfMonthsInYear()") + bOK = true + aValue = oObj.getNumberOfMonthsInYear() + Out.Log("There are " + aValue + " months in year") + bOK = bOK AND aValue = 12 + Test.MethodTested("getNumberOfMonthsInYear()", bOK) + + Test.StartMethod("getNumberOfDaysInWeek()") + bOK = true + aValue = oObj.getNumberOfDaysInWeek() + Out.Log("There are " + aValue + " days in week") + bOK = bOK AND aValue = 7 + Test.MethodTested("getNumberOfDaysInWeek()", bOK) + + Test.StartMethod("getMinimumNumberOfDaysForFirstWeek()") + bOK = true + aValue = oObj.getMinimumNumberOfDaysForFirstWeek() + Out.Log("MinimumNumberOfDaysForFirstWeek = " + aValue) + bOK = bOK AND aValue > 0 AND aValue < 8 + Test.MethodTested("getMinimumNumberOfDaysForFirstWeek()", bOK) + + Test.StartMethod("setMinimumNumberOfDaysForFirstWeek()") + bOK = true + oObj.setMinimumNumberOfDaysForFirstWeek(211) + aValue = oObj.getMinimumNumberOfDaysForFirstWeek() + Out.Log("MinimumNumberOfDaysForFirstWeek = " + aValue) + bOK = bOK AND aValue > 0 AND aValue < 8 + Test.MethodTested("setMinimumNumberOfDaysForFirstWeek()", bOK) + + Test.StartMethod("getMonths()") + bOK = true + Dim allMonths As Variant + Dim cAllMonths As String + allMonths = oObj.getMonths() + Out.Log("Returned " + ubound(allMonths) + 1 + " months.") + bOK = bOK AND ubound(allMonths) + 1= oObj.getNumberOfMonthsInYear() + if (bOK) then + cAllMonths = "" + for i = 0 to ubound(allMonths) + cAllMonths = cAllMonths + allMonths(i).FullName + ", " + next i + Out.Log("Months: " + cAllMonths) + end if + + Test.MethodTested("getMonths()", bOK) + + Test.StartMethod("getDays()") + bOK = true + Dim allDays As Variant + Dim cAllDays As String + allDays = oObj.getDays() + Out.Log("Returned " + ubound(allMonths) + 1 + " days.") + bOK = bOK AND ubound(allDays) + 1= oObj.getNumberOfDaysInWeek() + if (bOK) then + cAllDays = "" + for i = 0 to ubound(allDays) + cAllDays = cAllDays + allDays(i).FullName + ", " + next i + Out.Log("Days: " + cAllDays) + end if + Test.MethodTested("getDays()", bOK) + + Test.StartMethod("getDisplayName()") + bOK = true + Dim cDisplayName As String + cDisplayName = oObj.getDisplayName(com.sun.star.i18n.CalendarDisplayIndex.MONTH, com.sun.star.i18n.Months.JANUARY, 1) + Out.Log("Full name for JANUARY is: " + cDisplayName) + bOK = bOK AND cDisplayName <> "" + Test.MethodTested("getDisplayName()", bOK) + + Test.StartMethod("isValid()") + bOK = true + + oObj.setValue(com.sun.star.i18n.CalendarFieldIndex.DAY_OF_MONTH, 30) + oObj.setValue(com.sun.star.i18n.CalendarFieldIndex.MONTH, com.sun.star.i18n.Months.FEBURARY) + oObj.setValue(com.sun.star.i18n.CalendarFieldIndex.YEAR, 2001) + Out.Log("isValid() = " + oObj.isValid()) + bOK = bOK AND NOT oObj.isValid() + + oObj.setValue(com.sun.star.i18n.CalendarFieldIndex.DAY_OF_MONTH, 27) + oObj.setValue(com.sun.star.i18n.CalendarFieldIndex.MONTH, com.sun.star.i18n.Months.FEBURARY) + oObj.setValue(com.sun.star.i18n.CalendarFieldIndex.YEAR, 2001) + Out.Log("isValid() = " + oObj.isValid()) + bOK = bOK AND oObj.isValid() + + Test.MethodTested("isValid()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub + +Function TestValue(_Day As Integer, _Month As Integer, _Year As Integer, _ + _Day_of_week As Integer, _Week_of_month As Integer, _Week_of_year As Integer) As Boolean + + Dim bOK As Boolean + Dim aDay As Integer, aMonth As Integer, aYear As Integer + Dim aDay_of_week As Integer, aWeek_of_Month As Integer, aWeek_of_year As Integer + + bOK = true + + Out.Log("Set date to " + _Day + "." + _Month + "." + _Year + ";") + + oObj.setValue(com.sun.star.i18n.CalendarFieldIndex.DAY_OF_MONTH, _Day) + oObj.setValue(com.sun.star.i18n.CalendarFieldIndex.MONTH, _Month) + oObj.setValue(com.sun.star.i18n.CalendarFieldIndex.YEAR, _Year) + + aDay = oObj.getValue(com.sun.star.i18n.CalendarFieldIndex.DAY_OF_MONTH) + aMonth = oObj.getValue(com.sun.star.i18n.CalendarFieldIndex.MONTH) + aYear = oObj.getValue(com.sun.star.i18n.CalendarFieldIndex.YEAR) + + Out.Log("Now date is " + aDay + "." + aMonth + "." + aYear + ";") + + bOK = (aDay = _Day) AND (aMonth = _Month) AND (aYear = _Year) + + if (bOK) then + aDay_of_week = oObj.getValue(com.sun.star.i18n.CalendarFieldIndex.DAY_OF_WEEK) + aWeek_of_month = oObj.getValue(com.sun.star.i18n.CalendarFieldIndex.WEEK_OF_MONTH) + aWeek_of_year = oObj.getValue(com.sun.star.i18n.CalendarFieldIndex.WEEK_OF_YEAR) + Out.Log("aDay_of_week: Expected: " + _Day_of_week + ", Actual: " + aDay_of_week) + Out.Log("aWeek_of_month: Expected: " + _Week_of_month + ", Actual: " + aWeek_of_month) + Out.Log("aWeek_of_year: Expected: " + _Week_of_year + ", Actual: " + aWeek_of_year) + bOK = (aDay_of_week = _Day_of_week) AND (aWeek_of_month = _Week_of_month) AND (aWeek_of_year = _Week_of_year) + end if + + TestValue() = bOK + +Exit Function +ErrHndl: + Test.Exception() + TestValue() = false +End Function + +Function TestAddValue(valname As String, Idx As Integer, incValue As Integer, valModule As Integer) As Boolean + Dim aValue As Integer + Dim newValue As Integer + Dim bOK As Boolean + + aValue = oObj.getValue(idx) + oObj.addValue(idx, incValue) + newValue = oObj.getValue(idx) + if (valModule = 0) then + bOK = (newValue = (aValue + incValue)) + Out.Log(valname + ": Expected: " + (aValue + incValue) + ", Actual: " + newValue) + else + bOK = (newValue = (aValue + incValue) mod valModule) + Out.Log(valname + ": Expected: " + (aValue + incValue) mod valModule + ", Actual: " + newValue) + end if + TestAddValue() = bOK +Exit Function +ErrHndl: + Test.Exception() + TestAddValue() = false +End Function +</script:module> diff --git a/qadevOOo/tests/basic/ifc/i18n/XCalendar/script.xlb b/qadevOOo/tests/basic/ifc/i18n/XCalendar/script.xlb new file mode 100644 index 000000000000..2eedd64721be --- /dev/null +++ b/qadevOOo/tests/basic/ifc/i18n/XCalendar/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="i18n_XCalendar" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="i18n_XCalendar"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/i18n/XCharacterClassification/i18n_XCharacterClassification.xba b/qadevOOo/tests/basic/ifc/i18n/XCharacterClassification/i18n_XCharacterClassification.xba new file mode 100644 index 000000000000..d31b612cab49 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/i18n/XCharacterClassification/i18n_XCharacterClassification.xba @@ -0,0 +1,223 @@ +<?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="i18n_XCharacterClassification" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.i18n.XCharacterClassification +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim sType As Variant + Dim cString1 As String, cString2 As String + Dim cRes As Variant, sDir As Variant + + Const cString = "TestString1" + + Dim Locale As New com.sun.star.lang.Locale + + Locale.Language = "DE" + Locale.Country = "GERMANY" + Locale.Variant = "" + + Test.StartMethod("toUpper()") + bOK = true + cRes = oObj.toUpper(cString, 2, 3, Locale) + bOK = bOK AND Comp(cRes, "STS") + Test.MethodTested("toUpper()", bOK) + + Test.StartMethod("toLower()") + bOK = true + cRes = oObj.toLower(cString, 2, 3, Locale) + bOK = bOK AND Comp(cRes, "sts") + Test.MethodTested("toLower()", bOK) + + Test.StartMethod("toTitle()") + bOK = true + cRes = oObj.toTitle(cString, 2, 3, Locale) + bOK = bOK AND Comp(cRes, "STS") + Test.MethodTested("toTitle()", bOK) + + Test.StartMethod("getType()") + bOK = true + bOK = bOK AND oObj.getType(cString, 0) <> oObj.getType(cString, 2) + Test.MethodTested("getType()", bOK) + + Test.StartMethod("getCharacterDirection()") + bOK = true + sDir = oObj.getCharacterDirection(cString, 1) + bOK = bOK AND isNumeric(sDir) + Test.MethodTested("getCharacterDirection()", bOK) + + Test.StartMethod("getScript()") + bOK = true + bOK = bOK AND isNUmeric(oObj.getScript(cString, 0)) + Test.MethodTested("getScript()", bOK) + + Test.StartMethod("getCharacterType()") + bOK = true + sType = oObj.getCharacterType(cString, 0, Locale) + bOK = bOK AND (sType AND com.sun.star.i18n.KCharacterType.UPPER) + bOK = bOK AND NOT (sType AND com.sun.star.i18n.KCharacterType.DIGIT) + bOK = bOK AND (sType AND com.sun.star.i18n.KCharacterType.BASE_FORM) + sType = oObj.getCharacterType(cString, 1, Locale) + bOK = bOK AND (sType AND com.sun.star.i18n.KCharacterType.LOWER) + bOK = bOK AND NOT (sType AND com.sun.star.i18n.KCharacterType.DIGIT) + bOK = bOK AND (sType AND com.sun.star.i18n.KCharacterType.BASE_FORM) + sType = oObj.getCharacterType(cString, 10, Locale) + bOK = bOK AND NOT (sType AND com.sun.star.i18n.KCharacterType.UPPER) + bOK = bOK AND (sType AND com.sun.star.i18n.KCharacterType.DIGIT) + bOK = bOK AND (sType AND com.sun.star.i18n.KCharacterType.BASE_FORM) + Test.MethodTested("getCharacterType()", bOK) + + Test.StartMethod("getStringType()") + bOK = true + sType = oObj.getStringType(cString, 0, 10, Locale) + bOK = bOK AND (sType AND com.sun.star.i18n.KCharacterType.UPPER) + bOK = bOK AND (sType AND com.sun.star.i18n.KCharacterType.LOWER) + bOK = bOK AND (sType AND com.sun.star.i18n.KCharacterType.BASE_FORM) + bOK = bOK AND NOT (sType AND com.sun.star.i18n.KCharacterType.DIGIT) + sType = oObj.getStringType(cString, 0, 11, Locale) + bOK = bOK AND (sType AND com.sun.star.i18n.KCharacterType.UPPER) + bOK = bOK AND (sType AND com.sun.star.i18n.KCharacterType.LOWER) + bOK = bOK AND (sType AND com.sun.star.i18n.KCharacterType.BASE_FORM) + bOK = bOK AND (sType AND com.sun.star.i18n.KCharacterType.DIGIT) + Test.MethodTested("getStringType()", bOK) + + Test.StartMethod("parseAnyToken()") + bOK = true + + cString1 = "int _ind1 = 1234;" + Out.Log ("Parsing string: " + cString1) + Dim tTypes(10) As Integer + Dim tVals(10) As String + Dim nStartChartFlags As Variant, userDefinedCharactersStart As Variant + Dim nContCharFlags As Variant, userDefinedCharactersCont As Variant, nTokenType As Variant + + with com.sun.star.i18n.KParseType + tTypes(0) = .IDENTNAME: tVals(0) = "int" + tTypes(1) = .IDENTNAME: tVals(1) = "_ind1" + tTypes(2) = .ONE_SINGLE_CHAR: tVals(2) = "=" + tTypes(3) = .ANY_NUMBER: tVals(3) = "1234" + end with + + with com.sun.star.i18n.KParseTokens + nStartChartFlags = .ANY_ALPHA OR .IGNORE_LEADING_WS + userDefinedCharactersStart = "_" + nContCharFlags = nStartChartFlags OR .ANY_ALNUM + userDefinedCharactersCont = "" + end with + + Dim nStart As Integer, idx As Integer, nPos As Integer + Dim pRes As Variant + Dim cActStr As String + + nStart = 1 + idx = 0 + + while nStart < Len(cString1) + pRes = oObj.parseAnyToken(cString1, nStart - 1, Locale, nStartChartFlags, userDefinedCharactersStart, _ + nContCharFlags, userDefinedCharactersCont) + + Out.Log("Type is " + pRes.TokenType) + if (pRes.TokenType = 0) then + nStart = nStart + 1 + else + Out.Log("Type is as expexted - " + ((pRes.TokenType AND tTypes(idx)) > 0)) + bOK = bOK AND (pRes.TokenType AND tTypes(idx)) + cActStr = mid(cString1, (nStart + pRes.LeadingWhiteSpace), pRes.EndPos - (nStart + pRes.LeadingWhiteSpace) + 1) + Out.Log("Expected: '" + tVals(idx) + "'; actual is: '" + cActStr + "'") + bOK = bOK AND (cActStr = tVals(idx)) + nStart = pRes.EndPos + 1 + end if + idx = idx + 1 + wend + Test.MethodTested("parseAnyToken()", bOK) + + Test.StartMethod("parsePredefinedToken()") + bOK = true + + cString2 = "1a, _a1$5" + with com.sun.star.i18n.KParseType + nTokenType = .IDENTNAME + end with + with com.sun.star.i18n.KParseTokens + nStartChartFlags = .ANY_ALPHA OR .IGNORE_LEADING_WS + userDefinedCharactersStart = "_" + nContCharFlags = nStartChartFlags OR .ANY_ALNUM + userDefinedCharactersCont = "" + end with + + tVals(0) = "a" + tVals(1) = "_a1" + + nPos = 1 + idx = 0 + while nPos < Len(cString2) + pRes = oObj.parsePredefinedToken(nTokenType, cString2, nPos - 1, Locale, nStartChartFlags, userDefinedCharactersStart, _ + nContCharFlags, userDefinedCharactersCont) + + Out.Log("Type is " + pRes.TokenType) + if (pRes.TokenType = 0) then + nPos = nPos + 1 + else + bOK = bOK AND (pRes.TokenType AND tTypes(idx)) + cActStr = mid(cString2, (nPos + pRes.LeadingWhiteSpace), pRes.EndPos - (nPos + pRes.LeadingWhiteSpace) + 1) + bOK = bOK AND Comp(cActStr, tVals(idx)) + nPos = pRes.EndPos + 1 + idx = idx + 1 + end if + wend + + bOK = bOK AND true + Test.MethodTested("parsePredefinedToken()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +Function Comp(cS1 As String, cS2 As String) As Boolean + Out.Log("Expected : '" + cS2 + "', actual : '" + cS1 + "'") + Comp = cS1 = cS2 +End Function +</script:module> diff --git a/qadevOOo/tests/basic/ifc/i18n/XCharacterClassification/script.xlb b/qadevOOo/tests/basic/ifc/i18n/XCharacterClassification/script.xlb new file mode 100644 index 000000000000..730b504c245b --- /dev/null +++ b/qadevOOo/tests/basic/ifc/i18n/XCharacterClassification/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="i18n_XCharacterClassification" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="i18n_XCharacterClassification"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/i18n/XCollator/i18n_XCollator.xba b/qadevOOo/tests/basic/ifc/i18n/XCollator/i18n_XCollator.xba new file mode 100644 index 000000000000..4a4f7cc02bac --- /dev/null +++ b/qadevOOo/tests/basic/ifc/i18n/XCollator/i18n_XCollator.xba @@ -0,0 +1,133 @@ +<?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="i18n_XCollator" 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 + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' - Global oLocal As Object + +'************************************************************************* + + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.i18n.XCollator +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim Algorithms As Variant + Dim options As Variant + + Test.StartMethod("listCollatorAlgorithms()") + bOK = true + Algorithms = oObj.listCollatorAlgorithms(oLocale) + Out.Log("Found " + (ubound(Algorithms) + 1) + " algorithms.") + bOK = bOK AND ubound(Algorithms) >= 0 + Test.MethodTested("listCollatorAlgorithms()", bOK) + + Test.StartMethod("loadCollatorAlgorithm()") + bOK = true + options = com.sun.star.i18n.CollatorOptions.CollatorOptions_IGNORE_CASE + oObj.loadCollatorAlgorithm(Algorithms(0), oLocale, options) + bOK = bOK AND oObj.compareString("A", "a") = 0 + oObj.loadCollatorAlgorithm(Algorithms(0), oLocale, 0) + bOK = bOK AND oObj.compareString("A", "a") <> 0 + Test.MethodTested("loadCollatorAlgorithm()", bOK) + + Test.StartMethod("loadDefaultCollator()") + bOK = true + oObj.loadDefaultCollator(oLocale, 0) + bOK = bOK AND oObj.compareString("A", "a") <> 0 + oObj.loadDefaultCollator(oLocale, options) + bOK = bOK AND oObj.compareString("A", "a") = 0 + Test.MethodTested("loadDefaultCollator()", bOK) + + Test.StartMethod("listCollatorOptions()") + bOK = true + options = oObj.listCollatorOptions(Algorithms(0)) + Out.Log("Found " + (ubound(options) + 1) + " options.") + bOK = bOK AND ubound(options) >= 0 + Test.MethodTested("listCollatorOptions()", bOK) + + Test.StartMethod("compareSubstring()") + bOK = true + bOK = bOK AND oObj.compareSubstring("a", 0, 1, "B", 0, 1) = -1 + bOK = bOK AND oObj.compareSubstring("A", 0, 1, "b", 0, 1) = -1 + bOK = bOK AND oObj.compareSubstring("A", 0, 1, "a", 0, 1) = 0 + Test.MethodTested("compareSubstring()", bOK) + + Test.StartMethod("compareString()") + bOK = true + bOK = bOK AND oObj.compareString("a", "B") = -1 + bOK = bOK AND oObj.compareString("A", "b") = -1 + bOK = bOK AND oObj.compareString("A", "a") = 0 + Test.MethodTested("compareString()", bOK) + + Test.StartMethod("loadCollatorAlgorithmWithEndUserOption()") + bOK = true + Dim noOptions() As Integer + Dim optionsArray(0) As Integer + Dim ColAlgorithm As String + + colAlgorithm = "alphanumeric" + Out.Log("Used collation algorithm: "+colAlgorithm) + optionsArray(0) = com.sun.star.i18n.CollatorOptions.CollatorOptions_IGNORE_CASE + oObj.loadCollatorAlgorithmWithEndUserOption(colAlgorithm, oLocale, noOptions()) + bOK = bOK AND oObj.compareString("A", "a") = 1 + bOK = bOK AND oObj.compareString("a", "A") = -1 + bOK = bOK AND oObj.compareString("a", "a") = 0 + oObj.loadCollatorAlgorithmWithEndUserOption(colAlgorithm, oLocale, optionsArray()) + bOK = bOK AND oObj.compareString("A", "a") = 0 + bOK = bOK AND oObj.compareString("a", "A") = 0 + bOK = bOK AND oObj.compareString("a", "a") = 0 + Test.MethodTested("loadCollatorAlgorithmWithEndUserOption()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/i18n/XCollator/script.xlb b/qadevOOo/tests/basic/ifc/i18n/XCollator/script.xlb new file mode 100644 index 000000000000..0a2236d45ade --- /dev/null +++ b/qadevOOo/tests/basic/ifc/i18n/XCollator/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="i18n_XCollator" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="i18n_XCollator"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/i18n/XIndexEntrySupplier/i18n_XIndexEntrySupplier.xba b/qadevOOo/tests/basic/ifc/i18n/XIndexEntrySupplier/i18n_XIndexEntrySupplier.xba new file mode 100644 index 000000000000..f1798683fd02 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/i18n/XIndexEntrySupplier/i18n_XIndexEntrySupplier.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="i18n_XIndexEntrySupplier" 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 + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' - Global oLocale As Object + +'************************************************************************* + + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.i18n.XIndexEntrySupplier +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim entry As String, index As String + + Test.StartMethod("getIndexCharacter()") + bOK = true + entry = "abc" + index = oObj.getIndexCharacter("abc", oLocale, "") + Out.Log("Index key for entry '" + entry + "' is '" + index + "'") + bOK = bOK AND index = "A" OR index = "a" + Test.MethodTested("getIndexCharacter()", bOK) + + Test.StartMethod("getIndexFollowPageWord()") + bOK = true + Out.Log("getIndexFollowPageWord(true, oLocale) returned " + oObj.getIndexFollowPageWord(true, oLocale)) + bOK = bOK AND oObj.getIndexFollowPageWord(true, oLocale) <> "" + Out.Log("getIndexFollowPageWord(false, oLocale) returned " + oObj.getIndexFollowPageWord(false, oLocale)) + bOK = bOK AND oObj.getIndexFollowPageWord(true, oLocale) <> "" + Test.MethodTested("getIndexFollowPageWord()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/i18n/XIndexEntrySupplier/script.xlb b/qadevOOo/tests/basic/ifc/i18n/XIndexEntrySupplier/script.xlb new file mode 100644 index 000000000000..33a460d62c30 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/i18n/XIndexEntrySupplier/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="i18n_XIndexEntrySupplier" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="i18n_XIndexEntrySupplier"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/i18n/XLocaleData/i18n_XLocaleData.xba b/qadevOOo/tests/basic/ifc/i18n/XLocaleData/i18n_XLocaleData.xba new file mode 100644 index 000000000000..88c9952fb920 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/i18n/XLocaleData/i18n_XLocaleData.xba @@ -0,0 +1,245 @@ +<?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="i18n_XLocaleData" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.i18n.XLocaleData +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim AllNames As Variant, nNamesCount As Integer, i As Integer + Dim Locale As Variant, oInfo As Variant, LocItem As Variant + Dim AllCalendars As Variant, AllCurrencies As Variant + Dim AllFormats As Variant, Implementations As Variant + Dim sOpt As Variant, size As Variant + Dim rtLit As Variant, fbc As Variant, rw As Variant + + Test.StartMethod("getAllInstalledLocaleNames()") + bOK = true + AllNames = oObj.getAllInstalledLocaleNames() + nNamesCount = ubound(AllNames) + Out.Log("Found " + nNamesCount + " Loacales registered in the system") + + for i = 0 to nNamesCount + Out.Log("" + i + "). " + AllNames(i).Country + ";" + AllNames(i).Language + ";" + AllNames(i).Variant) + next i + + Randomize + Locale = AllNames(rnd * nNamesCount) + Out.Log("Choose for testing : " + Locale.Country) + + bOK = bOK AND NOT isNULL(Locale) + Test.MethodTested("getAllInstalledLocaleNames()", bOK) + + Test.StartMethod("getLanguageCountryInfo()") + bOK = true + oInfo = oObj.getLanguageCountryInfo(Locale) + bOK = bOK AND oInfo.Language = Locale.Language + bOK = bOK AND oInfo.Country = Locale.Country + Out.Log("Language: " + oInfo.Language + _ + ", LanguageDefaultName: " + oInfo.LanguageDefaultName + _ + ", Country: " + oInfo.Country + _ + ", CountryDefaultName: " + oInfo.CountryDefaultName + _ + ", Variant: " + oInfo.Variant) + + Test.MethodTested("getLanguageCountryInfo()", bOK) + + Test.StartMethod("getLocaleItem()") + bOK = true + LocItem = oObj.getLocaleItem(Locale) + bOK = bOK AND LocItem.unoID <> "" + Out.Log(" unoID: " + LocItem.unoID + _ + " dateSeparator: " + LocItem.dateSeparator + _ + " thousandSeparator: " + LocItem.thousandSeparator + _ + " decimalSeparator: " + LocItem.decimalSeparator + _ + " timeSeparator: " + LocItem.timeSeparator + _ + " time100SecSeparator: " + LocItem.time100SecSeparator + _ + " listSeparator: " + LocItem.listSeparator + _ + " quotationStart: " + LocItem.quotationStart + _ + " quotationEnd: " + LocItem.quotationEnd + _ + " doubleQuotationStart: " + LocItem.doubleQuotationStart + _ + " doubleQuotationEnd: " + LocItem.doubleQuotationEnd + _ + " timeAM: " + LocItem.timeAM + _ + " timePM: " + LocItem.timePM + _ + " measurementSystem: " + LocItem.measurementSystem + _ + " LongDateDayOfWeekSeparator: " + LocItem.LongDateDayOfWeekSeparator + _ + " LongDateDaySeparator: " + LocItem.LongDateDaySeparator + _ + " LongDateMonthSeparator: " + LocItem.LongDateMonthSeparator + _ + " LongDateYearSeparator: " + LocItem.LongDateYearSeparator) + Test.MethodTested("getLocaleItem()", bOK) + + Test.StartMethod("getAllCalendars()") + bOK = true + AllCalendars = oObj.getAllCalendars(Locale) + bOK = bOK AND NOT isNULL(AllCalendars(0)) + Out.Log("Found " + ubound(AllCalendars) + 1 + " calendar(s) used in this Locale") + + Dim Days As Variant, Months As Variant, Eras As Variant + Dim j As Integer + for i = 0 to ubound(AllCalendars) + + Out.Log("Calendar " + i + 1 + ":") + Out.Log(" Days:") + Days = AllCalendars(i).Days + for j = 0 to ubound(Days) + Out.Log(" " + j + ") ID: " + Days(j).ID + ", AbbrevName: " + Days(j).AbbrevName + ", FullName: " + Days(j).FullName) + next j + Out.Log(" Months:") + Months = AllCalendars(i).Months + for j = 0 to ubound(Months) + Out.Log(" " + j + ") ID: " + Months(j).ID + ", AbbrevName: " + Months(j).AbbrevName + ", FullName: " + Months(j).FullName) + next j + Out.Log(" Eras:") + Eras = AllCalendars(i).Eras + for j = 0 to ubound(Eras) + Out.Log(" " + j + ") ID: " + Eras(j).ID + ", AbbrevName: " + Eras(j).AbbrevName + ", FullName: " + Eras(j).FullName) + next j + Out.Log(" StartOfWeek: " + AllCalendars(i).StartOfWeek) + Out.Log(" MinimumNumberOfDaysForFirstWeek: " + AllCalendars(i).MinimumNumberOfDaysForFirstWeek) + Out.Log(" Default: " + AllCalendars(i).Default) + Out.Log(" Name: " + AllCalendars(i).Name) + next i + + Test.MethodTested("getAllCalendars()", bOK) + + Test.StartMethod("getAllCurrencies()") + bOK = true + AllCurrencies = oObj.getAllCurrencies(Locale) + Out.Log("Found " + ubound(AllCurrencies) + 1 + " Currencies used in this Locale") + bOK = bOK AND NOT isNULL(AllCurrencies(0)) + for i = 0 to ubound(AllCurrencies) + Out.Log("Currency " + i + 1 + ":") + Out.Log(" ID: " + AllCurrencies(i).ID + _ + " Symbol: " + AllCurrencies(i).Symbol + _ + " BankSymbol: " + AllCurrencies(i).BankSymbol + _ + " Name: " + AllCurrencies(i).Name + _ + " Default: " + AllCurrencies(i).Default) + next i + + Test.MethodTested("getAllCurrencies()", bOK) + + Test.StartMethod("getAllFormats()") + bOK = true + AllFormats = oObj.getAllFormats(Locale) + Out.Log("Found " + ubound(AllFormats) + 1 + " FormatElement(s) used in this Locale") + bOK = bOK AND NOT isNULL(AllFormats(0)) + for i = 0 to ubound(AllFormats) + Out.Log("FormatElement " + i + 1 + ":") + Out.Log(" formatCode: " + AllFormats(i).formatCode + _ + " formatName: " + AllFormats(i).formatName + _ + " formatKey: " + AllFormats(i).formatKey + _ + " formatType: " + AllFormats(i).formatType + _ + " formatUsage: " + AllFormats(i).formatUsage + _ + " formatIndex: " + AllFormats(i).formatIndex + _ + " isDefault: " + AllFormats(i).isDefault) + next i + Test.MethodTested("getAllFormats()", bOK) + + Test.StartMethod("getCollatorImplementations()") + bOK = true + Implementations = oObj.getCollatorImplementations(Locale) + Out.Log("Found " + (ubound(Implementations) + 1) + " Implementation(s) used in this Locale") + bOK = bOK AND NOT isNULL(Implementations(0)) + for i = 0 to ubound(Implementations) + Out.Log("Implementation " + (i + 1) + ":") + Out.Log(" unoID: " + Implementations(i).unoID ) + Out.Log(" isDefault: " + Implementations(i).isDefault) + next i + Test.MethodTested("getCollatorImplementations()", bOK) + + Test.StartMethod("getSearchOptions()") + bOK = true + sOpt = oObj.getSearchOptions(Locale) + size = ubound(sOpt) + Out.Log("There are : " + (size + 1) + " search options.") + for i = 0 to size + Out.Log("'" + sOpt(i) + "'") + next i + bOK = bOK AND isArray(sOpt) + Test.MethodTested("getSearchOptions()", bOK) + + Test.StartMethod("getCollationOptions()") + bOK = true + sOpt = oObj.getCollationOptions(Locale) + size = ubound(sOpt) + Out.Log("There are : " + (size + 1) + " collation options.") + for i = 0 to size + Out.Log("'" + sOpt(i) + "'") + next i + bOK = bOK AND isArray(sOpt) + Test.MethodTested("getCollationOptions()", bOK) + + Test.StartMethod("getTransliterations()") + bOK = true + rtLit = oObj.getTransliterations(Locale) + bOK = bOK AND NOT isNULL(rtLit) + for i = 0 to ubound(rtLit) + Out.Log("" + i + 1 +") " + rtLit(i)) + next i + Test.MethodTested("getTransliterations()", bOK) + + Test.StartMethod("getForbiddenCharacters()") + bOK = true + fbc = oObj.getForbiddenCharacters(Locale) + + Out.Log(" beginLine: " + fbc.beginLine) + Out.Log(" endLine: " + fbc.endLine) + + bOK = bOK AND NOT isNULL(fbc) + Test.MethodTested("getForbiddenCharacters()", bOK) + + Test.StartMethod("getReservedWord()") + bOK = true + rw = oObj.getReservedWord(Locale) + bOK = bOK AND NOT isNULL(rw) + for i = 0 to ubound(rw) + Out.Log("" + i + 1 +") " + rw(i)) + next i + Test.MethodTested("getReservedWord()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/i18n/XLocaleData/script.xlb b/qadevOOo/tests/basic/ifc/i18n/XLocaleData/script.xlb new file mode 100644 index 000000000000..fb7472a9c4ab --- /dev/null +++ b/qadevOOo/tests/basic/ifc/i18n/XLocaleData/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="i18n_XLocaleData" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="i18n_XLocaleData"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/i18n/XNumberFormatCode/i18n_XNumberFormatCode.xba b/qadevOOo/tests/basic/ifc/i18n/XNumberFormatCode/i18n_XNumberFormatCode.xba new file mode 100644 index 000000000000..752e20ab38ae --- /dev/null +++ b/qadevOOo/tests/basic/ifc/i18n/XNumberFormatCode/i18n_XNumberFormatCode.xba @@ -0,0 +1,78 @@ +<?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="i18n_XNumberFormatCode" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.i18n.XNumberFormatCode +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Dim vLocale As new com.sun.star.lang.Locale + Dim vDefault As Variant + Dim vFormatCode As Variant + + + Test.StartMethod("getDefault()") + vDefault = oObj.getDefault(1, 1, vLocale) + bOK = isNumeric(vDefault.Type) + Test.MethodTested("getDefault()", bOK) + + Test.StartMethod("getFormatCode()") + vFormatCode = oObj.getFormatCode(1, vLocale) + bOK = isNumeric(vFormatCode.Usage) + Test.MethodTested("getFormatCode()", bOK) + + Test.StartMethod("getAllFormatCode()") + vGetAllFormatCode = oObj.getAllFormatCode(1, vLocale) + bOK = uBound(vGetAllFormatCode) + Test.MethodTested("getAllFormatCode()", bOK) + + Test.StartMethod("getAllFormatCodes()") + vGetAllFormatCodes = oObj.getAllFormatCodes(vLocale) + bOK = uBound(vGetAllFormatCodes) + Test.MethodTested("getAllFormatCodes()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/i18n/XNumberFormatCode/script.xlb b/qadevOOo/tests/basic/ifc/i18n/XNumberFormatCode/script.xlb new file mode 100644 index 000000000000..3d354daa63ea --- /dev/null +++ b/qadevOOo/tests/basic/ifc/i18n/XNumberFormatCode/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="i18n_XNumberFormatCode" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="i18n_XNumberFormatCode"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/i18n/XTransliteration/i18n_XTransliteration.xba b/qadevOOo/tests/basic/ifc/i18n/XTransliteration/i18n_XTransliteration.xba new file mode 100644 index 000000000000..faaf0bab69f4 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/i18n/XTransliteration/i18n_XTransliteration.xba @@ -0,0 +1,282 @@ +<?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="i18n_XTransliteration" 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. +' +'************************************************************************* +'************************************************************************* + + + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' - Global oLocale As Object + +'************************************************************************* + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.i18n.XTransliteration +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim availableModules As Variant + Dim _string As String + Dim i As Integer + + + Test.StartMethod("getAvailableModules()") + bOK = true + availableModules = oObj.getAvailableModules(oLocale, com.sun.star.i18n.TransliterationModules.UPPERCASE_LOWERCASE) + _string = "" + for i = 0 to ubound(availableModules) + _string = _string + availableModules(i) + "; " + next i + Out.Log("AvailableModules: " + _string) + bOK = bOK AND _string <> "" + Test.MethodTested("getAvailableModules()", bOK) + + Test.StartMethod("loadModuleByImplName()") + bOK = true + oObj.loadModuleByImplName("LOWERCASE_UPPERCASE", oLocale) + Dim module_name As String + module_name = oObj.getName() + out.log("getName return: " + module_name) + bOK = module_name = "lower_to_upper(generic)" + Test.MethodTested("loadModuleByImplName()", bOK) + + Test.StartMethod("getName()") + bOK = true + Out.Log("Module name is " + oObj.getName()) + bOK = bOK AND oObj.getName() <> "" + Test.MethodTested("getName()", bOK) + + Test.StartMethod("getType()") + bOK = true + Out.Log("Type is " + oObj.getType()) + bOK = bOK AND oObj.getType() = 1 ' for UPPERCASE_LOWERCASE it is ONE_TO_ONE + Test.MethodTested("getType()", bOK) + + Test.StartMethod("loadModule()") + bOK = true + oObj.loadModule(com.sun.star.i18n.TransliterationModules.LOWERCASE_UPPERCASE, oLocale) + bOK = bOK AND oObj.getType = com.sun.star.i18n.TransliterationType.ONE_TO_ONE + Test.MethodTested("loadModule()", bOK) + + Test.StartMethod("loadModulesByImplNames()") + bOK = true + Dim Names(0) As String + Names(0) = "UPPERCASE_LOWERCASE" + oObj.loadModulesByImplNames(Names(), oLocale) + module_name = oObj.getName() + out.log("getName return: " + module_name) + bOK = module_name = "upper_to_lower(generic)" + Test.MethodTested("loadModulesByImplNames()", bOK) + + Test.StartMethod("loadModuleNew()") + bOK = true + Dim ModulesNew(0) As Variant + ModulesNew(0) = com.sun.star.i18n.TransliterationModulesNew.LOWERCASE_UPPERCASE + oObj.loadModuleNew(ModulesNew(), oLocale) + bOK = bOK AND oObj.getType = com.sun.star.i18n.TransliterationType.ONE_TO_ONE + Test.MethodTested("loadModuleNew()", bOK) + + Test.StartMethod("transliterate()") + Dim offset() As Variant + bOK = true + Out.Log("LOWERCASE_UPPERCASE-transliterate part of string 'AaBbCc'") + _string = oObj.transliterate("AaBbCc", 1, 4, offset()) + Out.Log("Result of transliteration: " + _string) + bOK = bOK AND "ABBC" = _string + bOK = bOK AND ubound(offset()) = 3 + for i = 0 to ubound(offset()) + bOK = bOK AND offset(i) = i + 1 + next i + Test.MethodTested("transliterate()", bOK) + + Test.StartMethod("equals()") + bOK = true + Dim Match1 As Variant, Match2 As Variant + bOK = bOK AND oObj.equals("This is an example string to be transliterate", 2, 20, Match1, _ + "IS IS AN EXAMPLE STR", 0, 20, Match2) + Test.MethodTested("equals()", bOK) + + Test.StartMethod("folding()") + bOK = true + _string = oObj.folding("AaBbCc", 1, 4, offset()) + Out.Log("Result of folding: " + _string) + bOK = bOK AND "ABBC" = _string + bOK = bOK AND ubound(offset()) = 3 + for i = 0 to ubound(offset()) + bOK = bOK AND offset(i) = i + 1 + next i + Test.MethodTested("folding()", bOK) + + Test.StartMethod("transliterateRange()") + Dim Result As Variant + bOK = true + oObj.loadModule(com.sun.star.i18n.TransliterationModules.IGNORE_CASE, _Locale) + Result = oObj.transliterateRange("a", "c") + for i = 0 to ubound(Result) + Out.Log(Result(i)) + next i + bOK = bOK AND ubound(Result()) = 3 AND _ + ((Result(0) = "a" AND Result(1) = "c" AND Result(2) = "A" AND Result(3) = "C" ) OR _ + (Result(0) = "A" AND Result(1) = "C" AND Result(2) = "a" AND Result(3) = "c" )) + Test.MethodTested("transliterateRange()", bOK) + + Test.StartMethod("compareString()") + oObj.loadModule(com.sun.star.i18n.TransliterationModules.LOWERCASE_UPPERCASE, _Locale) + bOK = true + bOK = bOK AND testString("", "", 0) + bOK = bOK AND testString("a", "", 1) + bOK = bOK AND testString("a", "a", 0) + bOK = bOK AND testString("A", "a", 1) + bOK = bOK AND testString("b", "a", 1) + bOK = bOK AND testString(chr(10), chr(10), 0) + bOK = bOK AND testString(chr(10), chr(9), 1) + bOK = bOK AND testString("aaa", "aaa", 0) + bOK = bOK AND testString("aaA", "aaa", 1) + bOK = bOK AND testString("aaa", "aa", 1) + bOK = bOK AND testString("ab", "aaa", 1) + bOK = bOK AND testString("aba", "aa", 1) + bOK = bOK AND testString("aaa" + chr(10) + chr(9) + "a", "aaa" + chr(10) + chr(9) + "a", 0) + bOK = bOK AND testString("aaa" + chr(9) + chr(10) + "b", "aaa" + chr(9) + chr(10) + "a", 1) + Test.MethodTested("compareString()", bOK) + + Test.StartMethod("compareSubstring()") + bOK = true + ' substrings below must be equal + bOK = bOK AND testSubstring("", 0, 0, "", 0, 0, 0) + bOK = bOK AND testSubstring("aa", 1, 0, "", 0, 0, 0) + bOK = bOK AND testSubstring("aa", 1, 0, "aa", 2, 0, 0) + bOK = bOK AND testSubstring("a", 0, 1, "a", 0, 1, 0) + bOK = bOK AND testSubstring("ab", 0, 2, "ab", 0, 2, 0) + bOK = bOK AND testSubstring("abc", 1, 2, "abc", 1, 2, 0) + bOK = bOK AND testSubstring("abcdef", 0, 3, "123abc", 3, 3, 0) + bOK = bOK AND testSubstring("abcdef", 1, 1, "123abc", 4, 1, 0) + + ' substrings below must NOT be equal + bOK = bOK AND testSubstring("a", 0, 1, "a", 0, 0, 1) + bOK = bOK AND testSubstring("aaa", 1, 1, "", 0, 0, 1) + bOK = bOK AND testSubstring("bbb", 2, 1, "aaa", 2, 1, 1) + bOK = bOK AND testSubstring("abc", 0, 3, "abc", 0, 2, 1) + bOK = bOK AND testSubstring("bbc", 1, 2, "bbc", 0, 2, 1) + + Test.MethodTested("compareSubstring()", bOK) +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub + +Function testString(str1 As String, str2 As String, expRes As Integer) As Boolean + if expRes = 0 then + testString = testStringCommon(str1, str2, expRes, false) + else + testString = testStringCommon(str1, str2, expRes, true) + end if +End Function + +Function testStringCommon(str1 As String, str2 As String, expRes As Integer, testReverse As Boolean) As Boolean + Dim res As Integer + + testStringCommon = true + + res = -666 + + res = oObj.compareString(str1, str2) + + if res = expRes then + Out.Log("Comparing of '" + str1 + "' and '" + str2 + "' OK" ) + else + Out.Log("Comparing of '" + str1 + "' and '" + str2 + _ + "' FAILED; return: " + res + ", expected: " + expRes) + testStringCommon = false + end if + + if NOT testReverse then + Exit Function + end if + + res = -666 + + res = oObj.compareString(str2, str1) + + if res = -expRes then + Out.Log("Comparing of '" + str2 + "' and '" + str1 + "' OK" ) + else + Out.Log("Comparing of '" + str2 + "' and '" + str1 + _ + "' FAILED; return: " + res + ", expected: " + -expRes) + testStringCommon = false + end if +End Function + +Function testSubstring(str1 As String, p1 As Integer, len1 As Integer, _ + str2 As String, p2 As Integer, len2 As Integer, expRes As Integer) As Boolean + + testSubstring = true + + Dim res As Integer + res = -666 + + res = oObj.compareSubstring(str1, p1, len1, str2, p2, len2) + + if res <> expRes then + Out.Log("Comparing FAILED; return: " + res + ", expected: " + expRes + " ") + testSubstring = false + else + Out.Log("Comparing OK : ") + end if + Out.Log("('" + str1 + "', " + p1 + ", " + len1 + ", '" + _ + str2 + "', " + p2 + ", " + len2 + ")") + + res = -666 + + res = oObj.compareSubstring(str2, p2, len2, str1, p1, len1) + + if res <> -expRes then + Out.Log("Comparing FAILED; return: " + res + ", expected: " + _ + -expRes + " ") + testSubstring = false + else + Out.Log("Comparing OK :") + end if + Out.Log("('" + str2 + "', " + p2 + ", " + len2 + ", '" + _ + str1 + "', " + p1 + ", " + len1 + ")") +End Function +</script:module> diff --git a/qadevOOo/tests/basic/ifc/i18n/XTransliteration/script.xlb b/qadevOOo/tests/basic/ifc/i18n/XTransliteration/script.xlb new file mode 100644 index 000000000000..ea5ecbba7158 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/i18n/XTransliteration/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="i18n_XTransliteration" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="i18n_XTransliteration"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/io/XActiveDataControl/io_XActiveDataControl.xba b/qadevOOo/tests/basic/ifc/io/XActiveDataControl/io_XActiveDataControl.xba new file mode 100644 index 000000000000..b62d12cabbf0 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/io/XActiveDataControl/io_XActiveDataControl.xba @@ -0,0 +1,204 @@ +<?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="io_XActiveDataControl" 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. +' +'************************************************************************* +'************************************************************************* + + + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' - Global oPipe As Object +' - Global PumpOUTFileName As String + +'************************************************************************* + + + + +Dim oListener1 As Object +Dim oListener2 As Object +Dim CB1Started As Integer +Dim CB1Closed As Integer +Dim CB1Terminated As Integer +Dim CB1Error As Integer +Dim CB2Started As Integer +Dim CB2Closed As Integer +Dim CB2Terminated As Integer +Dim CB2Error As Integer + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.io.XActiveDataControl +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim iSize As Integer + + oFileAcc = createUnoService("com.sun.star.ucb.SimpleFileAccess") + + Dim aBytes(10) As Integer + for i = 0 to ubound(aBytes()) + aBytes(i) = i * 3 + next i + + Test.StartMethod("start()") + Test.StartMethod("terminate()") + bOK = true + + Out.Log("Writing some bytes to Pipe") + + oPipe.writeBytes(aBytes()) + + Out.Log("The pump was not started yet. So, PumpOUT should be of zero size") + Out.Log("Terminating a pipe to have an opportunity to get a file size") + oObj.terminate() + + iSize = oFileAcc.getSize(PumpOUTFileName) + Out.Log("Size of file is " & iSize) + bOK = bOK AND iSize = 0 + DisposeObj() + CreateObj() + + Out.Log("Writing bytes again (because object was destroyed)") + oPipe.writeBytes(aBytes()) + Out.Log("... and starting pump") + oObj.start() + wait(100) + Out.Log("Now PumpOUT should have size " & ubound(aBytes()) + 1) + Out.Log("Terminating a pipe to have an opportunity to get a file size") + oObj.terminate() + iSize = oFileAcc.getSize(PumpOUTFileName) + Out.Log("Size of file is " & iSize) + bOK = bOK AND iSize = ubound(aBytes()) + 1 + + Test.MethodTested("start()", bOK) + Test.MethodTested("terminate()", bOK) + + DisposeObj() + CreateObj() + ResetCounters() + + oListener1 = createUnoListener("CB1_", "com.sun.star.io.XStreamListener") + oListener2 = createUnoListener("CB2_", "com.sun.star.io.XStreamListener") + + Test.StartMethod("addListener()") + bOK = true + Out.Log("adding two listeners") + oObj.addListener(oListener1) + oObj.addListener(oListener2) + oPipe.writeBytes(aBytes()) + oObj.start() + wait(100) ' for listeners to change counters + bOK = CB1Started = 1 AND CB2Started = 1 + Test.MethodTested("addListener()", bOK) + + DisposeObj() + CreateObj() + ResetCounters() + + Test.StartMethod("removeListener()") + bOK = true + Out.Log("adding two listeners") + oObj.addListener(oListener1) + oObj.addListener(oListener2) + Out.Log("Removing first listener...") + oObj.removeListener(oListener1) + oPipe.writeBytes(aBytes()) + oObj.start() + wait(100) + bOK = CB1Started = 0 AND CB2Started = 1 + Test.MethodTested("removeListener()", bOK) + DisposeObj() + CreateObj() + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub + +Sub ResetCounters() + CB1Started = 0 + CB1Closed = 0 + CB1Terminated = 0 + CB1Error = 0 + CB2Started = 0 + CB2Closed = 0 + CB2Terminated = 0 + CB2Error = 0 +End Sub + +Sub CB1_Started() + Out.Log("CB1_Started called") + CB1Started = CB1Started + 1 +End Sub + +Sub CB2_Started() + Out.Log("CB2_Started called") + CB2Started = CB2Started + 1 +End Sub + +Sub CB1_Closed() + Out.Log("CB1_Closed called") + CB1Closed = CB1Closed + 1 +End Sub + +Sub CB2_Closed() + Out.Log("CB2_Closed called") + CB2Closed = CB2Closed + 1 +End Sub + +Sub CB1_Terminated() + Out.Log("CB1_Terminated called") + CB1Terminated = CB1Terminated + 1 +End Sub + +Sub CB2_Terminated() + Out.Log("CB2_Terminated called") + CB2Terminated = CB2Terminated + 1 +End Sub + +Sub CB1_Error(aError As Object) + Out.Log("CB1_Error called") + CB1Error = CB1Error + 1 +End Sub + +Sub CB2_Error(aError As Object) + Out.Log("CB2_Error called") + CB2Error = CB2Error + 1 +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/io/XActiveDataControl/script.xlb b/qadevOOo/tests/basic/ifc/io/XActiveDataControl/script.xlb new file mode 100644 index 000000000000..8492bc4365c6 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/io/XActiveDataControl/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="io_XActiveDataControl" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="io_XActiveDataControl"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/io/XActiveDataSink/io_XActiveDataSink.xba b/qadevOOo/tests/basic/ifc/io/XActiveDataSink/io_XActiveDataSink.xba new file mode 100644 index 000000000000..d28d501553cd --- /dev/null +++ b/qadevOOo/tests/basic/ifc/io/XActiveDataSink/io_XActiveDataSink.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="io_XActiveDataSink" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.io.XActiveDataSink +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim oIS As Object, oPipe As Object, oGetPipe As Object + Dim aData As Variant, aGetData As Variant + Dim bytesRead As Variant + + ResetStreams() + Test.StartMethod("getInputStream()") + bOK = true + oIS = oObj.getInputStream() + bOK = bOK AND hasUnoInterfaces(oIS, "com.sun.star.io.XInputStream") + Test.MethodTested("getInputStream()", bOK) + + Test.StartMethod("setInputStream()") + bOK = true + oPipe = createUnoService("com.sun.star.io.Pipe") + aData = Array(23, 65, 32, 119) + oPipe.writeBytes(aData) + oObj.setInputStream(oPipe) + oGetPipe = oObj.getInputStream() + aGetData = dimArray(ubound(aData()) + bytesRead = oGetPipe.readBytes(aGetData(), ubound(aData()) + 1) + Out.Log("Reading bytes: " + bytesRead) + + bOK = bOK AND cmpArrays(aData, aGetData) + + Out.Log("Setting old input stream ...") + oObj.setInputStream(oIS) + + Test.MethodTested("setInputStream()", bOK) +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub + +Function cmpArrays(arr1 As Variant, arr2 As Variant) As Boolean +On Error Goto ErrHndl + Dim bRet As Boolean + Dim i As Integer + + bRet = true + if (isNull(arr1) OR isNull(arr2)) then + bRet = false + Out.Log("One of arrays is null") + else + if (ubound(arr1()) <> ubound(arr2())) then + Out.Log("UBOUND of 1st array is " + ubound(arr1()) + _ + "UBOUND of 2nd array is " + ubound(arr2())) + bRet = false + else + for i = 0 to ubound(arr1()) + Out.Log("(" + i + "): " + arr1(i) + "-" + arr2(i)) + bRet = bRet AND (arr1(i) = arr2(i)) + next i + end if + end if + + cmpArrays() = bRet +exit Function +ErrHndl: + Test.Exception() + cmpArrays() = false +End Function +</script:module> diff --git a/qadevOOo/tests/basic/ifc/io/XActiveDataSink/script.xlb b/qadevOOo/tests/basic/ifc/io/XActiveDataSink/script.xlb new file mode 100644 index 000000000000..b85797766d3e --- /dev/null +++ b/qadevOOo/tests/basic/ifc/io/XActiveDataSink/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="io_XActiveDataSink" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="io_XActiveDataSink"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/io/XActiveDataSource/io_XActiveDataSource.xba b/qadevOOo/tests/basic/ifc/io/XActiveDataSource/io_XActiveDataSource.xba new file mode 100644 index 000000000000..3bd00f2bd4ad --- /dev/null +++ b/qadevOOo/tests/basic/ifc/io/XActiveDataSource/io_XActiveDataSource.xba @@ -0,0 +1,68 @@ +<?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="io_XActiveDataSource" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.io.XActiveDataSource +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim oOS As Object + + Test.StartMethod("getOutputStream()") + bOK = true + oOS = oObj.getOutputStream() + bOK = bOK AND hasUnoInterfaces(oOS, "com.sun.star.io.XOutputStream") + Test.MethodTested("getOutputStream()", bOK) + + Test.StartMethod("setOutputStream()") + bOK = true + oObj.setOutputStream(oOS) + Test.MethodTested("setOutputStream()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/io/XActiveDataSource/script.xlb b/qadevOOo/tests/basic/ifc/io/XActiveDataSource/script.xlb new file mode 100644 index 000000000000..8dd0873e6226 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/io/XActiveDataSource/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="io_XActiveDataSource" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="io_XActiveDataSource"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/io/XConnectable/io_XConnectable.xba b/qadevOOo/tests/basic/ifc/io/XConnectable/io_XConnectable.xba new file mode 100644 index 000000000000..a30e570dea38 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/io/XConnectable/io_XConnectable.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="io_XConnectable" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.io.XConnectable +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Test.StartMethod("setPredecessor()") + bOK = true + oObj.setPredecessor(oObj) + Test.MethodTested("setPredecessor()", bOK) + + Test.StartMethod("getPredecessor()") + bOK = true + oPr = oObj.getPredecessor() + bOK = bOK AND hasUnoInterfaces(oPr, "com.sun.star.io.XConnectable") + Test.MethodTested("getPredecessor()", bOK) + + Test.StartMethod("setSuccessor()") + bOK = true + oObj.setSuccessor(oObj) + Test.MethodTested("setSuccessor()", bOK) + + Test.StartMethod("getSuccessor()") + bOK = true + oSc = oObj.getSuccessor() + bOK = bOK AND hasUnoInterfaces(oSc, "com.sun.star.io.XConnectable") + Test.MethodTested("getSuccessor()", bOK) + + ResetStreams() + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/io/XConnectable/script.xlb b/qadevOOo/tests/basic/ifc/io/XConnectable/script.xlb new file mode 100644 index 000000000000..b0feddcc80d4 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/io/XConnectable/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="io_XConnectable" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="io_XConnectable"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/io/XDataInputStream/io_XDataInputStream.xba b/qadevOOo/tests/basic/ifc/io/XDataInputStream/io_XDataInputStream.xba new file mode 100644 index 000000000000..989ceed4875e --- /dev/null +++ b/qadevOOo/tests/basic/ifc/io/XDataInputStream/io_XDataInputStream.xba @@ -0,0 +1,170 @@ +<?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="io_XDataInputStream" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.io.XDataInputStream +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim DataTypes(10) As String + Dim Data(10) As Variant + Dim oTypeConvertor As Object + + bOK = true + + oTypeConvertor = createUnoService("com.sun.star.script.Converter") + + DataTypes(0) = "byte" + Data(0) = 65 + DataTypes(1) = "boolean" + Data(1) = true + DataTypes(2) = "double" + Data(2) = 10.567 + DataTypes(3) = "long" + Data(3) = 12345678 + DataTypes(4) = "char" + Data(4) = oTypeConvertor.convertToSimpleType(89, com.sun.star.uno.TypeClass.CHAR) + DataTypes(5) = "short" + Data(5) = 233 + DataTypes(6) = "UTF" + Data(6) = "UTF String" + DataTypes(7) = "float" + Data(7) = -233.15 + DataTypes(8) = "Hyper" + Data(8) = 98765432123456 + + Out.Log("Writing data first... ") + + oOutStream = getOutStream() + + for i = 0 to ubound(Data()) + select case DataTypes(i) + case "boolean" + oOutStream.writeBoolean(Data(i)) + case "byte" + oOutStream.writeByte(Data(i)) + case "char" + oOutStream.writeChar(Data(i)) + case "short" + oOutStream.writeShort(Data(i)) + case "long" + oOutStream.writeLong(Data(i)) + case "Hyper" + oOutStream.writeHyper(Data(i)) + case "float" + oOutStream.writeFloat(Data(i)) + case "double" + oOutStream.writeDouble(Data(i)) + case "UTF" + oOutStream.writeUTF(Data(i)) + end select + next i + + Out.Log("then reading and comparering... ") + + ResetStreams() + + for i = 0 to ubound(Data()) + select case DataTypes(i) + case "boolean" + Dim bVar As Boolean + bVar = oObj.readBoolean() + Out.Log("Expected boolean '" & Data(i) & "', actual is '" & bVar & "'") + bOK = bOK AND Data(i) = bVar + Test.MethodTested("readBoolean()", bOK) + case "byte" + Dim iByteVar As Integer + iByteVar = oObj.readByte() + Out.Log("Expected byte '" & int(Data(i)) & "', actual is '" & int(iByteVar) & "'") + bOK = bOK AND Data(i) = iByteVar + Test.MethodTested("readByte()", bOK) + case "char" + Dim cCharVar As Integer + cCharVar = oObj.readChar() + Out.Log("Expected char '" & chr(Data(i)) & "', actual is '" & chr(cCharVar) & "'") + bOK = bOK AND Data(i) = cCharVar + Test.MethodTested("readChar()", bOK) + case "short" + Dim iShortVar As Integer + iShortVar = oObj.readShort() + Out.Log("Expected short '" & int(Data(i)) & "', actual is '" & int(iShortVar) & "'") + bOK = bOK AND Data(i) = iShortVar + Test.MethodTested("readShort()", bOK) + case "long" + Dim iLongVar As Long + iLongVar = oObj.readLong() + Out.Log("Expected long '" & Data(i) & "', actual is '" & iLongVar & "'") + bOK = bOK AND Data(i) = iLongVar + Test.MethodTested("readLong()", bOK) + case "Hyper" + Dim iHyperVar As Variant + iHyperVar = oObj.readHyper() + Out.Log("Expected hyper '" & Data(i) & "', actual is '" & iHyperVar & "'") + bOK = bOK AND Data(i) = iHyperVar + Test.MethodTested("readHyper()", bOK) + case "float" + Dim dFloatVar As Double + dFloatVar = oObj.readFloat() + Out.Log("Expected float '" & Data(i) & "', actual is '" & dFloatVar & "'") + bOK = bOK AND (abs(Data(i) - dFloatVar) < 0.00001) + Test.MethodTested("readFloat()", bOK) + case "double" + Dim dDoubleVar As Double + dDoubleVar = oObj.readDouble() + Out.Log("Expected double '" & Data(i) & "', actual is '" & dDoubleVar & "'") + bOK = bOK AND Data(i) = dDoubleVar + Test.MethodTested("readDouble()", bOK) + case "UTF" + Dim cUTFVar As String + cUTFVar = oObj.readUTF() + Out.Log("Expected UTF '" & Data(i) & "', actual is '" & cUTFVar & "'") + bOK = bOK AND Data(i) = cUTFVar + Test.MethodTested("readUTF()", bOK) + end select + next i + + ResetStreams() +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/io/XDataInputStream/script.xlb b/qadevOOo/tests/basic/ifc/io/XDataInputStream/script.xlb new file mode 100644 index 000000000000..c3623319e6ed --- /dev/null +++ b/qadevOOo/tests/basic/ifc/io/XDataInputStream/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="io_XDataInputStream" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="io_XDataInputStream"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/io/XDataOutputStream/io_XDataOutputStream.xba b/qadevOOo/tests/basic/ifc/io/XDataOutputStream/io_XDataOutputStream.xba new file mode 100644 index 000000000000..6ec09d17c2cd --- /dev/null +++ b/qadevOOo/tests/basic/ifc/io/XDataOutputStream/io_XDataOutputStream.xba @@ -0,0 +1,173 @@ +<?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="io_XDataOutputStream" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.io.XDataOutputStream +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim DataTypes(10) As String + Dim Data(10) As Variant + Dim oTypeConvertor As Object + Dim i As Integer + Dim oInputStream As Object + + bOK = true + + oTypeConvertor = createUnoService("com.sun.star.script.Converter") + + DataTypes(0) = "byte" + Data(0) = 65 + DataTypes(1) = "boolean" + Data(1) = true + DataTypes(2) = "double" + Data(2) = 10.567 + DataTypes(3) = "long" + Data(3) = 12345678 + DataTypes(4) = "char" + Data(4) = oTypeConvertor.convertToSimpleType(89, com.sun.star.uno.TypeClass.CHAR) + DataTypes(5) = "short" + Data(5) = 233 + DataTypes(6) = "UTF" + Data(6) = "UTF String" + DataTypes(7) = "float" + Data(7) = -233.15 + DataTypes(8) = "Hyper" + Data(8) = 98765432123456 + + Out.Log("Writing data first... ") + + for i = 0 to ubound(Data()) + select case DataTypes(i) + case "boolean" + oObj.writeBoolean(Data(i)) + case "byte" + oObj.writeByte(Data(i)) + case "char" + oObj.writeChar(Data(i)) + case "short" + oObj.writeShort(Data(i)) + case "long" + oObj.writeLong(Data(i)) + case "Hyper" + oObj.writeHyper(Data(i)) + case "float" + oObj.writeFloat(Data(i)) + case "double" + oObj.writeDouble(Data(i)) + case "UTF" + oObj.writeUTF(Data(i)) + end select + next i + + Out.Log("then reading and comparering... ") + + oInputStream = getInStream() + + for i = 0 to ubound(Data()) + select case DataTypes(i) + case "boolean" + Dim bVar As Boolean + bVar = oInputStream.readBoolean() + Out.Log("Expected boolean '" + Data(i) + "', actual is '" + bVar + "'") + bOK = bOK AND Data(i) = bVar + Test.MethodTested("writeBoolean()", bOK) + case "byte" + Dim iByteVar As Integer + iByteVar = oInputStream.readByte() + Out.Log("Expected byte '" + int(Data(i)) + "', actual is '" + int(iByteVar) + "'") + bOK = bOK AND Data(i) = iByteVar + Test.MethodTested("writeByte()", bOK) + case "char" + Dim cCharVar As Integer + cCharVar = oInputStream.readChar() + Out.Log("Expected char '" + chr(Data(i)) + "', actual is '" + chr(cCharVar) + "'") + bOK = bOK AND Data(i) = cCharVar + Test.MethodTested("writeChar()", bOK) + case "short" + Dim iShortVar As Integer + iShortVar = oInputStream.readShort() + Out.Log("Expected short '" + int(Data(i)) + "', actual is '" + int(iShortVar) + "'") + bOK = bOK AND Data(i) = iShortVar + Test.MethodTested("writeShort()", bOK) + case "long" + Dim iLongVar As Long + iLongVar = oInputStream.readLong() + Out.Log("Expected long '" + Data(i) + "', actual is '" + iLongVar + "'") + bOK = bOK AND Data(i) = iLongVar + Test.MethodTested("writeLong()", bOK) + case "Hyper" + Dim iHyperVar As Variant + iHyperVar = oInputStream.readHyper() + Out.Log("Expected hyper '" + Data(i) + "', actual is '" + iHyperVar + "'") + bOK = bOK AND Data(i) = iHyperVar + Test.MethodTested("writeHyper()", bOK) + case "float" + Dim dFloatVar As Double + dFloatVar = oInputStream.readFloat() + Out.Log("Expected float '" + Data(i) + "', actual is '" + dFloatVar + "'") + bOK = bOK AND (abs(Data(i) - dFloatVar) < 0.00001) + Test.MethodTested("writeFloat()", bOK) + case "double" + Dim dDoubleVar As Double + dDoubleVar = oInputStream.readDouble() + Out.Log("Expected double '" + Data(i) + "', actual is '" + dDoubleVar + "'") + bOK = bOK AND Data(i) = dDoubleVar + Test.MethodTested("writeDouble()", bOK) + case "UTF" + Dim cUTFVar As Variant + cUTFVar = oInputStream.readUTF() + Out.Log("Expected UTF '" + Data(i) + "', actual is '" + cUTFVar + "'") + bOK = bOK AND Data(i) = cUTFVar + Test.MethodTested("writeUTF()", bOK) + end select + next i + + ResetStreams() +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/io/XDataOutputStream/script.xlb b/qadevOOo/tests/basic/ifc/io/XDataOutputStream/script.xlb new file mode 100644 index 000000000000..95fc351c043e --- /dev/null +++ b/qadevOOo/tests/basic/ifc/io/XDataOutputStream/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="io_XDataOutputStream" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="io_XDataOutputStream"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/io/XInputStream/io_XInputStream.xba b/qadevOOo/tests/basic/ifc/io/XInputStream/io_XInputStream.xba new file mode 100644 index 000000000000..f4fae54389ea --- /dev/null +++ b/qadevOOo/tests/basic/ifc/io/XInputStream/io_XInputStream.xba @@ -0,0 +1,115 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="io_XInputStream" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.io.XInputStream +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim Bytes(10) As Integer + Dim rBytes(10) As Integer + Dim oOutputStream As Object + Dim i As Integer + Dim nRead As Integer + + Out.Log("First writeBytes()...") + bOK = true + + for i = 0 to ubound(Bytes()) + Bytes(i) = i + next i + + oOutputStream = getOutStream() + oOutputStream.writeBytes(Bytes()) + + if (cObjectName <> "stm.Pipe") then ResetStreams() + + Test.StartMethod("readBytes()") + bOK = true + nRead = oObj.readBytes(Bytes(), 5) + bOK = bOK AND nRead = 5 + for i = 0 to 4 + Out.Log("Expected " & i & ", actual is " & int(Bytes(i))) + bOK = bOK AND Bytes(i) = i + next i + Test.MethodTested("readBytes()", bOK) + + Test.StartMethod("skipBytes()") + bOK = true + oObj.skipBytes(2) + nRead = oObj.readBytes(Bytes(), 2) + Out.Log("Expected " & 7 & ", actual is " & int(Bytes(0))) + bOK = bOK AND Bytes(0) = 7 + Test.MethodTested("skipBytes()", bOK) + + Test.StartMethod("available()") + bOK = true + iAvail = oObj.available() + Out.Log("bytes available without blocking: " & iAvail) + bOK = bOK AND iAvail >= 0 + Test.MethodTested("available()", bOK) + + Test.StartMethod("readSomeBytes()") + bOK = true + nRead = oObj.readSomeBytes(Bytes(), 10) + Out.Log("Can read " & nRead & " bytes.") + for i = 0 to ubound(Bytes()) + Out.Log(int(Bytes(i))) + next i + bOK = bOK AND ubound(Bytes()) = 1 + bOK = bOK AND nRead = 2 + bOK = bOK AND Bytes(0) = 9 + bOK = bOK AND Bytes(1) = 10 + Test.MethodTested("readSomeBytes()", bOK) + + Test.StartMethod("closeInput()") + bOK = true + Out.Log("This method is called in main module.") + Test.MethodTested("closeInput()", bOK) + + ResetStreams() + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/io/XInputStream/script.xlb b/qadevOOo/tests/basic/ifc/io/XInputStream/script.xlb new file mode 100644 index 000000000000..7154ab2bb35b --- /dev/null +++ b/qadevOOo/tests/basic/ifc/io/XInputStream/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="io_XInputStream" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="io_XInputStream"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/io/XMarkableStream/io_XMarkableStream.xba b/qadevOOo/tests/basic/ifc/io/XMarkableStream/io_XMarkableStream.xba new file mode 100644 index 000000000000..12d14e6f2c9c --- /dev/null +++ b/qadevOOo/tests/basic/ifc/io/XMarkableStream/io_XMarkableStream.xba @@ -0,0 +1,253 @@ +<?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="io_XMarkableStream" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.io.XMarkableStream +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim Bytes(20) As Integer + Dim rBytes(0) + Dim lastRByte As Integer + Dim i As Integer + Dim oOutStream As Object + Dim oInStream As Object + Dim iMark1 As Integer + Dim iMark2 As Integer + Dim iByte As Integer + Dim iBytes As Integer + Dim iByteAfterMark As Integer + Dim iByteAfterMark1 As Integer + Dim iByteAfterMark2 As Integer + Dim iOffset As Integer + Dim sFileStr As String + + if (cObjectName = "stm.MarkableInputStream" OR cObjectName = "stm.ObjectInputStream") then + + for i = 0 to ubound(Bytes()) + Bytes(i) = i * 2 + next i + + Out.Log("First reset streams and write some bytes...") + oOutStream = getOutStream() + oOutStream.writeBytes(Bytes()) + ResetStreams() + + Test.StartMethod("createMark()") + bOK = true + Out.Log("Skip 3 bytes.") + oObj.skipBytes(3) + iMark1 = oObj.createMark() + Out.Log("Mark" + iMark1 + " was created.") + + oObj.readBytes(rBytes(), 1) + iByteAfterMark1 = rBytes(0) + Out.Log("Byte after Mark" + iMark1 + " is " + int(iByteAfterMark1)) + + Out.Log("Skip 5 bytes.") + oObj.skipBytes(5) + iMark2 = oObj.createMark() + Out.Log("Mark" + iMark2 + " was created.") + + oObj.readBytes(rBytes(), 1) + iByteAfterMark2 = rBytes(0) + Out.Log("Byte after Mark" + iMark2 + " is " + int(iByteAfterMark2)) + + Out.Log("Skip 7 bytes.") + oObj.skipBytes(7) + oObj.readBytes(rBytes(), 1) + lastRByte = rBytes(0) + + Out.Log("Jump to Mark" + iMark2) + oObj.jumpToMark(iMark2) + oObj.readBytes(rBytes(), 1) + iByteAfterMark = rBytes(0) + Out.Log("Byte after Mark" + iMark2 + " is " + int(iByteAfterMark) + ", expected " + int(iByteAfterMark2)) + bOK = bOK AND iByteAfterMark = iByteAfterMark2 + + Out.Log("Jump to Mark" + iMark1) + oObj.jumpToMark(iMark1) + oObj.readBytes(rBytes(), 1) + iByteAfterMark = rBytes(0) + Out.Log("Byte after Mark" + iMark1 + " is " + int(iByteAfterMark) + ", expected " + int(iByteAfterMark1)) + bOK = bOK AND iByteAfterMark = iByteAfterMark1 + + Test.MethodTested("createMark()", bOK) + Test.MethodTested("jumpToMark()", bOK) + + Test.StartMethod("offsetToMark()") + bOK = true + iOffset = oObj.offsetToMark(iMark2) + Out.Log("Offset from current position to Mark" + iMark2 + " is " + iOffset) + bOK = bOK AND iOffset = -5 + Test.MethodTested("offsetToMark()", bOK) + + Test.StartMethod("deleteMark()") + bOK = true + Out.Log("Delete Mark" + iMark1) + oObj.deleteMark(iMark1) + On Error goto ErrHndl1 + Out.Log("Trying to jump to deleted mark") + oObj.jumpToMark(iMark1) + Out.Log("No exception occurred. FAILED") + bOK = false + goto Cont1 + ErrHndl1: + Out.Log("Expected exception: " + error) + Cont1: + Test.MethodTested("deleteMark()", bOK) + + Test.StartMethod("jumpToFurthest()") + bOK = true + oObj.readBytes(rBytes(), 1) + iByte = rBytes(0) + Out.Log("Perform a reading operation from the current position. Byte " + int(iByte) + " was read.") + Out.Log("Changing position.") + oObj.jumpToMark(iMark2) + Out.Log("Changing position with jumpToFurthest()") + oObj.jumpToFurthest() + oObj.readBytes(rBytes(), 1) + Out.Log("From the current position byte " + int(rBytes(0)) + " was read. Expected byte is " + int(lastRByte) + 2) + bOK = bOK AND lastRByte + 2 = rBytes(0) + Test.MethodTested("jumpToFurthest()", bOK) + else + bOK = true + Out.Log("Write 3 bytes to stream") + ReDim Bytes(2) As Integer + for i = 0 to ubound(Bytes()) + Bytes(i) = i + next i + oObj.writeBytes(Bytes()) + Out.Log("Creating a Mark.") + iMark1 = oObj.createMark() + Out.Log("Write 4 bytes to stream") + ReDim Bytes(3) As Integer + for i = 0 to ubound(Bytes()) + Bytes(i) = i + 3 + next i + oObj.writeBytes(Bytes()) + Out.Log("Creating a Mark.") + iMark2 = oObj.createMark() + + iOffset = oObj.offsetToMark(iMark1) + Out.Log("Offset from current position to Mark" + iMark1 + " is " + iOffset) + bOK = bOK AND iOffset = 4 + Test.MethodTested("offsetToMark()", bOK) + + Out.Log("Write 5 bytes to stream") + ReDim Bytes(4) As Integer + for i = 0 to ubound(Bytes()) + Bytes(i) = i + 7 + next i + oObj.writeBytes(Bytes()) + + Out.Log("Testing jumpToMark()") + Out.Log("Testing deleteMark()") + bOK = true + Out.Log("Deleting Mark1") + oObj.deleteMark(iMark2) + On Error goto ErrHndl2 + Out.Log("Trying to jump to Mark1") + oObj.jumpToMark(iMark2) + Out.Log("No exception occurred - FAILED") + bOK = false + goto Cont2 + ErrHndl2: + Out.Log("Expected exception: " + error) + Cont2: + + Test.MethodTested("deleteMark()", bOK) + + bOK = true + + Out.Log("Jump to Mark0") + oObj.jumpToMark(iMark1) + Test.MethodTested("jumpToMark()", bOK) + Test.MethodTested("createMark()", bOK) + + bOK = true + Out.Log("Write 2 bytes to stream") + ReDim Bytes(1) As Integer + + for i = 0 to ubound(Bytes()) + Bytes(i) = i + 12 + next i + + oObj.writeBytes(Bytes()) + Out.Log("Changing position") + oObj.jumpToMark(iMark1) + Out.Log("Changing position with jumpToFurthest()") + oObj.jumpToFurthest() + + Out.Log("Write 2 bytes to stream") + ReDim Bytes(1) As Integer + for i = 0 to ubound(Bytes()) + Bytes(i) = i + 14 + next i + oObj.writeBytes(Bytes()) + + Out.Log("Comparing file with expected {0, 1, 2, 12, 13, 5, 6, 7, 8, 9, 10, 11, 14, 15}") + oInStream = getInStream() + iBytes = oInStream.readBytes(rBytes(), 20) + Out.Log("There are " + iBytes + " in stream:") + sFileStr = "" + int(rBytes(0)) + for i = 1 to ubound(rBytes()) + sFileStr = sFileStr + ", " + int(rBytes(i)) + next i + Out.Log("They are {" + sFileStr + "}") + bOK = bOK AND sFileStr = "0, 1, 2, 12, 13, 5, 6, 7, 8, 9, 10, 11, 14, 15" + + Test.MethodTested("jumpToFurthest()", bOK) + end if + + ResetStreams() + DisposeObj() + CreateObj() + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/io/XMarkableStream/script.xlb b/qadevOOo/tests/basic/ifc/io/XMarkableStream/script.xlb new file mode 100644 index 000000000000..0cccb2f8f56c --- /dev/null +++ b/qadevOOo/tests/basic/ifc/io/XMarkableStream/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="io_XMarkableStream" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="io_XMarkableStream"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/io/XObjectInputStream/io_XObjectInputStream.xba b/qadevOOo/tests/basic/ifc/io/XObjectInputStream/io_XObjectInputStream.xba new file mode 100644 index 000000000000..c12c8ce0180e --- /dev/null +++ b/qadevOOo/tests/basic/ifc/io/XObjectInputStream/io_XObjectInputStream.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="io_XObjectInputStream" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.io.XObjectInputStream +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + Dim oObjToWrite As Object + oObjToWrite = createUnoService("com.sun.star.awt.UnoControlButtonModel") + oObjToWrite.Label = "XObjectInputStream" + + Out.Log("Writing object with label " & oObjToWrite.Label ) + + oOutStream = getOutStream() + oOutStream.writeObject(oObjToWrite) + + ResetStreams() + + Test.StartMethod("readObject()") + bOK = true + + if (bOK) then + oReadObj = oObj.readObject() + + Out.Log("Object with label " & oReadObj.Label & " was read") + bOK = bOK AND oReadObj.Label = "XObjectInputStream" + end if + + Test.MethodTested("readObject()", bOK) + + ResetStreams() + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/io/XObjectInputStream/script.xlb b/qadevOOo/tests/basic/ifc/io/XObjectInputStream/script.xlb new file mode 100644 index 000000000000..08c456872069 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/io/XObjectInputStream/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="io_XObjectInputStream" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="io_XObjectInputStream"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/io/XObjectOutputStream/io_XObjectOutputStream.xba b/qadevOOo/tests/basic/ifc/io/XObjectOutputStream/io_XObjectOutputStream.xba new file mode 100644 index 000000000000..0f3f1f6bc97c --- /dev/null +++ b/qadevOOo/tests/basic/ifc/io/XObjectOutputStream/io_XObjectOutputStream.xba @@ -0,0 +1,75 @@ +<?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="io_XObjectOutputStream" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.io.XObjectOutputStream +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Dim oObjToWrite As Object + oObjToWrite = createUnoService("com.sun.star.awt.UnoControlButtonModel") + oObjToWrite.Label = "XObjectOutputStream" + + Out.Log("Writing object with label " & oObjToWrite.Label ) + + Test.StartMethod("writeObject()") + bOK = true + oObj.writeObject(oObjToWrite) + + if (bOK) then + inStream = getInStream() + oReadObj = inStream.readObject() + + Out.Log("Object with label " & oReadObj.Label & " was read") + bOK = bOK AND oReadObj.Label = "XObjectOutputStream" + end if + + Test.MethodTested("writeObject()", bOK) + + ResetStreams() + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/io/XObjectOutputStream/script.xlb b/qadevOOo/tests/basic/ifc/io/XObjectOutputStream/script.xlb new file mode 100644 index 000000000000..84af6a647208 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/io/XObjectOutputStream/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="io_XObjectOutputStream" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="io_XObjectOutputStream"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/io/XOutputStream/io_XOutputStream.xba b/qadevOOo/tests/basic/ifc/io/XOutputStream/io_XOutputStream.xba new file mode 100644 index 000000000000..f88bb41866c8 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/io/XOutputStream/io_XOutputStream.xba @@ -0,0 +1,88 @@ +<?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="io_XOutputStream" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.io.XOutputStream +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim Bytes(10) As Integer + Dim rBytes(10) As Integer + + Test.StartMethod("writeBytes()") + bOK = true + + for i = 0 to ubound(Bytes()) + Bytes(i) = i + next i + oObj.writeBytes(Bytes()) + + oInputStream = getInStream() + iBytesRead = oInputStream.readBytes(rBytes(), ubound(Bytes()) + 1) + Out.Log("" & iBytesRead & " bytes were read") + bOK = bOK AND iBytesRead = ubound(Bytes()) + 1 + + for i = 0 to ubound(rBytes()) + Out.Log("Expected " & Bytes(i) & ", actual is " & int(rBytes(i))) + bOK = bOK AND Bytes(i) = rBytes(i) + next i + + Test.MethodTested("writeBytes()", bOK) + + Test.StartMethod("flush()") + bOK = true + oObj.flush() + Test.MethodTested("flush()", bOK) + + Test.StartMethod("closeOutput()") + bOK = true + Out.Log("This method is called in main module.") + Test.MethodTested("closeOutput()", bOK) + + ResetStreams() + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/io/XOutputStream/script.xlb b/qadevOOo/tests/basic/ifc/io/XOutputStream/script.xlb new file mode 100644 index 000000000000..38a1f413e6d9 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/io/XOutputStream/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="io_XOutputStream" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="io_XOutputStream"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/io/XPersistObject/io_XPersistObject.xba b/qadevOOo/tests/basic/ifc/io/XPersistObject/io_XPersistObject.xba new file mode 100644 index 000000000000..11b00b9e7dce --- /dev/null +++ b/qadevOOo/tests/basic/ifc/io/XPersistObject/io_XPersistObject.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="io_XPersistObject" 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 + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' - Global oPersistInstance As Object + +'************************************************************************* + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.io.XPersistObject +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim oMarkIn, oMarkOut, oOutStrm, oInStrm As Object + Dim oDummy, oCopy, oPipe As Object + Dim uuidString As String + Dim UUID(), UUIDnew() As Variant + Dim i As Integer + + if isNull(oPersistInstance) Then + Out.Log("oPersistInstance is Empty! No oPersistInstance in main created?") + Exit Sub + end if + + Test.StartMethod("getServiceName()") + bOK = true + bOK = bOK AND (VarType(oObj.getServiceName()) = 8) + Test.MethodTested("getServiceName()", bOK) + + if (hasUnoInterfaces(oObj,"com.sun.star.lang.XTypeProvider")) then + 'get ImplementationID + Out.Log("Before writing object, rememeber it's implementation ID.") + uuidString = "" + UUID = oObj.getImplementationId() + for i = 0 to ubound(UUID()) + uuidString = uuidString & UUID(i) & "; " + next i + Out.Log("ImplementationID: " & uuidString) + endif + + oDummy = oPersistInstance + oPipe = createUNOService("com.sun.star.io.Pipe") + oMarkOut = createUNOService("com.sun.star.io.MarkableOutputStream") + oMarkIn = createUNOService("com.sun.star.io.MarkableInputStream") + oOutStrm = createUNOService("com.sun.star.io.ObjectOutputStream") + oInStrm = createUNOService("com.sun.star.io.ObjectInputStream") + + 'made chain + oOutStrm.setOutputStream(oMarkOut) + oMarkOut.setOutputStream(oPipe) + oMarkIn.setInputStream(oPipe) + oInStrm.setInputStream(oMarkIn) + + Test.StartMethod("write()") + Test.StartMethod("read()") + bOK = true + 'write dummy + oOutStrm.writeObject(oDummy) + oObj.write(oOutStrm) + 'read copy + oCopy = oInStrm.readObject() + oObj.read(oInStrm) + + if (hasUnoInterfaces(oObj,"com.sun.star.lang.XTypeProvider")) then + Out.Log("After reading object, get it's implementation ID.") + uuidString = "" + UUIDnew = oObj.getImplementationId() + for i = 0 to ubound(UUID()) + bOK = bOK AND (UUID(i) = UUIDnew(i)) + uuidString = uuidString & UUIDnew(i) & "; " + next i + Out.Log("ImplementationID: " & uuidString) + endif + + Test.MethodTested("write()", bOK) + Test.MethodTested("read()", bOK) + + ReCreateObj() +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/io/XPersistObject/script.xlb b/qadevOOo/tests/basic/ifc/io/XPersistObject/script.xlb new file mode 100644 index 000000000000..baaea2bba562 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/io/XPersistObject/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="io_XPersistObject" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="io_XPersistObject"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/java/XJavaVM/javajava_XJavaVM.xba b/qadevOOo/tests/basic/ifc/java/XJavaVM/javajava_XJavaVM.xba new file mode 100644 index 000000000000..1b8c1336be60 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/java/XJavaVM/javajava_XJavaVM.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="javajava_XJavaVM" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.java.XJavaVM +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + Test.StartMethod("getJavaVM()") + bOK = true + Out.Log("First, registering thread...") + oObj.registerThread() + + JVMAddress = oObj.getJavaVM(noargs()) + Out.Log("Returned address is " & JVMAddress) + bOK = bOK AND JVMAddress <> 0 + + Test.MethodTested("getJavaVM()", bOK) + + Test.StartMethod("isVMStarted()") + bOK = true + Dim isStarted As Boolean + isStarted = oObj.isVMStarted() + Out.Log("isVMStarted() returned " & isStarted) + Test.MethodTested("isVMStarted()", bOK) + + Test.StartMethod("isVMEnabled()") + bOK = true + Dim bEnabled As Boolean + bEnabled = oObj.isVMEnabled() + Out.Log("isVMEnabled() returned " & bEnabled) + Test.MethodTested("isVMEnabled()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/java/XJavaVM/script.xlb b/qadevOOo/tests/basic/ifc/java/XJavaVM/script.xlb new file mode 100644 index 000000000000..7536d1f4bde1 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/java/XJavaVM/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="javajava_XJavaVM" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="javajava_XJavaVM"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/lang/ServiceManager/lang_ServiceManager.xba b/qadevOOo/tests/basic/ifc/lang/ServiceManager/lang_ServiceManager.xba new file mode 100644 index 000000000000..39894b9ea349 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/lang/ServiceManager/lang_ServiceManager.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="lang_ServiceManager" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.lang.ServiceManager +'************************************************************************* +On Error Goto ErrHndl + + PropertyTester.TestProperty("DefaultContext") + + 'test the RTL function getDefaultcontext() + Test.MethodTested("DefaultContext", isObject(getDefaultContext())) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/lang/ServiceManager/script.xlb b/qadevOOo/tests/basic/ifc/lang/ServiceManager/script.xlb new file mode 100644 index 000000000000..7f4958ace7ec --- /dev/null +++ b/qadevOOo/tests/basic/ifc/lang/ServiceManager/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="lang_ServiceManager" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="lang_ServiceManager"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/lang/XComponent/lang_XComponent.xba b/qadevOOo/tests/basic/ifc/lang/XComponent/lang_XComponent.xba new file mode 100644 index 000000000000..6d429bed4c7b --- /dev/null +++ b/qadevOOo/tests/basic/ifc/lang/XComponent/lang_XComponent.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="lang_XComponent" 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. +' +'************************************************************************* +'************************************************************************* + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' Global oComponentInstance As Object it will be disposed + +'************************************************************************* + + +Dim bCB1 As Boolean, bCB2 As Boolean + +' Be sure that all variables are dimensioned: +option explicit + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.lang.XEventListener + +On Error Goto ErrHndl + Dim bOK As Boolean + Dim oListener1 as Object, oListener2 As Object + + If isNull(oComponentInstance) Then Out.Log("oComponentInstance is not initialized") + + bCB1 = false + bCB2 = false + + Out.Log("create two listeners") + oListener1 = createUNOListener("CB1_", "com.sun.star.lang.XEventListener") + oListener2 = createUNOListener("CB2_", "com.sun.star.lang.XEventListener") + + ' add listeners to object if initialized + if NOT(isNull(oListener2)) then + oComponentInstance.addEventListener(oListener2) + end if + if NOT(isNull(oListener1)) then + oComponentInstance.addEventListener(oListener1) + end if + + Out.Log("remove Listener2") + oComponentInstance.removeEventListener(oListener2) + + ' dispose object and check the count + Test.StartMethod("dispose()") + bOK = true + oComponentInstance.dispose() + bOK = bCB1 AND NOT bCB2 + Test.MethodTested("dispose()", bOK) + + ' check if only one eventlistener-callback was executed + Test.StartMethod("addEventListener()") + bOK = bCB1 AND NOT bCB2 + Test.MethodTested("addEventListener()", bOK) + + ' check if there was only one of the listener callbacks executed + Test.StartMethod("removeEventListener()") + bOK = bCB1 AND NOT bCB2 + Test.MethodTested("removeEventListener()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +Sub CB1_disposing + Out.Log("CallBack for Listener1 disposing was called.") + bCB1 = true +End Sub +Sub CB2_disposing + Out.Log("CallBack for Listener2 disposing was called.") + bCB2 = true +End Sub + +</script:module> diff --git a/qadevOOo/tests/basic/ifc/lang/XComponent/script.xlb b/qadevOOo/tests/basic/ifc/lang/XComponent/script.xlb new file mode 100644 index 000000000000..6868484b6179 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/lang/XComponent/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="lang_XComponent" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="lang_XComponent"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/lang/XEventListener/lang_XEventListener.xba b/qadevOOo/tests/basic/ifc/lang/XEventListener/lang_XEventListener.xba new file mode 100644 index 000000000000..bc98741e7b98 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/lang/XEventListener/lang_XEventListener.xba @@ -0,0 +1,64 @@ +<?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="lang_XEventListener" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.lang.XEventListener +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Test.StartMethod("disposing()") + bOK = true + Out.Log("The method 'disposing'") + Out.Log("gets called when the broadcaster is about to be disposed.") + Out.Log("All listeners and all other objects which reference the broadcaster should release the references.") + Out.Log("So there is nothing to test here") + Test.MethodTested("disposing()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/lang/XEventListener/script.xlb b/qadevOOo/tests/basic/ifc/lang/XEventListener/script.xlb new file mode 100644 index 000000000000..41dd6886e66c --- /dev/null +++ b/qadevOOo/tests/basic/ifc/lang/XEventListener/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="lang_XEventListener" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="lang_XEventListener"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/lang/XInitialization/lang_XInitialization.xba b/qadevOOo/tests/basic/ifc/lang/XInitialization/lang_XInitialization.xba new file mode 100644 index 000000000000..bd57e0d44942 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/lang/XInitialization/lang_XInitialization.xba @@ -0,0 +1,86 @@ +<?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="lang_XInitialization" 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 + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' - Global aInitArgs() As Variant +' Global aNoInit() As Variant [optional] +' if the variable defined as Array the method initialize() isnt called. + +'************************************************************************* + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.lang.XInitialization +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim bInit As Boolean + + bInit = true + + Test.StartMethod("initialize()") + bOK = true + + if NOT isArray(aNoInit) then + if NOT isArray(aInitArgs) then + Out.Log("aInitArgs is NULL ... trying with no arguments") + oObj.initialize(DimArray()) + else + oObj.initialize(aInitArgs()) + end if + else + Out.Log("The object already initialized ... OK") + end if + + Test.MethodTested("initialize()", bOK) +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/lang/XInitialization/script.xlb b/qadevOOo/tests/basic/ifc/lang/XInitialization/script.xlb new file mode 100644 index 000000000000..25601d809973 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/lang/XInitialization/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="lang_XInitialization" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="lang_XInitialization"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/lang/XMultiComponentFactory/lang_XMultiComponentFactory.xba b/qadevOOo/tests/basic/ifc/lang/XMultiComponentFactory/lang_XMultiComponentFactory.xba new file mode 100644 index 000000000000..2d56d6f2184d --- /dev/null +++ b/qadevOOo/tests/basic/ifc/lang/XMultiComponentFactory/lang_XMultiComponentFactory.xba @@ -0,0 +1,91 @@ +<?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="lang_XMultiComponentFactory" 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. +' +'************************************************************************* +'************************************************************************* + + + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' - Global cServiceName As String ie. 'com.sun.star.drawing.RectangleShape' +' - Global aContext() As Variant +' - Global aArguments() As Variant + +'************************************************************************* + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.lang.XMultiComponentFactory +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim oInstance1 As Object + Dim oInstance2 As Object + + Test.StartMethod("getAvailableServiceNames()") + bOK = true + Names = oObj.getAvailableServiceNames() + Dim bFound As Boolean + bFound = false + for i = 0 to ubound(Names) + if Names(i) = cServiceName then bFound = true + next i + if (NOT bFound) then Out.Log("Can't find '" & cServiceName & "' in returned array.") + bOK = bOK AND bFound + Test.MethodTested("getAvailableServiceNames()", bOK) + + Test.StartMethod("createInstanceWithContext()") + bOK = true + oInstance1 = oObj.createInstanceWithContext(cServiceName, aContext()) + bOK = bOK AND NOT isNULL(oInstance1) + Test.MethodTested("createInstanceWithContext()", bOK) + + Test.StartMethod("createInstanceWithArgumentsAndContext()") + bOK = true + oInstance2 = oObj.createInstanceWithArgumentsAndContext(cServiceName, aArguments(), aContext()) + bOK = bOK AND NOT isNULL(oInstance2) + Test.MethodTested("createInstanceWithArgumentsAndContext()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/lang/XMultiComponentFactory/script.xlb b/qadevOOo/tests/basic/ifc/lang/XMultiComponentFactory/script.xlb new file mode 100644 index 000000000000..3ed4be77bbe1 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/lang/XMultiComponentFactory/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="lang_XMultiComponentFactory" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="lang_XMultiComponentFactory"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/lang/XMultiServiceFactory/lang_XMultiServiceFactory.xba b/qadevOOo/tests/basic/ifc/lang/XMultiServiceFactory/lang_XMultiServiceFactory.xba new file mode 100644 index 000000000000..e7ee9543a28e --- /dev/null +++ b/qadevOOo/tests/basic/ifc/lang/XMultiServiceFactory/lang_XMultiServiceFactory.xba @@ -0,0 +1,99 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="lang_XMultiServiceFactory" 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. +' +'************************************************************************* +'************************************************************************* + + + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' - Global cServiceName As String ie. "com.sun.star.drawing.RectangleShape" +' - Global bCreateInstanceWithoutArguments As Boolean +' - Global aArguments() As Variant + +'************************************************************************* + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.lang.XMultiServiceFactory +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim oInstance1, oInstance2 As Object + Dim Names + + Test.StartMethod("getAvailableServiceNames()") + bOK = true + Names = oObj.getAvailableServiceNames() + Dim bFound As Boolean + bFound = false + for i = 0 to ubound(Names) + if Names(i) = cServiceName then bFound = true + next i + if (NOT bFound) then Out.Log("Can't find '" & cServiceName & "' in returned array.") + bOK = bOK AND bFound + Test.MethodTested("getAvailableServiceNames()", bOK) + + Test.StartMethod("createInstance()") + bOK = true + if bCreateInstanceWithoutArguments then + oInstance1 = oObj.createInstance(cServiceName) + bOK = bOK AND NOT isNull(oInstance1) + else + Out.Log("createInstance() skipped for this object.") + end if + Test.MethodTested("createInstance()", bOK) + + Test.StartMethod("createInstanceWithArguments()") + bOK = true + if (cObjectName = "sd.SdXImpressDocument") then + Out.Log("Object SdXImpressDocument doesn't suppotr createInstanceWithArguments().") + else + oInstance2 = oObj.createInstanceWithArguments(cServiceName, aArguments()) + bOK = bOK AND NOT isNULL(oInstance2) + end if + Test.MethodTested("createInstanceWithArguments()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/lang/XMultiServiceFactory/script.xlb b/qadevOOo/tests/basic/ifc/lang/XMultiServiceFactory/script.xlb new file mode 100644 index 000000000000..ebca38bedb29 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/lang/XMultiServiceFactory/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="lang_XMultiServiceFactory" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="lang_XMultiServiceFactory"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/lang/XServiceDisplayName/lang_XServiceDisplayName.xba b/qadevOOo/tests/basic/ifc/lang/XServiceDisplayName/lang_XServiceDisplayName.xba new file mode 100644 index 000000000000..2d79fd5e6fcc --- /dev/null +++ b/qadevOOo/tests/basic/ifc/lang/XServiceDisplayName/lang_XServiceDisplayName.xba @@ -0,0 +1,65 @@ +<?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="lang_XServiceDisplayName" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.lang.XServiceDisplayName +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Dim vLocale As new com.sun.star.lang.Locale + Dim cName As String + + vLocale.Language = "en" + vLocale.Country = "US" + + Test.StartMethod("getServiceDisplayName()") + bOK = true + cName = oObj.getServiceDisplayName(vLocale) + bOK = bOK AND (cName <> "") + Test.MethodTested("getServiceDisplayName()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/lang/XServiceDisplayName/script.xlb b/qadevOOo/tests/basic/ifc/lang/XServiceDisplayName/script.xlb new file mode 100644 index 000000000000..d133ba6703cd --- /dev/null +++ b/qadevOOo/tests/basic/ifc/lang/XServiceDisplayName/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="lang_XServiceDisplayName" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="lang_XServiceDisplayName"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/lang/XServiceInfo/lang_XServiceInfo.xba b/qadevOOo/tests/basic/ifc/lang/XServiceInfo/lang_XServiceInfo.xba new file mode 100644 index 000000000000..90691ddbedfe --- /dev/null +++ b/qadevOOo/tests/basic/ifc/lang/XServiceInfo/lang_XServiceInfo.xba @@ -0,0 +1,67 @@ +<?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="lang_XServiceInfo" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.lang.XServiceInfo +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Test.StartMethod("getImplementationName()") + bOK = VarType(oObj.getImplementationName()) = 8 + Test.MethodTested("getImplementationName()", bOK) + + Test.StartMethod("supportsService()") + bOK = true + vServices = oObj.getSupportedServiceNames() + bOK = bOK AND uBound(vServices()) >= 0 + Test.MethodTested("supportsService()", bOK) + + Test.StartMethod("getSupportedServiceNames()") + bOK = oObj.supportsService(vServices(0)) + Test.MethodTested("getSupportedServiceNames()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/lang/XServiceInfo/script.xlb b/qadevOOo/tests/basic/ifc/lang/XServiceInfo/script.xlb new file mode 100644 index 000000000000..1fb4bfa6401a --- /dev/null +++ b/qadevOOo/tests/basic/ifc/lang/XServiceInfo/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="lang_XServiceInfo" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="lang_XServiceInfo"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/lang/XSingleServiceFactory/lang_XSingleServiceFactory.xba b/qadevOOo/tests/basic/ifc/lang/XSingleServiceFactory/lang_XSingleServiceFactory.xba new file mode 100644 index 000000000000..77ad0a8c79b1 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/lang/XSingleServiceFactory/lang_XSingleServiceFactory.xba @@ -0,0 +1,106 @@ +<?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="lang_XSingleServiceFactory" 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 + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' - Global aArguments As Variant [optional] +' Array of arguments for createInstanceWithArguments() +' Global aMustSupportInterface As Variant [optional] +' Array of Strings with names of interfaces which must be supported by created instance. + +'************************************************************************* + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.lang.XSingleServiceFactory +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim aArgs() + Dim inst As Object + Dim i As Integer + + Test.StartMethod("createInstance()") + bOK = true + if (cObjectName = "inv.Invocation") then + Out.Log("createInstance() not available in " + cObjectName + " - SKIPPED") + else + bOK = bOK AND isObject(oObj.createInstance()) + end if + Test.MethodTested("createInstance()", bOK) + + Test.StartMethod("createInstanceWithArguments()") + bOK = true + if isArray(aArguments) then + inst = oObj.createInstanceWithArguments(aArguments()) + else + inst = oObj.createInstanceWithArguments(aArgs()) + end if + + if NOT isObject(inst) then + bOK = false + Out.Log("The returned instance is not object : FAILED.") + end if + + if isArray(aMustSupportInterface) AND bOK then + Out.Log("Checking supported interfaces ...") + for i = 0 to ubound(aMustSupportInterface()) + if NOT hasUnoInterfaces(inst, aMustSupportInterface(i)) then + Out.Log("The created instance doesn't support '" + aMustSupportInterface(i) + "'") + bOK = false + end if + next i + end if + + Test.MethodTested("createInstanceWithArguments()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/lang/XSingleServiceFactory/script.xlb b/qadevOOo/tests/basic/ifc/lang/XSingleServiceFactory/script.xlb new file mode 100644 index 000000000000..acff5b4a09b2 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/lang/XSingleServiceFactory/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="lang_XSingleServiceFactory" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="lang_XSingleServiceFactory"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/lang/XTypeProvider/lang_XTypeProvider.xba b/qadevOOo/tests/basic/ifc/lang/XTypeProvider/lang_XTypeProvider.xba new file mode 100644 index 000000000000..8422f4574e0e --- /dev/null +++ b/qadevOOo/tests/basic/ifc/lang/XTypeProvider/lang_XTypeProvider.xba @@ -0,0 +1,88 @@ +<?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="lang_XTypeProvider" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.lang.XTypeProvider +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim n As Integer + Dim vTypes As Variant + Dim IDs1(15) As Integer + Dim IDs2(15) As Integer + + Test.StartMethod("getTypes()") + bOK = false + vTypes = oObj.getTypes() + For n = lBound(vTypes()) to UBound(vTypes()) + If vTypes(n).Name = cIfcLongName Then + Out.Log("Type of Object " & n & " is " & vTypes(n).Name & ". Same as Interface => ok!" + bOK = true + Else + Out.Log("Type of Object " & n & " is " & vTypes(n).Name + End If + Next n + Test.MethodTested("getTypes()", bOK) + + Test.StartMethod("getImplementationId()") + bOK = true + IDs1() = oObj.getImplementationId() + IDs2() = oObj.getImplementationId() + + bOK = bOK AND ubound(IDs1()) = ubound(IDs2()) + bOK = bOK AND ubound(IDs1()) = 15 + if (bOK) then + for n = lBound(IDs1()) to lBound(IDs2()) + bOK = bOK AND IDs1(n) = IDs2(n) + Next n + end if + + if (NOT bOK) then + Out.Log("Returned IDs are NOT identical!") + end if + Test.MethodTested("getImplementationId()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/lang/XTypeProvider/script.xlb b/qadevOOo/tests/basic/ifc/lang/XTypeProvider/script.xlb new file mode 100644 index 000000000000..ef09fbba13a2 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/lang/XTypeProvider/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="lang_XTypeProvider" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="lang_XTypeProvider"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/linguistic2/LinguProperties/linguistic2_LinguProperties.xba b/qadevOOo/tests/basic/ifc/linguistic2/LinguProperties/linguistic2_LinguProperties.xba new file mode 100644 index 000000000000..c0de8cb85a49 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/linguistic2/LinguProperties/linguistic2_LinguProperties.xba @@ -0,0 +1,92 @@ +<?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="linguistic2_LinguProperties" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.linguistic2.LinguProperties +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + PropertyTester.TestProperty("IsGermanPreReform") + + PropertyTester.TestProperty("IsUseDictionaryList") + + PropertyTester.TestProperty("IsIgnoreControlCharacters") + + PropertyTester.TestProperty("IsSpellUpperCase") + + PropertyTester.TestProperty("IsSpellWithDigits") + + PropertyTester.TestProperty("IsSpellCapitalization") + + PropertyTester.TestProperty("HyphMinLeading") + + PropertyTester.TestProperty("HyphMinTrailing") + + PropertyTester.TestProperty("HyphMinWordLength") + + PropertyTester.TestProperty("DefaultLocale") + + PropertyTester.TestProperty("IsHyphAuto") + + PropertyTester.TestProperty("IsHyphSpecial") + + PropertyTester.TestProperty("IsSpellAuto") + + PropertyTester.TestProperty("IsSpellHide") + + PropertyTester.TestProperty("IsSpellInAllLanguages") + + PropertyTester.TestProperty("IsSpellSpecial") + + PropertyTester.TestProperty("IsWrapReverse") + + PropertyTester.TestProperty("DefaultLocale_CJK") + + PropertyTester.TestProperty("DefaultLocale_CTL") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/linguistic2/LinguProperties/script.xlb b/qadevOOo/tests/basic/ifc/linguistic2/LinguProperties/script.xlb new file mode 100644 index 000000000000..a16e649510ad --- /dev/null +++ b/qadevOOo/tests/basic/ifc/linguistic2/LinguProperties/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="linguistic2_LinguProperties" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="linguistic2_LinguProperties"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/linguistic2/XDictionaryList/linguistic2_XDictionaryList.xba b/qadevOOo/tests/basic/ifc/linguistic2/XDictionaryList/linguistic2_XDictionaryList.xba new file mode 100644 index 000000000000..41c5f4c9509a --- /dev/null +++ b/qadevOOo/tests/basic/ifc/linguistic2/XDictionaryList/linguistic2_XDictionaryList.xba @@ -0,0 +1,191 @@ +<?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="linguistic2_XDictionaryList" 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 + +Dim bCB1 As Long, bCB2 As Long + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.linguistic2.XDictionaryList +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Dim vGetDics As Variant + Dim oNegative As Object + Dim vLocale As new com.sun.star.lang.Locale + Dim nPrevious As Integer + Dim oAddDic As Object + Dim oNewDic As Object + Dim oListenDic1 As Object + Dim oListenDic As Object + Dim oListener1 As Object + Dim oListener2 As Object + + oListener1 = createUNOListener("CB1_", "com.sun.star.linguistic2.XDictionaryListEventListener") + oListener2 = createUNOListener("CB2_", "com.sun.star.linguistic2.XDictionaryListEventListener") + bCB1 = 0 + bCB2 = 0 + vLocale.Language = "en" + vLocale.Country = "US" + vLocale.Variant = "WIN" + + Test.StartMethod("getCount()") + bOK = true + Out.Log("getCouint retunrs " + oObj.getCount()) + bOK = bOK AND (oObj.getCount() > 0) + Test.MethodTested("getCount()", bOK) + + Test.StartMethod("getDictionaries()") + bOK = true + vGetDics = oObj.getDictionaries() + Out.Log("oObj.getDictionaries returned " + (uBound(vGetDics) + 1) + " elements") + bOK = bOK AND ((uBound(vGetDics) + 1) = oObj.getCount()) + Test.MethodTested("getDictionaries()", bOK) + + Test.StartMethod("getDictionaryByName()") + bOK = true + Out.Log("Try to get 'NegativDic' which should created in ObjCreation()" + oNegative = oObj.getDictionaryByName("NegativDic") + bOK = bOK AND hasUnoInterfaces(oNegative, "com.sun.star.linguistic2.XDictionary") + Test.MethodTested("getDictionaryByName()", bOK) + + Test.StartMethod("createDictionary()") + bOK = true + oAddDic = oObj.createDictionary("AddedDicBasic", vLocale,_ + com.sun.star.linguistic2.DictionaryType.POSITIVE,"") + bOK = bOK AND hasUnoInterfaces(oAddDic, "com.sun.star.linguistic2.XDictionary") + Test.MethodTested("createDictionary()", bOK) + + Test.StartMethod("addDictionary()") + bOK = true + nPrevious = oObj.getCount() + oObj.addDictionary(oAddDic) + Out.Log("Dictionaries before: " + nPrevious + ", after: " + oObj.getCount()) + bOK = bOK AND ((nPrevious + 1) = oObj.getCount()) + Test.MethodTested("addDictionary()", bOK) + + Test.StartMethod("removeDictionary()") + bOK = true + oObj.removeDictionary(oAddDic) + bOK = bOK AND (nPrevious = oObj.getCount()) + Test.MethodTested("removeDictionary()", bOK) + + Test.StartMethod("addDictionaryListEventListener()") + Dim bListOK As Boolean + + bOK = true + bCB1 = false + bCB2 = false + oListenDic = oObj.createDictionary("ListenDicBasic", vLocale,_ + com.sun.star.linguistic2.DictionaryType.POSITIVE,"") + bListOK = oObj.addDictionaryListEventListener(oListener1, false) + Out.Log("First listener was added: " + bListOK) + bListOK = oObj.addDictionaryListEventListener(oListener2, false) + Out.Log("Second listener was added: " + bListOK) + + Test.StartMethod("flushEvents()") + + Out.Log("The level of buffer returned by flushEvents() is " + oObj.flushEvents()) + + oObj.addDictionary(oListenDic) + oListenDic.setActive(true) +' oListenDic.add("AWord", false, "") + + Out.Log("The level of buffer returned by flushEvents() is " + oObj.flushEvents()) + + bOK = bOK AND bCB1 AND bCB2 + oObj.removeDictionary(oListenDic) + + Test.MethodTested("addDictionaryListEventListener()", bOK) + Test.MethodTested("flushEvents()", bOK) + + Test.StartMethod("removeDictionaryListEventListener()") + bOK = true + bCB1 = 0 + bCB2 = 0 + oObj.removeDictionaryListEventListener(oListener2) + oListenDic1 = oObj.createDictionary("ListenDicBasic1", vLocale,_ + com.sun.star.linguistic2.DictionaryType.POSITIVE,"") + oObj.flushEvents() + oObj.addDictionary(oListenDic) + oListenDic.setActive(true) + oObj.flushEvents() + oObj.removeDictionary(oListenDic) + bOK = bOK AND bCB1 AND NOT bCB2 + Test.MethodTested("removeDictionaryListEventListener()", bOK) + + Test.StartMethod("beginCollectEvents()") + bOK = true + Dim bufSize1 As Integer, bufSize2 As Integer + + bufSize1 = oObj.beginCollectEvents() + bufSize2 = oObj.beginCollectEvents() + + bOK = bOK AND (bufSize2 = bufSize1 + 1) + Test.MethodTested("beginCollectEvents()", bOK) + + Test.StartMethod("endCollectEvents()") + bufSize1 = oObj.endCollectEvents() + + bOK = bOK AND (bufSize2 = bufSize1 + 1) + Test.MethodTested("endCollectEvents()", bOK) + + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +Sub CB1_processDictionaryListEvent + Out.Log("CallBack for Listener1 was called.") + bCB1 = bCB1 + 1 +End Sub +Sub CB1_disposing +End Sub + +Sub CB2_processDictionaryListEvent + Out.Log("CallBack for Listener2 was called.") + bCB2 = bCB2 + 1 +End Sub +Sub CB2_disposing +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/linguistic2/XDictionaryList/script.xlb b/qadevOOo/tests/basic/ifc/linguistic2/XDictionaryList/script.xlb new file mode 100644 index 000000000000..8f31954d31d9 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/linguistic2/XDictionaryList/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="linguistic2_XDictionaryList" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="linguistic2_XDictionaryList"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/linguistic2/XHyphenator/linguistic2_XHyphenator.xba b/qadevOOo/tests/basic/ifc/linguistic2/XHyphenator/linguistic2_XHyphenator.xba new file mode 100644 index 000000000000..356b2e9b8c6a --- /dev/null +++ b/qadevOOo/tests/basic/ifc/linguistic2/XHyphenator/linguistic2_XHyphenator.xba @@ -0,0 +1,85 @@ +<?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="linguistic2_XHyphenator" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.linguistic2.XHyphenator +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Dim vProp As new com.sun.star.beans.PropertyValue + Dim vPops(0) As Variant + Dim vLocale As new com.sun.star.lang.Locale + Dim oHyphenate As Object + Dim oAlternative As Object + Dim oPossible As Object + + vProps(0) = vProp + + vLocale.Language = "de" + vLocale.Country = "DE" + vLocale.Variant = "" + + + Test.StartMethod("hyphenate()") + bOK = true + oHyphenate = oObj.hyphenate("wacker", vLocale, 3, vProps()) + bOK = bOK AND hasUnoInterfaces(oHyphenate, "com.sun.star.linguistic2.XHyphenatedWord") + Test.MethodTested("hyphenate()", bOK) + + Test.StartMethod("queryAlternativeSpelling()") + bOK = true + oAlternative = oObj.queryAlternativeSpelling("wacker", vLocale, 2, vProps()) + bOK = bOK AND hasUnoInterfaces(oHyphenate, "com.sun.star.linguistic2.XHyphenatedWord") + Test.MethodTested("queryAlternativeSpelling()", bOK) + + Test.StartMethod("createPossibleHyphens()") + bOK = true + oPossible = oObj.createPossibleHyphens("wacker", vLocale, vProps()) + bOK = bOK AND hasUnoInterfaces(oPossible, "com.sun.star.linguistic2.XPossibleHyphens") + Test.MethodTested("createPossibleHyphens()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/linguistic2/XHyphenator/script.xlb b/qadevOOo/tests/basic/ifc/linguistic2/XHyphenator/script.xlb new file mode 100644 index 000000000000..71eda6f3347e --- /dev/null +++ b/qadevOOo/tests/basic/ifc/linguistic2/XHyphenator/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="linguistic2_XHyphenator" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="linguistic2_XHyphenator"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/linguistic2/XLinguServiceEventBroadcaster/linguistic2_XLinguServiceEventBroadcaster.xba b/qadevOOo/tests/basic/ifc/linguistic2/XLinguServiceEventBroadcaster/linguistic2_XLinguServiceEventBroadcaster.xba new file mode 100644 index 000000000000..46010b0a055d --- /dev/null +++ b/qadevOOo/tests/basic/ifc/linguistic2/XLinguServiceEventBroadcaster/linguistic2_XLinguServiceEventBroadcaster.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="linguistic2_XLinguServiceEventBroadcaster" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.linguistic2.XLinguServiceEventBroadcaster +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Out.Log("create two listeners") + oListener1 = createUNOListener("CB1_", "com.sun.star.linguistic2.XLinguServiceEventListener") + oListener2 = createUNOListener("CB2_", "com.sun.star.linguistic2.XLinguServiceEventListener") + + Test.StartMethod("addLinguServiceEventListener()") + bOK = true + bOK = bOK AND oObj.addLinguServiceEventListener(oListener1) + bOK = bOK AND oObj.addLinguServiceEventListener(oListener2) + Test.MethodTested("addLinguServiceEventListener()", bOK) + + Test.StartMethod("removeLinguServiceEventListener()") + bOK = true + bOK = bOK AND oObj.removeLinguServiceEventListener(oListener2) + Test.MethodTested("removeLinguServiceEventListener()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +Sub CB1_processLinguServiceEvent + Out.Log("CallBack for Listener1 processLinguServiceEvent was called.") + bCB1 = true +End Sub + +Sub CB2_processLinguServiceEvent + Out.Log("CallBack for Listener2 processLinguServiceEvent was called.") + bCB2 = true +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/linguistic2/XLinguServiceEventBroadcaster/script.xlb b/qadevOOo/tests/basic/ifc/linguistic2/XLinguServiceEventBroadcaster/script.xlb new file mode 100644 index 000000000000..8b50d4cd343c --- /dev/null +++ b/qadevOOo/tests/basic/ifc/linguistic2/XLinguServiceEventBroadcaster/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="linguistic2_XLinguServiceEventBroadcaster" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="linguistic2_XLinguServiceEventBroadcaster"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/linguistic2/XLinguServiceManager/linguistic2_XLinguServiceManager.xba b/qadevOOo/tests/basic/ifc/linguistic2/XLinguServiceManager/linguistic2_XLinguServiceManager.xba new file mode 100644 index 000000000000..c83c9c54fbf3 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/linguistic2/XLinguServiceManager/linguistic2_XLinguServiceManager.xba @@ -0,0 +1,138 @@ +<?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="linguistic2_XLinguServiceManager" 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. +' +'************************************************************************* +'************************************************************************* + + + + +Dim nCB1Val As Long, nCB2Val As Long + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.linguistic2.XLinguServiceManager +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Dim oListener1 As Object + Dim oListener2 As Object + Dim vLocale As new com.sun.star.lang.Locale + Dim aServices As Variant + Dim vGetServices As Variant + + vLocale.Language = "en" + vLocale.Country = "US" + vLocale.Variant = "" + + oListener1 = createUNOListener("CB1_", "com.sun.star.linguistic2.XLinguServiceEventListener") + oListener2 = createUNOListener("CB2_", "com.sun.star.linguistic2.XLinguServiceEventListener") + nCB1Val = 0 + nCB2Val = 0 + + Test.StartMethod("getSpellChecker()") + bOK = true + bOK = bOK AND hasUnoInterfaces(oObj.getSpellChecker(), "com.sun.star.linguistic2.XSpellChecker") + Test.MethodTested("getSpellChecker()", bOK) + + Test.StartMethod("getHyphenator()") + bOK = true + bOK = bOK AND hasUnoInterfaces(oObj.getHyphenator(), "com.sun.star.linguistic2.XHyphenator") + Test.MethodTested("getHyphenator()", bOK) + + Test.StartMethod("getThesaurus()") + bOK = true + bOK = bOK AND hasUnoInterfaces(oObj.getThesaurus(), "com.sun.star.linguistic2.XThesaurus") + Test.MethodTested("getThesaurus()", bOK) + + Test.StartMethod("addLinguServiceManagerListener()") + bOK = true + bOK = bOK AND oObj.addLinguServiceManagerListener(oListener1) + bOK = bOK AND oObj.addLinguServiceManagerListener(oListener2) + Out.Log("oListener1 and oListener2 added => " + bOK ) + Test.MethodTested("addLinguServiceManagerListener()", bOK) + + Test.StartMethod("removeLinguServiceManagerListener()") + bOK = true + bOK = bOK AND oObj.removeLinguServiceManagerListener(oListener2) + Out.Log("oListener2 removed => " +bOK) + Test.MethodTested("removeLinguServiceManagerListener()", bOK) + + Test.StartMethod("getAvailableServices()") + bOK = true + aServices = oObj.getAvailableServices("com.sun.star.linguistic2.Thesaurus", vLocale) + bOK = bOK AND (uBound(aServices()) > -1) + Test.MethodTested("getAvailableServices()", bOK) + + Test.StartMethod("getConfiguredServices()") + bOK = true + vGetServices = oObj.getConfiguredServices("com.sun.star.linguistic2.Thesaurus", vLocale) + bOK = bOK AND (uBound(vGetServices()) > -1) + Test.MethodTested("getConfiguredServices()", bOK) + + Test.StartMethod("setConfiguredServices()") + Dim vSetServices(0) As String + Dim vSetGetServices As Variant + bOK = true + oObj.setConfiguredServices("com.sun.star.linguistic2.Hyphenator", vLocale, vSetServices()) + vSetGetServices = oObj.getConfiguredServices("com.sun.star.linguistic2.Hyphenator", vLocale) + bOK = bOK AND (uBound(vSetGetServices()) = -1) + oObj.setConfiguredServices("com.sun.star.linguistic2.Hyphenator", vLocale, vGetServices()) + Test.MethodTested("setConfiguredServices()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +Sub CB1_processLinguServiceEvent + Out.Log("CallBack for Listener1 processLinguServiceEvent was called.") + nCB1Val = nCB1Val + 1 +End Sub + +Sub CB2_processLinguServiceEvent + Out.Log("CallBack for Listener2 processLinguServiceEvent was called.") + nCB2Val = nCB2Val + 1 +End Sub +Sub CB1_ + Out.Log("CallBack for Listener1 disposing was called.") + nCB1Val = nCB1Val + 1 +End Sub + +Sub CB2_disposing + Out.Log("CallBack for Listener2 disposing was called.") + nCB2Val = nCB2Val + 1 +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/linguistic2/XLinguServiceManager/script.xlb b/qadevOOo/tests/basic/ifc/linguistic2/XLinguServiceManager/script.xlb new file mode 100644 index 000000000000..3584b2494b87 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/linguistic2/XLinguServiceManager/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="linguistic2_XLinguServiceManager" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="linguistic2_XLinguServiceManager"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/linguistic2/XSearchableDictionaryList/linguistic2_XSearchableDictionaryList.xba b/qadevOOo/tests/basic/ifc/linguistic2/XSearchableDictionaryList/linguistic2_XSearchableDictionaryList.xba new file mode 100644 index 000000000000..7ad9eb041457 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/linguistic2/XSearchableDictionaryList/linguistic2_XSearchableDictionaryList.xba @@ -0,0 +1,67 @@ +<?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="linguistic2_XSearchableDictionaryList" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.linguistic2.XSearchableDictionaryList +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Dim vLocale As new com.sun.star.lang.Locale + + vLocale.Language = "en" + vLocale.Country = "US" + vLocale.Variant = "WIN" + + Test.StartMethod("queryDictionaryEntry()") + bOK = true + bOK = bOK AND hasUnoInterfaces(oObj.queryDictionaryEntry("Negative", vLocale, false, false),_ + "com.sun.star.linguistic2.XDictionaryEntry") + bOK = bOK AND hasUnoInterfaces(oObj.queryDictionaryEntry("Positive", vLocale, true, true),_ + "com.sun.star.linguistic2.XDictionaryEntry") + Test.MethodTested("queryDictionaryEntry()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/linguistic2/XSearchableDictionaryList/script.xlb b/qadevOOo/tests/basic/ifc/linguistic2/XSearchableDictionaryList/script.xlb new file mode 100644 index 000000000000..782bf1beef0d --- /dev/null +++ b/qadevOOo/tests/basic/ifc/linguistic2/XSearchableDictionaryList/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="linguistic2_XSearchableDictionaryList" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="linguistic2_XSearchableDictionaryList"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/linguistic2/XSpellChecker/linguistic2_XSpellChecker.xba b/qadevOOo/tests/basic/ifc/linguistic2/XSpellChecker/linguistic2_XSpellChecker.xba new file mode 100644 index 000000000000..cb208d107450 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/linguistic2/XSpellChecker/linguistic2_XSpellChecker.xba @@ -0,0 +1,78 @@ +<?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="linguistic2_XSpellChecker" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.linguistic2.XSpellChecker +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Dim vLocale As new com.sun.star.lang.Locale + Dim Prop As new com.sun.star.beans.PropertyValue + Dim Props(0 to 0) As Variant + + Props(0) = Prop + + vLocale.Language = "en" + vLocale.Country = "US" + + + Test.StartMethod("isValid()") + bOK = true + bOK = bOK AND oObj.isValid("Sun", vLocale, Props()) + bOK = bOK AND NOT oObj.isValid("Summersun", vLocale, Props()) + Test.MethodTested("isValid()", bOK) + + Dim vAlt As Variant + Dim cAlternative As Variant + Test.StartMethod("spell()") + bOK = true + vAlt = oObj.spell("Summersun", vLocale, Props()) + cAlternative = vAlt.getAlternatives() + bOK = bOK AND (cAlternative(0) <> "") + Test.MethodTested("spell()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/linguistic2/XSpellChecker/script.xlb b/qadevOOo/tests/basic/ifc/linguistic2/XSpellChecker/script.xlb new file mode 100644 index 000000000000..530343cb3c4e --- /dev/null +++ b/qadevOOo/tests/basic/ifc/linguistic2/XSpellChecker/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="linguistic2_XSpellChecker" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="linguistic2_XSpellChecker"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/linguistic2/XSupportedLocales/linguistic2_XSupportedLocales.xba b/qadevOOo/tests/basic/ifc/linguistic2/XSupportedLocales/linguistic2_XSupportedLocales.xba new file mode 100644 index 000000000000..6127924df421 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/linguistic2/XSupportedLocales/linguistic2_XSupportedLocales.xba @@ -0,0 +1,78 @@ +<?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="linguistic2_XSupportedLocales" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.linguistic2.XSupportedLocales +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Dim vLocales As Variant + + Test.StartMethod("getLocales()") + bOK = true + vLocales = oObj.getLocales() + bOK = bOK AND (uBound(vLocales()) > 0) + Test.MethodTested("getLocales()", bOK) + + Test.StartMethod("hasLocale()") + bOK = true + Out.Log("first check all available locales") + for i=0 to uBound(vLocales()) + bOK = bOK AND oObj.hasLocale(vLocales(i)) + next i + Out.Log("all available locales result: " + bOK) + + Out.Log(" now create a invalid locale") + Dim vLocale As new com.sun.star.lang.Locale + vLocale.Language = "myLanguage" + vLocale.Country = "myCountry" + vLocale.Variant = "dummy" + bOK = bOK AND Not oObj.hasLocale(vLocale) + + Test.MethodTested("hasLocale()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/linguistic2/XSupportedLocales/script.xlb b/qadevOOo/tests/basic/ifc/linguistic2/XSupportedLocales/script.xlb new file mode 100644 index 000000000000..904ac803b61a --- /dev/null +++ b/qadevOOo/tests/basic/ifc/linguistic2/XSupportedLocales/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="linguistic2_XSupportedLocales" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="linguistic2_XSupportedLocales"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/linguistic2/XThesaurus/linguistic2_XThesaurus.xba b/qadevOOo/tests/basic/ifc/linguistic2/XThesaurus/linguistic2_XThesaurus.xba new file mode 100644 index 000000000000..4919533c477b --- /dev/null +++ b/qadevOOo/tests/basic/ifc/linguistic2/XThesaurus/linguistic2_XThesaurus.xba @@ -0,0 +1,69 @@ +<?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="linguistic2_XThesaurus" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.linguistic2.XThesaurus +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Dim cMeanings As Variant + Dim vProp As new com.sun.star.beans.PropertyValue + Dim vPops(0) As Variant + Dim vLocale As new com.sun.star.lang.Locale + + vProps(0) = vProp + vLocale.Language = "en" + vLocale.Country = "US" + vLocale.Variant = "" + + Test.StartMethod("queryMeanings()") + bOK = true + XMeanings = oObj.queryMeanings("joke", vLocale, vProps()) + bOK = bOK AND hasUnoInterfaces(XMeanings(0), "com.sun.star.linguistic2.XMeaning") + Test.MethodTested("queryMeanings()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/linguistic2/XThesaurus/script.xlb b/qadevOOo/tests/basic/ifc/linguistic2/XThesaurus/script.xlb new file mode 100644 index 000000000000..3caf514a4c66 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/linguistic2/XThesaurus/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="linguistic2_XThesaurus" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="linguistic2_XThesaurus"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/loader/XImplementationLoader/loader_XImplementationLoader.xba b/qadevOOo/tests/basic/ifc/loader/XImplementationLoader/loader_XImplementationLoader.xba new file mode 100644 index 000000000000..2be27a887c2b --- /dev/null +++ b/qadevOOo/tests/basic/ifc/loader/XImplementationLoader/loader_XImplementationLoader.xba @@ -0,0 +1,94 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="loader_XImplementationLoader" 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 + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' Global cImpLoader As String +' Global cImpURL As String +' Global cImpName As String + +'************************************************************************* + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.loader.XImplementationLoader +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim bRes As Boolean + Dim xIfc As Object + Dim xReg As Object + Dim regKey As Object + + xReg = createUNOService("com.sun.star.registry.SimpleRegistry") + xReg.Open(utils.getTempFileURL("XImpLoader.reg"), false, true) + regKey = xReg.getRootKey + + Test.StartMethod("writeRegistryInfo()") + bOK = true + bRes = oObj.writeRegistryInfo(regKey, cImpLoader, cImpURL) + Out.Log("writeRegistryInfo() returned " & bRes) + bOK = bOK AND bRes + Test.MethodTested("writeRegistryInfo()", bOK) + + Test.StartMethod("activate()") + bOK = true + Out.Log("Activating implementation for " + cImpName) + xIfc = oObj.activate(cImpName, cImpLoader, cImpURL, regKey) + Out.Log("Returned object supports XServiceInfo : " + _ + hasUnoInterfaces(xIfc, "com.sun.star.lang.XServiceInfo")) + Out.Log("Returned object's implementation name is " + xIfc.getImplementationName()) + + bOK = bOK AND xIfc.getImplementationName() = cImpName + Test.MethodTested("activate()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/loader/XImplementationLoader/script.xlb b/qadevOOo/tests/basic/ifc/loader/XImplementationLoader/script.xlb new file mode 100644 index 000000000000..327a1f78b6e7 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/loader/XImplementationLoader/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="loader_XImplementationLoader" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="loader_XImplementationLoader"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/presentation/OutlineView/presentation_OutlineView.xba b/qadevOOo/tests/basic/ifc/presentation/OutlineView/presentation_OutlineView.xba new file mode 100644 index 000000000000..f0b5382ecbd5 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/presentation/OutlineView/presentation_OutlineView.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="presentation_OutlineView" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.presentation.OutlineView +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + bOK = True + + PropertyTester.TestProperty("VisibleArea") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/presentation/OutlineView/script.xlb b/qadevOOo/tests/basic/ifc/presentation/OutlineView/script.xlb new file mode 100644 index 000000000000..433038dafcef --- /dev/null +++ b/qadevOOo/tests/basic/ifc/presentation/OutlineView/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="presentation_OutlineView" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="presentation_OutlineView"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/presentation/Presentation/presentation_Presentation.xba b/qadevOOo/tests/basic/ifc/presentation/Presentation/presentation_Presentation.xba new file mode 100644 index 000000000000..2cb4950e4f0e --- /dev/null +++ b/qadevOOo/tests/basic/ifc/presentation/Presentation/presentation_Presentation.xba @@ -0,0 +1,85 @@ +<?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="presentation_Presentation" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.presentation.Presentation +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + PropertyTester.TestProperty("AllowAnimations") + + Dim aShows(1) As String + aShows(0) = "FirstPresentation" + aShows(1) = "SecondPresentation" + PropertyTester.TestProperty("CustomShow", aShows()) + + PropertyTester.TestProperty("FirstPage") + + PropertyTester.TestProperty("IsAlwaysOnTop") + + PropertyTester.TestProperty("IsAutomatic") + + PropertyTester.TestProperty("IsEndless") + + PropertyTester.TestProperty("IsFullScreen") + + ' This property can be changed ONLY during presentation is running. + ' So, starting the presentation + oObj.start() + PropertyTester.TestProperty("IsLivePresentation") + oObj.end() + + PropertyTester.TestProperty("IsMouseVisible") + + PropertyTester.TestProperty("Pause") + + PropertyTester.TestProperty("StartWithNavigator") + + PropertyTester.TestProperty("UsePen") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/presentation/Presentation/script.xlb b/qadevOOo/tests/basic/ifc/presentation/Presentation/script.xlb new file mode 100644 index 000000000000..bd617066a402 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/presentation/Presentation/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="presentation_Presentation" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="presentation_Presentation"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/presentation/PresentationView/presentation_PresentationView.xba b/qadevOOo/tests/basic/ifc/presentation/PresentationView/presentation_PresentationView.xba new file mode 100644 index 000000000000..24f706db0e97 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/presentation/PresentationView/presentation_PresentationView.xba @@ -0,0 +1,61 @@ +<?xml version="1.0" encoding="UTF-8"?> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="presentation_PresentationView" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.presentation.PresentationView +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + +' + PropertyTester.TestProperty("CurrentPage") + + PropertyTester.TestProperty("VisibleArea") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/presentation/PresentationView/script.xlb b/qadevOOo/tests/basic/ifc/presentation/PresentationView/script.xlb new file mode 100644 index 000000000000..936a2ba9ceb3 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/presentation/PresentationView/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="presentation_PresentationView" library:readonly="false" library:passwordprotected="false"> + <library:element library:name="presentation_PresentationView"/> + </library:library> diff --git a/qadevOOo/tests/basic/ifc/presentation/PreviewView/presentation_PreviewView.xba b/qadevOOo/tests/basic/ifc/presentation/PreviewView/presentation_PreviewView.xba new file mode 100644 index 000000000000..9b060b548f34 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/presentation/PreviewView/presentation_PreviewView.xba @@ -0,0 +1,64 @@ +<?xml version="1.0" encoding="UTF-8"?> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="presentation_PreviewView" 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. +' +'************************************************************************* +'************************************************************************* + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' NONE + +'************************************************************************* + +' Be sure that all variables are dimensioned: +option explicit + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.presentation.PreviewView +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + +' + PropertyTester.TestProperty("CurrentPage") + + PropertyTester.TestProperty("VisibleArea") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/presentation/PreviewView/script.xlb b/qadevOOo/tests/basic/ifc/presentation/PreviewView/script.xlb new file mode 100644 index 000000000000..ecfdd26cb45c --- /dev/null +++ b/qadevOOo/tests/basic/ifc/presentation/PreviewView/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="presentation_PreviewView" library:readonly="false" library:passwordprotected="false"> + <library:element library:name="presentation_PreviewView"/> + </library:library> diff --git a/qadevOOo/tests/basic/ifc/presentation/XCustomPresentationSupplier/presentation_XCustomPresentationSupplier.xba b/qadevOOo/tests/basic/ifc/presentation/XCustomPresentationSupplier/presentation_XCustomPresentationSupplier.xba new file mode 100644 index 000000000000..3f999c6caef8 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/presentation/XCustomPresentationSupplier/presentation_XCustomPresentationSupplier.xba @@ -0,0 +1,62 @@ +<?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="presentation_XCustomPresentationSupplier" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.presentation.XCustomPresentationSupplier +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim oCustPres As Object + + Test.StartMethod("getCustomPresentations()") + bOK = true + oCustPres = oObj.getCustomPresentations() + bOK = bOK AND NOT isNull(oCustPres) + bOK = bOK AND hasUnoInterfaces(oCustPres, "com.sun.star.container.XNameContainer") + Test.MethodTested("getCustomPresentations()", bOK) + + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/presentation/XCustomPresentationSupplier/script.xlb b/qadevOOo/tests/basic/ifc/presentation/XCustomPresentationSupplier/script.xlb new file mode 100644 index 000000000000..a47543309bc2 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/presentation/XCustomPresentationSupplier/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="presentation_XCustomPresentationSupplier" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="presentation_XCustomPresentationSupplier"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/presentation/XPresentation/presentation_XPresentation.xba b/qadevOOo/tests/basic/ifc/presentation/XPresentation/presentation_XPresentation.xba new file mode 100644 index 000000000000..8b31c1dda6dd --- /dev/null +++ b/qadevOOo/tests/basic/ifc/presentation/XPresentation/presentation_XPresentation.xba @@ -0,0 +1,68 @@ +<?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="presentation_XPresentation" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.presentation.XPresentation +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Test.StartMethod("start()") + bOK = true + oObj.start() + Test.MethodTested("start()", bOK) + + Test.StartMethod("rehearseTimings()") + bOK = true + oObj.rehearseTimings() + Test.MethodTested("rehearseTimings()", bOK) + + Test.StartMethod("end()") + bOK = true + oObj.end() + Test.MethodTested("end()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/presentation/XPresentation/script.xlb b/qadevOOo/tests/basic/ifc/presentation/XPresentation/script.xlb new file mode 100644 index 000000000000..1983239dd174 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/presentation/XPresentation/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="presentation_XPresentation" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="presentation_XPresentation"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/presentation/XPresentationSupplier/presentation_XPresentationSupplier.xba b/qadevOOo/tests/basic/ifc/presentation/XPresentationSupplier/presentation_XPresentationSupplier.xba new file mode 100644 index 000000000000..d5902e2375e9 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/presentation/XPresentationSupplier/presentation_XPresentationSupplier.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="presentation_XPresentationSupplier" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.presentation.XPresentationSupplier +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim oPresentation As Object + + Test.StartMethod("getPresentation()") + bOK = true + oPresentation = oObj.getPresentation() + bOK = bOK AND NOT isNull(oPresentation) + bOK = bOK AND hasUnoInterfaces(oPresentation, "com.sun.star.presentation.XPresentation") + Test.MethodTested("getPresentation()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/presentation/XPresentationSupplier/script.xlb b/qadevOOo/tests/basic/ifc/presentation/XPresentationSupplier/script.xlb new file mode 100644 index 000000000000..c118d9ff34d4 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/presentation/XPresentationSupplier/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="presentation_XPresentationSupplier" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="presentation_XPresentationSupplier"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/reflection/XIdlReflection/reflection_XIdlReflection.xba b/qadevOOo/tests/basic/ifc/reflection/XIdlReflection/reflection_XIdlReflection.xba new file mode 100644 index 000000000000..65335dd20403 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/reflection/XIdlReflection/reflection_XIdlReflection.xba @@ -0,0 +1,68 @@ +<?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="reflection_XIdlReflection" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.reflection.XIdlReflection +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim oIdlClass As Object + Dim oIdlClassType As Object + + Test.StartMethod("forName()") + bOK = true + oIdlClass = oObj.forName("com.sun.star.drawing.LineStyle") + bOK = bOK AND oIdlClass.Name = "com.sun.star.drawing.LineStyle" + Test.MethodTested("forName()", bOK) + + Test.StartMethod("getType()") + bOK = true + oIdlClassType = oObj.getType(oIdlClass) + bOK = bOK AND hasUnoInterfaces(oIdlClass, "com.sun.star.reflection.XIdlClass") + bOK = bOK AND oIdlClassType.Name = "com.sun.star.reflection.XIdlClass" + Test.MethodTested("getType()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/reflection/XIdlReflection/script.xlb b/qadevOOo/tests/basic/ifc/reflection/XIdlReflection/script.xlb new file mode 100644 index 000000000000..7d0e642cb4e7 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/reflection/XIdlReflection/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="reflection_XIdlReflection" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="reflection_XIdlReflection"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/reflection/XProxyFactory/reflection_XProxyFactory.xba b/qadevOOo/tests/basic/ifc/reflection/XProxyFactory/reflection_XProxyFactory.xba new file mode 100644 index 000000000000..b7a26af0e045 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/reflection/XProxyFactory/reflection_XProxyFactory.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="reflection_XProxyFactory" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.reflection.XProxyFactory +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + Test.StartMethod("createProxy()") + bOK = true + bOK = bOK AND hasUnoInterfaces(oObj.createProxy(StarDesktop), "com.sun.star.uno.XAggregation") + Test.MethodTested("createProxy()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/reflection/XProxyFactory/script.xlb b/qadevOOo/tests/basic/ifc/reflection/XProxyFactory/script.xlb new file mode 100644 index 000000000000..3784677d8aaa --- /dev/null +++ b/qadevOOo/tests/basic/ifc/reflection/XProxyFactory/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="reflection_XProxyFactory" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="reflection_XProxyFactory"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/registry/XImplementationRegistration/registry_XImplementationRegistration.xba b/qadevOOo/tests/basic/ifc/registry/XImplementationRegistration/registry_XImplementationRegistration.xba new file mode 100644 index 000000000000..2915d317d47a --- /dev/null +++ b/qadevOOo/tests/basic/ifc/registry/XImplementationRegistration/registry_XImplementationRegistration.xba @@ -0,0 +1,168 @@ +<?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="registry_XImplementationRegistration" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.registry.XImplementationRegistration +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim aImplementationLoader As String + Dim aImplementations As Variant + Dim aMissingServices As Variant + Dim aLocation As String + Dim i As Integer + Dim k As Integer + Dim xReg As Object + Dim regKey As Object + Dim keyNames As Variant + Dim bNeedTest As Boolean + + xReg = createUNOService("com.sun.star.registry.SimpleRegistry") + xReg.Open(utils.Path2URL(cTestDocsDir & "XImpReg.reg"), false, true) + aImplementationLoader = "com.sun.star.loader.Java2" + aLocation = utils.Path2URL(cTestDocsDir & "qadevlibs/MyPersistObjectImpl.jar") + + Test.StartMethod("getImplementations()") + bOK = true + aImplementations = oObj.getImplementations(aImplementationLoader, aLocation) + bOK = bOK AND i >= 0 + for i = 0 to ubound(aImplementations) + Out.Log "" & i + 1 & ") " & aImplementations(i) + next i + Test.MethodTested("getImplementations()", bOK) + + Test.StartMethod("registerImplementation()") + Out.Log("Registering implementation from " & aLocation) + bOK = true + oObj.registerImplementation(aImplementationLoader, aLocation, xReg) + + bOK = bOK AND xReg.isValid() + + regKey = xReg.getRootKey.openKey("IMPLEMENTATIONS") + keyNames = regKey.getKeyNames() + Out.Log("In registry found " & ubound(keyNames) + 1 & " implementations.") + Dim aFlags(ubound(aImplementations())) As Boolean + for i = 0 to ubound(aFlags()) + aFlags(i) = false + next i + + for i = 0 to ubound(keyNames()) + Out.Log("Found key: " & keyNames(i)) + for k = 0 to ubound(aImplementations) + if (inStr(1, keyNames(i), aImplementations(k)) > 0 ) then + aFlags(k) = true + end if + next k + next i + + for i = 0 to ubound(aFlags()) + if (NOT aFlags(i)) then + Out.Log("Can't find information about " & aImplementations(i) & " in regestry") + bOK = false + end if + next i + + Test.MethodTested("registerImplementation()", bOK) + + Test.StartMethod("checkInstantiation()") + bOK = true + Out.Log("Looking for missing services to create " & aImplementations(0)) + aMissingServices = oObj.checkInstantiation(aImplementations(0)) + Out.Log("" & ubound(aMissingServices) + 1 & " missing services were found") + for i = 0 to ubound(aMissingServices) + Out.Log "" & i & ") " & aMissingServices(i) + next i + Test.MethodTested("checkInstantiation()", bOK) + + Test.StartMethod("revokeImplementation()") + bOK = true + bNeedTest = false + + oObj.revokeImplementation(aLocation, xReg) + + bOK = bOK AND xReg.isValid() + regKey = xReg.getRootKey + keyNames = regKey.getKeyNames() + for i = 0 to ubound(keyNames()) + if (inStr(1, keyNames(i), "IMPLEMENTATIONS") > 0) then + bNeedTest = true + end if + next i + if (NOT bNeedTest) then + Out.Log("No implementation was found.") + end if + + if (bOK AND bNeedTest) then + regKey = xReg.getRootKey.openKey("IMPLEMENTATIONS") + Out.Log("In registry found " & ubound(keyNames) + 1 & " implementations.") + + for i = 0 to ubound(aFlags()) + aFlags(i) = false + next i + + for i = 0 to ubound(keyNames()) + Out.Log("Found key: " & keyNames(i)) + for k = 0 to ubound(aImplementations) + if (inStr(1, keyNames(i), aImplementations(k)) > 0 ) then + aFlags(k) = true + end if + next k + next i + + for i = 0 to ubound(aFlags()) + if (aFlags(i)) then + Out.Log("Information about " & aImplementations(i) & " is still in regestry") + bOK = false + end if + next i + end if + Test.MethodTested("revokeImplementation()", bOK) + + xReg.Close() +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/registry/XImplementationRegistration/script.xlb b/qadevOOo/tests/basic/ifc/registry/XImplementationRegistration/script.xlb new file mode 100644 index 000000000000..ba6078351ce9 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/registry/XImplementationRegistration/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="registry_XImplementationRegistration" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="registry_XImplementationRegistration"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/registry/XSimpleRegistry/registry_XSimpleRegistry.xba b/qadevOOo/tests/basic/ifc/registry/XSimpleRegistry/registry_XSimpleRegistry.xba new file mode 100644 index 000000000000..fb9649252959 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/registry/XSimpleRegistry/registry_XSimpleRegistry.xba @@ -0,0 +1,132 @@ +<?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="registry_XSimpleRegistry" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.registry.XSimpleRegistry +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim cURL As String + Dim cTempURL As String + Dim oTempReg As Object + Dim oRoot As Object + Dim oKey As Object + Dim oKey2 As Object + + cURL = utils.getTempFileURL("BASReg.rdb", true) + + Test.StartMethod("open()") + bOK = true + if (cObjectName <> "defreg.NestedRegistry") then + oObj.open(cURL, false, true) + bOK = bOK AND FileExists(cURL) + end if + Test.MethodTested("open()", bOK) + + Test.StartMethod("isValid()") + bOK = true + bOK = bOK AND oObj.isValid() + Test.MethodTested("isValid()", bOK) + + Test.StartMethod("getRootKey()") + bOK = true + oKey = oObj.getRootKey() + bOK = bOK AND hasUnoInterfaces(oKey, "com.sun.star.registry.XRegistryKey") + Test.MethodTested("getRootKey()", bOK) + + Test.StartMethod("isReadOnly()") + bOK = true + bOK = bOK AND NOT oObj.isReadOnly() + Test.MethodTested("isReadOnly()", bOK) + + Test.StartMethod("mergeKey()") + bOK = true + + oKey.createKey("Key1").setStringValue("Value of Key1") + + cTempURL = utils.getTempFileURL("BASRegTemp.rdb", true) + oTempReg = createUnoService("com.sun.star.registry.SimpleRegistry") + oTempReg.open(cTempURL, false, true) + oKey2 = oTempReg.getRootKey() + oKey2.createKey("Key2").setStringValue("Value of Key2") + + oObj.mergeKey("/", cTempURL) + + oRoot = oObj.RootKey + oKey = oRoot.openKey("Key1") + bOK = bOK AND oKey.getStringValue = "Value of Key1" + oKey = oRoot.openKey("Key2") + bOK = bOK AND oKey.getStringValue = "Value of Key2" + oTempReg.close() + + Test.MethodTested("mergeKey()", bOK) + + Test.StartMethod("getURL()") + bOK = true + Out.Log("Returned URL is " & oObj.URL) + bOK = bOK AND inStr(1, oObj.URL, ".rdb") > 0 + Test.MethodTested("getURL()", bOK) + + Test.StartMethod("destroy()") + bOK = true + if (cObjectName <> "defreg.NestedRegistry") then + oObj.open(cURL, false, true) + oObj.destroy() + end if + Test.MethodTested("destroy()", bOK) + + Test.StartMethod("close()") + bOK = true + if (cObjectName <> "defreg.NestedRegistry") then + oObj.open(cURL, false, true) + oObj.close() + end if + Test.MethodTested("close()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/registry/XSimpleRegistry/script.xlb b/qadevOOo/tests/basic/ifc/registry/XSimpleRegistry/script.xlb new file mode 100644 index 000000000000..a4234ec9ee79 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/registry/XSimpleRegistry/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="registry_XSimpleRegistry" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="registry_XSimpleRegistry"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/script/XEventAttacherManager/script.xlb b/qadevOOo/tests/basic/ifc/script/XEventAttacherManager/script.xlb new file mode 100644 index 000000000000..915cdd0d4160 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/script/XEventAttacherManager/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="script_XEventAttacherManager" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="script_XEventAttacherManager"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/script/XEventAttacherManager/script_XEventAttacherManager.xba b/qadevOOo/tests/basic/ifc/script/XEventAttacherManager/script_XEventAttacherManager.xba new file mode 100644 index 000000000000..8aa6a798ccaf --- /dev/null +++ b/qadevOOo/tests/basic/ifc/script/XEventAttacherManager/script_XEventAttacherManager.xba @@ -0,0 +1,160 @@ +<?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="script_XEventAttacherManager" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.script.XEventAttacherManager +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + oObj.insertEntry(0) + + Test.StartMethod("addScriptListener()") + bOK = true + Dim oListener1 As Object + Dim oListener2 As Object + + oListener = createUnoListener("CB1_", "com.sun.star.script.XScriptListener") + + oObj.addScriptListener(oListener) + + Test.MethodTested("addScriptListener()", bOK) + + + Test.StartMethod("registerScriptEvent()") + bOK = true + + Dim aScriptEvent1 As New com.sun.star.script.ScriptEventDescriptor + aScriptEvent1.ListenerType = "ScriptListener" + aScriptEvent1.EventMethod = "Test" + aScriptEvent1.AddListenerParam = "" + aScriptEvent1.ScriptType = "Basic" + aScriptEvent1.ScriptCode = "MsgBox ""Script1""" + oObj.registerScriptEvent(0, aScriptEvent1) + + Test.MethodTested("registerScriptEvent()", bOK) + + Test.StartMethod("registerScriptEvents()") + bOK = true + Dim aScriptEvent2 As New com.sun.star.script.ScriptEventDescriptor + aScriptEvent2.ListenerType = "ScriptListener" + aScriptEvent2.EventMethod = "Test" + aScriptEvent2.AddListenerParam = "" + aScriptEvent2.ScriptType = "Basic" + aScriptEvent2.ScriptCode = "MsgBox ""Script2""" + Dim aScriptEvent3 As New com.sun.star.script.ScriptEventDescriptor + aScriptEvent3.ListenerType = "ScriptListener" + aScriptEvent3.EventMethod = "Test" + aScriptEvent3.AddListenerParam = "" + aScriptEvent3.ScriptType = "Basic" + aScriptEvent3.ScriptCode = "MsgBox ""Script3""" + + Dim aScripts(1) + aScripts(0) = aScriptEvent2 + aScripts(1) = aScriptEvent3 + + oObj.registerScriptEvents(0, aScripts()) + + Test.MethodTested("registerScriptEvents()", bOK) + + Test.StartMethod("getScriptEvents()") + bOK = true + allScripts = oObj.getScriptEvents(0) + bOK = bOK AND ubound(allScripts) = 2 + bOK = bOK AND allScripts(0).ScriptCode = "MsgBox ""Script1""" + bOK = bOK AND allScripts(1).ScriptCode = "MsgBox ""Script2""" + bOK = bOK AND allScripts(2).ScriptCode = "MsgBox ""Script3""" + Test.MethodTested("getScriptEvents()", bOK) + + Test.StartMethod("insertEntry()") + bOK = true + oObj.insertEntry(0) + allScripts = oObj.getScriptEvents(0) + bOK = bOK AND ubound(allScripts) = -1 + allScripts = oObj.getScriptEvents(1) + bOK = bOK AND ubound(allScripts) = 2 + Test.MethodTested("insertEntry()", bOK) + + Test.StartMethod("removeEntry()") + bOK = true + oObj.removeEntry(0) + allScripts = oObj.getScriptEvents(1) + bOK = bOK AND ubound(allScripts) = -1 + allScripts = oObj.getScriptEvents(0) + bOK = bOK AND ubound(allScripts) = 2 + Test.MethodTested("removeEntry()", bOK) + + Test.StartMethod("attach()") + bOK = true + oObj.attach(0, oObj, "") + Test.MethodTested("attach()", bOK) + + Test.StartMethod("detach()") + bOK = true + oObj.detach(0, oObj) + Test.MethodTested("detach()", bOK) + + + Test.StartMethod("revokeScriptEvent()") + bOK = true + oObj.revokeScriptEvent(0, "ScriptListener", "Test", "") + allScripts = oObj.getScriptEvents(0) + bOK = bOK AND ubound(allScripts) = 1 + Test.MethodTested("revokeScriptEvent()", bOK) + + Test.StartMethod("revokeScriptEvents()") + bOK = true + oObj.revokeScriptEvents(0) + allScripts = oObj.getScriptEvents(0) + bOK = bOK AND ubound(allScripts) = -1 + Test.MethodTested("revokeScriptEvents()", bOK) + + Test.StartMethod("removeScriptListener()") + bOK = true + oObj.removeScriptListener(oListener) + Test.MethodTested("removeScriptListener()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/script/XInvocationAdapterFactory/script.xlb b/qadevOOo/tests/basic/ifc/script/XInvocationAdapterFactory/script.xlb new file mode 100644 index 000000000000..6478659303e1 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/script/XInvocationAdapterFactory/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="script_XInvocationAdapterFactory" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="script_XInvocationAdapterFactory"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/script/XInvocationAdapterFactory/script_XInvocationAdapterFactory.xba b/qadevOOo/tests/basic/ifc/script/XInvocationAdapterFactory/script_XInvocationAdapterFactory.xba new file mode 100644 index 000000000000..34f1d2a7fc9d --- /dev/null +++ b/qadevOOo/tests/basic/ifc/script/XInvocationAdapterFactory/script_XInvocationAdapterFactory.xba @@ -0,0 +1,81 @@ +<?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="script_XInvocationAdapterFactory" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.script.XInvocationAdapterFactory +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim pipe As Object, invFac As Object, inv As Object + Dim adp As Object + Dim tIS As Variant + + Out.Log("Preparing arguments for method call ...") + pipe = createUnoService("com.sun.star.io.Pipe") + invFac = createUnoService("com.sun.star.script.Invocation") + inv = invFac.createInstanceWithArguments(Array(pipe)) + + Test.StartMethod("createAdapter()") + bOK = true + tIS = oCoreRefl.forName("com.sun.star.io.XInputStream") + Out.Log("Creating adapter for '" + tIS.Name + "' interface") + adp = oObj.createAdapter(inv, tIS) + if NOT isNull(adp) then + if NOT hasUnoInterfaces(adp, "com.sun.star.io.XInputStream") then + bOK = false + Out.Log("Returned object doesn't support XInputStream") + endif + else + bOK = false + Out.Log("NULL was returned.") + endif + + Test.MethodTested("createAdapter()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/script/XInvocationAdapterFactory2/script.xlb b/qadevOOo/tests/basic/ifc/script/XInvocationAdapterFactory2/script.xlb new file mode 100644 index 000000000000..f182c69bf6b1 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/script/XInvocationAdapterFactory2/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="script_XInvocationAdapterFactory2" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="script_XInvocationAdapterFactory2"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/script/XInvocationAdapterFactory2/script_XInvocationAdapterFactory2.xba b/qadevOOo/tests/basic/ifc/script/XInvocationAdapterFactory2/script_XInvocationAdapterFactory2.xba new file mode 100644 index 000000000000..49dad6ec208d --- /dev/null +++ b/qadevOOo/tests/basic/ifc/script/XInvocationAdapterFactory2/script_XInvocationAdapterFactory2.xba @@ -0,0 +1,80 @@ +<?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="script_XInvocationAdapterFactory2" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.script.XInvocationAdapterFactory2 +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim pipe As Object, invFac As Object, inv As Object + Dim adp As Object + Dim types As Variant + + Out.Log("Preparing arguments for method call ...") + pipe = createUnoService("com.sun.star.io.Pipe") + invFac = createUnoService("com.sun.star.script.Invocation") + inv = invFac.createInstanceWithArguments(Array(pipe)) + + Test.StartMethod("createAdapter()") + bOK = true + types = Array( oCoreRefl.forName("com.sun.star.io.XInputStream") ) + adp = oObj.createAdapter(inv, tIS) + if NOT isNull(adp) then + if NOT hasUnoInterfaces(adp, "com.sun.star.io.XInputStream") then + bOK = false + Out.Log("Returned object doesn't support XInputStream") + endif + else + bOK = false + Out.Log("NULL was returned.") + endif + + Test.MethodTested("createAdapter()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/script/XTypeConverter/script.xlb b/qadevOOo/tests/basic/ifc/script/XTypeConverter/script.xlb new file mode 100644 index 000000000000..2168d231f1d8 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/script/XTypeConverter/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="script_XTypeConverter" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="script_XTypeConverter"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/script/XTypeConverter/script_XTypeConverter.xba b/qadevOOo/tests/basic/ifc/script/XTypeConverter/script_XTypeConverter.xba new file mode 100644 index 000000000000..26d613cbef4c --- /dev/null +++ b/qadevOOo/tests/basic/ifc/script/XTypeConverter/script_XTypeConverter.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="script_XTypeConverter" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.script.XTypeConverter +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim oCoreRefl As Object + + oCoreRefl = createUNOService("com.sun.star.reflection.CoreReflection") + + Test.StartMethod("convertTo()") + bOK = true + Dim tXInterface As Variant + Dim tXInterfaceObject As Variant + Dim cObjTypeName As String + Dim oObjToConv As Object + + Out.Log("Creating a Type object for XInterface") + tXInterface = oCoreRefl.forName("com.sun.star.io.XInputStream") + Out.Log("Created " + tXInterface.Name) + + oObjToConv = createUnoService("com.sun.star.io.Pipe") + Out.Log("Converting object of type " + oCoreRefl.getType(oObjToConv).Name + " to " + tXInterface.Name) + tXInterfaceObject = oObj.convertTo(oObjToConv, tXInterface) + + if (isNULL(tXInterfaceObject)) then + Out.Log("Returned object is NULL!!!") + bOK = false + elseif (isEmpty(tXInterfaceObject)) then + cObjTypeName = "Empty" + else + cObjTypeName = oCoreRefl.getType(tXInterfaceObject).Name + end if + + Out.Log("New object is of type " + cObjTypeName + ".") + + bOK = bOK AND NOT isNULL(tXInterfaceObject) + bOK = bOK AND inStr(1, cObjTypeName, "XInterface") + Test.MethodTested("convertTo()", bOK) + + + Test.StartMethod("convertToSimpleType()") + Dim oldType As String + Dim newType As String + Dim oldVal As Integer + Dim newVal + + bOK = true + + oldVal = 65 + oldType = oCoreRefl.getType(oldVal).Name + newVal = oObj.convertToSimpleType(oldVal, com.sun.star.uno.TypeClass.STRING) + newType = oCoreRefl.getType(newVal).Name + + bOK = bOK AND newType <> oldType + bOK = bOK AND inStr(1, newVal, "65") + Out.Log("Old value is " + oldVal + " of type " + oldType + ", new value is " + _ + newVal + " of type " + newType + ".") + Test.MethodTested("convertToSimpleType()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sdb/DataAccessDescriptor/script.xlb b/qadevOOo/tests/basic/ifc/sdb/DataAccessDescriptor/script.xlb new file mode 100644 index 000000000000..cd1568bef490 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sdb/DataAccessDescriptor/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="sdb_DataAccessDescriptor" library:readonly="false" library:passwordprotected="false"> + <library:element library:name="sdb_DataAccessDescriptor"/> + </library:library> diff --git a/qadevOOo/tests/basic/ifc/sdb/DataAccessDescriptor/sdb_DataAccessDescriptor.xba b/qadevOOo/tests/basic/ifc/sdb/DataAccessDescriptor/sdb_DataAccessDescriptor.xba new file mode 100644 index 000000000000..9f00da7b7379 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sdb/DataAccessDescriptor/sdb_DataAccessDescriptor.xba @@ -0,0 +1,81 @@ +<?xml version="1.0" encoding="UTF-8"?> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="sdb_DataAccessDescriptor" 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. +' +'************************************************************************* +'************************************************************************* + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' NONE + +'************************************************************************* + +' Be sure that all variables are dimensioned: +option explicit + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.sdb.DataAccessDescriptor +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + PropertyTester.TestProperty("DataSourceName") + + PropertyTester.TestProperty("ActiveConnection") + + PropertyTester.TestProperty("Command") + + PropertyTester.TestProperty("CommandType") + + PropertyTester.TestProperty("Filter") + + PropertyTester.TestProperty("EscapeProcessing") + + PropertyTester.TestProperty("ResultSet") + + PropertyTester.TestProperty("Selection", Array(Array(2,4), Array(1,3))) + + PropertyTester.TestProperty("BookmarkSelection") + + PropertyTester.TestProperty("ColumnName") + + PropertyTester.TestProperty("Column") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sdb/DataSource/script.xlb b/qadevOOo/tests/basic/ifc/sdb/DataSource/script.xlb new file mode 100644 index 000000000000..2e4c15e4a7b8 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sdb/DataSource/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="sdb_DataSource" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sdb_DataSource"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sdb/DataSource/sdb_DataSource.xba b/qadevOOo/tests/basic/ifc/sdb/DataSource/sdb_DataSource.xba new file mode 100644 index 000000000000..58894d625364 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sdb/DataSource/sdb_DataSource.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="sdb_DataSource" 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. +' +'************************************************************************* +'************************************************************************* + + + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' - SuppressVersionColumns +' - IsReadOnly +' - NumberFormatsSupplier +' - TableFilter +' - TableTypeFilter + +'************************************************************************* + + + + + +Sub RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.sdb.DataSource +'************************************************************************* +On Error Goto ErrHndl + Dim infoUsr as new com.sun.star.beans.PropertyValue + Dim infoPass as new com.sun.star.beans.PropertyValue + Dim bOk as Boolean + + PropertyTester.TestProperty("Name") + + PropertyTester.TestProperty("URL") + + Test.StartMethod("Info") + props() = oObj.Info + + infoUsr.Name = "user" + if ubound(props()) > -1 then + infoUsr.Value = "New" + props(0).Value + else + infoUsr.Value = "DataSourceUser" + endif + + infoPass.Name = "password" + infoPass.Value = "DataSourcePasswd" + + newProps = Array(infoUsr, infoPass) + oObj.Info = newProps + getProps() = oObj.Info + Out.Log("ubound = " + ubound(getProps())) + + bOk = PropertyTester.equals(newProps, getProps) + + Test.MethodTested("Info", bOk) + + PropertyTester.TestProperty("User") + + PropertyTester.TestProperty("Password") + + PropertyTester.TestProperty("IsPasswordRequired") + + PropertyTester.TestProperty("SuppressVersionColumns") + + PropertyTester.TestProperty("IsReadOnly") + + PropertyTester.TestProperty("NumberFormatsSupplier") + + PropertyTester.TestProperty("TableFilter") + + PropertyTester.TestProperty("TableTypeFilter") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sdb/DatasourceAdministrationDialog/script.xlb b/qadevOOo/tests/basic/ifc/sdb/DatasourceAdministrationDialog/script.xlb new file mode 100644 index 000000000000..dd1009b2297b --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sdb/DatasourceAdministrationDialog/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="sdb_DatasourceAdministrationDialog" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sdb_DatasourceAdministrationDialog"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sdb/DatasourceAdministrationDialog/sdb_DatasourceAdministrationDialog.xba b/qadevOOo/tests/basic/ifc/sdb/DatasourceAdministrationDialog/sdb_DatasourceAdministrationDialog.xba new file mode 100644 index 000000000000..db42fb893ad7 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sdb/DatasourceAdministrationDialog/sdb_DatasourceAdministrationDialog.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="sdb_DatasourceAdministrationDialog" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.sdb.DatasourceAdministrationDialog +'************************************************************************* +On Error Goto ErrHndl + + PropertyTester.TestProperty("Title") + + PropertyTester.TestProperty("ParentWindow") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sdb/ErrorMessageDialog/script.xlb b/qadevOOo/tests/basic/ifc/sdb/ErrorMessageDialog/script.xlb new file mode 100644 index 000000000000..9a2d6ef472df --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sdb/ErrorMessageDialog/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="sdb_ErrorMessageDialog" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sdb_ErrorMessageDialog"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sdb/ErrorMessageDialog/sdb_ErrorMessageDialog.xba b/qadevOOo/tests/basic/ifc/sdb/ErrorMessageDialog/sdb_ErrorMessageDialog.xba new file mode 100644 index 000000000000..734a5d250ac3 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sdb/ErrorMessageDialog/sdb_ErrorMessageDialog.xba @@ -0,0 +1,74 @@ +<?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="sdb_ErrorMessageDialog" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.sdb.ErrorMessageDialog +'************************************************************************* +On Error Goto ErrHndl + Dim excep As Variant + Dim bOK As Boolean + Dim msg As String + + PropertyTester.TestProperty("Title") + + PropertyTester.TestProperty("ParentWindow") + + Test.StartMethod("SQLException") + bOk = true + excep = oObj.SQLException + if isNull(excep) OR isEmpty(excep) then + Out.Log("Property is null and cann't be changed") + else + oObj.SQLException = NULL_OBJECT + excep = oObj.SQLException + bOk = bOK AND (isNull(excep) OR isEmpty(excep)) + endIf + Test.MethodTested("SQLException", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sdb/QueryDefinition/script.xlb b/qadevOOo/tests/basic/ifc/sdb/QueryDefinition/script.xlb new file mode 100644 index 000000000000..be39aab5d1a8 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sdb/QueryDefinition/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="sdb_QueryDefinition" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sdb_QueryDefinition"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sdb/QueryDefinition/sdb_QueryDefinition.xba b/qadevOOo/tests/basic/ifc/sdb/QueryDefinition/sdb_QueryDefinition.xba new file mode 100644 index 000000000000..86723d3d00f8 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sdb/QueryDefinition/sdb_QueryDefinition.xba @@ -0,0 +1,66 @@ +<?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="sdb_QueryDefinition" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.sdb.QueryDefinition +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + PropertyTester.TestProperty("Name") + + PropertyTester.TestProperty("Command") + + PropertyTester.TestProperty("EscapeProcessing") + + PropertyTester.TestProperty("UpdateTableName") + + PropertyTester.TestProperty("UpdateCatalogName") + + PropertyTester.TestProperty("UpdateSchemaName") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sdb/RowSet/script.xlb b/qadevOOo/tests/basic/ifc/sdb/RowSet/script.xlb new file mode 100644 index 000000000000..e739bd7198ea --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sdb/RowSet/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="sdb_RowSet" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sdb_RowSet"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sdb/RowSet/sdb_RowSet.xba b/qadevOOo/tests/basic/ifc/sdb/RowSet/sdb_RowSet.xba new file mode 100644 index 000000000000..cc52b46be8fc --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sdb/RowSet/sdb_RowSet.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="sdb_RowSet" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.sdb.RowSet +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + PropertyTester.TestProperty("ActiveConnection") + + PropertyTester.TestProperty("DataSourceName") + + PropertyTester.TestProperty("Command") + + Test.StartMethod("CommandType") + bOK = true + oldVal = oObj.CommandType + Out.Log("value before: "+oldVal) + if (oldVal <> 9999) then + oObj.CommandType = 9999 + else + oObj.CommandType = 10000 + endif + newVal = oObj.CommandType + Out.Log("value after: "+newVal) + bOK = bOK AND (newVal <> oldVal) + Test.MethodTested("CommandType",bOK) + + PropertyTester.TestProperty("ActiveCommand") + + PropertyTester.TestProperty("IgnoreResult") + + PropertyTester.TestProperty("Filter") + + PropertyTester.TestProperty("ApplyFilter") + + PropertyTester.TestProperty("Order") + + PropertyTester.TestProperty("Privileges") + + PropertyTester.TestProperty("IsModified") + + PropertyTester.TestProperty("IsNew") + + PropertyTester.TestProperty("RowCount") + + PropertyTester.TestProperty("IsRowCountFinal") + + PropertyTester.TestProperty("UpdateTableName") + + PropertyTester.TestProperty("UpdateCatalogName") + + PropertyTester.TestProperty("UpdateSchemaName") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sdb/XBookmarksSupplier/script.xlb b/qadevOOo/tests/basic/ifc/sdb/XBookmarksSupplier/script.xlb new file mode 100644 index 000000000000..150ca7de9f49 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sdb/XBookmarksSupplier/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="sdb_XBookmarksSupplier" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sdb_XBookmarksSupplier"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sdb/XBookmarksSupplier/sdb_XBookmarksSupplier.xba b/qadevOOo/tests/basic/ifc/sdb/XBookmarksSupplier/sdb_XBookmarksSupplier.xba new file mode 100644 index 000000000000..691dbc25aaca --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sdb/XBookmarksSupplier/sdb_XBookmarksSupplier.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="sdb_XBookmarksSupplier" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.sdb.XBookmarksSupplier +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim bkMrks as Variant + + + Test.StartMethod("getBookmarks()") + bOK = true + bkMrks = oObj.getBookmarks() + bOK = bOK AND (NOT isNull(bkMrks)) + if NOT bOK then Out.Log("The method returned NULL") + bOK = bOK AND hasUNOInterfaces(bkMrks, "com.sun.star.container.XNameAccess") + Test.MethodTested("getBookmarks()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sdb/XCompletedConnection/script.xlb b/qadevOOo/tests/basic/ifc/sdb/XCompletedConnection/script.xlb new file mode 100644 index 000000000000..2ee70813f92a --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sdb/XCompletedConnection/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="sdb_XCompletedConnection" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sdb_XCompletedConnection"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sdb/XCompletedConnection/sdb_XCompletedConnection.xba b/qadevOOo/tests/basic/ifc/sdb/XCompletedConnection/sdb_XCompletedConnection.xba new file mode 100644 index 000000000000..b8254ddb5e2a --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sdb/XCompletedConnection/sdb_XCompletedConnection.xba @@ -0,0 +1,64 @@ +<?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="sdb_XCompletedConnection" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.sdb.XCompletedConnection +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + ReCreateObj() + + Test.StartMethod("connectWithCompletion()") + bOK = true + Dim oIH As Object + Dim oConnection As Object + oIH = createUnoService("com.sun.star.sdb.InteractionHandler") + oConnection = oObj.connectWithCompletion(oIH) + bOK = bOK AND hasUnoInterfaces(oConnection, "com.sun.star.sdbc.XConnection") + Test.MethodTested("connectWithCompletion()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sdb/XQueryDefinitionsSupplier/script.xlb b/qadevOOo/tests/basic/ifc/sdb/XQueryDefinitionsSupplier/script.xlb new file mode 100644 index 000000000000..30016fad8059 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sdb/XQueryDefinitionsSupplier/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="sdb_XQueryDefinitionsSupplier" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sdb_XQueryDefinitionsSupplier"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sdb/XQueryDefinitionsSupplier/sdb_XQueryDefinitionsSupplier.xba b/qadevOOo/tests/basic/ifc/sdb/XQueryDefinitionsSupplier/sdb_XQueryDefinitionsSupplier.xba new file mode 100644 index 000000000000..1d3a69bffea1 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sdb/XQueryDefinitionsSupplier/sdb_XQueryDefinitionsSupplier.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="sdb_XQueryDefinitionsSupplier" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.sdb.XQueryDefinitionsSupplier +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + Test.StartMethod("getQueryDefinitions()") + bOK = true + Dim oQD As Object + oQD = oObj.getQueryDefinitions() + bOK = bOK AND hasUnoInterfaces(oQD, "com.sun.star.container.XNameAccess" + Test.MethodTested("getQueryDefinitions()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sdb/XResultSetAccess/script.xlb b/qadevOOo/tests/basic/ifc/sdb/XResultSetAccess/script.xlb new file mode 100644 index 000000000000..2f4becc94f61 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sdb/XResultSetAccess/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="sdb_XResultSetAccess" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sdb_XResultSetAccess"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sdb/XResultSetAccess/sdb_XResultSetAccess.xba b/qadevOOo/tests/basic/ifc/sdb/XResultSetAccess/sdb_XResultSetAccess.xba new file mode 100644 index 000000000000..cbbb70f067d1 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sdb/XResultSetAccess/sdb_XResultSetAccess.xba @@ -0,0 +1,60 @@ +<?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="sdb_XResultSetAccess" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.sdb.XResultSetAccess +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + Test.StartMethod("createResultSet()") + bOK = true + oResultSet = oObj.createResultSet() + bOK = bOK AND hasUnoInterfaces(oResultSet, "com.sun.star.sdbc.XResultSet") + Test.MethodTested("createResultSet()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sdb/XRowSetApproveBroadcaster/script.xlb b/qadevOOo/tests/basic/ifc/sdb/XRowSetApproveBroadcaster/script.xlb new file mode 100644 index 000000000000..d5f0289de9ce --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sdb/XRowSetApproveBroadcaster/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="sdb_XRowSetApproveBroadcaster" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sdb_XRowSetApproveBroadcaster"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sdb/XRowSetApproveBroadcaster/sdb_XRowSetApproveBroadcaster.xba b/qadevOOo/tests/basic/ifc/sdb/XRowSetApproveBroadcaster/sdb_XRowSetApproveBroadcaster.xba new file mode 100644 index 000000000000..ba32a84bb2b3 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sdb/XRowSetApproveBroadcaster/sdb_XRowSetApproveBroadcaster.xba @@ -0,0 +1,214 @@ +<?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="sdb_XRowSetApproveBroadcaster" 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. +' +'************************************************************************* +'************************************************************************* + + + + +Dim iApproveCursorMove1 As Integer +Dim iApproveCursorMove2 As Integer +Dim iApproveRowChange1 As Integer +Dim iApproveRowChange2 As Integer +Dim iApproveRowSetChange1 As Integer +Dim iApproveRowSetChange2 As Integer + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.sdb.XRowSetApproveBroadcaster +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Dim oListener1 As Object + Dim oListener2 As Object + Dim cOrigStr As String + Dim cPrevStr As String + + oObj.first() + cOrigStr = oObj.getString(1) + + Out.Log("Creating two XRowSetApproveListeners") + oListener1 = createUnoListener("CB1_", "com.sun.star.sdb.XRowSetApproveListener") + oListener2 = createUnoListener("CB2_", "com.sun.star.sdb.XRowSetApproveListener") + + ResetCounters() + + Test.StartMethod("addRowSetApproveListener()") + bOK = true + oObj.addRowSetApproveListener(oListener1) + oObj.addRowSetApproveListener(oListener2) + + bOK = bOK AND Expected(0, 0, 0, 0, 0, 0) + + Out.Log("Call oObj.execute() - change RowSet") + oObj.execute() + bOK = bOK AND Expected(0, 0, 0, 0, 1, 1) + + ResetCounters() + Out.Log("Call oObj.next() - move cursor") + oObj.next() + bOK = bOK AND Expected(1, 1, 0, 0, 0, 0) + + Out.Log("Call oObj.updateString() - updating RowSet") + oObj.first() + ResetCounters() + cPrevStr = oObj.getString(1) + Out.Log(cPrevStr) + oObj.updateString(1, cPrevStr + "+") + oObj.updateRow() + Out.Log(oObj.getString(1)) + bOK = bOK AND Expected(0, 0, 1, 1, 0, 0) + bOK = bOK AND oObj.getString(1) = cPrevStr + "+" + + Test.MethodTested("addRowSetApproveListener()", bOK) + + ResetCounters() + + Test.StartMethod("removeRowSetApproveListener()") + bOK = true + Out.Log("Removing only first listener") + oObj.removeRowSetApproveListener(oListener1) + + bOK = bOK AND Expected(0, 0, 0, 0, 0, 0) + + Out.Log("Call oObj.execute() - change RowSet") + oObj.execute() + bOK = bOK AND Expected(0, 0, 0, 0, 0, 1) + + ResetCounters() + Out.Log("Call oObj.next() - move cursor") + oObj.next() + bOK = bOK AND Expected(0, 1, 0, 0, 0, 0) + + ResetCounters() + Out.Log("Call oObj.updateString() - updating RowSet") + oObj.first() + cPrevStr = oObj.getString(1) + Out.Log(cPrevStr) + oObj.updateString(1, cPrevStr + "+") + oObj.updateRow() + Out.Log(oObj.getString(1)) + bOK = bOK AND Expected(0, 0, 0, 1, 0, 0) + bOK = bOK AND oObj.getString(1) = cPrevStr + "+" + + Test.MethodTested("removeRowSetApproveListener()", bOK) + + Out.Log("Removing last listener") + oObj.removeRowSetApproveListener(oListener2) + + Out.Log("Returning first row back...") + oObj.first() + oObj.updateString(1, cOrigStr) + oObj.updateRow() + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +Function CB1_approveCursorMove(oEvent As Object) As Boolean + Out.Log("callback function approveCursorMove() for Listener1 was called!") + iApproveCursorMove1 = iApproveCursorMove1 + 1 + CB1_approveCursorMove() = true +End Function + +Function CB2_approveCursorMove(oEvent As Object) As Boolean + Out.Log("callback function approveCursorMove() for Listener2 was called!") + iApproveCursorMove2 = iApproveCursorMove2 + 1 + CB2_approveCursorMove() = true +End Function + +Function CB1_approveRowChange(oEvent As Object) As Boolean + Out.Log("callback function approveRowChange() for Listener1 was called!") + iApproveRowChange1 = iApproveRowChange1 + 1 + CB1_approveRowChange() = true +End Function + +Function CB2_approveRowChange(oEvent As Object) As Boolean + Out.Log("callback function approveRowChange() for Listener2 was called!") + iApproveRowChange2 = iApproveRowChange2 + 1 + CB2_approveRowChange() = true +End Function + +Function CB1_approveRowSetChange(oEvent As Object) As Boolean + Out.Log("callback function approveRowSetChange() for Listener1 was called!") + iApproveRowSetChange1 = iApproveRowSetChange1 + 1 + CB1_approveRowSetChange() = true +End Function + +Function CB2_approveRowSetChange(oEvent As Object) As Boolean + Out.Log("callback function approveRowSetChange() for Listener2 was called!") + iApproveRowSetChange2 = iApproveRowSetChange2 + 1 + CB2_approveRowSetChange() = true +End Function + +Sub ResetCounters() + Out.Log("Reset counters...") + iApproveCursorMove1 = 0 + iApproveCursorMove2 = 0 + iApproveRowChange1 = 0 + iApproveRowChange2 = 0 + iApproveRowSetChange1 = 0 + iApproveRowSetChange2 = 0 +End Sub + +Function Expected(iApprCursorMove1 As Integer, iApprCursorMove2 As Integer, _ + iApprRowChange1 As Integer, iApprRowChange2 As Integer, _ + iApprRowSetChange1 As Integer, iApprRowSetChange2 As Integer) As Boolean +Dim bOK As Boolean + bOK = true + + bOK = bOK AND Expected1("approveCursorMove()", 1, iApproveCursorMove1, iApprCursorMove1) + bOK = bOK AND Expected1("approveCursorMove()", 2, iApproveCursorMove2, iApprCursorMove2) + bOK = bOK AND Expected1("approveRowChange()", 1, iApproveRowChange1, iApprRowChange1) + bOK = bOK AND Expected1("approveRowChange()", 2, iApproveRowChange2, iApprRowChange2) + bOK = bOK AND Expected1("apprRowSetChange()", 1, iApproveRowSetChange1, iApprRowSetChange1) + bOK = bOK AND Expected1("apprRowSetChange()", 2, iApproveRowSetChange2, iApprRowSetChange2) + Expected() = bOK +End Function + +Function Expected1(fname As String, ln As Integer, val1 As Integer, val2 As Integer) As Boolean + Dim bOK As Integer + + bOK = true + if (val1 <> val2) then + Out.Log(fname + " of Listener" + ln + " was called " + val1 + " time(s), "_ + + "but it should be called " + val2 + " time(s).") + bOK = false + end if + Expected1() = bOK +End Function +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sdbc/ResultSet/script.xlb b/qadevOOo/tests/basic/ifc/sdbc/ResultSet/script.xlb new file mode 100644 index 000000000000..32a0dc881d96 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sdbc/ResultSet/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="sdbc_ResultSet" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sdbc_ResultSet"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sdbc/ResultSet/sdbc_ResultSet.xba b/qadevOOo/tests/basic/ifc/sdbc/ResultSet/sdbc_ResultSet.xba new file mode 100644 index 000000000000..8c4be7b77bd1 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sdbc/ResultSet/sdbc_ResultSet.xba @@ -0,0 +1,64 @@ +<?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="sdbc_ResultSet" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.sdbc.ResultSet +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + PropertyTester.TestProperty("CursorName") + + PropertyTester.TestProperty("ResultSetConcurrency") + + PropertyTester.TestProperty("ResultSetType") + + PropertyTester.TestProperty("FetchDirection") + + PropertyTester.TestProperty("FetchSize") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sdbc/RowSet/script.xlb b/qadevOOo/tests/basic/ifc/sdbc/RowSet/script.xlb new file mode 100644 index 000000000000..b29bd1235b71 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sdbc/RowSet/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="sdbc_RowSet" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sdbc_RowSet"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sdbc/RowSet/sdbc_RowSet.xba b/qadevOOo/tests/basic/ifc/sdbc/RowSet/sdbc_RowSet.xba new file mode 100644 index 000000000000..dccad879e23f --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sdbc/RowSet/sdbc_RowSet.xba @@ -0,0 +1,78 @@ +<?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="sdbc_RowSet" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.sdbc.RowSet +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + PropertyTester.TestProperty("DataSourceName") + + PropertyTester.TestProperty("URL") + + PropertyTester.TestProperty("Command") + + PropertyTester.TestProperty("TransactionIsolation") + + PropertyTester.TestProperty("TypeMap") + + PropertyTester.TestProperty("EscapeProcessing") + + PropertyTester.TestProperty("QueryTimeOut") + + PropertyTester.TestProperty("MaxFieldSize") + + PropertyTester.TestProperty("MaxRows") + + PropertyTester.TestProperty("User") + + PropertyTester.TestProperty("Password") + + PropertyTester.TestProperty("ResultSetType") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sdbc/XCloseable/script.xlb b/qadevOOo/tests/basic/ifc/sdbc/XCloseable/script.xlb new file mode 100644 index 000000000000..52cb7f319887 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sdbc/XCloseable/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="sdbc_XCloseable" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sdbc_XCloseable"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sdbc/XCloseable/sdbc_XCloseable.xba b/qadevOOo/tests/basic/ifc/sdbc/XCloseable/sdbc_XCloseable.xba new file mode 100644 index 000000000000..ec09836d0b4d --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sdbc/XCloseable/sdbc_XCloseable.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="sdbc_XCloseable" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.sdbc.XCloseable +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + Test.StartMethod("close()") + bOK = true + + Out.Log("Checking if the object is valid before closing ...") + oObj.first() + + oObj.close() + + Dim bEx As Boolean + bEx = false + On Error Goto ExpectErr + Out.Log("Checking if the row set was closed ...") + oObj.first() + On Error Goto ErrHndl + + bOK = bEx + + Test.MethodTested("close()", bOK) + + ReCreateObj() +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next + +ExpectErr: + Out.Log("Proper exception occurred") + bEx = true + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sdbc/XColumnLocate/script.xlb b/qadevOOo/tests/basic/ifc/sdbc/XColumnLocate/script.xlb new file mode 100644 index 000000000000..735924c27e5c --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sdbc/XColumnLocate/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="sdbc_XColumnLocate" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sdbc_XColumnLocate"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sdbc/XColumnLocate/sdbc_XColumnLocate.xba b/qadevOOo/tests/basic/ifc/sdbc/XColumnLocate/sdbc_XColumnLocate.xba new file mode 100644 index 000000000000..b2570fa5238c --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sdbc/XColumnLocate/sdbc_XColumnLocate.xba @@ -0,0 +1,71 @@ +<?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="sdbc_XColumnLocate" 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. +' +'************************************************************************* +'************************************************************************* + + + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' - Global cExistantColumnName As String + +'************************************************************************* + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.sdbc.XColumnLocate +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + Test.StartMethod("findColumn()") + bOK = true + iColumn = oObj.findColumn(cExistantColumnName) + + bOK = bOK AND iColumn <> 0 + Test.MethodTested("findColumn()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sdbc/XDataSource/script.xlb b/qadevOOo/tests/basic/ifc/sdbc/XDataSource/script.xlb new file mode 100644 index 000000000000..e5ffc7e4109a --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sdbc/XDataSource/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="sdbc_XDataSource" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sdbc_XDataSource"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sdbc/XDataSource/sdbc_XDataSource.xba b/qadevOOo/tests/basic/ifc/sdbc/XDataSource/sdbc_XDataSource.xba new file mode 100644 index 000000000000..6596f68fc20f --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sdbc/XDataSource/sdbc_XDataSource.xba @@ -0,0 +1,74 @@ +<?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="sdbc_XDataSource" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.sdbc.XDataSource +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Test.StartMethod("getConnection()") + Dim connection As Object + connection = oObj.getConnection("", "") + bOK = Not IsNull(connection) + Test.MethodTested("getConnection()", bOK) + + Test.StartMethod("getLoginTimeout()") + Dim timeout As Integer + timeout = oObj.getLoginTimeout() + bOK = timeout = 0 + Test.MethodTested("getLoginTimeout()", bOK) + + Test.StartMethod("setLoginTimeout()") + oObj.setLoginTimeout(111) + timeout = oObj.getLoginTimeout() + bOK = timeout = 111 + Test.MethodTested("setLoginTimeout()", bOK) +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sdbc/XDriver/script.xlb b/qadevOOo/tests/basic/ifc/sdbc/XDriver/script.xlb new file mode 100644 index 000000000000..e4f39f7430d6 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sdbc/XDriver/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="sdbc_XDriver" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sdbc_XDriver"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sdbc/XDriver/sdbc_XDriver.xba b/qadevOOo/tests/basic/ifc/sdbc/XDriver/sdbc_XDriver.xba new file mode 100644 index 000000000000..5e6a37c70e2e --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sdbc/XDriver/sdbc_XDriver.xba @@ -0,0 +1,104 @@ +<?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="sdbc_XDriver" 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 + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' - Global URL as String +' Global info As Variant + +'************************************************************************* + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.sdbc.XDriver +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Test.StartMethod("acceptsURL()") + bOK = oObj.acceptsURL(URL) + Out.log("acceptsURL('" + URL + "')? " + bOK) + Test.MethodTested("acceptsURL()", bOK) + + Test.StartMethod("connect()") + Out.log("connecting to '" + URL + "'") + Dim connection As Object + connection = oObj.connect(URL, info) + bOK = Not IsNull(connection) + Test.MethodTested("connect()", bOK) + + Test.StartMethod("getPropertyInfo()") + Dim dpi As Variant + dpi = oObj.getPropertyInfo(URL, info) + bOK = Not IsNull(dpi) + if bOK then + Dim i As Integer + for i = 0 to ubound(dpi) + Out.log(dpi(i).Name + ": " + dpi(i).Value) + next i + endif + Test.MethodTested("getPropertyInfo()", bOK) + + Test.StartMethod("getMajorVersion()") + bOK = true + Dim majVer As Integer + majVer = oObj.getMajorVersion() + Out.log("Major version: " + majVer) + Test.MethodTested("getMajorVersion()", bOK) + + Test.StartMethod("getMinorVersion()") + bOK = true + Dim minVer As Integer + minVer = oObj.getMinorVersion() + Out.log("Minor version: " + minVer) + Test.MethodTested("getMinorVersion()", bOK) +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sdbc/XDriverManager/script.xlb b/qadevOOo/tests/basic/ifc/sdbc/XDriverManager/script.xlb new file mode 100644 index 000000000000..e2b90a2b7f85 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sdbc/XDriverManager/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="sdbc_XDriverManager" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sdbc_XDriverManager"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sdbc/XDriverManager/sdbc_XDriverManager.xba b/qadevOOo/tests/basic/ifc/sdbc/XDriverManager/sdbc_XDriverManager.xba new file mode 100644 index 000000000000..8adf6fd5828a --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sdbc/XDriverManager/sdbc_XDriverManager.xba @@ -0,0 +1,86 @@ +<?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="sdbc_XDriverManager" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.sdbc.XDriverManager +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Test.StartMethod("getConnection()") + Dim connection As Object + connection = oObj.getConnection(dbaseUrl) + Out.log("getConnection('" + dbaseUrl + "')") + bOK = Not IsNull(connection) + Test.MethodTested("getConnection()", bOK) + + Test.StartMethod("getConnectionWithInfo()") + Dim info(2) As new com.sun.star.beans.PropertyValue + info(0).Name = "user" : info(0).Value = jdbcUser + info(1).Name = "password" : info(1).Value = jdbcPassword + info(2).Name = "JavaDriverClass" : info(2).Value = "org.gjt.mm.mysql.Driver" + connection = oObj.getConnectionWithInfo(jdbcUrl, info()) + Out.log("getConnectionWithInfo('" + jdbcUrl + "')") + bOK = Not IsNull(connection) + Test.MethodTested("getConnectionWithInfo()", bOK) + + Test.StartMethod("getLoginTimeout()") + Dim timeout As Integer + timeout = oObj.getLoginTimeout() + Out.log("getLoginTimeout(): " + timeout) + bOK = true + Test.MethodTested("getLoginTimeout()", bOK) + + Test.StartMethod("setLoginTimeout()") + oObj.setLoginTimeout(111) + Out.log("setLoginTimeout(): 111") + timeout = oObj.getLoginTimeout() + bOK = timeout = 111 + Test.MethodTested("setLoginTimeout()", bOK) +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sdbc/XIsolatedConnection/script.xlb b/qadevOOo/tests/basic/ifc/sdbc/XIsolatedConnection/script.xlb new file mode 100644 index 000000000000..93b938880d5a --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sdbc/XIsolatedConnection/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="sdbc_XIsolatedConnection" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sdbc_XIsolatedConnection"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sdbc/XIsolatedConnection/sdbc_XIsolatedConnection.xba b/qadevOOo/tests/basic/ifc/sdbc/XIsolatedConnection/sdbc_XIsolatedConnection.xba new file mode 100644 index 000000000000..f491c1d99085 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sdbc/XIsolatedConnection/sdbc_XIsolatedConnection.xba @@ -0,0 +1,76 @@ +<?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="sdbc_XIsolatedConnection" 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 + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' Global handler As Object + +'************************************************************************* + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.sdbc.XIsolatedConnection +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Test.StartMethod("getIsolatedConnectionWithCompletion()") + Dim connection As Object + connection = oObj.getIsolatedConnectionWithCompletion(handler) + bOK = Not IsNull(connection) + Test.MethodTested("getIsolatedConnectionWithCompletion()", bOK) + + Test.StartMethod("getIsolatedConnection()") + connection = oObj.getIsolatedConnection(handler) + bOK = Not IsNull(connection) + Test.MethodTested("getIsolatedConnection()", bOK) +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sdbc/XParameters/script.xlb b/qadevOOo/tests/basic/ifc/sdbc/XParameters/script.xlb new file mode 100644 index 000000000000..c2367a3e7172 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sdbc/XParameters/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="sdbc_XParameters" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sdbc_XParameters"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sdbc/XParameters/sdbc_XParameters.xba b/qadevOOo/tests/basic/ifc/sdbc/XParameters/sdbc_XParameters.xba new file mode 100644 index 000000000000..6140ade242c1 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sdbc/XParameters/sdbc_XParameters.xba @@ -0,0 +1,211 @@ +<?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="sdbc_XParameters" 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 + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' - Global paramTypes As Variant +' Array of Strings which describes the types of the query parameters + +'************************************************************************* + + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.sdbc.XParameters +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim i As Integer + + for i = 0 to ubound(paramTypes()) + if (paramTypes(i) = "boolean") OR (paramTypes(i) = "byte") OR (paramTypes(i) = "short") OR _ + (paramTypes(i) = "int") OR (paramTypes(i) = "long") OR (paramTypes(i) = "float") OR _ + (paramTypes(i) = "double") OR (paramTypes(i) = "string") OR (paramTypes(i) = "bytes") OR _ + (paramTypes(i) = "date") OR (paramTypes(i) = "time") OR (paramTypes(i) = "timestamp") OR _ + (paramTypes(i) = "binarystream") OR (paramTypes(i) = "characterstream") then + + bOK = true + oObj.setNull(i + 1, paramTypes(i)) + Test.MethodTested("setNull()", bOK) + elseif paramTypes(i) = "ref" then + Out.Log("Don't know how to test this :(") +' bOK = true +' oObj.setObjectNull(i) +' Test.MethodTested("setNull()", bOK) + end if + + + if paramTypes(i) = "boolean" then + Test.StartMethod("setBoolean()") + bOK = true + oObj.setBoolean(i + 1, true) + Test.MethodTested("setBoolean()", bOK) + elseif paramTypes(i) = "byte" then + Test.StartMethod("setByte()") + bOK = true + oObj.setByte(i + 1, 5) + Test.MethodTested("setByte()", bOK) + elseif paramTypes(i) = "short" then + Test.StartMethod("setShort()") + bOK = true + oObj.setShort(i + 1, 6) + Test.MethodTested("setShort()", bOK) + elseif paramTypes(i) = "int" then + Test.StartMethod("setInt()") + bOK = true + oObj.setInt(i + 1, 234) + Test.MethodTested("setInt()", bOK) + elseif paramTypes(i) = "long" then + Test.StartMethod("setLong()") + bOK = true + oObj.setLong(i + 1, 34656) + Test.MethodTested("setLong()", bOK) + elseif paramTypes(i) = "float" then + Test.StartMethod("setFloat()") + bOK = true + oObj.setFloat(i + 1, 98.765) + Test.MethodTested("setFloat()", bOK) + elseif paramTypes(i) = "double" then + Test.StartMethod("setDouble()") + bOK = true + oObj.setDouble(i + 1, 54.432) + Test.MethodTested("setDouble()", bOK) + elseif paramTypes(i) = "string" then + Test.StartMethod("setString()") + bOK = true + oObj.setString(i + 1, "XParameters") + Test.MethodTested("setString()", bOK) + elseif paramTypes(i) = "bytes" then + Test.StartMethod("setBytes()") + bOK = true + oObj.setBytes(i + 1, Array(1,2,3)) + Test.MethodTested("setBytes()", bOK) + elseif paramTypes(i) = "date" then + Dim dat As new com.sun.star.util.Date + + Test.StartMethod("setDate()") + bOK = true + oObj.setDate(i + 1, dat) + Test.MethodTested("setDate()", bOK) + elseif paramTypes(i) = "time" then + Dim tim As new com.sun.star.util.Time + + Test.StartMethod("setTime()") + bOK = true + oObj.setTime(i + 1, tim) + Test.MethodTested("setTime()", bOK) + elseif paramTypes(i) = "timestamp" then + Dim timstmp As new com.sun.star.util.DateTime + + Test.StartMethod("setTimestamp()") + bOK = true + oObj.setTimestamp(i + 1, timstmp) + Test.MethodTested("setTimestamp()", bOK) + elseif paramTypes(i) = "binarystream" then + Test.StartMethod("setBinaryStream()") + bOK = true + oObj.setBinaryStream(i + 1, ceateUnoService("com.sun.star.io.Pipe")) + Test.MethodTested("setBinaryStream()", bOK) + elseif paramTypes(i) = "characterstream" then + Test.StartMethod("setCharacterStream()") + bOK = true + oObj.setCharacterStream(i + 1, ceateUnoService("com.sun.star.io.Pipe")) + Test.MethodTested("setCharacterStream()", bOK) + elseif paramTypes(i) = "object" then + Test.StartMethod("setObject()") + bOK = true + oObj.setObject(i + 1, ceateUnoService("com.sun.star.io.Pipe")) + Test.MethodTested("setObject()", bOK) + elseif paramTypes(i) = "objectwithinfo" then + Out.Log("Don't know how to test this type :(") +' Test.StartMethod("setObjectWithInfo()") +' bOK = true +' oObj.setObjectWithInfo() +' bOK = bOK AND false +' Test.MethodTested("setObjectWithInfo()", bOK) + elseif paramTypes(i) = "ref" then + Out.Log("Don't know how to test this type :(") +' Test.StartMethod("setRef()") +' bOK = true +' oObj.setRef() +' bOK = bOK AND false +' Test.MethodTested("setRef()", bOK) + elseif paramTypes(i) = "blob" then + Out.Log("Don't know how to test this type :(") +' Test.StartMethod("setBlob()") +' bOK = true +' oObj.setBlob() +' bOK = bOK AND false +' Test.MethodTested("setBlob()", bOK) + elseif paramTypes(i) = "clob" then + Out.Log("Don't know how to test this type :(") +' Test.StartMethod("setClob()") +' bOK = true +' oObj.setClob() +' bOK = bOK AND false +' Test.MethodTested("setClob()", bOK) + elseif paramTypes(i) = "array" then + Out.Log("Don't know how to test this type :(") +' Test.StartMethod("setArray()") +' bOK = true +' oObj.setArray() +' bOK = bOK AND false +' Test.MethodTested("setArray()", bOK) + end if + next i + + Test.StartMethod("clearParameters()") + bOK = true + oObj.clearParameters() + Test.MethodTested("clearParameters()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sdbc/XResultSet/script.xlb b/qadevOOo/tests/basic/ifc/sdbc/XResultSet/script.xlb new file mode 100644 index 000000000000..8f24ba399ef1 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sdbc/XResultSet/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="sdbc_XResultSet" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sdbc_XResultSet"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sdbc/XResultSet/sdbc_XResultSet.xba b/qadevOOo/tests/basic/ifc/sdbc/XResultSet/sdbc_XResultSet.xba new file mode 100644 index 000000000000..2d694bdc3669 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sdbc/XResultSet/sdbc_XResultSet.xba @@ -0,0 +1,311 @@ +<?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="sdbc_XResultSet" 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. +' +'************************************************************************* +'************************************************************************* + + + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' - Global cXResultSetFirstRecord as String +' Global cXResultSetLastRecord as String +' Global cXResultSetRecord1 as String +' Global cXResultSetRecord2 as String +' Global cXResultSet2BeforeLastRecord as String + +'************************************************************************* + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.sdbc.XResultSet +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + Out.Log("ReCreating Object, to be shure that it is in initial state.") + + Test.StartMethod("beforeFirst()") + Test.StartMethod("isBeforeFirst()") + Test.StartMethod("isFirst()") + Test.StartMethod("first()") + Test.StartMethod("next()") + + Test.StartMethod("afterLast()") + Test.StartMethod("isAfterLast()") + Test.StartMethod("isLast()") + Test.StartMethod("last()") + Test.StartMethod("previous()") + + Test.StartMethod("getRow()") + + Dim bBeforeFirst As Boolean + Dim bIsBeforeFirst As Boolean + Dim bIsBeforeFirstLoop As Boolean + Dim bIsFirst As Boolean + Dim bFirst As Boolean + Dim bNext As Boolean + Dim bAfterLast As Boolean + Dim bIsAfterLast As Boolean + Dim bIsAfterLastLoop As Boolean + Dim bIsLast As Boolean + Dim bLast As Boolean + Dim bPrevious As Boolean + Dim bGetRow As Boolean + Dim bLoopError as Boolean + + bLoopError = false + bBeforeFirst = true + bIsBeforeFirst = true + bIsFirst = true + bFirst = true + bNext = true + bAfterLast = true + bIsAfterLast = true + bIsLast = true + bLast = true + bPrevious = true + bGetRow = true + + oObj.beforeFirst() + + Out.Log("Initially the cursor should be before first record.") + Out.Log("getRow(): expected : 0, actual: " + oObj.getRow()) + if (oObj.getRow() = 0) then + Out.Log("isBeforeFirst(): expected: 'true', actual '" + oObj.isBeforeFirst() + "'") + bIsBeforeFirst = bIsBeforeFirst AND oObj.isBeforeFirst() + end if + + Out.Log("Go to not first record...") + oObj.next + oObj.next + Out.Log("isBeforeFirst(): expected: 'false', actual '" + oObj.isBeforeFirst() + "'") + bIsBeforeFirst = bIsBeforeFirst AND NOT oObj.isBeforeFirst() + + Out.Log("Go to before first record...") + oObj.beforeFirst() + Out.Log("isBeforeFirst(): expected: 'true', actual '" + oObj.isBeforeFirst() + "'") + bBeforeFirst = bBeforeFirst AND oObj.isBeforeFirst() + bIsBeforeFirst = bIsBeforeFirst AND oObj.isBeforeFirst() + + Out.Log("Go to previous position") + oObj.previous() + Out.Log("isBeforeFirst(): expected: 'true', actual '" + oObj.isBeforeFirst() + "'") + bIsBeforeFirst = bIsBeforeFirst AND oObj.isBeforeFirst() + bPrevious = bPrevious AND oObj.isBeforeFirst() + + Out.Log("Go to first record...") + oObj.first() + Out.Log("isBeforeFirst(): expected: 'false', actual '" + oObj.isBeforeFirst() + "'") + bIsBeforeFirst = bIsBeforeFirst AND NOT oObj.isBeforeFirst() + Out.Log("isFirst(): expected: 'true', actual '" + oObj.isFirst() + "'") + bIsFirst = bIsFirst AND oObj.isFirst() + Out.Log("getRow(): expected : 1, actual: " + oObj.getRow()) + bIsFirst = bIsFirst AND oObj.getRow() = 1 + Out.Log("RowDsc should contain " + cXResultSetFirstRecord) + Out.Log("RowDsc is '" + oObj.getString(1) + "'") + bFirst = bFirst AND inStr(1, oObj.getString(1), cXResultSetFirstRecord) + + Out.Log("Go to previous position") + oObj.previous() + Out.Log("isBeforeFirst(): expected: 'true', actual '" + oObj.isBeforeFirst() + "'") + bIsBeforeFirst = bIsBeforeFirst AND oObj.isBeforeFirst() + bPrevious = bPrevious AND oObj.isBeforeFirst() + Out.Log("isFirst(): expected: 'false', actual '" + oObj.isFirst() + "'") + bIsFirst = bIsFirst AND NOT oObj.isFirst() + + Out.Log("Go to beforeFirst()") + oObj.beforeFirst() + Out.Log("Iterate through all records form first to last") + Dim n As Integer + n = 0 + bLoopError = false + bIsAfterLastLoop = oObj.isAfterLast() + while (n < 1000 AND NOT bIsAfterLastLoop) + oObj.next() + n = n + 1 + bIsAfterLastLoop = oObj.isAfterLast() + if bLoopError then + bLoopError = false + n = 1000 + end if + wend + + Out.Log("IsAfterLast(): expected: 'true', actual '" + oObj.IsAfterLast() + "'") + bIsAfterLast = bIsAfterLast AND oObj.isAfterLast() + Out.Log("IsLast(): expected: 'false', actual '" + oObj.IsLast() + "'") + bIsLast = bIsLast AND NOT oObj.isLast() + Out.Log("Amount of records is " + n) + Out.Log("Trying to go to next record") + oObj.next() + Out.Log("IsAfterLast(): expected: 'true', actual '" + oObj.IsAfterLast() + "'") + bIsAfterLast = bIsAfterLast AND oObj.isAfterLast() + + Out.Log("Go to previous position.") + oObj.previous() + Out.Log("IsLast(): expected: 'true', actual '" + oObj.IsLast() + "'") + bIsLast = bIsLast AND oObj.isLast() + Out.Log("RowDsc should contain " + cXResultSetLastRecord) + Out.Log("RowDsc is '" + oObj.getString(1) + "'") + bIsLast = bIsLast AND inStr(1, oObj.getString(1), cXResultSetLastRecord) + + Out.Log("Iterate through all records form last to first") + bLoopError = false + bIsBeforeFirstLoop = oObj.isBeforeFirst() + while (n > 0 AND NOT bIsBeforeFirstLoop) + oObj.previous() + n = n - 1 + bIsBeforeFirstLoop = oObj.isBeforeFirst() + if bLoopError then + bLoopError = false + n = 0 + end if + wend + + Out.Log("isBeforeFirst(): expected: 'true', actual '" + oObj.isBeforeFirst() + "'") + bIsBeforeFirst = bIsBeforeFirst AND oObj.isBeforeFirst() + + Out.Log("Trying to go to previous record") + oObj.previous() + Out.Log("isBeforeFirst(): expected: 'true', actual '" + oObj.isBeforeFirst() + "'") + bIsBeforeFirst = bIsBeforeFirst AND oObj.isBeforeFirst() + + + Test.MethodTested("beforeFirst()", bBeforeFirst) + Test.MethodTested("isBeforeFirst()", bIsBeforeFirst) + Test.MethodTested("isFirst()", bIsFirst) + Test.MethodTested("first()", bFirst) + Test.MethodTested("next()", bNext) + + Test.MethodTested("afterLast()", bAfterLast) + Test.MethodTested("isAfterLast()", bIsAfterLast) + Test.MethodTested("isLast()", bIsLast) + Test.MethodTested("last()", bLast) + Test.MethodTested("previous()", bPrevious) + + Test.MethodTested("getRow()", bGetRow) + + + Test.StartMethod("absolute()") + bOK = true + Out.Log("Go to second record") + oObj.absolute(2) + Out.Log("RowDsc should contain " + cXResultSetRecord2) + Out.Log("RowDsc is '" + oObj.getString(1) + "'") + bOK = bOK AND inStr(1, oObj.getString(1), cXResultSetRecord2) + Out.Log("Go to record -1") + oObj.absolute(-1) + Out.Log("RowDsc is '" + oObj.getString(1) + "'") + Out.Log("IsLast(): expected: 'true', actual '" + oObj.IsLast() + "'") + bOK = bOK AND oObj.isLast() + Out.Log("Go to record -2") + oObj.absolute(-2) + Out.Log("IsLast(): expected: 'false', actual '" + oObj.IsLast() + "'") + bOK = bOK AND NOT oObj.isLast() + Out.Log("RowDsc should contain " + cXResultSet2BeforeLastRecord) + Out.Log("RowDsc is '" + oObj.getString(1) + "'") + bOK = bOK AND inStr(1, oObj.getString(1), cXResultSet2BeforeLastRecord) + Test.MethodTested("absolute()", bOK) + + Test.StartMethod("relative()") + bOK = true + Out.Log("Go to before first record") + oObj.beforeFirst() + on error goto RelativeErrHndl + oObj.relative(1) + Out.Log("Exception expected!") + bOK = false + goto ContRelative + RelativeErrHndl: + Out.Log("Expected exception.") + + ContRelative: + On Error Goto NewErrHndl + Out.Log("Go to first record and relative(1)") + oObj.next() + oObj.relative(1) + Out.Log("RowDsc should contain " + cXResultSetRecord2) + Out.Log("RowDsc is '" + oObj.getString(1) + "'") + bOK = bOK AND inStr(1, oObj.getString(1), cXResultSetRecord2) + Out.Log("Go to relative(-1)") + oObj.relative(-1) + Out.Log("RowDsc should contain " + cXResultSetRecord1) + Out.Log("RowDsc is '" + oObj.getString(1) + "'") + bOK = bOK AND inStr(1, oObj.getString(1), cXResultSetRecord1) + Out.Log("RowDsc is '" + oObj.getString(1) + "'") + Test.MethodTested("relative()", bOK) + + Test.StartMethod("refreshRow()") + bOK = true + oObj.refreshRow() + Test.MethodTested("refreshRow()", bOK) + + Test.StartMethod("rowUpdated()") + bOK = true + Out.Log("rowUpdated() is " + oObj.rowUpdated()) + bOK = bOK AND NOT oObj.rowUpdated() + Test.MethodTested("rowUpdated()", bOK) + + Test.StartMethod("rowInserted()") + bOK = true + Out.Log("rowInserted() is " + oObj.rowInserted()) + bOK = bOK AND NOT oObj.rowInserted() + Test.MethodTested("rowInserted()", bOK) + + Test.StartMethod("rowDeleted()") + bOK = true + Out.Log("rowDeleted() is " + oObj.rowDeleted()) + bOK = bOK AND NOT oObj.rowDeleted() + Test.MethodTested("rowDeleted()", bOK) + + Test.StartMethod("getStatement()") + bOK = true + oStatement = oObj.getStatement() + bOK = bOK AND NOT isNULL(oStatement) + Test.MethodTested("getStatement()", bOK) + +Exit Sub +NewErrHndl: +ErrHndl: + Test.Exception() + bOK = false + bLoopError = true + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sdbc/XResultSetMetaDataSupplier/script.xlb b/qadevOOo/tests/basic/ifc/sdbc/XResultSetMetaDataSupplier/script.xlb new file mode 100644 index 000000000000..6e3f9179b493 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sdbc/XResultSetMetaDataSupplier/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="sdbc_XResultSetMetaDataSupplier" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sdbc_XResultSetMetaDataSupplier"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sdbc/XResultSetMetaDataSupplier/sdbc_XResultSetMetaDataSupplier.xba b/qadevOOo/tests/basic/ifc/sdbc/XResultSetMetaDataSupplier/sdbc_XResultSetMetaDataSupplier.xba new file mode 100644 index 000000000000..53301bf52e90 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sdbc/XResultSetMetaDataSupplier/sdbc_XResultSetMetaDataSupplier.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="sdbc_XResultSetMetaDataSupplier" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.sdbc.XResultSetMetaDataSupplier +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim oMetaData As Object + + + Test.StartMethod("getMetaData()") + bOK = true + oMetaData = oObj.getMetaData() + bOK = bOK AND hasUnoInterfaces(oMetaData, "com.sun.star.sdbc.XResultSetMetaData") + Test.MethodTested("getMetaData()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sdbc/XResultSetUpdate/script.xlb b/qadevOOo/tests/basic/ifc/sdbc/XResultSetUpdate/script.xlb new file mode 100644 index 000000000000..139cb18cc2f4 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sdbc/XResultSetUpdate/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="sdbc_XResultSetUpdate" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sdbc_XResultSetUpdate"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sdbc/XResultSetUpdate/sdbc_XResultSetUpdate.xba b/qadevOOo/tests/basic/ifc/sdbc/XResultSetUpdate/sdbc_XResultSetUpdate.xba new file mode 100644 index 000000000000..95b3788ed51a --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sdbc/XResultSetUpdate/sdbc_XResultSetUpdate.xba @@ -0,0 +1,138 @@ +<?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="sdbc_XResultSetUpdate" 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. +' +'************************************************************************* +'************************************************************************* + + + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' - Global textColumn As String + +'************************************************************************* + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.sdbc.XResultSetUpdate +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim iCount As Integer + Dim cString As String + Dim colIdx As Integer + + colIdx = oObj.findColumn(textColumn) + + Test.StartMethod("insertRow()") + bOK = true + iCount = countRows() + Out.Log("Initially " + countRows() + " records") + oObj.moveToInsertRow() + oObj.updateString(colIdx, "New string") + oObj.insertRow() + Out.Log("After inserting " + countRows() + " records") + oObj.last() + bOK = bOK AND oObj.getString(colIdx) = "New string" + bOK = bOK AND iCount = countRows() - 1 + Test.MethodTested("insertRow()", bOK) + + Test.StartMethod("cancelRowUpdates()") + bOK = true + oObj.last() + oObj.updateString(colIdx, "Changed string") + oObj.cancelRowUpdates() + bOK = bOK AND oObj.getString(colIdx) = "New string" + bOK = bOK AND iCount = countRows() - 1 + Test.MethodTested("cancelRowUpdates()", bOK) + + Test.StartMethod("updateRow()") + bOK = true + oObj.last() + oObj.updateString(colIdx, "Changed string") + oObj.updateRow() + bOK = bOK AND oObj.getString(colIdx) = "Changed string" + bOK = bOK AND iCount = countRows() - 1 + Test.MethodTested("updateRow()", bOK) + + Test.StartMethod("deleteRow()") + Dim rowsBefore As Integer, rowsAfter As Integer + bOK = true + rowsBefore = countRows() + oObj.Last() + oObj.deleteRow() + rowsAfter = countRows() + Out.Log("Rows before: " + rowsBefore + ", rows after: " + rowsAfter) + bOK = bOK AND iCount = rowsAfter + oObj.Last() + Out.Log(oObj.getString(colIdx)) + Test.MethodTested("deleteRow()", bOK) + + Test.StartMethod("moveToInsertRow()") + bOK = true + oObj.moveToInsertRow() + bOK = bOK AND oObj.getString(colIdx) = "" + Test.MethodTested("moveToInsertRow()", bOK) + + Test.StartMethod("moveToCurrentRow()") + bOK = true + oObj.first() + oObj.next() + cString = oObj.getString(colIdx) + oObj.moveToInsertRow() + oObj.moveToCurrentRow() + bOK = bOK AND oObj.getString(colIdx) = cString + Test.MethodTested("moveToCurrentRow()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +Function countRows() As Integer + Dim iCount As Integer + iCount = 0 + oObj.first() + while NOT oObj.isAfterLast() + iCount = iCount + 1 + oObj.next() + wend + countRows() = iCount +End Function +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sdbc/XRow/script.xlb b/qadevOOo/tests/basic/ifc/sdbc/XRow/script.xlb new file mode 100644 index 000000000000..0cda44d376bf --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sdbc/XRow/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="sdbc_XRow" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sdbc_XRow"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sdbc/XRow/sdbc_XRow.xba b/qadevOOo/tests/basic/ifc/sdbc/XRow/sdbc_XRow.xba new file mode 100644 index 000000000000..bfac0743d4b8 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sdbc/XRow/sdbc_XRow.xba @@ -0,0 +1,317 @@ +<?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="sdbc_XRow" 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 + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' - Global rowTypes As Variant +' Array of Strings with description of column types + +'************************************************************************* + + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.sdbc.XRow +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim i As Integer + Dim colType As String + + Test.StartMethod("getBoolean()") + bOK = true + colType = "boolean" + i = findColumn(colType) + if i >= 0 then + oObj.getBoolean(i) + else + Out.Log("!!! Column of type '" + colType + "' is not found. No test performed.") + Out.Log("Nevertheless status is OK") + end if + Test.MethodTested("getBoolean()", bOK) + + Test.StartMethod("getByte()") + bOK = true + colType = "byte" + i = findColumn(colType) + if i >= 0 then + oObj.getByte(i + 1) + else + Out.Log("!!! Column of type '" + colType + "' is not found. No test performed.") + Out.Log("Nevertheless status is OK") + end if + Test.MethodTested("getByte()", bOK) + + Test.StartMethod("getShort()") + bOK = true + colType = "short" + i = findColumn(colType) + if i >= 0 then + oObj.getShort(i + 1) + else + Out.Log("!!! Column of type '" + colType + "' is not found. No test performed.") + Out.Log("Nevertheless status is OK") + end if + Test.MethodTested("getShort()", bOK) + + Test.StartMethod("getInt()") + bOK = true + colType = "int" + i = findColumn(colType) + if i >= 0 then + oObj.getInt(i + 1) + else + Out.Log("!!! Column of type '" + colType + "' is not found. No test performed.") + Out.Log("Nevertheless status is OK") + end if + Test.MethodTested("getInt()", bOK) + + Test.StartMethod("getLong()") + bOK = true + colType = "long" + i = findColumn(colType) + if i >= 0 then + oObj.getLong(i + 1) + else + Out.Log("!!! Column of type '" + colType + "' is not found. No test performed.") + Out.Log("Nevertheless status is OK") + end if + Test.MethodTested("getLong()", bOK) + + Test.StartMethod("getFloat()") + bOK = true + colType = "float" + i = findColumn(colType) + if i >= 0 then + oObj.getFloat(i + 1) + else + Out.Log("!!! Column of type '" + colType + "' is not found. No test performed.") + Out.Log("Nevertheless status is OK") + end if + Test.MethodTested("getFloat()", bOK) + + Test.StartMethod("getDouble()") + bOK = true + colType = "double" + i = findColumn(colType) + if i >= 0 then + oObj.getDouble(i + 1) + else + Out.Log("!!! Column of type '" + colType + "' is not found. No test performed.") + Out.Log("Nevertheless status is OK") + end if + Test.MethodTested("getDouble()", bOK) + + Test.StartMethod("getString()") + bOK = true + colType = "string" + i = findColumn(colType) + if i >= 0 then + oObj.getString(i + 1) + else + Out.Log("!!! Column of type '" + colType + "' is not found. No test performed.") + Out.Log("Nevertheless status is OK") + end if + Test.MethodTested("getString()", bOK) + + Test.StartMethod("getBytes()") + bOK = true + colType = "bytes" + i = findColumn(colType) + if i >= 0 then + oObj.getBytes(i + 1) + else + Out.Log("!!! Column of type '" + colType + "' is not found. No test performed.") + Out.Log("Nevertheless status is OK") + end if + Test.MethodTested("getBytes()", bOK) + + Test.StartMethod("getDate()") + bOK = true + colType = "date" + i = findColumn(colType) + if i >= 0 then + oObj.getDate(i + 1) + else + Out.Log("!!! Column of type '" + colType + "' is not found. No test performed.") + Out.Log("Nevertheless status is OK") + end if + Test.MethodTested("getDate()", bOK) + + Test.StartMethod("getTime()") + bOK = true + colType = "time" + i = findColumn(colType) + if i >= 0 then + oObj.getTime(i + 1) + else + Out.Log("!!! Column of type '" + colType + "' is not found. No test performed.") + Out.Log("Nevertheless status is OK") + end if + Test.MethodTested("getTime()", bOK) + + Test.StartMethod("getTimestamp()") + bOK = true + colType = "timestamp" + i = findColumn(colType) + if i >= 0 then + oObj.getTimestamp(i + 1) + else + Out.Log("!!! Column of type '" + colType + "' is not found. No test performed.") + Out.Log("Nevertheless status is OK") + end if + Test.MethodTested("getTimestamp()", bOK) + + Test.StartMethod("getBinaryStream()") + bOK = true + colType = "binarystream" + i = findColumn(colType) + if i >= 0 then + oObj.getBinaryStream(i + 1) + else + Out.Log("!!! Column of type '" + colType + "' is not found. No test performed.") + Out.Log("Nevertheless status is OK") + end if + Test.MethodTested("getBinaryStream()", bOK) + + Test.StartMethod("getCharacterStream()") + bOK = true + colType = "characterstream" + i = findColumn(colType) + if i >= 0 then + oObj.getCharacterStream(i + 1) + else + Out.Log("!!! Column of type '" + colType + "' is not found. No test performed.") + Out.Log("Nevertheless status is OK") + end if + Test.MethodTested("getCharacterStream()", bOK) + + Test.StartMethod("getObject()") + bOK = true + colType = "object" + i = findColumn(colType) + if i >= 0 then + oObj.getObject(i + 1) + else + Out.Log("!!! Column of type '" + colType + "' is not found. No test performed.") + Out.Log("Nevertheless status is OK") + end if + Test.MethodTested("getObject()", bOK) + + Test.StartMethod("getRef()") + bOK = true + colType = "ref" + i = findColumn(colType) + if i >= 0 then + oObj.getRef(i + 1) + else + Out.Log("!!! Column of type '" + colType + "' is not found. No test performed.") + Out.Log("Nevertheless status is OK") + end if + Test.MethodTested("getRef()", bOK) + + Test.StartMethod("getBlob()") + bOK = true + colType = "blob" + i = findColumn(colType) + if i >= 0 then + oObj.getBlob(i + 1) + else + Out.Log("!!! Column of type '" + colType + "' is not found. No test performed.") + Out.Log("Nevertheless status is OK") + end if + Test.MethodTested("getBlob()", bOK) + + Test.StartMethod("getClob()") + bOK = true + colType = "clob" + i = findColumn(colType) + if i >= 0 then + oObj.getClob(i + 1) + else + Out.Log("!!! Column of type '" + colType + "' is not found. No test performed.") + Out.Log("Nevertheless status is OK") + end if + Test.MethodTested("getClob()", bOK) + + Test.StartMethod("getArray()") + bOK = true + colType = "array" + i = findColumn(colType) + if i >= 0 then + oObj.getArray(i + 1) + else + Out.Log("!!! Column of type '" + colType + "' is not found. No test performed.") + Out.Log("Nevertheless status is OK") + end if + Test.MethodTested("getArray()", bOK) + + + Test.StartMethod("wasNull()") + bOK = true + oObj.wasNull() + Test.MethodTested("wasNull()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub + +Function findColumn(cType As String) As Integer + Dim i As Integer + + for i = lbound(rowTypes()) to ubound(rowTypes()) + if rowTypes(i) = cType then + findColumn() = rowTypesCol(i) + exit function + end if + next i + + findColumn() = -1 +End function +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sdbc/XRowSet/script.xlb b/qadevOOo/tests/basic/ifc/sdbc/XRowSet/script.xlb new file mode 100644 index 000000000000..099e40a905dc --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sdbc/XRowSet/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="sdbc_XRowSet" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sdbc_XRowSet"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sdbc/XRowSet/sdbc_XRowSet.xba b/qadevOOo/tests/basic/ifc/sdbc/XRowSet/sdbc_XRowSet.xba new file mode 100644 index 000000000000..5c7f4725cf3e --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sdbc/XRowSet/sdbc_XRowSet.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="sdbc_XRowSet" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.sdbc.XRowSet +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim list1 As Object, list2 As Object + + bOK = true + Test.StartMethod("addRowSetListener()") + + list1 = createUnoListener("L1_", "com.sun.star.sdbc.XRowSetListener") + list2 = createUnoListener("L2_", "com.sun.star.sdbc.XRowSetListener") + oObj.addRowSetListener(list1) + oObj.addRowSetListener(list2) + + Test.StartMethod("removeRowSetListener()") + oObj.removeRowSetListener(list1) + + Test.StartMethod("execute()") + + l1Called = false + l2Called = false + + oObj.execute() + bOK = bOK AND l2Called + Test.MethodTested("execute()", bOK) + Test.MethodTested("addRowSetListener()", bOK) + + bOK = bOK AND NOT l1Called + Test.MethodTested("removeRowSetListener()", bOK) + + oObj.removeRowSetListener(list2) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub + +Dim l1Called As Boolean, l2Called As Boolean + +Sub L1_cursorMoved() +End Sub +Sub L1_rowChanged() +End Sub +Sub L1_disposing() +End Sub +Sub L1_rowSetChanged() + l1Called = true + Out.Log("Listener 1 called") +End Sub + +Sub L2_cursorMoved() +End Sub +Sub L2_rowChanged() +End Sub +Sub L2_disposing() +End Sub +Sub L2_rowSetChanged() + l2Called = true + Out.Log("Listener 2 called") +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sdbc/XRowUpdate/script.xlb b/qadevOOo/tests/basic/ifc/sdbc/XRowUpdate/script.xlb new file mode 100644 index 000000000000..7d8d5fb30e23 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sdbc/XRowUpdate/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="sdbc_XRowUpdate" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sdbc_XRowUpdate"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sdbc/XRowUpdate/sdbc_XRowUpdate.xba b/qadevOOo/tests/basic/ifc/sdbc/XRowUpdate/sdbc_XRowUpdate.xba new file mode 100644 index 000000000000..03dab0a3ccbf --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sdbc/XRowUpdate/sdbc_XRowUpdate.xba @@ -0,0 +1,514 @@ +<?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="sdbc_XRowUpdate" 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 + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' - Global rowTypes As Variant +' must be an array of Strings with description of column types +' - Global rowTypesCol As Variant +' corresponding column numbers + +'************************************************************************* + + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.sdbc.XRowUpdate +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean, bNullOK As Boolean + Dim i As Integer + Dim getV As Variant, newV As Variant, resV As Variant + Dim colType As String + + if NOT hasUnoInterfaces(oObj, "com.sun.star.sdbc.XRow") then + Out.Log("The interface com.sun.star.sdbc.XRow isn't supported by the component.") + Out.Log("The test must be upgraded !!!") + exit Sub + end if + + Test.RecreateObj() + + bNullOK = true + + Test.StartMethod("updateBoolean()") + colType = "boolean" + i = findColumn(colType) + if i >= 0 then + bOK = true + getV = oObj.getBoolean(i+1) + newV = NOT getV + oObj.updateBoolean(i+1, newV) + resV = oObj.getBoolean(i+1) + Out.Log("Was: " + getv + ", New: " + newV + ", Res: " + resV) + bOK = bOK AND (resV = newV) + Test.MethodTested("updateBoolean()", bOK) + + oObj.updateNull(i+1) + oObj.getBoolean(i+1) + bNullOK = bNullOK AND oObj.wasNull() + else + Out.Log("!!! Column of type '" + colType + "' is not found. No test performed.") + Out.Log("Nevertheless status is OK") + Test.MethodTested("updateBoolean()", true) + end if + + Test.StartMethod("updateByte()") + colType = "byte" + i = findColumn(colType) + if i >= 0 then + bOK = true + getV = oObj.getByte(i+1) + newV = getV + 1 + oObj.updateByte(i+1, newV) + resV = oObj.getByte(i+1) + Out.Log("Was: " + getv + ", New: " + newV + ", Res: " + resV) + bOK = bOK AND (resV = newV) + Test.MethodTested("updateByte()", bOK) + + oObj.updateNull(i+1) + oObj.getByte(i+1) + bNullOK = bNullOK AND oObj.wasNull() + else + Out.Log("!!! Column of type '" + colType + "' is not found. No test performed.") + Out.Log("Nevertheless status is OK") + Test.MethodTested("updateByte()", true) + end if + + Test.StartMethod("updateShort()") + colType = "short" + i = findColumn(colType) + if i >= 0 then + bOK = true + getV = oObj.getShort(i+1) + newV = getV + 1 + oObj.updateShort(i+1, newV) + resV = oObj.getShort(i+1) + Out.Log("Was: " + getv + ", New: " + newV + ", Res: " + resV) + bOK = bOK AND (resV = newV) + Test.MethodTested("updateShort()", bOK) + + oObj.updateNull(i+1) + oObj.getShort(i+1) + bNullOK = bNullOK AND oObj.wasNull() + else + Out.Log("!!! Column of type '" + colType + "' is not found. No test performed.") + Out.Log("Nevertheless status is OK") + Test.MethodTested("updateShort()", true) + end if + + Test.StartMethod("updateInt()") + colType = "int" + i = findColumn(colType) + if i >= 0 then + bOK = true + getV = oObj.getInt(i+1) + newV = getV + 1 + oObj.updateInt(i+1, newV) + resV = oObj.getInt(i+1) + Out.Log("Was: " + getv + ", New: " + newV + ", Res: " + resV) + bOK = bOK AND (resV = newV) + Test.MethodTested("updateInt()", bOK) + + oObj.updateNull(i+1) + oObj.getInt(i+1) + bNullOK = bNullOK AND oObj.wasNull() + else + Out.Log("!!! Column of type '" + colType + "' is not found. No test performed.") + Out.Log("Nevertheless status is OK") + Test.MethodTested("updateInt()", true) + end if + + Test.StartMethod("updateLong()") + colType = "long" + i = findColumn(colType) + if i >= 0 then + bOK = true + getV = oObj.getLong(i+1) + newV = getV + 1 + oObj.updateLong(i+1, newV) + resV = oObj.getLong(i+1) + Out.Log("Was: " + getv + ", New: " + newV + ", Res: " + resV) + bOK = bOK AND (resV = newV) + Test.MethodTested("updateLong()", bOK) + + oObj.updateNull(i+1) + oObj.getLong(i+1) + bNullOK = bNullOK AND oObj.wasNull() + else + Out.Log("!!! Column of type '" + colType + "' is not found. No test performed.") + Out.Log("Nevertheless status is OK") + Test.MethodTested("updateLong()", true) + end if + + Test.StartMethod("updateFloat()") + colType = "float" + i = findColumn(colType) + if i >= 0 then + bOK = true + getV = oObj.getFloat(i+1) + newV = getV + 1.3 + oObj.updateFloat(i+1, newV) + resV = oObj.getFloat(i+1) + Out.Log("Was: " + getv + ", New: " + newV + ", Res: " + resV) + bOK = bOK AND (resV = newV) + Test.MethodTested("updateFloat()", bOK) + + oObj.updateNull(i+1) + oObj.getFloat(i+1) + bNullOK = bNullOK AND oObj.wasNull() + else + Out.Log("!!! Column of type '" + colType + "' is not found. No test performed.") + Out.Log("Nevertheless status is OK") + Test.MethodTested("updateFloat()", true) + end if + + Test.StartMethod("updateDouble()") + colType = "double" + i = findColumn(colType) + if i >= 0 then + bOK = true + getV = oObj.getDouble(i+1) + newV = getV + 1.5 + oObj.updateDouble(i+1, newV) + resV = oObj.getDouble(i+1) + Out.Log("Was: " + getv + ", New: " + newV + ", Res: " + resV) + bOK = bOK AND (resV = newV) + Test.MethodTested("updateDouble()", bOK) + + oObj.updateNull(i+1) + oObj.getDouble(i+1) + bNullOK = bNullOK AND oObj.wasNull() + else + Out.Log("!!! Column of type '" + colType + "' is not found. No test performed.") + Out.Log("Nevertheless status is OK") + Test.MethodTested("updateDouble()", true) + end if + + Test.StartMethod("updateString()") + colType = "string" + i = findColumn(colType) + if i >= 0 then + bOK = true + getV = oObj.getString(i+1) + newV = "_" + getV + oObj.updateString(i+1, newV) + resV = oObj.getString(i+1) + Out.Log("Was: '" + getv + "', New: '" + newV + "', Res: '" + resV + "'") + bOK = bOK AND (resV = newV) + Test.MethodTested("updateString()", bOK) + + oObj.updateNull(i+1) + oObj.getString(i+1) + bNullOK = bNullOK AND oObj.wasNull() + else + Out.Log("!!! Column of type '" + colType + "' is not found. No test performed.") + Out.Log("Nevertheless status is OK") + Test.MethodTested("updateString()", true) + end if + + Test.StartMethod("updateBytes()") + colType = "bytes" + i = findColumn(colType) + if i >= 0 then + bOK = true + getV = oObj.getBytes(i+1) + + if (oObj.wasNull() OR ubound(getV()) < 0) then + newV = Array(1,2,3) + else + newV = getV + newV(0) = newV(0) + 1 + end if + + oObj.updateBytes(i+1, newV) + resV = oObj.getBytes(i+1) + + Out.Log("Was: " + getv(0) + ", New: " + newV(0) + ", Res: " + resV(0)) + bOK = bOK AND (resV(0) = newV(0)) + Test.MethodTested("updateBytes()", bOK) + + oObj.updateNull(i+1) + oObj.getBytes(i+1) + bNullOK = bNullOK AND oObj.wasNull() + else + Out.Log("!!! Column of type '" + colType + "' is not found. No test performed.") + Out.Log("Nevertheless status is OK") + Test.MethodTested("updateBytes()", true) + end if + + + Dim dat As com.sun.star.util.Date + Test.StartMethod("updateDate()") + colType = "date" + i = findColumn(colType) + if i >= 0 then + bOK = true + getV = oObj.getDate(i+1) + if (oObj.wasNull() OR isNull(getV)) then + newV = dat + else + newV = getV + newV.Year = newV.Year + 1 + end if + + oObj.updateDate(i+1, newV) + resV = oObj.getDate(i+1) + Out.Log("Was: '" + getv.Year + "', New: '" + newV.Year + "', Res: '" + resV.Year + "'") + bOK = bOK AND (resV.Year = newV.Year) + Test.MethodTested("updateDate()", bOK) + + oObj.updateNull(i+1) + oObj.getDate(i+1) + bNullOK = bNullOK AND oObj.wasNull() + else + Out.Log("!!! Column of type '" + colType + "' is not found. No test performed.") + Out.Log("Nevertheless status is OK") + Test.MethodTested("updateDate()", true) + end if + + Dim tim As com.sun.star.util.Time + Test.StartMethod("updateTime()") + colType = "time" + i = findColumn(colType) + if i >= 0 then + bOK = true + getV = oObj.getTime(i+1) + if (oObj.wasNull() OR isNull(getV)) then + newV = tim + else + newV = getV + newV.Seconds = newV.Seconds + 1 + end if + + oObj.updateTime(i+1, newV) + resV = oObj.getTime(i+1) + Out.Log("Was: '" + getv.Seconds + "', New: '" + newV.Seconds + "', Res: '" + resV.Seconds + "'") + bOK = bOK AND (resV.Seconds = newV.Seconds) + Test.MethodTested("updateTime()", bOK) + + oObj.updateNull(i+1) + oObj.getTime(i+1) + bNullOK = bNullOK AND oObj.wasNull() + else + Out.Log("!!! Column of type '" + colType + "' is not found. No test performed.") + Out.Log("Nevertheless status is OK") + Test.MethodTested("updateTime()", true) + end if + + Dim dattm As com.sun.star.util.DateTime + Test.StartMethod("updateTimestamp()") + colType = "timestamp" + i = findColumn(colType) + if i >= 0 then + bOK = true + getV = oObj.getTimestamp(i+1) + if (oObj.wasNull() OR isNull(getV)) then + newV = dattm + else + newV = getV + newV.Year = newV.Year + 1 + end if + + oObj.updateTimestamp(i+1, newV) + resV = oObj.getTimestamp(i+1) + Out.Log("Was: '" + getv.Year + "', New: '" + newV.Year + "', Res: '" + resV.Year + "'") + bOK = bOK AND (resV.Year = newV.Year) + Test.MethodTested("updateTimestamp()", bOK) + + oObj.updateNull(i+1) + oObj.getTimestamp(i+1) + bNullOK = bNullOK AND oObj.wasNull() + else + Out.Log("!!! Column of type '" + colType + "' is not found. No test performed.") + Out.Log("Nevertheless status is OK") + Test.MethodTested("updateTimestamp()", true) + end if + + Dim bytes As Variant, nBytes As Long + Test.StartMethod("updateCharacterStream()") + colType = "characterstream" + i = findColumn(colType) + if i >= 0 then + bOK = true + newV = createUnoService("com.sun.star.io.Pipe") + newV.writeBytes(Array(123, 234)) + oObj.updateCharacterStream(i+1, newV) + resV = oObj.getCharacterStream(i+1) + 'Out.Log("Was: '" + getv + "', New: '" + newV + "', Res: '" + resV + "'") + bOK = bOK AND NOT oObj.wasNull() AND NOT isNull(resV) + + if bOK then + Out.Log("Testing further ...") + nBytes = resV.readBytes(bytes, 2) + bOK = bOK AND (nBytes = 2) AND (bytes(0) = 123) AND (bytes(1) = 234) + end if + + Test.MethodTested("updateCharacterStream()", bOK) + + oObj.updateNull(i+1) + oObj.getCharacterStream(i+1) + bNullOK = bNullOK AND oObj.wasNull() + else + Out.Log("!!! Column of type '" + colType + "' is not found. No test performed.") + Out.Log("Nevertheless status is OK") + Test.MethodTested("updateCharacterStream()", true) + end if + + Test.StartMethod("updateBinaryStream()") + colType = "binarystream" + i = findColumn(colType) + if i >= 0 then + bOK = true + newV = createUnoService("com.sun.star.io.Pipe") + newV.writeBytes(Array(123, 234)) + oObj.updateBinaryStream(i+1, newV) + resV = oObj.getBinaryStream(i+1) + 'Out.Log("Was: '" + getv + "', New: '" + newV + "', Res: '" + resV + "'") + bOK = bOK AND NOT oObj.wasNull() AND NOT isNull(resV) + + if bOK then + Out.Log("Testing further ...") + nBytes = resV.readBytes(bytes, 2) + bOK = bOK AND (nBytes = 2) AND (bytes(0) = 123) AND (bytes(1) = 234) + end if + + Test.MethodTested("updateBinaryStream()", bOK) + + oObj.updateNull(i+1) + oObj.getBinaryStream(i+1) + bNullOK = bNullOK AND oObj.wasNull() + else + Out.Log("!!! Column of type '" + colType + "' is not found. No test performed.") + Out.Log("Nevertheless status is OK") + Test.MethodTested("updateBinaryStream()", true) + end if + + Test.StartMethod("updateObject()") + colType = "object" + i = findColumn(colType) + if i >= 0 then + bOK = true + getV = oObj.getObject(i+1) + if (NOT hasUnoInterfaces(getV, "com.sun.star.io.XInputStream")) then + newV = createUnoService("com.sun.star.io.DataInputStream") + else + newV = createUnoService("com.sun.star.io.DataOutputStream") + end if + + oObj.updateObject(i+1, newV) + resV = oObj.getObject(i+1) + + bOK = bOK AND (hasUnoInterfaces(newV, "com.sun.star.io.XInputStream") = _ + hasUnoInterfaces(resV, "com.sun.star.io.XInputStream")) AND _ + (hasUnoInterfaces(newV, "com.sun.star.io.XOutputStream") = _ + hasUnoInterfaces(resV, "com.sun.star.io.XOutputStream")) + + Test.MethodTested("updateObject()", bOK) + + oObj.updateNull(i+1) + oObj.getObject(i+1) + bNullOK = bNullOK AND oObj.wasNull() + else + Out.Log("!!! Column of type '" + colType + "' is not found. No test performed.") + Out.Log("Nevertheless status is OK") + Test.MethodTested("updateObject()", true) + end if + + Test.StartMethod("updateNumericObject()") + colType = "numericobject" + i = findColumn(colType) + if i >= 0 then + bOK = true + getV = oObj.getNumericObject(i+1) + if (NOT hasUnoInterfaces(getV, "com.sun.star.io.XInputStream")) then + newV = createUnoService("com.sun.star.io.DataInputStream") + else + newV = createUnoService("com.sun.star.io.DataOutputStream") + end if + + oObj.updateNumericObject(i+1, newV, 0) + resV = oObj.getNumericObject(i+1) + + bOK = bOK AND (hasUnoInterfaces(newV, "com.sun.star.io.XInputStream") = _ + hasUnoInterfaces(resV, "com.sun.star.io.XInputStream")) AND _ + (hasUnoInterfaces(newV, "com.sun.star.io.XOutputStream") = _ + hasUnoInterfaces(resV, "com.sun.star.io.XOutputStream")) + + Test.MethodTested("updateNumericObject()", bOK) + + oObj.updateNull(i+1) + oObj.getNumericObject(i+1) + bNullOK = bNullOK AND oObj.wasNull() + else + Out.Log("!!! Column of type '" + colType + "' is not found. No test performed.") + Out.Log("Nevertheless status is OK") + Test.MethodTested("updateNumericObject()", true) + end if + + Test.StartMethod("updateNull()") + Test.MethodTested("updateNull()", bNullOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub + +Function findColumn(cType As String) As Integer + Dim i As Integer + + for i = lbound(rowTypes()) to ubound(rowTypes()) + if rowTypes(i) = cType then + findColumn() = rowTypesCol(i) - 1 + exit function + end if + next i + + findColumn() = -1 +End function +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sdbc/XWarningsSupplier/script.xlb b/qadevOOo/tests/basic/ifc/sdbc/XWarningsSupplier/script.xlb new file mode 100644 index 000000000000..20435089b7f1 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sdbc/XWarningsSupplier/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="sdbc_XWarningsSupplier" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sdbc_XWarningsSupplier"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sdbc/XWarningsSupplier/sdbc_XWarningsSupplier.xba b/qadevOOo/tests/basic/ifc/sdbc/XWarningsSupplier/sdbc_XWarningsSupplier.xba new file mode 100644 index 000000000000..39ac1729e41d --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sdbc/XWarningsSupplier/sdbc_XWarningsSupplier.xba @@ -0,0 +1,64 @@ +<?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="sdbc_XWarningsSupplier" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.sdbc.XWarningsSupplier +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Test.StartMethod("clearWarnings()") + bOK = true + oObj.clearWarnings() + Test.MethodTested("clearWarnings()", bOK) + + + Test.StartMethod("getWarnings()") + bOK = true + bOK = bOK AND isEmpty(oObj.getWarnings()) + Test.MethodTested("getWarnings()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sdbcx/ResultSet/script.xlb b/qadevOOo/tests/basic/ifc/sdbcx/ResultSet/script.xlb new file mode 100644 index 000000000000..a9e55834fd82 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sdbcx/ResultSet/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="sdbcx_ResultSet" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sdbcx_ResultSet"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sdbcx/ResultSet/sdbcx_ResultSet.xba b/qadevOOo/tests/basic/ifc/sdbcx/ResultSet/sdbcx_ResultSet.xba new file mode 100644 index 000000000000..c2374f8b30fe --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sdbcx/ResultSet/sdbcx_ResultSet.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="sdbcx_ResultSet" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.sdbcx.ResultSet +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + PropertyTester.TestProperty("IsBookmarkable") + + PropertyTester.TestProperty("CanUpdateInsertedRows") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sdbcx/XColumnsSupplier/script.xlb b/qadevOOo/tests/basic/ifc/sdbcx/XColumnsSupplier/script.xlb new file mode 100644 index 000000000000..0d8eeef2548c --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sdbcx/XColumnsSupplier/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="sdbcx_XColumnsSupplier" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sdbcx_XColumnsSupplier"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sdbcx/XColumnsSupplier/sdbcx_XColumnsSupplier.xba b/qadevOOo/tests/basic/ifc/sdbcx/XColumnsSupplier/sdbcx_XColumnsSupplier.xba new file mode 100644 index 000000000000..1dae513a0754 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sdbcx/XColumnsSupplier/sdbcx_XColumnsSupplier.xba @@ -0,0 +1,67 @@ +<?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="sdbcx_XColumnsSupplier" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.sdbcx.XColumnsSupplier +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + Test.StartMethod("getColumns()") + bOK = true + oCols = oObj.getColumns() + bOK = bOK AND hasUnoInterfaces(oCols, "com.sun.star.container.XNameAccess") + if (bOK) then + cNames = oCols.getElementNames() + Out.Log("Following columns were found:") + for i = 0 to ubound(cNames) + Out.Log("'" & cNames(i) & "'") + next i + end if + Test.MethodTested("getColumns()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sdbcx/XDataDefinitionSupplier/script.xlb b/qadevOOo/tests/basic/ifc/sdbcx/XDataDefinitionSupplier/script.xlb new file mode 100644 index 000000000000..39e76d8ad1fd --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sdbcx/XDataDefinitionSupplier/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="sdbcx_XDataDefinitionSupplier" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sdbcx_XDataDefinitionSupplier"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sdbcx/XDataDefinitionSupplier/sdbcx_XDataDefinitionSupplier.xba b/qadevOOo/tests/basic/ifc/sdbcx/XDataDefinitionSupplier/sdbcx_XDataDefinitionSupplier.xba new file mode 100644 index 000000000000..37aae87150f8 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sdbcx/XDataDefinitionSupplier/sdbcx_XDataDefinitionSupplier.xba @@ -0,0 +1,74 @@ +<?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="sdbcx_XDataDefinitionSupplier" 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. +' +'************************************************************************* +'************************************************************************* + + + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' Global URL as String +' Global info As Variant + +'************************************************************************* + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.sdbcx.XDataDefinitionSupplier +'************************************************************************* +On Error Goto ErrHndl + Dim tableSupl As Object + Dim oConnection As Object + oConnection = oObj.connect(URL, info()) + + Test.StartMethod("getDataDefinitionByConnection()") + tableSupl = oObj.getDataDefinitionByConnection(oConnection) + Test.MethodTested("getDataDefinitionByConnection()", Not isNull(tableSupl)) + + Test.StartMethod("getDataDefinitionByURL()") + tableSupl = oObj.getDataDefinitionByURL(URL, info()) + Test.MethodTested("getDataDefinitionByURL()", Not isNull(tableSupl)) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sdbcx/XDeleteRows/script.xlb b/qadevOOo/tests/basic/ifc/sdbcx/XDeleteRows/script.xlb new file mode 100644 index 000000000000..aa38554c685f --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sdbcx/XDeleteRows/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="sdbcx_XDeleteRows" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sdbcx_XDeleteRows"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sdbcx/XDeleteRows/sdbcx_XDeleteRows.xba b/qadevOOo/tests/basic/ifc/sdbcx/XDeleteRows/sdbcx_XDeleteRows.xba new file mode 100644 index 000000000000..deafb4e55ad2 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sdbcx/XDeleteRows/sdbcx_XDeleteRows.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="sdbcx_XDeleteRows" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.sdbcx.XDeleteRows +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim bkmrk As Variant + Dim rowsBefore As Variant, rowsAfter As Variant + + + if NOT (hasUnoInterfaces(oObj, "com.sun.star.sdbcx.XRowLocate") AND _ + hasUnoInterfaces(oObj, "com.sun.star.sdbc.XResultSet")) then + + Out.Log("The component doesn't support one of the required interfaces.") + Out.Log("The test must be modified according to component testcase.") + Exit Sub + end if + + Test.StartMethod("deleteRows()") + bOK = true + + oObj.last() + rowsBefore = oObj.getRow() + oObj.first() + bkmrk = oObj.getBookmark() + + oObj.deleteRows(Array(bkmrk)) + + oObj.last() + rowsAfter = oObj.getRow() + + Out.Log("Rows before: " + rowsBefore + ", after: " + rowsAfter) + bOK = bOK AND (rowsBefore - 1 = rowsAfter) + Test.MethodTested("deleteRows()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sdbcx/XRowLocate/script.xlb b/qadevOOo/tests/basic/ifc/sdbcx/XRowLocate/script.xlb new file mode 100644 index 000000000000..519516b9ec25 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sdbcx/XRowLocate/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="sdbcx_XRowLocate" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sdbcx_XRowLocate"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sdbcx/XRowLocate/sdbcx_XRowLocate.xba b/qadevOOo/tests/basic/ifc/sdbcx/XRowLocate/sdbcx_XRowLocate.xba new file mode 100644 index 000000000000..2c25b4400324 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sdbcx/XRowLocate/sdbcx_XRowLocate.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="sdbcx_XRowLocate" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.sdbcx.XRowLocate +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim oBM1 As Variant + Dim oBM2 As Variant + Dim oBM3 As Variant + Dim oBM4 As Variant + Dim cDscr1 As String + Dim cDscr2 As String + + ReCreateObj() + + oObj.first() + + Test.StartMethod("getBookmark()") + bOK = true + oBM1 = oObj.getBookmark() + cDscr1 = oObj.getString(1) + Out.Log("Set bookmark to row " + cDscr1) + bOK = bOK AND NOT isNULL(oBM1) + Test.MethodTested("getBookmark()", bOK) + + Test.StartMethod("moveToBookmark()") + bOK = true + oObj.next() + cDscr2 = oObj.getString(1) + Out.Log("Now on " + cDscr2) + oObj.moveToBookmark(oBM1) + Out.Log("After movment on " + oObj.getString(1)) + bOK = bOK AND oObj.getString(1) = cDscr1 + Test.MethodTested("moveToBookmark()", bOK) + + Test.StartMethod("moveRelativeToBookmark()") + bOK = true + oObj.moveRelativeToBookmark(oBM1, 1) + Out.Log("After movment on " + oObj.getString(1)) + bOK = bOK AND oObj.getString(1) = cDscr2 + Test.MethodTested("moveRelativeToBookmark()", bOK) + + oBM2 = oObj.getBookmark() + + Test.StartMethod("compareBookmarks()") + bOK = true + ' if database driver supports ordered marks then + ' compareBookmarks should return values CompareBookmark::LESS or + ' CompareBookmark::GREATER in case when bookmarks are not equal + ' otherwise this method returnes only CompareBookmark::NOT_EQUAL + + if (oObj.hasOrderedBookmarks()) then + bOK = bOK AND oObj.compareBookmarks(oBM1, oBM1) = com.sun.star.sdbcx.CompareBookmark.EQUAL + bOK = bOK AND oObj.compareBookmarks(oBM1, oBM2) = com.sun.star.sdbcx.CompareBookmark.LESS + bOK = bOK AND oObj.compareBookmarks(oBM2, oBM1) = com.sun.star.sdbcx.CompareBookmark.GREATER + else + bOK = bOK AND oObj.compareBookmarks(oBM1, oBM1) = com.sun.star.sdbcx.CompareBookmark.EQUAL + bOK = bOK AND oObj.compareBookmarks(oBM1, oBM2) = com.sun.star.sdbcx.CompareBookmark.NOT_EQUAL + bOK = bOK AND oObj.compareBookmarks(oBM2, oBM1) = com.sun.star.sdbcx.CompareBookmark.NOT_EQUAL + end if + Test.MethodTested("compareBookmarks()", bOK) + + Test.StartMethod("hasOrderedBookmarks()") + bOK = true + bOK = bOK AND oObj.hasOrderedBookmarks() + Test.MethodTested("hasOrderedBookmarks()", bOK) + + Test.StartMethod("hashBookmark()") + bOK = true + + oObj.last() + oBM3 = oObj.getBookmark() + oObj.first() + oBM4 = oObj.getBookmark() + + bOK = bOK AND oObj.hashBookmark(oBM1) <> oObj.hashBookmark(oBM2) + bOK = bOK AND oObj.hashBookmark(oBM1) <> oObj.hashBookmark(oBM3) + bOK = bOK AND oObj.hashBookmark(oBM3) <> oObj.hashBookmark(oBM2) + bOK = bOK AND oObj.hashBookmark(oBM1) = oObj.hashBookmark(oBM4) + Test.MethodTested("hashBookmark()", bOK) + + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sheet/CellAreaLink/script.xlb b/qadevOOo/tests/basic/ifc/sheet/CellAreaLink/script.xlb new file mode 100644 index 000000000000..c731910c87be --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/CellAreaLink/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="sheet_CellAreaLink" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sheet_CellAreaLink"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sheet/CellAreaLink/sheet_CellAreaLink.xba b/qadevOOo/tests/basic/ifc/sheet/CellAreaLink/sheet_CellAreaLink.xba new file mode 100644 index 000000000000..71b64f1f89f1 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/CellAreaLink/sheet_CellAreaLink.xba @@ -0,0 +1,65 @@ +<?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="sheet_CellAreaLink" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.sheet.CellAreaLink +'************************************************************************* +On Error Goto ErrHndl + + Dim aURLs(1) As String + aURLs(0) = utils.Path2URL(cTestDocsDir) + aURLs(1) = utils.Path2URL(cTestDocsDir & "/temp.txt") + PropertyTester.TestProperty("Url", aURLs()) + + PropertyTester.TestProperty("Filter") + + PropertyTester.TestProperty("FilterOptions") + + PropertyTester.TestProperty("RefreshDelay") + +Exit Sub +ErrHndl: + Test.Exception() + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sheet/DataPilotField/script.xlb b/qadevOOo/tests/basic/ifc/sheet/DataPilotField/script.xlb new file mode 100644 index 000000000000..ff63efd2cb23 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/DataPilotField/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="sheet_DataPilotField" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sheet_DataPilotField"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sheet/DataPilotField/sheet_DataPilotField.xba b/qadevOOo/tests/basic/ifc/sheet/DataPilotField/sheet_DataPilotField.xba new file mode 100644 index 000000000000..5ce59de61b8e --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/DataPilotField/sheet_DataPilotField.xba @@ -0,0 +1,57 @@ +<?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="sheet_DataPilotField" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.sheet.DataPilotField +'************************************************************************* +On Error Goto ErrHndl + PropertyTester.TestProperty("Orientation") + + oObj.setPropertyValue("Orientation", com.sun.star.sheet.DataPilotFieldOrientation.COLUMN) + PropertyTester.TestProperty("Function") +Exit Sub +ErrHndl: + Test.Exception() + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sheet/DatabaseRange/script.xlb b/qadevOOo/tests/basic/ifc/sheet/DatabaseRange/script.xlb new file mode 100644 index 000000000000..74e74df5975c --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/DatabaseRange/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="sheet_DatabaseRange" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sheet_DatabaseRange"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sheet/DatabaseRange/sheet_DatabaseRange.xba b/qadevOOo/tests/basic/ifc/sheet/DatabaseRange/sheet_DatabaseRange.xba new file mode 100644 index 000000000000..956ce9af08b6 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/DatabaseRange/sheet_DatabaseRange.xba @@ -0,0 +1,68 @@ +<?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="sheet_DatabaseRange" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.sheet.DatabaseRange +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + PropertyTester.TestProperty("MoveCells") + + PropertyTester.TestProperty("KeepFormats") + + PropertyTester.TestProperty("StripData") + + PropertyTester.TestProperty("AutoFilter") + + PropertyTester.TestProperty("UseFilterCriteriaSource") + + PropertyTester.TestProperty("FilterCriteriaSource") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sheet/GlobalSheetSettings/script.xlb b/qadevOOo/tests/basic/ifc/sheet/GlobalSheetSettings/script.xlb new file mode 100644 index 000000000000..2b471754b704 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/GlobalSheetSettings/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="sheet_GlobalSheetSettings" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sheet_GlobalSheetSettings"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sheet/GlobalSheetSettings/sheet_GlobalSheetSettings.xba b/qadevOOo/tests/basic/ifc/sheet/GlobalSheetSettings/sheet_GlobalSheetSettings.xba new file mode 100644 index 000000000000..db041b57b210 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/GlobalSheetSettings/sheet_GlobalSheetSettings.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="sheet_GlobalSheetSettings" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.sheet.GlobalSheetSettings +'************************************************************************* +On Error Goto ErrHndl + + PropertyTester.TestProperty("MoveSelection") + + PropertyTester.TestProperty("MoveDirection") + + PropertyTester.TestProperty("EnterEdit") + + PropertyTester.TestProperty("ExtendFormat") + + PropertyTester.TestProperty("RangeFinder") + + PropertyTester.TestProperty("ExpandReferences") + + PropertyTester.TestProperty("MarkHeader") + + PropertyTester.TestProperty("UseTabCol") + + PropertyTester.TestProperty("Metric") + + PropertyTester.TestProperty("Scale") + + PropertyTester.TestProperty("DoAutoComplete") + + PropertyTester.TestProperty("StatusBarFunction") + + PropertyTester.TestProperty("UserLists") + + PropertyTester.TestProperty("LinkUpdateMode") + + PropertyTester.TestProperty("PrintAllSheets") + + PropertyTester.TestProperty("PrintEmptyPages") + + PropertyTester.TestProperty("UsePrinterMetrics") + + PropertyTester.TestProperty("ReplaceCellsWarning") + +Exit Sub +ErrHndl: + Test.Exception() + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sheet/SheetCell/script.xlb b/qadevOOo/tests/basic/ifc/sheet/SheetCell/script.xlb new file mode 100644 index 000000000000..e5ddf6444cc6 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/SheetCell/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="sheet_SheetCell" library:readonly="false" library:passwordprotected="false"> + <library:element library:name="sheet_SheetCell"/> + </library:library> diff --git a/qadevOOo/tests/basic/ifc/sheet/SheetCell/sheet_SheetCell.xba b/qadevOOo/tests/basic/ifc/sheet/SheetCell/sheet_SheetCell.xba new file mode 100644 index 000000000000..605351a25d57 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/SheetCell/sheet_SheetCell.xba @@ -0,0 +1,66 @@ +<?xml version="1.0" encoding="UTF-8"?> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="sheet_SheetCell" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.sheet.SheetCell +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + PropertyTester.TestProperty("Position") + + PropertyTester.TestProperty("Size") + + PropertyTester.TestProperty("FormulaLocal") + + PropertyTester.TestProperty("FormulaResultType") + + PropertyTester.TestProperty("ConditionalFormat") + + PropertyTester.TestProperty("ConditionalFormatLocal") + + PropertyTester.TestProperty("Validation") + + PropertyTester.TestProperty("ValidationLocal") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sheet/SheetCellRange/script.xlb b/qadevOOo/tests/basic/ifc/sheet/SheetCellRange/script.xlb new file mode 100644 index 000000000000..cccdd3d6113c --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/SheetCellRange/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="sheet_SheetCellRange" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sheet_SheetCellRange"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sheet/SheetCellRange/sheet_SheetCellRange.xba b/qadevOOo/tests/basic/ifc/sheet/SheetCellRange/sheet_SheetCellRange.xba new file mode 100644 index 000000000000..bd5acf56ce60 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/SheetCellRange/sheet_SheetCellRange.xba @@ -0,0 +1,65 @@ +<?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="sheet_SheetCellRange" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.sheet.SheetCellRange +'************************************************************************* +On Error Goto ErrHndl + PropertyTester.TestProperty("Position") + PropertyTester.TestProperty("Size") + + PropertyTester.TestProperty("Validation") + + PropertyTester.TestProperty("ValidationLocal") + + PropertyTester.TestProperty("ConditionalFormat") + + PropertyTester.TestProperty("ConditionalFormatLocal") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sheet/SheetCellRanges/script.xlb b/qadevOOo/tests/basic/ifc/sheet/SheetCellRanges/script.xlb new file mode 100644 index 000000000000..2c9622791cf5 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/SheetCellRanges/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="sheet_SheetCellRanges" library:readonly="false" library:passwordprotected="false"> + <library:element library:name="sheet_SheetCellRanges"/> + </library:library> diff --git a/qadevOOo/tests/basic/ifc/sheet/SheetCellRanges/sheet_SheetCellRanges.xba b/qadevOOo/tests/basic/ifc/sheet/SheetCellRanges/sheet_SheetCellRanges.xba new file mode 100644 index 000000000000..dc51f0fae055 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/SheetCellRanges/sheet_SheetCellRanges.xba @@ -0,0 +1,58 @@ +<?xml version="1.0" encoding="UTF-8"?> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="sheet_SheetCellRanges" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.sheet.SheetCellRanges +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + PropertyTester.TestProperty("ConditionalFormat") + + PropertyTester.TestProperty("ConditionalFormatLocal") + + PropertyTester.TestProperty("Validation") + + PropertyTester.TestProperty("ValidationLocal") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sheet/SheetFilterDescriptor/script.xlb b/qadevOOo/tests/basic/ifc/sheet/SheetFilterDescriptor/script.xlb new file mode 100644 index 000000000000..e82850021381 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/SheetFilterDescriptor/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="sheet_SheetFilterDescriptor" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sheet_SheetFilterDescriptor"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sheet/SheetFilterDescriptor/sheet_SheetFilterDescriptor.xba b/qadevOOo/tests/basic/ifc/sheet/SheetFilterDescriptor/sheet_SheetFilterDescriptor.xba new file mode 100644 index 000000000000..3d865a931836 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/SheetFilterDescriptor/sheet_SheetFilterDescriptor.xba @@ -0,0 +1,72 @@ +<?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="sheet_SheetFilterDescriptor" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.sheet.SheetFilterDescriptor +'************************************************************************* +On Error Goto ErrHndl + + PropertyTester.TestProperty("IsCaseSensitive") + + PropertyTester.TestProperty("SkipDuplicates") + + PropertyTester.TestProperty("UseRegularExpressions") + + PropertyTester.TestProperty("SaveOutputPosition") + + PropertyTester.TestProperty("Orientation") + + PropertyTester.TestProperty("ContainsHeader") + + PropertyTester.TestProperty("CopyOutputData") + + PropertyTester.TestProperty("OutputPosition") + + PropertyTester.TestProperty("MaxFieldCount") + +Exit Sub +ErrHndl: + Test.Exception() + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sheet/SheetLink/script.xlb b/qadevOOo/tests/basic/ifc/sheet/SheetLink/script.xlb new file mode 100644 index 000000000000..30fbc310593b --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/SheetLink/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="sheet_SheetLink" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sheet_SheetLink"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sheet/SheetLink/sheet_SheetLink.xba b/qadevOOo/tests/basic/ifc/sheet/SheetLink/sheet_SheetLink.xba new file mode 100644 index 000000000000..48ac50f08318 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/SheetLink/sheet_SheetLink.xba @@ -0,0 +1,70 @@ +<?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="sheet_SheetLink" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.sheet.SheetLink +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Dim aURLs(1) As String + aURLs(0) = utils.Path2URL(cTestDocsDir) + aURLs(1) = utils.Path2URL(cTestDocsDir & "/temp.txt") + + PropertyTester.TestProperty("Url", aURLs()) + + Dim aFilters(1) As String + aFilters(0) = "StarCalc 4.0" + aFilters(1) = "StarCalc 5.0" + + PropertyTester.TestProperty("Filter", aFilters()) + + PropertyTester.TestProperty("FilterOptions") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sheet/Spreadsheet/script.xlb b/qadevOOo/tests/basic/ifc/sheet/Spreadsheet/script.xlb new file mode 100644 index 000000000000..54d523870d7e --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/Spreadsheet/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="sheet_Spreadsheet" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sheet_Spreadsheet"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sheet/Spreadsheet/sheet_Spreadsheet.xba b/qadevOOo/tests/basic/ifc/sheet/Spreadsheet/sheet_Spreadsheet.xba new file mode 100644 index 000000000000..98435657a745 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/Spreadsheet/sheet_Spreadsheet.xba @@ -0,0 +1,70 @@ +<?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="sheet_Spreadsheet" 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 + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' - Global sStyleName As String + +'************************************************************************* + + + + + + +Sub RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.sheet.Spreadsheet +'************************************************************************* +On Error Goto ErrHndl + PropertyTester.TestProperty("IsVisible") + Dim aStyles(1) As String + aStyles(0) = sStyleName + aStyles(1) = "Default" + PropertyTester.TestProperty("PageStyle", aStyles()) +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sheet/SpreadsheetDocument/script.xlb b/qadevOOo/tests/basic/ifc/sheet/SpreadsheetDocument/script.xlb new file mode 100644 index 000000000000..870d40c0204f --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/SpreadsheetDocument/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="sheet_SpreadsheetDocument" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sheet_SpreadsheetDocument"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sheet/SpreadsheetDocument/sheet_SpreadsheetDocument.xba b/qadevOOo/tests/basic/ifc/sheet/SpreadsheetDocument/sheet_SpreadsheetDocument.xba new file mode 100644 index 000000000000..6706c1f00d49 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/SpreadsheetDocument/sheet_SpreadsheetDocument.xba @@ -0,0 +1,70 @@ +<?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="sheet_SpreadsheetDocument" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.sheet.SpreadsheetDocument +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + PropertyTester.TestProperty("NamedRanges") + + PropertyTester.TestProperty("DatabaseRanges") + + PropertyTester.TestProperty("ColumnLabelRanges") + + PropertyTester.TestProperty("RowLabelRanges") + + PropertyTester.TestProperty("SheetLinks") + + PropertyTester.TestProperty("AreaLinks") + + PropertyTester.TestProperty("DDELinks") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sheet/SpreadsheetDocumentSettings/script.xlb b/qadevOOo/tests/basic/ifc/sheet/SpreadsheetDocumentSettings/script.xlb new file mode 100644 index 000000000000..351347139143 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/SpreadsheetDocumentSettings/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="sheet_SpreadsheetDocumentSettings" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sheet_SpreadsheetDocumentSettings"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sheet/SpreadsheetDocumentSettings/sheet_SpreadsheetDocumentSettings.xba b/qadevOOo/tests/basic/ifc/sheet/SpreadsheetDocumentSettings/sheet_SpreadsheetDocumentSettings.xba new file mode 100644 index 000000000000..e0a761901887 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/SpreadsheetDocumentSettings/sheet_SpreadsheetDocumentSettings.xba @@ -0,0 +1,75 @@ +<?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="sheet_SpreadsheetDocumentSettings" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.sheet.SpreadsheetDocumentSettings +'************************************************************************* +On Error Goto ErrHndl + PropertyTester.TestProperty("IsIterationEnabled") + PropertyTester.TestProperty("IterationCount") + PropertyTester.TestProperty("IterationEpsilon") + PropertyTester.TestProperty("StandardDecimals") + PropertyTester.TestProperty("NullDate") + PropertyTester.TestProperty("DefaultTabStop") + PropertyTester.TestProperty("IgnoreCase") + PropertyTester.TestProperty("CalcAsShown") + PropertyTester.TestProperty("MatchWholeCell") + PropertyTester.TestProperty("SpellOnline") + PropertyTester.TestProperty("LookUpLabels") + PropertyTester.TestProperty("RegularExpressions") + PropertyTester.TestProperty("ForbiddenCharacters") + PropertyTester.TestProperty("HasDrawPages") + +' + PropertyTester.TestProperty("CharLocale") + + PropertyTester.TestProperty("CharLocaleAsian") + + PropertyTester.TestProperty("CharLocaleComplex") + +Exit Sub +ErrHndl: + Test.Exception() + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sheet/SpreadsheetViewSettings/script.xlb b/qadevOOo/tests/basic/ifc/sheet/SpreadsheetViewSettings/script.xlb new file mode 100644 index 000000000000..d9f23cd17d45 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/SpreadsheetViewSettings/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="sheet_SpreadsheetViewSettings" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sheet_SpreadsheetViewSettings"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sheet/SpreadsheetViewSettings/sheet_SpreadsheetViewSettings.xba b/qadevOOo/tests/basic/ifc/sheet/SpreadsheetViewSettings/sheet_SpreadsheetViewSettings.xba new file mode 100644 index 000000000000..c448552f7e29 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/SpreadsheetViewSettings/sheet_SpreadsheetViewSettings.xba @@ -0,0 +1,96 @@ +<?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="sheet_SpreadsheetViewSettings" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.sheet.SpreadsheetViewSettings +'************************************************************************* +On Error Goto ErrHndl + + PropertyTester.TestProperty("ShowFormulas") + + PropertyTester.TestProperty("ShowZeroValues") + + PropertyTester.TestProperty("IsValueHighlightingEnabled") + + PropertyTester.TestProperty("ShowNotes") + + PropertyTester.TestProperty("HasVerticalScrollBar") + + PropertyTester.TestProperty("HasHorizontalScrollBar") + + PropertyTester.TestProperty("HasSheetTabs") + + PropertyTester.TestProperty("IsOutlineSymbolsSet") + + PropertyTester.TestProperty("HasColumnRowHeaders") + + PropertyTester.TestProperty("ShowGrid") + + PropertyTester.TestProperty("GridColor") + + PropertyTester.TestProperty("ShowHelpLines") + + PropertyTester.TestProperty("ShowAnchor") + + PropertyTester.TestProperty("ShowPageBreaks") + + PropertyTester.TestProperty("SolidHandles") + + PropertyTester.TestProperty("ShowObjects") + + PropertyTester.TestProperty("ShowCharts") + + PropertyTester.TestProperty("ShowDrawing") + + PropertyTester.TestProperty("HideSpellMarks") + + PropertyTester.TestProperty("ZoomType") + + PropertyTester.TestProperty("ZoomValue") + +Exit Sub +ErrHndl: + Test.Exception() + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sheet/SubTotalDescriptor/script.xlb b/qadevOOo/tests/basic/ifc/sheet/SubTotalDescriptor/script.xlb new file mode 100644 index 000000000000..ec784755fab0 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/SubTotalDescriptor/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="sheet_SubTotalDescriptor" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sheet_SubTotalDescriptor"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sheet/SubTotalDescriptor/sheet_SubTotalDescriptor.xba b/qadevOOo/tests/basic/ifc/sheet/SubTotalDescriptor/sheet_SubTotalDescriptor.xba new file mode 100644 index 000000000000..bb9810addb02 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/SubTotalDescriptor/sheet_SubTotalDescriptor.xba @@ -0,0 +1,70 @@ +<?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="sheet_SubTotalDescriptor" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.sheet.SubTotalDescriptor +'************************************************************************* +On Error Goto ErrHndl + + PropertyTester.TestProperty("InsertPageBreaks") + + PropertyTester.TestProperty("IsCaseSensitive") + + PropertyTester.TestProperty("EnableUserSortList") + + PropertyTester.TestProperty("UserSortListIndex") + + PropertyTester.TestProperty("BindFormatsToContent") + + PropertyTester.TestProperty("SortAscending") + + PropertyTester.TestProperty("MaxFieldCount") + + PropertyTester.TestProperty("EnableSort") + +Exit Sub +ErrHndl: + Test.Exception() + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sheet/TableAutoFormat/script.xlb b/qadevOOo/tests/basic/ifc/sheet/TableAutoFormat/script.xlb new file mode 100644 index 000000000000..43d45faccf0d --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/TableAutoFormat/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="sheet_TableAutoFormat" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sheet_TableAutoFormat"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sheet/TableAutoFormat/sheet_TableAutoFormat.xba b/qadevOOo/tests/basic/ifc/sheet/TableAutoFormat/sheet_TableAutoFormat.xba new file mode 100644 index 000000000000..9c1fe4e521ec --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/TableAutoFormat/sheet_TableAutoFormat.xba @@ -0,0 +1,66 @@ +<?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="sheet_TableAutoFormat" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.sheet.TableAutoFormat +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + PropertyTester.TestProperty("IncludeFont") + + PropertyTester.TestProperty("IncludeJustify") + + PropertyTester.TestProperty("IncludeBorder") + + PropertyTester.TestProperty("IncludeBackground") + + PropertyTester.TestProperty("IncludeNumberFormat") + + PropertyTester.TestProperty("IncludeWidthAndHeight") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sheet/TableAutoFormatField/script.xlb b/qadevOOo/tests/basic/ifc/sheet/TableAutoFormatField/script.xlb new file mode 100644 index 000000000000..a82bd1a1a653 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/TableAutoFormatField/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="sheet_TableAutoFormatField" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sheet_TableAutoFormatField"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sheet/TableAutoFormatField/sheet_TableAutoFormatField.xba b/qadevOOo/tests/basic/ifc/sheet/TableAutoFormatField/sheet_TableAutoFormatField.xba new file mode 100644 index 000000000000..f66727fb5da4 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/TableAutoFormatField/sheet_TableAutoFormatField.xba @@ -0,0 +1,163 @@ +<?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="sheet_TableAutoFormatField" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.sheet.TableAutoFormatField +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + PropertyTester.TestProperty("CharFontName") + + Dim aHeightArray(3) As Double + aHeightArray(0) = 10 + aHeightArray(1) = 20.1 + aHeightArray(2) = 25.2 + aHeightArray(3) = 30.3 + PropertyTester.TestProperty("CharHeight",aHeightArray()) + + Dim aWeightArray(9) As Integer + with com.sun.star.awt.FontWeight + aWeightArray(0) = .DONTKNOW + aWeightArray(1) = .THIN + aWeightArray(2) = .ULTRALIGHT + aWeightArray(3) = .LIGHT + aWeightArray(4) = .SEMILIGHT + aWeightArray(5) = .NORMAL + aWeightArray(6) = .SEMIBOLD + aWeightArray(7) = .BOLD + aWeightArray(8) = .ULTRABOLD + aWeightArray(9) = .BLACK + end with + PropertyTester.TestProperty("CharWeight", aWeightArray()) + + PropertyTester.TestProperty("CharPosture") + + PropertyTester.TestProperty("CharUnderline") + + PropertyTester.TestProperty("CharCrossedOut") + + PropertyTester.TestProperty("CharContoured") + + PropertyTester.TestProperty("CharShadowed") + + PropertyTester.TestProperty("CharColor") + +' ### The following property was not found in correspond IDL file! ### + PropertyTester.TestProperty("CharLocale") + + PropertyTester.TestProperty("CellBackColor") + + PropertyTester.TestProperty("IsCellBackgroundTransparent") + + PropertyTester.TestProperty("ShadowFormat") + + PropertyTester.TestProperty("ParaRightMargin") + + PropertyTester.TestProperty("ParaLeftMargin") + + PropertyTester.TestProperty("ParaBottomMargin") + + PropertyTester.TestProperty("ParaTopMargin") + + PropertyTester.TestProperty("RotateReference") + + PropertyTester.TestProperty("RotateAngle") + + PropertyTester.TestProperty("Orientation") + + PropertyTester.TestProperty("IsTextWrapped") + + PropertyTester.TestProperty("VertJustify") + + PropertyTester.TestProperty("HoriJustify") + + PropertyTester.TestProperty("CharPostureComplex") + + PropertyTester.TestProperty("CharPostureAsian") + + PropertyTester.TestProperty("CharWeightComplex", aWeightArray()) + + PropertyTester.TestProperty("CharWeightAsian", aWeightArray()) + + PropertyTester.TestProperty("CharHeightComplex", aHeightArray()) + + PropertyTester.TestProperty("CharHeightAsian", aHeightArray()) + + PropertyTester.TestProperty("CharFontPitchComplex") + + PropertyTester.TestProperty("CharFontPitchAsian") + + PropertyTester.TestProperty("CharFontPitch") + + PropertyTester.TestProperty("CharFontFamilyComplex") + + PropertyTester.TestProperty("CharFontFamilyAsian") + + PropertyTester.TestProperty("CharFontFamily") + + PropertyTester.TestProperty("CharFontCharSetComplex") + + PropertyTester.TestProperty("CharFontCharSetAsian") + + PropertyTester.TestProperty("CharFontCharSet") + + PropertyTester.TestProperty("CharFontStyleNameComplex") + + PropertyTester.TestProperty("CharFontStyleNameAsian") + + PropertyTester.TestProperty("CharFontStyleName") + + PropertyTester.TestProperty("CharFontNameComplex") + + PropertyTester.TestProperty("CharFontNameAsian") + + +' + PropertyTester.TestProperty("TableBorder") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sheet/TableValidation/script.xlb b/qadevOOo/tests/basic/ifc/sheet/TableValidation/script.xlb new file mode 100644 index 000000000000..b5a1217ee934 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/TableValidation/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="sheet_TableValidation" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sheet_TableValidation"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sheet/TableValidation/sheet_TableValidation.xba b/qadevOOo/tests/basic/ifc/sheet/TableValidation/sheet_TableValidation.xba new file mode 100644 index 000000000000..100c51fa0397 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/TableValidation/sheet_TableValidation.xba @@ -0,0 +1,72 @@ +<?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="sheet_TableValidation" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.sheet.TableValidation +'************************************************************************* +On Error Goto ErrHndl + + PropertyTester.TestProperty("Type") + + PropertyTester.TestProperty("ShowInputMessage") + + PropertyTester.TestProperty("InputTitle") + + PropertyTester.TestProperty("InputMessage") + + PropertyTester.TestProperty("ShowErrorMessage") + + PropertyTester.TestProperty("ErrorTitle") + + PropertyTester.TestProperty("ErrorMessage") + + PropertyTester.TestProperty("IgnoreBlankCells") + + PropertyTester.TestProperty("ErrorAlertStyle") + +Exit Sub +ErrHndl: + Test.Exception() + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sheet/XAreaLink/script.xlb b/qadevOOo/tests/basic/ifc/sheet/XAreaLink/script.xlb new file mode 100644 index 000000000000..47d6b97b9722 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XAreaLink/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="sheet_XAreaLink" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sheet_XAreaLink"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sheet/XAreaLink/sheet_XAreaLink.xba b/qadevOOo/tests/basic/ifc/sheet/XAreaLink/sheet_XAreaLink.xba new file mode 100644 index 000000000000..6f3315327c25 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XAreaLink/sheet_XAreaLink.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="sheet_XAreaLink" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.sheet.XAreaLink +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + Test.StartMethod("getSourceArea()") + bOK = true + Dim cArea As String + cArea = oObj.getSourceArea() + bOK = bOK AND NOT isNULL(cArea) + Test.MethodTested("getSourceArea()", bOK) + + + Test.StartMethod("setSourceArea()") + bOK = true + Dim oldArea As String + Dim newArea As String + oldArea = oObj.getSourceArea() + newArea = "Sheet0.I6:G8" + Out.Log("Set SourceArea to '" & newArea & "'") + oObj.setSourceArea(newArea) + newArea = oObj.getSourceArea() + Out.Log("SourceArea is '" & newArea & "'") + bOK = bOK AND oldArea <> newArea + oObj.setSourceArea(oldArea) + Test.MethodTested("setSourceArea()", bOK) + + Test.StartMethod("getDestArea()") + Dim oArea As Object + bOK = true + oArea = oObj.getDestArea() + bOK = bOK AND NOT isNULL(oArea) + Test.MethodTested("getDestArea()", bOK) + + Test.StartMethod("setDestArea()") + Dim sNewArea As New com.sun.star.table.CellRangeAddress + Dim sOldArea As Object + + bOK = true + sOldArea = oObj.getDestArea() + + sNewArea.Sheet = sOldArea.Sheet + sNewArea.StartRow = sOldArea.StartRow + 1 + sNewArea.StartColumn = sOldArea.StartColumn + 1 + sNewArea.EndRow = sOldArea.EndRow + 1 + sNewArea.EndColumn = sOldArea.EndColumn + 1 + + oObj.setDestArea(sNewArea) + + bOK = bOK AND NOT isNULL(oObj.getDestArea()) + if (bOK) then + bOK = bOK AND (sOldArea.Sheet = oObj.getDestArea.Sheet) + bOK = bOK AND (sOldArea.StartRow = oObj.getDestArea.StartRow - 1) + bOK = bOK AND (sOldArea.StartColumn = oObj.getDestArea.StartColumn - 1) + bOK = bOK AND (sOldArea.EndRow = oObj.getDestArea.EndRow - 1) + bOK = bOK AND (sOldArea.EndColumn = oObj.getDestArea.EndColumn - 1) + end if + + oObj.setDestArea(sOldArea) + + Test.MethodTested("setDestArea()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sheet/XAreaLinks/script.xlb b/qadevOOo/tests/basic/ifc/sheet/XAreaLinks/script.xlb new file mode 100644 index 000000000000..430bf9a3a93e --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XAreaLinks/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="sheet_XAreaLinks" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sheet_XAreaLinks"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sheet/XAreaLinks/sheet_XAreaLinks.xba b/qadevOOo/tests/basic/ifc/sheet/XAreaLinks/sheet_XAreaLinks.xba new file mode 100644 index 000000000000..3e8d9d11354a --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XAreaLinks/sheet_XAreaLinks.xba @@ -0,0 +1,85 @@ +<?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="sheet_XAreaLinks" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.sheet.XAreaLinks +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Test.StartMethod("insertAtPosition()") + bOK = true + 'remembering amount of elements + Dim m_startAmount as Integer + m_startAmount = oObj.Count() + + Dim addr As New com.sun.star.table.CellAddress + addr.Sheet = 0 + addr.Row = 0 + addr.Column = 2 + + Dim mSrcFileName as String + mSrcFileName = utils.Path2URL(cTestDocsDir + "/" + "calcshapes.sxc") + Dim amdstAddresss as String + mdstAddress = "a2:b4" + Dim asmFilter as String + mFilter = "" + Dim mFilterOpts as String + mFilterOpts = "" + oObj.insertAtPosition(addr, mSrcFileName, mdstAddress, mFilter, mFilterOpts) + + bOK = bOK AND (m_startAmount + 1 = oObj.Count) + Test.MethodTested("insertAtPosition()", bOK) + + + Test.StartMethod("removeByIndex()") + bOK = true + oObj.removeByIndex(0) + bOK = bOK AND (oObj.Count = m_startAmount) + Test.MethodTested("removeByIndex()", bOK) + + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sheet/XArrayFormulaRange/script.xlb b/qadevOOo/tests/basic/ifc/sheet/XArrayFormulaRange/script.xlb new file mode 100644 index 000000000000..301683569797 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XArrayFormulaRange/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="sheet_XArrayFormulaRange" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sheet_XArrayFormulaRange"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sheet/XArrayFormulaRange/sheet_XArrayFormulaRange.xba b/qadevOOo/tests/basic/ifc/sheet/XArrayFormulaRange/sheet_XArrayFormulaRange.xba new file mode 100644 index 000000000000..120aa4b65033 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XArrayFormulaRange/sheet_XArrayFormulaRange.xba @@ -0,0 +1,85 @@ +<?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="sheet_XArrayFormulaRange" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.sheet.XArrayFormulaRange +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim bExpectedException As Boolean + + Test.StartMethod("setArrayFormula()") + Test.StartMethod("getArrayFormula()") + bOK = true + + if (cObjectName = "sc.ScTableSheetObj") then + bExpectedException = true + oObj.setArrayFormula("=1+2") + wait(1) ' additional operator should exists here to avoid + ' resuming on 'else' after exception handling + else + oObj.setArrayFormula("=1+2") + bOK = bOK AND (oObj.getArrayFormula() = "{=1+2}") + Out.Log("2") + end if + + ' Setting of _empty_ formula should work for all objects. + bExpectedException = false + oObj.setArrayFormula("") + bOK = bOK AND (oObj.getArrayFormula() = "") + + Test.MethodTested("getArrayFormula()", bOK) + Test.MethodTested("setArrayFormula()", bOK) + +Exit Sub +ErrHndl: + if (bExpectedException) then + Out.Log("It doesn't make sense to set formula over whole page.") + Out.Log("Expected exception: " & error) + else + Test.Exception() + bOK = false + end if + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sheet/XCellAddressable/script.xlb b/qadevOOo/tests/basic/ifc/sheet/XCellAddressable/script.xlb new file mode 100644 index 000000000000..892840f8d8e2 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XCellAddressable/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="sheet_XCellAddressable" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sheet_XCellAddressable"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sheet/XCellAddressable/sheet_XCellAddressable.xba b/qadevOOo/tests/basic/ifc/sheet/XCellAddressable/sheet_XCellAddressable.xba new file mode 100644 index 000000000000..7f00430ae466 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XCellAddressable/sheet_XCellAddressable.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="sheet_XCellAddressable" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.sheet.XCellAddressable +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim vCellAddress As Variant + + Test.StartMethod("getCellAddress()") + bOK = true + vCellAddress = oObj.getCellAddress() + bOK = bOK AND isNumeric(vCellAddress.Row) + Test.MethodTested("getCellAddress()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sheet/XCellRangeAddressable/script.xlb b/qadevOOo/tests/basic/ifc/sheet/XCellRangeAddressable/script.xlb new file mode 100644 index 000000000000..e72e1f1f4a52 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XCellRangeAddressable/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="sheet_XCellRangeAddressable" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sheet_XCellRangeAddressable"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sheet/XCellRangeAddressable/sheet_XCellRangeAddressable.xba b/qadevOOo/tests/basic/ifc/sheet/XCellRangeAddressable/sheet_XCellRangeAddressable.xba new file mode 100644 index 000000000000..d5f063b3c7e4 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XCellRangeAddressable/sheet_XCellRangeAddressable.xba @@ -0,0 +1,67 @@ +<?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="sheet_XCellRangeAddressable" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.sheet.XCellRangeAddressable +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim oAddress As Variant + + Test.StartMethod("getRangeAddress()") + bOK = true + oAddress = oObj.getRangeAddress() + bOK = bOK AND isNumeric(oAddress.Sheet) + bOK = bOK AND isNumeric(oAddress.StartColumn) + bOK = bOK AND isNumeric(oAddress.EndColumn) + bOK = bOK AND isNumeric(oAddress.StartRow) + bOK = bOK AND isNumeric(oAddress.EndRow) + Test.MethodTested("getRangeAddress()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sheet/XCellRangeData/script.xlb b/qadevOOo/tests/basic/ifc/sheet/XCellRangeData/script.xlb new file mode 100644 index 000000000000..9112c7c9b7f2 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XCellRangeData/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="sheet_XCellRangeData" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sheet_XCellRangeData"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sheet/XCellRangeData/sheet_XCellRangeData.xba b/qadevOOo/tests/basic/ifc/sheet/XCellRangeData/sheet_XCellRangeData.xba new file mode 100644 index 000000000000..f6114d09437a --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XCellRangeData/sheet_XCellRangeData.xba @@ -0,0 +1,72 @@ +<?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="sheet_XCellRangeData" 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 + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +'Global newData As Variant + +'************************************************************************* + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.sheet.XCellRangeData +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim data As Variant + Dim myNewData as Variant + + Test.StartMethod("getDataArray()") + data = oObj.getDataArray() + bOK = Not IsEmpty(data) AND ubound(data) > 0 + Test.MethodTested("getDataArray()", bOK) + + Test.StartMethod("setDataArray()") + oObj.setDataArray(createUnoValue("[][]any",newData)) + data = oObj.getDataArray() + bOK = equals(data, newData) + Test.MethodTested("setDataArray()", bOK) +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sheet/XCellRangeMovement/script.xlb b/qadevOOo/tests/basic/ifc/sheet/XCellRangeMovement/script.xlb new file mode 100644 index 000000000000..ae74228d9729 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XCellRangeMovement/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="sheet_XCellRangeMovement" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sheet_XCellRangeMovement"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sheet/XCellRangeMovement/sheet_XCellRangeMovement.xba b/qadevOOo/tests/basic/ifc/sheet/XCellRangeMovement/sheet_XCellRangeMovement.xba new file mode 100644 index 000000000000..8d420350ce38 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XCellRangeMovement/sheet_XCellRangeMovement.xba @@ -0,0 +1,167 @@ +<?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="sheet_XCellRangeMovement" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.sheet.XCellRangeMovement +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Out.Log("Prepearing test...") + for i = 0 to 5 + for j = 0 to 5 + oObj.getCellByPosition(j, i).Value = i * 6 + j + next j + next i + + Test.StartMethod("insertCells()") + bOK = true + Dim newCellAddress As New com.sun.star.table.CellRangeAddress + newCellAddress.Sheet = 0 + newCellAddress.StartColumn = 1 + newCellAddress.StartRow = 1 + newCellAddress.EndColumn = 1 + newCellAddress.EndRow = 1 + oObj.insertCells(newCellAddress, com.sun.star.sheet.CellInsertMode.DOWN) + bOK = bOK AND oObj.getCellByPosition(1, 1).String = "" + bOK = bOK AND oObj.getCellByPosition(2, 2).Value = 14 + bOK = bOK AND oObj.getCellByPosition(1, 2).Value = 7 + bOK = bOK AND oObj.getCellByPosition(0, 2).Value = 12 + + oObj.insertCells(newCellAddress, com.sun.star.sheet.CellInsertMode.RIGHT) + bOK = bOK AND oObj.getCellByPosition(1, 1).String = "" + bOK = bOK AND oObj.getCellByPosition(3, 0).Value = 3 + bOK = bOK AND oObj.getCellByPosition(3, 1).Value = 8 + bOK = bOK AND oObj.getCellByPosition(3, 2).Value = 15 + + oObj.insertCells(newCellAddress, com.sun.star.sheet.CellInsertMode.ROWS) + bOK = bOK AND oObj.getCellByPosition(1, 1).String = "" + bOK = bOK AND oObj.getCellByPosition(4, 0).Value = 4 + bOK = bOK AND oObj.getCellByPosition(4, 1).String = "" + bOK = bOK AND oObj.getCellByPosition(4, 2).Value = 9 + + oObj.insertCells(newCellAddress, com.sun.star.sheet.CellInsertMode.COLUMNS) + bOK = bOK AND oObj.getCellByPosition(1, 1).String = "" + bOK = bOK AND oObj.getCellByPosition(0, 5).Value = 24 + bOK = bOK AND oObj.getCellByPosition(1, 5).String = "" + bOK = bOK AND oObj.getCellByPosition(2, 5).Value = 19 + + Test.MethodTested("insertCells()", bOK) + + Test.StartMethod("removeRange()") + bOK = true + oObj.removeRange(newCellAddress, com.sun.star.sheet.CellDeleteMode.ROWS) + bOK = bOK AND oObj.getCellByPosition(1, 1).String = "" + bOK = bOK AND oObj.getCellByPosition(4, 0).Value = 3 + bOK = bOK AND oObj.getCellByPosition(4, 1).Value = 8 + bOK = bOK AND oObj.getCellByPosition(4, 2).Value = 15 + + oObj.removeRange(newCellAddress, com.sun.star.sheet.CellDeleteMode.COLUMNS) + bOK = bOK AND oObj.getCellByPosition(1, 1).String = "" + bOK = bOK AND oObj.getCellByPosition(4, 0).Value = 4 + bOK = bOK AND oObj.getCellByPosition(4, 1).Value = 9 + bOK = bOK AND oObj.getCellByPosition(4, 2).Value = 16 + + oObj.removeRange(newCellAddress, com.sun.star.sheet.CellDeleteMode.UP) + bOK = bOK AND oObj.getCellByPosition(1, 1).Value = 7 + bOK = bOK AND oObj.getCellByPosition(1, 2).Value = 13 + bOK = bOK AND oObj.getCellByPosition(1, 3).Value = 19 + bOK = bOK AND oObj.getCellByPosition(0, 3).Value = 18 + + oObj.removeRange(newCellAddress, com.sun.star.sheet.CellDeleteMode.LEFT) + bOK = bOK AND oObj.getCellByPosition(1, 1).String = "" + bOK = bOK AND oObj.getCellByPosition(0, 1).Value = 6 + bOK = bOK AND oObj.getCellByPosition(1, 1).String = "" + bOK = bOK AND oObj.getCellByPosition(2, 1).Value = 8 + + Test.MethodTested("removeRange()", bOK) + + Test.StartMethod("moveRange()") + bOK = true + newCellAddress.Sheet = 0 + newCellAddress.StartColumn = 0 + newCellAddress.StartRow = 0 + newCellAddress.EndColumn = 1 + newCellAddress.EndRow = 1 + Dim sCell As New com.sun.star.table.CellAddress + sCell.Sheet = 0 + sCell.Column = 3 + sCell.Row = 3 + oObj.moveRange(sCell, newCellAddress) + + bOK = bOK AND oObj.getCellByPosition(0, 0).String = "" + bOK = bOK AND oObj.getCellByPosition(1, 0).String = "" + bOK = bOK AND oObj.getCellByPosition(0, 1).String = "" + bOK = bOK AND oObj.getCellByPosition(1, 1).String = "" + + bOK = bOK AND oObj.getCellByPosition(3, 3).Value = 0 + bOK = bOK AND oObj.getCellByPosition(3, 4).Value = 6 + bOK = bOK AND oObj.getCellByPosition(4, 3).Value = 1 + bOK = bOK AND oObj.getCellByPosition(4, 4).String = "" + + Test.MethodTested("moveRange()", bOK) + + Test.StartMethod("copyRange()") + bOK = true + newCellAddress.Sheet = 0 + newCellAddress.StartColumn = 2 + newCellAddress.StartRow = 2 + newCellAddress.EndColumn = 3 + newCellAddress.EndRow = 3 + sCell.Sheet = 0 + sCell.Column = 0 + sCell.Row = 0 + + oObj.copyRange(sCell, newCellAddress) + + bOK = bOK AND oObj.getCellByPosition(0, 0).Value = oObj.getCellByPosition(2, 2).Value + bOK = bOK AND oObj.getCellByPosition(0, 1).Value = oObj.getCellByPosition(2, 3).Value + bOK = bOK AND oObj.getCellByPosition(1, 0).Value = oObj.getCellByPosition(3, 2).Value + bOK = bOK AND oObj.getCellByPosition(1, 1).Value = oObj.getCellByPosition(3, 3).Value + + Test.MethodTested("copyRange()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sheet/XCellRangeReferrer/script.xlb b/qadevOOo/tests/basic/ifc/sheet/XCellRangeReferrer/script.xlb new file mode 100644 index 000000000000..579888e295a3 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XCellRangeReferrer/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="sheet_XCellRangeReferrer" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sheet_XCellRangeReferrer"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sheet/XCellRangeReferrer/sheet_XCellRangeReferrer.xba b/qadevOOo/tests/basic/ifc/sheet/XCellRangeReferrer/sheet_XCellRangeReferrer.xba new file mode 100644 index 000000000000..7a41e77309c5 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XCellRangeReferrer/sheet_XCellRangeReferrer.xba @@ -0,0 +1,92 @@ +<?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="sheet_XCellRangeReferrer" 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 + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' - Global oReferredCells As New com.sun.star.table.CellRangeAddress + +'************************************************************************* + + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.sheet.XCellRangeReferrer +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim refCells As Object + + Test.StartMethod("getReferredCells()") + bOK = true + refCells = oObj.ReferredCells.getRangeAddress() + bOK = NOT isNULL(refCells) + bOK = bOK AND refCells.Sheet = oReferredCells.Sheet + bOK = bOK AND refCells.StartRow = oReferredCells.StartRow + bOK = bOK AND refCells.EndRow = oReferredCells.EndRow + bOK = bOK AND refCells.StartColumn = oReferredCells.StartColumn + bOK = bOK AND refCells.EndColumn = oReferredCells.EndColumn + + if NOT(bOK) then + Out.Log("Global oReferredCells var is: (" & oReferredCells.Sheet & "," _ + & oReferredCells.StartRow & "," _ + & oReferredCells.StartColumn & "," _ + & oReferredCells.EndRow & "," _ + & oReferredCells.EndColumn & ")") + Out.Log("Local var is: (" & refCells.Sheet & "," _ + & refCells.StartRow & "," _ + & refCells.StartColumn & "," _ + & refCells.EndRow & "," _ + & refCells.EndColumn & ")") + end if + Test.MethodTested("getReferredCells()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sheet/XCellSeries/script.xlb b/qadevOOo/tests/basic/ifc/sheet/XCellSeries/script.xlb new file mode 100644 index 000000000000..b75c980df466 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XCellSeries/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="sheet_XCellSeries" library:readonly="false" library:passwordprotected="false"> + <library:element library:name="sheet_XCellSeries"/> + </library:library> diff --git a/qadevOOo/tests/basic/ifc/sheet/XCellSeries/sheet_XCellSeries.xba b/qadevOOo/tests/basic/ifc/sheet/XCellSeries/sheet_XCellSeries.xba new file mode 100644 index 000000000000..7005d9886b6f --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XCellSeries/sheet_XCellSeries.xba @@ -0,0 +1,126 @@ +<?xml version="1.0" encoding="UTF-8"?> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="sheet_XCellSeries" 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. +' +'************************************************************************* +'************************************************************************* + + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' - Global aCellSeries(1) As Integer +' aCellSeries(0) = amount of rows of range +' aCellSeries(1) = amount of columns of range + +'************************************************************************* + +' Be sure that all variables are dimensioned: +option explicit + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.sheet.XCellSeries +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim startValue as Integer + Dim nStep as Integer + Dim shouldValue as Integer + Dim filledValue as Integer + Dim endCell(2) as Integer + Dim n as Integer, m as Integer + + startValue = 5 + nStep = 2 + + ' if 'nStep' is not a divisor of 'aCellSeries' it must be calculated + ' the last filled cell + for n = 0 to 1 + if (aCellSeries(n) mod nStep) <> 0 then + endCell(n) = aCellSeries(n) - (nStep-1) + else + endCell(n) = aCellSeries(n) + end if + next n + 'make clean cells + for n = 0 to endCell(0) + for m = 0 to endCell(1) + oObj.getCellByPosition(n,m).setString("") + next + next + 'set defined start value + oObj.getCellByPosition(0,0).setValue(startValue) + Test.StartMethod("fillAuto()") + bOK = TRUE + oObj.fillAuto(com.sun.star.sheet.FillDirection.TO_BOTTOM, nStep) + shouldValue = endCell(0) / nStep + startValue + filledValue = oObj.getCellByPosition(0,endCell(0)).getValue() + bOK = bOK AND ( shouldValue = filledValue ) + out.log("" + shouldValue + ":" + filledValue) + Test.MethodTested("fillAuto()", bOK) + + + Test.StartMethod("fillSeries()") + bOK = TRUE + out.log("fillSeries() 1/3") + oObj.fillSeries(com.sun.star.sheet.FillDirection.TO_BOTTOM, _ + com.sun.star.sheet.FillMode.LINEAR, _ + com.sun.star.sheet.FillDateMode.FILL_DATE_DAY, nStep, 20000000) + shouldValue = endCell(0) * nStep + startValue + filledValue = oObj.getCellByPosition(0,endCell(0)).getValue() + bOK = bOK and (shouldValue = filledValue) + + out.log("fillSeries() 2/3") + oObj.fillSeries(com.sun.star.sheet.FillDirection.TO_RIGHT, _ + com.sun.star.sheet.FillMode.LINEAR, _ + com.sun.star.sheet.FillDateMode.FILL_DATE_DAY, nStep, 20000000) + shouldValue = endCell(1) * nStep + startValue + filledValue = oObj.getCellByPosition(endCell(1),0).getValue() + bOK = bOK and (shouldValue = filledValue) + + + out.log("fillSeries() 3/3") + oObj.fillSeries(com.sun.star.sheet.FillDirection.TO_BOTTOM, _ + com.sun.star.sheet.FillMode.GROWTH, _ + com.sun.star.sheet.FillDateMode.FILL_DATE_DAY, nStep, 20000000) + shouldValue = startValue * nStep ^ endCell(0) + filledValue = oObj.getCellByPosition(0,endCell(0)).getValue() + bOK = bOK and (shouldValue = filledValue) + + Test.MethodTested("fillSeries()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sheet/XConsolidationDescriptor/script.xlb b/qadevOOo/tests/basic/ifc/sheet/XConsolidationDescriptor/script.xlb new file mode 100644 index 000000000000..c5f0520146ca --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XConsolidationDescriptor/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="sheet_XConsolidationDescriptor" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sheet_XConsolidationDescriptor"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sheet/XConsolidationDescriptor/sheet_XConsolidationDescriptor.xba b/qadevOOo/tests/basic/ifc/sheet/XConsolidationDescriptor/sheet_XConsolidationDescriptor.xba new file mode 100644 index 000000000000..426050dedc32 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XConsolidationDescriptor/sheet_XConsolidationDescriptor.xba @@ -0,0 +1,144 @@ +<?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="sheet_XConsolidationDescriptor" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.sheet.XConsolidationDescriptor +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim mStartPos, objpos As Variant + Dim bUseCols, bUseRows, bUsed, bLinks As Boolean + Dim src(0) As New com.sun.star.table.CellRangeAddress + Dim outpos As New com.sun.star.table.CellAddress + Dim objSrc() As Variant + + Test.StartMethod("getFunction()") + bOK = true + bOK = bOK AND NOT IsNULL(oObj.Function) + Test.MethodTested("getFunction()", bOK) + + Test.StartMethod("getSources()") + bOK = true + bOK = bOK AND NOT isNULL(oObj.getSources()) + Test.MethodTested("getSources()", bOK) + + Test.StartMethod("getStartOutputPosition()") + bOK = true + mStartPos = oObj.getStartOutputPosition() + bOK = mStartPos.Row >= 0 ' Checking that returned type is correct + ' (if Object has such field) + Test.MethodTested("getStartOutputPosition()", bOK) + + Test.StartMethod("getUseRowHeaders()") + Test.StartMethod("setUseRowHeaders()") + bOK = true + bUsed = oObj.getUseRowHeaders + oObj.setUseRowHeaders(NOT bUsed) + bOK = bOK AND (oObj.getUseRowHeaders <> bUsed) + Test.MethodTested("getUseRowHeaders()", bOK) + Test.MethodTested("setUseRowHeaders()", bOK) + + Test.StartMethod("setFunction()") + bOK = true + oObj.setFunction(com.sun.star.sheet.GeneralFunction.MAX) + bOK = bOK AND (oObj.getFunction = com.sun.star.sheet.GeneralFunction.MAX) + Test.MethodTested("setFunction()", bOK) + + Test.StartMethod("getInsertLinks()") + Test.StartMethod("setInsertLinks()") + bOK = true + bLinks = oObj.getInsertLinks + oObj.setInsertLinks(NOT bLinks) + bOK = bOK AND (oObj.getInsertLinks <> bLinks) + Test.MethodTested("getInsertLinks()", bOK) + Test.MethodTested("setInsertLinks()", bOK) + + Test.StartMethod("setSources()") + bOK = true + src(0).Sheet = 0 + src(0).StartRow = 5 + src(0).StartColumn = 5 + src(0).EndRow = 10 + src(0).EndColumn = 10 + oObj.setSources(src()) + objSrc() = oObj.getSources + bOK = bOK AND ((objSrc(0).Sheet = src(0).Sheet) AND _ + (objSrc(0).StartRow = src(0).StartRow) AND _ + (objSrc(0).EndRow = src(0).EndRow) AND _ + (objSrc(0).StartColumn = src(0).StartColumn) AND _ + (objSrc(0).EndColumn = src(0).EndColumn)) + Test.MethodTested("setSources()", bOK) + + Test.StartMethod("setStartOutputPosition()") + bOK = true + outpos.Sheet = 0 + outpos.Row = 2 + outpos.Column = 2 + oObj.setStartOutputPosition(outpos) + objpos = oObj.getStartOutputPosition + bOK = bOK AND ((objpos(0).Sheet = outpos(0).Sheet) AND _ + (objpos(0).Row = outpos(0).Row) AND _ + (objpos(0).Column = outpos(0).Column)) + Test.MethodTested("setStartOutputPosition()", bOK) + + Test.StartMethod("getUseColumnHeaders()") + bOK = true + bUseCols = oObj.getUseColumnHeaders() + oObj.setUseColumnHeaders(NOT bUseCols) + bOK = bOK AND (oObj.getUseColumnHeaders() <> bUseCols) + Test.MethodTested("getUseColumnHeaders()", bOK) + + Test.StartMethod("setUseColumnHeaders()") + bOK = true + bUseRows = oObj.getUseRowHeaders + oObj.setUseRowHeaders(NOT bUseRows) + bOK = bOK AND (oObj.getUseRowHeaders <> bUseRows) + Test.MethodTested("setUseColumnHeaders()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sheet/XDDELink/script.xlb b/qadevOOo/tests/basic/ifc/sheet/XDDELink/script.xlb new file mode 100644 index 000000000000..b045e20e2e69 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XDDELink/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="sheet_XDDELink" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sheet_XDDELink"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sheet/XDDELink/sheet_XDDELink.xba b/qadevOOo/tests/basic/ifc/sheet/XDDELink/sheet_XDDELink.xba new file mode 100644 index 000000000000..9b0f8e94fa82 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XDDELink/sheet_XDDELink.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="sheet_XDDELink" 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 + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' - Global DDETopic As String +' - Global DDEApplication As String +' - Global DDEItem As String + +'************************************************************************* + + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.sheet.XDDELink +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Test.StartMethod("getApplication()") + bOK = true + bOK = bOK AND NOT isNULL(oObj.getApplication) AND (oObj.getApplication = DDEApplication) + Test.MethodTested("getApplication()", bOK) + + Test.StartMethod("getTopic()") + bOK = true + bOK = bOK AND NOT isNULL(oObj.getTopic) AND (oObj.getTopic = DDETopic) + Test.MethodTested("getTopic()", bOK) + + Test.StartMethod("getItem()") + bOK = true + bOK = bOK AND NOT isNULL(oObj.getItem) AND (oObj.getItem = DDEItem) + Test.MethodTested("getItem()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sheet/XDataPilotDescriptor/script.xlb b/qadevOOo/tests/basic/ifc/sheet/XDataPilotDescriptor/script.xlb new file mode 100644 index 000000000000..303178ad2b29 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XDataPilotDescriptor/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="sheet_XDataPilotDescriptor" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sheet_XDataPilotDescriptor"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sheet/XDataPilotDescriptor/sheet_XDataPilotDescriptor.xba b/qadevOOo/tests/basic/ifc/sheet/XDataPilotDescriptor/sheet_XDataPilotDescriptor.xba new file mode 100644 index 000000000000..97fecf3af2e4 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XDataPilotDescriptor/sheet_XDataPilotDescriptor.xba @@ -0,0 +1,143 @@ +<?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="sheet_XDataPilotDescriptor" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.sheet.XDataPilotDescriptor +'************************************************************************* +On Error Goto ErrHndl + Dim bOK, bOK1 As Boolean + Dim Tag, oldTag As String + Dim oldRange, newRange, FD As Object + Dim Range As New com.sun.star.table.CellRangeAddress + Dim Fields() As Object + + Test.StartMethod("getTag()") + bOK = true + bOK = bOK AND NOT isNULL(oObj.getTag()) + Test.MethodTested("getTag()", bOK) + + Test.StartMethod("setTag()") + bOK = true + Tag = cIfcShortName + oldTag = oObj.getTag() + oObj.SetTag(Tag) + bOK = bOK AND (oldTag <> oObj.getTag()) + oObj.setTag(oldTag) + Test.MethodTested("setTag()", bOK) + + Test.StartMethod("getSourceRange()") + bOK = true + bOK = bOK AND NOT isNULL(oObj.getSourceRange()) + Test.MethodTested("getSourceRange()", bOK) + + Test.StartMethod("setSourceRange()") + bOK = true + Range.Sheet = 0 + Range.StartColumn = 1 + Range.StartRow = 1 + Range.EndColumn = 4 + Range.EndRow = 4 + + oldRange = oObj.getSourceRange + oObj.setSourceRange(Range) + newRange = oObj.getSourceRange + bOK1 = false + bOK1 = bOK1 OR newRange.Sheet <> oldRange.Sheet + bOK1 = bOK1 OR newRange.StartColumn <> oldRange.StartColumn + bOK1 = bOK1 OR newRange.EndColumn <> oldRange.EndColumn + bOK1 = bOK1 OR newRange.StartRow <> oldRange.StartRow + bOK1 = bOK1 OR newRange.EndRow <> oldRange.EndRow + bOK = bOK AND bOK1 + + oObj.setSourceRange(oldRange) + Test.MethodTested("setSourceRange()", bOK) + + Test.StartMethod("getFilterDescriptor()") + bOK = true + FD = oObj.getFilterDescriptor + bOK = (NOT isNULL(FD)) AND (ubound(FD.getFilterFields) > 0) + Test.MethodTested("getFilterDescriptor()", bOK) + + Test.StartMethod("getDataPilotFields()") + bOK = true + Fields = oObj.getDataPilotFields + bOK = NOT isNULL(Fields) + Test.MethodTested("getDataPilotFields()", bOK) + + Test.StartMethod("getColumnFields()") + bOK = true + Fields = oObj.getColumnFields + bOK = NOT isNULL(Fields) + Test.MethodTested("getColumnFields()", bOK) + + Test.StartMethod("getRowFields()") + bOK = true + Fields = oObj.getRowFields + bOK = NOT isNULL(Fields) + Test.MethodTested("getRowFields()", bOK) + + Test.StartMethod("getPageFields()") + bOK = true + Fields = oObj.getPageFields() + bOK = NOT isNULL(Fields) + Test.MethodTested("getPageFields()", bOK) + + Test.StartMethod("getDataFields()") + bOK = true + Fields = oObj.getDataFields + bOK = bOK AND NOT isNULL(Fields) + Test.MethodTested("getDataFields()", bOK) + + Test.StartMethod("getHiddenFields()") + bOK = true + Fields = oObj.getHiddenFields() + bOK = NOT isNULL(Fields) + Test.MethodTested("getHiddenFields()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sheet/XDataPilotTable/script.xlb b/qadevOOo/tests/basic/ifc/sheet/XDataPilotTable/script.xlb new file mode 100644 index 000000000000..5edf552cd579 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XDataPilotTable/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="sheet_XDataPilotTable" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sheet_XDataPilotTable"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sheet/XDataPilotTable/sheet_XDataPilotTable.xba b/qadevOOo/tests/basic/ifc/sheet/XDataPilotTable/sheet_XDataPilotTable.xba new file mode 100644 index 000000000000..e2d7d1c517eb --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XDataPilotTable/sheet_XDataPilotTable.xba @@ -0,0 +1,92 @@ +<?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="sheet_XDataPilotTable" 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 + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' - Global oOutputRange As New com.sun.star.table.CellAddress + +'************************************************************************* + + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.sheet.XDataPilotTable +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim Range, oSheet As Object + Dim oldData, newData, CellRow, CellCol As Integer + + Test.StartMethod("getOutputRange()") + bOK = true + Range = oObj.getOutputRange() + bOK = bOK AND NOT isNULL(Range) + if (bOK) then + bOK = bOK AND Range.Sheet = oOutputRange.Sheet + bOK = bOK AND Range.StartRow = oOutputRange.Row + bOK = bOK AND Range.StartColumn = oOutputRange.Column + end if + Test.MethodTested("getOutputRange()", bOK) + + Test.StartMethod("refresh()") + bOK = true + CellRow = oObj.getSourceRange.EndRow + CellCol = oObj.getSourceRange.EndColumn + oSheet = oDoc.Sheets.getByIndex(0) + oSheet.getCellByPosition(CellCol, CellRow).Value = 5 + oldData = oSheet.getCellByPosition(oOutputRange.Column, oOutputRange.Row+3).Value + oObj.refresh() + newData = oSheet.getCellByPosition(oOutputRange.Column, oOutputRange.Row+3).Value + bOK = bOK AND (oldData <> newData) + Test.MethodTested("refresh()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sheet/XDataPilotTables/script.xlb b/qadevOOo/tests/basic/ifc/sheet/XDataPilotTables/script.xlb new file mode 100644 index 000000000000..2e5439e882be --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XDataPilotTables/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="sheet_XDataPilotTables" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sheet_XDataPilotTables"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sheet/XDataPilotTables/sheet_XDataPilotTables.xba b/qadevOOo/tests/basic/ifc/sheet/XDataPilotTables/sheet_XDataPilotTables.xba new file mode 100644 index 000000000000..fb343083c4fe --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XDataPilotTables/sheet_XDataPilotTables.xba @@ -0,0 +1,88 @@ +<?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="sheet_XDataPilotTables" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.sheet.XDataPilotTables +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim DSC As Object + Dim DSCcreated As Boolean + Dim count As Long + + Test.StartMethod("createDataPilotDescriptor()") + bOK = true + DSC = oObj.createDataPilotDescriptor() + bOK = bOK AND not isNull(DSC) + DSCcreated = bOK + Test.MethodTested("createDataPilotDescriptor()", bOK) + + Test.StartMethod("insertNewByName()") + bOK = true + if (DSCcreated) then + count = oObj.Count + Dim Address As New com.sun.star.table.CellAddress + Address.Sheet = 0 + Address.Column = 10 + Address.Row = 10 + oObj.insertNewByName(cIfcShortName & "insertNewByName", Address, DSC) + bOK = bOK AND oObj.Count = count + 1 + end if + Test.MethodTested("insertNewByName()", bOK) + + Test.StartMethod("removeByName()") + bOK = true + if (DSCcreated) then + count = oObj.Count + oObj.removeByName(cIfcShortName & "insertNewByName") + bOK = oObj.Count = count - 1 + end if + Test.MethodTested("removeByName()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sheet/XDataPilotTablesSupplier/script.xlb b/qadevOOo/tests/basic/ifc/sheet/XDataPilotTablesSupplier/script.xlb new file mode 100644 index 000000000000..9bc02996a2a8 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XDataPilotTablesSupplier/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="sheet_XDataPilotTablesSupplier" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sheet_XDataPilotTablesSupplier"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sheet/XDataPilotTablesSupplier/sheet_XDataPilotTablesSupplier.xba b/qadevOOo/tests/basic/ifc/sheet/XDataPilotTablesSupplier/sheet_XDataPilotTablesSupplier.xba new file mode 100644 index 000000000000..fd7bb7476312 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XDataPilotTablesSupplier/sheet_XDataPilotTablesSupplier.xba @@ -0,0 +1,60 @@ +<?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="sheet_XDataPilotTablesSupplier" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.sheet.XDataPilotTablesSupplier +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + Test.StartMethod("getDataPilotTables()") + bOK = true + oDPT = oObj.getDataPilotTables() + bOK = bOK AND hasUnoInterfaces(oDPT, "com.sun.star.sheet.XDataPilotTables") + Test.MethodTested("getDataPilotTables()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sheet/XDatabaseRange/script.xlb b/qadevOOo/tests/basic/ifc/sheet/XDatabaseRange/script.xlb new file mode 100644 index 000000000000..0211247cd414 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XDatabaseRange/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="sheet_XDatabaseRange" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sheet_XDatabaseRange"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sheet/XDatabaseRange/sheet_XDatabaseRange.xba b/qadevOOo/tests/basic/ifc/sheet/XDatabaseRange/sheet_XDatabaseRange.xba new file mode 100644 index 000000000000..be1d5b906306 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XDatabaseRange/sheet_XDatabaseRange.xba @@ -0,0 +1,106 @@ +<?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="sheet_XDatabaseRange" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.sheet.XDatabaseRange +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim oldDA, oSD, oFD, oID, oSTD As Object + Dim newDA As New com.sun.star.table.CellRangeAddress + + Test.StartMethod("getDataArea()") + Test.StartMethod("setDataArea()") + bOK = true + oldDA = oObj.getDataArea() + newDA.Sheet = 0 + newDA.StartColumn = 5 + newDA.StartRow = 6 + newDA.EndColumn = 10 + newDA.EndRow = 8 + oObj.setDataArea(newDA) + bOK = bOK AND oObj.getDataArea().Sheet = newDA.Sheet + bOK = bOK AND oObj.getDataArea().StartColumn = newDA.StartColumn + bOK = bOK AND oObj.getDataArea().StartRow = newDA.StartRow + bOK = bOK AND oObj.getDataArea().EndColumn = newDA.EndColumn + bOK = bOK AND oObj.getDataArea().EndRow = newDA.EndRow + oObj.setDataArea(oldDA) + Test.MethodTested("getDataArea()", bOK) + Test.MethodTested("setDataArea()", bOK) + + Test.StartMethod("getSortDescriptor()") + bOK = true + oSD = oObj.getSortDescriptor() + bOK = bOK AND isArray(oSD) + Test.MethodTested("getSortDescriptor()", bOK) + + Test.StartMethod("getFilterDescriptor()") + bOK = true + oFD = oObj.getFilterDescriptor() + bOK = bOK AND hasUnoInterfaces(oFD, "com.sun.star.sheet.XSheetFilterDescriptor") + Test.MethodTested("getFilterDescriptor()", bOK) + + Test.StartMethod("getSubTotalDescriptor()") + bOK = true + oSTD = oObj.getSubTotalDescriptor() + bOK = bOK AND hasUnoInterfaces(oSTD, "com.sun.star.sheet.XSubTotalDescriptor") + Test.MethodTested("getSubTotalDescriptor()", bOK) + + Test.StartMethod("getImportDescriptor()") + bOK = true + oID = oObj.getImportDescriptor() + bOK = bOK AND isArray(oID) + Test.MethodTested("getImportDescriptor()", bOK) + + Test.StartMethod("refresh()") + bOK = true + oObj.refresh() + Test.MethodTested("refresh()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sheet/XDatabaseRanges/script.xlb b/qadevOOo/tests/basic/ifc/sheet/XDatabaseRanges/script.xlb new file mode 100644 index 000000000000..19f153f7d2f3 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XDatabaseRanges/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="sheet_XDatabaseRanges" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sheet_XDatabaseRanges"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sheet/XDatabaseRanges/sheet_XDatabaseRanges.xba b/qadevOOo/tests/basic/ifc/sheet/XDatabaseRanges/sheet_XDatabaseRanges.xba new file mode 100644 index 000000000000..c3d645b8f486 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XDatabaseRanges/sheet_XDatabaseRanges.xba @@ -0,0 +1,76 @@ +<?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="sheet_XDatabaseRanges" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.sheet.XDatabaseRanges +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim nCount As Integer + Dim aRange As New com.sun.star.table.CellRangeAddress + + Test.StartMethod("addNewByName()") + bOK = true + nCount = oObj.Count + aRange.Sheet = 0 + aRange.StartRow = 3 + aRange.StartColumn = 4 + aRange.EndRow = 10 + aRange.EndColumn = 7 + oObj.addNewByName(cIfcShortName, aRange) + bOK = bOK AND oObj.Count = nCount + 1 + Test.MethodTested("addNewByName()", bOK) + + Test.StartMethod("removeByName()") + bOK = true + oObj.removeByName(cIfcShortName) + bOK = bOK AND oObj.Count = nCount + Test.MethodTested("removeByName()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sheet/XFunctionDescriptions/script.xlb b/qadevOOo/tests/basic/ifc/sheet/XFunctionDescriptions/script.xlb new file mode 100644 index 000000000000..62b8a0e946bc --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XFunctionDescriptions/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="sheet_XFunctionDescriptions" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sheet_XFunctionDescriptions"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sheet/XFunctionDescriptions/sheet_XFunctionDescriptions.xba b/qadevOOo/tests/basic/ifc/sheet/XFunctionDescriptions/sheet_XFunctionDescriptions.xba new file mode 100644 index 000000000000..3499cf8146ef --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XFunctionDescriptions/sheet_XFunctionDescriptions.xba @@ -0,0 +1,78 @@ +<?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="sheet_XFunctionDescriptions" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.sheet.XFunctionDescriptions +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim fId,count As Long + Dim fName As String + Dim funct As Object + Dim i,j As Long + + Test.StartMethod("getById()") + bOK = true + count = oObj.count + Dim retfunct() As Variant + for i = 0 to count - 1 + funct = oObj.getByIndex(i) + for j = 0 to ubound(funct) + if funct(j).Name = "Name" then fName = funct(j).Value + if funct(j).Name = "Id" then fId = funct(j).Value + next j + Out.Log("Function " & i & ") " & fName & " has Id = " & fId) + retfunct = oObj.getById(fId) + for j = 0 to ubound(retfunct) + if retfunct(j).Name = "Name" then bOK = bOK AND retfunct(j).Value = fName + next j + next i + Test.MethodTested("getById()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sheet/XHeaderFooterContent/script.xlb b/qadevOOo/tests/basic/ifc/sheet/XHeaderFooterContent/script.xlb new file mode 100644 index 000000000000..f1b385ebbd9b --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XHeaderFooterContent/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="sheet_XHeaderFooterContent" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sheet_XHeaderFooterContent"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sheet/XHeaderFooterContent/sheet_XHeaderFooterContent.xba b/qadevOOo/tests/basic/ifc/sheet/XHeaderFooterContent/sheet_XHeaderFooterContent.xba new file mode 100644 index 000000000000..e280923d62b0 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XHeaderFooterContent/sheet_XHeaderFooterContent.xba @@ -0,0 +1,94 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="sheet_XHeaderFooterContent" 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 + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' - Global cLeftText As String +' - Global cCenterText As String +' - Global cRightText As String + +'************************************************************************* + + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.sheet.XHeaderFooterContent +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim oText As Object + + Test.StartMethod("getLeftText()") + bOK = true + oText = oObj.getLeftText() + bOK = bOK AND hasUnoInterfaces(oText, "com.sun.star.text.XText") + Out.Log("Text is '" & oText.String & "'") + bOK = bOK AND oText.String = cLeftText + Test.MethodTested("getLeftText()", bOK) + + Test.StartMethod("getCenterText()") + bOK = true + oText = oObj.getCenterText() + bOK = bOK AND hasUnoInterfaces(oText, "com.sun.star.text.XText") + Out.Log("Text is '" & oText.String & "'") + bOK = bOK AND oText.String = cCenterText + Test.MethodTested("getCenterText()", bOK) + + Test.StartMethod("getRightText()") + bOK = true + oText = oObj.getRightText() + bOK = bOK AND hasUnoInterfaces(oText, "com.sun.star.text.XText") + Out.Log("Text is '" & oText.String & "'") + bOK = bOK AND oText.String = cRightText + Test.MethodTested("getRightText()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sheet/XLabelRange/script.xlb b/qadevOOo/tests/basic/ifc/sheet/XLabelRange/script.xlb new file mode 100644 index 000000000000..8c8d2b1bc8b5 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XLabelRange/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="sheet_XLabelRange" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sheet_XLabelRange"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sheet/XLabelRange/sheet_XLabelRange.xba b/qadevOOo/tests/basic/ifc/sheet/XLabelRange/sheet_XLabelRange.xba new file mode 100644 index 000000000000..312cc52aef76 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XLabelRange/sheet_XLabelRange.xba @@ -0,0 +1,116 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="sheet_XLabelRange" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.sheet.XLabelRange +'************************************************************************* +On Error Goto ErrHndl + Dim bOK, bAllOK As Boolean + Dim oldArea, newArea As Object + Dim Area As New com.sun.star.table.CellRangeAddress + + Test.StartMethod("getLabelArea()") + bOK = true + bOK = bOK AND NOT isNULL(oObj.getLabelArea()) + Test.MethodTested("getLabelArea()", bOK) + + bAllOK = bAllOK AND bOK + + Test.StartMethod("setLabelArea()") + bOK = true + + Area.Sheet = 0 + Area.StartColumn = 1 + Area.StartRow = 1 + Area.EndColumn = 5 + Area.EndRow = 5 + + oldArea = oObj.getLabelArea() + oObj.setLabelArea(Area) + newArea = oObj.getLabelArea() + bOK = bOK AND NOT isNULL(newArea) + + bOK = bOK AND newArea.Sheet = Area.Sheet + bOK = bOK AND newArea.StartColumn = Area.StartColumn + bOK = bOK AND newArea.StartRow = Area.StartRow + bOK = bOK AND newArea.EndColumn = Area.EndColumn + bOK = bOK AND newArea.EndRow = Area.EndRow + + oObj.setLabelArea(oldArea) + Test.MethodTested("setLabelArea()", bOK) + + Test.StartMethod("getDataArea()") + bOK = true + bOK = bOK AND NOT isNULL(oObj.getDataArea()) + Test.MethodTested("getDataArea()", bOK) + + Test.StartMethod("setDataArea()") + bOK = true + + Area.Sheet = 0 + Area.StartColumn = 1 + Area.StartRow = 1 + Area.EndColumn = 5 + Area.EndRow = 5 + + oldArea = oObj.getDataArea() + oObj.setDataArea(Area) + newArea = oObj.getDataArea() + bOK = bOK AND NOT isNULL(newArea) + + bOK = bOK AND newArea.Sheet = Area.Sheet + bOK = bOK AND newArea.StartColumn = Area.StartColumn + bOK = bOK AND newArea.StartRow = Area.StartRow + bOK = bOK AND newArea.EndColumn = Area.EndColumn + bOK = bOK AND newArea.EndRow = Area.EndRow + + oObj.setDataArea(oldArea) + Test.MethodTested("setDataArea()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sheet/XLabelRanges/script.xlb b/qadevOOo/tests/basic/ifc/sheet/XLabelRanges/script.xlb new file mode 100644 index 000000000000..d465b388bf8e --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XLabelRanges/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="sheet_XLabelRanges" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sheet_XLabelRanges"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sheet/XLabelRanges/sheet_XLabelRanges.xba b/qadevOOo/tests/basic/ifc/sheet/XLabelRanges/sheet_XLabelRanges.xba new file mode 100644 index 000000000000..bd8b9b817ece --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XLabelRanges/sheet_XLabelRanges.xba @@ -0,0 +1,88 @@ +<?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="sheet_XLabelRanges" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.sheet.XLabelRanges +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim count As Integer + Dim RangeAddress1 As New com.sun.star.table.CellRangeAddress + Dim RangeAddress2 As New com.sun.star.table.CellRangeAddress + + Test.StartMethod("addNew()") + bOK = true + + count = oObj.count + RangeAddress1.Sheet = 0 + RangeAddress1.StartColumn = 2 + RangeAddress1.StartRow = 3 + RangeAddress1.EndColumn = 4 + RangeAddress1.EndRow = 5 + + RangeAddress2.Sheet = 0 + RangeAddress2.StartColumn = 6 + RangeAddress2.StartRow = 7 + RangeAddress2.EndColumn = 8 + RangeAddress2.EndRow = 9 + oObj.AddNew(RangeAddress1, RangeAddress2) + + bOK = bOK AND count = oObj.count - 1 + Test.MethodTested("addNew()", bOK) + + Test.StartMethod("removeByIndex()") + bOK = true + + count = oObj.count + oObj.removeByIndex(count - 1) + + bOK = bOK AND (count = oObj.count + 1) + Test.MethodTested("removeByIndex()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sheet/XNamedRange/script.xlb b/qadevOOo/tests/basic/ifc/sheet/XNamedRange/script.xlb new file mode 100644 index 000000000000..85dfce8cddf2 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XNamedRange/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="sheet_XNamedRange" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sheet_XNamedRange"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sheet/XNamedRange/sheet_XNamedRange.xba b/qadevOOo/tests/basic/ifc/sheet/XNamedRange/sheet_XNamedRange.xba new file mode 100644 index 000000000000..69ef24c93c5c --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XNamedRange/sheet_XNamedRange.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="sheet_XNamedRange" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.sheet.XNamedRange +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim oldContent, newContent As String + Dim position, oldPosition As Object + Dim newPosition As New com.sun.star.table.CellAddress + Dim oldType, newType As Long + + Test.StartMethod("getContent()") + bOK = true + bOK = bOK AND NOT isNULL(oObj.getContent()) + Test.MethodTested("getContent()", bOK) + + Test.StartMethod("setContent()") + bOK = true + oldContent = oObj.getContent + newContent = cIfcShortName + oObj.setContent(newContent) + bOK = bOK AND (oldContent <> oObj.getContent) + oObj.setContent(oldContent) + Test.MethodTested("setContent()", bOK) + + Test.StartMethod("getReferencePosition()") + bOK = true + bOK = bOK AND NOT isNULL(oObj.getReferencePosition()) + Test.MethodTested("getReferencePosition()", bOK) + + Test.StartMethod("setReferencePosition()") + bOK = true + oldPosition = oObj.getReferencePosition() + + newPosition.sheet = oldPosition.sheet + newPosition.row = oldPosition.row + 1 + newPosition.column = oldPosition.column + 1 + oObj.setReferencePosition(newPosition) + position = oObj.getReferencePosition() + + bOK = bOK AND NOT isNULL(position) + bOK = bOK AND position.Row <> oldPosition.row + bOK = bOK AND position.Column <> oldPosition.Column + + oObj.setReferencePosition(oldPosition) + Test.MethodTested("setReferencePosition()", bOK) + + Test.StartMethod("getType()") + bOK = true + bOK = bOK AND NOT isNULL(oObj.getType) + Test.MethodTested("getType()", bOK) + + Test.StartMethod("setType()") + bOK = true + oldType = oObj.getType() + newType = oldType XOR com.sun.star.sheet.NamedRangeFlag.PRINT_AREA + oObj.setType(newType) + bOK = bOK AND (oldType <> oObj.getType()) + oObj.setType(oldType) + Test.MethodTested("setType()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sheet/XNamedRanges/script.xlb b/qadevOOo/tests/basic/ifc/sheet/XNamedRanges/script.xlb new file mode 100644 index 000000000000..fc871518b603 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XNamedRanges/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="sheet_XNamedRanges" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sheet_XNamedRanges"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sheet/XNamedRanges/sheet_XNamedRanges.xba b/qadevOOo/tests/basic/ifc/sheet/XNamedRanges/sheet_XNamedRanges.xba new file mode 100644 index 000000000000..e7da70d5be52 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XNamedRanges/sheet_XNamedRanges.xba @@ -0,0 +1,131 @@ +<?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="sheet_XNamedRanges" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.sheet.XNamedRanges +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim count As Integer + Dim outRange As New com.sun.star.table.CellAddress + Dim range As New com.sun.star.table.CellRangeAddress + Dim i As Integer + + Test.StartMethod("addNewByName()") + bOK = true + outRange.Sheet = 0 + outRange.Row = 1 + outRange.Column = 1 + count = oObj.Count + oObj.addNewByName(cIfcShortName, "T4:Y7", outRange, 0) + bOK = bOK AND oObj.count = count + 1 + bOK = bOK AND oObj.hasByName(cIfcShortName) + Test.MethodTested("addNewByName()", bOK) + + Test.StartMethod("addNewFromTitles()") + bOK = true + count = oObj.count + + range.Sheet = 0 + range.StartRow = 1 + range.StartColumn = 2 + range.EndRow = 3 + range.EndColumn = 4 + + for i = 1 to 5 + oDoc.Sheets(0).getCellByPosition(i, 1).String = "Col" & i + next i + + oObj.addNewFromTitles(range, com.sun.star.sheet.Border.TOP) + + bOK = bOK AND (oObj.count = count + 3) + + bOK = bOK AND NOT oObj.hasByName("Col1") + bOK = bOK AND oObj.hasByName("Col2") + bOK = bOK AND oObj.hasByName("Col3") + bOK = bOK AND oObj.hasByName("Col4") + bOK = bOK AND NOT oObj.hasByName("Col5") + Test.MethodTested("addNewFromTitles()", bOK) + + Test.StartMethod("removeByName()") + bOK = true + count = oObj.Count + oObj.removeByName(cIfcShortName) + bOK = bOK AND (count = oObj.count + 1) + bOK = bOK AND NOT oObj.hasByName(cIfcShortName) + Test.MethodTested("removeByName()", bOK) + + Test.StartMethod("outputList()") + bOK = true + outRange.Sheet = 0 + outRange.Row = 5 + outRange.Column = 5 + + count = oObj.count + for i = 4 to 5 + count + oDoc.Sheets(0).getCellByPosition(5, i).String = "a" + oDoc.Sheets(0).getCellByPosition(6, i).String = "b" + next i + + oObj.outputList(outRange) + + bOK = bOK AND oDoc.Sheets(0).getCellByPosition(5, 4).String = "a" + bOK = bOK AND oDoc.Sheets(0).getCellByPosition(6, 4).String = "b" + bOK = bOK AND oDoc.Sheets(0).getCellByPosition(5, 5 + count).String = "a" + bOK = bOK AND oDoc.Sheets(0).getCellByPosition(6, 5 + count).String = "b" + + for i = 5 to 4 + count + bOK = bOK AND oDoc.Sheets(0).getCellByPosition(5, i).String <> "a" + bOK = bOK AND oDoc.Sheets(0).getCellByPosition(6, i).String <> "b" + bOK = bOK AND oObj.hasByName(oDoc.Sheets(0).getCellByPosition(5, i).String) + next i + + Test.MethodTested("outputList()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sheet/XRecentFunctions/script.xlb b/qadevOOo/tests/basic/ifc/sheet/XRecentFunctions/script.xlb new file mode 100644 index 000000000000..3ae59e9d0b50 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XRecentFunctions/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="sheet_XRecentFunctions" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sheet_XRecentFunctions"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sheet/XRecentFunctions/sheet_XRecentFunctions.xba b/qadevOOo/tests/basic/ifc/sheet/XRecentFunctions/sheet_XRecentFunctions.xba new file mode 100644 index 000000000000..dbc114a848e4 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XRecentFunctions/sheet_XRecentFunctions.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="sheet_XRecentFunctions" 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 + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' - Global AllFunctions As Variant + +'************************************************************************* + + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.sheet.XRecentFunctions +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim recentFunctions As Variant + Dim i, j As Integer + Dim props As Variant + + + Test.StartMethod("getRecentFunctionIds()") + bOK = true + recentFunctions = oObj.getRecentFunctionIds() + bOK = bOK AND NOT isNULL(recentFunctions) + bOK = bOK AND ubound(recentFunctions) <= oObj.getMaxRecentFunctions + for i = 0 to ubound(recentFunctions) - 1 + for j = i + 1 to ubound(recentFunctions) + if recentFunctions(i) = recentFunctions(j) then bOK = false + next j + next i + Test.MethodTested("getRecentFunctionIds()", bOK) + + Test.StartMethod("setRecentFunctionIds()") + bOK = true + Dim Max As Integer + Max = oObj.getMaxRecentFunctions + Dim newList(Max) As Integer + + for i = 0 to ubound(newList()) + props = AllFunctions.getByIndex(i) + for j = 0 to ubound(props()) + if props(j).Name = "Id" then + newList(i) = props(j).Value + exit for + end if + next j + next i + + oObj.setRecentFunctionIds(newList()) + bOK = bOK AND (Max = oObj.getMaxRecentFunctions) + Test.MethodTested("setRecentFunctionIds()", bOK) + + Test.StartMethod("getMaxRecentFunctions()") + bOK = true + Max = oObj.getMaxRecentFunctions + Out.Log("MaxRecentFunctions = " & Max) + bOK = bOK AND Max > 0 + Test.MethodTested("getMaxRecentFunctions()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sheet/XScenarios/script.xlb b/qadevOOo/tests/basic/ifc/sheet/XScenarios/script.xlb new file mode 100644 index 000000000000..27edd15fbc85 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XScenarios/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="sheet_XScenarios" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sheet_XScenarios"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sheet/XScenarios/sheet_XScenarios.xba b/qadevOOo/tests/basic/ifc/sheet/XScenarios/sheet_XScenarios.xba new file mode 100644 index 000000000000..f700d2c2bf7c --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XScenarios/sheet_XScenarios.xba @@ -0,0 +1,80 @@ +<?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="sheet_XScenarios" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.sheet.XScenarios +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim nCount As Integer + Dim aCRA(1) As New com.sun.star.table.CellRangeAddress + + aCRA(0).Sheet = 0 : aCRA(1).Sheet = 0 + aCRA(0).StartColumn = 3 : aCRA(1).StartColumn = 13 + aCRA(0).StartRow = 4 : aCRA(1).StartRow = 14 + aCRA(0).EndColumn = 8 : aCRA(1).EndColumn = 18 + aCRA(0).EndRow = 9 : aCRA(1).EndRow = 19 + + Test.StartMethod("addNewByName()") + bOK = true + nCount = oObj.getCount() + Out.Log("Initialy there are " & nCount & " scenarios.") + oObj.addNewByName("NewScenario", aCRA(), "New comment") + Out.Log("After inserting there are " & oObj.getCount() & " scenarios.") + bOK = bOK AND oObj.getCount() = nCount + 1 + Test.MethodTested("addNewByName()", bOK) + + Test.StartMethod("removeByName()") + bOK = true + oObj.removeByName("NewScenario") + Out.Log("After removing there are " & oObj.getCount() & " scenarios.") + bOK = bOK AND oObj.getCount() = nCount + Test.MethodTested("removeByName()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sheet/XScenariosSupplier/script.xlb b/qadevOOo/tests/basic/ifc/sheet/XScenariosSupplier/script.xlb new file mode 100644 index 000000000000..51fbaf29311e --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XScenariosSupplier/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="sheet_XScenariosSupplier" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sheet_XScenariosSupplier"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sheet/XScenariosSupplier/sheet_XScenariosSupplier.xba b/qadevOOo/tests/basic/ifc/sheet/XScenariosSupplier/sheet_XScenariosSupplier.xba new file mode 100644 index 000000000000..678b06532a20 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XScenariosSupplier/sheet_XScenariosSupplier.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="sheet_XScenariosSupplier" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.sheet.XScenariosSupplier +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + Test.StartMethod("getScenarios()") + bOK = true + oScen = oObj.getScenarios() + bOK = bOK AND NOT isNULL(oScen) + bOK = bOK AND hasUnoInterfaces(oScen, "com.sun.star.sheet.XScenarios") + Test.MethodTested("getScenarios()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sheet/XSheetAnnotation/script.xlb b/qadevOOo/tests/basic/ifc/sheet/XSheetAnnotation/script.xlb new file mode 100644 index 000000000000..a00e77a3e5c5 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XSheetAnnotation/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="sheet_XSheetAnnotation" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sheet_XSheetAnnotation"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sheet/XSheetAnnotation/sheet_XSheetAnnotation.xba b/qadevOOo/tests/basic/ifc/sheet/XSheetAnnotation/sheet_XSheetAnnotation.xba new file mode 100644 index 000000000000..2278f4bb7d0d --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XSheetAnnotation/sheet_XSheetAnnotation.xba @@ -0,0 +1,92 @@ +<?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="sheet_XSheetAnnotation" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.sheet.XSheetAnnotation +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim oldVal, newVal, valToSet As Boolean + Dim vPos As Variant + + Test.StartMethod("getAuthor()") + bOK = true + bOK = bOK AND (VarType(oObj.getAuthor()) = 8) + Test.MethodTested("getAuthor()", bOK) + + Test.StartMethod("getDate()") + bOK = true + bOK = bOK AND (VarType(oObj.getDate()) = 8) + Test.MethodTested("getDate()", bOK) + + Test.StartMethod("getIsVisible()") + Test.StartMethod("setIsVisible()") + bOK = true + oldVal = oObj.getIsVisible() + Out.Log("value before: " + oldVal) + if oldVal then + valToSet = false + else + valToSet = true + endif + Out.Log("setting value: " + valToSet) + oObj.setIsVisible(valToSet) + newVal = oObj.getIsVisible() + Out.Log("value after: " + newVal) + bOK = bOK AND (oObj.getIsVisible() = valToSet) + Test.MethodTested("getIsVisible()", bOK) + Test.MethodTested("setIsVisible()", bOK) + + Test.StartMethod("getPosition()") + bOK = true + vPos = oObj.getPosition() + bOK = bOK AND isNumeric(vPos.Column) + Test.MethodTested("getPosition()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sheet/XSheetAnnotations/script.xlb b/qadevOOo/tests/basic/ifc/sheet/XSheetAnnotations/script.xlb new file mode 100644 index 000000000000..6625ff875cc8 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XSheetAnnotations/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="sheet_XSheetAnnotations" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sheet_XSheetAnnotations"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sheet/XSheetAnnotations/sheet_XSheetAnnotations.xba b/qadevOOo/tests/basic/ifc/sheet/XSheetAnnotations/sheet_XSheetAnnotations.xba new file mode 100644 index 000000000000..8c2a3a05eeec --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XSheetAnnotations/sheet_XSheetAnnotations.xba @@ -0,0 +1,75 @@ +<?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="sheet_XSheetAnnotations" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.sheet.XSheetAnnotations +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim aPos As New com.sun.star.table.CellAddress + Dim nCount As Integer + + Test.StartMethod("insertNew()") + bOK = true + nCount = oObj.Count + aPos.Sheet = 1 + aPos.Row = 2 + aPos.Column = 3 + oObj.insertNew(aPos, cIfcShortName) + bOK = bOK AND (oObj.Count = nCount + 1) + Test.MethodTested("insertNew()", bOK) + + Test.StartMethod("removeByIndex()") + bOK = true + oObj.removeByIndex(0) + bOK = bOK AND (oObj.Count = nCount) + Test.MethodTested("removeByIndex()", bOK) + + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sheet/XSheetAnnotationsSupplier/script.xlb b/qadevOOo/tests/basic/ifc/sheet/XSheetAnnotationsSupplier/script.xlb new file mode 100644 index 000000000000..405fe71bf16a --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XSheetAnnotationsSupplier/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="sheet_XSheetAnnotationsSupplier" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sheet_XSheetAnnotationsSupplier"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sheet/XSheetAnnotationsSupplier/sheet_XSheetAnnotationsSupplier.xba b/qadevOOo/tests/basic/ifc/sheet/XSheetAnnotationsSupplier/sheet_XSheetAnnotationsSupplier.xba new file mode 100644 index 000000000000..226b12b238ec --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XSheetAnnotationsSupplier/sheet_XSheetAnnotationsSupplier.xba @@ -0,0 +1,60 @@ +<?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="sheet_XSheetAnnotationsSupplier" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.sheet.XSheetAnnotationsSupplier +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + Test.StartMethod("getAnnotations()") + bOK = true + oAnno = oObj.getAnnotations() + bOK = bOK AND hasUnoInterfaces(oAnno, "com.sun.star.sheet.XSheetAnnotations") + Test.MethodTested("getAnnotations()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sheet/XSheetCellCursor/script.xlb b/qadevOOo/tests/basic/ifc/sheet/XSheetCellCursor/script.xlb new file mode 100644 index 000000000000..9d3c2f6875fd --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XSheetCellCursor/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="sheet_XSheetCellCursor" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sheet_XSheetCellCursor"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sheet/XSheetCellCursor/sheet_XSheetCellCursor.xba b/qadevOOo/tests/basic/ifc/sheet/XSheetCellCursor/sheet_XSheetCellCursor.xba new file mode 100644 index 000000000000..436e88fc983b --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XSheetCellCursor/sheet_XSheetCellCursor.xba @@ -0,0 +1,135 @@ +<?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="sheet_XSheetCellCursor" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.sheet.XSheetCellCursor +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim nCols As Integer, nRows As Long + Dim ResetCols As Integer, ResetRows As Long + Dim oRange As Variant + + ResetCols = oObj.getColumns().getCount() + ResetRows = oObj.getRows().getCount() + + Test.StartMethod("collapseToCurrentRegion()") + bOK = true + oObj.collapseToCurrentRegion() + nCols = oObj.getColumns().getCount() + nRows = oObj.getRows().getCount() + bOK = bOK AND (nCols > 0) AND (nRows > 0) + Out.Log("collapseToCurrentRegion(): nCols = " & nCols & "(>0) nRows = " & nRows & "(>0)") + Test.MethodTested("collapseToCurrentRegion()", bOK) + + 'collapseToMergedArea goes into the area. But you must be insite + ' of one cell of these area + Test.StartMethod("collapseToMergedArea()") + bOK = true + oObj.collapseToSize(5,6) + oRange = oObj.getCellRangeByPosition(0,0,2,2) + oRange.merge(true) + oObj.gotoStart() + oObj.collapseToMergedArea() + nCols = oObj.getColumns().getCount() + nRows = oObj.getRows().getCount() + bOK = bOK AND (nCols = 3) AND (nRows = 3) + Out.Log("collapseToMergedArea(): nCols = " & nCols & "(3) nRows = " & nRows & "(3)") + Test.MethodTested("collapseToMergedArea()", bOK) + oRange.merge(false) + + + Test.StartMethod("collapseToSize()") + bOK = true + oObj.collapseToSize(5,6) + nCols = oObj.getColumns().getCount() + nRows = oObj.getRows().getCount() + bOK = bOK AND (nCols = 5 ) AND (nRows = 6) + Out.Log("collapseToSize(): nCols = " & nCols & "(5) nRows = " & nRows & "(6)") + Test.MethodTested("collapseToSize()", bOK) + + Test.StartMethod("collapseToCurrentArray()") + oObj.collapseToSize(5,6) + oRange = oObj.getCellRangeByPosition(0,0,2,3) + oRange.setArrayFormula("A1:A3") + bOK = true + oObj.collapseToCurrentArray() + nCols = oObj.getColumns().getCount() + nRows = oObj.getRows().getCount() + bOK = bOK AND (nCols = 3) AND (nRows = 4) + Out.Log("collapseToCurrentArray(): nCols = " & nCols & "(3) nRows = " & nRows & "(4)") + Test.MethodTested("collapseToCurrentArray()", bOK) + oRange.setArrayFormula("") + + + Test.StartMethod("expandToEntireColumns()") + bOK = true + oObj.collapseToSize(1,1) + oObj.expandToEntireColumns() + nCols = oObj.getColumns().getCount() + nRows = oObj.getRows().getCount() + bOK = bOK AND (nCols = 1) AND (nRows >= 32000) + Out.Log("expandToEntireColumns(): nCols = " & nCols & "(1) nRows = " & nRows & "(>=32000)") + Test.MethodTested("expandToEntireColumns()", bOK) + + Test.StartMethod("expandToEntireRows()") + bOK = true + oObj.collapseToSize(1,1) + oObj.expandToEntireRows() + nCols = oObj.getColumns().getCount() + nRows = oObj.getRows().getCount() + bOK = bOK AND (nCols >= 256) AND (nRows = 1) + Out.Log("expandToEntireRows(): nCols = " & nCols & "(>=256) nRows = " & nRows & "(1)") + Test.MethodTested("expandToEntireRows()", bOK) + + + Out.Log("Reset to old range: " & ResetCols & "," & ResetRows) + oObj.collapseToSize(ResetCols, ResetRows) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sheet/XSheetCellRange/script.xlb b/qadevOOo/tests/basic/ifc/sheet/XSheetCellRange/script.xlb new file mode 100644 index 000000000000..c161cc4a0128 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XSheetCellRange/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="sheet_XSheetCellRange" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sheet_XSheetCellRange"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sheet/XSheetCellRange/sheet_XSheetCellRange.xba b/qadevOOo/tests/basic/ifc/sheet/XSheetCellRange/sheet_XSheetCellRange.xba new file mode 100644 index 000000000000..abfb9155ad5b --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XSheetCellRange/sheet_XSheetCellRange.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="sheet_XSheetCellRange" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.sheet.XSheetCellRange +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim oSheet As Object + + Test.StartMethod("getSpreadsheet()") + bOK = true + oSheet = oObj.getSpreadsheet() + bOK = bOK AND hasUnoInterfaces(oSheet, "com.sun.star.sheet.XSpreadsheet") + Test.MethodTested("getSpreadsheet()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sheet/XSheetCellRangeContainer/script.xlb b/qadevOOo/tests/basic/ifc/sheet/XSheetCellRangeContainer/script.xlb new file mode 100644 index 000000000000..77b18f7f6f93 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XSheetCellRangeContainer/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="sheet_XSheetCellRangeContainer" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sheet_XSheetCellRangeContainer"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sheet/XSheetCellRangeContainer/sheet_XSheetCellRangeContainer.xba b/qadevOOo/tests/basic/ifc/sheet/XSheetCellRangeContainer/sheet_XSheetCellRangeContainer.xba new file mode 100644 index 000000000000..18def92467cd --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XSheetCellRangeContainer/sheet_XSheetCellRangeContainer.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="sheet_XSheetCellRangeContainer" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.sheet.XSheetCellRangeContainer +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim newAddress As New com.sun.star.table.CellRangeAddress + Dim newAddress1 As New com.sun.star.table.CellRangeAddress + Dim newAddresses(1) As Variant + Dim nCount As Integer + + Test.StartMethod("addRangeAddress()") + Test.StartMethod("removeRangeAddress()") + bOK = true + nCount = oObj.getCount() + newAddress.Sheet = 0 + newAddress.StartColumn = 15 : newAddress.EndColumn = 18 + newAddress.StartRow = 15 : newAddress.EndRow = 16 + oObj.addRangeAddress(newAddress, false) + bOK = bOK AND oObj.getCount() = nCount + 1 + oObj.removeRangeAddress(newAddress) + bOK = bOK AND oObj.getCount() = nCount + Test.MethodTested("addRangeAddress()", bOK) + Test.MethodTested("removeRangeAddress()", bOK) + + + Test.StartMethod("addRangeAddresses()") + Test.StartMethod("removeRangeAddresses()") + bOK = true + newAddress1.Sheet = 0 + newAddress1.StartColumn = 20 : newAddress1.EndColumn = 30 + newAddress1.StartRow = 20 : newAddress1.EndRow = 20 + newAddresses(0) = newAddress + newAddresses(1) = newAddress1 + oObj.addRangeAddresses(newAddresses(), false) + bOK = bOK AND oObj.getCount() = nCount + 2 + oObj.removeRangeAddresses(newAddresses()) + bOK = bOK AND oObj.getCount() = nCount + Test.MethodTested("removeRangeAddresses()", bOK) + Test.MethodTested("addRangeAddresses()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sheet/XSheetCellRanges/script.xlb b/qadevOOo/tests/basic/ifc/sheet/XSheetCellRanges/script.xlb new file mode 100644 index 000000000000..46814879c917 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XSheetCellRanges/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="sheet_XSheetCellRanges" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sheet_XSheetCellRanges"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sheet/XSheetCellRanges/sheet_XSheetCellRanges.xba b/qadevOOo/tests/basic/ifc/sheet/XSheetCellRanges/sheet_XSheetCellRanges.xba new file mode 100644 index 000000000000..2f1b076933ed --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XSheetCellRanges/sheet_XSheetCellRanges.xba @@ -0,0 +1,81 @@ +<?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="sheet_XSheetCellRanges" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.sheet.XSheetCellRanges +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim oCells, oRanges As Variant + Dim cRanges As String + + Test.StartMethod("getCells()") + bOK = true + oCells = oObj.getCells() + bOK = bOK AND hasUnoInterfaces(oCells, "com.sun.star.container.XEnumerationAccess") + Test.MethodTested("getCells()", bOK) + + Test.StartMethod("getRangeAddressesAsString()") + bOK = true + cRanges = oObj.getRangeAddressesAsString() + Out.Log("Returned ranges are : '" & cRanges & "'") + bOK = bOK AND inStr(1, cRanges, "Sheet") + Test.MethodTested("getRangeAddressesAsString()", bOK) + + Test.StartMethod("getRangeAddresses()") + bOK = true + oRanges = oObj.getRangeAddresses() + bOK = bOK AND (oRanges(ubound(oRanges)).StartColumn <> 0 OR _ + oRanges(ubound(oRanges)).StartRow <> 0 OR _ + oRanges(ubound(oRanges)).EndRow <> 0 OR _ + oRanges(ubound(oRanges)).EndColumn <> 0 OR _ + oRanges(ubound(oRanges)).Sheet <> 0) + Test.MethodTested("getRangeAddresses()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sheet/XSheetCondition/script.xlb b/qadevOOo/tests/basic/ifc/sheet/XSheetCondition/script.xlb new file mode 100644 index 000000000000..9d983d5cf384 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XSheetCondition/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="sheet_XSheetCondition" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sheet_XSheetCondition"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sheet/XSheetCondition/sheet_XSheetCondition.xba b/qadevOOo/tests/basic/ifc/sheet/XSheetCondition/sheet_XSheetCondition.xba new file mode 100644 index 000000000000..9215c1e80c1e --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XSheetCondition/sheet_XSheetCondition.xba @@ -0,0 +1,103 @@ +<?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="sheet_XSheetCondition" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.sheet.XSheetCondition +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim oldOperator As Variant + Dim oldFormula As String + Dim oPos As com.sun.star.table.CellAddress + Dim newPos As New com.sun.star.table.CellAddress + + Test.StartMethod("setOperator()") + Test.StartMethod("getOperator()") + bOK = true + oldOperator = oObj.getOperator() + oObj.setOperator(com.sun.star.sheet.ConditionOperator.LESS) + bOK = bOK AND oObj.getOperator() <> oldOperator + oObj.setOperator(oldOperator) + Test.MethodTested("getOperator()", bOK) + Test.MethodTested("setOperator()", bOK) + + Test.StartMethod("getFormula1()") + Test.StartMethod("setFormula1()") + bOK = true + oldFormula = oObj.getFormula1() + oObj.setFormula1("1") + bOK = bOK AND oObj.getFormula1() = "1" + oObj.setFormula1(oldFormula) + Test.MethodTested("getFormula1()", bOK) + Test.MethodTested("setFormula1()", bOK) + + Test.StartMethod("getFormula2()") + Test.StartMethod("setFormula2()") + bOK = true + oldFormula = oObj.getFormula2() + oObj.setFormula2("2") + bOK = bOK AND oObj.getFormula2() = "2" + oObj.setFormula2(oldFormula) + Test.MethodTested("getFormula2()", bOK) + Test.MethodTested("setFormula2()", bOK) + + Test.StartMethod("getSourcePosition()") + Test.StartMethod("setSourcePosition()") + bOK = true + oPos = oObj.getSourcePosition() + bOK = bOK AND oPos.Column >= 0 + newPos.Sheet = oPos.Sheet + newPos.Column = oPos.Column + 1 + newPos.Row = oPos.Row + 1 + oObj.setSourcePosition(newPos) + bOK = bOK AND oObj.getSourcePosition().Column = oPos.Column + 1 + Test.MethodTested("getSourcePosition()", bOK) + Test.MethodTested("setSourcePosition()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sheet/XSheetConditionalEntries/script.xlb b/qadevOOo/tests/basic/ifc/sheet/XSheetConditionalEntries/script.xlb new file mode 100644 index 000000000000..098e6c0ffc95 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XSheetConditionalEntries/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="sheet_XSheetConditionalEntries" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sheet_XSheetConditionalEntries"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sheet/XSheetConditionalEntries/sheet_XSheetConditionalEntries.xba b/qadevOOo/tests/basic/ifc/sheet/XSheetConditionalEntries/sheet_XSheetConditionalEntries.xba new file mode 100644 index 000000000000..88be1a8e4d6f --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XSheetConditionalEntries/sheet_XSheetConditionalEntries.xba @@ -0,0 +1,78 @@ +<?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="sheet_XSheetConditionalEntries" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.sheet.XSheetConditionalEntries +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim nNum As Integer + Dim aConditionalEntry(0) As New com.sun.star.beans.PropertyValue + + Test.StartMethod("addNew()") + bOK = true + nNum = oObj.Count + oObj.addNew(aConditionalEntry()) + bOK = bOK AND nNum = oObj.Count - 1 + Test.MethodTested("addNew()", bOK) + + Test.StartMethod("removeByIndex()") + bOK = true + oObj.removeByIndex(0) + bOK = bOK AND nNum = oObj.Count + Test.MethodTested("removeByIndex()", bOK) + + Test.StartMethod("clear()") + bOK = true + oObj.clear() + bOK = bOK AND oObj.Count = 0 + Test.MethodTested("clear()", bOK) + + ReCreateObj() +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sheet/XSheetConditionalEntry/script.xlb b/qadevOOo/tests/basic/ifc/sheet/XSheetConditionalEntry/script.xlb new file mode 100644 index 000000000000..b4e0c725f364 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XSheetConditionalEntry/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="sheet_XSheetConditionalEntry" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sheet_XSheetConditionalEntry"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sheet/XSheetConditionalEntry/sheet_XSheetConditionalEntry.xba b/qadevOOo/tests/basic/ifc/sheet/XSheetConditionalEntry/sheet_XSheetConditionalEntry.xba new file mode 100644 index 000000000000..334657127ec1 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XSheetConditionalEntry/sheet_XSheetConditionalEntry.xba @@ -0,0 +1,70 @@ +<?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="sheet_XSheetConditionalEntry" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.sheet.XSheetConditionalEntry +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim cName, cName1 As String + + Test.StartMethod("getStyleName()") + Test.StartMethod("setStyleName()") + bOK = true + cName = oObj.getStyleName() + Out.Log("Style name is '" & cName & "'") + oObj.setStyleName(cIfcShortName) + cName1 = oObj.getStyleName() + Out.Log("Style name is '" & cName1 & "'") + bOK = bOK AND cName1 <> cName + oObj.setStyleName(cName) + Test.MethodTested("getStyleName()", bOK) + Test.MethodTested("setStyleName()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sheet/XSheetFilterDescriptor/script.xlb b/qadevOOo/tests/basic/ifc/sheet/XSheetFilterDescriptor/script.xlb new file mode 100644 index 000000000000..c3f3a5da4331 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XSheetFilterDescriptor/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="sheet_XSheetFilterDescriptor" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sheet_XSheetFilterDescriptor"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sheet/XSheetFilterDescriptor/sheet_XSheetFilterDescriptor.xba b/qadevOOo/tests/basic/ifc/sheet/XSheetFilterDescriptor/sheet_XSheetFilterDescriptor.xba new file mode 100644 index 000000000000..6b2824138913 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XSheetFilterDescriptor/sheet_XSheetFilterDescriptor.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="sheet_XSheetFilterDescriptor" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.sheet.XSheetFilterDescriptor +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim oldVal, objVal As Object + Dim newVal(0) As New com.sun.star.sheet.TableFilterField + + + Test.StartMethod("getFilterFields()") + bOK = true + bOK = bOK AND NOT isNULL(oObj.getFilterFields()) + Test.MethodTested("getFilterFields()", bOK) + + Test.StartMethod("setFilterFields()") + bOK = true + oldVal = oObj.getFilterFields() + newVal(0).Field = 0 + newVal(0).isNumeric = true + newVal(0).Operator = com.sun.star.sheet.FilterOperator.GREATER_EQUAL + newVal(0).NumericValue = 99 + newVal(0).Connection = com.sun.star.sheet.FilterConnection.AND + oObj.setFilterFields(newVal()) + objVal = oObj.getFilterFields() + bOK = bOK AND (ubound(objVal) = 0) AND (objVal(0).NumericValue = 99) + Test.MethodTested("setFilterFields()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sheet/XSheetOperation/script.xlb b/qadevOOo/tests/basic/ifc/sheet/XSheetOperation/script.xlb new file mode 100644 index 000000000000..aa560324cc77 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XSheetOperation/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="sheet_XSheetOperation" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sheet_XSheetOperation"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sheet/XSheetOperation/sheet_XSheetOperation.xba b/qadevOOo/tests/basic/ifc/sheet/XSheetOperation/sheet_XSheetOperation.xba new file mode 100644 index 000000000000..65df94719702 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XSheetOperation/sheet_XSheetOperation.xba @@ -0,0 +1,70 @@ +<?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="sheet_XSheetOperation" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.sheet.XSheetOperation +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim nCompute As Long + + Test.StartMethod("computeFunction()") + bOK = true + nCompute = oObj.computeFunction(com.sun.star.sheet.GeneralFunction.COUNT) + bOK = bOK AND (nCompute >= 0) + Test.MethodTested("computeFunction()", bOK) + + Test.StartMethod("clearContents()") + bOK = true + oObj.clearContents(com.sun.star.sheet.CellFlags.VALUE) + nCompute= oObj.computeFunction(com.sun.star.sheet.GeneralFunction.COUNT) + bOK = bOK AND (nCompute = 0) + Test.MethodTested("clearContents()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sheet/XSheetPageBreak/script.xlb b/qadevOOo/tests/basic/ifc/sheet/XSheetPageBreak/script.xlb new file mode 100644 index 000000000000..4894c78c3242 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XSheetPageBreak/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="sheet_XSheetPageBreak" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sheet_XSheetPageBreak"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sheet/XSheetPageBreak/sheet_XSheetPageBreak.xba b/qadevOOo/tests/basic/ifc/sheet/XSheetPageBreak/sheet_XSheetPageBreak.xba new file mode 100644 index 000000000000..493557926c14 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XSheetPageBreak/sheet_XSheetPageBreak.xba @@ -0,0 +1,103 @@ +<?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="sheet_XSheetPageBreak" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.sheet.XSheetPageBreak +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim nColsBreaks As Integer + Dim nRowsBreaks As Integer + Dim oColumn As Object + Dim oRow As Object + Dim oPBs As Variant + Dim iRowsBefore As Integer + Dim iColsBefore As Integer + + iColsBefore = ubound(oObj.getColumnPageBreaks()) - 1 + iRowsBefore = ubound(oObj.getRowPageBreaks()) - 1 + + Out.Log("Before test: colBreaks: " & iColsBefore & _ + " rowBreaks: " & iRowsBefore) + + Out.Log("Inserting new PageBreaks.") + oColumn = oObj.Columns.getByIndex(5) + oColumn.SetPropertyValue("IsStartOfNewPage", true) + oRow = oObj.Rows.getByIndex(15) + oRow.SetPropertyValue("IsStartOfNewPage", true) + + Test.StartMethod("getColumnPageBreaks()") + bOK = true + oPBs = oObj.getColumnPageBreaks() + nColsBreaks = uBound(oPBs) + Out.Log("There are " & nColsBreaks & " column breaks.") + bOK = bOK AND nColsBreaks > 0 + bOK = bOK AND oPBs(0).Position >= 0 + Test.MethodTested("getColumnPageBreaks()", bOK) + + Test.StartMethod("getRowPageBreaks()") + bOK = true + oPBs = oObj.getRowPageBreaks() + nRowsBreaks = uBound(oPBs) + Out.Log("There are " & nRowsBreaks & " row breaks.") + bOK = bOK AND nRowsBreaks > 0 + bOK = bOK AND oPBs(0).Position >= 0 + Test.MethodTested("getRowPageBreaks()", bOK) + + Test.StartMethod("removeAllManualPageBreaks()") + bOK = true + oObj.removeAllManualPageBreaks() + Out.Log("After test: colBreaks: " & ubound(oObj.getColumnPageBreaks()) - 1 & _ + " rowBreaks: " & ubound(oObj.getRowPageBreaks()) - 1) + + bOK = bOK AND ubound(oObj.getRowPageBreaks()) - 1 = iRowsBefore + bOK = bOK AND ubound(oObj.getColumnPageBreaks()) - 1= iColsBefore + Test.MethodTested("removeAllManualPageBreaks()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sheet/XSpreadsheet/script.xlb b/qadevOOo/tests/basic/ifc/sheet/XSpreadsheet/script.xlb new file mode 100644 index 000000000000..629d421c08c1 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XSpreadsheet/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="sheet_XSpreadsheet" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sheet_XSpreadsheet"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sheet/XSpreadsheet/sheet_XSpreadsheet.xba b/qadevOOo/tests/basic/ifc/sheet/XSpreadsheet/sheet_XSpreadsheet.xba new file mode 100644 index 000000000000..2ada541ca50e --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XSpreadsheet/sheet_XSpreadsheet.xba @@ -0,0 +1,66 @@ +<?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="sheet_XSpreadsheet" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.sheet.XSpreadsheet +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + Test.StartMethod("createCursor()") + bOK = true + oCur = oObj.createCursor() + bOK = bOK AND hasUnoInterfaces(oCur, "com.sun.star.sheet.XSheetCellCursor") + Test.MethodTested("createCursor()", bOK) + + Test.StartMethod("createCursorByRange()") + bOK = true + oCur = oObj.createCursorByRange(oObj) + bOK = bOK AND hasUnoInterfaces(oCur, "com.sun.star.sheet.XSheetCellCursor") + Test.MethodTested("createCursorByRange()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sheet/XSpreadsheetDocument/script.xlb b/qadevOOo/tests/basic/ifc/sheet/XSpreadsheetDocument/script.xlb new file mode 100644 index 000000000000..7a9f4d13b24e --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XSpreadsheetDocument/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="sheet_XSpreadsheetDocument" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sheet_XSpreadsheetDocument"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sheet/XSpreadsheetDocument/sheet_XSpreadsheetDocument.xba b/qadevOOo/tests/basic/ifc/sheet/XSpreadsheetDocument/sheet_XSpreadsheetDocument.xba new file mode 100644 index 000000000000..1624ad932211 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XSpreadsheetDocument/sheet_XSpreadsheetDocument.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="sheet_XSpreadsheetDocument" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.sheet.XSpreadsheetDocument +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim oSheets As Object + + Test.StartMethod("getSheets()") + bOK = true + oSheets = oObj.getSheets + bOK = bOK AND ((NOT isNULL(oSheets)) AND (oSheets.count > 0)) + Test.MethodTested("getSheets()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sheet/XSpreadsheetView/script.xlb b/qadevOOo/tests/basic/ifc/sheet/XSpreadsheetView/script.xlb new file mode 100644 index 000000000000..57b477800e29 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XSpreadsheetView/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="sheet_XSpreadsheetView" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sheet_XSpreadsheetView"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sheet/XSpreadsheetView/sheet_XSpreadsheetView.xba b/qadevOOo/tests/basic/ifc/sheet/XSpreadsheetView/sheet_XSpreadsheetView.xba new file mode 100644 index 000000000000..55dac404bf79 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XSpreadsheetView/sheet_XSpreadsheetView.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="sheet_XSpreadsheetView" 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 + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' - Global oActivableSheet As Object + +'************************************************************************* + + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.sheet.XSpreadsheetView +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim oActiveSheet, oNewSheet, oNewActiveSheet As Object + Dim cString As String + + Test.StartMethod("getActiveSheet()") + bOK = true + oActiveSheet = oObj.getActiveSheet() + bOK = bOK AND NOT isNULL(oActiveSheet) + Test.MethodTested("getActiveSheet()", bOK) + + Test.StartMethod("setActiveSheet()") + bOK = true + oNewSheet = oDoc.createInstance("com.sun.star.sheet.Spreadsheet") + oDoc.Sheets.insertByName("ActiveSheet", oNewSheet) + + oActiveSheet = oObj.getActiveSheet() + + cString = oActiveSheet.getCellByPosition(1, 1).String & " on New Sheet" + oNewSheet.getCellByPosition(1, 1).String = cString + oObj.setActiveSheet(oNewSheet) + + oNewActiveSheet = oObj.getActiveSheet() + + bOK = bOK AND oNewActiveSheet.Name = "ActiveSheet" + bOK = bOK AND oNewActiveSheet.getCellByPosition(1, 1).String = cString + + oDoc.Sheets.removeByName("ActiveSheet") + + Test.MethodTested("setActiveSheet()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sheet/XSpreadsheets/script.xlb b/qadevOOo/tests/basic/ifc/sheet/XSpreadsheets/script.xlb new file mode 100644 index 000000000000..c51159812739 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XSpreadsheets/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="sheet_XSpreadsheets" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sheet_XSpreadsheets"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sheet/XSpreadsheets/sheet_XSpreadsheets.xba b/qadevOOo/tests/basic/ifc/sheet/XSpreadsheets/sheet_XSpreadsheets.xba new file mode 100644 index 000000000000..2391c87df0c1 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XSpreadsheets/sheet_XSpreadsheets.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="sheet_XSpreadsheets" 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 + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' - Global nGlobalLong As Long the number of sheets + +'************************************************************************* + + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.sheet.XSpreadsheets +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim l As Integer + Dim sname As String + Dim oSheet1, oSheet2 As Object + + + Test.StartMethod("insertNewByName()") + bOK = true + for l = 1 to nGlobalLong + sname = cIfcShortName & CStr(l) + oObj.insertNewByName(sname, l) + oSheet1 = oObj.getByName(sname) + oSheet2 = oObj.getByIndex(l) + bOK = bOK AND NOT isNull(oSheet1) + bOK = bOK AND NOT isNull(oSheet2) + if (bOK) then + bOK = bOK and oSheet1.name = oSheet2.name + end if + next l + Test.MethodTested("insertNewByName()", bOK) + + Test.StartMethod("copyByName()") + bOK = true + l = 1 + sname = cIfcShortName & "COPY" + oObj.copyByName(cIfcShortName & CStr(l), sname, l ) + oSheet1 = oObj.getByName(sname) + oSheet2 = oObj.getByIndex(l) + bOK = bOK AND NOT isNull(oSheet1) + bOK = bOK AND NOT isNull(oSheet2) + if (bOK) then + bOK = bOK AND oSheet1.name = oSheet2.name + end if + Test.MethodTested("copyByName()", bOK) + + Test.StartMethod("moveByName()") + bOK = true + l = 1 + sname = cIfcShortName & "2" + oObj.moveByName(sname, l) + oSheet1 = oObj.getByName(sname) + oSheet2 = oObj.getByIndex(l) + bOK = bOK AND NOT isNull(oSheet1) + bOK = bOK AND NOT isNull(oSheet2) + if (bOK) then + bOK = bOK AND oSheet1.name = oSheet2.name + end if + Out.Log(cIfcShortName & ":" & "#1 - " & bOK) + + sname = cIfcShortName & "COPY" + l = nGlobalLong + 1 + oObj.moveByName(sname, l) + l = l - 1 + oSheet1 = oObj.getByName(sname) + oSheet2 = oObj.getByIndex(l) + bOK = bOK AND NOT isNull(oSheet1) + bOK = bOK AND NOT isNull(oSheet2) + if (bOK) then + bOK = bOK and oSheet1.name =oSheet2.name + end if + Test.MethodTested("moveByName()", bOK) + + nGlobalLong = nGlobalLong * 2 + 1 ' nGlobalLong : 3 default sheets where already there + ' nGlobalLong have been inserted + ' + 1 has been created by Copy +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sheet/XSubTotalDescriptor/script.xlb b/qadevOOo/tests/basic/ifc/sheet/XSubTotalDescriptor/script.xlb new file mode 100644 index 000000000000..537bf6eddab9 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XSubTotalDescriptor/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="sheet_XSubTotalDescriptor" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sheet_XSubTotalDescriptor"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sheet/XSubTotalDescriptor/sheet_XSubTotalDescriptor.xba b/qadevOOo/tests/basic/ifc/sheet/XSubTotalDescriptor/sheet_XSubTotalDescriptor.xba new file mode 100644 index 000000000000..907b6299de86 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XSubTotalDescriptor/sheet_XSubTotalDescriptor.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="sheet_XSubTotalDescriptor" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.sheet.XSubTotalDescriptor +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim count As Integer + + Test.StartMethod("addNew()") + bOK = true + count = oObj.Count + + Out.Log("Before addNew() there are " & count & " elements") + + Dim SubTotalCol(0) As New com.sun.star.sheet.SubTotalColumn + SubTotalCol(0).Column = 7 + SubTotalCol(0).Function = com.sun.star.sheet.GeneralFunction.SUM + + oObj.addNew(SubTotalCol(), 1) + + bOK = bOK AND oObj.count = count + 1 + Out.Log("After addNew() there are " & oObj.Count & " elements") + Test.MethodTested("addNew()", bOK) + + Test.StartMethod("clear()") + bOK = true + oObj.clear() + bOK = bOK AND oObj.Count = 0 + Test.MethodTested("clear()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sheet/XSubTotalField/script.xlb b/qadevOOo/tests/basic/ifc/sheet/XSubTotalField/script.xlb new file mode 100644 index 000000000000..b938a580a566 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XSubTotalField/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="sheet_XSubTotalField" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sheet_XSubTotalField"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sheet/XSubTotalField/sheet_XSubTotalField.xba b/qadevOOo/tests/basic/ifc/sheet/XSubTotalField/sheet_XSubTotalField.xba new file mode 100644 index 000000000000..9e5c0324dfee --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XSubTotalField/sheet_XSubTotalField.xba @@ -0,0 +1,87 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="sheet_XSubTotalField" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.sheet.XSubTotalField +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim oldCol, newCol As Integer + Dim SubTotalCol(1) As New com.sun.star.sheet.SubTotalColumn + + Test.StartMethod("getGroupColumn()") + bOK = true + bOK = bOK AND NOT isNULL(oObj.getGroupColumn()) + Test.MethodTested("getGroupColumn()", bOK) + + Test.StartMethod("setGroupColumn()") + bOK = true + oldCol = oObj.getGroupColumn() + newCol = oldCol + 1 + oObj.setGroupColumn(newCol) + bOK = bOK AND (oldCol <> oObj.getGroupColumn()) + oObj.setGroupColumn(oldCol) + Test.MethodTested("setGroupColumn()", bOK) + + Test.StartMethod("getSubTotalColumns()") + bOK = true + bOK = bOK AND NOT isNULL(oObj.getSubTotalColumns()) + Test.MethodTested("getSubTotalColumns()", bOK) + + Test.StartMethod("setSubTotalColumns()") + bOK = true + SubTotalCol(0).Column = 1 + SubTotalCol(0).Function = com.sun.star.sheet.GeneralFunction.AVERAGE + SubTotalCol(1).Column = 2 + SubTotalCol(1).Function = com.sun.star.sheet.GeneralFunction.SUM + oObj.setSubTotalColumns(SubTotalCol()) + bOK = bOK AND ubound(oObj.getSubTotalColumns()) = 1 + Test.MethodTested("setSubTotalColumns()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sheet/XUsedAreaCursor/script.xlb b/qadevOOo/tests/basic/ifc/sheet/XUsedAreaCursor/script.xlb new file mode 100644 index 000000000000..b2e8ad029c89 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XUsedAreaCursor/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="sheet_XUsedAreaCursor" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sheet_XUsedAreaCursor"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sheet/XUsedAreaCursor/sheet_XUsedAreaCursor.xba b/qadevOOo/tests/basic/ifc/sheet/XUsedAreaCursor/sheet_XUsedAreaCursor.xba new file mode 100644 index 000000000000..4ac4e48941f6 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XUsedAreaCursor/sheet_XUsedAreaCursor.xba @@ -0,0 +1,86 @@ +<?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="sheet_XUsedAreaCursor" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.sheet.XUsedAreaCursor +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim nStartSCol, nStartECol As Integer + Dim nStartSRow, nStartERow As Long + Dim nEndSCol, nEndECol As Integer + Dim nEndSRow, nEndERow As Long + Dim oAddress As Object + + Test.StartMethod("gotoStartOfUsedArea()") + bOK = true + oObj.gotoStartOfUsedArea(true) + oAddress = oObj.getRangeAddress() + nStartSCol = oAddress.StartColumn + nStartECol = oAddress.EndColumn + nStartSRow = oAddress.StartRow + nStartERow = oAddress.EndRow + + Test.StartMethod("gotoEndOfUsedArea()") + bOK = true + oObj.gotoEndOfUsedArea(true) + oAddress = oObj.getRangeAddress() + nEndSCol = oAddress.StartColumn + nEndECol = oAddress.EndColumn + nEndSRow = oAddress.StartRow + nEndERow = oAddress.EndRow + + 'get the results + bOK = bOK AND ((nStartSCol <> nEndSCol) OR (nStartECol <> nEndECol) OR _ + (nStartSRow <> nEndSRow) OR (nStartERow <> nEndERow)) + + Test.MethodTested("gotoStartOfUsedArea()", bOK) + Test.MethodTested("gotoEndOfUsedArea()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sheet/XViewFreezable/script.xlb b/qadevOOo/tests/basic/ifc/sheet/XViewFreezable/script.xlb new file mode 100644 index 000000000000..251284d32141 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XViewFreezable/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="sheet_XViewFreezable" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sheet_XViewFreezable"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sheet/XViewFreezable/sheet_XViewFreezable.xba b/qadevOOo/tests/basic/ifc/sheet/XViewFreezable/sheet_XViewFreezable.xba new file mode 100644 index 000000000000..f1b48399ed44 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XViewFreezable/sheet_XViewFreezable.xba @@ -0,0 +1,75 @@ +<?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="sheet_XViewFreezable" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.sheet.XViewFreezable +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Test.StartMethod("freezeAtPosition()") + bOK = true + ' Only one of XViewSplitable::getIsWindowSplit() and + ' XViewFreezable::hasFrozenPanes() can be true + + oObj.SplitAtPosition(100, 100) + bOK = bOK AND oObj.getIsWindowSplit() + oObj.freezeAtPosition(0, 10) + bOK = bOK AND NOT oObj.getIsWindowSplit() + Test.MethodTested("freezeAtPosition()", bOK) + + Test.StartMethod("hasFrozenPanes()") + bOK = true + oObj.freezeAtPosition(3, 0) + bOK = bOK AND oObj.hasFrozenPanes() + oObj.SplitAtPosition(100, 100) + bOK = bOK AND NOT oObj.hasFrozenPanes() + Test.MethodTested("hasFrozenPanes()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sheet/XViewPane/script.xlb b/qadevOOo/tests/basic/ifc/sheet/XViewPane/script.xlb new file mode 100644 index 000000000000..59b8e6c28258 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XViewPane/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="sheet_XViewPane" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sheet_XViewPane"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sheet/XViewPane/sheet_XViewPane.xba b/qadevOOo/tests/basic/ifc/sheet/XViewPane/sheet_XViewPane.xba new file mode 100644 index 000000000000..86be1f937a3c --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XViewPane/sheet_XViewPane.xba @@ -0,0 +1,87 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="sheet_XViewPane" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.sheet.XViewPane +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim nCol, nRow As Integer + Dim oRange As Object + + Test.StartMethod("getFirstVisibleColumn()") + Test.StartMethod("setFirstVisibleColumn()") + bOK = true + nCol = oObj.getFirstVisibleColumn() + oObj.setFirstVisibleColumn(nCol + 4) + bOK = bOK AND nCol = oObj.getFirstVisibleColumn() - 4 + Test.MethodTested("getFirstVisibleColumn()", bOK) + Test.MethodTested("setFirstVisibleColumn()", bOK) + + Test.StartMethod("getFirstVisibleRow()") + Test.StartMethod("setFirstVisibleRow()") + bOK = true + nRow = oObj.getFirstVisibleRow() + oObj.setFirstVisibleRow(nRow + 4) + bOK = bOK AND nRow = oObj.getFirstVisibleRow() - 4 + Test.MethodTested("getFirstVisibleRow()", bOK) + Test.MethodTested("setFirstVisibleRow()", bOK) + + Test.StartMethod("getVisibleRange()") + bOK = true + oRange = oObj.getVisibleRange() + bOK = bOK AND NOT isNULL(oRange) + bOK = bOK AND oRange.StartColumn = nCol + 4 + bOK = bOK AND oRange.StartRow = nRow + 4 + Test.MethodTested("getVisibleRange()", bOK) + + ' We have to re-create object, as it's was referred range was changed here. + DisposeObj() + CreateObj() +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/sheet/XViewSplitable/script.xlb b/qadevOOo/tests/basic/ifc/sheet/XViewSplitable/script.xlb new file mode 100644 index 000000000000..62ab086ba658 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XViewSplitable/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="sheet_XViewSplitable" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="sheet_XViewSplitable"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/sheet/XViewSplitable/sheet_XViewSplitable.xba b/qadevOOo/tests/basic/ifc/sheet/XViewSplitable/sheet_XViewSplitable.xba new file mode 100644 index 000000000000..b9d25b417916 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/sheet/XViewSplitable/sheet_XViewSplitable.xba @@ -0,0 +1,133 @@ +<?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="sheet_XViewSplitable" 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 + +Dim XSplitPos As Long +Dim YSplitPos As Long + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.sheet.XViewSplitable +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Test.StartMethod("splitAtPosition()") + bOK = true + ' Only one of XViewSplitable::getIsWindowSplit() and + ' XViewFreezable::hasFrozenPanes() can be true + + oObj.freezeAtPosition(10, 10) + bOK = bOK AND oObj.hasFrozenPanes() + SplitAt(100, 200) + bOK = bOK AND NOT oObj.hasFrozenPanes() + Test.MethodTested("splitAtPosition()", bOK) + + Test.StartMethod("getIsWindowSplit()") + bOK = true + SplitAt(0, 0) + bOK = bOK AND NOT oObj.getIsWindowSplit() + SplitAt(50, 50) + bOK = bOK AND oObj.getIsWindowSplit() + + Test.MethodTested("getIsWindowSplit()", bOK) + + Test.StartMethod("getSplitHorizontal()") + bOK = true + SplitAt(0, 0) + bOK = bOK AND oObj.getSplitHorizontal() = XSplitPos + SplitAt(0, 100) + bOK = bOK AND oObj.getSplitHorizontal() = XSplitPos + SplitAt(100, 0) + bOK = bOK AND oObj.getSplitHorizontal() = XSplitPos + SplitAt(100, 100) + bOK = bOK AND oObj.getSplitHorizontal() = XSplitPos + Test.MethodTested("getSplitHorizontal()", bOK) + + Test.StartMethod("getSplitVertical()") + bOK = true + SplitAt(0, 0) + bOK = bOK AND oObj.getSplitVertical() = YSplitPos + SplitAt(100, 0) + bOK = bOK AND oObj.getSplitVertical() = YSplitPos + SplitAt(100, 100) + bOK = bOK AND oObj.getSplitVertical() = YSplitPos + SplitAt(0, 100) + bOK = bOK AND oObj.getSplitVertical() = YSplitPos + Test.MethodTested("getSplitVertical()", bOK) + + Test.StartMethod("getSplitColumn()") + bOK = true + SplitAt(0, 0) + bOK = bOK AND oObj.getSplitColumn() = 0 + SplitAt(0, 100) + bOK = bOK AND oObj.getSplitColumn() = 0 + SplitAt(100, 100) + bOK = bOK AND oObj.getSplitColumn() <> 0 + SplitAt(100, 0) + bOK = bOK AND oObj.getSplitColumn() <> 0 + Test.MethodTested("getSplitColumn()", bOK) + + Test.StartMethod("getSplitRow()") + bOK = true + SplitAt(0, 0) + bOK = bOK AND oObj.getSplitRow() = 0 + SplitAt(100, 0) + bOK = bOK AND oObj.getSplitRow() = 0 + SplitAt(100, 100) + bOK = bOK AND oObj.getSplitRow() <> 0 + SplitAt(0, 100) + bOK = bOK AND oObj.getSplitRow() <> 0 + Test.MethodTested("getSplitRow()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub + +Sub SplitAt(x As Long, y As Long) + Out.Log("Spliting At position (" & x & ", " & y & ")") + oObj.SplitAtPosition(x, y) + XSplitPos = x + YSplitPos = y +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/style/CharacterProperties/script.xlb b/qadevOOo/tests/basic/ifc/style/CharacterProperties/script.xlb new file mode 100644 index 000000000000..8fba4931cf47 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/style/CharacterProperties/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="style_CharacterProperties" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="style_CharacterProperties"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/style/CharacterProperties/style_CharacterProperties.xba b/qadevOOo/tests/basic/ifc/style/CharacterProperties/style_CharacterProperties.xba new file mode 100644 index 000000000000..48805b3691ed --- /dev/null +++ b/qadevOOo/tests/basic/ifc/style/CharacterProperties/style_CharacterProperties.xba @@ -0,0 +1,292 @@ +<?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="style_CharacterProperties" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.style.CharacterProperties +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim oStyleFamilies, oCharStyles As Variant + + PropertyTester.TestProperty("CharFontName") + + PropertyTester.TestProperty("CharFontStyleName") + + Dim aFamilys(6) As Integer + with com.sun.star.awt.FontFamily + aFamilys(0) = .DONTKNOW + aFamilys(1) = .DECORATIVE + aFamilys(2) = .MODERN + aFamilys(3) = .ROMAN + aFamilys(4) = .SCRIPT + aFamilys(5) = .SWISS + aFamilys(6) = .SYSTEM + end with + PropertyTester.TestProperty("CharFontFamily",aFamilys()) + + Dim aCharSetArray(10) As Integer + with com.sun.star.awt.CharSet + aCharSetArray(0) = .DONTKNOW + aCharSetArray(1) = .ANSI + aCharSetArray(2) = .MAC + aCharSetArray(3) = .IBMPC_437 + aCharSetArray(4) = .IBMPC_850 + aCharSetArray(5) = .IBMPC_860 + aCharSetArray(6) = .IBMPC_861 + aCharSetArray(7) = .IBMPC_863 + aCharSetArray(8) = .IBMPC_865 + aCharSetArray(9) = .SYSTEM + aCharSetArray(10) = .SYMBOL + end with + + PropertyTester.TestProperty("CharFontCharSet",aCharSetArray()) + + Dim aFontPitchArray(3) As Integer + with com.sun.star.awt.FontPitch + aFontPitchArray(0) = .DONTKNOW + aFontPitchArray(1) = .FIXED + aFontPitchArray(2) = .VARIABLE + end with + PropertyTester.TestProperty("CharFontPitch",aFontPitchArray()) + + PropertyTester.TestProperty("CharColor") + + Dim vCharEsc (0 to 4) As Integer + vCharEsc(0) = -100 + vCharEsc(1) = 100 + vCharEsc(2) = -63 + vCharEsc(3) = 76 + vCharEsc(4) = 0 + PropertyTester.TestProperty("CharEscapement",vCharEsc()) + + Dim aHeightArray(3) As Double + aHeightArray(0) = 10 + aHeightArray(1) = 20.1 + aHeightArray(2) = 25.2 + aHeightArray(3) = 30.3 + PropertyTester.TestProperty("CharHeight",aHeightArray()) + + Dim aUnderlineArray(18) As Integer + with com.sun.star.awt.FontUnderline + aUnderlineArray(0) = .NONE + aUnderlineArray(1) = .SINGLE + aUnderlineArray(2) = .DOUBLE + aUnderlineArray(3) = .DOTTED + aUnderlineArray(4) = .DONTKNOW + aUnderlineArray(5) = .DASH + aUnderlineArray(6) = .LONGDASH + aUnderlineArray(7) = .DASHDOT + aUnderlineArray(8) = .DASHDOTDOT + aUnderlineArray(9) = .SMALLWAVE + aUnderlineArray(10) = .WAVE + aUnderlineArray(11) = .DOUBLEWAVE + aUnderlineArray(12) = .BOLD + aUnderlineArray(13) = .BOLDDOTTED + aUnderlineArray(14) = .BOLDDASH + aUnderlineArray(15) = .BOLDLONGDASH + aUnderlineArray(16) = .BOLDDASHDOT + aUnderlineArray(17) = .BOLDDASHDOTDOT + aUnderlineArray(18) = .BOLDWAVE + end with + PropertyTester.TestProperty("CharUnderline",aUnderlineArray()) + + Dim aWeightArray(9) As Integer + with com.sun.star.awt.FontWeight + aWeightArray(0) = .DONTKNOW + aWeightArray(1) = .THIN + aWeightArray(2) = .ULTRALIGHT + aWeightArray(3) = .LIGHT + aWeightArray(4) = .SEMILIGHT + aWeightArray(5) = .NORMAL + aWeightArray(6) = .SEMIBOLD + aWeightArray(7) = .BOLD + aWeightArray(8) = .ULTRABOLD + aWeightArray(9) = .BLACK + end with + + PropertyTester.TestProperty("CharWeight",aWeightArray()) + + PropertyTester.TestProperty("CharPosture") + + PropertyTester.TestProperty("CharAutoKerning") + + PropertyTester.TestProperty("CharBackColor") + + PropertyTester.TestProperty("CharBackTransparent") + + Dim aCaseMaps(4) As Integer + with com.sun.star.style.CaseMap + aCaseMaps(0) = .NONE + aCaseMaps(1) = .UPPERCASE + aCaseMaps(2) = .LOWERCASE + aCaseMaps(3) = .TITLE + aCaseMaps(4) = .SMALLCAPS + end with + PropertyTester.TestProperty("CharCaseMap",aCaseMaps()) + + PropertyTester.TestProperty("CharCrossedOut") + + PropertyTester.TestProperty("CharFlash") + + Dim aStrikeoutArray(6) As Integer + with com.sun.star.awt.FontStrikeout + aStrikeoutArray(0) = .NONE + aStrikeoutArray(1) = .SINGLE + aStrikeoutArray(2) = .DOUBLE + aStrikeoutArray(3) = .DONTKNOW + aStrikeoutArray(4) = .BOLD + aStrikeoutArray(5) = .SLASH + aStrikeoutArray(6) = .X + end with + PropertyTester.TestProperty("CharStrikeout",aStrikeoutArray()) + + PropertyTester.TestProperty("CharWordMode") + + PropertyTester.TestProperty("CharKerning") + + PropertyTester.TestProperty("CharLocale") + + PropertyTester.TestProperty("CharKeepTogether") + + PropertyTester.TestProperty("CharNoLineBreak") + + PropertyTester.TestProperty("CharShadowed") + + PropertyTester.TestProperty("CharFontType") + + PropertyTester.TestProperty("CharContoured") + + PropertyTester.TestProperty("CharCombineIsOn") + + oObj.setPropertyValue("CharCombineIsOn", true) + Dim aPrifixes(1) As String + aPrifixes(0) = "(" + aPrifixes(1) = "[" + PropertyTester.TestProperty("CharCombinePrefix", aPrifixes()) + + Dim aSuffixes(1) As String + aSuffixes(0) = ")" + aSuffixes(1) = "]" + PropertyTester.TestProperty("CharCombineSuffix", aSuffixes()) + + Dim aCharEmphasizeArr(8) As Integer + with com.sun.star.text.FontEmphasis + aCharEmphasizeArr(0) = .NONE + aCharEmphasizeArr(1) = .DOT_ABOVE + aCharEmphasizeArr(2) = .CIRCLE_ABOVE + aCharEmphasizeArr(3) = .DISK_ABOVE + aCharEmphasizeArr(4) = .ACCENT_ABOVE + aCharEmphasizeArr(5) = .DOT_BELOW + aCharEmphasizeArr(6) = .CIRCLE_BELOW + aCharEmphasizeArr(7) = .DISK_BELOW + aCharEmphasizeArr(8) = .ACCENT_BELOW + end with + PropertyTester.TestProperty("CharEmphasize",aCharEmphasizeArr()) + + Dim aReliefs(2) As Integer + with com.sun.star.text.FontRelief + aReliefs(0) = .NONE + aReliefs(1) = .EMBOSSED + aReliefs(2) = .ENGRAVED + end with + PropertyTester.TestProperty("CharRelief",aReliefs()) + + PropertyTester.TestProperty("CharRotationIsFitToLine") + + PropertyTester.TestProperty("CharScaleWidth") + + Dim aRotat(2) As Integer + aRotat(0) = 900 + aRotat(1) = 2700 + aRotat(2) = 0 + PropertyTester.TestProperty("CharRotation",aRotat()) + + PropertyTester.TestProperty("RubyText") + + PropertyTester.TestProperty("RubyIsAbove") + + Dim aAdjusts(5) As Integer + aAdjusts(0) = com.sun.star.text.RubyAdjust.LEFT + aAdjusts(1) = com.sun.star.text.RubyAdjust.CENTER + aAdjusts(2) = com.sun.star.text.RubyAdjust.RIGHT + aAdjusts(3) = com.sun.star.text.RubyAdjust.LEFT + aAdjusts(4) = com.sun.star.text.RubyAdjust.BLOCK + aAdjusts(5) = com.sun.star.text.RubyAdjust.INDENT_BLOCK + PropertyTester.TestProperty("RubyAdjust", aAdjusts()) + + Dim aCharStyleNames() As String + oStyleFamilies = oDoc.StyleFamilies + oCharStyles = oStyleFamilies.getByIndex(0) + aCharStyleNames() = oCharStyles.Elementnames() + aCharStyleNames(0) = aCharStyleNames(2) ' "Standard" the same as "", exclude it... + + PropertyTester.TestProperty("RubyCharStyleName",aCharStyleNames()) + + PropertyTester.TestProperty("CharStyleName",aCharStyleNames()) + + PropertyTester.TestProperty("CharRotationIsFitToLine") + PropertyTester.TestProperty("CharScaleWidth") + PropertyTester.TestProperty("HyperLinkURL") + PropertyTester.TestProperty("HyperLinkTarget") + PropertyTester.TestProperty("HyperLinkName") + + Dim nHeight(0 to 2) as Integer + nHeight(0)=1 + nHeight(1)=33 + nHeight(2)=100 + PropertyTester.TestProperty("CharEscapementHeight", nHeight()) + + PropertyTester.TestProperty("CharNoHyphenation") + PropertyTester.TestProperty("CharUnderlineHasColor") + oObj.CharUnderlineHasColor = TRUE + PropertyTester.TestProperty("CharUnderlineColor") + + ReCreateObj() + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/style/CharacterPropertiesAsian/script.xlb b/qadevOOo/tests/basic/ifc/style/CharacterPropertiesAsian/script.xlb new file mode 100644 index 000000000000..55654ebf43b4 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/style/CharacterPropertiesAsian/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="style_CharacterPropertiesAsian" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="style_CharacterPropertiesAsian"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/style/CharacterPropertiesAsian/style_CharacterPropertiesAsian.xba b/qadevOOo/tests/basic/ifc/style/CharacterPropertiesAsian/style_CharacterPropertiesAsian.xba new file mode 100644 index 000000000000..956cfe025e24 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/style/CharacterPropertiesAsian/style_CharacterPropertiesAsian.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="style_CharacterPropertiesAsian" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.style.CharacterPropertiesAsian +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Dim charHeightAsian(3) As Double + charHeightAsian(0) = 12.3 + charHeightAsian(1) = 16.2 + charHeightAsian(2) = 26.6 + charHeightAsian(3) = 42.8 + + Dim charWeightAsian(9) As Integer + with com.sun.star.awt.FontWeight + charWeightAsian(0) = .DONTKNOW + charWeightAsian(1) = .THIN + charWeightAsian(2) = .ULTRALIGHT + charWeightAsian(3) = .LIGHT + charWeightAsian(4) = .SEMILIGHT + charWeightAsian(5) = .NORMAL + charWeightAsian(6) = .SEMIBOLD + charWeightAsian(7) = .BOLD + charWeightAsian(8) = .ULTRABOLD + charWeightAsian(9) = .BLACK + end with + + PropertyTester.TestProperty("CharHeightAsian",charHeightAsian()) + + PropertyTester.TestProperty("CharWeightAsian",charWeightAsian()) + + PropertyTester.TestProperty("CharFontNameAsian") + + PropertyTester.TestProperty("CharFontStyleNameAsian") + + PropertyTester.TestProperty("CharFontFamilyAsian") + + PropertyTester.TestProperty("CharFontCharSetAsian") + + PropertyTester.TestProperty("CharFontPitchAsian") + + PropertyTester.TestProperty("CharPostureAsian") + + PropertyTester.TestProperty("CharLocaleAsian") + + PropertyTester.TestProperty("ParaIsCharacterDistance") + + PropertyTester.TestProperty("ParaIsForbiddenRules") + + PropertyTester.TestProperty("ParaIsHangingPunctuation") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/style/CharacterPropertiesComplex/script.xlb b/qadevOOo/tests/basic/ifc/style/CharacterPropertiesComplex/script.xlb new file mode 100644 index 000000000000..47d057ab617b --- /dev/null +++ b/qadevOOo/tests/basic/ifc/style/CharacterPropertiesComplex/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="style_CharacterPropertiesComplex" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="style_CharacterPropertiesComplex"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/style/CharacterPropertiesComplex/style_CharacterPropertiesComplex.xba b/qadevOOo/tests/basic/ifc/style/CharacterPropertiesComplex/style_CharacterPropertiesComplex.xba new file mode 100644 index 000000000000..6ff647853299 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/style/CharacterPropertiesComplex/style_CharacterPropertiesComplex.xba @@ -0,0 +1,94 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="style_CharacterPropertiesComplex" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.style.CharacterPropertiesComplex +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Dim charHeightComplex(3) As Double + charHeightComplex(0) = 12.3 + charHeightComplex(1) = 16.2 + charHeightComplex(2) = 26.6 + charHeightComplex(3) = 42.8 + + Dim charWeightComplex(9) As Integer + with com.sun.star.awt.FontWeight + charWeightComplex(0) = .DONTKNOW + charWeightComplex(1) = .THIN + charWeightComplex(2) = .ULTRALIGHT + charWeightComplex(3) = .LIGHT + charWeightComplex(4) = .SEMILIGHT + charWeightComplex(5) = .NORMAL + charWeightComplex(6) = .SEMIBOLD + charWeightComplex(7) = .BOLD + charWeightComplex(8) = .ULTRABOLD + charWeightComplex(9) = .BLACK + end with + + PropertyTester.TestProperty("CharHeightComplex",charHeightComplex()) + + PropertyTester.TestProperty("CharWeightComplex",charWeightComplex()) + + PropertyTester.TestProperty("CharFontNameComplex") + + PropertyTester.TestProperty("CharFontStyleNameComplex") + + PropertyTester.TestProperty("CharFontFamilyComplex") + + PropertyTester.TestProperty("CharFontCharSetComplex") + + PropertyTester.TestProperty("CharFontPitchComplex") + + PropertyTester.TestProperty("CharPostureComplex") + + PropertyTester.TestProperty("CharLocaleComplex") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/style/ParagraphProperties/script.xlb b/qadevOOo/tests/basic/ifc/style/ParagraphProperties/script.xlb new file mode 100644 index 000000000000..9a6f2064f777 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/style/ParagraphProperties/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="style_ParagraphProperties" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="style_ParagraphProperties"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/style/ParagraphProperties/style_ParagraphProperties.xba b/qadevOOo/tests/basic/ifc/style/ParagraphProperties/style_ParagraphProperties.xba new file mode 100644 index 000000000000..922c6fcec0a9 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/style/ParagraphProperties/style_ParagraphProperties.xba @@ -0,0 +1,212 @@ +<?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="style_ParagraphProperties" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.style.ParagraphProperties +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + if hasUnoInterfaces(oObj, "com.sun.star.text.XTextRange") then + oObj.String = "This is an example string from ParagraphProperties..." + end if + + Dim nParaAdjust(3) As Integer + nParaAdjust(0) = com.sun.star.style.ParagraphAdjust.LEFT + nParaAdjust(1) = com.sun.star.style.ParagraphAdjust.RIGHT + nParaAdjust(2) = com.sun.star.style.ParagraphAdjust.BLOCK + nParaAdjust(3) = com.sun.star.style.ParagraphAdjust.CENTER + ' STRETCH???? + + Dim nLastLineAdjust(2) As Integer + nLastLineAdjust(0) = com.sun.star.style.ParagraphAdjust.LEFT + nLastLineAdjust(1) = com.sun.star.style.ParagraphAdjust.BLOCK + nLastLineAdjust(2) = com.sun.star.style.ParagraphAdjust.CENTER + ' STRETCH???? + + Out.Log("Starting ...") + + PropertyTester.TestProperty("ParaAdjust",nParaAdjust()) + + PropertyTester.TestProperty("ParaLineSpacing") + + PropertyTester.TestProperty("ParaBackColor") + + PropertyTester.TestProperty("ParaBackTransparent") + + PropertyTester.TestProperty("ParaBackGraphicURL") + + PropertyTester.TestProperty("ParaBackGraphicFilter") + + PropertyTester.TestProperty("ParaBackGraphicLocation") + + Out.Log("set ParaAdjust to com.sun.star.style.ParagraphAdjust.BLOCK") + oObj.ParaAdjust = com.sun.star.style.ParagraphAdjust.BLOCK + PropertyTester.TestProperty("ParaLastLineAdjust",nLastLineAdjust()) + oObj.ParaAdjust = com.sun.star.style.ParagraphAdjust.LEFT + + PropertyTester.TestProperty("ParaExpandSingleWord") + + Dim margins(2) As Integer + margins(0) = 0 + margins(1) = 50 + margins(2) = 100 + + PropertyTester.TestProperty("ParaLeftMargin",margins()) + + PropertyTester.TestProperty("ParaRightMargin",margins()) + + PropertyTester.TestProperty("ParaTopMargin",margins()) + + PropertyTester.TestProperty("ParaBottomMargin",margins()) + + PropertyTester.TestProperty("ParaLineNumberCount") + + PropertyTester.TestProperty("ParaLineNumberStartValue") + + Dim cPageDescName(0 To 1) As String + cPageDescName(0) = "HTML" + cPageDescName(1) = "Standard" + PropertyTester.TestProperty("PageDescName",cPageDescName()) + + PropertyTester.TestProperty("PageNumberOffset") + + PropertyTester.TestProperty("ParaRegisterModeActive") + + PropertyTester.TestProperty("ParaTabStops") + + Dim cParaStyleName(0 to 3) As String + cParaStyleName(0) = "Heading 1" + cParaStyleName(1) = "First line indent" + cParaStyleName(2) = "Text body" + cParaStyleName(3) = "Standard" + PropertyTester.TestProperty("ParaStyleName",cParaStyleName()) + + PropertyTester.TestProperty("DropCapFormat") + + PropertyTester.TestProperty("DropCapWholeWord") + + PropertyTester.TestProperty("ParaKeepTogether") + + PropertyTester.TestProperty("ParaSplit") + + Dim nLevel(0 to 1) As Integer + nLevel(0) = 3 + nLevel(1) = 0 + Out.Log("Set NumberingStyleName to 'List 2' " + if PropertyTester.isAvailable("NumberingStyleName") then + oObj.NumberingStyleName = "List 2" + end if + PropertyTester.TestProperty("NumberingLevel",nLevel()) + + PropertyTester.TestProperty("NumberingRules") + + PropertyTester.TestProperty("NumberingStartValue") + + PropertyTester.TestProperty("ParaIsNumberingRestart") + + Dim cStyleName(0 to 1) As String + cStyleName(0) = "List 1" + cStyleName(1) = "Numbering 2" + PropertyTester.TestProperty("NumberingStyleName",cStyleName()) + + PropertyTester.TestProperty("ParaOrphans") + + PropertyTester.TestProperty("ParaWidows") + + PropertyTester.TestProperty("ParaShadowFormat") + + PropertyTester.TestProperty("LeftBorder") + + PropertyTester.TestProperty("RightBorder") + + PropertyTester.TestProperty("TopBorder") + + PropertyTester.TestProperty("BottomBorder") + + PropertyTester.TestProperty("BorderDistance") + + PropertyTester.TestProperty("LeftBorderDistance") + + PropertyTester.TestProperty("RightBorderDistance") + + PropertyTester.TestProperty("TopBorderDistance") + + PropertyTester.TestProperty("BottomBorderDistance") + + PropertyTester.TestProperty("BreakType") + + Dim cCharStyles(1) as String + cCharStyles(0) = "Emphasis" + CCharStyles(1) = "Teletype" + + PropertyTester.TestProperty("DropCapCharStyleName",cCharStyles()) + + PropertyTester.TestProperty("ParaFirstLineIndent") + + PropertyTester.TestProperty("ParaIsAutoFirstLineIndent") + + PropertyTester.TestProperty("ParaHyphenationMaxHyphens") + + PropertyTester.TestProperty("ParaHyphenationMaxLeadingChars") + + PropertyTester.TestProperty("ParaHyphenationMaxTrailingChars") + + Dim VertAlign(0 to 4) as Integer + Dim nCount as Integer + for nCount = 0 to uBound(VertAlign()) + VertAlign(nCount) = nCount + next nCount + PropertyTester.TestProperty("ParaVertAlignment", VertAlign()) + + PropertyTester.TestProperty("ParaUserDefinedAttributes") + + PropertyTester.TestProperty("ParaIsHyphenation") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/style/ParagraphPropertiesAsian/script.xlb b/qadevOOo/tests/basic/ifc/style/ParagraphPropertiesAsian/script.xlb new file mode 100644 index 000000000000..38149c374b1f --- /dev/null +++ b/qadevOOo/tests/basic/ifc/style/ParagraphPropertiesAsian/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="style_ParagraphPropertiesAsian" library:readonly="false" library:passwordprotected="false"> + <library:element library:name="style_ParagraphPropertiesAsian"/> + </library:library> diff --git a/qadevOOo/tests/basic/ifc/style/ParagraphPropertiesAsian/style_ParagraphPropertiesAsian.xba b/qadevOOo/tests/basic/ifc/style/ParagraphPropertiesAsian/style_ParagraphPropertiesAsian.xba new file mode 100644 index 000000000000..887375db02b2 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/style/ParagraphPropertiesAsian/style_ParagraphPropertiesAsian.xba @@ -0,0 +1,63 @@ +<?xml version="1.0" encoding="UTF-8"?> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="style_ParagraphPropertiesAsian" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.style.ParagraphPropertiesAsian +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + +' + PropertyTester.TestProperty("ParaIsHangingPunctuation") + + PropertyTester.TestProperty("ParaIsCharacterDistance") + + PropertyTester.TestProperty("ParaIsForbiddenRules") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/style/ParagraphPropertiesComplex/script.xlb b/qadevOOo/tests/basic/ifc/style/ParagraphPropertiesComplex/script.xlb new file mode 100644 index 000000000000..e9f33ed0a38e --- /dev/null +++ b/qadevOOo/tests/basic/ifc/style/ParagraphPropertiesComplex/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="style_ParagraphPropertiesComplex" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="style_ParagraphPropertiesComplex"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/style/ParagraphPropertiesComplex/style_ParagraphPropertiesComplex.xba b/qadevOOo/tests/basic/ifc/style/ParagraphPropertiesComplex/style_ParagraphPropertiesComplex.xba new file mode 100644 index 000000000000..45c0e719955b --- /dev/null +++ b/qadevOOo/tests/basic/ifc/style/ParagraphPropertiesComplex/style_ParagraphPropertiesComplex.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="style_ParagraphPropertiesComplex" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.style.ParagraphPropertiesComplex +'************************************************************************* +On Error Goto ErrHndl + + Dim newVals As Variant + newVals = Array(0, 1, 2, 3, 4) + PropertyTester.TestProperty("WritingMode", newVals()) + +Exit Sub +ErrHndl: + Test.Exception() + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/style/Style/script.xlb b/qadevOOo/tests/basic/ifc/style/Style/script.xlb new file mode 100644 index 000000000000..e38e0da873aa --- /dev/null +++ b/qadevOOo/tests/basic/ifc/style/Style/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="style_Style" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="style_Style"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/style/Style/style_Style.xba b/qadevOOo/tests/basic/ifc/style/Style/style_Style.xba new file mode 100644 index 000000000000..e1e8f67685d9 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/style/Style/style_Style.xba @@ -0,0 +1,62 @@ +<?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="style_Style" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.style.Style +'************************************************************************* +On Error Goto ErrHndl + + PropertyTester.TestProperty("IsPhysical") + + PropertyTester.TestProperty("FollowStyle") + + PropertyTester.TestProperty("DisplayName") + + PropertyTester.TestProperty("IsAutoUpdate") + +Exit Sub +ErrHndl: + Test.Exception() + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/style/XStyle/script.xlb b/qadevOOo/tests/basic/ifc/style/XStyle/script.xlb new file mode 100644 index 000000000000..359a7b3efb62 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/style/XStyle/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="style_XStyle" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="style_XStyle"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/style/XStyle/style_XStyle.xba b/qadevOOo/tests/basic/ifc/style/XStyle/style_XStyle.xba new file mode 100644 index 000000000000..0e8b9c872be8 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/style/XStyle/style_XStyle.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="style_XStyle" 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 + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' - Global oStandartStyle As Object + +'************************************************************************* + + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.style.XStyle +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim cName, cObjName As String + + Test.StartMethod("isUserDefined()") + bOK = true + bOK = bOK AND oObj.isUserDefined() AND NOT oStandartStyle.isUserDefined() + Test.MethodTested("isUserDefined()", bOK) + + Test.StartMethod("isInUse()") + bOK = true + bOK = bOK AND oObj.isInUse() + Test.MethodTested("isInUse()", bOK) + + Test.StartMethod("setParentStyle()") + Test.StartMethod("getParentStyle()") + bOK = true + cName = oStandartStyle.Name + Out.Log("setting name to '" & cName & "'") + oObj.setParentStyle(cName) + cObjName = oObj.getParentStyle() + Out.Log("name is '" & cObjName & "'") + bOK = bOK AND cObjName = cName + Test.MethodTested("getParentStyle()", bOK) + Test.MethodTested("setParentStyle()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/style/XStyleFamiliesSupplier/script.xlb b/qadevOOo/tests/basic/ifc/style/XStyleFamiliesSupplier/script.xlb new file mode 100644 index 000000000000..3f55b2fa6d90 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/style/XStyleFamiliesSupplier/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="style_XStyleFamiliesSupplier" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="style_XStyleFamiliesSupplier"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/style/XStyleFamiliesSupplier/style_XStyleFamiliesSupplier.xba b/qadevOOo/tests/basic/ifc/style/XStyleFamiliesSupplier/style_XStyleFamiliesSupplier.xba new file mode 100644 index 000000000000..27ea60e95a47 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/style/XStyleFamiliesSupplier/style_XStyleFamiliesSupplier.xba @@ -0,0 +1,62 @@ +<?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="style_XStyleFamiliesSupplier" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.style.XStyleFamiliesSupplier +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim oFam As Object + + + Test.StartMethod("getStyleFamilies()") + bOK = true + oFam = oObj.getStyleFamilies() + bOK = NOT isNULL(oFam) + bOK = bOK AND hasUnoInterfaces(oFam, "com.sun.star.container.XNameAccess") + Test.MethodTested("getStyleFamilies()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/system/XProxySettings/script.xlb b/qadevOOo/tests/basic/ifc/system/XProxySettings/script.xlb new file mode 100644 index 000000000000..8163d6b3f6db --- /dev/null +++ b/qadevOOo/tests/basic/ifc/system/XProxySettings/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="system_XProxySettings" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="system_XProxySettings"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/system/XProxySettings/system_XProxySettings.xba b/qadevOOo/tests/basic/ifc/system/XProxySettings/system_XProxySettings.xba new file mode 100644 index 000000000000..eef8f15c67de --- /dev/null +++ b/qadevOOo/tests/basic/ifc/system/XProxySettings/system_XProxySettings.xba @@ -0,0 +1,114 @@ +<?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="system_XProxySettings" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.system.XProxySettings +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + Test.StartMethod("getFtpProxyAddress()") + bOK = true + bOK = bOK AND (VarType(oObj.getFtpProxyAddress()) = 8) + Test.MethodTested("getFtpProxyAddress()", bOK) + + Test.StartMethod("getFtpProxyPort()") + bOK = true + bOK = bOK AND (VarType(oObj.getFtpProxyAddress()) = 8) + Test.MethodTested("getFtpProxyPort()", bOK) + + Test.StartMethod("getGopherProxyAddress()") + bOK = true + bOK = bOK AND (VarType(oObj.getGopherProxyAddress()) = 8) + Test.MethodTested("getGopherProxyAddress()", bOK) + + Test.StartMethod("getGopherProxyPort()") + bOK = true + bOK = bOK AND (VarType(oObj.getGopherProxyPort()) = 8) + Test.MethodTested("getGopherProxyPort()", bOK) + + Test.StartMethod("getHttpProxyAddress()") + bOK = true + bOK = bOK AND (VarType(oObj.getHttpProxyAddress()) = 8) + Test.MethodTested("getHttpProxyAddress()", bOK) + + Test.StartMethod("getHttpProxyPort()") + bOK = true + bOK = bOK AND (VarType(oObj.getHttpProxyPort()) = 8) + Test.MethodTested("getHttpProxyPort()", bOK) + + Test.StartMethod("getHttpsProxyAddress()") + bOK = true + bOK = bOK AND (VarType(oObj.getHttpsProxyAddress()) = 8) + Test.MethodTested("getHttpsProxyAddress()", bOK) + + Test.StartMethod("getHttpsProxyPort()") + bOK = true + bOK = bOK AND (VarType(oObj.getHttpsProxyPort()) = 8) + Test.MethodTested("getHttpsProxyPort()", bOK) + + Test.StartMethod("getSocksProxyAddress()") + bOK = true + bOK = bOK AND (VarType(oObj.getSocksProxyAddress()) = 8) + Test.MethodTested("getSocksProxyAddress()", bOK) + + Test.StartMethod("getSocksProxyPort()") + bOK = true + bOK = bOK AND (VarType(oObj.getSocksProxyPort()) = 8) + Test.MethodTested("getSocksProxyPort()", bOK) + + Test.StartMethod("getProxyBypassAddress()") + bOK = true + bOK = bOK AND (VarType(oObj.getProxyBypassAddress()) = 8) + Test.MethodTested("getProxyBypassAddress()", bOK) + + Test.StartMethod("isProxyEnabled()") + bOK = true + bOK = bOK AND (VarType(oObj.isProxyEnabled()) = 11) + Test.MethodTested("isProxyEnabled()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/system/XSimpleMailClientSupplier/script.xlb b/qadevOOo/tests/basic/ifc/system/XSimpleMailClientSupplier/script.xlb new file mode 100644 index 000000000000..f8c67fe40fa3 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/system/XSimpleMailClientSupplier/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="system_XSimpleMailClientSupplier" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="system_XSimpleMailClientSupplier"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/system/XSimpleMailClientSupplier/system_XSimpleMailClientSupplier.xba b/qadevOOo/tests/basic/ifc/system/XSimpleMailClientSupplier/system_XSimpleMailClientSupplier.xba new file mode 100644 index 000000000000..4a0c280b014d --- /dev/null +++ b/qadevOOo/tests/basic/ifc/system/XSimpleMailClientSupplier/system_XSimpleMailClientSupplier.xba @@ -0,0 +1,65 @@ +<?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="system_XSimpleMailClientSupplier" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.system.XSimpleMailClientSupplier +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Dim oClient As Object + + Test.StartMethod("querySimpleMailClient()") + if (GetGuiType() = GUI_TYPE_WINDOWS) then + Out.Log("OS is Win : trying to query mail client ...") + bOK = isObject(oObj.querySimpleMailClient()) + else + Out.Log("OS is not Win : service is not available.") + bOK = true + endif + Test.MethodTested("querySimpleMailClient()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/system/XSystemShellExecute/script.xlb b/qadevOOo/tests/basic/ifc/system/XSystemShellExecute/script.xlb new file mode 100644 index 000000000000..92aa06663c82 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/system/XSystemShellExecute/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="system_XSystemShellExecute" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="system_XSystemShellExecute"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/system/XSystemShellExecute/system_XSystemShellExecute.xba b/qadevOOo/tests/basic/ifc/system/XSystemShellExecute/system_XSystemShellExecute.xba new file mode 100644 index 000000000000..28ebd069b35a --- /dev/null +++ b/qadevOOo/tests/basic/ifc/system/XSystemShellExecute/system_XSystemShellExecute.xba @@ -0,0 +1,105 @@ +<?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="system_XSystemShellExecute" 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 + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' - java existing in PATH system var and +' SystemShellExecute.class file in docs dir + +'************************************************************************* + + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.system.XSystemShellExecute +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim cResFile As String, cResURL As String, cClassPath As String + Dim oFacc As Object + Dim bExist As Boolean, i As Integer + Dim cArgs As String + + Test.StartMethod("execute()") + cClassPath = utils.URL2Path(utils.Path2URL(cTestDocsDir)) + cResURL = utils.getTempFileURL("SystemShellExecute.txt", true) + cResFile = utils.URL2Path(cResURL) + bOK = true + + cArgs = "-classpath " + cClassPath + " SystemShellExecute " + cResFile + Out.Log("Executing : 'java " + cArgs + "'") + oObj.execute("java", cArgs, 1) + + oFacc = createUnoService("com.sun.star.ucb.SimpleFileAccess") + + if bOK then + Out.Log("Waiting while the file will be created or timeout reached ...") + bExist = false + i = 0 + while i < 20 AND NOT bExist + bExist = oFacc.exists(cResURL) + wait(1000) + i = i + 1 + wend + + if bExist then + Out.Log("The command was executed and file created in " + i + " sec.") + else + Out.Log("File was not created.") + endif + + bOK = bOK AND bExist + endif + + Test.MethodTested("execute()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/table/CellProperties/script.xlb b/qadevOOo/tests/basic/ifc/table/CellProperties/script.xlb new file mode 100644 index 000000000000..f6d079817389 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/table/CellProperties/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="table_CellProperties" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="table_CellProperties"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/table/CellProperties/table_CellProperties.xba b/qadevOOo/tests/basic/ifc/table/CellProperties/table_CellProperties.xba new file mode 100644 index 000000000000..74d2e9706f3b --- /dev/null +++ b/qadevOOo/tests/basic/ifc/table/CellProperties/table_CellProperties.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="table_CellProperties" 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 + + +Dim bOK As Boolean +Dim oTB As Variant, oldVal As Variant +Dim newVal As Variant, valToSet As Variant + + + +Sub RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.table.CellProperties +'************************************************************************* +On Error Goto ErrHndl + Dim aCellStyles(1) As String + + aCellStyles(0) = "Result" + aCellStyles(1) = "Default" + PropertyTester.TestProperty("CellStyle", aCellStyles()) + + PropertyTester.TestProperty("CellBackColor") + + PropertyTester.TestProperty("IsCellBackgroundTransparent") + + Dim aNumberFormats(1) As Integer + aNumberFormats(0) = 2 + aNumberFormats(1) = 1 + PropertyTester.TestProperty("NumberFormat", aNumberFormats()) + + PropertyTester.TestProperty("ShadowFormat") + + PropertyTester.TestProperty("HoriJustify") + + PropertyTester.TestProperty("VertJustify") + + PropertyTester.TestProperty("Orientation") + + PropertyTester.TestProperty("CellProtection") + + Test.StartMethod("TableBorder") + + Dim oTBNew As New com.sun.star.table.TableBorder + bOK = true + oldVal = oObj.TableBorder.Distance + Out.Log("value of 'TableBorder.Distance' before: "+oldVal) + oTBNew = oObj.TableBorder + Out.Log("setting value: "+ (oldVal + 20)) + oTBNew.Distance = oldVal + 20 + oObj.setPropertyValue("TableBorder", oTBNew) + newVal = oObj.TableBorder.Distance + Out.Log("value of 'TableBorder.Distance' after: "+newVal) + bOK = bOK AND (newVal = oTBNew.Distance) + Test.MethodTested("TableBorder", bOK) + + PropertyTester.TestProperty("IsTextWrapped") + + Dim nRotate(1) As Integer + nRotate(0) = 30999 + nRotate(1) = 4500 + PropertyTester.TestProperty("RotateAngle",nRotate()) + + PropertyTester.TestProperty("RotateReference") + + PropertyTester.TestProperty("AsianVerticalMode") +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/table/TableColumn/script.xlb b/qadevOOo/tests/basic/ifc/table/TableColumn/script.xlb new file mode 100644 index 000000000000..6e6455ba0f2f --- /dev/null +++ b/qadevOOo/tests/basic/ifc/table/TableColumn/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="table_TableColumn" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="table_TableColumn"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/table/TableColumn/table_TableColumn.xba b/qadevOOo/tests/basic/ifc/table/TableColumn/table_TableColumn.xba new file mode 100644 index 000000000000..cf052ca74719 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/table/TableColumn/table_TableColumn.xba @@ -0,0 +1,64 @@ +<?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="table_TableColumn" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.table.TableColumn +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + PropertyTester.TestProperty("Width") + + PropertyTester.TestProperty("OptimalWidth") + + PropertyTester.TestProperty("IsVisible") + + PropertyTester.TestProperty("IsStartOfNewPage") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/table/TableRow/script.xlb b/qadevOOo/tests/basic/ifc/table/TableRow/script.xlb new file mode 100644 index 000000000000..a60eabb39d69 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/table/TableRow/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="table_TableRow" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="table_TableRow"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/table/TableRow/table_TableRow.xba b/qadevOOo/tests/basic/ifc/table/TableRow/table_TableRow.xba new file mode 100644 index 000000000000..f46e5f1e7e09 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/table/TableRow/table_TableRow.xba @@ -0,0 +1,62 @@ +<?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="table_TableRow" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.table.TableRow +'************************************************************************* +On Error Goto ErrHndl + + PropertyTester.TestProperty("Height") + + PropertyTester.TestProperty("OptimalHeight") + + PropertyTester.TestProperty("IsVisible") + + PropertyTester.TestProperty("IsStartOfNewPage") + +Exit Sub +ErrHndl: + Test.Exception() + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/table/XAutoFormattable/script.xlb b/qadevOOo/tests/basic/ifc/table/XAutoFormattable/script.xlb new file mode 100644 index 000000000000..88458e208447 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/table/XAutoFormattable/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="table_XAutoFormattable" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="table_XAutoFormattable"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/table/XAutoFormattable/table_XAutoFormattable.xba b/qadevOOo/tests/basic/ifc/table/XAutoFormattable/table_XAutoFormattable.xba new file mode 100644 index 000000000000..d67b346a9203 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/table/XAutoFormattable/table_XAutoFormattable.xba @@ -0,0 +1,67 @@ +<?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="table_XAutoFormattable" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.table.XAutoFormattable +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim iBg1 As Variant, iBg2 As Variant + + Test.StartMethod("autoFormat()") + bOK = true + oObj.getCellByPosition(0, 0).setPropertyValue("BackColor", 0) + oObj.getCellByPosition(1, 1).setPropertyValue("BackColor", 0) + oObj.autoFormat("Default") + iBg1 = oObj.getCellByPosition(0, 0).getPropertyValue("BackColor") + iBg2 = oObj.getCellByPosition(1, 1).getPropertyValue("BackColor") + bOK = bOK AND iBg1 <> iBg2 + Test.MethodTested("autoFormat()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/table/XCell/script.xlb b/qadevOOo/tests/basic/ifc/table/XCell/script.xlb new file mode 100644 index 000000000000..837a8f5c67f9 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/table/XCell/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="table_XCell" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="table_XCell"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/table/XCell/table_XCell.xba b/qadevOOo/tests/basic/ifc/table/XCell/table_XCell.xba new file mode 100644 index 000000000000..6bb675e5088c --- /dev/null +++ b/qadevOOo/tests/basic/ifc/table/XCell/table_XCell.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="table_XCell" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.table.XCell +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim aFormula As String + Dim aValue As Integer + Dim aType As Variant + + Test.StartMethod("setFormula()") + bOK = true + Out.Log("setFormula(""=2+2"")") + oObj.setFormula("=2+2") + Test.MethodTested("setFormula()", bOK) + + Test.StartMethod("getFormula()") + bOK = true + aFormula = oObj.getFormula() + Out.Log("getFormula() returned '" & aFormula & "'") + bOK = bOK AND inStr(1, aFormula, "2+2") + Test.MethodTested("getFormula()", bOK) + + Test.StartMethod("getValue()") + bOK = true + aValue = oObj.getValue() + bOK = bOK AND aValue = 4 + Test.MethodTested("getValue()", bOK) + + Test.StartMethod("setValue()") + bOK = true + oObj.setValue(10) + bOK = bOK AND oObj.getValue = 10 + Test.MethodTested("setValue()", bOK) + + Test.StartMethod("getType()") + bOK = true + aType = oObj.getType() + bOK = bOK AND (aType = com.sun.star.table.CellContentType.EMPTY OR _ + aType = com.sun.star.table.CellContentType.VALUE OR _ + aType = com.sun.star.table.CellContentType.TEXT OR _ + aType = com.sun.star.table.CellContentType.FORMULA) + Test.MethodTested("getType()", bOK) + + Test.StartMethod("getError()") + bOK = true + bOK = bOK AND (oObj.getError() = 0) + oObj.setFormula("=sqrt(-2)") + bOK = bOK AND (oObj.getError() <> 0) + Test.MethodTested("getError()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/table/XCellCursor/script.xlb b/qadevOOo/tests/basic/ifc/table/XCellCursor/script.xlb new file mode 100644 index 000000000000..beb85284488f --- /dev/null +++ b/qadevOOo/tests/basic/ifc/table/XCellCursor/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="table_XCellCursor" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="table_XCellCursor"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/table/XCellCursor/table_XCellCursor.xba b/qadevOOo/tests/basic/ifc/table/XCellCursor/table_XCellCursor.xba new file mode 100644 index 000000000000..b681dfa1a334 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/table/XCellCursor/table_XCellCursor.xba @@ -0,0 +1,144 @@ +<?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="table_XCellCursor" 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 + +'************************************************************************* +'XCellCursor walks in a range of data. That +' means: If you have the range (A1:B10) filled +' with data gotoStart() goes to (A1), gotoEnd() +' goes to (B10). But: you must insite this range. +' If you are in (C3) you will nerver go to (A1). + +'************************************************************************* + + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.table.XCellCursor +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim bSupport As Boolean + Dim ResetCols As Integer, ResetRows As Long + Dim nStartSCol, nStartECol As Integer + Dim nStartSRow, nStartERow As Long + Dim nNextECol As Integer, nNextERow As Long + Dim nEndECol As Integer, nEndERow As Long + Dim nPrevECol As Integer, nPrevERow As Long + Dim nOffECol As Integer, nOffERow As Long + Dim oAddress As Object + + if hasUnoInterfaces(oObj, "com.sun.star.sheet.XSheetCellCursor") then + bSupport = true + ResetCols = oObj.getColumns().getCount() + ResetRows = oObj.getRows().getCount() + else + bSupport = false + end if + + Test.StartMethod("gotoStart()") + bOK = true + oObj.gotoStart() + oAddress = oObj.getRangeAddress() + nStartSCol = oAddress.StartColumn + nStartECol = oAddress.EndColumn + nStartSRow = oAddress.StartRow + nStartERow = oAddress.EndRow + bOK = bOK AND (nStartSCol = nStartECol) AND (nStartSRow = nStartERow) + Out.Log("nStartSCol = " & nStartSCol & " nStartECol = " & nStartECol &_ + " nStartSRow = " & nStartSRow & " nStartERow = " & nStartERow) + Test.MethodTested("gotoStart()", bOK) + + Test.StartMethod("gotoNext()") + bOK = true + oObj.gotoNext() + oAddress = oObj.getRangeAddress() + nNextECol = oAddress.EndColumn + nNextERow = oAddress.EndRow + bOK = bOK AND ((nNextECol = nStartSCol + 1) OR (nNextERow = nStartSRow + 1)) + Out.Log("nNextECol = " & nNextECol & " nNextERow = " & nNextERow) + Test.MethodTested("gotoNext()", bOK) + + Test.StartMethod("gotoEnd()") + bOK = true + oObj.gotoEnd() + oAddress = oObj.getRangeAddress() + nEndECol = oAddress.EndColumn + nEndERow = oAddress.EndRow + bOK = bOK AND ((nEndECol > nStartECol) OR (nEndERow > nStartERow)) + Out.Log("nEndSCol = " & nEndECol & " nEndERow = " & nEndERow) + Test.MethodTested("gotoEnd()", bOK) + + Test.StartMethod("gotoPrevious()") + bOK = true + oObj.gotoPrevious() + oAddress = oObj.getRangeAddress() + nPrevECol = oAddress.EndColumn + nPrevERow = oAddress.EndRow + bOK = bOK AND ((nPrevECol < nEndECol) OR (nPrevERow < nEndERow)) + Out.Log("nPrevECol = " & nPrevECol & " nPrevERow = " & nPrevERow) + Test.MethodTested("gotoPrevious()", bOK) + + Test.StartMethod("gotoOffset()") + bOK = true + oObj.gotoStart() + oObj.gotoOffset(1,1) + oAddress = oObj.getRangeAddress() + nOffECol = oAddress.EndColumn + nOffERow = oAddress.EndRow + bOK = bOK AND (nOffECol = nStartSCol + 1) AND (nOffERow = nStartSRow + 1) + Out.Log("nOffECol = " & nOffECol & " nOffERow = " & nOffERow) + Test.MethodTested("gotoOffset()", bOK) + + if bSupport then + Out.Log("Reset to old range: " & ResetCols & "," & ResetRows) + oObj.collapseToSize(ResetCols, ResetRows) + end if + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/table/XCellRange/script.xlb b/qadevOOo/tests/basic/ifc/table/XCellRange/script.xlb new file mode 100644 index 000000000000..432c2e2fd845 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/table/XCellRange/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="table_XCellRange" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="table_XCellRange"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/table/XCellRange/table_XCellRange.xba b/qadevOOo/tests/basic/ifc/table/XCellRange/table_XCellRange.xba new file mode 100644 index 000000000000..84588e716650 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/table/XCellRange/table_XCellRange.xba @@ -0,0 +1,142 @@ +<?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="table_XCellRange" 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 + +'************************************************************************* +' You can only get ranges within your +' object-range. That means is your object-range +' is (A1:C3) you can get only a range within +' (A1:C3). + +'************************************************************************* + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.table.XCellRange +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Dim oCell As Object + Dim oCellRange As Object + Dim oCellRange1 As Object + Dim bSupport As Boolean + Dim oAddress As Object + Dim nSCol As Long, nECol As Long + Dim nSRow As Long, nERow As Long + Dim nCol As Long, nRow As Long + Dim cSCol As String, cECol As String + + bOK = true + 'does the object support this service? If yes, the object is a range itself. + 'So we must look for the range address to be get a valid range + if hasUnoInterfaces( oObj, "com.sun.star.sheet.XCellRangeAddressable" ) then + Out.Log("Object supports com.sun.star.sheet.XCellRangeAddressable") + bSupport = true + oAddress = oObj.getRangeAddress() + nSCol = oAddress.StartColumn + nECol = oAddress.EndColumn + nSRow = oAddress.StartRow + nERow = oAddress.EndRow + nCol = nECol - nSCol + nRow = nERow - nSRow + else + bSupport = false + nCol = 1 + nRow = 1 + end if + + Test.StartMethod("getCellByPosition()") + bOK = true + Out.Log("try to getCellByPosition(" + nCol + "," + nRow + ")") + oCell = oObj.getCellByPosition(nCol, nRow) + bOK = bOK AND hasUnoInterfaces( oCell, "com.sun.star.table.XCell" ) + Test.MethodTested("getCellByPosition()", bOK) + + Test.StartMethod("getCellRangeByPosition()") + bOK = true + Out.Log("try to getCellRangeByPosition(0,0," + nCol + "," + nRow + ")") + oCellRange = oObj.getCellRangeByPosition(0, 0, nCol, nRow) + bOK = bOK AND hasUnoInterfaces( oCellRange, "com.sun.star.table.XCellRange" ) + Test.MethodTested("getCellRangeByPosition()", bOK) + + Test.StartMethod("getCellRangeByName()") + bOK = true + if bSupport then + oAddress = oObj.getRangeAddress() + nSCol = oAddress.StartColumn + nECol = oAddress.EndColumn + nSRow = oAddress.StartRow + nERow = oAddress.EndRow + cSCol = getCharacter(nSCol) + cECol = getCharacter(nECol) + else + nSRow = 0 + nERow = 2 + cSCol = "A" + cECol = "C" + end if + Out.Log("Try to getCellRangeByName(""" + cSCol + (nSRow + 1) + ":" + cECol + (nERow + 1) + """)") + oCellRange1 = oObj.getCellRangeByName("" + cSCol + (nSRow + 1) + ":" + cECol + (nERow + 1)) + bOK = bOK AND hasUnoInterfaces( oCellRange1, "com.sun.star.table.XCellRange" ) + Test.MethodTested("getCellRangeByName()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +Function getCharacter( nCol as Integer) as String + Dim Char As String + Dim nNum As Integer + nNum = nCol + Char = "" + if (nNum - 26) > 0 Then + Char = Chr((nNum mod 26)+65) + nNum = Int((nNum - 26)/ 26) + end if + Char = Chr(nNum + 65) + Char + getCharacter = Char +End Function +</script:module> diff --git a/qadevOOo/tests/basic/ifc/table/XColumnRowRange/script.xlb b/qadevOOo/tests/basic/ifc/table/XColumnRowRange/script.xlb new file mode 100644 index 000000000000..7dc9dec2d4c2 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/table/XColumnRowRange/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="table_XColumnRowRange" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="table_XColumnRowRange"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/table/XColumnRowRange/table_XColumnRowRange.xba b/qadevOOo/tests/basic/ifc/table/XColumnRowRange/table_XColumnRowRange.xba new file mode 100644 index 000000000000..8b22ff74500e --- /dev/null +++ b/qadevOOo/tests/basic/ifc/table/XColumnRowRange/table_XColumnRowRange.xba @@ -0,0 +1,71 @@ +<?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="table_XColumnRowRange" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.table.XColumnRowRange +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Dim oColumns As Variant + Dim oRows As Variant + + Test.StartMethod("getColumns()") + bOK = true + oColumns = oObj.getColumns() + bOK = bOK AND hasUnoInterfaces( oColumns, "com.sun.star.table.XTableColumns" ) + Test.MethodTested("getColumns()", bOK) + + Test.StartMethod("getRows()") + bOK = true + oRows = oObj.getRows() + bOK = bOK AND hasUnoInterfaces( oRows, "com.sun.star.table.XTableRows" ) + Test.MethodTested("getRows()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/table/XTableChart/script.xlb b/qadevOOo/tests/basic/ifc/table/XTableChart/script.xlb new file mode 100644 index 000000000000..7a8bc8b28a2e --- /dev/null +++ b/qadevOOo/tests/basic/ifc/table/XTableChart/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="table_XTableChart" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="table_XTableChart"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/table/XTableChart/table_XTableChart.xba b/qadevOOo/tests/basic/ifc/table/XTableChart/table_XTableChart.xba new file mode 100644 index 000000000000..8d5caa7f9faa --- /dev/null +++ b/qadevOOo/tests/basic/ifc/table/XTableChart/table_XTableChart.xba @@ -0,0 +1,106 @@ +<?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="table_XTableChart" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.table.XTableChart +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim tAddr(0) As New com.sun.star.table.CellRangeAddress + Dim objAddr As Object + + Test.StartMethod("getHasColumnHeaders()") + bOK = true + bOK = bOK AND NOT isNULL(oObj.getHasColumnHeaders()) + Test.MethodTested("getHasColumnHeaders()", bOK) + + Test.StartMethod("setHasColumnHeaders()") + bOK = true + oObj.setHasColumnHeaders(true) + bOK = bOK AND oObj.getHasColumnHeaders() = true + oObj.setHasColumnHeaders(false) + bOK = bOK AND oObj.getHasColumnHeaders() = false + Test.MethodTested("setHasColumnHeaders()", bOK) + + Test.StartMethod("getHasRowHeaders()") + bOK = true + bOK = bOK AND NOT isNULL(oObj.getHasRowHeaders()) + Test.MethodTested("getHasRowHeaders()", bOK) + + Test.StartMethod("setHasRowHeaders()") + bOK = true + oObj.setHasRowHeaders(true) + bOK = bOK AND oObj.getHasRowHeaders() + oObj.setHasRowHeaders(false) + bOK = bOK AND oObj.getHasRowHeaders() = false + Test.MethodTested("setHasRowHeaders()", bOK) + + Test.StartMethod("getRanges()") + bOK = true + bOK = bOK AND NOT isNULL(oObj.getRanges()) + Test.MethodTested("getRanges()", bOK) + + Test.StartMethod("setRanges()") + bOK = true + tAddr(0).Sheet = 0 + tAddr(0).StartRow = 0 + tAddr(0).StartColumn = 0 + tAddr(0).EndRow = 3 + tAddr(0).EndColumn = 3 + + oObj.setRanges(tAddr()) + objAddr = oObj.getRanges() + bOK = bOK AND NOT isNULL(objAddr) + if bOK then + Out.Log("oChart.getRanges() returned array of " & ubound(objAddr) + 1 & " element(s)") + bOK = bOK AND (ubound(objAddr) <> -1) + end if + Test.MethodTested("setRanges()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/table/XTableCharts/script.xlb b/qadevOOo/tests/basic/ifc/table/XTableCharts/script.xlb new file mode 100644 index 000000000000..e02edbd313f5 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/table/XTableCharts/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="table_XTableCharts" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="table_XTableCharts"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/table/XTableCharts/table_XTableCharts.xba b/qadevOOo/tests/basic/ifc/table/XTableCharts/table_XTableCharts.xba new file mode 100644 index 000000000000..b9a76250e533 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/table/XTableCharts/table_XTableCharts.xba @@ -0,0 +1,99 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="table_XTableCharts" 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 + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' - Global cChartDataAddress As New com.sun.star.table.CellRangeAddress + +'************************************************************************* + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.table.XTableCharts +'************************************************************************* +On Error Goto ErrHndl +On Error goto ErrHndl + Dim bOK As Boolean + + Dim cCount As Integer + cCount = oObj.count() + + Dim tRect As New com.sun.star.awt.Rectangle + tRect.X = 100 + tRect.Y = 100 + tRect.Width = 5000 + tRect.Height = 2000 + + Test.StartMethod("addNewByName()") + bOK = true + + Dim oRanges(0) As New com.sun.star.table.CellRangeAddress + oRanges(0).Sheet = cChartDataAddress.Sheet + oRanges(0).StartRow = cChartDataAddress.StartRow + oRanges(0).EndRow = cChartDataAddress.EndRow + oRanges(0).StartColumn = cChartDataAddress.StartColumn + oRanges(0).EndColumn = cChartDataAddress.EndColumn + + oObj.addNewByName("XTableCharts", tRect, oRanges(), true, true) + bOK = bOK AND oObj.Count = cCount + 1 + Out.Log("Inserting chart " & bOK) + oInst = oObj.getByName("XTableCharts") + bOK = bOK AND NOT isNULL(oInst) + Test.MethodTested("addNewByName()", bOK) + + Test.StartMethod("removeByName()") + bOK = true + oObj.removeByName("XTableCharts") + bOK = bOK AND (oObj.Count = cCount) + Test.MethodTested("removeByName()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/table/XTableChartsSupplier/script.xlb b/qadevOOo/tests/basic/ifc/table/XTableChartsSupplier/script.xlb new file mode 100644 index 000000000000..4103c5404308 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/table/XTableChartsSupplier/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="table_XTableChartsSupplier" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="table_XTableChartsSupplier"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/table/XTableChartsSupplier/table_XTableChartsSupplier.xba b/qadevOOo/tests/basic/ifc/table/XTableChartsSupplier/table_XTableChartsSupplier.xba new file mode 100644 index 000000000000..19fa85f4f01d --- /dev/null +++ b/qadevOOo/tests/basic/ifc/table/XTableChartsSupplier/table_XTableChartsSupplier.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="table_XTableChartsSupplier" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.table.XTableChartsSupplier +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Test.StartMethod("getCharts()") + bOK = true + oCharts = oObj.getCharts() + bOK = bOK AND hasUnoInterfaces(oCharts, "com.sun.star.table.XTableCharts") + Test.MethodTested("getCharts()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/table/XTableColumns/script.xlb b/qadevOOo/tests/basic/ifc/table/XTableColumns/script.xlb new file mode 100644 index 000000000000..efeba31d43bd --- /dev/null +++ b/qadevOOo/tests/basic/ifc/table/XTableColumns/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="table_XTableColumns" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="table_XTableColumns"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/table/XTableColumns/table_XTableColumns.xba b/qadevOOo/tests/basic/ifc/table/XTableColumns/table_XTableColumns.xba new file mode 100644 index 000000000000..40aafed887c0 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/table/XTableColumns/table_XTableColumns.xba @@ -0,0 +1,87 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="table_XTableColumns" 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 + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' - Global oTable As Object + +'************************************************************************* + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.table.XTableColumns +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Out.Log("Filling three cells.") + oTable.getCellByPosition(0, 0).String = cObjectName & " 1" + oTable.getCellByPosition(1, 0).String = cObjectName & " 2" + oTable.getCellByPosition(2, 0).String = "" + + Test.StartMethod("insertByIndex()") + bOK = true + oObj.insertByIndex(1, 1) + bOK = bOK AND oTable.getCellByPosition(0, 0).String = cObjectName & " 1" + bOK = bOK AND oTable.getCellByPosition(1, 0).String = "" + bOK = bOK AND oTable.getCellByPosition(2, 0).String = cObjectName & " 2" + Test.MethodTested("insertByIndex()", bOK) + + Test.StartMethod("removeByIndex()") + bOK = true + oObj.removeByIndex(1, 1) + bOK = bOK AND oTable.getCellByPosition(0, 0).String = cObjectName & " 1" + bOK = bOK AND oTable.getCellByPosition(1, 0).String = cObjectName & " 2" + bOK = bOK AND oTable.getCellByPosition(2, 0).String = "" + Test.MethodTested("removeByIndex()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/table/XTableRows/script.xlb b/qadevOOo/tests/basic/ifc/table/XTableRows/script.xlb new file mode 100644 index 000000000000..83ad19104b27 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/table/XTableRows/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="table_XTableRows" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="table_XTableRows"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/table/XTableRows/table_XTableRows.xba b/qadevOOo/tests/basic/ifc/table/XTableRows/table_XTableRows.xba new file mode 100644 index 000000000000..e86e922ba644 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/table/XTableRows/table_XTableRows.xba @@ -0,0 +1,88 @@ +<?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="table_XTableRows" 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 + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' - Global oTable As Object + +'************************************************************************* + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.table.XTableRows +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Out.Log("Filling three cells.") + oTable.getCellByPosition(0, 0).String = cObjectName & " 1" + oTable.getCellByPosition(0, 1).String = cObjectName & " 2" + oTable.getCellByPosition(0, 2).String = "" + + Test.StartMethod("insertByIndex()") + bOK = true + Out.Log("Insert Row between first ones") + oObj.insertByIndex(1, 1) + bOK = bOK AND oTable.getCellByPosition(0, 0).String = cObjectName & " 1" + bOK = bOK AND oTable.getCellByPosition(0, 1).String = "" + bOK = bOK AND oTable.getCellByPosition(0, 2).String = cObjectName & " 2" + Test.MethodTested("insertByIndex()", bOK) + + Test.StartMethod("removeByIndex()") + bOK = true + oObj.removeByIndex(1, 1) + bOK = bOK AND oTable.getCellByPosition(0, 0).String = cObjectName & " 1" + bOK = bOK AND oTable.getCellByPosition(0, 1).String = cObjectName & " 2" + bOK = bOK AND oTable.getCellByPosition(0, 2).String = "" + Test.MethodTested("removeByIndex()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/task/XInteractionHandler/script.xlb b/qadevOOo/tests/basic/ifc/task/XInteractionHandler/script.xlb new file mode 100644 index 000000000000..0e5931a99ef8 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/task/XInteractionHandler/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="task_XInteractionHandler" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="task_XInteractionHandler"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/task/XInteractionHandler/task_XInteractionHandler.xba b/qadevOOo/tests/basic/ifc/task/XInteractionHandler/task_XInteractionHandler.xba new file mode 100644 index 000000000000..2caad798f534 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/task/XInteractionHandler/task_XInteractionHandler.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="task_XInteractionHandler" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.task.XInteractionHandler +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim bExExpected As Boolean + + Test.StartMethod("handle()") + bOK = true + + ' This method needs an com::sun::star::task::XInteractionRequest + ' as a parameter. In BASIC we can't create own services. + ' So we can't create an instance that supports XInteractionRequest. + ' All that can be tested here is that there is no exception when + ' calling this method with NULL and that there IS an exception, + ' when calling method with wrong parameter. + + bExExpected = false + oObj.handle(NULL) + + bExExpected = true + oObj.handle(oObj) + + Test.MethodTested("handle()", bOK) + +Exit Sub +ErrHndl: + if (bExExpected) then + Out.Log("EXPECTED EXCEPTION. " & error) + else + Test.Exception() + bOK = false + end if + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/task/XJob/script.xlb b/qadevOOo/tests/basic/ifc/task/XJob/script.xlb new file mode 100644 index 000000000000..2d25220b6ee4 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/task/XJob/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="task_XJob" library:readonly="false" library:passwordprotected="false"> + <library:element library:name="task_XJob"/> + </library:library> diff --git a/qadevOOo/tests/basic/ifc/task/XJob/task_XJob.xba b/qadevOOo/tests/basic/ifc/task/XJob/task_XJob.xba new file mode 100644 index 000000000000..8461cbeb6bdc --- /dev/null +++ b/qadevOOo/tests/basic/ifc/task/XJob/task_XJob.xba @@ -0,0 +1,88 @@ +<?xml version="1.0" encoding="UTF-8"?> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="task_XJob" 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. +' +'************************************************************************* +'************************************************************************* + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' Global vXJobArgs(0 to n) as Variant +' Example: +' Dim vXJobArg0(0 to 0) as new com.sun.star.beans.NamedValue +' Dim vXJobArg1(0 to 0) as new com.sun.star.beans.NamedValue +' vXJobArgs0(0).Name = "MyProperty": vXJobArg0(0).Vaue = "MyValue" +' vXJobArgs1(0).Name = "MyProperty": vXJobArg0(0).Vaue = "My2ndValue" +' vXJobArgs(0) = vXJobArg0() +' vXJobArgs(1) = vXJobArg1() + + +'************************************************************************* + + +' Be sure that all variables are dimensioned: +option explicit + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.task.XJob +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim bRun as Boolean + Dim n as Integer + + out.dbg("Start tests of com.sun.star.task.XJob #########") + ReCreateObj() + + Test.StartMethod("execute()") + + bOK = TRUE + for n = 0 to uBound(vXJobArgs()) + bRun = FALSE + out.dbg("running vXJobArgs(" + n + ")") + bRun = oObj.execute(vXJobArgs(n)) + bOK = bOK AND bRun + out.dbg("Result: " + bRun) + next n + Test.MethodTested("execute()", bOK) + + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/task/XStatusIndicatorFactory/script.xlb b/qadevOOo/tests/basic/ifc/task/XStatusIndicatorFactory/script.xlb new file mode 100644 index 000000000000..782ede80daa4 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/task/XStatusIndicatorFactory/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="task_XStatusIndicatorFactory" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="task_XStatusIndicatorFactory"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/task/XStatusIndicatorFactory/task_XStatusIndicatorFactory.xba b/qadevOOo/tests/basic/ifc/task/XStatusIndicatorFactory/task_XStatusIndicatorFactory.xba new file mode 100644 index 000000000000..b9094a0e9f10 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/task/XStatusIndicatorFactory/task_XStatusIndicatorFactory.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="task_XStatusIndicatorFactory" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.task.XStatusIndicatorFactory +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Test.StartMethod("createStatusIndicator()") + bOK = true + Dim SI1 As Object, SI2 As Object + SI1 = oObj.createStatusIndicator() + SI2 = oObj.createStatusIndicator() + 'Start all Indicators + SI1.start("Status1", 100) + SI2.start("Status2", 100) + + 'change SI2 + SI2.setText("A new name for the status") + SI2.setValue(45) + SI2.reset() + SI2.end() + + 'Now SI1 is active + SI1.end() + + bOK = Not isNull(SI1) + Test.MethodTested("createStatusIndicator()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/text/BaseFrame/script.xlb b/qadevOOo/tests/basic/ifc/text/BaseFrame/script.xlb new file mode 100644 index 000000000000..27ce09a2bb2c --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/BaseFrame/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="text_BaseFrame" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="text_BaseFrame"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/text/BaseFrame/text_BaseFrame.xba b/qadevOOo/tests/basic/ifc/text/BaseFrame/text_BaseFrame.xba new file mode 100644 index 000000000000..30f616fe44e1 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/BaseFrame/text_BaseFrame.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="text_BaseFrame" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.text.BaseFrame +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Dim FrameStyles(6) as String + FrameStyles(0) = "Formula" + FrameStyles(1) = "Graphics" + FrameStyles(2) = "Marginalia" + FrameStyles(3) = "OLE" + FrameStyles(4) = "Labels" + FrameStyles(5) = "Watermark" + FrameStyles(6) = "Frame" + PropertyTester.TestProperty("FrameStyleName", FrameStyles()) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/text/BaseFrameProperties/script.xlb b/qadevOOo/tests/basic/ifc/text/BaseFrameProperties/script.xlb new file mode 100644 index 000000000000..d19bf601e574 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/BaseFrameProperties/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="text_BaseFrameProperties" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="text_BaseFrameProperties"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/text/BaseFrameProperties/text_BaseFrameProperties.xba b/qadevOOo/tests/basic/ifc/text/BaseFrameProperties/text_BaseFrameProperties.xba new file mode 100644 index 000000000000..979432e5a5f1 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/BaseFrameProperties/text_BaseFrameProperties.xba @@ -0,0 +1,183 @@ +<?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="text_BaseFrameProperties" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.text.BaseFrameProperties +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + oObj.SizeProtected = false + + PropertyTester.TestProperty("ShadowFormat") + + Dim nPages(0 to 2) As Integer + nPages(0) = 1 + nPages(1) = 3 + nPages(2) = 1 + PropertyTester.TestProperty("AnchorPageNo",nPages()) + + PropertyTester.TestProperty("BackColor") + + PropertyTester.TestProperty("BackGraphicURL") + + PropertyTester.TestProperty("BackGraphicFilter") + + PropertyTester.TestProperty("BackGraphicLocation") + + PropertyTester.TestProperty("LeftBorder") + + PropertyTester.TestProperty("RightBorder") + + PropertyTester.TestProperty("TopBorder") + + PropertyTester.TestProperty("BottomBorder") + + PropertyTester.TestProperty("BorderDistance") + + PropertyTester.TestProperty("LeftBorderDistance") + + PropertyTester.TestProperty("RightBorderDistance") + + PropertyTester.TestProperty("TopBorderDistance") + + PropertyTester.TestProperty("BottomBorderDistance") + + PropertyTester.TestProperty("BackTransparent") + + PropertyTester.TestProperty("ContentProtected") + + PropertyTester.TestProperty("LeftMargin") + + PropertyTester.TestProperty("RightMargin") + + PropertyTester.TestProperty("TopMargin") + + PropertyTester.TestProperty("BottomMargin") + + Dim aRelative(2) As Integer + aRelative(0) = 10 + aRelative(1) = 20 + aRelative(2) = 0 + PropertyTester.TestProperty("RelativeHeight", aRelative()) + + PropertyTester.TestProperty("RelativeWidth", aRelative()) + + PropertyTester.TestProperty("Height") + + PropertyTester.TestProperty("Width") + + PropertyTester.TestProperty("IsSyncWidthToHeight") + + PropertyTester.TestProperty("IsSyncHeightToWidth") + + Dim aHoriOrient(3) As Integer + aHoriOrient(0) = com.sun.star.text.HoriOrientation.RIGHT + aHoriOrient(1) = com.sun.star.text.HoriOrientation.CENTER + aHoriOrient(2) = com.sun.star.text.HoriOrientation.LEFT + aHoriOrient(3) = com.sun.star.text.HoriOrientation.NONE + PropertyTester.TestProperty("HoriOrient", aHoriOrient()) + + PropertyTester.TestProperty("HoriOrientPosition") + + Dim aHoriRelations(3) As Integer + aHoriRelations(0) = com.sun.star.text.RelOrientation.FRAME + aHoriRelations(1) = com.sun.star.text.RelOrientation.CHAR + aHoriRelations(2) = com.sun.star.text.RelOrientation.PAGE_LEFT + aHoriRelations(3) = com.sun.star.text.RelOrientation.PAGE_RIGHT + + PropertyTester.TestProperty("HoriOrientRelation", aHoriRelations()) + + Dim aVertOrient(3) As Integer + aVertOrient(0) = com.sun.star.text.VertOrientation.TOP + aVertOrient(1) = com.sun.star.text.VertOrientation.CENTER + aVertOrient(2) = com.sun.star.text.VertOrientation.BOTTOM + aVertOrient(3) = com.sun.star.text.VertOrientation.NONE + PropertyTester.TestProperty("VertOrient", aVertOrient()) + + PropertyTester.TestProperty("VertOrientPosition", aVertOrient()) + + Dim aVertRelations(3) As Integer + aVertRelations(0) = com.sun.star.text.RelOrientation.FRAME + aVertRelations(1) = com.sun.star.text.RelOrientation.CHAR + aVertRelations(2) = com.sun.star.text.RelOrientation.PAGE_LEFT + aVertRelations(3) = com.sun.star.text.RelOrientation.PAGE_RIGHT + PropertyTester.TestProperty("VertOrientRelation", aVertRelations()) + + PropertyTester.TestProperty("HyperLinkURL") + + PropertyTester.TestProperty("HyperLinkTarget") + + PropertyTester.TestProperty("HyperLinkName") + + PropertyTester.TestProperty("Opaque") + + PropertyTester.TestProperty("PageToggle") + + PropertyTester.TestProperty("PositionProtected") + + PropertyTester.TestProperty("Print") + + PropertyTester.TestProperty("ServerMap") + + oObj.SizeProtected = false + PropertyTester.TestProperty("Size") + + PropertyTester.TestProperty("SizeProtected") + + oObj.SizeProtected = false + + PropertyTester.TestProperty("Surround") + + PropertyTester.TestProperty("SurroundAnchorOnly") + + PropertyTester.TestProperty("AnchorFrame") + + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/text/BaseIndex/script.xlb b/qadevOOo/tests/basic/ifc/text/BaseIndex/script.xlb new file mode 100644 index 000000000000..d3f4a6b1a23f --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/BaseIndex/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="text_BaseIndex" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="text_BaseIndex"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/text/BaseIndex/text_BaseIndex.xba b/qadevOOo/tests/basic/ifc/text/BaseIndex/text_BaseIndex.xba new file mode 100644 index 000000000000..92a93336bdb7 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/BaseIndex/text_BaseIndex.xba @@ -0,0 +1,102 @@ +<?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="text_BaseIndex" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.text.BaseIndex +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + PropertyTester.TestProperty("Title") + + PropertyTester.TestProperty("IsProtected") + + PropertyTester.TestProperty("ParaStyleHeading") + + PropertyTester.TestProperty("ParaStyleLevel1") + + PropertyTester.TestProperty("ParaStyleLevel2") + + PropertyTester.TestProperty("ParaStyleLevel3") + + PropertyTester.TestProperty("ParaStyleLevel4") + + PropertyTester.TestProperty("ParaStyleLevel5") + + PropertyTester.TestProperty("ParaStyleLevel6") + + PropertyTester.TestProperty("ParaStyleLevel7") + + PropertyTester.TestProperty("ParaStyleLevel8") + + PropertyTester.TestProperty("ParaStyleLevel9") + + PropertyTester.TestProperty("ParaStyleLevel10") + + PropertyTester.TestProperty("ParaStyleSeparator") + + PropertyTester.TestProperty("TextColumns") + + PropertyTester.TestProperty("BackGraphicURL") + + PropertyTester.TestProperty("BackGraphicFilter") + + PropertyTester.TestProperty("BackGraphicLocation") + + PropertyTester.TestProperty("BackTransparent") + + PropertyTester.TestProperty("LevelFormat") + + PropertyTester.TestProperty("CreateFromChapter") + + PropertyTester.TestProperty("HeaderSection") + + PropertyTester.TestProperty("ContentSection") + + PropertyTester.TestProperty("BackColor") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/text/BaseIndexMark/script.xlb b/qadevOOo/tests/basic/ifc/text/BaseIndexMark/script.xlb new file mode 100644 index 000000000000..dc54b5b8fdfb --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/BaseIndexMark/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="text_BaseIndexMark" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="text_BaseIndexMark"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/text/BaseIndexMark/text_BaseIndexMark.xba b/qadevOOo/tests/basic/ifc/text/BaseIndexMark/text_BaseIndexMark.xba new file mode 100644 index 000000000000..da934f4f49cc --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/BaseIndexMark/text_BaseIndexMark.xba @@ -0,0 +1,56 @@ +<?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="text_BaseIndexMark" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.text.BaseIndexMark +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + PropertyTester.TestProperty("AlternativeText") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/text/CellProperties/script.xlb b/qadevOOo/tests/basic/ifc/text/CellProperties/script.xlb new file mode 100644 index 000000000000..5fd5c45f6573 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/CellProperties/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="text_CellProperties" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="text_CellProperties"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/text/CellProperties/text_CellProperties.xba b/qadevOOo/tests/basic/ifc/text/CellProperties/text_CellProperties.xba new file mode 100644 index 000000000000..8d05e4b56b24 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/CellProperties/text_CellProperties.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="text_CellProperties" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.text.CellProperties +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + PropertyTester.TestProperty("BackColor") + + PropertyTester.TestProperty("BackGraphicURL") + + PropertyTester.TestProperty("BackGraphicFilter") + + PropertyTester.TestProperty("BackGraphicLocation") + + PropertyTester.TestProperty("NumberFormat") + + PropertyTester.TestProperty("BackTransparent") + + PropertyTester.TestProperty("LeftBorder") + + PropertyTester.TestProperty("RightBorder") + + PropertyTester.TestProperty("TopBorder") + + PropertyTester.TestProperty("BottomBorder") + + PropertyTester.TestProperty("LeftBorderDistance") + + PropertyTester.TestProperty("RightBorderDistance") + + PropertyTester.TestProperty("TopBorderDistance") + + PropertyTester.TestProperty("BottomBorderDistance") + + PropertyTester.TestProperty("UserDefinedAttributes") + + PropertyTester.TestProperty("TextSection") + + Dim myParams(2) As Boolean + myParams(0) = true + myParams(1) = false + myParams(1) = false + PropertyTester.TestProperty("IsProtected", myParams()) + + PropertyTester.TestProperty("CellName") + + + Dim orient(9) as Integer + orient(0) = com.sun.star.text.VertOrientation.NONE + orient(1) = com.sun.star.text.VertOrientation.TOP + orient(2) = com.sun.star.text.VertOrientation.CENTER + orient(3) = com.sun.star.text.VertOrientation.BOTTOM + orient(4) = com.sun.star.text.VertOrientation.CHAR_TOP + orient(5) = com.sun.star.text.VertOrientation.CHAR_CENTER + orient(6) = com.sun.star.text.VertOrientation.CHAR_BOTTOM + orient(7) = com.sun.star.text.VertOrientation.LINE_TOP + orient(8) = com.sun.star.text.VertOrientation.LINE_CENTER + orient(9) = com.sun.star.text.VertOrientation.LINE_BOTTOM + + PropertyTester.TestProperty("VertOrient", orient()) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/text/CellRange/script.xlb b/qadevOOo/tests/basic/ifc/text/CellRange/script.xlb new file mode 100644 index 000000000000..59e6c295861d --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/CellRange/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="text_CellRange" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="text_CellRange"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/text/CellRange/text_CellRange.xba b/qadevOOo/tests/basic/ifc/text/CellRange/text_CellRange.xba new file mode 100644 index 000000000000..63a3e78e1975 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/CellRange/text_CellRange.xba @@ -0,0 +1,74 @@ +<?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="text_CellRange" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.text.CellRange +'************************************************************************* +On Error Goto ErrHndl + + PropertyTester.TestProperty("BackColor") + + PropertyTester.TestProperty("BackGraphicFilter") + + PropertyTester.TestProperty("BackGraphicLocation") + + PropertyTester.TestProperty("BackGraphicURL") + + PropertyTester.TestProperty("BackTransparent") + + PropertyTester.TestProperty("ChartColumnAsLabel") + + PropertyTester.TestProperty("ChartRowAsLabel") + + PropertyTester.TestProperty("NumberFormat") + + PropertyTester.TestProperty("TopMargin") + + PropertyTester.TestProperty("BottomMargin") + +Exit Sub +ErrHndl: + Test.Exception() + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/text/Defaults/script.xlb b/qadevOOo/tests/basic/ifc/text/Defaults/script.xlb new file mode 100644 index 000000000000..6b41f6d1336a --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/Defaults/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="text_Defaults" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="text_Defaults"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/text/Defaults/text_Defaults.xba b/qadevOOo/tests/basic/ifc/text/Defaults/text_Defaults.xba new file mode 100644 index 000000000000..0c7bcf3c2c82 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/Defaults/text_Defaults.xba @@ -0,0 +1,56 @@ +<?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="text_Defaults" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.text.Defaults +'************************************************************************* +On Error Goto ErrHndl + + PropertyTester.TestProperty("TabStopDistance") + +Exit Sub +ErrHndl: + Test.Exception() + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/text/DocumentIndex/script.xlb b/qadevOOo/tests/basic/ifc/text/DocumentIndex/script.xlb new file mode 100644 index 000000000000..387227462568 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/DocumentIndex/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="text_DocumentIndex" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="text_DocumentIndex"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/text/DocumentIndex/text_DocumentIndex.xba b/qadevOOo/tests/basic/ifc/text/DocumentIndex/text_DocumentIndex.xba new file mode 100644 index 000000000000..e0578779377d --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/DocumentIndex/text_DocumentIndex.xba @@ -0,0 +1,66 @@ +<?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="text_DocumentIndex" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.text.DocumentIndex +'************************************************************************* +On Error Goto ErrHndl + + PropertyTester.TestProperty("UseAlphabeticalSeparators") + PropertyTester.TestProperty("UseKeyAsEntry") + PropertyTester.TestProperty("UseCombinedEntries") + PropertyTester.TestProperty("IsCaseSensitive") + PropertyTester.TestProperty("UsePP") + PropertyTester.TestProperty("UseDash") + PropertyTester.TestProperty("UseUpperCase") + PropertyTester.TestProperty("MainEntryCharacterStyleName") + PropertyTester.TestProperty("DocumentIndexMarks") + PropertyTester.TestProperty("Locale") + PropertyTester.TestProperty("SortAlgorithm") + +Exit Sub +ErrHndl: + Test.Exception() + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/text/DocumentIndexMark/script.xlb b/qadevOOo/tests/basic/ifc/text/DocumentIndexMark/script.xlb new file mode 100644 index 000000000000..46a08a71d963 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/DocumentIndexMark/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="text_DocumentIndexMark" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="text_DocumentIndexMark"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/text/DocumentIndexMark/text_DocumentIndexMark.xba b/qadevOOo/tests/basic/ifc/text/DocumentIndexMark/text_DocumentIndexMark.xba new file mode 100644 index 000000000000..db7e459465dd --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/DocumentIndexMark/text_DocumentIndexMark.xba @@ -0,0 +1,60 @@ +<?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="text_DocumentIndexMark" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.text.DocumentIndexMark +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + PropertyTester.TestProperty("PrimaryKey") + + PropertyTester.TestProperty("SecondaryKey") + + PropertyTester.TestProperty("IsMainEntry") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/text/Footnote/script.xlb b/qadevOOo/tests/basic/ifc/text/Footnote/script.xlb new file mode 100644 index 000000000000..d0a6ba452943 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/Footnote/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="text_Footnote" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="text_Footnote"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/text/Footnote/text_Footnote.xba b/qadevOOo/tests/basic/ifc/text/Footnote/text_Footnote.xba new file mode 100644 index 000000000000..12dd74714f6e --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/Footnote/text_Footnote.xba @@ -0,0 +1,56 @@ +<?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="text_Footnote" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.text.Footnote +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + PropertyTester.TestProperty("ReferenceId") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/text/FootnoteSettings/script.xlb b/qadevOOo/tests/basic/ifc/text/FootnoteSettings/script.xlb new file mode 100644 index 000000000000..552949b4a5ff --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/FootnoteSettings/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="text_FootnoteSettings" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="text_FootnoteSettings"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/text/FootnoteSettings/text_FootnoteSettings.xba b/qadevOOo/tests/basic/ifc/text/FootnoteSettings/text_FootnoteSettings.xba new file mode 100644 index 000000000000..2645f19b2808 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/FootnoteSettings/text_FootnoteSettings.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="text_FootnoteSettings" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.text.FootnoteSettings +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + Dim aSymbolArr(1) As String + aSymbolArr(0) = "Footnote Symbol" + aSymbolArr(1) = "Endnote Symbol" + PropertyTester.TestProperty("CharStyleName",aSymbolArr()) + + PropertyTester.TestProperty("NumberingType") + + Dim aPageStyles(0 to 2) As String + aPageStyles(0) = "HTML" + aPageStyles(1) = "Index" + aPageStyles(2) = "Endnote" + PropertyTester.TestProperty("PageStyleName",aPageStyles()) + + Dim aParaStyles(0 to 2) As String + aParaStyles(0) = "Heading" + aParaStyles(1) = "Signature" + aParaStyles(2) = "Standard" + PropertyTester.TestProperty("ParaStyleName",aParaStyles()) + + PropertyTester.TestProperty("Prefix") + + PropertyTester.TestProperty("StartAt") + + PropertyTester.TestProperty("Suffix") + + PropertyTester.TestProperty("BeginNotice") + + PropertyTester.TestProperty("EndNotice") + + Dim aCounting(0 to 1) As Integer + aCounting(0) = 1 + aCounting(1) = 2 + PropertyTester.TestProperty("FootnoteCounting",aCounting()) + + PropertyTester.TestProperty("PositionEndOfDoc") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/text/LineNumberingProperties/script.xlb b/qadevOOo/tests/basic/ifc/text/LineNumberingProperties/script.xlb new file mode 100644 index 000000000000..23e31fcc63f6 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/LineNumberingProperties/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="text_LineNumberingProperties" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="text_LineNumberingProperties"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/text/LineNumberingProperties/text_LineNumberingProperties.xba b/qadevOOo/tests/basic/ifc/text/LineNumberingProperties/text_LineNumberingProperties.xba new file mode 100644 index 000000000000..14e1bca8b5cf --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/LineNumberingProperties/text_LineNumberingProperties.xba @@ -0,0 +1,80 @@ +<?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="text_LineNumberingProperties" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.text.LineNumberingProperties +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + PropertyTester.TestProperty("IsOn") + + Dim aNames(1) As String + aNames(0) = "Endnote anchor" + aNames(1) = "Endnote Symbol" + PropertyTester.TestProperty("CharStyleName", aNames()) + + PropertyTester.TestProperty("CountEmptyLines") + + PropertyTester.TestProperty("CountLinesInFrames") + + PropertyTester.TestProperty("Distance") + + PropertyTester.TestProperty("Interval") + + PropertyTester.TestProperty("SeparatorText") + + PropertyTester.TestProperty("SeparatorInterval") + + Dim aPositions(1) As Integer + aPositions(0) = 1 + aPositions(1) = 0 + PropertyTester.TestProperty("NumberPosition", aPositions()) + + PropertyTester.TestProperty("NumberingType") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/text/MailMerge/script.xlb b/qadevOOo/tests/basic/ifc/text/MailMerge/script.xlb new file mode 100644 index 000000000000..8ea1d96356a7 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/MailMerge/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="text_MailMerge" library:readonly="false" library:passwordprotected="false"> + <library:element library:name="text_MailMerge"/> + </library:library> diff --git a/qadevOOo/tests/basic/ifc/text/MailMerge/text_MailMerge.xba b/qadevOOo/tests/basic/ifc/text/MailMerge/text_MailMerge.xba new file mode 100644 index 000000000000..aa267aa9ff37 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/MailMerge/text_MailMerge.xba @@ -0,0 +1,94 @@ +<?xml version="1.0" encoding="UTF-8"?> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="text_MailMerge" 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. +' +'************************************************************************* +'************************************************************************* + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' Global cMailMerge_DocumentURL as String +' cMailMerge_DocumentURL must be a valid Document URL + +'************************************************************************* + +' Be sure that all variables are dimensioned: +option explicit + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.text.MailMerge +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + PropertyTester.TestProperty("DataSourceName") + + Dim DataCommandTypes(2) as Integer + DataCommandTypes(0) = com.sun.star.sdb.CommandType.TABLE + DataCommandTypes(1) = com.sun.star.sdb.CommandType.QUERY + DataCommandTypes(2) = com.sun.star.sdb.CommandType.COMMAND + PropertyTester.TestProperty("CommandType", DataCommandTypes()) + + PropertyTester.TestProperty("Command") + + PropertyTester.TestProperty("ResultSet") + + PropertyTester.TestProperty("ActiveConnection") + + PropertyTester.TestProperty("Selection", Array(Array(2,4), Array(1,3))) + + PropertyTester.TestProperty("EscapeProcessing", ) + + PropertyTester.TestProperty("Filter") + + PropertyTester.TestProperty("DocumentURL", Array(cMailMerge_DocumentURL)) + + PropertyTester.TestProperty("Model") + + PropertyTester.TestProperty("OutputType") + + PropertyTester.TestProperty("SinglePrintJobs") + + PropertyTester.TestProperty("OutputURL", Array(ConvertToURL(utils.getUserPath()))) + + PropertyTester.TestProperty("FileNameFromColumn") + + PropertyTester.TestProperty("FileNamePrefix") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub + +</script:module> diff --git a/qadevOOo/tests/basic/ifc/text/NumberingRules/script.xlb b/qadevOOo/tests/basic/ifc/text/NumberingRules/script.xlb new file mode 100644 index 000000000000..fdd8280545eb --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/NumberingRules/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="text_NumberingRules" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="text_NumberingRules"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/text/NumberingRules/text_NumberingRules.xba b/qadevOOo/tests/basic/ifc/text/NumberingRules/text_NumberingRules.xba new file mode 100644 index 000000000000..d46f53eb6c1c --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/NumberingRules/text_NumberingRules.xba @@ -0,0 +1,62 @@ +<?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="text_NumberingRules" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.text.NumberingRules +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + PropertyTester.TestProperty("IsAbsoluteMargins") + + PropertyTester.TestProperty("IsAutomatic") + + PropertyTester.TestProperty("IsContinuousNumbering") + + PropertyTester.TestProperty("Name") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/text/PrintSettings/script.xlb b/qadevOOo/tests/basic/ifc/text/PrintSettings/script.xlb new file mode 100644 index 000000000000..9e9b673d4c3e --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/PrintSettings/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="text_PrintSettings" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="text_PrintSettings"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/text/PrintSettings/text_PrintSettings.xba b/qadevOOo/tests/basic/ifc/text/PrintSettings/text_PrintSettings.xba new file mode 100644 index 000000000000..e1519cee1e19 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/PrintSettings/text_PrintSettings.xba @@ -0,0 +1,83 @@ +<?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="text_PrintSettings" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.text.PrintSettings +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + PropertyTester.TestProperty("PrintGraphics") + + PropertyTester.TestProperty("PrintTables") + + PropertyTester.TestProperty("PrintDrawings") + + PropertyTester.TestProperty("PrintLeftPages") + + PropertyTester.TestProperty("PrintRightPages") + + PropertyTester.TestProperty("PrintControls") + + PropertyTester.TestProperty("PrintReversed") + + PropertyTester.TestProperty("PrintPaperFromSetup") + + PropertyTester.TestProperty("PrintFaxName") + + PropertyTester.TestProperty("PrintAnnotationMode", Array( _ + com.sun.star.text.NotePrintMode.NOT, _ + com.sun.star.text.NotePrintMode.ONLY, _ + com.sun.star.text.NotePrintMode.DOC_END, _ + com.sun.star.text.NotePrintMode.PAGE_END)) + + PropertyTester.TestProperty("PrintProspect") + + PropertyTester.TestProperty("PrintPageBackground") + + PropertyTester.TestProperty("PrintBlackFonts") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/text/Text/script.xlb b/qadevOOo/tests/basic/ifc/text/Text/script.xlb new file mode 100644 index 000000000000..e86fce1e13bd --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/Text/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="text_Text" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="text_Text"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/text/Text/text_Text.xba b/qadevOOo/tests/basic/ifc/text/Text/text_Text.xba new file mode 100644 index 000000000000..68ab507293ae --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/Text/text_Text.xba @@ -0,0 +1,56 @@ +<?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="text_Text" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.text.Text +'************************************************************************* +On Error Goto ErrHndl + + PropertyTester.TestProperty("StartRedline") + + PropertyTester.TestProperty("EndRedline") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/text/TextColumns/script.xlb b/qadevOOo/tests/basic/ifc/text/TextColumns/script.xlb new file mode 100644 index 000000000000..c8aeed8326d5 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/TextColumns/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="text_TextColumns" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="text_TextColumns"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/text/TextColumns/text_TextColumns.xba b/qadevOOo/tests/basic/ifc/text/TextColumns/text_TextColumns.xba new file mode 100644 index 000000000000..e3545193e66e --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/TextColumns/text_TextColumns.xba @@ -0,0 +1,75 @@ +<?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="text_TextColumns" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.text.TextColumns +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + PropertyTester.TestProperty("IsAutomatic") + + Test.StartMethod("AutomaticDistance") + bOK = true + if (oObj.IsAutomatic) then + bOK = PropertyTester.TestProperty("AutomaticDistance") + else + Out.Log("AutomaticDistance is available ONLY if IsAutomatic is TRUE. " & _ + "But it is FALSE.") + end if + + Test.MethodTested("AutomaticDistance", bOK) + + PropertyTester.TestProperty("SeparatorLineWidth") + PropertyTester.TestProperty("SeparatorLineColor") + + Dim aHeights(1) As Integer + aHeights(0) = 10 + aHeights(1) = 50 + PropertyTester.TestProperty("SeparatorLineRelativeHeight", aHeights()) + PropertyTester.TestProperty("SeparatorLineVerticalAlignment") + PropertyTester.TestProperty("SeparatorLineIsOn") + +Exit Sub +ErrHndl: + bOK = false + Test.Exception() + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/text/TextContent/script.xlb b/qadevOOo/tests/basic/ifc/text/TextContent/script.xlb new file mode 100644 index 000000000000..a28ef0745bf4 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/TextContent/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="text_TextContent" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="text_TextContent"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/text/TextContent/text_TextContent.xba b/qadevOOo/tests/basic/ifc/text/TextContent/text_TextContent.xba new file mode 100644 index 000000000000..624a61579033 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/TextContent/text_TextContent.xba @@ -0,0 +1,78 @@ +<?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="text_TextContent" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.text.TextContent +'************************************************************************* +On Error Goto ErrHndl + Dim noElems() + Dim count,i,j As Integer + + j = 0 + if (oObj.getPropertySetInfo.hasPropertyByName("AnchorTypes")) then + count = ubound(oObj.AnchorTypes()) + if (count <> 0) then + Dim aTypes(count-1) As Variant + for i = 0 to (count) + if oObj.AnchorTypes(i) <> _ + com.sun.star.text.TextContentAnchorType.AT_FRAME then + aTypes(j) = oObj.AnchorTypes(i) + j = j + 1 + endif + next i + PropertyTester.TestProperty("AnchorType",aTypes()) + else + PropertyTester.TestProperty("AnchorType") + endif + else + PropertyTester.TestProperty("AnchorType") + endif + + PropertyTester.TestProperty("AnchorTypes", noElems()) + PropertyTester.TestProperty("TextWrap") +Exit Sub +ErrHndl: + Test.Exception() + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/text/TextDocument/script.xlb b/qadevOOo/tests/basic/ifc/text/TextDocument/script.xlb new file mode 100644 index 000000000000..852fc6355d18 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/TextDocument/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="text_TextDocument" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="text_TextDocument"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/text/TextDocument/text_TextDocument.xba b/qadevOOo/tests/basic/ifc/text/TextDocument/text_TextDocument.xba new file mode 100644 index 000000000000..3a6afbc69419 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/TextDocument/text_TextDocument.xba @@ -0,0 +1,70 @@ +<?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="text_TextDocument" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.text.TextDocument +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + PropertyTester.TestProperty("CharLocale") + + PropertyTester.TestProperty("CharacterCount") + + PropertyTester.TestProperty("ParagraphCount") + + PropertyTester.TestProperty("WordCount") + + PropertyTester.TestProperty("WordSeparator") + + PropertyTester.TestProperty("IndexAutoMarkFileURL") + + PropertyTester.TestProperty("RecordChanges") + + PropertyTester.TestProperty("TwoDigitYear") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/text/TextFieldMaster/script.xlb b/qadevOOo/tests/basic/ifc/text/TextFieldMaster/script.xlb new file mode 100644 index 000000000000..a9998b0a93f9 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/TextFieldMaster/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="text_TextFieldMaster" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="text_TextFieldMaster"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/text/TextFieldMaster/text_TextFieldMaster.xba b/qadevOOo/tests/basic/ifc/text/TextFieldMaster/text_TextFieldMaster.xba new file mode 100644 index 000000000000..8355f71faa2a --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/TextFieldMaster/text_TextFieldMaster.xba @@ -0,0 +1,57 @@ +<?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="text_TextFieldMaster" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.text.TextFieldMaster +'************************************************************************* +On Error Goto ErrHndl + + PropertyTester.TestProperty("Name") + + PropertyTester.TestProperty("DependentTextFields") + + PropertyTester.TestProperty("InstanceName") + +Exit Sub +ErrHndl: + Test.Exception() + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/text/TextFrame/script.xlb b/qadevOOo/tests/basic/ifc/text/TextFrame/script.xlb new file mode 100644 index 000000000000..658d59486b38 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/TextFrame/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="text_TextFrame" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="text_TextFrame"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/text/TextFrame/text_TextFrame.xba b/qadevOOo/tests/basic/ifc/text/TextFrame/text_TextFrame.xba new file mode 100644 index 000000000000..c634160d7905 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/TextFrame/text_TextFrame.xba @@ -0,0 +1,75 @@ +<?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="text_TextFrame" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.text.TextFrame +'************************************************************************* +On Error Goto ErrHndl + oObj.SizeType = com.sun.star.text.SizeType.VARIABLE + PropertyTester.TestProperty("FrameHeightAbsolute") + + PropertyTester.TestProperty("FrameWidthAbsolute") + + Dim aPercents(2) As Integer + aPercents(0) = 25 + aPercents(1) = 50 + aPercents(2) = 100 + PropertyTester.TestProperty("FrameWidthPercent", aPercents()) + PropertyTester.TestProperty("FrameHeightPercent", aPercents()) + + PropertyTester.TestProperty("FrameIsAutomaticHeight") + + Dim SizeTypes(2) As Integer + SizeTypes(0) = com.sun.star.text.SizeType.VARIABLE + SizeTypes(1) = com.sun.star.text.SizeType.FIX + SizeTypes(2) = com.sun.star.text.SizeType.MIN + PropertyTester.TestProperty("SizeType",SizeTypes()) + + PropertyTester.TestProperty("WritingMode", Array(3)) + +Exit Sub +ErrHndl: + Test.Exception() + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/text/TextGraphicObject/script.xlb b/qadevOOo/tests/basic/ifc/text/TextGraphicObject/script.xlb new file mode 100644 index 000000000000..0c52b82b2a91 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/TextGraphicObject/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="text_TextGraphicObject" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="text_TextGraphicObject"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/text/TextGraphicObject/text_TextGraphicObject.xba b/qadevOOo/tests/basic/ifc/text/TextGraphicObject/text_TextGraphicObject.xba new file mode 100644 index 000000000000..5dec209a0251 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/TextGraphicObject/text_TextGraphicObject.xba @@ -0,0 +1,207 @@ +<?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="text_TextGraphicObject" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.text.TextGraphicObject +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + PropertyTester.TestProperty("ContentProtected") + + PropertyTester.TestProperty("SurroundContour") + + PropertyTester.TestProperty("ContourOutside") + + Test.StartMethod("ContourPolyPolygon") + ' Because in additional parameters we must to + ' pass an array of values, we need such array. + Dim aPParr1(1) As Variant + Dim aPol1(3) As new com.sun.star.awt.Point + Dim gArr As Variant + + bOK = true + aPol1(0).x = 0 : aPol1(0).y = 0 + aPol1(1).x = 101 : aPol1(1).y = 0 + aPol1(2).x = 101 : aPol1(2).y = 101 + aPol1(3).x = 0 : aPol1(3).y = 101 + Dim aPol2(3) As new com.sun.star.awt.Point + aPol2(0).x = 11 : aPol2(0).y = 11 + aPol2(1).x = 90 : aPol2(1).y = 11 + aPol2(2).x = 90 : aPol2(2).y = 90 + aPol2(3).x = 11 : aPol2(3).y = 90 + aPParr1(0) = aPol1() : aPParr1(1) = aPol2() + oObj.setPropertyValue("ContourPolyPolygon", aPParr1()) + gArr = oObj.getPropertyValue("ContourPolyPolygon") + + if isArray(gArr) AND ubound(gArr) >= 1 then + Dim aP1 As Variant, aP2 As Variant + + aP1 = gArr(0) + aP2 = gArr(1) + bOK = bOK AND comparePointArrays(aPol1(), aP1, 0, 0, 4) + bOK = bOK AND comparePointArrays(aPol2(), aP2, 0, 0, 4) + + ' One more point must be added to close the polygon + bOK = bOK AND comparePointArrays(aPol1(), aP1, 0, 4, 1) + bOK = bOK AND comparePointArrays(aPol2(), aP2, 0, 4, 1) + else + Out.Log("Returned value is invalid") + Out.Log = false + endif + + Test.MethodTested("ContourPolyPolygon", bOK) + +' PropertyTester.TestProperty("ContourPolyPolygon",testArr()) + + Dim aCropArr(1) As Variant + Dim Crop1 As Object + Dim Crop2 As Object + + Crop1 = createUnoStruct("com.sun.star.text.GraphicCrop") + Crop2 = createUnoStruct("com.sun.star.text.GraphicCrop") + + Crop1.Top = 11 : Crop1.Bottom = 11 : Crop1.Left = 11 : Crop1.Right = 11 + Crop2.Top = -11 : Crop2.Bottom = 11 : Crop2.Left = -11 : Crop2.Right = 11 + + aCropArr(0) = Crop1 : aCropArr(1) = Crop2 + PropertyTester.TestProperty("GraphicCrop",aCropArr()) + + PropertyTester.TestProperty("HoriMirroredOnEvenPages") + + PropertyTester.TestProperty("HoriMirroredOnOddPages") + + PropertyTester.TestProperty("VertMirrored") + + PropertyTester.TestProperty("GraphicURL") + + PropertyTester.TestProperty("GraphicFilter") + + PropertyTester.TestProperty("ActualSize") + + Dim oAdjustArr(4) As Integer + oAdjustArr(0) = -100 + oAdjustArr(1) = -50 + oAdjustArr(2) = 0 + oAdjustArr(3) = 50 + oAdjustArr(4) = 100 + + PropertyTester.TestProperty("AdjustLuminance",oAdjustArr()) + + PropertyTester.TestProperty("AdjustContrast",oAdjustArr()) + + PropertyTester.TestProperty("AdjustRed",oAdjustArr()) + + PropertyTester.TestProperty("AdjustGreen",oAdjustArr()) + + PropertyTester.TestProperty("AdjustBlue",oAdjustArr()) + + PropertyTester.TestProperty("Gamma",oAdjustArr()) + + PropertyTester.TestProperty("GraphicIsInverted") + + PropertyTester.TestProperty("Transparency",oAdjustArr()) + + PropertyTester.TestProperty("GraphicColorMode") + + PropertyTester.TestProperty("ImageMap") + + PropertyTester.TestProperty("ActualSize") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub + +Function comparePointArrays(arr1 As Variant, arr2 As Variant, fromIdx1 As Integer, fromIdx2 As Integer, count As Integer) As Boolean +On Error Goto ErrHndl + Dim bOK As Boolean + Dim i As Integer + + if NOT isArray(arr1) then + Out.Log("First parameter is not Array.") + comparePointArrays() = false + exit Function + endif + + if NOT isArray(arr2) then + Out.Log("Second parameter is not Array.") + comparePointArrays() = false + exit Function + endif + + if (lbound(arr1) > fromIdx1 OR ubound(arr1) < (fromIdx1 + count - 1)) then + Out.Log("Invalid bounds of the first array") + comparePointArrays() = false + exit Function + endif + if (lbound(arr2) > fromIdx2 OR ubound(arr2) < (fromIdx2 + count - 1)) then + Out.Log("Invalid bounds of the second array") + comparePointArrays() = false + exit Function + endif + + bOK = true + for i = 0 to count - 1 + if arr1(fromIdx1 + i).x <> arr2(fromIdx2 + i).x OR _ + arr1(fromIdx1 + i).y <> arr2(fromIdx2 + i).y then + + Out.Log("Points #" + i + " are different : (" + _ + arr1(fromIdx1 + i).x + "," + arr1(fromIdx1 + i).y + "), (" + _ + arr2(fromIdx2 + i).x + "," + arr2(fromIdx2 + i).y + ")." + + bOK = false + end if + next i + + comparePointArrays() = bOK + + exit Function +ErrHndl: + Test.Exception() + comparePointArrays() = false +End Function +</script:module> diff --git a/qadevOOo/tests/basic/ifc/text/TextPortion/script.xlb b/qadevOOo/tests/basic/ifc/text/TextPortion/script.xlb new file mode 100644 index 000000000000..0aefd8463cfc --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/TextPortion/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="text_TextPortion" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="text_TextPortion"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/text/TextPortion/text_TextPortion.xba b/qadevOOo/tests/basic/ifc/text/TextPortion/text_TextPortion.xba new file mode 100644 index 000000000000..a88541f59c4c --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/TextPortion/text_TextPortion.xba @@ -0,0 +1,66 @@ +<?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="text_TextPortion" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.text.TextPortion +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + PropertyTester.TestProperty("TextPortionType") + + PropertyTester.TestProperty("ControlCharacter") + + +' + PropertyTester.TestProperty("Bookmark") + + PropertyTester.TestProperty("IsCollapsed") + + PropertyTester.TestProperty("IsStart") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/text/TextSection/script.xlb b/qadevOOo/tests/basic/ifc/text/TextSection/script.xlb new file mode 100644 index 000000000000..649b8eee5e98 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/TextSection/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="text_TextSection" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="text_TextSection"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/text/TextSection/text_TextSection.xba b/qadevOOo/tests/basic/ifc/text/TextSection/text_TextSection.xba new file mode 100644 index 000000000000..bd7f21d3de53 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/TextSection/text_TextSection.xba @@ -0,0 +1,139 @@ +<?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="text_TextSection" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.text.TextSection +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + PropertyTester.TestProperty("Condition") + + PropertyTester.TestProperty("IsVisible") + + PropertyTester.TestProperty("IsProtected") + + Dim link As New com.sun.star.text.SectionFileLink + link.FileURL = utils.Path2URL(cTestDocsDir + "Iterator.sxw") + + PropertyTester.TestProperty("FileLink", Array(link)) + + PropertyTester.TestProperty("LinkRegion") + + PropertyTester.TestProperty("DDECommandType") + + PropertyTester.TestProperty("DDECommandFile") + + PropertyTester.TestProperty("DDECommandElement") + + PropertyTester.TestProperty("BackGraphicURL") + + PropertyTester.TestProperty("BackGraphicFilter") + + PropertyTester.TestProperty("BackGraphicLocation") + + PropertyTester.TestProperty("FootnoteIsCollectAtTextEnd") + + PropertyTester.TestProperty("FootnoteIsRestartNumbering") + + PropertyTester.TestProperty("FootnoteRestartNumberingAt") + + PropertyTester.TestProperty("FootnoteIsOwnNumbering") + + oObj.FootnoteIsOwnNumbering = true + oObj.FootnoteNumberingType = 1 + PropertyTester.TestProperty("FootnoteNumberingType", Array(com.sun.star.style.NumberingType.ARABIC)) + + PropertyTester.TestProperty("FootnoteNumberingPrefix") + + PropertyTester.TestProperty("FootnoteNumberingSuffix") + + PropertyTester.TestProperty("EndnoteIsCollectAtTextEnd") + + PropertyTester.TestProperty("EndnoteIsRestartNumbering") + + PropertyTester.TestProperty("EndnoteRestartNumberingAt") + + PropertyTester.TestProperty("EndnoteIsOwnNumbering") + + oObj.EndnoteIsOwnNumbering = true + oObj.EndnoteNumberingType = 1 + PropertyTester.TestProperty("EndnoteNumberingType", Array(com.sun.star.style.NumberingType.ARABIC)) + + PropertyTester.TestProperty("EndnoteNumberingPrefix") + + PropertyTester.TestProperty("EndnoteNumberingSuffix") + + PropertyTester.TestProperty("IsAutomaticUpdate") + + Test.StartMethod("TextColumns") + Dim oTC As Variant + Dim oldVal, newVal, val2set As Integer + oTC = oDoc.createInstance("com.sun.star.text.TextColumns") + oldVal = oObj.TextColumns.ColumnCount + Out.Log("COLUMNS BEFORE: "+oldVal) + if (oldVal < 100) then + val2set = oldVal + 20 + else + val2set = oldVal - 20 + Endif + Out.Log("COLUMNS TO SET: "+val2set) + oTC.ColumnCount = val2set + oObj.TextColumns = oTC + newVal = oObj.TextColumns.ColumnCount + Out.Log("COLUMNS AFTER: "+newVal) + bOK = oldVal <> newVal + Test.MethodTested("TextColumns", bOK) + + PropertyTester.TestProperty("SectionLeftMargin") + + PropertyTester.TestProperty("SectionRightMargin") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/text/TextTable/script.xlb b/qadevOOo/tests/basic/ifc/text/TextTable/script.xlb new file mode 100644 index 000000000000..e7e7a0ab6ce4 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/TextTable/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="text_TextTable" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="text_TextTable"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/text/TextTable/text_TextTable.xba b/qadevOOo/tests/basic/ifc/text/TextTable/text_TextTable.xba new file mode 100644 index 000000000000..96432c262f90 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/TextTable/text_TextTable.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="text_TextTable" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.text.TextTable +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim border As Variant + Dim oldVal As Variant, newVal As Variant, getVal As Variant + + + PropertyTester.TestProperty("BreakType") + + PropertyTester.TestProperty("LeftMargin") + + PropertyTester.TestProperty("RightMargin") + + PropertyTester.TestProperty("HoriOrient", Array( _ + com.sun.star.text.HoriOrientation.NONE, _ + com.sun.star.text.HoriOrientation.RIGHT, _ + com.sun.star.text.HoriOrientation.CENTER, _ + com.sun.star.text.HoriOrientation.LEFT, _ + com.sun.star.text.HoriOrientation.INSIDE, _ + com.sun.star.text.HoriOrientation.OUTSIDE, _ + com.sun.star.text.HoriOrientation.FULL, _ + com.sun.star.text.HoriOrientation.LEFT_AND_WIDTH)) + + PropertyTester.TestProperty("KeepTogether") + + PropertyTester.TestProperty("Split") + + PropertyTester.TestProperty("PageNumberOffset", Array(1, 2)) + + PropertyTester.TestProperty("PageDescName", Array("First Page")) + + PropertyTester.TestProperty("RelativeWidth", Array(50, 100)) + + PropertyTester.TestProperty("RepeatHeadline") + + PropertyTester.TestProperty("ShadowFormat") + + PropertyTester.TestProperty("TopMargin") + + PropertyTester.TestProperty("BottomMargin") + + PropertyTester.TestProperty("BackTransparent") + + PropertyTester.TestProperty("Width") + + oldVal = oObj.ChartRowAsLabel + PropertyTester.TestProperty("ChartRowAsLabel") + oObj.ChartRowAsLabel = oldVal + + oldVal = oObj.ChartColumnAsLabel + PropertyTester.TestProperty("ChartColumnAsLabel") + oObj.ChartColumnAsLabel = oldVal + + border = oObj.TableBorder + oldVal = border.Distance + newVal = oldVal + 200 + border.Distance = newVal + + PropertyTester.TestProperty("TableBorder", Array(border)) + + PropertyTester.TestProperty("TableColumnSeparators") + + PropertyTester.TestProperty("TableColumnRelativeSum") + + PropertyTester.TestProperty("BackColor") + + PropertyTester.TestProperty("BackGraphicURL") + + PropertyTester.TestProperty("BackGraphicFilter") + + PropertyTester.TestProperty("BackGraphicLocation") + + oObj.HoriOrient = com.sun.star.text.HoriOrientation.CENTER + oObj.RelativeWidth = 50 + PropertyTester.TestProperty("IsWidthRelative", Array(FALSE)) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/text/TextTableRow/script.xlb b/qadevOOo/tests/basic/ifc/text/TextTableRow/script.xlb new file mode 100644 index 000000000000..43be1c5b512f --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/TextTableRow/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="text_TextTableRow" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="text_TextTableRow"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/text/TextTableRow/text_TextTableRow.xba b/qadevOOo/tests/basic/ifc/text/TextTableRow/text_TextTableRow.xba new file mode 100644 index 000000000000..d4f39be2bd8e --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/TextTableRow/text_TextTableRow.xba @@ -0,0 +1,75 @@ +<?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="text_TextTableRow" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.text.TextTableRow +'************************************************************************* +On Error Goto ErrHndl + PropertyTester.TestProperty("BackColor") + PropertyTester.TestProperty("BackTransparent") + PropertyTester.TestProperty("BackGraphicURL") + PropertyTester.TestProperty("BackGraphicFilter") + + Dim locations As Variant + locations = Array(_ + com.sun.star.style.GraphicLocation.LEFT_TOP,_ + com.sun.star.style.GraphicLocation.MIDDLE_TOP,_ + com.sun.star.style.GraphicLocation.RIGHT_TOP,_ + com.sun.star.style.GraphicLocation.LEFT_MIDDLE,_ + com.sun.star.style.GraphicLocation.MIDDLE_MIDDLE,_ + com.sun.star.style.GraphicLocation.RIGHT_MIDDLE,_ + com.sun.star.style.GraphicLocation.LEFT_BOTTOM,_ + com.sun.star.style.GraphicLocation.MIDDLE_BOTTOM,_ + com.sun.star.style.GraphicLocation.RIGHT_BOTTOM,_ + com.sun.star.style.GraphicLocation.AREA,_ + com.sun.star.style.GraphicLocation.TILED ) + PropertyTester.TestProperty("BackGraphicLocation", locations) + PropertyTester.TestProperty("TableColumnSeparators") + PropertyTester.TestProperty("Height") + PropertyTester.TestProperty("IsAutoHeight") +Exit Sub +ErrHndl: + Test.Exception() + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/text/ViewSettings/script.xlb b/qadevOOo/tests/basic/ifc/text/ViewSettings/script.xlb new file mode 100644 index 000000000000..8827ee26ea5e --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/ViewSettings/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="text_ViewSettings" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="text_ViewSettings"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/text/ViewSettings/text_ViewSettings.xba b/qadevOOo/tests/basic/ifc/text/ViewSettings/text_ViewSettings.xba new file mode 100644 index 000000000000..2cb84a4ad92f --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/ViewSettings/text_ViewSettings.xba @@ -0,0 +1,114 @@ +<?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="text_ViewSettings" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.text.ViewSettings +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + PropertyTester.TestProperty("ShowAnnotations") + + PropertyTester.TestProperty("ShowBreaks") + + PropertyTester.TestProperty("ShowDrawings") + + PropertyTester.TestProperty("ShowFieldCommands") + + PropertyTester.TestProperty("ShowFootnoteBackground") + + PropertyTester.TestProperty("ShowGraphics") + + PropertyTester.TestProperty("ShowHiddenParagraphs") + + PropertyTester.TestProperty("ShowHiddenText") + + PropertyTester.TestProperty("ShowHoriRuler") + + PropertyTester.TestProperty("ShowHoriScrollBar") + + PropertyTester.TestProperty("ShowIndexMarkBackground") + + PropertyTester.TestProperty("ShowOnlineLayout") + + PropertyTester.TestProperty("ShowParaBreaks") + + PropertyTester.TestProperty("ShowProtectedSpaces") + + PropertyTester.TestProperty("ShowRulers") + + PropertyTester.TestProperty("ShowSoftHyphens") + + PropertyTester.TestProperty("ShowSpaces") + + PropertyTester.TestProperty("ShowTableBoundaries") + + PropertyTester.TestProperty("ShowTables") + + PropertyTester.TestProperty("ShowTabstops") + + PropertyTester.TestProperty("ShowTextBoundaries") + + PropertyTester.TestProperty("ShowTextFieldBackground") + + PropertyTester.TestProperty("ShowVertRuler") + + PropertyTester.TestProperty("ShowVertScrollBar") + + PropertyTester.TestProperty("SmoothScrolling") + + PropertyTester.TestProperty("SolidMarkHandles") + + PropertyTester.TestProperty("IsVertRulerRightAligned") + + Dim zoomTypes As Variant + zoomTypes = Array(0, 1, 2, 3) + PropertyTester.TestProperty("ZoomType", zoomTypes()) + + PropertyTester.TestProperty("ZoomValue") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/text/XAutoTextContainer/script.xlb b/qadevOOo/tests/basic/ifc/text/XAutoTextContainer/script.xlb new file mode 100644 index 000000000000..3eebfbeaeb1b --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/XAutoTextContainer/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="text_XAutoTextContainer" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="text_XAutoTextContainer"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/text/XAutoTextContainer/text_XAutoTextContainer.xba b/qadevOOo/tests/basic/ifc/text/XAutoTextContainer/text_XAutoTextContainer.xba new file mode 100644 index 000000000000..18ba7b0b7da6 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/XAutoTextContainer/text_XAutoTextContainer.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="text_XAutoTextContainer" 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 + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' - Global nGlobalLong As Long + +'************************************************************************* + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.text.XAutoTextContainer +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim oAutoText As Object + Dim aElementNames() As Variant + Dim i As Integer + Dim nCount As Integer + + Out.Log("Remove element with name '" & cIfcShortName & "' if exists") + aElementNames() = oObj.ElementNames + + for i = 0 to uBound(aElementNames()) + if aElementNames(i) = cIfcShortName then + oObj.removeByName(cIfcShortName) + nGlobalLong = oObj.Count + end if + next i + + Test.StartMethod("insertNewByName()") + bOK = true + oAutoText = oObj.insertNewByName(cIfcShortName) + nCount = oObj.Count + bOK = bOK AND (oObj.Count = nGlobalLong + 1) + Test.MethodTested("insertNewByName()", bOK) + + Test.StartMethod("removeByName()") + bOK = true + oObj.removeByName(cIfcShortName) + + nCount = oObj.Count + bOK = bOK AND (oObj.Count = nGlobalLong) + Test.MethodTested("removeByName()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/text/XAutoTextEntry/script.xlb b/qadevOOo/tests/basic/ifc/text/XAutoTextEntry/script.xlb new file mode 100644 index 000000000000..a35dec04f5bd --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/XAutoTextEntry/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="text_XAutoTextEntry" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="text_XAutoTextEntry"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/text/XAutoTextEntry/text_XAutoTextEntry.xba b/qadevOOo/tests/basic/ifc/text/XAutoTextEntry/text_XAutoTextEntry.xba new file mode 100644 index 000000000000..99070d58b2e0 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/XAutoTextEntry/text_XAutoTextEntry.xba @@ -0,0 +1,66 @@ +<?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="text_XAutoTextEntry" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.text.XAutoTextEntry +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim oldText As String, newText As String + + Test.StartMethod("applyTo()") + bOK = true + oldText = oDoc.Text.getString() + oObj.ApplyTo(oDoc.Text.createTextCursor()) + newText = oDoc.Text.getString() + bOK = bOK AND (newText <> oldText) + + Test.MethodTested("applyTo()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/text/XAutoTextGroup/script.xlb b/qadevOOo/tests/basic/ifc/text/XAutoTextGroup/script.xlb new file mode 100644 index 000000000000..11ef1cbd6ba5 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/XAutoTextGroup/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="text_XAutoTextGroup" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="text_XAutoTextGroup"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/text/XAutoTextGroup/text_XAutoTextGroup.xba b/qadevOOo/tests/basic/ifc/text/XAutoTextGroup/text_XAutoTextGroup.xba new file mode 100644 index 000000000000..75d6866993af --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/XAutoTextGroup/text_XAutoTextGroup.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="text_XAutoTextGroup" 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. +' +'************************************************************************* +'************************************************************************* + + + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' - Global nGlobalLong as Long + +'************************************************************************* + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.text.XAutoTextGroup +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Dim aTitles() As Variant + Dim aElements() As Variant + Dim oCursor As Object + + + bOK = true + + oCursor = oDoc.Text.createTextCursor() + oCursor.gotoEnd(true) + + Test.StartMethod("getTitles()") + bOK = true + aTitles() = oObj.Titles + bOK = bOK AND NOT (uBound(aTitles()) = -1) + Test.MethodTested("getTitles()", bOK) + + Test.StartMethod("insertNewByName()") + bOK = true + oObj.insertNewByName(cIfcShortName, cIfcShortName, oCursor) + bOK = bOK AND (oObj.Count > nGlobalLong) + Test.MethodTested("insertNewByName()", bOK) + + Test.StartMethod("renameByName()") + bOK = true + cName = mid(cIfcShortName,1,2) + oObj.renameByName(cIfcShortName,cName, cName & cIfcShortName ) + aElements() = oObj.getElementNames() + bOk = bOK AND (cName = aElements(uBound(aElements()))) + Test.MethodTested("renameByName()", bOK) + + Test.StartMethod("removeByName()") + bOK = true + oObj.removeByName(cName) + aElements() = oObj.getElementNames() + bOk = bOK AND (cName <> aElements(uBound(aElements()))) + Test.MethodTested("removeByName()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/text/XChapterNumberingSupplier/script.xlb b/qadevOOo/tests/basic/ifc/text/XChapterNumberingSupplier/script.xlb new file mode 100644 index 000000000000..5ba4d5a9a0d7 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/XChapterNumberingSupplier/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="text_XChapterNumberingSupplier" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="text_XChapterNumberingSupplier"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/text/XChapterNumberingSupplier/text_XChapterNumberingSupplier.xba b/qadevOOo/tests/basic/ifc/text/XChapterNumberingSupplier/text_XChapterNumberingSupplier.xba new file mode 100644 index 000000000000..5f07b99b1a98 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/XChapterNumberingSupplier/text_XChapterNumberingSupplier.xba @@ -0,0 +1,60 @@ +<?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="text_XChapterNumberingSupplier" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.text.XChapterNumberingSupplier +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + Test.StartMethod("getChapterNumberingRules()") + bOK = true + + bOK = bOK AND hasUnoInterfaces(oObj.getChapterNumberingRules(), "com.sun.star.container.XIndexReplace") + Test.MethodTested("getChapterNumberingRules()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/text/XDefaultNumberingProvider/script.xlb b/qadevOOo/tests/basic/ifc/text/XDefaultNumberingProvider/script.xlb new file mode 100644 index 000000000000..f216aeaf0c5f --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/XDefaultNumberingProvider/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="text_XDefaultNumberingProvider" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="text_XDefaultNumberingProvider"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/text/XDefaultNumberingProvider/text_XDefaultNumberingProvider.xba b/qadevOOo/tests/basic/ifc/text/XDefaultNumberingProvider/text_XDefaultNumberingProvider.xba new file mode 100644 index 000000000000..9fc53a91753f --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/XDefaultNumberingProvider/text_XDefaultNumberingProvider.xba @@ -0,0 +1,119 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="text_XDefaultNumberingProvider" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.text.XDefaultNumberingProvider +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim oLocale As New com.sun.star.lang.Locale + Dim aIndAcc As Object + Dim aPropVals As Object + Dim cr As Object + + oLocale.Country = "US" + oLocale.Language = "en" + + Test.StartMethod("getDefaultOutlineNumberings()") + bOK = true + aIndAcc = oObj.getDefaultOutlineNumberings(oLocale) + if (ubound(aIndAcc) >= 0) then + Out.Log("Returned sequence has " & ubound(aIndAcc) + 1 & " elements.") + bOK = bOK AND hasUNOInterfaces(aIndAcc(0), "com.sun.star.container.XIndexAccess") + else + Out.Log("Returned sequence is EMPTY.") + bOK = false + end if + Test.MethodTested("getDefaultOutlineNumberings()", bOK) + + Test.StartMethod("getDefaultContinuousNumberingLevels()") + bOK = true + aPropVals = oObj.getDefaultContinuousNumberingLevels(oLocale) + if (ubound(aPropVals) >= 0) then + Out.Log("Returned sequence has " & ubound(aPropVals) + 1 & " elements.") + cr = createUNOService("com.sun.star.reflection.CoreReflection") + bOK = bOK AND (cr.getType(aPropVals(0)).Name = "[]com.sun.star.beans.PropertyValue") +' OutDefaultContinuousNumberingLevels(aPropVals) + else + Out.Log("Returned sequence is EMPTY.") + bOK = false + end if + Test.MethodTested("getDefaultContinuousNumberingLevels()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +Sub OutDefaultOutlineNumberings(aIndAcc As Variant) + Dim i As Integer + Dim k As Integer + Dim l As Integer + Dim ia As Object + Dim props As Variant + + for k = 0 to ubound(aIndAcc) + Out.Log("" & k & ")") + ia = aIndAcc(k) + for l = 0 to ia.Count() - 1 + Out.Log(" " & l & ":") + props = ia.getByIndex(l) + for i = 0 to ubound(props) + Out.Log(" - " & props(i).Name & " = " & props(i).Value) + next i + next l + next k +End Sub + +Sub OutDefaultContinuousNumberingLevels(aPropVals As Variant) + Dim i As Integer + Dim k As Integer + Dim props As Variant + + for i = 0 to ubound(aPropVals) + Out.Log("" & i & ")") + props = aPropVals(i) + for k = 0 to ubound(props) + Out.Log(" - " & props(k).Name & " = " & props(k).Value) + next k + next i +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/text/XDocumentIndex/script.xlb b/qadevOOo/tests/basic/ifc/text/XDocumentIndex/script.xlb new file mode 100644 index 000000000000..fc20ebb211a8 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/XDocumentIndex/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="text_XDocumentIndex" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="text_XDocumentIndex"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/text/XDocumentIndex/text_XDocumentIndex.xba b/qadevOOo/tests/basic/ifc/text/XDocumentIndex/text_XDocumentIndex.xba new file mode 100644 index 000000000000..021093468be5 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/XDocumentIndex/text_XDocumentIndex.xba @@ -0,0 +1,65 @@ +<?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="text_XDocumentIndex" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.text.XDocumentIndex +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + Test.StartMethod("getServiceName()") + bOK = true + cName = oObj.getServiceName() + Out.Log("Service name is '" & cName & "'") + Test.MethodTested("getServiceName()", bOK) + + Test.StartMethod("update()") + bOK = true + oObj.update() + Test.MethodTested("update()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/text/XEndnotesSupplier/script.xlb b/qadevOOo/tests/basic/ifc/text/XEndnotesSupplier/script.xlb new file mode 100644 index 000000000000..bcd7bbe8ed05 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/XEndnotesSupplier/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="text_XEndnotesSupplier" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="text_XEndnotesSupplier"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/text/XEndnotesSupplier/text_XEndnotesSupplier.xba b/qadevOOo/tests/basic/ifc/text/XEndnotesSupplier/text_XEndnotesSupplier.xba new file mode 100644 index 000000000000..c85b42f63945 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/XEndnotesSupplier/text_XEndnotesSupplier.xba @@ -0,0 +1,64 @@ +<?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="text_XEndnotesSupplier" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.text.XEndnotesSupplier +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + Test.StartMethod("getEndnotes()") + bOK = true + bOK = bOK AND hasUnoInterfaces(oObj.getEndnotes(), "com.sun.star.container.XIndexAccess") + Test.MethodTested("getEndnotes()", bOK) + + Test.StartMethod("getEndnoteSettings()") + bOK = true + bOK = bOK AND hasUnoInterfaces(oObj.getEndnoteSettings(), "com.sun.star.beans.XPropertySet") + Test.MethodTested("getEndnoteSettings()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/text/XFootnote/script.xlb b/qadevOOo/tests/basic/ifc/text/XFootnote/script.xlb new file mode 100644 index 000000000000..38bb5ec7b924 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/XFootnote/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="text_XFootnote" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="text_XFootnote"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/text/XFootnote/text_XFootnote.xba b/qadevOOo/tests/basic/ifc/text/XFootnote/text_XFootnote.xba new file mode 100644 index 000000000000..8b8e11c61215 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/XFootnote/text_XFootnote.xba @@ -0,0 +1,68 @@ +<?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="text_XFootnote" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.text.XFootnote +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Dim cLabel As String + + + Test.StartMethod("getLabel()") + bOK = true + cLabel = oObj.Label + bOK = bOK AND (cLabel = (cGlobalString & nGlobalLong)) + Test.MethodTested("getLabel()", bOK) + + Test.StartMethod("setLabel()") + bOK = true + oObj.Label = cIfcShortName + bOK = bOK AND (oObj.Label <> cLabel) + Test.MethodTested("setLabel()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/text/XFootnotesSupplier/script.xlb b/qadevOOo/tests/basic/ifc/text/XFootnotesSupplier/script.xlb new file mode 100644 index 000000000000..8b7a7ab94be3 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/XFootnotesSupplier/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="text_XFootnotesSupplier" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="text_XFootnotesSupplier"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/text/XFootnotesSupplier/text_XFootnotesSupplier.xba b/qadevOOo/tests/basic/ifc/text/XFootnotesSupplier/text_XFootnotesSupplier.xba new file mode 100644 index 000000000000..009d7b8f7e3d --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/XFootnotesSupplier/text_XFootnotesSupplier.xba @@ -0,0 +1,64 @@ +<?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="text_XFootnotesSupplier" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.text.XFootnotesSupplier +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + Test.StartMethod("getFootnotes()") + bOK = true + bOK = bOK AND hasUnoInterfaces(oObj.getFootnotes(), "com.sun.star.container.XIndexAccess") + Test.MethodTested("getFootnotes()", bOK) + + Test.StartMethod("getFootnoteSettings()") + bOK = true + bOK = bOK AND hasUnoInterfaces(oObj.getFootnoteSettings(), "com.sun.star.beans.XPropertySet") + Test.MethodTested("getFootnoteSettings()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/text/XLineNumberingSupplier/script.xlb b/qadevOOo/tests/basic/ifc/text/XLineNumberingSupplier/script.xlb new file mode 100644 index 000000000000..4bc46cc25d13 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/XLineNumberingSupplier/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="text_XLineNumberingSupplier" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="text_XLineNumberingSupplier"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/text/XLineNumberingSupplier/text_XLineNumberingSupplier.xba b/qadevOOo/tests/basic/ifc/text/XLineNumberingSupplier/text_XLineNumberingSupplier.xba new file mode 100644 index 000000000000..64844888e720 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/XLineNumberingSupplier/text_XLineNumberingSupplier.xba @@ -0,0 +1,67 @@ +<?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="text_XLineNumberingSupplier" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.text.XLineNumberingSupplier +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim Rules As Variant + + + Test.StartMethod("getLineNumberingRules()") + bOK = true + Rules = oObj.getLineNumberingRules() + Out.Log("ubound(Rules) = " & ubound(Rules)) + bOK = bOK AND NOT isNULL(Rules) + Test.MethodTested("getLineNumberingRules()", bOK) + + Test.StartMethod("setLineNumberingRules()") + bOK = true + oObj.setLineNumberingRules(Rules) + Test.MethodTested("setLineNumberingRules()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/text/XMailMergeBroadcaster/script.xlb b/qadevOOo/tests/basic/ifc/text/XMailMergeBroadcaster/script.xlb new file mode 100644 index 000000000000..92cdc97078fe --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/XMailMergeBroadcaster/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="text_XMailMergeBroadcaster" library:readonly="false" library:passwordprotected="false"> + <library:element library:name="text_XMailMergeBroadcaster"/> + </library:library> diff --git a/qadevOOo/tests/basic/ifc/text/XMailMergeBroadcaster/text_XMailMergeBroadcaster.xba b/qadevOOo/tests/basic/ifc/text/XMailMergeBroadcaster/text_XMailMergeBroadcaster.xba new file mode 100644 index 000000000000..43edb935143d --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/XMailMergeBroadcaster/text_XMailMergeBroadcaster.xba @@ -0,0 +1,106 @@ +<?xml version="1.0" encoding="UTF-8"?> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="text_XMailMergeBroadcaster" 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. +' +'************************************************************************* +'************************************************************************* + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' Global FUNCTION XMailMergeEvent() +' This function fires an event which causes a listner call + + +'************************************************************************* + +' Be sure that all variables are dimensioned: +option explicit + + Dim bCB1 as Boolean + Dim bCB2 as Boolean + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.text.XMailMergeBroadcaster +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim oListener1 as Object + Dim oListener2 as Object + + Out.Log("create two listeners") + oListener1 = createUNOListener("CB1_", "com.sun.star.text.XMailMergeListener") + oListener2 = createUNOListener("CB2_", "com.sun.star.text.XMailMergeListener") + + Test.StartMethod("addMailMergeEventListener()") + bCB1 = FALSE + bCB2 = FALSE + bOK = TRUE + oObj.addMailMergeEventListener(oListener1) + oObj.addMailMergeEventListener(oListener2) + XMailMergeEvent() + out.dbg("call oObj.execute()") + out.dbg("Listener1: " + bCB1 + " ; Listener2: " + bCB2) + bOK = bOK AND bCB1 AND bCB2 + Test.MethodTested("addMailMergeEventListener()", bOK) + + Test.StartMethod("removeMailMergeEventListener()") + bCB1 = FALSE + bCB2 = FALSE + bOK = TRUE + out.dbg("remove Listener1") + oObj.removeMailMergeEventListener(oListener1) + out.dbg("call oObj.execute()") + XMailMergeEvent() + out.dbg("Listener1: " + bCB1 + " ; Listener2: " + bCB2) + bOK = bOK AND NOT bCB1 AND bCB2 + Test.MethodTested("removeMailMergeEventListener()", bOK) + + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub + +Sub CB1_notifyMailMergeEvent() + out.dbg("CB1_notifyMailMergeEvent() was clled.") + bCB1 = TRUE +end Sub + +Sub CB2_notifyMailMergeEvent() + out.dbg("CB2_notifyMailMergeEvent() was clled.") + bCB2 = TRUE +end Sub + +</script:module> diff --git a/qadevOOo/tests/basic/ifc/text/XPageCursor/script.xlb b/qadevOOo/tests/basic/ifc/text/XPageCursor/script.xlb new file mode 100644 index 000000000000..45ceef1da261 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/XPageCursor/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="text_XPageCursor" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="text_XPageCursor"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/text/XPageCursor/text_XPageCursor.xba b/qadevOOo/tests/basic/ifc/text/XPageCursor/text_XPageCursor.xba new file mode 100644 index 000000000000..6f4c28469a0d --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/XPageCursor/text_XPageCursor.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="text_XPageCursor" 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 + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' - PageCursor must be created from document XPageCursor.sdw + +'************************************************************************* + + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.text.XPageCursor +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + RecreateObj() + + Test.StartMethod("jumpToFirstPage()") + bOK = true + bOK = bOK AND oObj.jumpToFirstPage() + oObj.goRight(12, true) + bOK = bOK AND oObj.String = "StartOfPage1" + Test.MethodTested("jumpToFirstPage()", bOK) + + Test.StartMethod("jumpToLastPage()") + bOK = true + bOK = bOK AND oObj.jumpToLastPage() + oObj.goRight(12, true) + bOK = bOK AND oObj.String = "StartOfPage2" + Test.MethodTested("jumpToLastPage()", bOK) + + Test.StartMethod("jumpToPage()") + bOK = true + bOK = bOK AND oObj.jumpToPage(1) + oObj.goRight(12, true) + bOK = bOK AND oObj.String = "StartOfPage1" + Test.MethodTested("jumpToPage()", bOK) + + Test.StartMethod("getPage()") + bOK = true + bOK = bOK AND oObj.getPage() = 1 + Test.MethodTested("getPage()", bOK) + + Test.StartMethod("jumpToNextPage()") + bOK = true + bOK = bOK AND oObj.jumpToNextPage() + oObj.goRight(12, true) + bOK = bOK AND oObj.String = "StartOfPage2" + Test.MethodTested("jumpToNextPage()", bOK) + + Test.StartMethod("jumpToPreviousPage()") + bOK = true + bOK = bOK AND oObj.jumpToPreviousPage() + oObj.goLeft(12, true) + bOK = bOK AND oObj.String = "EndOfPage 1" + Test.MethodTested("jumpToPreviousPage()", bOK) + + Test.StartMethod("jumpToEndOfPage()") + bOK = true + bOK = bOK AND oObj.jumpToEndOfPage() + oObj.goLeft(12, true) + bOK = bOK AND oObj.String = "EndOfPage 1" + Test.MethodTested("jumpToEndOfPage()", bOK) + + Test.StartMethod("jumpToStartOfPage()") + bOK = true + bOK = bOK AND oObj.jumpToStartOfPage() + oObj.goRight(12, true) + bOK = bOK AND oObj.String = "StartOfPage1" + Test.MethodTested("jumpToStartOfPage()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/text/XPagePrintable/script.xlb b/qadevOOo/tests/basic/ifc/text/XPagePrintable/script.xlb new file mode 100644 index 000000000000..9e126a20a50b --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/XPagePrintable/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="text_XPagePrintable" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="text_XPagePrintable"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/text/XPagePrintable/text_XPagePrintable.xba b/qadevOOo/tests/basic/ifc/text/XPagePrintable/text_XPagePrintable.xba new file mode 100644 index 000000000000..80d9a93cef65 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/XPagePrintable/text_XPagePrintable.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="text_XPagePrintable" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.text.XPagePrintable +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim aPrintSettings As Variant + Dim aNewSettings As Variant + + Test.StartMethod("getPagePrintSettings()") + bOK = true + aPrintSettings = oObj.getPagePrintSettings() + Out.Log("PrintSettings have " & (ubound(aPrintSettings) + 1) & " elements") + bOK = bOK AND (ubound(aPrintSettings) > 0) + Test.MethodTested("getPagePrintSettings()", bOK) + + Test.StartMethod("setPagePrintSettings()") + bOK = true + Dim bOldLandscape As Boolean + ' Changing Landscape property... + bOldLandscape = aPrintSettings(8).Value + aPrintSettings(8).Value = NOT bOldLandscape + + oObj.setPagePrintSettings(aPrintSettings()) + aNewSettings = oObj.getPagePrintSettings() + bOK = bOK AND (aNewSettings(8).Value = NOT bOldLandscape) + + Test.MethodTested("setPagePrintSettings()", bOK) + + Test.StartMethod("printPages()") + bOK = true + Dim aPrintingOptions(0) As New com.sun.star.beans.PropertyValue + Dim sFileName As String + sFileName = utils.Path2URL(cTestDocsDir & "/temp/XPagePrintable.prt") + + if (FileExists(sFileName)) then + kill(sFileName) + end if + + aPrintingOptions(0).Name = "FileName" + aPrintingOptions(0).Value = sFileName + aPrintingOptions(0).State = com.sun.star.beans.PropertyState.DEFAULT_VALUE + + Out.Log("Printing to " & sFileName) + oObj.printPages(aPrintingOptions()) + + bOK = bOK AND FileExists(sFileName) + Test.MethodTested("printPages()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/text/XParagraphCursor/script.xlb b/qadevOOo/tests/basic/ifc/text/XParagraphCursor/script.xlb new file mode 100644 index 000000000000..0b33ec3d310c --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/XParagraphCursor/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="text_XParagraphCursor" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="text_XParagraphCursor"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/text/XParagraphCursor/text_XParagraphCursor.xba b/qadevOOo/tests/basic/ifc/text/XParagraphCursor/text_XParagraphCursor.xba new file mode 100644 index 000000000000..072cb69dbb41 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/XParagraphCursor/text_XParagraphCursor.xba @@ -0,0 +1,121 @@ +<?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="text_XParagraphCursor" 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 + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' - Global oText As Object + +'************************************************************************* + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.text.XParagraphCursor +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim i As Integer + + for i = 0 to 2 + oText.insertString(oObj, "" + i +"Start of paragraph.", false) + oText.insertString(oObj, Chr(10) + cObjectName + " " + cIfcShortName + Chr(10), false) + oText.insertString(oObj, "Paragraph's end." + i, false) + oText.insertControlCharacter(oObj, com.sun.star.text.ControlCharacter.PARAGRAPH_BREAK, false) + next i + + oObj.gotoStart(false) + + Test.StartMethod("gotoStartOfParagraph()") + bOK = true + oObj.gotoStartOfParagraph(false) + oText.insertString(oObj, "1", false) + bOK = bOK AND inStr(1, oText.String, "10Start") <> 0 + Test.MethodTested("gotoStartOfParagraph()", bOK) + + Test.StartMethod("gotoEndOfParagraph()") + bOK = true + oObj.gotoEndOfParagraph(false) + oText.insertString(oObj, "2", false) + bOK = bOK AND inStr(1, oText.String, "end.02") <> 0 + Test.MethodTested("gotoEndOfParagraph()", bOK) + + Test.StartMethod("gotoNextParagraph()") + bOK = true + oObj.gotoNextParagraph(false) + oObj.gotoNextParagraph(false) + oObj.gotoEndOfParagraph(false) + oText.insertString(oObj, "3", false) + bOK = bOK AND inStr(1, oText.String, "end.23") <> 0 + Test.MethodTested("gotoNextParagraph()", bOK) + + Test.StartMethod("gotoPreviousParagraph()") + bOK = true + oObj.gotoPreviousParagraph(false) + oObj.gotoEndOfParagraph(false) + oText.insertString(oObj, "4", false) + bOK = bOK AND inStr(1, oText.String, "end.14") <> 0 + Test.MethodTested("gotoPreviousParagraph()", bOK) + + Test.StartMethod("isStartOfParagraph()") + bOK = true + oObj.gotoStartOfParagraph(false) + bOK = bOK AND oObj.isStartOfParagraph() + bOK = bOK AND NOT oObj.isEndOfParagraph() + Test.MethodTested("isStartOfParagraph()", bOK) + + Test.StartMethod("isEndOfParagraph()") + bOK = true + oObj.gotoEndOfParagraph(false) + bOK = bOK AND oObj.isEndOfParagraph() + bOK = bOK AND NOT oObj.isStartOfParagraph() + Test.MethodTested("isEndOfParagraph()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/text/XReferenceMarksSupplier/script.xlb b/qadevOOo/tests/basic/ifc/text/XReferenceMarksSupplier/script.xlb new file mode 100644 index 000000000000..e66d625ea72a --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/XReferenceMarksSupplier/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="text_XReferenceMarksSupplier" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="text_XReferenceMarksSupplier"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/text/XReferenceMarksSupplier/text_XReferenceMarksSupplier.xba b/qadevOOo/tests/basic/ifc/text/XReferenceMarksSupplier/text_XReferenceMarksSupplier.xba new file mode 100644 index 000000000000..ee2f4b025d33 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/XReferenceMarksSupplier/text_XReferenceMarksSupplier.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="text_XReferenceMarksSupplier" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.text.XReferenceMarksSupplier +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + Test.StartMethod("getReferenceMarks()") + bOK = true + bOK = bOK AND hasUnoInterfaces(oObj.getReferenceMarks(), "com.sun.star.container.XNameAccess") + Test.MethodTested("getReferenceMarks()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/text/XRelativeTextContentInsert/script.xlb b/qadevOOo/tests/basic/ifc/text/XRelativeTextContentInsert/script.xlb new file mode 100644 index 000000000000..45220fcf0ae9 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/XRelativeTextContentInsert/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="text_XRelativeTextContentInsert" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="text_XRelativeTextContentInsert"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/text/XRelativeTextContentInsert/text_XRelativeTextContentInsert.xba b/qadevOOo/tests/basic/ifc/text/XRelativeTextContentInsert/text_XRelativeTextContentInsert.xba new file mode 100644 index 000000000000..63d93c63593c --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/XRelativeTextContentInsert/text_XRelativeTextContentInsert.xba @@ -0,0 +1,164 @@ +<?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="text_XRelativeTextContentInsert" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.text.XRelativeTextContentInsert +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim oEnum As Object + Dim oCursor As Object + Dim oContent1 As Object + Dim oContent2 As Object + Dim bFound As Boolean + Dim oEl As Object + + Test.StartMethod("insertTextContentBefore()") + bOK = true + oCursor = oObj.createTextCursor() + if (isNULL(oCursor)) then Out.Log("Can't create text cursor!") + + Out.Log("First, mark all existant entries with 0") + + oEnum = oObj.createEnumeration() + while (oEnum.hasMoreElements()) + oEl = oEnum.NextElement() + if (oEl.supportsService("com.sun.star.text.Paragraph")) then + oEl.String = "0" + end if + wend + + Out.Log("Inserting TextSection...") + oContent1 = oDoc.createInstance("com.sun.star.text.TextSection") + oObj.insertTextContent(oCursor, oContent1, false) + + oEnum = oObj.createEnumeration() + while (oEnum.hasMoreElements()) + oEl = oEnum.NextElement() + if (oEl.supportsService("com.sun.star.text.Paragraph")) then + if (oEl.String = "") then oEl.String = "1" + end if + wend + + Out.Log("Mark new entry with 1") + + oContent2 = oDoc.createInstance("com.sun.star.text.Paragraph") + oObj.insertTextContentBefore(oContent2, oContent1) + + oEnum = oObj.createEnumeration() + while (oEnum.hasMoreElements()) + oEl = oEnum.NextElement() + if (oEl.supportsService("com.sun.star.text.Paragraph")) then + if (oEl.String = "") then oEl.String = "2" + end if + wend + + Out.Log("Mark new entry with 2") + + Out.Log("Testing that content was inserted BEFORE. I.e. Label 2 before label 1") + + oEnum = oObj.createEnumeration() + bFound = false + while (oEnum.hasMoreElements() AND NOT bFound) + oEl = oEnum.NextElement() + if (oEl.supportsService("com.sun.star.text.Paragraph")) then + bFound = oEl.String = "2" + end if + wend + + oEl = oEnum.NextElement() + bOK = bOK AND oEl.String = "1" + + Test.MethodTested("insertTextContentBefore()", bOK) + + + Test.StartMethod("insertTextContentAfter()") + bOK = true + + Out.Log("Inserting TextSection...") + oContent1 = oDoc.createInstance("com.sun.star.text.TextSection") + oObj.insertTextContent(oCursor, oContent1, false) + + oEnum = oObj.createEnumeration() + while (oEnum.hasMoreElements()) + oEl = oEnum.NextElement() + if (oEl.supportsService("com.sun.star.text.Paragraph")) then + if (oEl.String = "") then oEl.String = "3" + end if + wend + + Out.Log("Mark new entry with 3") + + oContent2 = oDoc.createInstance("com.sun.star.text.Paragraph") + oObj.insertTextContentAfter(oContent2, oContent1) + + oEnum = oObj.createEnumeration() + while (oEnum.hasMoreElements()) + oEl = oEnum.NextElement() + if (oEl.supportsService("com.sun.star.text.Paragraph")) then + if (oEl.String = "") then oEl.String = "4" + end if + wend + + Out.Log("Mark new entry with 4") + + Out.Log("Testing that content was inserted AFTRER. I.e. Label 4 after label 3") + + oEnum = oObj.createEnumeration() + bFound = false + while (oEnum.hasMoreElements() AND NOT bFound) + oEl = oEnum.NextElement() + if (oEl.supportsService("com.sun.star.text.Paragraph")) then + bFound = oEl.String = "3" + end if + wend + + oEl = oEnum.NextElement() + bOK = bOK AND oEl.String = "4" + + Test.MethodTested("insertTextContentAfter()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/text/XSentenceCursor/script.xlb b/qadevOOo/tests/basic/ifc/text/XSentenceCursor/script.xlb new file mode 100644 index 000000000000..a27aa634f031 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/XSentenceCursor/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="text_XSentenceCursor" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="text_XSentenceCursor"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/text/XSentenceCursor/text_XSentenceCursor.xba b/qadevOOo/tests/basic/ifc/text/XSentenceCursor/text_XSentenceCursor.xba new file mode 100644 index 000000000000..09cd1870b19d --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/XSentenceCursor/text_XSentenceCursor.xba @@ -0,0 +1,105 @@ +<?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="text_XSentenceCursor" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.text.XSentenceCursor +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + oObj.Text.String = "Sentence two. Sentence three." + + oObj.gotoEnd(false) + + Test.StartMethod("gotoStartOfSentence()") + bOK = true + oObj.gotoStartOfSentence(false) + oObj.String = "1" + Out.Log("Current text: '" + oObj.Text.String + "'") + bOK = bOK AND inStr(1, oObj.Text.String, "1Sentence three.") <> 0 + Test.MethodTested("gotoStartOfSentence()", bOK) + + Test.StartMethod("isStartOfSentence()") + Test.StartMethod("isEndOfSentence()") + bOK = true + oObj.gotoStartOfSentence(false) + bOK = bOK AND oObj.isStartOfSentence() + bOK = bOK AND NOT oObj.isEndOfSentence() + oObj.gotoEndOfSentence(false) + bOK = bOK AND NOT oObj.isStartOfSentence() + bOK = bOK AND oObj.isEndOfSentence() + Test.MethodTested("isStartOfSentence()", bOK) + Test.MethodTested("isEndOfSentence()", bOK) + + + Test.StartMethod("gotoEndOfSentence()") + bOK = true + oObj.gotoEndOfSentence(false) + oObj.String = "2" + Out.Log("Current text: '" + oObj.Text.String + "'") + bOK = bOK AND inStr(1, oObj.Text.String, "three.2") <> 0 + Test.MethodTested("gotoEndOfSentence()", bOK) + + Test.StartMethod("gotoPreviousSentence()") + bOK = true + oObj.gotoPreviousSentence(false) + oObj.String = "3" + Out.Log("Current text: '" + oObj.Text.String + "'") + bOK = bOK AND inStr(1, oObj.Text.String, "3Sentence two.") <> 0 + Test.MethodTested("gotoPreviousSentence()", bOK) + + Test.StartMethod("gotoNextSentence()") + bOK = true + oObj.gotoNextSentence(false) + oObj.String = "4" + Out.Log("Current text: '" + oObj.Text.String + "'") + bOK = bOK AND inStr(1, oObj.Text.String, "41") <> 0 + Test.MethodTested("gotoNextSentence()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/text/XSimpleText/script.xlb b/qadevOOo/tests/basic/ifc/text/XSimpleText/script.xlb new file mode 100644 index 000000000000..d15cb9a51d44 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/XSimpleText/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="text_XSimpleText" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="text_XSimpleText"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/text/XSimpleText/text_XSimpleText.xba b/qadevOOo/tests/basic/ifc/text/XSimpleText/text_XSimpleText.xba new file mode 100644 index 000000000000..ee73a6e7f3b7 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/XSimpleText/text_XSimpleText.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="text_XSimpleText" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.text.XSimpleText +'************************************************************************* +On Error Goto ErrHndl + Dim oCursor As Object + Dim oPosCursor As Variant + Dim cIfcShortName As String + Dim bOK As Boolean + Dim oldString, newString As String + + cIfcShortName = "XSimpleText" + + Test.StartMethod("createTextCursor()") + bOK = true + oCursor = oObj.createTextCursor() + bOK = bOK AND NOT (isNull(oCursor)) + bOK = bOK AND hasUnoInterfaces(oCursor, "com.sun.star.text.XTextCursor") + Test.MethodTested("createTextCursor()", bOK) + + Test.StartMethod("createTextCursorByRange()") + bOK = true + oPosCursor = oObj.createTextCursorbyRange(oCursor) + bOK = bOK AND NOT isNull(oPosCursor) + bOK = bOK AND hasUnoInterfaces(oPosCursor, "com.sun.star.text.XTextCursor") + Test.MethodTested("createTextCursorByRange()", bOK) + + Test.StartMethod("insertString()") + bOK = true + oldString = oObj.String + Out.Log("String before inserting:'" + oldString + "'") + oCursor.gotoStart(false) + oObj.insertString(oCursor, cIfcShortName, false) + Dim newStr As String + newStr = oObj.String + Out.Log("String content after inserting:'" + newStr + "'") + Dim expectedStr As String + expectedStr = cIfcShortName + oldString + Out.Log("Expected string:'" + expectedStr + "'") + bOK = bOK AND (expectedStr = newStr) + oObj.setString(oldString) + Test.MethodTested("insertString()", bOK) + + ' some cursor navigation to verify if controlcharacters have benn inserted:) + Test.StartMethod("insertControlCharacter()") + bOK = true + oldString = oObj.getString() + newString = "XSimpleText" + Out.Log("Set string to '" + newString + "'") + oObj.setString(newString) + Out.Log("Current string content of object: '" + oObj.getString() + "'") + oCursor.gotoStart(false) + Out.Log("Insert control characters...") +' oObj.insertControlCharacter(oCursor, com.sun.star.text.ControlCharacter.PARAGRAPH_BREAK, false) + oObj.insertControlCharacter(oCursor, com.sun.star.text.ControlCharacter.LINE_BREAK, false) + Out.Log("Now string content of object: '" + oObj.getString() + "'") + Dim breakPos As Integer + breakPos = inStr(oObj.getString(), chr(10)) + Out.Log("Line break found at " + breakPos) + bOK = bOK AND breakPos > 0 + oObj.String = oldString + Out.Log("Return string to old state:'" + oObj.getString() + "'" ) + Test.MethodTested("insertControlCharacter()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/text/XText/script.xlb b/qadevOOo/tests/basic/ifc/text/XText/script.xlb new file mode 100644 index 000000000000..af753e01a742 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/XText/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="text_XText" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="text_XText"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/text/XText/text_XText.xba b/qadevOOo/tests/basic/ifc/text/XText/text_XText.xba new file mode 100644 index 000000000000..c0580ba6ea45 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/XText/text_XText.xba @@ -0,0 +1,153 @@ +<?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="text_XText" 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 + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' - Global oCollection As Object [optional] +' if this relation exists then the method "count" is called for check insert/remove +' - Global oInstance As Object +' Global aAddons() As Variant [optional] +' if this relation exists, then additional methods are called before and after insert/removeTextContent() methods + +'************************************************************************* + + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.text.XText +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim cText As String + Dim oCursor As Object + Dim i1 As Integer + Dim i2 As Integer + + Test.StartMethod("insertTextContent()") + bOK = true + cText = ". Zeile : test_XText" + + If IsObject(oCollection) and IsObject(oInstance) Then + oCursor = oObj.createTextCursor() + oCursor.gotoEnd(false) + i1 = count(oCollection) + Out.Log("Before inserting we have " + i1 + " elements.") + +' if isArray(aAddons) then +' Out.Log("Calling beforeInsertTextContent() ...") +' beforeInsertTextContent() +' endif + + oObj.insertTextContent(oCursor, oInstance, false) + +' if isArray(aAddons) then +' Out.Log("Calling afterInsertTextContent() ...") +' afterInsertTextContent() +' endif + + i2 = count(oCollection) + Out.Log("After inserting we have " + i2 + " elements.") + bOK = bOK AND i1 = i2 - 1 + Test.MethodTested("insertTextContent()", bOK) + + Test.StartMethod("removeTextContent()") + bOK = true + i1 = count(oCollection) + Out.Log("Before removing we have " + i1 + " elements.") + +' if (isArray(aAddons)) then +' Out.Log("Calling beforeRemoveTextContent() ...") +' beforeRemoveTextContent() +' endif + + oObj.removeTextContent(oInstance) + +' if (isArray(aAddons)) then +' Out.Log("Calling afterRemoveTextContent() ...") +' afterRemoveTextContent() +' endif + + i2 = count(oCollection) + Out.Log("After removing we have " + i2 + " elements.") + bOK = bOK AND i1 = i2 + 1 + Test.MethodTested("removeTextContent()", bOK) + Else + oCursor = oObj.createTextCursor() + oCursor.gotoEnd(false) + oObj.insertTextContent(oCursor, oInstance, false) + Test.MethodTested("insertTextContent()", True) + Test.StartMethod("removeTextContent()") + oObj.removeTextContent(oInstance) + Test.MethodTested("removeTextContent()", True) + End If + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub + +Function count(container As Variant) As Integer + Dim iAmount As Integer + Dim oEnumeration As Object + + if hasUnoInterfaces(container, "com.sun.star.container.XIndexAccess") then + iAmount = container.getCount() + elseif hasUnoInterfaces(container, "com.sun.star.container.XNameAccess") then + iAmount = ubound(container.getElementNames()) + 1 + elseif hasUnoInterfaces(container, "com.sun.star.container.XEnumerationAccess") then + oEnumeration = container.createEnumeration() + iAmount = 0 + while oEnumeration.hasMoreElements() + iAmount = iAmount + 1 + oEnumeration.nextElement() + wend + end if + + count() = iAmount +End Function +</script:module> diff --git a/qadevOOo/tests/basic/ifc/text/XTextColumns/script.xlb b/qadevOOo/tests/basic/ifc/text/XTextColumns/script.xlb new file mode 100644 index 000000000000..de7dd8e808c0 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/XTextColumns/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="text_XTextColumns" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="text_XTextColumns"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/text/XTextColumns/text_XTextColumns.xba b/qadevOOo/tests/basic/ifc/text/XTextColumns/text_XTextColumns.xba new file mode 100644 index 000000000000..bc9c2c048c8f --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/XTextColumns/text_XTextColumns.xba @@ -0,0 +1,119 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="text_XTextColumns" 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 + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' - Global oPageStyle As Object + +'************************************************************************* + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.text.XTextColumns +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Dim nCount As Integer + Dim aColumns As Variant + Dim RightCol As Variant + Dim LeftCol As Variant + Dim nRefValue As Long + + nCount = 2 + + Test.StartMethod("setColumnCount()") + bOK = true + oObj.setColumnCount(nCount) + Test.MethodTested("setColumnCount()", bOK) + + Test.StartMethod("getColumns()") + bOK = true + aColumns = oObj.Columns + bOK = bOK AND NOT isNull(aColumns) + Test.MethodTested("getColumns()", bOK) + + LeftCol = aColumns(0) + RightCol = aColumns(1) + RightCol.Width = 10000 : RightCol.RightMargin = 2000 + LeftCol.Width = 15000 : LeftCol.LeftMargin = 5000 + + aColumns(0) = LeftCol + aColumns(1) = RightCol + + oObj.setColumns(aColumns()) + + ' initialize the pagestyle with the new values + oPageStyle.TextColumns = oObj + + ' check if ColumnsCount was set successfull + Test.StartMethod("getColumnCount()") + bOK = true + bOK = bOK AND (nCount = oPageStyle.TextColumns.ColumnCount) + Test.MethodTested("getColumnCount()", bOK) + + Test.StartMethod("getReferenceValue()") + bOK = true + nRefValue = oObj.getReferenceValue() + bOK = bOK AND (nRefValue = 25000) + Test.MethodTested("getReferenceValue()", bOK) + + Test.StartMethod("setColumns()") + bOK = true + RightCol.Width = 15000 + aColumns(1) = RightCol + oObj.setColumns(aColumns()) + oPageStyle.TextColumns = oObj + bOK = bOK AND (oPageStyle.TextColumns.ReferenceValue = 30000) + Test.MethodTested("setColumns()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/text/XTextContent/script.xlb b/qadevOOo/tests/basic/ifc/text/XTextContent/script.xlb new file mode 100644 index 000000000000..b15fd5993ee6 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/XTextContent/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="text_XTextContent" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="text_XTextContent"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/text/XTextContent/text_XTextContent.xba b/qadevOOo/tests/basic/ifc/text/XTextContent/text_XTextContent.xba new file mode 100644 index 000000000000..acfb85d5edc4 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/XTextContent/text_XTextContent.xba @@ -0,0 +1,83 @@ +<?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="text_XTextContent" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.text.XTextContent +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim bImpossible as Boolean + + bImpossible = FALSE + Test.StartMethod("getAnchor()") + bOK = true + bOK = bOK AND hasUnoInterfaces(oObj.getAnchor(), "com.sun.star.text.XTextRange") + Test.MethodTested("getAnchor()", bOK) + +On Error Goto ImpossibleErr + If bXTextContentImpossible then + bImpossible = TRUE + End If + +On Error Goto ErrHndl + + Test.StartMethod("attach()") + bOK = true + oXTextContent.attach(oXTextContentRange) + If bImpossible then + bOK = True + Out.Log("bXTextContnetImpossible = TRUE: Object is not " + _ + "able to attach() to something => TRUE") + end If + Test.MethodTested("attach()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next + +ImpossibleErr: + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/text/XTextCursor/script.xlb b/qadevOOo/tests/basic/ifc/text/XTextCursor/script.xlb new file mode 100644 index 000000000000..ff8b4c2ee551 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/XTextCursor/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="text_XTextCursor" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="text_XTextCursor"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/text/XTextCursor/text_XTextCursor.xba b/qadevOOo/tests/basic/ifc/text/XTextCursor/text_XTextCursor.xba new file mode 100644 index 000000000000..fa542d02515b --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/XTextCursor/text_XTextCursor.xba @@ -0,0 +1,134 @@ +<?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="text_XTextCursor" 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. +' +'************************************************************************* +'************************************************************************* + + + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' - Global oCursor As Object +' One more cursor + +'************************************************************************* + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.text.XTextCursor +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim oRange As Object + + oObj.Text.String = "abcdefg" + + Test.StartMethod("gotoEnd()") + bOK = true + oObj.gotoEnd(false) + oObj.String = "1" + bOK = bOK AND inStr(1, oObj.Text.String, "g1") + Test.MethodTested("gotoEnd()", bOK) + + Test.StartMethod("gotoStart()") + bOK = true + oObj.gotoStart(false) + oObj.String = "2" + bOK = bOK AND inStr(1, oObj.Text.String, "2a") + Test.MethodTested("gotoStart()", bOK) + + Test.StartMethod("goRight()") + bOK = true + oObj.gotoStart(false) + oObj.goRight(2, false) + oObj.String = "3" + bOK = bOK AND inStr(1, oObj.Text.String, "2a3") + Test.MethodTested("goRight()", bOK) + + Test.StartMethod("goLeft()") + bOK = true + oObj.gotoEnd(false) + oObj.goLeft(2, false) + oObj.String = "4" + bOK = bOK AND inStr(1, oObj.Text.String, "4g1") + Test.MethodTested("goLeft()", bOK) + + Test.StartMethod("gotoRange()") + bOK = true + oCursor.gotoEnd(false) + oCursor.goLeft(1, false) + oCursor.goLeft(2, true) + oObj.gotoStart(false) + oObj.gotoRange(oCursor, false) + bOK = bOK AND oObj.String = "4g" + Test.MethodTested("gotoRange()", bOK) + + Test.StartMethod("collapseToStart()") + bOK = true + cTp = oObj.String + oObj.collapseToStart() + oObj.String = "5" + bOK = bOK AND inStr(1, oObj.Text.String, "5" & cTp) + Test.MethodTested("collapseToStart()", bOK) + + Test.StartMethod("collapseToEnd()") + bOK = true + oObj.gotoEnd(false) + oObj.goLeft(3, true) + cTp = oObj.String + oObj.collapseToEnd() + oObj.String = "6" + bOK = bOK AND inStr(1, oObj.Text.String, cTp & "6") + Test.MethodTested("collapseToEnd()", bOK) + + Test.StartMethod("isCollapsed()") + bOK = true + oObj.collapseToStart() + bOK = bOK AND oObj.isCollapsed() + oObj.gotoEnd(false) + oObj.goLeft(3, true) + bOK = bOK AND NOT oObj.isCollapsed() + Test.MethodTested("isCollapsed()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/text/XTextDocument/script.xlb b/qadevOOo/tests/basic/ifc/text/XTextDocument/script.xlb new file mode 100644 index 000000000000..3d21d9548231 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/XTextDocument/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="text_XTextDocument" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="text_XTextDocument"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/text/XTextDocument/text_XTextDocument.xba b/qadevOOo/tests/basic/ifc/text/XTextDocument/text_XTextDocument.xba new file mode 100644 index 000000000000..a8a63b753495 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/XTextDocument/text_XTextDocument.xba @@ -0,0 +1,65 @@ +<?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="text_XTextDocument" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.text.XTextDocument +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + Test.StartMethod("getText()") + bOK = true + oText = oObj.getText() + bOK = bOK AND hasUnoInterfaces(oText, "com.sun.star.text.XText") + Test.MethodTested("getText()", bOK) + + Test.StartMethod("reformat()") + bOK = true + oObj.reformat() + Test.MethodTested("reformat()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/text/XTextEmbeddedObjectsSupplier/script.xlb b/qadevOOo/tests/basic/ifc/text/XTextEmbeddedObjectsSupplier/script.xlb new file mode 100644 index 000000000000..6c31a1aadd14 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/XTextEmbeddedObjectsSupplier/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="text_XTextEmbeddedObjectsSupplier" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="text_XTextEmbeddedObjectsSupplier"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/text/XTextEmbeddedObjectsSupplier/text_XTextEmbeddedObjectsSupplier.xba b/qadevOOo/tests/basic/ifc/text/XTextEmbeddedObjectsSupplier/text_XTextEmbeddedObjectsSupplier.xba new file mode 100644 index 000000000000..53ae423f5175 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/XTextEmbeddedObjectsSupplier/text_XTextEmbeddedObjectsSupplier.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="text_XTextEmbeddedObjectsSupplier" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.text.XTextEmbeddedObjectsSupplier +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + Test.StartMethod("getEmbeddedObjects()") + bOK = true + bOK = bOK AND hasUnoInterfaces(oObj.getEmbeddedObjects(), "com.sun.star.container.XNameAccess") + Test.MethodTested("getEmbeddedObjects()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/text/XTextField/script.xlb b/qadevOOo/tests/basic/ifc/text/XTextField/script.xlb new file mode 100644 index 000000000000..5520ad3eb242 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/XTextField/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="text_XTextField" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="text_XTextField"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/text/XTextField/text_XTextField.xba b/qadevOOo/tests/basic/ifc/text/XTextField/text_XTextField.xba new file mode 100644 index 000000000000..183707c95a45 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/XTextField/text_XTextField.xba @@ -0,0 +1,67 @@ +<?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="text_XTextField" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.text.XTextField +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Test.StartMethod("getPresentation()") + bOK = true + Out.Log("getting presentetion with bShowCommand flag...") + bOK = bOK AND (VarType(oObj.getPresentation(true)) = 8 ) + Out.Log("Result: " & bOK) + Out.Log("getting presentetion without bShowCommand flag...") + bOK = bOK AND (VarType(oObj.getPresentation(false)) = 8 ) + Out.Log("Result: " & bOK) + + Test.MethodTested("getPresentation()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/text/XTextFrame/script.xlb b/qadevOOo/tests/basic/ifc/text/XTextFrame/script.xlb new file mode 100644 index 000000000000..5da11ee8e3a7 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/XTextFrame/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="text_XTextFrame" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="text_XTextFrame"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/text/XTextFrame/text_XTextFrame.xba b/qadevOOo/tests/basic/ifc/text/XTextFrame/text_XTextFrame.xba new file mode 100644 index 000000000000..c2649b234521 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/XTextFrame/text_XTextFrame.xba @@ -0,0 +1,70 @@ +<?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="text_XTextFrame" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.text.XTextFrame +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Dim oCursor As Object + + + Test.StartMethod("getText()") + bOK = true + oText = oObj.Text + bOK = bOK AND NOT isNull(oText) + + oCursor = oObj.Text.createTextCursor() + oBookmark = oDoc.Bookmarks.getByIndex(0) + + oCursor.gotoRange(oBookmark.Anchor, true) + + ' ... and check if text is what it should be + bOK = bOK AND (mid(oCursor.String, 1, Len(cFrameName)) = cFrameName) + Test.MethodTested("getText()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/text/XTextGraphicObjectsSupplier/script.xlb b/qadevOOo/tests/basic/ifc/text/XTextGraphicObjectsSupplier/script.xlb new file mode 100644 index 000000000000..1c98d19d8c83 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/XTextGraphicObjectsSupplier/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="text_XTextGraphicObjectsSupplier" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="text_XTextGraphicObjectsSupplier"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/text/XTextGraphicObjectsSupplier/text_XTextGraphicObjectsSupplier.xba b/qadevOOo/tests/basic/ifc/text/XTextGraphicObjectsSupplier/text_XTextGraphicObjectsSupplier.xba new file mode 100644 index 000000000000..1b6b7ba6f1c9 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/XTextGraphicObjectsSupplier/text_XTextGraphicObjectsSupplier.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="text_XTextGraphicObjectsSupplier" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.text.XTextGraphicObjectsSupplier +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + Test.StartMethod("getGraphicObjects()") + bOK = true + bOK = bOK AND hasUnoInterfaces(oObj.getGraphicObjects(), "com.sun.star.container.XNameAccess") + Test.MethodTested("getGraphicObjects()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/text/XTextRange/script.xlb b/qadevOOo/tests/basic/ifc/text/XTextRange/script.xlb new file mode 100644 index 000000000000..98eb1adc767b --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/XTextRange/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="text_XTextRange" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="text_XTextRange"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/text/XTextRange/text_XTextRange.xba b/qadevOOo/tests/basic/ifc/text/XTextRange/text_XTextRange.xba new file mode 100644 index 000000000000..14d417924c27 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/XTextRange/text_XTextRange.xba @@ -0,0 +1,86 @@ +<?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="text_XTextRange" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.text.XTextRange +'************************************************************************* +On Error Goto ErrHndl + Dim oStartOfTextRange As Object + Dim oEndOfTextRange As Object + Dim oText As Object + Dim bOK As Boolean + + + Test.StartMethod("setString()") + Test.StartMethod("getString()") + bOK = true + oObj.setString("Middle") + bOK = bOK AND (oObj.getString() = "Middle") + Test.MethodTested("setString()", bOK) + Test.MethodTested("getString()", bOK) + + Test.StartMethod("getEnd()") + oEndOfTextRange = oObj.getEnd() + oEndOfTextRange.String = "End" + + Test.StartMethod("getStart()") + bOK = true + oStartOfTextRange = oObj.getStart() + oStartOfTextRange.String = "Start" + + Test.StartMethod("getText()") + bOK = true + oText = oObj.getText() + Out.Log("Result string is '" + oText.getString() + "'") + bOK = bOK AND instr(oText.getString(), "StartMiddleEnd") > 0 + Test.MethodTested("getEnd()", bOK) + Test.MethodTested("getStart()", bOK) + Test.MethodTested("getText()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/text/XTextRangeCompare/script.xlb b/qadevOOo/tests/basic/ifc/text/XTextRangeCompare/script.xlb new file mode 100644 index 000000000000..08a067879bf7 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/XTextRangeCompare/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="text_XTextRangeCompare" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="text_XTextRangeCompare"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/text/XTextRangeCompare/text_XTextRangeCompare.xba b/qadevOOo/tests/basic/ifc/text/XTextRangeCompare/text_XTextRangeCompare.xba new file mode 100644 index 000000000000..4e750a4a47ee --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/XTextRangeCompare/text_XTextRangeCompare.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="text_XTextRangeCompare" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.text.XTextRangeCompare +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Dim oCursor1 As Object + Dim oCursor2 As Object + Dim nResult As Integer + Dim bEnd As Boolean + Dim bStart As Boolean + Dim cIfcShortName As String + + cIfcShortName = "XTextRangeCompare" + + nResult = 10 + + Test.StartMethod("compareRegionEnds()") + Test.StartMethod("compareRegionStarts()") + + oCursor1 = oObj.createTextCursor() + oCursor2 = oObj.createTextCursor() + + nResult = oObj.compareRegionEnds(oCursor1, oCursor2) + bEnd = (nResult = 0) + nResult = oObj.compareRegionStarts(oCursor1, oCursor2) + bStart = (nResult = 0) + + oObj.insertString(oCursor1, cIfcShortName, false) + oObj.insertControlCharacter(oCursor1, 0, false) + oCursor2 = oObj.createTextCursor() + + oObj.insertString(oCursor2, cIfcShortName + cIfcShortName, false) + oObj.insertControlCharacter(oCursor2, 0, false) + + nResult = oObj.compareRegionEnds(oCursor1, oCursor2) + bEnd = bEnd AND (nResult = -1) + nResult = oObj.compareRegionEnds(oCursor2, oCursor1) + bEnd = bEnd AND (nResult = 1) + + nResult = oObj.compareRegionStarts(oCursor1, oCursor2) + bStart = (nResult = -1) + nResult = oObj.compareRegionStarts(oCursor2, oCursor1) + bStart = (nResult = 1) + + Test.MethodTested("compareRegionEnds()", bEnd) + Test.MethodTested("compareRegionStarts()", bStart) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/text/XTextRangeMover/script.xlb b/qadevOOo/tests/basic/ifc/text/XTextRangeMover/script.xlb new file mode 100644 index 000000000000..25b529a589f0 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/XTextRangeMover/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="text_XTextRangeMover" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="text_XTextRangeMover"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/text/XTextRangeMover/text_XTextRangeMover.xba b/qadevOOo/tests/basic/ifc/text/XTextRangeMover/text_XTextRangeMover.xba new file mode 100644 index 000000000000..4922f14464e1 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/XTextRangeMover/text_XTextRangeMover.xba @@ -0,0 +1,71 @@ +<?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="text_XTextRangeMover" 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 + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' - Global oTextRangeToMove As Object + +'************************************************************************* + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.text.XTextRangeMover +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Test.StartMethod("moveTextRange()") + bOK = true + oObj.moveTextRange(oTextRangeToMove, 1) + Test.MethodTested("moveTextRange()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/text/XTextSection/script.xlb b/qadevOOo/tests/basic/ifc/text/XTextSection/script.xlb new file mode 100644 index 000000000000..0335ea7bbf13 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/XTextSection/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="text_XTextSection" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="text_XTextSection"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/text/XTextSection/text_XTextSection.xba b/qadevOOo/tests/basic/ifc/text/XTextSection/text_XTextSection.xba new file mode 100644 index 000000000000..92d4fab6cd7a --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/XTextSection/text_XTextSection.xba @@ -0,0 +1,106 @@ +<?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="text_XTextSection" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.text.XTextSection +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim oPS As Variant, oCS As Variant + Dim i As Integer + Dim bChild As Boolean + + Test.StartMethod("getParentSection()") + bOK = true + oPS = oObj.getParentSection() + if (NOT isNULL(oPS)) then + bOK = bOK AND hasUnoInterfaces(oPS, "com.sun.star.text.XTextSection") + if bOK then + Out.Log("Checking the names of parent's children ...") + oCS = oPS.getChildSections() + bChild = false + for i = 0 to ubound(oCS) + if oCS(i).Name = oObj.Name then bChild = true + next i + if NOT bChild then + Out.Log("The tested section was not found among its parent's child sections.") + bOK = false + endif + else + Out.Log("Wrong object returned.") + bOK = false + endif + else + Out.Log("!!! Not really tested. Parent not found !!!") + end if + Test.MethodTested("getParentSection()", bOK) + + Test.StartMethod("getChildSections()") + bOK = true + oCS = oObj.getChildSections() + bOK = bOK AND isArray(oCS) + if (ubound(oCS) >= 0) then + bOK = bOK AND hasUnoInterfaces(oCS(0), "com.sun.star.text.XTextSection") + if bOK then + Out.Log("Checking the name of child's parent ...") + oPS = oCS(0).getParentSection() + bOK = bOK AND oPS.Name = oObj.Name + if NOT bOK then + Out.Log("Child's parent name isn't match to the object name: '" + oPS.Name + "', '" + oObj.Name + "'") + endif + else + Out.Log("Wrong object returned.") + endif + else + Out.Log("!!! Not really tested. There are no section's children !!!") + bOK = false + end if + Test.MethodTested("getChildSections()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/text/XTextTable/script.xlb b/qadevOOo/tests/basic/ifc/text/XTextTable/script.xlb new file mode 100644 index 000000000000..292086fbe8a5 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/XTextTable/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="text_XTextTable" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="text_XTextTable"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/text/XTextTable/text_XTextTable.xba b/qadevOOo/tests/basic/ifc/text/XTextTable/text_XTextTable.xba new file mode 100644 index 000000000000..32009e626418 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/XTextTable/text_XTextTable.xba @@ -0,0 +1,140 @@ +<?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="text_XTextTable" 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 + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' - Global nTableW As Integer +' - Global nTableH As Integer + +'************************************************************************* + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.text.XTextTable +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim i As Integer, j As Integer + Dim oRows As Object, oColumns As Object + Dim oCursor As Object, oCell As Object + Dim aNames As Variant + Dim nDscColumns As Integer, nDscRows As Integer + + Test.StartMethod("initialize()") + bOK = true + ' Object is already was initialized, when it was created... So, assume that this is OK. + + For i = 0 to nTableW - 1 + For j = 0 to nTableH - 1 + oObj.getCellByPosition(i, j).Value = i + j * nTableW + Next j + Next i + + nDscColumns = ubound(oObj.getColumnDescriptions()) + 1 + nDscRows = ubound(oObj.getRowDescriptions()) + 1 + + bOK = bOK AND nDscRows = nTableH AND nDscColumns = nTableW + if NOT bOK then + Out.Log("The table must have size (" + nTableW + "," + nTableH + _ + "), but descriptions returned for size (" + nDscColumns + "," + nDscRows + ")") + endif + Test.MethodTested("initialize()", bOK) + + Test.StartMethod("getRows()") + bOK = true + + oRows = oObj.getRows() + + bOK = bOK AND hasUnoInterfaces(oRows, "com.sun.star.table.XTableRows") + bOK = bOK AND oRows.getCount() = nTableH + Test.MethodTested("getRows()", bOK) + + Test.StartMethod("getColumns()") + bOK = true + + oColumns = oObj.getColumns() + + bOK = bOK AND hasUnoInterfaces(oColumns, "com.sun.star.table.XTableColumns") + bOK = bOK AND oColumns.getCount() = nTableW + Test.MethodTested("getColumns()", bOK) + + + Test.StartMethod("createCursorByCellName()") + bOK = true + oCursor = oObj.createCursorByCellName("B2") + bOK = bOK AND hasUnoInterfaces(oCursor, "com.sun.star.text.XTextTableCursor") + bOK = bOK AND oCursor.getRangeName() = "B2" + Test.MethodTested("createCursorByCellName()", bOK) + + oCursor.splitRange(1, true) + oCursor.splitRange(1, false) + + Test.StartMethod("getCellNames()") + bOK = true + aNames = oObj.getCellNames() + bOK = bOK AND ubound(aNames) = nTableW * nTableH + 1 ' = nTableW * nTableH - 1 + 2(after splitting) + Test.MethodTested("getCellNames()", bOK) + + Test.StartMethod("getCellByName()") + bOK = true + oCell = oObj.getCellByPosition(0,0) + oCell.String = "A1" + oCell = oObj.getCellByName("A1") + bOK = bOK AND oCell.String = "A1" + + oCell = oObj.getCellByName("B2.2.1") + bOK = bOK AND hasUnoInterfaces(oCell, "com.sun.star.table.XCell") + + Test.MethodTested("getCellByName()", bOK) + + ReCreateObj() +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/text/XTextTableCursor/script.xlb b/qadevOOo/tests/basic/ifc/text/XTextTableCursor/script.xlb new file mode 100644 index 000000000000..6a67335e4ea2 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/XTextTableCursor/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="text_XTextTableCursor" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="text_XTextTableCursor"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/text/XTextTableCursor/text_XTextTableCursor.xba b/qadevOOo/tests/basic/ifc/text/XTextTableCursor/text_XTextTableCursor.xba new file mode 100644 index 000000000000..989a1537b3aa --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/XTextTableCursor/text_XTextTableCursor.xba @@ -0,0 +1,142 @@ +<?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="text_XTextTableCursor" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.text.XTextTableCursor +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Test.StartMethod("gotoStart()") + bOK = true + oObj.gotoStart(false) + bOK = bOK AND Expected("A1") + Test.MethodTested("gotoStart()", bOK) + + Test.StartMethod("getRangeName()") + bOK = true + cName = oObj.getRangeName() + bOK = bOK AND NOT isNULL(cName) + Test.MethodTested("getRangeName()", bOK) + + Test.StartMethod("gotoCellByName()") + bOK = true + bOK = bOK AND oObj.gotoCellByName("B2", true) + bOK = bOK AND Expected("A1:B2") + Test.MethodTested("gotoCellByName()", bOK) + + Test.StartMethod("goLeft()") + bOK = true + bOK = bOK AND oObj.goLeft(1, false) + bOK = bOK AND Expected("A2") + Test.MethodTested("goLeft()", bOK) + + Test.StartMethod("goRight()") + bOK = true + bOK = bOK AND oObj.goRight(3, true) + bOK = bOK AND Expected("A2:D2") + Test.MethodTested("goRight()", bOK) + + Test.StartMethod("goUp()") + bOK = true + bOK = bOK AND oObj.goUp(1, true) + bOK = bOK AND Expected("A2:D1") + Test.MethodTested("goUp()", bOK) + + Test.StartMethod("goDown()") + bOK = true + bOK = bOK AND oObj.goDown(3, false) + bOK = bOK AND Expected("D4") + Test.MethodTested("goDown()", bOK) + + Test.StartMethod("gotoEnd()") + bOK = true + oObj.gotoEnd(true) + bOK = bOK AND Expected("D4:E5") + Test.MethodTested("gotoEnd()", bOK) + + Test.StartMethod("mergeRange()") + bOK = true + oObj.gotoStart(false) + oObj.gotoEnd(true) + bOK = bOK AND oObj.mergeRange() + bOK = bOK AND Expected("A1") + Test.MethodTested("mergeRange()", bOK) + + Test.StartMethod("splitRange()") + bOK = true + bOK = bOK AND oObj.splitRange(3, true) + oObj.gotoEnd(true) + bOK = bOK AND Expected("A1.1.1:A1.1.4") + oObj.gotoStart(false) + bOK = bOK AND oObj.splitRange(2, false) + oObj.goRight(2, true) + bOK = bOK AND Expected("A1.1.1:A1.3.1") + Test.MethodTested("splitRange()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +Function Expected(cName As String) As Boolean + Dim bOK As Boolean + Dim cRangeName As String + Dim cAltName As String + Dim dPos As Integer + + cRangeName = oObj.getRangeName() + + dPos = inStr(1, cName, ":") + if (dPos > 0) then + cAltName = Mid(cName, dPos + 1) & ":" & Left(cName, dPos - 1) + bOK = (cRangeName = cName) OR (cAltName = cRangeName) + else + bOK = cRangeName = cName + end if + + if (NOT bOK) then + Out.Log("Expected RangeName is '" & cName & "' and actual is '" & cRangeName & "'") + end if + + Expected() = bOK +End Function +</script:module> diff --git a/qadevOOo/tests/basic/ifc/text/XTextTablesSupplier/script.xlb b/qadevOOo/tests/basic/ifc/text/XTextTablesSupplier/script.xlb new file mode 100644 index 000000000000..8357f15eee37 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/XTextTablesSupplier/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="text_XTextTablesSupplier" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="text_XTextTablesSupplier"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/text/XTextTablesSupplier/text_XTextTablesSupplier.xba b/qadevOOo/tests/basic/ifc/text/XTextTablesSupplier/text_XTextTablesSupplier.xba new file mode 100644 index 000000000000..ce3b1700ed74 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/XTextTablesSupplier/text_XTextTablesSupplier.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="text_XTextTablesSupplier" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.text.XTextTablesSupplier +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + Test.StartMethod("getTextTables()") + bOK = true + bOK = bOK AND hasUnoInterfaces(oObj.getTextTables(), "com.sun.star.container.XNameAccess") + Test.MethodTested("getTextTables()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/text/XTextViewCursorSupplier/script.xlb b/qadevOOo/tests/basic/ifc/text/XTextViewCursorSupplier/script.xlb new file mode 100644 index 000000000000..82f35ff951ae --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/XTextViewCursorSupplier/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="text_XTextViewCursorSupplier" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="text_XTextViewCursorSupplier"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/text/XTextViewCursorSupplier/text_XTextViewCursorSupplier.xba b/qadevOOo/tests/basic/ifc/text/XTextViewCursorSupplier/text_XTextViewCursorSupplier.xba new file mode 100644 index 000000000000..626fd75dbf08 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/XTextViewCursorSupplier/text_XTextViewCursorSupplier.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="text_XTextViewCursorSupplier" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.text.XTextViewCursorSupplier +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + Test.StartMethod("getViewCursor()") + bOK = true + oCursor = oObj.getViewCursor() + bOK = bOK AND NOT isNULL(oCursor) + bOK = bOK AND oCursor.implementationName = "SwXTextViewCursor" + Test.MethodTested("getViewCursor()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/text/XWordCursor/script.xlb b/qadevOOo/tests/basic/ifc/text/XWordCursor/script.xlb new file mode 100644 index 000000000000..0bf6c008e8e8 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/XWordCursor/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="text_XWordCursor" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="text_XWordCursor"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/text/XWordCursor/text_XWordCursor.xba b/qadevOOo/tests/basic/ifc/text/XWordCursor/text_XWordCursor.xba new file mode 100644 index 000000000000..c1e2936b3241 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/text/XWordCursor/text_XWordCursor.xba @@ -0,0 +1,99 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="text_XWordCursor" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.text.XWordCursor +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + oObj.Text.string = "1Word1: 2Word2, 3Word3." + oObj.gotoStart(false) + + Test.StartMethod("gotoStartOfWord()") + bOK = true + oObj.gotoStartOfWord(false) + oObj.String = "1" + bOK = bOK AND inStr(1, oObj.Text.String, "11W") <> 0 + Test.MethodTested("gotoStartOfWord()", bOK) + + Test.StartMethod("gotoEndOfWord()") + bOK = true + oObj.gotoEndOfWord(false) + oObj.String = "2" + bOK = bOK AND inStr(1, oObj.Text.String, "d12") <> 0 + Test.MethodTested("gotoEndOfWord()", bOK) + + Test.StartMethod("gotoNextWord()") + bOK = true + oObj.gotoNextWord(false) + oObj.gotoNextWord(false) + oObj.gotoEndOfWord(false) + oObj.String = "3" + bOK = bOK AND inStr(1, oObj.Text.String, "d33") <> 0 + Test.MethodTested("gotoNextWord()", bOK) + + Test.StartMethod("gotoPreviousWord()") + bOK = true + oObj.gotoPreviousWord(false) + oObj.gotoStartOfWord(false) + oObj.String = "4" + bOK = bOK AND inStr(1, oObj.Text.String, "42W") <> 0 + Test.MethodTested("gotoPreviousWord()", bOK) + + Test.StartMethod("isStartOfWord()") + bOK = true + oObj.gotoStartOfWord(false) + bOK = bOK AND oObj.isStartOfWord() + Test.MethodTested("isStartOfWord()", bOK) + + Test.StartMethod("isEndOfWord()") + bOK = true + oObj.gotoEndOfWord(false) + bOK = bOK AND oObj.isEndOfWord() + Test.MethodTested("isEndOfWord()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/ucb/XCachedContentResultSetFactory/script.xlb b/qadevOOo/tests/basic/ifc/ucb/XCachedContentResultSetFactory/script.xlb new file mode 100644 index 000000000000..ac4ee4bfe229 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/ucb/XCachedContentResultSetFactory/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="ucb_XCachedContentResultSetFactory" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="ucb_XCachedContentResultSetFactory"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/ucb/XCachedContentResultSetFactory/ucb_XCachedContentResultSetFactory.xba b/qadevOOo/tests/basic/ifc/ucb/XCachedContentResultSetFactory/ucb_XCachedContentResultSetFactory.xba new file mode 100644 index 000000000000..646757fbaa21 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/ucb/XCachedContentResultSetFactory/ucb_XCachedContentResultSetFactory.xba @@ -0,0 +1,91 @@ +<?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="ucb_XCachedContentResultSetFactory" 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 + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' - Global oCachedContentResultSetStub As Object + +'************************************************************************* + + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.ucb.XCachedContentResultSetFactory +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + Test.StartMethod("createCachedContentResultSet()") + bOK = true + + Dim oResSet As Object + oResSet = oObj.createCachedContentResultSet(oCachedContentResultSetStub, NULL_OBJECT) + + If IsNull(oResSet) Then + bOK = False + out.log("Method returned NULL") + Else + Dim stubRowNum, setRowNum As Integer + oCachedContentResultSetStub.last() + stubRowNum = oCachedContentResultSetStub.getRow() + + oResSet.last() + setRowNum = oResSet.getRow() + + bOK = (stubRowNum = setRowNum) and (setRowNum > 0) + out.log("Number of rows : stub=" + stubRowNum + " set=" + setRowNum) + EndIf + + Test.MethodTested("createCachedContentResultSet()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/ucb/XCachedContentResultSetStubFactory/script.xlb b/qadevOOo/tests/basic/ifc/ucb/XCachedContentResultSetStubFactory/script.xlb new file mode 100644 index 000000000000..35e8bdf341f0 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/ucb/XCachedContentResultSetStubFactory/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="ucb_XCachedContentResultSetStubFactory" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="ucb_XCachedContentResultSetStubFactory"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/ucb/XCachedContentResultSetStubFactory/ucb_XCachedContentResultSetStubFactory.xba b/qadevOOo/tests/basic/ifc/ucb/XCachedContentResultSetStubFactory/ucb_XCachedContentResultSetStubFactory.xba new file mode 100644 index 000000000000..a8a4516757e7 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/ucb/XCachedContentResultSetStubFactory/ucb_XCachedContentResultSetStubFactory.xba @@ -0,0 +1,91 @@ +<?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="ucb_XCachedContentResultSetStubFactory" 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 + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' - Global oContentResultSet As Object + +'************************************************************************* + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.ucb.XCachedContentResultSetStubFactory +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + Test.StartMethod("createCachedContentResultSetStub()") + bOK = true + + Dim oResSetStub As Object + oResSetStub = oObj.createCachedContentResultSetStub(oContentResultSet) + + If IsNull(oResSetStub) Then + bOk = False + out.log("Method returned NULL") + Else + Dim stubRowNum, setRowNum As Integer + + oResSetStub.last() + stubRowNum = oResSetStub.getRow() + + oContentResultSet.last() + setRowNum = oContentResultSet.getRow() + + bOk = (stubRowNum = setRowNum) and (setRowNum > 0) + out.log("Number of rows : set=" + setRowNum + "stub=" + stubRowNum) + EndIf + + Test.MethodTested("createCachedContentResultSetStub()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/ucb/XCachedDynamicResultSetFactory/script.xlb b/qadevOOo/tests/basic/ifc/ucb/XCachedDynamicResultSetFactory/script.xlb new file mode 100644 index 000000000000..355cb7dd01b2 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/ucb/XCachedDynamicResultSetFactory/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="ucb_XCachedDynamicResultSetFactory" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="ucb_XCachedDynamicResultSetFactory"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/ucb/XCachedDynamicResultSetFactory/ucb_XCachedDynamicResultSetFactory.xba b/qadevOOo/tests/basic/ifc/ucb/XCachedDynamicResultSetFactory/ucb_XCachedDynamicResultSetFactory.xba new file mode 100644 index 000000000000..292af7567947 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/ucb/XCachedDynamicResultSetFactory/ucb_XCachedDynamicResultSetFactory.xba @@ -0,0 +1,97 @@ +<?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="ucb_XCachedDynamicResultSetFactory" 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 + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +'Global oResSetStub As Object + +'************************************************************************* + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE : +' com.sun.star.ucb.XCachedDynamicResultSetFactory +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Test.StartMethod("createCachedDynamicResultSet()") + bOK = true + + Dim oResSet As Object + oResSet = oObj.createCachedDynamicResultSet(oResSetStub, NULL_OBJECT) + + If IsNull(oResSet) Then + bOk = False + out.log("Method returned NULL") + Else + Dim oResultSetS As Object, oResultSetStubS As Object + + oResultSetS = oResSet.getStaticResultSet() + + oResultSetStubS = oResSetStub.getStaticResultSet() + + Dim stubRowNum As Integer, setRowNum As Integer + + oResultSetStubS.last() + stubRowNum = oResultSetStubS.getRow() + + oResultSetS.last() + setRowNum = oResultSetS.getRow() + + bOK = (stubRowNum = setRowNum) and (setRowNum > 0) + + out.log("Number of rows : stub=" + stubRowNum + " set=" + setRowNum) + EndIf + + Test.MethodTested("createCachedDynamicResultSet()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/ucb/XCachedDynamicResultSetStubFactory/script.xlb b/qadevOOo/tests/basic/ifc/ucb/XCachedDynamicResultSetStubFactory/script.xlb new file mode 100644 index 000000000000..8e6110e4c280 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/ucb/XCachedDynamicResultSetStubFactory/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="ucb_XCachedDynamicResultSetStubFactory" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="ucb_XCachedDynamicResultSetStubFactory"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/ucb/XCachedDynamicResultSetStubFactory/ucb_XCachedDynamicResultSetStubFactory.xba b/qadevOOo/tests/basic/ifc/ucb/XCachedDynamicResultSetStubFactory/ucb_XCachedDynamicResultSetStubFactory.xba new file mode 100644 index 000000000000..8f323d227d5b --- /dev/null +++ b/qadevOOo/tests/basic/ifc/ucb/XCachedDynamicResultSetStubFactory/ucb_XCachedDynamicResultSetStubFactory.xba @@ -0,0 +1,125 @@ +<?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="ucb_XCachedDynamicResultSetStubFactory" 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 + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' - Global oResSet As Object + +'************************************************************************* + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.ucb.XCachedDynamicResultSetStubFactory +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + Test.StartMethod("createCachedDynamicResultSetStub()") + bOK = true + + Dim oResSetStub As Object + oResSetStub = oObj.createCachedDynamicResultSetStub(oResSet) + + If IsNull(oResSetStub) Then + bOK = False + out.log("Method returned NULL") + Else + Dim oResSetS, oResSetStubS As Object + + oResSetS = oResSet.getStaticResultSet() + oResSetStubS = oResSetStub.getStaticResultSet() + + Dim stubRowNum, setRowNum As Integer + + oResSetStubS.last() + stubRowNum = oResSetStubS.getRow() + + oResSetS.last() + setRowNum = oResSetS.getRow() + + bOK = (stubRowNum = setRowNum) and (setRowNum > 0) + + out.log("Number of rows : stub=" + stubRowNum + " set=" + setRowNum) + EndIf + + Test.MethodTested("createCachedDynamicResultSetStub()", bOK) + + Test.StartMethod("connectToCache()") + bOK = true + + Dim oFac As Object + oFac = createUnoService("com.sun.star.ucb.CachedDynamicResultSetFactory") + + Dim oDynResSet As Object + oDynResSet = oFac.createCachedDynamicResultSet(NULL_OBJECT, NULL_OBJECT) + + oObj.connectToCache(oResSet, oDynResSet, NULL_OBJECT, NULL_OBJECT) + + out.log("checking connection to the source...") + + oResSetS = oResSet.getStaticResultSet() + oResSetStubS = oDynResSet.getStaticResultSet() + + oResSetStubS.last() + stubRowNum = oResSetStubS.getRow() + + oResSetS.last() + setRowNum = oResSetS.getRow() + + bOK = (stubRowNum = setRowNum) and (setRowNum > 0) + + out.log("Number of rows : stub=" + stubRowNum + " set=" + setRowNum) + + Test.MethodTested("connectToCache()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/ucb/XCommandProcessor/script.xlb b/qadevOOo/tests/basic/ifc/ucb/XCommandProcessor/script.xlb new file mode 100644 index 000000000000..5b0eb48543ee --- /dev/null +++ b/qadevOOo/tests/basic/ifc/ucb/XCommandProcessor/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="ucb_XCommandProcessor" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="ucb_XCommandProcessor"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/ucb/XCommandProcessor/ucb_XCommandProcessor.xba b/qadevOOo/tests/basic/ifc/ucb/XCommandProcessor/ucb_XCommandProcessor.xba new file mode 100644 index 000000000000..3281500c4b1d --- /dev/null +++ b/qadevOOo/tests/basic/ifc/ucb/XCommandProcessor/ucb_XCommandProcessor.xba @@ -0,0 +1,85 @@ +<?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="ucb_XCommandProcessor" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.ucb.XCommandProcessor +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Dim CommandId As Long + Dim oCommand As New com.sun.star.ucb.Command + Dim Environment As Object + Dim Res As Variant + Dim Commands As Variant + + Test.StartMethod("createCommandIdentifier()") + bOK = true + CommandId = oObj.createCommandIdentifier() + bOK = bOK AND CommandId <> 0 + Test.MethodTested("createCommandIdentifier()", bOK) + + Test.StartMethod("execute()") + bOK = true + oCommand.Name = "getCommandInfo" + oCommand.Handle = -1 + oCommand.Argument = "arg" + + Res = oObj.execute(oCommand, CommandId, Environment) + Out.Log("getCommandInfo returned: ") + Commands = Res.getCommands() + for i = 0 to ubound(commands) + Out.Log " " & commands(i).Name + next i + + Test.MethodTested("execute()", bOK) + + Test.StartMethod("abort()") + bOK = true + oObj.abort(CommandId) + Test.MethodTested("abort()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/ucb/XContentIdentifierFactory/script.xlb b/qadevOOo/tests/basic/ifc/ucb/XContentIdentifierFactory/script.xlb new file mode 100644 index 000000000000..52e741f78ce3 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/ucb/XContentIdentifierFactory/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="ucb_XContentIdentifierFactory" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="ucb_XContentIdentifierFactory"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/ucb/XContentIdentifierFactory/ucb_XContentIdentifierFactory.xba b/qadevOOo/tests/basic/ifc/ucb/XContentIdentifierFactory/ucb_XContentIdentifierFactory.xba new file mode 100644 index 000000000000..32e2149f0c88 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/ucb/XContentIdentifierFactory/ucb_XContentIdentifierFactory.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="ucb_XContentIdentifierFactory" 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 + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' - Global sContentID As String + +'************************************************************************* + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.ucb.XContentIdentifierFactory +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim ContentID As Object + + if (sContentID = "") then + Out.Log("sContentID NOT initialized!") + Exit Sub + end if + + Test.StartMethod("createContentIdentifier()") + bOK = true + ContentID = oObj.createContentIdentifier(sContentID) + bOK = bOK AND hasUNOInterfaces(ContentID, "com.sun.star.ucb.XContentIdentifier") + Test.MethodTested("createContentIdentifier()", bOK) +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/ucb/XContentProvider/script.xlb b/qadevOOo/tests/basic/ifc/ucb/XContentProvider/script.xlb new file mode 100644 index 000000000000..8f76e1207192 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/ucb/XContentProvider/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="ucb_XContentProvider" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="ucb_XContentProvider"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/ucb/XContentProvider/ucb_XContentProvider.xba b/qadevOOo/tests/basic/ifc/ucb/XContentProvider/ucb_XContentProvider.xba new file mode 100644 index 000000000000..437c6e543bfd --- /dev/null +++ b/qadevOOo/tests/basic/ifc/ucb/XContentProvider/ucb_XContentProvider.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="ucb_XContentProvider" 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 + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' - Global ContentID1 As Object +' - Global ContentID2 As Object + +'************************************************************************* + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.ucb.XContentProvider +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim compRes As Integer + Dim Content As Object + + if (NOT hasUNOInterfaces(ContentID1, "com.sun.star.ucb.XContentIdentifier") OR _ + NOT hasUNOInterfaces(ContentID2, "com.sun.star.ucb.XContentIdentifier")) then + Out.Log("ContentID1 or/and ContentID2 not initialized.") + Exit Sub + end if + + Test.StartMethod("queryContent()") + bOK = true + Out.Log("Try to query content for '" & ContentID1.getContentIdentifier() & "'") + Content = oObj.queryContent(ContentID1) + bOK = bOK AND hasUnoInterfaces(Content, "com.sun.star.ucb.XContent") + Out.Log("Content is XContent - " & bOK) + if (bOK) then + Out.Log("Returned identifier is " & Content.getIdentifier.getContentIdentifier()) + bOK = bOK AND (Content.getIdentifier.getContentIdentifier() = ContentID1.getContentIdentifier()) + end if + Test.MethodTested("queryContent()", bOK) + + Test.StartMethod("compareContentIds()") + bOK = true + compRes = oObj.compareContentIds(ContentID1, ContentID2) + bOK = bOK AND compRes <> 0 + compRes = oObj.compareContentIds(ContentID2, ContentID2) + bOK = bOK AND compRes = 0 + Test.MethodTested("compareContentIds()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/ucb/XContentProviderFactory/script.xlb b/qadevOOo/tests/basic/ifc/ucb/XContentProviderFactory/script.xlb new file mode 100644 index 000000000000..d4230fd9c2e4 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/ucb/XContentProviderFactory/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="ucb_XContentProviderFactory" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="ucb_XContentProviderFactory"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/ucb/XContentProviderFactory/ucb_XContentProviderFactory.xba b/qadevOOo/tests/basic/ifc/ucb/XContentProviderFactory/ucb_XContentProviderFactory.xba new file mode 100644 index 000000000000..b667fa59c743 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/ucb/XContentProviderFactory/ucb_XContentProviderFactory.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="ucb_XContentProviderFactory" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.ucb.XContentProviderFactory +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + Test.StartMethod("createContentProvider()") + bOK = true + bOK = bOK AND hasUnoInterfaces(oObj.createContentProvider(_ + "com.sun.star.ucb.ContentProviderFactory"),_ + "com.sun.star.ucb.XContentProvider") + Test.MethodTested("createContentProvider()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/ucb/XContentProviderManager/script.xlb b/qadevOOo/tests/basic/ifc/ucb/XContentProviderManager/script.xlb new file mode 100644 index 000000000000..020d1bbd6498 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/ucb/XContentProviderManager/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="ucb_XContentProviderManager" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="ucb_XContentProviderManager"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/ucb/XContentProviderManager/ucb_XContentProviderManager.xba b/qadevOOo/tests/basic/ifc/ucb/XContentProviderManager/ucb_XContentProviderManager.xba new file mode 100644 index 000000000000..478485d31a4a --- /dev/null +++ b/qadevOOo/tests/basic/ifc/ucb/XContentProviderManager/ucb_XContentProviderManager.xba @@ -0,0 +1,115 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="ucb_XContentProviderManager" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.ucb.XContentProviderManager +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Dim Provider As Object + Dim Scheme As String + Dim ReplaceExisting As Boolean + Dim ContentProvider As Object + Dim queryInfo As Variant + Dim bFound As Boolean + + Test.StartMethod("queryContentProviders()") + bOK = true + queryInfo = oObj.queryContentProviders() + Out.Log("queryContentProviders() returned " & ubound(queryInfo) & " elements.") + for i = 0 to ubound(queryInfo) + Out.Log(queryInfo(i).Scheme) + next i + Test.MethodTested("queryContentProviders()", bOK) + + Test.StartMethod("registerContentProvider()") + bOK = true + ReplaceExisting = true + Scheme = "XContentProviderManager" + Provider = createUNOService("com.sun.star.ucb.FileContentProvider") + Out.Log("Registering Scheme = '" & Scheme & "'") + ContentProvider = oObj.registerContentProvider(Provider, Scheme, ReplaceExisting) + bOK = bOK AND hasUnoInterfaces(ContentProvider, "com.sun.star.ucb.XContentProvider") + Out.Log("ContentProvider is XContentProvider - " & bOK) + if bOK then + bFound = false + queryInfo = oObj.queryContentProviders() + for i = 0 to ubound(queryInfo) + bFound = bFound OR queryInfo(i).Scheme = Scheme + next i + if NOT bFound then + Out.Log("Can't find registered ContentProvider in query!") + bOK = false + end if + end if + Test.MethodTested("registerContentProvider()", bOK) + + Test.StartMethod("deregisterContentProvider()") + if bOK then + oObj.deregisterContentProvider(ContentProvider, Scheme) + bFound = false + queryInfo = oObj.queryContentProviders() + for i = 0 to ubound(queryInfo) + bFound = bFound OR queryInfo(i).Scheme = Scheme + next i + if bFound then + Out.Log("ContentProvider was found in query! It was not DeRegistered!") + bOK = false + end if + else + Out.Log("Can't deregister ContentProvider without registering!") + end if + + Test.MethodTested("deregisterContentProvider()", bOK) + + Test.StartMethod("queryContentProvider()") + bOK = true + ContentProvider = oObj.queryContentProvider(queryInfo(0).Scheme) + bOK = bOK AND hasUnoInterfaces(ContentProvider, "com.sun.star.ucb.XContentProvider") + Test.MethodTested("queryContentProvider()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/ucb/XDataContainer/script.xlb b/qadevOOo/tests/basic/ifc/ucb/XDataContainer/script.xlb new file mode 100644 index 000000000000..c5b36f463e24 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/ucb/XDataContainer/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="ucb_XDataContainer" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="ucb_XDataContainer"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/ucb/XDataContainer/ucb_XDataContainer.xba b/qadevOOo/tests/basic/ifc/ucb/XDataContainer/ucb_XDataContainer.xba new file mode 100644 index 000000000000..362684c3853d --- /dev/null +++ b/qadevOOo/tests/basic/ifc/ucb/XDataContainer/ucb_XDataContainer.xba @@ -0,0 +1,155 @@ +<?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="ucb_XDataContainer" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.ucb.XDataContainer +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim i As Integer + + + Test.StartMethod("setContentType()") + Test.StartMethod("getContentType()") + + Dim aContType As String + Dim objContType As String + Dim newContType As String + + bOK = true + aContType = oObj.getContentType() + Out.Log("Current content type is: '" + aContType + "'") + newContType = "text/html" + + if (newContType = aContType) then + newContType = "text/plain" + end if + + Out.Log("Trying to change type to " + newContType) + oObj.setContentType(newContType) + + objContType = oObj.getContentType() + Out.Log("Actual content type is: '" + objContType + "'") + bOK = bOK AND objContType = newContType + Out.Log("Change type back to original...") + oObj.setContentType(aContType) + + Test.MethodTested("getContentType()", bOK) + Test.MethodTested("setContentType()", bOK) + + + Test.StartMethod("getData()") + bOK = true + + Dim Data As Variant + + Data = oObj.getData() + Out.Log("getData returned array with ubound = " + ubound(Data)) + bOK = bOK AND ubound(Data) >= -1 + for i = 0 to ubound(Data) + Out.Log("" + Data(i) + " " + chr(Data(i))) + next i + Test.MethodTested("getData()", bOK) + + Test.StartMethod("setData()") + bOK = true + + Dim DataToSet As Variant + DataToSet = DimArray(ubound(Data())) + + for i = 0 to ubound(DataToSet()) + DataToSet(i) = Data(i) + 1 + next i + + oObj.setData(DataToSet) + Data = oObj.getData() + Out.Log("after setData() call: getData returned array with ubound = " + ubound(Data)) + bOK = bOK AND (ubound(Data) = ubound(DataToSet)) + if (bOK) then + for i = 0 to ubound(Data) + Out.Log("" + Data(i) + " " + chr(Data(i))) + bOK = bOK AND (DataToSet(i) = Data(i)) + next i + end if + + Test.MethodTested("setData()", bOK) + + Test.StartMethod("getDataURL()") + Test.StartMethod("setDataURL()") + + + Dim aDataURL As String + Dim objDataURL As String + Dim newDataURL As String + + bOK = true + aDataURL = oObj.getDataURL() + Out.Log("Current data URL is: '" + aDataURL + "'") + newDataURL = "http://www.sun.com" + if (newDataURL = aDataURL) then + newDataURL = "http://www.openoffice.org" + end if + + Out.Log("Trying to change data URL to " + newDataURL) + oObj.setDataURL(newDataURL) + + objDataURL = oObj.getDataURL() + Out.Log("Actual data URL is: '" + objDataURL + "'") + bOK = bOK AND objDataURL = newDataURL + Out.Log("Change data URL back to original...") + oObj.setDataURL(aDataURL) + + Out.Log("Methods getDataURL() and setDataURL() are DEPRICATED. The result of test is ALWAYS true!") + + bOK = true + + Test.MethodTested("getDataURL()", bOK) + Test.MethodTested("setDataURL()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/ucb/XFileIdentifierConverter/script.xlb b/qadevOOo/tests/basic/ifc/ucb/XFileIdentifierConverter/script.xlb new file mode 100644 index 000000000000..81007cb5654c --- /dev/null +++ b/qadevOOo/tests/basic/ifc/ucb/XFileIdentifierConverter/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="ucb_XFileIdentifierConverter" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="ucb_XFileIdentifierConverter"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/ucb/XFileIdentifierConverter/ucb_XFileIdentifierConverter.xba b/qadevOOo/tests/basic/ifc/ucb/XFileIdentifierConverter/ucb_XFileIdentifierConverter.xba new file mode 100644 index 000000000000..8b69b8f6cdc2 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/ucb/XFileIdentifierConverter/ucb_XFileIdentifierConverter.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="ucb_XFileIdentifierConverter" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.ucb.XFileIdentifierConverter +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim iRes As Integer + Dim sRes As String + + + Test.StartMethod("getFileProviderLocality()") + bOK = true + + Out.Log("Test that " & cBaseURL & " is correct") + iRes = oObj.getFileProviderLocality(cBaseURL) + Out.Log("Returned value is " & iRes) + bOK = bOK AND iRes > 0 + + Out.Log("Test that wrong URL is NOT correct") + iRes = oObj.getFileProviderLocality("++lsjd_!!") + Out.Log("Returned value is " & iRes) + bOK = bOK AND iRes < 0 + + Test.MethodTested("getFileProviderLocality()", bOK) + + Test.StartMethod("getFileURLFromSystemPath()") + bOK = true + Out.Log("Convert " & cSystemPath) + sRes = oObj.getFileURLFromSystemPath(cBaseURL, cSystemPath) + Out.Log("Returned value is " & sRes) + bOK = bOK AND sRes = Path2URL(cSystemPath) + Test.MethodTested("getFileURLFromSystemPath()", bOK) + + Test.StartMethod("getSystemPathFromFileURL()") + bOK = true + Out.Log("Convert " & cURLPath) + sRes = oObj.getSystemPathFromFileURL(cURLPath) + Out.Log("Returned value is " & sRes) + bOK = bOK AND sRes = URL2Path(cURLPath) + Test.MethodTested("getSystemPathFromFileURL()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/ucb/XPropertyMatcherFactory/script.xlb b/qadevOOo/tests/basic/ifc/ucb/XPropertyMatcherFactory/script.xlb new file mode 100644 index 000000000000..a5c8a5a0a01c --- /dev/null +++ b/qadevOOo/tests/basic/ifc/ucb/XPropertyMatcherFactory/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="ucb_XPropertyMatcherFactory" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="ucb_XPropertyMatcherFactory"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/ucb/XPropertyMatcherFactory/ucb_XPropertyMatcherFactory.xba b/qadevOOo/tests/basic/ifc/ucb/XPropertyMatcherFactory/ucb_XPropertyMatcherFactory.xba new file mode 100644 index 000000000000..59cf541e3b34 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/ucb/XPropertyMatcherFactory/ucb_XPropertyMatcherFactory.xba @@ -0,0 +1,71 @@ +<?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="ucb_XPropertyMatcherFactory" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.ucb.XPropertyMatcherFactory +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim oSearchCriteria(0) As New com.sun.star.ucb.SearchCriterium + Dim oTerms(0) As New com.sun.star.ucb.RuleTerm + Dim oPropertyMatcher As Object + + + Test.StartMethod("createPropertyMatcher()") + bOK = true + oTerms(0).Property = "Name" + oTerms(0).Operand = 1 + oTerms(0).Operator = "=" + oTerms(0).CaseSensitive = false + oTerms(0).RegularExpression = false + + oSearchCriteria(0).Terms = oTerms() + oPropertyMatcher = oObj.createPropertyMatcher(oSearchCriteria()) + + bOK = bOK AND hasUnoInterfaces(oPropertyMatcher, "com.sun.star.ucb.XPropertyMatcher") + Test.MethodTested("createPropertyMatcher()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/ucb/XPropertySetRegistryFactory/script.xlb b/qadevOOo/tests/basic/ifc/ucb/XPropertySetRegistryFactory/script.xlb new file mode 100644 index 000000000000..e21cccfe01f9 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/ucb/XPropertySetRegistryFactory/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="ucb_XPropertySetRegistryFactory" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="ucb_XPropertySetRegistryFactory"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/ucb/XPropertySetRegistryFactory/ucb_XPropertySetRegistryFactory.xba b/qadevOOo/tests/basic/ifc/ucb/XPropertySetRegistryFactory/ucb_XPropertySetRegistryFactory.xba new file mode 100644 index 000000000000..da9574f36b1b --- /dev/null +++ b/qadevOOo/tests/basic/ifc/ucb/XPropertySetRegistryFactory/ucb_XPropertySetRegistryFactory.xba @@ -0,0 +1,62 @@ +<?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="ucb_XPropertySetRegistryFactory" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.ucb.XPropertySetRegistryFactory +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + Test.StartMethod("createPropertySetRegistry()") + bOK = true + + bOK = bOK AND hasUnoInterfaces(oObj.createPropertySetRegistry(""),_ + "com.sun.star.ucb.XPropertySetRegistry") + + Test.MethodTested("createPropertySetRegistry()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/ucb/XSimpleFileAccess/script.xlb b/qadevOOo/tests/basic/ifc/ucb/XSimpleFileAccess/script.xlb new file mode 100644 index 000000000000..ce7b93254b04 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/ucb/XSimpleFileAccess/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="ucb_XSimpleFileAccess" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="ucb_XSimpleFileAccess"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/ucb/XSimpleFileAccess/ucb_XSimpleFileAccess.xba b/qadevOOo/tests/basic/ifc/ucb/XSimpleFileAccess/ucb_XSimpleFileAccess.xba new file mode 100644 index 000000000000..c4c24686f6c6 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/ucb/XSimpleFileAccess/ucb_XSimpleFileAccess.xba @@ -0,0 +1,242 @@ +<?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="ucb_XSimpleFileAccess" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.ucb.XSimpleFileAccess +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim testDir As String + Dim cSubFolder As String + Dim cFile1 As String + Dim cFile2 As String + Dim cFile3 As String + Dim oFC As Variant + Dim oDT As Object + Dim oOS As Object + Dim oIS As Object + Dim cFileName As String + Dim cCrDate As String + Dim cType As String + Dim i As Integer + Dim k As Integer + Dim oIH As Object + + Dim Bytes(5) As Integer + for i = 0 to 5 + Bytes(i) = i + next i + + testDir = utils.Path2URL(cTestDocsDir + "XSimpleFileAccessBASIC") + Out.Log("Test directory is '" + testDir + "'") + cSubFolder = utils.getTempFileURL( + "/SubFolder") + cFile1 = utils.Path2URL(testDir + "/File1.txt") + cFile2 = utils.Path2URL(testDir + "/File2.txt") + cFile3 = utils.Path2URL(cSubFolder + "/File3.txt") + if FileExists(cFile3) then kill(cFile3) + if (FileExists(cSubFolder)) then rmDir(cSubFolder) + + Out.Log("Test that files are in place...") + bOK = true + bOK = bOK AND FileExists(cFile1) + bOK = bOK AND FileExists(cFile2) + if (NOT bOK) then + Out.Log("Can't find '" + cFile1 + "' and/or '" + cFile2 + "'") + Exit Sub + end if + + Test.StartMethod("createFolder()") + bOK = true + Out.Log("Creating subfolder '" + cSubFolder + "'") + oObj.createFolder(cSubFolder) + bOK = bOK AND FileExists(cSubFolder) + Test.MethodTested("createFolder()", bOK) + + Test.StartMethod("isFolder()") + bOK = true + bOK = bOK AND oObj.isFolder(cSubFolder) + bOK = bOK AND NOT oObj.isFolder(cFile1) + Test.MethodTested("isFolder()", bOK) + + Test.StartMethod("getFolderContents()") + bOK = true + Out.Log("Getting content of folder '" + utils.Path2URL(cTestDocsDir) + "'") + oFC = oObj.getFolderContents(utils.Path2URL(cTestDocsDir), False) + ' Getting files amount (without folders) + cFileName = Dir(utils.Path2URL(cTestDocsDir)) + i = 0 + Out.Log("File list :") + while (cFileName <> "") + Out.Log(" " + cFileName) + i = i + 1 + cFileName = Dir() + wend + + bOK = bOK AND ubound(oFC) = i - 1 + if (bOK) then + for k = 0 to i - 1 + bOK = bOK AND FileExists(oFC(k)) + next k + else + Out.Log("Amount of files in list is wrong: " + (ubound(oFC) + 1) + "," + i) + + end if + + Test.MethodTested("getFolderContents()", bOK) + + Test.StartMethod("move()") + bOK = true + oObj.move(cFile2, cFile3) + bOK = bOK AND FileExists(cFile3) AND NOT FileExists(cFile2) + Test.MethodTested("move()", bOK) + + Test.StartMethod("copy()") + bOK = true + oObj.copy(cFile3, cFile2) + bOK = bOK AND FileExists(cFile3) AND FileExists(cFile2) + Test.MethodTested("copy()", bOK) + + Test.StartMethod("openFileWrite()") + bOK = true + + Test.StartMethod("kill()") + bOK = true + oObj.kill(cFile3) + bOK = bOK AND NOT FileExists(cFile3) + Test.MethodTested("kill()", bOK) + + Test.StartMethod("exists()") + bOK = true + bOK = bOK AND oObj.exists(cFile1) = FileExists(cFile1) AND oObj.exists(cFile3) = FileExists(cFile3) + Test.MethodTested("exists()", bOK) + + Out.Log("creating a new file '" + cFile3 + "'") + oOS = oObj.openFileWrite(cFile3) + bOK = bOK AND NOT isNULL(oOS) + bOK = bOK AND FileExists(cFile3) + if (bOK) then + oOS.writeBytes(Bytes()) + oOS.closeOutput() + end if + Test.MethodTested("openFileWrite()", bOK) + + Test.StartMethod("getSize()") + bOK = true + Out.Log("Actual: " + oObj.getSize(cFile3) + " Expected: " + (ubound(Bytes()) + 1)) + bOK = bOK AND oObj.getSize(cFile3) = (ubound(Bytes()) + 1) + Test.MethodTested("getSize()", bOK) + + Test.StartMethod("setReadOnly()") + Test.StartMethod("isReadOnly()") + bOK = true + oObj.setReadOnly(cSubFolder, true) + bOK = bOK AND oObj.isReadOnly(cSubFolder) + oObj.setReadOnly(cSubFolder, false) + bOK = bOK AND NOT oObj.isReadOnly(cSubFolder) + Test.MethodTested("isReadOnly()", bOK) + Test.MethodTested("setReadOnly()", bOK) + + Test.StartMethod("getContentType()") + bOK = true + cType = oObj.getContentType(cFile3) + Out.Log("Content Type is '" + cType + "'") + Test.MethodTested("getContentType()", bOK) + + Test.StartMethod("getDateTimeModified()") + bOK = true + oDT = oObj.getDateTimeModified(cFile3) + cCrDate = Date() + + + bOK = bOK AND Day(cCrDate) = oDT.Day + bOK = bOK AND Month(cCrDate) = oDT.Month + bOK = bOK AND Year(cCrDate) = oDT.Year + + if (NOT bOK) then + Out.Log("FileDateTime returned '" + cCrDate + "'") + Out.Log("getDateTimeModified returned '" + oDT.Day + "/" _ + + oDT.Month + "/" _ + + oDT.Year + " " _ + + oDT.Hours + ":" _ + + oDT.Minutes + ":" _ + + oDT.Seconds + "'") + end if + Test.MethodTested("getDateTimeModified()", bOK) + + Test.StartMethod("openFileRead()") + bOK = true + oIS = oObj.openFileRead(cFile3) + bOK = bOK AND NOT isNULL(oIS) + Dim rData(10) As Integer + Dim nRb As Integer + nRb = oIS.readBytes(rData(), 100) + bOK = bOK AND nRb = ubound(Bytes()) + 1 + if (NOT bOK) then + Out.Log("Amount of read files is wrong") + else + for i = 0 to nRb - 1 + bOK = bOK AND Bytes(i) = rData(i) + next i + end if + oIS.closeInput() + Test.MethodTested("openFileRead()", bOK) + + Test.StartMethod("openFileReadWrite()") + bOK = true + oIS = oObj.openFileReadWrite(cFile3) + bOK = bOK AND hasUnoInterfaces(oIS, "com.sun.star.io.XStream") + Test.MethodTested("openFileReadWrite()", bOK) + + Test.StartMethod("setInteractionHandler()") + bOK = true + oIH = createUNOInterface("com.sun.star.sdb.InteractionHandler") + oObj.setInteractionHandler(oIH) + Test.MethodTested("setInteractionHandler()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/ucb/XSimpleFileAccess2/script.xlb b/qadevOOo/tests/basic/ifc/ucb/XSimpleFileAccess2/script.xlb new file mode 100644 index 000000000000..d7216c83c7f8 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/ucb/XSimpleFileAccess2/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="ucb_XSimpleFileAccess2" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="ucb_XSimpleFileAccess2"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/ucb/XSimpleFileAccess2/ucb_XSimpleFileAccess2.xba b/qadevOOo/tests/basic/ifc/ucb/XSimpleFileAccess2/ucb_XSimpleFileAccess2.xba new file mode 100644 index 000000000000..95933450c149 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/ucb/XSimpleFileAccess2/ucb_XSimpleFileAccess2.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="ucb_XSimpleFileAccess2" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.ucb.XSimpleFileAccess2 +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim urlFileForWrite As String + Dim urlFileForRead As String + Dim oInputStream As Object + + Test.StartMethod("writeFile()") + + urlFileForWrite = utils.getTempFileURL("XSimpleFileAccess_new.txt") + urlFileForRead = utils.Path2URL(cTestDocsDir + "\XSimpleFileAccess\XSimpleFileAccess.txt") + + oInputStream = oObj.openFileRead(urlFileForRead) + + if oObj.exists(urlFileForWrite) then + oObj.kill(urlFileForWrite) + endif + + oObj.writeFile(urlFileForWrite, oInputStream) + wait(1000) + + bOK = oObj.exists(urlFileForWrite) + oObj.kill(urlFileForWrite) + + Test.MethodTested("writeFile()", bOK) +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/ucb/XSortedDynamicResultSetFactory/script.xlb b/qadevOOo/tests/basic/ifc/ucb/XSortedDynamicResultSetFactory/script.xlb new file mode 100644 index 000000000000..60ad898df6de --- /dev/null +++ b/qadevOOo/tests/basic/ifc/ucb/XSortedDynamicResultSetFactory/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="ucb_XSortedDynamicResultSetFactory" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="ucb_XSortedDynamicResultSetFactory"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/ucb/XSortedDynamicResultSetFactory/ucb_XSortedDynamicResultSetFactory.xba b/qadevOOo/tests/basic/ifc/ucb/XSortedDynamicResultSetFactory/ucb_XSortedDynamicResultSetFactory.xba new file mode 100644 index 000000000000..d32aee8b52d9 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/ucb/XSortedDynamicResultSetFactory/ucb_XSortedDynamicResultSetFactory.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="ucb_XSortedDynamicResultSetFactory" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.ucb.XSortedDynamicResultSetFactory +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + Test.StartMethod("createSortedDynamicResultSet()") + + Dim oUCB As Object + oUCB = createUnoService("com.sun.star.ucb.UniversalContentBroker") + Dim args As Variant + args = Array("Local", "Office") + oUCB.initialize(args()) + + Dim sURL, sCntURL As String + sURL = utils.Path2URL(cTestDocsDir & "solibrary.jar") + sURL = utils.utils.StrReplace(sURL, "/", "%2F") + sCntURL = "vnd.sun.star.pkg://" & sURL & "/" + + Dim oCI, oContent As Object + oCI = oUCB.createContentIdentifier(sCntUrl) + oContent = oUCB.queryContent(oCI) + + Dim props(0) As new com.sun.star.beans.Property + Dim cmd As new com.sun.star.ucb.Command + Dim ocArg As new com.sun.star.ucb.OpenCommandArgument2 + Dim sortInfo(0) As new com.sun.star.ucb.NumberedSortingInfo + Dim oDynResSet As Object + + props(0).Name = "Title" + + ocArg.Mode = com.sun.star.ucb.OpenMode.ALL + ocArg.Priority = 10000 + ocArg.Properties = props() + ocArg.SortingInfo = sortInfo() + + cmd.Name = "open" + cmd.Handle = -1 + cmd.Argument = ocArg + + oDynResSet = oContent.execute(cmd, 0, NULL_OBJECT) + + Dim oSortedSet As Object + oSortedSet = oObj.createSortedDynamicResultSet(oDynResSet, sortInfo(), NULL_OBJECT) + + If IsNULL(oSortedSet) Then + out.log("returns null") + bOK = False + Else + Dim oSet As Object + oSet = oSortedSet.getStaticResultSet() + oSet.last() + Dim rowCount As Integer + rowCount = oSet.getRow() + out.log("number of row : " + rowCount) + bOK = rowCount > 0 + EndIf + + Test.MethodTested("createSortedDynamicResultSet()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/ui/dialogs/FilePicker/script.xlb b/qadevOOo/tests/basic/ifc/ui/dialogs/FilePicker/script.xlb new file mode 100644 index 000000000000..97d3bbc7b5e1 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/ui/dialogs/FilePicker/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="ui_dialogs_FilePicker" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="ui_dialogs_FilePicker"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/ui/dialogs/FilePicker/ui_dialogs_FilePicker.xba b/qadevOOo/tests/basic/ifc/ui/dialogs/FilePicker/ui_dialogs_FilePicker.xba new file mode 100644 index 000000000000..e8405adf89ad --- /dev/null +++ b/qadevOOo/tests/basic/ifc/ui/dialogs/FilePicker/ui_dialogs_FilePicker.xba @@ -0,0 +1,55 @@ +<?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="ui_dialogs_FilePicker" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.ui.dialogs.FilePicker +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + PropertyTester.TestProperty("HelpURL") + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/ui/dialogs/XExecutableDialog/script.xlb b/qadevOOo/tests/basic/ifc/ui/dialogs/XExecutableDialog/script.xlb new file mode 100644 index 000000000000..c0953782f731 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/ui/dialogs/XExecutableDialog/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="ui_dialogs_XExecutableDialog" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="ui_dialogs_XExecutableDialog"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/ui/dialogs/XExecutableDialog/ui_dialogs_XExecutableDialog.xba b/qadevOOo/tests/basic/ifc/ui/dialogs/XExecutableDialog/ui_dialogs_XExecutableDialog.xba new file mode 100644 index 000000000000..95ec3646476b --- /dev/null +++ b/qadevOOo/tests/basic/ifc/ui/dialogs/XExecutableDialog/ui_dialogs_XExecutableDialog.xba @@ -0,0 +1,68 @@ +<?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="ui_dialogs_XExecutableDialog" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.ui.dialogs.XExecutableDialog +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + Test.StartMethod("setTitle()") + bOK = true + oObj.setTitle("XExecutableDialog") + Test.MethodTested("setTitle()", bOK) + + Test.StartMethod("execute()") + bOK = true +' oObj.execute() + Out.Log("This method is excluded from automated test since we can't close the dialog") + Test.MethodTested("execute()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/ui/dialogs/XFilePicker/script.xlb b/qadevOOo/tests/basic/ifc/ui/dialogs/XFilePicker/script.xlb new file mode 100644 index 000000000000..36ee0adb752c --- /dev/null +++ b/qadevOOo/tests/basic/ifc/ui/dialogs/XFilePicker/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="ui_dialogs_XFilePicker" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="ui_dialogs_XFilePicker"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/ui/dialogs/XFilePicker/ui_dialogs_XFilePicker.xba b/qadevOOo/tests/basic/ifc/ui/dialogs/XFilePicker/ui_dialogs_XFilePicker.xba new file mode 100644 index 000000000000..9b3e99ffd411 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/ui/dialogs/XFilePicker/ui_dialogs_XFilePicker.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="ui_dialogs_XFilePicker" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.ui.dialogs.XFilePicker +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim fileName As String, getDir As String + Dim getFiles As Variant, tempURL As String + + tempURL = utils.Path2URL(cTestDocsDir) + + Test.StartMethod("setMultiSelectionMode()") + bOK = true + oObj.setMultiSelectionMode(true) + oObj.setMultiSelectionMode(false) + Test.MethodTested("setMultiSelectionMode()", bOK) + + Test.StartMethod("setDisplayDirectory()") + Out.Log("Trying to set dir : '" + tempURL + "'") + oObj.setDisplayDirectory(tempURL) + + Test.StartMethod("getDisplayDirectory()") + bOK = true + getDir = oObj.getDisplayDirectory() + Out.Log("Returned directory : '" + getDir + "'") + bOK = bOK AND (getDir = tempURL) + Test.MethodTested("setDisplayDirectory()", bOK) + Test.MethodTested("getDisplayDirectory()", bOK) + + Test.StartMethod("setDefaultName()") + bOK = true + fileName = "BasicBridge.sxw" + oObj.setDefaultName(fileName) + Test.MethodTested("setDefaultName()", bOK) + + Test.StartMethod("getFiles()") + bOK = true + getFiles = oObj.getFiles() + Out.Log("Returned files count : " + ubound(getFiles())) + Out.Log("To have any files returned the FilePicker dialog must be executed, but this") + Out.Log("requires interactivity. Thus the fact that no files are selected is OK") + bOK = bOK AND (ubound(getFiles()) = -1) + Test.MethodTested("getFiles()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/ui/dialogs/XFilePickerControlAccess/script.xlb b/qadevOOo/tests/basic/ifc/ui/dialogs/XFilePickerControlAccess/script.xlb new file mode 100644 index 000000000000..f51b76b90abc --- /dev/null +++ b/qadevOOo/tests/basic/ifc/ui/dialogs/XFilePickerControlAccess/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="ui_dialogs_XFilePickerControlAccess" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="ui_dialogs_XFilePickerControlAccess"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/ui/dialogs/XFilePickerControlAccess/ui_dialogs_XFilePickerControlAccess.xba b/qadevOOo/tests/basic/ifc/ui/dialogs/XFilePickerControlAccess/ui_dialogs_XFilePickerControlAccess.xba new file mode 100644 index 000000000000..39e2ab6e8662 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/ui/dialogs/XFilePickerControlAccess/ui_dialogs_XFilePickerControlAccess.xba @@ -0,0 +1,102 @@ +<?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="ui_dialogs_XFilePickerControlAccess" 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 + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' - Global controlId As Short +' Global controlInitVal As Variant + +'************************************************************************* + + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.ui.dialogs.XFilePickerControlAccess +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim oldVal As Variant, newVal As Variant, resVal As Variant + Dim oldLabel As String, newLabel As String, resLabel As String + + Test.StartMethod("setValue()") + Test.StartMethod("getValue()") + bOK = true + newVal = controlInitVal 'PropertyTester.Change(oldVal, oCoreRefl.getType(oldVal).Name) + oObj.setValue(controlId, 0, newVal) + wait(100) + resVal = oObj.getValue(controlId, 0) + Out.Log("New: " + newVal + ", Res: " + resVal) + bOK = bOK AND PropertyTester.equals(newVal, resVal) + + Test.MethodTested("setValue()", bOK) + Test.MethodTested("getValue()", bOK) + + Test.StartMethod("getLabel()") + bOK = true + oldLabel = oObj.getLabel(controlId) + Test.MethodTested("getLabel()", bOK) + + Test.StartMethod("setLabel()") + bOK = true + newLabel = oldLabel + "_" + oObj.setLabel(controlId, newLabel) + resLabel = oObj.getLabel(controlId) + bOK = bOK AND (resLabel = newLabel) + Test.MethodTested("setLabel()", bOK) + + Test.StartMethod("enableControl()") + bOK = true + oObj.enableControl(controlId, false) + oObj.enableControl(controlId, true) + Test.MethodTested("enableControl()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/ui/dialogs/XFilePickerNotifier/script.xlb b/qadevOOo/tests/basic/ifc/ui/dialogs/XFilePickerNotifier/script.xlb new file mode 100644 index 000000000000..a02e56e88f95 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/ui/dialogs/XFilePickerNotifier/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="ui_dialogs_XFilePickerNotifier" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="ui_dialogs_XFilePickerNotifier"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/ui/dialogs/XFilePickerNotifier/ui_dialogs_XFilePickerNotifier.xba b/qadevOOo/tests/basic/ifc/ui/dialogs/XFilePickerNotifier/ui_dialogs_XFilePickerNotifier.xba new file mode 100644 index 000000000000..f8f4e4093962 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/ui/dialogs/XFilePickerNotifier/ui_dialogs_XFilePickerNotifier.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="ui_dialogs_XFilePickerNotifier" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.ui.dialogs.XFilePickerNotifier +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim list1 As Object, list2 As Object + Dim dir1 As String, dir2 As String + + dir1 = utils.Path2URL(cTestDocsDir) + dir2 = utils.getTempFileURL("") + + Test.StartMethod("addFilePickerListener()") + + list1 = createUnoListener("L1_", "com.sun.star.ui.dialogs.XFilePickerListener") + list2 = createUnoListener("L2_", "com.sun.star.ui.dialogs.XFilePickerListener") + + oObj.addFilePickerListener(list1) + oObj.addFilePickerListener(list2) + + Test.StartMethod("removeFilePickerListener()") + oObj.removeFilePickerListener(list1) + + called1 = false + called2 = false + oObj.setDisplayDirectory(dir1) + oObj.setDisplayDirectory(dir2) + + bOK = called2 + Test.MethodTested("addFilePickerListener()", bOK) + + bOK = called2 AND NOT called1 + Test.MethodTested("removeFilePickerListener()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub + +Dim called1 As Boolean, called2 As Boolean + +Sub L1_directoryChanged() + called1 = true +End Sub + +Sub L2_directoryChanged() + called2 = true +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/ui/dialogs/XFilePreview/script.xlb b/qadevOOo/tests/basic/ifc/ui/dialogs/XFilePreview/script.xlb new file mode 100644 index 000000000000..14a8801eee69 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/ui/dialogs/XFilePreview/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="ui_dialogs_XFilePreview" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="ui_dialogs_XFilePreview"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/ui/dialogs/XFilePreview/ui_dialogs_XFilePreview.xba b/qadevOOo/tests/basic/ifc/ui/dialogs/XFilePreview/ui_dialogs_XFilePreview.xba new file mode 100644 index 000000000000..88e377aeed4d --- /dev/null +++ b/qadevOOo/tests/basic/ifc/ui/dialogs/XFilePreview/ui_dialogs_XFilePreview.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="ui_dialogs_XFilePreview" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.ui.dialogs.XFilePreview +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim formats As Variant + Dim tmp As Integer + Dim state As Boolean, resState As Boolean + Dim i As Integer + + Test.StartMethod("getSupportedImageFormats()") + bOK = true + formats = oObj.getSupportedImageFormats() + bOK = bOK AND NOT isNull(formats) + Out.Log("Supported image formats :") + for i = lbound(formats()) to ubound(formats()) + Out.Log(" " + formats(i)) + next i + Test.MethodTested("getSupportedImageFormats()", bOK) + + Test.StartMethod("getTargetColorDepth()") + bOK = true + tmp = oObj.getTargetColorDepth() + Out.Log("ColorDepth = " + tmp) + Test.MethodTested("getTargetColorDepth()", bOK) + + Test.StartMethod("getAvailableWidth()") + bOK = true + tmp = oObj.getAvailableWidth() + Out.Log("AvailableWidth = " + tmp) + Test.MethodTested("getAvailableWidth()", bOK) + + Test.StartMethod("getAvailableHeight()") + bOK = true + tmp = oObj.getAvailableHeight() + Out.Log("AvailableHeight = " + tmp) + Test.MethodTested("getAvailableHeight()", bOK) + + Test.StartMethod("setImage()") + bOK = true + Dim emptyImage As Variant + oObj.setImage(com.sun.star.ui.dialogs.FilePreviewImageFormats.BITMAP, emptyImage) + Out.Log("No documentation is available for this method !!!!") + Test.MethodTested("setImage()", bOK) + + Test.StartMethod("getShowState()") + bOK = true + state = oObj.getShowState() + Out.Log("Was :" + state) + + Dim bRet As Boolean + Test.StartMethod("setShowState()") + bOK = true + Out.Log("Set to :" + (NOT state)) + bRet = oObj.setShowState(NOT state) + Out.Log("The returned value is " + bRet) + resState = oObj.getShowState() + Out.Log("Get : " + resState) + bOK = bOK AND ( NOT bRet OR (resState = NOT state)) + Test.MethodTested("getShowState()", bOK) + Test.MethodTested("setShowState()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/ui/dialogs/XFilterManager/script.xlb b/qadevOOo/tests/basic/ifc/ui/dialogs/XFilterManager/script.xlb new file mode 100644 index 000000000000..084ccdf864d5 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/ui/dialogs/XFilterManager/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="ui_dialogs_XFilterManager" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="ui_dialogs_XFilterManager"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/ui/dialogs/XFilterManager/ui_dialogs_XFilterManager.xba b/qadevOOo/tests/basic/ifc/ui/dialogs/XFilterManager/ui_dialogs_XFilterManager.xba new file mode 100644 index 000000000000..41b2e9ffa4ab --- /dev/null +++ b/qadevOOo/tests/basic/ifc/ui/dialogs/XFilterManager/ui_dialogs_XFilterManager.xba @@ -0,0 +1,73 @@ +<?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="ui_dialogs_XFilterManager" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.ui.dialogs.XFilterManager +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim gFilter As String + + + Test.StartMethod("appendFilter()") + bOK = true + oObj.appendFilter("TestFilter", "txt") + Test.MethodTested("appendFilter()", bOK) + + Test.StartMethod("setCurrentFilter()") + bOK = true + oObj.setCurrentFilter("TestFilter") + + Test.StartMethod("getCurrentFilter()") + gFilter = oObj.getCurrentFilter() + bOK = bOK AND (gFilter = "TestFilter") + Test.MethodTested("setCurrentFilter()", bOK) + Test.MethodTested("getCurrentFilter()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/ui/dialogs/XFolderPicker/script.xlb b/qadevOOo/tests/basic/ifc/ui/dialogs/XFolderPicker/script.xlb new file mode 100644 index 000000000000..1f831d352c46 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/ui/dialogs/XFolderPicker/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="ui_dialogs_XFolderPicker" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="ui_dialogs_XFolderPicker"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/ui/dialogs/XFolderPicker/ui_dialogs_XFolderPicker.xba b/qadevOOo/tests/basic/ifc/ui/dialogs/XFolderPicker/ui_dialogs_XFolderPicker.xba new file mode 100644 index 000000000000..c2802dbe2e8b --- /dev/null +++ b/qadevOOo/tests/basic/ifc/ui/dialogs/XFolderPicker/ui_dialogs_XFolderPicker.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="ui_dialogs_XFolderPicker" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.ui.dialogs.XFolderPicker +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim sDir As String, gDir As String + + sDir = utils.getTempFileURL("") + + Test.StartMethod("setDisplayDirectory()") + bOK = true + oObj.setDisplayDirectory(sDir) + Test.MethodTested("setDisplayDirectory()", bOK) + + Test.StartMethod("getDisplayDirectory()") + bOK = true + gDir = oObj.getDisplayDirectory() + out.log("Directory returned : " + gDir) + bOK = bOK AND (gDir = sDir) + Test.MethodTested("getDisplayDirectory()", bOK) + + Test.StartMethod("getDirectory()") + bOK = true + gDir = oObj.getDirectory() + out.log("Directory returned : " + gDir) + Test.MethodTested("getDirectory()", bOK) + + Test.StartMethod("setDescription()") + bOK = true + oObj.setDescription("XFolderPicker") + Test.MethodTested("setDescription()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/uno/XNamingService/script.xlb b/qadevOOo/tests/basic/ifc/uno/XNamingService/script.xlb new file mode 100644 index 000000000000..aa7e55046616 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/uno/XNamingService/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="uno_XNamingService" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="uno_XNamingService"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/uno/XNamingService/uno_XNamingService.xba b/qadevOOo/tests/basic/ifc/uno/XNamingService/uno_XNamingService.xba new file mode 100644 index 000000000000..8eb5ad5c8606 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/uno/XNamingService/uno_XNamingService.xba @@ -0,0 +1,92 @@ +<?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="uno_XNamingService" 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. +' +'************************************************************************* +'************************************************************************* + + + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' - Global oObjectToRegister As Object + +'************************************************************************* + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.uno.XNamingService +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Test.StartMethod("registerObject()") + bOK = true + oObj.registerObject(cIfcShortName, oObjectToRegister) + Test.MethodTested("registerObject()", bOK) + + Test.StartMethod("getRegisteredObject()") + bOK = true + objregObj = oObj.getRegisteredObject(cIfcShortName) + bOK = bOK AND NOT isNULL(objregObj) + bOK = bOK AND objregObj.implementationName = oObjectToRegister.implementationName + Test.MethodTested("getRegisteredObject()", bOK) + + Test.StartMethod("revokeObject()") + bOK = true + oObj.revokeObject(cIfcShortName) + Out.Log("Object was revoked") + on Error goto GoodExc + Out.Log("Trying to getRegistered object ...") + objregObj = oObj.getRegisteredObject(cIfcShortName) + Out.Log("No exception.") + bOK = bOK AND isNULL(objregObj) + if (bOK) then Out.Log("But NULL was returned") + goto cont + GoodExc: + Out.Log("Expected exception - OK") + cont: + Test.MethodTested("revokeObject()", bOK) + + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/util/PathSettings/script.xlb b/qadevOOo/tests/basic/ifc/util/PathSettings/script.xlb new file mode 100644 index 000000000000..07a37da2ed37 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/util/PathSettings/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="util_PathSettings" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="util_PathSettings"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/util/PathSettings/util_PathSettings.xba b/qadevOOo/tests/basic/ifc/util/PathSettings/util_PathSettings.xba new file mode 100644 index 000000000000..bd2c5cfe2a45 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/util/PathSettings/util_PathSettings.xba @@ -0,0 +1,151 @@ +<?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="util_PathSettings" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.util.PathSettings +'************************************************************************* +On Error Goto ErrHndl + + Dim values(1) As String + values(1) = oObj.Addin + values(0) = values(1) + "New" + PropertyTester.TestProperty("Addin", values()) + + values(1) = oObj.AutoCorrect + values(0) = values(1) + "New" + PropertyTester.TestProperty("AutoCorrect", values()) + + values(1) = oObj.AutoText + values(0) = values(1) + "New" + PropertyTester.TestProperty("AutoText", values()) + + values(1) = oObj.Backup + values(0) = values(1) + "New" + PropertyTester.TestProperty("Backup", values()) + + values(1) = oObj.Basic + values(0) = values(1) + "New" + PropertyTester.TestProperty("Basic", values()) + + values(1) = oObj.Bitmap + values(0) = values(1) + "New" + PropertyTester.TestProperty("Bitmap", values()) + + values(1) = oObj.Config + values(0) = values(1) + "New" + PropertyTester.TestProperty("Config", values()) + + values(1) = oObj.Dictionary + values(0) = values(1) + "New" + PropertyTester.TestProperty("Dictionary", values()) + + values(1) = oObj.Favorite + values(0) = values(1) + "New" + PropertyTester.TestProperty("Favorite", values()) + + values(1) = oObj.Filter + values(0) = values(1) + "New" + PropertyTester.TestProperty("Filter", values()) + + values(1) = oObj.Gallery + values(0) = values(1) + "New" + PropertyTester.TestProperty("Gallery", values()) + + values(1) = oObj.Graphic + values(0) = values(1) + "New" + PropertyTester.TestProperty("Graphic", values()) + + values(1) = oObj.Help + values(0) = values(1) + "New" + PropertyTester.TestProperty("Help", values()) + + values(1) = oObj.Linguistic + values(0) = values(1) + "New" + PropertyTester.TestProperty("Linguistic", values()) + + values(1) = oObj.Module + values(0) = values(1) + "New" + PropertyTester.TestProperty("Module", values()) + + values(1) = oObj.Palette + values(0) = values(1) + "New" + PropertyTester.TestProperty("Palette", values()) + + values(1) = oObj.Plugin + values(0) = values(1) + "New" + PropertyTester.TestProperty("Plugin", values()) + + values(1) = oObj.Storage + values(0) = values(1) + "New" + PropertyTester.TestProperty("Storage", values()) + + values(1) = oObj.Temp + values(0) = values(1) + "New" + PropertyTester.TestProperty("Temp", values()) + + values(1) = oObj.Template + values(0) = values(1) + "New" + PropertyTester.TestProperty("Template", values()) + + values(1) = oObj.UIConfig + values(0) = values(1) + "New" + PropertyTester.TestProperty("UIConfig", values()) + + values(1) = oObj.UserConfig + values(0) = values(1) + "New" + PropertyTester.TestProperty("UserConfig", values()) + + values(1) = oObj.UserDictionary + values(0) = values(1) + "New" + PropertyTester.TestProperty("UserDictionary", values()) + + values(1) = oObj.Work + values(0) = values(1) + "New" + PropertyTester.TestProperty("Work", values()) + +Exit Sub +ErrHndl: + Test.Exception() + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/util/SearchDescriptor/script.xlb b/qadevOOo/tests/basic/ifc/util/SearchDescriptor/script.xlb new file mode 100644 index 000000000000..dd9c79134331 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/util/SearchDescriptor/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="util_SearchDescriptor" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="util_SearchDescriptor"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/util/SearchDescriptor/util_SearchDescriptor.xba b/qadevOOo/tests/basic/ifc/util/SearchDescriptor/util_SearchDescriptor.xba new file mode 100644 index 000000000000..1a1a355275bd --- /dev/null +++ b/qadevOOo/tests/basic/ifc/util/SearchDescriptor/util_SearchDescriptor.xba @@ -0,0 +1,74 @@ +<?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="util_SearchDescriptor" 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 RunTest() + +'************************************************************************* +' SERVICE: +' com.sun.star.util.SearchDescriptor +'************************************************************************* +On Error Goto ErrHndl + + PropertyTester.TestProperty("SearchBackwards") + + PropertyTester.TestProperty("SearchCaseSensitive") + + PropertyTester.TestProperty("SearchWords") + + PropertyTester.TestProperty("SearchRegularExpression") + + PropertyTester.TestProperty("SearchStyles") + + PropertyTester.TestProperty("SearchSimilarity") + + PropertyTester.TestProperty("SearchSimilarityRelax") + + PropertyTester.TestProperty("SearchSimilarityRemove") + + PropertyTester.TestProperty("SearchSimilarityAdd") + + PropertyTester.TestProperty("SearchSimilarityExchange") + +Exit Sub +ErrHndl: + Test.Exception() + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/util/XCancellable/script.xlb b/qadevOOo/tests/basic/ifc/util/XCancellable/script.xlb new file mode 100644 index 000000000000..a65518a13481 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/util/XCancellable/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="util_XCancellable" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="util_XCancellable"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/util/XCancellable/util_XCancellable.xba b/qadevOOo/tests/basic/ifc/util/XCancellable/util_XCancellable.xba new file mode 100644 index 000000000000..0887a9b674c6 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/util/XCancellable/util_XCancellable.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="util_XCancellable" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.util.XCancellable +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Test.StartMethod("cancel()") + bOK = true + oObj.cancel() + Test.MethodTested("cancel()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/util/XCloneable/script.xlb b/qadevOOo/tests/basic/ifc/util/XCloneable/script.xlb new file mode 100644 index 000000000000..08e7c9519719 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/util/XCloneable/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="util_XCloneable" library:readonly="false" library:passwordprotected="false"> + <library:element library:name="util_XCloneable"/> + </library:library> diff --git a/qadevOOo/tests/basic/ifc/util/XCloneable/util_XCloneable.xba b/qadevOOo/tests/basic/ifc/util/XCloneable/util_XCloneable.xba new file mode 100644 index 000000000000..0cdf04f59fa3 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/util/XCloneable/util_XCloneable.xba @@ -0,0 +1,66 @@ +<?xml version="1.0" encoding="UTF-8"?> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="util_XCloneable" 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. +' +'************************************************************************* +'************************************************************************* + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' NONE + +'************************************************************************* + +' Be sure that all variables are dimensioned: +option explicit + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.util.XCloneable +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim oClone as Object + +' + Test.StartMethod("createClone()") + bOK = TRUE + oClone = oObj.createClone() + bOK = bOK AND hasUnoInterfaces(oClone, "com.sun.star.util.XCloneable") + Test.MethodTested("createClone()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/util/XFlushable/script.xlb b/qadevOOo/tests/basic/ifc/util/XFlushable/script.xlb new file mode 100644 index 000000000000..df08bd96abed --- /dev/null +++ b/qadevOOo/tests/basic/ifc/util/XFlushable/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="util_XFlushable" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="util_XFlushable"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/util/XFlushable/util_XFlushable.xba b/qadevOOo/tests/basic/ifc/util/XFlushable/util_XFlushable.xba new file mode 100644 index 000000000000..b57ea89b80fd --- /dev/null +++ b/qadevOOo/tests/basic/ifc/util/XFlushable/util_XFlushable.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="util_XFlushable" 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. +' +'************************************************************************* +'************************************************************************* + + + + +Dim iCB1_flushed As Integer +Dim iCB2_flushed As Integer + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.util.XFlushable +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Dim oListener1 As Object + Dim oListener2 As Object + + oListener1 = createUnoListener("CB1_", "com.sun.star.util.XFlushListener") + oListener2 = createUnoListener("CB2_", "com.sun.star.util.XFlushListener") + + Test.StartMethod("addFlushListener()") + bOK = true + iCB1_flushed = 0 : iCB2_flushed = 0 + Out.Log("Adding two listeners...") + oObj.addFlushListener(oListener1) + oObj.addFlushListener(oListener2) + oObj.flush() + bOK = bOK AND iCB1_flushed = 1 AND iCB2_flushed = 1 + Test.MethodTested("addFlushListener()", bOK) + + Test.StartMethod("flush()") + bOK = true + oObj.flush() + Test.MethodTested("flush()", bOK) + + Test.StartMethod("removeFlushListener()") + bOK = true + iCB1_flushed = 0 : iCB2_flushed = 0 + Out.Log("Removing first listener") + oObj.removeFlushListener(oListener1) + oObj.flush() + bOK = bOK AND iCB1_flushed = 0 AND iCB2_flushed = 1 + Test.MethodTested("removeFlushListener()", bOK) + + Out.Log("Removing second listener") + oObj.removeFlushListener(oListener2) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +Sub CB1_flushed(oEvent As Object) + iCB1_flushed = iCB1_flushed + 1 + Out.Log("CallBack function for the first listener was called.") +End Sub + +Sub CB2_flushed(oEvent As Object) + iCB2_flushed = iCB2_flushed + 1 + Out.Log("CallBack function for the second listener was called.") +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/util/XMergeable/script.xlb b/qadevOOo/tests/basic/ifc/util/XMergeable/script.xlb new file mode 100644 index 000000000000..02a018fc1cec --- /dev/null +++ b/qadevOOo/tests/basic/ifc/util/XMergeable/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="util_XMergeable" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="util_XMergeable"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/util/XMergeable/util_XMergeable.xba b/qadevOOo/tests/basic/ifc/util/XMergeable/util_XMergeable.xba new file mode 100644 index 000000000000..40d8e356db8d --- /dev/null +++ b/qadevOOo/tests/basic/ifc/util/XMergeable/util_XMergeable.xba @@ -0,0 +1,71 @@ +<?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="util_XMergeable" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.util.XMergeable +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim bMerged As Boolean + + bMerged = false + + Test.StartMethod("merge()") + bOK = true + oObj.merge(true) + bOk = bOk AND oObj.getIsMerged() + oObj.merge(false) + bOk = bOk AND NOT oObj.getIsMerged() + + Test.MethodTested("merge()", bOK) + + Test.StartMethod("getIsMerged()") + Test.MethodTested("getIsMerged()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/util/XModeSelector/script.xlb b/qadevOOo/tests/basic/ifc/util/XModeSelector/script.xlb new file mode 100644 index 000000000000..6408972dd437 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/util/XModeSelector/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="util_XModeSelector" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="util_XModeSelector"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/util/XModeSelector/util_XModeSelector.xba b/qadevOOo/tests/basic/ifc/util/XModeSelector/util_XModeSelector.xba new file mode 100644 index 000000000000..5743050ff6a9 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/util/XModeSelector/util_XModeSelector.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="util_XModeSelector" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.util.XModeSelector +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim i As Integer + Dim modes As Variant + Dim oldMode As String, newMode As String, resMode As String + + Test.StartMethod("getSupportedModes()") + bOK = true + modes = oObj.getSupportedModes() + for i = lbound(modes()) to ubound(modes()) + out.Log(" " + modes(i)) + next i + bOK = bOK AND ubound(modes()) > 0 + Test.MethodTested("getSupportedModes()", bOK) + + Test.StartMethod("supportsMode()") + bOK = true + bOK = bOK AND oObj.supportsMode(modes(0)) + Test.MethodTested("supportsMode()", bOK) + + Test.StartMethod("getMode()") + Test.StartMethod("setMode()") + bOK = true + oldMode = oObj.getMode() + if oldMode = modes(0) then newMode = modes(1) else newMode = modes(0) + oObj.setMode(newMode) + resMode = oObj.getMode() + bOK = bOK AND (newMode = resMode) + Test.MethodTested("getMode()", bOK) + Test.MethodTested("setMode()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/util/XModifyBroadcaster/script.xlb b/qadevOOo/tests/basic/ifc/util/XModifyBroadcaster/script.xlb new file mode 100644 index 000000000000..e65d266ff846 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/util/XModifyBroadcaster/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="util_XModifyBroadcaster" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="util_XModifyBroadcaster"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/util/XModifyBroadcaster/util_XModifyBroadcaster.xba b/qadevOOo/tests/basic/ifc/util/XModifyBroadcaster/util_XModifyBroadcaster.xba new file mode 100644 index 000000000000..dbca0d2ed013 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/util/XModifyBroadcaster/util_XModifyBroadcaster.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="util_XModifyBroadcaster" 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 + +'************************************************************************* +'Result checking is not performed. Modify listeners are called only in case of +' interaction with UI. + +'************************************************************************* + + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.util.XModifyBroadcaster +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim listener As Object + + listener = createUnoListener("TestListener_", "com.sun.star.util.XModifyListener") + + Test.StartMethod("addModifyListener()") + bOK = true + oObj.addModifyListener(listener) + Test.MethodTested("addModifyListener()", bOK) + + Test.StartMethod("removeModifyListener()") + bOK = true + oObj.removeModifyListener(listener) + Test.MethodTested("removeModifyListener()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub + +Sub TestListener_modified() +' dummy +end sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/util/XNumberFormatsSupplier/script.xlb b/qadevOOo/tests/basic/ifc/util/XNumberFormatsSupplier/script.xlb new file mode 100644 index 000000000000..7142ba2bfb90 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/util/XNumberFormatsSupplier/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="util_XNumberFormatsSupplier" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="util_XNumberFormatsSupplier"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/util/XNumberFormatsSupplier/util_XNumberFormatsSupplier.xba b/qadevOOo/tests/basic/ifc/util/XNumberFormatsSupplier/util_XNumberFormatsSupplier.xba new file mode 100644 index 000000000000..ad3a41ead80b --- /dev/null +++ b/qadevOOo/tests/basic/ifc/util/XNumberFormatsSupplier/util_XNumberFormatsSupplier.xba @@ -0,0 +1,71 @@ +<?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="util_XNumberFormatsSupplier" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.util.XNumberFormatsSupplier +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim oNumberFormatSettings, oNumberFormats As Object + + Test.StartMethod("getNumberFormatSettings()") + bOK = true + oNumberFormatSettings = oObj.getNumberFormatSettings() + bOK = bOK AND NOT isNULL(oNumberFormatSettings) + bOK = bOK AND hasUnoInterfaces(oNumberFormatSettings, "com.sun.star.beans.XPropertySet") + Test.MethodTested("getNumberFormatSettings()", bOK) + + Test.StartMethod("getNumberFormats()") + bOK = true + oNumberFormats = oObj.getNumberFormats() + bOK = bOK AND NOT isNULL(oNumberFormats) + bOK = bOK AND hasUnoInterfaces(oNumberFormats, "com.sun.star.util.XNumberFormats") + Test.MethodTested("getNumberFormats()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/util/XRefreshable/script.xlb b/qadevOOo/tests/basic/ifc/util/XRefreshable/script.xlb new file mode 100644 index 000000000000..3dce23efef3a --- /dev/null +++ b/qadevOOo/tests/basic/ifc/util/XRefreshable/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="util_XRefreshable" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="util_XRefreshable"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/util/XRefreshable/util_XRefreshable.xba b/qadevOOo/tests/basic/ifc/util/XRefreshable/util_XRefreshable.xba new file mode 100644 index 000000000000..342bfabf3232 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/util/XRefreshable/util_XRefreshable.xba @@ -0,0 +1,106 @@ +<?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="util_XRefreshable" 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 + + +Dim nCB1Val As Integer +Dim nCB2Val As Integer + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.util.XRefreshable +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim oListener1, oListener2 As Object + Dim nCount As Integer + + bOK = true + nCount = 0 + nCB1Val = 0 + nCB2Val = 0 + + Out.Log("Create two listeners...") + oListener1 = createUNOListener("CB1_", "com.sun.star.util.XRefreshListener") + oListener2 = createUNOListener("CB2_", "com.sun.star.util.XRefreshListener") + + Out.Log("Adding two refresh listeners") + oObj.addRefreshListener(oListener1) + oObj.addRefreshListener(oListener2) + + Test.StartMethod("addRefreshListener()") + bOK = true + oObj.refresh() + bOK = bOK AND (nCB1Val = 1) AND (nCB2Val = 1) + Test.MethodTested("addRefreshListener()", bOK) + + Test.StartMethod("removeRefreshListener()") + bOK = true + Out.Log("Removing second refresh listener") + oObj.removeRefreshListener(oListener2) + oObj.refresh() + bOK = bOK AND (nCB1Val = 2) AND (nCB2Val = 1) + Test.MethodTested("removeRefreshListener()", bOK) + + Test.StartMethod("refresh()") + bOK = true + bOK = bOK AND (nCB1Val = 2) AND (nCB2Val = 1) + Test.MethodTested("refresh()", bOK) + + Out.Log("Removing first refresh listener") + oObj.removeRefreshListener(oListener1) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub + +Sub CB1_refreshed() + Out.Log("First listener CallBack called") + nCB1Val = nCB1Val + 1 +End Sub + +Sub CB2_refreshed() + Out.Log("Second listener CallBack called") + nCB2Val = nCB2Val + 1 +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/util/XReplaceDescriptor/script.xlb b/qadevOOo/tests/basic/ifc/util/XReplaceDescriptor/script.xlb new file mode 100644 index 000000000000..1f7fa245341a --- /dev/null +++ b/qadevOOo/tests/basic/ifc/util/XReplaceDescriptor/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="util_XReplaceDescriptor" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="util_XReplaceDescriptor"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/util/XReplaceDescriptor/util_XReplaceDescriptor.xba b/qadevOOo/tests/basic/ifc/util/XReplaceDescriptor/util_XReplaceDescriptor.xba new file mode 100644 index 000000000000..e34fdb3015b5 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/util/XReplaceDescriptor/util_XReplaceDescriptor.xba @@ -0,0 +1,68 @@ +<?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="util_XReplaceDescriptor" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.util.XReplaceDescriptor +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim rStr As String + + Test.StartMethod("setReplaceString()") + Test.StartMethod("getReplaceString()") + bOK = true + + rStr = oObj.getReplaceString() + oObj.setReplaceString(rStr & cIfcShortName) + + bOK = bOK AND (rStr & cIfcShortName = oObj.getReplaceString()) + Test.MethodTested("getReplaceString()", bOK) + Test.MethodTested("setReplaceString()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/util/XReplaceable/script.xlb b/qadevOOo/tests/basic/ifc/util/XReplaceable/script.xlb new file mode 100644 index 000000000000..63b382a66845 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/util/XReplaceable/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="util_XReplaceable" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="util_XReplaceable"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/util/XReplaceable/util_XReplaceable.xba b/qadevOOo/tests/basic/ifc/util/XReplaceable/util_XReplaceable.xba new file mode 100644 index 000000000000..4a04437b8119 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/util/XReplaceable/util_XReplaceable.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="util_XReplaceable" 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. +' +'************************************************************************* +'************************************************************************* + + + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' - Global cStringToSearch As String +' should appears more than once +' - Global nSearchedEntriesAmount As Integer + +'************************************************************************* + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.util.XReplaceable +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim oReplaceDescriptor As Object + Dim nReplace As Integer + + + Test.StartMethod("createReplaceDescriptor()") + bOK = true + oReplaceDescriptor = oObj.createReplaceDescriptor() + bOK = bOK AND hasUnoInterfaces(oReplaceDescriptor, "com.sun.star.util.XReplaceDescriptor") + Test.MethodTested("createReplaceDescriptor()", bOK) + + Test.StartMethod("replaceAll()") + bOK = true + Out.Log("Prepearing descriptor...") + oReplaceDescriptor.SearchAll = true + oReplaceDescriptor.SearchCaseSensitive = true + oReplaceDescriptor.SearchWords = false + oReplaceDescriptor.SearchString = cStringToSearch + oReplaceDescriptor.ReplaceString = ucase(cStringToSearch) + + nReplace = oObj.replaceAll(oReplaceDescriptor) + Out.Log("" & nReplace & " replaces were performed. Expected: " & nSearchedEntriesAmount) + bOK = bOK AND nSearchedEntriesAmount = nReplace + + Out.Log("Return to previous state...") + oReplaceDescriptor.SearchString = ucase(cStringToSearch) + oReplaceDescriptor.ReplaceString = cStringToSearch + nReplace = oObj.replaceAll(oReplaceDescriptor) + Test.MethodTested("replaceAll()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/util/XSearchDescriptor/script.xlb b/qadevOOo/tests/basic/ifc/util/XSearchDescriptor/script.xlb new file mode 100644 index 000000000000..774469012875 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/util/XSearchDescriptor/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="util_XSearchDescriptor" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="util_XSearchDescriptor"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/util/XSearchDescriptor/util_XSearchDescriptor.xba b/qadevOOo/tests/basic/ifc/util/XSearchDescriptor/util_XSearchDescriptor.xba new file mode 100644 index 000000000000..95b66d85774f --- /dev/null +++ b/qadevOOo/tests/basic/ifc/util/XSearchDescriptor/util_XSearchDescriptor.xba @@ -0,0 +1,70 @@ +<?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="util_XSearchDescriptor" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.util.XSearchDescriptor +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim sStr As String + + + Test.StartMethod("setSearchString()") + bOK = true + sStr = oObj.getSearchString() + oObj.setSearchString(sStr & cIfcShortName) + bOK = bOK AND (sStr <> oObj.getSearchString()) + Test.MethodTested("setSearchString()", bOK) + + Test.StartMethod("getSearchString()") + bOK = true + bOK = bOK AND (oObj.getSearchString() = (sStr & cIfcShortName)) + Test.MethodTested("getSearchString()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/util/XSearchable/script.xlb b/qadevOOo/tests/basic/ifc/util/XSearchable/script.xlb new file mode 100644 index 000000000000..2e4eb5ac7612 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/util/XSearchable/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="util_XSearchable" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="util_XSearchable"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/util/XSearchable/util_XSearchable.xba b/qadevOOo/tests/basic/ifc/util/XSearchable/util_XSearchable.xba new file mode 100644 index 000000000000..56b3c7c5601a --- /dev/null +++ b/qadevOOo/tests/basic/ifc/util/XSearchable/util_XSearchable.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="util_XSearchable" 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. +' +'************************************************************************* +'************************************************************************* + + + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' - Global cStringToSearch As String +' should appears more than once +' - Global nSearchedEntriesAmount As Integer + +'************************************************************************* + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.util.XSearchable +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Dim oMatch As Object + Dim oAllMatch As Object + Dim oSearchDescriptor As Object + Dim nCount As Long + + Test.StartMethod("createSearchDescriptor()") + bOK = true + oSearchDescriptor = oObj.createSearchDescriptor() + bOK = bOK AND NOT isNULL(oSearchDescriptor) + bOK = bOK AND hasUnoInterfaces(oSearchDescriptor, "com.sun.star.util.XSearchDescriptor") + Test.MethodTested("createSearchDescriptor()", bOK) + + Out.Log("Setting values to search descriptor") + oSearchDescriptor.SearchString = cStringToSearch + oSearchDescriptor.SearchWords = false + oSearchDescriptor.SearchCaseSensitive = true + + Test.StartMethod("findAll()") + bOK = true + oAllMatch = oObj.findAll(oSearchDescriptor) + bOK = bOK AND hasUnoInterfaces(oAllMatch, "com.sun.star.container.XIndexAccess") + for i = 0 to oAllMatch.count - 1 + bOK = bOK AND oAllMatch.getByIndex(i).String = cStringToSearch + next i + bOK = bOK AND oAllMatch.count = nSearchedEntriesAmount + Test.MethodTested("findAll()", bOK) + + Test.StartMethod("findFirst()") + bOK = true + oMatch = oObj.findFirst(oSearchDescriptor) + bOK = bOK AND oMatch.String = cStringToSearch + Test.MethodTested("findFirst()", bOK) + + Test.StartMethod("findNext()") + bOK = true + nCount = 0 + + While NOT isNULL(oMatch) + nCount = nCount + 1 + bOK = bOK AND oMatch.String = cStringToSearch + oMatch = oObj.findNext(oMatch.end, oSearchDescriptor) + wend + + bOK = bOK AND nSearchedEntriesAmount = nCount + Test.MethodTested("findNext()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/util/XSortable/script.xlb b/qadevOOo/tests/basic/ifc/util/XSortable/script.xlb new file mode 100644 index 000000000000..a50e2d2de419 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/util/XSortable/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="util_XSortable" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="util_XSortable"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/util/XSortable/util_XSortable.xba b/qadevOOo/tests/basic/ifc/util/XSortable/util_XSortable.xba new file mode 100644 index 000000000000..dd998e38baab --- /dev/null +++ b/qadevOOo/tests/basic/ifc/util/XSortable/util_XSortable.xba @@ -0,0 +1,80 @@ +<?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="util_XSortable" 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 + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' - modifyDescriptor(sortDescr As Variant) +' checkSort() As Boolean + +'************************************************************************* + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.util.XSortable +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim oSortDsc As Object, newDsc As Object + + Test.StartMethod("createSortDescriptor()") + bOK = true + oSortDsc = oObj.createSortDescriptor() + bOK = bOK AND NOT isNULL(oSortDsc) + bOK = bOK AND isArray(oSortDsc) + Test.MethodTested("createSortDescriptor()", bOK) + + Test.StartMethod("sort()") + newDsc = modifyDescriptor(oSortDsc) + bOK = true + oObj.sort(newDsc) + bOK = bOK AND checkSort() + Test.MethodTested("sort()", bOK) +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/util/XStringEscape/script.xlb b/qadevOOo/tests/basic/ifc/util/XStringEscape/script.xlb new file mode 100644 index 000000000000..45c2a0056092 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/util/XStringEscape/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="util_XStringEscape" library:readonly="false" library:passwordprotected="false"> + <library:element library:name="util_XStringEscape"/> + </library:library> diff --git a/qadevOOo/tests/basic/ifc/util/XStringEscape/util_XStringEscape.xba b/qadevOOo/tests/basic/ifc/util/XStringEscape/util_XStringEscape.xba new file mode 100644 index 000000000000..70ca52891aa0 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/util/XStringEscape/util_XStringEscape.xba @@ -0,0 +1,71 @@ +<?xml version="1.0" encoding="UTF-8"?> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="XStringEscape" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.util.XStringEscape +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + out.log("The Implementation of this Interface doesn't really do anything") + Dim toCheck as String + toCheck = ";:<>/*" + + Test.StartMethod("escapeString()") + bOK = TRUE + Dim eString as String + eString = oObj.escapeString(toCheck) + bOK = bOK AND (eString = toCheck) + Test.MethodTested("escapeString()", bOK) + + Test.StartMethod("unescapeString()") + bOK = TRUE + Dim ueString as String + ueString = oObj.unescapeString(toCheck) + bOK = bOK AND (ueString = toCheck) + Test.MethodTested("unescapeString()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/util/XTextSearch/script.xlb b/qadevOOo/tests/basic/ifc/util/XTextSearch/script.xlb new file mode 100644 index 000000000000..923ac8c6cdd1 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/util/XTextSearch/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="util_XTextSearch" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="util_XTextSearch"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/util/XTextSearch/util_XTextSearch.xba b/qadevOOo/tests/basic/ifc/util/XTextSearch/util_XTextSearch.xba new file mode 100644 index 000000000000..875e1e1d26a0 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/util/XTextSearch/util_XTextSearch.xba @@ -0,0 +1,104 @@ +<?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="util_XTextSearch" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.util.XTextSearch +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Dim _Locale As new com.sun.star.lang.Locale + _Locale.Country = "US" + _Locale.Language = "en" + + Test.StartMethod("setOptions()") + bOK = true + Dim aSearchOptions As new com.sun.star.util.SearchOptions + aSearchOptions.algorithmType = com.sun.star.util.SearchAlgorithms.REGEXP + aSearchOptions.searchFlag = com.sun.star.util.SearchFlags.ALL_IGNORE_CASE + aSearchOptions.searchString = "h[ae](k|l|j)+o" 'Should work because of ALL_IGNORE_CASE! + aSearchOptions.Locale = _Locale + oObj.setOptions(aSearchOptions) + Test.MethodTested("setOptions()", bOK) + + Test.StartMethod("searchForward()") + bOK = true + Dim _string As String + Dim _result As Variant + + _string = "String with 'Hello' and 'Hallo'." + _result = oObj.searchForward(_string, 0, len(_string)) + if (ubound(_result.startOffset()) >= 0) then + bOK = bOK AND _result.startOffset(0) = 13 + bOK = bOK AND _result.endOffset(0) = 18 + _result = oObj.searchForward(_string, 18, len(_string)) + bOK = bOK AND _result.startOffset(0) = 25 + bOK = bOK AND _result.endOffset(0) = 30 + else + Out.Log("No matches were found!") + bOK = false + end if + Test.MethodTested("searchForward()", bOK) + + Test.StartMethod("searchBackward()") + bOK = true + _result = oObj.searchBackward(_string, len(_string), 0) + if (ubound(_result.startOffset()) >= 0) then + bOK = bOK AND _result.startOffset(0) = 30 + bOK = bOK AND _result.endOffset(0) = 25 + _result = oObj.searchBackward(_string, _result.endOffset(0), 0) + bOK = bOK AND _result.startOffset(0) = 18 + bOK = bOK AND _result.endOffset(0) = 13 + else + Out.Log("No matches were found!") + bOK = false + end if + Test.MethodTested("searchBackward()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/view/XControlAccess/script.xlb b/qadevOOo/tests/basic/ifc/view/XControlAccess/script.xlb new file mode 100644 index 000000000000..dd1dbb1dafa9 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/view/XControlAccess/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="view_XControlAccess" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="view_XControlAccess"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/view/XControlAccess/view_XControlAccess.xba b/qadevOOo/tests/basic/ifc/view/XControlAccess/view_XControlAccess.xba new file mode 100644 index 000000000000..f6d19697188f --- /dev/null +++ b/qadevOOo/tests/basic/ifc/view/XControlAccess/view_XControlAccess.xba @@ -0,0 +1,68 @@ +<?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="view_XControlAccess" 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. +' +'************************************************************************* +'************************************************************************* + + + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' - Global oControlModel As Object + +'************************************************************************* + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.view.XControlAccess +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Test.StartMethod("getControl()") + bOK = true + bOK = bOK AND NOT isNULL(oObj.getControl(oControlModel)) + Test.MethodTested("getControl()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/view/XPrintSettingsSupplier/script.xlb b/qadevOOo/tests/basic/ifc/view/XPrintSettingsSupplier/script.xlb new file mode 100644 index 000000000000..47d9d0c85c3d --- /dev/null +++ b/qadevOOo/tests/basic/ifc/view/XPrintSettingsSupplier/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="view_XPrintSettingsSupplier" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="view_XPrintSettingsSupplier"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/view/XPrintSettingsSupplier/view_XPrintSettingsSupplier.xba b/qadevOOo/tests/basic/ifc/view/XPrintSettingsSupplier/view_XPrintSettingsSupplier.xba new file mode 100644 index 000000000000..968976bc314f --- /dev/null +++ b/qadevOOo/tests/basic/ifc/view/XPrintSettingsSupplier/view_XPrintSettingsSupplier.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="view_XPrintSettingsSupplier" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.view.XPrintSettingsSupplier +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + + Test.StartMethod("getPrintSettings()") + bOK = true + bOK = bOK AND hasUnoInterfaces(oObj.getPrintSettings(), "com.sun.star.beans.XPropertySet") + Test.MethodTested("getPrintSettings()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/view/XPrintable/script.xlb b/qadevOOo/tests/basic/ifc/view/XPrintable/script.xlb new file mode 100644 index 000000000000..89ab8a254991 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/view/XPrintable/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="view_XPrintable" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="view_XPrintable"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/view/XPrintable/view_XPrintable.xba b/qadevOOo/tests/basic/ifc/view/XPrintable/view_XPrintable.xba new file mode 100644 index 000000000000..19d74dacd651 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/view/XPrintable/view_XPrintable.xba @@ -0,0 +1,119 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="view_XPrintable" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.view.XPrintable +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim sFileName, sFileUrl As String + Dim aPrintingOptions(1) As New com.sun.star.beans.PropertyValue + Dim aPrinterProps As Variant + Dim i As Integer + + Test.StartMethod("getPrinter()") + bOK = true + aPrinterProps = oObj.getPrinter() + bOK = bOK AND (ubound(aPrinterProps) > 0) + Test.MethodTested("getPrinter()", bOK) + + + Test.StartMethod("print()") + bOK = true + + sFileUrl = utils.getTempFileURL("/XPrintable.prt", true) + sFileName = utils.URL2Path(sFileUrl) + + aPrintingOptions(0).Name = "FileName" + aPrintingOptions(0).Value = sFileName + aPrintingOptions(0).State = com.sun.star.beans.PropertyState.DEFAULT_VALUE + + aPrintingOptions(1).Name = "Wait" + aPrintingOptions(1).Value = true + oObj.Print(aPrintingOptions()) + + ' without waiting Office can hang on setPrinter() call. + wait(500) + + bOK = bOK AND FileExists(sFileName) + Test.MethodTested("print()", bOK) + + Test.StartMethod("setPrinter()") + bOK = true + Dim iPaperFormat As Integer + Dim iNewPaperFormat As Integer + + for i = 0 to ubound(aPrinterProps()) + if (aPrinterProps(i).Name = "PaperFormat") then + iPaperFormat = aPrinterProps(i).Value + exit for + endif + next i + + if (iPaperFormat = com.sun.star.view.PaperFormat.A4) then + iNewPaperFormat = com.sun.star.view.PaperFormat.LETTER + else + iNewPaperFormat = com.sun.star.view.PaperFormat.A4 + endif + + aPrinterProps(i).Value = iNewPaperFormat + + oObj.setPrinter(aPrinterProps()) + + aPrinterProps() = oObj.getPrinter() + + for i = 0 to ubound(aPrinterProps()) + if (aPrinterProps(i).Name = "PaperFormat") then + bOK = bOK AND (aPrinterProps(i).Value = iNewPaperFormat) + exit for + endif + next i + Test.MethodTested("setPrinter()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/view/XScreenCursor/script.xlb b/qadevOOo/tests/basic/ifc/view/XScreenCursor/script.xlb new file mode 100644 index 000000000000..59d7873d04ee --- /dev/null +++ b/qadevOOo/tests/basic/ifc/view/XScreenCursor/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="view_XScreenCursor" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="view_XScreenCursor"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/view/XScreenCursor/view_XScreenCursor.xba b/qadevOOo/tests/basic/ifc/view/XScreenCursor/view_XScreenCursor.xba new file mode 100644 index 000000000000..801ab47df947 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/view/XScreenCursor/view_XScreenCursor.xba @@ -0,0 +1,69 @@ +<?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="view_XScreenCursor" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.view.XScreenCursor +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Test.StartMethod("screenDown()") + bOK = true + bOK = bOK AND oObj.screenDown() + Test.MethodTested("screenDown()", bOK) + + Test.StartMethod("screenUp()") + bOK = true + bOK = bOK AND oObj.screenUp() + Test.MethodTested("screenUp()", bOK) + + DisposeObj() + CreateObj() + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/view/XSelectionSupplier/script.xlb b/qadevOOo/tests/basic/ifc/view/XSelectionSupplier/script.xlb new file mode 100644 index 000000000000..29b136c54fc0 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/view/XSelectionSupplier/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="view_XSelectionSupplier" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="view_XSelectionSupplier"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/view/XSelectionSupplier/view_XSelectionSupplier.xba b/qadevOOo/tests/basic/ifc/view/XSelectionSupplier/view_XSelectionSupplier.xba new file mode 100644 index 000000000000..642eea896b9c --- /dev/null +++ b/qadevOOo/tests/basic/ifc/view/XSelectionSupplier/view_XSelectionSupplier.xba @@ -0,0 +1,146 @@ +<?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="view_XSelectionSupplier" 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 + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' - Global SelectableObj1 As Object +' - Global SelectableObj2 As Object + +'************************************************************************* + + + + +Dim nCB1Val, nCB2Val As Integer + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.view.XSelectionSupplier +'************************************************************************* +On Error Goto ErrHndl + Dim bOK, bSelected As Boolean + Dim oListener1, oListener2, oSelection As Object + + Out.Log("creating two Listeners") + oListener1 = createUNOListener("CB1_", "com.sun.star.view.XSelectionChangeListener") + oListener2 = createUNOListener("CB2_", "com.sun.star.view.XSelectionChangeListener") + bOK = NOT isNULL(oListener1) AND NOT isNULL(oListener2) + Out.Log("Listeners creation : " & bOK) + + Test.StartMethod("select()") + bOK = true + out.log("Trying to select ...") + bOK = bOK AND oObj.select(SelectableObj1) + Test.MethodTested("select()", bOK) + + Test.StartMethod("getSelection()") + bOK = true + oSelection = oObj.getSelection() + bOK = bOK AND NOT isNULL(oSelection) + + ' The selection is either specified by an object which is contained + ' in the component to which the view belongs or it is an interface of a + ' collection which contains such objects. + + if bOK then + if (cObjectName = "sw.SwXTextView") then + bOK = bOK AND oSelection.hasElements() + bOK = bOK AND (oSelection.getByIndex(0).String = SelectableObj1.String) + elseif (hasUnoInterfaces(oSelection, "com.sun.star.container.XElementAccess")) then + bOK = bOK AND oSelection.hasElements() + if bOK then bOK = bOK AND (oSelection.getByIndex(0).dbg_methods = SelectableObj1.dbg_methods) + else + bOK = bOK AND (oSelection.dbg_methods = SelectableObj1.dbg_methods) + end if + end if + + Test.MethodTested("getSelection()", bOK) + + Test.StartMethod("addSelectionChangeListener()") + bOK = true + Out.Log("Adding two listeners...") + oObj.addSelectionChangeListener(oListener1) + oObj.addSelectionChangeListener(oListener2) + + Out.Log("Select item...") + ResetCB() + bOK = bOK AND oObj.select(SelectableObj2) + bOK = bOK AND (nCB1Val > 0) AND (nCB2Val > 0) + Test.MethodTested("addSelectionChangeListener()", bOK) + + Test.StartMethod("removeSelectionChangeListener()") + bOK = true + Out.Log("Remove first listener...") + oObj.removeSelectionChangeListener(oListener1) + + Out.Log("Select item...") + ResetCB() + bOK = bOK AND oObj.select(SelectableObj1) + bOK = bOK AND (nCB1Val = 0) AND (nCB2Val > 0) + Test.MethodTested("removeSelectionChangeListener()", bOK) + + Out.Log("Remove last listener...") + oObj.removeSelectionChangeListener(oListener2) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub + +Sub CB1_selectionChanged + Out.Log("Listener 1 was called") + nCB1Val = nCB1Val + 1 +end sub + +Sub CB2_selectionChanged + Out.Log("Listener 2 was called") + nCB2Val = nCB2Val + 1 +end sub + +Sub ResetCB() + nCB1Val = 0 + nCB2Val = 0 +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/view/XViewSettingsSupplier/script.xlb b/qadevOOo/tests/basic/ifc/view/XViewSettingsSupplier/script.xlb new file mode 100644 index 000000000000..44bb4097f5f6 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/view/XViewSettingsSupplier/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="view_XViewSettingsSupplier" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="view_XViewSettingsSupplier"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/view/XViewSettingsSupplier/view_XViewSettingsSupplier.xba b/qadevOOo/tests/basic/ifc/view/XViewSettingsSupplier/view_XViewSettingsSupplier.xba new file mode 100644 index 000000000000..a30734c80fe9 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/view/XViewSettingsSupplier/view_XViewSettingsSupplier.xba @@ -0,0 +1,60 @@ +<?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="view_XViewSettingsSupplier" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.view.XViewSettingsSupplier +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + + Test.StartMethod("getViewSettings()") + bOK = true + oSettings = oObj.getViewSettings() + bOK = bOK AND NOT isNULL(oSettings) + bOK = bOK AND hasUnoInterfaces(oSettings, "com.sun.star.beans.XPropertySet") + Test.MethodTested("getViewSettings()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/xml/UserDefinedAttributeSupplier/script.xlb b/qadevOOo/tests/basic/ifc/xml/UserDefinedAttributeSupplier/script.xlb new file mode 100644 index 000000000000..1d1c11a3687a --- /dev/null +++ b/qadevOOo/tests/basic/ifc/xml/UserDefinedAttributeSupplier/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="xml_UserDefinedAttributeSupplier" library:readonly="false" library:passwordprotected="false"> + <library:element library:name="xml_UserDefinedAttributeSupplier"/> + </library:library> diff --git a/qadevOOo/tests/basic/ifc/xml/UserDefinedAttributeSupplier/xml_UserDefinedAttributeSupplier.xba b/qadevOOo/tests/basic/ifc/xml/UserDefinedAttributeSupplier/xml_UserDefinedAttributeSupplier.xba new file mode 100644 index 000000000000..e4ab382578be --- /dev/null +++ b/qadevOOo/tests/basic/ifc/xml/UserDefinedAttributeSupplier/xml_UserDefinedAttributeSupplier.xba @@ -0,0 +1,72 @@ +<?xml version="1.0" encoding="UTF-8"?> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="xml_UserDefinedAttributeSupplier" 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 RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.xml.UserDefinedAttributeSupplier +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim uda as Object + Dim attr as new com.sun.star.xml.AttributeData + Dim els as Variant + + bOK = TRUE + Test.StartMethod("UserDefinedAttributes") + uda = oObj.getPropertyValue("UserDefinedAttributes") + attr.Namespace = "http://www.sun.com/staroffice/apitest/Chartprop" + attr.Type="CDATA" + attr.Value="true" + uda.insertByName("Chartprop:has-first-alien-attribute",attr) + els = uda.getElementNames() + oObj.setPropertyValue("UserDefinedAttributes",uda) + uda = oObj.getPropertyValue("UserDefinedAttributes") + els = uda.getElementNames() + uda.getByName("Chartprop:has-first-alien-attribute") + Test.MethodTested("UserDefinedAttributes",bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> diff --git a/qadevOOo/tests/basic/ifc/xml/sax/XDocumentHandler/script.xlb b/qadevOOo/tests/basic/ifc/xml/sax/XDocumentHandler/script.xlb new file mode 100644 index 000000000000..bd86f9cb1f27 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/xml/sax/XDocumentHandler/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="xml_sax_XDocumentHandler" library:readonly="false" library:passwordprotected="false"> +"<library:element library:name="xml_sax_XDocumentHandler"/> +"</library:library> diff --git a/qadevOOo/tests/basic/ifc/xml/sax/XDocumentHandler/xml_sax_XDocumentHandler.xba b/qadevOOo/tests/basic/ifc/xml/sax/XDocumentHandler/xml_sax_XDocumentHandler.xba new file mode 100644 index 000000000000..010e288d21e7 --- /dev/null +++ b/qadevOOo/tests/basic/ifc/xml/sax/XDocumentHandler/xml_sax_XDocumentHandler.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="xml_sax_XDocumentHandler" 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 + +'************************************************************************* +' This Interface/Service test depends on the following GLOBAL variables, +' which must be specified in the object creation: + +' - Global vXMLData As Variant + +'************************************************************************* + + + + + +Sub RunTest() + +'************************************************************************* +' INTERFACE: +' com.sun.star.xml.sax.XDocumentHandler +'************************************************************************* +On Error Goto ErrHndl + Dim bOK As Boolean + Dim i As Integer + + Test.StartMethod("startDocument()") + bOK = true + oObj.startDocument() + Test.MethodTested("startDocument()", bOK) + out.log("StartDocument") + +' Imports the XML-data + For i = 0 to ubound(vXMLData) + Dim data As Variant + data = vXMLData(i) + If data(0) = "start" then + Dim oAttr As Object + oAttr = createUnoService("basichelper.AttributeList") + + Dim upBound as Integer + upBound = ubound(data()) + If upBound > 1 then + Dim j As Integer + Dim args As Variant + args = DimArray(upBound - 2) + For j = 0 to ubound(args()) + args(j) = data(2 + j) + Next j + oAttr.initialize(args()) + EndIf + + oObj.startElement(data(1), oAttr) + out.log("<" + data(1) + ">") + EndIf + If data(0) = "end" then + oObj.endElement(data(1)) + out.log("</" + data(1) + ">") + EndIf + If data(0) = "chars" then + oObj.characters(data(1)) + out.log(data(1)) + EndIf + Next i + + out.log("EndDocument") + Test.StartMethod("endDocument()") + oObj.endDocument() + bOK = CheckImport() + Test.MethodTested("endDocument()", bOK) + + Test.StartMethod("startElement()") + bOK = true + Test.MethodTested("startElement()", bOK) + + Test.StartMethod("endElement()") + bOK = true + Test.MethodTested("endElement()", bOK) + + + Test.StartMethod("characters()") + bOK = true + Test.MethodTested("characters()", bOK) + + Test.StartMethod("ignorableWhitespace()") + bOK = true + Test.MethodTested("ignorableWhitespace()", bOK) + + Test.StartMethod("processingInstruction()") + bOK = true + Test.MethodTested("processingInstruction()", bOK) + + Test.StartMethod("setDocumentLocator()") + bOK = true + Test.MethodTested("setDocumentLocator()", bOK) + +Exit Sub +ErrHndl: + Test.Exception() + bOK = false + resume next +End Sub +</script:module> |