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


Hi,

While looking for usage of OUString::matchAsciiL in the base code, I came across the following which seems odd.

At line 60 of /framework/source/lomenubar/MenuItemStatusListener.cxx, we can find :
>>>>>>>
    if ((Event.State >>= oULabel) &&
        !oULabel.matchAsciiL ("private:", 8, 0) &&
        !oULabel.matchAsciiL (".uno:", 5, 0)    &&
        !oULabel.matchAsciiL ("slot:", 5, 0)    &&
        !oULabel.matchAsciiL ("service:", 8, 0) &&
        !oULabel.matchAsciiL (".cmd:", 5, 0)    &&
        !oULabel.matchAsciiL ("macro:///", 5, 0))
>>>>>>>

The 2nd parameter of matchAsciiL is the length of the ASCII string we are trying to match.
All the calls provide the correct length of the string, EXCEPT the last one.


Q1)  Why "macro:///" and 5 ? Shouldn't it be 9 ???


Q2) In other places, matchAscii is used in conjunction of RTL_CONSTASCII_STRINGPARAM. This way, the length of the string is computed by the compiler.

Is it the preferred way to do, in order to avoid hard coded constant ?
If yes, I can provide a patch.


Best regards,
Christophe JAILLET


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.