summaryrefslogtreecommitdiff
path: root/unotest
diff options
context:
space:
mode:
authorStephan Bergmann <stephan.bergmann@allotropia.de>2024-02-22 10:36:24 +0100
committerStephan Bergmann <stephan.bergmann@allotropia.de>2024-02-22 15:45:51 +0100
commit2c3121adb9a53142a003ba668821e77e9555c629 (patch)
tree4708f24501715febe0ec3ebb0329d9b521a5b2cd /unotest
parentb3bca02d58f71d2413b673ff113a346e237ef92f (diff)
Embind: Add UNO char support
Change-Id: I4ced49774baafdf620ae167c53794932766aca86 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163741 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
Diffstat (limited to 'unotest')
-rw-r--r--unotest/source/embindtest/embindtest.cxx4
-rw-r--r--unotest/source/embindtest/embindtest.idl2
-rw-r--r--unotest/source/embindtest/embindtest.js6
3 files changed, 12 insertions, 0 deletions
diff --git a/unotest/source/embindtest/embindtest.cxx b/unotest/source/embindtest/embindtest.cxx
index b1f819272931..9ab70656541d 100644
--- a/unotest/source/embindtest/embindtest.cxx
+++ b/unotest/source/embindtest/embindtest.cxx
@@ -68,6 +68,10 @@ public:
sal_Bool SAL_CALL isDouble(double value) override { return value == 100.5; }
+ sal_Unicode SAL_CALL getChar() override { return u'Ö'; }
+
+ sal_Bool SAL_CALL isChar(sal_Unicode value) override { return value == u'Ö'; }
+
OUString SAL_CALL getString() override { return u"hä"_ustr; }
sal_Bool SAL_CALL isString(OUString const& value) override { return value == u"hä"; }
diff --git a/unotest/source/embindtest/embindtest.idl b/unotest/source/embindtest/embindtest.idl
index 913cde39e12b..09e5c4096c50 100644
--- a/unotest/source/embindtest/embindtest.idl
+++ b/unotest/source/embindtest/embindtest.idl
@@ -36,6 +36,8 @@ interface XTest {
boolean isFloat([in] float value);
double getDouble();
boolean isDouble([in] double value);
+ char getChar();
+ boolean isChar([in] char value);
string getString();
boolean isString([in] string value);
Struct getStruct();
diff --git a/unotest/source/embindtest/embindtest.js b/unotest/source/embindtest/embindtest.js
index 805dd16bfe99..9d0349ffe7f2 100644
--- a/unotest/source/embindtest/embindtest.js
+++ b/unotest/source/embindtest/embindtest.js
@@ -74,6 +74,12 @@ Module.addOnPostRun(function() {
console.assert(test.isDouble(v));
}
{
+ let v = test.getChar();
+ console.log(v);
+ console.assert(v === 'Ö');
+ console.assert(test.isChar(v));
+ }
+ {
let v = test.getString();
console.log(v);
console.assert(v === 'hä');