Some cppcheck cleaning

Change-Id: Idb380dbb7470dbdb371778ba0c486392cc55380e
This commit is contained in:
Julien Nabet 2013-02-12 14:47:52 +01:00
parent 2bfccd1489
commit 2ce2fafa1b
5 changed files with 10 additions and 13 deletions

View file

@ -615,10 +615,9 @@ void SbiParser::DefType( bool bPrivate )
for ( short i=0; i<pDim->GetSize();++i )
{
sal_Int32 ub = -1;
sal_Int32 lb = nBase;
SbiExprNode* pNode = pDim->Get(i)->GetExprNode();
ub = pNode->GetNumber();
sal_Int32 ub = pNode->GetNumber();
if ( !pDim->Get( i )->IsBased() ) // each dim is low/up
{
if ( ++i >= pDim->GetSize() ) // trouble

View file

@ -246,14 +246,13 @@ SvxBorderTabPage::SvxBorderTabPage(Window* pParent, const SfxItemSet& rCoreAttrs
// fill ColorBox out of the XColorList
SfxObjectShell* pDocSh = SfxObjectShell::Current();
const SfxPoolItem* pItem = NULL;
XColorListRef pColorTable;
DBG_ASSERT( pDocSh, "DocShell not found!" );
if ( pDocSh )
{
pItem = pDocSh->GetItem( SID_COLOR_TABLE );
const SfxPoolItem* pItem = pDocSh->GetItem( SID_COLOR_TABLE );
if ( pItem != NULL )
pColorTable = ( (SvxColorListItem*)pItem )->GetColorList();
}
@ -562,7 +561,6 @@ sal_Bool SvxBorderTabPage::FillItemSet( SfxItemSet& rCoreAttrs )
SvxBoxItem* pOldBoxItem = (SvxBoxItem*)GetOldItem( rCoreAttrs, SID_ATTR_BORDER_OUTER );
SfxMapUnit eCoreUnit = rOldSet.GetPool()->GetMetric( nBoxWhich );
const SfxPoolItem* pOld = 0;
//------------------
// outer border:
@ -684,7 +682,7 @@ sal_Bool SvxBorderTabPage::FillItemSet( SfxItemSet& rCoreAttrs )
rCoreAttrs.Put( aBoxItem );
bAttrsChanged |= sal_True;
}
pOld = GetOldItem( rCoreAttrs, SID_ATTR_BORDER_INNER, sal_False );
const SfxPoolItem* pOld = GetOldItem( rCoreAttrs, SID_ATTR_BORDER_INNER, sal_False );
if ( !pOld || !( *(const SvxBoxInfoItem*)pOld == aBoxInfoItem ) )
{
@ -796,7 +794,7 @@ IMPL_LINK_NOARG(SvxBorderTabPage, SelSdwHdl_Impl)
IMPL_LINK( SvxBorderTabPage, SelColHdl_Impl, ListBox *, pLb )
{
ColorListBox* pColLb = (ColorListBox*)pLb;
ColorListBox* pColLb = (ColorListBox*)(pLb);
if (pLb == m_pLbLineColor)
{

View file

@ -107,18 +107,19 @@ void GalleryBackgroundPopup::StateChanged( sal_uInt16 nSID, SfxItemState eState,
if ( ( nSID == SID_GALLERY_BG_BRUSH ) && pItem && ( eState != SFX_ITEM_DISABLED ) )
{
SfxStringListItem* pStrLstItem;
SfxStringItem* pStrItem;
PopupMenu::Clear();
if( ( pStrLstItem = PTR_CAST( SfxStringListItem, pItem ) ) != NULL )
if ( ( pStrLstItem = PTR_CAST( SfxStringListItem, pItem ) ) != NULL )
{
const std::vector<String> &aList = pStrLstItem->GetList();
for ( sal_uIntPtr i = 0, nCount = aList.size(); i < nCount; i++ )
InsertItem( (sal_uInt16) i + 1, aList[i]);
return;
}
else if( ( pStrItem = PTR_CAST( SfxStringItem, pItem ) ) != NULL )
SfxStringItem* pStrItem = PTR_CAST( SfxStringItem, pItem );
if (pStrItem)
InsertItem( 1, pStrItem->GetValue() );
else
{

View file

@ -460,8 +460,8 @@ void printMethods(std::ostream & o,
// REMOVE next line
OUString tmp = reader.getFieldName(i);
bool setAttrMethod = false;
if ( (reader.getFieldFlags(i) & RT_ACCESS_READONLY) == 0 ) {
bool setAttrMethod = false;
o << indentation << "public void set"
<< (codemaker::convertString(reader.getFieldName(i)).
getStr())

View file

@ -243,7 +243,6 @@ void ImplSalPostDispatchMsg( MSG* pMsg, LRESULT /* nDispatchResult */ )
{
// Used for Unicode and none Unicode
SalData* pSalData = GetSalData();
WinSalFrame* pFrame;
if ( (pMsg->message == WM_KEYDOWN) || (pMsg->message == WM_KEYUP) )
{
@ -253,7 +252,7 @@ void ImplSalPostDispatchMsg( MSG* pMsg, LRESULT /* nDispatchResult */ )
if ( pMsg->hwnd == ::GetFocus() )
{
ImplSalYieldMutexAcquireWithWait();
pFrame = ImplFindSalObjectFrame( pMsg->hwnd );
WinSalFrame* pFrame = ImplFindSalObjectFrame( pMsg->hwnd );
if ( pFrame )
ImplHandleSalObjKeyMsg( pFrame->mhWnd, pMsg->message, pMsg->wParam, pMsg->lParam );
ImplSalYieldMutexRelease();