[Libreoffice-commits] core.git: 2 commits - pyuno/source scaddins/source
Eike Rathke (via logerrit)
logerrit at kemper.freedesktop.org
Wed Jan 6 16:38:14 UTC 2021
pyuno/source/module/uno.py | 7 ++++---
scaddins/source/analysis/analysis.cxx | 2 +-
2 files changed, 5 insertions(+), 4 deletions(-)
New commits:
commit 70ea6b36df9ede18b135876d9b9da9945f6c129b
Author: Eike Rathke <erack at redhat.com>
AuthorDate: Wed Jan 6 01:24:41 2021 +0100
Commit: Eike Rathke <erack at redhat.com>
CommitDate: Wed Jan 6 17:37:40 2021 +0100
Resolves: tdf#139173 One-off error in limits for DEC2HEX()
BIN2HEX() and OCT2HEX() were not affected because the string input
is already limited to 10 characters and the converted decimal
can't even reach the limits.
Change-Id: Iba4212e8fc382287a1a454edf91426ba21497ae2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108824
Reviewed-by: Eike Rathke <erack at redhat.com>
Tested-by: Jenkins
diff --git a/scaddins/source/analysis/analysis.cxx b/scaddins/source/analysis/analysis.cxx
index 6fb4e9b958ff..3f7f4317eb55 100644
--- a/scaddins/source/analysis/analysis.cxx
+++ b/scaddins/source/analysis/analysis.cxx
@@ -661,7 +661,7 @@ const double SCA_MAX2 = 511.0; // min. val for binary numbe
const double SCA_MIN2 = -SCA_MAX2-1.0; // min. val for binary numbers (9 bits + sign)
const double SCA_MAX8 = 536870911.0; // max. val for octal numbers (29 bits + sign)
const double SCA_MIN8 = -SCA_MAX8-1.0; // min. val for octal numbers (29 bits + sign)
-const double SCA_MAX16 = 549755813888.0; // max. val for hexadecimal numbers (39 bits + sign)
+const double SCA_MAX16 = 549755813887.0; // max. val for hexadecimal numbers (39 bits + sign)
const double SCA_MIN16 = -SCA_MAX16-1.0; // min. val for hexadecimal numbers (39 bits + sign)
const sal_Int32 SCA_MAXPLACES = 10; // max. number of places
commit c7568cfdec8ababa4d73eddb7bed057404a6a009
Author: Michael Stahl <michael.stahl at allotropia.de>
AuthorDate: Tue Jan 5 13:30:26 2021 +0100
Commit: Michael Stahl <michael.stahl at allotropia.de>
CommitDate: Wed Jan 6 17:37:29 2021 +0100
pyuno: uno.Char is UTF-16 code unit, not UCS-4
Check for that in ctor.
Change-Id: Ia69b3d87ac4ccb5b6cc13169d7022c04607c609f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108803
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl at allotropia.de>
diff --git a/pyuno/source/module/uno.py b/pyuno/source/module/uno.py
index c4ca808feaa0..5fa7b135736d 100644
--- a/pyuno/source/module/uno.py
+++ b/pyuno/source/module/uno.py
@@ -225,9 +225,9 @@ class Char:
Use an instance of this class to explicitly pass a char to UNO.
- For Python 2, this class only works with unicode objects. Creating
- a Char instance with a normal str object or comparing a Char instance
- to a normal str object will raise an AssertionError.
+ For Python 3, this class only works with unicode (str) objects. Creating
+ a Char instance with a bytes object or comparing a Char instance
+ to a bytes object will raise an AssertionError.
:param value: A Unicode string with length 1
"""
@@ -236,6 +236,7 @@ class Char:
assert isinstance(value, str), "Expected str object, got %s instead." % type(value)
assert len(value) == 1, "Char value must have length of 1."
+ assert ord(value[0]) <= 0xFFFF, "Char value must be UTF-16 code unit"
self.value = value
More information about the Libreoffice-commits
mailing list