Kaydet (Commit) b71d3ad1 authored tarafından Lennard Wasserthal's avatar Lennard Wasserthal Kaydeden (comit) Fridrich Strba

fdo#55430 allowing click-from-textmode without causing fdo#61025

the last fix for #55430 caused #61025.
Markus Mohrhardt fixed that with by removing parts of the calc part
in 16f6ef0423cd0fd7c0e50ee28e8b32e72e21e090
I got it back where it causes no harm to the labels.

Change-Id: Ifb366a004701d7ec93b66662e14dba850d500e60
Signed-off-by: 's avatarLennard Wasserthal <Wasserthal@nefkom.net>
Reviewed-on: https://gerrit.libreoffice.org/2786Reviewed-by: 's avatarFridrich Strba <fridrich@documentfoundation.org>
Tested-by: 's avatarFridrich Strba <fridrich@documentfoundation.org>
üst 3333bb59
......@@ -768,6 +768,21 @@ void FuDraw::ForcePointer(const MouseEvent* pMEvt)
}
}
sal_Bool FuDraw::IsEditingANote( const MouseEvent& rMEvt ) const
{
const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
sal_Int32 backval=rMarkList.GetMarkCount();
for (sal_Int32 nlv1=0;nlv1<backval;nlv1++)
{
SdrObject* pObj = rMarkList.GetMark( nlv1 )->GetMarkedSdrObj();
if ( ScDrawLayer::IsNoteCaption( pObj ) )
{
return true;
}
}
return false;
}
sal_Bool FuDraw::IsSizingOrMovingNote( const MouseEvent& rMEvt ) const
{
sal_Bool bIsSizingOrMoving = false;
......
......@@ -132,9 +132,19 @@ sal_Bool FuText::MouseButtonDown(const MouseEvent& rMEvt)
if ( pView->IsTextEdit() )
{
if( !IsSizingOrMovingNote(rMEvt) )
if ( IsEditingANote(rMEvt) )
{
StopEditMode(); // Danebengeklickt, Ende mit Edit
if( !IsSizingOrMovingNote(rMEvt) )
{
StopEditMode(); // Danebengeklickt, Ende mit Edit
bStraightEnter = false;
}
}
else
{
StopEditMode(); // Clicked outside, ending edit.
pView->UnmarkAll();
bStraightEnter = false;
}
pView->SetCreateMode();
}
......@@ -322,6 +332,8 @@ sal_Bool FuText::MouseButtonDown(const MouseEvent& rMEvt)
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);
......@@ -343,6 +355,12 @@ sal_Bool FuText::MouseButtonDown(const MouseEvent& rMEvt)
pViewShell->SetActivePointer(pView->GetPreferedPointer(
pWindow->PixelToLogic(rMEvt.GetPosPixel()), pWindow ));
if (!bStraightEnter)
{
pView->UnmarkAll();
ScViewData& rViewData = *pViewShell->GetViewData();
rViewData.GetDispatcher().Execute(aSfxRequest.GetSlot(), SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD);
}
// return (bReturn);
return sal_True;
......
......@@ -49,6 +49,7 @@ class FuDraw : public FuPoor
// II
virtual void SelectionHasChanged();
sal_Bool IsEditingANote( const MouseEvent& rMEvt ) const;
sal_Bool IsSizingOrMovingNote( const MouseEvent& rMEvt ) const;
private:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment