Some cppcheck cleaning

Change-Id: I7217ab7500de5d8220b85e56aceb6e843bd0769f
This commit is contained in:
Julien Nabet
2013-01-27 23:07:58 +01:00
parent c348848775
commit b8d4b8656f
10 changed files with 18 additions and 21 deletions

View File

@@ -625,16 +625,16 @@ IMPL_LINK( SaneDlg, ModifyHdl, Edit*, pEdit )
else if( pEdit == &maNumericEdit )
{
double fValue;
char pBuf[256];
rtl::OString aContents(rtl::OUStringToOString(maNumericEdit.GetText(),
osl_getThreadTextEncoding()));
fValue = atof(aContents.getStr());
if( mfMin != mfMax && ( fValue < mfMin || fValue > mfMax ) )
{
char pBuf[256];
if( fValue < mfMin )
fValue = mfMin;
else if( fValue > mfMax )
fValue = mfMax;
fValue = mfMax;
sprintf( pBuf, "%g", fValue );
maNumericEdit.SetText( String( pBuf, osl_getThreadTextEncoding() ) );
}

View File

@@ -50,6 +50,7 @@ BaseContainer::BaseContainer()
: BaseLock ( )
, m_rCache ( )
, m_pFlushCache(NULL )
, m_eType()
, m_lListener (m_aLock)
{
m_rCache->load(FilterCache::E_CONTAINS_STANDARD);

View File

@@ -132,15 +132,12 @@ sal_Bool RscMgr::IsDefault( const RSCINST & rInst ){
|*
*************************************************************************/
sal_Bool RscMgr::IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef ){
RscMgrInst * pClassData;
RscMgrInst * pDfltData;
if( !RscClass::IsValueDefault( rInst, pDef ) )
return sal_False;
if( pDef ){
pClassData = (RscMgrInst *)(rInst.pData + RscClass::Size());
pDfltData = (RscMgrInst *)(pDef + RscClass::Size());
RscMgrInst * pClassData = (RscMgrInst *)(rInst.pData + RscClass::Size());
RscMgrInst * pDfltData = (RscMgrInst *)(pDef + RscClass::Size());
if( !pClassData->aRefId.IsId() && !pDfltData->aRefId.IsId() ){
return sal_True;

View File

@@ -27,7 +27,7 @@
using namespace xmloff::token;
ScMyColumnRowGroup::ScMyColumnRowGroup()
ScMyColumnRowGroup::ScMyColumnRowGroup() : bDisplay(false)
{
}

View File

@@ -91,6 +91,7 @@ struct SfxInterface_Impl
SfxInterface_Impl() :
aPopupRes(0,*SfxApplication::GetOrCreate()->GetSfxResManager()),
aStatBarRes(0,*SfxApplication::GetOrCreate()->GetSfxResManager())
, pModule(NULL)
, bRegistered(sal_False)
{
pObjectBars = new SfxObjectUIArr_Impl;

View File

@@ -925,9 +925,7 @@ bool SwPostItMgr::LayoutByPage(std::list<SwSidebarWin*> &aVisiblePostItList,cons
long lTopBorder = rBorder.Top() + 5;
long lBottomBorder = rBorder.Bottom() - 5;
const long lVisibleHeight = lBottomBorder - lTopBorder; //rBorder.GetHeight() ;
long lSpaceUsed = 0;
long lTranslatePos = 0;
int loop = 0;
bool bScrollbars = false;
// do all neccessary resizings
@@ -956,6 +954,8 @@ bool SwPostItMgr::LayoutByPage(std::list<SwSidebarWin*> &aVisiblePostItList,cons
//start the real layout so nothing overlaps anymore
if (aVisiblePostItList.size()>1)
{
long lSpaceUsed = 0;
int loop = 0;
bool bDone = false;
// if no window is moved anymore we are finished
while (!bDone)

View File

@@ -42,14 +42,13 @@
-----------------------------------------------------------------------*/
void SwPageExample::UpdateExample( const SfxItemSet& rSet )
{
const SvxPageItem* pPage = 0;
SfxItemPool* pPool = rSet.GetPool();
sal_uInt16 nWhich = pPool->GetWhich( SID_ATTR_PAGE );
if ( rSet.GetItemState( nWhich, sal_False ) == SFX_ITEM_SET )
{
// alignment
pPage = (const SvxPageItem*)&rSet.Get( nWhich );
const SvxPageItem* pPage = (const SvxPageItem*)&rSet.Get( nWhich );
if ( pPage )
SetUsage( pPage->GetPageUsage() );

View File

@@ -53,12 +53,13 @@ namespace uui
*//*-*************************************************************************************************************/
FilterDialog::FilterDialog( Window* pParentWindow ,
ResMgr* pResMgr )
: ModalDialog ( pParentWindow, ResId( DLG_FILTER_SELECT, *pResMgr ) )
, m_ftURL ( this, ResId( FT_URL, *pResMgr ) )
, m_lbFilters ( this, ResId( LB_FILTERS, *pResMgr ) )
, m_btnOK ( this, ResId( BTN_OK, *pResMgr ) )
, m_btnCancel ( this, ResId( BTN_CANCEL, *pResMgr ) )
, m_btnHelp ( this, ResId( BTN_HELP, *pResMgr ) )
: ModalDialog (pParentWindow, ResId( DLG_FILTER_SELECT, *pResMgr ) )
, m_ftURL (this, ResId( FT_URL, *pResMgr))
, m_lbFilters (this, ResId( LB_FILTERS, *pResMgr))
, m_btnOK (this, ResId( BTN_OK, *pResMgr))
, m_btnCancel (this, ResId( BTN_CANCEL, *pResMgr))
, m_btnHelp (this, ResId( BTN_HELP, *pResMgr))
, m_pFilterNames(NULL)
{
FreeResource();
}

View File

@@ -1423,8 +1423,6 @@ sal_Bool Printer::EndJob()
mnCurPage = 0;
bRet = sal_True;
mbPrinting = sal_False;
mnCurPrintPage = 0;
maJobName = rtl::OUString();

View File

@@ -70,7 +70,7 @@ protected:
public:
WW8StructBase(sal_Int32 nLength)
: mSequence(nLength)
: mSequence(nLength), mpParent(NULL), mpDocument(NULL)
{
}