[Libreoffice-commits] core.git: 2 commits - basic/qa basic/source include/basic solenv/bin
Jussi Pakkanen (via logerrit)
logerrit at kemper.freedesktop.org
Thu Apr 2 10:58:30 UTC 2020
basic/qa/basic_coverage/test_cverr_method.vb | 20 +++++
basic/qa/basic_coverage/test_ismissing_basic.vb | 38 +++-------
basic/qa/basic_coverage/test_ismissing_compatible.vb | 38 +++-------
basic/qa/basic_coverage/test_optional_paramters_basic.vb | 36 +++------
basic/qa/basic_coverage/test_optional_paramters_compatible.vb | 38 +++-------
basic/qa/vba_tests/cverr.vb | 11 ++
basic/qa/vba_tests/ismissing.vb | 36 ++-------
basic/qa/vba_tests/optional_paramters.vb | 36 ++-------
basic/source/inc/runtime.hxx | 5 +
basic/source/runtime/runtime.cxx | 38 ++++++++--
include/basic/sbxdef.hxx | 3
solenv/bin/desktop-translate.py | 12 +--
12 files changed, 152 insertions(+), 159 deletions(-)
New commits:
commit b9ba707ad95889db8e3dd04766aadc5d5c95cfaf
Author: Jussi Pakkanen <jpakkane at gmail.com>
AuthorDate: Wed Apr 1 19:24:03 2020 +0300
Commit: Jan-Marek Glogowski <glogow at fbihome.de>
CommitDate: Thu Apr 2 12:58:03 2020 +0200
Always treat desktop-translate files as utf-8.
Fixes a regression from commit
d2c23609083d7b3e5267b1e4c923476cbc509d00 ("tdf#130911: convert
desktop-translate from Perl to Python."), which breaks gallery
generation on some Windows machines. Python tries to decode the
utf-8 files with cp1252 on some machines and that fails with a
UnicodeDecodeError exception.
Change-Id: Ic82e5e3b2c21fc4b4bc32944ae7112bff14ccba1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91505
Tested-by: Jan-Marek Glogowski <glogow at fbihome.de>
Reviewed-by: Jan-Marek Glogowski <glogow at fbihome.de>
diff --git a/solenv/bin/desktop-translate.py b/solenv/bin/desktop-translate.py
index e0dbc3078082..3ae49ae576ee 100644
--- a/solenv/bin/desktop-translate.py
+++ b/solenv/bin/desktop-translate.py
@@ -22,7 +22,7 @@
# l10ntools/source/localize.cxx
#
-import os, sys, argparse
+import os, sys, argparse, io
parser = argparse.ArgumentParser()
parser.add_argument('-p', dest='productname', default='LibreOffice')
@@ -50,7 +50,7 @@ else:
templates = {}
# open input file
-source = open(o.ifile)
+source = io.open(o.ifile, encoding='utf-8')
template = None
@@ -99,7 +99,7 @@ for template in templates:
# open the template file - ignore sections for which no
# templates exist
try:
- template_file = open(outfilename)
+ template_file = io.open(outfilename, encoding='utf-8')
except Exception:
# string files processed one by one
if o.ext == 'str':
@@ -109,7 +109,7 @@ for template in templates:
# open output file
tmpfilename = '{}.tmp'.format(outfilename)
- outfile = open(tmpfilename, 'w')
+ outfile = io.open(tmpfilename, 'w', encoding='utf-8')
# emit the template to the output file
for line in template_file:
@@ -125,9 +125,9 @@ for template in templates:
# print "value is $value\n";
if value:
if o.ext == "desktop" or o.ext == "str":
- outfile.write("""{}[{}]={}\n""".format(outkey, locale, value))
+ outfile.write(u"""{}[{}]={}\n""".format(outkey, locale, value))
else:
- outfile.write("""\t[{}]{}={}\n""".format(locale, outkey, value))
+ outfile.write(u"""\t[{}]{}={}\n""".format(locale, outkey, value))
template_file.close()
commit 84b884135ee419fe7abfefa7b4b651a649cf9ad9
Author: Andreas Heinisch <andreas.heinisch at yahoo.de>
AuthorDate: Mon Mar 9 11:53:50 2020 +0100
Commit: Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Thu Apr 2 12:57:57 2020 +0200
tdf#79426, tdf#125180 - Don't convert missing parameters to requested type
If a particular parameter type is requested during the
construction of a parameter list, don't convert missing
parameters to avoid implicit casting to the specified
data type and value of the method.
Missing parameters are handled in StepEMPTY, where
additional information about missing parameters is added.
Change-Id: Ia413b2996d7d1feecedc1dfefaf6baf0fd9d917e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90215
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>
diff --git a/basic/qa/basic_coverage/test_cverr_method.vb b/basic/qa/basic_coverage/test_cverr_method.vb
index b1c3f8bec51c..f74445c20c6a 100644
--- a/basic/qa/basic_coverage/test_cverr_method.vb
+++ b/basic/qa/basic_coverage/test_cverr_method.vb
@@ -13,4 +13,24 @@ Function doUnitTest as Integer
Else
doUnitTest = 1
End If
+
+ ' tdf#79426 - passing an error object to a function
+ if ( TestCVErr( CVErr( 2 ) ) <> 2 ) Then
+ doUnitTest = 0
+ Else
+ doUnitTest = 1
+ End If
+
+ ' tdf#79426 - test with Error-Code 448 ( ERRCODE_BASIC_NAMED_NOT_FOUND )
+ if ( TestCVErr( CVErr( 448 ) ) <> 448 ) Then
+ doUnitTest = 0
+ Else
+ doUnitTest = 1
+ End If
End Function
+
+Function TestCVErr(vErr As Variant)
+ Dim nValue As Integer
+ nValue = vErr
+ TestCVErr = nValue
+End Function
\ No newline at end of file
diff --git a/basic/qa/basic_coverage/test_ismissing_basic.vb b/basic/qa/basic_coverage/test_ismissing_basic.vb
index 8705220e26d4..b838ce718c36 100644
--- a/basic/qa/basic_coverage/test_ismissing_basic.vb
+++ b/basic/qa/basic_coverage/test_ismissing_basic.vb
@@ -25,63 +25,55 @@ Function verify_testIsMissingBasic() As String
failCount = 0
result = "Test Results" & Chr$(10) & "============" & Chr$(10)
- testName = "Test optionals (Basic)"
+ testName = "Test missing (Basic)"
On Error GoTo errorHandler
' optionals with variant datatypes
TestLog_ASSERT TestOptVariant(), IsMissingAB, "TestOptVariant()"
TestLog_ASSERT TestOptVariant(123), IsMissingB, "TestOptVariant(123)"
- ' TODO - tdf#125180 for more details
- ' TestLog_ASSERT TestOptVariant(, 456), IsMissingA, "TestOptVariant(, 456)"
+ TestLog_ASSERT TestOptVariant(, 456), IsMissingA, "TestOptVariant(, 456)"
TestLog_ASSERT TestOptVariant(123, 456), IsMissingNone, "TestOptVariant(123, 456)"
' optionals with variant datatypes (ByRef and ByVal)
TestLog_ASSERT TestOptVariantByRefByVal(), IsMissingAB, "TestOptVariantByRefByVal()"
TestLog_ASSERT TestOptVariantByRefByVal(123), IsMissingB, "TestOptVariantByRefByVal(123)"
- ' TODO - tdf#125180 for more details
- ' TestLog_ASSERT TestOptVariantByRefByVal(, 456), IsMissingA, "TestOptVariantByRefByVal(, 456)"
+ TestLog_ASSERT TestOptVariantByRefByVal(, 456), IsMissingA, "TestOptVariantByRefByVal(, 456)"
TestLog_ASSERT TestOptVariantByRefByVal(123, 456), IsMissingNone, "TestOptVariantByRefByVal(123, 456)"
' optionals with double datatypes
TestLog_ASSERT TestOptDouble(), IsMissingAB, "TestOptDouble()"
TestLog_ASSERT TestOptDouble(123.4), IsMissingB, "TestOptDouble(123.4)"
- ' TODO - tdf#125180 for more details
- ' TestLog_ASSERT TestOptDouble(, 567.8), IsMissingA, "TestOptDouble(, 567.8)"
+ TestLog_ASSERT TestOptDouble(, 567.8), IsMissingA, "TestOptDouble(, 567.8)"
TestLog_ASSERT TestOptDouble(123.4, 567.8), IsMissingNone, "TestOptDouble(123.4, 567.8)"
' optionals with double datatypes (ByRef and ByVal)
TestLog_ASSERT TestOptDoubleByRefByVal(), IsMissingAB, "TestOptDouble()"
TestLog_ASSERT TestOptDoubleByRefByVal(123.4), IsMissingB, "TestOptDouble(123.4)"
- ' TODO - tdf#125180 for more details
- ' TestLog_ASSERT TestOptDoubleByRefByVal(, 567.8), IsMissingA, "TestOptDoubleByRefByVal(, 567.8)"
+ TestLog_ASSERT TestOptDoubleByRefByVal(, 567.8), IsMissingA, "TestOptDoubleByRefByVal(, 567.8)"
TestLog_ASSERT TestOptDoubleByRefByVal(123.4, 567.8), IsMissingNone, "TestOptDoubleByRefByVal(123.4, 567.8)"
' optionals with integer datatypes
TestLog_ASSERT TestOptInteger(), IsMissingAB, "TestOptInteger()"
TestLog_ASSERT TestOptInteger(123), IsMissingB, "TestOptInteger(123)"
- ' TODO - tdf#125180 for more details
- ' TestLog_ASSERT TestOptInteger(, 456), IsMissingA, "TestOptInteger(, 456)"
+ TestLog_ASSERT TestOptInteger(, 456), IsMissingA, "TestOptInteger(, 456)"
TestLog_ASSERT TestOptInteger(123, 456), IsMissingNone, "TestOptInteger(123, 456)"
' optionals with integer datatypes (ByRef and ByVal)
TestLog_ASSERT TestOptIntegerByRefByVal(), IsMissingAB, "TestOptIntegerByRefByVal()"
TestLog_ASSERT TestOptIntegerByRefByVal(123), IsMissingB, "TestOptIntegerByRefByVal(123)"
- ' TODO - tdf#125180 for more details
- ' TestLog_ASSERT TestOptIntegerByRefByVal(, 456), IsMissingA, "TestOptIntegerByRefByVal(, 456)"
+ TestLog_ASSERT TestOptIntegerByRefByVal(, 456), IsMissingA, "TestOptIntegerByRefByVal(, 456)"
TestLog_ASSERT TestOptIntegerByRefByVal(123, 456), IsMissingNone, "TestOptIntegerByRefByVal(123, 456)"
' optionals with string datatypes
TestLog_ASSERT TestOptString(), IsMissingAB, "TestOptString()"
TestLog_ASSERT TestOptString("123"), IsMissingB, "TestOptString(""123"")"
- ' TODO - tdf#125180 for more details
- ' TestLog_ASSERT TestOptString(, "456"), IsMissingA, "TestOptString(, ""456"")"
+ TestLog_ASSERT TestOptString(, "456"), IsMissingA, "TestOptString(, ""456"")"
TestLog_ASSERT TestOptString("123", "456"), IsMissingNone, "TestOptString(""123"", ""456"")"
' optionals with string datatypes (ByRef and ByVal)
TestLog_ASSERT TestOptStringByRefByVal(), IsMissingAB, "TestOptStringByRefByVal()"
TestLog_ASSERT TestOptStringByRefByVal("123"), IsMissingB, "TestOptStringByRefByVal(""123"")"
- ' TODO - tdf#125180 for more details
- ' TestLog_ASSERT TestOptStringByRefByVal(, "456"), IsMissingA, "TestOptStringByRefByVal(, ""456"")"
+ TestLog_ASSERT TestOptStringByRefByVal(, "456"), IsMissingA, "TestOptStringByRefByVal(, ""456"")"
TestLog_ASSERT TestOptStringByRefByVal("123", "456"), IsMissingNone, "TestOptStringByRefByVal(""123"", ""456"")"
' optionals with object datatypes
@@ -93,15 +85,13 @@ Function verify_testIsMissingBasic() As String
cB.Add (567.8)
TestLog_ASSERT TestOptObject(), IsMissingAB, "TestOptObject()"
TestLog_ASSERT TestOptObject(cA), IsMissingB, "TestOptObject(A)"
- ' TODO - tdf#125180 for more details
- ' TestLog_ASSERT TestOptObject(, cB), IsMissingA, "TestOptObject(, B)"
+ TestLog_ASSERT TestOptObject(, cB), IsMissingA, "TestOptObject(, B)"
TestLog_ASSERT TestOptObject(cA, cB), IsMissingNone, "TestOptObject(A, B)"
' optionals with object datatypes (ByRef and ByVal)
TestLog_ASSERT TestOptObjectByRefByVal(), IsMissingAB, "TestOptObjectByRefByVal()"
TestLog_ASSERT TestOptObjectByRefByVal(cA), IsMissingB, "TestOptObjectByRefByVal(A)"
- ' TODO - tdf#125180 for more details
- ' TestLog_ASSERT TestOptObjectByRefByVal(, cB), IsMissingA, "TestOptObjectByRefByVal(, B)"
+ TestLog_ASSERT TestOptObjectByRefByVal(, cB), IsMissingA, "TestOptObjectByRefByVal(, B)"
TestLog_ASSERT TestOptObjectByRefByVal(cA, cB), IsMissingNone, "TestOptObjectByRefByVal(A, B)"
' optionals with array datatypes
@@ -113,15 +103,13 @@ Function verify_testIsMissingBasic() As String
aB(1) = 567.8
TestLog_ASSERT TestOptArray(), IsMissingAB, "TestOptArray()"
TestLog_ASSERT TestOptArray(aA), IsMissingB, "TestOptArray(A)"
- ' TODO - tdf#125180 for more details
- 'TestLog_ASSERT TestOptArray(, aB), IsMissingA, "TestOptArray(, B)"
+ TestLog_ASSERT TestOptArray(, aB), IsMissingA, "TestOptArray(, B)"
TestLog_ASSERT TestOptArray(aA, aB), IsMissingNone, "TestOptArray(A, B)"
' optionals with array datatypes (ByRef and ByVal)
TestLog_ASSERT TestOptArrayByRefByVal(), IsMissingAB, "TestOptArrayByRefByVal()"
TestLog_ASSERT TestOptArrayByRefByVal(aA), IsMissingB, "TestOptArrayByRefByVal(A)"
- ' TODO - tdf#125180 for more details
- 'TestLog_ASSERT TestOptArrayByRefByVal(, aB), IsMissingA, "TestOptArrayByRefByVal(, B)"
+ TestLog_ASSERT TestOptArrayByRefByVal(, aB), IsMissingA, "TestOptArrayByRefByVal(, B)"
TestLog_ASSERT TestOptArrayByRefByVal(aA, aB), IsMissingNone, "TestOptArrayByRefByVal(A, B)"
result = result & Chr$(10) & "Tests passed: " & passCount & Chr$(10) & "Tests failed: " & failCount & Chr$(10)
diff --git a/basic/qa/basic_coverage/test_ismissing_compatible.vb b/basic/qa/basic_coverage/test_ismissing_compatible.vb
index 13f076d5bc30..dbe2a815d25d 100644
--- a/basic/qa/basic_coverage/test_ismissing_compatible.vb
+++ b/basic/qa/basic_coverage/test_ismissing_compatible.vb
@@ -28,63 +28,55 @@ Function verify_testIsMissingCompatible() As String
failCount = 0
result = "Test Results" & Chr$(10) & "============" & Chr$(10)
- testName = "Test optionals (Basic)"
+ testName = "Test missing (Compatible)"
On Error GoTo errorHandler
' optionals with variant datatypes
TestLog_ASSERT TestOptVariant(), IsMissingA, "TestOptVariant()"
TestLog_ASSERT TestOptVariant(123), IsMissingNone, "TestOptVariant(123)"
- ' TODO - tdf#125180 for more details
- ' TestLog_ASSERT TestOptVariant(, 456), IsMissingA, "TestOptVariant(, 456)"
+ TestLog_ASSERT TestOptVariant(, 456), IsMissingA, "TestOptVariant(, 456)"
TestLog_ASSERT TestOptVariant(123, 456), IsMissingNone, "TestOptVariant(123, 456)"
' optionals with variant datatypes (ByRef and ByVal)
TestLog_ASSERT TestOptVariantByRefByVal(), IsMissingA, "TestOptVariantByRefByVal()"
TestLog_ASSERT TestOptVariantByRefByVal(123), IsMissingNone, "TestOptVariantByRefByVal(123)"
- ' TODO - tdf#125180 for more details
- ' TestLog_ASSERT TestOptVariantByRefByVal(, 456), IsMissingA, "TestOptVariantByRefByVal(, 456)"
+ TestLog_ASSERT TestOptVariantByRefByVal(, 456), IsMissingA, "TestOptVariantByRefByVal(, 456)"
TestLog_ASSERT TestOptVariantByRefByVal(123, 456), IsMissingNone, "TestOptVariantByRefByVal(123, 456)"
' optionals with double datatypes
TestLog_ASSERT TestOptDouble(), IsMissingA, "TestOptDouble()"
TestLog_ASSERT TestOptDouble(123.4), IsMissingNone, "TestOptDouble(123.4)"
- ' TODO - tdf#125180 for more details
- ' TestLog_ASSERT TestOptDouble(, 567.8), IsMissingA, "TestOptDouble(, 567.8)"
+ TestLog_ASSERT TestOptDouble(, 567.8), IsMissingA, "TestOptDouble(, 567.8)"
TestLog_ASSERT TestOptDouble(123.4, 567.8), IsMissingNone, "TestOptDouble(123.4, 567.8)"
' optionals with double datatypes (ByRef and ByVal)
TestLog_ASSERT TestOptDoubleByRefByVal(), IsMissingA, "TestOptDouble()"
TestLog_ASSERT TestOptDoubleByRefByVal(123.4), IsMissingNone, "TestOptDouble(123.4)"
- ' TODO - tdf#125180 for more details
- ' TestLog_ASSERT TestOptDoubleByRefByVal(, 567.8), IsMissingA, "TestOptDoubleByRefByVal(, 567.8)"
+ TestLog_ASSERT TestOptDoubleByRefByVal(, 567.8), IsMissingA, "TestOptDoubleByRefByVal(, 567.8)"
TestLog_ASSERT TestOptDoubleByRefByVal(123.4, 567.8), IsMissingNone, "TestOptDoubleByRefByVal(123.4, 567.8)"
' optionals with integer datatypes
TestLog_ASSERT TestOptInteger(), IsMissingA, "TestOptInteger()"
TestLog_ASSERT TestOptInteger(123), IsMissingNone, "TestOptInteger(123)"
- ' TODO - tdf#125180 for more details
- ' TestLog_ASSERT TestOptInteger(, 456), IsMissingA, "TestOptInteger(, 456)"
+ TestLog_ASSERT TestOptInteger(, 456), IsMissingA, "TestOptInteger(, 456)"
TestLog_ASSERT TestOptInteger(123, 456), IsMissingNone, "TestOptInteger(123, 456)"
' optionals with integer datatypes (ByRef and ByVal)
TestLog_ASSERT TestOptIntegerByRefByVal(), IsMissingA, "TestOptIntegerByRefByVal()"
TestLog_ASSERT TestOptIntegerByRefByVal(123), IsMissingNone, "TestOptIntegerByRefByVal(123)"
- ' TODO - tdf#125180 for more details
- ' TestLog_ASSERT TestOptIntegerByRefByVal(, 456), IsMissingA, "TestOptIntegerByRefByVal(, 456)"
+ TestLog_ASSERT TestOptIntegerByRefByVal(, 456), IsMissingA, "TestOptIntegerByRefByVal(, 456)"
TestLog_ASSERT TestOptIntegerByRefByVal(123, 456), IsMissingNone, "TestOptIntegerByRefByVal(123, 456)"
' optionals with string datatypes
TestLog_ASSERT TestOptString(), IsMissingA, "TestOptString()"
TestLog_ASSERT TestOptString("123"), IsMissingNone, "TestOptString(""123"")"
- ' TODO - tdf#125180 for more details
- ' TestLog_ASSERT TestOptString(, "456"), IsMissingA, "TestOptString(, ""456"")"
+ TestLog_ASSERT TestOptString(, "456"), IsMissingA, "TestOptString(, ""456"")"
TestLog_ASSERT TestOptString("123", "456"), IsMissingNone, "TestOptString(""123"", ""456"")"
' optionals with string datatypes (ByRef and ByVal)
TestLog_ASSERT TestOptStringByRefByVal(), IsMissingA, "TestOptStringByRefByVal()"
TestLog_ASSERT TestOptStringByRefByVal("123"), IsMissingNone, "TestOptStringByRefByVal(""123"")"
- ' TODO - tdf#125180 for more details
- ' TestLog_ASSERT TestOptStringByRefByVal(, "456"), IsMissingA, "TestOptStringByRefByVal(, ""456"")"
+ TestLog_ASSERT TestOptStringByRefByVal(, "456"), IsMissingA, "TestOptStringByRefByVal(, ""456"")"
TestLog_ASSERT TestOptStringByRefByVal("123", "456"), IsMissingNone, "TestOptStringByRefByVal(""123"", ""456"")"
' optionals with object datatypes
@@ -96,15 +88,13 @@ Function verify_testIsMissingCompatible() As String
cB.Add (567.8)
TestLog_ASSERT TestOptObject(), IsMissingAB, "TestOptObject()"
TestLog_ASSERT TestOptObject(cA), IsMissingB, "TestOptObject(A)"
- ' TODO - tdf#125180 for more details
- ' TestLog_ASSERT TestOptObject(, cB), IsMissingA, "TestOptObject(, B)"
+ TestLog_ASSERT TestOptObject(, cB), IsMissingA, "TestOptObject(, B)"
TestLog_ASSERT TestOptObject(cA, cB), IsMissingNone, "TestOptObject(A, B)"
' optionals with object datatypes (ByRef and ByVal)
TestLog_ASSERT TestOptObjectByRefByVal(), IsMissingAB, "TestOptObjectByRefByVal()"
TestLog_ASSERT TestOptObjectByRefByVal(cA), IsMissingB, "TestOptObjectByRefByVal(A)"
- ' TODO - tdf#125180 for more details
- ' TestLog_ASSERT TestOptObjectByRefByVal(, cB), IsMissingA, "TestOptObjectByRefByVal(, B)"
+ TestLog_ASSERT TestOptObjectByRefByVal(, cB), IsMissingA, "TestOptObjectByRefByVal(, B)"
TestLog_ASSERT TestOptObjectByRefByVal(cA, cB), IsMissingNone, "TestOptObjectByRefByVal(A, B)"
' optionals with array datatypes
@@ -116,15 +106,13 @@ Function verify_testIsMissingCompatible() As String
aB(1) = 567.8
TestLog_ASSERT TestOptArray(), IsMissingAB, "TestOptArray()"
TestLog_ASSERT TestOptArray(aA), IsMissingB, "TestOptArray(A)"
- ' TODO - tdf#125180 for more details
- 'TestLog_ASSERT TestOptArray(, aB), IsMissingA, "TestOptArray(, B)"
+ TestLog_ASSERT TestOptArray(, aB), IsMissingA, "TestOptArray(, B)"
TestLog_ASSERT TestOptArray(aA, aB), IsMissingNone, "TestOptArray(A, B)"
' optionals with array datatypes (ByRef and ByVal)
TestLog_ASSERT TestOptArrayByRefByVal(), IsMissingAB, "TestOptArrayByRefByVal()"
TestLog_ASSERT TestOptArrayByRefByVal(aA), IsMissingB, "TestOptArrayByRefByVal(A)"
- ' TODO - tdf#125180 for more details
- 'TestLog_ASSERT TestOptArrayByRefByVal(, aB), IsMissingA, "TestOptArrayByRefByVal(, B)"
+ TestLog_ASSERT TestOptArrayByRefByVal(, aB), IsMissingA, "TestOptArrayByRefByVal(, B)"
TestLog_ASSERT TestOptArrayByRefByVal(aA, aB), IsMissingNone, "TestOptArrayByRefByVal(A, B)"
result = result & Chr$(10) & "Tests passed: " & passCount & Chr$(10) & "Tests failed: " & failCount & Chr$(10)
diff --git a/basic/qa/basic_coverage/test_optional_paramters_basic.vb b/basic/qa/basic_coverage/test_optional_paramters_basic.vb
index d260246508de..39aeb62b27a4 100644
--- a/basic/qa/basic_coverage/test_optional_paramters_basic.vb
+++ b/basic/qa/basic_coverage/test_optional_paramters_basic.vb
@@ -27,57 +27,49 @@ Function verify_testOptionalsBasic() As String
' optionals with variant datatypes
TestLog_ASSERT TestOptVariant(), 0, "TestOptVariant()"
TestLog_ASSERT TestOptVariant(123), 123, "TestOptVariant(123)"
- ' TODO - tdf#125180 for more details
- ' TestLog_ASSERT TestOptVariant(, 456), 456, "TestOptVariant(, 456)"
+ TestLog_ASSERT TestOptVariant(, 456), 456, "TestOptVariant(, 456)"
TestLog_ASSERT TestOptVariant(123, 456), 579, "TestOptVariant(123, 456)"
' optionals with variant datatypes (ByRef and ByVal)
TestLog_ASSERT TestOptVariantByRefByVal(), 0, "TestOptVariantByRefByVal()"
TestLog_ASSERT TestOptVariantByRefByVal(123), 123, "TestOptVariantByRefByVal(123)"
- ' TODO - tdf#125180 for more details
- ' TestLog_ASSERT TestOptVariantByRefByVal(, 456), 456, "TestOptVariantByRefByVal(, 456)"
+ TestLog_ASSERT TestOptVariantByRefByVal(, 456), 456, "TestOptVariantByRefByVal(, 456)"
TestLog_ASSERT TestOptVariantByRefByVal(123, 456), 579, "TestOptVariantByRefByVal(123, 456)"
' optionals with double datatypes
TestLog_ASSERT TestOptDouble(), 0, "TestOptDouble()"
TestLog_ASSERT TestOptDouble(123.4), 123.4, "TestOptDouble(123.4)"
- ' TODO - tdf#125180 for more details
- ' TestLog_ASSERT TestOptDouble(, 567.8), 567.8, "TestOptDouble(, 567.8)"
+ TestLog_ASSERT TestOptDouble(, 567.8), 567.8, "TestOptDouble(, 567.8)"
TestLog_ASSERT Format(TestOptDouble(123.4, 567.8), "0.0"), 691.2, "TestOptDouble(123.4, 567.8)"
' optionals with double datatypes (ByRef and ByVal)
TestLog_ASSERT TestOptDoubleByRefByVal(), 0, "TestOptDouble()"
TestLog_ASSERT TestOptDoubleByRefByVal(123.4), 123.4, "TestOptDouble(123.4)"
- ' TODO - tdf#125180 for more details
- ' TestLog_ASSERT TestOptDoubleByRefByVal(, 567.8), 567.8, "TestOptDoubleByRefByVal(, 567.8)"
+ TestLog_ASSERT TestOptDoubleByRefByVal(, 567.8), 567.8, "TestOptDoubleByRefByVal(, 567.8)"
TestLog_ASSERT Format(TestOptDoubleByRefByVal(123.4, 567.8), "0.0"), 691.2, "TestOptDoubleByRefByVal(123.4, 567.8)"
' optionals with integer datatypes
TestLog_ASSERT TestOptInteger(), 0, "TestOptInteger()"
TestLog_ASSERT TestOptInteger(123), 123, "TestOptInteger(123)"
- ' TODO - tdf#125180 for more details
- ' TestLog_ASSERT TestOptInteger(, 456), 456, "TestOptInteger(, 456)"
+ TestLog_ASSERT TestOptInteger(, 456), 456, "TestOptInteger(, 456)"
TestLog_ASSERT TestOptInteger(123, 456), 579, "TestOptInteger(123, 456)"
' optionals with integer datatypes (ByRef and ByVal)
TestLog_ASSERT TestOptIntegerByRefByVal(), 0, "TestOptIntegerByRefByVal()"
TestLog_ASSERT TestOptIntegerByRefByVal(123), 123, "TestOptIntegerByRefByVal(123)"
- ' TODO - tdf#125180 for more details
- ' TestLog_ASSERT TestOptIntegerByRefByVal(, 456), 456, "TestOptIntegerByRefByVal(, 456)"
+ TestLog_ASSERT TestOptIntegerByRefByVal(, 456), 456, "TestOptIntegerByRefByVal(, 456)"
TestLog_ASSERT TestOptIntegerByRefByVal(123, 456), 579, "TestOptIntegerByRefByVal(123, 456)"
' optionals with string datatypes
TestLog_ASSERT TestOptString(), "", "TestOptString()"
TestLog_ASSERT TestOptString("123"), "123", "TestOptString(""123"")"
- ' TODO - tdf#125180 for more details
- ' TestLog_ASSERT TestOptString(, "456"), "456", "TestOptString(, ""456"")"
+ TestLog_ASSERT TestOptString(, "456"), "456", "TestOptString(, ""456"")"
TestLog_ASSERT TestOptString("123", "456"), "123456", "TestOptString(""123"", ""456"")"
' optionals with string datatypes (ByRef and ByVal)
TestLog_ASSERT TestOptStringByRefByVal(), "", "TestOptStringByRefByVal()"
TestLog_ASSERT TestOptStringByRefByVal("123"), "123", "TestOptStringByRefByVal(""123"")"
- ' TODO - tdf#125180 for more details
- ' TestLog_ASSERT TestOptStringByRefByVal(, "456"), "456", "TestOptStringByRefByVal(, ""456"")"
+ TestLog_ASSERT TestOptStringByRefByVal(, "456"), "456", "TestOptStringByRefByVal(, ""456"")"
TestLog_ASSERT TestOptStringByRefByVal("123", "456"), "123456", "TestOptStringByRefByVal(""123"", ""456"")"
' optionals with object datatypes
@@ -89,15 +81,13 @@ Function verify_testOptionalsBasic() As String
cB.Add (567.8)
TestLog_ASSERT TestOptObject(), 0, "TestOptObject()"
TestLog_ASSERT TestOptObject(cA), 579, "TestOptObject(A)"
- ' TODO - tdf#125180 for more details
- ' TestLog_ASSERT Format(TestOptObject(, cB), "0.0"), 691.2, "TestOptObject(, B)"
+ TestLog_ASSERT Format(TestOptObject(, cB), "0.0"), 691.2, "TestOptObject(, B)"
TestLog_ASSERT Format(TestOptObject(cA, cB), "0.0"), 1270.2, "TestOptObject(A, B)"
' optionals with object datatypes (ByRef and ByVal)
TestLog_ASSERT TestOptObjectByRefByVal(), 0, "TestOptObjectByRefByVal()"
TestLog_ASSERT TestOptObjectByRefByVal(cA), 579, "TestOptObjectByRefByVal(A)"
- ' TODO - tdf#125180 for more details
- ' TestLog_ASSERT Format(TestOptObjectByRefByVal(, cB), "0.0"), 691.2, "TestOptObjectByRefByVal(, B)"
+ TestLog_ASSERT Format(TestOptObjectByRefByVal(, cB), "0.0"), 691.2, "TestOptObjectByRefByVal(, B)"
TestLog_ASSERT Format(TestOptObjectByRefByVal(cA, cB), "0.0"), 1270.2, "TestOptObjectByRefByVal(A, B)"
' optionals with array datatypes
@@ -109,15 +99,13 @@ Function verify_testOptionalsBasic() As String
aB(1) = 567.8
TestLog_ASSERT TestOptArray(), 0, "TestOptArray()"
TestLog_ASSERT TestOptArray(aA), 579, "TestOptArray(A)"
- ' TODO - tdf#125180 for more details
- 'TestLog_ASSERT Format(TestOptArray(, aB), "0.0"), 691.2, "TestOptArray(, B)"
+ TestLog_ASSERT Format(TestOptArray(, aB), "0.0"), 691.2, "TestOptArray(, B)"
TestLog_ASSERT Format(TestOptArray(aA, aB), "0.0"), 1270.2, "TestOptArray(A, B)"
' optionals with array datatypes (ByRef and ByVal)
TestLog_ASSERT TestOptArrayByRefByVal(), 0, "TestOptArrayByRefByVal()"
TestLog_ASSERT TestOptArrayByRefByVal(aA), 579, "TestOptArrayByRefByVal(A)"
- ' TODO - tdf#125180 for more details
- 'TestLog_ASSERT Format(TestOptArrayByRefByVal(, aB), "0.0"), 691.2, "TestOptArrayByRefByVal(, B)"
+ TestLog_ASSERT Format(TestOptArrayByRefByVal(, aB), "0.0"), 691.2, "TestOptArrayByRefByVal(, B)"
TestLog_ASSERT Format(TestOptArrayByRefByVal(aA, aB), "0.0"), 1270.2, "TestOptArrayByRefByVal(A, B)"
result = result & Chr$(10) & "Tests passed: " & passCount & Chr$(10) & "Tests failed: " & failCount & Chr$(10)
diff --git a/basic/qa/basic_coverage/test_optional_paramters_compatible.vb b/basic/qa/basic_coverage/test_optional_paramters_compatible.vb
index 5cbaeab258ad..15bfe77b827a 100644
--- a/basic/qa/basic_coverage/test_optional_paramters_compatible.vb
+++ b/basic/qa/basic_coverage/test_optional_paramters_compatible.vb
@@ -23,65 +23,57 @@ Function verify_testOptionalsCompatible() As String
failCount = 0
result = "Test Results" & Chr$(10) & "============" & Chr$(10)
- testName = "Test optionals (Basic)"
+ testName = "Test optionals (Compatible)"
On Error GoTo errorHandler
' optionals with variant datatypes
' TODO - New bug report? Scanner initializes variable as String. Function returns "123"
' TestLog_ASSERT TestOptVariant(), 123, "TestOptVariant()"
TestLog_ASSERT TestOptVariant(123), 246, "TestOptVariant(123)"
- ' TODO - tdf#125180 for more details
- ' TestLog_ASSERT TestOptVariant(, 456), 456, "TestOptVariant(, 456)"
+ TestLog_ASSERT TestOptVariant(, 456), 456, "TestOptVariant(, 456)"
TestLog_ASSERT TestOptVariant(123, 456), 579, "TestOptVariant(123, 456)"
' optionals with variant datatypes (ByRef and ByVal)
' TODO - New bug report? Scanner initializes variable as String. Function returns "123"
' TestLog_ASSERT TestOptVariantByRefByVal(), 123, "TestOptVariantByRefByVal()"
TestLog_ASSERT TestOptVariantByRefByVal(123), 246, "TestOptVariantByRefByVal(123)"
- ' TODO - tdf#125180 for more details
- ' TestLog_ASSERT TestOptVariantByRefByVal(, 456), 456, "TestOptVariantByRefByVal(, 456)"
+ TestLog_ASSERT TestOptVariantByRefByVal(, 456), 456, "TestOptVariantByRefByVal(, 456)"
TestLog_ASSERT TestOptVariantByRefByVal(123, 456), 579, "TestOptVariantByRefByVal(123, 456)"
' optionals with double datatypes
TestLog_ASSERT TestOptDouble(), 123.4, "TestOptDouble()"
TestLog_ASSERT TestOptDouble(123.4), 246.8, "TestOptDouble(123.4)"
- ' TODO - tdf#125180 for more details
- ' TestLog_ASSERT TestOptDouble(, 567.8), 567.8, "TestOptDouble(, 567.8)"
+ TestLog_ASSERT TestOptDouble(, 567.8), 567.8, "TestOptDouble(, 567.8)"
TestLog_ASSERT Format(TestOptDouble(123.4, 567.8), "0.0"), 691.2, "TestOptDouble(123.4, 567.8)"
' optionals with double datatypes (ByRef and ByVal)
TestLog_ASSERT TestOptDoubleByRefByVal(), 123.4, "TestOptDouble()"
TestLog_ASSERT TestOptDoubleByRefByVal(123.4), 246.8, "TestOptDouble(123.4)"
- ' TODO - tdf#125180 for more details
- ' TestLog_ASSERT TestOptDoubleByRefByVal(, 567.8), 567.8, "TestOptDoubleByRefByVal(, 567.8)"
+ TestLog_ASSERT TestOptDoubleByRefByVal(, 567.8), 567.8, "TestOptDoubleByRefByVal(, 567.8)"
TestLog_ASSERT Format(TestOptDoubleByRefByVal(123.4, 567.8), "0.0"), 691.2, "TestOptDoubleByRefByVal(123.4, 567.8)"
' optionals with integer datatypes
TestLog_ASSERT TestOptInteger(), 123, "TestOptInteger()"
TestLog_ASSERT TestOptInteger(123), 246, "TestOptInteger(123)"
- ' TODO - tdf#125180 for more details
- ' TestLog_ASSERT TestOptInteger(, 456), 456, "TestOptInteger(, 456)"
+ TestLog_ASSERT TestOptInteger(, 456), 456, "TestOptInteger(, 456)"
TestLog_ASSERT TestOptInteger(123, 456), 579, "TestOptInteger(123, 456)"
' optionals with integer datatypes (ByRef and ByVal)
TestLog_ASSERT TestOptIntegerByRefByVal(), 123, "TestOptIntegerByRefByVal()"
TestLog_ASSERT TestOptIntegerByRefByVal(123), 246, "TestOptIntegerByRefByVal(123)"
- ' TODO - tdf#125180 for more details
- ' TestLog_ASSERT TestOptIntegerByRefByVal(, 456), 456, "TestOptIntegerByRefByVal(, 456)"
+ TestLog_ASSERT TestOptIntegerByRefByVal(, 456), 456, "TestOptIntegerByRefByVal(, 456)"
TestLog_ASSERT TestOptIntegerByRefByVal(123, 456), 579, "TestOptIntegerByRefByVal(123, 456)"
' optionals with string datatypes
TestLog_ASSERT TestOptString(), "123", "TestOptString()"
TestLog_ASSERT TestOptString("123"), "123123", "TestOptString(""123"")"
- ' TODO - tdf#125180 for more details
- ' TestLog_ASSERT TestOptString(, "456"), "456", "TestOptString(, ""456"")"
+ TestLog_ASSERT TestOptString(, "456"), "456", "TestOptString(, ""456"")"
TestLog_ASSERT TestOptString("123", "456"), "123456", "TestOptString(""123"", ""456"")"
' optionals with string datatypes (ByRef and ByVal)
TestLog_ASSERT TestOptStringByRefByVal(), "123", "TestOptStringByRefByVal()"
TestLog_ASSERT TestOptStringByRefByVal("123"), "123123", "TestOptStringByRefByVal(""123"")"
- ' TODO - tdf#125180 for more details
- ' TestLog_ASSERT TestOptStringByRefByVal(, "456"), "456", "TestOptStringByRefByVal(, ""456"")"
+ TestLog_ASSERT TestOptStringByRefByVal(, "456"), "456", "TestOptStringByRefByVal(, ""456"")"
TestLog_ASSERT TestOptStringByRefByVal("123", "456"), "123456", "TestOptStringByRefByVal(""123"", ""456"")"
' optionals with object datatypes
@@ -93,15 +85,13 @@ Function verify_testOptionalsCompatible() As String
cB.Add (567.8)
TestLog_ASSERT TestOptObject(), 0, "TestOptObject()"
TestLog_ASSERT TestOptObject(cA), 579, "TestOptObject(A)"
- ' TODO - tdf#125180 for more details
- ' TestLog_ASSERT Format(TestOptObject(, cB), "0.0"), 691.2, "TestOptObject(, B)"
+ TestLog_ASSERT Format(TestOptObject(, cB), "0.0"), 691.2, "TestOptObject(, B)"
TestLog_ASSERT Format(TestOptObject(cA, cB), "0.0"), 1270.2, "TestOptObject(A, B)"
' optionals with object datatypes (ByRef and ByVal)
TestLog_ASSERT TestOptObjectByRefByVal(), 0, "TestOptObjectByRefByVal()"
TestLog_ASSERT TestOptObjectByRefByVal(cA), 579, "TestOptObjectByRefByVal(A)"
- ' TODO - tdf#125180 for more details
- ' TestLog_ASSERT Format(TestOptObjectByRefByVal(, cB), "0.0"), 691.2, "TestOptObjectByRefByVal(, B)"
+ TestLog_ASSERT Format(TestOptObjectByRefByVal(, cB), "0.0"), 691.2, "TestOptObjectByRefByVal(, B)"
TestLog_ASSERT Format(TestOptObjectByRefByVal(cA, cB), "0.0"), 1270.2, "TestOptObjectByRefByVal(A, B)"
' optionals with array datatypes
@@ -113,15 +103,13 @@ Function verify_testOptionalsCompatible() As String
aB(1) = 567.8
TestLog_ASSERT TestOptArray(), 0, "TestOptArray()"
TestLog_ASSERT TestOptArray(aA), 579, "TestOptArray(A)"
- ' TODO - tdf#125180 for more details
- 'TestLog_ASSERT Format(TestOptArray(, aB), "0.0"), 691.2, "TestOptArray(, B)"
+ TestLog_ASSERT Format(TestOptArray(, aB), "0.0"), 691.2, "TestOptArray(, B)"
TestLog_ASSERT Format(TestOptArray(aA, aB), "0.0"), 1270.2, "TestOptArray(A, B)"
' optionals with array datatypes (ByRef and ByVal)
TestLog_ASSERT TestOptArrayByRefByVal(), 0, "TestOptArrayByRefByVal()"
TestLog_ASSERT TestOptArrayByRefByVal(aA), 579, "TestOptArrayByRefByVal(A)"
- ' TODO - tdf#125180 for more details
- 'TestLog_ASSERT Format(TestOptArrayByRefByVal(, aB), "0.0"), 691.2, "TestOptArrayByRefByVal(, B)"
+ TestLog_ASSERT Format(TestOptArrayByRefByVal(, aB), "0.0"), 691.2, "TestOptArrayByRefByVal(, B)"
TestLog_ASSERT Format(TestOptArrayByRefByVal(aA, aB), "0.0"), 1270.2, "TestOptArrayByRefByVal(A, B)"
result = result & Chr$(10) & "Tests passed: " & passCount & Chr$(10) & "Tests failed: " & failCount & Chr$(10)
diff --git a/basic/qa/vba_tests/cverr.vb b/basic/qa/vba_tests/cverr.vb
index 11707ba2517c..4aa646ae87a8 100644
--- a/basic/qa/vba_tests/cverr.vb
+++ b/basic/qa/vba_tests/cverr.vb
@@ -59,6 +59,11 @@ Function verify_testCVErr() As String
date1 = CStr(CVErr(xlErrValue))
TestLog_ASSERT date1 = date2, "the return CVErr is: " & date1
+ ' tdf#79426 - passing an error object to a function
+ TestLog_ASSERT TestCVErr( CVErr( 2 ) ) = 2
+ ' tdf#79426 - test with Error-Code 448 ( ERRCODE_BASIC_NAMED_NOT_FOUND )
+ TestLog_ASSERT TestCVErr( CVErr( 448 ) ) = 448
+
result = result & Chr$(10) & "Tests passed: " & passCount & Chr$(10) & "Tests failed: " & failCount & Chr$(10)
verify_testCVErr = result
@@ -67,6 +72,12 @@ errorHandler:
TestLog_ASSERT (False), testName & ": hit error handler"
End Function
+Function TestCVErr(vErr As Variant)
+ Dim nValue As Integer
+ nValue = vErr
+ TestCVErr = nValue
+End Function
+
Sub TestLog_ASSERT(assertion As Boolean, Optional testId As String, Optional testComment As String)
If assertion = True Then
diff --git a/basic/qa/vba_tests/ismissing.vb b/basic/qa/vba_tests/ismissing.vb
index 1adc73441c22..623c153d4d72 100644
--- a/basic/qa/vba_tests/ismissing.vb
+++ b/basic/qa/vba_tests/ismissing.vb
@@ -29,63 +29,55 @@ Function verify_testIsMissingVba() As String
failCount = 0
result = "Test Results" & Chr$(10) & "============" & Chr$(10)
- testName = "Test optionals (Basic)"
+ testName = "Test missing (VBA)"
On Error GoTo errorHandler
' optionals with variant datatypes
TestLog_ASSERT TestOptVariant(), IsMissingA, "TestOptVariant()"
TestLog_ASSERT TestOptVariant(123), IsMissingNone, "TestOptVariant(123)"
- ' TODO - tdf#125180 for more details
- ' TestLog_ASSERT TestOptVariant(, 456), IsMissingNone, "TestOptVariant(, 456)"
+ TestLog_ASSERT TestOptVariant(, 456), IsMissingA, "TestOptVariant(, 456)"
TestLog_ASSERT TestOptVariant(123, 456), IsMissingNone, "TestOptVariant(123, 456)"
' optionals with variant datatypes (ByRef and ByVal)
TestLog_ASSERT TestOptVariantByRefByVal(), IsMissingA, "TestOptVariantByRefByVal()"
TestLog_ASSERT TestOptVariantByRefByVal(123),IsMissingNone, "TestOptVariantByRefByVal(123)"
- ' TODO - tdf#125180 for more details
- ' TestLog_ASSERT TestOptVariantByRefByVal(, 456), IsMissingNone, "TestOptVariantByRefByVal(, 456)"
+ TestLog_ASSERT TestOptVariantByRefByVal(, 456), IsMissingA, "TestOptVariantByRefByVal(, 456)"
TestLog_ASSERT TestOptVariantByRefByVal(123, 456), IsMissingNone, "TestOptVariantByRefByVal(123, 456)"
' optionals with double datatypes
TestLog_ASSERT TestOptDouble(), IsMissingNone, "TestOptDouble()"
TestLog_ASSERT TestOptDouble(123.4), IsMissingNone, "TestOptDouble(123.4)"
- ' TODO - tdf#125180 for more details
- ' TestLog_ASSERT TestOptDouble(, 567.8), IsMissingNone, "TestOptDouble(, 567.8)"
+ TestLog_ASSERT TestOptDouble(, 567.8), IsMissingNone, "TestOptDouble(, 567.8)"
TestLog_ASSERT TestOptDouble(123.4, 567.8), IsMissingNone, "TestOptDouble(123.4, 567.8)"
' optionals with double datatypes (ByRef and ByVal)
TestLog_ASSERT TestOptDoubleByRefByVal(), IsMissingNone, "TestOptDouble()"
TestLog_ASSERT TestOptDoubleByRefByVal(123.4), IsMissingNone, "TestOptDouble(123.4)"
- ' TODO - tdf#125180 for more details
- ' TestLog_ASSERT TestOptDoubleByRefByVal(, 567.8), IsMissingNone, "TestOptDoubleByRefByVal(, 567.8)"
+ TestLog_ASSERT TestOptDoubleByRefByVal(, 567.8), IsMissingNone, "TestOptDoubleByRefByVal(, 567.8)"
TestLog_ASSERT TestOptDoubleByRefByVal(123.4, 567.8), IsMissingNone, "TestOptDoubleByRefByVal(123.4, 567.8)"
' optionals with integer datatypes
TestLog_ASSERT TestOptInteger(), IsMissingNone, "TestOptInteger()"
TestLog_ASSERT TestOptInteger(123), IsMissingNone, "TestOptInteger(123)"
- ' TODO - tdf#125180 for more details
- ' TestLog_ASSERT TestOptInteger(, 456), IsMissingNone, "TestOptInteger(, 456)"
+ TestLog_ASSERT TestOptInteger(, 456), IsMissingNone, "TestOptInteger(, 456)"
TestLog_ASSERT TestOptInteger(123, 456), IsMissingNone, "TestOptInteger(123, 456)"
' optionals with integer datatypes (ByRef and ByVal)
TestLog_ASSERT TestOptIntegerByRefByVal(), IsMissingNone, "TestOptIntegerByRefByVal()"
TestLog_ASSERT TestOptIntegerByRefByVal(123), IsMissingNone, "TestOptIntegerByRefByVal(123)"
- ' TODO - tdf#125180 for more details
- ' TestLog_ASSERT TestOptIntegerByRefByVal(, 456), IsMissingNone, "TestOptIntegerByRefByVal(, 456)"
+ TestLog_ASSERT TestOptIntegerByRefByVal(, 456), IsMissingNone, "TestOptIntegerByRefByVal(, 456)"
TestLog_ASSERT TestOptIntegerByRefByVal(123, 456), IsMissingNone, "TestOptIntegerByRefByVal(123, 456)"
' optionals with string datatypes
TestLog_ASSERT TestOptString(), IsMissingNone, "TestOptString()"
TestLog_ASSERT TestOptString("123"), IsMissingNone, "TestOptString(""123"")"
- ' TODO - tdf#125180 for more details
- ' TestLog_ASSERT TestOptString(, "456"), IsMissingNone, "TestOptString(, ""456"")"
+ TestLog_ASSERT TestOptString(, "456"), IsMissingNone, "TestOptString(, ""456"")"
TestLog_ASSERT TestOptString("123", "456"), IsMissingNone, "TestOptString(""123"", ""456"")"
' optionals with string datatypes (ByRef and ByVal)
TestLog_ASSERT TestOptStringByRefByVal(), IsMissingNone, "TestOptStringByRefByVal()"
TestLog_ASSERT TestOptStringByRefByVal("123"), IsMissingNone, "TestOptStringByRefByVal(""123"")"
- ' TODO - tdf#125180 for more details
- ' TestLog_ASSERT TestOptStringByRefByVal(, "456"), IsMissingNone, "TestOptStringByRefByVal(, ""456"")"
+ TestLog_ASSERT TestOptStringByRefByVal(, "456"), IsMissingNone, "TestOptStringByRefByVal(, ""456"")"
TestLog_ASSERT TestOptStringByRefByVal("123", "456"), IsMissingNone, "TestOptStringByRefByVal(""123"", ""456"")"
' optionals with object datatypes
@@ -97,15 +89,13 @@ Function verify_testIsMissingVba() As String
cB.Add (567.8)
TestLog_ASSERT TestOptObject(), IsMissingAB, "TestOptObject()"
TestLog_ASSERT TestOptObject(cA), IsMissingB, "TestOptObject(A)"
- ' TODO - tdf#125180 for more details
- ' TestLog_ASSERT TestOptObject(, cB), IsMissingA, "TestOptObject(, B)"
+ TestLog_ASSERT TestOptObject(, cB), IsMissingA, "TestOptObject(, B)"
TestLog_ASSERT TestOptObject(cA, cB), IsMissingNone, "TestOptObject(A, B)"
' optionals with object datatypes (ByRef and ByVal)
TestLog_ASSERT TestOptObjectByRefByVal(), IsMissingAB, "TestOptObjectByRefByVal()"
TestLog_ASSERT TestOptObjectByRefByVal(cA), IsMissingB, "TestOptObjectByRefByVal(A)"
- ' TODO - tdf#125180 for more details
- ' TestLog_ASSERT TestOptObjectByRefByVal(, cB), IsMissingA, "TestOptObjectByRefByVal(, B)"
+ TestLog_ASSERT TestOptObjectByRefByVal(, cB), IsMissingA, "TestOptObjectByRefByVal(, B)"
TestLog_ASSERT TestOptObjectByRefByVal(cA, cB), IsMissingNone, "TestOptObjectByRefByVal(A, B)"
' optionals with array datatypes
@@ -118,8 +108,6 @@ Function verify_testIsMissingVba() As String
' TODO - New bug report? Scanner initializes variable not as an array
' TestLog_ASSERT TestOptArray(), IsMissingAB, "TestOptArray()"
' TestLog_ASSERT TestOptArray(aA), IsMissingB, "TestOptArray(A)"
-
- ' TODO - tdf#125180 for more details
' TestLog_ASSERT TestOptArray(, aB), IsMissingA, "TestOptArray(, B)"
TestLog_ASSERT TestOptArray(aA, aB), IsMissingNone, "TestOptArray(A, B)"
@@ -127,8 +115,6 @@ Function verify_testIsMissingVba() As String
' TODO - New bug report? Scanner initializes variable not as an array
' TestLog_ASSERT TestOptArrayByRefByVal(), IsMissingAB, "TestOptArrayByRefByVal()"
' TestLog_ASSERT TestOptArrayByRefByVal(aA), IsMissingB, "TestOptArrayByRefByVal(A)"
-
- ' TODO - tdf#125180 for more details
' TestLog_ASSERT TestOptArrayByRefByVal(, aB), IsMissingA, "TestOptArrayByRefByVal(, B)"
TestLog_ASSERT TestOptArrayByRefByVal(aA, aB), IsMissingNone, "TestOptArrayByRefByVal(A, B)"
diff --git a/basic/qa/vba_tests/optional_paramters.vb b/basic/qa/vba_tests/optional_paramters.vb
index eff8275d0e63..a8716c16c95e 100644
--- a/basic/qa/vba_tests/optional_paramters.vb
+++ b/basic/qa/vba_tests/optional_paramters.vb
@@ -24,65 +24,57 @@ Function verify_testOptionalsVba() As String
failCount = 0
result = "Test Results" & Chr$(10) & "============" & Chr$(10)
- testName = "Test optionals (Basic)"
+ testName = "Test optionals (VBA)"
On Error GoTo errorHandler
' optionals with variant datatypes
' TODO - New bug report? Scanner initializes variable as String. Function returns "123"
' TestLog_ASSERT TestOptVariant(), 123, "TestOptVariant()"
TestLog_ASSERT TestOptVariant(123), 246, "TestOptVariant(123)"
- ' TODO - tdf#125180 for more details
- ' TestLog_ASSERT TestOptVariant(, 456), 456, "TestOptVariant(, 456)"
+ TestLog_ASSERT TestOptVariant(, 456), 456, "TestOptVariant(, 456)"
TestLog_ASSERT TestOptVariant(123, 456), 579, "TestOptVariant(123, 456)"
' optionals with variant datatypes (ByRef and ByVal)
' TODO - New bug report? Scanner initializes variable as String. Function returns "123"
' TestLog_ASSERT TestOptVariantByRefByVal(), 123, "TestOptVariantByRefByVal()"
TestLog_ASSERT TestOptVariantByRefByVal(123), 246, "TestOptVariantByRefByVal(123)"
- ' TODO - tdf#125180 for more details
- ' TestLog_ASSERT TestOptVariantByRefByVal(, 456), 456, "TestOptVariantByRefByVal(, 456)"
+ TestLog_ASSERT TestOptVariantByRefByVal(, 456), 456, "TestOptVariantByRefByVal(, 456)"
TestLog_ASSERT TestOptVariantByRefByVal(123, 456), 579, "TestOptVariantByRefByVal(123, 456)"
' optionals with double datatypes
TestLog_ASSERT TestOptDouble(), 123.4, "TestOptDouble()"
TestLog_ASSERT TestOptDouble(123.4), 246.8, "TestOptDouble(123.4)"
- ' TODO - tdf#125180 for more details
- ' TestLog_ASSERT TestOptDouble(, 567.8), 567.8, "TestOptDouble(, 567.8)"
+ TestLog_ASSERT TestOptDouble(, 567.8), 567.8, "TestOptDouble(, 567.8)"
TestLog_ASSERT Format(TestOptDouble(123.4, 567.8), "0.0"), 691.2, "TestOptDouble(123.4, 567.8)"
' optionals with double datatypes (ByRef and ByVal)
TestLog_ASSERT TestOptDoubleByRefByVal(), 123.4, "TestOptDouble()"
TestLog_ASSERT TestOptDoubleByRefByVal(123.4), 246.8, "TestOptDouble(123.4)"
- ' TODO - tdf#125180 for more details
- ' TestLog_ASSERT TestOptDoubleByRefByVal(, 567.8), 567.8, "TestOptDoubleByRefByVal(, 567.8)"
+ TestLog_ASSERT TestOptDoubleByRefByVal(, 567.8), 567.8, "TestOptDoubleByRefByVal(, 567.8)"
TestLog_ASSERT Format(TestOptDoubleByRefByVal(123.4, 567.8), "0.0"), 691.2, "TestOptDoubleByRefByVal(123.4, 567.8)"
' optionals with integer datatypes
TestLog_ASSERT TestOptInteger(), 123, "TestOptInteger()"
TestLog_ASSERT TestOptInteger(123), 246, "TestOptInteger(123)"
- ' TODO - tdf#125180 for more details
- ' TestLog_ASSERT TestOptInteger(, 456), 456, "TestOptInteger(, 456)"
+ TestLog_ASSERT TestOptInteger(, 456), 456, "TestOptInteger(, 456)"
TestLog_ASSERT TestOptInteger(123, 456), 579, "TestOptInteger(123, 456)"
' optionals with integer datatypes (ByRef and ByVal)
TestLog_ASSERT TestOptIntegerByRefByVal(), 123, "TestOptIntegerByRefByVal()"
TestLog_ASSERT TestOptIntegerByRefByVal(123), 246, "TestOptIntegerByRefByVal(123)"
- ' TODO - tdf#125180 for more details
- ' TestLog_ASSERT TestOptIntegerByRefByVal(, 456), 456, "TestOptIntegerByRefByVal(, 456)"
+ TestLog_ASSERT TestOptIntegerByRefByVal(, 456), 456, "TestOptIntegerByRefByVal(, 456)"
TestLog_ASSERT TestOptIntegerByRefByVal(123, 456), 579, "TestOptIntegerByRefByVal(123, 456)"
' optionals with string datatypes
TestLog_ASSERT TestOptString(), "123", "TestOptString()"
TestLog_ASSERT TestOptString("123"), "123123", "TestOptString(""123"")"
- ' TODO - tdf#125180 for more details
- ' TestLog_ASSERT TestOptString(, "456"), "456", "TestOptString(, ""456"")"
+ TestLog_ASSERT TestOptString(, "456"), "456", "TestOptString(, ""456"")"
TestLog_ASSERT TestOptString("123", "456"), "123456", "TestOptString(""123"", ""456"")"
' optionals with string datatypes (ByRef and ByVal)
TestLog_ASSERT TestOptStringByRefByVal(), "123", "TestOptStringByRefByVal()"
TestLog_ASSERT TestOptStringByRefByVal("123"), "123123", "TestOptStringByRefByVal(""123"")"
- ' TODO - tdf#125180 for more details
- ' TestLog_ASSERT TestOptStringByRefByVal(, "456"), "456", "TestOptStringByRefByVal(, ""456"")"
+ TestLog_ASSERT TestOptStringByRefByVal(, "456"), "456", "TestOptStringByRefByVal(, ""456"")"
TestLog_ASSERT TestOptStringByRefByVal("123", "456"), "123456", "TestOptStringByRefByVal(""123"", ""456"")"
' optionals with object datatypes
@@ -94,15 +86,13 @@ Function verify_testOptionalsVba() As String
cB.Add (567.8)
TestLog_ASSERT TestOptObject(), 0, "TestOptObject()"
TestLog_ASSERT TestOptObject(cA), 579, "TestOptObject(A)"
- ' TODO - tdf#125180 for more details
- ' TestLog_ASSERT Format(TestOptObject(, cB), "0.0"), 691.2, "TestOptObject(, B)"
+ TestLog_ASSERT Format(TestOptObject(, cB), "0.0"), 691.2, "TestOptObject(, B)"
TestLog_ASSERT Format(TestOptObject(cA, cB), "0.0"), 1270.2, "TestOptObject(A, B)"
' optionals with object datatypes (ByRef and ByVal)
TestLog_ASSERT TestOptObjectByRefByVal(), 0, "TestOptObjectByRefByVal()"
TestLog_ASSERT TestOptObjectByRefByVal(cA), 579, "TestOptObjectByRefByVal(A)"
- ' TODO - tdf#125180 for more details
- ' TestLog_ASSERT Format(TestOptObjectByRefByVal(, cB), "0.0"), 691.2, "TestOptObjectByRefByVal(, B)"
+ TestLog_ASSERT Format(TestOptObjectByRefByVal(, cB), "0.0"), 691.2, "TestOptObjectByRefByVal(, B)"
TestLog_ASSERT Format(TestOptObjectByRefByVal(cA, cB), "0.0"), 1270.2, "TestOptObjectByRefByVal(A, B)"
' optionals with array datatypes
@@ -115,8 +105,6 @@ Function verify_testOptionalsVba() As String
' TODO - New bug report? Scanner initializes variable not as an array
' TestLog_ASSERT TestOptArray(), 0, "TestOptArray()"
' TestLog_ASSERT TestOptArray(aA), 579, "TestOptArray(A)"
-
- ' TODO - tdf#125180 for more details
' TestLog_ASSERT Format(TestOptArray(, aB), "0.0"), 691.2, "TestOptArray(, B)"
TestLog_ASSERT Format(TestOptArray(aA, aB), "0.0"), 1270.2, "TestOptArray(A, B)"
@@ -124,8 +112,6 @@ Function verify_testOptionalsVba() As String
' TODO - New bug report? Scanner initializes variable not as an array
' TestLog_ASSERT TestOptArrayByRefByVal(), 0, "TestOptArrayByRefByVal()"
' TestLog_ASSERT TestOptArrayByRefByVal(aA), 579, "TestOptArrayByRefByVal(A)"
-
- ' TODO - tdf#125180 for more details
' TestLog_ASSERT Format(TestOptArrayByRefByVal(, aB), "0.0"), 691.2, "TestOptArrayByRefByVal(, B)"
TestLog_ASSERT Format(TestOptArrayByRefByVal(aA, aB), "0.0"), 1270.2, "TestOptArrayByRefByVal(A, B)"
diff --git a/basic/source/inc/runtime.hxx b/basic/source/inc/runtime.hxx
index 1b0a3309367d..3b59a5b18341 100644
--- a/basic/source/inc/runtime.hxx
+++ b/basic/source/inc/runtime.hxx
@@ -348,6 +348,11 @@ public:
sal_Int32 nLine,nCol1,nCol2;
SbiRuntime* pNext; // Stack-Chain
+ // tdf#79426, tdf#125180 - adds the information about a missing parameter
+ static void SetIsMissing( SbxVariable* );
+ // tdf#79426, tdf#125180 - checks if a variable contains the information about a missing parameter
+ static bool IsMissing( SbxVariable*, sal_uInt16 );
+
SbiRuntime( SbModule*, SbMethod*, sal_uInt32 );
~SbiRuntime();
void Error( ErrCode, bool bVBATranslationAlreadyDone = false ); // set error if != 0
diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx
index 15b45ec736a0..279f26f48971 100644
--- a/basic/source/runtime/runtime.cxx
+++ b/basic/source/runtime/runtime.cxx
@@ -621,6 +621,20 @@ void SbiRuntime::SetVBAEnabled(bool bEnabled )
}
}
+// tdf#79426, tdf#125180 - adds the information about a missing parameter
+void SbiRuntime::SetIsMissing( SbxVariable* pVar )
+{
+ SbxInfo* pInfo = pVar->GetInfo() ? pVar->GetInfo() : new SbxInfo();
+ pInfo->AddParam( pVar->GetName(), SbxMISSING, pVar->GetFlags() );
+ pVar->SetInfo( pInfo );
+}
+
+// tdf#79426, tdf#125180 - checks if a variable contains the information about a missing parameter
+bool SbiRuntime::IsMissing( SbxVariable* pVar, sal_uInt16 nIdx )
+{
+ return pVar->GetInfo() && pVar->GetInfo()->GetParam( nIdx ) && pVar->GetInfo()->GetParam( nIdx )->eType & SbxMISSING;
+}
+
// Construction of the parameter list. All ByRef-parameters are directly
// taken over; copies of ByVal-parameters are created. If a particular
// data type is requested, it is converted.
@@ -671,7 +685,11 @@ void SbiRuntime::SetParameters( SbxArray* pParams )
if( p )
{
bByVal |= ( p->eType & SbxBYREF ) == 0;
- t = static_cast<SbxDataType>( p->eType & 0x0FFF );
+ // tdf#79426, tdf#125180 - don't convert missing arguments to the requested parameter type
+ if ( t != SbxEMPTY && !IsMissing( v, 1 ) )
+ {
+ t = static_cast<SbxDataType>( p->eType & 0x0FFF );
+ }
if( !bByVal && t != SbxVARIANT &&
(!v->IsFixed() || static_cast<SbxDataType>(v->GetType() & 0x0FFF ) != t) )
@@ -683,18 +701,25 @@ void SbiRuntime::SetParameters( SbxArray* pParams )
}
if( bByVal )
{
- if( bTargetTypeIsArray )
+ // tdf#79426, tdf#125180 - don't convert missing arguments to the requested parameter type
+ if( bTargetTypeIsArray && !IsMissing( v, 1 ) )
{
t = SbxOBJECT;
}
SbxVariable* v2 = new SbxVariable( t );
v2->SetFlag( SbxFlagBits::ReadWrite );
+ // tdf#79426, tdf#125180 - if parameter was missing, readd additional information about a missing parameter
+ if ( IsMissing( v, 1 ) )
+ {
+ SetIsMissing( v2 );
+ }
*v2 = *v;
refParams->Put32( v2, i );
}
else
{
- if( t != SbxVARIANT && t != ( v->GetType() & 0x0FFF ) )
+ // tdf#79426, tdf#125180 - don't convert missing arguments to the requested parameter type
+ if( t != SbxVARIANT && !IsMissing( v, 1 ) && t != ( v->GetType() & 0x0FFF ) )
{
if( p && (p->eType & SbxARRAY) )
{
@@ -2749,6 +2774,8 @@ void SbiRuntime::StepEMPTY()
// to simplify matters.
SbxVariableRef xVar = new SbxVariable( SbxVARIANT );
xVar->PutErr( 448 );
+ // tdf#79426, tdf#125180 - add additional information about a missing parameter
+ SetIsMissing( xVar.get() );
PushVar( xVar.get() );
}
@@ -4047,13 +4074,16 @@ void SbiRuntime::StepPARAM( sal_uInt32 nOp1, sal_uInt32 nOp2 )
{
pVar = new SbxVariable();
pVar->PutErr( 448 ); // like in VB: Error-Code 448 (ERRCODE_BASIC_NAMED_NOT_FOUND)
+ // tdf#79426, tdf#125180 - add additional information about a missing parameter
+ SetIsMissing( pVar );
refParams->Put32( pVar, iLoop );
iLoop--;
}
}
pVar = refParams->Get32( nIdx );
- if( pVar->GetType() == SbxERROR && nIdx )
+ // tdf#79426, tdf#125180 - check for optionals only if the parameter is actually missing
+ if( pVar->GetType() == SbxERROR && IsMissing( pVar, 1 ) && nIdx )
{
// if there's a parameter missing, it can be OPTIONAL
bool bOpt = false;
diff --git a/include/basic/sbxdef.hxx b/include/basic/sbxdef.hxx
index 2acbac0c98be..6c7a5a8c0bd1 100644
--- a/include/basic/sbxdef.hxx
+++ b/include/basic/sbxdef.hxx
@@ -78,6 +78,9 @@ enum SbxDataType {
SbxVECTOR = 0x1000, // simple counted array
SbxARRAY = 0x2000, // array
SbxBYREF = 0x4000, // access by reference
+
+ // tdf#79426, tdf#125180
+ SbxMISSING = 0x8000, // Parameter is missing
};
const sal_uInt32 SBX_TYPE_WITH_EVENTS_FLAG = 0x10000;
More information about the Libreoffice-commits
mailing list