summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2012-12-19 23:54:10 +0100
committerJulien Nabet <serval2412@yahoo.fr>2012-12-19 23:54:32 +0100
commitd507c57a86cde92428aaa029053b27154373a4f3 (patch)
tree27bb609d42b7c0e415f281efae2cb789c2f03d33
parent3e88ca86e9e3735ae8fbf144fcf51417c75baac8 (diff)
Some cppcheck cleaning
Change-Id: I750058d7e25de26bf82e76ff09c69257ae09c5ba
-rw-r--r--svx/source/dialog/hdft.cxx2
-rw-r--r--svx/source/dialog/imapwnd.cxx4
-rw-r--r--svx/source/items/numfmtsh.cxx16
-rw-r--r--svx/source/svdraw/svddrgmt.cxx7
-rw-r--r--svx/source/svdraw/svdfmtf.cxx4
-rw-r--r--svx/source/svdraw/svdmrkv.cxx2
6 files changed, 14 insertions, 21 deletions
diff --git a/svx/source/dialog/hdft.cxx b/svx/source/dialog/hdft.cxx
index 092955f59763..28833813d21f 100644
--- a/svx/source/dialog/hdft.cxx
+++ b/svx/source/dialog/hdft.cxx
@@ -298,12 +298,12 @@ sal_Bool SvxHFPage::FillItemSet( SfxItemSet& rSet )
aSet.Put( *pBBSet );
else
{
- const SfxItemSet* _pSet;
const SfxPoolItem* pItem;
if ( SFX_ITEM_SET ==
GetItemSet().GetItemState( GetWhich( nId ), sal_False, &pItem ) )
{
+ const SfxItemSet* _pSet;
_pSet = &( (SvxSetItem*)pItem )->GetItemSet();
if ( _pSet->GetItemState( nWBrush ) == SFX_ITEM_SET )
diff --git a/svx/source/dialog/imapwnd.cxx b/svx/source/dialog/imapwnd.cxx
index dfbe83e6f2a4..af7a2060bc1e 100644
--- a/svx/source/dialog/imapwnd.cxx
+++ b/svx/source/dialog/imapwnd.cxx
@@ -547,12 +547,12 @@ sal_Int8 IMapWindow::ExecuteDrop( const ExecuteDropEvent& rEvt )
void IMapWindow::RequestHelp( const HelpEvent& rHEvt )
{
- SdrObject* pSdrObj = NULL;
- SdrPageView* pPageView = NULL;
Point aPos = PixelToLogic( ScreenToOutputPixel( rHEvt.GetMousePosPixel() ) );
if ( Help::IsBalloonHelpEnabled() || Help::IsQuickHelpEnabled() )
{
+ SdrObject* pSdrObj = NULL;
+ SdrPageView* pPageView = NULL;
if ( pView->PickObj( aPos, pView->getHitTolLog(), pSdrObj, pPageView ) )
{
const IMapObject* pIMapObj = GetIMapObj( pSdrObj );
diff --git a/svx/source/items/numfmtsh.cxx b/svx/source/items/numfmtsh.cxx
index d1c7b617c5ab..c16793445975 100644
--- a/svx/source/items/numfmtsh.cxx
+++ b/svx/source/items/numfmtsh.cxx
@@ -1313,15 +1313,13 @@ void SvxNumberFormatShell::SetComment4Entry(short nEntry,String aEntStr)
String SvxNumberFormatShell::GetComment4Entry(short nEntry)
{
- const SvNumberformat *pNumEntry;
-
if(nEntry < 0)
return String();
if( static_cast<size_t>(nEntry) < aCurEntryList.size())
{
sal_uInt32 nMyNfEntry=aCurEntryList[nEntry];
- pNumEntry = pFormatter->GetEntry(nMyNfEntry);
+ const SvNumberformat *pNumEntry = pFormatter->GetEntry(nMyNfEntry);
if(pNumEntry!=NULL)
return pNumEntry->GetComment();
}
@@ -1346,7 +1344,6 @@ String SvxNumberFormatShell::GetComment4Entry(short nEntry)
short SvxNumberFormatShell::GetCategory4Entry(short nEntry)
{
- const SvNumberformat *pNumEntry;
if(nEntry<0) return 0;
if( static_cast<size_t>(nEntry) < aCurEntryList.size() )
@@ -1355,7 +1352,7 @@ short SvxNumberFormatShell::GetCategory4Entry(short nEntry)
if(nMyNfEntry!=NUMBERFORMAT_ENTRY_NOT_FOUND)
{
- pNumEntry = pFormatter->GetEntry(nMyNfEntry);
+ const SvNumberformat *pNumEntry = pFormatter->GetEntry(nMyNfEntry);
sal_uInt16 nMyCat,nMyType;
if(pNumEntry!=NULL)
{
@@ -1392,13 +1389,12 @@ short SvxNumberFormatShell::GetCategory4Entry(short nEntry)
bool SvxNumberFormatShell::GetUserDefined4Entry(short nEntry)
{
- const SvNumberformat *pNumEntry;
- if(nEntry<0) return 0;
+ if(nEntry<0) return false;
if( static_cast<size_t>(nEntry) < aCurEntryList.size())
{
sal_uInt32 nMyNfEntry=aCurEntryList[nEntry];
- pNumEntry = pFormatter->GetEntry(nMyNfEntry);
+ const SvNumberformat *pNumEntry = pFormatter->GetEntry(nMyNfEntry);
if(pNumEntry!=NULL)
{
@@ -1429,8 +1425,6 @@ bool SvxNumberFormatShell::GetUserDefined4Entry(short nEntry)
String SvxNumberFormatShell::GetFormat4Entry(short nEntry)
{
- const SvNumberformat *pNumEntry;
-
if(nEntry < 0)
return String();
@@ -1442,7 +1436,7 @@ String SvxNumberFormatShell::GetFormat4Entry(short nEntry)
else
{
sal_uInt32 nMyNfEntry=aCurEntryList[nEntry];
- pNumEntry = pFormatter->GetEntry(nMyNfEntry);
+ const SvNumberformat *pNumEntry = pFormatter->GetEntry(nMyNfEntry);
if(pNumEntry!=NULL)
return pNumEntry->GetFormatstring();
diff --git a/svx/source/svdraw/svddrgmt.cxx b/svx/source/svdraw/svddrgmt.cxx
index 29603fd841e4..b618ac1ddfd2 100644
--- a/svx/source/svdraw/svddrgmt.cxx
+++ b/svx/source/svdraw/svddrgmt.cxx
@@ -1248,14 +1248,14 @@ void SdrDragObjOwn::MoveSdrDrag(const Point& rNoSnapPnt)
bool SdrDragObjOwn::EndSdrDrag(bool /*bCopy*/)
{
Hide();
- SdrUndoAction* pUndo = NULL;
- SdrUndoAction* pUndo2 = NULL;
std::vector< SdrUndoAction* > vConnectorUndoActions;
bool bRet = false;
SdrObject* pObj = GetDragObj();
if(pObj)
{
+ SdrUndoAction* pUndo = NULL;
+ SdrUndoAction* pUndo2 = NULL;
const bool bUndo = getSdrDragView().IsUndoEnabled();
if( bUndo )
@@ -2313,8 +2313,7 @@ void SdrDragShear::MoveSdrDrag(const Point& rPnt)
nWink=nNeuWink;
aFact=aNeuFact;
double a=nWink*nPi180;
- double nTan1=0.0;
- nTan1=tan(a); // calculate now, so as little time as possible passes between Hide() and Show()
+ double nTan1=tan(a); // calculate now, so as little time as possible passes between Hide() and Show()
Hide();
nTan=nTan1;
DragStat().NextMove(rPnt);
diff --git a/svx/source/svdraw/svdfmtf.cxx b/svx/source/svdraw/svdfmtf.cxx
index 1fd41d246214..6e7b7f4dfabb 100644
--- a/svx/source/svdraw/svdfmtf.cxx
+++ b/svx/source/svdraw/svdfmtf.cxx
@@ -928,13 +928,13 @@ void ImpSdrGDIMetaFileImport::DoAction(MetaMapModeAction& rAct)
void ImpSdrGDIMetaFileImport::MapScaling()
{
- size_t i, nAnz = aTmpList.size();
+ size_t nAnz = aTmpList.size();
const MapMode& rMap = aVD.GetMapMode();
Point aMapOrg( rMap.GetOrigin() );
sal_Bool bMov2 = aMapOrg.X() != 0 || aMapOrg.Y() != 0;
if ( bMov2 )
{
- for ( i = nMapScalingOfs; i < nAnz; i++ )
+ for (size_t i = nMapScalingOfs; i < nAnz; i++ )
{
SdrObject* pObj = aTmpList[i];
if ( bMov2 )
diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx
index dcf57db1301f..afeb4534b550 100644
--- a/svx/source/svdraw/svdmrkv.cxx
+++ b/svx/source/svdraw/svdmrkv.cxx
@@ -1427,7 +1427,6 @@ sal_Bool SdrMarkView::MarkObj(const Rectangle& rRect, sal_Bool bUnmark)
{
sal_Bool bFnd=sal_False;
Rectangle aR(rRect);
- SdrObject* pObj;
SdrObjList* pObjList;
BrkAction();
SdrPageView* pPV = GetSdrPageView();
@@ -1437,6 +1436,7 @@ sal_Bool SdrMarkView::MarkObj(const Rectangle& rRect, sal_Bool bUnmark)
pObjList=pPV->GetObjList();
Rectangle aFrm1(aR);
sal_uIntPtr nObjAnz=pObjList->GetObjCount();
+ SdrObject* pObj;
for (sal_uIntPtr nO=0; nO<nObjAnz; nO++) {
pObj=pObjList->GetObj(nO);
Rectangle aRect(pObj->GetCurrentBoundRect());