diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2021-12-30 20:33:52 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-01-07 14:22:07 +0100 |
commit | 8295a3344704ce9a18489933c499a50c403f1a3d (patch) | |
tree | 92a10017311909e3010624b39acddfcf7d3eba00 /sd/source/ui | |
parent | 8accfa30343195b5d7cfd111301677a6a9b6a21b (diff) |
remove E3D_INVENTOR_FLAG and convert SdrObjKind to scoped enum
We don't need E3D_INVENTOR_FLAG, we can just check if the SdrObjKind is
in the right range.
Which exposes some dodgy code in DrawViewShell::GetMenuStateSel
SfxItemState::DEFAULT == rSet.GetItemState( OBJ_TITLETEXT ) ||
SfxItemState::DEFAULT == rSet.GetItemState( OBJ_OUTLINETEXT ) ||
which has been there ever since
commit f47a9d9db3d06927380bb79b04bb6d4721a92d2b
Date: Mon Sep 18 16:07:07 2000 +0000
initial import
just remove that.
In SwFEShell::ImpEndCreate() move some logic around to avoid
using an out-of-range SdrObjKind value
Change-Id: I4620bfe61aca8f7415503debe3c84bfe5f4368a0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127763
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd/source/ui')
46 files changed, 263 insertions, 261 deletions
diff --git a/sd/source/ui/app/sdxfer.cxx b/sd/source/ui/app/sdxfer.cxx index d63fd580efef..14e63798aec9 100644 --- a/sd/source/ui/app/sdxfer.cxx +++ b/sd/source/ui/app/sdxfer.cxx @@ -173,7 +173,7 @@ void SdTransferable::CreateObjectReplacement( SdrObject* pObj ) { mpGraphic.reset( new Graphic( static_cast< SdrGrafObj* >( pObj )->GetTransformedGraphic() ) ); } - else if( pObj->IsUnoObj() && SdrInventor::FmForm == pObj->GetObjInventor() && ( pObj->GetObjIdentifier() == sal_uInt16(OBJ_FM_BUTTON) ) ) + else if( pObj->IsUnoObj() && SdrInventor::FmForm == pObj->GetObjInventor() && ( pObj->GetObjIdentifier() == SdrObjKind::FormButton ) ) { SdrUnoObj* pUnoCtrl = static_cast< SdrUnoObj* >( pObj ); diff --git a/sd/source/ui/dlg/animobjs.cxx b/sd/source/ui/dlg/animobjs.cxx index 5299ef003604..b70848e23c78 100644 --- a/sd/source/ui/dlg/animobjs.cxx +++ b/sd/source/ui/dlg/animobjs.cxx @@ -707,10 +707,10 @@ void AnimationWindow::AddObj (::sd::View& rView ) SdrObject* pObject = pMark->GetMarkedSdrObj(); SdAnimationInfo* pAnimInfo = SdDrawDocument::GetAnimationInfo( pObject ); SdrInventor nInv = pObject->GetObjInventor(); - sal_uInt16 nId = pObject->GetObjIdentifier(); + SdrObjKind nId = pObject->GetObjIdentifier(); // Animated Bitmap (GIF) - if( nInv == SdrInventor::Default && nId == OBJ_GRAF && static_cast<SdrGrafObj*>( pObject )->IsAnimated() ) + if( nInv == SdrInventor::Default && nId == SdrObjKind::Graphic && static_cast<SdrGrafObj*>( pObject )->IsAnimated() ) { const SdrGrafObj* pGrafObj = static_cast<SdrGrafObj*>(pObject); Graphic aGraphic( pGrafObj->GetTransformedGraphic() ); diff --git a/sd/source/ui/dlg/dlgolbul.cxx b/sd/source/ui/dlg/dlgolbul.cxx index 96a2dfaecc20..002629ec8814 100644 --- a/sd/source/ui/dlg/dlgolbul.cxx +++ b/sd/source/ui/dlg/dlgolbul.cxx @@ -69,10 +69,10 @@ OutlineBulletDlg::OutlineBulletDlg(weld::Window* pParent, const SfxItemSet* pAtt { switch(pObj->GetObjIdentifier()) { - case OBJ_TITLETEXT: + case SdrObjKind::TitleText: m_bTitle = true; break; - case OBJ_OUTLINETEXT: + case SdrObjKind::OutlineText: bOutliner = true; break; default: diff --git a/sd/source/ui/dlg/prltempl.cxx b/sd/source/ui/dlg/prltempl.cxx index f922c7440c49..d5bf449f75e5 100644 --- a/sd/source/ui/dlg/prltempl.cxx +++ b/sd/source/ui/dlg/prltempl.cxx @@ -258,7 +258,7 @@ void SdPresLayoutTemplateDlg::PageCreated(const OString& rId, SfxTabPage &rPage) } else if (rId == "RID_SVXPAGE_TEXTATTR") { - aSet.Put(CntUInt16Item(SID_SVXTEXTATTRPAGE_OBJKIND, OBJ_TEXT)); + aSet.Put(CntUInt16Item(SID_SVXTEXTATTRPAGE_OBJKIND, static_cast<sal_uInt16>(SdrObjKind::Text))); rPage.PageCreated(aSet); } else if (rId == "RID_SVXPAGE_BKG") diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx index d8848780bd20..53306fffc0b6 100644 --- a/sd/source/ui/dlg/sdtreelb.cxx +++ b/sd/source/ui/dlg/sdtreelb.cxx @@ -897,13 +897,13 @@ IMPL_LINK(SdPageObjsTLV, RequestingChildrenHdl, const weld::TreeIter&, rFileEntr OUString aStr( GetObjectName( pObj ) ); if( !aStr.isEmpty() ) { - if( pObj->GetObjInventor() == SdrInventor::Default && pObj->GetObjIdentifier() == OBJ_OLE2 ) + if( pObj->GetObjInventor() == SdrInventor::Default && pObj->GetObjIdentifier() == SdrObjKind::OLE2 ) { m_xTreeView->insert(xPageEntry.get(), -1, &aStr, nullptr, nullptr, nullptr, false, m_xScratchIter.get()); m_xTreeView->set_image(*m_xScratchIter, sImgOle); } - else if( pObj->GetObjInventor() == SdrInventor::Default && pObj->GetObjIdentifier() == OBJ_GRAF ) + else if( pObj->GetObjInventor() == SdrInventor::Default && pObj->GetObjIdentifier() == SdrObjKind::Graphic ) { m_xTreeView->insert(xPageEntry.get(), -1, &aStr, nullptr, nullptr, nullptr, false, m_xScratchIter.get()); @@ -1043,11 +1043,11 @@ void SdPageObjsTLV::AddShapeList ( if( !aStr.isEmpty() ) { - if( pObj->GetObjInventor() == SdrInventor::Default && pObj->GetObjIdentifier() == OBJ_OLE2 ) + if( pObj->GetObjInventor() == SdrInventor::Default && pObj->GetObjIdentifier() == SdrObjKind::OLE2 ) { InsertEntry(xEntry.get(), sId, aStr, BMP_OLE); } - else if( pObj->GetObjInventor() == SdrInventor::Default && pObj->GetObjIdentifier() == OBJ_GRAF ) + else if( pObj->GetObjInventor() == SdrInventor::Default && pObj->GetObjIdentifier() == SdrObjKind::Graphic ) { InsertEntry(xEntry.get(), sId, aStr, BMP_GRAPHIC); } diff --git a/sd/source/ui/dlg/tpaction.cxx b/sd/source/ui/dlg/tpaction.cxx index 46611d147eb6..251cefa9a775 100644 --- a/sd/source/ui/dlg/tpaction.cxx +++ b/sd/source/ui/dlg/tpaction.cxx @@ -167,13 +167,13 @@ void SdTPAction::Construct() SdrObject* pObj = pMark->GetMarkedSdrObj(); SdrInventor nInv = pObj->GetObjInventor(); - sal_uInt16 nSdrObjKind = pObj->GetObjIdentifier(); + SdrObjKind nSdrObjKind = pObj->GetObjIdentifier(); - if (nInv == SdrInventor::Default && nSdrObjKind == OBJ_OLE2) + if (nInv == SdrInventor::Default && nSdrObjKind == SdrObjKind::OLE2) { pOleObj = static_cast<SdrOle2Obj*>(pObj); } - else if (nInv == SdrInventor::Default && nSdrObjKind == OBJ_GRAF) + else if (nInv == SdrInventor::Default && nSdrObjKind == SdrObjKind::Graphic) { pGrafObj = static_cast<SdrGrafObj*>(pObj); } diff --git a/sd/source/ui/docshell/docshel3.cxx b/sd/source/ui/docshell/docshel3.cxx index 875aa5b01347..1a9e70833d5f 100644 --- a/sd/source/ui/docshell/docshel3.cxx +++ b/sd/source/ui/docshell/docshel3.cxx @@ -122,7 +122,7 @@ static void lcl_setLanguage( const SdDrawDocument *pDoc, std::u16string_view rLa for( size_t nObj = 0; nObj < nObjCount; ++nObj ) { SdrObject *pObj = pPage->GetObj( nObj ); - if (pObj->GetObjIdentifier() != OBJ_PAGE) + if (pObj->GetObjIdentifier() != SdrObjKind::Page) lcl_setLanguageForObj( pObj, nLang, bLanguageNone ); } } diff --git a/sd/source/ui/func/fucon3d.cxx b/sd/source/ui/func/fucon3d.cxx index ddbe1f238bfe..6a670671b46c 100644 --- a/sd/source/ui/func/fucon3d.cxx +++ b/sd/source/ui/func/fucon3d.cxx @@ -372,7 +372,7 @@ bool FuConstruct3dObject::MouseButtonUp(const MouseEvent& rMEvt) void FuConstruct3dObject::Activate() { - mpView->SetCurrentObj(OBJ_NONE); + mpView->SetCurrentObj(SdrObjKind::NONE); FuConstruct::Activate(); } diff --git a/sd/source/ui/func/fuconarc.cxx b/sd/source/ui/func/fuconarc.cxx index d0370457f869..b5be93f9b7fb 100644 --- a/sd/source/ui/func/fuconarc.cxx +++ b/sd/source/ui/func/fuconarc.cxx @@ -165,7 +165,7 @@ void FuConstructArc::Activate() case SID_DRAW_ARC : case SID_DRAW_CIRCLEARC: { - aObjKind = OBJ_CARC; + aObjKind = SdrObjKind::CircleArc; } break; @@ -174,7 +174,7 @@ void FuConstructArc::Activate() case SID_DRAW_CIRCLEPIE : case SID_DRAW_CIRCLEPIE_NOFILL: { - aObjKind = OBJ_SECT; + aObjKind = SdrObjKind::CircleSection; } break; @@ -183,13 +183,13 @@ void FuConstructArc::Activate() case SID_DRAW_CIRCLECUT : case SID_DRAW_CIRCLECUT_NOFILL : { - aObjKind = OBJ_CCUT; + aObjKind = SdrObjKind::CircleCut; } break; default: { - aObjKind = OBJ_CARC; + aObjKind = SdrObjKind::CircleArc; } break; } diff --git a/sd/source/ui/func/fuconbez.cxx b/sd/source/ui/func/fuconbez.cxx index 8c4219cf523c..83d8e8bd42d3 100644 --- a/sd/source/ui/func/fuconbez.cxx +++ b/sd/source/ui/func/fuconbez.cxx @@ -292,44 +292,44 @@ void FuConstructBezierPolygon::Activate() case SID_DRAW_POLYGON_NOFILL: case SID_DRAW_XPOLYGON_NOFILL: { - eKind = OBJ_PLIN; + eKind = SdrObjKind::PolyLine; } break; case SID_DRAW_POLYGON: case SID_DRAW_XPOLYGON: { - eKind = OBJ_POLY; + eKind = SdrObjKind::Polygon; } break; case SID_DRAW_BEZIER_NOFILL: { - eKind = OBJ_PATHLINE; + eKind = SdrObjKind::PathLine; } break; case SID_DRAW_BEZIER_FILL: { - eKind = OBJ_PATHFILL; + eKind = SdrObjKind::PathFill; } break; case SID_DRAW_FREELINE_NOFILL: { - eKind = OBJ_FREELINE; + eKind = SdrObjKind::FreehandLine; } break; case SID_DRAW_FREELINE: { - eKind = OBJ_FREEFILL; + eKind = SdrObjKind::FreehandFill; } break; default: { - eKind = OBJ_PATHLINE; + eKind = SdrObjKind::PathLine; } break; } diff --git a/sd/source/ui/func/fuconcs.cxx b/sd/source/ui/func/fuconcs.cxx index 0fa62faec1fe..964366f4522d 100644 --- a/sd/source/ui/func/fuconcs.cxx +++ b/sd/source/ui/func/fuconcs.cxx @@ -135,7 +135,7 @@ bool FuConstructCustomShape::MouseButtonUp(const MouseEvent& rMEvt) void FuConstructCustomShape::Activate() { - mpView->SetCurrentObj( OBJ_CUSTOMSHAPE ); + mpView->SetCurrentObj( SdrObjKind::CustomShape ); FuConstruct::Activate(); } diff --git a/sd/source/ui/func/fuconrec.cxx b/sd/source/ui/func/fuconrec.cxx index b354138af287..605a330bdf63 100644 --- a/sd/source/ui/func/fuconrec.cxx +++ b/sd/source/ui/func/fuconrec.cxx @@ -251,7 +251,7 @@ bool FuConstructRectangle::MouseButtonDown(const MouseEvent& rMEvt) mpWindow->CaptureMouse(); sal_uInt16 nDrgLog = sal_uInt16 ( mpWindow->PixelToLogic(Size(DRGPIX,0)).Width() ); - if (mpView->GetCurrentObjIdentifier() == OBJ_CAPTION) + if (mpView->GetCurrentObjIdentifier() == SdrObjKind::Caption) { Size aCaptionSize(846, 846); // (4x2)cm bReturn = mpView->BegCreateCaptionObj(aPnt, aCaptionSize, @@ -341,12 +341,12 @@ void FuConstructRectangle::Activate() [[fallthrough]]; case SID_DRAW_LINE : case SID_DRAW_XLINE: - aObjKind = OBJ_LINE; + aObjKind = SdrObjKind::Line; break; case SID_DRAW_MEASURELINE: { - aObjKind = OBJ_MEASURE; + aObjKind = SdrObjKind::Measure; } break; @@ -359,7 +359,7 @@ void FuConstructRectangle::Activate() case SID_DRAW_SQUARE_ROUND : case SID_DRAW_SQUARE_ROUND_NOFILL: { - aObjKind = OBJ_RECT; + aObjKind = SdrObjKind::Rectangle; } break; @@ -368,14 +368,14 @@ void FuConstructRectangle::Activate() case SID_DRAW_CIRCLE : case SID_DRAW_CIRCLE_NOFILL : { - aObjKind = OBJ_CIRC; + aObjKind = SdrObjKind::CircleOrEllipse; } break; case SID_DRAW_CAPTION: case SID_DRAW_CAPTION_VERTICAL: { - aObjKind = OBJ_CAPTION; + aObjKind = SdrObjKind::Caption; } break; @@ -408,19 +408,19 @@ void FuConstructRectangle::Activate() case SID_CONNECTOR_LINES_CIRCLE_END: case SID_CONNECTOR_LINES_CIRCLES: { - aObjKind = OBJ_EDGE; + aObjKind = SdrObjKind::Edge; mpView->SetGlueVisible(); } break; case SID_INSERT_SIGNATURELINE: { - aObjKind = OBJ_GRAF; + aObjKind = SdrObjKind::Graphic; } break; default: { - aObjKind = OBJ_RECT; + aObjKind = SdrObjKind::Rectangle; } break; } @@ -674,7 +674,7 @@ static ::basegfx::B2DPolyPolygon getPolygon(TranslateId pResId, const SdrModel& void FuConstructRectangle::SetLineEnds(SfxItemSet& rAttr, SdrObject const & rObj) { - if ( !((rObj.GetObjIdentifier() == OBJ_EDGE && + if ( !((rObj.GetObjIdentifier() == SdrObjKind::Edge && nSlotId != SID_TOOL_CONNECTOR && nSlotId != SID_CONNECTOR_LINE && nSlotId != SID_CONNECTOR_LINES && diff --git a/sd/source/ui/func/fuconuno.cxx b/sd/source/ui/func/fuconuno.cxx index 27d3ae247b25..afa4523c6ef9 100644 --- a/sd/source/ui/func/fuconuno.cxx +++ b/sd/source/ui/func/fuconuno.cxx @@ -45,7 +45,7 @@ FuConstructUnoControl::FuConstructUnoControl ( SfxRequest& rReq) : FuConstruct(pViewSh, pWin, pView, pDoc, rReq) , nInventor(SdrInventor::Unknown) - , nIdentifier(OBJ_NONE) + , nIdentifier(SdrObjKind::NONE) { } diff --git a/sd/source/ui/func/fudraw.cxx b/sd/source/ui/func/fudraw.cxx index 8880b41d36dd..8beb753f6387 100644 --- a/sd/source/ui/func/fudraw.cxx +++ b/sd/source/ui/func/fudraw.cxx @@ -535,11 +535,11 @@ void FuDraw::ForcePointer(const MouseEvent* pMEvt) } else if (eHit == SdrHitKind::TextEditObj && dynamic_cast< const FuSelection *>( this ) != nullptr) { - sal_uInt16 nSdrObjKind = aVEvt.mpObj->GetObjIdentifier(); + SdrObjKind nSdrObjKind = aVEvt.mpObj->GetObjIdentifier(); - if ( nSdrObjKind != OBJ_TEXT && - nSdrObjKind != OBJ_TITLETEXT && - nSdrObjKind != OBJ_OUTLINETEXT && + if ( nSdrObjKind != SdrObjKind::Text && + nSdrObjKind != SdrObjKind::TitleText && + nSdrObjKind != SdrObjKind::OutlineText && aVEvt.mpObj->IsEmptyPresObj() ) { pObj = nullptr; @@ -638,9 +638,9 @@ void FuDraw::DoubleClick(const MouseEvent& rMEvt) SdrObject* pObj = pMark->GetMarkedSdrObj(); SdrInventor nInv = pObj->GetObjInventor(); - sal_uInt16 nSdrObjKind = pObj->GetObjIdentifier(); + SdrObjKind nSdrObjKind = pObj->GetObjIdentifier(); - if (nInv == SdrInventor::Default && nSdrObjKind == OBJ_OLE2) + if (nInv == SdrInventor::Default && nSdrObjKind == SdrObjKind::OLE2) { // activate OLE-object SfxInt16Item aItem(SID_OBJECT, 0); @@ -649,7 +649,7 @@ void FuDraw::DoubleClick(const MouseEvent& rMEvt) SfxCallMode::ASYNCHRON | SfxCallMode::RECORD, { &aItem }); } - else if (nInv == SdrInventor::Default && nSdrObjKind == OBJ_GRAF && pObj->IsEmptyPresObj() ) + else if (nInv == SdrInventor::Default && nSdrObjKind == SdrObjKind::Graphic && pObj->IsEmptyPresObj() ) { mpViewShell->GetViewFrame()-> GetDispatcher()->Execute( SID_INSERT_GRAPHIC, @@ -666,7 +666,7 @@ void FuDraw::DoubleClick(const MouseEvent& rMEvt) SfxCallMode::ASYNCHRON | SfxCallMode::RECORD, { &aItem }); } - else if (nInv == SdrInventor::Default && nSdrObjKind == OBJ_GRUP) + else if (nInv == SdrInventor::Default && nSdrObjKind == SdrObjKind::Group) { // hit group -> select subobject mpView->UnMarkAll(); diff --git a/sd/source/ui/func/fuformatpaintbrush.cxx b/sd/source/ui/func/fuformatpaintbrush.cxx index c7a3ca604a6c..40bde764ffaa 100644 --- a/sd/source/ui/func/fuformatpaintbrush.cxx +++ b/sd/source/ui/func/fuformatpaintbrush.cxx @@ -219,7 +219,7 @@ void FuFormatPaintBrush::Deactivate() } } -bool FuFormatPaintBrush::HasContentForThisType( SdrInventor nObjectInventor, sal_uInt16 nObjectIdentifier ) const +bool FuFormatPaintBrush::HasContentForThisType( SdrInventor nObjectInventor, SdrObjKind nObjectIdentifier ) const { if (mxItemSet == nullptr) return false; diff --git a/sd/source/ui/func/fuinsert.cxx b/sd/source/ui/func/fuinsert.cxx index 61f61b70b3cc..dd9e3a7202da 100644 --- a/sd/source/ui/func/fuinsert.cxx +++ b/sd/source/ui/func/fuinsert.cxx @@ -535,7 +535,7 @@ void FuInsertOLE::DoExecute( SfxRequest& rReq ) SdrObject* pObj = pMark->GetMarkedSdrObj(); if (pObj->GetObjInventor() == SdrInventor::Default && - pObj->GetObjIdentifier() == OBJ_OLE2) + pObj->GetObjIdentifier() == SdrObjKind::OLE2) { if ( !static_cast<SdrOle2Obj*>(pObj)->GetObjRef().is() ) { diff --git a/sd/source/ui/func/fuinsfil.cxx b/sd/source/ui/func/fuinsfil.cxx index d776e07f1246..6569514cfb73 100644 --- a/sd/source/ui/func/fuinsfil.cxx +++ b/sd/source/ui/func/fuinsfil.cxx @@ -466,7 +466,7 @@ void FuInsertFile::InsTextOrRTFinDrMode(SfxMedium* pMedium) SdrObject* pObj = mpView->GetTextEditObject(); if( pObj && pObj->GetObjInventor() == SdrInventor::Default && - pObj->GetObjIdentifier() == OBJ_TITLETEXT && + pObj->GetObjIdentifier() == SdrObjKind::TitleText && aOutliner.GetParagraphCount() > 1 ) { // in title objects, only one paragraph is allowed @@ -490,7 +490,7 @@ void FuInsertFile::InsTextOrRTFinDrMode(SfxMedium* pMedium) { SdrRectObj* pTO = new SdrRectObj( mpView->getSdrModelFromSdrView(), - OBJ_TEXT); + SdrObjKind::Text); pTO->SetOutlinerParaObject(std::move(pOPO)); const bool bUndo = mpView->IsUndoEnabled(); diff --git a/sd/source/ui/func/fulinend.cxx b/sd/source/ui/func/fulinend.cxx index 20280ec205f2..34fe631616cb 100644 --- a/sd/source/ui/func/fulinend.cxx +++ b/sd/source/ui/func/fulinend.cxx @@ -71,7 +71,7 @@ void FuLineEnd::DoExecute( SfxRequest& ) if( aInfoRec.bCanConvToPath && pObj->GetObjInventor() == SdrInventor::Default && - pObj->GetObjIdentifier() != OBJ_GRUP ) + pObj->GetObjIdentifier() != SdrObjKind::Group ) // bCanConvToPath is sal_True for group objects, // but it crashes on ConvertToPathObj()! { diff --git a/sd/source/ui/func/fumorph.cxx b/sd/source/ui/func/fumorph.cxx index 0409f530384c..a0a354392425 100644 --- a/sd/source/ui/func/fumorph.cxx +++ b/sd/source/ui/func/fumorph.cxx @@ -392,7 +392,7 @@ void FuMorph::ImpInsertPolygons( const ::basegfx::B2DPolyPolygon& rPolyPoly3D = rPolyPolyList3D[ i ]; SdrPathObj* pNewObj = new SdrPathObj( mpView->getSdrModelFromSdrView(), - OBJ_POLY, + SdrObjKind::Polygon, rPolyPoly3D); // line color diff --git a/sd/source/ui/func/fuoaprms.cxx b/sd/source/ui/func/fuoaprms.cxx index 2995f83712bf..0feaabfb4736 100644 --- a/sd/source/ui/func/fuoaprms.cxx +++ b/sd/source/ui/func/fuoaprms.cxx @@ -293,18 +293,18 @@ void FuObjectAnimationParameters::DoExecute( SfxRequest& rReq ) pInfo = nullptr; if (pObject1->GetObjInventor() == SdrInventor::Default && - ((eKind1 == OBJ_LINE) || // 2 point line - (eKind1 == OBJ_PLIN) || // Polygon - (eKind1 == OBJ_PATHLINE)) && // Bezier curve + ((eKind1 == SdrObjKind::Line) || // 2 point line + (eKind1 == SdrObjKind::PolyLine) || // Polygon + (eKind1 == SdrObjKind::PathLine)) && // Bezier curve (pInfo2 && pInfo2->meEffect == presentation::AnimationEffect_PATH)) { pInfo = pInfo2; } if (pObject2->GetObjInventor() == SdrInventor::Default && - ((eKind2 == OBJ_LINE) || // 2 point line - (eKind2 == OBJ_PLIN) || // Polygon - (eKind2 == OBJ_PATHLINE)) && // Bezier curve + ((eKind2 == SdrObjKind::Line) || // 2 point line + (eKind2 == SdrObjKind::PolyLine) || // Polygon + (eKind2 == SdrObjKind::PathLine)) && // Bezier curve (pInfo1 && pInfo1->meEffect == presentation::AnimationEffect_PATH)) { pInfo = pInfo1; @@ -633,18 +633,18 @@ void FuObjectAnimationParameters::DoExecute( SfxRequest& rReq ) SdrObject* pRunningObj = nullptr; if (pObject1->GetObjInventor() == SdrInventor::Default && - ((eKind1 == OBJ_LINE) || // 2 point line - (eKind1 == OBJ_PLIN) || // Polygon - (eKind1 == OBJ_PATHLINE))) // Bezier curve + ((eKind1 == SdrObjKind::Line) || // 2 point line + (eKind1 == SdrObjKind::PolyLine) || // Polygon + (eKind1 == SdrObjKind::PathLine))) // Bezier curve { pPath = static_cast<SdrPathObj*>(pObject1); pRunningObj = pObject2; } if (pObject2->GetObjInventor() == SdrInventor::Default && - ((eKind2 == OBJ_LINE) || // 2 point line - (eKind2 == OBJ_PLIN) || // Polygon - (eKind2 == OBJ_PATHLINE))) // Bezier curve + ((eKind2 == SdrObjKind::Line) || // 2 point line + (eKind2 == SdrObjKind::PolyLine) || // Polygon + (eKind2 == SdrObjKind::PathLine))) // Bezier curve { pPath = static_cast<SdrPathObj*>(pObject2); pRunningObj = pObject1; diff --git a/sd/source/ui/func/fuolbull.cxx b/sd/source/ui/func/fuolbull.cxx index 0116b4b0e80f..403c484464bb 100644 --- a/sd/source/ui/func/fuolbull.cxx +++ b/sd/source/ui/func/fuolbull.cxx @@ -143,7 +143,7 @@ void FuBulletAndPosition::SetCurrentBulletsNumbering(SfxRequest& rReq) if ( bInMasterView ) { SdrObject* pObj = mpView->GetTextEditObject(); - if( pObj && pObj->GetObjIdentifier() == OBJ_OUTLINETEXT ) + if( pObj && pObj->GetObjIdentifier() == SdrObjKind::OutlineText ) { const sal_uInt16 nLevel = mpView->GetSelectionLevel(); if( nLevel != 0xFFFF ) @@ -296,10 +296,10 @@ const SfxPoolItem* FuBulletAndPosition::GetNumBulletItem(SfxItemSet& aNewAttr, s { switch(pObj->GetObjIdentifier()) { - case OBJ_TITLETEXT: + case SdrObjKind::TitleText: bTitle = true; break; - case OBJ_OUTLINETEXT: + case SdrObjKind::OutlineText: bOutliner = true; break; default: diff --git a/sd/source/ui/func/fupoor.cxx b/sd/source/ui/func/fupoor.cxx index 067b281950eb..e901d07a6318 100644 --- a/sd/source/ui/func/fupoor.cxx +++ b/sd/source/ui/func/fupoor.cxx @@ -200,10 +200,10 @@ bool FuPoor::KeyInput(const KeyEvent& rKEvt) if(auto pTextObj = dynamic_cast<SdrTextObj *>( pObj )) { SdrInventor nInv(pObj->GetObjInventor()); - sal_uInt16 nKnd(pObj->GetObjIdentifier()); + SdrObjKind nKnd(pObj->GetObjIdentifier()); if(SdrInventor::Default == nInv && - (OBJ_TITLETEXT == nKnd || OBJ_OUTLINETEXT == nKnd || OBJ_TEXT == nKnd)) + (SdrObjKind::TitleText == nKnd || SdrObjKind::OutlineText == nKnd || SdrObjKind::Text == nKnd)) { pCandidate = pTextObj; } @@ -827,9 +827,9 @@ bool FuPoor::KeyInput(const KeyEvent& rKEvt) if(auto pTextObj = dynamic_cast< SdrTextObj *>( pObj )) { SdrInventor nInv(pObj->GetObjInventor()); - sal_uInt16 nKnd(pObj->GetObjIdentifier()); + SdrObjKind nKnd(pObj->GetObjIdentifier()); - if(SdrInventor::Default == nInv && OBJ_TITLETEXT == nKnd) + if(SdrInventor::Default == nInv && SdrObjKind::TitleText == nKnd) { pCandidate = pTextObj; } @@ -1089,10 +1089,10 @@ bool FuPoor::doConstructOrthogonal() const const SdrMarkList& rMarkList = mpView->GetMarkedObjectList(); if (rMarkList.GetMarkCount() == 1) { - sal_uInt16 aObjIdentifier = rMarkList.GetMark(0)->GetMarkedSdrObj()->GetObjIdentifier(); - bResizeKeepRatio = aObjIdentifier == OBJ_GRAF || - aObjIdentifier == OBJ_MEDIA || - aObjIdentifier == OBJ_OLE2; + SdrObjKind aObjIdentifier = rMarkList.GetMark(0)->GetMarkedSdrObj()->GetObjIdentifier(); + bResizeKeepRatio = aObjIdentifier == SdrObjKind::Graphic || + aObjIdentifier == SdrObjKind::Media || + aObjIdentifier == SdrObjKind::OLE2; } } SdrHdl* pHdl = mpView->PickHandle(aMDPos); diff --git a/sd/source/ui/func/fusel.cxx b/sd/source/ui/func/fusel.cxx index 57d3bab073b6..5b5e37ab5779 100644 --- a/sd/source/ui/func/fusel.cxx +++ b/sd/source/ui/func/fusel.cxx @@ -247,12 +247,12 @@ bool FuSelection::MouseButtonDown(const MouseEvent& rMEvt) } else if ( bTextEdit ) { - sal_uInt16 nSdrObjKind = aVEvt.mpObj->GetObjIdentifier(); + SdrObjKind nSdrObjKind = aVEvt.mpObj->GetObjIdentifier(); if (aVEvt.mpObj->GetObjInventor() == SdrInventor::Default && - (nSdrObjKind == OBJ_TEXT || - nSdrObjKind == OBJ_TITLETEXT || - nSdrObjKind == OBJ_OUTLINETEXT || + (nSdrObjKind == SdrObjKind::Text || + nSdrObjKind == SdrObjKind::TitleText || + nSdrObjKind == SdrObjKind::OutlineText || !aVEvt.mpObj->IsEmptyPresObj())) { // Seamless Editing: branch to text input @@ -841,7 +841,7 @@ bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt) !mpView->IsShearAllowed() && !mpView->IsDistortAllowed() ) || ( nSlotId==SID_CONVERT_TO_3D_LATHE && pSingleObj && (pSingleObj->GetObjInventor() != SdrInventor::Default || - pSingleObj->GetObjIdentifier() == OBJ_MEASURE) ) ) + pSingleObj->GetObjIdentifier() == SdrObjKind::Measure) ) ) { bReturn = true; ForcePointer(&rMEvt); diff --git a/sd/source/ui/func/futext.cxx b/sd/source/ui/func/futext.cxx index cd60a1040bc6..725bf96e1fce 100644 --- a/sd/source/ui/func/futext.cxx +++ b/sd/source/ui/func/futext.cxx @@ -183,7 +183,7 @@ void FuText::DoExecute( SfxRequest& ) ToolBarManager::ToolBarGroup::Function, ToolbarId::Draw_Text_Toolbox_Sd); - mpView->SetCurrentObj(OBJ_TEXT); + mpView->SetCurrentObj(SdrObjKind::Text); mpView->SetEditMode(SdrViewEditMode::Edit); MouseEvent aMEvt(mpWindow->GetPointerPosPixel()); @@ -217,7 +217,7 @@ void FuText::DoExecute( SfxRequest& ) if (rMarkList.GetMarkCount() == 1) { SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj(); - if( pObj && (pObj->GetObjInventor() == SdrInventor::Default ) && (pObj->GetObjIdentifier() == OBJ_TABLE) ) + if( pObj && (pObj->GetObjInventor() == SdrInventor::Default ) && (pObj->GetObjIdentifier() == SdrObjKind::Table) ) { mpViewShell->GetViewShellBase().GetToolBarManager()->AddToolBarShell(ToolBarManager::ToolBarGroup::Function, ToolbarId::Draw_Table_Toolbox); } @@ -301,7 +301,7 @@ bool FuText::MouseButtonDown(const MouseEvent& rMEvt) eHit = mpView->PickAnything(rMEvt, SdrMouseEventKind::BUTTONDOWN, aVEvt); } - mpView->SetCurrentObj(OBJ_TEXT); + mpView->SetCurrentObj(SdrObjKind::Text); mpView->SetEditMode(SdrViewEditMode::Edit); } @@ -447,7 +447,7 @@ bool FuText::MouseButtonDown(const MouseEvent& rMEvt) (bPermanent || !bFirstObjCreated) ) { // create object - mpView->SetCurrentObj(OBJ_TEXT); + mpView->SetCurrentObj(SdrObjKind::Text); mpView->SetEditMode(SdrViewEditMode::Create); sal_uInt16 nDrgLog = sal_uInt16 ( mpWindow->PixelToLogic(Size(DRGPIX,0)).Width() ); mpView->BegCreateObj(aMDPos, nullptr, nDrgLog); @@ -669,7 +669,7 @@ bool FuText::MouseButtonUp(const MouseEvent& rMEvt) mpView->SetDragWithCopy(bDragWithCopy); mpView->EndDragObj( mpView->IsDragWithCopy() ); mpView->ForceMarkedToAnotherPage(); - mpView->SetCurrentObj(OBJ_TEXT); + mpView->SetCurrentObj(SdrObjKind::Text); sal_uInt16 nDrgLog = sal_uInt16 ( mpWindow->PixelToLogic(Size(DRGPIX,0)).Width() ); @@ -789,7 +789,7 @@ bool FuText::MouseButtonUp(const MouseEvent& rMEvt) nSlotId != SID_TEXTEDIT ) { // text body (left-justified AutoGrow) - mpView->SetCurrentObj(OBJ_TEXT); + mpView->SetCurrentObj(SdrObjKind::Text); mpView->SetEditMode(SdrViewEditMode::Create); sal_uInt16 nDrgLog = sal_uInt16 ( mpWindow->PixelToLogic(Size(DRGPIX,0)).Width() ); mpView->BegCreateObj(aMDPos, nullptr, nDrgLog); @@ -949,7 +949,7 @@ bool FuText::KeyInput(const KeyEvent& rKEvt) } } - if ( mxTextObj.is() && mxTextObj->GetObjInventor() == SdrInventor::Default && mxTextObj->GetObjIdentifier() == OBJ_TITLETEXT && rKEvt.GetKeyCode().GetCode() == KEY_RETURN ) + if ( mxTextObj.is() && mxTextObj->GetObjInventor() == SdrInventor::Default && mxTextObj->GetObjIdentifier() == SdrObjKind::TitleText && rKEvt.GetKeyCode().GetCode() == KEY_RETURN ) { // title text object: always soft breaks bShift = true; @@ -984,7 +984,7 @@ bool FuText::KeyInput(const KeyEvent& rKEvt) if( bPermanent ) { - mpView->SetCurrentObj(OBJ_TEXT); + mpView->SetCurrentObj(SdrObjKind::Text); mpView->SetEditMode(SdrViewEditMode::Create); } @@ -1035,7 +1035,7 @@ void FuText::SetInEditMode(const MouseEvent& rMEvt, bool bQuickDrag) SdrPageView* pPV = mpView->GetSdrPageView(); if( mxTextObj.is() && (mxTextObj->getSdrPageFromSdrObject() == pPV->GetPage()) ) { - mpView->SetCurrentObj(OBJ_TEXT); + mpView->SetCurrentObj(SdrObjKind::Text); if( bPermanent ) mpView->SetEditMode(SdrViewEditMode::Create); @@ -1063,12 +1063,12 @@ void FuText::SetInEditMode(const MouseEvent& rMEvt, bool bQuickDrag) if (GetTextObj() != mpView->GetTextEditObject() || bEmptyOutliner) { SdrInventor nInv = mxTextObj->GetObjInventor(); - sal_uInt16 nSdrObjKind = mxTextObj->GetObjIdentifier(); + SdrObjKind nSdrObjKind = mxTextObj->GetObjIdentifier(); if (nInv == SdrInventor::Default && GetTextObj()->HasTextEdit() && - (nSdrObjKind == OBJ_TEXT || - nSdrObjKind == OBJ_TITLETEXT || - nSdrObjKind == OBJ_OUTLINETEXT || !mxTextObj->IsEmptyPresObj() ) ) + (nSdrObjKind == SdrObjKind::Text || + nSdrObjKind == SdrObjKind::TitleText || + nSdrObjKind == SdrObjKind::OutlineText || !mxTextObj->IsEmptyPresObj() ) ) { // create new outliner (owned by SdrObjEditView) std::unique_ptr<SdrOutliner> pOutl = SdrMakeOutliner(OutlinerMode::OutlineObject, *mpDoc); @@ -1123,10 +1123,10 @@ void FuText::SetInEditMode(const MouseEvent& rMEvt, bool bQuickDrag) if (eHit == SdrHitKind::TextEdit) { // hit text - if (nSdrObjKind == OBJ_TEXT || - nSdrObjKind == OBJ_TITLETEXT || - nSdrObjKind == OBJ_OUTLINETEXT || - nSdrObjKind == OBJ_TABLE || + if (nSdrObjKind == SdrObjKind::Text || + nSdrObjKind == SdrObjKind::TitleText || + nSdrObjKind == SdrObjKind::OutlineText || + nSdrObjKind == SdrObjKind::Table || nSlotId == SID_TEXTEDIT || !bQuickDrag) { @@ -1380,7 +1380,7 @@ bool FuText::cancel() if(mpView->SdrEndTextEdit() == SdrEndTextEditKind::Deleted) mxTextObj.reset(nullptr); - mpView->SetCurrentObj(OBJ_TEXT); + mpView->SetCurrentObj(SdrObjKind::Text); mpView->SetEditMode(SdrViewEditMode::Edit); return true; } diff --git a/sd/source/ui/func/futransf.cxx b/sd/source/ui/func/futransf.cxx index 80441e57dea4..8c565a3b84e8 100644 --- a/sd/source/ui/func/futransf.cxx +++ b/sd/source/ui/func/futransf.cxx @@ -86,7 +86,7 @@ void FuTransform::DoExecute( SfxRequest& rReq ) SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj(); if( rMarkList.GetMarkCount() == 1 && pObj->GetObjInventor() == SdrInventor::Default && - pObj->GetObjIdentifier() == OBJ_CAPTION ) + pObj->GetObjIdentifier() == SdrObjKind::Caption ) { // --------- itemset for caption -------- SfxItemSet aNewAttr( mpDoc->GetPool() ); diff --git a/sd/source/ui/inc/fuformatpaintbrush.hxx b/sd/source/ui/inc/fuformatpaintbrush.hxx index 74f66d98eced..0de28d4a8ba5 100644 --- a/sd/source/ui/inc/fuformatpaintbrush.hxx +++ b/sd/source/ui/inc/fuformatpaintbrush.hxx @@ -46,7 +46,7 @@ private: void DoExecute( SfxRequest& rReq ) override; - bool HasContentForThisType( SdrInventor nObjectInventor, sal_uInt16 nObjectIdentifier ) const; + bool HasContentForThisType( SdrInventor nObjectInventor, SdrObjKind nObjectIdentifier ) const; void Paste( bool, bool ); void implcancel(); diff --git a/sd/source/ui/tools/PreviewRenderer.cxx b/sd/source/ui/tools/PreviewRenderer.cxx index 2d74c7679476..be8d8ca207a1 100644 --- a/sd/source/ui/tools/PreviewRenderer.cxx +++ b/sd/source/ui/tools/PreviewRenderer.cxx @@ -511,7 +511,7 @@ void ViewRedirector::createRedirectedPrimitive2DSequence( const bool bDoCreateGeometry (pObject->getSdrPageFromSdrObject()->checkVisibility( rOriginal, rDisplayInfo, true)); if ( ! bDoCreateGeometry - && (pObject->GetObjInventor() != SdrInventor::Default || pObject->GetObjIdentifier() != OBJ_PAGE)) + && (pObject->GetObjInventor() != SdrInventor::Default || pObject->GetObjIdentifier() != SdrObjKind::Page)) { return; } diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx index 6004ba2be8f2..71137c4943d4 100644 --- a/sd/source/ui/unoidl/unomodel.cxx +++ b/sd/source/ui/unoidl/unomodel.cxx @@ -955,75 +955,75 @@ css::uno::Reference<css::uno::XInterface> SdXImpressDocument::create( const OUString aType( aServiceSpecifier.copy(26) ); rtl::Reference<SvxShape> pShape; - sal_uInt16 nType = OBJ_TEXT; + SdrObjKind nType = SdrObjKind::Text; // create a shape wrapper if( aType.startsWith( "TitleTextShape" ) ) { - nType = OBJ_TEXT; + nType = SdrObjKind::Text; } else if( aType.startsWith( "OutlinerShape" ) ) { - nType = OBJ_TEXT; + nType = SdrObjKind::Text; } else if( aType.startsWith( "SubtitleShape" ) ) { - nType = OBJ_TEXT; + nType = SdrObjKind::Text; } else if( aType.startsWith( "GraphicObjectShape" ) ) { - nType = OBJ_GRAF; + nType = SdrObjKind::Graphic; } else if( aType.startsWith( "PageShape" ) ) { - nType = OBJ_PAGE; + nType = SdrObjKind::Page; } else if( aType.startsWith( "OLE2Shape" ) ) { - nType = OBJ_OLE2; + nType = SdrObjKind::OLE2; } else if( aType.startsWith( "ChartShape" ) ) { - nType = OBJ_OLE2; + nType = SdrObjKind::OLE2; } else if( aType.startsWith( "CalcShape" ) ) { - nType = OBJ_OLE2; + nType = SdrObjKind::OLE2; } else if( aType.startsWith( "TableShape" ) ) { - nType = OBJ_TABLE; + nType = SdrObjKind::Table; } else if( aType.startsWith( "OrgChartShape" ) ) { - nType = OBJ_OLE2; + nType = SdrObjKind::OLE2; } else if( aType.startsWith( "NotesShape" ) ) { - nType = OBJ_TEXT; + nType = SdrObjKind::Text; } else if( aType.startsWith( "HandoutShape" ) ) { - nType = OBJ_PAGE; + nType = SdrObjKind::Page; } else if( aType.startsWith( "FooterShape" ) ) { - nType = OBJ_TEXT; + nType = SdrObjKind::Text; } else if( aType.startsWith( "HeaderShape" ) ) { - nType = OBJ_TEXT; + nType = SdrObjKind::Text; } else if( aType.startsWith( "SlideNumberShape" ) ) { - nType = OBJ_TEXT; + nType = SdrObjKind::Text; } else if( aType.startsWith( "DateTimeShape" ) ) { - nType = OBJ_TEXT; + nType = SdrObjKind::Text; } else if( aType.startsWith( "MediaShape" ) ) { - nType = OBJ_MEDIA; + nType = SdrObjKind::Media; } else { @@ -1041,7 +1041,7 @@ css::uno::Reference<css::uno::XInterface> SdXImpressDocument::create( } else if ( aServiceSpecifier == "com.sun.star.drawing.TableShape" ) { - rtl::Reference<SvxShape> pShape = CreateSvxShapeByTypeAndInventor( OBJ_TABLE, SdrInventor::Default, referer ); + rtl::Reference<SvxShape> pShape = CreateSvxShapeByTypeAndInventor( SdrObjKind::Table, SdrInventor::Default, referer ); if( pShape && !mbClipBoard ) pShape->SetShapeType(aServiceSpecifier); @@ -1734,16 +1734,16 @@ vcl::PDFWriter::StructElement ImplRenderPaintProc::ImplBegStructureTag( const Sd if ( pPDFExtOutDevData && pPDFExtOutDevData->GetIsExportTaggedPDF() ) { SdrInventor nInventor = rObject.GetObjInventor(); - sal_uInt16 nIdentifier = rObject.GetObjIdentifier(); + SdrObjKind nIdentifier = rObject.GetObjIdentifier(); bool bIsTextObj = dynamic_cast< const SdrTextObj *>( &rObject ) != nullptr; if ( nInventor == SdrInventor::Default ) { - if ( nIdentifier == OBJ_GRUP ) + if ( nIdentifier == SdrObjKind::Group ) eElement = vcl::PDFWriter::Section; - else if ( nIdentifier == OBJ_TITLETEXT ) + else if ( nIdentifier == SdrObjKind::TitleText ) eElement = vcl::PDFWriter::Heading; - else if ( nIdentifier == OBJ_OUTLINETEXT ) + else if ( nIdentifier == SdrObjKind::OutlineText ) eElement = vcl::PDFWriter::Division; else if ( !bIsTextObj || !static_cast<const SdrTextObj&>(rObject).HasText() ) eElement = vcl::PDFWriter::Figure; @@ -1785,7 +1785,7 @@ void ImplRenderPaintProc::createRedirectedPrimitive2DSequence( // exactly this purpose (StructureTagPrimitive2D) const bool bBackground(pSdrPage->IsMasterPage()); - const bool bImage(pObject->GetObjIdentifier() == OBJ_GRAF); + const bool bImage(pObject->GetObjIdentifier() == SdrObjKind::Graphic); drawinglayer::primitive2d::Primitive2DReference xReference( new drawinglayer::primitive2d::StructureTagPrimitive2D( diff --git a/sd/source/ui/unoidl/unoobj.cxx b/sd/source/ui/unoidl/unoobj.cxx index d17345234e56..5f15d010ba1b 100644 --- a/sd/source/ui/unoidl/unoobj.cxx +++ b/sd/source/ui/unoidl/unoobj.cxx @@ -257,10 +257,10 @@ const SvEventDescription* ImplGetSupportedMacroItems() SdXShape::SdXShape(SvxShape* pShape, SdXImpressDocument* pModel) : mpShape( pShape ), mpPropSet( pModel? - lcl_ImplGetShapePropertySet(pModel->IsImpressDocument(), pShape->getShapeKind() == OBJ_GRAF ) + lcl_ImplGetShapePropertySet(pModel->IsImpressDocument(), pShape->getShapeKind() == SdrObjKind::Graphic ) : lcl_GetEmpty_SdXShapePropertySet_Impl() ), mpMap( pModel? - lcl_ImplGetShapePropertyMap(pModel->IsImpressDocument(), pShape->getShapeKind() == OBJ_GRAF ) + lcl_ImplGetShapePropertyMap(pModel->IsImpressDocument(), pShape->getShapeKind() == SdrObjKind::Graphic ) : lcl_GetEmpty_SdXShapePropertyMap_Impl() ), mpModel(pModel) { @@ -315,7 +315,7 @@ uno::Sequence< uno::Type > SAL_CALL SdXShape::getTypes() } else { - sal_uInt32 nObjId = mpShape->getShapeKind(); + SdrObjKind nObjId = mpShape->getShapeKind(); uno::Sequence< uno::Type > aTypes; SdTypesCache& gImplTypesCache = SD_MOD()->gImplTypesCache; SdTypesCache::iterator aIter( gImplTypesCache.find( nObjId ) ); @@ -812,15 +812,16 @@ uno::Sequence< OUString > SAL_CALL SdXShape::getSupportedServiceNames() SdrObject* pObj = mpShape->GetSdrObject(); if(pObj && pObj->GetObjInventor() == SdrInventor::Default ) { - sal_uInt32 nInventor = pObj->GetObjIdentifier(); + SdrObjKind nInventor = pObj->GetObjIdentifier(); switch( nInventor ) { - case OBJ_TITLETEXT: + case SdrObjKind::TitleText: aAdd.emplace_back(u"com.sun.star.presentation.TitleTextShape"); break; - case OBJ_OUTLINETEXT: + case SdrObjKind::OutlineText: aAdd.emplace_back(u"com.sun.star.presentation.OutlinerShape"); break; + default: ; } } return comphelper::concatSequences(mpShape->_getSupportedServiceNames(), aAdd); diff --git a/sd/source/ui/unoidl/unopage.cxx b/sd/source/ui/unoidl/unopage.cxx index 62c70998e18f..d5576855f923 100644 --- a/sd/source/ui/unoidl/unopage.cxx +++ b/sd/source/ui/unoidl/unopage.cxx @@ -1395,10 +1395,10 @@ Reference< drawing::XShape > SdGenericDrawPage::CreateShape(SdrObject *pObj) co if(pObj->GetObjInventor() == SdrInventor::Default) { - sal_uInt32 nInventor = pObj->GetObjIdentifier(); + SdrObjKind nInventor = pObj->GetObjIdentifier(); switch( nInventor ) { - case OBJ_TITLETEXT: + case SdrObjKind::TitleText: pShape = new SvxShapeText( pObj ); if( GetPage()->GetPageKind() == PageKind::Notes && GetPage()->IsMasterPage() ) { @@ -1411,11 +1411,12 @@ Reference< drawing::XShape > SdGenericDrawPage::CreateShape(SdrObject *pObj) co } eKind = PresObjKind::NONE; break; - case OBJ_OUTLINETEXT: + case SdrObjKind::OutlineText: pShape = new SvxShapeText( pObj ); pShape->SetShapeType("com.sun.star.presentation.OutlinerShape"); eKind = PresObjKind::NONE; break; + default: ; } } diff --git a/sd/source/ui/view/DocumentRenderer.cxx b/sd/source/ui/view/DocumentRenderer.cxx index 09f8d390368d..eee1a759e845 100644 --- a/sd/source/ui/view/DocumentRenderer.cxx +++ b/sd/source/ui/view/DocumentRenderer.cxx @@ -1546,7 +1546,7 @@ private: SdrPathObj* pPathObj = new SdrPathObj( rModel, - OBJ_PATHLINE, + SdrObjKind::PathLine, aPathPoly); pPathObj->SetMergedItem(XLineStyleItem(drawing::LineStyle_SOLID)); pPathObj->SetMergedItem(XLineColorItem(OUString(), COL_BLACK)); @@ -1643,7 +1643,7 @@ private: { SdrObject* pObj = pPage->GetObj(nObj++); if (pObj->GetObjInventor() == SdrInventor::Default - && pObj->GetObjIdentifier() == OBJ_TITLETEXT) + && pObj->GetObjIdentifier() == SdrObjKind::TitleText) { pTextObj = dynamic_cast<SdrTextObj*>(pObj); } @@ -1667,7 +1667,7 @@ private: { SdrObject* pObj = pPage->GetObj(nObj++); if (pObj->GetObjInventor() == SdrInventor::Default - && pObj->GetObjIdentifier() == OBJ_OUTLINETEXT) + && pObj->GetObjIdentifier() == SdrObjKind::OutlineText) { pTextObj = dynamic_cast<SdrTextObj*>(pObj); } diff --git a/sd/source/ui/view/drawview.cxx b/sd/source/ui/view/drawview.cxx index 5129a5216a91..dd711aeaef49 100644 --- a/sd/source/ui/view/drawview.cxx +++ b/sd/source/ui/view/drawview.cxx @@ -66,7 +66,7 @@ DrawView::DrawView( ,mpDrawViewShell(pShell) ,mnPOCHSmph(0) { - SetCurrentObj(OBJ_RECT); + SetCurrentObj(SdrObjKind::Rectangle); } DrawView::~DrawView() @@ -153,7 +153,7 @@ bool DrawView::SetAttributes(const SfxItemSet& rSet, if (nInv == SdrInventor::Default) { - sal_uInt16 eObjKind = pEditObject->GetObjIdentifier(); + SdrObjKind eObjKind = pEditObject->GetObjIdentifier(); PresObjKind ePresObjKind = rPage.GetPresObjKind(pEditObject); if ( ePresObjKind == PresObjKind::Title || @@ -175,7 +175,7 @@ bool DrawView::SetAttributes(const SfxItemSet& rSet, pSheet->Broadcast(SfxHint(SfxHintId::DataChanged)); bOk = true; } - else if (eObjKind == OBJ_OUTLINETEXT) + else if (eObjKind == SdrObjKind::OutlineText) { // Presentation object outline OutlinerView* pOV = GetTextEditOutlinerView(); @@ -298,9 +298,9 @@ void DrawView::SetMasterAttributes( SdrObject* pObject, const SdPage& rPage, Sfx if (nInv != SdrInventor::Default) return; - sal_uInt16 eObjKind = pObject->GetObjIdentifier(); + SdrObjKind eObjKind = pObject->GetObjIdentifier(); PresObjKind ePresObjKind = rPage.GetPresObjKind(pObject); - if (bSlide && eObjKind == OBJ_TEXT) + if (bSlide && eObjKind == SdrObjKind::Text) { // Presentation object (except outline) SfxStyleSheet* pSheet = rPage.GetTextStyleSheetForObject(pObject); @@ -339,7 +339,7 @@ void DrawView::SetMasterAttributes( SdrObject* pObject, const SdPage& rPage, Sfx pSheet->Broadcast(SfxHint(SfxHintId::DataChanged)); bOk = true; } - else if (eObjKind == OBJ_OUTLINETEXT) + else if (eObjKind == SdrObjKind::OutlineText) { // tdf#127900: do not forget to apply master style to placeholders if (!rSet.HasItem(EE_PARA_NUMBULLET) || bMaster) diff --git a/sd/source/ui/view/drviews1.cxx b/sd/source/ui/view/drviews1.cxx index 4c3e446963a5..092fdb1c3ebc 100644 --- a/sd/source/ui/view/drviews1.cxx +++ b/sd/source/ui/view/drviews1.cxx @@ -168,14 +168,14 @@ void DrawViewShell::SelectionHasChanged() SdrObject* pObj = pMark->GetMarkedSdrObj(); SdrInventor nInv = pObj->GetObjInventor(); - sal_uInt16 nSdrObjKind = pObj->GetObjIdentifier(); + SdrObjKind nSdrObjKind = pObj->GetObjIdentifier(); - if (nInv == SdrInventor::Default && nSdrObjKind == OBJ_OLE2) + if (nInv == SdrInventor::Default && nSdrObjKind == SdrObjKind::OLE2) { pOleObj = static_cast<SdrOle2Obj*>(pObj); UpdateIMapDlg( pObj ); } - else if (nSdrObjKind == OBJ_GRAF) + else if (nSdrObjKind == SdrObjKind::Graphic) UpdateIMapDlg( pObj ); } } @@ -730,9 +730,9 @@ ErrCode DrawViewShell::DoVerb(sal_Int32 nVerb) SdrObject* pObj = pMark->GetMarkedSdrObj(); SdrInventor nInv = pObj->GetObjInventor(); - sal_uInt16 nSdrObjKind = pObj->GetObjIdentifier(); + SdrObjKind nSdrObjKind = pObj->GetObjIdentifier(); - if (nInv == SdrInventor::Default && nSdrObjKind == OBJ_OLE2) + if (nInv == SdrInventor::Default && nSdrObjKind == SdrObjKind::OLE2) { ActivateObject( static_cast<SdrOle2Obj*>(pObj), nVerb); } diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx index 87d1a34e2ebe..449321eabf63 100644 --- a/sd/source/ui/view/drviews2.cxx +++ b/sd/source/ui/view/drviews2.cxx @@ -335,7 +335,7 @@ public: { SdrObject* pObject = pMasterPage->GetObj(nObject); SdrRectObj* pRectObject = dynamic_cast<SdrRectObj*>(pObject); - if (pRectObject && pRectObject->GetTextKind() == OBJ_TEXT) + if (pRectObject && pRectObject->GetTextKind() == SdrObjKind::Text) { OutlinerParaObject* pOutlinerParagraphObject = pRectObject->GetOutlinerParaObject(); if (pOutlinerParagraphObject) @@ -374,7 +374,7 @@ private: { SdrObject* pObject = pMasterPage->GetObj(nObject); SdrRectObj* pRectObject = dynamic_cast<SdrRectObj*>(pObject); - if (pRectObject && pRectObject->GetTextKind() == OBJ_TEXT) + if (pRectObject && pRectObject->GetTextKind() == SdrObjKind::Text) { OutlinerParaObject* pOutlinerParagraphObject = pRectObject->GetOutlinerParaObject(); if (pOutlinerParagraphObject) @@ -525,7 +525,7 @@ public: SdrRectObj* pObject = new SdrRectObj( *m_rDrawViewShell.GetDoc(), // TTTT should be reference - OBJ_TEXT); + SdrObjKind::Text); pObject->SetMergedItem(makeSdrTextAutoGrowWidthItem(true)); pObject->SetOutlinerParaObject(pOutliner->CreateParaObject()); pMasterPage->InsertObject(pObject); @@ -1280,13 +1280,13 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) SfxStyleSheet* pSheet = nullptr; SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj(); - if (pObj->GetObjIdentifier() == OBJ_TITLETEXT) + if (pObj->GetObjIdentifier() == SdrObjKind::TitleText) { pSheet = mpActualPage->GetStyleSheetForPresObj(PresObjKind::Title); if (pSheet) pObj->SetStyleSheet(pSheet, false); } - else if(pObj->GetObjIdentifier() == OBJ_OUTLINETEXT) + else if(pObj->GetObjIdentifier() == SdrObjKind::OutlineText) { for (sal_uInt16 nLevel = 1; nLevel < 10; nLevel++) { @@ -2506,7 +2506,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) SdrRectObj* pRectObj = new SdrRectObj( *GetDoc(), - OBJ_TEXT); + SdrObjKind::Text); pRectObj->SetMergedItem(makeSdrTextAutoGrowWidthItem(true)); pOutl->UpdateFields(); diff --git a/sd/source/ui/view/drviews3.cxx b/sd/source/ui/view/drviews3.cxx index 96cea2ab177d..bf0641a47aeb 100644 --- a/sd/source/ui/view/drviews3.cxx +++ b/sd/source/ui/view/drviews3.cxx @@ -984,7 +984,7 @@ void DrawViewShell::GetRulerState(SfxItemSet& rSet) aPointItem.SetValue( aPos ); ::tools::Rectangle aParaRect(maMarkRect); - if (pObj->GetObjIdentifier() == OBJ_TABLE) + if (pObj->GetObjIdentifier() == SdrObjKind::Table) { sdr::table::SdrTableObj* pTable = static_cast<sdr::table::SdrTableObj*>(pObj); sdr::table::CellPos cellpos; diff --git a/sd/source/ui/view/drviews4.cxx b/sd/source/ui/view/drviews4.cxx index 71915d6a1914..b07279844265 100644 --- a/sd/source/ui/view/drviews4.cxx +++ b/sd/source/ui/view/drviews4.cxx @@ -211,10 +211,10 @@ bool DrawViewShell::KeyInput (const KeyEvent& rKEvt, ::sd::Window* pWin) if(auto pSdrTextObj = dynamic_cast<SdrTextObj *>( pObj )) { SdrInventor nInv(pObj->GetObjInventor()); - sal_uInt16 nKnd(pObj->GetObjIdentifier()); + SdrObjKind nKnd(pObj->GetObjIdentifier()); if(SdrInventor::Default == nInv && - (OBJ_TITLETEXT == nKnd || OBJ_OUTLINETEXT == nKnd || OBJ_TEXT == nKnd) + (SdrObjKind::TitleText == nKnd || SdrObjKind::OutlineText == nKnd || SdrObjKind::Text == nKnd) && bDidVisitOldObject) { pCandidate = pSdrTextObj; @@ -680,7 +680,7 @@ void DrawViewShell::Command(const CommandEvent& rCEvt, ::sd::Window* pWin) } else { - if( (pObj->GetObjInventor() == SdrInventor::Default) && (pObj->GetObjIdentifier() == OBJ_TABLE) ) + if( (pObj->GetObjInventor() == SdrInventor::Default) && (pObj->GetObjIdentifier() == SdrObjKind::Table) ) { aPopupId = "table"; } @@ -694,71 +694,72 @@ void DrawViewShell::Command(const CommandEvent& rCEvt, ::sd::Window* pWin) else { SdrInventor nInv = pObj->GetObjInventor(); - sal_uInt16 nId = pObj->GetObjIdentifier(); + SdrObjKind nId = pObj->GetObjIdentifier(); if (nInv == SdrInventor::Default) { switch ( nId ) { - case OBJ_OUTLINETEXT: - case OBJ_CAPTION: - case OBJ_TITLETEXT: - case OBJ_TEXT: + case SdrObjKind::OutlineText: + case SdrObjKind::Caption: + case SdrObjKind::TitleText: + case SdrObjKind::Text: aPopupId = "textbox"; break; - case OBJ_PATHLINE: - case OBJ_PLIN: + case SdrObjKind::PathLine: + case SdrObjKind::PolyLine: aPopupId = "curve"; break; - case OBJ_FREELINE: - case OBJ_EDGE: + case SdrObjKind::FreehandLine: + case SdrObjKind::Edge: aPopupId = "connector"; break; - case OBJ_LINE: + case SdrObjKind::Line: aPopupId = "line"; break; - case OBJ_MEASURE: + case SdrObjKind::Measure: aPopupId = "measure"; break; - case OBJ_RECT: - case OBJ_CIRC: - case OBJ_FREEFILL: - case OBJ_PATHFILL: - case OBJ_POLY: - case OBJ_SECT: - case OBJ_CARC: - case OBJ_CCUT: - case OBJ_CUSTOMSHAPE: + case SdrObjKind::Rectangle: + case SdrObjKind::CircleOrEllipse: + case SdrObjKind::FreehandFill: + case SdrObjKind::PathFill: + case SdrObjKind::Polygon: + case SdrObjKind::CircleSection: + case SdrObjKind::CircleArc: + case SdrObjKind::CircleCut: + case SdrObjKind::CustomShape: aPopupId = "draw"; break; - case OBJ_GRUP: + case SdrObjKind::Group: aPopupId = "group"; break; - case OBJ_GRAF: + case SdrObjKind::Graphic: aPopupId = "graphic"; break; - case OBJ_OLE2: + case SdrObjKind::OLE2: aPopupId = "oleobject"; break; - case OBJ_MEDIA: + case SdrObjKind::Media: aPopupId = "media"; break; - case OBJ_TABLE: + case SdrObjKind::Table: aPopupId = "table"; break; + default: ; } } else if( nInv == SdrInventor::E3d ) { - if( nId == E3D_SCENE_ID ) + if( nId == SdrObjKind::E3D_Scene ) { if( !mpDrawView->IsGroupEntered() ) aPopupId = "3dscene"; diff --git a/sd/source/ui/view/drviews6.cxx b/sd/source/ui/view/drviews6.cxx index 7c34a560ccad..7d85151f78e1 100644 --- a/sd/source/ui/view/drviews6.cxx +++ b/sd/source/ui/view/drviews6.cxx @@ -175,11 +175,11 @@ void DrawViewShell::GetAnimationWinState( SfxItemSet& rSet ) { const SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj(); SdrInventor nInv = pObj->GetObjInventor(); - sal_uInt16 nId = pObj->GetObjIdentifier(); + SdrObjKind nId = pObj->GetObjIdentifier(); // 1 selected group object - if( nInv == SdrInventor::Default && nId == OBJ_GRUP ) + if( nInv == SdrInventor::Default && nId == SdrObjKind::Group ) nValue = 3; - else if( nInv == SdrInventor::Default && nId == OBJ_GRAF ) // Animated GIF ? + else if( nInv == SdrInventor::Default && nId == SdrObjKind::Graphic ) // Animated GIF ? { sal_uInt16 nCount = 0; diff --git a/sd/source/ui/view/drviews7.cxx b/sd/source/ui/view/drviews7.cxx index d98a214aa524..7ef14e54a83b 100644 --- a/sd/source/ui/view/drviews7.cxx +++ b/sd/source/ui/view/drviews7.cxx @@ -932,7 +932,7 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet ) SdrObject* pObj = rMarkList.GetMark(nNum)->GetMarkedSdrObj(); if( pObj->GetObjInventor() == SdrInventor::Default ) { - if( pObj->GetObjIdentifier() == OBJ_OUTLINETEXT ) + if( pObj->GetObjIdentifier() == SdrObjKind::OutlineText ) { bHasOutliner = true; if(bHasOther) @@ -1381,7 +1381,7 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet ) for (size_t i=0; i < nMarkCount && !bFoundAny; ++i) { SdrObject* pObj = aMarkList.GetMark(i)->GetMarkedSdrObj(); - sal_uInt16 nId = pObj->GetObjIdentifier(); + SdrObjKind nId = pObj->GetObjIdentifier(); SdrInventor nInv = pObj->GetObjInventor(); if(nInv == SdrInventor::Default) @@ -1389,22 +1389,22 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet ) // 2D objects switch( nId ) { - case OBJ_PATHLINE : - case OBJ_PLIN : - case OBJ_LINE: - case OBJ_FREELINE : - case OBJ_EDGE: - case OBJ_CARC : + case SdrObjKind::PathLine : + case SdrObjKind::PolyLine : + case SdrObjKind::Line: + case SdrObjKind::FreehandLine : + case SdrObjKind::Edge: + case SdrObjKind::CircleArc : bFoundObjNoArea = true; bFoundNoGraphicObj = true; break; - case OBJ_OLE2 : + case SdrObjKind::OLE2 : // #i118485# #i118525# Allow Line, Area and Graphic (Metafile, Bitmap) bSingleGraphicSelected = nMarkCount == 1; bFoundBitmap = true; bFoundMetafile = true; break; - case OBJ_GRAF : + case SdrObjKind::Graphic : { bSingleGraphicSelected = nMarkCount == 1; const SdrGrafObj* pSdrGrafObj = static_cast< const SdrGrafObj* >(pObj); @@ -1436,7 +1436,7 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet ) } break; } - case OBJ_TABLE: + case SdrObjKind::Table: bFoundTable = true; break; default : diff --git a/sd/source/ui/view/drviews9.cxx b/sd/source/ui/view/drviews9.cxx index 4ba735f153cd..064c6949fabf 100644 --- a/sd/source/ui/view/drviews9.cxx +++ b/sd/source/ui/view/drviews9.cxx @@ -139,7 +139,7 @@ void DrawViewShell::ExecGallery(SfxRequest const & rReq) SdrMark* pMark = rMarkList.GetMark(0); SdrObject* pObj = pMark->GetMarkedSdrObj(); - if (pObj->GetObjInventor() == SdrInventor::Default && pObj->GetObjIdentifier() == OBJ_GRAF) + if (pObj->GetObjInventor() == SdrInventor::Default && pObj->GetObjIdentifier() == SdrObjKind::Graphic) { pGrafObj = static_cast<SdrGrafObj*>(pObj); diff --git a/sd/source/ui/view/drviewse.cxx b/sd/source/ui/view/drviewse.cxx index 28f1145e84fc..e35a042cdf61 100644 --- a/sd/source/ui/view/drviewse.cxx +++ b/sd/source/ui/view/drviewse.cxx @@ -1495,7 +1495,7 @@ void DrawViewShell::InsertURLField(const OUString& rURL, const OUString& rText, SdrRectObj* pRectObj = new SdrRectObj( GetView()->getSdrModelFromSdrView(), - OBJ_TEXT); + SdrObjKind::Text); pOutl->UpdateFields(); pOutl->SetUpdateLayout( true ); @@ -1534,7 +1534,7 @@ void DrawViewShell::InsertURLButton(const OUString& rURL, const OUString& rText, if( pMarkedObj ) try { // change first marked object - if( SdrInventor::FmForm == pMarkedObj->GetObjInventor() && pMarkedObj->GetObjIdentifier() == OBJ_FM_BUTTON ) + if( SdrInventor::FmForm == pMarkedObj->GetObjInventor() && pMarkedObj->GetObjIdentifier() == SdrObjKind::FormButton ) { bNewObj = false; @@ -1581,7 +1581,7 @@ void DrawViewShell::InsertURLButton(const OUString& rURL, const OUString& rText, SdrObjFactory::MakeNewObject( GetView()->getSdrModelFromSdrView(), SdrInventor::FmForm, - OBJ_FM_BUTTON)); //, + SdrObjKind::FormButton)); //, //mpDrawView->GetSdrPageView()->GetPage())); Reference< awt::XControlModel > xControlModel( pUnoCtrl->GetUnoControlModel(), uno::UNO_SET_THROW ); diff --git a/sd/source/ui/view/drviewsf.cxx b/sd/source/ui/view/drviewsf.cxx index e21dd62caca6..4c1eae173391 100644 --- a/sd/source/ui/view/drviewsf.cxx +++ b/sd/source/ui/view/drviewsf.cxx @@ -689,7 +689,7 @@ void DrawViewShell::GetAttrState( SfxItemSet& rSet ) SdrTextObj* pTextObj = dynamic_cast< SdrTextObj* >(rMarkList.GetMark(nIndex)->GetMarkedSdrObj()); if (pTextObj && pTextObj->GetObjInventor() == SdrInventor::Default) { - if (pTextObj->GetObjIdentifier() != OBJ_OLE2) + if (pTextObj->GetObjIdentifier() != SdrObjKind::OLE2) { bEnable = true; break; diff --git a/sd/source/ui/view/drviewsj.cxx b/sd/source/ui/view/drviewsj.cxx index 6bbf88338f06..9f9a52012c3d 100644 --- a/sd/source/ui/view/drviewsj.cxx +++ b/sd/source/ui/view/drviewsj.cxx @@ -70,8 +70,6 @@ void DrawViewShell::GetMenuStateSel( SfxItemSet &rSet ) SfxItemState::DEFAULT == rSet.GetItemState( SID_CHANGEBEZIER ) || SfxItemState::DEFAULT == rSet.GetItemState( SID_CHANGEPOLYGON ) || SfxItemState::DEFAULT == rSet.GetItemState( SID_LINEEND_POLYGON ) || - SfxItemState::DEFAULT == rSet.GetItemState( OBJ_TITLETEXT ) || - SfxItemState::DEFAULT == rSet.GetItemState( OBJ_OUTLINETEXT ) || SfxItemState::DEFAULT == rSet.GetItemState( SID_MEASURE_DLG ) || SfxItemState::DEFAULT == rSet.GetItemState( SID_CONNECTION_DLG ) || SfxItemState::DEFAULT == rSet.GetItemState( SID_CONNECTION_NEW_ROUTING ) || @@ -103,7 +101,7 @@ void DrawViewShell::GetMenuStateSel( SfxItemSet &rSet ) const SdAnimationInfo* pAnimationInfo = SdDrawDocument::GetAnimationInfo(rMarkList.GetMark(0)->GetMarkedSdrObj()); SdrInventor nInv = pObj->GetObjInventor(); - sal_uInt16 nId = pObj->GetObjIdentifier(); + SdrObjKind nId = pObj->GetObjIdentifier(); SdrObjTransformInfoRec aInfoRec; pObj->TakeObjInfo( aInfoRec ); @@ -147,10 +145,10 @@ void DrawViewShell::GetMenuStateSel( SfxItemSet &rSet ) } if( nInv == SdrInventor::Default && - (nId == OBJ_LINE || - nId == OBJ_PLIN || - nId == OBJ_PATHLINE || - nId == OBJ_FREELINE )) + (nId == SdrObjKind::Line || + nId == SdrObjKind::PolyLine || + nId == SdrObjKind::PathLine || + nId == SdrObjKind::FreehandLine )) { //rSet.DisableItem( SID_ATTRIBUTES_AREA ); // remove again! rSet.DisableItem( SID_ATTR_FILL_STYLE ); @@ -162,25 +160,25 @@ void DrawViewShell::GetMenuStateSel( SfxItemSet &rSet ) rSet.DisableItem( SID_LINEEND_POLYGON ); } if(nInv == SdrInventor::Default && - (nId == OBJ_PATHFILL || nId == OBJ_PATHLINE || !aInfoRec.bCanConvToPath)) + (nId == SdrObjKind::PathFill || nId == SdrObjKind::PathLine || !aInfoRec.bCanConvToPath)) rSet.DisableItem( SID_CHANGEBEZIER ); if( nInv == SdrInventor::Default && - ( nId == OBJ_POLY || nId == OBJ_PLIN || !aInfoRec.bCanConvToPoly ) && + ( nId == SdrObjKind::Polygon || nId == SdrObjKind::PolyLine || !aInfoRec.bCanConvToPoly ) && !GetView()->IsVectorizeAllowed() ) { rSet.DisableItem( SID_CHANGEPOLYGON ); } - if(nInv == SdrInventor::Default && nId == OBJ_TABLE ) + if(nInv == SdrInventor::Default && nId == SdrObjKind::Table ) { rSet.DisableItem( SID_TEXTATTR_DLG ); } - if( nInv != SdrInventor::Default || nId != OBJ_MEASURE ) + if( nInv != SdrInventor::Default || nId != SdrObjKind::Measure ) rSet.DisableItem( SID_MEASURE_DLG ); - if( nInv != SdrInventor::Default || nId != OBJ_EDGE ) + if( nInv != SdrInventor::Default || nId != SdrObjKind::Edge ) rSet.DisableItem( SID_CONNECTION_DLG ); else { @@ -333,35 +331,36 @@ void DrawViewShell::GetMenuStateSel( SfxItemSet &rSet ) { SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj(); SdrInventor nInv = pObj->GetObjInventor(); - sal_uInt16 nId = pObj->GetObjIdentifier(); + SdrObjKind nId = pObj->GetObjIdentifier(); if (nInv == SdrInventor::Default) { switch (nId) { - case OBJ_TEXT: bText = true; break; + case SdrObjKind::Text: bText = true; break; - case OBJ_LINE: bLine = true; break; + case SdrObjKind::Line: bLine = true; break; - case OBJ_EDGE: bEdgeObj = true; break; + case SdrObjKind::Edge: bEdgeObj = true; break; - case OBJ_MEASURE: bMeasureObj = true; break; + case SdrObjKind::Measure: bMeasureObj = true; break; - case OBJ_RECT: - case OBJ_CIRC: - case OBJ_FREELINE: - case OBJ_FREEFILL: - case OBJ_PATHFILL: - case OBJ_PATHLINE: - case OBJ_SECT: - case OBJ_CARC: - case OBJ_CCUT: bDrawObj = true; break; + case SdrObjKind::Rectangle: + case SdrObjKind::CircleOrEllipse: + case SdrObjKind::FreehandLine: + case SdrObjKind::FreehandFill: + case SdrObjKind::PathFill: + case SdrObjKind::PathLine: + case SdrObjKind::CircleSection: + case SdrObjKind::CircleArc: + case SdrObjKind::CircleCut: bDrawObj = true; break; - case OBJ_GRUP: bGroup = true; break; + case SdrObjKind::Group: bGroup = true; break; - case OBJ_GRAF: break; + case SdrObjKind::Graphic: break; - case OBJ_TABLE: bTable = true; break; + case SdrObjKind::Table: bTable = true; break; + default: ; } } else if (nInv == SdrInventor::E3d) diff --git a/sd/source/ui/view/outlview.cxx b/sd/source/ui/view/outlview.cxx index 4a4bb45f1f1b..5e598de483dc 100644 --- a/sd/source/ui/view/outlview.cxx +++ b/sd/source/ui/view/outlview.cxx @@ -865,7 +865,7 @@ SdrTextObj* OutlineView::GetTitleTextObject(SdrPage const * pPage) { SdrObject* pObject = pPage->GetObj(nObject); if (pObject->GetObjInventor() == SdrInventor::Default && - pObject->GetObjIdentifier() == OBJ_TITLETEXT) + pObject->GetObjIdentifier() == SdrObjKind::TitleText) { pResult = static_cast<SdrTextObj*>(pObject); break; @@ -886,7 +886,7 @@ SdrTextObj* OutlineView::GetOutlineTextObject(SdrPage const * pPage) { SdrObject* pObject = pPage->GetObj(nObject); if (pObject->GetObjInventor() == SdrInventor::Default && - pObject->GetObjIdentifier() == OBJ_OUTLINETEXT) + pObject->GetObjIdentifier() == SdrObjKind::OutlineText) { pResult = static_cast<SdrTextObj*>(pObject); break; diff --git a/sd/source/ui/view/sdview.cxx b/sd/source/ui/view/sdview.cxx index a79673bc51ac..5b04fb8a2adc 100644 --- a/sd/source/ui/view/sdview.cxx +++ b/sd/source/ui/view/sdview.cxx @@ -191,7 +191,7 @@ void ViewRedirector::createRedirectedPrimitive2DSequence( const bool bDoCreateGeometry(pSdrPage->checkVisibility( rOriginal, rDisplayInfo, true )); if(!bDoCreateGeometry && - (( pObject->GetObjInventor() != SdrInventor::Default ) || ( pObject->GetObjIdentifier() != OBJ_PAGE )) ) + (( pObject->GetObjInventor() != SdrInventor::Default ) || ( pObject->GetObjIdentifier() != SdrObjKind::Page )) ) return; PresObjKind eKind(PresObjKind::NONE); @@ -217,7 +217,7 @@ void ViewRedirector::createRedirectedPrimitive2DSequence( bCreateOutline = true; } } - else if( ( pObject->GetObjInventor() == SdrInventor::Default ) && ( pObject->GetObjIdentifier() == OBJ_TEXT ) ) + else if( ( pObject->GetObjInventor() == SdrInventor::Default ) && ( pObject->GetObjIdentifier() == SdrObjKind::Text ) ) { if( pObjectsSdPage ) { @@ -233,7 +233,7 @@ void ViewRedirector::createRedirectedPrimitive2DSequence( } } } - else if( ( pObject->GetObjInventor() == SdrInventor::Default ) && ( pObject->GetObjIdentifier() == OBJ_PAGE ) ) + else if( ( pObject->GetObjInventor() == SdrInventor::Default ) && ( pObject->GetObjIdentifier() == SdrObjKind::Page ) ) { // only for handout page, else this frame will be created for each // page preview object in SlideSorter and PagePane @@ -682,7 +682,7 @@ bool View::SdrBeginTextEdit( { mpViewSh->GetViewShellBase().GetDrawController().FireSelectionChangeListener(); - if (pObj && pObj->GetObjIdentifier() == OBJ_TABLE) + if (pObj && pObj->GetObjIdentifier() == SdrObjKind::Table) mpViewSh->UpdateScrollBars(); if (comphelper::LibreOfficeKit::isActive()) @@ -704,7 +704,7 @@ bool View::SdrBeginTextEdit( { if (pObj) { - if( pObj->GetObjInventor() == SdrInventor::Default && pObj->GetObjIdentifier() == OBJ_TABLE ) + if( pObj->GetObjInventor() == SdrInventor::Default && pObj->GetObjIdentifier() == SdrObjKind::Table ) { Color aBackground = GetTextEditBackgroundColor(*this); pOL->SetBackgroundColor( aBackground ); @@ -840,7 +840,7 @@ void View::SetMarkedOriginalSize() if( pObj->GetObjInventor() == SdrInventor::Default ) { - if( pObj->GetObjIdentifier() == OBJ_OLE2 ) + if( pObj->GetObjIdentifier() == SdrObjKind::OLE2 ) { uno::Reference < embed::XEmbeddedObject > xObj = static_cast<SdrOle2Obj*>(pObj)->GetObjRef(); if( xObj.is() ) @@ -879,7 +879,7 @@ void View::SetMarkedOriginalSize() } } } - else if( pObj->GetObjIdentifier() == OBJ_GRAF ) + else if( pObj->GetObjIdentifier() == SdrObjKind::Graphic ) { const SdrGrafObj* pSdrGrafObj = static_cast< const SdrGrafObj* >(pObj); const Size aSize = pSdrGrafObj->getOriginalSize( ); @@ -947,23 +947,23 @@ bool View::IsMorphingAllowed() const { const SdrObject* pObj1 = rMarkList.GetMark( 0 )->GetMarkedSdrObj(); const SdrObject* pObj2 = rMarkList.GetMark( 1 )->GetMarkedSdrObj(); - const sal_uInt16 nKind1 = pObj1->GetObjIdentifier(); - const sal_uInt16 nKind2 = pObj2->GetObjIdentifier(); - - if ( ( nKind1 != OBJ_TEXT && nKind2 != OBJ_TEXT ) && - ( nKind1 != OBJ_TITLETEXT && nKind2 != OBJ_TITLETEXT ) && - ( nKind1 != OBJ_OUTLINETEXT && nKind2 != OBJ_OUTLINETEXT ) && - ( nKind1 != OBJ_GRUP && nKind2 != OBJ_GRUP ) && - ( nKind1 != OBJ_LINE && nKind2 != OBJ_LINE ) && - ( nKind1 != OBJ_PLIN && nKind2 != OBJ_PLIN ) && - ( nKind1 != OBJ_PATHLINE && nKind2 != OBJ_PATHLINE ) && - ( nKind1 != OBJ_FREELINE && nKind2 != OBJ_FREELINE ) && - ( nKind1 != OBJ_PATHPLIN && nKind2 != OBJ_PATHPLIN ) && - ( nKind1 != OBJ_MEASURE && nKind2 != OBJ_MEASURE ) && - ( nKind1 != OBJ_EDGE && nKind2 != OBJ_EDGE ) && - ( nKind1 != OBJ_GRAF && nKind2 != OBJ_GRAF ) && - ( nKind1 != OBJ_OLE2 && nKind2 != OBJ_OLE2 ) && - ( nKind1 != OBJ_CAPTION && nKind2 != OBJ_CAPTION ) && + const SdrObjKind nKind1 = pObj1->GetObjIdentifier(); + const SdrObjKind nKind2 = pObj2->GetObjIdentifier(); + + if ( ( nKind1 != SdrObjKind::Text && nKind2 != SdrObjKind::Text ) && + ( nKind1 != SdrObjKind::TitleText && nKind2 != SdrObjKind::TitleText ) && + ( nKind1 != SdrObjKind::OutlineText && nKind2 != SdrObjKind::OutlineText ) && + ( nKind1 != SdrObjKind::Group && nKind2 != SdrObjKind::Group ) && + ( nKind1 != SdrObjKind::Line && nKind2 != SdrObjKind::Line ) && + ( nKind1 != SdrObjKind::PolyLine && nKind2 != SdrObjKind::PolyLine ) && + ( nKind1 != SdrObjKind::PathLine && nKind2 != SdrObjKind::PathLine ) && + ( nKind1 != SdrObjKind::FreehandLine && nKind2 != SdrObjKind::FreehandLine ) && + ( nKind1 != SdrObjKind::PathPolyLine && nKind2 != SdrObjKind::PathPolyLine ) && + ( nKind1 != SdrObjKind::Measure && nKind2 != SdrObjKind::Measure ) && + ( nKind1 != SdrObjKind::Edge && nKind2 != SdrObjKind::Edge ) && + ( nKind1 != SdrObjKind::Graphic && nKind2 != SdrObjKind::Graphic ) && + ( nKind1 != SdrObjKind::OLE2 && nKind2 != SdrObjKind::OLE2 ) && + ( nKind1 != SdrObjKind::Caption && nKind2 != SdrObjKind::Caption ) && dynamic_cast< const E3dObject *>( pObj1 ) == nullptr && dynamic_cast< const E3dObject *>( pObj2 ) == nullptr ) { SfxItemSetFixed<XATTR_FILLSTYLE, XATTR_FILLSTYLE> aSet1( mrDoc.GetPool() ); diff --git a/sd/source/ui/view/viewoverlaymanager.cxx b/sd/source/ui/view/viewoverlaymanager.cxx index 1d4723c880af..184b8cbdc475 100644 --- a/sd/source/ui/view/viewoverlaymanager.cxx +++ b/sd/source/ui/view/viewoverlaymanager.cxx @@ -500,7 +500,7 @@ bool ViewOverlayManager::CreateTags() for( SdrObject* pShape : rShapes ) { - if( pShape->IsEmptyPresObj() && (pShape->GetObjIdentifier() == OBJ_OUTLINETEXT) && (mrBase.GetDrawView()->GetTextEditObject() != pShape) ) + if( pShape->IsEmptyPresObj() && (pShape->GetObjIdentifier() == SdrObjKind::OutlineText) && (mrBase.GetDrawView()->GetTextEditObject() != pShape) ) { rtl::Reference< SmartTag > xTag( new ChangePlaceholderTag( *mrBase.GetMainViewShell()->GetView(), *pShape ) ); maTagVector.push_back(xTag); diff --git a/sd/source/ui/view/viewshel.cxx b/sd/source/ui/view/viewshel.cxx index 5d8d2efefce6..ae99d6a72b1f 100644 --- a/sd/source/ui/view/viewshel.cxx +++ b/sd/source/ui/view/viewshel.cxx @@ -824,10 +824,10 @@ const SfxPoolItem* ViewShell::GetNumBulletItem(SfxItemSet& aNewAttr, sal_uInt16& { switch(pObj->GetObjIdentifier()) { - case OBJ_TITLETEXT: + case SdrObjKind::TitleText: bTitle = true; break; - case OBJ_OUTLINETEXT: + case SdrObjKind::OutlineText: bOutliner = true; break; default: |