[Libreoffice] [PATCH V2] convert SdCustomShow from tools/list to vector

Eike Rathke erack at redhat.com
Tue Jan 31 09:51:28 PST 2012


Hi Ivan,

On Tuesday, 2012-01-31 21:31:11 +0400, Ivan Timofeev wrote:

> >should remove the first occurrence, care to fix ?
> 
> so the exact equivalent of
> 
> mpSdCustomShow->Remove(pPage->GetSdrPage())
> 
> will be:
> 
> SdCustomShow::PageVec::iterator it = std::find(
>     mpSdCustomShow->PagesVector().begin(),
>     mpSdCustomShow->PagesVector().end(),
>     pPage->GetSdrPage());
> if (it != mpSdCustomShow->PagesVector().end())
>     mpSdCustomShow->PagesVector().erase(it);
> 
> right?

Looks corect. Seeing this it would make sense to reintroduce the
Remove() method that in the patch was merged with the Replace() method,
which otherwise I would had preferred got a comment in the header file
that it actually removed if the replacement was NULL ...

  Eike

-- 
LibreOffice Calc developer. Number formatter stricken i18n transpositionizer.
GnuPG key 0x293C05FD : 997A 4C60 CE41 0149 0DB3  9E96 2F1A D073 293C 05FD
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20120131/34ab6e14/attachment.pgp>


More information about the LibreOffice mailing list