On 25/06/12 14:29, Noel Grandin wrote:
These patches convert various usage of Svptrarr to modern STL containers
like std::vector.
Along the way, I noticed some other stuff, so one of the patches deletes
a dead header file, and one of them cleans up a const-casting mess.
This patch series passes make check, and has been compiled with
--enable-dbgutil.
great, didn't have any build problems :)
pushed to master, thanks.
patches #1 and #14 have one of the dreaded vector(size_t)
+ std::vector<DateTime*> aDateTimeArr( 16 );
patch #17 has a subtle issue:
- sal_uInt16 nPos = SvPtrarr::GetPos( pObj );
- if( nPos )
+ iterator it = std::find( begin(), end(), pObj );
+ if( it != begin() )
{
// object is currently not the first in cache
- if( USHRT_MAX != nPos )
- SvPtrarr::Remove( nPos );
+ if( it != end() )
+ erase( it );
it != begin() will be false for empty container, because then it ==
end() and begin() == end() hence end() != end() is false; while before
nPos is USHRT_MAX for empty container, which is true here.
ah, and this bit here seems to be C++11 syntax that at least Apple GCC
doesn't understand:
- pArr->push_back( { pBoxFrmFmt, pNewTableBoxFmt } );
Context
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.