summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--wizards/source/access2base/Application.xba34
1 files changed, 34 insertions, 0 deletions
diff --git a/wizards/source/access2base/Application.xba b/wizards/source/access2base/Application.xba
index 70c98db9b192..7a76ed0ad70a 100644
--- a/wizards/source/access2base/Application.xba
+++ b/wizards/source/access2base/Application.xba
@@ -900,6 +900,40 @@ Error_Function:
End Function ' Forms V0.9.0
REM -----------------------------------------------------------------------------------------------------------------------
+Function HtmlEncode(ByVal pvString As Variant, ByVal Optional pvLength As Variant) As String
+' Converts a string to an HTML-encoded string.
+
+ If _ErrorHandler() Then On Local Error Goto Error_Function
+Const cstThisSub = "HtmlEncode"
+ Utils._SetCalledSub(cstThisSub)
+
+ HtmlEncode = ""
+
+Dim sOutput As String, l As Long, lLength As Long
+ If IsMissing(pvLength) Then pvLength = 0
+ If Not Utils._CheckArgument(pvString, 1, vbString) Then Goto Exit_Function
+ If Not Utils._CheckArgument(pvLength, 1, _AddNumeric()) Then Goto Exit_Function
+
+ sOutput = ""
+ lLength = CLng(pvLength)
+ If Len(pvString) > 0 Then
+ For l = 1 To Len(pvString)
+ If lLength > 0 And Len(sOutput) > lLength Then Exit For
+ sOutput = sOutput & Utils._UTF8Encode(Mid(pvString, l, 1)
+ Next l
+ End If
+
+ HtmlEncode = sOutput
+
+Exit_Function:
+ Utils._ResetCalledSub(cstThisSub)
+ Exit Function
+Error_Function:
+ TraceError(TRACEABORT, Err, cstThisSub, Erl)
+ GoTo Exit_Function
+End Function ' HtmlEncode V1.4.0
+
+REM -----------------------------------------------------------------------------------------------------------------------
Public Function OpenConnection ( _
Optional pvComponent As Variant _
, ByVal Optional pvUser As Variant _