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

Rafael Dominguez venccsralph at gmail.com
Tue Jun 7 18:06:05 PDT 2011


On Tue, Jun 7, 2011 at 8:19 PM, Rafael Dominguez <venccsralph at gmail.com>wrote:

>
>
>> 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
>
>
Forgot to remove the initializing the vector changed it for reserve. Tripled
checked so it should be fine now
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20110607/d89a470a/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Replace-List-with-std-vector-XclExpUserBView.patch
Type: text/x-patch
Size: 5078 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20110607/d89a470a/attachment.bin>


More information about the LibreOffice mailing list