diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2015-10-12 21:44:46 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2015-10-13 06:22:33 +0000 |
commit | ed7361ef0bdb6bee4f47a8421221eb7824f02e38 (patch) | |
tree | b745a27d916bb923f01857148e16485ac319f288 /sd | |
parent | 239c75ed63fb31cfef9cee13d8d58c4fe9e7a906 (diff) |
cppcheck:variableScope
Change-Id: I7cbd5a9e9bb5417f754d4e2445df309140fd40af
Reviewed-on: https://gerrit.libreoffice.org/19329
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/core/stlpool.cxx | 3 | ||||
-rw-r--r-- | sd/source/filter/ppt/pptinanimations.cxx | 14 | ||||
-rw-r--r-- | sd/source/ui/func/fuinsfil.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/func/fuoaprms.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/func/fusel.cxx | 6 | ||||
-rw-r--r-- | sd/source/ui/func/futext.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/unoidl/unosrch.cxx | 2 |
7 files changed, 16 insertions, 17 deletions
diff --git a/sd/source/core/stlpool.cxx b/sd/source/core/stlpool.cxx index b2f159bb9cfb..212a81a83972 100644 --- a/sd/source/core/stlpool.cxx +++ b/sd/source/core/stlpool.cxx @@ -209,7 +209,6 @@ void SdStyleSheetPool::CreateLayoutStyleSheets(const OUString& rLayoutName, bool OUString aName(SD_RESSTR(STR_LAYOUT_OUTLINE)); OUString aHelpFile; - SfxStyleSheetBase* pParent = NULL; SvxLRSpaceItem aSvxLRSpaceItem( EE_PARA_LRSPACE ); SvxULSpaceItem aSvxULSpaceItem( EE_PARA_ULSPACE ); @@ -312,7 +311,7 @@ void SdStyleSheetPool::CreateLayoutStyleSheets(const OUString& rLayoutName, bool // if we created outline styles, we need to chain them if( bCreated ) { - pParent = NULL; + SfxStyleSheetBase* pParent = NULL; for (sal_Int32 nLevel = 1; nLevel < 10; nLevel++) { OUString aLevelName( aPrefix + aName + " " + OUString::number( nLevel ) ); diff --git a/sd/source/filter/ppt/pptinanimations.cxx b/sd/source/filter/ppt/pptinanimations.cxx index 8d9907e3c610..dffd6656ae1d 100644 --- a/sd/source/filter/ppt/pptinanimations.cxx +++ b/sd/source/filter/ppt/pptinanimations.cxx @@ -3358,15 +3358,15 @@ void AnimationImporter::dump( Any& rAny ) } else if( rAny >>= aEvent ) { - static const char* triggers[] = - { - "none","onbegin","onend","begin", - "end","onclick","ondoubleclick","onmouseenter", - "onmouseleave","onpptnext","onpptprev","onstopaudio" - }; - if( aEvent.Trigger != EventTrigger::NONE ) { + static const char* triggers[] = + { + "none","onbegin","onend","begin", + "end","onclick","ondoubleclick","onmouseenter", + "onmouseleave","onpptnext","onpptprev","onstopaudio" + }; + if( aEvent.Source.hasValue() ) { dump_target( aEvent.Source ); diff --git a/sd/source/ui/func/fuinsfil.cxx b/sd/source/ui/func/fuinsfil.cxx index 163a9acf5e70..c2cf29a2491f 100644 --- a/sd/source/ui/func/fuinsfil.cxx +++ b/sd/source/ui/func/fuinsfil.cxx @@ -351,7 +351,6 @@ bool FuInsertFile::InsSDDinDrMode(SfxMedium* pMedium) First, insert pages */ std::vector<OUString> aBookmarkList = pDlg->GetList( 1 ); // pages bool bLink = pDlg->IsLink(); - bool bReplace = false; SdPage* pPage = NULL; ::sd::View* pView = mpViewShell ? mpViewShell->GetView() : NULL; @@ -394,6 +393,7 @@ bool FuInsertFile::InsSDDinDrMode(SfxMedium* pMedium) necessary. bNameOK is sal_False if the user has canceled. */ bNameOK = mpView->GetExchangeList( aExchangeList, aBookmarkList, 0 ); + bool bReplace = false; if( bNameOK ) bOK = mpDoc->InsertBookmarkAsPage( aBookmarkList, &aExchangeList, diff --git a/sd/source/ui/func/fuoaprms.cxx b/sd/source/ui/func/fuoaprms.cxx index 8c0b708df55c..6216f82033bc 100644 --- a/sd/source/ui/func/fuoaprms.cxx +++ b/sd/source/ui/func/fuoaprms.cxx @@ -626,7 +626,6 @@ void FuObjectAnimationParameters::DoExecute( SfxRequest& rReq ) pUndoGroup->SetComment(aComment); // for the path effect, remember some stuff - SdrObject* pRunningObj = NULL; SdrPathObj* pPath = NULL; if (eEffect == presentation::AnimationEffect_PATH && nEffectSet == ATTR_SET) { @@ -635,6 +634,7 @@ void FuObjectAnimationParameters::DoExecute( SfxRequest& rReq ) SdrObject* pObject2 = rMarkList.GetMark(1)->GetMarkedSdrObj(); SdrObjKind eKind1 = (SdrObjKind)pObject1->GetObjIdentifier(); SdrObjKind eKind2 = (SdrObjKind)pObject2->GetObjIdentifier(); + SdrObject* pRunningObj = NULL; if (pObject1->GetObjInventor() == SdrInventor && ((eKind1 == OBJ_LINE) || // 2 point line diff --git a/sd/source/ui/func/fusel.cxx b/sd/source/ui/func/fusel.cxx index 585454445d38..61f5b4b8fdc0 100644 --- a/sd/source/ui/func/fusel.cxx +++ b/sd/source/ui/func/fusel.cxx @@ -177,7 +177,6 @@ bool FuSelection::MouseButtonDown(const MouseEvent& rMEvt) ******************************************************************/ mpWindow->CaptureMouse(); pHdl = mpView->PickHandle(aMDPos); - SdrObject* pObj; SdrPageView* pPV; long nAngle0 = GetAngle(aMDPos - mpView->GetRef1()); @@ -239,6 +238,7 @@ bool FuSelection::MouseButtonDown(const MouseEvent& rMEvt) } else { + SdrObject* pObj; if (!rMEvt.IsMod2() && mpView->PickObj(aMDPos, mpView->getHitTolLog(), pObj, pPV, SdrSearchOptions::PICKMACRO)) { mpView->BegMacroObj(aMDPos, nHitLog, pObj, pPV, mpWindow); @@ -625,8 +625,6 @@ bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt) // (and deselect others) as a preparation for showing the context // menu. const bool bSelectionOnly = rMEvt.IsRight(); - SdrObject* pObj; - SdrPageView* pPV; if (bHideAndAnimate) { @@ -682,6 +680,8 @@ bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt) * If a user wants to click on an object in front of a marked * one, he releases the mouse button immediately **************************************************************/ + SdrPageView* pPV; + SdrObject* pObj; if (mpView->PickObj(aMDPos, mpView->getHitTolLog(), pObj, pPV, SdrSearchOptions::ALSOONMASTER | SdrSearchOptions::BEFOREMARK)) { if (pPV->IsObjSelectable(pObj)) diff --git a/sd/source/ui/func/futext.cxx b/sd/source/ui/func/futext.cxx index b6a29ddfca84..6159c81cb5d5 100644 --- a/sd/source/ui/func/futext.cxx +++ b/sd/source/ui/func/futext.cxx @@ -582,8 +582,6 @@ void FuText::ImpSetAttributesFitCommon(SdrTextObj* pTxtObj) bool FuText::MouseButtonUp(const MouseEvent& rMEvt) { bool bReturn = false; - SdrObject* pObj; - SdrPageView* pPV; if (aDragTimer.IsActive()) { aDragTimer.Stop(); @@ -655,6 +653,8 @@ bool FuText::MouseButtonUp(const MouseEvent& rMEvt) /************************************************************* * From text mode, you don't want to rotate immediately. **************************************************************/ + SdrObject* pObj; + SdrPageView* pPV; if (mpView->PickObj(aMDPos, mpView->getHitTolLog(), pObj, pPV, SdrSearchOptions::ALSOONMASTER | SdrSearchOptions::BEFOREMARK)) { if (pPV->IsObjSelectable(pObj)) diff --git a/sd/source/ui/unoidl/unosrch.cxx b/sd/source/ui/unoidl/unosrch.cxx index 4f6610a7e16e..0e70f81abf5e 100644 --- a/sd/source/ui/unoidl/unosrch.cxx +++ b/sd/source/ui/unoidl/unosrch.cxx @@ -476,7 +476,6 @@ uno::Reference< text::XTextRange > SdUnoSearchReplaceShape::Search( uno::Refere sal_Int32* pConvertPos = new sal_Int32[nTextLen+2]; sal_Int32* pConvertPara = new sal_Int32[nTextLen+2]; - int ndbg = 0; const sal_Unicode* pText = aText.getStr(); sal_Int32* pPos = pConvertPos; @@ -494,6 +493,7 @@ uno::Reference< text::XTextRange > SdUnoSearchReplaceShape::Search( uno::Refere while(xParaEnum->hasMoreElements()) { + int ndbg = 0; uno::Reference< text::XTextContent > xParagraph( xParaEnum->nextElement(), uno::UNO_QUERY ); if( xParagraph.is() ) xEnumAccess.set(xParagraph, css::uno::UNO_QUERY); |