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


On 16/04/13 16:13, Lubos Lunak wrote:
On Tuesday 16 of April 2013, Wols Lists wrote:
The attached patch is not in logerrit (I've yet to set that up), and
there's an error in it so I'm hoping someone can help. It does a TODO in
the file, but I can't get my argument casting right - in the original
code, matchIgnoreAsciiCaseAsciiL wraps its argument in
RTL_CONSTASCII_STRINGPARAM. This is defined in sal/inc/rtl/string.h and
passes both the string and its length. So me removing it is obviously a
mistake, but it's got some integrity checking in there and I just can't
get it to pass that.

 Actually removing it is not a mistake. The macro is a cumbersome 
micro-optimization and here it presumably doesn't make any difference. Just 
calling matchIgnoreAsciiCase() should do.

 Also note that LO has SAL_N_ELEMENTS macro for getting the number of items in 
an array.

Okay, looks like SAL_N_ELEMENTS does just as required. But calling
matchIgnoreAsciiCase still doesn't work ...

/home/anthony/gitstuff/loffice/connectivity/source/drivers/postgresql/pq_connection.cxx:502:68:
error: no matching function for call to
‘rtl::OUString::matchIgnoreAsciiCase(const char*&) const’
/home/anthony/gitstuff/loffice/connectivity/source/drivers/postgresql/pq_connection.cxx:502:68:
note: candidates are:
/home/anthony/gitstuff/loffice/instdir/unxlngx6.pro/sdk/include/rtl/ustring.hxx:654:14:
note: sal_Bool rtl::OUString::matchIgnoreAsciiCase(const rtl::OUString&,
sal_Int32) const
/home/anthony/gitstuff/loffice/instdir/unxlngx6.pro/sdk/include/rtl/ustring.hxx:654:14:
note:   no known conversion for argument 1 from ‘const char*’ to ‘const
rtl::OUString&’
/home/anthony/gitstuff/loffice/instdir/unxlngx6.pro/sdk/include/rtl/ustring.hxx:667:64:
note: template<class T> typename
rtl::internal::ConstCharArrayDetector<T, bool>::Type
rtl::OUString::matchIgnoreAsciiCase(T&, sal_Int32) const

I need to force some type of type conversion - basically from "const
char *" to "const rtl::OUString&", I presume.

Cheers,
Wol

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.