Kaydet (Commit) 8035ea99 authored tarafından Oliver-Rainer Wittmann's avatar Oliver-Rainer Wittmann Kaydeden (comit) Michael Meeks

Related: #i122156# #i122087# correct context notification...

regarding the text edit mode for Drawing objects

(cherry picked from commit a0e76afb)

Change-Id: I8b4e5cbd865455ef3d7046f9d65c5dd68a53d8ce
üst ff03b807
...@@ -695,10 +695,6 @@ sal_Bool View::SdrBeginTextEdit( ...@@ -695,10 +695,6 @@ sal_Bool View::SdrBeginTextEdit(
pGivenOutlinerView, bDontDeleteOutliner, pGivenOutlinerView, bDontDeleteOutliner,
bOnlyOneView, bGrabFocus); bOnlyOneView, bGrabFocus);
ContextChangeEventMultiplexer::NotifyContextChange(
&GetViewShell()->GetViewShellBase(),
::sfx2::sidebar::EnumContext::Context_DrawText);
if (bReturn) if (bReturn)
{ {
::Outliner* pOL = GetTextEditOutliner(); ::Outliner* pOL = GetTextEditOutliner();
...@@ -765,10 +761,6 @@ SdrEndTextEditKind View::SdrEndTextEdit(sal_Bool bDontDeleteReally ) ...@@ -765,10 +761,6 @@ SdrEndTextEditKind View::SdrEndTextEdit(sal_Bool bDontDeleteReally )
if( xObj.is() ) if( xObj.is() )
{ {
ContextChangeEventMultiplexer::NotifyContextChange(
&GetViewShell()->GetViewShellBase(),
::sfx2::sidebar::EnumContext::Context_Default);
SdPage* pPage = dynamic_cast< SdPage* >( xObj->GetPage() ); SdPage* pPage = dynamic_cast< SdPage* >( xObj->GetPage() );
if( pPage ) if( pPage )
pPage->onEndTextEdit( xObj.get() ); pPage->onEndTextEdit( xObj.get() );
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include "svx/sidebar/SelectionAnalyzer.hxx" #include "svx/sidebar/SelectionAnalyzer.hxx"
#include "svx/svdmrkv.hxx" #include "svx/svdmrkv.hxx"
#include "svx/svdobj.hxx" #include "svx/svdobj.hxx"
#include "svx/svdotext.hxx"
#include "svx/svdpage.hxx" #include "svx/svdpage.hxx"
#include "svx/fmglob.hxx" #include "svx/fmglob.hxx"
#include "svx/globl3d.hxx" #include "svx/globl3d.hxx"
...@@ -42,12 +43,19 @@ EnumContext::Context SelectionAnalyzer::GetContextForSelection_SC (const SdrMark ...@@ -42,12 +43,19 @@ EnumContext::Context SelectionAnalyzer::GetContextForSelection_SC (const SdrMark
case 1: case 1:
{ {
SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj(); SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
const sal_uInt32 nInv = pObj->GetObjInventor(); if ( pObj->ISA(SdrTextObj) && ((SdrTextObj*)pObj)->IsInEditMode() )
const sal_uInt16 nObjId = pObj->GetObjIdentifier(); {
if (nInv == SdrInventor) eContext = EnumContext::Context_DrawText;
eContext = GetContextForObjectId_SC(nObjId); }
else if (nInv == FmFormInventor) else
eContext = EnumContext::Context_Form; {
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; break;
} }
...@@ -109,25 +117,32 @@ EnumContext::Context SelectionAnalyzer::GetContextForSelection_SD ( ...@@ -109,25 +117,32 @@ EnumContext::Context SelectionAnalyzer::GetContextForSelection_SD (
case 1: case 1:
{ {
SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj(); SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
const sal_uInt32 nInv = pObj->GetObjInventor(); if ( pObj->ISA(SdrTextObj) && ((SdrTextObj*)pObj)->IsInEditMode() )
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; 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; break;
} }
......
...@@ -674,6 +674,8 @@ sal_Bool SdrObjEditView::SdrBeginTextEdit( ...@@ -674,6 +674,8 @@ sal_Bool SdrObjEditView::SdrBeginTextEdit(
// Since IsMarkHdlWhenTextEdit() is ignored, it is necessary // Since IsMarkHdlWhenTextEdit() is ignored, it is necessary
// to call AdjustMarkHdl() always. // to call AdjustMarkHdl() always.
AdjustMarkHdl(); AdjustMarkHdl();
// Call <MarkListHasChanged()> as it also handles context changes for sidebar
MarkListHasChanged();
pTextEditOutlinerView=ImpMakeOutlinerView(pWin,!bEmpty,pGivenOutlinerView); pTextEditOutlinerView=ImpMakeOutlinerView(pWin,!bEmpty,pGivenOutlinerView);
...@@ -927,6 +929,8 @@ SdrEndTextEditKind SdrObjEditView::SdrEndTextEdit(sal_Bool bDontDeleteReally) ...@@ -927,6 +929,8 @@ SdrEndTextEditKind SdrObjEditView::SdrEndTextEdit(sal_Bool bDontDeleteReally)
// Since IsMarkHdlWhenTextEdit() is ignored, it is necessary // Since IsMarkHdlWhenTextEdit() is ignored, it is necessary
// to call AdjustMarkHdl() always. // to call AdjustMarkHdl() always.
AdjustMarkHdl(); AdjustMarkHdl();
// Call <MarkListHasChanged()> as it also handles context changes for sidebar
MarkListHasChanged();
} }
// delete all OutlinerViews // delete all OutlinerViews
for (sal_uIntPtr i=pTEOutliner->GetViewCount(); i>0;) for (sal_uIntPtr i=pTEOutliner->GetViewCount(); i>0;)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment