Hi Lubos, On Tuesday, 2012-06-19 15:20:40 +0200, Lubos Lunak wrote:
please review and backport to 3-5 and 3-5-5 the attached patch.
Looks sensible, pushed to 3-5 Two more reviews needed for 3-5-5 Btw, this ...
-const ShapeBase* ShapeContainer::takeLastShape()
+boost::shared_ptr< ShapeBase > ShapeContainer::takeLastShape()
{
assert( mrDrawing.getType() == VMLDRAWING_WORD );
if( maShapes.empty())
- return NULL;
- const ShapeBase* ret = maShapes.back().get();
+ return boost::shared_ptr< ShapeBase >();
+ boost::shared_ptr< ShapeBase > ret = maShapes.back();
maShapes.pop_back();
return ret;
}
... could be written as
boost::shared_ptr< ShapeBase > ShapeContainer::takeLastShape()
{
boost::shared_ptr< ShapeBase > ret;
assert( mrDrawing.getType() == VMLDRAWING_WORD );
if( !maShapes.empty())
{
ret.reset( maShapes.back());
maShapes.pop_back();
}
return ret;
}
to help compilers optimize the return to the caller if the return type
is defined at the start of the method (or so I have read ...)
Eike
--
LibreOffice Calc developer. Number formatter stricken i18n transpositionizer.
GnuPG key 0x293C05FD : 997A 4C60 CE41 0149 0DB3 9E96 2F1A D073 293C 05FD
Attachment:
pgpBrvaOaNklm.pgp
Description: PGP signature