diff options
author | Lennard Wasserthal <Wasserthal@nefkom.net> | 2013-03-17 10:41:15 +0100 |
---|---|---|
committer | Fridrich Strba <fridrich@documentfoundation.org> | 2013-03-21 08:33:42 +0000 |
commit | b71d3ad1fd71092e4cc85f5bb96b3bc3347e55d2 (patch) | |
tree | 6bcc6181b7b9c4752872755f1c6cd7756c50a298 /sc/source | |
parent | 3333bb59e2e22161fcf66e3c71f58f5b160a24c9 (diff) |
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: Lennard Wasserthal <Wasserthal@nefkom.net>
Reviewed-on: https://gerrit.libreoffice.org/2786
Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org>
Tested-by: Fridrich Strba <fridrich@documentfoundation.org>
Diffstat (limited to 'sc/source')
-rw-r--r-- | sc/source/ui/drawfunc/fudraw.cxx | 15 | ||||
-rw-r--r-- | sc/source/ui/drawfunc/futext.cxx | 22 | ||||
-rw-r--r-- | sc/source/ui/inc/fudraw.hxx | 1 |
3 files changed, 36 insertions, 2 deletions
diff --git a/sc/source/ui/drawfunc/fudraw.cxx b/sc/source/ui/drawfunc/fudraw.cxx index 59922ae950b2..fc72d7bc7df3 100644 --- a/sc/source/ui/drawfunc/fudraw.cxx +++ b/sc/source/ui/drawfunc/fudraw.cxx @@ -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; diff --git a/sc/source/ui/drawfunc/futext.cxx b/sc/source/ui/drawfunc/futext.cxx index 02d086a01c4f..70be8241c38f 100644 --- a/sc/source/ui/drawfunc/futext.cxx +++ b/sc/source/ui/drawfunc/futext.cxx @@ -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; diff --git a/sc/source/ui/inc/fudraw.hxx b/sc/source/ui/inc/fudraw.hxx index 158b0324d7e9..fdff18adf955 100644 --- a/sc/source/ui/inc/fudraw.hxx +++ b/sc/source/ui/inc/fudraw.hxx @@ -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: |