Date: prev next · Thread: first prev next last
2015 Archives by date, by thread · List index


Hi Aleksandr,

On Sunday, 2015-11-08 20:26:03 +0300, Aleksandr Andreev wrote:

I started working on the project of adding Cyrillic numerals, and I
decided that first I would add the digits and then, once I figured
that out, work on the algorithm. However, I am stuck. I've added the
digits to nativenumbersupplier.cxx (see attached)

Btw, the attachment made it only through in my personal copy, it was
stripped on the l10n list. And please use patch attachments that are
produced by git format-patch, not just git show.

, and the software
compiles, but when I attempt to format the digits in the Church Slavic
locale, I get gibberish (some kind of CJK ideographs).

Likely because you forgot to adjust NumberChar_Count in
i18npool/source/nativenumber/data/numberchar.h and instead added
NumberChar_cu after:

--- a/i18npool/source/nativenumber/data/numberchar.h
+++ b/i18npool/source/nativenumber/data/numberchar.h
@@ -54,6 +54,7 @@ static const sal_Int16 NumberChar_he        = 28;
 static const sal_Int16 NumberChar_ne        = 29;
 static const sal_Int16 NumberChar_dz        = 30;
 static const sal_Int16 NumberChar_Count     = 31;
+static const sal_Int16 NumberChar_cu        = 32;

NumberChar_Count is used to allocate and loop over ranges, see places in
i18npool/source/nativenumber/nativenumbersupplier.cxx where
NumberChar_Count is used. If you access with NumberChar_cu beyond that
you'll get arbitrary memory.

So instead it should be

  +static const sal_Int16 NumberChar_cu        = 31;
  -static const sal_Int16 NumberChar_Count     = 31;
  +static const sal_Int16 NumberChar_Count     = 32;


  Eike

-- 
LibreOffice Calc developer. Number formatter stricken i18n transpositionizer.
GPG key "ID" 0x65632D3A - 2265 D7F3 A7B0 95CC 3918  630B 6A6C D5B7 6563 2D3A
Better use 64-bit 0x6A6CD5B765632D3A here is why: https://evil32.com/
Care about Free Software, support the FSFE https://fsfe.org/support/?erack

-- 
To unsubscribe e-mail to: l10n+unsubscribe@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/l10n/
All messages sent to this list will be publicly archived and cannot be deleted

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.