[PUSHED] Re: [PATCH] convert various raw SvPtrarr usages to STL containers (16)

Michael Stahl mstahl at redhat.com
Wed Jul 4 14:26:41 PDT 2012


On 02/07/12 10:41, Noel Grandin wrote:
> Hi
> 
> This collection of small patches converts various places from using raw 
> SvPtrarr to using STL containers.

thanks, pushed to master.

patch #10: if you change an array to an associative array then this
check for size() gets a completely different (and wrong) meaning:

> -    if( !pColumns || nIndex >= pColumns->Count() )
> +    if( !pColumns || nIndex >= pColumns->size() )


patch #11: in the horrible ugly mess below, the pNew is actually
inserted at the first position, which the new code doesn't do:

> -                String* pDel = (String*)aLRULst[ nMaxCount - 1 ];
> -
> -                void** ppData = (void**)aLRULst.GetData();
> -                memmove( ppData+1, ppData, (nMaxCount - 1) * sizeof( void* ));
> -                *ppData = pNew;
> -
> +                SwAutoCompleteString* pDel = aLRULst.back();
> +                aLRULst.pop_back();

patch #12: the reverse_iterator actually points to the element preceding
the original "it", so on the first iteration it shouldn't be
incremented, as that has happened implicitly already.

> -            while( nListPos )
> +            SvxIconChoiceCtrlEntryPtrVec::const_reverse_iterator it2(it);
> +            while( ++it2 != rList.rend() )
>              {
> -                nListPos--;



More information about the LibreOffice mailing list