diff options
author | Oliver-Rainer Wittmann <orw@apache.org> | 2013-04-26 11:20:19 +0000 |
---|---|---|
committer | Michael Meeks <michael.meeks@suse.com> | 2013-05-20 11:33:24 +0100 |
commit | 8035ea995506557c6711c637435374a056662b8b (patch) | |
tree | 5b49fc8fb94f91872f1bdde5c7e634eadb208852 | |
parent | ff03b807b6fa4e20516dfe0b0908ac5ef82335a4 (diff) |
Related: #i122156# #i122087# correct context notification...
regarding the text edit mode for Drawing objects
(cherry picked from commit a0e76afb572510e2c2c75fc6c558f271c0d74d0b)
Change-Id: I8b4e5cbd865455ef3d7046f9d65c5dd68a53d8ce
-rw-r--r-- | sd/source/ui/view/sdview.cxx | 8 | ||||
-rw-r--r-- | svx/source/sidebar/SelectionAnalyzer.cxx | 59 | ||||
-rw-r--r-- | svx/source/svdraw/svdedxv.cxx | 4 |
3 files changed, 41 insertions, 30 deletions
diff --git a/sd/source/ui/view/sdview.cxx b/sd/source/ui/view/sdview.cxx index ed0579050984..6a6714cd4d5a 100644 --- a/sd/source/ui/view/sdview.cxx +++ b/sd/source/ui/view/sdview.cxx @@ -695,10 +695,6 @@ sal_Bool View::SdrBeginTextEdit( pGivenOutlinerView, bDontDeleteOutliner, bOnlyOneView, bGrabFocus); - ContextChangeEventMultiplexer::NotifyContextChange( - &GetViewShell()->GetViewShellBase(), - ::sfx2::sidebar::EnumContext::Context_DrawText); - if (bReturn) { ::Outliner* pOL = GetTextEditOutliner(); @@ -765,10 +761,6 @@ SdrEndTextEditKind View::SdrEndTextEdit(sal_Bool bDontDeleteReally ) if( xObj.is() ) { - ContextChangeEventMultiplexer::NotifyContextChange( - &GetViewShell()->GetViewShellBase(), - ::sfx2::sidebar::EnumContext::Context_Default); - SdPage* pPage = dynamic_cast< SdPage* >( xObj->GetPage() ); if( pPage ) pPage->onEndTextEdit( xObj.get() ); diff --git a/svx/source/sidebar/SelectionAnalyzer.cxx b/svx/source/sidebar/SelectionAnalyzer.cxx index 2f201e98125c..44fa4073af6c 100644 --- a/svx/source/sidebar/SelectionAnalyzer.cxx +++ b/svx/source/sidebar/SelectionAnalyzer.cxx @@ -19,6 +19,7 @@ #include "svx/sidebar/SelectionAnalyzer.hxx" #include "svx/svdmrkv.hxx" #include "svx/svdobj.hxx" +#include "svx/svdotext.hxx" #include "svx/svdpage.hxx" #include "svx/fmglob.hxx" #include "svx/globl3d.hxx" @@ -42,12 +43,19 @@ EnumContext::Context SelectionAnalyzer::GetContextForSelection_SC (const SdrMark case 1: { SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj(); - const sal_uInt32 nInv = pObj->GetObjInventor(); - const sal_uInt16 nObjId = pObj->GetObjIdentifier(); - if (nInv == SdrInventor) - eContext = GetContextForObjectId_SC(nObjId); - else if (nInv == FmFormInventor) - eContext = EnumContext::Context_Form; + if ( pObj->ISA(SdrTextObj) && ((SdrTextObj*)pObj)->IsInEditMode() ) + { + eContext = EnumContext::Context_DrawText; + } + else + { + const sal_uInt32 nInv = pObj->GetObjInventor(); + const sal_uInt16 nObjId = pObj->GetObjIdentifier(); + if (nInv == SdrInventor) + eContext = GetContextForObjectId_SC(nObjId); + else if (nInv == FmFormInventor) + eContext = EnumContext::Context_Form; + } break; } @@ -109,25 +117,32 @@ EnumContext::Context SelectionAnalyzer::GetContextForSelection_SD ( case 1: { SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj(); - const sal_uInt32 nInv = pObj->GetObjInventor(); - sal_uInt16 nObjId = pObj->GetObjIdentifier(); - if (nInv == SdrInventor) - { - if (nObjId == OBJ_GRUP) - { - nObjId = GetObjectTypeFromGroup(pObj); - if (nObjId == 0) - nObjId = OBJ_GRUP; - } - eContext = GetContextForObjectId_SD(nObjId, bIsHandoutPage, bIsNotesPage); - } - else if (nInv == E3dInventor) + if ( pObj->ISA(SdrTextObj) && ((SdrTextObj*)pObj)->IsInEditMode() ) { - eContext = EnumContext::Context_3DObject; + eContext = EnumContext::Context_DrawText; } - else if (nInv == FmFormInventor) + else { - eContext = EnumContext::Context_Form; + const sal_uInt32 nInv = pObj->GetObjInventor(); + sal_uInt16 nObjId = pObj->GetObjIdentifier(); + if (nInv == SdrInventor) + { + if (nObjId == OBJ_GRUP) + { + nObjId = GetObjectTypeFromGroup(pObj); + if (nObjId == 0) + nObjId = OBJ_GRUP; + } + eContext = GetContextForObjectId_SD(nObjId, bIsHandoutPage, bIsNotesPage); + } + else if (nInv == E3dInventor) + { + eContext = EnumContext::Context_3DObject; + } + else if (nInv == FmFormInventor) + { + eContext = EnumContext::Context_Form; + } } break; } diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx index 6134278eddb8..f5cc8676b05c 100644 --- a/svx/source/svdraw/svdedxv.cxx +++ b/svx/source/svdraw/svdedxv.cxx @@ -674,6 +674,8 @@ 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); @@ -927,6 +929,8 @@ 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;) |