[Libreoffice-commits] core.git: Branch 'feature/sidebar' - sc/source sd/source svx/source

Oliver-Rainer Wittmann orw at apache.org
Fri May 10 01:59:24 PDT 2013


 sc/source/ui/inc/drawview.hxx  |   13 +++++++++
 sc/source/ui/view/drawview.cxx |   54 +++++++++++++++++++++++++++++++++++++++++
 sd/source/ui/view/sdview.cxx   |   11 ++++++++
 svx/source/svdraw/svdedxv.cxx  |    4 ---
 4 files changed, 78 insertions(+), 4 deletions(-)

New commits:
commit 10b791ba57ae2985537649dd4c9a3a28b3ba8549
Author: Oliver-Rainer Wittmann <orw at apache.org>
Date:   Mon Apr 29 11:30:03 2013 +0000

    Related: #i122156# #i122087# correct context notification...
    
    regarding the text edit mode for Drawing objects - take two
    
    (cherry picked from commit 3dd1e0f85ba7d0fdcb2de134184407201ca7fae0)
    
    Conflicts:
    	sc/source/ui/inc/drawview.hxx
    	sc/source/ui/view/drawview.cxx
    
    Change-Id: Icfe16b76fc4fcc838133d8410736877703e5c23b

diff --git a/sc/source/ui/inc/drawview.hxx b/sc/source/ui/inc/drawview.hxx
index d636b61..f5de693 100644
--- a/sc/source/ui/inc/drawview.hxx
+++ b/sc/source/ui/inc/drawview.hxx
@@ -66,6 +66,19 @@ public:
 
     virtual void    DeleteMarked();
 
+    virtual sal_Bool SdrBeginTextEdit(
+        SdrObject* pObj,
+        SdrPageView* pPV = 0L,
+        ::Window* pWin = 0L,
+        sal_Bool bIsNewObj = sal_False,
+        SdrOutliner* pGivenOutliner = 0L,
+        OutlinerView* pGivenOutlinerView = 0L,
+        sal_Bool bDontDeleteOutliner = sal_False,
+        sal_Bool bOnlyOneView = sal_False,
+        sal_Bool bGrabFocus = sal_True);
+
+    virtual SdrEndTextEditKind SdrEndTextEdit( sal_Bool bDontDeleteReally = sal_False );
+
     void            MarkDropObj( SdrObject* pObj );
 
     void            SetMarkedToLayer( sal_uInt8 nLayerNo );
diff --git a/sc/source/ui/view/drawview.cxx b/sc/source/ui/view/drawview.cxx
index c664cbd..8f66038 100644
--- a/sc/source/ui/view/drawview.cxx
+++ b/sc/source/ui/view/drawview.cxx
@@ -535,6 +535,60 @@ void ScDrawView::MarkListHasChanged()
 
 }
 
+sal_Bool ScDrawView::SdrBeginTextEdit(
+    SdrObject* pObj,
+    SdrPageView* pPV,
+    ::Window* pWinL,
+    sal_Bool bIsNewObj,
+    SdrOutliner* pGivenOutliner,
+    OutlinerView* pGivenOutlinerView,
+    sal_Bool bDontDeleteOutliner,
+    sal_Bool bOnlyOneView,
+    sal_Bool bGrabFocus )
+{
+    const sal_Bool bRet = FmFormView::SdrBeginTextEdit(
+        pObj, pPV, pWinL, bIsNewObj,
+        pGivenOutliner, pGivenOutlinerView, bDontDeleteOutliner,
+        bOnlyOneView, bGrabFocus );
+
+    ScTabViewShell* pViewSh = pViewData->GetViewShell();
+    if ( pViewSh->GetViewFrame() )
+    {
+        SfxFrame& rFrame = pViewSh->GetViewFrame()->GetFrame();
+        uno::Reference< frame::XController > xController = rFrame.GetController();
+        if (xController.is())
+        {
+            ScTabViewObj* pImp = ScTabViewObj::getImplementation( xController );
+            if (pImp)
+                pImp->SelectionChanged();
+        }
+    }
+
+    return bRet;
+}
+
+
+SdrEndTextEditKind ScDrawView::SdrEndTextEdit( sal_Bool bDontDeleteReally )
+{
+    const SdrEndTextEditKind eRet = FmFormView::SdrEndTextEdit( bDontDeleteReally );
+
+    ScTabViewShell* pViewSh = pViewData->GetViewShell();
+    if ( pViewSh->GetViewFrame() )
+    {
+        SfxFrame& rFrame = pViewSh->GetViewFrame()->GetFrame();
+        uno::Reference< frame::XController > xController = rFrame.GetController();
+        if (xController.is())
+        {
+            ScTabViewObj* pImp = ScTabViewObj::getImplementation( xController );
+            if (pImp)
+                pImp->SelectionChanged();
+        }
+    }
+
+    return eRet;
+}
+
+
 void ScDrawView::ModelHasChanged()
 {
     SdrObject* pEditObj = GetTextEditObject();
diff --git a/sd/source/ui/view/sdview.cxx b/sd/source/ui/view/sdview.cxx
index c930b1b..1009c55 100644
--- a/sd/source/ui/view/sdview.cxx
+++ b/sd/source/ui/view/sdview.cxx
@@ -88,6 +88,7 @@
 #include <drawinglayer/primitive2d/textprimitive2d.hxx>
 #include <svx/unoapi.hxx>
 #include <basegfx/matrix/b2dhommatrixtools.hxx>
+#include "DrawController.hxx"
 
 #include <numeric>
 
@@ -695,6 +696,11 @@ sal_Bool View::SdrBeginTextEdit(
         pGivenOutlinerView, bDontDeleteOutliner,
         bOnlyOneView, bGrabFocus);
 
+    if ( mpViewSh )
+    {
+        mpViewSh->GetViewShellBase().GetDrawController().FireSelectionChangeListener();
+    }
+
     if (bReturn)
     {
         ::Outliner* pOL = GetTextEditOutliner();
@@ -761,6 +767,11 @@ SdrEndTextEditKind View::SdrEndTextEdit(sal_Bool bDontDeleteReally )
 
     if( xObj.is() )
     {
+        if ( mpViewSh )
+        {
+            mpViewSh->GetViewShellBase().GetDrawController().FireSelectionChangeListener();
+        }
+
         SdPage* pPage = dynamic_cast< SdPage* >( xObj->GetPage() );
         if( pPage )
             pPage->onEndTextEdit( xObj.get() );
diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index 0866328..654cf7f 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -673,8 +673,6 @@ sal_Bool SdrObjEditView::SdrBeginTextEdit(
             // Since IsMarkHdlWhenTextEdit() is ignored, it is necessary
             // to call AdjustMarkHdl() always.
             AdjustMarkHdl();
-            // Call <MarkListHasChanged()> as it also handles context changes for sidebar
-            MarkListHasChanged();
 
             pTextEditOutlinerView=ImpMakeOutlinerView(pWin,!bEmpty,pGivenOutlinerView);
 
@@ -928,8 +926,6 @@ SdrEndTextEditKind SdrObjEditView::SdrEndTextEdit(sal_Bool bDontDeleteReally)
             // Since IsMarkHdlWhenTextEdit() is ignored, it is necessary
             // to call AdjustMarkHdl() always.
             AdjustMarkHdl();
-            // Call <MarkListHasChanged()> as it also handles context changes for sidebar
-            MarkListHasChanged();
         }
         // delete all OutlinerViews
         for (sal_uIntPtr i=pTEOutliner->GetViewCount(); i>0;)


More information about the Libreoffice-commits mailing list