summaryrefslogtreecommitdiff
path: root/wizards
diff options
context:
space:
mode:
authorJean-Pierre Ledure <jp@ledure.be>2020-12-29 18:31:09 +0100
committerJulien Nabet <serval2412@yahoo.fr>2020-12-31 17:53:57 +0100
commitd06cb471ecab814c29c3b8948933fc17b63ec21e (patch)
tree6b6a18b4072d2c81c29ca0fe85fd05a8f9bd27e3 /wizards
parentf59af079afd1ff5fa87323b6abc5f3bfd516c22f (diff)
ScriptForge - (SFDocuments) create a SF_Form instance with Subforms()
Subforms are controls in UNO They are considered as form objects in ScriptForge Additional error message in po files SF_Form._IsStillAlive() has been simplified SF_Form._GetParents() has been reviewed to incorporate subforms Change-Id: I89306d5c65e34ae1596f84b674ed338e070957f5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108475 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
Diffstat (limited to 'wizards')
-rw-r--r--wizards/source/scriptforge/SF_Exception.xba4
-rw-r--r--wizards/source/scriptforge/SF_Root.xba15
-rw-r--r--wizards/source/scriptforge/po/ScriptForge.pot20
-rw-r--r--wizards/source/scriptforge/po/en.po20
-rw-r--r--wizards/source/sfdocuments/SF_Base.xba2
-rw-r--r--wizards/source/sfdocuments/SF_Calc.xba2
-rw-r--r--wizards/source/sfdocuments/SF_Document.xba4
-rw-r--r--wizards/source/sfdocuments/SF_Form.xba141
-rw-r--r--wizards/source/sfdocuments/SF_Register.xba3
9 files changed, 165 insertions, 46 deletions
diff --git a/wizards/source/scriptforge/SF_Exception.xba b/wizards/source/scriptforge/SF_Exception.xba
index c4a0f6c85370..fa0db91d06af 100644
--- a/wizards/source/scriptforge/SF_Exception.xba
+++ b/wizards/source/scriptforge/SF_Exception.xba
@@ -109,6 +109,7 @@ Const FORMDEADERROR = &quot;FORMDEADERROR&quot;
Const CALCFORMNOTFOUNDERROR = &quot;CALCFORMNOTFOUNDERROR&quot;
Const WRITERFORMNOTFOUNDERROR = &quot;WRITERFORMNOTFOUNDERROR&quot;
Const BASEFORMNOTFOUNDERROR = &quot;BASEFORMNOTFOUNDERROR&quot;
+Const SUBFORMNOTFOUNDERROR = &quot;SUBFORMNOTFOUNDERROR&quot;
&apos; SF_Dialog
Const DIALOGNOTFOUNDERROR = &quot;DIALOGNOTFOUNDERROR&quot;
@@ -842,6 +843,9 @@ Try:
Case BASEFORMNOTFOUNDERROR &apos; SF_Base.Forms(Index, FormDocument, BaseDocument)
sMessage = sLocation _
&amp; &quot;\n&quot; &amp; &quot;\n&quot; &amp; .GetText(&quot;BASEFORMNOTFOUND&quot;, pvArgs(0), pvArgs(1), pvArgs(2))
+ Case SUBFORMNOTFOUNDERROR &apos; SF_Form.Subforms(Subform, Mainform)
+ sMessage = sLocation _
+ &amp; &quot;\n&quot; &amp; &quot;\n&quot; &amp; .GetText(&quot;SUBFORMNOTFOUND&quot;, pvArgs(0), pvArgs(1))
Case DIALOGNOTFOUNDERROR &apos; SF_Dialog._NewDialog(Service, DialogName, WindowName)
sMessage = sLocation _
&amp; &quot;\n&quot; &amp; &quot;\n&quot; &amp; .GetText(&quot;DIALOGNOTFOUND&quot;, pvArgs(0), pvArgs(1), pvArgs(2), pvArgs(3), pvArgs(4) _
diff --git a/wizards/source/scriptforge/SF_Root.xba b/wizards/source/scriptforge/SF_Root.xba
index 22a4a8aba2b2..3d643acdd121 100644
--- a/wizards/source/scriptforge/SF_Root.xba
+++ b/wizards/source/scriptforge/SF_Root.xba
@@ -740,7 +740,7 @@ Try:
, MsgId := &quot;The requested form could not be found in the Calc sheet. The given index is off-limits.\n\n&quot; _
&amp; &quot;The concerned Calc document is &apos;%3&apos;.\n\n&quot; _
&amp; &quot;The name of the sheet = &apos;%2&apos;\n&quot; _
- &amp; &quot;The index = %1&quot; _
+ &amp; &quot;The index = %1.&quot; _
, Comment := &quot;SF_Form determination\n&quot; _
&amp; &quot;%1: A number\n&quot; _
&amp; &quot;%2: A sheet name\n&quot; _
@@ -750,7 +750,7 @@ Try:
.AddText( Context := &quot;WRITERFORMNOTFOUND&quot; _
, MsgId := &quot;The requested form could not be found in the Writer document. The given index is off-limits.\n\n&quot; _
&amp; &quot;The concerned Writer document is &apos;%2&apos;.\n\n&quot; _
- &amp; &quot;The index = %1&quot; _
+ &amp; &quot;The index = %1.&quot; _
, Comment := &quot;SF_Form determination\n&quot; _
&amp; &quot;%1: A number\n&quot; _
&amp; &quot;%2: A file name&quot; _
@@ -759,12 +759,21 @@ Try:
.AddText( Context := &quot;BASEFORMNOTFOUND&quot; _
, MsgId := &quot;The requested form could not be found in the form document &apos;%2&apos;. The given index is off-limits.\n\n&quot; _
&amp; &quot;The concerned Base document is &apos;%3&apos;.\n\n&quot; _
- &amp; &quot;The index = %1&quot; _
+ &amp; &quot;The index = %1.&quot; _
, Comment := &quot;SF_Form determination\n&quot; _
&amp; &quot;%1: A number\n&quot; _
&amp; &quot;%2: A string\n&quot; _
&amp; &quot;%3: A file name&quot; _
)
+ &apos; SF_Form.Subforms
+ .AddText( Context := &quot;SUBFORMNOTFOUND&quot; _
+ , MsgId := &quot;The requested subform could not be found below the given main form.\n\n&quot; _
+ &amp; &quot;The main form = &apos;%2&apos;.\n&quot; _
+ &amp; &quot;The subform = &apos;%1&apos;.&quot; _
+ , Comment := &quot;SF_Form determination\n&quot; _
+ &amp; &quot;%1: A form name\n&quot; _
+ &amp; &quot;%2: A form name&quot; _
+ )
&apos; SF_Dialog._NewDialog
.AddText( Context := &quot;DIALOGNOTFOUND&quot; _
, MsgId := &quot;The requested dialog could not be located in the given container or library.\n&quot; _
diff --git a/wizards/source/scriptforge/po/ScriptForge.pot b/wizards/source/scriptforge/po/ScriptForge.pot
index 9e39b5da6896..d75dbab0a991 100644
--- a/wizards/source/scriptforge/po/ScriptForge.pot
+++ b/wizards/source/scriptforge/po/ScriptForge.pot
@@ -14,7 +14,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: https://bugs.libreoffice.org/enter_bug.cgi?product=LibreOffice&bug_status=UNCONFIRMED&component=UI\n"
-"POT-Creation-Date: 2020-12-15 15:57:29\n"
+"POT-Creation-Date: 2020-12-29 18:05:28\n"
"PO-Revision-Date: YYYY-MM-DD HH:MM:SS\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <EMAIL@ADDRESS>\n"
@@ -750,7 +750,7 @@ msgid ""
"The concerned Calc document is '%3'.\n"
"\n"
"The name of the sheet = '%2'\n"
-"The index = %1"
+"The index = %1."
msgstr ""
#. SF_Form determination
@@ -764,7 +764,7 @@ msgid ""
"\n"
"The concerned Writer document is '%2'.\n"
"\n"
-"The index = %1"
+"The index = %1."
msgstr ""
#. SF_Form determination
@@ -779,7 +779,19 @@ msgid ""
"\n"
"The concerned Base document is '%3'.\n"
"\n"
-"The index = %1"
+"The index = %1."
+msgstr ""
+
+#. SF_Form determination
+#. %1: A form name
+#. %2: A form name
+#, kde-format
+msgctxt "SUBFORMNOTFOUND"
+msgid ""
+"The requested subform could not be found below the given main form.\n"
+"\n"
+"The main form = '%2'.\n"
+"The subform = '%1'."
msgstr ""
#. SF_Dialog creation
diff --git a/wizards/source/scriptforge/po/en.po b/wizards/source/scriptforge/po/en.po
index 9e39b5da6896..d75dbab0a991 100644
--- a/wizards/source/scriptforge/po/en.po
+++ b/wizards/source/scriptforge/po/en.po
@@ -14,7 +14,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: https://bugs.libreoffice.org/enter_bug.cgi?product=LibreOffice&bug_status=UNCONFIRMED&component=UI\n"
-"POT-Creation-Date: 2020-12-15 15:57:29\n"
+"POT-Creation-Date: 2020-12-29 18:05:28\n"
"PO-Revision-Date: YYYY-MM-DD HH:MM:SS\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <EMAIL@ADDRESS>\n"
@@ -750,7 +750,7 @@ msgid ""
"The concerned Calc document is '%3'.\n"
"\n"
"The name of the sheet = '%2'\n"
-"The index = %1"
+"The index = %1."
msgstr ""
#. SF_Form determination
@@ -764,7 +764,7 @@ msgid ""
"\n"
"The concerned Writer document is '%2'.\n"
"\n"
-"The index = %1"
+"The index = %1."
msgstr ""
#. SF_Form determination
@@ -779,7 +779,19 @@ msgid ""
"\n"
"The concerned Base document is '%3'.\n"
"\n"
-"The index = %1"
+"The index = %1."
+msgstr ""
+
+#. SF_Form determination
+#. %1: A form name
+#. %2: A form name
+#, kde-format
+msgctxt "SUBFORMNOTFOUND"
+msgid ""
+"The requested subform could not be found below the given main form.\n"
+"\n"
+"The main form = '%2'.\n"
+"The subform = '%1'."
msgstr ""
#. SF_Dialog creation
diff --git a/wizards/source/sfdocuments/SF_Base.xba b/wizards/source/sfdocuments/SF_Base.xba
index dec3b2eccad9..f60886e574c9 100644
--- a/wizards/source/sfdocuments/SF_Base.xba
+++ b/wizards/source/sfdocuments/SF_Base.xba
@@ -180,7 +180,7 @@ Public Function Forms(Optional ByVal FormDocument As Variant _
&apos;&apos;&apos; When absent, the list of available forms is returned
&apos;&apos;&apos; To get the first (unique ?) form stored in the form document, set Form = 0
&apos;&apos;&apos; Returns:
-&apos;&apos;&apos; A zero-base array of strings if Form is absent
+&apos;&apos;&apos; A zero-based array of strings if Form is absent
&apos;&apos;&apos; An instance of the SF_Form class if Form exists
&apos;&apos;&apos; Exceptions:
&apos;&apos;&apos; FORMDEADERROR The form is not open
diff --git a/wizards/source/sfdocuments/SF_Calc.xba b/wizards/source/sfdocuments/SF_Calc.xba
index 8f542af3aa58..852cd0ad138d 100644
--- a/wizards/source/sfdocuments/SF_Calc.xba
+++ b/wizards/source/sfdocuments/SF_Calc.xba
@@ -865,7 +865,7 @@ Public Function Forms(Optional ByVal SheetName As Variant _
&apos;&apos;&apos; Exceptions:
&apos;&apos;&apos; CALCFORMNOTFOUNDERROR Form not found
&apos;&apos;&apos; Returns:
-&apos;&apos;&apos; A zero-base array of strings if Form is absent
+&apos;&apos;&apos; A zero-based array of strings if Form is absent
&apos;&apos;&apos; An instance of the SF_Form class if Form exists
&apos;&apos;&apos; Example:
&apos;&apos;&apos; Dim myForm As Object, myList As Variant
diff --git a/wizards/source/sfdocuments/SF_Document.xba b/wizards/source/sfdocuments/SF_Document.xba
index a77e0ad9223b..7b66600794a9 100644
--- a/wizards/source/sfdocuments/SF_Document.xba
+++ b/wizards/source/sfdocuments/SF_Document.xba
@@ -469,7 +469,7 @@ Public Function Forms(Optional ByVal Form As Variant) As Variant
&apos;&apos;&apos; Exceptions:
&apos;&apos;&apos; WRITERFORMNOTFOUNDERROR Form not found
&apos;&apos;&apos; Returns:
-&apos;&apos;&apos; A zero-base array of strings if Form is absent
+&apos;&apos;&apos; A zero-based array of strings if Form is absent
&apos;&apos;&apos; An instance of the SF_Form class if Form exists
&apos;&apos;&apos; Example:
&apos;&apos;&apos; Dim myForm As Object, myList As Variant
@@ -504,7 +504,7 @@ Try:
Forms = vFormNames
Else
If VarType(Form) = V_STRING Then &apos; Find the form by name
- If Not ScriptForge.SF_Utils._Validate(Form, &quot;Form&quot;, V_STRING, vFormNames) Then GoTo Finally
+ If Not ScriptForge.SF_Array.Contains(vFormNames, Form, CaseSensitive := True) Then GoTo CatchNotFound
Set oXForm = oForms.getByName(Form)
Else &apos; Find the form by index
If Form &lt; 0 Or Form &gt;= oForms.Count Then GoTo CatchNotFound
diff --git a/wizards/source/sfdocuments/SF_Form.xba b/wizards/source/sfdocuments/SF_Form.xba
index 1ed94d51faf3..1c6b14770055 100644
--- a/wizards/source/sfdocuments/SF_Form.xba
+++ b/wizards/source/sfdocuments/SF_Form.xba
@@ -64,7 +64,8 @@ Option Explicit
REM ================================================================== EXCEPTIONS
-Private Const FORMDEADERROR = &quot;FORMDEADERROR&quot;
+Private Const FORMDEADERROR = &quot;FORMDEADERROR&quot;
+Private Const SUBFORMNOTFOUNDERROR = &quot;SUBFORMNOTFOUNDERROR&quot;
REM ============================================================= PRIVATE MEMBERS
@@ -84,7 +85,6 @@ Private _Component As Object &apos; com.sun.star.lang.XComponent or com.sun.s
&apos; EVents management
Private _CacheIndex As Long &apos; Index in central cache storage
-Private _IssuedFromEvent As Boolean &apos; When True instance is always presumed alive
&apos; Form UNO references
&apos; The entry to the interactions with the form. Validity checked by the _IsStillAlive() method
@@ -119,7 +119,6 @@ Private Sub Class_Initialize()
Set _FormDocument = Nothing
_FormType = ISUNDEFINED
_CacheIndex = -1
- _IssuedFromEvent = False
Set _Form = Nothing
Set _Database = Nothing
_ControlCache = Array()
@@ -173,6 +172,12 @@ Property Get Name() As String
End Property &apos; SFDocuments.SF_Form.Name
REM -----------------------------------------------------------------------------
+Property Get Parent() As Object
+&apos;&apos;&apos; Return the Parent of the actual Form
+ Parent = _PropertyGet(&quot;Parent&quot;)
+End Property &apos; SFDocuments.SF_Form.Parent
+
+REM -----------------------------------------------------------------------------
Property Get Visible() As Variant
&apos;&apos;&apos; The Visible property is False before the Execute() statement
Visible = _PropertyGet(&quot;Visible&quot;)
@@ -349,7 +354,7 @@ Public Function GetDatabase(Optional ByVal User As Variant _
&apos;&apos;&apos; Returns a Database instance (service = SFDatabases.Database) giving access
&apos;&apos;&apos; to the execution of SQL commands on the database defined and/or stored in
&apos;&apos;&apos; the actual Base document
-&apos;&apos;&apos; Each form has its own database connection, except within Base documents where
+&apos;&apos;&apos; Each main form has its own database connection, except within Base documents where
&apos;&apos;&apos; they all share the same connection
&apos;&apos;&apos; Args:
&apos;&apos;&apos; User, Password: the login parameters as strings. Defaults = &quot;&quot;
@@ -393,7 +398,9 @@ Try:
If _FormType = ISBASEFORM Then
&apos; Fetch the shared connection
Set _Database = [_Parent].GetDatabase(User, Password)
- ElseIf Len(_Form.DataSOurceName) = 0 Then &apos; There is no database linked with the form
+ ElseIf _FormType = ISSUBFORM Then
+ &apos; Return Nothing : method is not applicable to subforms
+ ElseIf Len(_Form.DataSourceName) = 0 Then &apos; There is no database linked with the form
&apos; Return Nothing
Else
&apos; Check if DataSourceName is a file or a registered name and create database instance accordingly
@@ -553,6 +560,87 @@ Catch:
GoTo Finally
End Function &apos; SFDocuments.SF_Form.SetProperty
+REM -----------------------------------------------------------------------------
+Public Function Subforms(Optional ByVal Subform As Variant) As Variant
+&apos;&apos;&apos; Return either
+&apos;&apos;&apos; - the list of the subforms contained in the actual form or subform instance
+&apos;&apos;&apos; - a SFDocuments.Form object based on its name or its index in the alphabetic list of subforms
+&apos;&apos;&apos; Args:
+&apos;&apos;&apos; Subform: a subform stored in the parent form given by its name or its index
+&apos;&apos;&apos; When absent, the list of available subforms is returned
+&apos;&apos;&apos; To get the first (unique ?) subform stored in the parent form, set Subform = 0
+&apos;&apos;&apos; Exceptions:
+&apos;&apos;&apos; SUBFORMNOTFOUNDERROR Subform not found
+&apos;&apos;&apos; Returns:
+&apos;&apos;&apos; A zero-based array of strings if Subform is absent
+&apos;&apos;&apos; An instance of the SF_Form class if Subform exists
+&apos;&apos;&apos; Example:
+&apos;&apos;&apos; Dim myForm As Object, myList As Variant, mySubform As Object
+&apos;&apos;&apos; myList = oForm.Subforms()
+&apos;&apos;&apos; Set mySubform = myForm.Subforms(&quot;mySubform&quot;)
+
+Dim oSubform As Object &apos; The new Form class instance
+Dim oXSubform As Object &apos; com.sun.star.form.XForm
+Dim vSubformNames As Variant &apos; Array of subform names
+Dim i As Long
+Const cstDrawPage = 0 &apos; Only 1 drawpage in a Writer document
+
+Const cstThisSub = &quot;SFDocuments.Form.Subforms&quot;
+Const cstSubArgs = &quot;[Subform=&quot;&quot;&quot;&quot;]&quot;
+
+ If ScriptForge.SF_Utils._ErrorHandling() Then On Local Error GoTo Catch
+
+Check:
+ If IsMissing(Subform) Or IsEmpty(Subform) Then Subform = &quot;&quot;
+ If ScriptForge.SF_Utils._EnterFunction(cstThisSub, cstSubArgs) Then
+ If Not _IsStillAlive() Then GoTo Finally
+ If Not ScriptForge.SF_Utils._Validate(Subform, &quot;Subform&quot;, Array(V_STRING, ScriptForge.V_NUMERIC)) Then GoTo Finally
+ End If
+
+Try:
+ &apos; Collect all control names and retain only the subforms
+ vSubformNames = _Form.getElementNames()
+ For i = 0 To UBound(vSubformNames)
+ Set oSubform = _Form.getByName(vSubformNames(i))
+ &apos; Subforms are the only control types having no ClassId property
+ If ScriptForge.SF_Session.HasUnoProperty(oSubform, &quot;ClassId&quot;) Then vSubformNames(i) = &quot;&quot;
+ Next i
+ vSubformNames = ScriptForge.SF_Array.TrimArray(vSubformNames)
+
+ If Len(Subform) = 0 Then &apos; Return the list of valid subform names
+ Subforms = vSubformNames
+ Else
+ If VarType(Subform) = V_STRING Then &apos; Find the form by name
+ If Not ScriptForge.SF_Array.Contains(vSubformNames, Subform, CaseSensitive := True) Then GoTo CatchNotFound
+ Set oXSubform = _Form.getByName(Subform)
+ Else &apos; Find the form by index
+ If Subform &lt; 0 Or Subform &gt; UBound(vSubformNames) Then GoTo CatchNotFound
+ Set oXSubform = _Form.getByName(vSubformNames(Subform))
+ End If
+ &apos; Create the new Form class instance
+ Set oSubform = SF_Register._NewForm(oXSubform)
+ With oSubform
+ Set .[_Parent] = [Me]
+ ._FormType = ISSUBFORM
+ Set ._Component = _Component
+ Set ._FormDocument = _FormDocument
+ ._SheetName = _SheetName
+ ._FormDocumentName = _FormDocumentName
+ ._Initialize()
+ End With
+ Set Subforms = oSubform
+ End If
+
+Finally:
+ ScriptForge.SF_Utils._ExitFunction(cstThisSub)
+ Exit Function
+Catch:
+ GoTo Finally
+CatchNotFound:
+ ScriptForge.SF_Exception.RaiseFatal(SUBFORMNOTFOUNDERROR, Subform, _Name)
+ GoTo Finally
+End Function &apos; SFDocuments.SF_Form.Subforms
+
REM =========================================================== PRIVATE FUNCTIONS
REM -----------------------------------------------------------------------------
@@ -625,9 +713,14 @@ Try:
If iLevel = 1 Then
_FormType = ISSUBFORM
Set [_Parent] = SF_Register._NewForm(oParent)
- &apos; The parent form could be a main form
- [_Parent]._Initialize()
- &apos; Everything is in the parent, stop scan
+ &apos; Everything is in the parent, copy items and stop scan
+ [_Parent]._Initialize() &apos; Current method is called recursively here
+ With [_Parent]
+ _SheetName = ._SheetName
+ _FormDocumentName = ._FormDocumentName
+ Set _FormDocument = ._FormDocument
+ Set _Component = ._Component
+ End With
Exit Sub
End If
Case &quot;com.sun.star.form.OFormsCollection&quot; &apos; The collection of forms inside a drawpage
@@ -667,7 +760,6 @@ Public Sub _Initialize()
&apos;&apos;&apos; - complete the missing private members
&apos;&apos;&apos; - store the new instance in the cache
-
_GetParents()
_CacheIndex = SF_Register._AddFormToCache(_Form, [Me])
@@ -690,22 +782,10 @@ Check:
If IsMissing(pbError) Then pbError = True
Try:
- If _IssuedFromEvent Then &apos; Instance is presumed alive when issued from an event
- bAlive = True
- Else
- &apos; For usual documents, check that the parent document is still open
- &apos; For Base forms and subforms, check the openness of the main form
- Select Case _FormType
- Case ISDOCFORM, ISCALCFORM
- bAlive = [_Parent]._IsStillAlive(pbError)
- Case ISBASEFORM, ISSUBFORM
- &apos; A form that has never been opened has no component
- &apos; If ever opened and closed afterwards, it keeps the Component but loses its Controller
- bAlive = Not IsNull(_FormDocument.Component)
- If bAlive Then bAlive = Not IsNull(_FormDocument.Component.CurrentController)
- End Select
- If Not bAlive Then GoTo Catch
- End If
+ &apos; At main form termination, all database connections are lost
+ bAlive = Not IsNull(_Form)
+ If bAlive Then bAlive = Not IsNull(_Form.ActiveConnection)
+ If Not bAlive Then GoTo Catch
Finally:
_IsStillAlive = bAlive
@@ -716,7 +796,7 @@ Catch:
&apos; Keep error message elements before disposing the instance
sName = _SheetName &amp; _FormDocumentName &apos; At least one of them is a zero-length string
sName = Iif(Len(sName) &gt; 0, &quot;[&quot; &amp; sName &amp; &quot;].&quot;, &quot;&quot;) &amp; _Name
- sId = [_Parent]._FileIdent()
+ If Not IsNull(_Component) Then sId = _Component.Location Else sId = &quot;&quot;
&apos; Dispose the actual forms instance
Dispose()
&apos; Display error message
@@ -742,13 +822,14 @@ Const cstSubArgs = &quot;&quot;
If IsNull(oSession) Then Set oSession = ScriptForge.SF_Services.CreateScriptService(&quot;Session&quot;)
Select Case UCase(psProperty)
- Case UCase(&quot;Caption&quot;)
- Case UCase(&quot;Height&quot;)
+&apos; Case UCase(&quot;Caption&quot;)
+&apos; Case UCase(&quot;Height&quot;)
Case UCase(&quot;Name&quot;)
+ _PropertyGet = _Name
Case UCase(&quot;Parent&quot;)
_PropertyGet = [_Parent]
- Case UCase(&quot;Visible&quot;)
- Case UCase(&quot;Width&quot;)
+&apos; Case UCase(&quot;Visible&quot;)
+&apos; Case UCase(&quot;Width&quot;)
Case UCase(&quot;XForm&quot;)
Set _PropertyGet = _Form
Case Else
diff --git a/wizards/source/sfdocuments/SF_Register.xba b/wizards/source/sfdocuments/SF_Register.xba
index 55224b0d53d4..d530d5b84181 100644
--- a/wizards/source/sfdocuments/SF_Register.xba
+++ b/wizards/source/sfdocuments/SF_Register.xba
@@ -246,7 +246,8 @@ Try:
If oSession.UnoObjectType(vEvent) = &quot;com.sun.star.lang.EventObject&quot; Then
If oSession.UnoObjectType(vEvent.Source) = &quot;com.sun.star.comp.forms.ODatabaseForm&quot; Then
Set oSource = SF_Register._NewForm(vEvent.Source)
- Else &apos; Add for controls
+ If oSource._CacheIndex &lt; 0 Then oSource._Initialize()
+ Else &apos; TODO for controls
End If
End If