diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-05-08 15:57:31 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-05-08 16:10:43 +0100 |
commit | a9324fb76cd5841cb78ff59da7cfc1e00f10889c (patch) | |
tree | 46e41e772b16fb56eaee4096771f5b7581f7e317 /sc/source | |
parent | 930d4b4268ef9584a77bb28425ff26c4b70bc9cd (diff) |
coverity#735474 Logically dead code
Change-Id: I63ccafff98feb998e7632801ec8c7161f50c7991
Diffstat (limited to 'sc/source')
-rw-r--r-- | sc/source/ui/drawfunc/futext.cxx | 139 |
1 files changed, 64 insertions, 75 deletions
diff --git a/sc/source/ui/drawfunc/futext.cxx b/sc/source/ui/drawfunc/futext.cxx index c898580b8c2e..c0822fa1b023 100644 --- a/sc/source/ui/drawfunc/futext.cxx +++ b/sc/source/ui/drawfunc/futext.cxx @@ -257,101 +257,90 @@ bool FuText::MouseButtonDown(const MouseEvent& rMEvt) } else { - bool bMacro = false; - -// if (bMacro && pView->TakeMacroObject(aMDPos,pObj,pPV)) - if (bMacro && pView->PickObj(aMDPos, pView->getHitTolLog(), pObj, pPV, SDRSEARCH_PICKMACRO) ) - - { - pView->BegMacroObj(aMDPos,pObj,pPV,pWindow); - } - else + if (pView->IsEditMode()) { - if (pView->IsEditMode()) - { - bool bPointMode=pView->HasMarkablePoints(); + bool bPointMode=pView->HasMarkablePoints(); - if (!rMEvt.IsShift()) + if (!rMEvt.IsShift()) + { + if (bPointMode) { - if (bPointMode) - { - pView->UnmarkAllPoints(); - } - else - { - pView->UnmarkAll(); - } - - pView->SetDragMode(SDRDRAG_MOVE); - SfxBindings& rBindings = pViewShell->GetViewFrame()->GetBindings(); - rBindings.Invalidate( SID_OBJECT_ROTATE ); - rBindings.Invalidate( SID_OBJECT_MIRROR ); + pView->UnmarkAllPoints(); } - - if ( pView->MarkObj(aMDPos, -2, false, rMEvt.IsMod1()) ) + else { - aDragTimer.Start(); + pView->UnmarkAll(); + } - pHdl=pView->PickHandle(aMDPos); + pView->SetDragMode(SDRDRAG_MOVE); + SfxBindings& rBindings = pViewShell->GetViewFrame()->GetBindings(); + rBindings.Invalidate( SID_OBJECT_ROTATE ); + rBindings.Invalidate( SID_OBJECT_MIRROR ); + } - if (pHdl!=NULL) - { - pView->MarkPoint(*pHdl); - pHdl=pView->GetHdl(nHdlNum); - } + if ( pView->MarkObj(aMDPos, -2, false, rMEvt.IsMod1()) ) + { + aDragTimer.Start(); - pView->BegDragObj(aMDPos, (OutputDevice*) NULL, pHdl); - } - else + pHdl=pView->PickHandle(aMDPos); + + if (pHdl!=NULL) { - if (bPointMode) - { - pView->BegMarkPoints(aMDPos); - } - else - { - pView->BegMarkObj(aMDPos); - } + pView->MarkPoint(*pHdl); + pHdl=pView->GetHdl(nHdlNum); } - } - else if (aSfxRequest.GetSlot() == SID_DRAW_NOTEEDIT ) - { - // Notizen editieren -> keine neuen Textobjekte erzeugen, - // stattdessen Textmodus verlassen - pViewShell->GetViewData()->GetDispatcher(). - Execute(aSfxRequest.GetSlot(), SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD); + pView->BegDragObj(aMDPos, (OutputDevice*) NULL, pHdl); } else { - if (bStraightEnter)//Hack for that silly idea that creating text fields is inside the text routine + if (bPointMode) { - /********************************************************** - * Objekt erzeugen - **********************************************************/ - // Hack to align object to nearest grid position where object - // would be anchored ( if it were cell anchored ) - // Get grid offset for current position ( note: aPnt is - // also adjusted ) - Point aGridOff = CurrentGridSyncOffsetAndPos( aMDPos ); - - bool bRet = pView->BegCreateObj(aMDPos, (OutputDevice*) NULL); - if ( bRet ) - pView->GetCreateObj()->SetGridOffset( aGridOff ); + pView->BegMarkPoints(aMDPos); } - else if (pView->PickObj(aMDPos, pView->getHitTolLog(), pObj, pPV, SDRSEARCH_ALSOONMASTER | SDRSEARCH_BEFOREMARK)) + else { - pView->UnmarkAllObj(); - ScViewData& rViewData = *pViewShell->GetViewData(); - rViewData.GetDispatcher().Execute(aSfxRequest.GetSlot(), SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD); - pView->MarkObj(pObj,pPV,false,false); - - pHdl=pView->PickHandle(aMDPos); - pView->BegDragObj(aMDPos, (OutputDevice*) NULL, pHdl); - return true; + pView->BegMarkObj(aMDPos); } } } + else if (aSfxRequest.GetSlot() == SID_DRAW_NOTEEDIT ) + { + // Notizen editieren -> keine neuen Textobjekte erzeugen, + // stattdessen Textmodus verlassen + + pViewShell->GetViewData()->GetDispatcher(). + Execute(aSfxRequest.GetSlot(), SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD); + } + else + { + if (bStraightEnter)//Hack for that silly idea that creating text fields is inside the text routine + { + /********************************************************** + * Objekt erzeugen + **********************************************************/ + // Hack to align object to nearest grid position where object + // would be anchored ( if it were cell anchored ) + // Get grid offset for current position ( note: aPnt is + // also adjusted ) + Point aGridOff = CurrentGridSyncOffsetAndPos( aMDPos ); + + bool bRet = pView->BegCreateObj(aMDPos, (OutputDevice*) NULL); + if ( bRet ) + pView->GetCreateObj()->SetGridOffset( aGridOff ); + } + else if (pView->PickObj(aMDPos, pView->getHitTolLog(), pObj, pPV, SDRSEARCH_ALSOONMASTER | SDRSEARCH_BEFOREMARK)) + { + pView->UnmarkAllObj(); + ScViewData& rViewData = *pViewShell->GetViewData(); + rViewData.GetDispatcher().Execute(aSfxRequest.GetSlot(), SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD); + pView->MarkObj(pObj,pPV,false,false); + + pHdl=pView->PickHandle(aMDPos); + pView->BegDragObj(aMDPos, (OutputDevice*) NULL, pHdl); + return true; + } + } } } |