[Libreoffice-commits] core.git: sc/source

Lennard Wasserthal Wasserthal at nefkom.net
Thu Mar 21 01:34:01 PDT 2013


 sc/source/ui/drawfunc/fudraw.cxx |   15 +++++++++++++++
 sc/source/ui/drawfunc/futext.cxx |   22 ++++++++++++++++++++--
 sc/source/ui/inc/fudraw.hxx      |    1 +
 3 files changed, 36 insertions(+), 2 deletions(-)

New commits:
commit b71d3ad1fd71092e4cc85f5bb96b3bc3347e55d2
Author: Lennard Wasserthal <Wasserthal at nefkom.net>
Date:   Sun Mar 17 10:41:15 2013 +0100

    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 at nefkom.net>
    Reviewed-on: https://gerrit.libreoffice.org/2786
    Reviewed-by: Fridrich Strba <fridrich at documentfoundation.org>
    Tested-by: Fridrich Strba <fridrich at documentfoundation.org>

diff --git a/sc/source/ui/drawfunc/fudraw.cxx b/sc/source/ui/drawfunc/fudraw.cxx
index 59922ae..fc72d7b 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 02d086a..70be824 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 158b032..fdff18a 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:


More information about the Libreoffice-commits mailing list