convert SdrInsertReasonKind to scoped enum
Change-Id: I225250ef296bb263bdb83c13e23412bf0204be51
This commit is contained in:
parent
c2238e16fd
commit
1a37d46c79
@ -52,12 +52,12 @@ class Color;
|
||||
class SfxStyleSheet;
|
||||
class SvxUnoDrawPagesAccess;
|
||||
|
||||
enum SdrInsertReasonKind {
|
||||
SDRREASON_UNKNOWN,
|
||||
SDRREASON_STREAMING, /// importing document
|
||||
SDRREASON_UNDO, /// from Undo
|
||||
SDRREASON_COPY, /// something copied...
|
||||
SDRREASON_VIEWCALL /// via SdrView::Group(), ...
|
||||
enum class SdrInsertReasonKind {
|
||||
Unknown,
|
||||
Streaming, /// importing document
|
||||
Undo, /// from Undo
|
||||
Copy, /// something copied...
|
||||
ViewCall /// via SdrView::Group(), ...
|
||||
};
|
||||
|
||||
class SdrInsertReason {
|
||||
|
@ -266,7 +266,7 @@ void OReportSection::Paste(const uno::Sequence< beans::NamedValue >& _aAllreadyC
|
||||
|
||||
pNeuObj->SetPage( m_pPage );
|
||||
pNeuObj->SetModel( m_pModel.get() );
|
||||
SdrInsertReason aReason(SDRREASON_VIEWCALL);
|
||||
SdrInsertReason aReason(SdrInsertReasonKind::ViewCall);
|
||||
m_pPage->InsertObject(pNeuObj, SAL_MAX_SIZE, &aReason);
|
||||
|
||||
Rectangle aRet(VCLPoint((*pCopiesIter)->getPosition()),VCLSize((*pCopiesIter)->getSize()));
|
||||
|
@ -133,7 +133,7 @@ void FmFormPage::InsertObject(SdrObject* pObj, size_t nPos,
|
||||
const SdrInsertReason* pReason)
|
||||
{
|
||||
SdrPage::InsertObject( pObj, nPos, pReason );
|
||||
if (GetModel() && (!pReason || pReason->GetReason() != SDRREASON_STREAMING))
|
||||
if (GetModel() && (!pReason || pReason->GetReason() != SdrInsertReasonKind::Streaming))
|
||||
static_cast<FmFormModel*>(GetModel())->GetUndoEnv().Inserted(pObj);
|
||||
}
|
||||
|
||||
|
@ -676,7 +676,7 @@ void SdrEditView::ForceMarkedObjToAnotherPage()
|
||||
if(bFnd)
|
||||
{
|
||||
pM->GetPageView()->GetObjList()->RemoveObject(pObj->GetOrdNum());
|
||||
SdrInsertReason aReason(SDRREASON_VIEWCALL);
|
||||
SdrInsertReason aReason(SdrInsertReasonKind::ViewCall);
|
||||
pPV->GetObjList()->InsertObject(pObj, SAL_MAX_SIZE, &aReason);
|
||||
pM->SetPageView(pPV);
|
||||
InvalidateAllWin(aObjRect);
|
||||
@ -906,7 +906,7 @@ void SdrEditView::CopyMarkedObj()
|
||||
SdrMark* pM=aSourceObjectsForCopy.GetMark(nm);
|
||||
SdrObject* pO=pM->GetMarkedSdrObj()->Clone();
|
||||
if (pO!=nullptr) {
|
||||
SdrInsertReason aReason(SDRREASON_VIEWCALL);
|
||||
SdrInsertReason aReason(SdrInsertReasonKind::ViewCall);
|
||||
pM->GetPageView()->GetObjList()->InsertObject(pO, SAL_MAX_SIZE, &aReason);
|
||||
|
||||
if( bUndo )
|
||||
@ -969,7 +969,7 @@ bool SdrEditView::InsertObjectAtView(SdrObject* pObj, SdrPageView& rPV, SdrInser
|
||||
pObj->SetMergedItemSet(maDefaultAttr);
|
||||
}
|
||||
if (!pObj->IsInserted()) {
|
||||
SdrInsertReason aReason(SDRREASON_VIEWCALL);
|
||||
SdrInsertReason aReason(SdrInsertReasonKind::ViewCall);
|
||||
if (nOptions & SdrInsertFlags::NOBROADCAST) {
|
||||
rPV.GetObjList()->NbcInsertObject(pObj, SAL_MAX_SIZE, &aReason);
|
||||
} else {
|
||||
|
@ -1129,7 +1129,7 @@ void SdrEditView::MergeMarkedObjects(SdrMergeMode eMode)
|
||||
{
|
||||
SdrPathObj* pPath = new SdrPathObj(OBJ_PATHFILL, aMergePolyPolygonA);
|
||||
ImpCopyAttributes(pAttrObj, pPath);
|
||||
SdrInsertReason aReason(SDRREASON_VIEWCALL);
|
||||
SdrInsertReason aReason(SdrInsertReasonKind::ViewCall);
|
||||
pInsOL->InsertObject(pPath, nInsPos, &aReason);
|
||||
if( bUndo )
|
||||
AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoNewObject(*pPath));
|
||||
@ -1375,7 +1375,7 @@ void SdrEditView::CombineMarkedObjects(bool bNoPolyPoly)
|
||||
pPath->SetMergedItem(XLineStyleItem(drawing::LineStyle_SOLID));
|
||||
}
|
||||
|
||||
SdrInsertReason aReason(SDRREASON_VIEWCALL);
|
||||
SdrInsertReason aReason(SdrInsertReasonKind::ViewCall);
|
||||
pInsOL->InsertObject(pPath,nInsPos,&aReason);
|
||||
if( bUndo )
|
||||
AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoNewObject(*pPath));
|
||||
@ -1529,7 +1529,7 @@ void SdrEditView::ImpDismantleOneObject(const SdrObject* pObj, SdrObjList& rOL,
|
||||
SdrPathObj* pPath = new SdrPathObj((SdrObjKind)pSrcPath->GetObjIdentifier(), basegfx::B2DPolyPolygon(rCandidate));
|
||||
ImpCopyAttributes(pSrcPath, pPath);
|
||||
pLast = pPath;
|
||||
SdrInsertReason aReason(SDRREASON_VIEWCALL);
|
||||
SdrInsertReason aReason(SdrInsertReasonKind::ViewCall);
|
||||
rOL.InsertObject(pPath, rPos, &aReason);
|
||||
if( bUndo )
|
||||
AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoNewObject(*pPath, true));
|
||||
@ -1564,7 +1564,7 @@ void SdrEditView::ImpDismantleOneObject(const SdrObject* pObj, SdrObjList& rOL,
|
||||
SdrPathObj* pPath = new SdrPathObj(eKind, basegfx::B2DPolyPolygon(aNewPolygon));
|
||||
ImpCopyAttributes(pSrcPath, pPath);
|
||||
pLast = pPath;
|
||||
SdrInsertReason aReason(SDRREASON_VIEWCALL);
|
||||
SdrInsertReason aReason(SdrInsertReasonKind::ViewCall);
|
||||
rOL.InsertObject(pPath, rPos, &aReason);
|
||||
if( bUndo )
|
||||
AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoNewObject(*pPath, true));
|
||||
@ -1600,7 +1600,7 @@ void SdrEditView::ImpDismantleOneObject(const SdrObject* pObj, SdrObjList& rOL,
|
||||
}
|
||||
}
|
||||
|
||||
SdrInsertReason aReason(SDRREASON_VIEWCALL);
|
||||
SdrInsertReason aReason(SdrInsertReasonKind::ViewCall);
|
||||
rOL.InsertObject(pCandidate, rPos, &aReason);
|
||||
if( bUndo )
|
||||
AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoNewObject(*pCandidate, true));
|
||||
@ -1785,7 +1785,7 @@ void SdrEditView::GroupMarked()
|
||||
pSrcLst->RemoveObject(pObj->GetOrdNumDirect());
|
||||
if (!bForeignList)
|
||||
nInsPos--; // correct InsertPos
|
||||
SdrInsertReason aReason(SDRREASON_VIEWCALL);
|
||||
SdrInsertReason aReason(SdrInsertReasonKind::ViewCall);
|
||||
pDstLst->InsertObject(pObj,0,&aReason);
|
||||
GetMarkedObjectListWriteAccess().DeleteMark(nm);
|
||||
pSrcLst0=pSrcLst;
|
||||
@ -1795,7 +1795,7 @@ void SdrEditView::GroupMarked()
|
||||
{
|
||||
aNewMark.InsertEntry(SdrMark(pGrp,pPV));
|
||||
const size_t nCount=pDstLst->GetObjCount();
|
||||
SdrInsertReason aReason(SDRREASON_VIEWCALL);
|
||||
SdrInsertReason aReason(SdrInsertReasonKind::ViewCall);
|
||||
pAktLst->InsertObject(pGrp,nInsPos,&aReason);
|
||||
if( bUndo )
|
||||
{
|
||||
@ -1871,7 +1871,7 @@ void SdrEditView::UnGroupMarked()
|
||||
for (size_t no=0; no<nObjCount; ++no)
|
||||
{
|
||||
SdrObject* pObj=pSrcLst->RemoveObject(0);
|
||||
SdrInsertReason aReason(SDRREASON_VIEWCALL);
|
||||
SdrInsertReason aReason(SdrInsertReasonKind::ViewCall);
|
||||
pDstLst->InsertObject(pObj,nDstCnt,&aReason);
|
||||
if( bUndo )
|
||||
AddUndo( GetModel()->GetSdrUndoFactory().CreateUndoInsertObject(*pObj,true));
|
||||
|
@ -293,7 +293,7 @@ size_t ImpSdrGDIMetaFileImport::DoImport(
|
||||
// insert all objects cached in aTmpList now into rOL from nInsPos
|
||||
nInsPos = std::min(nInsPos, rOL.GetObjCount());
|
||||
|
||||
SdrInsertReason aReason(SDRREASON_VIEWCALL);
|
||||
SdrInsertReason aReason(SdrInsertReasonKind::ViewCall);
|
||||
|
||||
for(SdrObject* pObj : maTmpList)
|
||||
{
|
||||
|
@ -135,7 +135,7 @@ void SdrObjList::CopyObjects(const SdrObjList& rSrcList)
|
||||
bRectsDirty =false;
|
||||
size_t nCloneErrCnt = 0;
|
||||
const size_t nCount = rSrcList.GetObjCount();
|
||||
SdrInsertReason aReason(SDRREASON_COPY);
|
||||
SdrInsertReason aReason(SdrInsertReasonKind::Copy);
|
||||
for (size_t no=0; no<nCount; ++no) {
|
||||
SdrObject* pSO=rSrcList.GetObj(no);
|
||||
|
||||
@ -740,7 +740,7 @@ void SdrObjList::UnGroupObj( size_t nObjNum )
|
||||
for( size_t i=0; i<nCount; ++i )
|
||||
{
|
||||
SdrObject* pObj = pSrcLst->RemoveObject(0);
|
||||
SdrInsertReason aReason(SDRREASON_VIEWCALL);
|
||||
SdrInsertReason aReason(SdrInsertReasonKind::ViewCall);
|
||||
InsertObject(pObj, nInsertPos, &aReason);
|
||||
++nInsertPos;
|
||||
}
|
||||
|
@ -380,7 +380,7 @@ void SdrPolyEditView::RipUpAtMarkedPoints()
|
||||
|
||||
if(pNeuObj)
|
||||
{
|
||||
SdrInsertReason aReason(SDRREASON_VIEWCALL);
|
||||
SdrInsertReason aReason(SdrInsertReasonKind::ViewCall);
|
||||
pM->GetPageView()->GetObjList()->InsertObject(pNeuObj, pObj->GetOrdNum() + 1, &aReason);
|
||||
if( bUndo )
|
||||
AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoNewObject(*pNeuObj));
|
||||
|
@ -746,7 +746,7 @@ void SdrUndoRemoveObj::Undo()
|
||||
}
|
||||
|
||||
E3DModifySceneSnapRectUpdater aUpdater(pObjList->GetOwnerObj());
|
||||
SdrInsertReason aReason(SDRREASON_UNDO);
|
||||
SdrInsertReason aReason(SdrInsertReasonKind::Undo);
|
||||
pObjList->InsertObject(pObj,nOrdNum,&aReason);
|
||||
|
||||
// #i11426#
|
||||
@ -805,7 +805,7 @@ void SdrUndoInsertObj::Redo()
|
||||
aAnchorPos = pObj->GetAnchorPos();
|
||||
}
|
||||
|
||||
SdrInsertReason aReason(SDRREASON_UNDO);
|
||||
SdrInsertReason aReason(SdrInsertReasonKind::Undo);
|
||||
pObjList->InsertObject(pObj,nOrdNum,&aReason);
|
||||
|
||||
// Arcs lose position when grouped (#i45952#)
|
||||
|
@ -342,7 +342,7 @@ bool SdrExchangeView::Paste(
|
||||
pNeuObj->SetLayer(nLayer);
|
||||
}
|
||||
|
||||
SdrInsertReason aReason(SDRREASON_VIEWCALL);
|
||||
SdrInsertReason aReason(SdrInsertReasonKind::ViewCall);
|
||||
pDstLst->InsertObject(pNeuObj, SAL_MAX_SIZE, &aReason);
|
||||
|
||||
if( bUndo )
|
||||
@ -420,7 +420,7 @@ void SdrExchangeView::ImpPasteObject(SdrObject* pObj, SdrObjList& rLst, const Po
|
||||
Point aPos(rCenter.X()-xs/2,rCenter.Y()-ys/2);
|
||||
Rectangle aR(aPos.X(),aPos.Y(),aPos.X()+xs,aPos.Y()+ys);
|
||||
pObj->SetLogicRect(aR);
|
||||
SdrInsertReason aReason(SDRREASON_VIEWCALL);
|
||||
SdrInsertReason aReason(SdrInsertReasonKind::ViewCall);
|
||||
rLst.InsertObject(pObj, SAL_MAX_SIZE, &aReason);
|
||||
|
||||
if( IsUndoEnabled() )
|
||||
@ -750,7 +750,7 @@ SdrModel* SdrExchangeView::GetMarkedObjModel() const
|
||||
pNeuObj->SetModel( pNeuMod );
|
||||
}
|
||||
|
||||
SdrInsertReason aReason(SDRREASON_VIEWCALL);
|
||||
SdrInsertReason aReason(SdrInsertReasonKind::ViewCall);
|
||||
pNeuPag->InsertObject(pNeuObj, SAL_MAX_SIZE, &aReason);
|
||||
|
||||
// #i13033#
|
||||
|
@ -2608,7 +2608,7 @@ bool SvxTableController::GetMarkedObjModel( SdrPage* pNewPage )
|
||||
pNewTableObj->SetPage( pNewPage );
|
||||
pNewTableObj->SetModel( pNewPage->GetModel() );
|
||||
|
||||
SdrInsertReason aReason(SDRREASON_VIEWCALL);
|
||||
SdrInsertReason aReason(SdrInsertReasonKind::ViewCall);
|
||||
pNewPage->InsertObject(pNewTableObj, SAL_MAX_SIZE, &aReason);
|
||||
|
||||
return true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user