[Libreoffice] [PATCH] Replace List for vector<> in sc

Rafael Dominguez venccsralph at gmail.com
Tue Jun 7 17:49:05 PDT 2011


>
> Also haven't pushed
> 0002-Replace-List-with-std-vector-XclExpUserBView.calc.patch because I
> am not sure about
>
> --- cut ---
>  XclExpUserBViewList::XclExpUserBViewList( const ScChangeTrack&
> rChangeTrack )
> +    : aViews(rChangeTrack.GetUserCollection().GetCount())
> [...]
> -            List::Insert( new XclExpUserBView( pStrData->GetString(),
> aGUID ), LIST_APPEND );
> +            aViews.push_back( new XclExpUserBView( pStrData->GetString(),
> aGUID ) );
> --- cut ---
>
> Why do you initialize the vector with NULL pointers?
>
> IMHO, all the pointers will stay NULL because you later use .push_back().
>
> For example, rChangeTrack has the collection: A B C D and GetCount()
> returns 4.
> If you initialize the vector, you will end with the vector: 0 0 0 0 A B C D
>
> Or did I miss something?
>
>
Nope, heres a patch fixing those issues
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20110607/e5dea2f6/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Replace-List-with-std-vector-XclExpUserBView.patch
Type: text/x-patch
Size: 5186 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20110607/e5dea2f6/attachment.bin>


More information about the LibreOffice mailing list