About coverity 705746 (pormulti.cxx from sw module)

Noel Grandin noel at peralex.com
Fri Mar 15 02:04:11 PDT 2013


On 2013-03-15 10:30, julien2412 wrote:
> Noel Grandin wrote
>> I would guess that someone meant to move line 742 inside the first "if"
>> statement, but only did half the job.
> Hello Noël,
>
> Perhaps I'm too sleepy this morning but I don't see the interest to
> duplicate the "new" part. Any hint?
>
>

I think the code should read:

if( nLeft || nRight )
      {
          if( !pCurr->GetPortion() )
pCurr->SetPortion( new SwTxtPortion( *pCurr ) );
          if( nLeft )
          {
              SwMarginPortion *pMarg = new SwMarginPortion( 0 );
     pMarg->AddPrtWidth( nLeft );
pMarg->SetPortion( pCurr->GetPortion() );
pCurr->SetPortion( pMarg );
          }
          if( nRight )
          {
SwMarginPortion *pMarg = new SwMarginPortion( 0 );
pMarg->AddPrtWidth( nRight );
pCurr->FindLastPortion()->Append( pMarg );
          }
     }

Disclaimer: http://www.peralex.com/disclaimer.html


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20130315/e30b6723/attachment.html>


More information about the LibreOffice mailing list