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


Dear Petr,

Thank you for the reminder of this issue. My apologies for not getting to it earlier.


I do not understand the code either. I just wonder if it would make
sense to check for:

    while (++nCharIndex - mnMinCharPos <
                    static_cast<int>(mvChar2BaseGlyph.size()))

As the array is accessed as mvChar2BaseGlyph[nCharIndex-mnMinCharPos].
Otherwise, the cycle might end too early. 

Another conservative solution would be to combine it with the original
check:

while (++nCharIndex < static_cast<int>(mvGlyph2Char.size()) &&
       nCharIndex - mnMinCharPos <
                        static_cast<int>(mvChar2BaseGlyph.size()))

Any other opinion here, please?

I would go with the first of these. It makes no sense to compare a charIndex against a glyph->char 
mapping array, whose size is the number of glyphs, not characters. I think it is simply a bug.

Notice that I am not claiming authoritative understanding of this code since it was written by 
Keith, who unfortunately is no longer with us and so cannot comment. I am hoping that when I 
eventually get time to work on this code, and particularly the mac port, I can refactor the code 
and gain the necessary authoritative confidence.

Yours,
Martin

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.