summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--wizards/source/scriptforge/SF_Exception.xba4
-rw-r--r--wizards/source/scriptforge/SF_Root.xba10
-rw-r--r--wizards/source/scriptforge/po/ScriptForge.pot15
-rw-r--r--wizards/source/scriptforge/po/en.po15
-rw-r--r--wizards/source/sfdocuments/SF_FormControl.xba15
5 files changed, 50 insertions, 9 deletions
diff --git a/wizards/source/scriptforge/SF_Exception.xba b/wizards/source/scriptforge/SF_Exception.xba
index 8739e0edfa8e..18d562b21e7b 100644
--- a/wizards/source/scriptforge/SF_Exception.xba
+++ b/wizards/source/scriptforge/SF_Exception.xba
@@ -110,6 +110,7 @@ Const CALCFORMNOTFOUNDERROR = "CALCFORMNOTFOUNDERROR"
Const WRITERFORMNOTFOUNDERROR = "WRITERFORMNOTFOUNDERROR"
Const BASEFORMNOTFOUNDERROR = "BASEFORMNOTFOUNDERROR"
Const SUBFORMNOTFOUNDERROR = "SUBFORMNOTFOUNDERROR"
+Const FORMCONTROLTYPEERROR = "FORMCONTROLTYPEERROR"
' SF_Dialog
Const DIALOGNOTFOUNDERROR = "DIALOGNOTFOUNDERROR"
@@ -847,6 +848,9 @@ Try:
Case SUBFORMNOTFOUNDERROR ' SF_Form.Subforms(Subform, Mainform)
sMessage = sLocation _
& "\n" & "\n" & .GetText("SUBFORMNOTFOUND", pvArgs(0), pvArgs(1))
+ Case FORMCONTROLTYPEERROR ' SF_FormControl._SetProperty(ControlName, FormName, ControlType, Property)
+ sMessage = sLocation _
+ & "\n" & "\n" & .GetText("FORMCONTROLTYPE", pvArgs(0), pvArgs(1), pvArgs(2), pvArgs(3))
Case DIALOGNOTFOUNDERROR ' SF_Dialog._NewDialog(Service, DialogName, WindowName)
sMessage = sLocation _
& "\n" & "\n" & .GetText("DIALOGNOTFOUND", 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 3d643acdd121..334e4798018c 100644
--- a/wizards/source/scriptforge/SF_Root.xba
+++ b/wizards/source/scriptforge/SF_Root.xba
@@ -774,6 +774,16 @@ Try:
& "%1: A form name\n" _
& "%2: A form name" _
)
+ ' SF_FormControl._SetProperty
+ .AddText( Context := "FORMCONTROLTYPE" _
+ , MsgId := "The control '%1' in form '%2' is of type '%3'.\n" _
+ & "The property or method '%4' is not applicable on that type of form controls." _
+ , Comment := "SF_FormControl property setting\n" _
+ & "%1: An identifier\n" _
+ & "%2: An identifier\n" _
+ & "%3: A string\n" _
+ & "%4: An identifier" _
+ )
' SF_Dialog._NewDialog
.AddText( Context := "DIALOGNOTFOUND" _
, MsgId := "The requested dialog could not be located in the given container or library.\n" _
diff --git a/wizards/source/scriptforge/po/ScriptForge.pot b/wizards/source/scriptforge/po/ScriptForge.pot
index d75dbab0a991..a4c6ff514bc4 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-29 18:05:28\n"
+"POT-Creation-Date: 2021-02-03 15:55:36\n"
"PO-Revision-Date: YYYY-MM-DD HH:MM:SS\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <EMAIL@ADDRESS>\n"
@@ -794,6 +794,19 @@ msgid ""
"The subform = '%1'."
msgstr ""
+#. SF_FormControl property setting
+#. %1: An identifier
+#. %2: An identifier
+#. %3: A string
+#. %4: An identifier
+#, kde-format
+msgctxt "FORMCONTROLTYPE"
+msgid ""
+"The control '%1' in form '%2' is of type '%3'.\n"
+"The property or method '%4' is not applicable on that type of form "
+"controls."
+msgstr ""
+
#. SF_Dialog creation
#. %1: An identifier
#. %2: A string
diff --git a/wizards/source/scriptforge/po/en.po b/wizards/source/scriptforge/po/en.po
index d75dbab0a991..a4c6ff514bc4 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-29 18:05:28\n"
+"POT-Creation-Date: 2021-02-03 15:55:36\n"
"PO-Revision-Date: YYYY-MM-DD HH:MM:SS\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <EMAIL@ADDRESS>\n"
@@ -794,6 +794,19 @@ msgid ""
"The subform = '%1'."
msgstr ""
+#. SF_FormControl property setting
+#. %1: An identifier
+#. %2: An identifier
+#. %3: A string
+#. %4: An identifier
+#, kde-format
+msgctxt "FORMCONTROLTYPE"
+msgid ""
+"The control '%1' in form '%2' is of type '%3'.\n"
+"The property or method '%4' is not applicable on that type of form "
+"controls."
+msgstr ""
+
#. SF_Dialog creation
#. %1: An identifier
#. %2: A string
diff --git a/wizards/source/sfdocuments/SF_FormControl.xba b/wizards/source/sfdocuments/SF_FormControl.xba
index 242f2c0e6405..3e4ad352c782 100644
--- a/wizards/source/sfdocuments/SF_FormControl.xba
+++ b/wizards/source/sfdocuments/SF_FormControl.xba
@@ -41,8 +41,7 @@ Option Explicit
REM ================================================================== EXCEPTIONS
-Private Const CONTROLTYPEERROR = &quot;CONTROLTYPEERROR&quot;
-Private Const TEXTFIELDERROR = &quot;TEXTFIELDERROR&quot;
+Private Const FORMCONTROLTYPEERROR = &quot;FORMCONTROLTYPEERROR&quot;
REM ============================================================= PRIVATE MEMBERS
@@ -1494,6 +1493,7 @@ Private Function _PropertySet(Optional ByVal psProperty As String _
Dim bSet As Boolean &apos; Return value
Static oSession As Object &apos; Alias of SF_Session
+Dim sFormName As String &apos; Full form identification for error messages
Dim vSet As Variant &apos; Value to set in UNO model or view property
Dim vActions As Variant &apos; Action property: list of available actions
Dim sAction As String &apos; A single action
@@ -1513,7 +1513,7 @@ Const cstSubArgs = &quot;Value&quot;
cstThisSub = &quot;SFDocuments.FormControl.set&quot; &amp; psProperty
ScriptForge.SF_Utils._EnterFunction(cstThisSub, cstSubArgs)
- If Not [_Parent]._IsStillAlive() Then GoTo Finally
+ If Not _ParentForm._IsStillAlive() Then GoTo Finally
If IsNull(oSession) Then Set oSession = ScriptForge.SF_Services.CreateScriptService(&quot;Session&quot;)
bSet = True
@@ -1578,7 +1578,7 @@ Const cstSubArgs = &quot;Value&quot;
Select Case _ControlType
Case CTLCOMBOBOX
If oSession.HasUNOProperty(_ControlModel, &quot;Text&quot;) And oSession.HasUNOProperty(_ControlModel, &quot;StringItemList&quot;) Then
- _ControlModel.Text = _ControlModel.StringItemList(CInt(pvValue))
+ If pvValue &gt;= 0 And pvValue &lt;= UBound(_ControlModel.StringItemList) Then _ControlModel.Text = _ControlModel.StringItemList(CInt(pvValue))
End If
Case CTLLISTBOX
If oSession.HasUNOProperty(_ControlModel, &quot;SelectedItems&quot;) Then _ControlModel.SelectedItems = Array(CInt(pvValue))
@@ -1595,7 +1595,7 @@ Const cstSubArgs = &quot;Value&quot;
, .TABLE _
, .TABLEFIELDS
Set oDatabase = _ParentForm.GetDatabase()
- If _ControlModel.ListSourceType = .QUERY Then vList = oDatabase.Queries Else vList = oDatabase.Tables
+ If _ControlModel.ListSourceType = .QUERY Then vList = oDatabase.Queries Else vList = oDatabase.Tables
If Not ScriptForge.SF_Utils._Validate(pvValue, psProperty, V_STRING, vList) Then Goto Finally
If _ControlType = CTLCOMBOBOX Then _ControlModel.ListSource = pvValue Else _ControlModel.ListSource = Array(pvValue)
_ControlModel.refresh()
@@ -1713,7 +1713,7 @@ Const cstSubArgs = &quot;Value&quot;
Case CTLCOMBOBOX
If oSession.HasUnoProperty(_ControlModel, &quot;Text&quot;) And oSession.HasUnoProperty(_ControlModel, &quot;StringItemList&quot;) Then
If pvValue &lt;&gt; &quot;&quot; Then
- If Not ScriptForge.SF_Utils._Validate(pvValue, &quot;Vamue&quot;, V_STRING, _ControlModel.StringItemList) Then Goto Finally
+ If Not ScriptForge.SF_Utils._Validate(pvValue, &quot;Value&quot;, V_STRING, _ControlModel.StringItemList) Then Goto Finally
End If
_ControlModel.Text = pvValue
End If
@@ -1805,7 +1805,8 @@ Finally:
Catch:
GoTo Finally
CatchType:
- ScriptForge.SF_Exception.RaiseFatal(CONTROLTYPEERROR, _Name, _FormName, _ControlType, psProperty)
+ If Len(_ParentForm._FormDocumentName) &gt; 0 Then sFormName = _ParentForm._FormDocumentName &amp; &quot;.&quot; Else sFormName = &quot;&quot;
+ ScriptForge.SF_Exception.RaiseFatal(FORMCONTROLTYPEERROR, _Name, sFormName &amp; _FormName, _ControlType, psProperty)
GoTo Finally
End Function &apos; SFDocuments.SF_FormControl._PropertySet