[PUSHED] Re: [PATCH] Convert various SV_DECL_PTRARR in SVL and SVTOOLS modules
Michael Stahl
mstahl at redhat.com
Fri Jun 8 14:00:11 PDT 2012
On 07/06/12 17:38, Noel Grandin wrote:
> Hi
>
> These patches convert various SV_DECL_PTRARR stuff to std::set and
> std::vector in the SVL and SVTOOLS modules.
>
> Passes "make check" at global level, and compiled with debug=true
thanks, pushed.
although there was quite some DBGUTIL code in svtools that didn't build,
apparently the easy-hackers haven't cleaned up the DBG_ASSERTs there yet...
patch #4 does this:
> if ( nDelFromLine != 0xFFFF )
> - pTEParaPortion->GetLines().DeleteAndDestroy( nDelFromLine, pTEParaPortion->GetLines().Count() - nDelFromLine );
> + for( TextLines::iterator it = pTEParaPortion->GetLines().begin() + nDelFromLine;
> + it != pTEParaPortion->GetLines().end(); ++it )
> + delete *it;
> + pTEParaPortion->GetLines().erase( pTEParaPortion->GetLines().begin() + nDelFromLine,
> + pTEParaPortion->GetLines().end() );
which will happily construct a begin() + 0xFFFF iterator and pass that
to erase.
see, this is exactly why i have acquired the habit to always write { and
} for if statements and loops, even if the body is only one statement :)
More information about the LibreOffice
mailing list