[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 : > 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 got > remo

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 rtl_uStri

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 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 >> OUString::createFromAscii(pSomethi

[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 = rtl::OUString(RTL_CONSTASCII_USTRINGP

[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 GetWindo

[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 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

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)(

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

2010-11-01 Thread Gert Faller
Selon Caolán McNamara : > 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 string literal,

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

2010-11-03 Thread Noel Power
Hi Caolan, On Wed, 2010-11-03 at 20:45 +, Caolán McNamara wrote: > On Wed, 2010-11-03 at 17:16 +0100, Gert Faller wrote: [...] > > In this case I believe its not being found simply because it doesn't > exist. If I "touch" the file, I see dmake doesn't rebuild it, and its > not listed in the ma