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 /cui/source | |
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 'cui/source')
-rw-r--r-- | cui/source/tabpages/swpossizetabpage.cxx | 2 | ||||
-rw-r--r-- | cui/source/tabpages/tabline.cxx | 12 | ||||
-rw-r--r-- | cui/source/tabpages/textanim.cxx | 2 | ||||
-rw-r--r-- | cui/source/tabpages/textattr.cxx | 14 | ||||
-rw-r--r-- | cui/source/tabpages/transfrm.cxx | 2 |
5 files changed, 16 insertions, 16 deletions
diff --git a/cui/source/tabpages/swpossizetabpage.cxx b/cui/source/tabpages/swpossizetabpage.cxx index 8bd464a799ee..fe1d46a4d0c8 100644 --- a/cui/source/tabpages/swpossizetabpage.cxx +++ b/cui/source/tabpages/swpossizetabpage.cxx @@ -1866,7 +1866,7 @@ void SvxSwPosSizeTabPage::SetView( const SdrView* pSdrView ) const SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj(); SdrObjKind eKind = (SdrObjKind) pObj->GetObjIdentifier(); if( ( pObj->GetObjInventor() == SdrInventor::Default ) && - ( eKind==OBJ_TEXT || eKind==OBJ_TITLETEXT || eKind==OBJ_OUTLINETEXT) && + ( eKind==SdrObjKind::Text || eKind==SdrObjKind::TitleText || eKind==SdrObjKind::OutlineText) && pObj->HasText() ) { OSL_FAIL("AutoWidth/AutoHeight should be enabled"); diff --git a/cui/source/tabpages/tabline.cxx b/cui/source/tabpages/tabline.cxx index f4e0a1268013..1cf54885047d 100644 --- a/cui/source/tabpages/tabline.cxx +++ b/cui/source/tabpages/tabline.cxx @@ -50,12 +50,12 @@ SvxLineTabDialog::SvxLineTabDialog(weld::Window* pParent, const SfxItemSet* pAtt { switch( pObj->GetObjIdentifier() ) { - case OBJ_LINE: - case OBJ_PLIN: - case OBJ_PATHLINE: - case OBJ_FREELINE: - case OBJ_MEASURE: - case OBJ_EDGE: + case SdrObjKind::Line: + case SdrObjKind::PolyLine: + case SdrObjKind::PathLine: + case SdrObjKind::FreehandLine: + case SdrObjKind::Measure: + case SdrObjKind::Edge: bLineOnly = true; break; diff --git a/cui/source/tabpages/textanim.cxx b/cui/source/tabpages/textanim.cxx index 95d3463a1607..e086969bbbd1 100644 --- a/cui/source/tabpages/textanim.cxx +++ b/cui/source/tabpages/textanim.cxx @@ -58,7 +58,7 @@ void SvxTextTabDialog::PageCreated(const OString& rId, SfxTabPage &rPage) if (rId != "RID_SVXPAGE_TEXTATTR") return; - SdrObjKind eKind = OBJ_NONE; + SdrObjKind eKind = SdrObjKind::NONE; if (pView) { const SdrMarkList& rMarkList = pView->GetMarkedObjectList(); diff --git a/cui/source/tabpages/textattr.cxx b/cui/source/tabpages/textattr.cxx index a936e227622a..0f4a33bba4fa 100644 --- a/cui/source/tabpages/textattr.cxx +++ b/cui/source/tabpages/textattr.cxx @@ -49,7 +49,7 @@ const WhichRangesContainer SvxTextAttrPage::pRanges( SvxTextAttrPage::SvxTextAttrPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rInAttrs) : SvxTabPage(pPage, pController, "cui/ui/textattrtabpage.ui", "TextAttributesPage", rInAttrs) , rOutAttrs(rInAttrs) - , m_eObjKind(OBJ_NONE) + , m_eObjKind(SdrObjKind::NONE) , bAutoGrowSizeEnabled(false) , bContourEnabled(false) , bAutoGrowWidthEnabled(false) @@ -431,17 +431,17 @@ void SvxTextAttrPage::Construct() { switch (m_eObjKind) { - case OBJ_NONE: + case SdrObjKind::NONE: // indeterminate, show them all bFitToSizeEnabled = bContourEnabled = bWordWrapTextEnabled = bAutoGrowSizeEnabled = bAutoGrowWidthEnabled = bAutoGrowHeightEnabled = true; m_xCustomShapeText->show(); m_xDrawingText->show(); break; - case OBJ_TEXT: - case OBJ_TITLETEXT: - case OBJ_OUTLINETEXT: - case OBJ_CAPTION: + case SdrObjKind::Text: + case SdrObjKind::TitleText: + case SdrObjKind::OutlineText: + case SdrObjKind::Caption: // contour NOT possible for pure text objects bContourEnabled = bWordWrapTextEnabled = bAutoGrowSizeEnabled = false; @@ -450,7 +450,7 @@ void SvxTextAttrPage::Construct() m_xCustomShapeText->hide(); m_xDrawingText->show(); break; - case OBJ_CUSTOMSHAPE: + case SdrObjKind::CustomShape: bFitToSizeEnabled = bContourEnabled = bAutoGrowWidthEnabled = bAutoGrowHeightEnabled = false; bWordWrapTextEnabled = bAutoGrowSizeEnabled = true; m_xDrawingText->hide(); diff --git a/cui/source/tabpages/transfrm.cxx b/cui/source/tabpages/transfrm.cxx index 2aa7ec09539c..61b858dc15b3 100644 --- a/cui/source/tabpages/transfrm.cxx +++ b/cui/source/tabpages/transfrm.cxx @@ -846,7 +846,7 @@ void SvxPositionSizeTabPage::Construct() const SdrObjKind eKind(pObj->GetObjIdentifier()); if((pObj->GetObjInventor() == SdrInventor::Default) && - (OBJ_TEXT == eKind || OBJ_TITLETEXT == eKind || OBJ_OUTLINETEXT == eKind) && + (SdrObjKind::Text == eKind || SdrObjKind::TitleText == eKind || SdrObjKind::OutlineText == eKind) && pObj->HasText()) { mbAdjustDisabled = false; |