summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-05-08 15:57:31 +0100
committerCaolán McNamara <caolanm@redhat.com>2014-05-08 16:10:43 +0100
commita9324fb76cd5841cb78ff59da7cfc1e00f10889c (patch)
tree46e41e772b16fb56eaee4096771f5b7581f7e317 /sc
parent930d4b4268ef9584a77bb28425ff26c4b70bc9cd (diff)
coverity#735474 Logically dead code
Change-Id: I63ccafff98feb998e7632801ec8c7161f50c7991
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/drawfunc/futext.cxx139
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;
+ }
+ }
}
}