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>
This commit is contained in:
@@ -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,
|
||||
|
@@ -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; ]
|
||||
|
@@ -99,7 +99,6 @@
|
||||
#include <svx/sdprcitm.hxx>
|
||||
#include <svx/sdmetitm.hxx>
|
||||
|
||||
#define SvxDrawToolItem SfxAllEnumItem
|
||||
#define SvxDrawAlignItem SfxAllEnumItem
|
||||
#define avmedia_MediaItem ::avmedia::MediaItem
|
||||
|
||||
|
@@ -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;
|
||||
|
@@ -138,11 +138,7 @@ interface ViewShellBaseView
|
||||
StateMethod = GetState ;
|
||||
]
|
||||
SID_INSERT_DRAW
|
||||
[
|
||||
ExecMethod = Execute ;
|
||||
StateMethod = GetState ;
|
||||
PseudoSlots = FALSE;
|
||||
]
|
||||
[]
|
||||
}
|
||||
|
||||
shell ViewShellBase
|
||||
|
@@ -104,7 +104,6 @@
|
||||
#include <svx/galleryitem.hxx>
|
||||
|
||||
#define SFX_TYPEMAP
|
||||
#define SvxDrawToolItem SfxAllEnumItem
|
||||
#include "sdslots.hxx"
|
||||
|
||||
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
]
|
||||
|
||||
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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: */
|
||||
|
@@ -75,6 +75,75 @@ interface TextEditView : BaseTextEditView
|
||||
DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
|
||||
]
|
||||
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 ;
|
||||
|
@@ -122,7 +122,6 @@
|
||||
#include <svx/drawitem.hxx>
|
||||
#include <avmedia/mediaitem.hxx>
|
||||
|
||||
#define SvxDrawToolItem SfxAllEnumItem
|
||||
#define SvxDrawAlignItem SfxAllEnumItem
|
||||
#define avmedia_MediaItem ::avmedia::MediaItem
|
||||
|
||||
|
@@ -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)
|
||||
|
@@ -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 )
|
||||
|
Reference in New Issue
Block a user