diff options
author | Michael Dunphy <mdunphy@uwaterloo.ca> | 2015-03-22 01:04:12 +0100 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2015-03-23 08:48:56 +0000 |
commit | da631972229389d40e0502e02ff4e2c0761ca3fc (patch) | |
tree | 2218df146e11799e5089a6436b306ca81e2d720b /svx | |
parent | b0c1d2a7f368ed8af46d358e4b4350eb435fa241 (diff) |
fdo#39440 cppcheck cleanliness
Reduce scope of local variables.
Change-Id: I5f06dc0d9d16e92a7a0afb599eb3a93d9d5cc878
Reviewed-on: https://gerrit.libreoffice.org/14943
Reviewed-by: David Tardon <dtardon@redhat.com>
Tested-by: David Tardon <dtardon@redhat.com>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/accessibility/svxrectctaccessiblecontext.cxx | 3 | ||||
-rw-r--r-- | svx/source/dialog/dlgctrl.cxx | 3 | ||||
-rw-r--r-- | svx/source/svdraw/svdglev.cxx | 6 | ||||
-rw-r--r-- | svx/source/svdraw/svdotextdecomposition.cxx | 4 | ||||
-rw-r--r-- | svx/source/svdraw/svdpage.cxx | 3 | ||||
-rw-r--r-- | svx/source/table/tablecontroller.cxx | 2 |
6 files changed, 9 insertions, 12 deletions
diff --git a/svx/source/accessibility/svxrectctaccessiblecontext.cxx b/svx/source/accessibility/svxrectctaccessiblecontext.cxx index 16c07cd9d06b..0fd553d8aa68 100644 --- a/svx/source/accessibility/svxrectctaccessiblecontext.cxx +++ b/svx/source/accessibility/svxrectctaccessiblecontext.cxx @@ -580,11 +580,10 @@ void SvxRectCtlAccessibleContext::FireChildFocus( RECT_POINT eButton ) if( nNew < nNumOfChildren ) { // select new child - SvxRectCtlChildAccessibleContext* pChild; mnSelectedChild = nNew; if( nNew != NOCHILDSELECTED ) { - pChild = mpChildren[ nNew ]; + SvxRectCtlChildAccessibleContext* pChild = mpChildren[ nNew ]; if( pChild ) { pChild->FireFocusEvent(); diff --git a/svx/source/dialog/dlgctrl.cxx b/svx/source/dialog/dlgctrl.cxx index d673e2b8d78d..6606c6491a39 100644 --- a/svx/source/dialog/dlgctrl.cxx +++ b/svx/source/dialog/dlgctrl.cxx @@ -1218,14 +1218,13 @@ void HatchingLB::Fill( const XHatchListRef &pList ) return; mpList = pList; - XHatchEntry* pEntry; long nCount = pList->Count(); SetUpdateMode( false ); for( long i = 0; i < nCount; i++ ) { - pEntry = pList->GetHatch( i ); + XHatchEntry* pEntry = pList->GetHatch( i ); const Bitmap aBitmap = pList->GetUiBitmap( i ); if( !aBitmap.IsEmpty() ) InsertEntry(pEntry->GetName(), Image(aBitmap)); diff --git a/svx/source/svdraw/svdglev.cxx b/svx/source/svdraw/svdglev.cxx index c1b21ba6ac44..85affa680634 100644 --- a/svx/source/svdraw/svdglev.cxx +++ b/svx/source/svdraw/svdglev.cxx @@ -89,10 +89,10 @@ void SdrGlueEditView::ImpDoMarkedGluePoints(PGlueDoFunc pDoFunc, bool bConst, co static void ImpGetEscDir(SdrGluePoint& rGP, const SdrObject* /*pObj*/, const void* pbFirst, const void* pnThisEsc, const void* pnRet, const void*, const void*) { sal_uInt16& nRet=*(sal_uInt16*)pnRet; - bool& bFirst=*(bool*)pbFirst; if (nRet!=FUZZY) { sal_uInt16 nEsc = rGP.GetEscDir(); bool bOn = (nEsc & *(sal_uInt16*)pnThisEsc) != 0; + bool& bFirst=*(bool*)pbFirst; if (bFirst) { nRet = bOn ? 1 : 0; bFirst = false; @@ -131,9 +131,9 @@ void SdrGlueEditView::SetMarkedGluePointsEscDir(sal_uInt16 nThisEsc, bool bOn) static void ImpGetPercent(SdrGluePoint& rGP, const SdrObject* /*pObj*/, const void* pbFirst, const void* pnRet, const void*, const void*, const void*) { sal_uInt16& nRet=*(sal_uInt16*)pnRet; - bool& bFirst=*(bool*)pbFirst; if (nRet!=FUZZY) { bool bOn=rGP.IsPercent(); + bool& bFirst=*(bool*)pbFirst; if (bFirst) { nRet=sal_uInt16(bOn); bFirst=false; } else if ((nRet!=0)!=bOn) nRet=FUZZY; } @@ -168,7 +168,6 @@ void SdrGlueEditView::SetMarkedGluePointsPercent(bool bOn) static void ImpGetAlign(SdrGluePoint& rGP, const SdrObject* /*pObj*/, const void* pbFirst, const void* pbDontCare, const void* pbVert, const void* pnRet, const void*) { sal_uInt16& nRet=*(sal_uInt16*)pnRet; - bool& bFirst=*(bool*)pbFirst; bool& bDontCare=*(bool*)pbDontCare; bool bVert=*(bool*)pbVert; if (!bDontCare) { @@ -178,6 +177,7 @@ static void ImpGetAlign(SdrGluePoint& rGP, const SdrObject* /*pObj*/, const void } else { nAlg=rGP.GetHorzAlign(); } + bool& bFirst=*(bool*)pbFirst; if (bFirst) { nRet=nAlg; bFirst=false; } else if (nRet!=nAlg) { if (bVert) { diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx index fa2dc701d8e8..2f1003a2d6b3 100644 --- a/svx/source/svdraw/svdotextdecomposition.cxx +++ b/svx/source/svdraw/svdotextdecomposition.cxx @@ -1194,7 +1194,6 @@ void SdrTextObj::impGetBlinkTextTiming(drawinglayer::animation::AnimationEntryLi // get values const SfxItemSet& rSet = GetObjectItemSet(); const sal_uInt32 nRepeat((sal_uInt32)static_cast<const SdrTextAniCountItem&>(rSet.Get(SDRATTR_TEXT_ANICOUNT)).GetValue()); - bool bVisisbleWhenStopped(static_cast<const SdrTextAniStopInsideItem&>(rSet.Get(SDRATTR_TEXT_ANISTOPINSIDE)).GetValue()); double fDelay((double)static_cast<const SdrTextAniDelayItem&>(rSet.Get(SDRATTR_TEXT_ANIDELAY)).GetValue()); if(0.0 == fDelay) @@ -1214,6 +1213,7 @@ void SdrTextObj::impGetBlinkTextTiming(drawinglayer::animation::AnimationEntryLi // add stopped state if loop is not endless if(0L != nRepeat) { + bool bVisisbleWhenStopped(static_cast<const SdrTextAniStopInsideItem&>(rSet.Get(SDRATTR_TEXT_ANISTOPINSIDE)).GetValue()); drawinglayer::animation::AnimationEntryFixed aStop(ENDLESS_TIME, bVisisbleWhenStopped ? 0.0 : 1.0); rAnimList.append(aStop); } @@ -1262,7 +1262,6 @@ void impCreateAlternateTiming(const SfxItemSet& rSet, drawinglayer::animation::A const double fStartPosition(bForward ? fRelativeTextLength : 1.0 - fRelativeTextLength); const double fEndPosition(bForward ? 1.0 - fRelativeTextLength : fRelativeTextLength); - bool bVisisbleWhenStopped(static_cast<const SdrTextAniStopInsideItem&>(rSet.Get(SDRATTR_TEXT_ANISTOPINSIDE)).GetValue()); bool bVisisbleWhenStarted(static_cast<const SdrTextAniStartInsideItem&>(rSet.Get(SDRATTR_TEXT_ANISTOPINSIDE )).GetValue()); const sal_uInt32 nRepeat(static_cast<const SdrTextAniCountItem&>(rSet.Get(SDRATTR_TEXT_ANICOUNT)).GetValue()); @@ -1304,6 +1303,7 @@ void impCreateAlternateTiming(const SfxItemSet& rSet, drawinglayer::animation::A if(0L != nRepeat) { + bool bVisisbleWhenStopped(static_cast<const SdrTextAniStopInsideItem&>(rSet.Get(SDRATTR_TEXT_ANISTOPINSIDE)).GetValue()); if(bVisisbleWhenStopped) { // add timing for staying at the end diff --git a/svx/source/svdraw/svdpage.cxx b/svx/source/svdraw/svdpage.cxx index 757b517560d6..84bad358cc50 100644 --- a/svx/source/svdraw/svdpage.cxx +++ b/svx/source/svdraw/svdpage.cxx @@ -742,11 +742,10 @@ void SdrObjList::UnGroupObj( size_t nObjNum ) // the position at which we insert the members of rUngroupGroup size_t nInsertPos( pUngroupGroup->GetOrdNum() ); - SdrObject* pObj; const size_t nCount = pSrcLst->GetObjCount(); for( size_t i=0; i<nCount; ++i ) { - pObj = pSrcLst->RemoveObject(0); + SdrObject* pObj = pSrcLst->RemoveObject(0); SdrInsertReason aReason(SDRREASON_VIEWCALL, pUngroupGroup); InsertObject(pObj, nInsertPos, &aReason); ++nInsertPos; diff --git a/svx/source/table/tablecontroller.cxx b/svx/source/table/tablecontroller.cxx index 119ff78865f3..0abbf7ee4367 100644 --- a/svx/source/table/tablecontroller.cxx +++ b/svx/source/table/tablecontroller.cxx @@ -2829,10 +2829,10 @@ void lcl_MergeBorderLine( const sal_uInt16 nInnerLine(bBorder ? 0 : ((nValidFlag & VALID_HORI) ? BOXINFO_LINE_HORI : BOXINFO_LINE_VERT)); BoxItemWrapper aBoxItem(rLinesState.rBoxItem, rLinesState.rBoxInfoItem, nLine, nInnerLine, bBorder); bool& rbSet(bBorder ? rLinesState.aBorderSet[nLine] : rLinesState.aInnerLineSet[nInnerLine]); - bool& rbIndeterminate(bBorder ? rLinesState.aBorderIndeterminate[nLine] : rLinesState.aInnerLineIndeterminate[nInnerLine]); if (rbSet) { + bool& rbIndeterminate(bBorder ? rLinesState.aBorderIndeterminate[nLine] : rLinesState.aInnerLineIndeterminate[nInnerLine]); if (!rbIndeterminate) { const SvxBorderLine* const pMergedLine(aBoxItem.getLine()); |