[Libreoffice-commits] core.git: Branch 'feature/gsoc-writer-char-borders' - 3 commits - include/drawinglayer sw/inc sw/source

Miklos Vajna vmiklos at vmiklos.hu
Mon Jul 8 02:27:20 PDT 2013


On Sun, Jul 07, 2013 at 11:19:11AM -0700, =?ISO-8859-1?Q?Zolnai_Tam=E1s_ <zolnaitamas2000 at gmail.com>, ?= wrote:
> +    // character borders
> +    editeng::SvxBorderLine*     m_pTopBorder;
> +    editeng::SvxBorderLine*     m_pBottomBorder;
> +    editeng::SvxBorderLine*     m_pRightBorder;
> +    editeng::SvxBorderLine*     m_pLeftBorder;
> +
....
> +void SwFont::SetLeftBorder( const editeng::SvxBorderLine* pLeftBorder )
> +{
> +    delete m_pLeftBorder;
> +    if( pLeftBorder )
> +        m_pLeftBorder = new editeng::SvxBorderLine(*pLeftBorder);
> +    else
> +        m_pLeftBorder = 0;
> +    bFntChg = sal_True;
> +}

Hmm, what's the benefit or manual memory management here? If you need a
pointer, you could use boost::shared_ptr here. Though I'm not sure you
really need a pointer here. If you just want optional members,
boost::optional is better.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20130708/138e4d45/attachment.pgp>


More information about the LibreOffice mailing list