diff options
-rw-r--r-- | include/editeng/svxenum.hxx | 20 | ||||
-rw-r--r-- | sc/sdi/tabvwsh.sdi | 16 | ||||
-rw-r--r-- | sc/source/ui/app/typemap.cxx | 1 | ||||
-rw-r--r-- | sc/source/ui/view/tabvwsh2.cxx | 115 | ||||
-rw-r--r-- | sd/sdi/ViewShellBase.sdi | 6 | ||||
-rw-r--r-- | sd/source/core/typemap.cxx | 1 | ||||
-rw-r--r-- | starmath/sdi/smitems.sdi | 20 | ||||
-rw-r--r-- | svx/sdi/svx.sdi | 4 | ||||
-rw-r--r-- | svx/sdi/svxitems.sdi | 22 | ||||
-rw-r--r-- | svx/source/tbxctrls/tbxdrctl.cxx | 2 | ||||
-rw-r--r-- | sw/sdi/swriter.sdi | 2 | ||||
-rw-r--r-- | sw/sdi/viewsh.sdi | 69 | ||||
-rw-r--r-- | sw/source/uibase/shells/slotadd.cxx | 1 | ||||
-rw-r--r-- | sw/source/uibase/uiview/viewdraw.cxx | 37 | ||||
-rw-r--r-- | sw/source/uibase/uiview/viewstat.cxx | 31 |
15 files changed, 144 insertions, 203 deletions
diff --git a/include/editeng/svxenum.hxx b/include/editeng/svxenum.hxx index a233ffff09ce..ceb2276bc7dc 100644 --- a/include/editeng/svxenum.hxx +++ b/include/editeng/svxenum.hxx @@ -139,26 +139,6 @@ enum SvxCellOrientation SVX_ORIENTATION_STACKED }; -enum SvxDrawToolEnum -{ - SVX_SNAP_DRAW_SELECT, - - SVX_SNAP_DRAW_LINE, - SVX_SNAP_DRAW_RECT, - SVX_SNAP_DRAW_ELLIPSE, - SVX_SNAP_DRAW_POLYGON_NOFILL, - SVX_SNAP_DRAW_BEZIER_NOFILL, - SVX_SNAP_DRAW_FREELINE_NOFILL, - SVX_SNAP_DRAW_ARC, - SVX_SNAP_DRAW_PIE, - SVX_SNAP_DRAW_CIRCLECUT, - SVX_SNAP_DRAW_TEXT, - SVX_SNAP_DRAW_TEXT_VERTICAL, - SVX_SNAP_DRAW_TEXT_MARQUEE, - SVX_SNAP_DRAW_CAPTION, - SVX_SNAP_DRAW_CAPTION_VERTICAL -}; - enum SvxDrawAlignEnum { SVX_OBJECT_ALIGN_LEFT, diff --git a/sc/sdi/tabvwsh.sdi b/sc/sdi/tabvwsh.sdi index 8999ad8fb293..86878ec103f3 100644 --- a/sc/sdi/tabvwsh.sdi +++ b/sc/sdi/tabvwsh.sdi @@ -97,7 +97,21 @@ interface BaseSelection //SID_CHOOSE_CONTROLS [ ExecMethod = ExecDraw; StateMethod = GetDrawState; ] SID_OBJECT_SELECT [ ExecMethod = ExecDraw; StateMethod = GetDrawState; ] - SID_INSERT_DRAW [ ExecMethod = ExecDraw; StateMethod = GetDrawState; ] + SID_DRAW_LINE [ ExecMethod = ExecDraw; StateMethod = GetDrawState; ] + SID_DRAW_RECT [ ExecMethod = ExecDraw; StateMethod = GetDrawState; ] + SID_DRAW_ELLIPSE [ ExecMethod = ExecDraw; StateMethod = GetDrawState; ] + SID_DRAW_POLYGON_NOFILL [ ExecMethod = ExecDraw; StateMethod = GetDrawState; ] + SID_DRAW_BEZIER_NOFILL [ ExecMethod = ExecDraw; StateMethod = GetDrawState; ] + SID_DRAW_FREELINE_NOFILL [ ExecMethod = ExecDraw; StateMethod = GetDrawState; ] + SID_DRAW_ARC [ ExecMethod = ExecDraw; StateMethod = GetDrawState; ] + SID_DRAW_PIE [ ExecMethod = ExecDraw; StateMethod = GetDrawState; ] + SID_DRAW_CIRCLECUT [ ExecMethod = ExecDraw; StateMethod = GetDrawState; ] + SID_DRAW_TEXT [ ExecMethod = ExecDraw; StateMethod = GetDrawState; ] + SID_DRAW_TEXT_VERTICAL [ ExecMethod = ExecDraw; StateMethod = GetDrawState; ] + SID_DRAW_TEXT_MARQUEE [ ExecMethod = ExecDraw; StateMethod = GetDrawState; ] + SID_DRAW_CAPTION [ ExecMethod = ExecDraw; StateMethod = GetDrawState; ] + SID_DRAW_CAPTION_VERTICAL [ ExecMethod = ExecDraw; StateMethod = GetDrawState; ] + SID_INSERT_DRAW [] SID_FONTWORK_GALLERY_FLOATER [ ExecMethod = ExecDrawIns; StateMethod = GetDrawInsState; ] SID_DRAWTBX_CS_BASIC [ ExecMethod = ExecDraw; StateMethod = GetDrawState; ] SID_DRAWTBX_CS_SYMBOL [ ExecMethod = ExecDraw; StateMethod = GetDrawState; ] diff --git a/sc/source/ui/app/typemap.cxx b/sc/source/ui/app/typemap.cxx index e2f0fbfc3be3..63f07ffe8e82 100644 --- a/sc/source/ui/app/typemap.cxx +++ b/sc/source/ui/app/typemap.cxx @@ -99,7 +99,6 @@ #include <svx/sdprcitm.hxx> #include <svx/sdmetitm.hxx> -#define SvxDrawToolItem SfxAllEnumItem #define SvxDrawAlignItem SfxAllEnumItem #define avmedia_MediaItem ::avmedia::MediaItem diff --git a/sc/source/ui/view/tabvwsh2.cxx b/sc/source/ui/view/tabvwsh2.cxx index 6aa2bb3c5b89..0abd8b3c2ffe 100644 --- a/sc/source/ui/view/tabvwsh2.cxx +++ b/sc/source/ui/view/tabvwsh2.cxx @@ -94,43 +94,6 @@ void ScTabViewShell::ExecDraw(SfxRequest& rReq) return; } - // evaluate pseudo slots in draw toolbox - //! is this still really needed ????? - - if (nNewId == SID_INSERT_DRAW && pArgs) - { - const SfxPoolItem* pItem; - const SfxAllEnumItem* pEnumItem = nullptr; - if ( pArgs->GetItemState( SID_INSERT_DRAW, true, &pItem ) == SfxItemState::SET && - ( pEnumItem = dynamic_cast<const SfxAllEnumItem*>( pItem ) ) ) - { - SvxDrawToolEnum eSel = (SvxDrawToolEnum)pEnumItem->GetValue(); - switch (eSel) - { - case SVX_SNAP_DRAW_SELECT: nNewId = SID_OBJECT_SELECT; break; - case SVX_SNAP_DRAW_LINE: nNewId = SID_DRAW_LINE; break; - case SVX_SNAP_DRAW_RECT: nNewId = SID_DRAW_RECT; break; - case SVX_SNAP_DRAW_ELLIPSE: nNewId = SID_DRAW_ELLIPSE; break; - case SVX_SNAP_DRAW_POLYGON_NOFILL: nNewId = SID_DRAW_POLYGON_NOFILL; break; - case SVX_SNAP_DRAW_BEZIER_NOFILL: nNewId = SID_DRAW_BEZIER_NOFILL; break; - case SVX_SNAP_DRAW_FREELINE_NOFILL: nNewId = SID_DRAW_FREELINE_NOFILL; break; - case SVX_SNAP_DRAW_ARC: nNewId = SID_DRAW_ARC; break; - case SVX_SNAP_DRAW_PIE: nNewId = SID_DRAW_PIE; break; - case SVX_SNAP_DRAW_CIRCLECUT: nNewId = SID_DRAW_CIRCLECUT; break; - case SVX_SNAP_DRAW_TEXT: nNewId = SID_DRAW_TEXT; break; - case SVX_SNAP_DRAW_TEXT_VERTICAL: nNewId = SID_DRAW_TEXT_VERTICAL; break; - case SVX_SNAP_DRAW_TEXT_MARQUEE: nNewId = SID_DRAW_TEXT_MARQUEE; break; - case SVX_SNAP_DRAW_CAPTION: nNewId = SID_DRAW_CAPTION; break; - case SVX_SNAP_DRAW_CAPTION_VERTICAL: nNewId = SID_DRAW_CAPTION_VERTICAL; break; - } - } - else // sal_uInt16 item from controller - { - rReq.Done(); - return; - } - } - if ( nNewId == SID_DRAW_SELECT ) nNewId = SID_OBJECT_SELECT; @@ -244,9 +207,6 @@ void ScTabViewShell::ExecDraw(SfxRequest& rReq) pTabView->SetDrawFuncPtr(nullptr); } - SfxRequest aNewReq(rReq); - aNewReq.SetSlot(nDrawSfxId); - assert(nNewId != SID_DRAW_CHART); //#i71254# handled already above switch (nNewId) @@ -254,18 +214,18 @@ void ScTabViewShell::ExecDraw(SfxRequest& rReq) case SID_OBJECT_SELECT: // Nicht immer zurueckschalten if(pView->GetMarkedObjectList().GetMarkCount() == 0) SetDrawShell(bEx); - pTabView->SetDrawFuncPtr(new FuSelection(this, pWin, pView, pDoc, aNewReq)); + pTabView->SetDrawFuncPtr(new FuSelection(this, pWin, pView, pDoc, rReq)); break; case SID_DRAW_LINE: case SID_DRAW_RECT: case SID_DRAW_ELLIPSE: - pTabView->SetDrawFuncPtr(new FuConstRectangle(this, pWin, pView, pDoc, aNewReq)); + pTabView->SetDrawFuncPtr(new FuConstRectangle(this, pWin, pView, pDoc, rReq)); break; case SID_DRAW_CAPTION: case SID_DRAW_CAPTION_VERTICAL: - pTabView->SetDrawFuncPtr(new FuConstRectangle(this, pWin, pView, pDoc, aNewReq)); + pTabView->SetDrawFuncPtr(new FuConstRectangle(this, pWin, pView, pDoc, rReq)); pView->SetFrameDragSingles( false ); rBindings.Invalidate( SID_BEZIER_EDIT ); break; @@ -274,25 +234,25 @@ void ScTabViewShell::ExecDraw(SfxRequest& rReq) case SID_DRAW_POLYGON_NOFILL: case SID_DRAW_BEZIER_NOFILL: case SID_DRAW_FREELINE_NOFILL: - pTabView->SetDrawFuncPtr(new FuConstPolygon(this, pWin, pView, pDoc, aNewReq)); + pTabView->SetDrawFuncPtr(new FuConstPolygon(this, pWin, pView, pDoc, rReq)); break; case SID_DRAW_ARC: case SID_DRAW_PIE: case SID_DRAW_CIRCLECUT: - pTabView->SetDrawFuncPtr(new FuConstArc(this, pWin, pView, pDoc, aNewReq)); + pTabView->SetDrawFuncPtr(new FuConstArc(this, pWin, pView, pDoc, rReq)); break; case SID_DRAW_TEXT: case SID_DRAW_TEXT_VERTICAL: case SID_DRAW_TEXT_MARQUEE: case SID_DRAW_NOTEEDIT: - pTabView->SetDrawFuncPtr(new FuText(this, pWin, pView, pDoc, aNewReq)); + pTabView->SetDrawFuncPtr(new FuText(this, pWin, pView, pDoc, rReq)); break; case SID_FM_CREATE_CONTROL: SetDrawFormShell(true); - pTabView->SetDrawFuncPtr(new FuConstUnoControl(this, pWin, pView, pDoc, aNewReq)); + pTabView->SetDrawFuncPtr(new FuConstUnoControl(this, pWin, pView, pDoc, rReq)); nFormSfxId = nNewFormId; break; @@ -304,7 +264,7 @@ void ScTabViewShell::ExecDraw(SfxRequest& rReq) case SID_DRAWTBX_CS_STAR : case SID_DRAW_CS_ID : { - pTabView->SetDrawFuncPtr( new FuConstCustomShape( this, pWin, pView, pDoc, aNewReq )); + pTabView->SetDrawFuncPtr( new FuConstCustomShape( this, pWin, pView, pDoc, rReq )); if ( nNewId != SID_DRAW_CS_ID ) { const SfxStringItem* pEnumCommand = rReq.GetArg<SfxStringItem>(nNewId); @@ -329,8 +289,7 @@ void ScTabViewShell::ExecDraw(SfxRequest& rReq) rReq.Done(); - rBindings.Invalidate( SID_INSERT_DRAW ); - rBindings.Update( SID_INSERT_DRAW ); + Invalidate(); // Create default drawing objects via keyboard // with qualifier construct directly @@ -389,39 +348,6 @@ void ScTabViewShell::GetDrawState(SfxItemSet &rSet) { switch ( nWhich ) { - case SID_INSERT_DRAW: - { - // SID_OBJECT_SELECT only if "harder" selection mode - sal_uInt16 nPutId = nDrawSfxId; - if ( nPutId == SID_OBJECT_SELECT && !IsDrawSelMode() ) - nPutId = USHRT_MAX; - // only the images that are also in the controller - if ( nPutId != SID_OBJECT_SELECT && - nPutId != SID_DRAW_LINE && - nPutId != SID_DRAW_RECT && - nPutId != SID_DRAW_ELLIPSE && - nPutId != SID_DRAW_POLYGON_NOFILL && - nPutId != SID_DRAW_BEZIER_NOFILL && - nPutId != SID_DRAW_FREELINE_NOFILL && - nPutId != SID_DRAW_ARC && - nPutId != SID_DRAW_PIE && - nPutId != SID_DRAW_CIRCLECUT && - nPutId != SID_DRAW_TEXT && - nPutId != SID_DRAW_TEXT_VERTICAL && - nPutId != SID_DRAW_TEXT_MARQUEE && - nPutId != SID_DRAW_CAPTION && - nPutId != SID_DRAW_CAPTION_VERTICAL ) - nPutId = USHRT_MAX; - SfxAllEnumItem aItem( nWhich, nPutId ); - if ( !SvtLanguageOptions().IsVerticalTextEnabled() ) - { - aItem.DisableValue( SID_DRAW_TEXT_VERTICAL ); - aItem.DisableValue( SID_DRAW_CAPTION_VERTICAL ); - } - rSet.Put( aItem ); - } - break; - case SID_DRAW_CHART: { bool bOle = GetViewFrame()->GetFrame().IsInPlace(); @@ -430,6 +356,29 @@ void ScTabViewShell::GetDrawState(SfxItemSet &rSet) } break; + case SID_DRAW_LINE: + case SID_DRAW_RECT: + case SID_DRAW_ELLIPSE: + case SID_DRAW_POLYGON_NOFILL: + case SID_DRAW_BEZIER_NOFILL: + case SID_DRAW_FREELINE_NOFILL: + case SID_DRAW_ARC: + case SID_DRAW_PIE: + case SID_DRAW_CIRCLECUT: + case SID_DRAW_TEXT: + case SID_DRAW_TEXT_MARQUEE: + case SID_DRAW_CAPTION: + rSet.Put( SfxBoolItem( nWhich, nDrawSfxId == nWhich ) ); + break; + + case SID_DRAW_TEXT_VERTICAL: + case SID_DRAW_CAPTION_VERTICAL: + if ( !SvtLanguageOptions().IsVerticalTextEnabled() ) + rSet.DisableItem( nWhich ); + else + rSet.Put( SfxBoolItem( nWhich, nDrawSfxId == nWhich ) ); + break; + case SID_OBJECT_SELECT: // important for the old control-controller rSet.Put( SfxBoolItem( nWhich, nDrawSfxId == SID_OBJECT_SELECT && IsDrawSelMode() ) ); break; diff --git a/sd/sdi/ViewShellBase.sdi b/sd/sdi/ViewShellBase.sdi index e58605f18acc..1327a2489e34 100644 --- a/sd/sdi/ViewShellBase.sdi +++ b/sd/sdi/ViewShellBase.sdi @@ -138,11 +138,7 @@ interface ViewShellBaseView StateMethod = GetState ; ] SID_INSERT_DRAW - [ - ExecMethod = Execute ; - StateMethod = GetState ; - PseudoSlots = FALSE; - ] + [] } shell ViewShellBase diff --git a/sd/source/core/typemap.cxx b/sd/source/core/typemap.cxx index 65898a212d79..6a91ddd3c31d 100644 --- a/sd/source/core/typemap.cxx +++ b/sd/source/core/typemap.cxx @@ -104,7 +104,6 @@ #include <svx/galleryitem.hxx> #define SFX_TYPEMAP -#define SvxDrawToolItem SfxAllEnumItem #include "sdslots.hxx" diff --git a/starmath/sdi/smitems.sdi b/starmath/sdi/smitems.sdi index 279f7eea421d..d9bc6940f5c4 100644 --- a/starmath/sdi/smitems.sdi +++ b/starmath/sdi/smitems.sdi @@ -485,27 +485,7 @@ item SvxChooseControlEnum SvxChooseControlEnumItem; -enum SvxDrawToolEnum -{ - SVX_SNAP_DRAW_SELECT, - - SVX_SNAP_DRAW_LINE, - SVX_SNAP_DRAW_RECT, - SVX_SNAP_DRAW_ELLIPSE, - SVX_SNAP_DRAW_POLYGON, - SVX_SNAP_DRAW_ARC, - SVX_SNAP_DRAW_PIE, - SVX_SNAP_DRAW_CIRCLECUT, - SVX_SNAP_DRAW_TEXT, - SVX_SNAP_DRAW_CAPTION, - SVX_SNAP_DRAW_NOTHING -} -item SvxDrawToolEnum SvxDrawToolEnumItem; - - - item SvxChooseControlEnum SvxChooseControlItem; -item SvxDrawToolEnum SvxDrawToolItem; item FontUnderline SvxUnderlineItem; item FontWeight SvxWeightItem; item BYTE SvxWidowsItem; diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi index 2c7fae317474..6856a07d9cfb 100644 --- a/svx/sdi/svx.sdi +++ b/svx/sdi/svx.sdi @@ -3333,7 +3333,7 @@ SfxBoolItem DrawSelect SID_DRAW_SELECT ] -SvxDrawToolItem InsertDraw SID_INSERT_DRAW +SfxBoolItem InsertDraw SID_INSERT_DRAW [ /* flags: */ @@ -3357,8 +3357,6 @@ SvxDrawToolItem InsertDraw SID_INSERT_DRAW StatusBarConfig = FALSE, ToolBoxConfig = TRUE, GroupId = GID_DRAWING; - PseudoSlots = TRUE; - PseudoPrefix = SID_DRAW; ] diff --git a/svx/sdi/svxitems.sdi b/svx/sdi/svxitems.sdi index 5664a2b77173..4fa991c5bb58 100644 --- a/svx/sdi/svxitems.sdi +++ b/svx/sdi/svxitems.sdi @@ -76,27 +76,6 @@ enum SvxChooseControlEnum }; item SvxChooseControlEnum SvxChooseControlItem; -enum SvxDrawToolEnum -{ - SVX_SNAP_DRAW_SELECT, - - SVX_SNAP_DRAW_LINE, - SVX_SNAP_DRAW_RECT, - SVX_SNAP_DRAW_ELLIPSE, - SVX_SNAP_DRAW_POLYGON_NOFILL, - SVX_SNAP_DRAW_BEZIER_NOFILL, - SVX_SNAP_DRAW_FREELINE_NOFILL, - SVX_SNAP_DRAW_ARC, - SVX_SNAP_DRAW_PIE, - SVX_SNAP_DRAW_CIRCLECUT, - SVX_SNAP_DRAW_TEXT, - SVX_SNAP_DRAW_TEXT_VERTICAL, - SVX_SNAP_DRAW_TEXT_MARQUEE, - SVX_SNAP_DRAW_CAPTION, - SVX_SNAP_DRAW_CAPTION_VERTICAL -}; -item SvxDrawToolEnum SvxDrawToolEnumItem; - enum SvxDrawAlignEnum { SVX_OBJECT_ALIGN_LEFT, @@ -341,7 +320,6 @@ item UINT16 SvxPropSizeItem; // derived from UInt16Item item BOOL SvxShadowedItem; item SvxDrawBezierEnum SvxDrawBezierItem; item SvxDrawAlignEnum SvxDrawAlignItem; -item SvxDrawToolEnum SvxDrawToolItem; item BYTE SvxWidowsItem; item BOOL SvxWordLineModeItem; item SvxCellHorJustifyEnum SvxHorJustifyItem; diff --git a/svx/source/tbxctrls/tbxdrctl.cxx b/svx/source/tbxctrls/tbxdrctl.cxx index 43af4f8744e5..84f73df3e8c6 100644 --- a/svx/source/tbxctrls/tbxdrctl.cxx +++ b/svx/source/tbxctrls/tbxdrctl.cxx @@ -33,7 +33,7 @@ #include "svx/tbxcolor.hxx" #include <com/sun/star/frame/XLayoutManager.hpp> -SFX_IMPL_TOOLBOX_CONTROL(SvxTbxCtlDraw, SfxAllEnumItem); +SFX_IMPL_TOOLBOX_CONTROL(SvxTbxCtlDraw, SfxBoolItem); using namespace ::com::sun::star::uno; using namespace ::com::sun::star::frame; diff --git a/sw/sdi/swriter.sdi b/sw/sdi/swriter.sdi index 2ad6d07c9b8a..83fe275b805b 100644 --- a/sw/sdi/swriter.sdi +++ b/sw/sdi/swriter.sdi @@ -91,7 +91,7 @@ SfxBoolItem TrackChanges FN_REDLINE_ON GroupId = GID_EDIT; ] -SfxAllEnumItem TrackChangesBar SID_TRACK_CHANGES_BAR +SfxBoolItem TrackChangesBar SID_TRACK_CHANGES_BAR [ /* flags: */ diff --git a/sw/sdi/viewsh.sdi b/sw/sdi/viewsh.sdi index 1717fc828880..15f3f2a9a252 100644 --- a/sw/sdi/viewsh.sdi +++ b/sw/sdi/viewsh.sdi @@ -76,6 +76,75 @@ interface TextEditView : BaseTextEditView ] SID_INSERT_DRAW // status() [ + StateMethod = GetDrawState ; + ] + SID_DRAW_LINE + [ + ExecMethod = ExecDraw ; + StateMethod = GetDrawState ; + ] + SID_DRAW_RECT + [ + ExecMethod = ExecDraw ; + StateMethod = GetDrawState ; + ] + SID_DRAW_ELLIPSE + [ + ExecMethod = ExecDraw ; + StateMethod = GetDrawState ; + ] + SID_DRAW_POLYGON_NOFILL + [ + ExecMethod = ExecDraw ; + StateMethod = GetDrawState ; + ] + SID_DRAW_BEZIER_NOFILL + [ + ExecMethod = ExecDraw ; + StateMethod = GetDrawState ; + ] + SID_DRAW_FREELINE_NOFILL + [ + ExecMethod = ExecDraw ; + StateMethod = GetDrawState ; + ] + SID_DRAW_ARC + [ + ExecMethod = ExecDraw ; + StateMethod = GetDrawState ; + ] + SID_DRAW_PIE + [ + ExecMethod = ExecDraw ; + StateMethod = GetDrawState ; + ] + SID_DRAW_CIRCLECUT + [ + ExecMethod = ExecDraw ; + StateMethod = GetDrawState ; + ] + SID_DRAW_TEXT + [ + ExecMethod = ExecDraw ; + StateMethod = GetDrawState ; + ] + SID_DRAW_TEXT_VERTICAL + [ + ExecMethod = ExecDraw ; + StateMethod = GetDrawState ; + ] + SID_DRAW_TEXT_MARQUEE + [ + ExecMethod = ExecDraw ; + StateMethod = GetDrawState ; + ] + SID_DRAW_CAPTION + [ + ExecMethod = ExecDraw ; + StateMethod = GetDrawState ; + ] + SID_DRAW_CAPTION_VERTICAL + [ ExecMethod = ExecDraw ; StateMethod = GetDrawState ; ] diff --git a/sw/source/uibase/shells/slotadd.cxx b/sw/source/uibase/shells/slotadd.cxx index ed66709a37e5..c0658a329e51 100644 --- a/sw/source/uibase/shells/slotadd.cxx +++ b/sw/source/uibase/shells/slotadd.cxx @@ -122,7 +122,6 @@ #include <svx/drawitem.hxx> #include <avmedia/mediaitem.hxx> -#define SvxDrawToolItem SfxAllEnumItem #define SvxDrawAlignItem SfxAllEnumItem #define avmedia_MediaItem ::avmedia::MediaItem 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) diff --git a/sw/source/uibase/uiview/viewstat.cxx b/sw/source/uibase/uiview/viewstat.cxx index c37b8d77eac2..7c01196b5d2e 100644 --- a/sw/source/uibase/uiview/viewstat.cxx +++ b/sw/source/uibase/uiview/viewstat.cxx @@ -472,19 +472,29 @@ void SwView::GetDrawState(SfxItemSet &rSet) nWhich = aIter.NextWhich() ) switch(nWhich) { - case SID_INSERT_DRAW: + case SID_DRAW_LINE: + case SID_DRAW_RECT: + case SID_DRAW_ELLIPSE: + case SID_DRAW_POLYGON_NOFILL: + case SID_DRAW_BEZIER_NOFILL: + case SID_DRAW_FREELINE_NOFILL: + case SID_DRAW_ARC: + case SID_DRAW_PIE: + case SID_DRAW_CIRCLECUT: + case SID_DRAW_TEXT: + case SID_DRAW_CAPTION: if ( bWeb ) rSet.DisableItem( nWhich ); else - { - SfxAllEnumItem aEnum(SID_INSERT_DRAW, m_nDrawSfxId); - if ( !SvtLanguageOptions().IsVerticalTextEnabled() ) - { - aEnum.DisableValue( SID_DRAW_CAPTION_VERTICAL ); - aEnum.DisableValue( SID_DRAW_TEXT_VERTICAL ); - } - rSet.Put(aEnum); - } + rSet.Put( SfxBoolItem( nWhich, m_nDrawSfxId == nWhich ) ); + break; + + case SID_DRAW_TEXT_VERTICAL: + case SID_DRAW_CAPTION_VERTICAL: + if ( bWeb || !SvtLanguageOptions().IsVerticalTextEnabled() ) + rSet.DisableItem( nWhich ); + else + rSet.Put( SfxBoolItem( nWhich, m_nDrawSfxId == nWhich ) ); break; case SID_SHOW_HIDDEN: @@ -503,6 +513,7 @@ void SwView::GetDrawState(SfxItemSet &rSet) m_nFormSfxId == nWhich)); break; + case SID_INSERT_DRAW: case SID_FONTWORK_GALLERY_FLOATER : { if ( bWeb ) |