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


On 03/19/2013 05:59 PM, Michael Meeks wrote:
On Tue, 2013-03-19 at 15:13 +0100, Stephan Bergmann wrote:
-    if( rule.compareToAscii( RTL_CONSTASCII_STRINGPARAM( "r" ) ) == 0 )
+    if( rule == "r" )
...
smells like an incorrect conversion from
rtl::OUString::compareToAscii(asciiStr,maxLength) to operator== rather
than rtl::OUString::startsWith, but then again, given the preceeding

        So I've fallen for this as well - if indeed compareToAscii just
compares the first few characters that are in asciiStr - then the
documentation in the header:

     /**
       Compares two strings.

       The comparison is based on the numeric value of each character in
       the strings and return a value indicating their relationship.
...
       @param  asciiStr      the 8-Bit ASCII character string to be compared.
       @return   0 - if both strings are equal
                 < 0 - if this string is less than the string argument
                 > 0 - if this string is greater than the string argument
     */
     sal_Int32 compareToAscii( const sal_Char* asciiStr ) const SAL_THROW(())

        I took 'both strings are equal' at face value ;-)

        Does it really not do that ?

No. Note that there is another overload of compareToAscii with two parameters, with is the subject here.

Stephan

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.