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