Author: orw
Date: Mon Apr 29 12:30:03 2013
New Revision: 1476999

URL: http://svn.apache.org/r1476999
Log:
122156 122087: correct context notification regarding the text edit mode for 
Drawing objects - take two

Modified:
    openoffice/trunk/main/sc/source/ui/inc/drawview.hxx
    openoffice/trunk/main/sc/source/ui/view/drawview.cxx
    openoffice/trunk/main/sd/source/ui/view/sdview.cxx
    openoffice/trunk/main/svx/source/svdraw/svdedxv.cxx

Modified: openoffice/trunk/main/sc/source/ui/inc/drawview.hxx
URL: 
http://svn.apache.org/viewvc/openoffice/trunk/main/sc/source/ui/inc/drawview.hxx?rev=1476999&r1=1476998&r2=1476999&view=diff
==============================================================================
--- openoffice/trunk/main/sc/source/ui/inc/drawview.hxx (original)
+++ openoffice/trunk/main/sc/source/ui/inc/drawview.hxx Mon Apr 29 12:30:03 2013
@@ -75,7 +75,20 @@ public:
 
     virtual void    DeleteMarked();
 
-       void                    DrawMarks( OutputDevice* pOut ) const;
+    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                       DrawMarks( OutputDevice* pOut ) const;
 
        void                    MarkDropObj( SdrObject* pObj );
 

Modified: openoffice/trunk/main/sc/source/ui/view/drawview.cxx
URL: 
http://svn.apache.org/viewvc/openoffice/trunk/main/sc/source/ui/view/drawview.cxx?rev=1476999&r1=1476998&r2=1476999&view=diff
==============================================================================
--- openoffice/trunk/main/sc/source/ui/view/drawview.cxx (original)
+++ openoffice/trunk/main/sc/source/ui/view/drawview.cxx Mon Apr 29 12:30:03 
2013
@@ -587,6 +587,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 __EXPORT ScDrawView::ModelHasChanged()
 {
        SdrObject* pEditObj = GetTextEditObject();

Modified: openoffice/trunk/main/sd/source/ui/view/sdview.cxx
URL: 
http://svn.apache.org/viewvc/openoffice/trunk/main/sd/source/ui/view/sdview.cxx?rev=1476999&r1=1476998&r2=1476999&view=diff
==============================================================================
--- openoffice/trunk/main/sd/source/ui/view/sdview.cxx (original)
+++ openoffice/trunk/main/sd/source/ui/view/sdview.cxx Mon Apr 29 12:30:03 2013
@@ -97,6 +97,7 @@
 #include <drawinglayer/primitive2d/textprimitive2d.hxx>
 #include <svx/unoapi.hxx>
 #include <basegfx/matrix/b2dhommatrixtools.hxx>
+#include "DrawController.hxx"
 
 #include <numeric>
 
@@ -780,33 +781,38 @@ sal_Bool View::SdrBeginTextEdit(
                pGivenOutlinerView, bDontDeleteOutliner,
                bOnlyOneView, bGrabFocus);
 
-       if (bReturn)
-       {
-               ::Outliner* pOL = GetTextEditOutliner();
+    if ( mpViewSh )
+    {
+        
mpViewSh->GetViewShellBase().GetDrawController().FireSelectionChangeListener();
+    }
 
-               if( pObj && pObj->GetPage() )
-               {
-                       Color aBackground;
-                       if( pObj->GetObjInventor() == SdrInventor && 
pObj->GetObjIdentifier() == OBJ_TABLE )
-                       {
-                               aBackground = GetTextEditBackgroundColor(*this);
-                       }
-                       else
-                       {
-                               aBackground = 
pObj->GetPage()->GetPageBackgroundColor(pPV);
-                       }
+    if (bReturn)
+    {
+        ::Outliner* pOL = GetTextEditOutliner();
+
+        if( pObj && pObj->GetPage() )
+        {
+            Color aBackground;
+            if( pObj->GetObjInventor() == SdrInventor && 
pObj->GetObjIdentifier() == OBJ_TABLE )
+            {
+                aBackground = GetTextEditBackgroundColor(*this);
+            }
+            else
+            {
+                aBackground = pObj->GetPage()->GetPageBackgroundColor(pPV);
+            }
             if (pOL != NULL)
                 pOL->SetBackgroundColor( aBackground  );
-               }
+        }
 
         if (pOL != NULL)
         {
             pOL->SetParaInsertedHdl(LINK(this, View, OnParagraphInsertedHdl));
             pOL->SetParaRemovingHdl(LINK(this, View, OnParagraphRemovingHdl));
         }
-       }
+    }
 
-       return(bReturn);
+    return(bReturn);
 }
 
 /** ends current text editing */
@@ -846,6 +852,11 @@ SdrEndTextEditKind View::SdrEndTextEdit(
 
     if( xObj.is() )
     {
+        if ( mpViewSh )
+        {
+            
mpViewSh->GetViewShellBase().GetDrawController().FireSelectionChangeListener();
+        }
+
         SdPage* pPage = dynamic_cast< SdPage* >( xObj->GetPage() );
         if( pPage )
             pPage->onEndTextEdit( xObj.get() );

Modified: openoffice/trunk/main/svx/source/svdraw/svdedxv.cxx
URL: 
http://svn.apache.org/viewvc/openoffice/trunk/main/svx/source/svdraw/svdedxv.cxx?rev=1476999&r1=1476998&r2=1476999&view=diff
==============================================================================
--- openoffice/trunk/main/svx/source/svdraw/svdedxv.cxx (original)
+++ openoffice/trunk/main/svx/source/svdraw/svdedxv.cxx Mon Apr 29 12:30:03 2013
@@ -695,8 +695,6 @@ sal_Bool SdrObjEditView::SdrBeginTextEdi
             // 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);
 
@@ -1033,8 +1031,6 @@ SdrEndTextEditKind SdrObjEditView::SdrEn
             // Since IsMarkHdlWhenTextEdit() is ignored, it is necessary
             // to call AdjustMarkHdl() always.
             AdjustMarkHdl();
-            // Call <MarkListHasChanged()> as it also handles context changes 
for sidebar
-            MarkListHasChanged();
         }
         // alle OutlinerViews loeschen
         for (sal_uIntPtr i=pTEOutliner->GetViewCount(); i>0;)


Reply via email to