Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index


Hello,

Cppcheck reports this:
svtools/source/dialogs/filedlg2.cxx
558     unreadVariable  style   Variable 'nMaxWidth' is assigned a value that is
never used.

    544     if( nMaxWidth > aSize.Width() )
    545     {
    546         Size aDlgSize = GetPathDialog()->GetOutputSizePixel();
    547         GetPathDialog()->SetOutputSizePixel( Size(
aDlgSize.Width()+nMaxWidth-aSize.Width(), aDlgSize.Height() ) );
    548         aSize.Width() = nMaxWidth;
    549 
    550         if( pOkBtn )
    551             pOkBtn->SetSizePixel( aSize );
    552         if( pCancelBtn )
    553             pCancelBtn->SetSizePixel( aSize );
    554         if( pLoadBtn )
    555             pLoadBtn->SetSizePixel( aSize );
    556     }
    557     else
    558         nMaxWidth = aSize.Width();

see
http://opengrok.libreoffice.org/xref/core/svtools/source/dialogs/filedlg2.cxx#544

Any idea what should be done with this?

Remark:
By trying to understand this, I wondered how come line 548 was ok, then I
noticed these lines in tools/inc/tools/gen.hxx:
long            Width() const  { return nA; }
long&            Width() const  { return nA; }
I must recognize I don't understand the interest since there's a setWidth
function

Julien



--
View this message in context: 
http://nabble.documentfoundation.org/Cppcheck-reports-nMaxWidth-is-assigned-a-value-never-used-svtools-module-tp4036771.html
Sent from the Dev mailing list archive at Nabble.com.

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.