convert SdrCreateCmd to scoped enum
Change-Id: I8772032dee25c790314384750b8c7277c4879318
This commit is contained in:
parent
fc518ed954
commit
eba160af21
@ -390,7 +390,7 @@ bool DlgEdFuncInsert::MouseButtonUp( const MouseEvent& rMEvt )
|
||||
// object creation active?
|
||||
if ( rView.IsCreateObj() )
|
||||
{
|
||||
rView.EndCreateObj(SDRCREATE_FORCEEND);
|
||||
rView.EndCreateObj(SdrCreateCmd::ForceEnd);
|
||||
|
||||
if ( !rView.AreObjectsMarked() )
|
||||
{
|
||||
|
@ -743,7 +743,7 @@ void ChartController::execute_MouseButtonUp( const MouseEvent& rMEvt )
|
||||
// #i12587# support for shapes in chart
|
||||
if ( m_eDrawMode == CHARTDRAW_INSERT && pDrawViewWrapper->IsCreateObj() )
|
||||
{
|
||||
pDrawViewWrapper->EndCreateObj( SDRCREATE_FORCEEND );
|
||||
pDrawViewWrapper->EndCreateObj( SdrCreateCmd::ForceEnd );
|
||||
{
|
||||
HiddenUndoContext aUndoContext( m_xUndoManager );
|
||||
// don't want the positioning Undo action to appear in the UI
|
||||
|
@ -31,9 +31,12 @@ const sal_uInt32 SdrInventor=sal_uInt32('S')*0x00000001+
|
||||
sal_uInt32('r')*0x01000000;
|
||||
|
||||
// commands for EndCreate()
|
||||
enum SdrCreateCmd {SDRCREATE_NEXTPOINT, // next traverse station, segment of a circle: next coordinate
|
||||
SDRCREATE_NEXTOBJECT, // next polygon in PolyPolygon
|
||||
SDRCREATE_FORCEEND}; // forced end
|
||||
enum class SdrCreateCmd
|
||||
{
|
||||
NextPoint, // next traverse station, segment of a circle: next coordinate
|
||||
NextObject, // next polygon in PolyPolygon
|
||||
ForceEnd // forced end
|
||||
};
|
||||
|
||||
enum class SdrDragMode
|
||||
{
|
||||
|
@ -701,7 +701,7 @@ bool DlgEdFuncInsert::MouseButtonUp( const MouseEvent& rMEvt )
|
||||
return true;
|
||||
}
|
||||
|
||||
m_rView.EndCreateObj(SDRCREATE_FORCEEND);
|
||||
m_rView.EndCreateObj(SdrCreateCmd::ForceEnd);
|
||||
|
||||
if ( !m_rView.AreObjectsMarked() )
|
||||
{
|
||||
|
@ -92,7 +92,7 @@ bool FuConstArc::MouseButtonUp( const MouseEvent& rMEvt )
|
||||
|
||||
if ( pView->IsCreateObj() && rMEvt.IsLeft() )
|
||||
{
|
||||
pView->EndCreateObj( SDRCREATE_NEXTPOINT );
|
||||
pView->EndCreateObj( SdrCreateCmd::NextPoint );
|
||||
bReturn = true;
|
||||
}
|
||||
return (FuConstruct::MouseButtonUp(rMEvt) || bReturn);
|
||||
|
@ -114,7 +114,7 @@ bool FuConstCustomShape::MouseButtonUp(const MouseEvent& rMEvt)
|
||||
|
||||
if ( pView->IsCreateObj() && rMEvt.IsLeft() )
|
||||
{
|
||||
pView->EndCreateObj(SDRCREATE_FORCEEND);
|
||||
pView->EndCreateObj(SdrCreateCmd::ForceEnd);
|
||||
bReturn = true;
|
||||
}
|
||||
return (FuConstruct::MouseButtonUp(rMEvt) || bReturn);
|
||||
|
@ -107,7 +107,7 @@ bool FuConstRectangle::MouseButtonUp(const MouseEvent& rMEvt)
|
||||
|
||||
if ( pView->IsCreateObj() && rMEvt.IsLeft() )
|
||||
{
|
||||
pView->EndCreateObj(SDRCREATE_FORCEEND);
|
||||
pView->EndCreateObj(SdrCreateCmd::ForceEnd);
|
||||
|
||||
if (aSfxRequest.GetSlot() == SID_DRAW_CAPTION_VERTICAL)
|
||||
{
|
||||
|
@ -97,7 +97,7 @@ bool FuConstUnoControl::MouseButtonUp(const MouseEvent& rMEvt)
|
||||
|
||||
if ( pView->IsCreateObj() && rMEvt.IsLeft() )
|
||||
{
|
||||
pView->EndCreateObj(SDRCREATE_FORCEEND);
|
||||
pView->EndCreateObj(SdrCreateCmd::ForceEnd);
|
||||
bReturn = true;
|
||||
}
|
||||
return (FuConstruct::MouseButtonUp(rMEvt) || bReturn);
|
||||
|
@ -441,7 +441,7 @@ bool FuText::MouseButtonUp(const MouseEvent& rMEvt)
|
||||
{
|
||||
if (rMEvt.IsLeft())
|
||||
{
|
||||
pView->EndCreateObj(SDRCREATE_FORCEEND);
|
||||
pView->EndCreateObj(SdrCreateCmd::ForceEnd);
|
||||
if (aSfxRequest.GetSlot() == SID_DRAW_TEXT_MARQUEE)
|
||||
{
|
||||
// Lauftext-Objekt erzeugen?
|
||||
|
@ -342,7 +342,7 @@ bool FuConstruct3dObject::MouseButtonUp(const MouseEvent& rMEvt)
|
||||
|
||||
if ( mpView->IsCreateObj() && rMEvt.IsLeft() )
|
||||
{
|
||||
mpView->EndCreateObj(SDRCREATE_FORCEEND);
|
||||
mpView->EndCreateObj(SdrCreateCmd::ForceEnd);
|
||||
bReturn = true;
|
||||
}
|
||||
|
||||
|
@ -136,7 +136,7 @@ bool FuConstructArc::MouseButtonUp( const MouseEvent& rMEvt )
|
||||
{
|
||||
const size_t nCount = mpView->GetSdrPageView()->GetObjList()->GetObjCount();
|
||||
|
||||
if (mpView->EndCreateObj(SDRCREATE_NEXTPOINT) )
|
||||
if (mpView->EndCreateObj(SdrCreateCmd::NextPoint) )
|
||||
{
|
||||
if (nCount != mpView->GetSdrPageView()->GetObjList()->GetObjCount())
|
||||
{
|
||||
|
@ -131,7 +131,7 @@ bool FuConstructBezierPolygon::MouseButtonUp(const MouseEvent& rMEvt )
|
||||
|
||||
if (mpView->IsInsObjPoint())
|
||||
{
|
||||
mpView->EndInsObjPoint(SDRCREATE_FORCEEND);
|
||||
mpView->EndInsObjPoint(SdrCreateCmd::ForceEnd);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -143,7 +143,7 @@ bool FuConstructCustomShape::MouseButtonUp(const MouseEvent& rMEvt)
|
||||
if(mpView->IsCreateObj() && rMEvt.IsLeft())
|
||||
{
|
||||
SdrObject* pObj = mpView->GetCreateObj();
|
||||
if( pObj && mpView->EndCreateObj( SDRCREATE_FORCEEND ) )
|
||||
if( pObj && mpView->EndCreateObj( SdrCreateCmd::ForceEnd ) )
|
||||
{
|
||||
bReturn = true;
|
||||
}
|
||||
|
@ -223,7 +223,7 @@ bool FuConstructRectangle::MouseButtonUp(const MouseEvent& rMEvt)
|
||||
{
|
||||
SdrObject* pObj = mpView->GetCreateObj();
|
||||
|
||||
if(pObj && mpView->EndCreateObj(SDRCREATE_FORCEEND))
|
||||
if(pObj && mpView->EndCreateObj(SdrCreateCmd::ForceEnd))
|
||||
{
|
||||
if(SID_DRAW_MEASURELINE == nSlotId)
|
||||
{
|
||||
|
@ -100,7 +100,7 @@ bool FuConstructUnoControl::MouseButtonUp(const MouseEvent& rMEvt)
|
||||
|
||||
if ( mpView->IsCreateObj() && rMEvt.IsLeft() )
|
||||
{
|
||||
mpView->EndCreateObj(SDRCREATE_FORCEEND);
|
||||
mpView->EndCreateObj(SdrCreateCmd::ForceEnd);
|
||||
bReturn = true;
|
||||
}
|
||||
|
||||
|
@ -847,7 +847,7 @@ bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt)
|
||||
{
|
||||
if ( mpView->IsInsObjPoint() )
|
||||
{
|
||||
mpView->EndInsObjPoint(SDRCREATE_FORCEEND);
|
||||
mpView->EndInsObjPoint(SdrCreateCmd::ForceEnd);
|
||||
}
|
||||
else if ( mpView->IsDragObj() )
|
||||
{
|
||||
|
@ -705,7 +705,7 @@ bool FuText::MouseButtonUp(const MouseEvent& rMEvt)
|
||||
ImpSetAttributesForNewTextObject(GetTextObj());
|
||||
}
|
||||
|
||||
if (!mpView->EndCreateObj(SDRCREATE_FORCEEND))
|
||||
if (!mpView->EndCreateObj(SdrCreateCmd::ForceEnd))
|
||||
{
|
||||
// it was not possible to create text object
|
||||
mxTextObj.reset(nullptr);
|
||||
@ -781,7 +781,7 @@ bool FuText::MouseButtonUp(const MouseEvent& rMEvt)
|
||||
GetTextObj()->SetDisableAutoWidthOnDragging(true);
|
||||
}
|
||||
|
||||
if(!mpView->EndCreateObj(SDRCREATE_FORCEEND))
|
||||
if(!mpView->EndCreateObj(SdrCreateCmd::ForceEnd))
|
||||
{
|
||||
mxTextObj.reset(nullptr);
|
||||
}
|
||||
|
@ -679,7 +679,7 @@ void GraphCtrl::MouseButtonUp(const MouseEvent& rMEvt)
|
||||
if ( bSdrMode )
|
||||
{
|
||||
if ( pView->IsInsObjPoint() )
|
||||
pView->EndInsObjPoint( SDRCREATE_FORCEEND );
|
||||
pView->EndInsObjPoint( SdrCreateCmd::ForceEnd );
|
||||
else
|
||||
pView->MouseButtonUp( rMEvt, this );
|
||||
|
||||
|
@ -698,7 +698,7 @@ bool E3dScene::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd)
|
||||
aRect1.Justify();
|
||||
NbcSetSnapRect(aRect1);
|
||||
SetRectsDirty();
|
||||
return (eCmd==SDRCREATE_FORCEEND || rStat.GetPointCount()>=2);
|
||||
return (eCmd==SdrCreateCmd::ForceEnd || rStat.GetPointCount()>=2);
|
||||
}
|
||||
|
||||
bool E3dScene::BckCreate(SdrDragStat& /*rStat*/)
|
||||
|
@ -633,7 +633,7 @@ void FmFormObj::SetUnoControlModel( const Reference< css::awt::XControlModel >&
|
||||
bool FmFormObj::EndCreate( SdrDragStat& rStat, SdrCreateCmd eCmd )
|
||||
{
|
||||
bool bResult = SdrUnoObj::EndCreate(rStat, eCmd);
|
||||
if ( bResult && SDRCREATE_FORCEEND == eCmd && rStat.GetView() )
|
||||
if ( bResult && SdrCreateCmd::ForceEnd == eCmd && rStat.GetView() )
|
||||
{
|
||||
if ( pPage )
|
||||
{
|
||||
|
@ -232,7 +232,7 @@ void SdrCreateView::MovAction(const Point& rPnt)
|
||||
|
||||
void SdrCreateView::EndAction()
|
||||
{
|
||||
if (pAktCreate!=nullptr) EndCreateObj(SDRCREATE_FORCEEND);
|
||||
if (pAktCreate!=nullptr) EndCreateObj(SdrCreateCmd::ForceEnd);
|
||||
SdrDragView::EndAction();
|
||||
}
|
||||
|
||||
@ -595,7 +595,7 @@ bool SdrCreateView::EndCreateObj(SdrCreateCmd eCmd)
|
||||
{
|
||||
sal_uIntPtr nCount=maDragStat.GetPointCount();
|
||||
|
||||
if (nCount<=1 && eCmd==SDRCREATE_FORCEEND)
|
||||
if (nCount<=1 && eCmd==SdrCreateCmd::ForceEnd)
|
||||
{
|
||||
BrkCreateObj(); // objects with only a single point don't exist (at least today)
|
||||
return false; // sal_False = event not interpreted
|
||||
@ -672,7 +672,7 @@ bool SdrCreateView::EndCreateObj(SdrCreateCmd eCmd)
|
||||
}
|
||||
else
|
||||
{ // more points
|
||||
if (eCmd==SDRCREATE_FORCEEND || // nothing there -- force ending
|
||||
if (eCmd==SdrCreateCmd::ForceEnd || // nothing there -- force ending
|
||||
nCount==0 || // no existing points (should never happen)
|
||||
(nCount<=1 && !maDragStat.IsMinMoved())) { // MinMove not met
|
||||
BrkCreateObj();
|
||||
|
@ -697,10 +697,10 @@ bool SdrDragView::EndInsObjPoint(SdrCreateCmd eCmd)
|
||||
sal_uInt32 nNextPnt(mnInsPointNum);
|
||||
Point aPnt(maDragStat.GetNow());
|
||||
bool bOk=EndDragObj();
|
||||
if (bOk && eCmd!=SDRCREATE_FORCEEND)
|
||||
if (bOk && eCmd!=SdrCreateCmd::ForceEnd)
|
||||
{
|
||||
// Ret=True means: Action is over.
|
||||
bOk=!(ImpBegInsObjPoint(true, nNextPnt, aPnt, eCmd == SDRCREATE_NEXTOBJECT, mpDragWin));
|
||||
bOk=!(ImpBegInsObjPoint(true, nNextPnt, aPnt, eCmd == SdrCreateCmd::NextObject, mpDragWin));
|
||||
}
|
||||
|
||||
return bOk;
|
||||
|
@ -2192,7 +2192,7 @@ bool SdrObjCustomShape::EndCreate( SdrDragStat& rStat, SdrCreateCmd eCmd )
|
||||
AdaptTextMinSize();
|
||||
|
||||
SetRectsDirty();
|
||||
return ( eCmd == SDRCREATE_FORCEEND || rStat.GetPointCount() >= 2 );
|
||||
return ( eCmd == SdrCreateCmd::ForceEnd || rStat.GetPointCount() >= 2 );
|
||||
}
|
||||
|
||||
basegfx::B2DPolyPolygon SdrObjCustomShape::TakeCreatePoly(const SdrDragStat& /*rDrag*/) const
|
||||
|
@ -1353,7 +1353,7 @@ bool SdrObject::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd)
|
||||
rStat.TakeCreateRect(aOutRect);
|
||||
aOutRect.Justify();
|
||||
|
||||
return (eCmd==SDRCREATE_FORCEEND || rStat.GetPointCount()>=2);
|
||||
return (eCmd==SdrCreateCmd::ForceEnd || rStat.GetPointCount()>=2);
|
||||
}
|
||||
|
||||
void SdrObject::BrkCreate(SdrDragStat& /*rStat*/)
|
||||
|
@ -572,7 +572,7 @@ bool SdrCaptionObj::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd)
|
||||
maRect.SetPos(rStat.GetNow());
|
||||
ImpCalcTail(aPara,aTailPoly,maRect);
|
||||
SetRectsDirty();
|
||||
return (eCmd==SDRCREATE_FORCEEND || rStat.GetPointCount()>=2);
|
||||
return (eCmd==SdrCreateCmd::ForceEnd || rStat.GetPointCount()>=2);
|
||||
}
|
||||
|
||||
bool SdrCaptionObj::BckCreate(SdrDragStat& /*rStat*/)
|
||||
|
@ -712,7 +712,7 @@ bool SdrCircObj::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd)
|
||||
ImpSetCreateParams(rStat);
|
||||
ImpCircUser* pU=static_cast<ImpCircUser*>(rStat.GetUser());
|
||||
bool bRet = false;
|
||||
if (eCmd==SDRCREATE_FORCEEND && rStat.GetPointCount()<4) meCircleKind=OBJ_CIRC;
|
||||
if (eCmd==SdrCreateCmd::ForceEnd && rStat.GetPointCount()<4) meCircleKind=OBJ_CIRC;
|
||||
if (meCircleKind==OBJ_CIRC) {
|
||||
bRet=rStat.GetPointCount()>=2;
|
||||
if (bRet) {
|
||||
|
@ -2048,7 +2048,7 @@ bool SdrEdgeObj::MovCreate(SdrDragStat& rDragStat)
|
||||
|
||||
bool SdrEdgeObj::EndCreate(SdrDragStat& rDragStat, SdrCreateCmd eCmd)
|
||||
{
|
||||
bool bOk=(eCmd==SDRCREATE_FORCEEND || rDragStat.GetPointCount()>=2);
|
||||
bool bOk=(eCmd==SdrCreateCmd::ForceEnd || rDragStat.GetPointCount()>=2);
|
||||
if (bOk) {
|
||||
ConnectToNode(true,aCon1.pObj);
|
||||
ConnectToNode(false,aCon2.pObj);
|
||||
|
@ -991,7 +991,7 @@ bool SdrMeasureObj::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd)
|
||||
{
|
||||
SetTextDirty();
|
||||
SetRectsDirty();
|
||||
return (eCmd==SDRCREATE_FORCEEND || rStat.GetPointCount()>=2);
|
||||
return (eCmd==SdrCreateCmd::ForceEnd || rStat.GetPointCount()>=2);
|
||||
}
|
||||
|
||||
bool SdrMeasureObj::BckCreate(SdrDragStat& /*rStat*/)
|
||||
|
@ -1403,8 +1403,8 @@ bool ImpPathForDragAndCreate::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd)
|
||||
sal_uInt16 nActPoint=rXPoly.GetPointCount()-1;
|
||||
rXPoly[nActPoint]=rStat.Now();
|
||||
if (!pU->bMixedCreate && pU->eStartKind==OBJ_LINE) {
|
||||
if (rStat.GetPointCount()>=2) eCmd=SDRCREATE_FORCEEND;
|
||||
bRet = eCmd==SDRCREATE_FORCEEND;
|
||||
if (rStat.GetPointCount()>=2) eCmd=SdrCreateCmd::ForceEnd;
|
||||
bRet = eCmd==SdrCreateCmd::ForceEnd;
|
||||
if (bRet) {
|
||||
mbCreating = false;
|
||||
delete pU;
|
||||
@ -1414,8 +1414,8 @@ bool ImpPathForDragAndCreate::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd)
|
||||
}
|
||||
|
||||
if (!pU->bMixedCreate && IsFreeHand(pU->eStartKind)) {
|
||||
if (rStat.GetPointCount()>=2) eCmd=SDRCREATE_FORCEEND;
|
||||
bRet=eCmd==SDRCREATE_FORCEEND;
|
||||
if (rStat.GetPointCount()>=2) eCmd=SdrCreateCmd::ForceEnd;
|
||||
bRet=eCmd==SdrCreateCmd::ForceEnd;
|
||||
if (bRet) {
|
||||
mbCreating=false;
|
||||
delete pU;
|
||||
@ -1423,7 +1423,7 @@ bool ImpPathForDragAndCreate::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd)
|
||||
}
|
||||
return bRet;
|
||||
}
|
||||
if (eCmd==SDRCREATE_NEXTPOINT || eCmd==SDRCREATE_NEXTOBJECT) {
|
||||
if (eCmd==SdrCreateCmd::NextPoint || eCmd==SdrCreateCmd::NextObject) {
|
||||
// don't allow two consecutive points to occupy the same position
|
||||
if (nActPoint==0 || rStat.Now()!=rXPoly[nActPoint-1]) {
|
||||
if (bIncomp) {
|
||||
@ -1458,7 +1458,7 @@ bool ImpPathForDragAndCreate::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd)
|
||||
nActPoint++;
|
||||
rXPoly[nActPoint]=rStat.GetNow();
|
||||
}
|
||||
if (eCmd==SDRCREATE_NEXTOBJECT) {
|
||||
if (eCmd==SdrCreateCmd::NextObject) {
|
||||
if (rXPoly.GetPointCount()>=2) {
|
||||
pU->bBezHasCtrl0=false;
|
||||
// only a singular polygon may be opened, so close this
|
||||
@ -1473,7 +1473,7 @@ bool ImpPathForDragAndCreate::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd)
|
||||
sal_uInt16 nPolyCount=aPathPolygon.Count();
|
||||
if (nPolyCount!=0) {
|
||||
// delete last point, if necessary
|
||||
if (eCmd==SDRCREATE_FORCEEND) {
|
||||
if (eCmd==SdrCreateCmd::ForceEnd) {
|
||||
XPolygon& rXP=aPathPolygon[nPolyCount-1];
|
||||
sal_uInt16 nPointCount=rXP.GetPointCount();
|
||||
if (nPointCount>=2) {
|
||||
@ -1493,13 +1493,13 @@ bool ImpPathForDragAndCreate::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd)
|
||||
XPolygon& rXP=aPathPolygon[nPolyNum];
|
||||
sal_uInt16 nPointCount=rXP.GetPointCount();
|
||||
// delete polygons with too few points
|
||||
if (nPolyNum<nPolyCount-1 || eCmd==SDRCREATE_FORCEEND) {
|
||||
if (nPolyNum<nPolyCount-1 || eCmd==SdrCreateCmd::ForceEnd) {
|
||||
if (nPointCount<2) aPathPolygon.Remove(nPolyNum);
|
||||
}
|
||||
}
|
||||
}
|
||||
pU->ResetFormFlags();
|
||||
bRet=eCmd==SDRCREATE_FORCEEND;
|
||||
bRet=eCmd==SdrCreateCmd::ForceEnd;
|
||||
if (bRet) {
|
||||
mbCreating=false;
|
||||
delete pU;
|
||||
|
@ -216,7 +216,7 @@ bool SdrTextObj::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd)
|
||||
if (dynamic_cast<const SdrRectObj *>(this) != nullptr) {
|
||||
static_cast<SdrRectObj*>(this)->SetXPolyDirty();
|
||||
}
|
||||
return (eCmd==SDRCREATE_FORCEEND || rStat.GetPointCount()>=2);
|
||||
return (eCmd==SdrCreateCmd::ForceEnd || rStat.GetPointCount()>=2);
|
||||
}
|
||||
|
||||
void SdrTextObj::BrkCreate(SdrDragStat& /*rStat*/)
|
||||
|
@ -60,7 +60,7 @@ SdrViewEvent::SdrViewEvent()
|
||||
pURLField(nullptr),
|
||||
eHit(SDRHIT_NONE),
|
||||
eEvent(SdrEventKind::NONE),
|
||||
eEndCreateCmd(SDRCREATE_NEXTPOINT),
|
||||
eEndCreateCmd(SdrCreateCmd::NextPoint),
|
||||
nMouseClicks(0),
|
||||
nMouseMode(MouseEventModifiers::NONE),
|
||||
nMouseCode(0),
|
||||
@ -573,9 +573,9 @@ SdrHitKind SdrView::PickAnything(const Point& rLogicPos, SdrViewEvent& rVEvt) co
|
||||
else if (IsCreateObj() || IsInsObjPoint())
|
||||
{
|
||||
eEvent=IsCreateObj() ? SdrEventKind::EndCreate : SdrEventKind::EndInsertObjPoint;
|
||||
rVEvt.eEndCreateCmd=SDRCREATE_NEXTPOINT;
|
||||
if (MODKEY_PolyPoly) rVEvt.eEndCreateCmd=SDRCREATE_NEXTOBJECT;
|
||||
if (rVEvt.nMouseClicks>1) rVEvt.eEndCreateCmd=SDRCREATE_FORCEEND;
|
||||
rVEvt.eEndCreateCmd=SdrCreateCmd::NextPoint;
|
||||
if (MODKEY_PolyPoly) rVEvt.eEndCreateCmd=SdrCreateCmd::NextObject;
|
||||
if (rVEvt.nMouseClicks>1) rVEvt.eEndCreateCmd=SdrCreateCmd::ForceEnd;
|
||||
}
|
||||
else if (IsMarking())
|
||||
{
|
||||
@ -803,9 +803,9 @@ bool SdrView::DoMouseEvent(const SdrViewEvent& rVEvt)
|
||||
bRet=true;
|
||||
} break;
|
||||
case SdrEventKind::EndCreate: { // if necessary, MarkObj
|
||||
SdrCreateCmd eCmd=SDRCREATE_NEXTPOINT;
|
||||
if (MODKEY_PolyPoly) eCmd=SDRCREATE_NEXTOBJECT;
|
||||
if (rVEvt.nMouseClicks>1) eCmd=SDRCREATE_FORCEEND;
|
||||
SdrCreateCmd eCmd=SdrCreateCmd::NextPoint;
|
||||
if (MODKEY_PolyPoly) eCmd=SdrCreateCmd::NextObject;
|
||||
if (rVEvt.nMouseClicks>1) eCmd=SdrCreateCmd::ForceEnd;
|
||||
if (!EndCreateObj(eCmd)) { // Don't evaluate event for Create? -> Select
|
||||
if (eHit==SDRHIT_UNMARKEDOBJECT || eHit==SDRHIT_TEXTEDIT) {
|
||||
MarkObj(rVEvt.pRootObj,rVEvt.pPV);
|
||||
@ -880,9 +880,9 @@ bool SdrView::DoMouseEvent(const SdrViewEvent& rVEvt)
|
||||
case SdrEventKind::BeginMark: bRet=BegMark(aLogicPos,rVEvt.bAddMark,rVEvt.bUnmark); break;
|
||||
case SdrEventKind::BeginInsertObjPoint: bRet = BegInsObjPoint(aLogicPos, MODKEY_PolyPoly); break;
|
||||
case SdrEventKind::EndInsertObjPoint: {
|
||||
SdrCreateCmd eCmd=SDRCREATE_NEXTPOINT;
|
||||
if (MODKEY_PolyPoly) eCmd=SDRCREATE_NEXTOBJECT;
|
||||
if (rVEvt.nMouseClicks>1) eCmd=SDRCREATE_FORCEEND;
|
||||
SdrCreateCmd eCmd=SdrCreateCmd::NextPoint;
|
||||
if (MODKEY_PolyPoly) eCmd=SdrCreateCmd::NextObject;
|
||||
if (rVEvt.nMouseClicks>1) eCmd=SdrCreateCmd::ForceEnd;
|
||||
EndInsObjPoint(eCmd);
|
||||
bRet=true;
|
||||
} break;
|
||||
|
@ -2345,7 +2345,7 @@ bool SdrTableObj::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd)
|
||||
{
|
||||
rStat.TakeCreateRect(maRect);
|
||||
ImpJustifyRect(maRect);
|
||||
return (eCmd==SDRCREATE_FORCEEND || rStat.GetPointCount()>=2);
|
||||
return (eCmd==SdrCreateCmd::ForceEnd || rStat.GetPointCount()>=2);
|
||||
}
|
||||
|
||||
void SdrTableObj::BrkCreate(SdrDragStat& /*rStat*/)
|
||||
|
@ -521,13 +521,13 @@ public:
|
||||
|
||||
/** Process of creating draw objects. At the beginning object type is passed.
|
||||
At the end a Cmd can be passed. Here, SDRCREATE_RESTRAINTEND for end
|
||||
or SDRCREATE_NEXTPOINT for a polygon may be relevant.
|
||||
or SdrCreateCmd::NextPoint for a polygon may be relevant.
|
||||
After RESTRAINTEND the object is created and selected.
|
||||
BreakCreate interrupts the process. In this case no object is selected. */
|
||||
bool BeginCreate( sal_uInt16 /*SdrObjKind ?*/ eSdrObjectKind, const Point &rPos );
|
||||
bool BeginCreate( sal_uInt16 /*SdrObjKind ?*/ eSdrObjectKind, sal_uInt32 eObjInventor, const Point &);
|
||||
void MoveCreate ( const Point &rPos );
|
||||
bool EndCreate ( sal_uInt16 eSdrCreateCmd );
|
||||
bool EndCreate ( SdrCreateCmd eSdrCreateCmd );
|
||||
void BreakCreate();
|
||||
bool IsDrawCreate() const;
|
||||
void CreateDefaultShape( sal_uInt16 /*SdrObjKind ?*/ eSdrObjectKind, const Rectangle& rRect, sal_uInt16 nSlotId);
|
||||
|
@ -1522,7 +1522,7 @@ void SwFEShell::MoveCreate( const Point &rPos )
|
||||
}
|
||||
}
|
||||
|
||||
bool SwFEShell::EndCreate( sal_uInt16 eSdrCreateCmd )
|
||||
bool SwFEShell::EndCreate( SdrCreateCmd eSdrCreateCmd )
|
||||
{
|
||||
// To assure undo-object from the DrawEngine is not stored,
|
||||
// (we create our own undo-object!), temporarily switch-off Undo
|
||||
@ -1531,8 +1531,7 @@ bool SwFEShell::EndCreate( sal_uInt16 eSdrCreateCmd )
|
||||
{
|
||||
GetDoc()->GetIDocumentUndoRedo().DoDrawUndo(false);
|
||||
}
|
||||
bool bCreate = Imp()->GetDrawView()->EndCreateObj(
|
||||
SdrCreateCmd( eSdrCreateCmd ) );
|
||||
bool bCreate = Imp()->GetDrawView()->EndCreateObj( eSdrCreateCmd );
|
||||
GetDoc()->GetIDocumentUndoRedo().DoDrawUndo(true);
|
||||
|
||||
if ( !bCreate )
|
||||
@ -1541,7 +1540,7 @@ bool SwFEShell::EndCreate( sal_uInt16 eSdrCreateCmd )
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( (SdrCreateCmd)eSdrCreateCmd == SDRCREATE_NEXTPOINT )
|
||||
if ( eSdrCreateCmd == SdrCreateCmd::NextPoint )
|
||||
{
|
||||
::FrameNotify( this );
|
||||
return true;
|
||||
|
@ -64,7 +64,7 @@ bool ConstArc::MouseButtonUp( const MouseEvent& rMEvt )
|
||||
bReturn = true;
|
||||
}
|
||||
else
|
||||
m_pSh->EndCreate(SDRCREATE_NEXTPOINT);
|
||||
m_pSh->EndCreate(SdrCreateCmd::NextPoint);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -104,7 +104,7 @@ void ConstFormControl::CreateDefaultObject()
|
||||
pSdrView->SetDesignMode();
|
||||
m_pSh->BeginCreate( static_cast< sal_uInt16 >(m_pWin->GetSdrDrawMode()), FmFormInventor, aStartPos);
|
||||
m_pSh->MoveCreate(aEndPos);
|
||||
m_pSh->EndCreate(SDRCREATE_FORCEEND);
|
||||
m_pSh->EndCreate(SdrCreateCmd::ForceEnd);
|
||||
}
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||
|
@ -60,7 +60,7 @@ bool ConstPolygon::MouseButtonUp(const MouseEvent& rMEvt)
|
||||
m_pWin->GetSdrDrawMode() != OBJ_FREELINE &&
|
||||
m_pWin->GetSdrDrawMode() != OBJ_FREEFILL)
|
||||
{
|
||||
if (!m_pSh->EndCreate(SDRCREATE_NEXTPOINT))
|
||||
if (!m_pSh->EndCreate(SdrCreateCmd::NextPoint))
|
||||
{
|
||||
m_pSh->BreakCreate();
|
||||
EnterSelectMode(rMEvt);
|
||||
|
@ -268,7 +268,7 @@ bool SwDrawBase::MouseButtonUp(const MouseEvent& rMEvt)
|
||||
m_pSh->StartUndo(UNDO_INSERT, &aRewriter);
|
||||
}
|
||||
|
||||
m_pSh->EndCreate(SDRCREATE_FORCEEND);
|
||||
m_pSh->EndCreate(SdrCreateCmd::ForceEnd);
|
||||
if (OBJ_NONE == nDrawMode) // Text border inserted
|
||||
{
|
||||
uno::Reference< frame::XDispatchRecorder > xRecorder =
|
||||
@ -362,7 +362,7 @@ bool SwDrawBase::MouseButtonUp(const MouseEvent& rMEvt)
|
||||
if ( pSdrView->IsAction() )
|
||||
{
|
||||
if ( pSdrView->IsInsObjPoint() )
|
||||
bReturn = pSdrView->EndInsObjPoint(SDRCREATE_FORCEEND);
|
||||
bReturn = pSdrView->EndInsObjPoint(SdrCreateCmd::ForceEnd);
|
||||
else if (pSdrView->IsMarkPoints() )
|
||||
bReturn = pSdrView->EndMarkPoints();
|
||||
else
|
||||
|
@ -67,7 +67,7 @@ void SwBaseShell::InsertURLButton(const OUString& rURL, const OUString& rTarget,
|
||||
Point aEndPos(aSz.Width(), aSz.Height());
|
||||
|
||||
rSh.MoveCreate(aStartPos + aEndPos);
|
||||
rSh.EndCreate(SDRCREATE_FORCEEND);
|
||||
rSh.EndCreate(SdrCreateCmd::ForceEnd);
|
||||
|
||||
const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
|
||||
if (rMarkList.GetMark(0))
|
||||
|
Loading…
x
Reference in New Issue
Block a user