summaryrefslogtreecommitdiff
path: root/sw/source/uibase/uiview/viewdraw.cxx
diff options
context:
space:
mode:
authorMaxim Monastirsky <momonasmon@gmail.com>2016-02-01 18:39:51 +0200
committerMaxim Monastirsky <momonasmon@gmail.com>2016-02-02 09:32:36 +0000
commit11d605cc5a0c221d2423b6e63f502db660d085d2 (patch)
tree018a88d0fe4e56ec0c69a40596227cb70dfdf847 /sw/source/uibase/uiview/viewdraw.cxx
parent8b65dec8e0fdfc8564597e90aff91b971e23f7ce (diff)
tdf#84843 Stop using PseudoSlots for drawing slots
Instead of fighting with this obsolete thing, let's just kill it. This fixes disabling in read-only doc, as well as pressed/unpressed states. Change-Id: I4d06ba3395024ffd09d77c6d22653a2c5e227115 Reviewed-on: https://gerrit.libreoffice.org/22010 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com>
Diffstat (limited to 'sw/source/uibase/uiview/viewdraw.cxx')
-rw-r--r--sw/source/uibase/uiview/viewdraw.cxx37
1 files changed, 3 insertions, 34 deletions
diff --git a/sw/source/uibase/uiview/viewdraw.cxx b/sw/source/uibase/uiview/viewdraw.cxx
index 628eaf51b5bd..6d94b477d9f1 100644
--- a/sw/source/uibase/uiview/viewdraw.cxx
+++ b/sw/source/uibase/uiview/viewdraw.cxx
@@ -77,37 +77,13 @@ void SwView::ExecDraw(SfxRequest& rReq)
{
const SfxItemSet *pArgs = rReq.GetArgs();
const SfxPoolItem* pItem;
- const SfxAllEnumItem* pEItem = nullptr;
const SfxStringItem* pStringItem = nullptr;
SdrView *pSdrView = m_pWrtShell->GetDrawView();
bool bDeselect = false;
sal_uInt16 nSlotId = rReq.GetSlot();
if(pArgs && SfxItemState::SET == pArgs->GetItemState(GetPool().GetWhich(nSlotId), false, &pItem))
- {
- pEItem = dynamic_cast< const SfxAllEnumItem*>(pItem);
pStringItem = dynamic_cast< const SfxStringItem*>(pItem);
- }
-
- if (SID_INSERT_DRAW == nSlotId && pEItem)
- switch ( pEItem->GetValue() )
- {
- case SVX_SNAP_DRAW_SELECT: nSlotId = SID_OBJECT_SELECT; break;
- case SVX_SNAP_DRAW_LINE: nSlotId = SID_DRAW_LINE; break;
- case SVX_SNAP_DRAW_RECT: nSlotId = SID_DRAW_RECT; break;
- case SVX_SNAP_DRAW_ELLIPSE: nSlotId = SID_DRAW_ELLIPSE; break;
- case SVX_SNAP_DRAW_POLYGON_NOFILL: nSlotId = SID_DRAW_POLYGON_NOFILL; break;
- case SVX_SNAP_DRAW_BEZIER_NOFILL: nSlotId = SID_DRAW_BEZIER_NOFILL; break;
- case SVX_SNAP_DRAW_FREELINE_NOFILL: nSlotId = SID_DRAW_FREELINE_NOFILL; break;
- case SVX_SNAP_DRAW_ARC: nSlotId = SID_DRAW_ARC; break;
- case SVX_SNAP_DRAW_PIE: nSlotId = SID_DRAW_PIE; break;
- case SVX_SNAP_DRAW_CIRCLECUT: nSlotId = SID_DRAW_CIRCLECUT; break;
- case SVX_SNAP_DRAW_TEXT: nSlotId = SID_DRAW_TEXT; break;
- case SVX_SNAP_DRAW_TEXT_VERTICAL: nSlotId = SID_DRAW_TEXT_VERTICAL; break;
- case SVX_SNAP_DRAW_TEXT_MARQUEE: nSlotId = SID_DRAW_TEXT_MARQUEE; break;
- case SVX_SNAP_DRAW_CAPTION: nSlotId = SID_DRAW_CAPTION; break;
- case SVX_SNAP_DRAW_CAPTION_VERTICAL: nSlotId = SID_DRAW_CAPTION_VERTICAL; break;
- }
if (nSlotId == SID_OBJECT_SELECT && m_nFormSfxId == nSlotId)
{
@@ -212,6 +188,8 @@ void SwView::ExecDraw(SfxRequest& rReq)
if( pWin )
pWin->LeaveWait();
}
+ else if ( m_nFormSfxId != USHRT_MAX )
+ GetViewFrame()->GetDispatcher()->Execute( SID_FM_LEAVE_CREATE );
if( nSlotId == SID_DRAW_CS_ID )
{
@@ -244,8 +222,6 @@ void SwView::ExecDraw(SfxRequest& rReq)
m_pWrtShell->EnterSelFrameMode();
LeaveDrawCreate();
- GetViewFrame()->GetBindings().Invalidate(SID_INSERT_DRAW);
-
AttrChangedNotify(m_pWrtShell);
return;
}
@@ -332,14 +308,7 @@ void SwView::ExecDraw(SfxRequest& rReq)
break;
}
- static sal_uInt16 const aInval[] =
- {
- // Slot IDs must be sorted when calling Invalidate!
- SID_ATTRIBUTES_AREA,
- SID_INSERT_DRAW,
- 0
- };
- GetViewFrame()->GetBindings().Invalidate(aInval);
+ GetViewFrame()->GetBindings().Invalidate(SID_ATTRIBUTES_AREA);
bool bEndTextEdit = true;
if (pFuncPtr)