[Libreoffice] [PUSHED] Re: EasyHack RTL_CONSTASCII_USTRINGPARAM in cui
Caolán McNamara
caolanm at redhat.com
Sun Oct 31 10:26:50 PDT 2010
On Sun, 2010-10-31 at 15:37 +0100, Joost Eekhoorn wrote:
> MPL 1.1 / GPLv3+ / LGPLv3+
All good, committed and pushed, thanks :-)
> In ./cui/source/tabpages/numpages.cxx (line 2852):
> String sMsg( RTL_CONSTASCII_USTRINGPARAM( "Preview") );
>
> Should that not be RTL_CONSTASCII_STRINGPARAM, because sMsg is a
> String and not a OUString?
That's ok, if you look a the String class (UniString in
tools/inc/tools/string.hxx) you can see that it has a constructor which
takes as arguments, a char pointer, length and text encoding and a
default fourth argument, so RTL_CONSTASCII_USTRINGPARAM is compatible
with that constructor and its ok.
Of course having another String class as well as rtl::OUString is
annoying, and there's another "Easy" hack to remove the String/UniString
class in favour of OUString, but it's a little bit tricky given the
different APIs they have. e.g. in many cases a rtl::OUStringBuffer might
be called for, and in others using OUString can be quite clumsy so
extension/addition to e.g. the comphelper/inc/comphelper/string.hxx
helper class might be called for to make it easy to replace UniString
with rtl::OUString.
C.
More information about the LibreOffice
mailing list