[Libreoffice] [PUSHED] Re: [PATCH] Easy Hacks : Use RTL_CONSTASCII_USTRINGPARAM macro 8

2010-11-03 Thread Caolán McNamara
On Wed, 2010-11-03 at 17:16 +0100, Gert Faller wrote: Hi, this may be the last for module 'writer'. Excellent, all pushed, thanks. Remains 'sw/source/ui/vba/vbacheckbox.cxx:78'. When I google I find : #define ECMA_FORMCHECKBOX_CHECKED checked in '/xmloff/inc/xmloff/ecmaflds.hxx' but

[Libreoffice] [PUSHED] Re: [PATCH] Easy Hacks : Use RTL_CONSTASCII_USTRINGPARAM macro 7

2010-11-02 Thread Caolán McNamara
On Tue, 2010-11-02 at 18:44 +0100, Gert Faller wrote: Hi, with this one, module 'impress' should be rather clean of that. Heh, good, liked the ? : rework to keep me pacified :-). Thanks for this. As an aside, stylistically I'd prefer rtl::OUString sFoo(RTL_CONSTASCII_USTRINGPARAM(apple));

[Libreoffice] [PUSHED] Re: [PATCH] Easy Hacks : Use RTL_CONSTASCII_USTRINGPARAM macro 4

2010-11-01 Thread Caolán McNamara
On Mon, 2010-11-01 at 20:28 +0100, Gert Faller wrote: Hi, more of that... Mostly good, though createFromAscii_7.patch has... OUString::createFromAscii( GetWindowState( WINDOWSTATE_MASK_POS ).GetBuffer() ) ); that one can't be changed to use RTL_CONSTASCII_USTRINGPARAM because

Re: [Libreoffice] [PUSHED] Re: [PATCH] Easy Hacks : Use RTL_CONSTASCII_USTRINGPARAM macro 4

2010-11-01 Thread Gert Faller
Selon Caolán McNamara caol...@redhat.com: Mostly good, though createFromAscii_7.patch has... OUString::createFromAscii( GetWindowState( WINDOWSTATE_MASK_POS ).GetBuffer() ) ); that one can't be changed to use RTL_CONSTASCII_USTRINGPARAM because GetWindowState is a method rather than a

Re: [Libreoffice] [PUSHED] Re: [PATCH] Easy Hacks : Use RTL_CONSTASCII_USTRINGPARAM macro bis

2010-10-31 Thread Caolán McNamara
On Sat, 2010-10-30 at 22:08 +0100, Caolán McNamara wrote: old: OUString sFoo(OUString::createFromAscii(bBool ? true : false)); new: OUString sFoo(RTL_CONSTASCII_USTRINGPARAM(bBool ? true : false)); would be expanded as... OUString sFoo(bBool ? true : false, ((sal_Int32)(sizeof(bBool ?

[Libreoffice] [PUSHED] Re: [PATCH] Easy Hacks : Use RTL_CONSTASCII_USTRINGPARAM macro

2010-10-30 Thread Caolán McNamara
On Sat, 2010-10-30 at 17:08 +0200, Gert Faller wrote: Hi, a first try on that. Excellent, these are little mini-optimizations and they all help. Not sure if I let the original source (for control) Nah, don't bother keeping the old content as a comment, we can look at the git history to see

Re: [Libreoffice] [PUSHED] Re: [PATCH] Easy Hacks : Use RTL_CONSTASCII_USTRINGPARAM macro

2010-10-30 Thread Gert Faller
Selon Caolán McNamara caol...@redhat.com: You have two typos in there however, i.e. - com.sun.star.chart.BarDiagram + com.sun.star.chart.BarDiagra - com.sun.star.chart2.ScatterChartType + com.sun.star.chart2.ScatterChartTyp in those two cases the trailing letter of the original string

Re: [Libreoffice] [PUSHED] Re: [PATCH] Easy Hacks : Use RTL_CONSTASCII_USTRINGPARAM macro

2010-10-30 Thread Caolán McNamara
On Sat, 2010-10-30 at 18:16 +0200, Gert Faller wrote: I've got 2388 files with 'createFromAscii'. That's a lot. The wiki says that this macro is 'faster'. Does it mean at running time ? Yes, ever so slightly, sal/inc/rtl/ustring.hxx has OUString::createFromAscii in it, and that calls

Re: [Libreoffice] [PUSHED] Re: [PATCH] Easy Hacks : Use RTL_CONSTASCII_USTRINGPARAM macro

2010-10-30 Thread Gert Faller
OK, thanks. Now, this only works when you can compute the length of the string at compile time, i.e. its a string literal, so OUString::createFromAscii(foo) can be trivially replaced, while OUString::createFromAscii(pSomething) should be left alone. C. Yes, of course, I was just

Re: [Libreoffice] [PUSHED] Re: [PATCH] Easy Hacks : Use RTL_CONSTASCII_USTRINGPARAM macro

2010-10-30 Thread Jesús Corrius
On Sat, Oct 30, 2010 at 10:35 PM, Gert Faller gertfal...@aliceadsl.fr wrote: OK, thanks. Now, this only works when you can compute the length of the string at compile time, i.e. its a string literal, so OUString::createFromAscii(foo) can be trivially replaced, while

[Libreoffice] [PUSHED] Re: [PATCH] Easy Hacks : Use RTL_CONSTASCII_USTRINGPARAM macro bis

2010-10-30 Thread Caolán McNamara
On Sat, 2010-10-30 at 22:23 +0200, Gert Faller wrote: Hi, here are some more of them. Great, thanks. Looking at this createFromAscii_4.patch reminds me of something else. Nothing to do with you, the code was this way already, but rtl::OUString foo =