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(
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() );
......
......@@ -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;
}
......
......@@ -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;)
......
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