[PATCH] convert table.hxx use in editeng/source/editeng/editdoc.hxx

Ivan Timofeev timofeev.i.s at gmail.com
Sun Feb 12 08:20:52 PST 2012


Hi Noel,

On 10.02.2012 13:42, Noel Grandin wrote:
> Convert tools/table.hxx usage in editeng/source/editeng/editdoc.hxx to
> boost::ptr_map

Your patch looks good to me. But... let's look at the usages of the 
SvxFontTable class. All of them are in editeng/source/editeng/impedit4.cxx.
ImpEditEngine::WriteRTF:

     SvxFontTable aFontTable;
     aFontTable.Insert( 0, ... );
     aFontTable.Insert( 1, ... );
     aFontTable.Insert( 2, ... );

Ok, keys are 0, 1, 2.

     aFontTable.Insert( aFontTable.Count(), ... );

Keys will be 3, 4, 5 and so on. And there are no other calls of Insert. 
Thus, no real need of a map, we can use a vector, and treat positions of 
elements as ex-keys. So, I'd suggest to remove SvxFontTable wrapper, 
directly replacing it with vector.

Have you something against? :)

Best Regards,
Ivan


More information about the LibreOffice mailing list