[PATCH] convert SdPresLayoutDlg from tools/list.hxx to std::map

Michael Stahl mstahl at redhat.com
Sat Feb 4 08:00:18 PST 2012


On 01/02/12 12:58, Noel Power wrote:
> Hi Noel
> On 31/01/12 14:24, Noel Grandin wrote:
>> sorry, that should be "converted to std::vector"
> you mean boost::ptr_vector I think :-)
> 
> Hope I didn't miss anything this time, I made some minor changes ( see
> attached patch )
> 
> e.g. I removed the maLayoutNames.clear() from :~SdPresLayoutDlg() as the
> vector will go out of scope here anyway and delete the container
> contents. Also I changed slightly the code in IMPL_LINK(SdPresLayoutDlg,
> ClickLoadHdl, void *, EMPTYARG) and got rid of a String copy and
> slightly changed the calculation of 'nId' for maVS.SelectItem
> 
> I am currently running make check on it this time ;-) assuming it works
> and no other objection to the patch I will commit to master
> thanks again for the patch.

hi Noel,

a further improvement would be to replace boost::ptr_vector with
std::vector: our various String classes (at least the 4 most popular
ones) effectively are already smart pointers to an array and can be
stored directly in STL containers, so wrapping them in _another_ pointer
is just, errm, pointless  :)



More information about the LibreOffice mailing list