[PUSHED][PATCH] convert SV_DECL_PTRARR_DEL to boost::ptr_vector in sc/inc/viewuno.hxx

Ivan Timofeev timofeev.i.s at gmail.com
Sun Mar 4 10:27:51 PST 2012


Hi Noel,

On 29.02.2012 15:24, Noel Grandin wrote:
> New patch with recommended fixes attached.

Great! Pushed, thanks.

> I wonder, would it not be better to convert this type of listener-list
> thing to boost::ptr_set?
> - no chance of accidentally adding duplicates

Objects are created right before push_back, so I think the code is safe 
as it is.

> - O(1) deletion

...and not-so-fast insertion. IMHO listeners are inserted more often 
then removed. But you can disagree, of course. :)

Anyway, there is another improvement now - convert these size() to empty():

     sal_uInt16 nCount = aMouseClickHandlers.size();
     ...
     if (aMouseClickHandlers.size() == 1 && nCount == 0)


Thanks again,
Ivan




More information about the LibreOffice mailing list