summaryrefslogtreecommitdiff
path: root/qadevOOo/tests/basic/mod/forms
diff options
context:
space:
mode:
Diffstat (limited to 'qadevOOo/tests/basic/mod/forms')
-rw-r--r--qadevOOo/tests/basic/mod/forms/OButtonControl/forms_OButtonControl.xba107
-rw-r--r--qadevOOo/tests/basic/mod/forms/OButtonControl/script.xlb5
-rw-r--r--qadevOOo/tests/basic/mod/forms/OButtonModel/forms_OButtonModel.xba72
-rw-r--r--qadevOOo/tests/basic/mod/forms/OButtonModel/script.xlb5
-rw-r--r--qadevOOo/tests/basic/mod/forms/OCheckBoxControl/forms_OCheckBoxControl.xba127
-rw-r--r--qadevOOo/tests/basic/mod/forms/OCheckBoxControl/script.xlb5
-rw-r--r--qadevOOo/tests/basic/mod/forms/OCheckBoxModel/forms_OCheckBoxModel.xba71
-rw-r--r--qadevOOo/tests/basic/mod/forms/OCheckBoxModel/script.xlb5
-rw-r--r--qadevOOo/tests/basic/mod/forms/OComboBoxControl/forms_OComboBoxControl.xba108
-rw-r--r--qadevOOo/tests/basic/mod/forms/OComboBoxControl/script.xlb5
-rw-r--r--qadevOOo/tests/basic/mod/forms/OComboBoxModel/forms_OComboBoxModel.xba131
-rw-r--r--qadevOOo/tests/basic/mod/forms/OComboBoxModel/script.xlb5
-rw-r--r--qadevOOo/tests/basic/mod/forms/OCurrencyControl/forms_OCurrencyControl.xba106
-rw-r--r--qadevOOo/tests/basic/mod/forms/OCurrencyControl/script.xlb5
-rw-r--r--qadevOOo/tests/basic/mod/forms/OCurrencyModel/forms_OCurrencyModel.xba137
-rw-r--r--qadevOOo/tests/basic/mod/forms/OCurrencyModel/script.xlb5
-rw-r--r--qadevOOo/tests/basic/mod/forms/ODatabaseForm/forms_ODatabaseForm.xba212
-rw-r--r--qadevOOo/tests/basic/mod/forms/ODatabaseForm/script.xlb5
-rw-r--r--qadevOOo/tests/basic/mod/forms/ODateControl/forms_ODateControl.xba107
-rw-r--r--qadevOOo/tests/basic/mod/forms/ODateControl/script.xlb5
-rw-r--r--qadevOOo/tests/basic/mod/forms/ODateModel/forms_ODateModel.xba140
-rw-r--r--qadevOOo/tests/basic/mod/forms/ODateModel/script.xlb5
-rw-r--r--qadevOOo/tests/basic/mod/forms/OEditControl/forms_OEditControl.xba106
-rw-r--r--qadevOOo/tests/basic/mod/forms/OEditControl/script.xlb5
-rw-r--r--qadevOOo/tests/basic/mod/forms/OEditModel/forms_OEditModel.xba128
-rw-r--r--qadevOOo/tests/basic/mod/forms/OEditModel/script.xlb5
-rw-r--r--qadevOOo/tests/basic/mod/forms/OFileControlModel/forms_OFileControlModel.xba76
-rw-r--r--qadevOOo/tests/basic/mod/forms/OFileControlModel/script.xlb5
-rw-r--r--qadevOOo/tests/basic/mod/forms/OFixedTextModel/forms_OFixedTextModel.xba74
-rw-r--r--qadevOOo/tests/basic/mod/forms/OFixedTextModel/script.xlb5
-rw-r--r--qadevOOo/tests/basic/mod/forms/OFormattedControl/forms_OFormattedControl.xba107
-rw-r--r--qadevOOo/tests/basic/mod/forms/OFormattedControl/script.xlb5
-rw-r--r--qadevOOo/tests/basic/mod/forms/OFormattedFieldWrapper/forms_OFormattedFieldWrapper.xba166
-rw-r--r--qadevOOo/tests/basic/mod/forms/OFormattedFieldWrapper/script.xlb5
-rw-r--r--qadevOOo/tests/basic/mod/forms/OFormsCollection/forms_OFormsCollection.xba97
-rw-r--r--qadevOOo/tests/basic/mod/forms/OFormsCollection/script.xlb5
-rw-r--r--qadevOOo/tests/basic/mod/forms/OGridControlModel/forms_OGridControlModel.xba123
-rw-r--r--qadevOOo/tests/basic/mod/forms/OGridControlModel/script.xlb5
-rw-r--r--qadevOOo/tests/basic/mod/forms/OGroupBoxControl/forms_OGroupBoxControl.xba104
-rw-r--r--qadevOOo/tests/basic/mod/forms/OGroupBoxControl/script.xlb5
-rw-r--r--qadevOOo/tests/basic/mod/forms/OGroupBoxModel/forms_OGroupBoxModel.xba75
-rw-r--r--qadevOOo/tests/basic/mod/forms/OGroupBoxModel/script.xlb5
-rw-r--r--qadevOOo/tests/basic/mod/forms/OHiddenModel/forms_OHiddenModel.xba101
-rw-r--r--qadevOOo/tests/basic/mod/forms/OHiddenModel/script.xlb5
-rw-r--r--qadevOOo/tests/basic/mod/forms/OImageButtonControl/forms_OImageButtonControl.xba105
-rw-r--r--qadevOOo/tests/basic/mod/forms/OImageButtonControl/script.xlb5
-rw-r--r--qadevOOo/tests/basic/mod/forms/OImageButtonModel/forms_OImageButtonModel.xba74
-rw-r--r--qadevOOo/tests/basic/mod/forms/OImageButtonModel/script.xlb5
-rw-r--r--qadevOOo/tests/basic/mod/forms/OImageControlControl/forms_OImageControlControl.xba108
-rw-r--r--qadevOOo/tests/basic/mod/forms/OImageControlControl/script.xlb5
-rw-r--r--qadevOOo/tests/basic/mod/forms/OImageControlModel/forms_OImageControlModel.xba75
-rw-r--r--qadevOOo/tests/basic/mod/forms/OImageControlModel/script.xlb5
-rw-r--r--qadevOOo/tests/basic/mod/forms/OListBoxControl/forms_OListBoxControl.xba121
-rw-r--r--qadevOOo/tests/basic/mod/forms/OListBoxControl/script.xlb5
-rw-r--r--qadevOOo/tests/basic/mod/forms/OListBoxModel/forms_OListBoxModel.xba158
-rw-r--r--qadevOOo/tests/basic/mod/forms/OListBoxModel/script.xlb5
-rw-r--r--qadevOOo/tests/basic/mod/forms/ONumericControl/forms_ONumericControl.xba106
-rw-r--r--qadevOOo/tests/basic/mod/forms/ONumericControl/script.xlb5
-rw-r--r--qadevOOo/tests/basic/mod/forms/ONumericModel/forms_ONumericModel.xba127
-rw-r--r--qadevOOo/tests/basic/mod/forms/ONumericModel/script.xlb5
-rw-r--r--qadevOOo/tests/basic/mod/forms/OPatternControl/forms_OPatternControl.xba104
-rw-r--r--qadevOOo/tests/basic/mod/forms/OPatternControl/script.xlb5
-rw-r--r--qadevOOo/tests/basic/mod/forms/OPatternModel/forms_OPatternModel.xba128
-rw-r--r--qadevOOo/tests/basic/mod/forms/OPatternModel/script.xlb5
-rw-r--r--qadevOOo/tests/basic/mod/forms/ORadioButtonControl/forms_ORadioButtonControl.xba105
-rw-r--r--qadevOOo/tests/basic/mod/forms/ORadioButtonControl/script.xlb5
-rw-r--r--qadevOOo/tests/basic/mod/forms/ORadioButtonModel/forms_ORadioButtonModel.xba132
-rw-r--r--qadevOOo/tests/basic/mod/forms/ORadioButtonModel/script.xlb5
-rw-r--r--qadevOOo/tests/basic/mod/forms/OTimeControl/forms_OTimeControl.xba106
-rw-r--r--qadevOOo/tests/basic/mod/forms/OTimeControl/script.xlb5
-rw-r--r--qadevOOo/tests/basic/mod/forms/OTimeModel/forms_OTimeModel.xba182
-rw-r--r--qadevOOo/tests/basic/mod/forms/OTimeModel/script.xlb5
72 files changed, 4286 insertions, 0 deletions
diff --git a/qadevOOo/tests/basic/mod/forms/OButtonControl/forms_OButtonControl.xba b/qadevOOo/tests/basic/mod/forms/OButtonControl/forms_OButtonControl.xba
new file mode 100644
index 000000000000..b571308e576e
--- /dev/null
+++ b/qadevOOo/tests/basic/mod/forms/OButtonControl/forms_OButtonControl.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="forms_OButtonControl" script:language="StarBasic">
+
+
+'*************************************************************************
+'
+' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+'
+' Copyright 2000, 2010 Oracle and/or its affiliates.
+'
+' OpenOffice.org - a multi-platform office productivity suite
+'
+' This file is part of OpenOffice.org.
+'
+' OpenOffice.org is free software: you can redistribute it and/or modify
+' it under the terms of the GNU Lesser General Public License version 3
+' only, as published by the Free Software Foundation.
+'
+' OpenOffice.org is distributed in the hope that it will be useful,
+' but WITHOUT ANY WARRANTY; without even the implied warranty of
+' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+' GNU Lesser General Public License version 3 for more details
+' (a copy is included in the LICENSE file that accompanied this code).
+'
+' You should have received a copy of the GNU Lesser General Public License
+' version 3 along with OpenOffice.org. If not, see
+' <http://www.openoffice.org/license.html>
+' for a copy of the LGPLv3 License.
+'
+'*************************************************************************
+'*************************************************************************
+
+
+
+
+' REQUIRED VARIABLES for interface/service tests:
+
+' Required for com.sun.star.awt.XView:
+ Global oGraphics as Object
+
+' Required for com.sun.star.lang.XComponent:
+ Global oComponentInstance As Object ' it will be disposed
+
+' Required for com.sun.star.awt.XControl:
+ Global oContext As Object
+ Global oWinpeer As Object
+ Global oToolkit As Object
+ Global oModel As Object
+
+' Required for com.sun.star.awt.XWindow:
+ Global oXWindow as Object
+ Global oCtrlShape As Variant
+
+
+Sub CreateObj()
+
+'*************************************************************************
+' COMPONENT:
+' forms.OButtonControl
+'*************************************************************************
+On Error Goto ErrHndl
+
+ Dim bOK As Boolean
+ Dim oShape1 As Object
+ Dim oShape2 As Object
+ Dim oShape3 As Object
+ Dim oCurrCtrl As Object
+ Dim oWin As Object
+ Dim oKit As Object
+ Dim oDevice As Object
+ Dim oDoc2 As Object
+
+ bOK = true
+
+ oDoc = utils.createDocument("swriter", cObjectName)
+
+ Out.Log("try to insert some shapes...")
+ oShape1 = toolkittools.addControlToDefaultForm("CommandButton", 1000, 1000, 2000, 1000)
+ oShape2 = toolkittools.addControlToDefaultForm("CommandButton", 1000, 3000, 2000, 1000)
+ oShape3 = toolkittools.addControlToDefaultForm("TextField", 1000, 5000, 2000, 1000)
+
+ oModel = oShape1.getControl()
+ oCurrCtrl = oDoc.getCurrentController()
+ oWin = oCurrCtrl.getControl(oModel).getPeer()
+ oKit = oWin.getToolkit()
+ oDevice = oKit.createScreenCompatibleDevice(200,200)
+ oGraphics = oDevice.createGraphics()
+
+ oObj = oCurrCtrl.getControl(oModel)
+ oComponentInstance = oCurrCtrl.getControl(oShape2.getControl())
+ oContext = oDoc
+ oWinpeer = oWin
+ oToolkit = oKit
+ oXWindow = oCurrCtrl.getControl(oShape3.getControl())
+ oCtrlShape = oShape1
+
+Exit Sub
+ErrHndl:
+ Test.Exception()
+End Sub
+'Sub DisposeObj()
+' 'Re-open this document to close it successfully
+' oDoc2 = utils.createDocument("swriter", cObjectName + "2")
+' oDoc2.Dispose()
+'End Sub
+</script:module>
diff --git a/qadevOOo/tests/basic/mod/forms/OButtonControl/script.xlb b/qadevOOo/tests/basic/mod/forms/OButtonControl/script.xlb
new file mode 100644
index 000000000000..c0f46b692949
--- /dev/null
+++ b/qadevOOo/tests/basic/mod/forms/OButtonControl/script.xlb
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd">
+<library:library xmlns:library="http://openoffice.org/2000/library" library:name="forms_OButtonControl" library:readonly="false" library:passwordprotected="false">
+"<library:element library:name="forms_OButtonControl"/>
+"</library:library>
diff --git a/qadevOOo/tests/basic/mod/forms/OButtonModel/forms_OButtonModel.xba b/qadevOOo/tests/basic/mod/forms/OButtonModel/forms_OButtonModel.xba
new file mode 100644
index 000000000000..89a96c9e2467
--- /dev/null
+++ b/qadevOOo/tests/basic/mod/forms/OButtonModel/forms_OButtonModel.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="forms_OButtonModel" script:language="StarBasic">
+
+
+'*************************************************************************
+'
+' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+'
+' Copyright 2000, 2010 Oracle and/or its affiliates.
+'
+' OpenOffice.org - a multi-platform office productivity suite
+'
+' This file is part of OpenOffice.org.
+'
+' OpenOffice.org is free software: you can redistribute it and/or modify
+' it under the terms of the GNU Lesser General Public License version 3
+' only, as published by the Free Software Foundation.
+'
+' OpenOffice.org is distributed in the hope that it will be useful,
+' but WITHOUT ANY WARRANTY; without even the implied warranty of
+' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+' GNU Lesser General Public License version 3 for more details
+' (a copy is included in the LICENSE file that accompanied this code).
+'
+' You should have received a copy of the GNU Lesser General Public License
+' version 3 along with OpenOffice.org. If not, see
+' <http://www.openoffice.org/license.html>
+' for a copy of the LGPLv3 License.
+'
+'*************************************************************************
+'*************************************************************************
+
+
+
+' Be sure that all variables are dimensioned:
+option explicit
+
+
+' REQUIRED VARIABLES for interface/service tests:
+
+Global oComponentInstance As Object
+Global oPersistInstance As Object
+
+
+Sub CreateObj()
+
+'*************************************************************************
+' COMPONENT:
+' forms.OButtonModel
+'*************************************************************************
+On Error Goto ErrHndl
+ Dim bOK As Boolean
+ Dim ctrlShape As Object
+
+ bOK = true
+
+ oDoc = utils.createDocument("swriter", cObjectName)
+
+ ctrlShape = toolkittools.addControlToDefaultForm("CommandButton", 1000, 1000, 2000, 1000)
+ oObj = ctrlShape.getControl()
+ ctrlShape = toolkittools.addControlToDefaultForm("CommandButton", 1000, 3000, 2000, 1000)
+ oComponentInstance = ctrlShape.getControl()
+ ctrlShape = toolkittools.addControlToDefaultForm("CommandButton", 1000, 5000, 2000, 1000)
+ oPersistInstance = ctrlShape.getControl()
+
+
+Exit Sub
+ErrHndl:
+ Test.Exception()
+End Sub
+</script:module>
diff --git a/qadevOOo/tests/basic/mod/forms/OButtonModel/script.xlb b/qadevOOo/tests/basic/mod/forms/OButtonModel/script.xlb
new file mode 100644
index 000000000000..1e6a3faf31f0
--- /dev/null
+++ b/qadevOOo/tests/basic/mod/forms/OButtonModel/script.xlb
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd">
+<library:library xmlns:library="http://openoffice.org/2000/library" library:name="forms_OButtonModel" library:readonly="false" library:passwordprotected="false">
+"<library:element library:name="forms_OButtonModel"/>
+"</library:library>
diff --git a/qadevOOo/tests/basic/mod/forms/OCheckBoxControl/forms_OCheckBoxControl.xba b/qadevOOo/tests/basic/mod/forms/OCheckBoxControl/forms_OCheckBoxControl.xba
new file mode 100644
index 000000000000..9bb51ee2f615
--- /dev/null
+++ b/qadevOOo/tests/basic/mod/forms/OCheckBoxControl/forms_OCheckBoxControl.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="forms_OCheckBoxControl" script:language="StarBasic">
+
+
+'*************************************************************************
+'
+' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+'
+' Copyright 2000, 2010 Oracle and/or its affiliates.
+'
+' OpenOffice.org - a multi-platform office productivity suite
+'
+' This file is part of OpenOffice.org.
+'
+' OpenOffice.org is free software: you can redistribute it and/or modify
+' it under the terms of the GNU Lesser General Public License version 3
+' only, as published by the Free Software Foundation.
+'
+' OpenOffice.org is distributed in the hope that it will be useful,
+' but WITHOUT ANY WARRANTY; without even the implied warranty of
+' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+' GNU Lesser General Public License version 3 for more details
+' (a copy is included in the LICENSE file that accompanied this code).
+'
+' You should have received a copy of the GNU Lesser General Public License
+' version 3 along with OpenOffice.org. If not, see
+' <http://www.openoffice.org/license.html>
+' for a copy of the LGPLv3 License.
+'
+'*************************************************************************
+'*************************************************************************
+
+
+
+' Be sure that all variables are dimensioned:
+option explicit
+
+
+
+' REQUIRED VARIABLES for interface/service tests:
+
+' Required for com.sun.star.awt.XView:
+ Global oGraphics as Object
+
+' Required for com.sun.star.lang.XComponent:
+ Global oComponentInstance As Object ' it will be disposed
+
+' Required for com.sun.star.awt.XControl:
+ Global oContext As Object
+ Global oWinpeer As Object
+ Global oToolkit As Object
+ Global oModel As Object
+
+' Required for com.sun.star.awt.XWindow:
+ Global oXWindow as Object
+ Global oCtrlShape As Variant
+
+' Required for awt.XItemListener
+ Global bIL_itemStateChanged As Boolean
+ Global oEventItemListener As Object
+
+
+Sub CreateObj()
+
+'*************************************************************************
+' COMPONENT:
+' forms.OCheckBoxControl
+'*************************************************************************
+On Error Goto ErrHndl
+
+ Dim bOK As Boolean
+ Dim oShape1 As Object
+ Dim oShape2 As Object
+ Dim oShape3 As Object
+ Dim oCurrCtrl As Object
+ Dim oWin As Object
+ Dim oKit As Object
+ Dim oDevice As Object
+ Dim oDoc2 As Object
+ Dim oIListener As Object
+
+ bOK = true
+
+ oDoc = utils.createDocument("swriter", cObjectName)
+' oDoc2 = utils.createDocument("swriter", cObjectName + "2")
+
+ oShape1 = toolkittools.addControlToDefaultForm("CheckBox", 1000, 1000, 2000, 1000)
+ oShape2 = toolkittools.addControlToDefaultForm("CheckBox", 1000, 3000, 2000, 1000)
+ oShape3 = toolkittools.addControlToDefaultForm("TextField", 1000, 5000, 2000, 1000)
+
+ oModel = oShape1.getControl()
+ oCurrCtrl = oDoc.getCurrentController()
+ oWin = oCurrCtrl.getControl(oModel).getPeer()
+ oKit = oWin.getToolkit()
+ oDevice = oKit.createScreenCompatibleDevice(200,200)
+ oGraphics = oDevice.createGraphics()
+
+ oObj = oCurrCtrl.getControl(oModel)
+ oComponentInstance = oCurrCtrl.getControl(oShape2.getControl())
+ oContext = oDoc
+ oWinpeer = oWin
+ oToolkit = oKit
+ oXWindow = oCurrCtrl.getControl(oShape3.getControl())
+ oCtrlShape = oShape1
+
+ oIListener = createUnoListener("IL_", "com.sun.star.awt.XItemListener")
+ oObj.addItemListener(oIListener)
+
+Exit Sub
+ErrHndl:
+ Test.Exception()
+End Sub
+
+Sub IL_itemStateChanged(rEvent As Object)
+ bIL_itemStateChanged = True
+ Out.Log("CallBack for ItemListener itemStateChanged was called.")
+ oEventItemListener = rEvent
+End Sub
+
+
+'Sub DisposeObj()
+' 'Re-open this document to close it successfully
+' oDoc2 = utils.createDocument("swriter", cObjectName + "2")
+' oDoc2.Dispose()
+'End Sub
+</script:module>
diff --git a/qadevOOo/tests/basic/mod/forms/OCheckBoxControl/script.xlb b/qadevOOo/tests/basic/mod/forms/OCheckBoxControl/script.xlb
new file mode 100644
index 000000000000..bd422e9fb66e
--- /dev/null
+++ b/qadevOOo/tests/basic/mod/forms/OCheckBoxControl/script.xlb
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd">
+<library:library xmlns:library="http://openoffice.org/2000/library" library:name="forms_OCheckBoxControl" library:readonly="false" library:passwordprotected="false">
+"<library:element library:name="forms_OCheckBoxControl"/>
+"</library:library>
diff --git a/qadevOOo/tests/basic/mod/forms/OCheckBoxModel/forms_OCheckBoxModel.xba b/qadevOOo/tests/basic/mod/forms/OCheckBoxModel/forms_OCheckBoxModel.xba
new file mode 100644
index 000000000000..85c12933d4bb
--- /dev/null
+++ b/qadevOOo/tests/basic/mod/forms/OCheckBoxModel/forms_OCheckBoxModel.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="forms_OCheckBoxModel" script:language="StarBasic">
+
+
+'*************************************************************************
+'
+' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+'
+' Copyright 2000, 2010 Oracle and/or its affiliates.
+'
+' OpenOffice.org - a multi-platform office productivity suite
+'
+' This file is part of OpenOffice.org.
+'
+' OpenOffice.org is free software: you can redistribute it and/or modify
+' it under the terms of the GNU Lesser General Public License version 3
+' only, as published by the Free Software Foundation.
+'
+' OpenOffice.org is distributed in the hope that it will be useful,
+' but WITHOUT ANY WARRANTY; without even the implied warranty of
+' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+' GNU Lesser General Public License version 3 for more details
+' (a copy is included in the LICENSE file that accompanied this code).
+'
+' You should have received a copy of the GNU Lesser General Public License
+' version 3 along with OpenOffice.org. If not, see
+' <http://www.openoffice.org/license.html>
+' for a copy of the LGPLv3 License.
+'
+'*************************************************************************
+'*************************************************************************
+
+
+
+
+' REQUIRED VARIABLES for interface/service tests:
+
+Global oComponentInstance As Object
+Global oPersistInstance As Object
+
+
+Sub CreateObj()
+
+'*************************************************************************
+' COMPONENT:
+' forms.OCheckBoxModel
+'*************************************************************************
+On Error Goto ErrHndl
+
+ Dim bOK As Boolean
+ Dim oDrawPage as Object
+ Dim oCntrlShape as Object
+ bOK = true
+
+ oDoc = utils.createDocument("swriter", cObjectName)
+
+
+ oCntrlShape = toolkittools.addControlToDefaultForm("CheckBox", 1000, 1000, 2000, 1000)
+ oObj = oCntrlShape.getControl()
+ oCntrlShape = toolkittools.addControlToDefaultForm("CheckBox", 1000, 3000, 2000, 1000)
+ oComponentInstance = oCntrlShape.getControl()
+ oCntrlShape = toolkittools.addControlToDefaultForm("CheckBox", 1000, 5000, 2000, 1000)
+ oPersistInstance = oCntrlShape.getControl()
+
+
+Exit Sub
+ErrHndl:
+ Test.Exception()
+End Sub
+</script:module>
diff --git a/qadevOOo/tests/basic/mod/forms/OCheckBoxModel/script.xlb b/qadevOOo/tests/basic/mod/forms/OCheckBoxModel/script.xlb
new file mode 100644
index 000000000000..b81cae2daec5
--- /dev/null
+++ b/qadevOOo/tests/basic/mod/forms/OCheckBoxModel/script.xlb
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd">
+<library:library xmlns:library="http://openoffice.org/2000/library" library:name="forms_OCheckBoxModel" library:readonly="false" library:passwordprotected="false">
+"<library:element library:name="forms_OCheckBoxModel"/>
+"</library:library>
diff --git a/qadevOOo/tests/basic/mod/forms/OComboBoxControl/forms_OComboBoxControl.xba b/qadevOOo/tests/basic/mod/forms/OComboBoxControl/forms_OComboBoxControl.xba
new file mode 100644
index 000000000000..bd3436e0c3d7
--- /dev/null
+++ b/qadevOOo/tests/basic/mod/forms/OComboBoxControl/forms_OComboBoxControl.xba
@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
+<script:module xmlns:script="http://openoffice.org/2000/script" script:name="forms_OComboBoxControl" script:language="StarBasic">
+
+
+'*************************************************************************
+'
+' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+'
+' Copyright 2000, 2010 Oracle and/or its affiliates.
+'
+' OpenOffice.org - a multi-platform office productivity suite
+'
+' This file is part of OpenOffice.org.
+'
+' OpenOffice.org is free software: you can redistribute it and/or modify
+' it under the terms of the GNU Lesser General Public License version 3
+' only, as published by the Free Software Foundation.
+'
+' OpenOffice.org is distributed in the hope that it will be useful,
+' but WITHOUT ANY WARRANTY; without even the implied warranty of
+' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+' GNU Lesser General Public License version 3 for more details
+' (a copy is included in the LICENSE file that accompanied this code).
+'
+' You should have received a copy of the GNU Lesser General Public License
+' version 3 along with OpenOffice.org. If not, see
+' <http://www.openoffice.org/license.html>
+' for a copy of the LGPLv3 License.
+'
+'*************************************************************************
+'*************************************************************************
+
+
+
+' Be sure that all variables are dimensioned:
+option explicit
+
+
+
+' REQUIRED VARIABLES for interface/service tests:
+
+' Required for com.sun.star.awt.XView:
+ Global oGraphics as Object
+
+' Required for com.sun.star.lang.XComponent:
+ Global oComponentInstance As Object ' it will be disposed
+
+' Required for com.sun.star.awt.XControl:
+ Global oContext As Object
+ Global oWinpeer As Object
+ Global oToolkit As Object
+ Global oModel As Object
+
+' Required for com.sun.star.awt.XWindow:
+ Global oXWindow as Object
+ Global oCtrlShape As Variant
+
+
+
+Sub CreateObj()
+
+'*************************************************************************
+' COMPONENT:
+' forms.OComboBoxControl
+'*************************************************************************
+On Error Goto ErrHndl
+
+ Dim bOK As Boolean
+ Dim oShape1 As Object
+ Dim oShape2 As Object
+ Dim oShape3 As Object
+ Dim oCurrCtrl As Object
+ Dim oWin As Object
+ Dim oKit As Object
+ Dim oDevice As Object
+ Dim oDoc2 As Object
+
+ bOK = true
+
+ oDoc = utils.createDocument("swriter", cObjectName)
+' oDoc2 = utils.createDocument("swriter", cObjectName + "2")
+
+ oShape1 = toolkittools.addControlToDefaultForm("ComboBox", 1000, 1000, 3000, 1500)
+ oShape2 = toolkittools.addControlToDefaultForm("ComboBox", 1000, 3000, 3000, 1500)
+ oShape3 = toolkittools.addControlToDefaultForm("TextField", 1000, 5000, 3000, 1500)
+
+ oModel = oShape1.getControl()
+ oCurrCtrl = oDoc.getCurrentController()
+ oWin = oCurrCtrl.getControl(oModel).getPeer()
+ oKit = oWin.getToolkit()
+ oDevice = oKit.createScreenCompatibleDevice(200,200)
+ oGraphics = oDevice.createGraphics()
+
+ oObj = oCurrCtrl.getControl(oModel)
+ oComponentInstance = oCurrCtrl.getControl(oShape2.getControl())
+ oContext = oDoc
+ oWinpeer = oWin
+ oToolkit = oKit
+ oXWindow = oCurrCtrl.getControl(oShape3.getControl())
+ oCtrlShape = oShape1
+
+
+Exit Sub
+ErrHndl:
+ Test.Exception()
+End Sub
+</script:module>
diff --git a/qadevOOo/tests/basic/mod/forms/OComboBoxControl/script.xlb b/qadevOOo/tests/basic/mod/forms/OComboBoxControl/script.xlb
new file mode 100644
index 000000000000..10d3c4651c86
--- /dev/null
+++ b/qadevOOo/tests/basic/mod/forms/OComboBoxControl/script.xlb
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd">
+<library:library xmlns:library="http://openoffice.org/2000/library" library:name="forms_OComboBoxControl" library:readonly="false" library:passwordprotected="false">
+"<library:element library:name="forms_OComboBoxControl"/>
+"</library:library>
diff --git a/qadevOOo/tests/basic/mod/forms/OComboBoxModel/forms_OComboBoxModel.xba b/qadevOOo/tests/basic/mod/forms/OComboBoxModel/forms_OComboBoxModel.xba
new file mode 100644
index 000000000000..973aa92f5e73
--- /dev/null
+++ b/qadevOOo/tests/basic/mod/forms/OComboBoxModel/forms_OComboBoxModel.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="forms_OComboBoxModel" script:language="StarBasic">
+
+
+'*************************************************************************
+'
+' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+'
+' Copyright 2000, 2010 Oracle and/or its affiliates.
+'
+' OpenOffice.org - a multi-platform office productivity suite
+'
+' This file is part of OpenOffice.org.
+'
+' OpenOffice.org is free software: you can redistribute it and/or modify
+' it under the terms of the GNU Lesser General Public License version 3
+' only, as published by the Free Software Foundation.
+'
+' OpenOffice.org is distributed in the hope that it will be useful,
+' but WITHOUT ANY WARRANTY; without even the implied warranty of
+' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+' GNU Lesser General Public License version 3 for more details
+' (a copy is included in the LICENSE file that accompanied this code).
+'
+' You should have received a copy of the GNU Lesser General Public License
+' version 3 along with OpenOffice.org. If not, see
+' <http://www.openoffice.org/license.html>
+' for a copy of the LGPLv3 License.
+'
+'*************************************************************************
+'*************************************************************************
+
+
+
+' Be sure that all variables are dimensioned:
+option explicit
+
+
+' REQUIRED VARIABLES for interface/service tests:
+
+' for XComponent
+Global oComponentInstance As Object
+
+' for XPersistObject
+Global oPersistInstance As Object
+
+' for XUpdateBroadcaster
+Global bCustomUpdate As Boolean
+
+' for relation function checkCommit
+Global oForm As Object
+
+
+Sub CreateObj()
+
+'*************************************************************************
+' COMPONENT:
+' forms.OComboBoxModel
+'*************************************************************************
+On Error Goto ErrHndl
+ Dim bOK As Boolean
+ Dim oCntrlShape As Object, oDrawPage As Object
+
+ bOK = true
+ ' --- create a document if needed
+
+ oDoc = utils.createDocument("swriter", cObjectName)
+
+
+ oCntrlShape = toolkittools.addControlToDefaultForm("ComboBox", 1000, 1000, 2000, 1000)
+ oObj = oCntrlShape.getControl()
+ oCntrlShape = toolkittools.addControlToDefaultForm("ComboBox", 1000, 3000, 2000, 1000)
+ oComponentInstance = oCntrlShape.getControl()
+ oCntrlShape = toolkittools.addControlToDefaultForm("ComboBox", 1000, 5000, 2000, 1000)
+ oPersistInstance = oCntrlShape.getControl()
+
+ 'get control from document
+ oDrawPage = oDoc.DrawPage
+ oForm = oDrawPage.Forms.getByName("Standard")
+
+ oForm.DataSourceName = "Bibliography"
+ oForm.Command = "biblio"
+ oForm.CommandType = com.sun.star.sdb.CommandType.TABLE
+
+ oObj.DataField = "Author"
+
+ oForm.load()
+
+ ' for XUpdateBroadcaster
+ bCustomUpdate = true
+
+Exit Sub
+ErrHndl:
+ Test.Exception()
+End Sub
+
+Global sChangedText As String
+
+' for XBoundComponent
+Sub prepareCommit()
+On Error Goto ErrHndl
+ Out.Log("prepareCommit() called.")
+ sChangedText = "_" + oObj.Text
+ oObj.Text = sChangedText
+
+ exit sub
+ErrHndl:
+ Test.Exception()
+End Sub
+
+' for XBoundComponent
+Function checkCommit() As Boolean
+On Error Goto ErrHndl
+ Out.Log("checkCommit() called.")
+ Dim rowText As Variant
+
+ rowText = oForm.getString(oForm.findColumn("Author"))
+ checkCommit() = (rowText = sChangedText)
+
+ exit function
+ErrHndl:
+ Test.Exception()
+End Function
+
+' for XUpdateBroadcaster
+Sub UpdateComponent()
+ oObj.Text = "_" + oObj.Text
+ oObj.commit()
+End Sub
+</script:module>
diff --git a/qadevOOo/tests/basic/mod/forms/OComboBoxModel/script.xlb b/qadevOOo/tests/basic/mod/forms/OComboBoxModel/script.xlb
new file mode 100644
index 000000000000..8f59ecd5288a
--- /dev/null
+++ b/qadevOOo/tests/basic/mod/forms/OComboBoxModel/script.xlb
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd">
+<library:library xmlns:library="http://openoffice.org/2000/library" library:name="forms_OComboBoxModel" library:readonly="false" library:passwordprotected="false">
+"<library:element library:name="forms_OComboBoxModel"/>
+"</library:library>
diff --git a/qadevOOo/tests/basic/mod/forms/OCurrencyControl/forms_OCurrencyControl.xba b/qadevOOo/tests/basic/mod/forms/OCurrencyControl/forms_OCurrencyControl.xba
new file mode 100644
index 000000000000..c0594708a070
--- /dev/null
+++ b/qadevOOo/tests/basic/mod/forms/OCurrencyControl/forms_OCurrencyControl.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="forms_OCurrencyControl" script:language="StarBasic">
+
+
+'*************************************************************************
+'
+' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+'
+' Copyright 2000, 2010 Oracle and/or its affiliates.
+'
+' OpenOffice.org - a multi-platform office productivity suite
+'
+' This file is part of OpenOffice.org.
+'
+' OpenOffice.org is free software: you can redistribute it and/or modify
+' it under the terms of the GNU Lesser General Public License version 3
+' only, as published by the Free Software Foundation.
+'
+' OpenOffice.org is distributed in the hope that it will be useful,
+' but WITHOUT ANY WARRANTY; without even the implied warranty of
+' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+' GNU Lesser General Public License version 3 for more details
+' (a copy is included in the LICENSE file that accompanied this code).
+'
+' You should have received a copy of the GNU Lesser General Public License
+' version 3 along with OpenOffice.org. If not, see
+' <http://www.openoffice.org/license.html>
+' for a copy of the LGPLv3 License.
+'
+'*************************************************************************
+'*************************************************************************
+
+
+
+' Be sure that all variables are dimensioned:
+option explicit
+
+
+
+' REQUIRED VARIABLES for interface/service tests:
+
+' Required for com.sun.star.awt.XView:
+ Global oGraphics as Object
+
+' Required for com.sun.star.lang.XComponent:
+ Global oComponentInstance As Object ' it will be disposed
+
+' Required for com.sun.star.awt.XControl:
+ Global oContext As Object
+ Global oWinpeer As Object
+ Global oToolkit As Object
+ Global oModel As Object
+
+' Required for com.sun.star.awt.XWindow:
+ Global oXWindow as Object
+ Global oCtrlShape As Variant
+
+
+
+Sub CreateObj()
+
+'*************************************************************************
+' COMPONENT:
+' forms.OCurrencyControl
+'*************************************************************************
+On Error Goto ErrHndl
+
+ Dim bOK As Boolean
+ Dim oShape1 As Object
+ Dim oShape2 As Object
+ Dim oShape3 As Object
+ Dim oCurrCtrl As Object
+ Dim oWin As Object
+ Dim oKit As Object
+ Dim oDevice As Object
+ Dim oDoc2 As Object
+
+ bOK = true
+
+ oDoc = utils.createDocument("swriter", cObjectName)
+
+ oShape1 = toolkittools.addControlToDefaultForm("CurrencyField", 1000, 1000, 2000, 1000)
+ oShape2 = toolkittools.addControlToDefaultForm("CurrencyField", 1000, 3000, 2000, 1000)
+ oShape3 = toolkittools.addControlToDefaultForm("TextField", 1000, 5000, 2000, 1000)
+
+ oModel = oShape1.getControl()
+ oCurrCtrl = oDoc.getCurrentController()
+ oWin = oCurrCtrl.getControl(oModel).getPeer()
+ oKit = oWin.getToolkit()
+ oDevice = oKit.createScreenCompatibleDevice(200,200)
+ oGraphics = oDevice.createGraphics()
+
+ oObj = oCurrCtrl.getControl(oModel)
+ oComponentInstance = oCurrCtrl.getControl(oShape2.getControl())
+ oContext = oDoc
+ oWinpeer = oWin
+ oToolkit = oKit
+ oXWindow = oCurrCtrl.getControl(oShape3.getControl())
+ oCtrlShape = oShape1
+
+Exit Sub
+ErrHndl:
+ Test.Exception()
+End Sub
+</script:module>
diff --git a/qadevOOo/tests/basic/mod/forms/OCurrencyControl/script.xlb b/qadevOOo/tests/basic/mod/forms/OCurrencyControl/script.xlb
new file mode 100644
index 000000000000..a06c264fc157
--- /dev/null
+++ b/qadevOOo/tests/basic/mod/forms/OCurrencyControl/script.xlb
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd">
+<library:library xmlns:library="http://openoffice.org/2000/library" library:name="forms_OCurrencyControl" library:readonly="false" library:passwordprotected="false">
+"<library:element library:name="forms_OCurrencyControl"/>
+"</library:library>
diff --git a/qadevOOo/tests/basic/mod/forms/OCurrencyModel/forms_OCurrencyModel.xba b/qadevOOo/tests/basic/mod/forms/OCurrencyModel/forms_OCurrencyModel.xba
new file mode 100644
index 000000000000..e4c47dbcbcd2
--- /dev/null
+++ b/qadevOOo/tests/basic/mod/forms/OCurrencyModel/forms_OCurrencyModel.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="forms_OCurrencyModel" script:language="StarBasic">
+
+
+'*************************************************************************
+'
+' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+'
+' Copyright 2000, 2010 Oracle and/or its affiliates.
+'
+' OpenOffice.org - a multi-platform office productivity suite
+'
+' This file is part of OpenOffice.org.
+'
+' OpenOffice.org is free software: you can redistribute it and/or modify
+' it under the terms of the GNU Lesser General Public License version 3
+' only, as published by the Free Software Foundation.
+'
+' OpenOffice.org is distributed in the hope that it will be useful,
+' but WITHOUT ANY WARRANTY; without even the implied warranty of
+' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+' GNU Lesser General Public License version 3 for more details
+' (a copy is included in the LICENSE file that accompanied this code).
+'
+' You should have received a copy of the GNU Lesser General Public License
+' version 3 along with OpenOffice.org. If not, see
+' <http://www.openoffice.org/license.html>
+' for a copy of the LGPLv3 License.
+'
+'*************************************************************************
+'*************************************************************************
+
+
+
+' Be sure that all variables are dimensioned:
+option explicit
+
+
+' REQUIRED VARIABLES for interface/service tests:
+
+' for XComponent
+Global oComponentInstance As Object
+
+' for XPersistObject
+Global oPersistInstance As Object
+
+' for XUpdateBroadcaster
+Global bCustomUpdate As Boolean
+
+Global oForm As Object
+
+
+Sub CreateObj()
+
+'*************************************************************************
+' COMPONENT:
+' forms.OCurrencyModel
+'*************************************************************************
+On Error Goto ErrHndl
+
+ Dim bOK As Boolean
+ Dim oShape As Object, oDrawPage As Object
+
+ bOK = true
+' --- create a document if needed
+
+ oDoc = utils.createDocument("swriter", cObjectName)
+
+ oShape = toolkittools.addControlToDefaultForm("CurrencyField", 1000, 1000, 2000, 1000)
+ oObj = oShape.getControl()
+ oShape = toolkittools.addControlToDefaultForm("CurrencyField", 1000, 3000, 2000, 1000)
+ oComponentInstance = oShape.getControl()
+ oShape = toolkittools.addControlToDefaultForm("CurrencyField", 1000, 5000, 2000, 1000)
+ oPersistInstance = oShape.getControl()
+
+ 'get control from document
+ oDrawPage = oDoc.DrawPage
+ oForm = oDrawPage.Forms.getByName("Standard")
+
+ oForm.DataSourceName = "Bibliography"
+ oForm.Command = "biblio"
+ oForm.CommandType = com.sun.star.sdb.CommandType.TABLE
+
+ oObj.DataField = "Pages"
+
+ oForm.load()
+
+ ' for XUpdateBroadcaster
+ bCustomUpdate = true
+
+
+Exit Sub
+ErrHndl:
+ Test.Exception()
+End Sub
+
+Global aChangedValue As Double
+
+' for XBoundComponent
+Sub prepareCommit()
+On Error Goto ErrHndl
+ Out.Log("prepareCommit() called.")
+ if NOT (isNull(oObj.Value) OR isEmpty(oObj.Value)) then
+ aChangedValue = oObj.Value + 1
+ else
+ aChangedValue = 1
+ end if
+ oObj.Value = aChangedValue
+
+ exit sub
+ErrHndl:
+ Test.Exception()
+End Sub
+
+' for XBoundComponent
+Function checkCommit() As Boolean
+On Error Goto ErrHndl
+ Out.Log("checkCommit() called.")
+ Dim rowValue As Variant
+
+ rowValue = oForm.getDouble(oForm.findColumn("Pages"))
+ Out.Log("Value was set to " + aChangedValue )
+ Out.Log("the value in current row is " + rowValue)
+ checkCommit() = (rowValue = aChangedValue)
+
+ exit function
+ErrHndl:
+ Test.Exception()
+End Function
+
+' for XUpdateBroadcaster
+Sub UpdateComponent()
+ oObj.Value = oObj.Value + 1
+ oObj.commit()
+End Sub
+</script:module>
diff --git a/qadevOOo/tests/basic/mod/forms/OCurrencyModel/script.xlb b/qadevOOo/tests/basic/mod/forms/OCurrencyModel/script.xlb
new file mode 100644
index 000000000000..2ad36c4a5a60
--- /dev/null
+++ b/qadevOOo/tests/basic/mod/forms/OCurrencyModel/script.xlb
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd">
+<library:library xmlns:library="http://openoffice.org/2000/library" library:name="forms_OCurrencyModel" library:readonly="false" library:passwordprotected="false">
+"<library:element library:name="forms_OCurrencyModel"/>
+"</library:library>
diff --git a/qadevOOo/tests/basic/mod/forms/ODatabaseForm/forms_ODatabaseForm.xba b/qadevOOo/tests/basic/mod/forms/ODatabaseForm/forms_ODatabaseForm.xba
new file mode 100644
index 000000000000..c1f2102b06f5
--- /dev/null
+++ b/qadevOOo/tests/basic/mod/forms/ODatabaseForm/forms_ODatabaseForm.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="forms_ODatabaseForm" script:language="StarBasic">
+
+
+'*************************************************************************
+'
+' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+'
+' Copyright 2000, 2010 Oracle and/or its affiliates.
+'
+' OpenOffice.org - a multi-platform office productivity suite
+'
+' This file is part of OpenOffice.org.
+'
+' OpenOffice.org is free software: you can redistribute it and/or modify
+' it under the terms of the GNU Lesser General Public License version 3
+' only, as published by the Free Software Foundation.
+'
+' OpenOffice.org is distributed in the hope that it will be useful,
+' but WITHOUT ANY WARRANTY; without even the implied warranty of
+' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+' GNU Lesser General Public License version 3 for more details
+' (a copy is included in the LICENSE file that accompanied this code).
+'
+' You should have received a copy of the GNU Lesser General Public License
+' version 3 along with OpenOffice.org. If not, see
+' <http://www.openoffice.org/license.html>
+' for a copy of the LGPLv3 License.
+'
+'*************************************************************************
+'*************************************************************************
+
+
+
+' Be sure that all variables are dimensioned:
+option explicit
+
+
+' REQUIRED VARIABLES for interface/service tests:
+
+' for XPersistObject
+ Global oPersistInstance As Object
+
+' Required for com.sun.star.lang.XComponent:
+ Global oComponentInstance As Object ' it will be disposed
+
+ ' Requiered for com.sun.star.container.XNameContainer
+ Global oInstance As Object 'instance to insert
+
+ ' Required for com.sun.star.sdbc.XResultSet
+ Global cXResultSetFirstRecord as String
+ Global cXResultSetLastRecord as String
+ Global cXResultSetRecord1 as String
+ Global cXResultSetRecord2 as String
+ Global cXResultSet2BeforeLastRecord as String
+
+' Required for com.sun.star.sdbc.XColumnLocate:
+ Global cExistantColumnName As String
+
+ ' Requiered for com.sun.star.container.XNameReplace
+ Global cNameToReplace As String 'name of instance to be replased
+ Global oReplaceInstance As Object 'instance, that will be inserted
+ 'instead old one
+
+ Global oIdxReplaceInstance As Object
+
+' Required for com.sun.star.sdbc.XParameters
+ Global paramTypes as Variant
+
+' Required for com.sun.star.sdbc.XRow and com.sun.star.sdbc.XRowUpdate
+ Global rowTypes as Variant
+ Global rowTypesCol as Variant
+
+' Required for com.sun.star.sdbc.XResultSetUpdate
+ Global textColumn As String
+
+' Required for com.sun.star.awt.XTabControllerModel
+ Global XTabControlModel1 As Object
+ Global XTabControlModel2 As Object
+
+ Global oConnection As Object
+
+' Required for com.sun.star.container.XContainer
+ Global oElementToInsert As Object
+ Global oContainer As Object
+
+Sub CreateObj()
+
+'*************************************************************************
+' COMPONENT:
+' forms.ODatabaseForm
+'*************************************************************************
+On Error Goto ErrHndl
+ Dim bOK As Boolean
+ Dim oRowSet As Object, facc As Object, dbSource As Object
+ Dim srcFile As String, dstFile As String, dbSrcURL As String
+ Dim oDrawPage As Object, oForms As Object, oForm As Object
+ Dim oShape1 As Object, oShape2 As Object
+
+ bOK = true
+
+ ' Copying DB file to temp location
+ srcFile = utils.Path2URL(cTestDocsDir) + "TestDB/testDB.dbf"
+ dstFile = utils.getTempFileURL("TestDB.dbf")
+ dbSrcURL = "sdbc:dbase:" + utils.StrReplace(dstFile, "/testDB.dbf", "")
+
+ Out.Log("Copying file '" + srcFile + "' to '" + dstFile + "'")
+ facc = createUnoService("com.sun.star.ucb.SimpleFileAccess")
+ if (facc.exists(dstFile)) then facc.kill(dstFile)
+ facc.copy(srcFile, dstFile)
+
+ dbtools.RegisterDataSource("DBTest", dbSrcURL)
+
+ ' Creating a form
+ oDoc = utils.createDocument("swriter", cObjectName)
+
+ oShape1 = toolkittools.addControlToDefaultForm("ComboBox", 1000, 1000, 2000, 1000)
+ oShape2 = toolkittools.addControlToDefaultForm("TextField", 1000, 1000, 2000, 1000)
+ 'get control from document
+ oDrawPage = oDoc.DrawPage
+ oForms = oDrawPage.getForms()
+
+ oForm = oForms.getByName("Standard")
+
+ oForms.insertByName("Instance1", oDoc.createInstance("com.sun.star.form.component.Form"))
+ oForms.insertByName("Instance2", oDoc.createInstance("com.sun.star.form.component.Form"))
+
+ oObj = oForm
+
+ 'connect to a database
+ oForm.DataSourceName = "DBTest"
+ oForm.Command = "TestDB"
+ oForm.CommandType = com.sun.star.sdb.CommandType.TABLE
+ oForm.Load()
+
+ oConnection = oForm.ActiveConnection
+ Dim list as Object
+' list = createUnoListener("C_", "com.sun.star.lang.XEventListener")
+' oConnection.addEventListener(list)
+
+ 'for XComponent
+ Out.Log("" + oForms.hasByName("Instance1") + "," + oForms.hasByName("Instance2"))
+ oComponentInstance = oForms.getByName("Instance1")
+ oPersistInstance = oForms.getByName("Instance2")
+
+ 'for XNameContainer, XIndexContainer
+ oInstance = oDoc.createInstance("com.sun.star.form.component.ComboBox")
+
+ 'for XContainer
+ oElementToInsert = oDoc.createInstance("com.sun.star.form.component.ComboBox")
+
+ 'for XNameReplace
+ oReplaceInstance = oDoc.createInstance("com.sun.star.form.component.ComboBox")
+ oObj.insertByName(cObjectName + "Replace", oDoc.createInstance("com.sun.star.form.component.ComboBox"))
+ cNameToReplace = cObjectName + "Replace"
+
+ 'for XIndexReplace
+ oIdxReplaceInstance = oDoc.createInstance("com.sun.star.form.component.ComboBox")
+
+ cExistantColumnName = "_TEXT"
+ cXResultSetFirstRecord = "text1"
+ cXResultSetLastRecord = "text3"
+ cXResultSetRecord1 = "text1"
+ cXResultSetRecord2 = "text2"
+ cXResultSet2BeforeLastRecord = "text2"
+
+ ' for XParameters
+ paramTypes = DimArray()
+' paramTypes = Array("boolean", "byte", "short", "int", "long", "float", "double", "string", _
+' "bytes", "date", "time", "timestamp", "binarystream", "characterstream", "object", "objectwithinfo", _
+' "ref", "blob", "clob", "array")
+
+ ' for XRow and XRowUpdate
+ rowTypes = Array("string", "int", "long", "double", "float", "date", "datetm", "boolean")
+ rowTypesCol = Array(1, 2, 3, 4, 5, 6, 7, 9)
+' rowTypes = Array("boolean", "byte", "short", "int", "long", "float", "double", "string", _
+' "bytes", "date", "time", "timestamp", "binarystream", "characterstream", "object", "objectwithinfo", _
+' "ref", "blob", "clob", "array")
+
+' Required for com.sun.star.sdbc.XResultSetUpdate
+ textColumn = "_TEXT"
+
+' Required for com.sun.star.awt.XTabControllerModel
+ XTabControlModel1 = oShape1.getControl()
+ XTabControlModel2 = oShape2.getControl()
+
+Exit Sub
+ErrHndl:
+ Test.Exception()
+End Sub
+
+Sub DisposeObj()
+On Error Goto ErrHndl
+'msgbox "Disposing ODatabaseForm"
+ Out.Log("Closing DB connection ...")
+ oConnection.close()
+
+ Out.Log("Revoking 'DBTest' datasource ...")
+ dbtools.RevokeDB("DBTest")
+'msgbox "ODatabaseForm disposed."
+Exit Sub
+ErrHndl:
+ Test.Exception()
+ resume next
+End Sub
+
+Sub C_disposing()
+ Out.Log("!!! Connection disposed !!!")
+' oConnection.close()
+End Sub
+</script:module>
diff --git a/qadevOOo/tests/basic/mod/forms/ODatabaseForm/script.xlb b/qadevOOo/tests/basic/mod/forms/ODatabaseForm/script.xlb
new file mode 100644
index 000000000000..558bb6821d40
--- /dev/null
+++ b/qadevOOo/tests/basic/mod/forms/ODatabaseForm/script.xlb
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd">
+<library:library xmlns:library="http://openoffice.org/2000/library" library:name="forms_ODatabaseForm" library:readonly="false" library:passwordprotected="false">
+"<library:element library:name="forms_ODatabaseForm"/>
+"</library:library>
diff --git a/qadevOOo/tests/basic/mod/forms/ODateControl/forms_ODateControl.xba b/qadevOOo/tests/basic/mod/forms/ODateControl/forms_ODateControl.xba
new file mode 100644
index 000000000000..0a72fa971137
--- /dev/null
+++ b/qadevOOo/tests/basic/mod/forms/ODateControl/forms_ODateControl.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="forms_ODateControl" script:language="StarBasic">
+
+
+'*************************************************************************
+'
+' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+'
+' Copyright 2000, 2010 Oracle and/or its affiliates.
+'
+' OpenOffice.org - a multi-platform office productivity suite
+'
+' This file is part of OpenOffice.org.
+'
+' OpenOffice.org is free software: you can redistribute it and/or modify
+' it under the terms of the GNU Lesser General Public License version 3
+' only, as published by the Free Software Foundation.
+'
+' OpenOffice.org is distributed in the hope that it will be useful,
+' but WITHOUT ANY WARRANTY; without even the implied warranty of
+' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+' GNU Lesser General Public License version 3 for more details
+' (a copy is included in the LICENSE file that accompanied this code).
+'
+' You should have received a copy of the GNU Lesser General Public License
+' version 3 along with OpenOffice.org. If not, see
+' <http://www.openoffice.org/license.html>
+' for a copy of the LGPLv3 License.
+'
+'*************************************************************************
+'*************************************************************************
+
+
+
+' Be sure that all variables are dimensioned:
+option explicit
+
+
+
+' REQUIRED VARIABLES for interface/service tests:
+
+' Required for com.sun.star.awt.XView:
+ Global oGraphics as Object
+
+' Required for com.sun.star.lang.XComponent:
+ Global oComponentInstance As Object ' it will be disposed
+
+' Required for com.sun.star.awt.XControl:
+ Global oContext As Object
+ Global oWinpeer As Object
+ Global oToolkit As Object
+ Global oModel As Object
+
+' Required for com.sun.star.awt.XWindow:
+ Global oXWindow as Object
+ Global oCtrlShape As Variant
+
+
+
+Sub CreateObj()
+
+'*************************************************************************
+' COMPONENT:
+' forms.ODateControl
+'*************************************************************************
+On Error Goto ErrHndl
+
+ Dim bOK As Boolean
+ Dim oShape1 As Object
+ Dim oShape2 As Object
+ Dim oShape3 As Object
+ Dim oCurrCtrl As Object
+ Dim oWin As Object
+ Dim oKit As Object
+ Dim oDevice As Object
+ Dim oDoc2 As Object
+
+ bOK = true
+
+ oDoc = utils.createDocument("swriter", cObjectName)
+
+ oShape1 = toolkittools.addControlToDefaultForm("DateField", 1000, 1000, 2000, 1000)
+ oShape2 = toolkittools.addControlToDefaultForm("DateField", 1000, 3000, 2000, 1000)
+ oShape3 = toolkittools.addControlToDefaultForm("TextField", 1000, 5000, 2000, 1000)
+
+ oModel = oShape1.getControl()
+ oCurrCtrl = oDoc.getCurrentController()
+ oWin = oCurrCtrl.getControl(oModel).getPeer()
+ oKit = oWin.getToolkit()
+ oDevice = oKit.createScreenCompatibleDevice(200,200)
+ oGraphics = oDevice.createGraphics()
+
+ oObj = oCurrCtrl.getControl(oModel)
+ oComponentInstance = oCurrCtrl.getControl(oShape2.getControl())
+ oContext = oDoc
+ oWinpeer = oWin
+ oToolkit = oKit
+ oXWindow = oCurrCtrl.getControl(oShape3.getControl())
+ oCtrlShape = oShape1
+
+
+Exit Sub
+ErrHndl:
+ Test.Exception()
+End Sub
+</script:module>
diff --git a/qadevOOo/tests/basic/mod/forms/ODateControl/script.xlb b/qadevOOo/tests/basic/mod/forms/ODateControl/script.xlb
new file mode 100644
index 000000000000..39760a22b6dc
--- /dev/null
+++ b/qadevOOo/tests/basic/mod/forms/ODateControl/script.xlb
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd">
+<library:library xmlns:library="http://openoffice.org/2000/library" library:name="forms_ODateControl" library:readonly="false" library:passwordprotected="false">
+"<library:element library:name="forms_ODateControl"/>
+"</library:library>
diff --git a/qadevOOo/tests/basic/mod/forms/ODateModel/forms_ODateModel.xba b/qadevOOo/tests/basic/mod/forms/ODateModel/forms_ODateModel.xba
new file mode 100644
index 000000000000..c038d6f2bef9
--- /dev/null
+++ b/qadevOOo/tests/basic/mod/forms/ODateModel/forms_ODateModel.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="forms_ODateModel" script:language="StarBasic">
+
+
+'*************************************************************************
+'
+' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+'
+' Copyright 2000, 2010 Oracle and/or its affiliates.
+'
+' OpenOffice.org - a multi-platform office productivity suite
+'
+' This file is part of OpenOffice.org.
+'
+' OpenOffice.org is free software: you can redistribute it and/or modify
+' it under the terms of the GNU Lesser General Public License version 3
+' only, as published by the Free Software Foundation.
+'
+' OpenOffice.org is distributed in the hope that it will be useful,
+' but WITHOUT ANY WARRANTY; without even the implied warranty of
+' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+' GNU Lesser General Public License version 3 for more details
+' (a copy is included in the LICENSE file that accompanied this code).
+'
+' You should have received a copy of the GNU Lesser General Public License
+' version 3 along with OpenOffice.org. If not, see
+' <http://www.openoffice.org/license.html>
+' for a copy of the LGPLv3 License.
+'
+'*************************************************************************
+'*************************************************************************
+
+
+
+' Be sure that all variables are dimensioned:
+option explicit
+
+
+' REQUIRED VARIABLES for interface/service tests:
+
+' for XComponent
+Global oComponentInstance As Object
+
+' for XPersistObject
+Global oPersistInstance As Object
+
+' for XUpdateBroadcaster
+Global bCustomUpdate As Boolean
+
+Global oForm As Object
+
+
+Sub CreateObj()
+
+'*************************************************************************
+' COMPONENT:
+' forms.ODateModel
+'*************************************************************************
+On Error Goto ErrHndl
+
+ Dim bOK As Boolean
+ Dim oShape As Object, oDrawPage As Object
+
+ bOK = true
+ ' --- create a document if needed
+
+ oDoc = utils.createDocument("swriter", cObjectName)
+
+ oShape = toolkittools.addControlToDefaultForm("DateField", 1000, 1000, 2000, 1000)
+ oObj = oShape.getControl()
+ oShape = toolkittools.addControlToDefaultForm("DateField", 1000, 3000, 2000, 1000)
+ oComponentInstance = oShape.getControl()
+ oShape = toolkittools.addControlToDefaultForm("DateField", 1000, 5000, 2000, 1000)
+ oPersistInstance = oShape.getControl()
+
+ 'get control from document
+ oDrawPage = oDoc.DrawPage
+ oForm = oDrawPage.Forms.getByName("Standard")
+
+ oForm.DataSourceName = "Bibliography"
+ oForm.Command = "biblio"
+ oForm.CommandType = com.sun.star.sdb.CommandType.TABLE
+
+ oObj.DataField = "Custom1"
+
+ oForm.load()
+
+ ' for XUpdateBroadcaster
+ bCustomUpdate = true
+
+Exit Sub
+ErrHndl:
+ Test.Exception()
+End Sub
+
+Global aChangedValue As Variant
+
+' for XBoundComponent
+Sub prepareCommit()
+On Error Goto ErrHndl
+ Dim dat As New com.sun.star.util.Date
+
+ Out.Log("prepareCommit() called.")
+ if NOT (isNull(oObj.Date) OR isEmpty(oObj.Date)) then
+ aChangedValue = oObj.Date + 1
+ else
+ aChangedValue = 1
+ end if
+ oObj.Date = aChangedValue
+
+ exit sub
+ErrHndl:
+ Test.Exception()
+End Sub
+
+' for XBoundComponent
+Function checkCommit() As Boolean
+On Error Goto ErrHndl
+ Out.Log("checkCommit() called.")
+ Dim rowValue As Variant
+
+ oForm.updateRow()
+ oForm.reload()
+ rowValue = oObj.Date
+ Out.Log("Value was set to " + aChangedValue )
+ Out.Log("the value in current row is " + rowValue)
+ checkCommit() = (rowValue = aChangedValue)
+
+ exit function
+ErrHndl:
+ Test.Exception()
+End Function
+
+' for XUpdateBroadcaster
+Sub UpdateComponent()
+ oObj.Date = oObj.Date + 1
+ oObj.commit()
+End Sub
+</script:module>
diff --git a/qadevOOo/tests/basic/mod/forms/ODateModel/script.xlb b/qadevOOo/tests/basic/mod/forms/ODateModel/script.xlb
new file mode 100644
index 000000000000..52fb8db2a879
--- /dev/null
+++ b/qadevOOo/tests/basic/mod/forms/ODateModel/script.xlb
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd">
+<library:library xmlns:library="http://openoffice.org/2000/library" library:name="forms_ODateModel" library:readonly="false" library:passwordprotected="false">
+"<library:element library:name="forms_ODateModel"/>
+"</library:library>
diff --git a/qadevOOo/tests/basic/mod/forms/OEditControl/forms_OEditControl.xba b/qadevOOo/tests/basic/mod/forms/OEditControl/forms_OEditControl.xba
new file mode 100644
index 000000000000..30881b177270
--- /dev/null
+++ b/qadevOOo/tests/basic/mod/forms/OEditControl/forms_OEditControl.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="forms_OEditControl" script:language="StarBasic">
+
+
+'*************************************************************************
+'
+' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+'
+' Copyright 2000, 2010 Oracle and/or its affiliates.
+'
+' OpenOffice.org - a multi-platform office productivity suite
+'
+' This file is part of OpenOffice.org.
+'
+' OpenOffice.org is free software: you can redistribute it and/or modify
+' it under the terms of the GNU Lesser General Public License version 3
+' only, as published by the Free Software Foundation.
+'
+' OpenOffice.org is distributed in the hope that it will be useful,
+' but WITHOUT ANY WARRANTY; without even the implied warranty of
+' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+' GNU Lesser General Public License version 3 for more details
+' (a copy is included in the LICENSE file that accompanied this code).
+'
+' You should have received a copy of the GNU Lesser General Public License
+' version 3 along with OpenOffice.org. If not, see
+' <http://www.openoffice.org/license.html>
+' for a copy of the LGPLv3 License.
+'
+'*************************************************************************
+'*************************************************************************
+
+
+
+' Be sure that all variables are dimensioned:
+option explicit
+
+
+
+' REQUIRED VARIABLES for interface/service tests:
+
+' Required for com.sun.star.awt.XView:
+ Global oGraphics as Object
+
+' Required for com.sun.star.lang.XComponent:
+ Global oComponentInstance As Object ' it will be disposed
+
+' Required for com.sun.star.awt.XControl:
+ Global oContext As Object
+ Global oWinpeer As Object
+ Global oToolkit As Object
+ Global oModel As Object
+
+' Required for com.sun.star.awt.XWindow:
+ Global oXWindow as Object
+ Global oCtrlShape As Variant
+
+
+
+Sub CreateObj()
+
+'*************************************************************************
+' COMPONENT:
+' forms.OEditControl
+'*************************************************************************
+On Error Goto ErrHndl
+
+ Dim bOK As Boolean
+ Dim oShape1 As Object
+ Dim oShape2 As Object
+ Dim oShape3 As Object
+ Dim oCurrCtrl As Object
+ Dim oWin As Object
+ Dim oKit As Object
+ Dim oDevice As Object
+
+ bOK = true
+
+ oDoc = utils.createDocument("swriter", cObjectName)
+
+ oShape1 = toolkittools.addControlToDefaultForm("TextField", 1000, 1000, 2000, 1000)
+ oShape2 = toolkittools.addControlToDefaultForm("TextField", 1000, 3000, 2000, 1000)
+ oShape3 = toolkittools.addControlToDefaultForm("TextField", 1000, 5000, 2000, 1000)
+
+ oModel = oShape1.getControl()
+ oCurrCtrl = oDoc.getCurrentController()
+ oWin = oCurrCtrl.getControl(oModel).getPeer()
+ oKit = oWin.getToolkit()
+ oDevice = oKit.createScreenCompatibleDevice(200,200)
+ oGraphics = oDevice.createGraphics()
+
+ oObj = oCurrCtrl.getControl(oModel)
+ oComponentInstance = oCurrCtrl.getControl(oShape2.getControl())
+ oContext = oDoc
+ oWinpeer = oWin
+ oToolkit = oKit
+ oXWindow = oCurrCtrl.getControl(oShape3.getControl())
+ oCtrlShape = oShape1
+
+
+Exit Sub
+ErrHndl:
+ Test.Exception()
+End Sub
+</script:module>
diff --git a/qadevOOo/tests/basic/mod/forms/OEditControl/script.xlb b/qadevOOo/tests/basic/mod/forms/OEditControl/script.xlb
new file mode 100644
index 000000000000..764079c52396
--- /dev/null
+++ b/qadevOOo/tests/basic/mod/forms/OEditControl/script.xlb
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd">
+<library:library xmlns:library="http://openoffice.org/2000/library" library:name="forms_OEditControl" library:readonly="false" library:passwordprotected="false">
+"<library:element library:name="forms_OEditControl"/>
+"</library:library>
diff --git a/qadevOOo/tests/basic/mod/forms/OEditModel/forms_OEditModel.xba b/qadevOOo/tests/basic/mod/forms/OEditModel/forms_OEditModel.xba
new file mode 100644
index 000000000000..d1aaab2517a4
--- /dev/null
+++ b/qadevOOo/tests/basic/mod/forms/OEditModel/forms_OEditModel.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="forms_OEditModel" script:language="StarBasic">
+
+
+'*************************************************************************
+'
+' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+'
+' Copyright 2000, 2010 Oracle and/or its affiliates.
+'
+' OpenOffice.org - a multi-platform office productivity suite
+'
+' This file is part of OpenOffice.org.
+'
+' OpenOffice.org is free software: you can redistribute it and/or modify
+' it under the terms of the GNU Lesser General Public License version 3
+' only, as published by the Free Software Foundation.
+'
+' OpenOffice.org is distributed in the hope that it will be useful,
+' but WITHOUT ANY WARRANTY; without even the implied warranty of
+' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+' GNU Lesser General Public License version 3 for more details
+' (a copy is included in the LICENSE file that accompanied this code).
+'
+' You should have received a copy of the GNU Lesser General Public License
+' version 3 along with OpenOffice.org. If not, see
+' <http://www.openoffice.org/license.html>
+' for a copy of the LGPLv3 License.
+'
+'*************************************************************************
+'*************************************************************************
+
+
+
+' Be sure that all variables are dimensioned:
+option explicit
+
+
+' REQUIRED VARIABLES for interface/service tests:
+
+' for XComponent
+Global oComponentInstance As Object
+
+' for XPersistObject
+Global oPersistInstance As Object
+
+' for XUpdateBroadcaster
+Global bCustomUpdate As Boolean
+
+Global oForm As Object
+
+
+Sub CreateObj()
+
+'*************************************************************************
+' COMPONENT:
+' forms.OEditModel
+'*************************************************************************
+On Error Goto ErrHndl
+ Dim bOK As Boolean
+ Dim oShape As Object, oDrawPage As Object
+
+ bOK = true
+
+ oDoc = utils.createDocument("swriter", cObjectName)
+
+ oShape = toolkittools.addControlToDefaultForm("TextField", 1000, 1000, 2000, 1000)
+ oObj = oShape.getControl()
+ oShape = toolkittools.addControlToDefaultForm("TextField", 1000, 3000, 2000, 1000)
+ oComponentInstance = oShape.getControl()
+ oShape = toolkittools.addControlToDefaultForm("TextField", 1000, 5000, 2000, 1000)
+ oPersistInstance = oShape.getControl()
+
+ 'get control from document
+ oDrawPage = oDoc.DrawPage
+ oForm = oDrawPage.Forms.getByName("Standard")
+
+ oForm.DataSourceName = "Bibliography"
+ oForm.Command = "biblio"
+ oForm.CommandType = com.sun.star.sdb.CommandType.TABLE
+
+ oObj.DataField = "Author"
+
+ oForm.load()
+
+ ' for XUpdateBroadcaster
+ bCustomUpdate = true
+
+Exit Sub
+ErrHndl:
+ Test.Exception()
+End Sub
+
+Global sChangedText As String
+
+' for XBoundComponent
+Sub prepareCommit()
+On Error Goto ErrHndl
+ Out.Log("prepareCommit() called.")
+ sChangedText = "_" + oObj.Text
+ oObj.Text = sChangedText
+
+ exit sub
+ErrHndl:
+ Test.Exception()
+End Sub
+
+' for XBoundComponent
+Function checkCommit() As Boolean
+On Error Goto ErrHndl
+ Out.Log("checkCommit() called.")
+ Dim rowText As Variant
+
+ rowText = oForm.getString(oForm.findColumn("Author"))
+ checkCommit() = (rowText = sChangedText)
+
+ exit function
+ErrHndl:
+ Test.Exception()
+End Function
+
+' for XUpdateBroadcaster
+Sub UpdateComponent()
+ oObj.Text = "_" + oObj.Text
+ oObj.commit()
+End Sub
+</script:module>
diff --git a/qadevOOo/tests/basic/mod/forms/OEditModel/script.xlb b/qadevOOo/tests/basic/mod/forms/OEditModel/script.xlb
new file mode 100644
index 000000000000..96715b5ae2e1
--- /dev/null
+++ b/qadevOOo/tests/basic/mod/forms/OEditModel/script.xlb
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd">
+<library:library xmlns:library="http://openoffice.org/2000/library" library:name="forms_OEditModel" library:readonly="false" library:passwordprotected="false">
+"<library:element library:name="forms_OEditModel"/>
+"</library:library>
diff --git a/qadevOOo/tests/basic/mod/forms/OFileControlModel/forms_OFileControlModel.xba b/qadevOOo/tests/basic/mod/forms/OFileControlModel/forms_OFileControlModel.xba
new file mode 100644
index 000000000000..50ddc2c0e558
--- /dev/null
+++ b/qadevOOo/tests/basic/mod/forms/OFileControlModel/forms_OFileControlModel.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="forms_OFileControlModel" script:language="StarBasic">
+
+
+'*************************************************************************
+'
+' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+'
+' Copyright 2000, 2010 Oracle and/or its affiliates.
+'
+' OpenOffice.org - a multi-platform office productivity suite
+'
+' This file is part of OpenOffice.org.
+'
+' OpenOffice.org is free software: you can redistribute it and/or modify
+' it under the terms of the GNU Lesser General Public License version 3
+' only, as published by the Free Software Foundation.
+'
+' OpenOffice.org is distributed in the hope that it will be useful,
+' but WITHOUT ANY WARRANTY; without even the implied warranty of
+' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+' GNU Lesser General Public License version 3 for more details
+' (a copy is included in the LICENSE file that accompanied this code).
+'
+' You should have received a copy of the GNU Lesser General Public License
+' version 3 along with OpenOffice.org. If not, see
+' <http://www.openoffice.org/license.html>
+' for a copy of the LGPLv3 License.
+'
+'*************************************************************************
+'*************************************************************************
+
+
+
+' Be sure that all variables are dimensioned:
+option explicit
+
+
+' REQUIRED VARIABLES for interface/service tests:
+
+' for XComponent
+Global oComponentInstance As Object
+
+' for XPersistObject
+Global oPersistInstance As Object
+
+Global oForm As Object
+
+
+Sub CreateObj()
+
+'*************************************************************************
+' COMPONENT:
+' forms.OFileControlModel
+'*************************************************************************
+On Error Goto ErrHndl
+ Dim bOK As Boolean
+ Dim oShape As Object, oDrawPage As Object
+
+ bOK = true
+
+ oDoc = utils.createDocument("swriter", cObjectName)
+
+ oShape = toolkittools.addControlToDefaultForm("FileControl", 1000, 1000, 2000, 1000)
+ oObj = oShape.getControl()
+ oShape = toolkittools.addControlToDefaultForm("FileControl", 1000, 3000, 2000, 1000)
+ oComponentInstance = oShape.getControl()
+ oShape = toolkittools.addControlToDefaultForm("FileControl", 1000, 5000, 2000, 1000)
+ oPersistInstance = oShape.getControl()
+
+Exit Sub
+ErrHndl:
+ Test.Exception()
+End Sub
+</script:module>
diff --git a/qadevOOo/tests/basic/mod/forms/OFileControlModel/script.xlb b/qadevOOo/tests/basic/mod/forms/OFileControlModel/script.xlb
new file mode 100644
index 000000000000..79c36ddf2a22
--- /dev/null
+++ b/qadevOOo/tests/basic/mod/forms/OFileControlModel/script.xlb
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd">
+<library:library xmlns:library="http://openoffice.org/2000/library" library:name="forms_OFileControlModel" library:readonly="false" library:passwordprotected="false">
+"<library:element library:name="forms_OFileControlModel"/>
+"</library:library>
diff --git a/qadevOOo/tests/basic/mod/forms/OFixedTextModel/forms_OFixedTextModel.xba b/qadevOOo/tests/basic/mod/forms/OFixedTextModel/forms_OFixedTextModel.xba
new file mode 100644
index 000000000000..1f4d518652e5
--- /dev/null
+++ b/qadevOOo/tests/basic/mod/forms/OFixedTextModel/forms_OFixedTextModel.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="forms_OFixedTextModel" script:language="StarBasic">
+
+
+'*************************************************************************
+'
+' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+'
+' Copyright 2000, 2010 Oracle and/or its affiliates.
+'
+' OpenOffice.org - a multi-platform office productivity suite
+'
+' This file is part of OpenOffice.org.
+'
+' OpenOffice.org is free software: you can redistribute it and/or modify
+' it under the terms of the GNU Lesser General Public License version 3
+' only, as published by the Free Software Foundation.
+'
+' OpenOffice.org is distributed in the hope that it will be useful,
+' but WITHOUT ANY WARRANTY; without even the implied warranty of
+' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+' GNU Lesser General Public License version 3 for more details
+' (a copy is included in the LICENSE file that accompanied this code).
+'
+' You should have received a copy of the GNU Lesser General Public License
+' version 3 along with OpenOffice.org. If not, see
+' <http://www.openoffice.org/license.html>
+' for a copy of the LGPLv3 License.
+'
+'*************************************************************************
+'*************************************************************************
+
+
+
+' Be sure that all variables are dimensioned:
+option explicit
+
+
+' REQUIRED VARIABLES for interface/service tests:
+
+' for XComponent
+Global oComponentInstance As Object
+
+' for XPersistObject
+Global oPersistInstance As Object
+
+
+Sub CreateObj()
+
+'*************************************************************************
+' COMPONENT:
+' forms.OFixedTextModel
+'*************************************************************************
+On Error Goto ErrHndl
+ Dim bOK As Boolean
+ Dim oShape As Object
+
+ bOK = true
+
+ oDoc = utils.createDocument("swriter", cObjectName)
+
+ oShape = toolkittools.addControlToDefaultForm("FixedText", 1000, 1000, 2000, 1000)
+ oObj = oShape.getControl()
+ oShape = toolkittools.addControlToDefaultForm("FixedText", 1000, 3000, 2000, 1000)
+ oComponentInstance = oShape.getControl()
+ oShape = toolkittools.addControlToDefaultForm("FixedText", 1000, 5000, 2000, 1000)
+ oPersistInstance = oShape.getControl()
+
+Exit Sub
+ErrHndl:
+ Test.Exception()
+End Sub
+</script:module>
diff --git a/qadevOOo/tests/basic/mod/forms/OFixedTextModel/script.xlb b/qadevOOo/tests/basic/mod/forms/OFixedTextModel/script.xlb
new file mode 100644
index 000000000000..2181f2d0a32b
--- /dev/null
+++ b/qadevOOo/tests/basic/mod/forms/OFixedTextModel/script.xlb
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd">
+<library:library xmlns:library="http://openoffice.org/2000/library" library:name="forms_OFixedTextModel" library:readonly="false" library:passwordprotected="false">
+"<library:element library:name="forms_OFixedTextModel"/>
+"</library:library>
diff --git a/qadevOOo/tests/basic/mod/forms/OFormattedControl/forms_OFormattedControl.xba b/qadevOOo/tests/basic/mod/forms/OFormattedControl/forms_OFormattedControl.xba
new file mode 100644
index 000000000000..31ec92e4cc10
--- /dev/null
+++ b/qadevOOo/tests/basic/mod/forms/OFormattedControl/forms_OFormattedControl.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="forms_OFormattedControl" script:language="StarBasic">
+
+
+'*************************************************************************
+'
+' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+'
+' Copyright 2000, 2010 Oracle and/or its affiliates.
+'
+' OpenOffice.org - a multi-platform office productivity suite
+'
+' This file is part of OpenOffice.org.
+'
+' OpenOffice.org is free software: you can redistribute it and/or modify
+' it under the terms of the GNU Lesser General Public License version 3
+' only, as published by the Free Software Foundation.
+'
+' OpenOffice.org is distributed in the hope that it will be useful,
+' but WITHOUT ANY WARRANTY; without even the implied warranty of
+' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+' GNU Lesser General Public License version 3 for more details
+' (a copy is included in the LICENSE file that accompanied this code).
+'
+' You should have received a copy of the GNU Lesser General Public License
+' version 3 along with OpenOffice.org. If not, see
+' <http://www.openoffice.org/license.html>
+' for a copy of the LGPLv3 License.
+'
+'*************************************************************************
+'*************************************************************************
+
+
+
+' Be sure that all variables are dimensioned:
+option explicit
+
+
+
+' REQUIRED VARIABLES for interface/service tests:
+
+' Required for com.sun.star.awt.XView:
+ Global oGraphics as Object
+
+' Required for com.sun.star.lang.XComponent:
+ Global oComponentInstance As Object ' it will be disposed
+
+' Required for com.sun.star.awt.XControl:
+ Global oContext As Object
+ Global oWinpeer As Object
+ Global oToolkit As Object
+ Global oModel As Object
+
+' Required for com.sun.star.awt.XWindow:
+ Global oXWindow as Object
+ Global oCtrlShape As Variant
+
+
+
+Sub CreateObj()
+
+'*************************************************************************
+' COMPONENT:
+' forms.OFormattedControl
+'*************************************************************************
+On Error Goto ErrHndl
+
+ Dim bOK As Boolean
+ Dim oShape1 As Object
+ Dim oShape2 As Object
+ Dim oShape3 As Object
+ Dim oCurrCtrl As Object
+ Dim oWin As Object
+ Dim oKit As Object
+ Dim oDevice As Object
+ Dim oDoc2 As Object
+
+ bOK = true
+
+ oDoc = utils.createDocument("swriter", cObjectName)
+
+ oShape1 = toolkittools.addControlToDefaultForm("FormattedField", 1000, 1000, 2000, 1000)
+ oShape2 = toolkittools.addControlToDefaultForm("FormattedField", 1000, 3000, 2000, 1000)
+ oShape3 = toolkittools.addControlToDefaultForm("TextField", 1000, 5000, 2000, 1000)
+
+ oModel = oShape1.getControl()
+ oCurrCtrl = oDoc.getCurrentController()
+ oWin = oCurrCtrl.getControl(oModel).getPeer()
+ oKit = oWin.getToolkit()
+ oDevice = oKit.createScreenCompatibleDevice(200,200)
+ oGraphics = oDevice.createGraphics()
+
+ oObj = oCurrCtrl.getControl(oModel)
+ oComponentInstance = oCurrCtrl.getControl(oShape2.getControl())
+ oContext = oDoc
+ oWinpeer = oWin
+ oToolkit = oKit
+ oXWindow = oCurrCtrl.getControl(oShape3.getControl())
+ oCtrlShape = oShape1
+
+
+Exit Sub
+ErrHndl:
+ Test.Exception()
+End Sub
+</script:module>
diff --git a/qadevOOo/tests/basic/mod/forms/OFormattedControl/script.xlb b/qadevOOo/tests/basic/mod/forms/OFormattedControl/script.xlb
new file mode 100644
index 000000000000..f77a899327c0
--- /dev/null
+++ b/qadevOOo/tests/basic/mod/forms/OFormattedControl/script.xlb
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd">
+<library:library xmlns:library="http://openoffice.org/2000/library" library:name="forms_OFormattedControl" library:readonly="false" library:passwordprotected="false">
+"<library:element library:name="forms_OFormattedControl"/>
+"</library:library>
diff --git a/qadevOOo/tests/basic/mod/forms/OFormattedFieldWrapper/forms_OFormattedFieldWrapper.xba b/qadevOOo/tests/basic/mod/forms/OFormattedFieldWrapper/forms_OFormattedFieldWrapper.xba
new file mode 100644
index 000000000000..d76b0bdbfe00
--- /dev/null
+++ b/qadevOOo/tests/basic/mod/forms/OFormattedFieldWrapper/forms_OFormattedFieldWrapper.xba
@@ -0,0 +1,166 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
+<script:module xmlns:script="http://openoffice.org/2000/script" script:name="forms_OFormattedFieldWrapper" script:language="StarBasic">
+
+
+'*************************************************************************
+'
+' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+'
+' Copyright 2000, 2010 Oracle and/or its affiliates.
+'
+' OpenOffice.org - a multi-platform office productivity suite
+'
+' This file is part of OpenOffice.org.
+'
+' OpenOffice.org is free software: you can redistribute it and/or modify
+' it under the terms of the GNU Lesser General Public License version 3
+' only, as published by the Free Software Foundation.
+'
+' OpenOffice.org is distributed in the hope that it will be useful,
+' but WITHOUT ANY WARRANTY; without even the implied warranty of
+' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+' GNU Lesser General Public License version 3 for more details
+' (a copy is included in the LICENSE file that accompanied this code).
+'
+' You should have received a copy of the GNU Lesser General Public License
+' version 3 along with OpenOffice.org. If not, see
+' <http://www.openoffice.org/license.html>
+' for a copy of the LGPLv3 License.
+'
+'*************************************************************************
+'*************************************************************************
+
+
+
+' Be sure that all variables are dimensioned:
+option explicit
+
+
+' REQUIRED VARIABLES for interface/service tests:
+
+' Requiered for com.sun.star.lang.XComponent
+ Global oComponentInstance As Object ' it will be disposed
+
+' Requiered for com.sun.star.io.XPersistObject
+ Global oPersistInstance As Object
+
+' for XUpdateBroadcaster
+Global bCustomUpdate As Boolean
+
+Global oForm As Object
+
+
+Sub CreateObj()
+
+'*************************************************************************
+' COMPONENT:
+' forms.OFormattedFieldWrapper
+'*************************************************************************
+On Error Goto ErrHndl
+ Dim bOK As Boolean
+ Dim oShape As Object, oDrawPage As Object
+
+ bOK = true
+
+ oDoc = utils.createDocument("swriter", cObjectName)
+
+ oShape = toolkittools.addControlToDefaultForm("DatabaseFormattedField", 1000, 1000, 2000, 1000)
+ oObj = oShape.getControl()
+ oShape = toolkittools.addControlToDefaultForm("DatabaseFormattedField", 1000, 3000, 2000, 1000)
+ oComponentInstance = oShape.getControl()
+ oShape = toolkittools.addControlToDefaultForm("DatabaseFormattedField", 1000, 5000, 2000, 1000)
+ oPersistInstance = oShape.getControl()
+
+ 'get control from document
+ oDrawPage = oDoc.DrawPage
+ oForm = oDrawPage.Forms.getByName("Standard")
+
+ oForm.DataSourceName = "Bibliography"
+ oForm.Command = "biblio"
+ oForm.CommandType = com.sun.star.sdb.CommandType.TABLE
+
+ oObj.DataField = "Custom2"
+
+ oForm.load()
+
+ ' for XUpdateBroadcaster
+ bCustomUpdate = true
+
+ ' Switching to non-design mode
+ switchDesignMode(oDoc)
+
+Exit Sub
+ErrHndl:
+ Test.Exception()
+End Sub
+
+Sub switchDesignMode(xDoc as Object)
+On Error Goto ErrHndl
+
+ Dim frame as Variant, disp as Variant, transf as Object
+ Dim URL as new com.sun.star.util.URL
+ Dim noProps()
+ Dim res as Boolean
+
+ frame = xDoc.getCurrentController().getFrame()
+ URL.Complete = ".uno:SwitchControlDesignMode"
+ transf = createUnoService("com.sun.star.util.URLTransformer")
+ res = transf.parseStrict(URL)
+
+ out.log("URL parsed :" + res)
+
+ disp = frame.queryDispatch(URL, "", com.sun.star.frame.FrameSearchFlag.SELF _
+ OR com.sun.star.frame.FrameSearchFlag.CHILDREN)
+
+ out.log("disp get.")
+
+ disp.dispatch(URL, noProps())
+Exit Sub
+ErrHndl:
+ Test.Exception()
+End Sub
+
+Global sChangedText As String
+
+' for XBoundComponent
+Sub prepareCommit()
+On Error Goto ErrHndl
+ Out.Log("prepareCommit() called.")
+
+ if isNull(oObj.EffectiveValue) OR isEmpty(oObj.EffectiveValue) then
+ oObj.EffectiveValue = "12"
+ endif
+ sChangedText = "9" + oObj.EffectiveValue
+
+ Out.Log("Text was: '" + oObj.EffectiveValue + "', set to '" + sChangedText + "'")
+
+ oObj.EffectiveValue = sChangedText
+
+ exit sub
+ErrHndl:
+ Test.Exception()
+End Sub
+
+' for XBoundComponent
+Function checkCommit() As Boolean
+On Error Goto ErrHndl
+ Out.Log("checkCommit() called.")
+ Dim rowText As Variant
+
+ rowText = oForm.getString(oForm.findColumn("Custom2"))
+
+ Out.Log("Result test: '" + rowText + "'")
+ checkCommit() = (rowText = sChangedText)
+
+ exit function
+ErrHndl:
+ Test.Exception()
+End Function
+
+' for XUpdateBroadcaster
+Sub UpdateComponent()
+ oObj.EffectiveValue = "_" + oObj.EffectiveValue
+ oObj.commit()
+End Sub
+</script:module>
diff --git a/qadevOOo/tests/basic/mod/forms/OFormattedFieldWrapper/script.xlb b/qadevOOo/tests/basic/mod/forms/OFormattedFieldWrapper/script.xlb
new file mode 100644
index 000000000000..3ec914585ae1
--- /dev/null
+++ b/qadevOOo/tests/basic/mod/forms/OFormattedFieldWrapper/script.xlb
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd">
+<library:library xmlns:library="http://openoffice.org/2000/library" library:name="forms_OFormattedFieldWrapper" library:readonly="false" library:passwordprotected="false">
+"<library:element library:name="forms_OFormattedFieldWrapper"/>
+"</library:library>
diff --git a/qadevOOo/tests/basic/mod/forms/OFormsCollection/forms_OFormsCollection.xba b/qadevOOo/tests/basic/mod/forms/OFormsCollection/forms_OFormsCollection.xba
new file mode 100644
index 000000000000..4ecc02ce80cf
--- /dev/null
+++ b/qadevOOo/tests/basic/mod/forms/OFormsCollection/forms_OFormsCollection.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="forms_OFormsCollection" script:language="StarBasic">
+
+
+'*************************************************************************
+'
+' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+'
+' Copyright 2000, 2010 Oracle and/or its affiliates.
+'
+' OpenOffice.org - a multi-platform office productivity suite
+'
+' This file is part of OpenOffice.org.
+'
+' OpenOffice.org is free software: you can redistribute it and/or modify
+' it under the terms of the GNU Lesser General Public License version 3
+' only, as published by the Free Software Foundation.
+'
+' OpenOffice.org is distributed in the hope that it will be useful,
+' but WITHOUT ANY WARRANTY; without even the implied warranty of
+' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+' GNU Lesser General Public License version 3 for more details
+' (a copy is included in the LICENSE file that accompanied this code).
+'
+' You should have received a copy of the GNU Lesser General Public License
+' version 3 along with OpenOffice.org. If not, see
+' <http://www.openoffice.org/license.html>
+' for a copy of the LGPLv3 License.
+'
+'*************************************************************************
+'*************************************************************************
+
+
+
+' Be sure that all variables are dimensioned:
+option explicit
+
+
+' REQUIRED VARIABLES for interface/service tests:
+
+' Required for com.sun.star.container.XNameContainer:
+Global oInstance As Object
+
+' Required for com.sun.star.container.XNameReplace:
+Global cNameToReplace As String
+Global oReplaceInstance As Object
+
+' Required for com.sun.star.container.XIndexReplace
+Global oIdxReplaceInstance As Object
+
+' Required for com.sun.star.io.XPersistObject
+Global oPersistInstance As Object
+
+
+Sub CreateObj()
+
+'*************************************************************************
+' COMPONENT:
+' forms.OFormsCollection
+'*************************************************************************
+On Error Goto ErrHndl
+ Dim bOK As Boolean
+ Dim oDrawPage As Object, oForms As Object, oForm As Object
+
+ bOK = true
+ oDoc = utils.createDocument("swriter", cObjectName)
+
+ oDrawPage = oDoc.DrawPage
+ oForms = oDrawPage.Forms
+
+ oForm = oDoc.createInstance("com.sun.star.form.component.Form")
+ oForm.Name = "first form"
+ oForms.insertByIndex(0, oForm)
+
+ oForm = oDoc.createInstance("com.sun.star.form.component.Form")
+ oForm.Name = "second form"
+ oForms.insertByIndex(1, oForm)
+
+ oInstance = oDoc.createInstance("com.sun.star.form.component.Form")
+ oInstance.Name = "instance form"
+
+ oReplaceInstance = oDoc.createInstance("com.sun.star.form.component.Form")
+ oReplaceInstance.Name = "replace form"
+
+ oIdxReplaceInstance = oDoc.createInstance("com.sun.star.form.component.Form")
+ oIdxReplaceInstance.Name = "index replace form"
+
+ cNameToReplace = "second form"
+
+ oObj = oForms
+
+Exit Sub
+ErrHndl:
+ Test.Exception()
+End Sub
+</script:module>
diff --git a/qadevOOo/tests/basic/mod/forms/OFormsCollection/script.xlb b/qadevOOo/tests/basic/mod/forms/OFormsCollection/script.xlb
new file mode 100644
index 000000000000..d2d253b60998
--- /dev/null
+++ b/qadevOOo/tests/basic/mod/forms/OFormsCollection/script.xlb
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd">
+<library:library xmlns:library="http://openoffice.org/2000/library" library:name="forms_OFormsCollection" library:readonly="false" library:passwordprotected="false">
+"<library:element library:name="forms_OFormsCollection"/>
+"</library:library>
diff --git a/qadevOOo/tests/basic/mod/forms/OGridControlModel/forms_OGridControlModel.xba b/qadevOOo/tests/basic/mod/forms/OGridControlModel/forms_OGridControlModel.xba
new file mode 100644
index 000000000000..2631dd931902
--- /dev/null
+++ b/qadevOOo/tests/basic/mod/forms/OGridControlModel/forms_OGridControlModel.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="forms_OGridControlModel" script:language="StarBasic">
+
+
+'*************************************************************************
+'
+' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+'
+' Copyright 2000, 2010 Oracle and/or its affiliates.
+'
+' OpenOffice.org - a multi-platform office productivity suite
+'
+' This file is part of OpenOffice.org.
+'
+' OpenOffice.org is free software: you can redistribute it and/or modify
+' it under the terms of the GNU Lesser General Public License version 3
+' only, as published by the Free Software Foundation.
+'
+' OpenOffice.org is distributed in the hope that it will be useful,
+' but WITHOUT ANY WARRANTY; without even the implied warranty of
+' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+' GNU Lesser General Public License version 3 for more details
+' (a copy is included in the LICENSE file that accompanied this code).
+'
+' You should have received a copy of the GNU Lesser General Public License
+' version 3 along with OpenOffice.org. If not, see
+' <http://www.openoffice.org/license.html>
+' for a copy of the LGPLv3 License.
+'
+'*************************************************************************
+'*************************************************************************
+
+
+
+' Be sure that all variables are dimensioned:
+option explicit
+
+
+' REQUIRED VARIABLES for interface/service tests:
+
+' Required for XPersistObject
+Global oPersistInstance As Object
+
+' Required for XComponent
+Global oComponentInstance As Object ' it will be disposed
+
+' Requiered for com.sun.star.container.XNameContainer
+ Global oInstance As Object 'instance to insert
+
+' Requiered for com.sun.star.view.XSelectionSupplier
+ Global SelectableObj1 As Variant
+ Global SelectableObj2 As Variant
+
+' Requiered for com.sun.star.container.XNameReplace
+ Global cNameToReplace As String 'name of instance to be replased
+ Global oReplaceInstance As Object 'instance, that will be inserted
+ 'instead old one
+
+' Requiered for com.sun.star.container.XIndexReplace
+ Global oIdxReplaceInstance As Object
+
+' Requiered for XContainer
+ Global oElementToInsert As Object
+
+
+Sub CreateObj()
+
+'*************************************************************************
+' COMPONENT:
+' forms.OGridControlModel
+'*************************************************************************
+On Error Goto ErrHndl
+ Dim bOK As Boolean, i As Integer
+ Dim oShape As Object, oGridColumn As Object
+
+ bOK = true
+
+ oDoc = utils.createDocument("swriter", cObjectName)
+
+ oShape = toolkittools.addControlToDefaultForm("GridControl", 1000, 1000, 3000, 3000)
+ oObj = oShape.getControl()
+ oShape = toolkittools.addControlToDefaultForm("GridControl", 1000, 5000, 500, 500)
+ oComponentInstance = oShape.getControl()
+ oShape = toolkittools.addControlToDefaultForm("GridControl", 1000, 9000, 500, 500)
+ oPersistInstance = oShape.getControl()
+
+ 'insert Columns into Grid
+ for i = 0 to 10
+ oGridColumn = oObj.createColumn("TextField")
+ oGridColumn.Label = "Label" + Str(i)
+ oGridColumn.DataField = "Data" + Str(i)
+ oObj.insertByName("Field" + i , oGridColumn)
+
+ next i
+
+ SelectableObj1 = oObj.getByName("Field" + 7)
+ SelectableObj2 = oObj.getByName("Field" + 5)
+
+ 'for XNameContainer
+ oInstance = oObj.createColumn("TextField")
+ oInstance.Label = "LabelInstance"
+ oInstance.DataField = "DataInstance"
+
+ oElementToInsert = oObj.createColumn("TextField")
+ oElementToInsert.Label = "LabelInstance"
+ oElementToInsert.DataField = "DataInstance"
+
+ 'for XNameReplace
+ cNameToReplace = "Field2"
+ oReplaceInstance = oObj.createColumn("TextField")
+ oReplaceInstance.Label = "LabelReplace"
+ oReplaceInstance.DataField = "LabelReplace"
+
+ 'for XIndexReplace
+ oIdxReplaceInstance = oObj.createColumn("TextField")
+ oIdxReplaceInstance.Label = "LabelIndexReplace"
+
+Exit Sub
+ErrHndl:
+ Test.Exception()
+End Sub
+</script:module>
diff --git a/qadevOOo/tests/basic/mod/forms/OGridControlModel/script.xlb b/qadevOOo/tests/basic/mod/forms/OGridControlModel/script.xlb
new file mode 100644
index 000000000000..c525093365aa
--- /dev/null
+++ b/qadevOOo/tests/basic/mod/forms/OGridControlModel/script.xlb
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd">
+<library:library xmlns:library="http://openoffice.org/2000/library" library:name="forms_OGridControlModel" library:readonly="false" library:passwordprotected="false">
+"<library:element library:name="forms_OGridControlModel"/>
+"</library:library>
diff --git a/qadevOOo/tests/basic/mod/forms/OGroupBoxControl/forms_OGroupBoxControl.xba b/qadevOOo/tests/basic/mod/forms/OGroupBoxControl/forms_OGroupBoxControl.xba
new file mode 100644
index 000000000000..39ab1062b729
--- /dev/null
+++ b/qadevOOo/tests/basic/mod/forms/OGroupBoxControl/forms_OGroupBoxControl.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="forms_OGroupBoxControl" script:language="StarBasic">
+
+
+'*************************************************************************
+'
+' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+'
+' Copyright 2000, 2010 Oracle and/or its affiliates.
+'
+' OpenOffice.org - a multi-platform office productivity suite
+'
+' This file is part of OpenOffice.org.
+'
+' OpenOffice.org is free software: you can redistribute it and/or modify
+' it under the terms of the GNU Lesser General Public License version 3
+' only, as published by the Free Software Foundation.
+'
+' OpenOffice.org is distributed in the hope that it will be useful,
+' but WITHOUT ANY WARRANTY; without even the implied warranty of
+' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+' GNU Lesser General Public License version 3 for more details
+' (a copy is included in the LICENSE file that accompanied this code).
+'
+' You should have received a copy of the GNU Lesser General Public License
+' version 3 along with OpenOffice.org. If not, see
+' <http://www.openoffice.org/license.html>
+' for a copy of the LGPLv3 License.
+'
+'*************************************************************************
+'*************************************************************************
+
+
+
+' Be sure that all variables are dimensioned:
+option explicit
+
+
+' REQUIRED VARIABLES for interface/service tests:
+
+' Required for com.sun.star.awt.XView:
+ Global oGraphics as Object
+
+' Required for com.sun.star.lang.XComponent:
+ Global oComponentInstance As Object ' it will be disposed
+
+' Required for com.sun.star.awt.XControl:
+ Global oContext As Object
+ Global oWinpeer As Object
+ Global oToolkit As Object
+ Global oModel As Object
+
+' Required for com.sun.star.awt.XWindow:
+ Global oXWindow as Object
+ Global oCtrlShape As Variant
+
+
+
+Sub CreateObj()
+
+'*************************************************************************
+' COMPONENT:
+' forms.OGroupBoxControl
+'*************************************************************************
+On Error Goto ErrHndl
+
+ Dim bOK As Boolean
+ Dim oShape1 As Object
+ Dim oShape2 As Object
+ Dim oShape3 As Object
+ Dim oCurrCtrl As Object
+ Dim oWin As Object
+ Dim oKit As Object
+ Dim oDevice As Object
+
+ bOK = true
+
+ oDoc = utils.createDocument("swriter", cObjectName)
+
+ oShape1 = toolkittools.addControlToDefaultForm("GroupBox", 1000, 1000, 2000, 1000)
+ oShape2 = toolkittools.addControlToDefaultForm("GroupBox", 1000, 3000, 2000, 1000)
+ oShape3 = toolkittools.addControlToDefaultForm("TextField", 1000, 5000, 2000, 1000)
+
+ oModel = oShape1.getControl()
+ oCurrCtrl = oDoc.getCurrentController()
+ oWin = oCurrCtrl.getControl(oModel).getPeer()
+ oKit = oWin.getToolkit()
+ oDevice = oKit.createScreenCompatibleDevice(200,200)
+ oGraphics = oDevice.createGraphics()
+
+ oObj = oCurrCtrl.getControl(oModel)
+ oComponentInstance = oCurrCtrl.getControl(oShape2.getControl())
+ oContext = oDoc
+ oWinpeer = oWin
+ oToolkit = oKit
+ oXWindow = oCurrCtrl.getControl(oShape3.getControl())
+ oCtrlShape = oShape1
+
+Exit Sub
+ErrHndl:
+ Test.Exception()
+End Sub
+</script:module>
diff --git a/qadevOOo/tests/basic/mod/forms/OGroupBoxControl/script.xlb b/qadevOOo/tests/basic/mod/forms/OGroupBoxControl/script.xlb
new file mode 100644
index 000000000000..35becbb255d5
--- /dev/null
+++ b/qadevOOo/tests/basic/mod/forms/OGroupBoxControl/script.xlb
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd">
+<library:library xmlns:library="http://openoffice.org/2000/library" library:name="forms_OGroupBoxControl" library:readonly="false" library:passwordprotected="false">
+"<library:element library:name="forms_OGroupBoxControl"/>
+"</library:library>
diff --git a/qadevOOo/tests/basic/mod/forms/OGroupBoxModel/forms_OGroupBoxModel.xba b/qadevOOo/tests/basic/mod/forms/OGroupBoxModel/forms_OGroupBoxModel.xba
new file mode 100644
index 000000000000..101d322ab147
--- /dev/null
+++ b/qadevOOo/tests/basic/mod/forms/OGroupBoxModel/forms_OGroupBoxModel.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="forms_OGroupBoxModel" script:language="StarBasic">
+
+
+'*************************************************************************
+'
+' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+'
+' Copyright 2000, 2010 Oracle and/or its affiliates.
+'
+' OpenOffice.org - a multi-platform office productivity suite
+'
+' This file is part of OpenOffice.org.
+'
+' OpenOffice.org is free software: you can redistribute it and/or modify
+' it under the terms of the GNU Lesser General Public License version 3
+' only, as published by the Free Software Foundation.
+'
+' OpenOffice.org is distributed in the hope that it will be useful,
+' but WITHOUT ANY WARRANTY; without even the implied warranty of
+' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+' GNU Lesser General Public License version 3 for more details
+' (a copy is included in the LICENSE file that accompanied this code).
+'
+' You should have received a copy of the GNU Lesser General Public License
+' version 3 along with OpenOffice.org. If not, see
+' <http://www.openoffice.org/license.html>
+' for a copy of the LGPLv3 License.
+'
+'*************************************************************************
+'*************************************************************************
+
+
+
+' Be sure that all variables are dimensioned:
+option explicit
+
+
+' REQUIRED VARIABLES for interface/service tests:
+
+' for XComponent
+Global oComponentInstance As Object
+
+' for XPersistObject
+Global oPersistInstance As Object
+
+
+Sub CreateObj()
+
+'*************************************************************************
+' COMPONENT:
+' forms.OGroupBoxModel
+'*************************************************************************
+On Error Goto ErrHndl
+ Dim bOK As Boolean
+ Dim oShape As Object
+
+ bOK = true
+
+ oDoc = utils.createDocument("swriter", cObjectName)
+
+
+ oShape = toolkittools.addControlToDefaultForm("GroupBox", 1000, 1000, 2000, 1000)
+ oObj = oShape.getControl()
+ oShape = toolkittools.addControlToDefaultForm("GroupBox", 1000, 3000, 2000, 1000)
+ oComponentInstance = oShape.getControl()
+ oShape = toolkittools.addControlToDefaultForm("GroupBox", 1000, 5000, 2000, 1000)
+ oPersistInstance = oShape.getControl()
+
+Exit Sub
+ErrHndl:
+ Test.Exception()
+End Sub
+</script:module>
diff --git a/qadevOOo/tests/basic/mod/forms/OGroupBoxModel/script.xlb b/qadevOOo/tests/basic/mod/forms/OGroupBoxModel/script.xlb
new file mode 100644
index 000000000000..e2797e9989d0
--- /dev/null
+++ b/qadevOOo/tests/basic/mod/forms/OGroupBoxModel/script.xlb
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd">
+<library:library xmlns:library="http://openoffice.org/2000/library" library:name="forms_OGroupBoxModel" library:readonly="false" library:passwordprotected="false">
+"<library:element library:name="forms_OGroupBoxModel"/>
+"</library:library>
diff --git a/qadevOOo/tests/basic/mod/forms/OHiddenModel/forms_OHiddenModel.xba b/qadevOOo/tests/basic/mod/forms/OHiddenModel/forms_OHiddenModel.xba
new file mode 100644
index 000000000000..809c8eef80aa
--- /dev/null
+++ b/qadevOOo/tests/basic/mod/forms/OHiddenModel/forms_OHiddenModel.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="forms_OHiddenModel" script:language="StarBasic">
+
+
+'*************************************************************************
+'
+' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+'
+' Copyright 2000, 2010 Oracle and/or its affiliates.
+'
+' OpenOffice.org - a multi-platform office productivity suite
+'
+' This file is part of OpenOffice.org.
+'
+' OpenOffice.org is free software: you can redistribute it and/or modify
+' it under the terms of the GNU Lesser General Public License version 3
+' only, as published by the Free Software Foundation.
+'
+' OpenOffice.org is distributed in the hope that it will be useful,
+' but WITHOUT ANY WARRANTY; without even the implied warranty of
+' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+' GNU Lesser General Public License version 3 for more details
+' (a copy is included in the LICENSE file that accompanied this code).
+'
+' You should have received a copy of the GNU Lesser General Public License
+' version 3 along with OpenOffice.org. If not, see
+' <http://www.openoffice.org/license.html>
+' for a copy of the LGPLv3 License.
+'
+'*************************************************************************
+'*************************************************************************
+
+
+
+' Be sure that all variables are dimensioned:
+option explicit
+
+
+' REQUIRED VARIABLES for interface/service tests:
+
+' for XComponent
+Global oComponentInstance As Object
+
+' for XPersistObject
+Global oPersistInstance As Object
+
+
+Sub CreateObj()
+
+'*************************************************************************
+' COMPONENT:
+' forms.OHiddenModel
+'*************************************************************************
+On Error Goto ErrHndl
+ Dim bOK As Boolean
+ Dim oDrawPage As Object, oForm As Object
+
+ bOK = true
+
+ oDoc = utils.createDocument("swriter", cObjectName)
+
+ addHiddenControl()
+ addHiddenControl()
+ addHiddenControl()
+ addHiddenControl()
+ addHiddenControl()
+
+ 'get control from document
+ oDrawPage = oDoc.DrawPage
+ oForm = oDrawPage.Forms.getByIndex(0)
+ 'for xComponent
+ oComponentInstance = oForm.getByIndex(1)
+ oPersistInstance = oForm.getByIndex(2)
+
+ oObj = oForm.getByIndex(oForm.count - 1)
+
+
+Exit Sub
+ErrHndl:
+ Test.Exception()
+End Sub
+
+Sub addHiddenControl()
+ Dim oDrawPage as Object
+ Dim oForm as Object, oForms as Object
+ Dim oControl as Object, oControlShape as Object
+
+ oDrawPage = oDoc.DrawPage
+ oControlShape = oDoc.createInstance("com.sun.star.drawing.ControlShape")
+ oControl = oDoc.createInstance("com.sun.star.form.component.HiddenControl")
+ oForm = oDoc.createInstance("com.sun.star.form.component.Form")
+ oforms = oDrawPage.Forms
+ if oForms.count = 0 then
+ oForm.Name = "Form1"
+ oForms.insertbyindex(0,oForm)
+ endif
+ oForm = oForms.getByIndex(0)
+ oForm.insertByIndex(oForm.count,oControl)
+End Sub
+</script:module>
diff --git a/qadevOOo/tests/basic/mod/forms/OHiddenModel/script.xlb b/qadevOOo/tests/basic/mod/forms/OHiddenModel/script.xlb
new file mode 100644
index 000000000000..84d3638e9666
--- /dev/null
+++ b/qadevOOo/tests/basic/mod/forms/OHiddenModel/script.xlb
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd">
+<library:library xmlns:library="http://openoffice.org/2000/library" library:name="forms_OHiddenModel" library:readonly="false" library:passwordprotected="false">
+"<library:element library:name="forms_OHiddenModel"/>
+"</library:library>
diff --git a/qadevOOo/tests/basic/mod/forms/OImageButtonControl/forms_OImageButtonControl.xba b/qadevOOo/tests/basic/mod/forms/OImageButtonControl/forms_OImageButtonControl.xba
new file mode 100644
index 000000000000..6eb28793b0da
--- /dev/null
+++ b/qadevOOo/tests/basic/mod/forms/OImageButtonControl/forms_OImageButtonControl.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="forms_OImageButtonControl" script:language="StarBasic">
+
+
+'*************************************************************************
+'
+' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+'
+' Copyright 2000, 2010 Oracle and/or its affiliates.
+'
+' OpenOffice.org - a multi-platform office productivity suite
+'
+' This file is part of OpenOffice.org.
+'
+' OpenOffice.org is free software: you can redistribute it and/or modify
+' it under the terms of the GNU Lesser General Public License version 3
+' only, as published by the Free Software Foundation.
+'
+' OpenOffice.org is distributed in the hope that it will be useful,
+' but WITHOUT ANY WARRANTY; without even the implied warranty of
+' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+' GNU Lesser General Public License version 3 for more details
+' (a copy is included in the LICENSE file that accompanied this code).
+'
+' You should have received a copy of the GNU Lesser General Public License
+' version 3 along with OpenOffice.org. If not, see
+' <http://www.openoffice.org/license.html>
+' for a copy of the LGPLv3 License.
+'
+'*************************************************************************
+'*************************************************************************
+
+
+
+' Be sure that all variables are dimensioned:
+option explicit
+
+
+
+' REQUIRED VARIABLES for interface/service tests:
+
+' Required for com.sun.star.awt.XView:
+ Global oGraphics as Object
+
+' Required for com.sun.star.lang.XComponent:
+ Global oComponentInstance As Object ' it will be disposed
+
+' Required for com.sun.star.awt.XControl:
+ Global oContext As Object
+ Global oWinpeer As Object
+ Global oToolkit As Object
+ Global oModel As Object
+
+' Required for com.sun.star.awt.XWindow:
+ Global oXWindow as Object
+ Global oCtrlShape As Variant
+
+
+
+Sub CreateObj()
+
+'*************************************************************************
+' COMPONENT:
+' forms.OImageButtonControl
+'*************************************************************************
+On Error Goto ErrHndl
+
+ Dim bOK As Boolean
+ Dim oShape1 As Object
+ Dim oShape2 As Object
+ Dim oShape3 As Object
+ Dim oCurrCtrl As Object
+ Dim oWin As Object
+ Dim oKit As Object
+ Dim oDevice As Object
+
+ bOK = true
+
+ oDoc = utils.createDocument("swriter", cObjectName)
+
+ oShape1 = toolkittools.addControlToDefaultForm("ImageButton", 1000, 1000, 2000, 1000)
+ oShape2 = toolkittools.addControlToDefaultForm("ImageButton", 1000, 3000, 2000, 1000)
+ oShape3 = toolkittools.addControlToDefaultForm("TextField", 1000, 5000, 2000, 1000)
+
+ oModel = oShape1.getControl()
+ oCurrCtrl = oDoc.getCurrentController()
+ oWin = oCurrCtrl.getControl(oModel).getPeer()
+ oKit = oWin.getToolkit()
+ oDevice = oKit.createScreenCompatibleDevice(200,200)
+ oGraphics = oDevice.createGraphics()
+
+ oObj = oCurrCtrl.getControl(oModel)
+ oComponentInstance = oCurrCtrl.getControl(oShape2.getControl())
+ oContext = oDoc
+ oWinpeer = oWin
+ oToolkit = oKit
+ oXWindow = oCurrCtrl.getControl(oShape3.getControl())
+ oCtrlShape = oShape1
+
+Exit Sub
+ErrHndl:
+ Test.Exception()
+End Sub
+</script:module>
diff --git a/qadevOOo/tests/basic/mod/forms/OImageButtonControl/script.xlb b/qadevOOo/tests/basic/mod/forms/OImageButtonControl/script.xlb
new file mode 100644
index 000000000000..c528e95c2999
--- /dev/null
+++ b/qadevOOo/tests/basic/mod/forms/OImageButtonControl/script.xlb
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd">
+<library:library xmlns:library="http://openoffice.org/2000/library" library:name="forms_OImageButtonControl" library:readonly="false" library:passwordprotected="false">
+"<library:element library:name="forms_OImageButtonControl"/>
+"</library:library>
diff --git a/qadevOOo/tests/basic/mod/forms/OImageButtonModel/forms_OImageButtonModel.xba b/qadevOOo/tests/basic/mod/forms/OImageButtonModel/forms_OImageButtonModel.xba
new file mode 100644
index 000000000000..5a5592638500
--- /dev/null
+++ b/qadevOOo/tests/basic/mod/forms/OImageButtonModel/forms_OImageButtonModel.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="forms_OImageButtonModel" script:language="StarBasic">
+
+
+'*************************************************************************
+'
+' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+'
+' Copyright 2000, 2010 Oracle and/or its affiliates.
+'
+' OpenOffice.org - a multi-platform office productivity suite
+'
+' This file is part of OpenOffice.org.
+'
+' OpenOffice.org is free software: you can redistribute it and/or modify
+' it under the terms of the GNU Lesser General Public License version 3
+' only, as published by the Free Software Foundation.
+'
+' OpenOffice.org is distributed in the hope that it will be useful,
+' but WITHOUT ANY WARRANTY; without even the implied warranty of
+' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+' GNU Lesser General Public License version 3 for more details
+' (a copy is included in the LICENSE file that accompanied this code).
+'
+' You should have received a copy of the GNU Lesser General Public License
+' version 3 along with OpenOffice.org. If not, see
+' <http://www.openoffice.org/license.html>
+' for a copy of the LGPLv3 License.
+'
+'*************************************************************************
+'*************************************************************************
+
+
+
+' Be sure that all variables are dimensioned:
+option explicit
+
+
+' REQUIRED VARIABLES for interface/service tests:
+
+' for XComponent
+Global oComponentInstance As Object
+
+' for XPersistObject
+Global oPersistInstance As Object
+
+
+Sub CreateObj()
+
+'*************************************************************************
+' COMPONENT:
+' forms.OImageButtonModel
+'*************************************************************************
+On Error Goto ErrHndl
+ Dim bOK As Boolean
+ Dim oShape As Object, oDrawPage As Object
+
+ bOK = true
+
+ oDoc = utils.createDocument("swriter", cObjectName)
+
+ oShape = toolkittools.addControlToDefaultForm("ImageButton", 1000, 1000, 2000, 1000)
+ oObj = oShape.getControl()
+ oShape = toolkittools.addControlToDefaultForm("ImageButton", 1000, 3000, 2000, 1000)
+ oComponentInstance = oShape.getControl()
+ oShape = toolkittools.addControlToDefaultForm("ImageButton", 1000, 5000, 2000, 1000)
+ oPersistInstance = oShape.getControl()
+
+Exit Sub
+ErrHndl:
+ Test.Exception()
+End Sub
+</script:module>
diff --git a/qadevOOo/tests/basic/mod/forms/OImageButtonModel/script.xlb b/qadevOOo/tests/basic/mod/forms/OImageButtonModel/script.xlb
new file mode 100644
index 000000000000..52b34ca1effc
--- /dev/null
+++ b/qadevOOo/tests/basic/mod/forms/OImageButtonModel/script.xlb
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd">
+<library:library xmlns:library="http://openoffice.org/2000/library" library:name="forms_OImageButtonModel" library:readonly="false" library:passwordprotected="false">
+"<library:element library:name="forms_OImageButtonModel"/>
+"</library:library>
diff --git a/qadevOOo/tests/basic/mod/forms/OImageControlControl/forms_OImageControlControl.xba b/qadevOOo/tests/basic/mod/forms/OImageControlControl/forms_OImageControlControl.xba
new file mode 100644
index 000000000000..6280f3c8f471
--- /dev/null
+++ b/qadevOOo/tests/basic/mod/forms/OImageControlControl/forms_OImageControlControl.xba
@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
+<script:module xmlns:script="http://openoffice.org/2000/script" script:name="forms_OImageControlControl" script:language="StarBasic">
+
+
+'*************************************************************************
+'
+' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+'
+' Copyright 2000, 2010 Oracle and/or its affiliates.
+'
+' OpenOffice.org - a multi-platform office productivity suite
+'
+' This file is part of OpenOffice.org.
+'
+' OpenOffice.org is free software: you can redistribute it and/or modify
+' it under the terms of the GNU Lesser General Public License version 3
+' only, as published by the Free Software Foundation.
+'
+' OpenOffice.org is distributed in the hope that it will be useful,
+' but WITHOUT ANY WARRANTY; without even the implied warranty of
+' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+' GNU Lesser General Public License version 3 for more details
+' (a copy is included in the LICENSE file that accompanied this code).
+'
+' You should have received a copy of the GNU Lesser General Public License
+' version 3 along with OpenOffice.org. If not, see
+' <http://www.openoffice.org/license.html>
+' for a copy of the LGPLv3 License.
+'
+'*************************************************************************
+'*************************************************************************
+
+
+
+' Be sure that all variables are dimensioned:
+option explicit
+
+
+' REQUIRED VARIABLES for interface/service tests:
+
+' Required for com.sun.star.awt.XView:
+ Global oGraphics as Object
+
+' Required for com.sun.star.lang.XComponent:
+ Global oComponentInstance As Object ' it will be disposed
+
+' Required for com.sun.star.awt.XControl:
+ Global oContext As Object
+ Global oWinpeer As Object
+ Global oToolkit As Object
+ Global oModel As Object
+
+' Required for com.sun.star.awt.XWindow:
+ Global oXWindow as Object
+ Global oCtrlShape As Variant
+
+
+
+Sub CreateObj()
+
+'*************************************************************************
+' COMPONENT:
+' forms.OImageControlControl
+'*************************************************************************
+On Error Goto ErrHndl
+
+ Dim bOK As Boolean
+ Dim oShape1 As Object
+ Dim oShape2 As Object
+ Dim oShape3 As Object
+ Dim oCurrCtrl As Object
+ Dim oWin As Object
+ Dim oKit As Object
+ Dim oDevice As Object
+ Dim oDoc2 As Object
+
+ bOK = true
+
+ oDoc = utils.createDocument("swriter", cObjectName)
+
+ oShape1 = toolkittools.createControlShapeWithDefaultControl("DatabaseImageControl")
+ oShape2 = toolkittools.createControlShapeWithDefaultControl("DatabaseImageControl")
+ oShape3 = toolkittools.createControlShapeWithDefaultControl("TextField")
+ toolkittools.addShape(oShape1)
+ toolkittools.addShape(oShape2)
+ toolkittools.addShape(oShape3)
+
+ oModel = oShape1.getControl()
+ oCurrCtrl = oDoc.getCurrentController()
+ oWin = oCurrCtrl.getControl(oModel).getPeer()
+ oKit = oWin.getToolkit()
+ oDevice = oKit.createScreenCompatibleDevice(200,200)
+ oGraphics = oDevice.createGraphics()
+
+ oObj = oCurrCtrl.getControl(oModel)
+ oComponentInstance = oCurrCtrl.getControl(oShape2.getControl())
+ oContext = oDoc
+ oWinpeer = oWin
+ oToolkit = oKit
+ oXWindow = oCurrCtrl.getControl(oShape3.getControl())
+ oCtrlShape = oShape1
+
+Exit Sub
+ErrHndl:
+ Test.Exception()
+End Sub
+</script:module>
diff --git a/qadevOOo/tests/basic/mod/forms/OImageControlControl/script.xlb b/qadevOOo/tests/basic/mod/forms/OImageControlControl/script.xlb
new file mode 100644
index 000000000000..5aaa204440bd
--- /dev/null
+++ b/qadevOOo/tests/basic/mod/forms/OImageControlControl/script.xlb
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd">
+<library:library xmlns:library="http://openoffice.org/2000/library" library:name="forms_OImageControlControl" library:readonly="false" library:passwordprotected="false">
+"<library:element library:name="forms_OImageControlControl"/>
+"</library:library>
diff --git a/qadevOOo/tests/basic/mod/forms/OImageControlModel/forms_OImageControlModel.xba b/qadevOOo/tests/basic/mod/forms/OImageControlModel/forms_OImageControlModel.xba
new file mode 100644
index 000000000000..0f4d43f38c3d
--- /dev/null
+++ b/qadevOOo/tests/basic/mod/forms/OImageControlModel/forms_OImageControlModel.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="forms_OImageControlModel" script:language="StarBasic">
+
+
+'*************************************************************************
+'
+' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+'
+' Copyright 2000, 2010 Oracle and/or its affiliates.
+'
+' OpenOffice.org - a multi-platform office productivity suite
+'
+' This file is part of OpenOffice.org.
+'
+' OpenOffice.org is free software: you can redistribute it and/or modify
+' it under the terms of the GNU Lesser General Public License version 3
+' only, as published by the Free Software Foundation.
+'
+' OpenOffice.org is distributed in the hope that it will be useful,
+' but WITHOUT ANY WARRANTY; without even the implied warranty of
+' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+' GNU Lesser General Public License version 3 for more details
+' (a copy is included in the LICENSE file that accompanied this code).
+'
+' You should have received a copy of the GNU Lesser General Public License
+' version 3 along with OpenOffice.org. If not, see
+' <http://www.openoffice.org/license.html>
+' for a copy of the LGPLv3 License.
+'
+'*************************************************************************
+'*************************************************************************
+
+
+
+' Be sure that all variables are dimensioned:
+option explicit
+
+
+' REQUIRED VARIABLES for interface/service tests:
+
+' for XComponent
+Global oComponentInstance As Object
+
+' for XPersistObject
+Global oPersistInstance As Object
+
+
+Sub CreateObj()
+
+'*************************************************************************
+' COMPONENT:
+' forms.OImageControlModel
+'*************************************************************************
+On Error Goto ErrHndl
+ Dim bOK As Boolean
+ Dim oShape As Object, oDrawPage As Object
+
+ bOK = true
+
+ oDoc = utils.createDocument("swriter", cObjectName)
+
+ oShape = toolkittools.addControlToDefaultForm("DatabaseImageControl", 1000, 1000, 2000, 1000)
+ oObj = oShape.getControl()
+ oShape = toolkittools.addControlToDefaultForm("DatabaseImageControl", 1000, 3000, 2000, 1000)
+ oComponentInstance = oShape.getControl()
+ oShape = toolkittools.addControlToDefaultForm("DatabaseImageControl", 1000, 5000, 2000, 1000)
+ oPersistInstance = oShape.getControl()
+
+
+Exit Sub
+ErrHndl:
+ Test.Exception()
+End Sub
+</script:module>
diff --git a/qadevOOo/tests/basic/mod/forms/OImageControlModel/script.xlb b/qadevOOo/tests/basic/mod/forms/OImageControlModel/script.xlb
new file mode 100644
index 000000000000..7c723d3c110d
--- /dev/null
+++ b/qadevOOo/tests/basic/mod/forms/OImageControlModel/script.xlb
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd">
+<library:library xmlns:library="http://openoffice.org/2000/library" library:name="forms_OImageControlModel" library:readonly="false" library:passwordprotected="false">
+"<library:element library:name="forms_OImageControlModel"/>
+"</library:library>
diff --git a/qadevOOo/tests/basic/mod/forms/OListBoxControl/forms_OListBoxControl.xba b/qadevOOo/tests/basic/mod/forms/OListBoxControl/forms_OListBoxControl.xba
new file mode 100644
index 000000000000..e5b2c3456baa
--- /dev/null
+++ b/qadevOOo/tests/basic/mod/forms/OListBoxControl/forms_OListBoxControl.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="forms_OListBoxControl" script:language="StarBasic">
+
+
+'*************************************************************************
+'
+' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+'
+' Copyright 2000, 2010 Oracle and/or its affiliates.
+'
+' OpenOffice.org - a multi-platform office productivity suite
+'
+' This file is part of OpenOffice.org.
+'
+' OpenOffice.org is free software: you can redistribute it and/or modify
+' it under the terms of the GNU Lesser General Public License version 3
+' only, as published by the Free Software Foundation.
+'
+' OpenOffice.org is distributed in the hope that it will be useful,
+' but WITHOUT ANY WARRANTY; without even the implied warranty of
+' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+' GNU Lesser General Public License version 3 for more details
+' (a copy is included in the LICENSE file that accompanied this code).
+'
+' You should have received a copy of the GNU Lesser General Public License
+' version 3 along with OpenOffice.org. If not, see
+' <http://www.openoffice.org/license.html>
+' for a copy of the LGPLv3 License.
+'
+'*************************************************************************
+'*************************************************************************
+
+
+
+' Be sure that all variables are dimensioned:
+option explicit
+
+
+
+' REQUIRED VARIABLES for interface/service tests:
+
+' Required for com.sun.star.awt.XView:
+ Global oGraphics as Object
+
+' Required for com.sun.star.lang.XComponent:
+ Global oComponentInstance As Object ' it will be disposed
+
+' Required for com.sun.star.awt.XControl:
+ Global oContext As Object
+ Global oWinpeer As Object
+ Global oToolkit As Object
+ Global oModel As Object
+
+' Required for com.sun.star.awt.XWindow:
+ Global oXWindow as Object
+ Global oCtrlShape As Variant
+
+' Required for awt.XItemListener
+ Global bIL_itemStateChanged As Boolean
+ Global oEventItemListener As Object
+
+
+Sub CreateObj()
+
+'*************************************************************************
+' COMPONENT:
+' forms.OListBoxControl
+'*************************************************************************
+On Error Goto ErrHndl
+
+ Dim bOK As Boolean
+ Dim oShape1 As Object
+ Dim oShape2 As Object
+ Dim oShape3 As Object
+ Dim oCurrCtrl As Object
+ Dim oWin As Object
+ Dim oKit As Object
+ Dim oDevice As Object
+ Dim oIListener As Object
+
+ bOK = true
+
+ oDoc = utils.createDocument("swriter", cObjectName)
+
+ oShape1 = toolkittools.addControlToDefaultForm("ListBox", 1000, 1000, 2000, 1000)
+ oShape2 = toolkittools.addControlToDefaultForm("ListBox", 1000, 3000, 2000, 1000)
+ oShape3 = toolkittools.addControlToDefaultForm("TextField", 1000, 1000, 2000, 1000)
+
+ oModel = oShape1.getControl()
+ oCurrCtrl = oDoc.getCurrentController()
+ oWin = oCurrCtrl.getControl(oModel).getPeer()
+ oKit = oWin.getToolkit()
+ oDevice = oKit.createScreenCompatibleDevice(200,200)
+ oGraphics = oDevice.createGraphics()
+
+ oObj = oCurrCtrl.getControl(oModel)
+ oComponentInstance = oCurrCtrl.getControl(oShape2.getControl())
+ oContext = oDoc
+ oWinpeer = oWin
+ oToolkit = oKit
+ oXWindow = oCurrCtrl.getControl(oShape3.getControl())
+ oCtrlShape = oShape1
+
+ oIListener = createUnoListener("IL_", "com.sun.star.awt.XItemListener")
+ oObj.addItemListener(oIListener)
+
+Exit Sub
+ErrHndl:
+ Test.Exception()
+End Sub
+
+Sub IL_itemStateChanged(rEvent As Object)
+ bIL_itemStateChanged = True
+ Out.Log("CallBack for ItemListener itemStateChanged was called.")
+ oEventItemListener = rEvent
+End Sub
+
+Sub IL_disposing
+End Sub
+</script:module>
diff --git a/qadevOOo/tests/basic/mod/forms/OListBoxControl/script.xlb b/qadevOOo/tests/basic/mod/forms/OListBoxControl/script.xlb
new file mode 100644
index 000000000000..04dc4fa3b92e
--- /dev/null
+++ b/qadevOOo/tests/basic/mod/forms/OListBoxControl/script.xlb
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd">
+<library:library xmlns:library="http://openoffice.org/2000/library" library:name="forms_OListBoxControl" library:readonly="false" library:passwordprotected="false">
+"<library:element library:name="forms_OListBoxControl"/>
+"</library:library>
diff --git a/qadevOOo/tests/basic/mod/forms/OListBoxModel/forms_OListBoxModel.xba b/qadevOOo/tests/basic/mod/forms/OListBoxModel/forms_OListBoxModel.xba
new file mode 100644
index 000000000000..769466b6758b
--- /dev/null
+++ b/qadevOOo/tests/basic/mod/forms/OListBoxModel/forms_OListBoxModel.xba
@@ -0,0 +1,158 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
+<script:module xmlns:script="http://openoffice.org/2000/script" script:name="forms_OListBoxModel" script:language="StarBasic">
+
+
+'*************************************************************************
+'
+' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+'
+' Copyright 2000, 2010 Oracle and/or its affiliates.
+'
+' OpenOffice.org - a multi-platform office productivity suite
+'
+' This file is part of OpenOffice.org.
+'
+' OpenOffice.org is free software: you can redistribute it and/or modify
+' it under the terms of the GNU Lesser General Public License version 3
+' only, as published by the Free Software Foundation.
+'
+' OpenOffice.org is distributed in the hope that it will be useful,
+' but WITHOUT ANY WARRANTY; without even the implied warranty of
+' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+' GNU Lesser General Public License version 3 for more details
+' (a copy is included in the LICENSE file that accompanied this code).
+'
+' You should have received a copy of the GNU Lesser General Public License
+' version 3 along with OpenOffice.org. If not, see
+' <http://www.openoffice.org/license.html>
+' for a copy of the LGPLv3 License.
+'
+'*************************************************************************
+'*************************************************************************
+
+
+
+' Be sure that all variables are dimensioned:
+option explicit
+
+
+' REQUIRED VARIABLES for interface/service tests:
+
+' for XComponent
+Global oComponentInstance As Object
+
+' for XPersistObject
+Global oPersistInstance As Object
+
+' for XUpdateBroadcaster
+Global bCustomUpdate As Boolean
+
+Global oForm As Object
+Global aList(1) As Variant
+
+
+Sub CreateObj()
+
+'*************************************************************************
+' COMPONENT:
+' forms.OListBoxModel
+'*************************************************************************
+On Error Goto ErrHndl
+ Dim bOK As Boolean
+ Dim aSelection(0 to 0) As Variant
+ Dim oShape As Object, oDrawPage As Object
+
+ bOK = true
+
+ oDoc = utils.createDocument("swriter", cObjectName)
+
+ oShape = toolkittools.addControlToDefaultForm("ListBox", 1000, 1000, 2000, 1000)
+ oObj = oShape.getControl()
+ oShape = toolkittools.addControlToDefaultForm("ListBox", 1000, 3000, 2000, 1000)
+ oComponentInstance = oShape.getControl()
+ oShape = toolkittools.addControlToDefaultForm("ListBox", 1000, 5000, 2000, 1000)
+ oPersistInstance = oShape.getControl()
+
+ 'for UnoControlListBoxModel::SelectedItems
+ aList(0) = "Hello"
+ aList(1) = "World"
+ aSelection(0) = 1
+ oObj.DefaultSelection = aSelection()
+ oObj.ListSource = aList()
+
+ 'get control from document
+ oDrawPage = oDoc.DrawPage
+ oForm = oDrawPage.Forms.getByName("Standard")
+
+ oForm.DataSourceName = "Bibliography"
+ oForm.Command = "biblio"
+ oForm.CommandType = com.sun.star.sdb.CommandType.TABLE
+
+ oObj.DataField = "Author"
+
+ oForm.load()
+
+ ' for XUpdateBroadcaster
+ bCustomUpdate = true
+
+Exit Sub
+ErrHndl:
+ Test.Exception()
+End Sub
+
+Global sChangedText As String
+
+' for XBoundComponent
+Sub prepareCommit()
+On Error Goto ErrHndl
+ Dim items As Variant
+ Dim item As Variant
+
+ Out.Log("prepareCommit() called.")
+ items = oObj.SelectedItems
+ if ubound(items()) &lt; 0 then
+ item = 0
+ else
+ if items(0) = 0 then item = 1 else item = 0
+ endif
+
+ sChangedText = aList(item)
+ oObj.SelectedItems = Array(item)
+
+ exit sub
+ErrHndl:
+ Test.Exception()
+End Sub
+
+' for XBoundComponent
+Function checkCommit() As Boolean
+On Error Goto ErrHndl
+ Out.Log("checkCommit() called.")
+ Dim rowText As Variant
+
+ rowText = oForm.getString(oForm.findColumn("Author"))
+ checkCommit() = (rowText = sChangedText)
+
+ exit function
+ErrHndl:
+ Test.Exception()
+End Function
+
+' for XUpdateBroadcaster
+Sub UpdateComponent()
+ Out.Log("UpdateComponent() called.")
+
+ Dim items As Variant
+ Dim item As Variant
+ items = oObj.SelectedItems
+ if ubound(items()) &lt; 0 then
+ item = 0
+ else
+ if items(0) = 0 then item = 1 else item = 0
+ endif
+ oObj.SelectedItems = Array(item)
+
+ oObj.commit()
+End Sub
+</script:module>
diff --git a/qadevOOo/tests/basic/mod/forms/OListBoxModel/script.xlb b/qadevOOo/tests/basic/mod/forms/OListBoxModel/script.xlb
new file mode 100644
index 000000000000..0c9c727d99e7
--- /dev/null
+++ b/qadevOOo/tests/basic/mod/forms/OListBoxModel/script.xlb
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd">
+<library:library xmlns:library="http://openoffice.org/2000/library" library:name="forms_OListBoxModel" library:readonly="false" library:passwordprotected="false">
+"<library:element library:name="forms_OListBoxModel"/>
+"</library:library>
diff --git a/qadevOOo/tests/basic/mod/forms/ONumericControl/forms_ONumericControl.xba b/qadevOOo/tests/basic/mod/forms/ONumericControl/forms_ONumericControl.xba
new file mode 100644
index 000000000000..949c1b52187b
--- /dev/null
+++ b/qadevOOo/tests/basic/mod/forms/ONumericControl/forms_ONumericControl.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="forms_ONumericControl" script:language="StarBasic">
+
+
+'*************************************************************************
+'
+' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+'
+' Copyright 2000, 2010 Oracle and/or its affiliates.
+'
+' OpenOffice.org - a multi-platform office productivity suite
+'
+' This file is part of OpenOffice.org.
+'
+' OpenOffice.org is free software: you can redistribute it and/or modify
+' it under the terms of the GNU Lesser General Public License version 3
+' only, as published by the Free Software Foundation.
+'
+' OpenOffice.org is distributed in the hope that it will be useful,
+' but WITHOUT ANY WARRANTY; without even the implied warranty of
+' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+' GNU Lesser General Public License version 3 for more details
+' (a copy is included in the LICENSE file that accompanied this code).
+'
+' You should have received a copy of the GNU Lesser General Public License
+' version 3 along with OpenOffice.org. If not, see
+' <http://www.openoffice.org/license.html>
+' for a copy of the LGPLv3 License.
+'
+'*************************************************************************
+'*************************************************************************
+
+
+
+' Be sure that all variables are dimensioned:
+option explicit
+
+
+
+' REQUIRED VARIABLES for interface/service tests:
+
+' Required for com.sun.star.awt.XView:
+ Global oGraphics as Object
+
+' Required for com.sun.star.lang.XComponent:
+ Global oComponentInstance As Object ' it will be disposed
+
+' Required for com.sun.star.awt.XControl:
+ Global oContext As Object
+ Global oWinpeer As Object
+ Global oToolkit As Object
+ Global oModel As Object
+
+' Required for com.sun.star.awt.XWindow:
+ Global oXWindow as Object
+ Global oCtrlShape As Variant
+
+
+
+Sub CreateObj()
+
+'*************************************************************************
+' COMPONENT:
+' forms.ONumericControl
+'*************************************************************************
+On Error Goto ErrHndl
+
+ Dim bOK As Boolean
+ Dim oShape1 As Object
+ Dim oShape2 As Object
+ Dim oShape3 As Object
+ Dim oCurrCtrl As Object
+ Dim oWin As Object
+ Dim oKit As Object
+ Dim oDevice As Object
+
+ bOK = true
+
+ oDoc = utils.createDocument("swriter", cObjectName)
+
+ oShape1 = toolkittools.addControlToDefaultForm("NumericField", 1000, 1000, 2000, 1000)
+ oShape2 = toolkittools.addControlToDefaultForm("NumericField", 1000, 3000, 2000, 1000)
+ oShape3 = toolkittools.addControlToDefaultForm("TextField", 1000, 5000, 2000, 1000)
+
+ oModel = oShape1.getControl()
+ oCurrCtrl = oDoc.getCurrentController()
+ oWin = oCurrCtrl.getControl(oModel).getPeer()
+ oKit = oWin.getToolkit()
+ oDevice = oKit.createScreenCompatibleDevice(200,200)
+ oGraphics = oDevice.createGraphics()
+
+ oObj = oCurrCtrl.getControl(oModel)
+ oComponentInstance = oCurrCtrl.getControl(oShape2.getControl())
+ oContext = oDoc
+ oWinpeer = oWin
+ oToolkit = oKit
+ oXWindow = oCurrCtrl.getControl(oShape3.getControl())
+ oCtrlShape = oShape1
+
+
+Exit Sub
+ErrHndl:
+ Test.Exception()
+End Sub
+</script:module>
diff --git a/qadevOOo/tests/basic/mod/forms/ONumericControl/script.xlb b/qadevOOo/tests/basic/mod/forms/ONumericControl/script.xlb
new file mode 100644
index 000000000000..4dae412199e0
--- /dev/null
+++ b/qadevOOo/tests/basic/mod/forms/ONumericControl/script.xlb
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd">
+<library:library xmlns:library="http://openoffice.org/2000/library" library:name="forms_ONumericControl" library:readonly="false" library:passwordprotected="false">
+"<library:element library:name="forms_ONumericControl"/>
+"</library:library>
diff --git a/qadevOOo/tests/basic/mod/forms/ONumericModel/forms_ONumericModel.xba b/qadevOOo/tests/basic/mod/forms/ONumericModel/forms_ONumericModel.xba
new file mode 100644
index 000000000000..117ba7bd2b7e
--- /dev/null
+++ b/qadevOOo/tests/basic/mod/forms/ONumericModel/forms_ONumericModel.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="forms_ONumericModel" script:language="StarBasic">
+
+
+'*************************************************************************
+'
+' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+'
+' Copyright 2000, 2010 Oracle and/or its affiliates.
+'
+' OpenOffice.org - a multi-platform office productivity suite
+'
+' This file is part of OpenOffice.org.
+'
+' OpenOffice.org is free software: you can redistribute it and/or modify
+' it under the terms of the GNU Lesser General Public License version 3
+' only, as published by the Free Software Foundation.
+'
+' OpenOffice.org is distributed in the hope that it will be useful,
+' but WITHOUT ANY WARRANTY; without even the implied warranty of
+' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+' GNU Lesser General Public License version 3 for more details
+' (a copy is included in the LICENSE file that accompanied this code).
+'
+' You should have received a copy of the GNU Lesser General Public License
+' version 3 along with OpenOffice.org. If not, see
+' <http://www.openoffice.org/license.html>
+' for a copy of the LGPLv3 License.
+'
+'*************************************************************************
+'*************************************************************************
+
+
+
+' Be sure that all variables are dimensioned:
+option explicit
+
+
+' REQUIRED VARIABLES for interface/service tests:
+
+' for XComponent
+Global oComponentInstance As Object
+
+' for XPersistObject
+Global oPersistInstance As Object
+
+' for XUpdateBroadcaster
+Global bCustomUpdate As Boolean
+
+Global oForm As Object
+
+
+Sub CreateObj()
+
+'*************************************************************************
+' COMPONENT:
+' forms.ONumericModel
+'*************************************************************************
+On Error Goto ErrHndl
+ Dim bOK As Boolean
+ Dim oShape As Object, oDrawPage As Object
+
+ bOK = true
+
+ oDoc = utils.createDocument("swriter", cObjectName)
+
+ oShape = toolkittools.addControlToDefaultForm("NumericField", 1000, 1000, 2000, 1000)
+ oObj = oShape.getControl()
+ oShape = toolkittools.addControlToDefaultForm("NumericField", 1000, 3000, 2000, 1000)
+ oComponentInstance = oShape.getControl()
+ oShape = toolkittools.addControlToDefaultForm("TextField", 1000, 5000, 2000, 1000)
+ oPersistInstance = oShape.getControl()
+
+ oDrawPage = oDoc.DrawPage
+ oForm = oDrawPage.Forms.getByName("Standard")
+
+ oForm.DataSourceName = "Bibliography"
+ oForm.Command = "biblio"
+ oForm.CommandType = com.sun.star.sdb.CommandType.TABLE
+
+ oObj.DataField = "Pages"
+
+ oForm.load()
+
+ ' for XUpdateBroadcaster
+ bCustomUpdate = true
+
+Exit Sub
+ErrHndl:
+ Test.Exception()
+End Sub
+
+Global nChangedVal As Variant
+
+' for XBoundComponent
+Sub prepareCommit()
+On Error Goto ErrHndl
+ Out.Log("prepareCommit() called.")
+ nChangedVal = oObj.Value + 1
+ oObj.Value = nChangedVal
+
+ exit sub
+ErrHndl:
+ Test.Exception()
+End Sub
+
+' for XBoundComponent
+Function checkCommit() As Boolean
+On Error Goto ErrHndl
+ Out.Log("checkCommit() called.")
+ Dim rowVal As Variant
+
+ rowVal = oForm.getInt(oForm.findColumn("Pages"))
+ checkCommit() = (rowVal = nChangedVal)
+
+ exit function
+ErrHndl:
+ Test.Exception()
+End Function
+
+' for XUpdateBroadcaster
+Sub UpdateComponent()
+ oObj.Value = oObj.Value + 1
+ oObj.commit()
+End Sub
+</script:module>
diff --git a/qadevOOo/tests/basic/mod/forms/ONumericModel/script.xlb b/qadevOOo/tests/basic/mod/forms/ONumericModel/script.xlb
new file mode 100644
index 000000000000..d44de2b54e64
--- /dev/null
+++ b/qadevOOo/tests/basic/mod/forms/ONumericModel/script.xlb
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd">
+<library:library xmlns:library="http://openoffice.org/2000/library" library:name="forms_ONumericModel" library:readonly="false" library:passwordprotected="false">
+"<library:element library:name="forms_ONumericModel"/>
+"</library:library>
diff --git a/qadevOOo/tests/basic/mod/forms/OPatternControl/forms_OPatternControl.xba b/qadevOOo/tests/basic/mod/forms/OPatternControl/forms_OPatternControl.xba
new file mode 100644
index 000000000000..65c1cc774822
--- /dev/null
+++ b/qadevOOo/tests/basic/mod/forms/OPatternControl/forms_OPatternControl.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="forms_OPatternControl" script:language="StarBasic">
+
+
+'*************************************************************************
+'
+' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+'
+' Copyright 2000, 2010 Oracle and/or its affiliates.
+'
+' OpenOffice.org - a multi-platform office productivity suite
+'
+' This file is part of OpenOffice.org.
+'
+' OpenOffice.org is free software: you can redistribute it and/or modify
+' it under the terms of the GNU Lesser General Public License version 3
+' only, as published by the Free Software Foundation.
+'
+' OpenOffice.org is distributed in the hope that it will be useful,
+' but WITHOUT ANY WARRANTY; without even the implied warranty of
+' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+' GNU Lesser General Public License version 3 for more details
+' (a copy is included in the LICENSE file that accompanied this code).
+'
+' You should have received a copy of the GNU Lesser General Public License
+' version 3 along with OpenOffice.org. If not, see
+' <http://www.openoffice.org/license.html>
+' for a copy of the LGPLv3 License.
+'
+'*************************************************************************
+'*************************************************************************
+
+
+
+' Be sure that all variables are dimensioned:
+option explicit
+
+
+
+' REQUIRED VARIABLES for interface/service tests:
+
+' Required for com.sun.star.awt.XView:
+ Global oGraphics as Object
+
+' Required for com.sun.star.lang.XComponent:
+ Global oComponentInstance As Object ' it will be disposed
+
+' Required for com.sun.star.awt.XControl:
+ Global oContext As Object
+ Global oWinpeer As Object
+ Global oToolkit As Object
+ Global oModel As Object
+
+' Required for com.sun.star.awt.XWindow:
+ Global oXWindow as Object
+ Global oCtrlShape As Variant
+
+
+Sub CreateObj()
+
+'*************************************************************************
+' COMPONENT:
+' forms.OPatternControl
+'*************************************************************************
+On Error Goto ErrHndl
+
+ Dim bOK As Boolean
+ Dim oShape1 As Object
+ Dim oShape2 As Object
+ Dim oShape3 As Object
+ Dim oCurrCtrl As Object
+ Dim oWin As Object
+ Dim oKit As Object
+ Dim oDevice As Object
+
+ bOK = true
+
+ oDoc = utils.createDocument("swriter", cObjectName)
+
+ oShape1 = toolkittools.addControlToDefaultForm("PatternField", 1000, 1000, 2000, 1000)
+ oShape2 = toolkittools.addControlToDefaultForm("PatternField", 1000, 3000, 2000, 1000)
+ oShape3 = toolkittools.addControlToDefaultForm("TextField", 1000, 5000, 2000, 1000)
+
+ oModel = oShape1.getControl()
+ oCurrCtrl = oDoc.getCurrentController()
+ oWin = oCurrCtrl.getControl(oModel).getPeer()
+ oKit = oWin.getToolkit()
+ oDevice = oKit.createScreenCompatibleDevice(200,200)
+ oGraphics = oDevice.createGraphics()
+
+ oObj = oCurrCtrl.getControl(oModel)
+ oComponentInstance = oCurrCtrl.getControl(oShape2.getControl())
+ oContext = oDoc
+ oWinpeer = oWin
+ oToolkit = oKit
+ oXWindow = oCurrCtrl.getControl(oShape2.getControl())
+ oCtrlShape = oShape1
+
+Exit Sub
+ErrHndl:
+ Test.Exception()
+End Sub
+</script:module>
diff --git a/qadevOOo/tests/basic/mod/forms/OPatternControl/script.xlb b/qadevOOo/tests/basic/mod/forms/OPatternControl/script.xlb
new file mode 100644
index 000000000000..1d7fd0303f27
--- /dev/null
+++ b/qadevOOo/tests/basic/mod/forms/OPatternControl/script.xlb
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd">
+<library:library xmlns:library="http://openoffice.org/2000/library" library:name="forms_OPatternControl" library:readonly="false" library:passwordprotected="false">
+"<library:element library:name="forms_OPatternControl"/>
+"</library:library>
diff --git a/qadevOOo/tests/basic/mod/forms/OPatternModel/forms_OPatternModel.xba b/qadevOOo/tests/basic/mod/forms/OPatternModel/forms_OPatternModel.xba
new file mode 100644
index 000000000000..65ef760eed29
--- /dev/null
+++ b/qadevOOo/tests/basic/mod/forms/OPatternModel/forms_OPatternModel.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="forms_OPatternModel" script:language="StarBasic">
+
+
+'*************************************************************************
+'
+' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+'
+' Copyright 2000, 2010 Oracle and/or its affiliates.
+'
+' OpenOffice.org - a multi-platform office productivity suite
+'
+' This file is part of OpenOffice.org.
+'
+' OpenOffice.org is free software: you can redistribute it and/or modify
+' it under the terms of the GNU Lesser General Public License version 3
+' only, as published by the Free Software Foundation.
+'
+' OpenOffice.org is distributed in the hope that it will be useful,
+' but WITHOUT ANY WARRANTY; without even the implied warranty of
+' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+' GNU Lesser General Public License version 3 for more details
+' (a copy is included in the LICENSE file that accompanied this code).
+'
+' You should have received a copy of the GNU Lesser General Public License
+' version 3 along with OpenOffice.org. If not, see
+' <http://www.openoffice.org/license.html>
+' for a copy of the LGPLv3 License.
+'
+'*************************************************************************
+'*************************************************************************
+
+
+
+' Be sure that all variables are dimensioned:
+option explicit
+
+
+' REQUIRED VARIABLES for interface/service tests:
+
+' for XComponent
+Global oComponentInstance As Object
+
+' for XPersistObject
+Global oPersistInstance As Object
+
+' for XUpdateBroadcaster
+Global bCustomUpdate As Boolean
+
+Global oForm As Object
+
+
+Sub CreateObj()
+
+'*************************************************************************
+' COMPONENT:
+' forms.OPatternModel
+'*************************************************************************
+On Error Goto ErrHndl
+ Dim bOK As Boolean
+ Dim oShape As Object, oDrawPage As Object
+
+ bOK = true
+
+ oDoc = utils.createDocument("swriter", cObjectName)
+
+ oShape = toolkittools.addControlToDefaultForm("PatternField", 1000, 1000, 2000, 1000)
+ oObj = oShape.getControl()
+ oShape = toolkittools.addControlToDefaultForm("PatternField", 1000, 3000, 2000, 1000)
+ oComponentInstance = oShape.getControl()
+ oShape = toolkittools.addControlToDefaultForm("TextField", 1000, 5000, 2000, 1000)
+ oPersistInstance = oShape.getControl()
+
+ 'get control from document
+ oDrawPage = oDoc.DrawPage
+ oForm = oDrawPage.Forms.getByName("Standard")
+
+ oForm.DataSourceName = "Bibliography"
+ oForm.Command = "biblio"
+ oForm.CommandType = com.sun.star.sdb.CommandType.TABLE
+
+ oObj.DataField = "Author"
+
+ oForm.load()
+
+ ' for XUpdateBroadcaster
+ bCustomUpdate = true
+
+Exit Sub
+ErrHndl:
+ Test.Exception()
+End Sub
+
+Global sChangedText As String
+
+' for XBoundComponent
+Sub prepareCommit()
+On Error Goto ErrHndl
+ Out.Log("prepareCommit() called.")
+ sChangedText = "_" + oObj.Text
+ oObj.Text = sChangedText
+
+ exit sub
+ErrHndl:
+ Test.Exception()
+End Sub
+
+' for XBoundComponent
+Function checkCommit() As Boolean
+On Error Goto ErrHndl
+ Out.Log("checkCommit() called.")
+ Dim rowText As Variant
+
+ rowText = oForm.getString(oForm.findColumn("Author"))
+ checkCommit() = (rowText = sChangedText)
+
+ exit function
+ErrHndl:
+ Test.Exception()
+End Function
+
+' for XUpdateBroadcaster
+Sub UpdateComponent()
+ oObj.Text = "_" + oObj.Text
+ oObj.commit()
+End Sub
+</script:module>
diff --git a/qadevOOo/tests/basic/mod/forms/OPatternModel/script.xlb b/qadevOOo/tests/basic/mod/forms/OPatternModel/script.xlb
new file mode 100644
index 000000000000..c8b4f8d4b089
--- /dev/null
+++ b/qadevOOo/tests/basic/mod/forms/OPatternModel/script.xlb
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd">
+<library:library xmlns:library="http://openoffice.org/2000/library" library:name="forms_OPatternModel" library:readonly="false" library:passwordprotected="false">
+"<library:element library:name="forms_OPatternModel"/>
+"</library:library>
diff --git a/qadevOOo/tests/basic/mod/forms/ORadioButtonControl/forms_ORadioButtonControl.xba b/qadevOOo/tests/basic/mod/forms/ORadioButtonControl/forms_ORadioButtonControl.xba
new file mode 100644
index 000000000000..d614220e637d
--- /dev/null
+++ b/qadevOOo/tests/basic/mod/forms/ORadioButtonControl/forms_ORadioButtonControl.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="forms_ORadioButtonControl" script:language="StarBasic">
+
+
+'*************************************************************************
+'
+' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+'
+' Copyright 2000, 2010 Oracle and/or its affiliates.
+'
+' OpenOffice.org - a multi-platform office productivity suite
+'
+' This file is part of OpenOffice.org.
+'
+' OpenOffice.org is free software: you can redistribute it and/or modify
+' it under the terms of the GNU Lesser General Public License version 3
+' only, as published by the Free Software Foundation.
+'
+' OpenOffice.org is distributed in the hope that it will be useful,
+' but WITHOUT ANY WARRANTY; without even the implied warranty of
+' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+' GNU Lesser General Public License version 3 for more details
+' (a copy is included in the LICENSE file that accompanied this code).
+'
+' You should have received a copy of the GNU Lesser General Public License
+' version 3 along with OpenOffice.org. If not, see
+' <http://www.openoffice.org/license.html>
+' for a copy of the LGPLv3 License.
+'
+'*************************************************************************
+'*************************************************************************
+
+
+
+' Be sure that all variables are dimensioned:
+option explicit
+
+
+
+' REQUIRED VARIABLES for interface/service tests:
+
+' Required for com.sun.star.awt.XView:
+ Global oGraphics as Object
+
+' Required for com.sun.star.lang.XComponent:
+ Global oComponentInstance As Object ' it will be disposed
+
+' Required for com.sun.star.awt.XControl:
+ Global oContext As Object
+ Global oWinpeer As Object
+ Global oToolkit As Object
+ Global oModel As Object
+
+' Required for com.sun.star.awt.XWindow:
+ Global oXWindow as Object
+ Global oCtrlShape As Variant
+
+
+
+Sub CreateObj()
+
+'*************************************************************************
+' COMPONENT:
+' forms.ORadioButtonControl
+'*************************************************************************
+On Error Goto ErrHndl
+
+ Dim bOK As Boolean
+ Dim oShape1 As Object
+ Dim oShape2 As Object
+ Dim oShape3 As Object
+ Dim oCurrCtrl As Object
+ Dim oWin As Object
+ Dim oKit As Object
+ Dim oDevice As Object
+
+ bOK = true
+
+ oDoc = utils.createDocument("swriter", cObjectName)
+
+ oShape1 = toolkittools.addControlToDefaultForm("RadioButton", 1000, 1000, 2000, 1000)
+ oShape2 = toolkittools.addControlToDefaultForm("RadioButton", 1000, 3000, 2000, 1000)
+ oShape3 = toolkittools.addControlToDefaultForm("TextField", 1000, 5000, 2000, 1000)
+
+ oModel = oShape1.getControl()
+ oCurrCtrl = oDoc.getCurrentController()
+ oWin = oCurrCtrl.getControl(oModel).getPeer()
+ oKit = oWin.getToolkit()
+ oDevice = oKit.createScreenCompatibleDevice(200,200)
+ oGraphics = oDevice.createGraphics()
+
+ oObj = oCurrCtrl.getControl(oModel)
+ oComponentInstance = oCurrCtrl.getControl(oShape2.getControl())
+ oContext = oDoc
+ oWinpeer = oWin
+ oToolkit = oKit
+ oXWindow = oCurrCtrl.getControl(oShape2.getControl())
+ oCtrlShape = oShape1
+
+Exit Sub
+ErrHndl:
+ Test.Exception()
+End Sub
+</script:module>
diff --git a/qadevOOo/tests/basic/mod/forms/ORadioButtonControl/script.xlb b/qadevOOo/tests/basic/mod/forms/ORadioButtonControl/script.xlb
new file mode 100644
index 000000000000..0c79cbf8481c
--- /dev/null
+++ b/qadevOOo/tests/basic/mod/forms/ORadioButtonControl/script.xlb
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd">
+<library:library xmlns:library="http://openoffice.org/2000/library" library:name="forms_ORadioButtonControl" library:readonly="false" library:passwordprotected="false">
+"<library:element library:name="forms_ORadioButtonControl"/>
+"</library:library>
diff --git a/qadevOOo/tests/basic/mod/forms/ORadioButtonModel/forms_ORadioButtonModel.xba b/qadevOOo/tests/basic/mod/forms/ORadioButtonModel/forms_ORadioButtonModel.xba
new file mode 100644
index 000000000000..64379f607c50
--- /dev/null
+++ b/qadevOOo/tests/basic/mod/forms/ORadioButtonModel/forms_ORadioButtonModel.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="forms_ORadioButtonModel" script:language="StarBasic">
+
+
+'*************************************************************************
+'
+' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+'
+' Copyright 2000, 2010 Oracle and/or its affiliates.
+'
+' OpenOffice.org - a multi-platform office productivity suite
+'
+' This file is part of OpenOffice.org.
+'
+' OpenOffice.org is free software: you can redistribute it and/or modify
+' it under the terms of the GNU Lesser General Public License version 3
+' only, as published by the Free Software Foundation.
+'
+' OpenOffice.org is distributed in the hope that it will be useful,
+' but WITHOUT ANY WARRANTY; without even the implied warranty of
+' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+' GNU Lesser General Public License version 3 for more details
+' (a copy is included in the LICENSE file that accompanied this code).
+'
+' You should have received a copy of the GNU Lesser General Public License
+' version 3 along with OpenOffice.org. If not, see
+' <http://www.openoffice.org/license.html>
+' for a copy of the LGPLv3 License.
+'
+'*************************************************************************
+'*************************************************************************
+
+
+
+' Be sure that all variables are dimensioned:
+option explicit
+
+
+' REQUIRED VARIABLES for interface/service tests:
+
+' for XComponent
+Global oComponentInstance As Object
+
+' for XPersistObject
+Global oPersistInstance As Object
+
+' for XUpdateBroadcaster
+Global bCustomUpdate As Boolean
+
+Global oForm As Object
+
+
+Sub CreateObj()
+
+'*************************************************************************
+' COMPONENT:
+' forms.ORadioButtonModel
+'*************************************************************************
+On Error Goto ErrHndl
+ Dim bOK As Boolean
+ Dim oShape As Object, oDrawPage As Object
+
+ bOK = true
+
+ oDoc = utils.createDocument("swriter", cObjectName)
+
+ oShape = toolkittools.addControlToDefaultForm("RadioButton", 1000, 1000, 2000, 1000)
+ oObj = oShape.getControl()
+ oShape = toolkittools.addControlToDefaultForm("RadioButton", 1000, 3000, 2000, 1000)
+ oComponentInstance = oShape.getControl()
+ oShape = toolkittools.addControlToDefaultForm("RadioButton", 1000, 5000, 2000, 1000)
+ oPersistInstance = oShape.getControl()
+
+ 'get control from document
+ oDrawPage = oDoc.DrawPage
+ oForm = oDrawPage.Forms.getByName("Standard")
+
+ oForm.DataSourceName = "Bibliography"
+ oForm.Command = "biblio"
+ oForm.CommandType = com.sun.star.sdb.CommandType.TABLE
+
+ oObj.DataField = "Custom3"
+
+ oForm.load()
+
+ ' for XUpdateBroadcaster
+ bCustomUpdate = true
+
+Exit Sub
+ErrHndl:
+ Test.Exception()
+End Sub
+
+Global aChangedVal As String
+
+' for XBoundComponent
+Sub prepareCommit()
+On Error Goto ErrHndl
+ Out.Log("prepareCommit() called.")
+ aChangedVal = 1 - oObj.State
+ oObj.State = aChangedVal
+
+ exit sub
+ErrHndl:
+ Test.Exception()
+End Sub
+
+' for XBoundComponent
+Function checkCommit() As Boolean
+On Error Goto ErrHndl
+ Out.Log("checkCommit() called.")
+ Dim rowVal As Variant
+
+ rowVal = oForm.getBoolean(oForm.findColumn("Custom3"))
+ if rowVal = true then
+ checkCommit() = (aChangedVal = 1)
+ else
+ checkCommit() = (aChangedVal = 0)
+ end if
+
+ exit function
+ErrHndl:
+ Test.Exception()
+End Function
+
+' for XUpdateBroadcaster
+Sub UpdateComponent()
+ oObj.State = 1 - oObj.State
+ oObj.commit()
+End Sub
+</script:module>
diff --git a/qadevOOo/tests/basic/mod/forms/ORadioButtonModel/script.xlb b/qadevOOo/tests/basic/mod/forms/ORadioButtonModel/script.xlb
new file mode 100644
index 000000000000..a364a4442441
--- /dev/null
+++ b/qadevOOo/tests/basic/mod/forms/ORadioButtonModel/script.xlb
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd">
+<library:library xmlns:library="http://openoffice.org/2000/library" library:name="forms_ORadioButtonModel" library:readonly="false" library:passwordprotected="false">
+"<library:element library:name="forms_ORadioButtonModel"/>
+"</library:library>
diff --git a/qadevOOo/tests/basic/mod/forms/OTimeControl/forms_OTimeControl.xba b/qadevOOo/tests/basic/mod/forms/OTimeControl/forms_OTimeControl.xba
new file mode 100644
index 000000000000..d960cf290bc0
--- /dev/null
+++ b/qadevOOo/tests/basic/mod/forms/OTimeControl/forms_OTimeControl.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="forms_OTimeControl" script:language="StarBasic">
+
+
+'*************************************************************************
+'
+' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+'
+' Copyright 2000, 2010 Oracle and/or its affiliates.
+'
+' OpenOffice.org - a multi-platform office productivity suite
+'
+' This file is part of OpenOffice.org.
+'
+' OpenOffice.org is free software: you can redistribute it and/or modify
+' it under the terms of the GNU Lesser General Public License version 3
+' only, as published by the Free Software Foundation.
+'
+' OpenOffice.org is distributed in the hope that it will be useful,
+' but WITHOUT ANY WARRANTY; without even the implied warranty of
+' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+' GNU Lesser General Public License version 3 for more details
+' (a copy is included in the LICENSE file that accompanied this code).
+'
+' You should have received a copy of the GNU Lesser General Public License
+' version 3 along with OpenOffice.org. If not, see
+' <http://www.openoffice.org/license.html>
+' for a copy of the LGPLv3 License.
+'
+'*************************************************************************
+'*************************************************************************
+
+
+
+' Be sure that all variables are dimensioned:
+option explicit
+
+
+
+' REQUIRED VARIABLES for interface/service tests:
+
+' Required for com.sun.star.awt.XView:
+ Global oGraphics as Object
+
+' Required for com.sun.star.lang.XComponent:
+ Global oComponentInstance As Object ' it will be disposed
+
+' Required for com.sun.star.awt.XControl:
+ Global oContext As Object
+ Global oWinpeer As Object
+ Global oToolkit As Object
+ Global oModel As Object
+
+' Required for com.sun.star.awt.XWindow:
+ Global oXWindow as Object
+ Global oCtrlShape As Variant
+
+
+
+Sub CreateObj()
+
+'*************************************************************************
+' COMPONENT:
+' forms.OTimeControl
+'*************************************************************************
+On Error Goto ErrHndl
+
+ Dim bOK As Boolean
+ Dim oShape1 As Object
+ Dim oShape2 As Object
+ Dim oShape3 As Object
+ Dim oCurrCtrl As Object
+ Dim oWin As Object
+ Dim oKit As Object
+ Dim oDevice As Object
+
+ bOK = true
+
+ oDoc = utils.createDocument("swriter", cObjectName)
+
+ oShape1 = toolkittools.addControlToDefaultForm("TimeField", 1000, 1000, 2000, 1000)
+ oShape2 = toolkittools.addControlToDefaultForm("TimeField", 1000, 1000, 2000, 1000)
+ oShape3 = toolkittools.addControlToDefaultForm("TextField", 1000, 1000, 2000, 1000)
+
+ oModel = oShape1.getControl()
+ oCurrCtrl = oDoc.getCurrentController()
+ oWin = oCurrCtrl.getControl(oModel).getPeer()
+ oKit = oWin.getToolkit()
+ oDevice = oKit.createScreenCompatibleDevice(200,200)
+ oGraphics = oDevice.createGraphics()
+
+ oObj = oCurrCtrl.getControl(oModel)
+ oComponentInstance = oCurrCtrl.getControl(oShape2.getControl())
+ oContext = oDoc
+ oWinpeer = oWin
+ oToolkit = oKit
+ oXWindow = oCurrCtrl.getControl(oShape3.getControl())
+ oCtrlShape = oShape1
+
+
+Exit Sub
+ErrHndl:
+ Test.Exception()
+End Sub
+</script:module>
diff --git a/qadevOOo/tests/basic/mod/forms/OTimeControl/script.xlb b/qadevOOo/tests/basic/mod/forms/OTimeControl/script.xlb
new file mode 100644
index 000000000000..5ffb92c7d3e5
--- /dev/null
+++ b/qadevOOo/tests/basic/mod/forms/OTimeControl/script.xlb
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd">
+<library:library xmlns:library="http://openoffice.org/2000/library" library:name="forms_OTimeControl" library:readonly="false" library:passwordprotected="false">
+"<library:element library:name="forms_OTimeControl"/>
+"</library:library>
diff --git a/qadevOOo/tests/basic/mod/forms/OTimeModel/forms_OTimeModel.xba b/qadevOOo/tests/basic/mod/forms/OTimeModel/forms_OTimeModel.xba
new file mode 100644
index 000000000000..003dd7d1f30f
--- /dev/null
+++ b/qadevOOo/tests/basic/mod/forms/OTimeModel/forms_OTimeModel.xba
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
+<script:module xmlns:script="http://openoffice.org/2000/script" script:name="forms_OTimeModel" script:language="StarBasic">
+
+
+'*************************************************************************
+'
+' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+'
+' Copyright 2000, 2010 Oracle and/or its affiliates.
+'
+' OpenOffice.org - a multi-platform office productivity suite
+'
+' This file is part of OpenOffice.org.
+'
+' OpenOffice.org is free software: you can redistribute it and/or modify
+' it under the terms of the GNU Lesser General Public License version 3
+' only, as published by the Free Software Foundation.
+'
+' OpenOffice.org is distributed in the hope that it will be useful,
+' but WITHOUT ANY WARRANTY; without even the implied warranty of
+' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+' GNU Lesser General Public License version 3 for more details
+' (a copy is included in the LICENSE file that accompanied this code).
+'
+' You should have received a copy of the GNU Lesser General Public License
+' version 3 along with OpenOffice.org. If not, see
+' <http://www.openoffice.org/license.html>
+' for a copy of the LGPLv3 License.
+'
+'*************************************************************************
+'*************************************************************************
+
+
+
+' Be sure that all variables are dimensioned:
+option explicit
+
+
+
+' REQUIRED VARIABLES for interface/service tests:
+
+' for XComponent
+Global oComponentInstance As Object
+
+' for XPersistObject
+Global oPersistInstance As Object
+
+' for XUpdateBroadcaster
+Global bCustomUpdate As Boolean
+
+Global oForm As Object
+
+Global oConnection As Object
+
+
+Sub CreateObj()
+
+'*************************************************************************
+' COMPONENT:
+' forms.OTimeModel
+'*************************************************************************
+On Error Goto ErrHndl
+
+ Dim bOK As Boolean
+ Dim oShape As Object, oDrawPage As Object
+
+ bOK = true
+ ' --- create a document if needed
+
+ oDoc = utils.createDocument("swriter", cObjectName)
+
+ oShape = toolkittools.addControlToDefaultForm("TimeField", 1000, 1000, 2000, 1000)
+ oObj = oShape.getControl()
+ oShape = toolkittools.addControlToDefaultForm("TimeField", 1000, 3000, 2000, 1000)
+ oComponentInstance = oShape.getControl()
+ oShape = toolkittools.addControlToDefaultForm("TimeField", 1000, 5000, 2000, 1000)
+ oPersistInstance = oShape.getControl()
+
+ 'get control from document
+ oDrawPage = oDoc.DrawPage
+ oForm = oDrawPage.Forms.getByName("Standard")
+
+ Dim oRowSet As Object, facc As Object, dbSource As Object
+ Dim srcFile As String, dstFile As String, dbSrcURL As String
+
+ ' Copying DB file to temp location
+ srcFile = utils.Path2URL(cTestDocsDir) + "TestDB/testDB.dbf"
+ dstFile = utils.getTempFileURL("OTimeModelDB.dbf")
+ dbSrcURL = "sdbc:dbase:" + utils.StrReplace(dstFile, "/OTimeModelDB.dbf", "")
+
+ facc = createUnoService("com.sun.star.ucb.SimpleFileAccess")
+ if (facc.exists(dstFile)) then facc.kill(dstFile)
+ facc.copy(srcFile, dstFile)
+
+ dbtools.RegisterDataSource("DBTest", dbSrcURL)
+
+ oForm.DataSourceName = "DBTest"
+ oForm.Command = "OTimeModelDB"
+ oForm.CommandType = com.sun.star.sdb.CommandType.TABLE
+
+ oObj.DataField = "_DOUBLE"
+
+ oForm.load()
+
+ oConnection = oForm.ActiveConnection
+
+ ' for XUpdateBroadcaster
+ bCustomUpdate = true
+
+Exit Sub
+ErrHndl:
+ Test.Exception()
+End Sub
+
+Global aChangedValue As Variant
+
+' for XBoundComponent
+Sub prepareCommit()
+On Error Goto ErrHndl
+
+ Out.Log("prepareCommit() called.")
+ if NOT (isNull(oObj.Time) OR isEmpty(oObj.Time)) then
+ Out.Log("The old value was: " + oObj.Time)
+ aChangedValue = oObj.Time + 150000 ' adding 15 minutes
+ else
+ aChangedValue = 150000 ' setting to 0:15
+ end if
+ oObj.Time = aChangedValue
+
+ exit sub
+ErrHndl:
+ Test.Exception()
+End Sub
+
+' for XBoundComponent
+Function checkCommit() As Boolean
+On Error Goto ErrHndl
+ Out.Log("checkCommit() called.")
+ Dim rowValue As Variant
+
+ oForm.updateRow()
+ oForm.reload()
+ rowValue = oObj.Time
+ Out.Log("Value was set to " + aChangedValue )
+ Out.Log("the value in current row is " + rowValue)
+ checkCommit() = abs(rowValue - aChangedValue) &lt; 100
+
+ exit function
+ErrHndl:
+ Test.Exception()
+ checkCommit() = false
+End Function
+
+' for XUpdateBroadcaster
+Sub UpdateComponent()
+ Out.Log("UpdateComponent() called.")
+ if NOT (isNull(oObj.Time) OR isEmpty(oObj.Time)) then
+ oObj.Time = oObj.Time + 150000
+ else
+ oObj.Time = 150000
+ end if
+ oObj.commit()
+
+ exit sub
+ErrHndl:
+ Test.Exception()
+End Sub
+
+Sub DisposeObj()
+On Error Goto ErrHndl
+ Out.Log("Closing DB connection ...")
+ oConnection.close()
+
+ Out.Log("Revoking 'DBTest' datasource ...")
+ dbtools.RevokeDB("DBTest")
+Exit Sub
+ErrHndl:
+ Test.Exception()
+ resume next
+End Sub
+</script:module>
diff --git a/qadevOOo/tests/basic/mod/forms/OTimeModel/script.xlb b/qadevOOo/tests/basic/mod/forms/OTimeModel/script.xlb
new file mode 100644
index 000000000000..bff6755c7966
--- /dev/null
+++ b/qadevOOo/tests/basic/mod/forms/OTimeModel/script.xlb
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd">
+<library:library xmlns:library="http://openoffice.org/2000/library" library:name="forms_OTimeModel" library:readonly="false" library:passwordprotected="false">
+"<library:element library:name="forms_OTimeModel"/>
+"</library:library>