Re: [Libreoffice] [PATCH] Replace SvULongs with vector and code clean up part 1

2011-08-07 Thread Maciej Rumianowski
Dnia 2011-08-07, nie o godzinie 21:31 +0200, Eike Rathke pisze: > I suggest > > ::std::vector::iterator GetAdded_Impl( size_t nKey ); > > with logically the content of IsAdded_Impl() but using ::std::find() > instead of the awkward loop and returning the position's iterator that > can be used in

Re: [Libreoffice] [PATCH] Replace SvULongs with vector and code clean up part 1

2011-08-07 Thread Eike Rathke
Hi Maciej, On Sunday, 2011-08-07 17:04:49 +0200, Maciej Rumianowski wrote: > > You're right, the code is "suboptimal" ... in fact IsRemoved_Impl() > > and > > IsAdded_Impl() could also return the index of the element found so it > > wouldn't be needed to be searched again. Want to take care of it

Re: [Libreoffice] [PATCH] Replace SvULongs with vector and code clean up part 1

2011-08-07 Thread Maciej Rumianowski
Hi Eike, Dnia 2011-08-07, nie o godzinie 11:17 +0200, Eike Rathke pisze: > You're right, the code is "suboptimal" ... in fact IsRemoved_Impl() > and > IsAdded_Impl() could also return the index of the element found so it > wouldn't be needed to be searched again. Want to take care of it? Yes :)

Re: [Libreoffice] [PATCH] Replace SvULongs with vector and code clean up part 1

2011-08-07 Thread Eike Rathke
Hi Maciej, On Saturday, 2011-08-06 19:59:40 +0200, Maciej Rumianowski wrote: > > > DBG_ASSERT( bFound, "Key not found" ); > > > -aDelList.Remove( nAt ); > > > +aDelList.erase( nAt ); > > > > Hmm.. I'd say the original code was wrong, when nAddKey was not foun

Re: [Libreoffice] [PATCH] Replace SvULongs with vector and code clean up part 1

2011-08-06 Thread Maciej Rumianowski
Hi Eike, Thanks for review! Dnia 2011-08-06, sob o godzinie 17:35 +0200, Eike Rathke pisze: > > > { > > -if ( aDelList[i] == nAddKey ) > > +if ( *it == nAddKey ) > > { > > bFound = sal_True; > > -

Re: [Libreoffice] [PATCH] Replace SvULongs with vector and code clean up part 1

2011-08-06 Thread Eike Rathke
Hi Maciej, On Saturday, 2011-08-06 15:32:52 +0200, Maciej Rumianowski wrote: > With this patch comes some questions: > > @@ -159,16 +159,10 @@ SvxNumberFormatShell::~SvxNumberFormatShell() > > // Hinzugefuegte Formate sind nicht gueltig: > > // => wieder entfernen: > > > > -

[Libreoffice] [PATCH] Replace SvULongs with vector and code clean up part 1

2011-08-06 Thread Maciej Rumianowski
Hi, I was working on SvULongs in libs-core and I decided to split my work in several Patches. With this patch comes some questions: > @@ -159,16 +159,10 @@ SvxNumberFormatShell::~SvxNumberFormatShell() > // Hinzugefuegte Formate sind nicht gueltig: > // => wieder entfernen: > >