[Libreoffice-commits] core.git: Branch 'feature/sidebar' - sd/source svx/source
Oliver-Rainer Wittmann
orw at apache.org
Thu May 9 12:43:16 PDT 2013
sd/source/ui/view/sdview.cxx | 8 ----
svx/source/sidebar/SelectionAnalyzer.cxx | 59 +++++++++++++++++++------------
svx/source/svdraw/svdedxv.cxx | 4 ++
3 files changed, 41 insertions(+), 30 deletions(-)
New commits:
commit 007e4d0e662bb9437bd013f8c9a49ebb7c0a380a
Author: Oliver-Rainer Wittmann <orw at apache.org>
Date: Fri Apr 26 11:20:19 2013 +0000
Related: #i122156# #i122087# correct context notification...
regarding the text edit mode for Drawing objects
(cherry picked from commit a0e76afb572510e2c2c75fc6c558f271c0d74d0b)
Change-Id: I8b4e5cbd865455ef3d7046f9d65c5dd68a53d8ce
diff --git a/sd/source/ui/view/sdview.cxx b/sd/source/ui/view/sdview.cxx
index a908a61..c930b1b 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 2f201e9..44fa407 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 654cf7f..0866328 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -673,6 +673,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);
@@ -926,6 +928,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;)
More information about the Libreoffice-commits
mailing list