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 | |
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>
245 files changed, 1922 insertions, 1910 deletions
diff --git a/basctl/source/basicide/baside3.cxx b/basctl/source/basicide/baside3.cxx index 920e82da3d0a..91ac35a4bbc0 100644 --- a/basctl/source/basicide/baside3.cxx +++ b/basctl/source/basicide/baside3.cxx @@ -392,7 +392,7 @@ void DialogWindow::GetState( SfxItemSet& rSet ) void DialogWindow::ExecuteCommand( SfxRequest& rReq ) { const sal_uInt16 nSlotId(rReq.GetSlot()); - SdrObjKind nInsertObj(OBJ_NONE); + SdrObjKind nInsertObj(SdrObjKind::NONE); switch ( nSlotId ) { @@ -425,100 +425,100 @@ void DialogWindow::ExecuteCommand( SfxRequest& rReq ) break; case SID_INSERT_FORM_RADIO: - nInsertObj = OBJ_DLG_FORMRADIO; + nInsertObj = SdrObjKind::BasicDialogFormRadio; break; case SID_INSERT_FORM_CHECK: - nInsertObj = OBJ_DLG_FORMCHECK; + nInsertObj = SdrObjKind::BasicDialogFormCheck; break; case SID_INSERT_FORM_LIST: - nInsertObj = OBJ_DLG_FORMLIST; + nInsertObj = SdrObjKind::BasicDialogFormList; break; case SID_INSERT_FORM_COMBO: - nInsertObj = OBJ_DLG_FORMCOMBO; + nInsertObj = SdrObjKind::BasicDialogFormCombo; break; case SID_INSERT_FORM_SPIN: - nInsertObj = OBJ_DLG_FORMSPIN; + nInsertObj = SdrObjKind::BasicDialogFormSpin; break; case SID_INSERT_FORM_VSCROLL: - nInsertObj = OBJ_DLG_FORMVSCROLL; + nInsertObj = SdrObjKind::BasicDialogFormVerticalScroll; break; case SID_INSERT_FORM_HSCROLL: - nInsertObj = OBJ_DLG_FORMHSCROLL; + nInsertObj = SdrObjKind::BasicDialogFormHorizontalScroll; break; case SID_INSERT_PUSHBUTTON: - nInsertObj = OBJ_DLG_PUSHBUTTON; + nInsertObj = SdrObjKind::BasicDialogPushButton; break; case SID_INSERT_RADIOBUTTON: - nInsertObj = OBJ_DLG_RADIOBUTTON; + nInsertObj = SdrObjKind::BasicDialogRadioButton; break; case SID_INSERT_CHECKBOX: - nInsertObj = OBJ_DLG_CHECKBOX; + nInsertObj = SdrObjKind::BasicDialogCheckbox; break; case SID_INSERT_LISTBOX: - nInsertObj = OBJ_DLG_LISTBOX; + nInsertObj = SdrObjKind::BasicDialogListbox; break; case SID_INSERT_COMBOBOX: - nInsertObj = OBJ_DLG_COMBOBOX; + nInsertObj = SdrObjKind::BasicDialogCombobox; break; case SID_INSERT_GROUPBOX: - nInsertObj = OBJ_DLG_GROUPBOX; + nInsertObj = SdrObjKind::BasicDialogGroupBox; break; case SID_INSERT_EDIT: - nInsertObj = OBJ_DLG_EDIT; + nInsertObj = SdrObjKind::BasicDialogEdit; break; case SID_INSERT_FIXEDTEXT: - nInsertObj = OBJ_DLG_FIXEDTEXT; + nInsertObj = SdrObjKind::BasicDialogFixedText; break; case SID_INSERT_IMAGECONTROL: - nInsertObj = OBJ_DLG_IMAGECONTROL; + nInsertObj = SdrObjKind::BasicDialogImageControl; break; case SID_INSERT_PROGRESSBAR: - nInsertObj = OBJ_DLG_PROGRESSBAR; + nInsertObj = SdrObjKind::BasicDialogProgressbar; break; case SID_INSERT_HSCROLLBAR: - nInsertObj = OBJ_DLG_HSCROLLBAR; + nInsertObj = SdrObjKind::BasicDialogHorizontalScrollbar; break; case SID_INSERT_VSCROLLBAR: - nInsertObj = OBJ_DLG_VSCROLLBAR; + nInsertObj = SdrObjKind::BasicDialogVerticalScrollbar; break; case SID_INSERT_HFIXEDLINE: - nInsertObj = OBJ_DLG_HFIXEDLINE; + nInsertObj = SdrObjKind::BasicDialogHorizontalFixedLine; break; case SID_INSERT_VFIXEDLINE: - nInsertObj = OBJ_DLG_VFIXEDLINE; + nInsertObj = SdrObjKind::BasicDialogVerticalFixedLine; break; case SID_INSERT_DATEFIELD: - nInsertObj = OBJ_DLG_DATEFIELD; + nInsertObj = SdrObjKind::BasicDialogDateField; break; case SID_INSERT_TIMEFIELD: - nInsertObj = OBJ_DLG_TIMEFIELD; + nInsertObj = SdrObjKind::BasicDialogTimeField; break; case SID_INSERT_NUMERICFIELD: - nInsertObj = OBJ_DLG_NUMERICFIELD; + nInsertObj = SdrObjKind::BasicDialogNumericField; break; case SID_INSERT_CURRENCYFIELD: - nInsertObj = OBJ_DLG_CURRENCYFIELD; + nInsertObj = SdrObjKind::BasicDialogCurencyField; break; case SID_INSERT_FORMATTEDFIELD: - nInsertObj = OBJ_DLG_FORMATTEDFIELD; + nInsertObj = SdrObjKind::BasicDialogFormattedField; break; case SID_INSERT_PATTERNFIELD: - nInsertObj = OBJ_DLG_PATTERNFIELD; + nInsertObj = SdrObjKind::BasicDialogPatternField; break; case SID_INSERT_FILECONTROL: - nInsertObj = OBJ_DLG_FILECONTROL; + nInsertObj = SdrObjKind::BasicDialogFileControl; break; case SID_INSERT_SPINBUTTON: - nInsertObj = OBJ_DLG_SPINBUTTON; + nInsertObj = SdrObjKind::BasicDialogSpinButton; break; case SID_INSERT_GRIDCONTROL: - nInsertObj = OBJ_DLG_GRIDCONTROL; + nInsertObj = SdrObjKind::BasicDialogGridControl; break; case SID_INSERT_HYPERLINKCONTROL: - nInsertObj = OBJ_DLG_HYPERLINKCONTROL; + nInsertObj = SdrObjKind::BasicDialogHyperlinkControl; break; case SID_INSERT_TREECONTROL: - nInsertObj = OBJ_DLG_TREECONTROL; + nInsertObj = SdrObjKind::BasicDialogTreeControl; break; case SID_INSERT_SELECT: m_nControlSlotId = nSlotId; @@ -556,7 +556,7 @@ void DialogWindow::ExecuteCommand( SfxRequest& rReq ) break; } - if ( nInsertObj ) + if ( nInsertObj != SdrObjKind::NONE ) { m_nControlSlotId = nSlotId; GetEditor().SetMode( DlgEditor::INSERT ); diff --git a/basctl/source/dlged/dlged.cxx b/basctl/source/dlged/dlged.cxx index 13ff7a17ca36..69ffb81f3579 100644 --- a/basctl/source/dlged/dlged.cxx +++ b/basctl/source/dlged/dlged.cxx @@ -195,7 +195,7 @@ DlgEditor::DlgEditor ( ,pFunc(new DlgEdFuncSelect(*this)) ,rLayout(rLayout_) ,eMode( DlgEditor::SELECT ) - ,eActObj( OBJ_DLG_PUSHBUTTON ) + ,eActObj( SdrObjKind::BasicDialogPushButton ) ,bFirstDraw(false) ,bCreateOK(true) ,bDialogModelChanged(false) diff --git a/basctl/source/dlged/dlgedfac.cxx b/basctl/source/dlged/dlgedfac.cxx index 98c0f260b0f9..5c7d012344bb 100644 --- a/basctl/source/dlged/dlgedfac.cxx +++ b/basctl/source/dlged/dlgedfac.cxx @@ -60,40 +60,40 @@ IMPL_LINK( DlgEdFactory, MakeObject, SdrObjCreatorParams, aParams, SdrObject* ) SdrObject* pNewObj = nullptr; if( (aParams.nInventor == SdrInventor::BasicDialog) && - (aParams.nObjIdentifier >= OBJ_DLG_PUSHBUTTON) && - (aParams.nObjIdentifier <= OBJ_DLG_FORMHSCROLL) ) + (aParams.nObjIdentifier >= SdrObjKind::BasicDialogPushButton) && + (aParams.nObjIdentifier <= SdrObjKind::BasicDialogFormHorizontalScroll) ) { switch( aParams.nObjIdentifier ) { - case OBJ_DLG_PUSHBUTTON: + case SdrObjKind::BasicDialogPushButton: pNewObj = new DlgEdObj(aParams.rSdrModel, "com.sun.star.awt.UnoControlButtonModel", xDialogSFact ); break; - case OBJ_DLG_RADIOBUTTON: + case SdrObjKind::BasicDialogRadioButton: pNewObj = new DlgEdObj(aParams.rSdrModel, "com.sun.star.awt.UnoControlRadioButtonModel", xDialogSFact ); break; - case OBJ_DLG_FORMRADIO: + case SdrObjKind::BasicDialogFormRadio: pNewObj = new DlgEdObj(aParams.rSdrModel, "com.sun.star.form.component.RadioButton", xDialogSFact ); static_cast< DlgEdObj* >( pNewObj )->MakeDataAware( mxModel ); break; - case OBJ_DLG_CHECKBOX: + case SdrObjKind::BasicDialogCheckbox: pNewObj = new DlgEdObj(aParams.rSdrModel, "com.sun.star.awt.UnoControlCheckBoxModel", xDialogSFact ); break; - case OBJ_DLG_FORMCHECK: + case SdrObjKind::BasicDialogFormCheck: pNewObj = new DlgEdObj(aParams.rSdrModel, "com.sun.star.form.component.CheckBox", xDialogSFact ); static_cast< DlgEdObj* >( pNewObj )->MakeDataAware( mxModel ); break; - case OBJ_DLG_LISTBOX: + case SdrObjKind::BasicDialogListbox: pNewObj = new DlgEdObj(aParams.rSdrModel, "com.sun.star.awt.UnoControlListBoxModel", xDialogSFact ); break; - case OBJ_DLG_FORMLIST: + case SdrObjKind::BasicDialogFormList: pNewObj = new DlgEdObj(aParams.rSdrModel, "com.sun.star.form.component.ListBox", xDialogSFact ); static_cast< DlgEdObj* >( pNewObj )->MakeDataAware( mxModel ); break; - case OBJ_DLG_FORMCOMBO: - case OBJ_DLG_COMBOBOX: + case SdrObjKind::BasicDialogFormCombo: + case SdrObjKind::BasicDialogCombobox: { DlgEdObj* pNew = nullptr; - if ( aParams.nObjIdentifier == OBJ_DLG_COMBOBOX ) + if ( aParams.nObjIdentifier == SdrObjKind::BasicDialogCombobox ) pNew = new DlgEdObj(aParams.rSdrModel, "com.sun.star.awt.UnoControlComboBoxModel", xDialogSFact ); else { @@ -114,33 +114,33 @@ IMPL_LINK( DlgEdFactory, MakeObject, SdrObjCreatorParams, aParams, SdrObject* ) } } break; - case OBJ_DLG_GROUPBOX: + case SdrObjKind::BasicDialogGroupBox: pNewObj = new DlgEdObj(aParams.rSdrModel, "com.sun.star.awt.UnoControlGroupBoxModel", xDialogSFact ); break; - case OBJ_DLG_EDIT: + case SdrObjKind::BasicDialogEdit: pNewObj = new DlgEdObj(aParams.rSdrModel, "com.sun.star.awt.UnoControlEditModel", xDialogSFact ); break; - case OBJ_DLG_FIXEDTEXT: + case SdrObjKind::BasicDialogFixedText: pNewObj = new DlgEdObj(aParams.rSdrModel, "com.sun.star.awt.UnoControlFixedTextModel", xDialogSFact ); break; - case OBJ_DLG_IMAGECONTROL: + case SdrObjKind::BasicDialogImageControl: pNewObj = new DlgEdObj(aParams.rSdrModel, "com.sun.star.awt.UnoControlImageControlModel", xDialogSFact ); break; - case OBJ_DLG_PROGRESSBAR: + case SdrObjKind::BasicDialogProgressbar: pNewObj = new DlgEdObj(aParams.rSdrModel, "com.sun.star.awt.UnoControlProgressBarModel", xDialogSFact ); break; - case OBJ_DLG_HSCROLLBAR: + case SdrObjKind::BasicDialogHorizontalScrollbar: pNewObj = new DlgEdObj(aParams.rSdrModel, "com.sun.star.awt.UnoControlScrollBarModel", xDialogSFact ); break; - case OBJ_DLG_FORMHSCROLL: + case SdrObjKind::BasicDialogFormHorizontalScroll: pNewObj = new DlgEdObj(aParams.rSdrModel, "com.sun.star.form.component.ScrollBar", xDialogSFact ); static_cast< DlgEdObj* >( pNewObj )->MakeDataAware( mxModel ); break; - case OBJ_DLG_FORMVSCROLL: - case OBJ_DLG_VSCROLLBAR: + case SdrObjKind::BasicDialogFormVerticalScroll: + case SdrObjKind::BasicDialogVerticalScrollbar: { DlgEdObj* pNew = nullptr; - if ( aParams.nObjIdentifier == OBJ_DLG_VSCROLLBAR ) + if ( aParams.nObjIdentifier == SdrObjKind::BasicDialogVerticalScrollbar ) pNew = new DlgEdObj(aParams.rSdrModel, "com.sun.star.awt.UnoControlScrollBarModel", xDialogSFact ); else { @@ -161,10 +161,10 @@ IMPL_LINK( DlgEdFactory, MakeObject, SdrObjCreatorParams, aParams, SdrObject* ) { } } break; - case OBJ_DLG_HFIXEDLINE: + case SdrObjKind::BasicDialogHorizontalFixedLine: pNewObj = new DlgEdObj(aParams.rSdrModel, "com.sun.star.awt.UnoControlFixedLineModel", xDialogSFact ); break; - case OBJ_DLG_VFIXEDLINE: + case SdrObjKind::BasicDialogVerticalFixedLine: { DlgEdObj* pNew = new DlgEdObj(aParams.rSdrModel, "com.sun.star.awt.UnoControlFixedLineModel", xDialogSFact ); pNewObj = pNew; @@ -181,41 +181,41 @@ IMPL_LINK( DlgEdFactory, MakeObject, SdrObjCreatorParams, aParams, SdrObject* ) { } } break; - case OBJ_DLG_DATEFIELD: + case SdrObjKind::BasicDialogDateField: pNewObj = new DlgEdObj(aParams.rSdrModel, "com.sun.star.awt.UnoControlDateFieldModel", xDialogSFact ); break; - case OBJ_DLG_TIMEFIELD: + case SdrObjKind::BasicDialogTimeField: pNewObj = new DlgEdObj(aParams.rSdrModel, "com.sun.star.awt.UnoControlTimeFieldModel", xDialogSFact ); break; - case OBJ_DLG_NUMERICFIELD: + case SdrObjKind::BasicDialogNumericField: pNewObj = new DlgEdObj(aParams.rSdrModel, "com.sun.star.awt.UnoControlNumericFieldModel", xDialogSFact ); break; - case OBJ_DLG_CURRENCYFIELD: + case SdrObjKind::BasicDialogCurencyField: pNewObj = new DlgEdObj(aParams.rSdrModel, "com.sun.star.awt.UnoControlCurrencyFieldModel", xDialogSFact ); break; - case OBJ_DLG_FORMATTEDFIELD: + case SdrObjKind::BasicDialogFormattedField: pNewObj = new DlgEdObj(aParams.rSdrModel, "com.sun.star.awt.UnoControlFormattedFieldModel", xDialogSFact ); break; - case OBJ_DLG_PATTERNFIELD: + case SdrObjKind::BasicDialogPatternField: pNewObj = new DlgEdObj(aParams.rSdrModel, "com.sun.star.awt.UnoControlPatternFieldModel", xDialogSFact ); break; - case OBJ_DLG_FILECONTROL: + case SdrObjKind::BasicDialogFileControl: pNewObj = new DlgEdObj(aParams.rSdrModel, "com.sun.star.awt.UnoControlFileControlModel", xDialogSFact ); break; - case OBJ_DLG_SPINBUTTON: + case SdrObjKind::BasicDialogSpinButton: pNewObj = new DlgEdObj(aParams.rSdrModel, "com.sun.star.awt.UnoControlSpinButtonModel", xDialogSFact ); break; - case OBJ_DLG_FORMSPIN: + case SdrObjKind::BasicDialogFormSpin: pNewObj = new DlgEdObj(aParams.rSdrModel, "com.sun.star.form.component.SpinButton", xDialogSFact ); static_cast< DlgEdObj* >( pNewObj )->MakeDataAware( mxModel ); break; - case OBJ_DLG_TREECONTROL: + case SdrObjKind::BasicDialogTreeControl: pNewObj = new DlgEdObj(aParams.rSdrModel, "com.sun.star.awt.tree.TreeControlModel", xDialogSFact ); break; - case OBJ_DLG_GRIDCONTROL: + case SdrObjKind::BasicDialogGridControl: pNewObj = new DlgEdObj(aParams.rSdrModel, "com.sun.star.awt.grid.UnoControlGridModel", xDialogSFact ); break; - case OBJ_DLG_HYPERLINKCONTROL: + case SdrObjKind::BasicDialogHyperlinkControl: pNewObj = new DlgEdObj(aParams.rSdrModel, "com.sun.star.awt.UnoControlFixedHyperlinkModel", xDialogSFact ); break; default: diff --git a/basctl/source/dlged/dlgedobj.cxx b/basctl/source/dlged/dlgedobj.cxx index c9ae1de4ae6e..1d89210b7dd5 100644 --- a/basctl/source/dlged/dlgedobj.cxx +++ b/basctl/source/dlged/dlgedobj.cxx @@ -810,99 +810,99 @@ SdrObjKind DlgEdObj::GetObjIdentifier() const { if ( supportsService( "com.sun.star.awt.UnoControlDialogModel" )) { - return OBJ_DLG_DIALOG; + return SdrObjKind::BasicDialogDialog; } else if ( supportsService( "com.sun.star.awt.UnoControlButtonModel" )) { - return OBJ_DLG_PUSHBUTTON; + return SdrObjKind::BasicDialogPushButton; } else if ( supportsService( "com.sun.star.awt.UnoControlRadioButtonModel" )) { - return OBJ_DLG_RADIOBUTTON; + return SdrObjKind::BasicDialogRadioButton; } else if ( supportsService( "com.sun.star.awt.UnoControlCheckBoxModel" )) { - return OBJ_DLG_CHECKBOX; + return SdrObjKind::BasicDialogCheckbox; } else if ( supportsService( "com.sun.star.awt.UnoControlListBoxModel" )) { - return OBJ_DLG_LISTBOX; + return SdrObjKind::BasicDialogListbox; } else if ( supportsService( "com.sun.star.awt.UnoControlComboBoxModel" )) { - return OBJ_DLG_COMBOBOX; + return SdrObjKind::BasicDialogCombobox; } else if ( supportsService( "com.sun.star.awt.UnoControlGroupBoxModel" )) { - return OBJ_DLG_GROUPBOX; + return SdrObjKind::BasicDialogGroupBox; } else if ( supportsService( "com.sun.star.awt.UnoControlEditModel" )) { - return OBJ_DLG_EDIT; + return SdrObjKind::BasicDialogEdit; } else if ( supportsService( "com.sun.star.awt.UnoControlFixedTextModel" )) { - return OBJ_DLG_FIXEDTEXT; + return SdrObjKind::BasicDialogFixedText; } else if ( supportsService( "com.sun.star.awt.UnoControlImageControlModel" )) { - return OBJ_DLG_IMAGECONTROL; + return SdrObjKind::BasicDialogImageControl; } else if ( supportsService( "com.sun.star.awt.UnoControlProgressBarModel" )) { - return OBJ_DLG_PROGRESSBAR; + return SdrObjKind::BasicDialogProgressbar; } else if ( supportsService( "com.sun.star.awt.UnoControlScrollBarModel" )) { - return OBJ_DLG_HSCROLLBAR; + return SdrObjKind::BasicDialogHorizontalScrollbar; } else if ( supportsService( "com.sun.star.awt.UnoControlFixedLineModel" )) { - return OBJ_DLG_HFIXEDLINE; + return SdrObjKind::BasicDialogHorizontalFixedLine; } else if ( supportsService( "com.sun.star.awt.UnoControlDateFieldModel" )) { - return OBJ_DLG_DATEFIELD; + return SdrObjKind::BasicDialogDateField; } else if ( supportsService( "com.sun.star.awt.UnoControlTimeFieldModel" )) { - return OBJ_DLG_TIMEFIELD; + return SdrObjKind::BasicDialogTimeField; } else if ( supportsService( "com.sun.star.awt.UnoControlNumericFieldModel" )) { - return OBJ_DLG_NUMERICFIELD; + return SdrObjKind::BasicDialogNumericField; } else if ( supportsService( "com.sun.star.awt.UnoControlCurrencyFieldModel" )) { - return OBJ_DLG_CURRENCYFIELD; + return SdrObjKind::BasicDialogCurencyField; } else if ( supportsService( "com.sun.star.awt.UnoControlFormattedFieldModel" )) { - return OBJ_DLG_FORMATTEDFIELD; + return SdrObjKind::BasicDialogFormattedField; } else if ( supportsService( "com.sun.star.awt.UnoControlPatternFieldModel" )) { - return OBJ_DLG_PATTERNFIELD; + return SdrObjKind::BasicDialogPatternField; } else if ( supportsService( "com.sun.star.awt.UnoControlFileControlModel" )) { - return OBJ_DLG_FILECONTROL; + return SdrObjKind::BasicDialogFileControl; } else if ( supportsService( "com.sun.star.awt.tree.TreeControlModel" )) { - return OBJ_DLG_TREECONTROL; + return SdrObjKind::BasicDialogTreeControl; } else if ( supportsService( "com.sun.star.awt.grid.UnoControlGridModel" )) { - return OBJ_DLG_GRIDCONTROL; + return SdrObjKind::BasicDialogGridControl; } else if ( supportsService( "com.sun.star.awt.UnoControlFixedHyperlinkModel" )) { - return OBJ_DLG_HYPERLINKCONTROL; + return SdrObjKind::BasicDialogHyperlinkControl; } else { - return OBJ_DLG_CONTROL; + return SdrObjKind::BasicDialogControl; } } diff --git a/chart2/source/controller/main/ChartController_Tools.cxx b/chart2/source/controller/main/ChartController_Tools.cxx index 27454b66ae70..d88d9c424da5 100644 --- a/chart2/source/controller/main/ChartController_Tools.cxx +++ b/chart2/source/controller/main/ChartController_Tools.cxx @@ -352,7 +352,7 @@ void ChartController::impl_PasteGraphic( if( ! (xGraphic.is() && xModelProp.is())) return; rtl::Reference<SvxGraphicObject> xGraphicShape = new SvxGraphicObject(nullptr); - xGraphicShape->setShapeKind(OBJ_GRAF); + xGraphicShape->setShapeKind(SdrObjKind::Graphic); uno::Reference< drawing::XShapes > xPage = pDrawModelWrapper->getMainDrawPage(); if( xPage.is()) @@ -454,7 +454,7 @@ void ChartController::impl_PasteStringAsTextShape( const OUString& rString, cons try { rtl::Reference<SvxShapeText> xTextShape = new SvxShapeText(nullptr); - xTextShape->setShapeKind(OBJ_TEXT); + xTextShape->setShapeKind(SdrObjKind::Text); xDrawPage->add( xTextShape ); xTextShape->setString( rString ); @@ -571,7 +571,7 @@ bool ChartController::isShapeContext() const { return m_aSelection.isAdditionalShapeSelected() || ( m_pDrawViewWrapper && m_pDrawViewWrapper->AreObjectsMarked() && - ( m_pDrawViewWrapper->GetCurrentObjIdentifier() == OBJ_TEXT ) ); + ( m_pDrawViewWrapper->GetCurrentObjIdentifier() == SdrObjKind::Text ) ); } void ChartController::impl_ClearSelection() diff --git a/chart2/source/controller/main/ChartController_Window.cxx b/chart2/source/controller/main/ChartController_Window.cxx index 92a7f9f16851..76ccba722e54 100644 --- a/chart2/source/controller/main/ChartController_Window.cxx +++ b/chart2/source/controller/main/ChartController_Window.cxx @@ -637,7 +637,7 @@ void ChartController::execute_MouseButtonDown( const MouseEvent& rMEvt ) } if ( !pDrawViewWrapper->IsAction() ) { - if ( pDrawViewWrapper->GetCurrentObjIdentifier() == OBJ_CAPTION ) + if ( pDrawViewWrapper->GetCurrentObjIdentifier() == SdrObjKind::Caption ) { Size aCaptionSize( 2268, 1134 ); pDrawViewWrapper->BegCreateCaptionObj( aMPos, aCaptionSize ); @@ -786,7 +786,7 @@ void ChartController::execute_MouseButtonUp( const MouseEvent& rMEvt ) } if ( pDrawViewWrapper->AreObjectsMarked() ) { - if ( pDrawViewWrapper->GetCurrentObjIdentifier() == OBJ_TEXT ) + if ( pDrawViewWrapper->GetCurrentObjIdentifier() == SdrObjKind::Text ) { executeDispatch_EditText(); } @@ -1988,33 +1988,33 @@ void ChartController::impl_SetMousePointer( const MouseEvent & rEvent ) SdrObjKind eKind = m_pDrawViewWrapper->GetCurrentObjIdentifier(); switch ( eKind ) { - case OBJ_LINE: + case SdrObjKind::Line: { ePointerStyle = PointerStyle::DrawLine; } break; - case OBJ_RECT: - case OBJ_CUSTOMSHAPE: + case SdrObjKind::Rectangle: + case SdrObjKind::CustomShape: { ePointerStyle = PointerStyle::DrawRect; } break; - case OBJ_CIRC: + case SdrObjKind::CircleOrEllipse: { ePointerStyle = PointerStyle::DrawEllipse; } break; - case OBJ_FREELINE: + case SdrObjKind::FreehandLine: { ePointerStyle = PointerStyle::DrawPolygon; } break; - case OBJ_TEXT: + case SdrObjKind::Text: { ePointerStyle = PointerStyle::DrawText; } break; - case OBJ_CAPTION: + case SdrObjKind::Caption: { ePointerStyle = PointerStyle::DrawCaption; } diff --git a/chart2/source/controller/main/DrawCommandDispatch.cxx b/chart2/source/controller/main/DrawCommandDispatch.cxx index 06fcf0ac4e57..a20d2ba1a7fb 100644 --- a/chart2/source/controller/main/DrawCommandDispatch.cxx +++ b/chart2/source/controller/main/DrawCommandDispatch.cxx @@ -101,7 +101,7 @@ void DrawCommandDispatch::setAttributes( SdrObject* pObj ) DrawModelWrapper* pDrawModelWrapper = m_pChartController->GetDrawModelWrapper(); DrawViewWrapper* pDrawViewWrapper = m_pChartController->GetDrawViewWrapper(); - if ( !(pDrawModelWrapper && pDrawViewWrapper && pDrawViewWrapper->GetCurrentObjIdentifier() == OBJ_CUSTOMSHAPE) ) + if ( !(pDrawModelWrapper && pDrawViewWrapper && pDrawViewWrapper->GetCurrentObjIdentifier() == SdrObjKind::CustomShape) ) return; bool bAttributesAppliedFromGallery = false; @@ -257,7 +257,7 @@ FeatureState DrawCommandDispatch::getState( const OUString& rCommand ) void DrawCommandDispatch::execute( const OUString& rCommand, const Sequence< beans::PropertyValue>& rArgs ) { ChartDrawMode eDrawMode = CHARTDRAW_SELECT; - SdrObjKind eKind = OBJ_NONE; + SdrObjKind eKind = SdrObjKind::NONE; sal_uInt16 nFeatureId = 0; OUString aBaseCommand; @@ -274,45 +274,45 @@ void DrawCommandDispatch::execute( const OUString& rCommand, const Sequence< bea case COMMAND_ID_OBJECT_SELECT: { eDrawMode = CHARTDRAW_SELECT; - eKind = OBJ_NONE; + eKind = SdrObjKind::NONE; } break; case COMMAND_ID_DRAW_LINE: case COMMAND_ID_LINE_ARROW_END: { eDrawMode = CHARTDRAW_INSERT; - eKind = OBJ_LINE; + eKind = SdrObjKind::Line; } break; case COMMAND_ID_DRAW_RECT: { eDrawMode = CHARTDRAW_INSERT; - eKind = OBJ_RECT; + eKind = SdrObjKind::Rectangle; } break; case COMMAND_ID_DRAW_ELLIPSE: { eDrawMode = CHARTDRAW_INSERT; - eKind = OBJ_CIRC; + eKind = SdrObjKind::CircleOrEllipse; } break; case COMMAND_ID_DRAW_FREELINE_NOFILL: { eDrawMode = CHARTDRAW_INSERT; - eKind = OBJ_FREELINE; + eKind = SdrObjKind::FreehandLine; } break; case COMMAND_ID_DRAW_TEXT: { eDrawMode = CHARTDRAW_INSERT; - eKind = OBJ_TEXT; + eKind = SdrObjKind::Text; bCreate = true; } break; case COMMAND_ID_DRAW_CAPTION: { eDrawMode = CHARTDRAW_INSERT; - eKind = OBJ_CAPTION; + eKind = SdrObjKind::Caption; } break; case COMMAND_ID_DRAWTBX_CS_BASIC: @@ -323,13 +323,13 @@ void DrawCommandDispatch::execute( const OUString& rCommand, const Sequence< bea case COMMAND_ID_DRAWTBX_CS_STAR: { eDrawMode = CHARTDRAW_INSERT; - eKind = OBJ_CUSTOMSHAPE; + eKind = SdrObjKind::CustomShape; } break; default: { eDrawMode = CHARTDRAW_SELECT; - eKind = OBJ_NONE; + eKind = SdrObjKind::NONE; } break; } diff --git a/chart2/source/controller/main/ShapeController.cxx b/chart2/source/controller/main/ShapeController.cxx index a85922dfa61d..924e4d9a6690 100644 --- a/chart2/source/controller/main/ShapeController.cxx +++ b/chart2/source/controller/main/ShapeController.cxx @@ -351,7 +351,7 @@ void ShapeController::executeDispatch_TransformDialog() return; SdrObject* pSelectedObj = pDrawViewWrapper->getSelectedObject(); - if ( pSelectedObj && pSelectedObj->GetObjIdentifier() == OBJ_CAPTION ) + if ( pSelectedObj && pSelectedObj->GetObjIdentifier() == SdrObjKind::Caption ) { // item set for caption SfxItemSet aAttr( pDrawViewWrapper->GetModel()->GetItemPool() ); diff --git a/chart2/source/view/main/ShapeFactory.cxx b/chart2/source/view/main/ShapeFactory.cxx index 7c3210cd1dc0..98afa8bba4da 100644 --- a/chart2/source/view/main/ShapeFactory.cxx +++ b/chart2/source/view/main/ShapeFactory.cxx @@ -95,7 +95,7 @@ rtl::Reference<SvxShapeGroupAnyD> ShapeFactory::getOrCreateChartRootShape( // Create a new root shape and set it to the bottom of the page. The root // shape is identified by having the name com.sun.star.chart2.shapes. rtl::Reference<SvxShapeGroup> xShapeGroup = new SvxShapeGroup(nullptr, nullptr); - xShapeGroup->setShapeKind(OBJ_GRUP); + xShapeGroup->setShapeKind(SdrObjKind::Group); uno::Reference<drawing::XShape> xShape(static_cast<cppu::OWeakObject*>(xShapeGroup.get()), uno::UNO_QUERY); xDrawPage->addBottom(xShape); @@ -405,7 +405,7 @@ rtl::Reference<Svx3DExtrudeObject> //create shape rtl::Reference<Svx3DExtrudeObject> xShape = new Svx3DExtrudeObject(nullptr); - xShape->setShapeKind(E3D_EXTRUDEOBJ_ID | E3D_INVENTOR_FLAG); + xShape->setShapeKind(SdrObjKind::E3D_Extrusion); xTarget->add(xShape); //set properties @@ -640,7 +640,7 @@ rtl::Reference<Svx3DLatheObject> //create shape rtl::Reference<Svx3DLatheObject> xShape = new Svx3DLatheObject(nullptr); - xShape->setShapeKind(E3D_LATHEOBJ_ID | E3D_INVENTOR_FLAG); + xShape->setShapeKind(SdrObjKind::E3D_Lathe); xTarget->add(xShape); double fWidth = rSize.DirectionX/2.0; //The depth will be corrected within Matrix @@ -870,7 +870,7 @@ rtl::Reference<SvxShapePolyPolygon> //create shape rtl::Reference<SvxShapePolyPolygon> xShape = new SvxShapePolyPolygon(nullptr); - xShape->setShapeKind(OBJ_PATHFILL); // aka ClosedBezierShape + xShape->setShapeKind(SdrObjKind::PathFill); // aka ClosedBezierShape xTarget->add(xShape); //need to add the shape before setting of properties //set properties @@ -917,7 +917,7 @@ rtl::Reference<Svx3DExtrudeObject> //create shape rtl::Reference<Svx3DExtrudeObject> xShape = new Svx3DExtrudeObject(nullptr); - xShape->setShapeKind(E3D_EXTRUDEOBJ_ID | E3D_INVENTOR_FLAG); + xShape->setShapeKind(SdrObjKind::E3D_Extrusion); xTarget->add(xShape); //need to add the shape before setting of properties //set properties @@ -987,7 +987,7 @@ rtl::Reference<Svx3DPolygonObject> //create shape rtl::Reference<Svx3DPolygonObject> xShape = new Svx3DPolygonObject(nullptr); - xShape->setShapeKind(E3D_POLYGONOBJ_ID | E3D_INVENTOR_FLAG); + xShape->setShapeKind(SdrObjKind::E3D_Polygon); xTarget->add(xShape); //set properties @@ -1041,7 +1041,7 @@ rtl::Reference<Svx3DExtrudeObject> //create shape rtl::Reference<Svx3DExtrudeObject> xShape = new Svx3DExtrudeObject(nullptr); - xShape->setShapeKind(E3D_EXTRUDEOBJ_ID | E3D_INVENTOR_FLAG); + xShape->setShapeKind(SdrObjKind::E3D_Extrusion); xTarget->add(xShape); //set properties @@ -1090,7 +1090,7 @@ SdrPathObj* return nullptr; //create shape - SdrPathObj* pPath = new SdrPathObj(xTarget->GetSdrObject()->getSdrModelFromSdrObject(), OBJ_POLY); + SdrPathObj* pPath = new SdrPathObj(xTarget->GetSdrObject()->getSdrModelFromSdrObject(), SdrObjKind::Polygon); if (bSetZOrderToZero) // insert at ZOrder 0, an area should always be behind other shapes xTarget->GetSdrObject()->GetSubList()->InsertObject(pPath, 0); @@ -1628,7 +1628,7 @@ rtl::Reference<SvxShapePolyPolygon> //create shape rtl::Reference<SvxShapePolyPolygon> xShape = new SvxShapePolyPolygon(nullptr); - xShape->setShapeKind(OBJ_POLY); + xShape->setShapeKind(SdrObjKind::Polygon); xTarget->add(uno::Reference<drawing::XShape>(xShape)); //set properties @@ -1671,7 +1671,7 @@ rtl::Reference<SvxGraphicObject> //create shape rtl::Reference<SvxGraphicObject> xShape = new SvxGraphicObject(nullptr); - xShape->setShapeKind(OBJ_GRAF); + xShape->setShapeKind(SdrObjKind::Graphic); xTarget->add(xShape); try @@ -1709,7 +1709,7 @@ rtl::Reference< SvxShapeGroup > { //create and add to target rtl::Reference<SvxShapeGroup> xShapeGroup = new SvxShapeGroup(nullptr, nullptr); - xShapeGroup->setShapeKind(OBJ_GRUP); + xShapeGroup->setShapeKind(SdrObjKind::Group); uno::Reference< drawing::XShape > xShape(static_cast<cppu::OWeakObject*>(xShapeGroup.get()), uno::UNO_QUERY_THROW); xTarget->add(xShape); @@ -1741,7 +1741,7 @@ rtl::Reference< SvxShapeGroup > { //create and add to target rtl::Reference<SvxShapeGroup> xShapeGroup = new SvxShapeGroup(nullptr, nullptr); - xShapeGroup->setShapeKind(OBJ_GRUP); + xShapeGroup->setShapeKind(SdrObjKind::Group); uno::Reference< drawing::XShape > xShape(static_cast<cppu::OWeakObject*>(xShapeGroup.get()), uno::UNO_QUERY_THROW); xTarget->add(xShape); @@ -1773,7 +1773,7 @@ rtl::Reference<Svx3DSceneObject> { //create shape rtl::Reference<Svx3DSceneObject> xShape = new Svx3DSceneObject(nullptr, nullptr); - xShape->setShapeKind(E3D_SCENE_ID | E3D_INVENTOR_FLAG); + xShape->setShapeKind(SdrObjKind::E3D_Scene); xTarget->add(xShape); //it is necessary to set the transform matrix to initialize the scene properly @@ -1815,7 +1815,7 @@ rtl::Reference<SvxShapeCircle> //create shape rtl::Reference<SvxShapeCircle> xShape = new SvxShapeCircle(nullptr); - xShape->setShapeKind(OBJ_CIRC); + xShape->setShapeKind(SdrObjKind::CircleOrEllipse); xTarget->add(xShape); try @@ -1850,7 +1850,7 @@ rtl::Reference<SvxShapeCircle> , const awt::Point& rPosition ) { rtl::Reference<SvxShapeCircle> xShape = new SvxShapeCircle(nullptr); - xShape->setShapeKind(OBJ_CIRC); + xShape->setShapeKind(SdrObjKind::CircleOrEllipse); xTarget->add(xShape); xShape->setSize( rSize ); xShape->setPosition( rPosition ); @@ -1871,7 +1871,7 @@ rtl::Reference<Svx3DPolygonObject> //create shape rtl::Reference<Svx3DPolygonObject> xShape = new Svx3DPolygonObject(nullptr); - xShape->setShapeKind(E3D_POLYGONOBJ_ID | E3D_INVENTOR_FLAG); + xShape->setShapeKind(SdrObjKind::E3D_Polygon); xTarget->add(xShape); //set properties @@ -1940,7 +1940,7 @@ rtl::Reference<SvxShapePolyPolygon> //create shape rtl::Reference<SvxShapePolyPolygon> xShape = new SvxShapePolyPolygon(nullptr); - xShape->setShapeKind(OBJ_PLIN); + xShape->setShapeKind(SdrObjKind::PolyLine); xTarget->add(xShape); //set properties @@ -1996,7 +1996,7 @@ rtl::Reference<SvxShapePolyPolygon> { //create shape rtl::Reference<SvxShapePolyPolygon> xShape = new SvxShapePolyPolygon(nullptr); - xShape->setShapeKind(OBJ_LINE); + xShape->setShapeKind(SdrObjKind::Line); xTarget->add(xShape); xShape->setSize( rSize ); xShape->setPosition( rPosition ); @@ -2014,7 +2014,7 @@ rtl::Reference<SvxShapeRect> ShapeFactory::createInvisibleRectangle( return nullptr; rtl::Reference<SvxShapeRect> xShape = new SvxShapeRect(nullptr); - xShape->setShapeKind(OBJ_RECT); + xShape->setShapeKind(SdrObjKind::Rectangle); xTarget->add( xShape ); ShapeFactory::makeShapeInvisible( xShape ); xShape->setSize( rSize ); @@ -2036,7 +2036,7 @@ rtl::Reference<SvxShapeRect> ShapeFactory::createRectangle( StackPosition ePos ) { rtl::Reference<SvxShapeRect> xShape = new SvxShapeRect(nullptr); - xShape->setShapeKind(OBJ_RECT); + xShape->setShapeKind(SdrObjKind::Rectangle); if (ePos == StackPosition::Bottom) { uno::Reference<drawing::XShapes2> xTarget2(static_cast<cppu::OWeakObject*>(xTarget.get()), uno::UNO_QUERY); @@ -2058,7 +2058,7 @@ rtl::Reference<SvxShapeRect> const rtl::Reference<SvxShapeGroupAnyD>& xTarget ) { rtl::Reference<SvxShapeRect> xShape = new SvxShapeRect(nullptr); - xShape->setShapeKind(OBJ_RECT); + xShape->setShapeKind(SdrObjKind::Rectangle); xTarget->add( xShape ); return xShape; @@ -2079,7 +2079,7 @@ rtl::Reference<SvxShapeText> //create shape and add to page rtl::Reference<SvxShapeText> xShape = new SvxShapeText(nullptr); - xShape->setShapeKind(OBJ_TEXT); + xShape->setShapeKind(SdrObjKind::Text); xTarget->add(xShape); //set text @@ -2134,7 +2134,7 @@ rtl::Reference<SvxShapeText> //create shape and add to page rtl::Reference<SvxShapeText> xShape = new SvxShapeText(nullptr); - xShape->setShapeKind(OBJ_TEXT); + xShape->setShapeKind(SdrObjKind::Text); xTarget->add(xShape); //set paragraph properties @@ -2201,7 +2201,7 @@ rtl::Reference<SvxShapeText> { //create shape and add to page rtl::Reference<SvxShapeText> xShape = new SvxShapeText(nullptr); - xShape->setShapeKind(OBJ_TEXT); + xShape->setShapeKind(SdrObjKind::Text); try { xTarget->add(xShape); diff --git a/chart2/source/view/main/VButton.cxx b/chart2/source/view/main/VButton.cxx index c53b4dc75282..c2aebd913b88 100644 --- a/chart2/source/view/main/VButton.cxx +++ b/chart2/source/view/main/VButton.cxx @@ -43,7 +43,7 @@ void VButton::init(const rtl::Reference<SvxShapeGroupAnyD>& xTargetPage) rtl::Reference<SvxShapePolyPolygon> VButton::createTriangle(awt::Size aSize) { rtl::Reference<SvxShapePolyPolygon> xShape = new SvxShapePolyPolygon(nullptr); - xShape->setShapeKind(OBJ_POLY); + xShape->setShapeKind(SdrObjKind::Polygon); drawing::PolyPolygonShape3D aPolyPolygon; aPolyPolygon.SequenceX.realloc(1); 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; diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx index 823868ae2dfe..8832617a4e58 100644 --- a/filter/source/msfilter/msdffimp.cxx +++ b/filter/source/msfilter/msdffimp.cxx @@ -481,16 +481,16 @@ void SvxMSDffManager::SolveSolver( const SvxMSDffSolverContainer& rSolver ) if( nInventor == SdrInventor::Default ) { bool bValidGluePoint = false; - sal_uInt32 nObjId = pO->GetObjIdentifier(); + SdrObjKind nObjId = pO->GetObjIdentifier(); switch( nObjId ) { - case OBJ_GRUP : - case OBJ_GRAF : - case OBJ_RECT : - case OBJ_TEXT : - case OBJ_PAGE : - case OBJ_TITLETEXT : - case OBJ_OUTLINETEXT : + case SdrObjKind::Group : + case SdrObjKind::Graphic : + case SdrObjKind::Rectangle : + case SdrObjKind::Text : + case SdrObjKind::Page : + case SdrObjKind::TitleText : + case SdrObjKind::OutlineText : { if ( nC & 1 ) { @@ -521,17 +521,17 @@ void SvxMSDffManager::SolveSolver( const SvxMSDffSolverContainer& rSolver ) bValidGluePoint = true; } break; - case OBJ_POLY : - case OBJ_PLIN : - case OBJ_LINE : - case OBJ_PATHLINE : - case OBJ_PATHFILL : - case OBJ_FREELINE : - case OBJ_FREEFILL : - case OBJ_SPLNLINE : - case OBJ_SPLNFILL : - case OBJ_PATHPOLY : - case OBJ_PATHPLIN : + case SdrObjKind::Polygon : + case SdrObjKind::PolyLine : + case SdrObjKind::Line : + case SdrObjKind::PathLine : + case SdrObjKind::PathFill : + case SdrObjKind::FreehandLine : + case SdrObjKind::FreehandFill : + case SdrObjKind::SplineLine : + case SdrObjKind::SplineFill : + case SdrObjKind::PathPoly : + case SdrObjKind::PathPolyLine : { if (pList) { @@ -597,7 +597,7 @@ void SvxMSDffManager::SolveSolver( const SvxMSDffSolverContainer& rSolver ) } break; - case OBJ_CUSTOMSHAPE : + case SdrObjKind::CustomShape : { const SfxPoolItem& aCustomShape = static_cast<SdrObjCustomShape*>(pO)->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ); SdrCustomShapeGeometryItem aGeometryItem( static_cast<const SdrCustomShapeGeometryItem&>(aCustomShape) ); @@ -748,6 +748,7 @@ void SvxMSDffManager::SolveSolver( const SvxMSDffSolverContainer& rSolver ) } } break; + default: ; } if ( bValidGluePoint ) { @@ -4340,7 +4341,7 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r aPoly.append(basegfx::B2DPoint(aObjData.aBoundRect.Right(), aObjData.aBoundRect.Bottom())); pRet = new SdrPathObj( *pSdrModel, - OBJ_LINE, + SdrObjKind::Line, basegfx::B2DPolyPolygon(aPoly)); ApplyAttributes( rSt, aSet, aObjData ); pRet->SetMergedItemSet(aSet); @@ -5293,7 +5294,7 @@ SdrObject* SvxMSDffManager::ProcessObj(SvStream& rSt, pTextObj = new SdrRectObj( *pSdrModel, - OBJ_TEXT, + SdrObjKind::Text, rTextRect); pTextImpRec = new SvxMSDffImportRec(*pImpRec); bDeleteTextImpRec = true; diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx index 9828b287bda5..9ab29d66458f 100644 --- a/filter/source/msfilter/svdfppt.cxx +++ b/filter/source/msfilter/svdfppt.cxx @@ -987,18 +987,18 @@ SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, Svx nMinFrameHeight = rTextRect.GetHeight() - ( nTextTop + nTextBottom ); } - SdrObjKind eTextKind = OBJ_RECT; + SdrObjKind eTextKind = SdrObjKind::Rectangle; if ( ( aPlaceholderAtom.nPlaceholderId == PptPlaceholder::NOTESSLIDEIMAGE ) || ( aPlaceholderAtom.nPlaceholderId == PptPlaceholder::MASTERNOTESSLIDEIMAGE ) ) { aTextObj.SetInstance( TSS_Type::Notes ); - eTextKind = OBJ_TITLETEXT; + eTextKind = SdrObjKind::TitleText; } else if ( ( aPlaceholderAtom.nPlaceholderId == PptPlaceholder::MASTERNOTESBODYIMAGE ) || ( aPlaceholderAtom.nPlaceholderId == PptPlaceholder::NOTESBODY ) ) { aTextObj.SetInstance( TSS_Type::Notes ); - eTextKind = OBJ_TEXT; + eTextKind = SdrObjKind::Text; } TSS_Type nDestinationInstance = aTextObj.GetInstance(); @@ -1036,11 +1036,11 @@ SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, Svx switch ( aTextObj.GetInstance() ) { case TSS_Type::PageTitle : - case TSS_Type::Title : eTextKind = OBJ_TITLETEXT; break; - case TSS_Type::Subtitle : eTextKind = OBJ_TEXT; break; + case TSS_Type::Title : eTextKind = SdrObjKind::TitleText; break; + case TSS_Type::Subtitle : eTextKind = SdrObjKind::Text; break; case TSS_Type::Body : case TSS_Type::HalfBody : - case TSS_Type::QuarterBody : eTextKind = OBJ_OUTLINETEXT; bAutoFit = true; break; + case TSS_Type::QuarterBody : eTextKind = SdrObjKind::OutlineText; bAutoFit = true; break; default: break; } if ( aTextObj.GetDestinationInstance() != TSS_Type::TextInShape ) @@ -1048,14 +1048,14 @@ SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, Svx if ( !aTextObj.GetOEPlaceHolderAtom() || aTextObj.GetOEPlaceHolderAtom()->nPlaceholderId == PptPlaceholder::NONE ) { aTextObj.SetDestinationInstance( TSS_Type::TextInShape ); - eTextKind = OBJ_RECT; + eTextKind = SdrObjKind::Rectangle; } } SdrObject* pTObj = nullptr; bool bWordWrap = GetPropertyValue(DFF_Prop_WrapText, mso_wrapSquare) != mso_wrapNone; bool bFitShapeToText = ( GetPropertyValue( DFF_Prop_FitTextToShape, 0 ) & 2 ) != 0; - if ( dynamic_cast<const SdrObjCustomShape* >(pRet) != nullptr && ( eTextKind == OBJ_RECT ) ) + if ( dynamic_cast<const SdrObjCustomShape* >(pRet) != nullptr && ( eTextKind == SdrObjKind::Rectangle ) ) { bAutoGrowHeight = bFitShapeToText; bAutoGrowWidth = !bWordWrap; @@ -1071,7 +1071,7 @@ SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, Svx } pTObj = new SdrRectObj( *pSdrModel, - eTextKind != OBJ_RECT ? eTextKind : OBJ_TEXT); + eTextKind != SdrObjKind::Rectangle ? eTextKind : SdrObjKind::Text); SfxItemSet aSet( pSdrModel->GetItemPool() ); if ( !pRet ) ApplyAttributes( rSt, aSet, rObjData ); @@ -2258,7 +2258,7 @@ SdrObject* SdrPowerPointImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj* bool bUndoEnabled = rOutliner.IsUndoEnabled(); rOutliner.EnableUndo(false); - if ( ( pText->GetObjInventor() == SdrInventor::Default ) && ( pText->GetObjIdentifier() == OBJ_TITLETEXT ) ) // Outliner-Style for Title-Text object?!? (->of DL) + if ( ( pText->GetObjInventor() == SdrInventor::Default ) && ( pText->GetObjIdentifier() == SdrObjKind::TitleText ) ) // Outliner-Style for Title-Text object?!? (->of DL) rOutliner.Init( OutlinerMode::TitleObject ); // Outliner reset bool bOldUpdateMode = rOutliner.SetUpdateLayout( false ); diff --git a/include/filter/msfilter/msdffimp.hxx b/include/filter/msfilter/msdffimp.hxx index e7ac958d7564..581d5586a78b 100644 --- a/include/filter/msfilter/msdffimp.hxx +++ b/include/filter/msfilter/msdffimp.hxx @@ -537,7 +537,7 @@ protected: ) const; /** Prevent that (rounded) rectangles with wrapped text will always be - converted into SdrRectObj( OBJ_TEXT ). + converted into SdrRectObj( SdrObjKind::Text ). @return true means "conversion". */ diff --git a/include/svx/fmtools.hxx b/include/svx/fmtools.hxx index 869023f06f7f..10f52d474977 100644 --- a/include/svx/fmtools.hxx +++ b/include/svx/fmtools.hxx @@ -43,7 +43,7 @@ namespace com::sun::star::sdbc { class SQLException; } namespace com::sun::star::sdbc { class XRowSet; } namespace com::sun::star::sdb { class SQLContext; } namespace com::sun::star::sdb { struct SQLErrorEvent; } - +enum class SdrObjKind : sal_uInt16; // common types @@ -160,7 +160,7 @@ public: void dispose(); }; -sal_Int16 getControlTypeByObject(const css::uno::Reference< css::lang::XServiceInfo>& _rxObject); +SdrObjKind getControlTypeByObject(const css::uno::Reference< css::lang::XServiceInfo>& _rxObject); // get the object type (OBJ_FM_...) from the services the object supports diff --git a/include/svx/sidebar/SelectionAnalyzer.hxx b/include/svx/sidebar/SelectionAnalyzer.hxx index a7b8cba99d4c..349db88513b5 100644 --- a/include/svx/sidebar/SelectionAnalyzer.hxx +++ b/include/svx/sidebar/SelectionAnalyzer.hxx @@ -25,6 +25,7 @@ class SdrMarkList; class SdrObject; enum class SdrInventor : sal_uInt32; +enum class SdrObjKind : sal_uInt16; namespace svx::sidebar { @@ -52,20 +53,20 @@ public: private: static vcl::EnumContext::Context GetContextForObjectId_SC ( - const sal_uInt16 nObjectId); + const SdrObjKind nObjectId); static vcl::EnumContext::Context GetContextForObjectId_SD ( - const sal_uInt16 nObjectId, + const SdrObjKind nObjectId, const ViewType eViewType); static SdrInventor GetInventorTypeFromMark ( const SdrMarkList& rMarkList); - static sal_uInt16 GetObjectTypeFromMark ( + static SdrObjKind GetObjectTypeFromMark ( const SdrMarkList& rMarkList); - static sal_uInt16 GetObjectTypeFromGroup ( + static SdrObjKind GetObjectTypeFromGroup ( const SdrObject* pObj); static bool IsShapeType ( - const sal_uInt16 nType); + const SdrObjKind nType); static bool IsTextObjType ( - const sal_uInt16 nType); + const SdrObjKind nType); }; } // end of namespace svx::sidebar diff --git a/include/svx/svdedxv.hxx b/include/svx/svdedxv.hxx index ed8f0c08939a..cbdecfea5298 100644 --- a/include/svx/svdedxv.hxx +++ b/include/svx/svdedxv.hxx @@ -298,7 +298,7 @@ public: const rtl::Reference< sdr::SelectionController >& getSelectionController() const { return mxSelectionController; } /** returns true if the shape identified by its inventor and identifier supports format paint brush operation */ - static bool SupportsFormatPaintbrush( SdrInventor nObjectInventor, sal_uInt16 nObjectIdentifier ); + static bool SupportsFormatPaintbrush( SdrInventor nObjectInventor, SdrObjKind nObjectIdentifier ); /** returns a format paint brush set from the current selection */ void TakeFormatPaintBrush( std::shared_ptr< SfxItemSet >& rFormatSet ); diff --git a/include/svx/svdobjkind.hxx b/include/svx/svdobjkind.hxx index 827b35e3b339..187fd0d6ffb5 100644 --- a/include/svx/svdobjkind.hxx +++ b/include/svx/svdobjkind.hxx @@ -21,127 +21,134 @@ #include <com/sun/star/form/FormComponentType.hpp> -enum SdrObjKind +enum class SdrObjKind : sal_uInt16 { - OBJ_NONE = 0, /// abstract object (SdrObject) - OBJ_GRUP = 1, /// object group - OBJ_LINE = 2, /// line - OBJ_RECT = 3, /// rectangle (round corners optional) - OBJ_CIRC = 4, /// circle, ellipse - OBJ_SECT = 5, /// circle section - OBJ_CARC = 6, /// circle arc - OBJ_CCUT = 7, /// circle cut - OBJ_POLY = 8, /// polygon, PolyPolygon - OBJ_PLIN = 9, /// PolyLine - OBJ_PATHLINE = 10, /// open Bezier-curve - OBJ_PATHFILL = 11, /// closed Bezier-curve - OBJ_FREELINE = 12, /// open free-hand line - OBJ_FREEFILL = 13, /// closed free-hand line - OBJ_SPLNLINE = 14, /// natural cubic Spline (ni) - OBJ_SPLNFILL = 15, /// periodic cubic Spline (ni) - OBJ_TEXT = 16, /// text object - OBJ_TITLETEXT = 20, /// TitleText, special text object for StarDraw - OBJ_OUTLINETEXT = 21, /// OutlineText, special text object for StarDraw - OBJ_GRAF = 22, /// foreign graphic (StarView Graphic) - OBJ_OLE2 = 23, /// OLE object - OBJ_EDGE = 24, /// connector object - OBJ_CAPTION = 25, /// caption object - OBJ_PATHPOLY = 26, /// Polygon/PolyPolygon represented by SdrPathObj - OBJ_PATHPLIN = 27, /// Polyline represented by SdrPathObj - OBJ_PAGE = 28, /// object that represents a SdrPage - OBJ_MEASURE = 29, /// measurement object - OBJ_FRAME = 31, /// continuously activated OLE (PlugIn-Frame or similar) - OBJ_UNO = 32, /// Universal Network Object packed into SvDraw object - OBJ_CUSTOMSHAPE = 33, /// custom shape - OBJ_MEDIA = 34, /// media shape - OBJ_TABLE = 35, /// table + NONE = 0, /// abstract object (SdrObject) + Group = 1, /// object group + Line = 2, /// line + Rectangle = 3, /// rectangle (round corners optional) + CircleOrEllipse = 4, /// circle, ellipse + CircleSection = 5, /// circle section + CircleArc = 6, /// circle arc + CircleCut = 7, /// circle cut + Polygon = 8, /// polygon, PolyPolygon + PolyLine = 9, /// PolyLine + PathLine = 10, /// open Bezier-curve + PathFill = 11, /// closed Bezier-curve + FreehandLine = 12, /// open free-hand line + FreehandFill = 13, /// closed free-hand line + SplineLine = 14, /// natural cubic Spline (ni) + SplineFill = 15, /// periodic cubic Spline (ni) + Text = 16, /// text object + TitleText = 20, /// TitleText, special text object for StarDraw + OutlineText = 21, /// OutlineText, special text object for StarDraw + Graphic = 22, /// foreign graphic (StarView Graphic) + OLE2 = 23, /// OLE object + Edge = 24, /// connector object + Caption = 25, /// caption object + PathPoly = 26, /// Polygon/PolyPolygon represented by SdrPathObj + PathPolyLine = 27, /// Polyline represented by SdrPathObj + Page = 28, /// object that represents a SdrPage + Measure = 29, /// measurement object + OLEPluginFrame = 31, /// continuously activated OLE (PlugIn-Frame or similar) + UNO = 32, /// Universal Network Object packed into SvDraw object + CustomShape = 33, /// custom shape + Media = 34, /// media shape + Table = 35, /// table - OBJ_OLE2_APPLET = 100, - OBJ_OLE2_PLUGIN = 101, + OLE2Applet = 100, + OLE2Plugin = 101, // engine3d, arbitrarily place at 200 - E3D_SCENE_ID = 202, + E3D_Scene = 202, // E3D_OBJECT_ID should not be used, it's only a helper class for E3DScene and E3DCompoundObject - E3D_OBJECT_ID = 203, - E3D_CUBEOBJ_ID = 204, - E3D_SPHEREOBJ_ID = 205, - E3D_EXTRUDEOBJ_ID = 206, - E3D_LATHEOBJ_ID = 207, - E3D_COMPOUNDOBJ_ID = 208, - E3D_POLYGONOBJ_ID = 209, + E3D_Object = 203, + E3D_Cube = 204, + E3D_Sphere = 205, + E3D_Extrusion = 206, + E3D_Lathe = 207, + E3D_CompoundObject = 208, + E3D_Polygon = 209, + E3D_INVENTOR_FIRST = E3D_Scene, + E3D_INVENTOR_LAST = E3D_Polygon, // for form components, arbitrarily place at 300 - OBJ_FM_CONTROL = 300 + css::form::FormComponentType::CONTROL, - OBJ_FM_EDIT = 300 + css::form::FormComponentType::TEXTFIELD, - OBJ_FM_BUTTON = 300 + css::form::FormComponentType::COMMANDBUTTON, - OBJ_FM_FIXEDTEXT = 300 + css::form::FormComponentType::FIXEDTEXT, - OBJ_FM_LISTBOX = 300 + css::form::FormComponentType::LISTBOX, - OBJ_FM_CHECKBOX = 300 + css::form::FormComponentType::CHECKBOX, - OBJ_FM_COMBOBOX = 300 + css::form::FormComponentType::COMBOBOX, - OBJ_FM_RADIOBUTTON = 300 + css::form::FormComponentType::RADIOBUTTON, - OBJ_FM_GROUPBOX = 300 + css::form::FormComponentType::GROUPBOX, - OBJ_FM_GRID = 300 + css::form::FormComponentType::GRIDCONTROL, - OBJ_FM_IMAGEBUTTON = 300 + css::form::FormComponentType::IMAGEBUTTON, - OBJ_FM_FILECONTROL = 300 + css::form::FormComponentType::FILECONTROL, - OBJ_FM_DATEFIELD = 300 + css::form::FormComponentType::DATEFIELD, - OBJ_FM_TIMEFIELD = 300 + css::form::FormComponentType::TIMEFIELD, - OBJ_FM_NUMERICFIELD = 300 + css::form::FormComponentType::NUMERICFIELD, - OBJ_FM_CURRENCYFIELD = 300 + css::form::FormComponentType::CURRENCYFIELD, - OBJ_FM_PATTERNFIELD = 300 + css::form::FormComponentType::PATTERNFIELD, - OBJ_FM_HIDDEN = 300 + css::form::FormComponentType::HIDDENCONTROL, - OBJ_FM_IMAGECONTROL = 300 + css::form::FormComponentType::IMAGECONTROL, - OBJ_FM_FORMATTEDFIELD = 300 + css::form::FormComponentType::PATTERNFIELD + 1, - OBJ_FM_SCROLLBAR = 300 + css::form::FormComponentType::PATTERNFIELD + 2, - OBJ_FM_SPINBUTTON = 300 + css::form::FormComponentType::PATTERNFIELD + 3, - OBJ_FM_NAVIGATIONBAR = 300 + css::form::FormComponentType::PATTERNFIELD + 4, + FormControl = 300 + css::form::FormComponentType::CONTROL, + FormEdit = 300 + css::form::FormComponentType::TEXTFIELD, + FormButton = 300 + css::form::FormComponentType::COMMANDBUTTON, + FormFixedText = 300 + css::form::FormComponentType::FIXEDTEXT, + FormListbox = 300 + css::form::FormComponentType::LISTBOX, + FormCheckbox = 300 + css::form::FormComponentType::CHECKBOX, + FormCombobox = 300 + css::form::FormComponentType::COMBOBOX, + FormRadioButton = 300 + css::form::FormComponentType::RADIOBUTTON, + FormGroupBox = 300 + css::form::FormComponentType::GROUPBOX, + FormGrid = 300 + css::form::FormComponentType::GRIDCONTROL, + FormImageButton = 300 + css::form::FormComponentType::IMAGEBUTTON, + FormFileControl = 300 + css::form::FormComponentType::FILECONTROL, + FormDateField = 300 + css::form::FormComponentType::DATEFIELD, + FormTimeField = 300 + css::form::FormComponentType::TIMEFIELD, + FormNumericField = 300 + css::form::FormComponentType::NUMERICFIELD, + FormCurrencyField = 300 + css::form::FormComponentType::CURRENCYFIELD, + FormPatternField = 300 + css::form::FormComponentType::PATTERNFIELD, + FormHidden = 300 + css::form::FormComponentType::HIDDENCONTROL, + FormImageControl = 300 + css::form::FormComponentType::IMAGECONTROL, + FormFormattedField = 300 + css::form::FormComponentType::PATTERNFIELD + 1, + FormScrollbar = 300 + css::form::FormComponentType::PATTERNFIELD + 2, + FormSpinButton = 300 + css::form::FormComponentType::PATTERNFIELD + 3, + FormNavigationBar = 300 + css::form::FormComponentType::PATTERNFIELD + 4, // basctl, arbitrarily place at 400 - OBJ_DLG_CONTROL = 401, - OBJ_DLG_DIALOG = 402, - OBJ_DLG_PUSHBUTTON = 403, - OBJ_DLG_RADIOBUTTON = 404, - OBJ_DLG_CHECKBOX = 405, - OBJ_DLG_LISTBOX = 406, - OBJ_DLG_COMBOBOX = 407, - OBJ_DLG_GROUPBOX = 408, - OBJ_DLG_EDIT = 409, - OBJ_DLG_FIXEDTEXT = 410, - OBJ_DLG_IMAGECONTROL = 411, - OBJ_DLG_PROGRESSBAR = 412, - OBJ_DLG_HSCROLLBAR = 413, - OBJ_DLG_VSCROLLBAR = 414, - OBJ_DLG_HFIXEDLINE = 415, - OBJ_DLG_VFIXEDLINE = 416, - OBJ_DLG_DATEFIELD = 417, - OBJ_DLG_TIMEFIELD = 418, - OBJ_DLG_NUMERICFIELD = 419, - OBJ_DLG_CURRENCYFIELD = 420, - OBJ_DLG_FORMATTEDFIELD = 421, - OBJ_DLG_PATTERNFIELD = 422, - OBJ_DLG_FILECONTROL = 423, - OBJ_DLG_TREECONTROL = 424, - OBJ_DLG_SPINBUTTON = 425, - OBJ_DLG_GRIDCONTROL = 426, - OBJ_DLG_HYPERLINKCONTROL = 427, + BasicDialogControl = 401, + BasicDialogDialog = 402, + BasicDialogPushButton = 403, + BasicDialogRadioButton = 404, + BasicDialogCheckbox = 405, + BasicDialogListbox = 406, + BasicDialogCombobox = 407, + BasicDialogGroupBox = 408, + BasicDialogEdit = 409, + BasicDialogFixedText = 410, + BasicDialogImageControl = 411, + BasicDialogProgressbar = 412, + BasicDialogHorizontalScrollbar = 413, + BasicDialogVerticalScrollbar = 414, + BasicDialogHorizontalFixedLine = 415, + BasicDialogVerticalFixedLine = 416, + BasicDialogDateField = 417, + BasicDialogTimeField = 418, + BasicDialogNumericField = 419, + BasicDialogCurencyField = 420, + BasicDialogFormattedField = 421, + BasicDialogPatternField = 422, + BasicDialogFileControl = 423, + BasicDialogTreeControl = 424, + BasicDialogSpinButton = 425, + BasicDialogGridControl = 426, + BasicDialogHyperlinkControl = 427, - OBJ_DLG_FORMRADIO = 428, - OBJ_DLG_FORMCHECK = 429, - OBJ_DLG_FORMLIST = 430, - OBJ_DLG_FORMCOMBO = 431, - OBJ_DLG_FORMSPIN = 432, - OBJ_DLG_FORMVSCROLL = 433, - OBJ_DLG_FORMHSCROLL = 434, + BasicDialogFormRadio = 428, + BasicDialogFormCheck = 429, + BasicDialogFormList = 430, + BasicDialogFormCombo = 431, + BasicDialogFormSpin = 432, + BasicDialogFormVerticalScroll = 433, + BasicDialogFormHorizontalScroll = 434, // reportdesign, arbitrarily place at 500 - OBJ_RD_FIXEDTEXT = 501, - OBJ_RD_IMAGECONTROL = 502, - OBJ_RD_FORMATTEDFIELD = 503, - OBJ_RD_HFIXEDLINE = 504, - OBJ_RD_VFIXEDLINE = 505, - OBJ_RD_SUBREPORT = 506, + ReportDesignFixedText = 501, + ReportDesignImageControl = 502, + ReportDesignFormattedField = 503, + ReportDesignHorizontalFixedLine = 504, + ReportDesignVerticalFixedLine = 505, + ReportDesignSubReport = 506, // writer, arbitrarily place at 600 SwFlyDrawObjIdentifier = 601 }; +inline constexpr bool IsInventorE3D(SdrObjKind e) +{ + return e >= SdrObjKind::E3D_INVENTOR_FIRST && e <= SdrObjKind::E3D_INVENTOR_LAST; +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/svdopath.hxx b/include/svx/svdopath.hxx index fc7280670c97..dd854468bb3f 100644 --- a/include/svx/svdopath.hxx +++ b/include/svx/svdopath.hxx @@ -143,10 +143,10 @@ public: void NbcSetPathPoly(const basegfx::B2DPolyPolygon& rPathPoly); // special functions for Bezier-polygon handling - bool IsClosed() const { return meKind==OBJ_POLY || meKind==OBJ_PATHPOLY || meKind==OBJ_PATHFILL || meKind==OBJ_FREEFILL || meKind==OBJ_SPLNFILL; } - bool IsLine() const { return meKind==OBJ_PLIN || meKind==OBJ_PATHPLIN || meKind==OBJ_PATHLINE || meKind==OBJ_FREELINE || meKind==OBJ_SPLNLINE || meKind==OBJ_LINE; } - bool IsBezier() const { return meKind==OBJ_PATHLINE || meKind==OBJ_PATHFILL; } - bool IsSpline() const { return meKind==OBJ_SPLNLINE || meKind==OBJ_SPLNFILL; } + bool IsClosed() const { return meKind==SdrObjKind::Polygon || meKind==SdrObjKind::PathPoly || meKind==SdrObjKind::PathFill || meKind==SdrObjKind::FreehandFill || meKind==SdrObjKind::SplineFill; } + bool IsLine() const { return meKind==SdrObjKind::PolyLine || meKind==SdrObjKind::PathPolyLine || meKind==SdrObjKind::PathLine || meKind==SdrObjKind::FreehandLine || meKind==SdrObjKind::SplineLine || meKind==SdrObjKind::Line; } + bool IsBezier() const { return meKind==SdrObjKind::PathLine || meKind==SdrObjKind::PathFill; } + bool IsSpline() const { return meKind==SdrObjKind::SplineLine || meKind==SdrObjKind::SplineFill; } // close/open path // if opening, move end point by "nOpenDistance" diff --git a/include/svx/svdotext.hxx b/include/svx/svdotext.hxx index d192552d16ad..03c828db7493 100644 --- a/include/svx/svdotext.hxx +++ b/include/svx/svdotext.hxx @@ -184,9 +184,9 @@ protected: SdrOutliner* mpEditingOutliner; // Possible values for eTextKind are: - // OBJ_TEXT regular text frame - // OBJ_TITLETEXT TitleText for presentations - // OBJ_OUTLINETEXT OutlineText for presentations + // SdrObjKind::Text regular text frame + // SdrObjKind::TitleText TitleText for presentations + // SdrObjKind::OutlineText OutlineText for presentations // eTextKind only has meaning when bTextFrame=sal_True, since otherwise // we're dealing with a labeled graphical object SdrObjKind meTextKind; @@ -332,7 +332,7 @@ public: virtual bool NbcAdjustTextFrameWidthAndHeight(bool bHgt = true, bool bWdt = true); virtual bool AdjustTextFrameWidthAndHeight(); bool IsTextFrame() const { return mbTextFrame; } - bool IsOutlText() const { return mbTextFrame && (meTextKind==OBJ_OUTLINETEXT || meTextKind==OBJ_TITLETEXT); } + bool IsOutlText() const { return mbTextFrame && (meTextKind==SdrObjKind::OutlineText || meTextKind==SdrObjKind::TitleText); } /// returns true if the PPT autofit of text into shape bounds is enabled. implies IsFitToSize()==false! bool IsAutoFit() const; /// returns true if the old feature for fitting shape content should into shape is enabled. implies IsAutoFit()==false! diff --git a/include/svx/unoapi.hxx b/include/svx/unoapi.hxx index 3c9e04d46af1..3107a483579d 100644 --- a/include/svx/unoapi.hxx +++ b/include/svx/unoapi.hxx @@ -34,6 +34,7 @@ class SdrPage; class SvxNumBulletItem; class SfxItemPool; enum class SdrInventor : sal_uInt32; +enum class SdrObjKind : sal_uInt16; /** * Creates a StarOffice API wrapper with the given type and inventor @@ -41,7 +42,7 @@ enum class SdrInventor : sal_uInt32; * * @throws css::uno::RuntimeException */ -SVXCORE_DLLPUBLIC rtl::Reference<SvxShape> CreateSvxShapeByTypeAndInventor(sal_uInt16 nType, SdrInventor nInventor, OUString const & referer); +SVXCORE_DLLPUBLIC rtl::Reference<SvxShape> CreateSvxShapeByTypeAndInventor(SdrObjKind nType, SdrInventor nInventor, OUString const & referer); /** Returns a StarOffice API wrapper for the given SdrObject */ SVXCORE_DLLPUBLIC css::uno::Reference< css::drawing::XShape > GetXShapeForSdrObject( SdrObject* pObj ) noexcept; diff --git a/include/svx/unopage.hxx b/include/svx/unopage.hxx index 4b00244a7b17..e69eb7ec8995 100644 --- a/include/svx/unopage.hxx +++ b/include/svx/unopage.hxx @@ -88,7 +88,7 @@ class SVXCORE_DLLPUBLIC SvxDrawPage : protected cppu::BaseMutex, virtual SdrObject *CreateSdrObject_( const css::uno::Reference< css::drawing::XShape >& xShape ); /// @throws css::uno::RuntimeException - static rtl::Reference<SvxShape> CreateShapeByTypeAndInventor( sal_uInt16 nType, SdrInventor nInventor, SdrObject *pObj, SvxDrawPage *pPage = nullptr, OUString const & referer = OUString() ); + static rtl::Reference<SvxShape> CreateShapeByTypeAndInventor( SdrObjKind nType, SdrInventor nInventor, SdrObject *pObj, SvxDrawPage *pPage = nullptr, OUString const & referer = OUString() ); // The following method is called if a SvxShape object is to be created. // Derived classes can create a derivation or an SvxShape aggregating object. diff --git a/include/svx/unoprov.hxx b/include/svx/unoprov.hxx index 0b03c7732bbc..f7ee83979f0d 100644 --- a/include/svx/unoprov.hxx +++ b/include/svx/unoprov.hxx @@ -27,22 +27,21 @@ #include <editeng/unoipset.hxx> #include <rtl/ref.hxx> #include <memory> - +#include <optional> class SvxItemPropertySet; class SfxItemPool; +enum class SdrObjKind : sal_uInt16; /** * class UHashMap */ - -#define UHASHMAP_NOTFOUND sal::static_int_cast< sal_uInt32 >(~0) class UHashMap { UHashMap() = delete; public: - static sal_uInt32 getId( const OUString& rCompareString ); - static OUString getNameFromId (sal_uInt32 nId); + static std::optional<SdrObjKind> getId( const OUString& rCompareString ); + static OUString getNameFromId (SdrObjKind nId); static css::uno::Sequence< OUString > getServiceNames(); }; @@ -93,12 +92,6 @@ public: }; /** - * Globals - */ - -#define E3D_INVENTOR_FLAG (0x80000000) - -/** * class SvxPropertySetInfoPool */ diff --git a/include/svx/unoshape.hxx b/include/svx/unoshape.hxx index 20cbf28f6d89..a6ebdeed682d 100644 --- a/include/svx/unoshape.hxx +++ b/include/svx/unoshape.hxx @@ -210,8 +210,8 @@ public: svx::PropertyChangeNotifier& getShapePropertyChangeNotifier(); - void setShapeKind( sal_uInt32 nKind ); - sal_uInt32 getShapeKind() const; + void setShapeKind( SdrObjKind nKind ); + SdrObjKind getShapeKind() const; // styles need this static bool SetFillAttribute( sal_uInt16 nWID, const OUString& rName, SfxItemSet& rSet, SdrModel const * pModel ); diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index c35bc9b02220..55cea6049c83 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -5410,7 +5410,7 @@ void DrawingML::WriteFromTo(const uno::Reference<css::drawing::XShape>& rXShape, sal_Int16 nHalfWidth = aSize.Width / 2; sal_Int16 nHalfHeight = aSize.Height / 2; // aTopLeft needs correction for rotated customshapes - if (pObj->GetObjIdentifier() == OBJ_CUSTOMSHAPE) + if (pObj->GetObjIdentifier() == SdrObjKind::CustomShape) { // Center of bounding box of the rotated shape const auto aSnapRectCenter(pObj->GetSnapRect().Center()); diff --git a/reportdesign/inc/RptDef.hxx b/reportdesign/inc/RptDef.hxx index 91fff4ae2342..9d60fe3594aa 100644 --- a/reportdesign/inc/RptDef.hxx +++ b/reportdesign/inc/RptDef.hxx @@ -74,7 +74,7 @@ typedef std::map<OUString, TPropertyConverter> TPropertyNamePair; /** returns the property name map for the given property id @param _nObjectId the object id */ -REPORTDESIGN_DLLPUBLIC const TPropertyNamePair& getPropertyNameMap(sal_uInt16 _nObjectId); +REPORTDESIGN_DLLPUBLIC const TPropertyNamePair& getPropertyNameMap(SdrObjKind _nObjectId); REPORTDESIGN_DLLPUBLIC css::uno::Reference< css::style::XStyle> getUsedStyle(const css::uno::Reference< css::report::XReportDefinition>& _xReport); template < typename T> T getStyleProperty(const css::uno::Reference< css::report::XReportDefinition>& _xReport,const OUString& _sPropertyName) diff --git a/reportdesign/source/core/sdr/ReportDrawPage.cxx b/reportdesign/source/core/sdr/ReportDrawPage.cxx index 1823c3c07527..abb56f534a58 100644 --- a/reportdesign/source/core/sdr/ReportDrawPage.cxx +++ b/reportdesign/source/core/sdr/ReportDrawPage.cxx @@ -78,14 +78,14 @@ uno::Reference< drawing::XShape > OReportDrawPage::CreateShape( SdrObject *pObj if (dynamic_cast< const OUnoObject* >(pObj) != nullptr) { OUnoObject& rUnoObj = dynamic_cast<OUnoObject&>(*pObj); - if (rUnoObj.GetObjIdentifier() == OBJ_RD_FIXEDTEXT) + if (rUnoObj.GetObjIdentifier() == SdrObjKind::ReportDesignFixedText) { uno::Reference<beans::XPropertySet> xControlModel(rUnoObj.GetUnoControlModel(),uno::UNO_QUERY); if ( xControlModel.is() ) xControlModel->setPropertyValue( PROPERTY_MULTILINE,uno::makeAny(true)); } else - bChangeOrientation = rUnoObj.GetObjIdentifier() == OBJ_RD_HFIXEDLINE; + bChangeOrientation = rUnoObj.GetObjIdentifier() == SdrObjKind::ReportDesignHorizontalFixedLine; rtl::Reference<SvxShapeControl> pShape = new SvxShapeControl( pObj ); xShape = static_cast<SvxShape_UnoImplHelper *>(pShape.get()); pShape->setShapeKind(pObj->GetObjIdentifier()); diff --git a/reportdesign/source/core/sdr/RptObject.cxx b/reportdesign/source/core/sdr/RptObject.cxx index e3cfb19d9037..dd83ccef4ba6 100644 --- a/reportdesign/source/core/sdr/RptObject.cxx +++ b/reportdesign/source/core/sdr/RptObject.cxx @@ -63,26 +63,26 @@ SdrObjKind OObjectBase::getObjectType(const uno::Reference< report::XReportCompo uno::Reference< lang::XServiceInfo > xServiceInfo( _xComponent , uno::UNO_QUERY ); OSL_ENSURE(xServiceInfo.is(),"Who deletes the XServiceInfo interface!"); if ( !xServiceInfo ) - return OBJ_NONE; + return SdrObjKind::NONE; if ( xServiceInfo->supportsService( SERVICE_FIXEDTEXT )) - return OBJ_RD_FIXEDTEXT; + return SdrObjKind::ReportDesignFixedText; if ( xServiceInfo->supportsService( SERVICE_FIXEDLINE )) { uno::Reference< report::XFixedLine> xFixedLine(_xComponent,uno::UNO_QUERY); - return xFixedLine->getOrientation() ? OBJ_RD_HFIXEDLINE : OBJ_RD_VFIXEDLINE; + return xFixedLine->getOrientation() ? SdrObjKind::ReportDesignHorizontalFixedLine : SdrObjKind::ReportDesignVerticalFixedLine; } if ( xServiceInfo->supportsService( SERVICE_IMAGECONTROL)) - return OBJ_RD_IMAGECONTROL; + return SdrObjKind::ReportDesignImageControl; if ( xServiceInfo->supportsService( SERVICE_FORMATTEDFIELD )) - return OBJ_RD_FORMATTEDFIELD; + return SdrObjKind::ReportDesignFormattedField; if ( xServiceInfo->supportsService("com.sun.star.drawing.OLE2Shape") ) - return OBJ_OLE2; + return SdrObjKind::OLE2; if ( xServiceInfo->supportsService( SERVICE_SHAPE )) - return OBJ_CUSTOMSHAPE; + return SdrObjKind::CustomShape; if ( xServiceInfo->supportsService( SERVICE_REPORTDEFINITION ) ) - return OBJ_RD_SUBREPORT; - return OBJ_OLE2; + return SdrObjKind::ReportDesignSubReport; + return SdrObjKind::OLE2; } SdrObject* OObjectBase::createObject( @@ -93,13 +93,13 @@ SdrObject* OObjectBase::createObject( SdrObjKind nType = OObjectBase::getObjectType(_xComponent); switch( nType ) { - case OBJ_RD_FIXEDTEXT: + case SdrObjKind::ReportDesignFixedText: { OUnoObject* pUnoObj = new OUnoObject( rTargetModel, _xComponent, OUString("com.sun.star.form.component.FixedText"), - OBJ_RD_FIXEDTEXT); + SdrObjKind::ReportDesignFixedText); pNewObj = pUnoObj; uno::Reference<beans::XPropertySet> xControlModel(pUnoObj->GetUnoControlModel(),uno::UNO_QUERY); @@ -107,29 +107,29 @@ SdrObject* OObjectBase::createObject( xControlModel->setPropertyValue( PROPERTY_MULTILINE,uno::makeAny(true)); } break; - case OBJ_RD_IMAGECONTROL: + case SdrObjKind::ReportDesignImageControl: pNewObj = new OUnoObject( rTargetModel, _xComponent, OUString("com.sun.star.form.component.DatabaseImageControl"), - OBJ_RD_IMAGECONTROL); + SdrObjKind::ReportDesignImageControl); break; - case OBJ_RD_FORMATTEDFIELD: + case SdrObjKind::ReportDesignFormattedField: pNewObj = new OUnoObject( rTargetModel, _xComponent, OUString("com.sun.star.form.component.FormattedField"), - OBJ_RD_FORMATTEDFIELD); + SdrObjKind::ReportDesignFormattedField); break; - case OBJ_RD_HFIXEDLINE: - case OBJ_RD_VFIXEDLINE: + case SdrObjKind::ReportDesignHorizontalFixedLine: + case SdrObjKind::ReportDesignVerticalFixedLine: pNewObj = new OUnoObject( rTargetModel, _xComponent, OUString("com.sun.star.awt.UnoControlFixedLineModel"), nType); break; - case OBJ_CUSTOMSHAPE: + case SdrObjKind::CustomShape: pNewObj = OCustomShape::Create( rTargetModel, _xComponent); @@ -144,8 +144,8 @@ SdrObject* OObjectBase::createObject( DBG_UNHANDLED_EXCEPTION("reportdesign"); } break; - case OBJ_RD_SUBREPORT: - case OBJ_OLE2: + case SdrObjKind::ReportDesignSubReport: + case SdrObjKind::OLE2: pNewObj = OOle2Obj::Create( rTargetModel, _xComponent, @@ -222,11 +222,11 @@ namespace }; } -const TPropertyNamePair& getPropertyNameMap(sal_uInt16 _nObjectId) +const TPropertyNamePair& getPropertyNameMap(SdrObjKind _nObjectId) { switch(_nObjectId) { - case OBJ_RD_IMAGECONTROL: + case SdrObjKind::ReportDesignImageControl: { static TPropertyNamePair s_aNameMap = []() { @@ -240,7 +240,7 @@ const TPropertyNamePair& getPropertyNameMap(sal_uInt16 _nObjectId) return s_aNameMap; } - case OBJ_RD_FIXEDTEXT: + case SdrObjKind::ReportDesignFixedText: { static TPropertyNamePair s_aNameMap = []() { @@ -262,7 +262,7 @@ const TPropertyNamePair& getPropertyNameMap(sal_uInt16 _nObjectId) }(); return s_aNameMap; } - case OBJ_RD_FORMATTEDFIELD: + case SdrObjKind::ReportDesignFormattedField: { static TPropertyNamePair s_aNameMap = []() { @@ -284,7 +284,7 @@ const TPropertyNamePair& getPropertyNameMap(sal_uInt16 _nObjectId) return s_aNameMap; } - case OBJ_CUSTOMSHAPE: + case SdrObjKind::CustomShape: { static TPropertyNamePair s_aNameMap = []() { @@ -477,7 +477,7 @@ OCustomShape::~OCustomShape() SdrObjKind OCustomShape::GetObjIdentifier() const { - return OBJ_CUSTOMSHAPE; + return SdrObjKind::CustomShape; } SdrInventor OCustomShape::GetObjInventor() const diff --git a/reportdesign/source/ui/inc/DesignView.hxx b/reportdesign/source/ui/inc/DesignView.hxx index 15a7d2ed25b8..def0495c1b2e 100644 --- a/reportdesign/source/ui/inc/DesignView.hxx +++ b/reportdesign/source/ui/inc/DesignView.hxx @@ -131,7 +131,7 @@ namespace rptui /** All objects will be marked. */ - void SelectAll(const sal_uInt16 _nObjectType); + void SelectAll(const SdrObjKind _nObjectType); /// checks if a selection exists bool HasSelection() const; diff --git a/reportdesign/source/ui/inc/ReportController.hxx b/reportdesign/source/ui/inc/ReportController.hxx index cb86ce7cf235..726ac8012370 100644 --- a/reportdesign/source/ui/inc/ReportController.hxx +++ b/reportdesign/source/ui/inc/ReportController.hxx @@ -126,7 +126,7 @@ namespace rptui * \param _xSection the section where to create the formatted field * \param _sFunction the function which will be set at the data field. */ - void createControl(const css::uno::Sequence< css::beans::PropertyValue >& _aArgs,const css::uno::Reference< css::report::XSection>& _xSection,const OUString& _sFunction ,SdrObjKind _nObjectId = OBJ_RD_FORMATTEDFIELD); + void createControl(const css::uno::Sequence< css::beans::PropertyValue >& _aArgs,const css::uno::Reference< css::report::XSection>& _xSection,const OUString& _sFunction ,SdrObjKind _nObjectId = SdrObjKind::ReportDesignFormattedField); /** switch the report header/footer sectionon off with undo or without depending on the given id. * * \param _nId Can either be SID_REPORTHEADER_WITHOUT_UNDO or SID_REPORTFOOTER_WITHOUT_UNDO or SID_REPORTHEADERFOOTER. diff --git a/reportdesign/source/ui/inc/ReportSection.hxx b/reportdesign/source/ui/inc/ReportSection.hxx index ad334f194234..03bb57199bac 100644 --- a/reportdesign/source/ui/inc/ReportSection.hxx +++ b/reportdesign/source/ui/inc/ReportSection.hxx @@ -104,7 +104,7 @@ namespace rptui /** All objects will be marked. */ - void SelectAll(const sal_uInt16 _nObjectType); + void SelectAll(const SdrObjKind _nObjectType); /** makes the grid visible * diff --git a/reportdesign/source/ui/inc/ReportWindow.hxx b/reportdesign/source/ui/inc/ReportWindow.hxx index c634dcf098f4..7e1716384548 100644 --- a/reportdesign/source/ui/inc/ReportWindow.hxx +++ b/reportdesign/source/ui/inc/ReportWindow.hxx @@ -100,7 +100,7 @@ namespace rptui /** All objects will be marked. */ - void SelectAll(const sal_uInt16 _nObjectType); + void SelectAll(const SdrObjKind _nObjectType); /** returns <TRUE/> when an object is marked */ diff --git a/reportdesign/source/ui/inc/ScrollHelper.hxx b/reportdesign/source/ui/inc/ScrollHelper.hxx index eab5c7dd3b8b..076943ff76fc 100644 --- a/reportdesign/source/ui/inc/ScrollHelper.hxx +++ b/reportdesign/source/ui/inc/ScrollHelper.hxx @@ -109,7 +109,7 @@ namespace rptui /** All objects will be marked. */ - void SelectAll(const sal_uInt16 _nObjectType); + void SelectAll(const SdrObjKind _nObjectType); /** returns <TRUE/> when an object is marked */ diff --git a/reportdesign/source/ui/inc/ViewsWindow.hxx b/reportdesign/source/ui/inc/ViewsWindow.hxx index c270aae409fc..f83e28ca8a24 100644 --- a/reportdesign/source/ui/inc/ViewsWindow.hxx +++ b/reportdesign/source/ui/inc/ViewsWindow.hxx @@ -171,7 +171,7 @@ namespace rptui /** All objects will be marked. */ - void SelectAll(const sal_uInt16 _nObjectType); + void SelectAll(const SdrObjKind _nObjectType); /** returns <TRUE/> when an object is marked */ diff --git a/reportdesign/source/ui/misc/UITools.cxx b/reportdesign/source/ui/misc/UITools.cxx index d5f48ca60ad0..066d330df338 100644 --- a/reportdesign/source/ui/misc/UITools.cxx +++ b/reportdesign/source/ui/misc/UITools.cxx @@ -878,7 +878,7 @@ SdrObject* isOver(const tools::Rectangle& _rRect, SdrPage const & _rPage, SdrVie && (_bAllObjects || !_rView.IsObjMarked(pObjIter)) && (dynamic_cast<OUnoObject*>(pObjIter) != nullptr || dynamic_cast<OOle2Obj*>(pObjIter) != nullptr)) { - if (_nIgnoreType == ISOVER_IGNORE_CUSTOMSHAPES && pObjIter->GetObjIdentifier() == OBJ_CUSTOMSHAPE) + if (_nIgnoreType == ISOVER_IGNORE_CUSTOMSHAPES && pObjIter->GetObjIdentifier() == SdrObjKind::CustomShape) { continue; } diff --git a/reportdesign/source/ui/report/DesignView.cxx b/reportdesign/source/ui/report/DesignView.cxx index c77c6d5a8eaa..ab213479b9f6 100644 --- a/reportdesign/source/ui/report/DesignView.cxx +++ b/reportdesign/source/ui/report/DesignView.cxx @@ -92,7 +92,7 @@ ODesignView::ODesignView( vcl::Window* pParent, ,m_pCurrentView(nullptr) ,m_aMarkIdle("reportdesign ODesignView Mark Idle") ,m_eMode( DlgEdMode::Select ) - ,m_eActObj( OBJ_NONE ) + ,m_eActObj( SdrObjKind::NONE ) ,m_aGridSizeCoarse( 1000, 1000 ) // #i93595# 100TH_MM changed to grid using coarse 1 cm grid ,m_aGridSizeFine( 250, 250 ) // and a 0,25 cm subdivision for better visualisation ,m_bDeleted( false ) @@ -287,7 +287,7 @@ void ODesignView::SetMode( DlgEdMode _eNewMode ) { m_eMode = _eNewMode; if ( m_eMode == DlgEdMode::Select ) - m_eActObj = OBJ_NONE; + m_eActObj = SdrObjKind::NONE; m_aScrollWindow->SetMode(_eNewMode); } @@ -413,7 +413,7 @@ IMPL_LINK_NOARG( ODesignView, SplitHdl, SplitWindow*, void ) } } -void ODesignView::SelectAll(const sal_uInt16 _nObjectType) +void ODesignView::SelectAll(const SdrObjKind _nObjectType) { m_aScrollWindow->SelectAll(_nObjectType); } diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx index d81d100bc129..9e1df7251c9d 100644 --- a/reportdesign/source/ui/report/ReportController.cxx +++ b/reportdesign/source/ui/report/ReportController.cxx @@ -598,27 +598,27 @@ FeatureState OReportController::GetState(sal_uInt16 _nId) const case SID_INSERT_DIAGRAM: aReturn.bEnabled = isEditable(); aReturn.bInvisible = !m_bChartEnabled; - aReturn.bChecked = getDesignView()->GetInsertObj() == OBJ_OLE2; + aReturn.bChecked = getDesignView()->GetInsertObj() == SdrObjKind::OLE2; break; case SID_FM_FIXEDTEXT: aReturn.bEnabled = isEditable(); - aReturn.bChecked = getDesignView()->GetInsertObj() == OBJ_RD_FIXEDTEXT; + aReturn.bChecked = getDesignView()->GetInsertObj() == SdrObjKind::ReportDesignFixedText; break; case SID_INSERT_HFIXEDLINE: aReturn.bEnabled = isEditable(); - aReturn.bChecked = getDesignView()->GetInsertObj() == OBJ_RD_HFIXEDLINE; + aReturn.bChecked = getDesignView()->GetInsertObj() == SdrObjKind::ReportDesignHorizontalFixedLine; break; case SID_INSERT_VFIXEDLINE: aReturn.bEnabled = isEditable(); - aReturn.bChecked = getDesignView()->GetInsertObj() == OBJ_RD_VFIXEDLINE; + aReturn.bChecked = getDesignView()->GetInsertObj() == SdrObjKind::ReportDesignVerticalFixedLine; break; case SID_FM_EDIT: aReturn.bEnabled = isEditable(); - aReturn.bChecked = getDesignView()->GetInsertObj() == OBJ_RD_FORMATTEDFIELD; + aReturn.bChecked = getDesignView()->GetInsertObj() == SdrObjKind::ReportDesignFormattedField; break; case SID_FM_IMAGECONTROL: aReturn.bEnabled = isEditable(); - aReturn.bChecked = getDesignView()->GetInsertObj() == OBJ_RD_IMAGECONTROL; + aReturn.bChecked = getDesignView()->GetInsertObj() == SdrObjKind::ReportDesignImageControl; break; case SID_DRAWTBX_CS_BASIC: case SID_DRAWTBX_CS_BASIC1: @@ -1104,7 +1104,7 @@ void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue > break; case SID_SELECTALL: - getDesignView()->SelectAll(OBJ_NONE); + getDesignView()->SelectAll(SdrObjKind::NONE); break; case SID_SELECTALL_IN_SECTION: { @@ -1118,10 +1118,10 @@ void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue > InvalidateFeature( SID_OBJECT_SELECT ); break; case SID_SELECT_ALL_EDITS: - getDesignView()->SelectAll(OBJ_RD_FORMATTEDFIELD); + getDesignView()->SelectAll(SdrObjKind::ReportDesignFormattedField); break; case SID_SELECT_ALL_LABELS: - getDesignView()->SelectAll(OBJ_RD_FIXEDTEXT); + getDesignView()->SelectAll(SdrObjKind::ReportDesignFixedText); break; case SID_TERMINATE_INPLACEACTIVATION: { @@ -1196,37 +1196,37 @@ void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue > break; case SID_INSERT_DIAGRAM: getDesignView()->SetMode( DlgEdMode::Insert ); - getDesignView()->SetInsertObj( OBJ_OLE2); + getDesignView()->SetInsertObj( SdrObjKind::OLE2); createDefaultControl(aArgs); InvalidateAll(); break; case SID_FM_FIXEDTEXT: getDesignView()->SetMode( DlgEdMode::Insert ); - getDesignView()->SetInsertObj( OBJ_RD_FIXEDTEXT ); + getDesignView()->SetInsertObj( SdrObjKind::ReportDesignFixedText ); createDefaultControl(aArgs); InvalidateAll(); break; case SID_INSERT_HFIXEDLINE: getDesignView()->SetMode( DlgEdMode::Insert ); - getDesignView()->SetInsertObj( OBJ_RD_HFIXEDLINE ); + getDesignView()->SetInsertObj( SdrObjKind::ReportDesignHorizontalFixedLine ); createDefaultControl(aArgs); InvalidateAll(); break; case SID_INSERT_VFIXEDLINE: getDesignView()->SetMode( DlgEdMode::Insert ); - getDesignView()->SetInsertObj( OBJ_RD_VFIXEDLINE ); + getDesignView()->SetInsertObj( SdrObjKind::ReportDesignVerticalFixedLine ); createDefaultControl(aArgs); InvalidateAll(); break; case SID_FM_EDIT: getDesignView()->SetMode( DlgEdMode::Insert ); - getDesignView()->SetInsertObj( OBJ_RD_FORMATTEDFIELD ); + getDesignView()->SetInsertObj( SdrObjKind::ReportDesignFormattedField ); createDefaultControl(aArgs); InvalidateAll(); break; case SID_FM_IMAGECONTROL: getDesignView()->SetMode( DlgEdMode::Insert ); - getDesignView()->SetInsertObj( OBJ_RD_IMAGECONTROL ); + getDesignView()->SetInsertObj( SdrObjKind::ReportDesignImageControl ); createDefaultControl(aArgs); InvalidateAll(); break; @@ -1380,7 +1380,7 @@ void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue > else sType = aUrl.Complete.getToken(0,'.',nIndex); - getDesignView()->SetInsertObj( OBJ_CUSTOMSHAPE ,sType); + getDesignView()->SetInsertObj( SdrObjKind::CustomShape ,sType); createDefaultControl(aArgs); } InvalidateAll(); @@ -3010,7 +3010,7 @@ void OReportController::insertGraphic() { PROPERTY_IMAGEURL, Any(aDialog.GetPath()) }, { PROPERTY_PRESERVEIRI, Any(bLink) } })); - createControl(aArgs,xSection,OUString(),OBJ_RD_IMAGECONTROL); + createControl(aArgs,xSection,OUString(),SdrObjKind::ReportDesignImageControl); } } catch(const Exception&) @@ -3115,7 +3115,7 @@ void OReportController::createControl(const Sequence< PropertyValue >& _aArgs,co SdrObject* pNewControl = nullptr; uno::Reference< report::XReportComponent> xShapeProp; - if ( _nObjectId == OBJ_CUSTOMSHAPE ) + if ( _nObjectId == SdrObjKind::CustomShape ) { pNewControl = SdrObjFactory::MakeNewObject( *m_aReportModel, @@ -3128,7 +3128,7 @@ void OReportController::createControl(const Sequence< PropertyValue >& _aArgs,co OReportSection::createDefault(sCustomShapeType,pNewControl); pNewControl->SetLogicRect(tools::Rectangle(3000,500,6000,3500)); // switch height and width } - else if ( _nObjectId == OBJ_OLE2 || OBJ_RD_SUBREPORT == _nObjectId ) + else if ( _nObjectId == SdrObjKind::OLE2 || SdrObjKind::ReportDesignSubReport == _nObjectId ) { pNewControl = SdrObjFactory::MakeNewObject( *m_aReportModel, @@ -3156,7 +3156,7 @@ void OReportController::createControl(const Sequence< PropertyValue >& _aArgs,co nullptr, _nObjectId, SdrInventor::ReportDesign, - OBJ_RD_FIXEDTEXT, + SdrObjKind::ReportDesignFixedText, // tdf#118963 Need a SdrModel for SdrObject creation. Dereferencing // m_aReportModel seems pretty safe, it's done in other places, initialized @@ -3213,9 +3213,9 @@ void OReportController::createControl(const Sequence< PropertyValue >& _aArgs,co pObj->CreateMediator(true); - if ( _nObjectId == OBJ_RD_FIXEDTEXT ) // special case for fixed text + if ( _nObjectId == SdrObjKind::ReportDesignFixedText ) // special case for fixed text xUnoProp->setPropertyValue(PROPERTY_LABEL,uno::makeAny(OUnoObject::GetDefaultName(pObj))); - else if ( _nObjectId == OBJ_RD_VFIXEDLINE ) + else if ( _nObjectId == SdrObjKind::ReportDesignVerticalFixedLine ) { awt::Size aOlSize = xShapeProp->getSize(); xShapeProp->setSize(awt::Size(aOlSize.Height,aOlSize.Width)); // switch height and width @@ -3424,7 +3424,7 @@ void OReportController::addPairControls(const Sequence< PropertyValue >& aArgs) if ( !xField.is() ) continue; - SdrObjKind nOBJID = OBJ_NONE; + SdrObjKind nOBJID = SdrObjKind::NONE; sal_Int32 nDataType = sdbc::DataType::BINARY; xField->getPropertyValue(PROPERTY_TYPE) >>= nDataType; switch ( nDataType ) @@ -3432,14 +3432,14 @@ void OReportController::addPairControls(const Sequence< PropertyValue >& aArgs) case sdbc::DataType::BINARY: case sdbc::DataType::VARBINARY: case sdbc::DataType::LONGVARBINARY: - nOBJID = OBJ_RD_IMAGECONTROL; + nOBJID = SdrObjKind::ReportDesignImageControl; break; default: - nOBJID = OBJ_RD_FORMATTEDFIELD; + nOBJID = SdrObjKind::ReportDesignFormattedField; break; } - if ( !nOBJID ) + if ( nOBJID == SdrObjKind::NONE ) continue; Reference< util::XNumberFormatsSupplier > xSupplier = getReportNumberFormatter()->getNumberFormatsSupplier(); @@ -3463,7 +3463,7 @@ void OReportController::addPairControls(const Sequence< PropertyValue >& aArgs) xNumberFormats, nOBJID, SdrInventor::ReportDesign, - OBJ_RD_FIXEDTEXT, + SdrObjKind::ReportDesignFixedText, // tdf#118963 Need a SdrModel for SdrObject creation. Dereferencing // m_aReportModel seems pretty safe, it's done in other places, initialized @@ -3534,7 +3534,7 @@ void OReportController::addPairControls(const Sequence< PropertyValue >& aArgs) xField->getPropertyValue(PROPERTY_LABEL) >>= sLabel; if (pSectionViews[0] != pSectionViews[1] && - nOBJID == OBJ_RD_FORMATTEDFIELD) // we want this nice feature only at FORMATTEDFIELD + nOBJID == SdrObjKind::ReportDesignFormattedField) // we want this nice feature only at FORMATTEDFIELD { uno::Reference< report::XReportComponent> xShapePropLabel(pObjs[0]->getUnoShape(),uno::UNO_QUERY_THROW); uno::Reference< report::XReportComponent> xShapePropTextField(pObjs[1]->getUnoShape(),uno::UNO_QUERY_THROW); @@ -4182,7 +4182,7 @@ bool OReportController::impl_setPropertyAtControls_throw(TranslateId pUndoResId, void OReportController::impl_fillCustomShapeState_nothrow(const char* _pCustomShapeType,dbaui::FeatureState& _rState) const { _rState.bEnabled = isEditable(); - _rState.bChecked = getDesignView()->GetInsertObj() == OBJ_CUSTOMSHAPE && getDesignView()->GetInsertObjString().equalsAscii(_pCustomShapeType); + _rState.bChecked = getDesignView()->GetInsertObj() == SdrObjKind::CustomShape && getDesignView()->GetInsertObjString().equalsAscii(_pCustomShapeType); } diff --git a/reportdesign/source/ui/report/ReportSection.cxx b/reportdesign/source/ui/report/ReportSection.cxx index 35aff0e6d6b3..57c1bddb2797 100644 --- a/reportdesign/source/ui/report/ReportSection.cxx +++ b/reportdesign/source/ui/report/ReportSection.cxx @@ -391,12 +391,12 @@ void OReportSection::SetGridVisible(bool _bVisible) m_pView->SetGridVisible( _bVisible ); } -void OReportSection::SelectAll(const sal_uInt16 _nObjectType) +void OReportSection::SelectAll(const SdrObjKind _nObjectType) { if ( !m_pView ) return; - if ( _nObjectType == OBJ_NONE ) + if ( _nObjectType == SdrObjKind::NONE ) m_pView->MarkAllObj(); else { diff --git a/reportdesign/source/ui/report/ReportWindow.cxx b/reportdesign/source/ui/report/ReportWindow.cxx index ed6f614b5859..8da0855f6146 100644 --- a/reportdesign/source/ui/report/ReportWindow.cxx +++ b/reportdesign/source/ui/report/ReportWindow.cxx @@ -272,7 +272,7 @@ bool OReportWindow::IsPasteAllowed() const return m_aViewsWindow->IsPasteAllowed(); } -void OReportWindow::SelectAll(const sal_uInt16 _nObjectType) +void OReportWindow::SelectAll(const SdrObjKind _nObjectType) { m_aViewsWindow->SelectAll(_nObjectType); diff --git a/reportdesign/source/ui/report/ScrollHelper.cxx b/reportdesign/source/ui/report/ScrollHelper.cxx index 07dd4fd50016..bf5f261cfd7f 100644 --- a/reportdesign/source/ui/report/ScrollHelper.cxx +++ b/reportdesign/source/ui/report/ScrollHelper.cxx @@ -258,7 +258,7 @@ bool OScrollWindowHelper::IsPasteAllowed() const return m_aReportWindow->IsPasteAllowed(); } -void OScrollWindowHelper::SelectAll(const sal_uInt16 _nObjectType) +void OScrollWindowHelper::SelectAll(const SdrObjKind _nObjectType) { m_aReportWindow->SelectAll(_nObjectType); } diff --git a/reportdesign/source/ui/report/ViewsWindow.cxx b/reportdesign/source/ui/report/ViewsWindow.cxx index 68c110780ce1..f856654fed63 100644 --- a/reportdesign/source/ui/report/ViewsWindow.cxx +++ b/reportdesign/source/ui/report/ViewsWindow.cxx @@ -479,7 +479,7 @@ bool OViewsWindow::IsPasteAllowed() const return aTransferData.HasFormat(OReportExchange::getDescriptorFormatId()); } -void OViewsWindow::SelectAll(const sal_uInt16 _nObjectType) +void OViewsWindow::SelectAll(const SdrObjKind _nObjectType) { m_bInUnmark = true; ::std::for_each(m_aSections.begin(),m_aSections.end(), diff --git a/reportdesign/source/ui/report/dlgedfac.cxx b/reportdesign/source/ui/report/dlgedfac.cxx index ceb2d6402ee5..f7b8a27f64b4 100644 --- a/reportdesign/source/ui/report/dlgedfac.cxx +++ b/reportdesign/source/ui/report/dlgedfac.cxx @@ -49,43 +49,43 @@ IMPL_STATIC_LINK( { switch( aParams.nObjIdentifier ) { - case OBJ_RD_FIXEDTEXT: + case SdrObjKind::ReportDesignFixedText: pNewObj = new OUnoObject(aParams.rSdrModel, SERVICE_FIXEDTEXT ,OUString("com.sun.star.form.component.FixedText") - ,OBJ_RD_FIXEDTEXT); + ,SdrObjKind::ReportDesignFixedText); break; - case OBJ_RD_IMAGECONTROL: + case SdrObjKind::ReportDesignImageControl: pNewObj = new OUnoObject(aParams.rSdrModel, SERVICE_IMAGECONTROL ,OUString("com.sun.star.form.component.DatabaseImageControl") - ,OBJ_RD_IMAGECONTROL); + ,SdrObjKind::ReportDesignImageControl); break; - case OBJ_RD_FORMATTEDFIELD: + case SdrObjKind::ReportDesignFormattedField: pNewObj = new OUnoObject(aParams.rSdrModel, SERVICE_FORMATTEDFIELD ,OUString("com.sun.star.form.component.FormattedField") - ,OBJ_RD_FORMATTEDFIELD); + ,SdrObjKind::ReportDesignFormattedField); break; - case OBJ_RD_VFIXEDLINE: - case OBJ_RD_HFIXEDLINE: + case SdrObjKind::ReportDesignVerticalFixedLine: + case SdrObjKind::ReportDesignHorizontalFixedLine: { OUnoObject* pObj = new OUnoObject(aParams.rSdrModel, SERVICE_FIXEDLINE ,OUString("com.sun.star.awt.UnoControlFixedLineModel") ,aParams.nObjIdentifier); pNewObj = pObj; - if ( aParams.nObjIdentifier == OBJ_RD_HFIXEDLINE ) + if ( aParams.nObjIdentifier == SdrObjKind::ReportDesignHorizontalFixedLine ) { uno::Reference<beans::XPropertySet> xProp = pObj->getAwtComponent(); xProp->setPropertyValue( PROPERTY_ORIENTATION, uno::makeAny(sal_Int32(0)) ); } } break; - case OBJ_CUSTOMSHAPE: + case SdrObjKind::CustomShape: pNewObj = new OCustomShape(aParams.rSdrModel, SERVICE_SHAPE); break; - case OBJ_RD_SUBREPORT: - pNewObj = new OOle2Obj(aParams.rSdrModel, SERVICE_REPORTDEFINITION, OBJ_RD_SUBREPORT); + case SdrObjKind::ReportDesignSubReport: + pNewObj = new OOle2Obj(aParams.rSdrModel, SERVICE_REPORTDEFINITION, SdrObjKind::ReportDesignSubReport); break; - case OBJ_OLE2: - pNewObj = new OOle2Obj(aParams.rSdrModel, "com.sun.star.chart2.ChartDocument", OBJ_OLE2); + case SdrObjKind::OLE2: + pNewObj = new OOle2Obj(aParams.rSdrModel, "com.sun.star.chart2.ChartDocument", SdrObjKind::OLE2); break; default: OSL_FAIL("Unknown object id"); diff --git a/reportdesign/source/ui/report/dlgedfunc.cxx b/reportdesign/source/ui/report/dlgedfunc.cxx index e258f659e05b..a5456ce9865e 100644 --- a/reportdesign/source/ui/report/dlgedfunc.cxx +++ b/reportdesign/source/ui/report/dlgedfunc.cxx @@ -375,11 +375,11 @@ void DlgEdFunc::activateOle(SdrObject* _pObj) if ( !_pObj ) return; - const sal_uInt16 nSdrObjKind = _pObj->GetObjIdentifier(); + const SdrObjKind nSdrObjKind = _pObj->GetObjIdentifier(); // OLE: activate - if (nSdrObjKind != OBJ_OLE2) + if (nSdrObjKind != SdrObjKind::OLE2) return; SdrOle2Obj* pOleObj = dynamic_cast<SdrOle2Obj*>(_pObj); @@ -537,7 +537,7 @@ bool DlgEdFunc::isOnlyCustomShapeMarked() const { SdrMark* pMark = rMarkList.GetMark(i); SdrObject* pObj = pMark->GetMarkedSdrObj(); - if (pObj->GetObjIdentifier() != OBJ_CUSTOMSHAPE) + if (pObj->GetObjIdentifier() != SdrObjKind::CustomShape) { // we found an object in the marked objects, which is not a custom shape. bReturn = false; @@ -597,7 +597,7 @@ bool DlgEdFunc::isRectangleHit(const MouseEvent& rMEvt) } } } - else if (aVEvt.mpObj && (aVEvt.mpObj->GetObjIdentifier() != OBJ_CUSTOMSHAPE) && !m_bSelectionMode) + else if (aVEvt.mpObj && (aVEvt.mpObj->GetObjIdentifier() != SdrObjKind::CustomShape) && !m_bSelectionMode) { colorizeOverlappedObject(aVEvt.mpObj); } @@ -643,11 +643,11 @@ bool DlgEdFuncInsert::MouseButtonDown( const MouseEvent& rMEvt ) return true; SdrViewEvent aVEvt; - sal_Int16 nId = m_rView.GetCurrentObjIdentifier(); + SdrObjKind nId = m_rView.GetCurrentObjIdentifier(); const SdrHitKind eHit = m_rView.PickAnything(rMEvt, SdrMouseEventKind::BUTTONDOWN, aVEvt); - if (eHit == SdrHitKind::UnmarkedObject && nId != OBJ_CUSTOMSHAPE) + if (eHit == SdrHitKind::UnmarkedObject && nId != SdrObjKind::CustomShape) { // there is an object under the mouse cursor, but not a customshape m_pParent->getSectionWindow()->getViewsWindow()->BrkAction(); diff --git a/sc/inc/drwlayer.hxx b/sc/inc/drwlayer.hxx index e71bd6bd0a2d..3c36115b8ee5 100644 --- a/sc/inc/drwlayer.hxx +++ b/sc/inc/drwlayer.hxx @@ -28,6 +28,7 @@ class SfxObjectShell; class ScDrawObjData; class ScMacroInfo; class ScMarkData; +enum class SdrObjKind : sal_uInt16; class ScTabDeletedHint final : public SfxHint { @@ -173,7 +174,7 @@ public: // (ChartListenerCollection etc. must use GetPersistName directly) static OUString GetVisibleName( const SdrObject* pObj ); - SdrObject* GetNamedObject( std::u16string_view rName, sal_uInt16 nId, SCTAB& rFoundTab ) const; + SdrObject* GetNamedObject( std::u16string_view rName, SdrObjKind nId, SCTAB& rFoundTab ) const; // if pnCounter != NULL, the search for a name starts with this index + 1, // and the index really used is returned. OUString GetNewGraphicName( tools::Long* pnCounter = nullptr ) const; diff --git a/sc/qa/unit/helper/qahelper.cxx b/sc/qa/unit/helper/qahelper.cxx index c1d42a2a1a6a..8a8f15bdffae 100644 --- a/sc/qa/unit/helper/qahelper.cxx +++ b/sc/qa/unit/helper/qahelper.cxx @@ -338,7 +338,7 @@ const SdrOle2Obj* getSingleOleObject(ScDocument& rDoc, sal_uInt16 nPage) return nullptr; } - if (pObj->GetObjIdentifier() != OBJ_OLE2) + if (pObj->GetObjIdentifier() != SdrObjKind::OLE2) { cout << "This is not an OLE2 object." << endl; return nullptr; diff --git a/sc/qa/unit/scshapetest.cxx b/sc/qa/unit/scshapetest.cxx index 8784fb1a125a..9771664c24a9 100644 --- a/sc/qa/unit/scshapetest.cxx +++ b/sc/qa/unit/scshapetest.cxx @@ -335,7 +335,8 @@ void ScShapeTest::testTdf140252_DragCreateFormControl() ScTabViewShell* pTabViewShell = lcl_getScTabViewShellWithAssert(pDocSh); // drag-create a push button as example of form control - SfxUInt16Item aIdentifierItem(SID_FM_CONTROL_IDENTIFIER, OBJ_FM_BUTTON); + SfxUInt16Item aIdentifierItem(SID_FM_CONTROL_IDENTIFIER, + static_cast<sal_uInt16>(SdrObjKind::FormButton)); SfxUInt32Item aInventorItem(SID_FM_CONTROL_INVENTOR, sal_uInt32(SdrInventor::FmForm)); const SfxPoolItem* pArgs[] = { &aIdentifierItem, &aInventorItem, nullptr }; pTabViewShell->GetViewData().GetDispatcher().Execute(SID_FM_CREATE_CONTROL, @@ -428,7 +429,8 @@ void ScShapeTest::testTdf140252_LayerOfControl() ScDocShell* pDocSh = lcl_getScDocShellWithAssert(xComponent); // Create default push button - SfxUInt16Item aIdentifierItem(SID_FM_CONTROL_IDENTIFIER, OBJ_FM_BUTTON); + SfxUInt16Item aIdentifierItem(SID_FM_CONTROL_IDENTIFIER, + static_cast<sal_uInt16>(SdrObjKind::FormButton)); SfxUInt32Item aInventorItem(SID_FM_CONTROL_INVENTOR, sal_uInt32(SdrInventor::FmForm)); const SfxPoolItem* pArgs[] = { &aIdentifierItem, &aInventorItem, nullptr }; const SfxPoolItem* pInternalArgs[] = { nullptr }; diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx index 402f3b4388d5..e89ae7c4f5db 100644 --- a/sc/qa/unit/ucalc.cxx +++ b/sc/qa/unit/ucalc.cxx @@ -3132,7 +3132,7 @@ void Test::testGraphicsInGroup() tools::Rectangle aOrigRect(10,200,110,300); // 100 x 100 aTempPoly.append(basegfx::B2DPoint(aStartPos.X(), aStartPos.Y())); aTempPoly.append(basegfx::B2DPoint(aEndPos.X(), aEndPos.Y())); - SdrPathObj* pObj = new SdrPathObj(*pDrawLayer, OBJ_LINE, basegfx::B2DPolyPolygon(aTempPoly)); + SdrPathObj* pObj = new SdrPathObj(*pDrawLayer, SdrObjKind::Line, basegfx::B2DPolyPolygon(aTempPoly)); pObj->NbcSetLogicRect(aOrigRect); pPage->InsertObject(pObj); const tools::Rectangle& rNewRect = pObj->GetLogicRect(); diff --git a/sc/source/core/data/documen5.cxx b/sc/source/core/data/documen5.cxx index 67421451e99e..ba6bea3a6116 100644 --- a/sc/source/core/data/documen5.cxx +++ b/sc/source/core/data/documen5.cxx @@ -108,7 +108,7 @@ bool ScDocument::HasChartAtPoint( SCTAB nTab, const Point& rPos, OUString& rName SdrObject* pObject = aIter.Next(); while (pObject) { - if ( pObject->GetObjIdentifier() == OBJ_OLE2 && + if ( pObject->GetObjIdentifier() == SdrObjKind::OLE2 && pObject->GetCurrentBoundRect().Contains(rPos) ) { // also Chart-Objects that are not in the Collection @@ -152,7 +152,7 @@ uno::Reference< chart2::XChartDocument > ScDocument::GetChartByName( std::u16str SdrObject* pObject = aIter.Next(); while (pObject) { - if ( pObject->GetObjIdentifier() == OBJ_OLE2 && + if ( pObject->GetObjIdentifier() == SdrObjKind::OLE2 && static_cast<SdrOle2Obj*>(pObject)->GetPersistName() == rChartName ) { xReturn.set( ScChartHelper::GetChartFromSdrObject( pObject ) ); @@ -219,7 +219,7 @@ void ScDocument::GetOldChartParameters( std::u16string_view rName, SdrObject* pObject = aIter.Next(); while (pObject) { - if ( pObject->GetObjIdentifier() == OBJ_OLE2 && + if ( pObject->GetObjIdentifier() == SdrObjKind::OLE2 && static_cast<SdrOle2Obj*>(pObject)->GetPersistName() == rName ) { uno::Reference< chart2::XChartDocument > xChartDoc( ScChartHelper::GetChartFromSdrObject( pObject ) ); @@ -266,7 +266,7 @@ void ScDocument::UpdateChartArea( const OUString& rChartName, SdrObject* pObject = aIter.Next(); while (pObject) { - if ( pObject->GetObjIdentifier() == OBJ_OLE2 && + if ( pObject->GetObjIdentifier() == SdrObjKind::OLE2 && static_cast<SdrOle2Obj*>(pObject)->GetPersistName() == rChartName ) { uno::Reference< chart2::XChartDocument > xChartDoc( ScChartHelper::GetChartFromSdrObject( pObject ) ); @@ -496,7 +496,7 @@ void ScDocument::SetChartRangeList( std::u16string_view rChartName, SdrObject* pObject = aIter.Next(); while (pObject) { - if ( pObject->GetObjIdentifier() == OBJ_OLE2 && + if ( pObject->GetObjIdentifier() == SdrObjKind::OLE2 && static_cast<SdrOle2Obj*>(pObject)->GetPersistName() == rChartName ) { uno::Reference< chart2::XChartDocument > xChartDoc( ScChartHelper::GetChartFromSdrObject( pObject ) ); @@ -551,7 +551,7 @@ uno::Reference< embed::XEmbeddedObject > SdrObject* pObject = aIter.Next(); while (pObject) { - if ( pObject->GetObjIdentifier() == OBJ_OLE2 ) + if ( pObject->GetObjIdentifier() == SdrObjKind::OLE2 ) { SdrOle2Obj * pOleObject ( dynamic_cast< SdrOle2Obj * >( pObject )); if( pOleObject && @@ -592,7 +592,7 @@ void ScDocument::UpdateChartListenerCollection() for (SdrObject* pObject = aIter.Next(); pObject; pObject = aIter.Next()) { - if ( pObject->GetObjIdentifier() != OBJ_OLE2 ) + if ( pObject->GetObjIdentifier() != SdrObjKind::OLE2 ) continue; OUString aObjName = static_cast<SdrOle2Obj*>(pObject)->GetPersistName(); diff --git a/sc/source/core/data/documen9.cxx b/sc/source/core/data/documen9.cxx index 5a8f97bb36db..69c37888057b 100644 --- a/sc/source/core/data/documen9.cxx +++ b/sc/source/core/data/documen9.cxx @@ -203,7 +203,7 @@ void ScDocument::SetDrawPageSize(SCTAB nTab) bool ScDocument::IsChart( const SdrObject* pObject ) { // IsChart() implementation moved to svx drawinglayer - if(pObject && OBJ_OLE2 == pObject->GetObjIdentifier()) + if(pObject && SdrObjKind::OLE2 == pObject->GetObjIdentifier()) { return static_cast<const SdrOle2Obj*>(pObject)->IsChart(); } @@ -303,7 +303,7 @@ bool ScDocument::HasOLEObjectsInArea( const ScRange& rRange, const ScMarkData* p SdrObject* pObject = aIter.Next(); while (pObject) { - if ( pObject->GetObjIdentifier() == OBJ_OLE2 && + if ( pObject->GetObjIdentifier() == SdrObjKind::OLE2 && aMMRect.Contains( pObject->GetCurrentBoundRect() ) ) return true; diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx index b0436d407ddd..3503ae9cd949 100644 --- a/sc/source/core/data/drwlayer.cxx +++ b/sc/source/core/data/drwlayer.cxx @@ -689,7 +689,7 @@ bool lcl_AreRectanglesApproxEqual(const tools::Rectangle& rRectA, const tools::R bool lcl_NeedsMirrorYCorrection(const SdrObject* pObj) { - return pObj->GetObjIdentifier() == OBJ_CUSTOMSHAPE + return pObj->GetObjIdentifier() == SdrObjKind::CustomShape && static_cast<const SdrObjCustomShape*>(pObj)->IsMirroredY(); } @@ -942,7 +942,7 @@ void ScDrawLayer::InitializeCellAnchoredObj(SdrObject* pObj, ScDrawObjData& rDat const ScAnchorType aAnchorType = ScDrawLayer::GetAnchorType(*pObj); if (aAnchorType == SCA_CELL_RESIZE) { - if (pObj->GetObjIdentifier() == OBJ_LINE) + if (pObj->GetObjIdentifier() == SdrObjKind::Line) { // Horizontal lines might have wrong start and end anchor because of erroneously applied // 180deg rotation (tdf#137446). Other lines have wrong end anchor. Coordinates in @@ -959,7 +959,7 @@ void ScDrawLayer::InitializeCellAnchoredObj(SdrObject* pObj, ScDrawObjData& rDat GetCellAnchorFromPosition(aObjRect, rNoRotatedAnchor, *pDoc, nTab1, false /*bHiddenAsZero*/); } - else if (pObj->GetObjIdentifier() == OBJ_MEASURE) + else if (pObj->GetObjIdentifier() == SdrObjKind::Measure) { // Measure lines might have got wrong start and end anchor from XML import. Recreate // anchor from start and end point. @@ -1209,7 +1209,7 @@ void ScDrawLayer::RecalcPos( SdrObject* pObj, ScDrawObjData& rData, bool bNegati } rData.setShapeRect(GetDocument(), lcl_makeSafeRectangle(rData.getShapeRect()), pObj->IsVisible()); - if (pObj->GetObjIdentifier() == OBJ_CUSTOMSHAPE) + if (pObj->GetObjIdentifier() == SdrObjKind::CustomShape) pObj->AdjustToMaxRect(rData.getShapeRect()); else pObj->SetSnapRect(rData.getShapeRect()); @@ -1917,7 +1917,7 @@ void ScDrawLayer::CopyFromClip( ScDrawLayer* pClipModel, SCTAB nSourceTab, const //#i110034# handle chart data references (after InsertObject) - if ( pNewObject->GetObjIdentifier() == OBJ_OLE2 ) + if ( pNewObject->GetObjIdentifier() == SdrObjKind::OLE2 ) { uno::Reference< embed::XEmbeddedObject > xIPObj = static_cast<SdrOle2Obj*>(pNewObject)->GetObjRef(); uno::Reference< embed::XClassifiedObject > xClassified = xIPObj; @@ -1996,11 +1996,11 @@ void ScDrawLayer::MirrorRTL( SdrObject* pObj ) if( !pDoc ) return; - sal_uInt16 nIdent = pObj->GetObjIdentifier(); + SdrObjKind nIdent = pObj->GetObjIdentifier(); // don't mirror OLE or graphics, otherwise ask the object // if it can be mirrored - bool bCanMirror = ( nIdent != OBJ_GRAF && nIdent != OBJ_OLE2 ); + bool bCanMirror = ( nIdent != SdrObjKind::Graphic && nIdent != SdrObjKind::OLE2 ); if (bCanMirror) { SdrObjTransformInfoRec aInfo; @@ -2145,7 +2145,7 @@ tools::Rectangle ScDrawLayer::GetCellRect( const ScDocument& rDoc, const ScAddre OUString ScDrawLayer::GetVisibleName( const SdrObject* pObj ) { OUString aName = pObj->GetName(); - if ( pObj->GetObjIdentifier() == OBJ_OLE2 ) + if ( pObj->GetObjIdentifier() == SdrObjKind::OLE2 ) { // For OLE, the user defined name (GetName) is used // if it's not empty (accepting possibly duplicate names), @@ -2164,11 +2164,11 @@ static bool IsNamedObject( const SdrObject* pObj, std::u16string_view rName ) // (used to find a named object) return ( pObj->GetName() == rName || - ( pObj->GetObjIdentifier() == OBJ_OLE2 && + ( pObj->GetObjIdentifier() == SdrObjKind::OLE2 && static_cast<const SdrOle2Obj*>(pObj)->GetPersistName() == rName ) ); } -SdrObject* ScDrawLayer::GetNamedObject( std::u16string_view rName, sal_uInt16 nId, SCTAB& rFoundTab ) const +SdrObject* ScDrawLayer::GetNamedObject( std::u16string_view rName, SdrObjKind nId, SCTAB& rFoundTab ) const { sal_uInt16 nTabCount = GetPageCount(); for (sal_uInt16 nTab=0; nTab<nTabCount; nTab++) @@ -2181,7 +2181,7 @@ SdrObject* ScDrawLayer::GetNamedObject( std::u16string_view rName, sal_uInt16 nI SdrObject* pObject = aIter.Next(); while (pObject) { - if ( nId == 0 || pObject->GetObjIdentifier() == nId ) + if ( nId == SdrObjKind::NONE || pObject->GetObjIdentifier() == nId ) if ( IsNamedObject( pObject, rName ) ) { rFoundTab = static_cast<SCTAB>(nTab); @@ -2208,7 +2208,7 @@ OUString ScDrawLayer::GetNewGraphicName( tools::Long* pnCounter ) const { ++nId; aGraphicName = aBase + OUString::number( nId ); - bThere = ( GetNamedObject( aGraphicName, 0, nDummy ) != nullptr ); + bThere = ( GetNamedObject( aGraphicName, SdrObjKind::NONE, nDummy ) != nullptr ); } if ( pnCounter ) @@ -2238,7 +2238,7 @@ void ScDrawLayer::EnsureGraphicNames() while (pObject) { - if ( pObject->GetObjIdentifier() == OBJ_GRAF && pObject->GetName().isEmpty()) + if ( pObject->GetObjIdentifier() == SdrObjKind::Graphic && pObject->GetName().isEmpty()) pObject->SetName( GetNewGraphicName( &nCounter ) ); pObject = aIter.Next(); @@ -2332,7 +2332,7 @@ void ScDrawLayer::SetCellAnchoredFromPosition( SdrObject &rObj, const ScDocument aObjRect2 = rObj.GetLogicRect(); rObj.NbcMirror(aLeft, aRight); } - else if (rObj.GetObjIdentifier() == OBJ_MEASURE) + else if (rObj.GetObjIdentifier() == SdrObjKind::Measure) { // tdf#137576. A SdrMeasureObj might have a wrong logic rect here. TakeUnrotatedSnapRect // calculates the current unrotated snap rectangle, sets logic rectangle and returns it. diff --git a/sc/source/core/tool/charthelper.cxx b/sc/source/core/tool/charthelper.cxx index 32315565ace5..8470c83d5b04 100644 --- a/sc/source/core/tool/charthelper.cxx +++ b/sc/source/core/tool/charthelper.cxx @@ -60,7 +60,7 @@ sal_uInt16 lcl_DoUpdateCharts( ScDocument& rDoc ) SdrObject* pObject = aIter.Next(); while (pObject) { - if ( pObject->GetObjIdentifier() == OBJ_OLE2 && ScDocument::IsChart( pObject ) ) + if ( pObject->GetObjIdentifier() == SdrObjKind::OLE2 && ScDocument::IsChart( pObject ) ) { OUString aName = static_cast<SdrOle2Obj*>(pObject)->GetPersistName(); rDoc.UpdateChart( aName ); @@ -125,7 +125,7 @@ void ScChartHelper::AdjustRangesOfChartsOnDestinationPage( const ScDocument& rSr SdrObject* pObject = aIter.Next(); while( pObject ) { - if( pObject->GetObjIdentifier() == OBJ_OLE2 && static_cast<SdrOle2Obj*>(pObject)->IsChart() ) + if( pObject->GetObjIdentifier() == SdrObjKind::OLE2 && static_cast<SdrOle2Obj*>(pObject)->IsChart() ) { OUString aChartName = static_cast<SdrOle2Obj*>(pObject)->GetPersistName(); @@ -161,7 +161,7 @@ void ScChartHelper::UpdateChartsOnDestinationPage( ScDocument& rDestDoc, const S SdrObject* pObject = aIter.Next(); while( pObject ) { - if( pObject->GetObjIdentifier() == OBJ_OLE2 && static_cast<SdrOle2Obj*>(pObject)->IsChart() ) + if( pObject->GetObjIdentifier() == SdrObjKind::OLE2 && static_cast<SdrOle2Obj*>(pObject)->IsChart() ) { OUString aChartName = static_cast<SdrOle2Obj*>(pObject)->GetPersistName(); Reference< chart2::XChartDocument > xChartDoc( rDestDoc.GetChartByName( aChartName ) ); @@ -177,7 +177,7 @@ uno::Reference< chart2::XChartDocument > ScChartHelper::GetChartFromSdrObject( c uno::Reference< chart2::XChartDocument > xReturn; if( pObject ) { - if( pObject->GetObjIdentifier() == OBJ_OLE2 && static_cast<const SdrOle2Obj*>(pObject)->IsChart() ) + if( pObject->GetObjIdentifier() == SdrObjKind::OLE2 && static_cast<const SdrOle2Obj*>(pObject)->IsChart() ) { uno::Reference< embed::XEmbeddedObject > xIPObj = static_cast<const SdrOle2Obj*>(pObject)->GetObjRef(); if( xIPObj.is() ) @@ -281,7 +281,7 @@ void ScChartHelper::SetChartRanges( const uno::Reference< chart2::XChartDocument void ScChartHelper::AddRangesIfProtectedChart( ScRangeListVector& rRangesVector, const ScDocument& rDocument, SdrObject* pObject ) { - if ( !(pObject && ( pObject->GetObjIdentifier() == OBJ_OLE2 )) ) + if ( !(pObject && ( pObject->GetObjIdentifier() == SdrObjKind::OLE2 )) ) return; SdrOle2Obj* pSdrOle2Obj = dynamic_cast< SdrOle2Obj* >( pObject ); @@ -344,7 +344,7 @@ void ScChartHelper::GetChartNames( ::std::vector< OUString >& rChartNames, const SdrObject* pObject = aIter.Next(); while ( pObject ) { - if ( pObject->GetObjIdentifier() == OBJ_OLE2 ) + if ( pObject->GetObjIdentifier() == SdrObjKind::OLE2 ) { SdrOle2Obj* pSdrOle2Obj = dynamic_cast< SdrOle2Obj* >( pObject ); if ( pSdrOle2Obj && pSdrOle2Obj->IsChart() ) @@ -368,7 +368,7 @@ void ScChartHelper::CreateProtectedChartListenersAndNotify( ScDocument& rDoc, co SdrObject* pObject = aIter.Next(); while ( pObject ) { - if ( pObject->GetObjIdentifier() == OBJ_OLE2 ) + if ( pObject->GetObjIdentifier() == SdrObjKind::OLE2 ) { SdrOle2Obj* pSdrOle2Obj = dynamic_cast< SdrOle2Obj* >( pObject ); if ( pSdrOle2Obj && pSdrOle2Obj->IsChart() ) diff --git a/sc/source/core/tool/detfunc.cxx b/sc/source/core/tool/detfunc.cxx index d120b4e35ff0..eabc91a3c4bb 100644 --- a/sc/source/core/tool/detfunc.cxx +++ b/sc/source/core/tool/detfunc.cxx @@ -497,7 +497,7 @@ void ScDetectiveFunc::InsertArrow( SCCOL nCol, SCROW nRow, aTempPoly.append(basegfx::B2DPoint(aEndPos.X(), aEndPos.Y())); SdrPathObj* pArrow = new SdrPathObj( *pModel, - OBJ_LINE, + SdrObjKind::Line, basegfx::B2DPolyPolygon(aTempPoly)); pArrow->NbcSetLogicRect(tools::Rectangle::Justify(aStartPos,aEndPos)); //TODO: needed ??? pArrow->SetMergedItemSetAndBroadcast(rAttrSet); @@ -566,7 +566,7 @@ void ScDetectiveFunc::InsertToOtherTab( SCCOL nStartCol, SCROW nStartRow, aTempPoly.append(basegfx::B2DPoint(aEndPos.X(), aEndPos.Y())); SdrPathObj* pArrow = new SdrPathObj( *pModel, - OBJ_LINE, + SdrObjKind::Line, basegfx::B2DPolyPolygon(aTempPoly)); pArrow->NbcSetLogicRect(tools::Rectangle::Justify(aStartPos,aEndPos)); //TODO: needed ??? diff --git a/sc/source/filter/excel/xeescher.cxx b/sc/source/filter/excel/xeescher.cxx index 3d3d23520e94..a109f7b9c6db 100644 --- a/sc/source/filter/excel/xeescher.cxx +++ b/sc/source/filter/excel/xeescher.cxx @@ -1598,7 +1598,7 @@ void XclExpChartObj::SaveXml( XclExpXmlStream& rStrm ) css::uno::Reference<css::chart::XChartDocument> XclExpChartObj::GetChartDoc() const { SdrObject* pObj = SdrObject::getSdrObjectFromXShape(mxShape); - if (!pObj || pObj->GetObjIdentifier() != OBJ_OLE2) + if (!pObj || pObj->GetObjIdentifier() != SdrObjKind::OLE2) return {}; // May load here - makes sure that we are working with actually loaded OLE object return css::uno::Reference<css::chart::XChartDocument>( diff --git a/sc/source/filter/excel/xiescher.cxx b/sc/source/filter/excel/xiescher.cxx index 298517b0f5b0..4b80fea99cfc 100644 --- a/sc/source/filter/excel/xiescher.cxx +++ b/sc/source/filter/excel/xiescher.cxx @@ -1123,7 +1123,7 @@ SdrObjectUniquePtr XclImpLineObj::DoCreateSdrObj( XclImpDffConverter& rDffConv, SdrObjectUniquePtr xSdrObj( new SdrPathObj( *GetDoc().GetDrawLayer(), - OBJ_LINE, + SdrObjKind::Line, ::basegfx::B2DPolyPolygon(aB2DPolygon))); ConvertLineStyle( *xSdrObj, maLineData ); @@ -1415,7 +1415,7 @@ SdrObjectUniquePtr XclImpPolygonObj::DoCreateSdrObj( XclImpDffConverter& rDffCon if( ::get_flag( mnPolyFlags, EXC_OBJ_POLY_CLOSED ) && (maCoords.front() != maCoords.back()) ) aB2DPolygon.append( lclGetPolyPoint( rAnchorRect, maCoords.front() ) ); // create the SdrObject - SdrObjKind eObjKind = maFillData.IsFilled() ? OBJ_PATHPOLY : OBJ_PATHPLIN; + SdrObjKind eObjKind = maFillData.IsFilled() ? SdrObjKind::PathPoly : SdrObjKind::PathPolyLine; xSdrObj.reset( new SdrPathObj( *GetDoc().GetDrawLayer(), diff --git a/sc/source/filter/html/htmlexp2.cxx b/sc/source/filter/html/htmlexp2.cxx index 50ff33b6ffc8..c76f001fdf84 100644 --- a/sc/source/filter/html/htmlexp2.cxx +++ b/sc/source/filter/html/htmlexp2.cxx @@ -129,7 +129,7 @@ void ScHTMLExport::WriteGraphEntry( ScHTMLGraphEntry* pE ) OString aOpt = aBuf.makeStringAndClear(); switch ( pObject->GetObjIdentifier() ) { - case OBJ_GRAF: + case SdrObjKind::Graphic: { const SdrGrafObj* pSGO = static_cast<SdrGrafObj*>(pObject); std::unique_ptr<SdrGrafObjGeoData> pGeo(static_cast<SdrGrafObjGeoData*>(pSGO->GetGeoData().release())); @@ -149,7 +149,7 @@ void ScHTMLExport::WriteGraphEntry( ScHTMLGraphEntry* pE ) pE->bWritten = true; } break; - case OBJ_OLE2: + case SdrObjKind::OLE2: { const Graphic* pGraphic = static_cast<SdrOle2Obj*>(pObject)->GetGraphic(); if ( pGraphic ) diff --git a/sc/source/filter/xcl97/xcl97esc.cxx b/sc/source/filter/xcl97/xcl97esc.cxx index 7778944ccfd7..db0c7159000a 100644 --- a/sc/source/filter/xcl97/xcl97esc.cxx +++ b/sc/source/filter/xcl97/xcl97esc.cxx @@ -166,7 +166,7 @@ namespace { bool lcl_IsFontwork( const SdrObject* pObj ) { bool bIsFontwork = false; - if( pObj->GetObjIdentifier() == OBJ_CUSTOMSHAPE ) + if( pObj->GetObjIdentifier() == SdrObjKind::CustomShape ) { static const OUStringLiteral aTextPath = u"TextPath"; const SdrCustomShapeGeometryItem& rGeometryItem = @@ -202,9 +202,9 @@ EscherExHostAppData* XclEscherEx::StartShape( const Reference< XShape >& rxShape else { pCurrXclObj = nullptr; - sal_uInt16 nObjType = pObj->GetObjIdentifier(); + SdrObjKind nObjType = pObj->GetObjIdentifier(); - if( nObjType == OBJ_OLE2 ) + if( nObjType == SdrObjKind::OLE2 ) { // no OLE objects in embedded drawings (chart shapes) if( mbIsRootDff ) @@ -228,7 +228,7 @@ EscherExHostAppData* XclEscherEx::StartShape( const Reference< XShape >& rxShape else pCurrXclObj = new XclObjAny( mrObjMgr, rxShape, &GetDoc() ); } - else if( nObjType == OBJ_UNO ) + else if( nObjType == SdrObjKind::UNO ) { //added for exporting OCX control Reference< XPropertySet > xPropSet( rxShape, UNO_QUERY ); @@ -280,7 +280,7 @@ EscherExHostAppData* XclEscherEx::StartShape( const Reference< XShape >& rxShape pCurrAppData->SetClientAnchor( pAnchor ); } const SdrTextObj* pTextObj = dynamic_cast<SdrTextObj*>( pObj ); - if( pTextObj && !lcl_IsFontwork( pTextObj ) && (pObj->GetObjIdentifier() != OBJ_CAPTION) ) + if( pTextObj && !lcl_IsFontwork( pTextObj ) && (pObj->GetObjIdentifier() != SdrObjKind::Caption) ) { const OutlinerParaObject* pParaObj = pTextObj->GetOutlinerParaObject(); if( pParaObj ) @@ -310,8 +310,8 @@ EscherExHostAppData* XclEscherEx::StartShape( const Reference< XShape >& rxShape //for OCX control import from MS office file,we need keep the id value as MS office file. //GetOldRoot().pObjRecs->Add( pCurrXclObj ) statement has generated the id value as obj id rule; //but we trick it here. - sal_uInt16 nObjType = pObj->GetObjIdentifier(); - if( nObjType == OBJ_UNO && pCurrXclObj ) + SdrObjKind nObjType = pObj->GetObjIdentifier(); + if( nObjType == SdrObjKind::UNO && pCurrXclObj ) { Reference< XPropertySet > xPropSet( rxShape, UNO_QUERY ); Any aAny; diff --git a/sc/source/filter/xcl97/xcl97rec.cxx b/sc/source/filter/xcl97/xcl97rec.cxx index 5ed6cccde2a2..243c7b27c630 100644 --- a/sc/source/filter/xcl97/xcl97rec.cxx +++ b/sc/source/filter/xcl97/xcl97rec.cxx @@ -1106,9 +1106,9 @@ void XclObjAny::WriteFromTo( XclExpXmlStream& rStrm, const Reference< XShape >& // Do not adjust objects, which have rotation incorporated into their points // but report a rotation angle nevertheless. SdrObject* pObj = SdrObject::getSdrObjectFromXShape(rShape); - if (pObj && pObj->GetObjIdentifier() != OBJ_LINE && pObj->GetObjIdentifier() != OBJ_PLIN - && pObj->GetObjIdentifier() != OBJ_PATHLINE && pObj->GetObjIdentifier() != OBJ_FREELINE - && pObj->GetObjIdentifier() != OBJ_PATHPLIN) + if (pObj && pObj->GetObjIdentifier() != SdrObjKind::Line && pObj->GetObjIdentifier() != SdrObjKind::PolyLine + && pObj->GetObjIdentifier() != SdrObjKind::PathLine && pObj->GetObjIdentifier() != SdrObjKind::FreehandLine + && pObj->GetObjIdentifier() != SdrObjKind::PathPolyLine) { Degree100 nRotation = NormAngle36000(pObj->GetRotateAngle()); if (nRotation) diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx index bdae3a1f94d0..4d52fce1216e 100644 --- a/sc/source/filter/xml/xmlexprt.cxx +++ b/sc/source/filter/xml/xmlexprt.cxx @@ -3571,7 +3571,7 @@ void ScXMLExport::WriteShapes(const ScMyCell& rMyCell) aPoint.X = aSnapRect.Left() + aSnapRect.Right() - aPoint.X; } else if (pObj && (pNRObjData = ScDrawLayer::GetNonRotatedObjData(pObj)) - && ((rShape.bResizeWithCell && pObj->GetObjIdentifier() == OBJ_CUSTOMSHAPE + && ((rShape.bResizeWithCell && pObj->GetObjIdentifier() == SdrObjKind::CustomShape && static_cast<SdrObjCustomShape*>(pObj)->IsMirroredX()) || bNegativePage)) { diff --git a/sc/source/ui/app/client.cxx b/sc/source/ui/app/client.cxx index 50cbadc567fa..0886fae89400 100644 --- a/sc/source/ui/app/client.cxx +++ b/sc/source/ui/app/client.cxx @@ -60,7 +60,7 @@ SdrOle2Obj* ScClient::GetDrawObj() SdrObject* pObject = aIter.Next(); while (pObject && !pOle2Obj) { - if ( pObject->GetObjIdentifier() == OBJ_OLE2 ) + if ( pObject->GetObjIdentifier() == SdrObjKind::OLE2 ) { // name from InfoObject is PersistName if ( static_cast<SdrOle2Obj*>(pObject)->GetPersistName() == aName ) diff --git a/sc/source/ui/app/drwtrans.cxx b/sc/source/ui/app/drwtrans.cxx index 50075e80055f..8cd335b2e946 100644 --- a/sc/source/ui/app/drwtrans.cxx +++ b/sc/source/ui/app/drwtrans.cxx @@ -89,8 +89,8 @@ ScDrawTransferObj::ScDrawTransferObj( std::unique_ptr<SdrModel> pClipModel, ScDo // OLE object - sal_uInt16 nSdrObjKind = pObject->GetObjIdentifier(); - if (nSdrObjKind == OBJ_OLE2) + SdrObjKind nSdrObjKind = pObject->GetObjIdentifier(); + if (nSdrObjKind == SdrObjKind::OLE2) { // if object has no persistence it must be copied as a part of document try @@ -106,7 +106,7 @@ ScDrawTransferObj::ScDrawTransferObj( std::unique_ptr<SdrModel> pClipModel, ScDo // Graphic object - if (nSdrObjKind == OBJ_GRAF) + if (nSdrObjKind == SdrObjKind::Graphic) { m_bGraphic = true; if ( static_cast<SdrGrafObj*>(pObject)->GetGraphic().GetType() == GraphicType::Bitmap ) @@ -383,7 +383,7 @@ bool ScDrawTransferObj::GetData( const css::datatransfer::DataFlavor& rFlavor, c { SdrObjListIter aIter( pPage, SdrIterMode::Flat ); SdrObject* pObject = aIter.Next(); - if (pObject && pObject->GetObjIdentifier() == OBJ_GRAF) + if (pObject && pObject->GetObjIdentifier() == SdrObjKind::Graphic) { SdrGrafObj* pGraphObj = static_cast<SdrGrafObj*>(pObject); bOK = SetGraphic( pGraphObj->GetGraphic() ); @@ -637,7 +637,7 @@ SdrOle2Obj* ScDrawTransferObj::GetSingleObject() { SdrObjListIter aIter( pPage, SdrIterMode::Flat ); SdrObject* pObject = aIter.Next(); - if (pObject && pObject->GetObjIdentifier() == OBJ_OLE2) + if (pObject && pObject->GetObjIdentifier() == SdrObjKind::OLE2) { return static_cast<SdrOle2Obj*>(pObject); } diff --git a/sc/source/ui/app/seltrans.cxx b/sc/source/ui/app/seltrans.cxx index 9b7b3caa0905..33405d447aa3 100644 --- a/sc/source/ui/app/seltrans.cxx +++ b/sc/source/ui/app/seltrans.cxx @@ -88,16 +88,16 @@ rtl::Reference<ScSelectionTransferObj> ScSelectionTransferObj::CreateFromView( S if ( nMarkCount == 1 ) { SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj(); - sal_uInt16 nSdrObjKind = pObj->GetObjIdentifier(); + SdrObjKind nSdrObjKind = pObj->GetObjIdentifier(); - if ( nSdrObjKind == OBJ_GRAF ) + if ( nSdrObjKind == SdrObjKind::Graphic ) { if ( static_cast<SdrGrafObj*>(pObj)->GetGraphic().GetType() == GraphicType::Bitmap ) eMode = SC_SELTRANS_DRAW_BITMAP; else eMode = SC_SELTRANS_DRAW_GRAPHIC; } - else if ( nSdrObjKind == OBJ_OLE2 ) + else if ( nSdrObjKind == SdrObjKind::OLE2 ) eMode = SC_SELTRANS_DRAW_OLE; else if ( lcl_IsURLButton( pObj ) ) eMode = SC_SELTRANS_DRAW_BOOKMARK; diff --git a/sc/source/ui/drawfunc/drawsh.cxx b/sc/source/ui/drawfunc/drawsh.cxx index 08be0531f2a5..f35f20caf84a 100644 --- a/sc/source/ui/drawfunc/drawsh.cxx +++ b/sc/source/ui/drawfunc/drawsh.cxx @@ -372,7 +372,7 @@ void ScDrawShell::ExecDrawAttr( SfxRequest& rReq ) SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj(); std::shared_ptr<SfxRequest> pRequest = std::make_shared<SfxRequest>(rReq); - if( pObj->GetObjIdentifier() == OBJ_CAPTION ) + if( pObj->GetObjIdentifier() == SdrObjKind::Caption ) { // Caption Itemset SfxItemSet aNewAttr(pDoc->GetItemPool()); diff --git a/sc/source/ui/drawfunc/drawsh2.cxx b/sc/source/ui/drawfunc/drawsh2.cxx index 7a288ecbd100..a3a0a9abb20a 100644 --- a/sc/source/ui/drawfunc/drawsh2.cxx +++ b/sc/source/ui/drawfunc/drawsh2.cxx @@ -241,8 +241,8 @@ void ScDrawShell::GetDrawFuncState( SfxItemSet& rSet ) // disable functions bCanRename = true; // #i51351# anything except internal objects can be renamed // #91929#; don't show original size entry if not possible - sal_uInt16 nObjType = pObj->GetObjIdentifier(); - if ( nObjType == OBJ_OLE2 ) + SdrObjKind nObjType = pObj->GetObjIdentifier(); + if ( nObjType == SdrObjKind::OLE2 ) { SdrOle2Obj* pOleObj = static_cast<SdrOle2Obj*>(rMarkList.GetMark( 0 )->GetMarkedSdrObj()); if (pOleObj->GetObjRef().is() && @@ -250,7 +250,7 @@ void ScDrawShell::GetDrawFuncState( SfxItemSet& rSet ) // disable functions //TODO/LATER: why different slots in Draw and Calc? rSet.DisableItem(SID_ORIGINALSIZE); } - else if ( nObjType == OBJ_CAPTION ) + else if ( nObjType == SdrObjKind::Caption ) { if ( nLayerID == SC_LAYER_INTERN ) { @@ -473,18 +473,18 @@ void ScDrawShell::GetAttrFuncState(SfxItemSet &rSet) for ( size_t i = 0; i < nMarkCount && i < 50; ++i ) { SdrObject* pObj = rMarkList.GetMark( i )->GetMarkedSdrObj(); - sal_uInt16 nObjType = pObj->GetObjIdentifier(); + SdrObjKind nObjType = pObj->GetObjIdentifier(); - if ( nObjType != OBJ_MEASURE ) + if ( nObjType != SdrObjKind::Measure ) bShowMeasure = false; // If marked object is 2D, disable format area command. - if ( nObjType == OBJ_PLIN || - nObjType == OBJ_LINE || - nObjType == OBJ_PATHLINE || - nObjType == OBJ_FREELINE || - nObjType == OBJ_EDGE || - nObjType == OBJ_CARC || + if ( nObjType == SdrObjKind::PolyLine || + nObjType == SdrObjKind::Line || + nObjType == SdrObjKind::PathLine || + nObjType == SdrObjKind::FreehandLine || + nObjType == SdrObjKind::Edge || + nObjType == SdrObjKind::CircleArc || bShowMeasure ) bShowArea = false; diff --git a/sc/source/ui/drawfunc/drawsh5.cxx b/sc/source/ui/drawfunc/drawsh5.cxx index 70dff477d54e..d7c3ee434e0d 100644 --- a/sc/source/ui/drawfunc/drawsh5.cxx +++ b/sc/source/ui/drawfunc/drawsh5.cxx @@ -490,9 +490,9 @@ void ScDrawShell::ExecDrawFunc( SfxRequest& rReq ) if (aName != pSelected->GetName()) { // handle name change - const sal_uInt16 nObjType(pSelected->GetObjIdentifier()); + const SdrObjKind nObjType(pSelected->GetObjIdentifier()); - if (OBJ_GRAF == nObjType && aName.isEmpty()) + if (SdrObjKind::Graphic == nObjType && aName.isEmpty()) { // graphics objects must have names // (all graphics are supposed to be in the navigator) @@ -507,7 +507,7 @@ void ScDrawShell::ExecDrawFunc( SfxRequest& rReq ) // An undo action for renaming is missing in svdraw (99363). // For OLE objects (which can be identified using the persist name), // ScUndoRenameObject can be used until there is a common action for all objects. - if(OBJ_OLE2 == nObjType) + if(SdrObjKind::OLE2 == nObjType) { const OUString aPersistName = static_cast<SdrOle2Obj*>(pSelected)->GetPersistName(); @@ -616,7 +616,7 @@ IMPL_LINK( ScDrawShell, NameObjectHdl, AbstractSvxObjectNameDialog&, rDialog, bo if ( !aName.isEmpty() && pModel ) { SCTAB nDummyTab; - if ( pModel->GetNamedObject( aName, 0, nDummyTab ) ) + if ( pModel->GetNamedObject( aName, SdrObjKind::NONE, nDummyTab ) ) { // existing object found -> name invalid return false; diff --git a/sc/source/ui/drawfunc/fuconarc.cxx b/sc/source/ui/drawfunc/fuconarc.cxx index 95e5785868d0..ef9b2c0fdd8e 100644 --- a/sc/source/ui/drawfunc/fuconarc.cxx +++ b/sc/source/ui/drawfunc/fuconarc.cxx @@ -77,22 +77,22 @@ void FuConstArc::Activate() { case SID_DRAW_ARC: aNewPointer = PointerStyle::DrawArc; - aObjKind = OBJ_CARC; + aObjKind = SdrObjKind::CircleArc; break; case SID_DRAW_PIE: aNewPointer = PointerStyle::DrawPie; - aObjKind = OBJ_SECT; + aObjKind = SdrObjKind::CircleSection; break; case SID_DRAW_CIRCLECUT: aNewPointer = PointerStyle::DrawCircleCut; - aObjKind = OBJ_CCUT; + aObjKind = SdrObjKind::CircleCut; break; default: aNewPointer = PointerStyle::Cross; - aObjKind = OBJ_CARC; + aObjKind = SdrObjKind::CircleArc; break; } diff --git a/sc/source/ui/drawfunc/fuconcustomshape.cxx b/sc/source/ui/drawfunc/fuconcustomshape.cxx index 2e7a506f77f1..ed4522fb85e8 100644 --- a/sc/source/ui/drawfunc/fuconcustomshape.cxx +++ b/sc/source/ui/drawfunc/fuconcustomshape.cxx @@ -97,7 +97,7 @@ bool FuConstCustomShape::MouseButtonUp(const MouseEvent& rMEvt) void FuConstCustomShape::Activate() { - pView->SetCurrentObj( OBJ_CUSTOMSHAPE ); + pView->SetCurrentObj( SdrObjKind::CustomShape ); aNewPointer = PointerStyle::DrawRect; aOldPointer = pWindow->GetPointer(); diff --git a/sc/source/ui/drawfunc/fuconpol.cxx b/sc/source/ui/drawfunc/fuconpol.cxx index 22b94acfad43..6ce044ad9d5a 100644 --- a/sc/source/ui/drawfunc/fuconpol.cxx +++ b/sc/source/ui/drawfunc/fuconpol.cxx @@ -109,44 +109,44 @@ void FuConstPolygon::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/sc/source/ui/drawfunc/fuconrec.cxx b/sc/source/ui/drawfunc/fuconrec.cxx index c112617652b4..8e31015e8ae3 100644 --- a/sc/source/ui/drawfunc/fuconrec.cxx +++ b/sc/source/ui/drawfunc/fuconrec.cxx @@ -94,7 +94,7 @@ bool FuConstRectangle::MouseButtonDown(const MouseEvent& rMEvt) Point aPos( pWindow->PixelToLogic( rMEvt.GetPosPixel() ) ); pWindow->CaptureMouse(); - if ( pView->GetCurrentObjIdentifier() == OBJ_CAPTION ) + if ( pView->GetCurrentObjIdentifier() == SdrObjKind::Caption ) { Size aCaptionSize ( 2268, 1134 ); // 4x2cm @@ -166,33 +166,33 @@ void FuConstRectangle::Activate() case SID_LINE_SQUARE_ARROW: case SID_LINE_ARROWS: aNewPointer = PointerStyle::DrawLine; - aObjKind = OBJ_LINE; + aObjKind = SdrObjKind::Line; break; case SID_DRAW_MEASURELINE: aNewPointer = PointerStyle::DrawLine; - aObjKind = OBJ_MEASURE; + aObjKind = SdrObjKind::Measure; break; case SID_DRAW_RECT: aNewPointer = PointerStyle::DrawRect; - aObjKind = OBJ_RECT; + aObjKind = SdrObjKind::Rectangle; break; case SID_DRAW_ELLIPSE: aNewPointer = PointerStyle::DrawEllipse; - aObjKind = OBJ_CIRC; + aObjKind = SdrObjKind::CircleOrEllipse; break; case SID_DRAW_CAPTION: case SID_DRAW_CAPTION_VERTICAL: aNewPointer = PointerStyle::DrawCaption; - aObjKind = OBJ_CAPTION; + aObjKind = SdrObjKind::Caption; break; default: aNewPointer = PointerStyle::Cross; - aObjKind = OBJ_RECT; + aObjKind = SdrObjKind::Rectangle; break; } diff --git a/sc/source/ui/drawfunc/fuconuno.cxx b/sc/source/ui/drawfunc/fuconuno.cxx index e0257f97feec..e4e3c3e3764b 100644 --- a/sc/source/ui/drawfunc/fuconuno.cxx +++ b/sc/source/ui/drawfunc/fuconuno.cxx @@ -27,7 +27,7 @@ FuConstUnoControl::FuConstUnoControl(ScTabViewShell& rViewSh, vcl::Window* pWin, SdrModel* pDoc, const SfxRequest& rReq) : FuConstruct(rViewSh, pWin, pViewP, pDoc, rReq) , nInventor(SdrInventor::Unknown) - , nIdentifier(OBJ_NONE) + , nIdentifier(SdrObjKind::NONE) { const SfxUInt32Item* pInventorItem = rReq.GetArg<SfxUInt32Item>(SID_FM_CONTROL_INVENTOR); const SfxUInt16Item* pIdentifierItem = rReq.GetArg<SfxUInt16Item>(SID_FM_CONTROL_IDENTIFIER); diff --git a/sc/source/ui/drawfunc/fupoor.cxx b/sc/source/ui/drawfunc/fupoor.cxx index a7fb3f38bd24..decfacebe85c 100644 --- a/sc/source/ui/drawfunc/fupoor.cxx +++ b/sc/source/ui/drawfunc/fupoor.cxx @@ -257,10 +257,10 @@ bool FuPoor::doConstructOrthogonal() const const SdrMarkList& rMarkList = pView->GetMarkedObjectList(); if (rMarkList.GetMarkCount() == 1) { - sal_uInt16 aObjIdentifier = rMarkList.GetMark(0)->GetMarkedSdrObj()->GetObjIdentifier(); - bool bIsMediaSelected = aObjIdentifier == OBJ_GRAF || - aObjIdentifier == OBJ_MEDIA || - aObjIdentifier == OBJ_OLE2; + SdrObjKind aObjIdentifier = rMarkList.GetMark(0)->GetMarkedSdrObj()->GetObjIdentifier(); + bool bIsMediaSelected = aObjIdentifier == SdrObjKind::Graphic || + aObjIdentifier == SdrObjKind::Media || + aObjIdentifier == SdrObjKind::OLE2; SdrHdl* pHdl = pView->PickHandle(aMDPos); // Resize proportionally when media is selected and the user drags on a corner diff --git a/sc/source/ui/drawfunc/fusel.cxx b/sc/source/ui/drawfunc/fusel.cxx index b59059786d69..18ba12b792b9 100644 --- a/sc/source/ui/drawfunc/fusel.cxx +++ b/sc/source/ui/drawfunc/fusel.cxx @@ -459,11 +459,11 @@ bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt) SdrHitKind eHit = pView->PickAnything( rMEvt, SdrMouseEventKind::BUTTONDOWN, aVEvt ); if (eHit != SdrHitKind::NONE && aVEvt.mpObj == pObj) { - sal_uInt16 nSdrObjKind = pObj->GetObjIdentifier(); + SdrObjKind nSdrObjKind = pObj->GetObjIdentifier(); // OLE: activate - if (nSdrObjKind == OBJ_OLE2) + if (nSdrObjKind == SdrObjKind::OLE2) { if (!bOle) { diff --git a/sc/source/ui/drawfunc/futext.cxx b/sc/source/ui/drawfunc/futext.cxx index ef853ef52078..d907a0a72bf8 100644 --- a/sc/source/ui/drawfunc/futext.cxx +++ b/sc/source/ui/drawfunc/futext.cxx @@ -509,7 +509,7 @@ void FuText::Activate() { // no text object in EditMode, therefore set CreateMode - pView->SetCurrentObj(OBJ_TEXT); + pView->SetCurrentObj(SdrObjKind::Text); pView->SetCreateMode(); } @@ -552,11 +552,11 @@ void FuText::SetInEditMode(SdrObject* pObj, const Point* pMousePixel, if ( !pObj ) return; - sal_uInt16 nSdrObjKind = pObj->GetObjIdentifier(); + SdrObjKind nSdrObjKind = pObj->GetObjIdentifier(); - if (!(nSdrObjKind == OBJ_TEXT || - nSdrObjKind == OBJ_TITLETEXT || - nSdrObjKind == OBJ_OUTLINETEXT || + if (!(nSdrObjKind == SdrObjKind::Text || + nSdrObjKind == SdrObjKind::TitleText || + nSdrObjKind == SdrObjKind::OutlineText || dynamic_cast<const SdrTextObj*>( pObj) != nullptr)) return; diff --git a/sc/source/ui/inc/content.hxx b/sc/source/ui/inc/content.hxx index c442df3f502f..2a31d1d38056 100644 --- a/sc/source/ui/inc/content.hxx +++ b/sc/source/ui/inc/content.hxx @@ -30,6 +30,7 @@ class ScDocument; class ScDocShell; class ScNavigatorDlg; struct ImplSVEvent; +enum class SdrObjKind : sal_uInt16; enum class ScContentId { ROOT, TABLE, RANGENAME, DBAREA, @@ -75,7 +76,7 @@ class ScContentTree void GetDrawingNames(); void GetNoteStrings(); - static bool IsPartOfType( ScContentId nContentType, sal_uInt16 nObjIdentifier ); + static bool IsPartOfType( ScContentId nContentType, SdrObjKind nObjIdentifier ); bool DrawNamesChanged( ScContentId nType ); bool NoteStringsChanged(); diff --git a/sc/source/ui/navipi/content.cxx b/sc/source/ui/navipi/content.cxx index 39577acb5a00..c6fa3fcc7eab 100644 --- a/sc/source/ui/navipi/content.cxx +++ b/sc/source/ui/navipi/content.cxx @@ -793,19 +793,19 @@ void ScContentTree::GetDbNames() } } -bool ScContentTree::IsPartOfType( ScContentId nContentType, sal_uInt16 nObjIdentifier ) +bool ScContentTree::IsPartOfType( ScContentId nContentType, SdrObjKind nObjIdentifier ) { bool bRet = false; switch ( nContentType ) { case ScContentId::GRAPHIC: - bRet = ( nObjIdentifier == OBJ_GRAF ); + bRet = ( nObjIdentifier == SdrObjKind::Graphic ); break; case ScContentId::OLEOBJECT: - bRet = ( nObjIdentifier == OBJ_OLE2 ); + bRet = ( nObjIdentifier == SdrObjKind::OLE2 ); break; case ScContentId::DRAWING: - bRet = ( nObjIdentifier != OBJ_GRAF && nObjIdentifier != OBJ_OLE2 ); // everything else + bRet = ( nObjIdentifier != SdrObjKind::Graphic && nObjIdentifier != SdrObjKind::OLE2 ); // everything else break; default: OSL_FAIL("unknown content type"); @@ -1108,7 +1108,7 @@ static bool lcl_DoDragObject( ScDocShell* pSrcShell, std::u16string_view rName, { bool bOle = ( nType == ScContentId::OLEOBJECT ); bool bGraf = ( nType == ScContentId::GRAPHIC ); - sal_uInt16 nDrawId = sal::static_int_cast<sal_uInt16>( bOle ? OBJ_OLE2 : ( bGraf ? OBJ_GRAF : OBJ_GRUP ) ); + SdrObjKind nDrawId = bOle ? SdrObjKind::OLE2 : ( bGraf ? SdrObjKind::Graphic : SdrObjKind::Group ); SCTAB nTab = 0; SdrObject* pObject = pModel->GetNamedObject( rName, nDrawId, nTab ); if (pObject) @@ -1124,7 +1124,7 @@ static bool lcl_DoDragObject( ScDocShell* pSrcShell, std::u16string_view rName, // that the EmbeddedObjectContainer gets copied. We need no CheckOle // here, test is simpler. ScDocShellRef aDragShellRef; - if(OBJ_OLE2 == pObject->GetObjIdentifier()) + if(SdrObjKind::OLE2 == pObject->GetObjIdentifier()) { aDragShellRef = new ScDocShell; // DocShell needs a Ref immediately aDragShellRef->DoInitNew(); diff --git a/sc/source/ui/uitest/uiobject.cxx b/sc/source/ui/uitest/uiobject.cxx index 19b32fddfb8b..d1f3592cecf3 100644 --- a/sc/source/ui/uitest/uiobject.cxx +++ b/sc/source/ui/uitest/uiobject.cxx @@ -207,8 +207,8 @@ void ScGridWinUIObject::execute(const OUString& rAction, { SdrMark* pMark = rMarkList.GetMark(0); SdrObject* pObj = pMark->GetMarkedSdrObj(); - sal_uInt16 nSdrObjKind = pObj->GetObjIdentifier(); - if (nSdrObjKind == OBJ_OLE2) + SdrObjKind nSdrObjKind = pObj->GetObjIdentifier(); + if (nSdrObjKind == SdrObjKind::OLE2) { ScTabViewShell* pViewShell = getViewShell(); pViewShell->ActivateObject(static_cast<SdrOle2Obj*>(pObj), css::embed::EmbedVerbs::MS_OLEVERB_PRIMARY); @@ -373,7 +373,7 @@ std::set<OUString> collect_charts(VclPtr<ScGridWindow> const & xGridWindow) SdrObject* pObject = aIter.Next(); while (pObject) { - if (pObject->GetObjIdentifier() == OBJ_OLE2) + if (pObject->GetObjIdentifier() == SdrObjKind::OLE2) { aRet.insert(static_cast<SdrOle2Obj*>(pObject)->GetPersistName()); } diff --git a/sc/source/ui/undo/undotab.cxx b/sc/source/ui/undo/undotab.cxx index 467e93cb7145..7ce4c23d17c2 100644 --- a/sc/source/ui/undo/undotab.cxx +++ b/sc/source/ui/undo/undotab.cxx @@ -1454,7 +1454,7 @@ SdrObject* ScUndoRenameObject::GetObject() SdrObject* pObject = aIter.Next(); while (pObject) { - if ( pObject->GetObjIdentifier() == OBJ_OLE2 && + if ( pObject->GetObjIdentifier() == SdrObjKind::OLE2 && static_cast<SdrOle2Obj*>(pObject)->GetPersistName() == aPersistName ) { return pObject; diff --git a/sc/source/ui/unoobj/ChartTools.cxx b/sc/source/ui/unoobj/ChartTools.cxx index b405557d1c8b..6ce72bd9e792 100644 --- a/sc/source/ui/unoobj/ChartTools.cxx +++ b/sc/source/ui/unoobj/ChartTools.cxx @@ -78,7 +78,7 @@ SdrOle2Obj* ChartIterator::next() SdrObject* pObject = m_pIterator->Next(); while (pObject) { - if (pObject->GetObjIdentifier() == OBJ_OLE2 && ScDocument::IsChart(pObject)) + if (pObject->GetObjIdentifier() == SdrObjKind::OLE2 && ScDocument::IsChart(pObject)) { SdrOle2Obj* pOleObject = static_cast<SdrOle2Obj*>(pObject); diff --git a/sc/source/ui/unoobj/TablePivotCharts.cxx b/sc/source/ui/unoobj/TablePivotCharts.cxx index 291084b99500..e4d09f459f91 100644 --- a/sc/source/ui/unoobj/TablePivotCharts.cxx +++ b/sc/source/ui/unoobj/TablePivotCharts.cxx @@ -86,7 +86,7 @@ void SAL_CALL TablePivotCharts::addNewByName(OUString const & rName, OUString aName = rName; SCTAB nDummy; - if (!aName.isEmpty() && pModel->GetNamedObject(aName, OBJ_OLE2, nDummy)) + if (!aName.isEmpty() && pModel->GetNamedObject(aName, SdrObjKind::OLE2, nDummy)) { // object exists - only RuntimeException is specified throw uno::RuntimeException(); diff --git a/sc/source/ui/unoobj/chartuno.cxx b/sc/source/ui/unoobj/chartuno.cxx index 1de57336b2b4..9bf802f812d5 100644 --- a/sc/source/ui/unoobj/chartuno.cxx +++ b/sc/source/ui/unoobj/chartuno.cxx @@ -99,7 +99,7 @@ rtl::Reference<ScChartObj> ScChartsObj::GetObjectByIndex_Impl(tools::Long nIndex SdrObject* pObject = aIter.Next(); while (pObject) { - if ( pObject->GetObjIdentifier() == OBJ_OLE2 && ScDocument::IsChart(pObject) ) + if ( pObject->GetObjIdentifier() == SdrObjKind::OLE2 && ScDocument::IsChart(pObject) ) { if ( nPos == nIndex ) { @@ -153,7 +153,7 @@ void SAL_CALL ScChartsObj::addNewByName( const OUString& rName, OUString aName = rName; SCTAB nDummy; - if ( !aName.isEmpty() && pModel->GetNamedObject( aName, OBJ_OLE2, nDummy ) ) + if ( !aName.isEmpty() && pModel->GetNamedObject( aName, SdrObjKind::OLE2, nDummy ) ) { // object exists - only RuntimeException is specified throw uno::RuntimeException(); @@ -309,7 +309,7 @@ sal_Int32 SAL_CALL ScChartsObj::getCount() SdrObject* pObject = aIter.Next(); while (pObject) { - if ( pObject->GetObjIdentifier() == OBJ_OLE2 && ScDocument::IsChart(pObject) ) + if ( pObject->GetObjIdentifier() == SdrObjKind::OLE2 && ScDocument::IsChart(pObject) ) ++nCount; pObject = aIter.Next(); } @@ -374,7 +374,7 @@ uno::Sequence<OUString> SAL_CALL ScChartsObj::getElementNames() SdrObject* pObject = aIter.Next(); while (pObject) { - if ( pObject->GetObjIdentifier() == OBJ_OLE2 && ScDocument::IsChart(pObject) ) + if ( pObject->GetObjIdentifier() == SdrObjKind::OLE2 && ScDocument::IsChart(pObject) ) { OUString aName; uno::Reference < embed::XEmbeddedObject > xObj = static_cast<SdrOle2Obj*>(pObject)->GetObjRef(); diff --git a/sc/source/ui/view/dbfunc4.cxx b/sc/source/ui/view/dbfunc4.cxx index 64f444dbf51b..f13035b29108 100644 --- a/sc/source/ui/view/dbfunc4.cxx +++ b/sc/source/ui/view/dbfunc4.cxx @@ -46,7 +46,7 @@ sal_uInt16 ScDBFunc::DoUpdateCharts(const ScAddress& rPos, ScDocument& rDoc, boo SdrObject* pObject = aIter.Next(); while (pObject) { - if (pObject->GetObjIdentifier() == OBJ_OLE2 && ScDocument::IsChart(pObject)) + if (pObject->GetObjIdentifier() == SdrObjKind::OLE2 && ScDocument::IsChart(pObject)) { OUString aName = static_cast<SdrOle2Obj*>(pObject)->GetPersistName(); bool bHit = true; diff --git a/sc/source/ui/view/drawvie4.cxx b/sc/source/ui/view/drawvie4.cxx index 2887f26811cd..9efc96a34e08 100644 --- a/sc/source/ui/view/drawvie4.cxx +++ b/sc/source/ui/view/drawvie4.cxx @@ -210,8 +210,8 @@ void getOleSourceRanges(const SdrMarkList& rMarkList, bool& rAnyOle, bool& rOneO if ( !pObj ) continue; - sal_uInt16 nSdrObjKind = pObj->GetObjIdentifier(); - if (nSdrObjKind == OBJ_OLE2) + SdrObjKind nSdrObjKind = pObj->GetObjIdentifier(); + if (nSdrObjKind == SdrObjKind::OLE2) { rAnyOle = true; rOneOle = (nCount == 1); @@ -226,7 +226,7 @@ void getOleSourceRanges(const SdrMarkList& rMarkList, bool& rAnyOle, bool& rOneO SdrObject* pSubObj = aIter.Next(); while (pSubObj) { - if ( pSubObj->GetObjIdentifier() == OBJ_OLE2 ) + if ( pSubObj->GetObjIdentifier() == SdrObjKind::OLE2 ) { rAnyOle = true; // rOneOle remains false - a group isn't treated like a single OLE object @@ -438,10 +438,10 @@ void ScDrawView::SetMarkedOriginalSize() for (size_t i=0; i<nCount; ++i) { SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj(); - sal_uInt16 nIdent = pObj->GetObjIdentifier(); + SdrObjKind nIdent = pObj->GetObjIdentifier(); bool bDo = false; Size aOriginalSize; - if (nIdent == OBJ_OLE2) + if (nIdent == SdrObjKind::OLE2) { // TODO/LEAN: working with visual area can switch object to running state uno::Reference < embed::XEmbeddedObject > xObj = static_cast<SdrOle2Obj*>(pObj)->GetObjRef(); @@ -473,7 +473,7 @@ void ScDrawView::SetMarkedOriginalSize() } } } - else if (nIdent == OBJ_GRAF) + else if (nIdent == SdrObjKind::Graphic) { const Graphic& rGraphic = static_cast<SdrGrafObj*>(pObj)->GetGraphic(); @@ -565,7 +565,7 @@ void ScDrawView::FitToCellSize() } pUndoGroup->AddAction( std::make_unique<SdrUndoGeoObj>( *pObj ) ); - if (pObj->GetObjIdentifier() == OBJ_CUSTOMSHAPE) + if (pObj->GetObjIdentifier() == SdrObjKind::CustomShape) pObj->AdjustToMaxRect(aCellRect); else pObj->SetSnapRect(aCellRect); diff --git a/sc/source/ui/view/drawview.cxx b/sc/source/ui/view/drawview.cxx index 0254e62fb2be..71dd9809b0d0 100644 --- a/sc/source/ui/view/drawview.cxx +++ b/sc/source/ui/view/drawview.cxx @@ -402,7 +402,7 @@ void ScDrawView::MarkListHasChanged() if (nMarkCount == 1) { SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj(); - if (pObj->GetObjIdentifier() == OBJ_OLE2) + if (pObj->GetObjIdentifier() == SdrObjKind::OLE2) { pOle2Obj = static_cast<SdrOle2Obj*>(pObj); if (!ScDocument::IsChart(pObj) ) @@ -411,18 +411,18 @@ void ScDrawView::MarkListHasChanged() pViewSh->SetChartShell(true); bSubShellSet = true; } - else if (pObj->GetObjIdentifier() == OBJ_GRAF) + else if (pObj->GetObjIdentifier() == SdrObjKind::Graphic) { pGrafObj = static_cast<SdrGrafObj*>(pObj); pViewSh->SetGraphicShell(true); bSubShellSet = true; } - else if (pObj->GetObjIdentifier() == OBJ_MEDIA) + else if (pObj->GetObjIdentifier() == SdrObjKind::Media) { pViewSh->SetMediaShell(true); bSubShellSet = true; } - else if (pObj->GetObjIdentifier() != OBJ_TEXT // prevent switching to the drawing shell + else if (pObj->GetObjIdentifier() != SdrObjKind::Text // prevent switching to the drawing shell || !pViewSh->IsDrawTextShell()) // when creating a text object @#70206# { pViewSh->SetDrawShell(true); @@ -453,7 +453,7 @@ void ScDrawView::MarkListHasChanged() if (dynamic_cast<const SdrUnoObj*>( pSubObj) == nullptr) bOnlyControls = false; - if (pSubObj->GetObjIdentifier() != OBJ_GRAF) + if (pSubObj->GetObjIdentifier() != SdrObjKind::Graphic) bOnlyGraf = false; if ( !bOnlyControls && !bOnlyGraf ) break; @@ -463,7 +463,7 @@ void ScDrawView::MarkListHasChanged() { if (dynamic_cast<const SdrUnoObj*>( pObj) == nullptr) bOnlyControls = false; - if (pObj->GetObjIdentifier() != OBJ_GRAF) + if (pObj->GetObjIdentifier() != SdrObjKind::Graphic) bOnlyGraf = false; } diff --git a/sc/source/ui/view/tabvwsh2.cxx b/sc/source/ui/view/tabvwsh2.cxx index a096a766ea7d..0c3b35f56442 100644 --- a/sc/source/ui/view/tabvwsh2.cxx +++ b/sc/source/ui/view/tabvwsh2.cxx @@ -97,7 +97,7 @@ void ScTabViewShell::ExecDraw(SfxRequest& rReq) if ( nNewId == SID_DRAW_SELECT ) nNewId = SID_OBJECT_SELECT; - SdrObjKind eNewFormObjKind = OBJ_NONE; + SdrObjKind eNewFormObjKind = SdrObjKind::NONE; if (nNewId == SID_FM_CREATE_CONTROL) { const SfxUInt16Item* pIdentifierItem = rReq.GetArg<SfxUInt16Item>(SID_FM_CONTROL_IDENTIFIER); @@ -132,7 +132,7 @@ void ScTabViewShell::ExecDraw(SfxRequest& rReq) bEx = true; } else if ( nNewId == nDrawSfxId && ( nNewId != SID_FM_CREATE_CONTROL || - eNewFormObjKind == eFormObjKind || eNewFormObjKind == OBJ_NONE ) && !bSwitchCustom ) + eNewFormObjKind == eFormObjKind || eNewFormObjKind == SdrObjKind::NONE ) && !bSwitchCustom ) { // #i52871# if a different custom shape is selected, the slot id can be the same, // so the custom shape type string has to be compared, too. diff --git a/sc/source/ui/view/tabvwshb.cxx b/sc/source/ui/view/tabvwshb.cxx index 3d545dd109aa..374e8a667973 100644 --- a/sc/source/ui/view/tabvwshb.cxx +++ b/sc/source/ui/view/tabvwshb.cxx @@ -272,7 +272,7 @@ ErrCode ScTabViewShell::DoVerb(sal_Int32 nVerb) if (rMarkList.GetMarkCount() == 1) { SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj(); - if (pObj->GetObjIdentifier() == OBJ_OLE2) + if (pObj->GetObjIdentifier() == SdrObjKind::OLE2) pOle2Obj = static_cast<SdrOle2Obj*>(pObj); } @@ -450,9 +450,9 @@ void ScTabViewShell::ExecDrawIns(SfxRequest& rReq) SdrMark* pMark = rMarkList.GetMark(0); SdrObject* pObj = pMark->GetMarkedSdrObj(); - sal_uInt16 nSdrObjKind = pObj->GetObjIdentifier(); + SdrObjKind nSdrObjKind = pObj->GetObjIdentifier(); - if (nSdrObjKind == OBJ_OLE2) + if (nSdrObjKind == SdrObjKind::OLE2) { if ( static_cast<SdrOle2Obj*>(pObj)->GetObjRef().is() ) { diff --git a/sc/source/ui/view/tabvwshg.cxx b/sc/source/ui/view/tabvwshg.cxx index 26d67585301b..365d51117292 100644 --- a/sc/source/ui/view/tabvwshg.cxx +++ b/sc/source/ui/view/tabvwshg.cxx @@ -63,7 +63,7 @@ void ScTabViewShell::InsertURLButton( const OUString& rName, const OUString& rUR SdrObject* pObj = SdrObjFactory::MakeNewObject( *pModel, SdrInventor::FmForm, - OBJ_FM_BUTTON); + SdrObjKind::FormButton); SdrUnoObj* pUnoCtrl = dynamic_cast<SdrUnoObj*>( pObj ); OSL_ENSURE( pUnoCtrl, "no SdrUnoObj"); diff --git a/sc/source/ui/view/tabvwshh.cxx b/sc/source/ui/view/tabvwshh.cxx index 8eb262187b0e..4e45f0153a21 100644 --- a/sc/source/ui/view/tabvwshh.cxx +++ b/sc/source/ui/view/tabvwshh.cxx @@ -141,7 +141,7 @@ static uno::Reference < embed::XEmbeddedObject > lcl_GetSelectedObj( const SdrVi if (rMarkList.GetMarkCount() == 1) { SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj(); - if (pObj->GetObjIdentifier() == OBJ_OLE2) + if (pObj->GetObjIdentifier() == SdrObjKind::OLE2) { SdrOle2Obj* pOle2Obj = static_cast<SdrOle2Obj*>(pObj); xRet = pOle2Obj->GetObjRef(); diff --git a/sd/inc/sdmod.hxx b/sd/inc/sdmod.hxx index 18440f688230..047a78fa21ae 100644 --- a/sd/inc/sdmod.hxx +++ b/sd/inc/sdmod.hxx @@ -44,6 +44,7 @@ class SfxFrame; struct SfxItemPropertyMapEntry; class VclSimpleEvent; namespace svtools { class ColorConfig; } +enum class SdrObjKind : sal_uInt16; namespace com::sun::star::frame { class XFrame; @@ -56,7 +57,7 @@ enum class SdOptionStreamMode }; typedef std::map< SfxItemPropertyMapEntry const * , css::uno::Reference<css::beans::XPropertySetInfo> > SdExtPropertySetInfoCache; -typedef std::map< sal_uInt32, css::uno::Sequence< css::uno::Type> > SdTypesCache; +typedef std::map< SdrObjKind, css::uno::Sequence< css::uno::Type> > SdTypesCache; /* diff --git a/sd/qa/unit/export-tests-ooxml1.cxx b/sd/qa/unit/export-tests-ooxml1.cxx index 9efb79ae9cf1..22435dd51d78 100644 --- a/sd/qa/unit/export-tests-ooxml1.cxx +++ b/sd/qa/unit/export-tests-ooxml1.cxx @@ -1152,7 +1152,7 @@ void SdOOXMLExportTest1::testTdf111884() CPPUNIT_ASSERT_MESSAGE("no shape", pShape != nullptr); // must be a group shape - CPPUNIT_ASSERT_EQUAL(OBJ_GRUP, pShape->GetObjIdentifier()); + CPPUNIT_ASSERT_EQUAL(SdrObjKind::Group, pShape->GetObjIdentifier()); xDocShRef->DoClose(); } diff --git a/sd/qa/unit/export-tests-ooxml2.cxx b/sd/qa/unit/export-tests-ooxml2.cxx index 4b980cafdfa6..4ab2a893e1f0 100644 --- a/sd/qa/unit/export-tests-ooxml2.cxx +++ b/sd/qa/unit/export-tests-ooxml2.cxx @@ -294,7 +294,7 @@ void SdOOXMLExportTest2::testBnc822341() const SdrObject* pObj = pPage->GetObj(0); CPPUNIT_ASSERT_MESSAGE( "no object", pObj != nullptr); - CPPUNIT_ASSERT_EQUAL( OBJ_OLE2, pObj->GetObjIdentifier() ); + CPPUNIT_ASSERT_EQUAL( SdrObjKind::OLE2, pObj->GetObjIdentifier() ); } utl::TempFile tempFile2; @@ -327,7 +327,7 @@ void SdOOXMLExportTest2::testBnc822341() const SdrObject* pObj = pPage->GetObj(0); CPPUNIT_ASSERT_MESSAGE( "no object", pObj != nullptr); - CPPUNIT_ASSERT_EQUAL( OBJ_OLE2, pObj->GetObjIdentifier() ); + CPPUNIT_ASSERT_EQUAL( SdrObjKind::OLE2, pObj->GetObjIdentifier() ); } xDocShRef->DoClose(); @@ -354,7 +354,7 @@ void SdOOXMLExportTest2::testMathObject() const SdrPage *pPage = GetPage(1, xDocShRef); const SdrObject* pObj = pPage->GetObj(0); CPPUNIT_ASSERT_MESSAGE("no object", pObj != nullptr); - CPPUNIT_ASSERT_EQUAL(OBJ_OLE2, pObj->GetObjIdentifier()); + CPPUNIT_ASSERT_EQUAL(SdrObjKind::OLE2, pObj->GetObjIdentifier()); } utl::TempFile tempFile2; @@ -374,7 +374,7 @@ void SdOOXMLExportTest2::testMathObject() const SdrPage *pPage = GetPage(1, xDocShRef); const SdrObject* pObj = pPage->GetObj(0); CPPUNIT_ASSERT_MESSAGE("no object", pObj != nullptr); - CPPUNIT_ASSERT_EQUAL(OBJ_OLE2, pObj->GetObjIdentifier()); + CPPUNIT_ASSERT_EQUAL(SdrObjKind::OLE2, pObj->GetObjIdentifier()); } xDocShRef->DoClose(); @@ -401,7 +401,7 @@ void SdOOXMLExportTest2::testMathObjectPPT2010() const SdrPage *pPage = GetPage(1, xDocShRef); const SdrObject* pObj = pPage->GetObj(0); CPPUNIT_ASSERT_MESSAGE("no object", pObj != nullptr); - CPPUNIT_ASSERT_EQUAL(OBJ_OLE2, pObj->GetObjIdentifier()); + CPPUNIT_ASSERT_EQUAL(SdrObjKind::OLE2, pObj->GetObjIdentifier()); } xDocShRef->DoClose(); diff --git a/sd/qa/unit/export-tests-ooxml3.cxx b/sd/qa/unit/export-tests-ooxml3.cxx index 8f150f702770..437f1906dd97 100644 --- a/sd/qa/unit/export-tests-ooxml3.cxx +++ b/sd/qa/unit/export-tests-ooxml3.cxx @@ -1559,7 +1559,7 @@ void SdOOXMLExportTest3::testTdf129372() const SdrObject* pObj = pPage->GetObj(0); CPPUNIT_ASSERT_MESSAGE("no object", pObj != nullptr); - CPPUNIT_ASSERT_EQUAL(OBJ_OLE2, pObj->GetObjIdentifier()); + CPPUNIT_ASSERT_EQUAL(SdrObjKind::OLE2, pObj->GetObjIdentifier()); } void SdOOXMLExportTest3::testShapeGlowEffect() diff --git a/sd/qa/unit/import-tests-smartart.cxx b/sd/qa/unit/import-tests-smartart.cxx index 68555d365cae..91773929a05d 100644 --- a/sd/qa/unit/import-tests-smartart.cxx +++ b/sd/qa/unit/import-tests-smartart.cxx @@ -1590,7 +1590,7 @@ void SdImportTestSmartArt::testTdf131553() CPPUNIT_ASSERT(pObjGroup); const SdrObject* pObj = pObjGroup->GetSubList()->GetObj(1); CPPUNIT_ASSERT_MESSAGE("no object", pObj != nullptr); - CPPUNIT_ASSERT_EQUAL(OBJ_OLE2, pObj->GetObjIdentifier()); + CPPUNIT_ASSERT_EQUAL(SdrObjKind::OLE2, pObj->GetObjIdentifier()); xDocShRef->DoClose(); } diff --git a/sd/qa/unit/tiledrendering/LOKitSearchTest.cxx b/sd/qa/unit/tiledrendering/LOKitSearchTest.cxx index 8bb2144bbe80..7f486b910ac2 100644 --- a/sd/qa/unit/tiledrendering/LOKitSearchTest.cxx +++ b/sd/qa/unit/tiledrendering/LOKitSearchTest.cxx @@ -634,7 +634,7 @@ void LOKitSearchTest::testSearchIn2MixedObjects() SdrObject* pObject = pPage->GetObj(0); CPPUNIT_ASSERT(pObject); - CPPUNIT_ASSERT_EQUAL(OBJ_TEXT, pObject->GetObjIdentifier()); + CPPUNIT_ASSERT_EQUAL(SdrObjKind::Text, pObject->GetObjIdentifier()); } // Check Object 2 @@ -642,7 +642,7 @@ void LOKitSearchTest::testSearchIn2MixedObjects() SdrObject* pObject = pPage->GetObj(1); CPPUNIT_ASSERT(pObject); - CPPUNIT_ASSERT_EQUAL(OBJ_GRAF, pObject->GetObjIdentifier()); + CPPUNIT_ASSERT_EQUAL(SdrObjKind::Graphic, pObject->GetObjIdentifier()); SdrGrafObj* pGraphicObject = dynamic_cast<SdrGrafObj*>(pObject); CPPUNIT_ASSERT(pGraphicObject); @@ -725,14 +725,14 @@ void LOKitSearchTest::testSearchIn6MixedObjects() { SdrObject* pObject = pPage->GetObj(0); CPPUNIT_ASSERT(pObject); - CPPUNIT_ASSERT_EQUAL(OBJ_TEXT, pObject->GetObjIdentifier()); + CPPUNIT_ASSERT_EQUAL(SdrObjKind::Text, pObject->GetObjIdentifier()); } // Check Object 2 { SdrObject* pObject = pPage->GetObj(1); CPPUNIT_ASSERT(pObject); - CPPUNIT_ASSERT_EQUAL(OBJ_GRAF, pObject->GetObjIdentifier()); + CPPUNIT_ASSERT_EQUAL(SdrObjKind::Graphic, pObject->GetObjIdentifier()); SdrGrafObj* pGraphicObject = dynamic_cast<SdrGrafObj*>(pObject); CPPUNIT_ASSERT(pGraphicObject); auto const& pVectorGraphicData = pGraphicObject->GetGraphic().getVectorGraphicData(); @@ -744,21 +744,21 @@ void LOKitSearchTest::testSearchIn6MixedObjects() { SdrObject* pObject = pPage->GetObj(2); CPPUNIT_ASSERT(pObject); - CPPUNIT_ASSERT_EQUAL(OBJ_CUSTOMSHAPE, pObject->GetObjIdentifier()); + CPPUNIT_ASSERT_EQUAL(SdrObjKind::CustomShape, pObject->GetObjIdentifier()); } // Check Object 4 { SdrObject* pObject = pPage->GetObj(3); CPPUNIT_ASSERT(pObject); - CPPUNIT_ASSERT_EQUAL(OBJ_CUSTOMSHAPE, pObject->GetObjIdentifier()); + CPPUNIT_ASSERT_EQUAL(SdrObjKind::CustomShape, pObject->GetObjIdentifier()); } // Check Object 5 { SdrObject* pObject = pPage->GetObj(4); CPPUNIT_ASSERT(pObject); - CPPUNIT_ASSERT_EQUAL(OBJ_GRAF, pObject->GetObjIdentifier()); + CPPUNIT_ASSERT_EQUAL(SdrObjKind::Graphic, pObject->GetObjIdentifier()); SdrGrafObj* pGraphicObject = dynamic_cast<SdrGrafObj*>(pObject); CPPUNIT_ASSERT(pGraphicObject); auto const& pVectorGraphicData = pGraphicObject->GetGraphic().getVectorGraphicData(); @@ -770,7 +770,7 @@ void LOKitSearchTest::testSearchIn6MixedObjects() { SdrObject* pObject = pPage->GetObj(5); CPPUNIT_ASSERT(pObject); - CPPUNIT_ASSERT_EQUAL(OBJ_GRAF, pObject->GetObjIdentifier()); + CPPUNIT_ASSERT_EQUAL(SdrObjKind::Graphic, pObject->GetObjIdentifier()); SdrGrafObj* pGraphicObject = dynamic_cast<SdrGrafObj*>(pObject); CPPUNIT_ASSERT(pGraphicObject); auto const& pVectorGraphicData = pGraphicObject->GetGraphic().getVectorGraphicData(); diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx b/sd/qa/unit/tiledrendering/tiledrendering.cxx index 166859cb87d5..c1fcca8be963 100644 --- a/sd/qa/unit/tiledrendering/tiledrendering.cxx +++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx @@ -437,7 +437,7 @@ void SdTiledRenderingTest::testPostKeyEvent() sd::ViewShell* pViewShell = pXImpressDocument->GetDocShell()->GetViewShell(); SdPage* pActualPage = pViewShell->GetActualPage(); SdrObject* pObject = pActualPage->GetObj(0); - CPPUNIT_ASSERT_EQUAL(OBJ_TITLETEXT, pObject->GetObjIdentifier()); + CPPUNIT_ASSERT_EQUAL(SdrObjKind::TitleText, pObject->GetObjIdentifier()); SdrTextObj* pTextObj = static_cast<SdrTextObj*>(pObject); SdrView* pView = pViewShell->GetView(); pView->MarkObj(pTextObj, pView->GetSdrPageView()); @@ -465,7 +465,7 @@ void SdTiledRenderingTest::testPostMouseEvent() sd::ViewShell* pViewShell = pXImpressDocument->GetDocShell()->GetViewShell(); SdPage* pActualPage = pViewShell->GetActualPage(); SdrObject* pObject = pActualPage->GetObj(0); - CPPUNIT_ASSERT_EQUAL(OBJ_TITLETEXT, pObject->GetObjIdentifier()); + CPPUNIT_ASSERT_EQUAL(SdrObjKind::TitleText, pObject->GetObjIdentifier()); SdrTextObj* pTextObj = static_cast<SdrTextObj*>(pObject); SdrView* pView = pViewShell->GetView(); pView->MarkObj(pTextObj, pView->GetSdrPageView()); @@ -1145,7 +1145,7 @@ void SdTiledRenderingTest::testCursorVisibility_SingleClick() SdPage* pActualPage = pViewShell->GetActualPage(); SdrObject* pObject1 = pActualPage->GetObj(0); CPPUNIT_ASSERT(pObject1 != nullptr); - CPPUNIT_ASSERT_EQUAL(OBJ_TITLETEXT, pObject1->GetObjIdentifier()); + CPPUNIT_ASSERT_EQUAL(SdrObjKind::TitleText, pObject1->GetObjIdentifier()); SdrTextObj* pTextObject = static_cast<SdrTextObj*>(pObject1); // Click once outside of the text (in the first quartile) => no editing. @@ -1194,7 +1194,7 @@ void SdTiledRenderingTest::testCursorVisibility_DoubleClick() SdPage* pActualPage = pViewShell->GetActualPage(); SdrObject* pObject1 = pActualPage->GetObj(0); CPPUNIT_ASSERT(pObject1 != nullptr); - CPPUNIT_ASSERT_EQUAL(OBJ_TITLETEXT, pObject1->GetObjIdentifier()); + CPPUNIT_ASSERT_EQUAL(SdrObjKind::TitleText, pObject1->GetObjIdentifier()); SdrTextObj* pTextObject = static_cast<SdrTextObj*>(pObject1); // Double-click outside the text to enter edit mode. @@ -1226,7 +1226,7 @@ void SdTiledRenderingTest::testCursorVisibility_MultiView() SdPage* pActualPage = pViewShell->GetActualPage(); SdrObject* pObject1 = pActualPage->GetObj(0); CPPUNIT_ASSERT(pObject1); - CPPUNIT_ASSERT_EQUAL(OBJ_TITLETEXT, pObject1->GetObjIdentifier()); + CPPUNIT_ASSERT_EQUAL(SdrObjKind::TitleText, pObject1->GetObjIdentifier()); SdrTextObj* pTextObject = static_cast<SdrTextObj*>(pObject1); // Make sure that cursor state is not changed just because we create a second view. @@ -1274,7 +1274,7 @@ void SdTiledRenderingTest::testCursorVisibility_Escape() SdPage* pActualPage = pViewShell->GetActualPage(); SdrObject* pObject1 = pActualPage->GetObj(0); CPPUNIT_ASSERT(pObject1 != nullptr); - CPPUNIT_ASSERT_EQUAL(OBJ_TITLETEXT, pObject1->GetObjIdentifier()); + CPPUNIT_ASSERT_EQUAL(SdrObjKind::TitleText, pObject1->GetObjIdentifier()); SdrTextObj* pTextObject = static_cast<SdrTextObj*>(pObject1); // Click once on the text to start editing. @@ -1597,7 +1597,7 @@ void SdTiledRenderingTest::testTdf103083() SdPage* pActualPage = pViewShell->GetActualPage(); SdrObject* pObject1 = pActualPage->GetObj(1); - CPPUNIT_ASSERT_EQUAL(OBJ_OUTLINETEXT, pObject1->GetObjIdentifier()); + CPPUNIT_ASSERT_EQUAL(SdrObjKind::OutlineText, pObject1->GetObjIdentifier()); SdrTextObj* pTextObject = static_cast<SdrTextObj*>(pObject1); SdrView* pView = pViewShell->GetView(); @@ -2069,7 +2069,7 @@ void SdTiledRenderingTest::testMultiViewInsertDeletePage2() SdPage* pActualPage = pViewShell->GetActualPage(); SdrObject* pObject1 = pActualPage->GetObj(0); CPPUNIT_ASSERT(pObject1 != nullptr); - CPPUNIT_ASSERT_EQUAL(OBJ_TITLETEXT, pObject1->GetObjIdentifier()); + CPPUNIT_ASSERT_EQUAL(SdrObjKind::TitleText, pObject1->GetObjIdentifier()); SdrTextObj* pTextObject = static_cast<SdrTextObj*>(pObject1); // Double-click outside the text to enter edit mode. @@ -2472,7 +2472,7 @@ void SdTiledRenderingTest::testPasteTextOnSlide() CPPUNIT_ASSERT(pObject); SdrTextObj* pTextObj = dynamic_cast<SdrTextObj*>(pObject); CPPUNIT_ASSERT(pTextObj); - CPPUNIT_ASSERT_EQUAL(OBJ_TEXT, pTextObj->GetObjIdentifier()); + CPPUNIT_ASSERT_EQUAL(SdrObjKind::Text, pTextObj->GetObjIdentifier()); // This test is unreliable: it gives alternating results for the following coordinates. // As a compromise, instead of disabling it altogether, we allow for both sets of values. const Point aPos = pTextObj->GetLastBoundRect().TopLeft(); diff --git a/sd/source/core/CustomAnimationEffect.cxx b/sd/source/core/CustomAnimationEffect.cxx index 4477ec35ed83..cf6dcadc1b86 100644 --- a/sd/source/core/CustomAnimationEffect.cxx +++ b/sd/source/core/CustomAnimationEffect.cxx @@ -1568,7 +1568,7 @@ bool CustomAnimationEffect::getStopAudio() const SdrPathObj* CustomAnimationEffect::createSdrPathObjFromPath(SdrModel& rTargetModel) { - SdrPathObj * pPathObj = new SdrPathObj(rTargetModel, OBJ_PATHLINE); + SdrPathObj * pPathObj = new SdrPathObj(rTargetModel, SdrObjKind::PathLine); updateSdrPathObjFromPath( *pPathObj ); return pPathObj; } diff --git a/sd/source/core/EffectMigration.cxx b/sd/source/core/EffectMigration.cxx index fe531f2b9667..326fa74abcec 100644 --- a/sd/source/core/EffectMigration.cxx +++ b/sd/source/core/EffectMigration.cxx @@ -515,7 +515,7 @@ void EffectMigration::SetAnimationEffect( SvxShape* pShape, AnimationEffect eEff pMainSequence->append( pEffect ); - if( ( pObj->GetObjInventor() == SdrInventor::Default ) && ( pObj->GetObjIdentifier() == OBJ_OUTLINETEXT ) ) + if( ( pObj->GetObjInventor() == SdrInventor::Default ) && ( pObj->GetObjIdentifier() == SdrObjKind::OutlineText ) ) { // special case for outline text, effects are always mapped to text group effect pMainSequence-> diff --git a/sd/source/core/drawdoc.cxx b/sd/source/core/drawdoc.cxx index 953afd909302..d765e3639288 100644 --- a/sd/source/core/drawdoc.cxx +++ b/sd/source/core/drawdoc.cxx @@ -857,9 +857,9 @@ void SdDrawDocument::NewOrLoadCompleted( SdPage* pPage, SdStyleSheetPool* pSPool if (pObj->GetObjInventor() == SdrInventor::Default) { OutlinerParaObject* pOPO = pObj->GetOutlinerParaObject(); - sal_uInt16 nId = pObj->GetObjIdentifier(); + SdrObjKind nId = pObj->GetObjIdentifier(); - if (nId == OBJ_TITLETEXT) + if (nId == SdrObjKind::TitleText) { if( pOPO && pOPO->GetOutlinerMode() == OutlinerMode::DontKnow ) pOPO->SetOutlinerMode( OutlinerMode::TitleObject ); @@ -868,7 +868,7 @@ void SdDrawDocument::NewOrLoadCompleted( SdPage* pPage, SdStyleSheetPool* pSPool if (pTitleSheet) pObj->SetStyleSheet(pTitleSheet, true); } - else if (nId == OBJ_OUTLINETEXT) + else if (nId == SdrObjKind::OutlineText) { if( pOPO && pOPO->GetOutlinerMode() == OutlinerMode::DontKnow ) pOPO->SetOutlinerMode( OutlinerMode::OutlineObject ); diff --git a/sd/source/core/drawdoc2.cxx b/sd/source/core/drawdoc2.cxx index c17910d686e3..d0187bab0f8c 100644 --- a/sd/source/core/drawdoc2.cxx +++ b/sd/source/core/drawdoc2.cxx @@ -84,7 +84,7 @@ SdrObject* SdDrawDocument::GetObj(std::u16string_view rObjName) const if( ( pObj->GetName() == rObjName ) || ( SdrInventor::Default == pObj->GetObjInventor() && - OBJ_OLE2 == pObj->GetObjIdentifier() && + SdrObjKind::OLE2 == pObj->GetObjIdentifier() && rObjName == static_cast< SdrOle2Obj* >( pObj )->GetPersistName() ) ) { pObjFound = pObj; @@ -109,7 +109,7 @@ SdrObject* SdDrawDocument::GetObj(std::u16string_view rObjName) const if( ( pObj->GetName() == rObjName ) || ( SdrInventor::Default == pObj->GetObjInventor() && - OBJ_OLE2 == pObj->GetObjIdentifier() && + SdrObjKind::OLE2 == pObj->GetObjIdentifier() && rObjName == static_cast< SdrOle2Obj* >( pObj )->GetPersistName() ) ) { pObjFound = pObj; @@ -248,7 +248,7 @@ void SdDrawDocument::UpdatePageObjectsInNotes(sal_uInt16 nStartPos) for (size_t nObj = 0; nObj < nObjCount; ++nObj) { SdrObject* pObj = pPage->GetObj(nObj); - if (pObj->GetObjIdentifier() == OBJ_PAGE && + if (pObj->GetObjIdentifier() == SdrObjKind::Page && pObj->GetObjInventor() == SdrInventor::Default) { // The page object is the preceding page (drawing page) diff --git a/sd/source/core/drawdoc3.cxx b/sd/source/core/drawdoc3.cxx index 556dfa15f1a9..e25e8199d0e2 100644 --- a/sd/source/core/drawdoc3.cxx +++ b/sd/source/core/drawdoc3.cxx @@ -994,7 +994,7 @@ bool SdDrawDocument::InsertBookmarkAsObject( { // Found an object if (pObj->GetObjInventor() == SdrInventor::Default && - pObj->GetObjIdentifier() == OBJ_OLE2) + pObj->GetObjIdentifier() == SdrObjKind::OLE2) { bOLEObjFound = true; } diff --git a/sd/source/core/drawdoc4.cxx b/sd/source/core/drawdoc4.cxx index 62f0936ff4bb..3c75dd4315e1 100644 --- a/sd/source/core/drawdoc4.cxx +++ b/sd/source/core/drawdoc4.cxx @@ -882,7 +882,7 @@ void SdDrawDocument::FillOnlineSpellingList(SdPage const * pPage) // Found a text object mpOnlineSpellingList->addShape(*pObj); } - else if (pObj->GetObjIdentifier() == OBJ_GRUP) + else if (pObj->GetObjIdentifier() == SdrObjKind::Group) { // Found a group object SdrObjListIter aGroupIter(static_cast< SdrObjGroup* >(pObj)->GetSubList(), SdrIterMode::DeepNoGroups); @@ -922,7 +922,7 @@ IMPL_LINK_NOARG(SdDrawDocument, OnlineSpellingHdl, Timer *, void) // Spell text object SpellObject(static_cast<SdrTextObj*>(pObj)); } - else if (pObj->GetObjIdentifier() == OBJ_GRUP) + else if (pObj->GetObjIdentifier() == SdrObjKind::Group) { // Found a group object SdrObjListIter aGroupIter(static_cast< SdrObjGroup* >(pObj)->GetSubList(), SdrIterMode::DeepNoGroups); @@ -970,7 +970,7 @@ void SdDrawDocument::SpellObject(SdrTextObj* pObj) OutlinerMode nOldOutlMode = pOutl->GetOutlinerMode(); OutlinerMode nOutlMode = OutlinerMode::TextObject; if (pObj->GetObjInventor() == SdrInventor::Default && - pObj->GetObjIdentifier() == OBJ_OUTLINETEXT) + pObj->GetObjIdentifier() == SdrObjKind::OutlineText) { nOutlMode = OutlinerMode::OutlineObject; } @@ -1013,7 +1013,7 @@ void SdDrawDocument::InsertObject(SdrObject* pObj) { if(mpOnlineSpellingList && pObj) { - if (pObj->GetOutlinerParaObject() || (pObj->GetObjIdentifier() == OBJ_GRUP)) + if (pObj->GetOutlinerParaObject() || (pObj->GetObjIdentifier() == SdrObjKind::Group)) { // Add object to OnlineSpelling list mpOnlineSpellingList->addShape(*pObj); @@ -1026,7 +1026,7 @@ void SdDrawDocument::RemoveObject(SdrObject* pObj) { if(mpOnlineSpellingList && pObj) { - if (pObj->GetOutlinerParaObject() || (pObj->GetObjIdentifier() == OBJ_GRUP)) + if (pObj->GetOutlinerParaObject() || (pObj->GetObjIdentifier() == SdrObjKind::Group)) { // Replace object in OnlineSpelling list by 0 pointer mpOnlineSpellingList->removeShape(*pObj); @@ -1166,9 +1166,9 @@ void SdDrawDocument::RenameLayoutTemplate(const OUString& rOldLayoutName, const { switch( pObj->GetObjIdentifier() ) { - case OBJ_TEXT: - case OBJ_OUTLINETEXT: - case OBJ_TITLETEXT: + case SdrObjKind::Text: + case SdrObjKind::OutlineText: + case SdrObjKind::TitleText: { OutlinerParaObject* pOPO = static_cast<SdrTextObj*>(pObj)->GetOutlinerParaObject(); @@ -1208,9 +1208,9 @@ void SdDrawDocument::RenameLayoutTemplate(const OUString& rOldLayoutName, const { switch(pObj->GetObjIdentifier()) { - case OBJ_TEXT: - case OBJ_OUTLINETEXT: - case OBJ_TITLETEXT: + case SdrObjKind::Text: + case SdrObjKind::OutlineText: + case SdrObjKind::TitleText: { OutlinerParaObject* pOPO = static_cast<SdrTextObj*>(pObj)->GetOutlinerParaObject(); diff --git a/sd/source/core/sdpage.cxx b/sd/source/core/sdpage.cxx index 1a8a6bd427d1..5221fd718c54 100644 --- a/sd/source/core/sdpage.cxx +++ b/sd/source/core/sdpage.cxx @@ -288,7 +288,7 @@ SdrObject* SdPage::CreatePresObj(PresObjKind eObjKind, bool bVertical, const ::t { case PresObjKind::Title: { - pSdrObj = new SdrRectObj(getSdrModelFromSdrPage(), OBJ_TITLETEXT); + pSdrObj = new SdrRectObj(getSdrModelFromSdrPage(), SdrObjKind::TitleText); if (mbMaster) { @@ -299,7 +299,7 @@ SdrObject* SdPage::CreatePresObj(PresObjKind eObjKind, bool bVertical, const ::t case PresObjKind::Outline: { - pSdrObj = new SdrRectObj(getSdrModelFromSdrPage(), OBJ_OUTLINETEXT); + pSdrObj = new SdrRectObj(getSdrModelFromSdrPage(), SdrObjKind::OutlineText); if (mbMaster) { @@ -310,7 +310,7 @@ SdrObject* SdPage::CreatePresObj(PresObjKind eObjKind, bool bVertical, const ::t case PresObjKind::Notes: { - pSdrObj = new SdrRectObj(getSdrModelFromSdrPage(), OBJ_TEXT); + pSdrObj = new SdrRectObj(getSdrModelFromSdrPage(), SdrObjKind::Text); if (mbMaster) { @@ -321,7 +321,7 @@ SdrObject* SdPage::CreatePresObj(PresObjKind eObjKind, bool bVertical, const ::t case PresObjKind::Text: { - pSdrObj = new SdrRectObj(getSdrModelFromSdrPage(), OBJ_TEXT); + pSdrObj = new SdrRectObj(getSdrModelFromSdrPage(), SdrObjKind::Text); } break; @@ -423,7 +423,7 @@ SdrObject* SdPage::CreatePresObj(PresObjKind eObjKind, bool bVertical, const ::t case PresObjKind::DateTime: case PresObjKind::SlideNumber: { - pSdrObj = new SdrRectObj(getSdrModelFromSdrPage(), OBJ_TEXT); + pSdrObj = new SdrRectObj(getSdrModelFromSdrPage(), SdrObjKind::Text); bEmptyPresObj = false; bForceText = true; } @@ -1512,24 +1512,24 @@ static void findAutoLayoutShapesImpl( SdPage& rPage, const LayoutDescriptor& rDe switch( eKind ) { case PresObjKind::Title: - bFound = eSdrObjKind == OBJ_TITLETEXT; + bFound = eSdrObjKind == SdrObjKind::TitleText; break; case PresObjKind::Table: - bFound = eSdrObjKind == OBJ_TABLE; + bFound = eSdrObjKind == SdrObjKind::Table; break; case PresObjKind::Media: - bFound = eSdrObjKind == OBJ_MEDIA; + bFound = eSdrObjKind == SdrObjKind::Media; break; case PresObjKind::Outline: - bFound = (eSdrObjKind == OBJ_OUTLINETEXT) || - ((eSdrObjKind == OBJ_TEXT) && bPresStyle) || - (eSdrObjKind == OBJ_TABLE) || (eSdrObjKind == OBJ_MEDIA) || (eSdrObjKind == OBJ_GRAF) || (eSdrObjKind == OBJ_OLE2); + bFound = (eSdrObjKind == SdrObjKind::OutlineText) || + ((eSdrObjKind == SdrObjKind::Text) && bPresStyle) || + (eSdrObjKind == SdrObjKind::Table) || (eSdrObjKind == SdrObjKind::Media) || (eSdrObjKind == SdrObjKind::Graphic) || (eSdrObjKind == SdrObjKind::OLE2); break; case PresObjKind::Graphic: - bFound = eSdrObjKind == OBJ_GRAF; + bFound = eSdrObjKind == SdrObjKind::Graphic; break; case PresObjKind::Object: - if( eSdrObjKind == OBJ_OLE2 ) + if( eSdrObjKind == SdrObjKind::OLE2 ) { SdrOle2Obj* pOle2 = dynamic_cast< SdrOle2Obj* >( pObj ); if( pOle2 ) @@ -1566,7 +1566,7 @@ static void findAutoLayoutShapesImpl( SdPage& rPage, const LayoutDescriptor& rDe break; case PresObjKind::Chart: case PresObjKind::Calc: - if( eSdrObjKind == OBJ_OLE2 ) + if( eSdrObjKind == SdrObjKind::OLE2 ) { SdrOle2Obj* pOle2 = dynamic_cast< SdrOle2Obj* >( pObj ); if( pOle2 ) @@ -1583,18 +1583,18 @@ static void findAutoLayoutShapesImpl( SdPage& rPage, const LayoutDescriptor& rDe } break; } - else if( eSdrObjKind == OBJ_TABLE ) + else if( eSdrObjKind == SdrObjKind::Table ) { bFound = true; } break; case PresObjKind::Page: case PresObjKind::Handout: - bFound = eSdrObjKind == OBJ_PAGE; + bFound = eSdrObjKind == SdrObjKind::Page; break; case PresObjKind::Notes: case PresObjKind::Text: - bFound = (bPresStyle && (eSdrObjKind == OBJ_TEXT)) || (eSdrObjKind == OBJ_OUTLINETEXT); + bFound = (bPresStyle && (eSdrObjKind == SdrObjKind::Text)) || (eSdrObjKind == SdrObjKind::OutlineText); break; default: break; @@ -2011,8 +2011,8 @@ void SdPage::ScaleObjects(const Size& rNewPageSize, const ::tools::Rectangle& rN } } } - else if ( eObjKind != OBJ_TITLETEXT && - eObjKind != OBJ_OUTLINETEXT && + else if ( eObjKind != SdrObjKind::TitleText && + eObjKind != SdrObjKind::OutlineText && dynamic_cast< const SdrTextObj *>( pObj ) != nullptr && pObj->GetOutlinerParaObject() ) { @@ -2071,7 +2071,7 @@ static SdrObject* convertPresentationObjectImpl(SdPage& rPage, SdrObject* pSourc const bool bUndo = pUndoManager && pUndoManager->IsInListAction() && rPage.IsInserted(); SdrObject* pNewObj = pSourceObj; - if((eObjKind == PresObjKind::Outline) && (pSourceObj->GetObjIdentifier() == OBJ_TEXT) ) + if((eObjKind == PresObjKind::Outline) && (pSourceObj->GetObjIdentifier() == SdrObjKind::Text) ) { pNewObj = rPage.CreatePresObj(PresObjKind::Outline, bVertical, rRect); @@ -2123,7 +2123,7 @@ static SdrObject* convertPresentationObjectImpl(SdPage& rPage, SdrObject* pSourc SdrObject::Free( pSourceObj ); } } - else if((eObjKind == PresObjKind::Text) && (pSourceObj->GetObjIdentifier() == OBJ_OUTLINETEXT) ) + else if((eObjKind == PresObjKind::Text) && (pSourceObj->GetObjIdentifier() == SdrObjKind::OutlineText) ) { // is there an outline shape we can use to replace empty subtitle shape? pNewObj = rPage.CreatePresObj(PresObjKind::Text, bVertical, rRect); @@ -2167,14 +2167,14 @@ static SdrObject* convertPresentationObjectImpl(SdPage& rPage, SdrObject* pSourc SdrObject::Free( pSourceObj ); } } - else if((eObjKind == PresObjKind::Outline) && (pSourceObj->GetObjIdentifier() != OBJ_OUTLINETEXT) ) + else if((eObjKind == PresObjKind::Outline) && (pSourceObj->GetObjIdentifier() != SdrObjKind::OutlineText) ) { switch( pSourceObj->GetObjIdentifier() ) { - case OBJ_TABLE: eObjKind = PresObjKind::Table; break; - case OBJ_MEDIA: eObjKind = PresObjKind::Media; break; - case OBJ_GRAF: eObjKind = PresObjKind::Graphic; break; - case OBJ_OLE2: eObjKind = PresObjKind::Object; break; + case SdrObjKind::Table: eObjKind = PresObjKind::Table; break; + case SdrObjKind::Media: eObjKind = PresObjKind::Media; break; + case SdrObjKind::Graphic: eObjKind = PresObjKind::Graphic; break; + case SdrObjKind::OLE2: eObjKind = PresObjKind::Object; break; default: break; } } @@ -2237,7 +2237,7 @@ SdrObject* SdPage::InsertAutoLayoutShape(SdrObject* pObj, PresObjKind eObjKind, pTextObject->SetMergedItem(SdrTextHorzAdjustItem( bVertical ? SDRTEXTHORZADJUST_RIGHT : SDRTEXTHORZADJUST_BLOCK )); } - if( !mbMaster && (pTextObject->GetObjIdentifier() != OBJ_TABLE) ) + if( !mbMaster && (pTextObject->GetObjIdentifier() != SdrObjKind::Table) ) { if ( pTextObject->IsAutoGrowHeight() ) { @@ -2809,11 +2809,11 @@ bool SdPage::checkVisibility( // empty presentation objects only visible during edit mode if( (bIsPrinting || !bEdit || bIsInsidePageObj ) && pObj->IsEmptyPresObj() ) { - if( (pObj->GetObjInventor() != SdrInventor::Default) || ( (pObj->GetObjIdentifier() != OBJ_RECT) && (pObj->GetObjIdentifier() != OBJ_PAGE) ) ) + if( (pObj->GetObjInventor() != SdrInventor::Default) || ( (pObj->GetObjIdentifier() != SdrObjKind::Rectangle) && (pObj->GetObjIdentifier() != SdrObjKind::Page) ) ) return false; } - if( ( pObj->GetObjInventor() == SdrInventor::Default ) && ( pObj->GetObjIdentifier() == OBJ_TEXT ) ) + if( ( pObj->GetObjInventor() == SdrInventor::Default ) && ( pObj->GetObjIdentifier() == SdrObjKind::Text ) ) { const SdPage* pCheckPage = dynamic_cast< const SdPage* >(pObj->getSdrPageFromSdrObject()); @@ -2860,7 +2860,7 @@ bool SdPage::checkVisibility( } // i63977, do not print SdrpageObjs from master pages - if( ( pObj->GetObjInventor() == SdrInventor::Default ) && ( pObj->GetObjIdentifier() == OBJ_PAGE ) ) + if( ( pObj->GetObjInventor() == SdrInventor::Default ) && ( pObj->GetObjIdentifier() == SdrObjKind::Page ) ) { if( pObj->getSdrPageFromSdrObject() && pObj->getSdrPageFromSdrObject()->IsMasterPage() ) return false; diff --git a/sd/source/core/sdpage2.cxx b/sd/source/core/sdpage2.cxx index 78f199b4833a..1870ed3287a7 100644 --- a/sd/source/core/sdpage2.cxx +++ b/sd/source/core/sdpage2.cxx @@ -146,7 +146,7 @@ void SdPage::SetPresentationLayout(std::u16string_view rLayoutName, auto pObj = GetObj(nObj); if (pObj->GetObjInventor() == SdrInventor::Default && - pObj->GetObjIdentifier() == OBJ_OUTLINETEXT) + pObj->GetObjIdentifier() == SdrObjKind::OutlineText) { if (!bListsFilled || !bReplaceStyleSheets) { @@ -221,7 +221,7 @@ void SdPage::SetPresentationLayout(std::u16string_view rLayoutName, } } else if (pObj->GetObjInventor() == SdrInventor::Default && - pObj->GetObjIdentifier() == OBJ_TITLETEXT) + pObj->GetObjIdentifier() == SdrObjKind::TitleText) { // We do not get PresObjKind via GetPresObjKind() since there are // only PresObjListe considered. But we want to consider all "Title diff --git a/sd/source/filter/html/htmlex.cxx b/sd/source/filter/html/htmlex.cxx index 3e06c07fed38..158a0b57d103 100644 --- a/sd/source/filter/html/htmlex.cxx +++ b/sd/source/filter/html/htmlex.cxx @@ -1028,7 +1028,7 @@ SdrTextObj* HtmlExport::GetLayoutTextObject(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; @@ -1207,12 +1207,12 @@ OUString HtmlExport::CreateTextForPage(SdrOutliner* pOutliner, SdPage const * pP { case PresObjKind::NONE: { - if (pObject->GetObjIdentifier() == OBJ_GRUP) + if (pObject->GetObjIdentifier() == SdrObjKind::Group) { SdrObjGroup* pObjectGroup = static_cast<SdrObjGroup*>(pObject); WriteObjectGroup(aStr, pObjectGroup, pOutliner, rBackgroundColor, false); } - else if (pObject->GetObjIdentifier() == OBJ_TABLE) + else if (pObject->GetObjIdentifier() == SdrObjKind::Table) { SdrTableObj* pTableObject = static_cast<SdrTableObj*>(pObject); WriteTable(aStr, pTableObject, pOutliner, rBackgroundColor); @@ -1286,7 +1286,7 @@ void HtmlExport::WriteObjectGroup(OUStringBuffer& aStr, SdrObjGroup const * pObj while (aGroupIterator.IsMore()) { SdrObject* pCurrentObject = aGroupIterator.Next(); - if (pCurrentObject->GetObjIdentifier() == OBJ_GRUP) + if (pCurrentObject->GetObjIdentifier() == SdrObjKind::Group) { SdrObjGroup* pCurrentGroupObject = static_cast<SdrObjGroup*>(pCurrentObject); WriteObjectGroup(aStr, pCurrentGroupObject, pOutliner, rBackgroundColor, bHeadLine); @@ -1850,7 +1850,7 @@ bool HtmlExport::CreateHtmlForPresPages() { // a circle? if (pObject->GetObjInventor() == SdrInventor::Default && - pObject->GetObjIdentifier() == OBJ_CIRC && + pObject->GetObjIdentifier() == SdrObjKind::CircleOrEllipse && bIsSquare ) { aStr.append(CreateHTMLCircleArea(aRect.GetWidth() / 2, @@ -1860,9 +1860,9 @@ bool HtmlExport::CreateHtmlForPresPages() } // a polygon? else if (pObject->GetObjInventor() == SdrInventor::Default && - (pObject->GetObjIdentifier() == OBJ_PATHLINE || - pObject->GetObjIdentifier() == OBJ_PLIN || - pObject->GetObjIdentifier() == OBJ_POLY)) + (pObject->GetObjIdentifier() == SdrObjKind::PathLine || + pObject->GetObjIdentifier() == SdrObjKind::PolyLine || + pObject->GetObjIdentifier() == SdrObjKind::Polygon)) { aStr.append(CreateHTMLPolygonArea(static_cast<SdrPathObj*>(pObject)->GetPathPoly(), Size(-pPage->GetLeftBorder(), -pPage->GetUpperBorder()), fLogicToPixel, aHRef)); } diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx index 3da1736486ee..3d9ed7dfc14a 100644 --- a/sd/source/filter/ppt/pptin.cxx +++ b/sd/source/filter/ppt/pptin.cxx @@ -883,7 +883,7 @@ bool ImplSdPPTImport::Import() // background object pObj = pMPage->GetObj( 0 ); - if ( pObj && pObj->GetObjIdentifier() == OBJ_RECT ) + if ( pObj && pObj->GetObjIdentifier() == SdrObjKind::Rectangle ) { if ( pMPage->GetPageKind() == PageKind::Standard ) { diff --git a/sd/source/filter/xml/sdtransform.cxx b/sd/source/filter/xml/sdtransform.cxx index 8a84d10c0348..13e3a957e27d 100644 --- a/sd/source/filter/xml/sdtransform.cxx +++ b/sd/source/filter/xml/sdtransform.cxx @@ -209,7 +209,7 @@ void SdTransformOOo2xDocument::transformTextShape( SdrTextObj& rTextShape ) if( (nDepth != -1) && (!getBulletState( aParaSet, mrOutliner.GetStyleSheet( nPara ), bState ) || !bState) ) { // disable bullet if text::enable-bullet="false" is found - if( (nDepth > 0 ) && (rTextShape.GetObjInventor() == SdrInventor::Default) && (rTextShape.GetObjIdentifier() == OBJ_OUTLINETEXT) ) + if( (nDepth > 0 ) && (rTextShape.GetObjInventor() == SdrInventor::Default) && (rTextShape.GetObjIdentifier() == SdrObjKind::OutlineText) ) { // for outline object and level > 0 burn in the style sheet because it will be changed to "outline 1" SfxStyleSheet* pStyleSheet = mrOutliner.GetStyleSheet( nPara ); 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: diff --git a/svx/source/customshapes/EnhancedCustomShape2d.cxx b/svx/source/customshapes/EnhancedCustomShape2d.cxx index 1f05a3782a7c..9f3b91297bd9 100644 --- a/svx/source/customshapes/EnhancedCustomShape2d.cxx +++ b/svx/source/customshapes/EnhancedCustomShape2d.cxx @@ -2585,7 +2585,7 @@ void EnhancedCustomShape2d::CreateSubPath( aClosedPolyPolygon.setClosed(true); SdrPathObjUniquePtr pFill(new SdrPathObj( mrSdrObjCustomShape.getSdrModelFromSdrObject(), - OBJ_POLY, + SdrObjKind::Polygon, aClosedPolyPolygon)); SfxItemSet aTempSet(*this); aTempSet.Put(makeSdrShadowItem(false)); @@ -2602,7 +2602,7 @@ void EnhancedCustomShape2d::CreateSubPath( // Thus, use a type that fits the polygon SdrPathObjUniquePtr pStroke(new SdrPathObj( mrSdrObjCustomShape.getSdrModelFromSdrObject(), - aNewB2DPolyPolygon.isClosed() ? OBJ_POLY : OBJ_PLIN, + aNewB2DPolyPolygon.isClosed() ? SdrObjKind::Polygon : SdrObjKind::PolyLine, aNewB2DPolyPolygon)); SfxItemSet aTempSet(*this); aTempSet.Put(makeSdrShadowItem(false)); @@ -2622,7 +2622,7 @@ void EnhancedCustomShape2d::CreateSubPath( // see comment above about OBJ_PLIN pObj.reset(new SdrPathObj( mrSdrObjCustomShape.getSdrModelFromSdrObject(), - aNewB2DPolyPolygon.isClosed() ? OBJ_POLY : OBJ_PLIN, + aNewB2DPolyPolygon.isClosed() ? SdrObjKind::Polygon : SdrObjKind::PolyLine, aNewB2DPolyPolygon)); aTempSet.Put(XFillStyleItem(drawing::FillStyle_NONE)); } @@ -2631,7 +2631,7 @@ void EnhancedCustomShape2d::CreateSubPath( aNewB2DPolyPolygon.setClosed(true); pObj.reset(new SdrPathObj( mrSdrObjCustomShape.getSdrModelFromSdrObject(), - OBJ_POLY, + SdrObjKind::Polygon, aNewB2DPolyPolygon)); } diff --git a/svx/source/customshapes/EnhancedCustomShapeEngine.cxx b/svx/source/customshapes/EnhancedCustomShapeEngine.cxx index c2b440d7f13e..83f6c512ce85 100644 --- a/svx/source/customshapes/EnhancedCustomShapeEngine.cxx +++ b/svx/source/customshapes/EnhancedCustomShapeEngine.cxx @@ -178,7 +178,7 @@ std::unique_ptr<SdrObject, SdrObjectFreeOp> EnhancedCustomShapeEngine::ImplForce std::unique_ptr<SdrObject, SdrObjectFreeOp> pTextObj( SdrObjFactory::MakeNewObject( rSdrObjCustomShape.getSdrModelFromSdrObject(), rSdrObjCustomShape.GetObjInventor(), - OBJ_TEXT) ); + SdrObjKind::Text) ); // Copy text content OutlinerParaObject* pParaObj(rSdrObjCustomShape.GetOutlinerParaObject()); diff --git a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx index 1284b11e4c65..3dbfc06be1a4 100644 --- a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx +++ b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx @@ -877,7 +877,7 @@ static SdrObject* CreateSdrObjectFromParagraphOutlines( pRet = new SdrPathObj( rSdrObjCustomShape.getSdrModelFromSdrObject(), - OBJ_POLY, + SdrObjKind::Polygon, aPolyPoly); SfxItemSet aSet(rSdrObjCustomShape.GetMergedItemSet()); diff --git a/svx/source/dialog/_contdlg.cxx b/svx/source/dialog/_contdlg.cxx index 712544ff0c01..fbd6f40bc547 100644 --- a/svx/source/dialog/_contdlg.cxx +++ b/svx/source/dialog/_contdlg.cxx @@ -382,17 +382,17 @@ IMPL_LINK(SvxSuperContourDlg, Tbx1ClickHdl, const OString&, rId, void) else if (rId == "TBI_RECT") { SetActiveTool(rId); - m_xContourWnd->SetObjKind( OBJ_RECT ); + m_xContourWnd->SetObjKind( SdrObjKind::Rectangle ); } else if (rId == "TBI_CIRCLE") { SetActiveTool(rId); - m_xContourWnd->SetObjKind( OBJ_CIRC ); + m_xContourWnd->SetObjKind( SdrObjKind::CircleOrEllipse ); } else if (rId == "TBI_POLY") { SetActiveTool(rId); - m_xContourWnd->SetObjKind( OBJ_POLY ); + m_xContourWnd->SetObjKind( SdrObjKind::Polygon ); } else if (rId == "TBI_POLYEDIT") { diff --git a/svx/source/dialog/connctrl.cxx b/svx/source/dialog/connctrl.cxx index f2371a9cb9cf..0249b5dd965a 100644 --- a/svx/source/dialog/connctrl.cxx +++ b/svx/source/dialog/connctrl.cxx @@ -139,8 +139,8 @@ void SvxXConnectionPreview::Construct() { const SdrObject* pObj = rMarkList.GetMark( i )->GetMarkedSdrObj(); SdrInventor nInv = pObj->GetObjInventor(); - sal_uInt16 nId = pObj->GetObjIdentifier(); - if( nInv == SdrInventor::Default && nId == OBJ_EDGE ) + SdrObjKind nId = pObj->GetObjIdentifier(); + if( nInv == SdrInventor::Default && nId == SdrObjKind::Edge ) { bFound = true; diff --git a/svx/source/dialog/contwnd.cxx b/svx/source/dialog/contwnd.cxx index 49ad8b6a0102..48ace0ac7d17 100644 --- a/svx/source/dialog/contwnd.cxx +++ b/svx/source/dialog/contwnd.cxx @@ -61,7 +61,7 @@ void ContourWindow::SetPolyPolygon(const tools::PolyPolygon& rPolyPoly) aPolyPolygon.append(aPolyPoly[ i ].getB2DPolygon()); SdrPathObj* pPathObj = new SdrPathObj( *pModel, - OBJ_PATHFILL, + SdrObjKind::PathFill, aPolyPolygon); SfxItemSet aSet(pModel->GetItemPool()); diff --git a/svx/source/dialog/dlgctrl.cxx b/svx/source/dialog/dlgctrl.cxx index f88c252fd232..f14cc1822a39 100644 --- a/svx/source/dialog/dlgctrl.cxx +++ b/svx/source/dialog/dlgctrl.cxx @@ -1109,9 +1109,9 @@ void SvxXLinePreview::SetDrawingArea(weld::DrawingArea* pDrawingArea) { SvxPreviewBase::SetDrawingArea(pDrawingArea); - mpLineObjA = new SdrPathObj(getModel(), OBJ_LINE); - mpLineObjB = new SdrPathObj(getModel(), OBJ_PLIN); - mpLineObjC = new SdrPathObj(getModel(), OBJ_PLIN); + mpLineObjA = new SdrPathObj(getModel(), SdrObjKind::Line); + mpLineObjB = new SdrPathObj(getModel(), SdrObjKind::PolyLine); + mpLineObjC = new SdrPathObj(getModel(), SdrObjKind::PolyLine); Resize(); Invalidate(); diff --git a/svx/source/dialog/graphctl.cxx b/svx/source/dialog/graphctl.cxx index 8b113c86e7d8..ba44840a9b16 100644 --- a/svx/source/dialog/graphctl.cxx +++ b/svx/source/dialog/graphctl.cxx @@ -51,7 +51,7 @@ void GraphCtrlUserCall::Changed( const SdrObject& rObj, SdrUserCallType eType, c GraphCtrl::GraphCtrl(weld::Dialog* pDialog) : aUpdateIdle("svx GraphCtrl Update") , aMap100(MapUnit::Map100thMM) - , eObjKind(OBJ_NONE) + , eObjKind(SdrObjKind::NONE) , nPolyEdit(0) , bEditMode(false) , mbSdrMode(false) @@ -701,7 +701,7 @@ void GraphCtrl::SetEditMode( const bool _bEditMode ) { bEditMode = _bEditMode; pView->SetEditMode( bEditMode ); - eObjKind = OBJ_NONE; + eObjKind = SdrObjKind::NONE; pView->SetCurrentObj(eObjKind); } else @@ -733,7 +733,7 @@ void GraphCtrl::SetObjKind( const SdrObjKind _eObjKind ) pView->SetCurrentObj(eObjKind); } else - eObjKind = OBJ_NONE; + eObjKind = SdrObjKind::NONE; QueueIdleUpdate(); } diff --git a/svx/source/dialog/imapdlg.cxx b/svx/source/dialog/imapdlg.cxx index 9e499493acc7..7a462449a4a2 100644 --- a/svx/source/dialog/imapdlg.cxx +++ b/svx/source/dialog/imapdlg.cxx @@ -292,22 +292,22 @@ IMPL_LINK(SvxIMapDlg, TbxClickHdl, const OString&, rNewItemId, void) else if (rNewItemId == "TBI_RECT") { SetActiveTool( rNewItemId ); - m_xIMapWnd->SetObjKind( OBJ_RECT ); + m_xIMapWnd->SetObjKind( SdrObjKind::Rectangle ); } else if (rNewItemId == "TBI_CIRCLE") { SetActiveTool( rNewItemId ); - m_xIMapWnd->SetObjKind( OBJ_CIRC ); + m_xIMapWnd->SetObjKind( SdrObjKind::CircleOrEllipse ); } else if (rNewItemId == "TBI_POLY") { SetActiveTool( rNewItemId ); - m_xIMapWnd->SetObjKind( OBJ_POLY ); + m_xIMapWnd->SetObjKind( SdrObjKind::Polygon ); } else if (rNewItemId == "TBI_FREEPOLY") { SetActiveTool( rNewItemId ); - m_xIMapWnd->SetObjKind( OBJ_FREEFILL ); + m_xIMapWnd->SetObjKind( SdrObjKind::FreehandFill ); } else if (rNewItemId == "TBI_ACTIVE") { diff --git a/svx/source/dialog/imapwnd.cxx b/svx/source/dialog/imapwnd.cxx index d6f212f0c8e0..0e7b85131593 100644 --- a/svx/source/dialog/imapwnd.cxx +++ b/svx/source/dialog/imapwnd.cxx @@ -243,7 +243,7 @@ SdrObject* IMapWindow::CreateObj( const IMapObject* pIMapObj ) aPolygon.append(aDrawPoly.getB2DPolygon()); pSdrObj = new SdrPathObj( *pModel, - OBJ_POLY, + SdrObjKind::Polygon, basegfx::B2DPolyPolygon(aPolygon)); } @@ -298,7 +298,7 @@ void IMapWindow::SdrObjCreated( const SdrObject& rObj ) { switch( rObj.GetObjIdentifier() ) { - case OBJ_RECT: + case SdrObjKind::Rectangle: { SdrRectObj* pRectObj = const_cast<SdrRectObj*>(static_cast<const SdrRectObj*>(&rObj)); auto pObj = std::make_shared<IMapRectangleObject>( pRectObj->GetLogicRect(), "", "", "", "", "", true, false ); @@ -307,7 +307,7 @@ void IMapWindow::SdrObjCreated( const SdrObject& rObj ) } break; - case OBJ_CIRC: + case SdrObjKind::CircleOrEllipse: { SdrCircObj* pCircObj = const_cast<SdrCircObj*>( static_cast<const SdrCircObj*>(&rObj) ); SdrPathObj* pPathObj = static_cast<SdrPathObj*>( pCircObj->ConvertToPolyObj( false, false ).release() ); @@ -323,10 +323,10 @@ void IMapWindow::SdrObjCreated( const SdrObject& rObj ) } break; - case OBJ_POLY: - case OBJ_FREEFILL: - case OBJ_PATHPOLY: - case OBJ_PATHFILL: + case SdrObjKind::Polygon: + case SdrObjKind::FreehandFill: + case SdrObjKind::PathPoly: + case SdrObjKind::PathFill: { SdrPathObj* pPathObj = const_cast<SdrPathObj*>( static_cast<const SdrPathObj*>(&rObj) ); const basegfx::B2DPolyPolygon& rXPolyPoly = pPathObj->GetPathPoly(); @@ -370,14 +370,14 @@ void IMapWindow::SdrObjChanged( const SdrObject& rObj ) switch( rObj.GetObjIdentifier() ) { - case OBJ_RECT: + case SdrObjKind::Rectangle: { pUserData->ReplaceObject( std::make_shared<IMapRectangleObject>( static_cast<const SdrRectObj&>(rObj).GetLogicRect(), aURL, aAltText, aDesc, aTarget, "", bActive, false ) ); } break; - case OBJ_CIRC: + case SdrObjKind::CircleOrEllipse: { const SdrCircObj& rCircObj = static_cast<const SdrCircObj&>(rObj); SdrPathObj* pPathObj = static_cast<SdrPathObj*>( rCircObj.ConvertToPolyObj( false, false ).release() ); @@ -395,10 +395,10 @@ void IMapWindow::SdrObjChanged( const SdrObject& rObj ) } break; - case OBJ_POLY: - case OBJ_FREEFILL: - case OBJ_PATHPOLY: - case OBJ_PATHFILL: + case SdrObjKind::Polygon: + case SdrObjKind::FreehandFill: + case SdrObjKind::PathPoly: + case SdrObjKind::PathFill: { const SdrPathObj& rPathObj = static_cast<const SdrPathObj&>(rObj); const basegfx::B2DPolyPolygon& rXPolyPoly = rPathObj.GetPathPoly(); diff --git a/svx/source/engine3d/cube3d.cxx b/svx/source/engine3d/cube3d.cxx index c68462860c35..adc9a86fbbe6 100644 --- a/svx/source/engine3d/cube3d.cxx +++ b/svx/source/engine3d/cube3d.cxx @@ -86,7 +86,7 @@ void E3dCubeObj::SetDefaultAttributes(const E3dDefaultAttributes& rDefault) SdrObjKind E3dCubeObj::GetObjIdentifier() const { - return E3D_CUBEOBJ_ID; + return SdrObjKind::E3D_Cube; } // Convert the object into a group object consisting of 6 polygons diff --git a/svx/source/engine3d/extrud3d.cxx b/svx/source/engine3d/extrud3d.cxx index d0cb345755a3..166d426c43f4 100644 --- a/svx/source/engine3d/extrud3d.cxx +++ b/svx/source/engine3d/extrud3d.cxx @@ -109,7 +109,7 @@ void E3dExtrudeObj::SetDefaultAttributes(const E3dDefaultAttributes& rDefault) SdrObjKind E3dExtrudeObj::GetObjIdentifier() const { - return E3D_EXTRUDEOBJ_ID; + return SdrObjKind::E3D_Extrusion; } E3dExtrudeObj* E3dExtrudeObj::CloneSdrObject(SdrModel& rTargetModel) const @@ -205,7 +205,7 @@ std::unique_ptr<SdrAttrObj,SdrObjectFreeOp> E3dExtrudeObj::GetBreakObj() { // create PathObj basegfx::B2DPolyPolygon aPoly = TransformToScreenCoor(aBackSide); - std::unique_ptr<SdrPathObj,SdrObjectFreeOp> pPathObj(new SdrPathObj(getSdrModelFromSdrObject(), OBJ_PLIN, aPoly)); + std::unique_ptr<SdrPathObj,SdrObjectFreeOp> pPathObj(new SdrPathObj(getSdrModelFromSdrObject(), SdrObjKind::PolyLine, aPoly)); SfxItemSet aSet(GetObjectItemSet()); aSet.Put(XLineStyleItem(css::drawing::LineStyle_SOLID)); diff --git a/svx/source/engine3d/lathe3d.cxx b/svx/source/engine3d/lathe3d.cxx index e811d0eebfeb..4880193f8159 100644 --- a/svx/source/engine3d/lathe3d.cxx +++ b/svx/source/engine3d/lathe3d.cxx @@ -114,7 +114,7 @@ void E3dLatheObj::SetDefaultAttributes(const E3dDefaultAttributes& rDefault) SdrObjKind E3dLatheObj::GetObjIdentifier() const { - return E3D_LATHEOBJ_ID; + return SdrObjKind::E3D_Lathe; } E3dLatheObj* E3dLatheObj::CloneSdrObject(SdrModel& rTargetModel) const @@ -186,7 +186,7 @@ std::unique_ptr<SdrAttrObj,SdrObjectFreeOp> E3dLatheObj::GetBreakObj() // create PathObj basegfx::B3DPolyPolygon aLathePoly3D(basegfx::utils::createB3DPolyPolygonFromB2DPolyPolygon(maPolyPoly2D)); basegfx::B2DPolyPolygon aTransPoly(TransformToScreenCoor(aLathePoly3D)); - std::unique_ptr<SdrPathObj,SdrObjectFreeOp> pPathObj(new SdrPathObj(getSdrModelFromSdrObject(), OBJ_PLIN, aTransPoly)); + std::unique_ptr<SdrPathObj,SdrObjectFreeOp> pPathObj(new SdrPathObj(getSdrModelFromSdrObject(), SdrObjKind::PolyLine, aTransPoly)); // Set Attribute SfxItemSet aSet(GetObjectItemSet()); diff --git a/svx/source/engine3d/obj3d.cxx b/svx/source/engine3d/obj3d.cxx index eed5b878033c..2863504b3607 100644 --- a/svx/source/engine3d/obj3d.cxx +++ b/svx/source/engine3d/obj3d.cxx @@ -108,7 +108,7 @@ SdrInventor E3dObject::GetObjInventor() const SdrObjKind E3dObject::GetObjIdentifier() const { - return E3D_OBJECT_ID; + return SdrObjKind::E3D_Object; } // Determine the capabilities of the object @@ -545,7 +545,7 @@ void E3dCompoundObject::AddToHdlList(SdrHdlList& rHdlList) const SdrObjKind E3dCompoundObject::GetObjIdentifier() const { - return E3D_COMPOUNDOBJ_ID; + return SdrObjKind::E3D_CompoundObject; } void E3dCompoundObject::RecalcSnapRect() diff --git a/svx/source/engine3d/objfac3d.cxx b/svx/source/engine3d/objfac3d.cxx index db626f649463..160406c17405 100644 --- a/svx/source/engine3d/objfac3d.cxx +++ b/svx/source/engine3d/objfac3d.cxx @@ -50,19 +50,19 @@ IMPL_STATIC_LINK( E3dObjFactory, MakeObject, SdrObjCreatorParams, aParams, SdrOb { switch ( aParams.nObjIdentifier ) { - case E3D_SCENE_ID: + case SdrObjKind::E3D_Scene: return new E3dScene(aParams.rSdrModel); - case E3D_POLYGONOBJ_ID : + case SdrObjKind::E3D_Polygon : return new E3dPolygonObj(aParams.rSdrModel); - case E3D_CUBEOBJ_ID : + case SdrObjKind::E3D_Cube : return new E3dCubeObj(aParams.rSdrModel); - case E3D_SPHEREOBJ_ID: + case SdrObjKind::E3D_Sphere: return new E3dSphereObj(aParams.rSdrModel); - case E3D_EXTRUDEOBJ_ID: + case SdrObjKind::E3D_Extrusion: return new E3dExtrudeObj(aParams.rSdrModel); - case E3D_LATHEOBJ_ID: + case SdrObjKind::E3D_Lathe: return new E3dLatheObj(aParams.rSdrModel); - case E3D_COMPOUNDOBJ_ID: + case SdrObjKind::E3D_CompoundObject: return new E3dCompoundObject(aParams.rSdrModel); default: break; diff --git a/svx/source/engine3d/polygn3d.cxx b/svx/source/engine3d/polygn3d.cxx index 22aecb44105a..e7a5623bf01d 100644 --- a/svx/source/engine3d/polygn3d.cxx +++ b/svx/source/engine3d/polygn3d.cxx @@ -177,7 +177,7 @@ void E3dPolygonObj::CreateDefaultTexture() E3dPolygonObj::~E3dPolygonObj() {} -SdrObjKind E3dPolygonObj::GetObjIdentifier() const { return E3D_POLYGONOBJ_ID; } +SdrObjKind E3dPolygonObj::GetObjIdentifier() const { return SdrObjKind::E3D_Polygon; } void E3dPolygonObj::SetPolyPolygon3D(const basegfx::B3DPolyPolygon& rNewPolyPoly3D) { diff --git a/svx/source/engine3d/scene3d.cxx b/svx/source/engine3d/scene3d.cxx index 0a7253139330..79cb56665918 100644 --- a/svx/source/engine3d/scene3d.cxx +++ b/svx/source/engine3d/scene3d.cxx @@ -295,7 +295,7 @@ sal_uInt32 E3dScene::RemapOrdNum(sal_uInt32 nNewOrdNum) const SdrObjKind E3dScene::GetObjIdentifier() const { - return E3D_SCENE_ID; + return SdrObjKind::E3D_Scene; } void E3dScene::SetBoundRectDirty() diff --git a/svx/source/engine3d/sphere3d.cxx b/svx/source/engine3d/sphere3d.cxx index 7cc16a82ff65..6b56d2d44dbe 100644 --- a/svx/source/engine3d/sphere3d.cxx +++ b/svx/source/engine3d/sphere3d.cxx @@ -90,7 +90,7 @@ void E3dSphereObj::SetDefaultAttributes(const E3dDefaultAttributes& rDefault) SdrObjKind E3dSphereObj::GetObjIdentifier() const { - return E3D_SPHEREOBJ_ID; + return SdrObjKind::E3D_Sphere; } // Convert the object into a group object consisting of n polygons diff --git a/svx/source/form/fmexpl.cxx b/svx/source/form/fmexpl.cxx index 41ee0ced7931..8ab6006bd559 100644 --- a/svx/source/form/fmexpl.cxx +++ b/svx/source/form/fmexpl.cxx @@ -312,96 +312,98 @@ OUString FmControlData::GetImage() const // Spezielle Control-Images - sal_Int16 nObjectType = getControlTypeByObject(xInfo); + SdrObjKind nObjectType = getControlTypeByObject(xInfo); switch (nObjectType) { - case OBJ_FM_BUTTON: + case SdrObjKind::FormButton: aImage = RID_SVXBMP_BUTTON; break; - case OBJ_FM_FIXEDTEXT: + case SdrObjKind::FormFixedText: aImage = RID_SVXBMP_FIXEDTEXT; break; - case OBJ_FM_EDIT: + case SdrObjKind::FormEdit: aImage = RID_SVXBMP_EDITBOX; break; - case OBJ_FM_RADIOBUTTON: + case SdrObjKind::FormRadioButton: aImage = RID_SVXBMP_RADIOBUTTON; break; - case OBJ_FM_CHECKBOX: + case SdrObjKind::FormCheckbox: aImage = RID_SVXBMP_CHECKBOX; break; - case OBJ_FM_LISTBOX: + case SdrObjKind::FormListbox: aImage = RID_SVXBMP_LISTBOX; break; - case OBJ_FM_COMBOBOX: + case SdrObjKind::FormCombobox: aImage = RID_SVXBMP_COMBOBOX; break; - case OBJ_FM_NAVIGATIONBAR: + case SdrObjKind::FormNavigationBar: aImage = RID_SVXBMP_NAVIGATIONBAR; break; - case OBJ_FM_GROUPBOX: + case SdrObjKind::FormGroupBox: aImage = RID_SVXBMP_GROUPBOX; break; - case OBJ_FM_IMAGEBUTTON: + case SdrObjKind::FormImageButton: aImage = RID_SVXBMP_IMAGEBUTTON; break; - case OBJ_FM_FILECONTROL: + case SdrObjKind::FormFileControl: aImage = RID_SVXBMP_FILECONTROL; break; - case OBJ_FM_HIDDEN: + case SdrObjKind::FormHidden: aImage = RID_SVXBMP_HIDDEN; break; - case OBJ_FM_DATEFIELD: + case SdrObjKind::FormDateField: aImage = RID_SVXBMP_DATEFIELD; break; - case OBJ_FM_TIMEFIELD: + case SdrObjKind::FormTimeField: aImage = RID_SVXBMP_TIMEFIELD; break; - case OBJ_FM_NUMERICFIELD: + case SdrObjKind::FormNumericField: aImage = RID_SVXBMP_NUMERICFIELD; break; - case OBJ_FM_CURRENCYFIELD: + case SdrObjKind::FormCurrencyField: aImage = RID_SVXBMP_CURRENCYFIELD; break; - case OBJ_FM_PATTERNFIELD: + case SdrObjKind::FormPatternField: aImage = RID_SVXBMP_PATTERNFIELD; break; - case OBJ_FM_IMAGECONTROL: + case SdrObjKind::FormImageControl: aImage = RID_SVXBMP_IMAGECONTROL; break; - case OBJ_FM_FORMATTEDFIELD: + case SdrObjKind::FormFormattedField: aImage = RID_SVXBMP_FORMATTEDFIELD; break; - case OBJ_FM_GRID: + case SdrObjKind::FormGrid: aImage = RID_SVXBMP_GRID; break; - case OBJ_FM_SCROLLBAR: + case SdrObjKind::FormScrollbar: aImage = RID_SVXBMP_SCROLLBAR; break; - case OBJ_FM_SPINBUTTON: + case SdrObjKind::FormSpinButton: aImage = RID_SVXBMP_SPINBUTTON; break; + + default:; } return aImage; diff --git a/svx/source/form/fmobj.cxx b/svx/source/form/fmobj.cxx index e0b6d1c31ff4..1b331092e1e7 100644 --- a/svx/source/form/fmobj.cxx +++ b/svx/source/form/fmobj.cxx @@ -357,7 +357,7 @@ SdrInventor FmFormObj::GetObjInventor() const SdrObjKind FmFormObj::GetObjIdentifier() const { - return OBJ_UNO; + return SdrObjKind::UNO; } FmFormObj* FmFormObj::CloneSdrObject(SdrModel& rTargetModel) const diff --git a/svx/source/form/fmobjfac.cxx b/svx/source/form/fmobjfac.cxx index 16bc622d7e31..6ef433414af0 100644 --- a/svx/source/form/fmobjfac.cxx +++ b/svx/source/form/fmobjfac.cxx @@ -117,93 +117,93 @@ IMPL_STATIC_LINK(FmFormObjFactory, MakeObject, SdrObjCreatorParams, aParams, Sdr switch ( aParams.nObjIdentifier ) { - case OBJ_FM_EDIT: + case SdrObjKind::FormEdit: sServiceSpecifier = FM_COMPONENT_EDIT; break; - case OBJ_FM_BUTTON: + case SdrObjKind::FormButton: sServiceSpecifier = FM_COMPONENT_COMMANDBUTTON; break; - case OBJ_FM_FIXEDTEXT: + case SdrObjKind::FormFixedText: sServiceSpecifier = FM_COMPONENT_FIXEDTEXT; break; - case OBJ_FM_LISTBOX: + case SdrObjKind::FormListbox: sServiceSpecifier = FM_COMPONENT_LISTBOX; break; - case OBJ_FM_CHECKBOX: + case SdrObjKind::FormCheckbox: sServiceSpecifier = FM_COMPONENT_CHECKBOX; break; - case OBJ_FM_RADIOBUTTON: + case SdrObjKind::FormRadioButton: sServiceSpecifier = FM_COMPONENT_RADIOBUTTON; break; - case OBJ_FM_GROUPBOX: + case SdrObjKind::FormGroupBox: sServiceSpecifier = FM_COMPONENT_GROUPBOX; break; - case OBJ_FM_COMBOBOX: + case SdrObjKind::FormCombobox: sServiceSpecifier = FM_COMPONENT_COMBOBOX; break; - case OBJ_FM_GRID: + case SdrObjKind::FormGrid: sServiceSpecifier = FM_COMPONENT_GRID; break; - case OBJ_FM_IMAGEBUTTON: + case SdrObjKind::FormImageButton: sServiceSpecifier = FM_COMPONENT_IMAGEBUTTON; break; - case OBJ_FM_FILECONTROL: + case SdrObjKind::FormFileControl: sServiceSpecifier = FM_COMPONENT_FILECONTROL; break; - case OBJ_FM_DATEFIELD: + case SdrObjKind::FormDateField: sServiceSpecifier = FM_COMPONENT_DATEFIELD; break; - case OBJ_FM_TIMEFIELD: + case SdrObjKind::FormTimeField: sServiceSpecifier = FM_COMPONENT_TIMEFIELD; aInitialProperties.emplace_back( FM_PROP_TIMEMAX, makeAny( tools::Time( 23, 59, 59, 999999999 ).GetUNOTime() ) ); break; - case OBJ_FM_NUMERICFIELD: + case SdrObjKind::FormNumericField: sServiceSpecifier = FM_COMPONENT_NUMERICFIELD; break; - case OBJ_FM_CURRENCYFIELD: + case SdrObjKind::FormCurrencyField: sServiceSpecifier = FM_COMPONENT_CURRENCYFIELD; break; - case OBJ_FM_PATTERNFIELD: + case SdrObjKind::FormPatternField: sServiceSpecifier = FM_COMPONENT_PATTERNFIELD; break; - case OBJ_FM_HIDDEN: + case SdrObjKind::FormHidden: sServiceSpecifier = FM_COMPONENT_HIDDEN; break; - case OBJ_FM_IMAGECONTROL: + case SdrObjKind::FormImageControl: sServiceSpecifier = FM_COMPONENT_IMAGECONTROL; break; - case OBJ_FM_FORMATTEDFIELD: + case SdrObjKind::FormFormattedField: sServiceSpecifier = FM_COMPONENT_FORMATTEDFIELD; break; - case OBJ_FM_NAVIGATIONBAR: + case SdrObjKind::FormNavigationBar: sServiceSpecifier = FM_SUN_COMPONENT_NAVIGATIONBAR; break; - case OBJ_FM_SCROLLBAR: + case SdrObjKind::FormScrollbar: sServiceSpecifier = FM_SUN_COMPONENT_SCROLLBAR; aInitialProperties.emplace_back( FM_PROP_BORDER, makeAny( sal_Int16(0) ) ); break; - case OBJ_FM_SPINBUTTON: + case SdrObjKind::FormSpinButton: sServiceSpecifier = FM_SUN_COMPONENT_SPINBUTTON; aInitialProperties.emplace_back( FM_PROP_BORDER, makeAny( sal_Int16(0) ) ); break; diff --git a/svx/source/form/fmshell.cxx b/svx/source/form/fmshell.cxx index 280912284c86..676a12763417 100644 --- a/svx/source/form/fmshell.cxx +++ b/svx/source/form/fmshell.cxx @@ -354,71 +354,71 @@ void FmFormShell::Execute(SfxRequest &rReq) // set the Identifier and Inventor of the Uno control - SdrObjKind nIdentifier = OBJ_NONE; + SdrObjKind nIdentifier = SdrObjKind::NONE; switch( nSlot ) { case SID_FM_CHECKBOX: - nIdentifier = OBJ_FM_CHECKBOX; + nIdentifier = SdrObjKind::FormCheckbox; break; case SID_FM_PUSHBUTTON: - nIdentifier = OBJ_FM_BUTTON; + nIdentifier = SdrObjKind::FormButton; break; case SID_FM_FIXEDTEXT: - nIdentifier = OBJ_FM_FIXEDTEXT; + nIdentifier = SdrObjKind::FormFixedText; break; case SID_FM_LISTBOX: - nIdentifier = OBJ_FM_LISTBOX; + nIdentifier = SdrObjKind::FormListbox; break; case SID_FM_EDIT: - nIdentifier = OBJ_FM_EDIT; + nIdentifier = SdrObjKind::FormEdit; break; case SID_FM_RADIOBUTTON: - nIdentifier = OBJ_FM_RADIOBUTTON; + nIdentifier = SdrObjKind::FormRadioButton; break; case SID_FM_GROUPBOX: - nIdentifier = OBJ_FM_GROUPBOX; + nIdentifier = SdrObjKind::FormGroupBox; break; case SID_FM_COMBOBOX: - nIdentifier = OBJ_FM_COMBOBOX; + nIdentifier = SdrObjKind::FormCombobox; break; case SID_FM_NAVIGATIONBAR: - nIdentifier = OBJ_FM_NAVIGATIONBAR; + nIdentifier = SdrObjKind::FormNavigationBar; break; case SID_FM_DBGRID: - nIdentifier = OBJ_FM_GRID; + nIdentifier = SdrObjKind::FormGrid; break; case SID_FM_IMAGEBUTTON: - nIdentifier = OBJ_FM_IMAGEBUTTON; + nIdentifier = SdrObjKind::FormImageButton; break; case SID_FM_IMAGECONTROL: - nIdentifier = OBJ_FM_IMAGECONTROL; + nIdentifier = SdrObjKind::FormImageControl; break; case SID_FM_FILECONTROL: - nIdentifier = OBJ_FM_FILECONTROL; + nIdentifier = SdrObjKind::FormFileControl; break; case SID_FM_DATEFIELD: - nIdentifier = OBJ_FM_DATEFIELD; + nIdentifier = SdrObjKind::FormDateField; break; case SID_FM_TIMEFIELD: - nIdentifier = OBJ_FM_TIMEFIELD; + nIdentifier = SdrObjKind::FormTimeField; break; case SID_FM_NUMERICFIELD: - nIdentifier = OBJ_FM_NUMERICFIELD; + nIdentifier = SdrObjKind::FormNumericField; break; case SID_FM_CURRENCYFIELD: - nIdentifier = OBJ_FM_CURRENCYFIELD; + nIdentifier = SdrObjKind::FormCurrencyField; break; case SID_FM_PATTERNFIELD: - nIdentifier = OBJ_FM_PATTERNFIELD; + nIdentifier = SdrObjKind::FormPatternField; break; case SID_FM_FORMATTEDFIELD: - nIdentifier = OBJ_FM_FORMATTEDFIELD; + nIdentifier = SdrObjKind::FormFormattedField; break; case SID_FM_SCROLLBAR: - nIdentifier = OBJ_FM_SCROLLBAR; + nIdentifier = SdrObjKind::FormScrollbar; break; case SID_FM_SPINBUTTON: - nIdentifier = OBJ_FM_SPINBUTTON; + nIdentifier = SdrObjKind::FormSpinButton; break; } @@ -456,7 +456,7 @@ void FmFormShell::Execute(SfxRequest &rReq) break; } - SfxUInt16Item aIdentifierItem( SID_FM_CONTROL_IDENTIFIER, nIdentifier ); + SfxUInt16Item aIdentifierItem( SID_FM_CONTROL_IDENTIFIER, static_cast<sal_uInt16>(nIdentifier) ); SfxUInt32Item aInventorItem( SID_FM_CONTROL_INVENTOR, sal_uInt32(SdrInventor::FmForm) ); const SfxPoolItem* pArgs[] = { diff --git a/svx/source/form/fmshimp.cxx b/svx/source/form/fmshimp.cxx index 4502f063a920..66f71165f67e 100644 --- a/svx/source/form/fmshimp.cxx +++ b/svx/source/form/fmshimp.cxx @@ -227,28 +227,28 @@ constexpr rtl::OUStringConstExpr aImgIds[] = RID_SVXBMP_NAVIGATIONBAR }; -const sal_Int16 nObjectTypes[] = -{ - OBJ_FM_EDIT, - OBJ_FM_BUTTON, - OBJ_FM_FIXEDTEXT, - OBJ_FM_LISTBOX, - OBJ_FM_CHECKBOX, - OBJ_FM_RADIOBUTTON, - OBJ_FM_GROUPBOX, - OBJ_FM_COMBOBOX, - OBJ_FM_IMAGEBUTTON, - OBJ_FM_FILECONTROL, - OBJ_FM_DATEFIELD, - OBJ_FM_TIMEFIELD, - OBJ_FM_NUMERICFIELD, - OBJ_FM_CURRENCYFIELD, - OBJ_FM_PATTERNFIELD, - OBJ_FM_IMAGECONTROL, - OBJ_FM_FORMATTEDFIELD, - OBJ_FM_SCROLLBAR, - OBJ_FM_SPINBUTTON, - OBJ_FM_NAVIGATIONBAR +const SdrObjKind nObjectTypes[] = +{ + SdrObjKind::FormEdit, + SdrObjKind::FormButton, + SdrObjKind::FormFixedText, + SdrObjKind::FormListbox, + SdrObjKind::FormCheckbox, + SdrObjKind::FormRadioButton, + SdrObjKind::FormGroupBox, + SdrObjKind::FormCombobox, + SdrObjKind::FormImageButton, + SdrObjKind::FormFileControl, + SdrObjKind::FormDateField, + SdrObjKind::FormTimeField, + SdrObjKind::FormNumericField, + SdrObjKind::FormCurrencyField, + SdrObjKind::FormPatternField, + SdrObjKind::FormImageControl, + SdrObjKind::FormFormattedField, + SdrObjKind::FormScrollbar, + SdrObjKind::FormSpinButton, + SdrObjKind::FormNavigationBar }; using namespace ::com::sun::star; @@ -429,32 +429,33 @@ namespace } - OUString getServiceNameByControlType(sal_Int16 nType) + OUString getServiceNameByControlType(SdrObjKind nType) { switch (nType) { - case OBJ_FM_EDIT : return FM_COMPONENT_TEXTFIELD; - case OBJ_FM_BUTTON : return FM_COMPONENT_COMMANDBUTTON; - case OBJ_FM_FIXEDTEXT : return FM_COMPONENT_FIXEDTEXT; - case OBJ_FM_LISTBOX : return FM_COMPONENT_LISTBOX; - case OBJ_FM_CHECKBOX : return FM_COMPONENT_CHECKBOX; - case OBJ_FM_RADIOBUTTON : return FM_COMPONENT_RADIOBUTTON; - case OBJ_FM_GROUPBOX : return FM_COMPONENT_GROUPBOX; - case OBJ_FM_COMBOBOX : return FM_COMPONENT_COMBOBOX; - case OBJ_FM_GRID : return FM_COMPONENT_GRIDCONTROL; - case OBJ_FM_IMAGEBUTTON : return FM_COMPONENT_IMAGEBUTTON; - case OBJ_FM_FILECONTROL : return FM_COMPONENT_FILECONTROL; - case OBJ_FM_DATEFIELD : return FM_COMPONENT_DATEFIELD; - case OBJ_FM_TIMEFIELD : return FM_COMPONENT_TIMEFIELD; - case OBJ_FM_NUMERICFIELD : return FM_COMPONENT_NUMERICFIELD; - case OBJ_FM_CURRENCYFIELD : return FM_COMPONENT_CURRENCYFIELD; - case OBJ_FM_PATTERNFIELD : return FM_COMPONENT_PATTERNFIELD; - case OBJ_FM_HIDDEN : return FM_COMPONENT_HIDDENCONTROL; - case OBJ_FM_IMAGECONTROL : return FM_COMPONENT_IMAGECONTROL; - case OBJ_FM_FORMATTEDFIELD : return FM_COMPONENT_FORMATTEDFIELD; - case OBJ_FM_SCROLLBAR : return FM_SUN_COMPONENT_SCROLLBAR; - case OBJ_FM_SPINBUTTON : return FM_SUN_COMPONENT_SPINBUTTON; - case OBJ_FM_NAVIGATIONBAR : return FM_SUN_COMPONENT_NAVIGATIONBAR; + case SdrObjKind::FormEdit : return FM_COMPONENT_TEXTFIELD; + case SdrObjKind::FormButton : return FM_COMPONENT_COMMANDBUTTON; + case SdrObjKind::FormFixedText : return FM_COMPONENT_FIXEDTEXT; + case SdrObjKind::FormListbox : return FM_COMPONENT_LISTBOX; + case SdrObjKind::FormCheckbox : return FM_COMPONENT_CHECKBOX; + case SdrObjKind::FormRadioButton : return FM_COMPONENT_RADIOBUTTON; + case SdrObjKind::FormGroupBox : return FM_COMPONENT_GROUPBOX; + case SdrObjKind::FormCombobox : return FM_COMPONENT_COMBOBOX; + case SdrObjKind::FormGrid : return FM_COMPONENT_GRIDCONTROL; + case SdrObjKind::FormImageButton : return FM_COMPONENT_IMAGEBUTTON; + case SdrObjKind::FormFileControl : return FM_COMPONENT_FILECONTROL; + case SdrObjKind::FormDateField : return FM_COMPONENT_DATEFIELD; + case SdrObjKind::FormTimeField : return FM_COMPONENT_TIMEFIELD; + case SdrObjKind::FormNumericField : return FM_COMPONENT_NUMERICFIELD; + case SdrObjKind::FormCurrencyField : return FM_COMPONENT_CURRENCYFIELD; + case SdrObjKind::FormPatternField : return FM_COMPONENT_PATTERNFIELD; + case SdrObjKind::FormHidden : return FM_COMPONENT_HIDDENCONTROL; + case SdrObjKind::FormImageControl : return FM_COMPONENT_IMAGECONTROL; + case SdrObjKind::FormFormattedField : return FM_COMPONENT_FORMATTEDFIELD; + case SdrObjKind::FormScrollbar : return FM_SUN_COMPONENT_SCROLLBAR; + case SdrObjKind::FormSpinButton : return FM_SUN_COMPONENT_SPINBUTTON; + case SdrObjKind::FormNavigationBar : return FM_SUN_COMPONENT_NAVIGATIONBAR; + default:; } return OUString(); } @@ -1268,11 +1269,11 @@ bool FmXFormShell::canConvertCurrentSelectionToControl_Lock(std::string_view rId // it's a form return false; - sal_Int16 nObjectType = getControlTypeByObject( xElementInfo ); + SdrObjKind nObjectType = getControlTypeByObject( xElementInfo ); - if ( ( OBJ_FM_HIDDEN == nObjectType ) - || ( OBJ_FM_CONTROL == nObjectType ) - || ( OBJ_FM_GRID == nObjectType ) + if ( ( SdrObjKind::FormHidden == nObjectType ) + || ( SdrObjKind::FormControl == nObjectType ) + || ( SdrObjKind::FormGrid == nObjectType ) ) return false; // those types cannot be converted @@ -3283,8 +3284,8 @@ void FmXFormShell::CreateExternalView_Lock() Reference< lang::XServiceInfo> xInfo(xCurrentModelSet, UNO_QUERY); if (xInfo.is()) { - sal_Int16 nObjectType = getControlTypeByObject(xInfo); - if (OBJ_FM_FORMATTEDFIELD == nObjectType) + SdrObjKind nObjectType = getControlTypeByObject(xInfo); + if (SdrObjKind::FormFormattedField == nObjectType) sColumnType = FM_COL_FORMATTEDFIELD; } } diff --git a/svx/source/form/fmtools.cxx b/svx/source/form/fmtools.cxx index 9263651ff2ef..b6d2de838b1b 100644 --- a/svx/source/form/fmtools.cxx +++ b/svx/source/form/fmtools.cxx @@ -284,77 +284,77 @@ void FmXDisposeMultiplexer::dispose() } -sal_Int16 getControlTypeByObject(const Reference< css::lang::XServiceInfo>& _rxObject) +SdrObjKind getControlTypeByObject(const Reference< css::lang::XServiceInfo>& _rxObject) { // ask for the persistent service name Reference< css::io::XPersistObject> xPersistence(_rxObject, UNO_QUERY); DBG_ASSERT(xPersistence.is(), "::getControlTypeByObject : argument should be a css::io::XPersistObject !"); if (!xPersistence.is()) - return OBJ_FM_CONTROL; + return SdrObjKind::FormControl; OUString sPersistentServiceName = xPersistence->getServiceName(); if (sPersistentServiceName == FM_COMPONENT_EDIT) // 5.0-Name { // may be a simple edit field or a formatted field, dependent of the supported services if (_rxObject->supportsService(FM_SUN_COMPONENT_FORMATTEDFIELD)) - return OBJ_FM_FORMATTEDFIELD; - return OBJ_FM_EDIT; + return SdrObjKind::FormFormattedField; + return SdrObjKind::FormEdit; } if (sPersistentServiceName == FM_COMPONENT_TEXTFIELD) - return OBJ_FM_EDIT; + return SdrObjKind::FormEdit; if (sPersistentServiceName == FM_COMPONENT_COMMANDBUTTON) - return OBJ_FM_BUTTON; + return SdrObjKind::FormButton; if (sPersistentServiceName == FM_COMPONENT_FIXEDTEXT) - return OBJ_FM_FIXEDTEXT; + return SdrObjKind::FormFixedText; if (sPersistentServiceName == FM_COMPONENT_LISTBOX) - return OBJ_FM_LISTBOX; + return SdrObjKind::FormListbox; if (sPersistentServiceName == FM_COMPONENT_CHECKBOX) - return OBJ_FM_CHECKBOX; + return SdrObjKind::FormCheckbox; if (sPersistentServiceName == FM_COMPONENT_RADIOBUTTON) - return OBJ_FM_RADIOBUTTON; + return SdrObjKind::FormRadioButton; if (sPersistentServiceName == FM_COMPONENT_GROUPBOX) - return OBJ_FM_GROUPBOX; + return SdrObjKind::FormGroupBox; if (sPersistentServiceName == FM_COMPONENT_COMBOBOX) - return OBJ_FM_COMBOBOX; + return SdrObjKind::FormCombobox; if (sPersistentServiceName == FM_COMPONENT_GRID) // 5.0-Name - return OBJ_FM_GRID; + return SdrObjKind::FormGrid; if (sPersistentServiceName == FM_COMPONENT_GRIDCONTROL) - return OBJ_FM_GRID; + return SdrObjKind::FormGrid; if (sPersistentServiceName == FM_COMPONENT_IMAGEBUTTON) - return OBJ_FM_IMAGEBUTTON; + return SdrObjKind::FormImageButton; if (sPersistentServiceName == FM_COMPONENT_FILECONTROL) - return OBJ_FM_FILECONTROL; + return SdrObjKind::FormFileControl; if (sPersistentServiceName == FM_COMPONENT_DATEFIELD) - return OBJ_FM_DATEFIELD; + return SdrObjKind::FormDateField; if (sPersistentServiceName == FM_COMPONENT_TIMEFIELD) - return OBJ_FM_TIMEFIELD; + return SdrObjKind::FormTimeField; if (sPersistentServiceName == FM_COMPONENT_NUMERICFIELD) - return OBJ_FM_NUMERICFIELD; + return SdrObjKind::FormNumericField; if (sPersistentServiceName == FM_COMPONENT_CURRENCYFIELD) - return OBJ_FM_CURRENCYFIELD; + return SdrObjKind::FormCurrencyField; if (sPersistentServiceName == FM_COMPONENT_PATTERNFIELD) - return OBJ_FM_PATTERNFIELD; + return SdrObjKind::FormPatternField; if (sPersistentServiceName == FM_COMPONENT_HIDDEN) // 5.0-Name - return OBJ_FM_HIDDEN; + return SdrObjKind::FormHidden; if (sPersistentServiceName == FM_COMPONENT_HIDDENCONTROL) - return OBJ_FM_HIDDEN; + return SdrObjKind::FormHidden; if (sPersistentServiceName == FM_COMPONENT_IMAGECONTROL) - return OBJ_FM_IMAGECONTROL; + return SdrObjKind::FormImageControl; if (sPersistentServiceName == FM_COMPONENT_FORMATTEDFIELD) { OSL_FAIL("::getControlTypeByObject : suspicious persistent service name (formatted field) !"); // objects with that service name should exist as they aren't compatible with older versions - return OBJ_FM_FORMATTEDFIELD; + return SdrObjKind::FormFormattedField; } if ( sPersistentServiceName == FM_SUN_COMPONENT_SCROLLBAR ) - return OBJ_FM_SCROLLBAR; + return SdrObjKind::FormScrollbar; if ( sPersistentServiceName == FM_SUN_COMPONENT_SPINBUTTON ) - return OBJ_FM_SPINBUTTON; + return SdrObjKind::FormSpinButton; if ( sPersistentServiceName == FM_SUN_COMPONENT_NAVIGATIONBAR ) - return OBJ_FM_NAVIGATIONBAR; + return SdrObjKind::FormNavigationBar; OSL_FAIL("::getControlTypeByObject : unknown object type !"); - return OBJ_FM_CONTROL; + return SdrObjKind::FormControl; } diff --git a/svx/source/form/fmvwimp.cxx b/svx/source/form/fmvwimp.cxx index 790b41ce25b5..80a87cdd61d0 100644 --- a/svx/source/form/fmvwimp.cxx +++ b/svx/source/form/fmvwimp.cxx @@ -1242,7 +1242,7 @@ SdrObjectUniquePtr FmXFormView::implCreateFieldControl( const svx::ODataAccessDe // determine the control type by examining the data type of the bound column - SdrObjKind nOBJID = OBJ_NONE; + SdrObjKind nOBJID = SdrObjKind::NONE; bool bDateNTimeField = false; bool bIsCurrency = false; @@ -1250,53 +1250,53 @@ SdrObjectUniquePtr FmXFormView::implCreateFieldControl( const svx::ODataAccessDe bIsCurrency = ::comphelper::getBOOL(xField->getPropertyValue(FM_PROP_ISCURRENCY)); if (bIsCurrency) - nOBJID = OBJ_FM_CURRENCYFIELD; + nOBJID = SdrObjKind::FormCurrencyField; else switch (nDataType) { case DataType::BLOB: case DataType::LONGVARBINARY: - nOBJID = OBJ_FM_IMAGECONTROL; + nOBJID = SdrObjKind::FormImageControl; break; case DataType::LONGVARCHAR: case DataType::CLOB: - nOBJID = OBJ_FM_EDIT; + nOBJID = SdrObjKind::FormEdit; break; case DataType::BINARY: case DataType::VARBINARY: return nullptr; case DataType::BIT: case DataType::BOOLEAN: - nOBJID = OBJ_FM_CHECKBOX; + nOBJID = SdrObjKind::FormCheckbox; break; case DataType::TINYINT: case DataType::SMALLINT: case DataType::INTEGER: - nOBJID = OBJ_FM_NUMERICFIELD; + nOBJID = SdrObjKind::FormNumericField; break; case DataType::REAL: case DataType::DOUBLE: case DataType::NUMERIC: case DataType::DECIMAL: - nOBJID = OBJ_FM_FORMATTEDFIELD; + nOBJID = SdrObjKind::FormFormattedField; break; case DataType::TIMESTAMP: bDateNTimeField = true; sLabelPostfix = SvxResId(RID_STR_POSTFIX_DATE); [[fallthrough]]; case DataType::DATE: - nOBJID = OBJ_FM_DATEFIELD; + nOBJID = SdrObjKind::FormDateField; break; case DataType::TIME: - nOBJID = OBJ_FM_TIMEFIELD; + nOBJID = SdrObjKind::FormTimeField; break; case DataType::CHAR: case DataType::VARCHAR: default: - nOBJID = OBJ_FM_EDIT; + nOBJID = SdrObjKind::FormEdit; break; } - if (!nOBJID) + if (nOBJID == SdrObjKind::NONE) return nullptr; std::unique_ptr<SdrUnoObj, SdrObjectFreeOp> pLabel; @@ -1310,7 +1310,7 @@ SdrObjectUniquePtr FmXFormView::implCreateFieldControl( const svx::ODataAccessDe // group objects - bool bCheckbox = ( OBJ_FM_CHECKBOX == nOBJID ); + bool bCheckbox = ( SdrObjKind::FormCheckbox == nOBJID ); OSL_ENSURE( !bCheckbox || !pLabel, "FmXFormView::implCreateFieldControl: why was there a label created for a check box?" ); if ( bCheckbox ) return SdrObjectUniquePtr(pControl.release()); @@ -1322,7 +1322,7 @@ SdrObjectUniquePtr FmXFormView::implCreateFieldControl( const svx::ODataAccessDe if ( bDateNTimeField ) { // so far we created a date field only, but we also need a time field - if ( createControlLabelPair( *pOutDev, 0, 1000, xField, xNumberFormats, OBJ_FM_TIMEFIELD, + if ( createControlLabelPair( *pOutDev, 0, 1000, xField, xNumberFormats, SdrObjKind::FormTimeField, SvxResId(RID_STR_POSTFIX_TIME), pLabel, pControl, xDataSource, sDataSource, sCommand, nCommandType ) ) @@ -1387,13 +1387,13 @@ SdrObjectUniquePtr FmXFormView::implCreateXFormsControl( const svx::OXFormsDescr // The service name decides which control should be created - SdrObjKind nOBJID = OBJ_FM_EDIT; + SdrObjKind nOBJID = SdrObjKind::FormEdit; if(_rDesc.szServiceName == FM_SUN_COMPONENT_NUMERICFIELD) - nOBJID = OBJ_FM_NUMERICFIELD; + nOBJID = SdrObjKind::FormNumericField; if(_rDesc.szServiceName == FM_SUN_COMPONENT_CHECKBOX) - nOBJID = OBJ_FM_CHECKBOX; + nOBJID = SdrObjKind::FormCheckbox; if(_rDesc.szServiceName == FM_COMPONENT_COMMANDBUTTON) - nOBJID = OBJ_FM_BUTTON; + nOBJID = SdrObjKind::FormButton; Reference< css::form::submission::XSubmission > xSubmission(_rDesc.xPropSet, UNO_QUERY); @@ -1418,7 +1418,7 @@ SdrObjectUniquePtr FmXFormView::implCreateXFormsControl( const svx::OXFormsDescr if ( xBindableValue.is() ) xBindableValue->setValueBinding(xValueBinding); - bool bCheckbox = ( OBJ_FM_CHECKBOX == nOBJID ); + bool bCheckbox = ( SdrObjKind::FormCheckbox == nOBJID ); OSL_ENSURE( !bCheckbox || !pLabel, "FmXFormView::implCreateXFormsControl: why was there a label created for a check box?" ); if ( bCheckbox ) return SdrObjectUniquePtr(pControl.release()); @@ -1437,7 +1437,7 @@ SdrObjectUniquePtr FmXFormView::implCreateXFormsControl( const svx::OXFormsDescr // create a button control const MapMode& eTargetMode( pOutDev->GetMapMode() ); const MapMode eSourceMode(MapUnit::Map100thMM); - const SdrObjKind nObjID = OBJ_FM_BUTTON; + const SdrObjKind nObjID = SdrObjKind::FormButton; ::Size controlSize(4000, 500); FmFormObj *pControl = static_cast<FmFormObj*>( SdrObjFactory::MakeNewObject( @@ -1489,7 +1489,7 @@ bool FmXFormView::createControlLabelPair( OutputDevice const & _rOutDev, sal_Int _nControlObjectID, _rFieldPostfix, SdrInventor::FmForm, - OBJ_FM_FIXEDTEXT, + SdrObjKind::FormFixedText, // tdf#118963 Hand over a SdrModel to SdrObject-creation. It uses the local m_pView // and already returning false when nullptr == getView() could be done, but m_pView @@ -1555,7 +1555,7 @@ bool FmXFormView::createControlLabelPair( OutputDevice const & _rOutDev, sal_Int aRealSize.setHeight( tools::Long(Fraction(aRealSize.Height(), 1) * eTargetMode.GetScaleY()) ); // for boolean fields, we do not create a label, but just a checkbox - bool bNeedLabel = ( _nControlObjectID != OBJ_FM_CHECKBOX ); + bool bNeedLabel = ( _nControlObjectID != SdrObjKind::FormCheckbox ); // the label ::std::unique_ptr< SdrUnoObj, SdrObjectFreeOp > pLabel; @@ -1626,7 +1626,7 @@ bool FmXFormView::createControlLabelPair( OutputDevice const & _rOutDev, sal_Int break; } - if ( OBJ_FM_IMAGECONTROL == _nControlObjectID ) + if ( SdrObjKind::FormImageControl == _nControlObjectID ) aControlSize = aDefImageSize; aControlSize.setWidth( tools::Long(Fraction(aControlSize.Width(), 1) * eTargetMode.GetScaleX()) ); diff --git a/svx/source/sdr/contact/viewcontactofgraphic.cxx b/svx/source/sdr/contact/viewcontactofgraphic.cxx index 020e17be2d76..6428e5a66520 100644 --- a/svx/source/sdr/contact/viewcontactofgraphic.cxx +++ b/svx/source/sdr/contact/viewcontactofgraphic.cxx @@ -241,7 +241,7 @@ namespace sdr::contact // needed and can be deleted. // create temp RectObj as TextObj and set needed attributes - SdrRectObj* pRectObj(new SdrRectObj(GetGrafObject().getSdrModelFromSdrObject(), OBJ_TEXT)); + SdrRectObj* pRectObj(new SdrRectObj(GetGrafObject().getSdrModelFromSdrObject(), SdrObjKind::Text)); pRectObj->NbcSetText(aDraftText); pRectObj->SetMergedItem(SvxColorItem(COL_LIGHTRED, EE_CHAR_COLOR)); diff --git a/svx/source/sdr/contact/viewcontactofsdrcircobj.cxx b/svx/source/sdr/contact/viewcontactofsdrcircobj.cxx index c05905cbfc20..042d2160a0cf 100644 --- a/svx/source/sdr/contact/viewcontactofsdrcircobj.cxx +++ b/svx/source/sdr/contact/viewcontactofsdrcircobj.cxx @@ -61,12 +61,12 @@ namespace sdr::contact aObjectRange.getMinX(), aObjectRange.getMinY())); // create primitive data - const sal_uInt16 nIdentifier(GetCircObj().GetObjIdentifier()); + const SdrObjKind nIdentifier(GetCircObj().GetObjIdentifier()); // always create primitives to allow the decomposition of SdrEllipsePrimitive2D // or SdrEllipseSegmentPrimitive2D to create needed invisible elements for HitTest // and/or BoundRect - if(OBJ_CIRC == nIdentifier) + if(SdrObjKind::CircleOrEllipse == nIdentifier) { const drawinglayer::primitive2d::Primitive2DReference xReference( new drawinglayer::primitive2d::SdrEllipsePrimitive2D( @@ -81,8 +81,8 @@ namespace sdr::contact const auto nNewEnd(rItemSet.Get(SDRATTR_CIRCENDANGLE).GetValue()); const double fStart(toRadians((36000_deg100 - nNewEnd) % 36000_deg100)); const double fEnd(toRadians((36000_deg100 - nNewStart) % 36000_deg100)); - const bool bCloseSegment(OBJ_CARC != nIdentifier); - const bool bCloseUsingCenter(OBJ_SECT == nIdentifier); + const bool bCloseSegment(SdrObjKind::CircleArc != nIdentifier); + const bool bCloseUsingCenter(SdrObjKind::CircleSection == nIdentifier); const drawinglayer::primitive2d::Primitive2DReference xReference( new drawinglayer::primitive2d::SdrEllipseSegmentPrimitive2D( diff --git a/svx/source/sdr/contact/viewobjectcontactofsdrobj.cxx b/svx/source/sdr/contact/viewobjectcontactofsdrobj.cxx index 96acb10e96f2..f87906240338 100644 --- a/svx/source/sdr/contact/viewobjectcontactofsdrobj.cxx +++ b/svx/source/sdr/contact/viewobjectcontactofsdrobj.cxx @@ -97,7 +97,7 @@ bool ViewObjectContactOfSdrObj::isPrimitiveVisible(const DisplayInfo& rDisplayIn if(bHideOle || bHideChart || bHideDraw || bHideFormControl) { - if(OBJ_OLE2 == rObject.GetObjIdentifier()) + if(SdrObjKind::OLE2 == rObject.GetObjIdentifier()) { if(static_cast<const SdrOle2Obj&>(rObject).IsChart()) { @@ -116,7 +116,7 @@ bool ViewObjectContactOfSdrObj::isPrimitiveVisible(const DisplayInfo& rDisplayIn } } } - else if(OBJ_GRAF == rObject.GetObjIdentifier()) + else if(SdrObjKind::Graphic == rObject.GetObjIdentifier()) { // graphic handled like OLE if(bHideOle) diff --git a/svx/source/sdr/properties/textproperties.cxx b/svx/source/sdr/properties/textproperties.cxx index 75bbb9a89e37..d361080e2062 100644 --- a/svx/source/sdr/properties/textproperties.cxx +++ b/svx/source/sdr/properties/textproperties.cxx @@ -280,7 +280,7 @@ namespace sdr::properties if(GetStyleSheet()) { - if((OBJ_OUTLINETEXT == rObj.GetTextKind()) && (SdrInventor::Default == rObj.GetObjInventor())) + if((SdrObjKind::OutlineText == rObj.GetTextKind()) && (SdrInventor::Default == rObj.GetObjInventor())) { OUString aNewStyleSheetName(GetStyleSheet()->GetName()); aNewStyleSheetName = aNewStyleSheetName.copy(0, aNewStyleSheetName.getLength() - 1); @@ -361,9 +361,9 @@ namespace sdr::properties if( rObj.GetObjInventor() == SdrInventor::Default ) { - const sal_uInt16 nSdrObjKind = rObj.GetObjIdentifier(); + const SdrObjKind nSdrObjKind = rObj.GetObjIdentifier(); - if( nSdrObjKind == OBJ_TITLETEXT || nSdrObjKind == OBJ_OUTLINETEXT ) + if( nSdrObjKind == SdrObjKind::TitleText || nSdrObjKind == SdrObjKind::OutlineText ) return; // no defaults for presentation objects } diff --git a/svx/source/sidebar/SelectionAnalyzer.cxx b/svx/source/sidebar/SelectionAnalyzer.cxx index 7d0cb4d16967..193b6b6b7d60 100644 --- a/svx/source/sidebar/SelectionAnalyzer.cxx +++ b/svx/source/sidebar/SelectionAnalyzer.cxx @@ -54,7 +54,7 @@ EnumContext::Context SelectionAnalyzer::GetContextForSelection_SC(const SdrMarkL else { const SdrInventor nInv = pObj->GetObjInventor(); - const sal_uInt16 nObjId = pObj->GetObjIdentifier(); + const SdrObjKind nObjId = pObj->GetObjIdentifier(); if (nInv == SdrInventor::Default) eContext = GetContextForObjectId_SC(nObjId); else if (nInv == SdrInventor::FmForm) @@ -70,8 +70,8 @@ EnumContext::Context SelectionAnalyzer::GetContextForSelection_SC(const SdrMarkL { case SdrInventor::Default: { - const sal_uInt16 nObjId(GetObjectTypeFromMark(rMarkList)); - if (nObjId == 0) + const SdrObjKind nObjId(GetObjectTypeFromMark(rMarkList)); + if (nObjId == SdrObjKind::NONE) eContext = EnumContext::Context::MultiObject; else eContext = GetContextForObjectId_SC(nObjId); @@ -128,7 +128,7 @@ EnumContext::Context SelectionAnalyzer::GetContextForSelection_SD(const SdrMarkL auto pTextObj = dynamic_cast<SdrTextObj*>(pObj); if (pTextObj && pTextObj->IsInEditMode()) { - if (pObj->GetObjIdentifier() == OBJ_TABLE) + if (pObj->GetObjIdentifier() == SdrObjKind::Table) { // Let a table object take precedence over text // edit mode. The panels for text editing are @@ -145,14 +145,14 @@ EnumContext::Context SelectionAnalyzer::GetContextForSelection_SD(const SdrMarkL else { const SdrInventor nInv = pObj->GetObjInventor(); - sal_uInt16 nObjId = pObj->GetObjIdentifier(); + SdrObjKind nObjId = pObj->GetObjIdentifier(); if (nInv == SdrInventor::Default) { - if (nObjId == OBJ_GRUP) + if (nObjId == SdrObjKind::Group) { nObjId = GetObjectTypeFromGroup(pObj); - if (nObjId == 0) - nObjId = OBJ_GRUP; + if (nObjId == SdrObjKind::NONE) + nObjId = SdrObjKind::Group; } eContext = GetContextForObjectId_SD(nObjId, eViewType); } @@ -174,8 +174,8 @@ EnumContext::Context SelectionAnalyzer::GetContextForSelection_SD(const SdrMarkL { case SdrInventor::Default: { - const sal_uInt16 nObjId = GetObjectTypeFromMark(rMarkList); - if (nObjId == 0) + const SdrObjKind nObjId = GetObjectTypeFromMark(rMarkList); + if (nObjId == SdrObjKind::NONE) eContext = EnumContext::Context::MultiObject; else eContext = GetContextForObjectId_SD(nObjId, eViewType); @@ -204,41 +204,41 @@ EnumContext::Context SelectionAnalyzer::GetContextForSelection_SD(const SdrMarkL return eContext; } -EnumContext::Context SelectionAnalyzer::GetContextForObjectId_SC(const sal_uInt16 nObjectId) +EnumContext::Context SelectionAnalyzer::GetContextForObjectId_SC(const SdrObjKind nObjectId) { switch (nObjectId) { - case OBJ_CAPTION: - case OBJ_TITLETEXT: - case OBJ_OUTLINETEXT: - case OBJ_TEXT: - case OBJ_MEASURE: - 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 OBJ_GRUP: + case SdrObjKind::Caption: + case SdrObjKind::TitleText: + case SdrObjKind::OutlineText: + case SdrObjKind::Text: + case SdrObjKind::Measure: + 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: + case SdrObjKind::Group: return EnumContext::Context::Draw; - case OBJ_PLIN: - case OBJ_PATHLINE: - case OBJ_FREELINE: - case OBJ_LINE: - case OBJ_EDGE: + case SdrObjKind::PolyLine: + case SdrObjKind::PathLine: + case SdrObjKind::FreehandLine: + case SdrObjKind::Line: + case SdrObjKind::Edge: return EnumContext::Context::DrawLine; - case OBJ_GRAF: + case SdrObjKind::Graphic: return EnumContext::Context::Graphic; - case OBJ_OLE2: + case SdrObjKind::OLE2: return EnumContext::Context::OLE; - case OBJ_MEDIA: + case SdrObjKind::Media: return EnumContext::Context::Media; default: @@ -246,50 +246,50 @@ EnumContext::Context SelectionAnalyzer::GetContextForObjectId_SC(const sal_uInt1 } } -EnumContext::Context SelectionAnalyzer::GetContextForObjectId_SD(const sal_uInt16 nObjectId, +EnumContext::Context SelectionAnalyzer::GetContextForObjectId_SD(const SdrObjKind nObjectId, const ViewType eViewType) { switch (nObjectId) { - case OBJ_CAPTION: - case OBJ_MEASURE: - 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 OBJ_GRUP: + case SdrObjKind::Caption: + case SdrObjKind::Measure: + 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: + case SdrObjKind::Group: return EnumContext::Context::Draw; - case OBJ_EDGE: - case OBJ_PATHLINE: - case OBJ_FREELINE: - case OBJ_PLIN: - case OBJ_LINE: + case SdrObjKind::Edge: + case SdrObjKind::PathLine: + case SdrObjKind::FreehandLine: + case SdrObjKind::PolyLine: + case SdrObjKind::Line: return EnumContext::Context::DrawLine; - case OBJ_TITLETEXT: - case OBJ_OUTLINETEXT: - case OBJ_TEXT: + case SdrObjKind::TitleText: + case SdrObjKind::OutlineText: + case SdrObjKind::Text: return EnumContext::Context::TextObject; - case OBJ_GRAF: + case SdrObjKind::Graphic: return EnumContext::Context::Graphic; - case OBJ_OLE2: + case SdrObjKind::OLE2: return EnumContext::Context::OLE; - case OBJ_MEDIA: + case SdrObjKind::Media: return EnumContext::Context::Media; - case OBJ_TABLE: + case SdrObjKind::Table: return EnumContext::Context::Table; - case OBJ_PAGE: + case SdrObjKind::Page: switch (eViewType) { case ViewType::Handout: @@ -329,7 +329,7 @@ SdrInventor SelectionAnalyzer::GetInventorTypeFromMark(const SdrMarkList& rMarkL return nFirstInv; } -sal_uInt16 SelectionAnalyzer::GetObjectTypeFromGroup(const SdrObject* pObj) +SdrObjKind SelectionAnalyzer::GetObjectTypeFromGroup(const SdrObject* pObj) { SdrObjList* pObjList = pObj->GetSubList(); if (pObjList) @@ -339,120 +339,120 @@ sal_uInt16 SelectionAnalyzer::GetObjectTypeFromGroup(const SdrObject* pObj) if (nSubObjCount > 0) { SdrObject* pSubObj = pObjList->GetObj(0); - sal_uInt16 nResultType = pSubObj->GetObjIdentifier(); + SdrObjKind nResultType = pSubObj->GetObjIdentifier(); - if (nResultType == OBJ_GRUP) + if (nResultType == SdrObjKind::Group) nResultType = GetObjectTypeFromGroup(pSubObj); if (IsShapeType(nResultType)) - nResultType = OBJ_CUSTOMSHAPE; + nResultType = SdrObjKind::CustomShape; if (IsTextObjType(nResultType)) - nResultType = OBJ_TEXT; + nResultType = SdrObjKind::Text; for (size_t nIndex = 1; nIndex < nSubObjCount; ++nIndex) { pSubObj = pObjList->GetObj(nIndex); - sal_uInt16 nType(pSubObj->GetObjIdentifier()); + SdrObjKind nType(pSubObj->GetObjIdentifier()); - if (nType == OBJ_GRUP) + if (nType == SdrObjKind::Group) nType = GetObjectTypeFromGroup(pSubObj); if (IsShapeType(nType)) - nType = OBJ_CUSTOMSHAPE; + nType = SdrObjKind::CustomShape; - if ((nType == OBJ_CUSTOMSHAPE) && (nResultType == OBJ_TEXT)) - nType = OBJ_TEXT; + if ((nType == SdrObjKind::CustomShape) && (nResultType == SdrObjKind::Text)) + nType = SdrObjKind::Text; if (IsTextObjType(nType)) - nType = OBJ_TEXT; + nType = SdrObjKind::Text; - if ((nType == OBJ_TEXT) && (nResultType == OBJ_CUSTOMSHAPE)) - nResultType = OBJ_TEXT; + if ((nType == SdrObjKind::Text) && (nResultType == SdrObjKind::CustomShape)) + nResultType = SdrObjKind::Text; if (nType != nResultType) - return 0; + return SdrObjKind::NONE; } return nResultType; } } - return 0; + return SdrObjKind::NONE; } -sal_uInt16 SelectionAnalyzer::GetObjectTypeFromMark(const SdrMarkList& rMarkList) +SdrObjKind SelectionAnalyzer::GetObjectTypeFromMark(const SdrMarkList& rMarkList) { const size_t nMarkCount(rMarkList.GetMarkCount()); if (nMarkCount < 1) - return 0; + return SdrObjKind::NONE; SdrMark* pMark = rMarkList.GetMark(0); SdrObject* pObj = pMark->GetMarkedSdrObj(); - sal_uInt16 nResultType = pObj->GetObjIdentifier(); + SdrObjKind nResultType = pObj->GetObjIdentifier(); - if (nResultType == OBJ_GRUP) + if (nResultType == SdrObjKind::Group) nResultType = GetObjectTypeFromGroup(pObj); if (IsShapeType(nResultType)) - nResultType = OBJ_CUSTOMSHAPE; + nResultType = SdrObjKind::CustomShape; if (IsTextObjType(nResultType)) - nResultType = OBJ_TEXT; + nResultType = SdrObjKind::Text; for (size_t nIndex = 1; nIndex < nMarkCount; ++nIndex) { pMark = rMarkList.GetMark(nIndex); pObj = pMark->GetMarkedSdrObj(); - sal_uInt16 nType = pObj->GetObjIdentifier(); + SdrObjKind nType = pObj->GetObjIdentifier(); - if (nType == OBJ_GRUP) + if (nType == SdrObjKind::Group) nType = GetObjectTypeFromGroup(pObj); if (IsShapeType(nType)) - nType = OBJ_CUSTOMSHAPE; + nType = SdrObjKind::CustomShape; - if ((nType == OBJ_CUSTOMSHAPE) && (nResultType == OBJ_TEXT)) - nType = OBJ_TEXT; + if ((nType == SdrObjKind::CustomShape) && (nResultType == SdrObjKind::Text)) + nType = SdrObjKind::Text; if (IsTextObjType(nType)) - nType = OBJ_TEXT; + nType = SdrObjKind::Text; - if ((nType == OBJ_TEXT) && (nResultType == OBJ_CUSTOMSHAPE)) - nResultType = OBJ_TEXT; + if ((nType == SdrObjKind::Text) && (nResultType == SdrObjKind::CustomShape)) + nResultType = SdrObjKind::Text; if (nType != nResultType) - return 0; + return SdrObjKind::NONE; } return nResultType; } -bool SelectionAnalyzer::IsShapeType(const sal_uInt16 nType) +bool SelectionAnalyzer::IsShapeType(const SdrObjKind nType) { switch (nType) { - case OBJ_LINE: - case OBJ_CARC: - case OBJ_PLIN: - case OBJ_PATHLINE: - case OBJ_RECT: - case OBJ_CIRC: - case OBJ_SECT: - case OBJ_CCUT: - case OBJ_PATHFILL: - case OBJ_CUSTOMSHAPE: - case OBJ_CAPTION: - case OBJ_MEASURE: - case OBJ_EDGE: - case OBJ_POLY: - case OBJ_FREELINE: - case OBJ_FREEFILL: - - // #122145# adding OBJ_OLE2 since these also allow line/fill style and may + case SdrObjKind::Line: + case SdrObjKind::CircleArc: + case SdrObjKind::PolyLine: + case SdrObjKind::PathLine: + case SdrObjKind::Rectangle: + case SdrObjKind::CircleOrEllipse: + case SdrObjKind::CircleSection: + case SdrObjKind::CircleCut: + case SdrObjKind::PathFill: + case SdrObjKind::CustomShape: + case SdrObjKind::Caption: + case SdrObjKind::Measure: + case SdrObjKind::Edge: + case SdrObjKind::Polygon: + case SdrObjKind::FreehandLine: + case SdrObjKind::FreehandFill: + + // #122145# adding SdrObjKind::OLE2 since these also allow line/fill style and may // be multiselected/grouped with normal draw objects, e.g. math OLE objects - case OBJ_OLE2: + case SdrObjKind::OLE2: return true; default: @@ -460,13 +460,13 @@ bool SelectionAnalyzer::IsShapeType(const sal_uInt16 nType) } } -bool SelectionAnalyzer::IsTextObjType(const sal_uInt16 nType) +bool SelectionAnalyzer::IsTextObjType(const SdrObjKind nType) { switch (nType) { - case OBJ_TEXT: - case OBJ_TITLETEXT: - case OBJ_OUTLINETEXT: + case SdrObjKind::Text: + case SdrObjKind::TitleText: + case SdrObjKind::OutlineText: return true; default: diff --git a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx index cb309821b824..8c211c853bce 100644 --- a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx +++ b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx @@ -185,7 +185,7 @@ namespace const SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj(); const SdrObjKind eKind(pObj->GetObjIdentifier()); - if((pObj->GetObjInventor() == SdrInventor::Default) && (OBJ_TEXT == eKind || OBJ_TITLETEXT == eKind || OBJ_OUTLINETEXT == eKind)) + if((pObj->GetObjInventor() == SdrInventor::Default) && (SdrObjKind::Text == eKind || SdrObjKind::TitleText == eKind || SdrObjKind::OutlineText == eKind)) { const SdrTextObj* pSdrTextObj = dynamic_cast< const SdrTextObj* >(pObj); @@ -708,8 +708,8 @@ void PosSizePropertyPanel::NotifyItemUpdate( if(((nCombinedContext == CombinedEnumContext(Application::DrawImpress, Context::Draw) || nCombinedContext == CombinedEnumContext(Application::DrawImpress, Context::TextObject) - ) && OBJ_EDGE == eKind) - || OBJ_CAPTION == eKind) + ) && SdrObjKind::Edge == eKind) + || SdrObjKind::Caption == eKind) { mxFtAngle->set_sensitive(false); mxMtrAngle->set_sensitive(false); @@ -732,8 +732,8 @@ void PosSizePropertyPanel::NotifyItemUpdate( if(((nCombinedContext == CombinedEnumContext(Application::DrawImpress, Context::Draw) || nCombinedContext == CombinedEnumContext(Application::DrawImpress, Context::TextObject) - ) && OBJ_EDGE == eKind) - || OBJ_CAPTION == eKind) + ) && SdrObjKind::Edge == eKind) + || SdrObjKind::Caption == eKind) { isNoEdge = false; break; diff --git a/svx/source/svdraw/svdcrtv.cxx b/svx/source/svdraw/svdcrtv.cxx index 84443978a30a..9791df7ae9f2 100644 --- a/svx/source/svdraw/svdcrtv.cxx +++ b/svx/source/svdraw/svdcrtv.cxx @@ -187,7 +187,7 @@ SdrCreateView::SdrCreateView(SdrModel& rSdrModel, OutputDevice* pOut) , mnAutoCloseDistPix(5) , mnFreeHandMinDistPix(10) , mnCurrentInvent(SdrInventor::Default) - , mnCurrentIdent(OBJ_NONE) + , mnCurrentIdent(SdrObjKind::NONE) , mb1stPointAsCenter(false) , mbUseIncompatiblePathCreateInterface(false) { @@ -252,10 +252,10 @@ bool SdrCreateView::CheckEdgeMode() if (mpCurrentCreate != nullptr) { // is managed by EdgeObj - if (mnCurrentInvent==SdrInventor::Default && mnCurrentIdent==OBJ_EDGE) return false; + if (mnCurrentInvent==SdrInventor::Default && mnCurrentIdent==SdrObjKind::Edge) return false; } - if (!IsCreateMode() || mnCurrentInvent!=SdrInventor::Default || mnCurrentIdent!=OBJ_EDGE) + if (!IsCreateMode() || mnCurrentInvent!=SdrInventor::Default || mnCurrentIdent!=SdrObjKind::Edge) { ImpClearConnectMarker(); return false; @@ -316,17 +316,21 @@ bool SdrCreateView::MouseMove(const MouseEvent& rMEvt, OutputDevice* pWin) bool SdrCreateView::IsTextTool() const { - return meEditMode==SdrViewEditMode::Create && mnCurrentInvent==SdrInventor::Default && (mnCurrentIdent==OBJ_TEXT || mnCurrentIdent==OBJ_TITLETEXT || mnCurrentIdent==OBJ_OUTLINETEXT); + return meEditMode==SdrViewEditMode::Create + && mnCurrentInvent==SdrInventor::Default + && (mnCurrentIdent==SdrObjKind::Text + || mnCurrentIdent==SdrObjKind::TitleText + || mnCurrentIdent==SdrObjKind::OutlineText); } bool SdrCreateView::IsEdgeTool() const { - return meEditMode==SdrViewEditMode::Create && mnCurrentInvent==SdrInventor::Default && (mnCurrentIdent==OBJ_EDGE); + return meEditMode==SdrViewEditMode::Create && mnCurrentInvent==SdrInventor::Default && (mnCurrentIdent==SdrObjKind::Edge); } bool SdrCreateView::IsMeasureTool() const { - return meEditMode==SdrViewEditMode::Create && mnCurrentInvent==SdrInventor::Default && (mnCurrentIdent==OBJ_MEASURE); + return meEditMode==SdrViewEditMode::Create && mnCurrentInvent==SdrInventor::Default && (mnCurrentIdent==SdrObjKind::Measure); } void SdrCreateView::SetCurrentObj(SdrObjKind nIdent, SdrInventor nInvent) @@ -335,7 +339,7 @@ void SdrCreateView::SetCurrentObj(SdrObjKind nIdent, SdrInventor nInvent) { mnCurrentInvent=nInvent; mnCurrentIdent=nIdent; - SdrObject * pObj = (nIdent == OBJ_NONE) ? nullptr : + SdrObject * pObj = (nIdent == SdrObjKind::NONE) ? nullptr : SdrObjFactory::MakeNewObject( *GetModel(), nInvent, @@ -381,7 +385,7 @@ bool SdrCreateView::ImpBegCreateObj(SdrInventor nInvent, SdrObjKind nIdent, cons { // otherwise no side registered! OUString aLay(maActualLayer); - if(nInvent == SdrInventor::Default && nIdent == OBJ_MEASURE && !maMeasureLayer.isEmpty()) + if(nInvent == SdrInventor::Default && nIdent == SdrObjKind::Measure && !maMeasureLayer.isEmpty()) { aLay = maMeasureLayer; } @@ -403,9 +407,9 @@ bool SdrCreateView::ImpBegCreateObj(SdrInventor nInvent, SdrObjKind nIdent, cons } Point aPnt(rPnt); - if (mnCurrentInvent!=SdrInventor::Default || (mnCurrentIdent!=sal_uInt16(OBJ_EDGE) && - mnCurrentIdent!=sal_uInt16(OBJ_FREELINE) && - mnCurrentIdent!=sal_uInt16(OBJ_FREEFILL) )) { // no snapping for Edge and Freehand + if (mnCurrentInvent != SdrInventor::Default || (mnCurrentIdent != SdrObjKind::Edge && + mnCurrentIdent != SdrObjKind::FreehandLine && + mnCurrentIdent != SdrObjKind::FreehandFill )) { // no snapping for Edge and Freehand aPnt=GetSnapPos(aPnt, mpCreatePV); } if (mpCurrentCreate!=nullptr) @@ -416,7 +420,7 @@ bool SdrCreateView::ImpBegCreateObj(SdrInventor nInvent, SdrObjKind nIdent, cons // object should not be created. Since it is possible to use it as a helper // object (e.g. in letting the user define an area with the interactive // construction) at least no items should be set at that object. - if(nInvent != SdrInventor::Default || nIdent != OBJ_NONE) + if(nInvent != SdrInventor::Default || nIdent != SdrObjKind::NONE) { mpCurrentCreate->SetMergedItemSet(maDefaultAttr); } @@ -429,8 +433,8 @@ bool SdrCreateView::ImpBegCreateObj(SdrInventor nInvent, SdrObjKind nIdent, cons mpCurrentCreate->SetMergedItemSet(aSet); } - if (mpModel && nInvent==SdrInventor::Default && (nIdent==OBJ_TEXT || - nIdent==OBJ_TITLETEXT || nIdent==OBJ_OUTLINETEXT)) + if (mpModel && nInvent==SdrInventor::Default && (nIdent==SdrObjKind::Text || + nIdent==SdrObjKind::TitleText || nIdent==SdrObjKind::OutlineText)) { // default for all text frames: no background, no border SfxItemSet aSet(mpModel->GetItemPool()); @@ -513,7 +517,7 @@ bool SdrCreateView::BegCreatePreparedObject(const Point& rPnt, sal_Int16 nMinMov bool SdrCreateView::BegCreateCaptionObj(const Point& rPnt, const Size& rObjSiz, OutputDevice* pOut, short nMinMov) { - return ImpBegCreateObj(SdrInventor::Default,OBJ_CAPTION,rPnt,pOut,nMinMov, + return ImpBegCreateObj(SdrInventor::Default,SdrObjKind::Caption,rPnt,pOut,nMinMov, tools::Rectangle(rPnt,Size(rObjSiz.Width()+1,rObjSiz.Height()+1)), nullptr); } @@ -746,7 +750,7 @@ void SdrCreateView::ShowCreateObj(/*OutputDevice* pOut, sal_Bool bFull*/) // a derivation). This is e.g. used in SW Frame construction // as placeholder. Do not use SolidDragging for naked SdrObjects, // they cannot have a valid optical representation - if(bUseSolidDragging && OBJ_NONE == mpCurrentCreate->GetObjIdentifier()) + if(bUseSolidDragging && SdrObjKind::NONE == mpCurrentCreate->GetObjIdentifier()) { bUseSolidDragging = false; } @@ -778,7 +782,7 @@ void SdrCreateView::ShowCreateObj(/*OutputDevice* pOut, sal_Bool bFull*/) { SdrCircObj* pCircObj = dynamic_cast<SdrCircObj*>(mpCurrentCreate); - if(pCircObj && OBJ_CIRC != pCircObj->GetObjIdentifier()) + if(pCircObj && SdrObjKind::CircleOrEllipse != pCircObj->GetObjIdentifier()) { // #i103058# Allow SolidDragging with four points if(maDragStat.GetPointCount() < 4) diff --git a/svx/source/svdraw/svdedtv2.cxx b/svx/source/svdraw/svdedtv2.cxx index 1d04e2eb381a..0700847fe920 100644 --- a/svx/source/svdraw/svdedtv2.cxx +++ b/svx/source/svdraw/svdedtv2.cxx @@ -1120,7 +1120,7 @@ void SdrEditView::MergeMarkedObjects(SdrMergeMode eMode) // #i73441# check insert list before taking actions if(pInsOL) { - SdrPathObj* pPath = new SdrPathObj(pAttrObj->getSdrModelFromSdrObject(), OBJ_PATHFILL, aMergePolyPolygonA); + SdrPathObj* pPath = new SdrPathObj(pAttrObj->getSdrModelFromSdrObject(), SdrObjKind::PathFill, aMergePolyPolygonA); ImpCopyAttributes(pAttrObj, pPath); pInsOL->InsertObject(pPath, nInsPos); if( bUndo ) @@ -1240,7 +1240,7 @@ void SdrEditView::CombineMarkedTextObjects() SdrTextObj* pTextObj = dynamic_cast<SdrTextObj*>( pObj ); const OutlinerParaObject* pOPO = pTextObj ? pTextObj->GetOutlinerParaObject() : nullptr; if ( pOPO && pTextObj->IsTextFrame() - && pTextObj->GetObjIdentifier() == OBJ_TEXT // not callouts (OBJ_CAPTION) + && pTextObj->GetObjIdentifier() == SdrObjKind::Text // not callouts (OBJ_CAPTION) && !pTextObj->IsOutlText() // not impress presentation objects && pTextObj->GetMergedItem(XATTR_FORMTXTSTYLE).GetValue() == XFormTextStyle::NONE // not Fontwork ) @@ -1268,7 +1268,7 @@ void SdrEditView::CombineMarkedTextObjects() if ( GetMarkedObjectCount() > 1 ) { - SdrRectObj* pReplacement = new SdrRectObj( getSdrModelFromSdrView(), OBJ_TEXT ); + SdrRectObj* pReplacement = new SdrRectObj( getSdrModelFromSdrView(), SdrObjKind::Text ); pReplacement->SetOutlinerParaObject( rDrawOutliner.CreateParaObject() ); pReplacement->SetSnapRect( GetMarkedObjRect() ); @@ -1376,7 +1376,7 @@ void SdrEditView::CombineMarkedObjects(bool bNoPolyPoly) if (nPolyCount && pAttrObj) { - SdrObjKind eKind = OBJ_PATHFILL; + SdrObjKind eKind = SdrObjKind::PathFill; if(nPolyCount > 1) { @@ -1390,7 +1390,7 @@ void SdrEditView::CombineMarkedObjects(bool bNoPolyPoly) if(nPointCount <= 2) { - eKind = OBJ_PATHLINE; + eKind = SdrObjKind::PathLine; } else { @@ -1407,7 +1407,7 @@ void SdrEditView::CombineMarkedObjects(bool bNoPolyPoly) } else { - eKind = OBJ_PATHLINE; + eKind = SdrObjKind::PathLine; } } } @@ -1601,7 +1601,7 @@ void SdrEditView::ImpDismantleOneObject(const SdrObject* pObj, SdrObjList& rOL, for(sal_uInt32 b(0); b < nLoopCount; b++) { - SdrObjKind eKind(OBJ_PLIN); + SdrObjKind eKind(SdrObjKind::PolyLine); basegfx::B2DPolygon aNewPolygon; const sal_uInt32 nNextIndex((b + 1) % nPointCount); @@ -1613,7 +1613,7 @@ void SdrEditView::ImpDismantleOneObject(const SdrObject* pObj, SdrObjList& rOL, rCandidate.getNextControlPoint(b), rCandidate.getPrevControlPoint(nNextIndex), rCandidate.getB2DPoint(nNextIndex)); - eKind = OBJ_PATHLINE; + eKind = SdrObjKind::PathLine; } else { @@ -1671,7 +1671,7 @@ void SdrEditView::ImpDismantleOneObject(const SdrObject* pObj, SdrObjList& rOL, SdrObject* pTextObj = SdrObjFactory::MakeNewObject( pCustomShape->getSdrModelFromSdrObject(), pCustomShape->GetObjInventor(), - OBJ_TEXT); + SdrObjKind::Text); // Copy text content OutlinerParaObject* pParaObj = pCustomShape->GetOutlinerParaObject(); diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx index 6ba72c1c09f1..ad016b5c4f32 100644 --- a/svx/source/svdraw/svdedxv.cxx +++ b/svx/source/svdraw/svdedxv.cxx @@ -1575,7 +1575,7 @@ SdrEndTextEditKind SdrObjEditView::SdrEndTextEdit(bool bDontDeleteReally) && pTEObj->GetObjInventor() == SdrInventor::Default && !bDontDeleteReally) { SdrObjKind eIdent = pTEObj->GetObjIdentifier(); - if (eIdent == OBJ_TEXT) + if (eIdent == SdrObjKind::Text) { pDelUndo = GetModel()->GetSdrUndoFactory().CreateUndoDeleteObject(*pTEObj); } @@ -2529,7 +2529,7 @@ void SdrObjEditView::MarkListHasChanged() // check for table if (pObj && pView && (pObj->GetObjInventor() == SdrInventor::Default) - && (pObj->GetObjIdentifier() == OBJ_TABLE)) + && (pObj->GetObjIdentifier() == SdrObjKind::Table)) { mxSelectionController = sdr::table::CreateTableController( *pView, static_cast<const sdr::table::SdrTableObj&>(*pObj), mxLastSelectionController); @@ -2598,48 +2598,48 @@ sal_uInt16 SdrObjEditView::GetSelectionLevel() const } bool SdrObjEditView::SupportsFormatPaintbrush(SdrInventor nObjectInventor, - sal_uInt16 nObjectIdentifier) + SdrObjKind nObjectIdentifier) { if (nObjectInventor != SdrInventor::Default && nObjectInventor != SdrInventor::E3d) return false; switch (nObjectIdentifier) { - case OBJ_NONE: - case OBJ_GRUP: + case SdrObjKind::NONE: + case SdrObjKind::Group: return false; - case OBJ_LINE: - case OBJ_RECT: - case OBJ_CIRC: - case OBJ_SECT: - case OBJ_CARC: - case OBJ_CCUT: - case OBJ_POLY: - case OBJ_PLIN: - case OBJ_PATHLINE: - case OBJ_PATHFILL: - case OBJ_FREELINE: - case OBJ_FREEFILL: - case OBJ_SPLNLINE: - case OBJ_SPLNFILL: - case OBJ_TEXT: - case OBJ_TITLETEXT: - case OBJ_OUTLINETEXT: - case OBJ_GRAF: - case OBJ_OLE2: - case OBJ_TABLE: + case SdrObjKind::Line: + case SdrObjKind::Rectangle: + case SdrObjKind::CircleOrEllipse: + case SdrObjKind::CircleSection: + case SdrObjKind::CircleArc: + case SdrObjKind::CircleCut: + case SdrObjKind::Polygon: + case SdrObjKind::PolyLine: + case SdrObjKind::PathLine: + case SdrObjKind::PathFill: + case SdrObjKind::FreehandLine: + case SdrObjKind::FreehandFill: + case SdrObjKind::SplineLine: + case SdrObjKind::SplineFill: + case SdrObjKind::Text: + case SdrObjKind::TitleText: + case SdrObjKind::OutlineText: + case SdrObjKind::Graphic: + case SdrObjKind::OLE2: + case SdrObjKind::Table: return true; - case OBJ_EDGE: - case OBJ_CAPTION: + case SdrObjKind::Edge: + case SdrObjKind::Caption: return false; - case OBJ_PATHPOLY: - case OBJ_PATHPLIN: + case SdrObjKind::PathPoly: + case SdrObjKind::PathPolyLine: return true; - case OBJ_PAGE: - case OBJ_MEASURE: - case OBJ_FRAME: - case OBJ_UNO: + case SdrObjKind::Page: + case SdrObjKind::Measure: + case SdrObjKind::OLEPluginFrame: + case SdrObjKind::UNO: return false; - case OBJ_CUSTOMSHAPE: + case SdrObjKind::CustomShape: return true; default: return false; @@ -2685,7 +2685,7 @@ void SdrObjEditView::TakeFormatPaintBrush(std::shared_ptr<SfxItemSet>& rFormatSe // check for cloning from table cell, in which case we need to copy cell-specific formatting attributes const SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj(); if (pObj && (pObj->GetObjInventor() == SdrInventor::Default) - && (pObj->GetObjIdentifier() == OBJ_TABLE)) + && (pObj->GetObjIdentifier() == SdrObjKind::Table)) { auto pTable = static_cast<const sdr::table::SdrTableObj*>(pObj); if (mxSelectionController.is() && pTable->getActiveCell().is()) @@ -2854,7 +2854,7 @@ void SdrObjEditView::ApplyFormatPaintBrush(SfxItemSet& rFormatSet, bool bNoChara // check for cloning to table cell, in which case we need to copy cell-specific formatting attributes SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj(); if (pObj && (pObj->GetObjInventor() == SdrInventor::Default) - && (pObj->GetObjIdentifier() == OBJ_TABLE)) + && (pObj->GetObjIdentifier() == SdrObjKind::Table)) { auto pTable = static_cast<sdr::table::SdrTableObj*>(pObj); if (pTable->getActiveCell().is() && mxSelectionController.is()) diff --git a/svx/source/svdraw/svdfmtf.cxx b/svx/source/svdraw/svdfmtf.cxx index 94d54040cd03..659fae0908c9 100644 --- a/svx/source/svdraw/svdfmtf.cxx +++ b/svx/source/svdraw/svdfmtf.cxx @@ -554,7 +554,7 @@ void ImpSdrGDIMetaFileImport::InsertObj(SdrObject* pObj, bool bScale) { pObj = new SdrPathObj( *mpModel, - aNewPoly.isClosed() ? OBJ_POLY : OBJ_PLIN, + aNewPoly.isClosed() ? SdrObjKind::Polygon : SdrObjKind::PolyLine, aNewPoly); pObj->SetLayer(aOldLayer); @@ -687,7 +687,7 @@ void ImpSdrGDIMetaFileImport::DoAction(MetaLineAction const & rAct) SdrPathObj* pPath = new SdrPathObj( *mpModel, - OBJ_LINE, + SdrObjKind::Line, basegfx::B2DPolyPolygon(aLine)); mnLineWidth = nNewLineWidth; maLineJoin = rLineInfo.GetLineJoin(); @@ -933,7 +933,7 @@ void ImpSdrGDIMetaFileImport::DoAction( MetaPolyLineAction const & rAct ) SdrPathObj* pPath = new SdrPathObj( *mpModel, - aSource.isClosed() ? OBJ_POLY : OBJ_PLIN, + aSource.isClosed() ? SdrObjKind::Polygon : SdrObjKind::PolyLine, basegfx::B2DPolyPolygon(aSource)); mnLineWidth = nNewLineWidth; maLineJoin = rLineInfo.GetLineJoin(); @@ -966,7 +966,7 @@ void ImpSdrGDIMetaFileImport::DoAction( MetaPolygonAction const & rAct ) aSource.setClosed(true); SdrPathObj* pPath = new SdrPathObj( *mpModel, - OBJ_POLY, + SdrObjKind::Polygon, basegfx::B2DPolyPolygon(aSource)); SetAttributes(pPath); InsertObj(pPath, false); @@ -990,7 +990,7 @@ void ImpSdrGDIMetaFileImport::DoAction(MetaPolyPolygonAction const & rAct) aSource.setClosed(true); SdrPathObj* pPath = new SdrPathObj( *mpModel, - OBJ_POLY, + SdrObjKind::Polygon, aSource); SetAttributes(pPath); InsertObj(pPath, false); @@ -1019,7 +1019,7 @@ void ImpSdrGDIMetaFileImport::ImportText( const Point& rPos, const OUString& rSt tools::Rectangle aTextRect( aPos, aSize ); SdrRectObj* pText = new SdrRectObj( *mpModel, - OBJ_TEXT, + SdrObjKind::Text, aTextRect); pText->SetMergedItem ( makeSdrTextUpperDistItem (0)); @@ -1156,7 +1156,7 @@ void ImpSdrGDIMetaFileImport::DoAction( MetaHatchAction const & rAct ) const Hatch& rHatch = rAct.GetHatch(); SdrPathObj* pPath = new SdrPathObj( *mpModel, - OBJ_POLY, + SdrObjKind::Polygon, aSource); // #i125211# Use the ranges from the SdrObject to create a new empty SfxItemSet SfxItemSet aHatchAttr(mpModel->GetItemPool(), pPath->GetMergedItemSet().GetRanges()); @@ -1247,7 +1247,7 @@ void ImpSdrGDIMetaFileImport::DoAction( MetaCommentAction const & rAct, GDIMetaF const Gradient& rGrad = pAct->GetGradient(); SdrPathObj* pPath = new SdrPathObj( *mpModel, - OBJ_POLY, + SdrObjKind::Polygon, aSource); // #i125211# Use the ranges from the SdrObject to create a new empty SfxItemSet SfxItemSet aGradAttr(mpModel->GetItemPool(), pPath->GetMergedItemSet().GetRanges()); @@ -1480,7 +1480,7 @@ void ImpSdrGDIMetaFileImport::DoAction(MetaTransparentAction const & rAct) SdrPathObj* pPath = new SdrPathObj( *mpModel, - OBJ_POLY, + SdrObjKind::Polygon, aSource); SetAttributes(pPath); pPath->SetMergedItem(XFillTransparenceItem(rAct.GetTransparence())); @@ -1503,7 +1503,7 @@ void ImpSdrGDIMetaFileImport::DoAction(MetaGradientExAction const & rAct) const Gradient& rGradient = rAct.GetGradient(); SdrPathObj* pPath = new SdrPathObj( *mpModel, - OBJ_POLY, + SdrObjKind::Polygon, aSource); // #i125211# Use the ranges from the SdrObject to create a new empty SfxItemSet SfxItemSet aGradientAttr(mpModel->GetItemPool(), pPath->GetMergedItemSet().GetRanges()); diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx index ff76ce6bf485..1aa6d8a2e8b2 100644 --- a/svx/source/svdraw/svdmrkv.cxx +++ b/svx/source/svdraw/svdmrkv.cxx @@ -601,8 +601,8 @@ bool SdrMarkView::ImpIsFrameHandles() const const SdrObject* pObj=GetMarkedObjectByIndex(0); if (pObj && pObj->GetObjInventor()==SdrInventor::Default) { - sal_uInt16 nIdent=pObj->GetObjIdentifier(); - if (nIdent==OBJ_LINE || nIdent==OBJ_EDGE || nIdent==OBJ_CAPTION || nIdent==OBJ_MEASURE || nIdent==OBJ_CUSTOMSHAPE || nIdent==OBJ_TABLE ) + SdrObjKind nIdent=pObj->GetObjIdentifier(); + if (nIdent==SdrObjKind::Line || nIdent==SdrObjKind::Edge || nIdent==SdrObjKind::Caption || nIdent==SdrObjKind::Measure || nIdent==SdrObjKind::CustomShape || nIdent==SdrObjKind::Table ) { bFrmHdl=false; } @@ -812,12 +812,12 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle const & rRect, const S bool bTableSelection = false; bool bConnectorSelection = false; - if (mpMarkedObj && mpMarkedObj->GetObjIdentifier() == OBJ_TABLE) + if (mpMarkedObj && mpMarkedObj->GetObjIdentifier() == SdrObjKind::Table) { auto& rTableObject = dynamic_cast<sdr::table::SdrTableObj&>(*mpMarkedObj); bTableSelection = rTableObject.createTableEdgesJson(aTableJsonTree); } - if (mpMarkedObj && mpMarkedObj->GetObjIdentifier() == OBJ_EDGE) + if (mpMarkedObj && mpMarkedObj->GetObjIdentifier() == SdrObjKind::Edge) { bConnectorSelection = dumpGluePointsToJSON(aGluePointsTree); } @@ -933,7 +933,7 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle const & rRect, const S aExtraInfo.append("]"); // polygon approximating the pie segment or donut segment - if (pO->GetObjIdentifier() == OBJ_PATHFILL) + if (pO->GetObjIdentifier() == SdrObjKind::PathFill) { const basegfx::B2DPolyPolygon aPolyPolygon(pO->TakeXorPoly()); if (aPolyPolygon.count() == 1) @@ -2667,8 +2667,7 @@ void SdrMarkView::MarkListHasChanged() if (GetMarkedObjectCount()==1) { const SdrObject* pObj=GetMarkedObjectByIndex(0); if (pObj->GetObjInventor()==SdrInventor::Default) { - sal_uInt16 nIdent=pObj->GetObjIdentifier(); - bOneEdgeMarked=nIdent==OBJ_EDGE; + bOneEdgeMarked = pObj->GetObjIdentifier() == SdrObjKind::Edge; } } ImpSetGlueVisible4(bOneEdgeMarked); diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx index 994772547c77..9c711c1e204e 100644 --- a/svx/source/svdraw/svdoashp.cxx +++ b/svx/source/svdraw/svdoashp.cxx @@ -1366,7 +1366,7 @@ void SdrObjCustomShape::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const SdrObjKind SdrObjCustomShape::GetObjIdentifier() const { - return OBJ_CUSTOMSHAPE; + return SdrObjKind::CustomShape; } // #115391# This implementation is based on the TextFrame size of the CustomShape and the diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx index 9cd2d1b5cde0..6050a654cae1 100644 --- a/svx/source/svdraw/svdobj.cxx +++ b/svx/source/svdraw/svdobj.cxx @@ -659,7 +659,7 @@ SdrInventor SdrObject::GetObjInventor() const SdrObjKind SdrObject::GetObjIdentifier() const { - return OBJ_NONE; + return SdrObjKind::NONE; } void SdrObject::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const @@ -2429,7 +2429,7 @@ SdrObject* SdrObject::ImpConvertToContourObj(bool bForceLineDash) // create SdrObject for filled line geometry aLinePolygonPart = new SdrPathObj( getSdrModelFromSdrObject(), - OBJ_PATHFILL, + SdrObjKind::PathFill, aMergedLineFillPolyPolygon); // correct item properties @@ -2452,7 +2452,7 @@ SdrObject* SdrObject::ImpConvertToContourObj(bool bForceLineDash) // the correct closed state. aLineHairlinePart = new SdrPathObj( getSdrModelFromSdrObject(), - OBJ_PATHLINE, + SdrObjKind::PathLine, aMergedHairlinePolyPolygon); aSet.Put(XLineWidthItem(0)); @@ -3192,7 +3192,7 @@ SdrObject* SdrObjFactory::MakeNewObject( { switch (nIdentifier) { - case OBJ_MEASURE: + case SdrObjKind::Measure: { if(nullptr != pSnapRect) { @@ -3207,7 +3207,7 @@ SdrObject* SdrObjFactory::MakeNewObject( } } break; - case OBJ_LINE: + case SdrObjKind::Line: { if(nullptr != pSnapRect) { @@ -3223,20 +3223,20 @@ SdrObject* SdrObjFactory::MakeNewObject( pSnapRect->Bottom())); pObj = new SdrPathObj( rSdrModel, - OBJ_LINE, + SdrObjKind::Line, basegfx::B2DPolyPolygon(aPoly)); } else { pObj = new SdrPathObj( rSdrModel, - OBJ_LINE); + SdrObjKind::Line); } } break; - case OBJ_TEXT: - case OBJ_TITLETEXT: - case OBJ_OUTLINETEXT: + case SdrObjKind::Text: + case SdrObjKind::TitleText: + case SdrObjKind::OutlineText: { if(nullptr != pSnapRect) { @@ -3254,10 +3254,10 @@ SdrObject* SdrObjFactory::MakeNewObject( } } break; - case OBJ_CIRC: - case OBJ_SECT: - case OBJ_CARC: - case OBJ_CCUT: + case SdrObjKind::CircleOrEllipse: + case SdrObjKind::CircleSection: + case SdrObjKind::CircleArc: + case SdrObjKind::CircleCut: { SdrCircKind eCircKind = ToSdrCircKind(nIdentifier); if(nullptr != pSnapRect) @@ -3271,29 +3271,29 @@ SdrObject* SdrObjFactory::MakeNewObject( } } break; - case OBJ_NONE : pObj=new SdrObject(rSdrModel); break; - case OBJ_GRUP : pObj=new SdrObjGroup(rSdrModel); break; - case OBJ_POLY : pObj=new SdrPathObj(rSdrModel, OBJ_POLY ); break; - case OBJ_PLIN : pObj=new SdrPathObj(rSdrModel, OBJ_PLIN ); break; - case OBJ_PATHLINE : pObj=new SdrPathObj(rSdrModel, OBJ_PATHLINE ); break; - case OBJ_PATHFILL : pObj=new SdrPathObj(rSdrModel, OBJ_PATHFILL ); break; - case OBJ_FREELINE : pObj=new SdrPathObj(rSdrModel, OBJ_FREELINE ); break; - case OBJ_FREEFILL : pObj=new SdrPathObj(rSdrModel, OBJ_FREEFILL ); break; - case OBJ_PATHPOLY : pObj=new SdrPathObj(rSdrModel, OBJ_POLY ); break; - case OBJ_PATHPLIN : pObj=new SdrPathObj(rSdrModel, OBJ_PLIN ); break; - case OBJ_EDGE : pObj=new SdrEdgeObj(rSdrModel); break; - case OBJ_RECT : pObj=new SdrRectObj(rSdrModel); break; - case OBJ_GRAF : pObj=new SdrGrafObj(rSdrModel); break; - case OBJ_OLE2 : pObj=new SdrOle2Obj(rSdrModel); break; - case OBJ_FRAME : pObj=new SdrOle2Obj(rSdrModel, true); break; - case OBJ_CAPTION : pObj=new SdrCaptionObj(rSdrModel); break; - case OBJ_PAGE : pObj=new SdrPageObj(rSdrModel); break; - case OBJ_UNO : pObj=new SdrUnoObj(rSdrModel, OUString()); break; - case OBJ_CUSTOMSHAPE: pObj=new SdrObjCustomShape(rSdrModel); break; + case SdrObjKind::NONE : pObj=new SdrObject(rSdrModel); break; + case SdrObjKind::Group : pObj=new SdrObjGroup(rSdrModel); break; + case SdrObjKind::Polygon : pObj=new SdrPathObj(rSdrModel, SdrObjKind::Polygon ); break; + case SdrObjKind::PolyLine : pObj=new SdrPathObj(rSdrModel, SdrObjKind::PolyLine ); break; + case SdrObjKind::PathLine : pObj=new SdrPathObj(rSdrModel, SdrObjKind::PathLine ); break; + case SdrObjKind::PathFill : pObj=new SdrPathObj(rSdrModel, SdrObjKind::PathFill ); break; + case SdrObjKind::FreehandLine : pObj=new SdrPathObj(rSdrModel, SdrObjKind::FreehandLine ); break; + case SdrObjKind::FreehandFill : pObj=new SdrPathObj(rSdrModel, SdrObjKind::FreehandFill ); break; + case SdrObjKind::PathPoly : pObj=new SdrPathObj(rSdrModel, SdrObjKind::Polygon ); break; + case SdrObjKind::PathPolyLine : pObj=new SdrPathObj(rSdrModel, SdrObjKind::PolyLine ); break; + case SdrObjKind::Edge : pObj=new SdrEdgeObj(rSdrModel); break; + case SdrObjKind::Rectangle : pObj=new SdrRectObj(rSdrModel); break; + case SdrObjKind::Graphic : pObj=new SdrGrafObj(rSdrModel); break; + case SdrObjKind::OLE2 : pObj=new SdrOle2Obj(rSdrModel); break; + case SdrObjKind::OLEPluginFrame : pObj=new SdrOle2Obj(rSdrModel, true); break; + case SdrObjKind::Caption : pObj=new SdrCaptionObj(rSdrModel); break; + case SdrObjKind::Page : pObj=new SdrPageObj(rSdrModel); break; + case SdrObjKind::UNO : pObj=new SdrUnoObj(rSdrModel, OUString()); break; + case SdrObjKind::CustomShape: pObj=new SdrObjCustomShape(rSdrModel); break; #if HAVE_FEATURE_AVMEDIA - case OBJ_MEDIA : pObj=new SdrMediaObj(rSdrModel); break; + case SdrObjKind::Media : pObj=new SdrMediaObj(rSdrModel); break; #endif - case OBJ_TABLE : pObj=new sdr::table::SdrTableObj(rSdrModel); break; + case SdrObjKind::Table : pObj=new sdr::table::SdrTableObj(rSdrModel); break; default: break; } } diff --git a/svx/source/svdraw/svdocapt.cxx b/svx/source/svdraw/svdocapt.cxx index 85d4a721a066..e94e2833570b 100644 --- a/svx/source/svdraw/svdocapt.cxx +++ b/svx/source/svdraw/svdocapt.cxx @@ -181,7 +181,7 @@ std::unique_ptr<sdr::contact::ViewContact> SdrCaptionObj::CreateObjectSpecificVi SdrCaptionObj::SdrCaptionObj(SdrModel& rSdrModel) -: SdrRectObj(rSdrModel, OBJ_TEXT), +: SdrRectObj(rSdrModel, SdrObjKind::Text), aTailPoly(3), // default size: 3 points = 2 lines mbSpecialTextBoxShadow(false), mbFixedTail(false), @@ -203,7 +203,7 @@ SdrCaptionObj::SdrCaptionObj( SdrModel& rSdrModel, const tools::Rectangle& rRect, const Point& rTail) -: SdrRectObj(rSdrModel, OBJ_TEXT,rRect), +: SdrRectObj(rSdrModel, SdrObjKind::Text,rRect), aTailPoly(3), // default size: 3 points = 2 lines mbSpecialTextBoxShadow(false), mbFixedTail(false), @@ -235,7 +235,7 @@ void SdrCaptionObj::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const SdrObjKind SdrCaptionObj::GetObjIdentifier() const { - return OBJ_CAPTION; + return SdrObjKind::Caption; } SdrCaptionObj* SdrCaptionObj::CloneSdrObject(SdrModel& rTargetModel) const diff --git a/svx/source/svdraw/svdocirc.cxx b/svx/source/svdraw/svdocirc.cxx index 6f320d6d4ae7..0204b2c2effe 100644 --- a/svx/source/svdraw/svdocirc.cxx +++ b/svx/source/svdraw/svdocirc.cxx @@ -105,10 +105,10 @@ SdrCircKind ToSdrCircKind(SdrObjKind eKind) { switch (eKind) { - case OBJ_CIRC: return SdrCircKind::Full; - case OBJ_SECT: return SdrCircKind::Section; - case OBJ_CARC: return SdrCircKind::Arc; - case OBJ_CCUT: return SdrCircKind::Cut; + case SdrObjKind::CircleOrEllipse: return SdrCircKind::Full; + case SdrObjKind::CircleSection: return SdrCircKind::Section; + case SdrObjKind::CircleArc: return SdrCircKind::Arc; + case SdrObjKind::CircleCut: return SdrCircKind::Cut; default: assert(false); } return SdrCircKind::Full; @@ -179,13 +179,13 @@ SdrObjKind SdrCircObj::GetObjIdentifier() const { switch (meCircleKind) { - case SdrCircKind::Full: return OBJ_CIRC; - case SdrCircKind::Section: return OBJ_SECT; - case SdrCircKind::Cut: return OBJ_CCUT; - case SdrCircKind::Arc: return OBJ_CARC; + case SdrCircKind::Full: return SdrObjKind::CircleOrEllipse; + case SdrCircKind::Section: return SdrObjKind::CircleSection; + case SdrCircKind::Cut: return SdrObjKind::CircleCut; + case SdrCircKind::Arc: return SdrObjKind::CircleArc; default: assert(false); } - return OBJ_CIRC; + return SdrObjKind::CircleOrEllipse; } bool SdrCircObj::PaintNeedsXPolyCirc() const diff --git a/svx/source/svdraw/svdoedge.cxx b/svx/source/svdraw/svdoedge.cxx index 549d75af74e1..a76cc1831603 100644 --- a/svx/source/svdraw/svdoedge.cxx +++ b/svx/source/svdraw/svdoedge.cxx @@ -392,7 +392,7 @@ void SdrEdgeObj::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const SdrObjKind SdrEdgeObj::GetObjIdentifier() const { - return OBJ_EDGE; + return SdrObjKind::Edge; } const tools::Rectangle& SdrEdgeObj::GetCurrentBoundRect() const diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx index 2b95bb7207f3..c369c5fcc832 100644 --- a/svx/source/svdraw/svdograf.cxx +++ b/svx/source/svdraw/svdograf.cxx @@ -592,7 +592,7 @@ void SdrGrafObj::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const SdrObjKind SdrGrafObj::GetObjIdentifier() const { - return OBJ_GRAF; + return SdrObjKind::Graphic; } void SdrGrafObj::ImpSetLinkedGraphic( const Graphic& rGraphic ) diff --git a/svx/source/svdraw/svdogrp.cxx b/svx/source/svdraw/svdogrp.cxx index 409b7bac8d5e..f9eb754bb7c2 100644 --- a/svx/source/svdraw/svdogrp.cxx +++ b/svx/source/svdraw/svdogrp.cxx @@ -151,7 +151,7 @@ void SdrObjGroup::SetBoundRectDirty() SdrObjKind SdrObjGroup::GetObjIdentifier() const { - return OBJ_GRUP; + return SdrObjKind::Group; } SdrLayerID SdrObjGroup::GetLayer() const diff --git a/svx/source/svdraw/svdomeas.cxx b/svx/source/svdraw/svdomeas.cxx index 09601cae6f17..9d6e0627b546 100644 --- a/svx/source/svdraw/svdomeas.cxx +++ b/svx/source/svdraw/svdomeas.cxx @@ -257,7 +257,7 @@ void SdrMeasureObj::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const SdrObjKind SdrMeasureObj::GetObjIdentifier() const { - return OBJ_MEASURE; + return SdrObjKind::Measure; } struct ImpMeasureRec : public SdrDragStatUserData @@ -1151,7 +1151,7 @@ SdrObjectUniquePtr SdrMeasureObj::DoConvertToPolyObj(bool bBezier, bool bAddText pPath = new SdrPathObj( getSdrModelFromSdrObject(), - OBJ_PATHLINE, + SdrObjKind::PathLine, aPolyPoly); pPath->SetMergedItemSet(aSet); @@ -1172,7 +1172,7 @@ SdrObjectUniquePtr SdrMeasureObj::DoConvertToPolyObj(bool bBezier, bool bAddText aPolyPoly.append(aTmpPolyPolygon[0].getB2DPolygon()); pPath = new SdrPathObj( getSdrModelFromSdrObject(), - OBJ_PATHLINE, + SdrObjKind::PathLine, aPolyPoly); pPath->SetMergedItemSet(aSet); @@ -1187,7 +1187,7 @@ SdrObjectUniquePtr SdrMeasureObj::DoConvertToPolyObj(bool bBezier, bool bAddText aPolyPoly.append(aTmpPolyPolygon[1].getB2DPolygon()); pPath = new SdrPathObj( getSdrModelFromSdrObject(), - OBJ_PATHLINE, + SdrObjKind::PathLine, aPolyPoly); pPath->SetMergedItemSet(aSet); @@ -1209,7 +1209,7 @@ SdrObjectUniquePtr SdrMeasureObj::DoConvertToPolyObj(bool bBezier, bool bAddText aPolyPoly.append(aTmpPolyPolygon[0].getB2DPolygon()); pPath = new SdrPathObj( getSdrModelFromSdrObject(), - OBJ_PATHLINE, + SdrObjKind::PathLine, aPolyPoly); pPath->SetMergedItemSet(aSet); @@ -1224,7 +1224,7 @@ SdrObjectUniquePtr SdrMeasureObj::DoConvertToPolyObj(bool bBezier, bool bAddText aPolyPoly.append(aTmpPolyPolygon[1].getB2DPolygon()); pPath = new SdrPathObj( getSdrModelFromSdrObject(), - OBJ_PATHLINE, + SdrObjKind::PathLine, aPolyPoly); pPath->SetMergedItemSet(aSet); @@ -1242,7 +1242,7 @@ SdrObjectUniquePtr SdrMeasureObj::DoConvertToPolyObj(bool bBezier, bool bAddText aPolyPoly.append(aTmpPolyPolygon[nLoopStart].getB2DPolygon()); pPath = new SdrPathObj( getSdrModelFromSdrObject(), - OBJ_PATHLINE, + SdrObjKind::PathLine, aPolyPoly); pPath->SetMergedItemSet(aSet); diff --git a/svx/source/svdraw/svdomedia.cxx b/svx/source/svdraw/svdomedia.cxx index 3df53dbf3523..b40a0644aa15 100644 --- a/svx/source/svdraw/svdomedia.cxx +++ b/svx/source/svdraw/svdomedia.cxx @@ -117,7 +117,7 @@ void SdrMediaObj::TakeObjInfo( SdrObjTransformInfoRec& rInfo ) const SdrObjKind SdrMediaObj::GetObjIdentifier() const { - return OBJ_MEDIA; + return SdrObjKind::Media; } OUString SdrMediaObj::TakeObjNameSingul() const diff --git a/svx/source/svdraw/svdoole2.cxx b/svx/source/svdraw/svdoole2.cxx index bc7df6b37513..5f59761009fb 100644 --- a/svx/source/svdraw/svdoole2.cxx +++ b/svx/source/svdraw/svdoole2.cxx @@ -1386,7 +1386,7 @@ void SdrOle2Obj::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const SdrObjKind SdrOle2Obj::GetObjIdentifier() const { - return mpImpl->mbFrame ? OBJ_FRAME : OBJ_OLE2; + return mpImpl->mbFrame ? SdrObjKind::OLEPluginFrame : SdrObjKind::OLE2; } OUString SdrOle2Obj::TakeObjNameSingul() const diff --git a/svx/source/svdraw/svdopage.cxx b/svx/source/svdraw/svdopage.cxx index d0eb579cc6dd..a74b02192e81 100644 --- a/svx/source/svdraw/svdopage.cxx +++ b/svx/source/svdraw/svdopage.cxx @@ -132,7 +132,7 @@ void SdrPageObj::SetBoundRectDirty() SdrObjKind SdrPageObj::GetObjIdentifier() const { - return OBJ_PAGE; + return SdrObjKind::Page; } void SdrPageObj::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const diff --git a/svx/source/svdraw/svdopath.cxx b/svx/source/svdraw/svdopath.cxx index 553c299b9831..ccb0bf601335 100644 --- a/svx/source/svdraw/svdopath.cxx +++ b/svx/source/svdraw/svdopath.cxx @@ -258,7 +258,7 @@ struct ImpPathCreateUser : public SdrDragStatUserData public: ImpPathCreateUser(): nCircRadius(0),nCircStAngle(0),nCircRelAngle(0), bBezier(false),bBezHasCtrl0(false),bCircle(false),bAngleSnap(false),bLine(false),bLine90(false),bRect(false), - bMixedCreate(false),nBezierStartPoint(0),eStartKind(OBJ_NONE),eCurrentKind(OBJ_NONE) { } + bMixedCreate(false),nBezierStartPoint(0),eStartKind(SdrObjKind::NONE),eCurrentKind(SdrObjKind::NONE) { } void ResetFormFlags() { bBezier=false; bCircle=false; bLine=false; bRect=false; } bool IsFormFlag() const { return bBezier || bCircle || bLine || bRect; } @@ -522,9 +522,9 @@ public: PointerStyle GetCreatePointer() const; // helping stuff - static bool IsClosed(SdrObjKind eKind) { return eKind==OBJ_POLY || eKind==OBJ_PATHPOLY || eKind==OBJ_PATHFILL || eKind==OBJ_FREEFILL || eKind==OBJ_SPLNFILL; } - static bool IsFreeHand(SdrObjKind eKind) { return eKind==OBJ_FREELINE || eKind==OBJ_FREEFILL; } - static bool IsBezier(SdrObjKind eKind) { return eKind==OBJ_PATHLINE || eKind==OBJ_PATHFILL; } + static bool IsClosed(SdrObjKind eKind) { return eKind==SdrObjKind::Polygon || eKind==SdrObjKind::PathPoly || eKind==SdrObjKind::PathFill || eKind==SdrObjKind::FreehandFill || eKind==SdrObjKind::SplineFill; } + static bool IsFreeHand(SdrObjKind eKind) { return eKind==SdrObjKind::FreehandLine || eKind==SdrObjKind::FreehandFill; } + static bool IsBezier(SdrObjKind eKind) { return eKind==SdrObjKind::PathLine || eKind==SdrObjKind::PathFill; } bool IsCreating() const { return mbCreating; } // get the polygon @@ -823,7 +823,7 @@ bool ImpPathForDragAndCreate::endPathDrag(SdrDragStat const & rDrag) { Point aLinePt1; Point aLinePt2; - bool bLineGlueMirror(OBJ_LINE == meObjectKind); + bool bLineGlueMirror(SdrObjKind::Line == meObjectKind); if (bLineGlueMirror) { XPolygon& rXP=aPathPolygon[0]; aLinePt1=rXP[0]; @@ -1229,7 +1229,7 @@ void ImpPathForDragAndCreate::BegCreate(SdrDragStat& rStat) bool bMakeStartPoint = true; SdrView* pView=rStat.GetView(); if (pView!=nullptr && pView->IsUseIncompatiblePathCreateInterface() && - (meObjectKind==OBJ_POLY || meObjectKind==OBJ_PLIN || meObjectKind==OBJ_PATHLINE || meObjectKind==OBJ_PATHFILL)) { + (meObjectKind==SdrObjKind::Polygon || meObjectKind==SdrObjKind::PolyLine || meObjectKind==SdrObjKind::PathLine || meObjectKind==SdrObjKind::PathFill)) { bMakeStartPoint = false; } aPathPolygon.Insert(XPolygon()); @@ -1256,22 +1256,22 @@ bool ImpPathForDragAndCreate::MovCreate(SdrDragStat& rStat) if (nInvent==SdrInventor::Default && pU->eCurrentKind != nIdent) { SdrObjKind eNewKind = nIdent; switch (eNewKind) { - case OBJ_CARC: - case OBJ_CIRC: - case OBJ_CCUT: - case OBJ_SECT: - eNewKind=OBJ_CARC; + case SdrObjKind::CircleArc: + case SdrObjKind::CircleOrEllipse: + case SdrObjKind::CircleCut: + case SdrObjKind::CircleSection: + eNewKind=SdrObjKind::CircleArc; [[fallthrough]]; - case OBJ_RECT: - case OBJ_LINE: - case OBJ_PLIN: - case OBJ_POLY: - case OBJ_PATHLINE: - case OBJ_PATHFILL: - case OBJ_FREELINE: - case OBJ_FREEFILL: - case OBJ_SPLNLINE: - case OBJ_SPLNFILL: { + case SdrObjKind::Rectangle: + case SdrObjKind::Line: + case SdrObjKind::PolyLine: + case SdrObjKind::Polygon: + case SdrObjKind::PathLine: + case SdrObjKind::PathFill: + case SdrObjKind::FreehandLine: + case SdrObjKind::FreehandFill: + case SdrObjKind::SplineLine: + case SdrObjKind::SplineFill: { pU->eCurrentKind=eNewKind; pU->bMixedCreate=true; pU->nBezierStartPoint=rXPoly.GetPointCount(); @@ -1292,9 +1292,9 @@ bool ImpPathForDragAndCreate::MovCreate(SdrDragStat& rStat) } else nCurrentPoint--; bool bFreeHand=IsFreeHand(pU->eCurrentKind); rStat.SetNoSnap(bFreeHand); - rStat.SetOrtho8Possible(pU->eCurrentKind!=OBJ_CARC && pU->eCurrentKind!=OBJ_RECT && (!pU->bMixedCreate || pU->eCurrentKind!=OBJ_LINE)); + rStat.SetOrtho8Possible(pU->eCurrentKind!=SdrObjKind::CircleArc && pU->eCurrentKind!=SdrObjKind::Rectangle && (!pU->bMixedCreate || pU->eCurrentKind!=SdrObjKind::Line)); rXPoly[nCurrentPoint]=rStat.GetNow(); - if (!pU->bMixedCreate && pU->eStartKind==OBJ_LINE && rXPoly.GetPointCount()>=1) { + if (!pU->bMixedCreate && pU->eStartKind==SdrObjKind::Line && rXPoly.GetPointCount()>=1) { Point aPt(rStat.GetStart()); if (pView!=nullptr && pView->IsCreate1stPointAsCenter()) { aPt+=aPt; @@ -1346,13 +1346,13 @@ bool ImpPathForDragAndCreate::MovCreate(SdrDragStat& rStat) pU->CalcBezier(rXPoly[nCurrentPoint-1],rXPoly[nCurrentPoint],pU->aBezControl0-rXPoly[nCurrentPoint-1],rStat.IsMouseDown()); } } - if (pU->eCurrentKind==OBJ_CARC && nCurrentPoint>=2) { + if (pU->eCurrentKind==SdrObjKind::CircleArc && nCurrentPoint>=2) { pU->CalcCircle(rXPoly[nCurrentPoint-1],rXPoly[nCurrentPoint],rXPoly[nCurrentPoint-1]-rXPoly[nCurrentPoint-2],pView); } - if (pU->eCurrentKind==OBJ_LINE && nCurrentPoint>=2) { + if (pU->eCurrentKind==SdrObjKind::Line && nCurrentPoint>=2) { pU->CalcLine(rXPoly[nCurrentPoint-1],rXPoly[nCurrentPoint],rXPoly[nCurrentPoint-1]-rXPoly[nCurrentPoint-2],pView); } - if (pU->eCurrentKind==OBJ_RECT && nCurrentPoint>=2) { + if (pU->eCurrentKind==SdrObjKind::Rectangle && nCurrentPoint>=2) { pU->CalcRect(rXPoly[nCurrentPoint-1],rXPoly[nCurrentPoint],rXPoly[nCurrentPoint-1]-rXPoly[nCurrentPoint-2],pView); } @@ -1368,7 +1368,7 @@ bool ImpPathForDragAndCreate::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd) XPolygon& rXPoly=aPathPolygon[aPathPolygon.Count()-1]; sal_uInt16 nCurrentPoint=rXPoly.GetPointCount()-1; rXPoly[nCurrentPoint]=rStat.GetNow(); - if (!pU->bMixedCreate && pU->eStartKind==OBJ_LINE) { + if (!pU->bMixedCreate && pU->eStartKind==SdrObjKind::Line) { if (rStat.GetPointCount()>=2) eCmd=SdrCreateCmd::ForceEnd; bRet = eCmd==SdrCreateCmd::ForceEnd; if (bRet) { @@ -1585,24 +1585,24 @@ basegfx::B2DPolyPolygon ImpPathForDragAndCreate::TakeDragPolyPolygon(const SdrDr PointerStyle ImpPathForDragAndCreate::GetCreatePointer() const { switch (meObjectKind) { - case OBJ_LINE : return PointerStyle::DrawLine; - case OBJ_POLY : return PointerStyle::DrawPolygon; - case OBJ_PLIN : return PointerStyle::DrawPolygon; - case OBJ_PATHLINE: return PointerStyle::DrawBezier; - case OBJ_PATHFILL: return PointerStyle::DrawBezier; - case OBJ_FREELINE: return PointerStyle::DrawFreehand; - case OBJ_FREEFILL: return PointerStyle::DrawFreehand; - case OBJ_SPLNLINE: return PointerStyle::DrawFreehand; - case OBJ_SPLNFILL: return PointerStyle::DrawFreehand; - case OBJ_PATHPOLY: return PointerStyle::DrawPolygon; - case OBJ_PATHPLIN: return PointerStyle::DrawPolygon; + case SdrObjKind::Line : return PointerStyle::DrawLine; + case SdrObjKind::Polygon : return PointerStyle::DrawPolygon; + case SdrObjKind::PolyLine : return PointerStyle::DrawPolygon; + case SdrObjKind::PathLine: return PointerStyle::DrawBezier; + case SdrObjKind::PathFill: return PointerStyle::DrawBezier; + case SdrObjKind::FreehandLine: return PointerStyle::DrawFreehand; + case SdrObjKind::FreehandFill: return PointerStyle::DrawFreehand; + case SdrObjKind::SplineLine: return PointerStyle::DrawFreehand; + case SdrObjKind::SplineFill: return PointerStyle::DrawFreehand; + case SdrObjKind::PathPoly: return PointerStyle::DrawPolygon; + case SdrObjKind::PathPolyLine: return PointerStyle::DrawPolygon; default: break; } // switch return PointerStyle::Cross; } SdrPathObjGeoData::SdrPathObjGeoData() - : meKind(OBJ_NONE) + : meKind(SdrObjKind::NONE) { } @@ -1668,7 +1668,7 @@ static tools::Rectangle lcl_ImpGetBoundRect(const basegfx::B2DPolyPolygon& rPoly void SdrPathObj::ImpForceLineAngle() { - if(OBJ_LINE != meKind || !lcl_ImpIsLine(GetPathPoly())) + if(SdrObjKind::Line != meKind || !lcl_ImpIsLine(GetPathPoly())) return; const basegfx::B2DPolygon aPoly(GetPathPoly().getB2DPolygon(0)); @@ -1690,16 +1690,16 @@ void SdrPathObj::ImpForceLineAngle() void SdrPathObj::ImpForceKind() { - if (meKind==OBJ_PATHPLIN) meKind=OBJ_PLIN; - if (meKind==OBJ_PATHPOLY) meKind=OBJ_POLY; + if (meKind==SdrObjKind::PathPolyLine) meKind=SdrObjKind::PolyLine; + if (meKind==SdrObjKind::PathPoly) meKind=SdrObjKind::Polygon; if(GetPathPoly().areControlPointsUsed()) { switch (meKind) { - case OBJ_LINE: meKind=OBJ_PATHLINE; break; - case OBJ_PLIN: meKind=OBJ_PATHLINE; break; - case OBJ_POLY: meKind=OBJ_PATHFILL; break; + case SdrObjKind::Line: meKind=SdrObjKind::PathLine; break; + case SdrObjKind::PolyLine: meKind=SdrObjKind::PathLine; break; + case SdrObjKind::Polygon: meKind=SdrObjKind::PathFill; break; default: break; } } @@ -1707,20 +1707,20 @@ void SdrPathObj::ImpForceKind() { switch (meKind) { - case OBJ_PATHLINE: meKind=OBJ_PLIN; break; - case OBJ_FREELINE: meKind=OBJ_PLIN; break; - case OBJ_PATHFILL: meKind=OBJ_POLY; break; - case OBJ_FREEFILL: meKind=OBJ_POLY; break; + case SdrObjKind::PathLine: meKind=SdrObjKind::PolyLine; break; + case SdrObjKind::FreehandLine: meKind=SdrObjKind::PolyLine; break; + case SdrObjKind::PathFill: meKind=SdrObjKind::Polygon; break; + case SdrObjKind::FreehandFill: meKind=SdrObjKind::Polygon; break; default: break; } } - if (meKind==OBJ_LINE && !lcl_ImpIsLine(GetPathPoly())) meKind=OBJ_PLIN; - if (meKind==OBJ_PLIN && lcl_ImpIsLine(GetPathPoly())) meKind=OBJ_LINE; + if (meKind==SdrObjKind::Line && !lcl_ImpIsLine(GetPathPoly())) meKind=SdrObjKind::PolyLine; + if (meKind==SdrObjKind::PolyLine && lcl_ImpIsLine(GetPathPoly())) meKind=SdrObjKind::Line; m_bClosedObj=IsClosed(); - if (meKind==OBJ_LINE) + if (meKind==SdrObjKind::Line) { ImpForceLineAngle(); } @@ -1780,11 +1780,11 @@ void SdrPathObj::ImpSetClosed(bool bClose) { switch (meKind) { - case OBJ_LINE : meKind=OBJ_POLY; break; - case OBJ_PLIN : meKind=OBJ_POLY; break; - case OBJ_PATHLINE: meKind=OBJ_PATHFILL; break; - case OBJ_FREELINE: meKind=OBJ_FREEFILL; break; - case OBJ_SPLNLINE: meKind=OBJ_SPLNFILL; break; + case SdrObjKind::Line : meKind=SdrObjKind::Polygon; break; + case SdrObjKind::PolyLine : meKind=SdrObjKind::Polygon; break; + case SdrObjKind::PathLine: meKind=SdrObjKind::PathFill; break; + case SdrObjKind::FreehandLine: meKind=SdrObjKind::FreehandFill; break; + case SdrObjKind::SplineLine: meKind=SdrObjKind::SplineFill; break; default: break; } @@ -1794,10 +1794,10 @@ void SdrPathObj::ImpSetClosed(bool bClose) { switch (meKind) { - case OBJ_POLY : meKind=OBJ_PLIN; break; - case OBJ_PATHFILL: meKind=OBJ_PATHLINE; break; - case OBJ_FREEFILL: meKind=OBJ_FREELINE; break; - case OBJ_SPLNFILL: meKind=OBJ_SPLNLINE; break; + case SdrObjKind::Polygon : meKind=SdrObjKind::PolyLine; break; + case SdrObjKind::PathFill: meKind=SdrObjKind::PathLine; break; + case SdrObjKind::FreehandFill: meKind=SdrObjKind::FreehandLine; break; + case SdrObjKind::SplineFill: meKind=SdrObjKind::SplineLine; break; default: break; } @@ -1834,7 +1834,7 @@ OUString SdrPathObj::TakeObjNameSingul() const { OUString sName; - if(OBJ_LINE == meKind) + if(SdrObjKind::Line == meKind) { TranslateId pId(STR_ObjNameSingulLINE); @@ -1869,9 +1869,9 @@ OUString SdrPathObj::TakeObjNameSingul() const sName = SvxResId(pId); } - else if(OBJ_PLIN == meKind || OBJ_POLY == meKind) + else if(SdrObjKind::PolyLine == meKind || SdrObjKind::Polygon == meKind) { - const bool bClosed(OBJ_POLY == meKind); + const bool bClosed(SdrObjKind::Polygon == meKind); TranslateId pId; if(mpDAC && mpDAC->IsCreating()) @@ -1914,12 +1914,12 @@ OUString SdrPathObj::TakeObjNameSingul() const { switch (meKind) { - case OBJ_PATHLINE: sName = SvxResId(STR_ObjNameSingulPATHLINE); break; - case OBJ_FREELINE: sName = SvxResId(STR_ObjNameSingulFREELINE); break; - case OBJ_SPLNLINE: sName = SvxResId(STR_ObjNameSingulNATSPLN); break; - case OBJ_PATHFILL: sName = SvxResId(STR_ObjNameSingulPATHFILL); break; - case OBJ_FREEFILL: sName = SvxResId(STR_ObjNameSingulFREEFILL); break; - case OBJ_SPLNFILL: sName = SvxResId(STR_ObjNameSingulPERSPLN); break; + case SdrObjKind::PathLine: sName = SvxResId(STR_ObjNameSingulPATHLINE); break; + case SdrObjKind::FreehandLine: sName = SvxResId(STR_ObjNameSingulFREELINE); break; + case SdrObjKind::SplineLine: sName = SvxResId(STR_ObjNameSingulNATSPLN); break; + case SdrObjKind::PathFill: sName = SvxResId(STR_ObjNameSingulPATHFILL); break; + case SdrObjKind::FreehandFill: sName = SvxResId(STR_ObjNameSingulFREEFILL); break; + case SdrObjKind::SplineFill: sName = SvxResId(STR_ObjNameSingulPERSPLN); break; default: break; } } @@ -1936,15 +1936,15 @@ OUString SdrPathObj::TakeObjNamePlural() const OUString sName; switch(meKind) { - case OBJ_LINE : sName=SvxResId(STR_ObjNamePluralLINE ); break; - case OBJ_PLIN : sName=SvxResId(STR_ObjNamePluralPLIN ); break; - case OBJ_POLY : sName=SvxResId(STR_ObjNamePluralPOLY ); break; - case OBJ_PATHLINE: sName=SvxResId(STR_ObjNamePluralPATHLINE); break; - case OBJ_FREELINE: sName=SvxResId(STR_ObjNamePluralFREELINE); break; - case OBJ_SPLNLINE: sName=SvxResId(STR_ObjNamePluralNATSPLN); break; - case OBJ_PATHFILL: sName=SvxResId(STR_ObjNamePluralPATHFILL); break; - case OBJ_FREEFILL: sName=SvxResId(STR_ObjNamePluralFREEFILL); break; - case OBJ_SPLNFILL: sName=SvxResId(STR_ObjNamePluralPERSPLN); break; + case SdrObjKind::Line : sName=SvxResId(STR_ObjNamePluralLINE ); break; + case SdrObjKind::PolyLine : sName=SvxResId(STR_ObjNamePluralPLIN ); break; + case SdrObjKind::Polygon : sName=SvxResId(STR_ObjNamePluralPOLY ); break; + case SdrObjKind::PathLine: sName=SvxResId(STR_ObjNamePluralPATHLINE); break; + case SdrObjKind::FreehandLine: sName=SvxResId(STR_ObjNamePluralFREELINE); break; + case SdrObjKind::SplineLine: sName=SvxResId(STR_ObjNamePluralNATSPLN); break; + case SdrObjKind::PathFill: sName=SvxResId(STR_ObjNamePluralPATHFILL); break; + case SdrObjKind::FreehandFill: sName=SvxResId(STR_ObjNamePluralFREEFILL); break; + case SdrObjKind::SplineFill: sName=SvxResId(STR_ObjNamePluralPERSPLN); break; default: break; } return sName; @@ -2469,7 +2469,7 @@ void SdrPathObj::NbcSetPoint(const Point& rPnt, sal_uInt32 nHdlNum) aNewPolygon.setB2DPoint(nPnt, basegfx::B2DPoint(rPnt.X(), rPnt.Y())); maPathPolygon.setB2DPolygon(nPoly, aNewPolygon); - if(meKind==OBJ_LINE) + if(meKind==SdrObjKind::Line) { ImpForceLineAngle(); } @@ -2800,7 +2800,7 @@ bool SdrPathObj::TRGetBaseGeometry(basegfx::B2DHomMatrix& rMatrix, basegfx::B2DP basegfx::B2DHomMatrix aMoveToZeroMatrix; rPolyPolygon = GetPathPoly(); - if(OBJ_LINE == meKind) + if(SdrObjKind::Line == meKind) { // ignore shear and rotate, just use scale and translate OSL_ENSURE(GetPathPoly().count() > 0 && GetPathPoly().getB2DPolygon(0).count() > 1, "OBJ_LINE with too few polygons (!)"); diff --git a/svx/source/svdraw/svdorect.cxx b/svx/source/svdraw/svdorect.cxx index bd3c53bac1ad..b3b1ad7335a1 100644 --- a/svx/source/svdraw/svdorect.cxx +++ b/svx/source/svdraw/svdorect.cxx @@ -77,8 +77,8 @@ SdrRectObj::SdrRectObj( SdrObjKind eNewTextKind) : SdrTextObj(rSdrModel, eNewTextKind) { - DBG_ASSERT(meTextKind == OBJ_TEXT || - meTextKind == OBJ_OUTLINETEXT || meTextKind == OBJ_TITLETEXT, + DBG_ASSERT(meTextKind == SdrObjKind::Text || + meTextKind == SdrObjKind::OutlineText || meTextKind == SdrObjKind::TitleText, "SdrRectObj::SdrRectObj(SdrObjKind) can only be applied to text frames."); m_bClosedObj=true; } @@ -89,8 +89,8 @@ SdrRectObj::SdrRectObj( const tools::Rectangle& rRect) : SdrTextObj(rSdrModel, eNewTextKind, rRect) { - DBG_ASSERT(meTextKind == OBJ_TEXT || - meTextKind == OBJ_OUTLINETEXT || meTextKind == OBJ_TITLETEXT, + DBG_ASSERT(meTextKind == SdrObjKind::Text || + meTextKind == SdrObjKind::OutlineText || meTextKind == SdrObjKind::TitleText, "SdrRectObj::SdrRectObj(SdrObjKind,...) can only be applied to text frames."); m_bClosedObj=true; } @@ -173,7 +173,7 @@ SdrObjKind SdrRectObj::GetObjIdentifier() const { if (IsTextFrame()) return meTextKind; - else return OBJ_RECT; + else return SdrObjKind::Rectangle; } void SdrRectObj::TakeUnrotatedSnapRect(tools::Rectangle& rRect) const diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index 9788bfdeae7a..fe5e13446955 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -71,7 +71,7 @@ std::unique_ptr<sdr::contact::ViewContact> SdrTextObj::CreateObjectSpecificViewC SdrTextObj::SdrTextObj(SdrModel& rSdrModel) : SdrAttrObj(rSdrModel), mpEditingOutliner(nullptr), - meTextKind(OBJ_TEXT) + meTextKind(SdrObjKind::Text) { mbTextSizeDirty = false; mbTextFrame = false; @@ -142,7 +142,7 @@ SdrTextObj::SdrTextObj( : SdrAttrObj(rSdrModel), maRect(rNewRect), mpEditingOutliner(nullptr), - meTextKind(OBJ_TEXT) + meTextKind(SdrObjKind::Text) { mbTextSizeDirty = false; mbTextFrame = false; @@ -997,13 +997,13 @@ OUString SdrTextObj::TakeObjNameSingul() const switch(meTextKind) { - case OBJ_OUTLINETEXT: + case SdrObjKind::OutlineText: { aStr = SvxResId(STR_ObjNameSingulOUTLINETEXT); break; } - case OBJ_TITLETEXT : + case SdrObjKind::TitleText : { aStr = SvxResId(STR_ObjNameSingulTITLETEXT); break; @@ -1020,7 +1020,7 @@ OUString SdrTextObj::TakeObjNameSingul() const } OutlinerParaObject* pOutlinerParaObject = GetOutlinerParaObject(); - if(pOutlinerParaObject && meTextKind != OBJ_OUTLINETEXT) + if(pOutlinerParaObject && meTextKind != SdrObjKind::OutlineText) { // shouldn't currently cause any problems at OUTLINETEXT OUString aStr2(comphelper::string::stripStart(pOutlinerParaObject->GetTextObject().GetText(0), ' ')); @@ -1055,8 +1055,8 @@ OUString SdrTextObj::TakeObjNamePlural() const OUString sName; switch (meTextKind) { - case OBJ_OUTLINETEXT: sName=SvxResId(STR_ObjNamePluralOUTLINETEXT); break; - case OBJ_TITLETEXT : sName=SvxResId(STR_ObjNamePluralTITLETEXT); break; + case SdrObjKind::OutlineText: sName=SvxResId(STR_ObjNamePluralOUTLINETEXT); break; + case SdrObjKind::TitleText : sName=SvxResId(STR_ObjNamePluralTITLETEXT); break; default: { if (IsLinkedText()) { sName=SvxResId(STR_ObjNamePluralTEXTLNK); @@ -1452,7 +1452,7 @@ void SdrTextObj::ForceOutlinerParaObject() if( pText && (pText->GetOutlinerParaObject() == nullptr) ) { OutlinerMode nOutlMode = OutlinerMode::TextObject; - if( IsTextFrame() && meTextKind == OBJ_OUTLINETEXT ) + if( IsTextFrame() && meTextKind == SdrObjKind::OutlineText ) nOutlMode = OutlinerMode::OutlineObject; pText->ForceOutlinerParaObject( nOutlMode ); diff --git a/svx/source/svdraw/svdotxtr.cxx b/svx/source/svdraw/svdotxtr.cxx index 48a79ffde6a4..7da067468abf 100644 --- a/svx/source/svdraw/svdotxtr.cxx +++ b/svx/source/svdraw/svdotxtr.cxx @@ -351,7 +351,7 @@ SdrObjectUniquePtr SdrTextObj::ImpConvertContainedTextToSdrPathObjs(bool bToPoly // create filled SdrPathObj pPathObj = new SdrPathObj( getSdrModelFromSdrObject(), - OBJ_PATHFILL, + SdrObjKind::PathFill, aPolyPolygon); } else @@ -365,7 +365,7 @@ SdrObjectUniquePtr SdrTextObj::ImpConvertContainedTextToSdrPathObjs(bool bToPoly // create line SdrPathObj pPathObj = new SdrPathObj( getSdrModelFromSdrObject(), - OBJ_PATHLINE, + SdrObjKind::PathLine, aPolyPolygon); } @@ -422,14 +422,14 @@ bool SdrTextObj::ImpCanConvTextToCurve() const SdrPathObjUniquePtr SdrTextObj::ImpConvertMakeObj(const basegfx::B2DPolyPolygon& rPolyPolygon, bool bClosed, bool bBezier) const { - SdrObjKind ePathKind = bClosed ? OBJ_PATHFILL : OBJ_PATHLINE; + SdrObjKind ePathKind = bClosed ? SdrObjKind::PathFill : SdrObjKind::PathLine; basegfx::B2DPolyPolygon aB2DPolyPolygon(rPolyPolygon); // #i37011# if(!bBezier) { aB2DPolyPolygon = basegfx::utils::adaptiveSubdivideByAngle(aB2DPolyPolygon); - ePathKind = bClosed ? OBJ_POLY : OBJ_PLIN; + ePathKind = bClosed ? SdrObjKind::Polygon : SdrObjKind::PolyLine; } SdrPathObjUniquePtr pPathObj(new SdrPathObj( diff --git a/svx/source/svdraw/svdouno.cxx b/svx/source/svdraw/svdouno.cxx index 01414bfe2962..eeb302fae0e9 100644 --- a/svx/source/svdraw/svdouno.cxx +++ b/svx/source/svdraw/svdouno.cxx @@ -249,7 +249,7 @@ void SdrUnoObj::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const SdrObjKind SdrUnoObj::GetObjIdentifier() const { - return OBJ_UNO; + return SdrObjKind::UNO; } void SdrUnoObj::SetContextWritingMode( const sal_Int16 _nContextWritingMode ) diff --git a/svx/source/svdraw/svdpage.cxx b/svx/source/svdraw/svdpage.cxx index d4322e3a8720..981381643430 100644 --- a/svx/source/svdraw/svdpage.cxx +++ b/svx/source/svdraw/svdpage.cxx @@ -784,7 +784,7 @@ void SdrObjList::ReformatAllEdgeObjects() while(aIter.IsMore()) { SdrObject* pObj = aIter.Next(); - if (pObj->GetObjIdentifier() != OBJ_EDGE) + if (pObj->GetObjIdentifier() != SdrObjKind::Edge) continue; SdrEdgeObj* pSdrEdgeObj = static_cast< SdrEdgeObj* >(pObj); diff --git a/svx/source/svdraw/svdpdf.cxx b/svx/source/svdraw/svdpdf.cxx index 4fcfb21fca7a..3ad208ba78b9 100644 --- a/svx/source/svdraw/svdpdf.cxx +++ b/svx/source/svdraw/svdpdf.cxx @@ -506,8 +506,9 @@ void ImpSdrPdfImport::InsertObj(SdrObject* pObj, bool bScale) if (!aNewRange.isEmpty()) { - pObj = new SdrPathObj(*mpModel, aNewPoly.isClosed() ? OBJ_POLY : OBJ_PLIN, - aNewPoly); + pObj = new SdrPathObj( + *mpModel, aNewPoly.isClosed() ? SdrObjKind::Polygon : SdrObjKind::PolyLine, + aNewPoly); pObj->SetLayer(aOldLayer); pObj->SetMergedItemSet(aOldItemSet); @@ -803,7 +804,7 @@ void ImpSdrPdfImport::InsertTextObject(const Point& rPos, const Size& rSize, con aPosition.AdjustY(-nTextHeight); tools::Rectangle aTextRect(aPosition, aSize); - SdrRectObj* pText = new SdrRectObj(*mpModel, OBJ_TEXT, aTextRect); + SdrRectObj* pText = new SdrRectObj(*mpModel, SdrObjKind::Text, aTextRect); pText->SetMergedItem(makeSdrTextUpperDistItem(0)); pText->SetMergedItem(makeSdrTextLowerDistItem(0)); @@ -1027,7 +1028,7 @@ void ImpSdrPdfImport::ImportPath(std::unique_ptr<vcl::pdf::PDFiumPageObject> con if (!mbLastObjWasPolyWithoutLine || !CheckLastPolyLineAndFillMerge(aPolyPoly)) { - SdrPathObj* pPath = new SdrPathObj(*mpModel, OBJ_POLY, aPolyPoly); + SdrPathObj* pPath = new SdrPathObj(*mpModel, SdrObjKind::Polygon, aPolyPoly); SetAttributes(pPath); InsertObj(pPath, false); } diff --git a/svx/source/svdraw/svdview.cxx b/svx/source/svdraw/svdview.cxx index 55731106abf8..52391d0a0b57 100644 --- a/svx/source/svdraw/svdview.cxx +++ b/svx/source/svdraw/svdview.cxx @@ -899,7 +899,7 @@ bool SdrView::DoMouseEvent(const SdrViewEvent& rVEvt) case SdrEventKind::BeginDragHelpline: bRet = BegDragHelpLine(rVEvt.mnHlplIdx,rVEvt.mpPV); break; case SdrEventKind::BeginDragObj: bRet=BegDragObj(aLogicPos, nullptr, rVEvt.mpHdl, mnMinMovLog); break; case SdrEventKind::BeginCreateObj: { - if (mnCurrentInvent==SdrInventor::Default && mnCurrentIdent==OBJ_CAPTION) { + if (mnCurrentInvent==SdrInventor::Default && mnCurrentIdent==SdrObjKind::Caption) { tools::Long nHgt=SdrEngineDefaults::GetFontHeight(); bRet=BegCreateCaptionObj(aLogicPos,Size(5*nHgt,2*nHgt)); } else bRet=BegCreateObj(aLogicPos); @@ -1360,7 +1360,7 @@ void SdrView::MarkAll() const SdrObject* pObj(rMarkList.GetMark(0)->GetMarkedSdrObj()); SdrView* pView = this; if (pObj && pView && (pObj->GetObjInventor() == SdrInventor::Default) - && (pObj->GetObjIdentifier() == OBJ_TABLE)) + && (pObj->GetObjIdentifier() == SdrObjKind::Table)) { mxSelectionController.clear(); mxSelectionController = sdr::table::CreateTableController( diff --git a/svx/source/svdraw/svdxcgv.cxx b/svx/source/svdraw/svdxcgv.cxx index c4725d899566..513eb39c7996 100644 --- a/svx/source/svdraw/svdxcgv.cxx +++ b/svx/source/svdraw/svdxcgv.cxx @@ -143,7 +143,7 @@ bool SdrExchangeView::Paste(const OUString& rStr, const Point& rPos, SdrObjList* } SdrRectObj* pObj = new SdrRectObj( getSdrModelFromSdrView(), - OBJ_TEXT, + SdrObjKind::Text, aTextRect); pObj->SetLayer(nLayer); @@ -183,7 +183,7 @@ bool SdrExchangeView::Paste(SvStream& rInput, EETextFormat eFormat, const Point& } SdrRectObj* pObj = new SdrRectObj( getSdrModelFromSdrView(), - OBJ_TEXT, + SdrObjKind::Text, aTextRect); pObj->SetLayer(nLayer); @@ -750,7 +750,7 @@ std::unique_ptr<SdrModel> SdrExchangeView::CreateMarkedObjModel() const if(nullptr == pNewObj) { // not cloned yet - if(pObj->GetObjIdentifier() == OBJ_OLE2 && nullptr == mpModel->GetPersist()) + if(pObj->GetObjIdentifier() == SdrObjKind::OLE2 && nullptr == mpModel->GetPersist()) { // tdf#125520 - former fix was wrong, the SdrModel // has to have a GetPersist() already, see task. diff --git a/svx/source/table/svdotable.cxx b/svx/source/table/svdotable.cxx index 28ad30df44b9..5e346f3c115c 100644 --- a/svx/source/table/svdotable.cxx +++ b/svx/source/table/svdotable.cxx @@ -1479,7 +1479,7 @@ void SdrTableObj::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const SdrObjKind SdrTableObj::GetObjIdentifier() const { - return OBJ_TABLE; + return SdrObjKind::Table; } void SdrTableObj::TakeTextRect( SdrOutliner& rOutliner, tools::Rectangle& rTextRect, bool bNoEditText, tools::Rectangle* pAnchorRect, bool /*bLineWidth*/ ) const diff --git a/svx/source/table/tablecontroller.cxx b/svx/source/table/tablecontroller.cxx index d11b22988148..8001979f5d08 100644 --- a/svx/source/table/tablecontroller.cxx +++ b/svx/source/table/tablecontroller.cxx @@ -2105,7 +2105,7 @@ void SvxTableController::StopTextEdit() if(mrView.IsTextEdit()) { mrView.SdrEndTextEdit(); - mrView.SetCurrentObj(OBJ_TABLE); + mrView.SetCurrentObj(SdrObjKind::Table); mrView.SetEditMode(SdrViewEditMode::Edit); } } @@ -3320,7 +3320,7 @@ bool SvxTableController::isColumnHeader() bool SvxTableController::setCursorLogicPosition(const Point& rPosition, bool bPoint) { - if (mxTableObj->GetObjIdentifier() != OBJ_TABLE) + if (mxTableObj->GetObjIdentifier() != SdrObjKind::Table) return false; SdrTableObj* pTableObj = mxTableObj.get(); diff --git a/svx/source/unodraw/unomod.cxx b/svx/source/unodraw/unomod.cxx index d69fac8acd7b..07f231ef181a 100644 --- a/svx/source/unodraw/unomod.cxx +++ b/svx/source/unodraw/unomod.cxx @@ -168,13 +168,12 @@ css::uno::Reference<css::uno::XInterface> create( { if( rServiceSpecifier.startsWith("com.sun.star.drawing.") ) { - sal_uInt32 nType = UHashMap::getId( rServiceSpecifier ); - if( nType != UHASHMAP_NOTFOUND ) + std::optional<SdrObjKind> nType = UHashMap::getId( rServiceSpecifier ); + if( nType ) { - sal_uInt16 nT = static_cast<sal_uInt16>(nType & ~E3D_INVENTOR_FLAG); - SdrInventor nI = (nType & E3D_INVENTOR_FLAG) ? SdrInventor::E3d : SdrInventor::Default; + SdrInventor nI = IsInventorE3D(*nType) ? SdrInventor::E3d : SdrInventor::Default; - return uno::Reference< uno::XInterface >( static_cast<drawing::XShape*>(SvxDrawPage::CreateShapeByTypeAndInventor( nT, nI, nullptr, nullptr, referer ).get()) ); + return uno::Reference< uno::XInterface >( static_cast<drawing::XShape*>(SvxDrawPage::CreateShapeByTypeAndInventor( *nType, nI, nullptr, nullptr, referer ).get()) ); } } else if (rServiceSpecifier == "com.sun.star.document.ImportGraphicStorageHandler") @@ -379,68 +378,68 @@ uno::Reference< uno::XInterface > SAL_CALL SvxUnoDrawingModel::createInstance( c { SvxShape* pShape = nullptr; - sal_uInt16 nType = OBJ_TEXT; + SdrObjKind nType = SdrObjKind::Text; OUString aTypeName = aServiceSpecifier.copy( aPackagePrefix.getLength() ); // create a shape wrapper if( aTypeName.startsWith("TitleTextShape") ) { - nType = OBJ_TEXT; + nType = SdrObjKind::Text; } else if( aTypeName.startsWith( "OutlinerShape" ) ) { - nType = OBJ_TEXT; + nType = SdrObjKind::Text; } else if( aTypeName.startsWith( "SubtitleShape" ) ) { - nType = OBJ_TEXT; + nType = SdrObjKind::Text; } else if( aTypeName.startsWith( "GraphicObjectShape" ) ) { - nType = OBJ_GRAF; + nType = SdrObjKind::Graphic; } else if( aTypeName.startsWith( "PageShape" ) ) { - nType = OBJ_PAGE; + nType = SdrObjKind::Page; } else if( aTypeName.startsWith( "OLE2Shape" ) ) { - nType = OBJ_OLE2; + nType = SdrObjKind::OLE2; } else if( aTypeName.startsWith( "ChartShape" ) ) { - nType = OBJ_OLE2; + nType = SdrObjKind::OLE2; } else if( aTypeName.startsWith( "OrgChartShape" ) ) { - nType = OBJ_OLE2; + nType = SdrObjKind::OLE2; } else if( aTypeName.startsWith( "NotesShape" ) ) { - nType = OBJ_TEXT; + nType = SdrObjKind::Text; } else if( aTypeName.startsWith( "HandoutShape" ) ) { - nType = OBJ_PAGE; + nType = SdrObjKind::Page; } else if( aTypeName.startsWith( "FooterShape" ) ) { - nType = OBJ_TEXT; + nType = SdrObjKind::Text; } else if( aTypeName.startsWith( "HeaderShape" ) ) { - nType = OBJ_TEXT; + nType = SdrObjKind::Text; } else if( aTypeName.startsWith( "SlideNumberShape" ) ) { - nType = OBJ_TEXT; + nType = SdrObjKind::Text; } else if( aTypeName.startsWith( "DateTimeShape" ) ) { - nType = OBJ_TEXT; + nType = SdrObjKind::Text; } else if( aTypeName.startsWith( "TableShape" ) ) { - nType = OBJ_TABLE; + nType = SdrObjKind::Table; } else { diff --git a/svx/source/unodraw/unopage.cxx b/svx/source/unodraw/unopage.cxx index f7bc19864927..62669249ec5a 100644 --- a/svx/source/unodraw/unopage.cxx +++ b/svx/source/unodraw/unopage.cxx @@ -493,11 +493,11 @@ void SAL_CALL SvxDrawPage::ungroup( const Reference< drawing::XShapeGroup >& aGr SdrObject* SvxDrawPage::CreateSdrObject_(const Reference< drawing::XShape > & xShape) { - SdrObjKind nType = OBJ_NONE; + SdrObjKind nType = SdrObjKind::NONE; SdrInventor nInventor; GetTypeAndInventor( nType, nInventor, xShape->getShapeType() ); - if (!nType) + if (nType == SdrObjKind::NONE) return nullptr; awt::Size aSize = xShape->getSize(); @@ -563,40 +563,40 @@ SdrObject* SvxDrawPage::CreateSdrObject_(const Reference< drawing::XShape > & xS void SvxDrawPage::GetTypeAndInventor( SdrObjKind& rType, SdrInventor& rInventor, const OUString& aName ) noexcept { - sal_uInt32 nTempType = UHashMap::getId( aName ); + std::optional<SdrObjKind> nTempType = UHashMap::getId( aName ); - if( nTempType == UHASHMAP_NOTFOUND ) + if( !nTempType ) { if( aName == "com.sun.star.drawing.TableShape" || aName == "com.sun.star.presentation.TableShape" ) { rInventor = SdrInventor::Default; - rType = OBJ_TABLE; + rType = SdrObjKind::Table; } #if HAVE_FEATURE_AVMEDIA else if ( aName == "com.sun.star.presentation.MediaShape" ) { rInventor = SdrInventor::Default; - rType = OBJ_MEDIA; + rType = SdrObjKind::Media; } #endif } - else if(nTempType & E3D_INVENTOR_FLAG) + else if( IsInventorE3D(*nTempType) ) { rInventor = SdrInventor::E3d; - rType = static_cast<SdrObjKind>(nTempType & ~E3D_INVENTOR_FLAG); + rType = *nTempType; } else { rInventor = SdrInventor::Default; - rType = static_cast<SdrObjKind>(nTempType); + rType = *nTempType; switch( rType ) { - case OBJ_FRAME: - case OBJ_OLE2_PLUGIN: - case OBJ_OLE2_APPLET: - rType = OBJ_OLE2; + case SdrObjKind::OLEPluginFrame: + case SdrObjKind::OLE2Plugin: + case SdrObjKind::OLE2Applet: + rType = SdrObjKind::OLE2; break; default: break; @@ -604,7 +604,7 @@ void SvxDrawPage::GetTypeAndInventor( SdrObjKind& rType, SdrInventor& rInventor, } } -rtl::Reference<SvxShape> SvxDrawPage::CreateShapeByTypeAndInventor( sal_uInt16 nType, SdrInventor nInventor, SdrObject *pObj, SvxDrawPage *mpPage, OUString const & referer ) +rtl::Reference<SvxShape> SvxDrawPage::CreateShapeByTypeAndInventor( SdrObjKind nType, SdrInventor nInventor, SdrObject *pObj, SvxDrawPage *mpPage, OUString const & referer ) { rtl::Reference<SvxShape> pRet; @@ -614,25 +614,26 @@ rtl::Reference<SvxShape> SvxDrawPage::CreateShapeByTypeAndInventor( sal_uInt16 n { switch( nType ) { - case E3D_SCENE_ID : + case SdrObjKind::E3D_Scene : pRet = new Svx3DSceneObject( pObj, mpPage ); break; - case E3D_CUBEOBJ_ID : + case SdrObjKind::E3D_Cube : pRet = new Svx3DCubeObject( pObj ); break; - case E3D_SPHEREOBJ_ID : + case SdrObjKind::E3D_Sphere : pRet = new Svx3DSphereObject( pObj ); break; - case E3D_LATHEOBJ_ID : + case SdrObjKind::E3D_Lathe : pRet = new Svx3DLatheObject( pObj ); break; - case E3D_EXTRUDEOBJ_ID : + case SdrObjKind::E3D_Extrusion : pRet = new Svx3DExtrudeObject( pObj ); break; - case E3D_POLYGONOBJ_ID : + case SdrObjKind::E3D_Polygon : pRet = new Svx3DPolygonObject( pObj ); break; default: // unknown 3D-object on page + assert(false && "the IsInventor3D function must be wrong"); pRet = new SvxShape( pObj ); break; } @@ -642,62 +643,62 @@ rtl::Reference<SvxShape> SvxDrawPage::CreateShapeByTypeAndInventor( sal_uInt16 n { switch( nType ) { - case OBJ_GRUP: + case SdrObjKind::Group: pRet = new SvxShapeGroup( pObj, mpPage ); break; - case OBJ_LINE: + case SdrObjKind::Line: pRet = new SvxShapePolyPolygon( pObj ); break; - case OBJ_RECT: + case SdrObjKind::Rectangle: pRet = new SvxShapeRect( pObj ); break; - case OBJ_CIRC: - case OBJ_SECT: - case OBJ_CARC: - case OBJ_CCUT: + case SdrObjKind::CircleOrEllipse: + case SdrObjKind::CircleSection: + case SdrObjKind::CircleArc: + case SdrObjKind::CircleCut: pRet = new SvxShapeCircle( pObj ); break; - case OBJ_POLY: + case SdrObjKind::Polygon: pRet = new SvxShapePolyPolygon( pObj ); break; - case OBJ_PLIN: + case SdrObjKind::PolyLine: pRet = new SvxShapePolyPolygon( pObj ); break; - case OBJ_SPLNLINE: - case OBJ_PATHLINE: + case SdrObjKind::SplineLine: + case SdrObjKind::PathLine: pRet = new SvxShapePolyPolygon( pObj ); break; - case OBJ_SPLNFILL: - case OBJ_PATHFILL: + case SdrObjKind::SplineFill: + case SdrObjKind::PathFill: pRet = new SvxShapePolyPolygon( pObj ); break; - case OBJ_FREELINE: + case SdrObjKind::FreehandLine: pRet = new SvxShapePolyPolygon( pObj ); break; - case OBJ_FREEFILL: + case SdrObjKind::FreehandFill: pRet = new SvxShapePolyPolygon( pObj ); break; - case OBJ_CAPTION: + case SdrObjKind::Caption: pRet = new SvxShapeCaption( pObj ); break; - case OBJ_TITLETEXT: - case OBJ_OUTLINETEXT: - case OBJ_TEXT: + case SdrObjKind::TitleText: + case SdrObjKind::OutlineText: + case SdrObjKind::Text: pRet = new SvxShapeText( pObj ); break; - case OBJ_GRAF: + case SdrObjKind::Graphic: pRet = new SvxGraphicObject( pObj ); break; - case OBJ_FRAME: + case SdrObjKind::OLEPluginFrame: pRet = new SvxFrameShape( pObj ); break; - case OBJ_OLE2_APPLET: + case SdrObjKind::OLE2Applet: pRet = new SvxAppletShape( pObj ); break; - case OBJ_OLE2_PLUGIN: + case SdrObjKind::OLE2Plugin: pRet = new SvxPluginShape( pObj ); break; - case OBJ_OLE2: + case SdrObjKind::OLE2: { if( pObj && !pObj->IsEmptyPresObj() && mpPage ) { @@ -724,17 +725,17 @@ rtl::Reference<SvxShape> SvxDrawPage::CreateShapeByTypeAndInventor( sal_uInt16 n if( aPluginClassId == aClassId ) { pRet = new SvxPluginShape( pObj ); - nType = OBJ_OLE2_PLUGIN; + nType = SdrObjKind::OLE2Plugin; } else if( aAppletClassId == aClassId ) { pRet = new SvxAppletShape( pObj ); - nType = OBJ_OLE2_APPLET; + nType = SdrObjKind::OLE2Applet; } else if( aIFrameClassId == aClassId ) { pRet = new SvxFrameShape( pObj ); - nType = OBJ_FRAME; + nType = SdrObjKind::OLEPluginFrame; } } } @@ -747,34 +748,34 @@ rtl::Reference<SvxShape> SvxDrawPage::CreateShapeByTypeAndInventor( sal_uInt16 n } } break; - case OBJ_EDGE: + case SdrObjKind::Edge: pRet = new SvxShapeConnector( pObj ); break; - case OBJ_PATHPOLY: + case SdrObjKind::PathPoly: pRet = new SvxShapePolyPolygon( pObj ); break; - case OBJ_PATHPLIN: + case SdrObjKind::PathPolyLine: pRet = new SvxShapePolyPolygon( pObj ); break; - case OBJ_PAGE: + case SdrObjKind::Page: { SvxUnoPropertyMapProvider& rSvxMapProvider = getSvxMapProvider(); pRet = new SvxShape( pObj, rSvxMapProvider.GetMap(SVXMAP_PAGE), rSvxMapProvider.GetPropertySet(SVXMAP_PAGE, SdrObject::GetGlobalDrawObjectItemPool()) ); } break; - case OBJ_MEASURE: + case SdrObjKind::Measure: pRet = new SvxShapeDimensioning( pObj ); break; - case OBJ_UNO: + case SdrObjKind::UNO: pRet = new SvxShapeControl( pObj ); break; - case OBJ_CUSTOMSHAPE: + case SdrObjKind::CustomShape: pRet = new SvxCustomShape( pObj ); break; - case OBJ_MEDIA: + case SdrObjKind::Media: pRet = new SvxMediaShape( pObj, referer ); break; - case OBJ_TABLE: + case SdrObjKind::Table: pRet = new SvxTableShape( pObj ); break; default: // unknown 2D-object on page @@ -793,23 +794,21 @@ rtl::Reference<SvxShape> SvxDrawPage::CreateShapeByTypeAndInventor( sal_uInt16 n if(pRet) { - sal_uInt32 nObjId = nType; - - if( nInventor == SdrInventor::E3d ) - nObjId |= E3D_INVENTOR_FLAG; + SdrObjKind nObjId = nType; switch(nObjId) { - case OBJ_CCUT: // segment of circle - case OBJ_CARC: // arc of circle - case OBJ_SECT: // sector - nObjId = OBJ_CIRC; + case SdrObjKind::CircleCut: // segment of circle + case SdrObjKind::CircleArc: // arc of circle + case SdrObjKind::CircleSection: // sector + nObjId = SdrObjKind::CircleOrEllipse; break; - case OBJ_TITLETEXT: - case OBJ_OUTLINETEXT: - nObjId = OBJ_TEXT; + case SdrObjKind::TitleText: + case SdrObjKind::OutlineText: + nObjId = SdrObjKind::Text; break; + default: ; } pRet->setShapeKind(nObjId); @@ -861,7 +860,7 @@ uno::Sequence< OUString > SAL_CALL SvxDrawPage::getSupportedServiceNames() return aSeq; } -rtl::Reference<SvxShape> CreateSvxShapeByTypeAndInventor(sal_uInt16 nType, SdrInventor nInventor, OUString const & referer) +rtl::Reference<SvxShape> CreateSvxShapeByTypeAndInventor(SdrObjKind nType, SdrInventor nInventor, OUString const & referer) { return SvxDrawPage::CreateShapeByTypeAndInventor( nType, nInventor, nullptr, nullptr, referer ); } diff --git a/svx/source/unodraw/unoprov.cxx b/svx/source/unodraw/unoprov.cxx index 4d20dee09617..be3d98108fc8 100644 --- a/svx/source/unodraw/unoprov.cxx +++ b/svx/source/unodraw/unoprov.cxx @@ -808,7 +808,7 @@ static comphelper::PropertyMapEntry const * ImplGetAdditionalWriterDrawingDefaul return aSvxAdditionalDefaultsPropertyMap_Impl; } -typedef std::unordered_map< OUString, sal_uInt32 > UHashMapImpl; +typedef std::unordered_map< OUString, SdrObjKind > UHashMapImpl; namespace { @@ -816,38 +816,38 @@ const UHashMapImpl& GetUHashImpl() { static UHashMapImpl const aImpl { - { "com.sun.star.drawing.RectangleShape", OBJ_RECT }, - { "com.sun.star.drawing.EllipseShape", OBJ_CIRC }, - { "com.sun.star.drawing.ControlShape", OBJ_UNO }, - { "com.sun.star.drawing.ConnectorShape", OBJ_EDGE }, - { "com.sun.star.drawing.MeasureShape", OBJ_MEASURE }, - { "com.sun.star.drawing.LineShape", OBJ_LINE }, - { "com.sun.star.drawing.PolyPolygonShape", OBJ_POLY }, - { "com.sun.star.drawing.PolyLineShape", OBJ_PLIN }, - { "com.sun.star.drawing.OpenBezierShape", OBJ_PATHLINE }, - { "com.sun.star.drawing.ClosedBezierShape", OBJ_PATHFILL }, - { "com.sun.star.drawing.OpenFreeHandShape", OBJ_FREELINE }, - { "com.sun.star.drawing.ClosedFreeHandShape", OBJ_FREEFILL }, - { "com.sun.star.drawing.PolyPolygonPathShape", OBJ_PATHPOLY }, - { "com.sun.star.drawing.PolyLinePathShape", OBJ_PATHPLIN }, - { "com.sun.star.drawing.GraphicObjectShape", OBJ_GRAF }, - { "com.sun.star.drawing.GroupShape", OBJ_GRUP }, - { "com.sun.star.drawing.TextShape", OBJ_TEXT }, - { "com.sun.star.drawing.OLE2Shape", OBJ_OLE2 }, - { "com.sun.star.drawing.PageShape", OBJ_PAGE }, - { "com.sun.star.drawing.CaptionShape", OBJ_CAPTION }, - { "com.sun.star.drawing.FrameShape", OBJ_FRAME }, - { "com.sun.star.drawing.PluginShape", OBJ_OLE2_PLUGIN }, - { "com.sun.star.drawing.AppletShape", OBJ_OLE2_APPLET }, - { "com.sun.star.drawing.CustomShape", OBJ_CUSTOMSHAPE }, - { "com.sun.star.drawing.MediaShape", OBJ_MEDIA }, - - { "com.sun.star.drawing.Shape3DSceneObject", E3D_SCENE_ID | E3D_INVENTOR_FLAG }, - { "com.sun.star.drawing.Shape3DCubeObject", E3D_CUBEOBJ_ID | E3D_INVENTOR_FLAG }, - { "com.sun.star.drawing.Shape3DSphereObject", E3D_SPHEREOBJ_ID | E3D_INVENTOR_FLAG }, - { "com.sun.star.drawing.Shape3DLatheObject", E3D_LATHEOBJ_ID | E3D_INVENTOR_FLAG }, - { "com.sun.star.drawing.Shape3DExtrudeObject", E3D_EXTRUDEOBJ_ID | E3D_INVENTOR_FLAG }, - { "com.sun.star.drawing.Shape3DPolygonObject", E3D_POLYGONOBJ_ID | E3D_INVENTOR_FLAG }, + { "com.sun.star.drawing.RectangleShape", SdrObjKind::Rectangle }, + { "com.sun.star.drawing.EllipseShape", SdrObjKind::CircleOrEllipse }, + { "com.sun.star.drawing.ControlShape", SdrObjKind::UNO }, + { "com.sun.star.drawing.ConnectorShape", SdrObjKind::Edge }, + { "com.sun.star.drawing.MeasureShape", SdrObjKind::Measure }, + { "com.sun.star.drawing.LineShape", SdrObjKind::Line }, + { "com.sun.star.drawing.PolyPolygonShape", SdrObjKind::Polygon }, + { "com.sun.star.drawing.PolyLineShape", SdrObjKind::PolyLine }, + { "com.sun.star.drawing.OpenBezierShape", SdrObjKind::PathLine }, + { "com.sun.star.drawing.ClosedBezierShape", SdrObjKind::PathFill }, + { "com.sun.star.drawing.OpenFreeHandShape", SdrObjKind::FreehandLine }, + { "com.sun.star.drawing.ClosedFreeHandShape", SdrObjKind::FreehandFill }, + { "com.sun.star.drawing.PolyPolygonPathShape", SdrObjKind::PathPoly }, + { "com.sun.star.drawing.PolyLinePathShape", SdrObjKind::PathPolyLine }, + { "com.sun.star.drawing.GraphicObjectShape", SdrObjKind::Graphic }, + { "com.sun.star.drawing.GroupShape", SdrObjKind::Group }, + { "com.sun.star.drawing.TextShape", SdrObjKind::Text }, + { "com.sun.star.drawing.OLE2Shape", SdrObjKind::OLE2 }, + { "com.sun.star.drawing.PageShape", SdrObjKind::Page }, + { "com.sun.star.drawing.CaptionShape", SdrObjKind::Caption }, + { "com.sun.star.drawing.FrameShape", SdrObjKind::OLEPluginFrame }, + { "com.sun.star.drawing.PluginShape", SdrObjKind::OLE2Plugin }, + { "com.sun.star.drawing.AppletShape", SdrObjKind::OLE2Applet }, + { "com.sun.star.drawing.CustomShape", SdrObjKind::CustomShape }, + { "com.sun.star.drawing.MediaShape", SdrObjKind::Media }, + + { "com.sun.star.drawing.Shape3DSceneObject", SdrObjKind::E3D_Scene }, + { "com.sun.star.drawing.Shape3DCubeObject", SdrObjKind::E3D_Cube }, + { "com.sun.star.drawing.Shape3DSphereObject", SdrObjKind::E3D_Sphere }, + { "com.sun.star.drawing.Shape3DLatheObject", SdrObjKind::E3D_Lathe }, + { "com.sun.star.drawing.Shape3DExtrudeObject", SdrObjKind::E3D_Extrusion }, + { "com.sun.star.drawing.Shape3DPolygonObject", SdrObjKind::E3D_Polygon }, }; return aImpl; @@ -856,7 +856,7 @@ const UHashMapImpl& GetUHashImpl() } -OUString UHashMap::getNameFromId(sal_uInt32 nId) +OUString UHashMap::getNameFromId(SdrObjKind nId) { const UHashMapImpl &rMap = GetUHashImpl(); @@ -873,12 +873,12 @@ uno::Sequence< OUString > UHashMap::getServiceNames() return comphelper::mapKeysToSequence( GetUHashImpl() ); } -sal_uInt32 UHashMap::getId( const OUString& rCompareString ) +std::optional<SdrObjKind> UHashMap::getId( const OUString& rCompareString ) { const UHashMapImpl &rMap = GetUHashImpl(); UHashMapImpl::const_iterator it = rMap.find( rCompareString ); if( it == rMap.end() ) - return UHASHMAP_NOTFOUND; + return {}; else return it->second; } diff --git a/svx/source/unodraw/unoshap2.cxx b/svx/source/unodraw/unoshap2.cxx index c5440fd2d95d..aecd0e0a8593 100644 --- a/svx/source/unodraw/unoshap2.cxx +++ b/svx/source/unodraw/unoshap2.cxx @@ -457,7 +457,7 @@ void SAL_CALL SvxShapeConnector::disconnectEnd( const uno::Reference< drawing::X SvxShapeControl::SvxShapeControl(SdrObject* pObj) : SvxShapeText( pObj, getSvxMapProvider().GetMap(SVXMAP_CONTROL), getSvxMapProvider().GetPropertySet(SVXMAP_CONTROL, SdrObject::GetGlobalDrawObjectItemPool()) ) { - setShapeKind( OBJ_UNO ); + setShapeKind( SdrObjKind::UNO ); } @@ -1116,14 +1116,14 @@ drawing::PolygonKind SvxShapePolyPolygon::GetPolygonKind() const { switch(GetSdrObject()->GetObjIdentifier()) { - case OBJ_POLY: aRetval = drawing::PolygonKind_POLY; break; - case OBJ_PLIN: aRetval = drawing::PolygonKind_PLIN; break; - case OBJ_SPLNLINE: - case OBJ_PATHLINE: aRetval = drawing::PolygonKind_PATHLINE; break; - case OBJ_SPLNFILL: - case OBJ_PATHFILL: aRetval = drawing::PolygonKind_PATHFILL; break; - case OBJ_FREELINE: aRetval = drawing::PolygonKind_FREELINE; break; - case OBJ_FREEFILL: aRetval = drawing::PolygonKind_FREEFILL; break; + case SdrObjKind::Polygon: aRetval = drawing::PolygonKind_POLY; break; + case SdrObjKind::PolyLine: aRetval = drawing::PolygonKind_PLIN; break; + case SdrObjKind::SplineLine: + case SdrObjKind::PathLine: aRetval = drawing::PolygonKind_PATHLINE; break; + case SdrObjKind::SplineFill: + case SdrObjKind::PathFill: aRetval = drawing::PolygonKind_PATHFILL; break; + case SdrObjKind::FreehandLine: aRetval = drawing::PolygonKind_FREELINE; break; + case SdrObjKind::FreehandFill: aRetval = drawing::PolygonKind_FREEFILL; break; default: break; } } diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx index 0b2535831d39..4081e4d8128f 100644 --- a/svx/source/unodraw/unoshape.cxx +++ b/svx/source/unodraw/unoshape.cxx @@ -112,7 +112,7 @@ struct SvxShapeImpl { SvxShape& mrAntiImpl; std::optional<SfxItemSet> mxItemSet; - sal_uInt32 mnObjId; + SdrObjKind mnObjId; SvxShapeMaster* mpMaster; bool mbHasSdrObjectOwnership; bool mbDisposing; @@ -130,7 +130,7 @@ struct SvxShapeImpl SvxShapeImpl( SvxShape& _rAntiImpl, ::osl::Mutex& _rMutex ) :mrAntiImpl( _rAntiImpl ) - ,mnObjId( 0 ) + ,mnObjId( SdrObjKind::NONE ) ,mpMaster( nullptr ) ,mbHasSdrObjectOwnership( false ) ,mbDisposing( false ) @@ -274,13 +274,13 @@ bool SvxShape::HasSdrObjectOwnership() const } -void SvxShape::setShapeKind( sal_uInt32 nKind ) +void SvxShape::setShapeKind( SdrObjKind nKind ) { mpImpl->mnObjId = nKind; } -sal_uInt32 SvxShape::getShapeKind() const +SdrObjKind SvxShape::getShapeKind() const { return mpImpl->mnObjId; } @@ -361,22 +361,21 @@ void SvxShape::impl_initFromSdrObject() if(nInventor == SdrInventor::FmForm) { - mpImpl->mnObjId = OBJ_UNO; + mpImpl->mnObjId = SdrObjKind::UNO; } else { mpImpl->mnObjId = GetSdrObject()->GetObjIdentifier(); - if( nInventor == SdrInventor::E3d ) - mpImpl->mnObjId |= E3D_INVENTOR_FLAG; } switch(mpImpl->mnObjId) { - case OBJ_CCUT: // segment of circle - case OBJ_CARC: // arc of circle - case OBJ_SECT: // sector - mpImpl->mnObjId = OBJ_CIRC; + case SdrObjKind::CircleCut: // segment of circle + case SdrObjKind::CircleArc: // arc of circle + case SdrObjKind::CircleSection: // sector + mpImpl->mnObjId = SdrObjKind::CircleOrEllipse; break; + default: ; } } @@ -773,17 +772,17 @@ uno::Sequence< uno::Type > const & SvxShape::_getTypes() switch( mpImpl->mnObjId ) { // shapes without text - case OBJ_PAGE: - case OBJ_FRAME: - case OBJ_OLE2_PLUGIN: - case OBJ_OLE2_APPLET: - case E3D_CUBEOBJ_ID|E3D_INVENTOR_FLAG: - case E3D_SPHEREOBJ_ID|E3D_INVENTOR_FLAG: - case E3D_LATHEOBJ_ID|E3D_INVENTOR_FLAG: - case E3D_EXTRUDEOBJ_ID|E3D_INVENTOR_FLAG: - case E3D_POLYGONOBJ_ID|E3D_INVENTOR_FLAG: - case OBJ_MEDIA: - case OBJ_TABLE: + case SdrObjKind::Page: + case SdrObjKind::OLEPluginFrame: + case SdrObjKind::OLE2Plugin: + case SdrObjKind::OLE2Applet: + case SdrObjKind::E3D_Cube: + case SdrObjKind::E3D_Sphere: + case SdrObjKind::E3D_Lathe: + case SdrObjKind::E3D_Extrusion: + case SdrObjKind::E3D_Polygon: + case SdrObjKind::Media: + case SdrObjKind::Table: { static uno::Sequence<uno::Type> aTypeSequence{ cppu::UnoType<drawing::XShape>::get(), @@ -803,7 +802,7 @@ uno::Sequence< uno::Type > const & SvxShape::_getTypes() return aTypeSequence; } // group shape - case OBJ_GRUP: + case SdrObjKind::Group: { static uno::Sequence<uno::Type> aTypeSequence{ cppu::UnoType<drawing::XShape>::get(), @@ -825,7 +824,7 @@ uno::Sequence< uno::Type > const & SvxShape::_getTypes() return aTypeSequence; } // connector shape - case OBJ_EDGE: + case SdrObjKind::Edge: { static uno::Sequence<uno::Type> aTypeSequence{ cppu::UnoType<drawing::XShape>::get(), @@ -851,7 +850,7 @@ uno::Sequence< uno::Type > const & SvxShape::_getTypes() return aTypeSequence; } // control shape - case OBJ_UNO: + case SdrObjKind::UNO: { static uno::Sequence<uno::Type> aTypeSequence{ cppu::UnoType<drawing::XShape>::get(), @@ -872,7 +871,7 @@ uno::Sequence< uno::Type > const & SvxShape::_getTypes() return aTypeSequence; } // 3d scene shape - case E3D_SCENE_ID|E3D_INVENTOR_FLAG: + case SdrObjKind::E3D_Scene: { static uno::Sequence<uno::Type> aTypeSequence{ cppu::UnoType<drawing::XShape>::get(), @@ -892,7 +891,7 @@ uno::Sequence< uno::Type > const & SvxShape::_getTypes() return aTypeSequence; } - case OBJ_CUSTOMSHAPE: + case SdrObjKind::CustomShape: { static uno::Sequence<uno::Type> aTypeSequence{ cppu::UnoType<drawing::XShape>::get(), @@ -917,22 +916,22 @@ uno::Sequence< uno::Type > const & SvxShape::_getTypes() return aTypeSequence; } // shapes with text - case OBJ_RECT: - case OBJ_CIRC: - case OBJ_MEASURE: - case OBJ_LINE: - case OBJ_POLY: - case OBJ_PLIN: - case OBJ_PATHLINE: - case OBJ_PATHFILL: - case OBJ_FREELINE: - case OBJ_FREEFILL: - case OBJ_PATHPOLY: - case OBJ_PATHPLIN: - case OBJ_GRAF: - case OBJ_TEXT: - case OBJ_CAPTION: - case OBJ_OLE2: // #i118485# Moved to shapes with text + case SdrObjKind::Rectangle: + case SdrObjKind::CircleOrEllipse: + case SdrObjKind::Measure: + case SdrObjKind::Line: + case SdrObjKind::Polygon: + case SdrObjKind::PolyLine: + case SdrObjKind::PathLine: + case SdrObjKind::PathFill: + case SdrObjKind::FreehandLine: + case SdrObjKind::FreehandFill: + case SdrObjKind::PathPoly: + case SdrObjKind::PathPolyLine: + case SdrObjKind::Graphic: + case SdrObjKind::Text: + case SdrObjKind::Caption: + case SdrObjKind::OLE2: // #i118485# Moved to shapes with text default: { static uno::Sequence<uno::Type> aTypeSequence{ @@ -1050,20 +1049,20 @@ static bool svx_needLogicRectHack( SdrObject const * pObj ) { switch(pObj->GetObjIdentifier()) { - case OBJ_GRUP: - case OBJ_LINE: - case OBJ_POLY: - case OBJ_PLIN: - case OBJ_PATHLINE: - case OBJ_PATHFILL: - case OBJ_FREELINE: - case OBJ_FREEFILL: - case OBJ_SPLNLINE: - case OBJ_SPLNFILL: - case OBJ_EDGE: - case OBJ_PATHPOLY: - case OBJ_PATHPLIN: - case OBJ_MEASURE: + case SdrObjKind::Group: + case SdrObjKind::Line: + case SdrObjKind::Polygon: + case SdrObjKind::PolyLine: + case SdrObjKind::PathLine: + case SdrObjKind::PathFill: + case SdrObjKind::FreehandLine: + case SdrObjKind::FreehandFill: + case SdrObjKind::SplineLine: + case SdrObjKind::SplineFill: + case SdrObjKind::Edge: + case SdrObjKind::PathPoly: + case SdrObjKind::PathPolyLine: + case SdrObjKind::Measure: return true; default: break; @@ -1178,7 +1177,7 @@ void SAL_CALL SvxShape::setSize( const awt::Size& rSize ) Size aLocalSize( rSize.Width, rSize.Height ); ForceMetricToItemPoolMetric(aLocalSize); - if(GetSdrObject()->GetObjInventor() == SdrInventor::Default && GetSdrObject()->GetObjIdentifier() == OBJ_MEASURE ) + if(GetSdrObject()->GetObjInventor() == SdrInventor::Default && GetSdrObject()->GetObjIdentifier() == SdrObjKind::Measure ) { Fraction aWdt(aLocalSize.Width(),aRect.Right()-aRect.Left()); Fraction aHgt(aLocalSize.Height(),aRect.Bottom()-aRect.Top()); @@ -1911,16 +1910,16 @@ uno::Any SvxShape::GetAnyForItem( SfxItemSet const & aSet, const SfxItemProperty drawing::CircleKind eKind; switch(GetSdrObject()->GetObjIdentifier()) { - case OBJ_CIRC: // circle, ellipse + case SdrObjKind::CircleOrEllipse: // circle, ellipse eKind = drawing::CircleKind_FULL; break; - case OBJ_CCUT: // segment of circle + case SdrObjKind::CircleCut: // segment of circle eKind = drawing::CircleKind_CUT; break; - case OBJ_CARC: // arc of circle + case SdrObjKind::CircleArc: // arc of circle eKind = drawing::CircleKind_ARC; break; - case OBJ_SECT: // sector + case SdrObjKind::CircleSection: // sector eKind = drawing::CircleKind_SECTION; break; default: @@ -2649,11 +2648,11 @@ bool SvxShape::getPropertyValueImpl( const OUString&, const SfxItemPropertyMapEn case OWN_ATTR_LDBITMAP: { OUString sId; - if( GetSdrObject()->GetObjInventor() == SdrInventor::Default && GetSdrObject()->GetObjIdentifier() == OBJ_OLE2 ) + if( GetSdrObject()->GetObjInventor() == SdrInventor::Default && GetSdrObject()->GetObjIdentifier() == SdrObjKind::OLE2 ) { sId = RID_UNODRAW_OLE2; } - else if( GetSdrObject()->GetObjInventor() == SdrInventor::Default && GetSdrObject()->GetObjIdentifier() == OBJ_GRAF ) + else if( GetSdrObject()->GetObjInventor() == SdrInventor::Default && GetSdrObject()->GetObjIdentifier() == SdrObjKind::Graphic ) { sId = RID_UNODRAW_GRAPHICS; } @@ -3197,18 +3196,18 @@ uno::Sequence< OUString > SvxShape::_getSupportedServiceNames() if( HasSdrObject() && GetSdrObject()->GetObjInventor() == SdrInventor::Default) { - const sal_uInt16 nIdent = GetSdrObject()->GetObjIdentifier(); + const SdrObjKind nIdent = GetSdrObject()->GetObjIdentifier(); switch(nIdent) { - case OBJ_GRUP: + case SdrObjKind::Group: { static const uno::Sequence<OUString> aSvxShape_GroupServices = { sUNO_service_drawing_GroupShape, sUNO_service_drawing_Shape }; return aSvxShape_GroupServices; } - case OBJ_CUSTOMSHAPE: + case SdrObjKind::CustomShape: { static const uno::Sequence<OUString> aSvxShape_CustomShapeServices = { sUNO_service_drawing_CustomShape, @@ -3228,7 +3227,7 @@ uno::Sequence< OUString > SvxShape::_getSupportedServiceNames() sUNO_service_drawing_RotationDescriptor }; return aSvxShape_CustomShapeServices; } - case OBJ_LINE: + case SdrObjKind::Line: { static const uno::Sequence<OUString> aSvxShape_LineServices = { sUNO_service_drawing_LineShape, @@ -3251,7 +3250,7 @@ uno::Sequence< OUString > SvxShape::_getSupportedServiceNames() return aSvxShape_LineServices; } - case OBJ_RECT: + case SdrObjKind::Rectangle: { static const uno::Sequence<OUString> aSvxShape_RectServices = { sUNO_service_drawing_RectangleShape, @@ -3273,10 +3272,10 @@ uno::Sequence< OUString > SvxShape::_getSupportedServiceNames() return aSvxShape_RectServices; } - case OBJ_CIRC: - case OBJ_SECT: - case OBJ_CARC: - case OBJ_CCUT: + case SdrObjKind::CircleOrEllipse: + case SdrObjKind::CircleSection: + case SdrObjKind::CircleArc: + case SdrObjKind::CircleCut: { static const uno::Sequence<OUString> aSvxShape_CircServices = { sUNO_service_drawing_EllipseShape, @@ -3299,8 +3298,8 @@ uno::Sequence< OUString > SvxShape::_getSupportedServiceNames() return aSvxShape_CircServices; } - case OBJ_PATHPLIN: - case OBJ_PLIN: + case SdrObjKind::PathPolyLine: + case SdrObjKind::PolyLine: { static const uno::Sequence<OUString> aSvxShape_PathServices = { sUNO_service_drawing_PolyLineShape, @@ -3324,8 +3323,8 @@ uno::Sequence< OUString > SvxShape::_getSupportedServiceNames() return aSvxShape_PathServices; } - case OBJ_PATHPOLY: - case OBJ_POLY: + case SdrObjKind::PathPoly: + case SdrObjKind::Polygon: { static const uno::Sequence<OUString> aSvxShape_PolyServices = { sUNO_service_drawing_PolyPolygonShape, @@ -3350,8 +3349,8 @@ uno::Sequence< OUString > SvxShape::_getSupportedServiceNames() return aSvxShape_PolyServices; } - case OBJ_FREELINE: - case OBJ_PATHLINE: + case SdrObjKind::FreehandLine: + case SdrObjKind::PathLine: { static const uno::Sequence<OUString> aSvxShape_FreeLineServices = { sUNO_service_drawing_OpenBezierShape, @@ -3376,8 +3375,8 @@ uno::Sequence< OUString > SvxShape::_getSupportedServiceNames() return aSvxShape_FreeLineServices; } - case OBJ_FREEFILL: - case OBJ_PATHFILL: + case SdrObjKind::FreehandFill: + case SdrObjKind::PathFill: { static const uno::Sequence<OUString> aSvxShape_FreeFillServices = { sUNO_service_drawing_ClosedBezierShape, @@ -3402,9 +3401,9 @@ uno::Sequence< OUString > SvxShape::_getSupportedServiceNames() return aSvxShape_FreeFillServices; } - case OBJ_OUTLINETEXT: - case OBJ_TITLETEXT: - case OBJ_TEXT: + case SdrObjKind::OutlineText: + case SdrObjKind::TitleText: + case SdrObjKind::Text: { static const uno::Sequence<OUString> aSvxShape_TextServices = { sUNO_service_drawing_TextShape, @@ -3427,7 +3426,7 @@ uno::Sequence< OUString > SvxShape::_getSupportedServiceNames() return aSvxShape_TextServices; } - case OBJ_GRAF: + case SdrObjKind::Graphic: { static const uno::Sequence<OUString> aSvxShape_GrafServices = { sUNO_service_drawing_GraphicObjectShape, @@ -3448,7 +3447,7 @@ uno::Sequence< OUString > SvxShape::_getSupportedServiceNames() return aSvxShape_GrafServices; } - case OBJ_OLE2: + case SdrObjKind::OLE2: { static const uno::Sequence<OUString> aSvxShape_Ole2Services = { sUNO_service_drawing_OLE2Shape, @@ -3469,7 +3468,7 @@ uno::Sequence< OUString > SvxShape::_getSupportedServiceNames() return aSvxShape_Ole2Services; } - case OBJ_CAPTION: + case SdrObjKind::Caption: { static const uno::Sequence<OUString> aSvxShape_CaptionServices = { sUNO_service_drawing_CaptionShape, @@ -3492,7 +3491,7 @@ uno::Sequence< OUString > SvxShape::_getSupportedServiceNames() return aSvxShape_CaptionServices; } - case OBJ_PAGE: + case SdrObjKind::Page: { static const uno::Sequence<OUString> aSvxShape_PageServices = { sUNO_service_drawing_PageShape, @@ -3500,7 +3499,7 @@ uno::Sequence< OUString > SvxShape::_getSupportedServiceNames() return aSvxShape_PageServices; } - case OBJ_MEASURE: + case SdrObjKind::Measure: { static const uno::Sequence<OUString> aSvxShape_MeasureServices = { sUNO_service_drawing_MeasureShape, @@ -3525,7 +3524,7 @@ uno::Sequence< OUString > SvxShape::_getSupportedServiceNames() return aSvxShape_MeasureServices; } - case OBJ_FRAME: + case SdrObjKind::OLEPluginFrame: { static const uno::Sequence<OUString> aSvxShape_FrameServices = { sUNO_service_drawing_FrameShape, @@ -3533,7 +3532,7 @@ uno::Sequence< OUString > SvxShape::_getSupportedServiceNames() return aSvxShape_FrameServices; } - case OBJ_UNO: + case SdrObjKind::UNO: { static const uno::Sequence<OUString> aSvxShape_UnoServices = { sUNO_service_drawing_ControlShape, @@ -3541,7 +3540,7 @@ uno::Sequence< OUString > SvxShape::_getSupportedServiceNames() return aSvxShape_UnoServices; } - case OBJ_EDGE: + case SdrObjKind::Edge: { static const uno::Sequence<OUString> aSvxShape_EdgeServices = { sUNO_service_drawing_ConnectorShape, @@ -3564,20 +3563,21 @@ uno::Sequence< OUString > SvxShape::_getSupportedServiceNames() sUNO_service_drawing_RotationDescriptor }; return aSvxShape_EdgeServices; } - case OBJ_MEDIA: + case SdrObjKind::Media: { static const uno::Sequence<OUString> aSvxShape_MediaServices = { sUNO_service_drawing_MediaShape, sUNO_service_drawing_Shape }; return aSvxShape_MediaServices; } + default: ; } } else if( HasSdrObject() && GetSdrObject()->GetObjInventor() == SdrInventor::FmForm) { #if OSL_DEBUG_LEVEL > 0 - const sal_uInt16 nIdent = GetSdrObject()->GetObjIdentifier(); - OSL_ENSURE( nIdent == OBJ_UNO, "SvxShape::_getSupportedServiceNames: SdrInventor::FmForm, but no UNO object?" ); + const SdrObjKind nIdent = GetSdrObject()->GetObjIdentifier(); + OSL_ENSURE( nIdent == SdrObjKind::UNO, "SvxShape::_getSupportedServiceNames: SdrInventor::FmForm, but no UNO object?" ); #endif static const uno::Sequence<OUString> aSvxShape_UnoServices = { sUNO_service_drawing_ControlShape, @@ -3745,17 +3745,17 @@ void SvxShape::updateShapeKind() { switch( mpImpl->mnObjId ) { - case OBJ_LINE: - case OBJ_POLY: - case OBJ_PLIN: - case OBJ_PATHLINE: - case OBJ_PATHFILL: - case OBJ_FREELINE: - case OBJ_FREEFILL: - case OBJ_PATHPOLY: - case OBJ_PATHPLIN: + case SdrObjKind::Line: + case SdrObjKind::Polygon: + case SdrObjKind::PolyLine: + case SdrObjKind::PathLine: + case SdrObjKind::PathFill: + case SdrObjKind::FreehandLine: + case SdrObjKind::FreehandFill: + case SdrObjKind::PathPoly: + case SdrObjKind::PathPolyLine: { - const sal_uInt32 nId = GetSdrObject()->GetObjIdentifier(); + const SdrObjKind nId = GetSdrObject()->GetObjIdentifier(); if( nId != mpImpl->mnObjId ) { @@ -3764,6 +3764,7 @@ void SvxShape::updateShapeKind() } break; } + default: ; } } diff --git a/svx/source/unodraw/unoshtxt.cxx b/svx/source/unodraw/unoshtxt.cxx index cfb01211c129..ae35681d57b5 100644 --- a/svx/source/unodraw/unoshtxt.cxx +++ b/svx/source/unodraw/unoshtxt.cxx @@ -487,7 +487,7 @@ SvxTextForwarder* SvxTextEditSourceImpl::GetBackgroundTextForwarder() { SdrTextObj* pTextObj = dynamic_cast<SdrTextObj*>( mpObject ); OutlinerMode nOutlMode = OutlinerMode::TextObject; - if( pTextObj && pTextObj->IsTextFrame() && pTextObj->GetTextKind() == OBJ_OUTLINETEXT ) + if( pTextObj && pTextObj->IsTextFrame() && pTextObj->GetTextKind() == SdrObjKind::OutlineText ) nOutlMode = OutlinerMode::OutlineObject; mpOutliner = mpModel->createOutliner( nOutlMode ); @@ -522,7 +522,7 @@ SvxTextForwarder* SvxTextEditSourceImpl::GetBackgroundTextForwarder() } - mpTextForwarder.reset(new SvxOutlinerForwarder( *mpOutliner, (mpObject->GetObjInventor() == SdrInventor::Default) && (mpObject->GetObjIdentifier() == OBJ_OUTLINETEXT) )); + mpTextForwarder.reset(new SvxOutlinerForwarder( *mpOutliner, (mpObject->GetObjInventor() == SdrInventor::Default) && (mpObject->GetObjIdentifier() == SdrObjKind::OutlineText) )); // delay listener subscription and UAA initialization until Outliner is fully setup bCreated = true; @@ -624,7 +624,7 @@ SvxTextForwarder* SvxTextEditSourceImpl::GetEditModeTextForwarder() if( pEditOutliner ) { - mpTextForwarder.reset(new SvxOutlinerForwarder( *pEditOutliner, (mpObject->GetObjInventor() == SdrInventor::Default) && (mpObject->GetObjIdentifier() == OBJ_OUTLINETEXT) )); + mpTextForwarder.reset(new SvxOutlinerForwarder( *pEditOutliner, (mpObject->GetObjInventor() == SdrInventor::Default) && (mpObject->GetObjIdentifier() == SdrObjKind::OutlineText) )); mbForwarderIsEditMode = true; } } diff --git a/sw/inc/view.hxx b/sw/inc/view.hxx index d074f0d552a7..a3070642aa16 100644 --- a/sw/inc/view.hxx +++ b/sw/inc/view.hxx @@ -535,7 +535,7 @@ public: bool EnterDrawTextMode(const Point& aDocPos); /// Same as EnterDrawTextMode(), but takes an SdrObject instead of guessing it by document position. bool EnterShapeDrawTextMode(SdrObject* pObject); - void LeaveDrawCreate() { m_nDrawSfxId = m_nFormSfxId = USHRT_MAX; m_sDrawCustom.clear(); m_eFormObjKind = OBJ_NONE; } + void LeaveDrawCreate() { m_nDrawSfxId = m_nFormSfxId = USHRT_MAX; m_sDrawCustom.clear(); m_eFormObjKind = SdrObjKind::NONE; } bool IsDrawMode() const { return (m_nDrawSfxId != USHRT_MAX || m_nFormSfxId != USHRT_MAX); } bool IsFormMode() const; bool IsBezierEditMode() const; diff --git a/sw/qa/extras/uiwriter/uiwriter2.cxx b/sw/qa/extras/uiwriter/uiwriter2.cxx index abb6d02556f8..3463f850d3dd 100644 --- a/sw/qa/extras/uiwriter/uiwriter2.cxx +++ b/sw/qa/extras/uiwriter/uiwriter2.cxx @@ -2360,7 +2360,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf122942) // Start creating a custom shape that overlaps with the rounded rectangle // already present in the document. Point aStartPos(8000, 3000); - pWrtShell->BeginCreate(OBJ_CUSTOMSHAPE, aStartPos); + pWrtShell->BeginCreate(SdrObjKind::CustomShape, aStartPos); // Set its size. Point aMovePos(10000, 5000); diff --git a/sw/qa/uibase/shells/shells.cxx b/sw/qa/uibase/shells/shells.cxx index bae2c4ab350a..ef4cea15476b 100644 --- a/sw/qa/uibase/shells/shells.cxx +++ b/sw/qa/uibase/shells/shells.cxx @@ -78,7 +78,7 @@ CPPUNIT_TEST_FIXTURE(SwUibaseShellsTest, testShapeTextAlignment) SwDoc* pDoc = createSwDoc(); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); Point aStartPos(1000, 1000); - pWrtShell->BeginCreate(OBJ_RECT, aStartPos); + pWrtShell->BeginCreate(SdrObjKind::Rectangle, aStartPos); Point aMovePos(2000, 2000); pWrtShell->MoveCreate(aMovePos); pWrtShell->EndCreate(SdrCreateCmd::ForceEnd); diff --git a/sw/source/core/access/AccessibilityCheck.cxx b/sw/source/core/access/AccessibilityCheck.cxx index 03162a0a33ad..626e3e0463f1 100644 --- a/sw/source/core/access/AccessibilityCheck.cxx +++ b/sw/source/core/access/AccessibilityCheck.cxx @@ -893,7 +893,8 @@ void AccessibilityCheck::checkObject(SdrObject* pObject) && FindFrameFormat(pObject)->GetAnchor().GetAnchorId() != RndStdIds::FLY_AS_CHAR) lclAddIssue(m_aIssueCollection, SwResId(STR_FLOATING_TEXT)); - if (pObject->GetObjIdentifier() == OBJ_CUSTOMSHAPE || pObject->GetObjIdentifier() == OBJ_TEXT) + if (pObject->GetObjIdentifier() == SdrObjKind::CustomShape + || pObject->GetObjIdentifier() == SdrObjKind::Text) { OUString sAlternative = pObject->GetTitle(); if (sAlternative.isEmpty()) diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx index 48c29c519434..f4f463294087 100644 --- a/sw/source/core/draw/dcontact.cxx +++ b/sw/source/core/draw/dcontact.cxx @@ -182,7 +182,7 @@ SwContact* GetUserCall( const SdrObject* pObj ) bool IsMarqueeTextObj( const SdrObject& rObj ) { if (SdrInventor::Default != rObj.GetObjInventor() || - OBJ_TEXT != rObj.GetObjIdentifier()) + SdrObjKind::Text != rObj.GetObjIdentifier()) return false; SdrTextAniKind eTKind = static_cast<const SdrTextObj&>(rObj).GetTextAniKind(); return ( SdrTextAniKind::Scroll == eTKind diff --git a/sw/source/core/draw/dflyobj.cxx b/sw/source/core/draw/dflyobj.cxx index 5e945db1bd3e..dd8ee2dab586 100644 --- a/sw/source/core/draw/dflyobj.cxx +++ b/sw/source/core/draw/dflyobj.cxx @@ -141,7 +141,7 @@ SdrInventor SwFlyDrawObj::GetObjInventor() const SdrObjKind SwFlyDrawObj::GetObjIdentifier() const { - return SwFlyDrawObjIdentifier; + return SdrObjKind::SwFlyDrawObjIdentifier; } // TODO: Need own primitive to get the FlyFrame paint working diff --git a/sw/source/core/draw/dobjfac.cxx b/sw/source/core/draw/dobjfac.cxx index fb08ba595984..818b870da72a 100644 --- a/sw/source/core/draw/dobjfac.cxx +++ b/sw/source/core/draw/dobjfac.cxx @@ -29,7 +29,7 @@ IMPL_STATIC_LINK( if ( aParams.nInventor == SdrInventor::Swg ) { // No switch, there's only one at the moment - OSL_ENSURE( aParams.nObjIdentifier == SwFlyDrawObjIdentifier, + OSL_ENSURE( aParams.nObjIdentifier == SdrObjKind::SwFlyDrawObjIdentifier, "Wrong inventor or identifier" ); return new SwFlyDrawObj(aParams.rSdrModel); } diff --git a/sw/source/core/frmedt/fecopy.cxx b/sw/source/core/frmedt/fecopy.cxx index adc55dbfe9d2..985e9907ee92 100644 --- a/sw/source/core/frmedt/fecopy.cxx +++ b/sw/source/core/frmedt/fecopy.cxx @@ -1530,7 +1530,7 @@ void SwFEShell::Paste( SvStream& rStrm, SwPasteSdr nAction, const Point* pPt ) pObj->ImpSetAnchorPos( aNull ); } - pView->SetCurrentObj( OBJ_GRUP ); + pView->SetCurrentObj( SdrObjKind::Group ); if ( nCnt > 1 ) pView->GroupMarked(); SdrObject *pObj = pView->GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj(); diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx index e0212c28d57c..2e285cbe4dd0 100644 --- a/sw/source/core/frmedt/feshview.cxx +++ b/sw/source/core/frmedt/feshview.cxx @@ -1782,7 +1782,7 @@ bool SwFEShell::BeginCreate( SdrObjKind eSdrObjectKind, const Point &rPos ) if ( GetPageNumber( rPos ) ) { Imp()->GetDrawView()->SetCurrentObj( eSdrObjectKind ); - if ( eSdrObjectKind == OBJ_CAPTION ) + if ( eSdrObjectKind == SdrObjKind::Caption ) bRet = Imp()->GetDrawView()->BegCreateCaptionObj( rPos, Size( lMinBorder - MINFLY, lMinBorder - MINFLY ), GetOut() ); @@ -1886,12 +1886,6 @@ bool SwFEShell::ImpEndCreate() const tools::Rectangle &rBound = rSdrObj.GetSnapRect(); Point aPt( rBound.TopRight() ); - // alien identifier should end up on defaults - // duplications possible!! - sal_uInt16 nIdent = SdrInventor::Default == rSdrObj.GetObjInventor() - ? rSdrObj.GetObjIdentifier() - : 0xFFFF; - // default for controls character bound, otherwise paragraph bound. SwFormatAnchor aAnch; const SwFrame *pAnch = nullptr; @@ -1943,7 +1937,7 @@ bool SwFEShell::ImpEndCreate() // of <nIdent> - value <0xFFFF> indicates control objects, which aren't // allowed in header/footer. //bool bBodyOnly = OBJ_NONE != nIdent; - bool bBodyOnly = 0xFFFF == nIdent; + bool bBodyOnly = SdrInventor::Default != rSdrObj.GetObjInventor(); bool bAtPage = false; const SwFrame* pPage = nullptr; SwCursorMoveState aState( CursorMoveState::SetOnlyText ); @@ -2065,7 +2059,7 @@ bool SwFEShell::ImpEndCreate() } } - if( OBJ_NONE == nIdent ) + if( SdrInventor::Default == rSdrObj.GetObjInventor() && rSdrObj.GetObjIdentifier() == SdrObjKind::NONE ) { // For OBJ_NONE a fly is inserted. const tools::Long nWidth = rBound.Right() - rBound.Left(); @@ -3034,7 +3028,7 @@ void SwFEShell::CreateDefaultShape( SdrObjKind eSdrObjectKind, const tools::Rect if(pObj) { tools::Rectangle aRect(rRect); - if(OBJ_CARC == eSdrObjectKind || OBJ_CCUT == eSdrObjectKind) + if(SdrObjKind::CircleArc == eSdrObjectKind || SdrObjKind::CircleCut == eSdrObjectKind) { // force quadratic if(aRect.GetWidth() > aRect.GetHeight()) @@ -3068,8 +3062,8 @@ void SwFEShell::CreateDefaultShape( SdrObjKind eSdrObjectKind, const tools::Rect switch(eSdrObjectKind) { - case OBJ_PATHLINE: - case OBJ_PATHFILL: + case SdrObjKind::PathLine: + case SdrObjKind::PathFill: { basegfx::B2DPolygon aInnerPoly; @@ -3091,8 +3085,8 @@ void SwFEShell::CreateDefaultShape( SdrObjKind eSdrObjectKind, const tools::Rect aPoly.append(aInnerPoly); } break; - case OBJ_FREELINE: - case OBJ_FREEFILL: + case SdrObjKind::FreehandLine: + case SdrObjKind::FreehandFill: { basegfx::B2DPolygon aInnerPoly; @@ -3113,8 +3107,8 @@ void SwFEShell::CreateDefaultShape( SdrObjKind eSdrObjectKind, const tools::Rect aPoly.append(aInnerPoly); } break; - case OBJ_POLY: - case OBJ_PLIN: + case SdrObjKind::Polygon: + case SdrObjKind::PolyLine: { basegfx::B2DPolygon aInnerPoly; sal_Int32 nWdt(aRect.GetWidth()); @@ -3129,7 +3123,7 @@ void SwFEShell::CreateDefaultShape( SdrObjKind eSdrObjectKind, const tools::Rect aInnerPoly.append(basegfx::B2DPoint(aRect.Left() + (nWdt * 80) / 100, aRect.Top() + (nHgt * 75) / 100)); aInnerPoly.append(basegfx::B2DPoint(aRect.Bottom(), aRect.Right())); - if(OBJ_PLIN == eSdrObjectKind) + if(SdrObjKind::PolyLine == eSdrObjectKind) { aInnerPoly.append(basegfx::B2DPoint(aRect.Center().getX(), aRect.Bottom())); } @@ -3141,7 +3135,7 @@ void SwFEShell::CreateDefaultShape( SdrObjKind eSdrObjectKind, const tools::Rect aPoly.append(aInnerPoly); } break; - case OBJ_LINE : + case SdrObjKind::Line : { sal_Int32 nYMiddle((aRect.Top() + aRect.Bottom()) / 2); basegfx::B2DPolygon aTempPoly; diff --git a/sw/source/filter/html/htmldrawreader.cxx b/sw/source/filter/html/htmldrawreader.cxx index 2839a2febe4d..a6f42fc7f42c 100644 --- a/sw/source/filter/html/htmldrawreader.cxx +++ b/sw/source/filter/html/htmldrawreader.cxx @@ -352,7 +352,7 @@ void SwHTMLParser::NewMarquee( HTMLTable *pCurTable ) m_pMarquee = SdrObjFactory::MakeNewObject( *pModel, SdrInventor::Default, - OBJ_TEXT); + SdrObjKind::Text); if( !m_pMarquee ) return; @@ -525,7 +525,7 @@ void SwHTMLParser::NewMarquee( HTMLTable *pCurTable ) void SwHTMLParser::EndMarquee() { - OSL_ENSURE( m_pMarquee && OBJ_TEXT==m_pMarquee->GetObjIdentifier(), + OSL_ENSURE( m_pMarquee && SdrObjKind::Text==m_pMarquee->GetObjIdentifier(), "no marquee or wrong type" ); if( m_bFixMarqueeWidth ) @@ -553,7 +553,7 @@ void SwHTMLParser::EndMarquee() void SwHTMLParser::InsertMarqueeText() { - OSL_ENSURE( m_pMarquee && OBJ_TEXT==m_pMarquee->GetObjIdentifier(), + OSL_ENSURE( m_pMarquee && SdrObjKind::Text==m_pMarquee->GetObjIdentifier(), "no marquee or wrong type" ); // append the current text part to the text @@ -562,10 +562,10 @@ void SwHTMLParser::InsertMarqueeText() void SwHTMLParser::ResizeDrawObject( SdrObject* pObj, SwTwips nWidth ) { - OSL_ENSURE( OBJ_TEXT==pObj->GetObjIdentifier(), + OSL_ENSURE( SdrObjKind::Text==pObj->GetObjIdentifier(), "no marquee or wrong type" ); - if( OBJ_TEXT!=pObj->GetObjIdentifier() ) + if( SdrObjKind::Text!=pObj->GetObjIdentifier() ) return; // the old size diff --git a/sw/source/filter/ww8/docxsdrexport.cxx b/sw/source/filter/ww8/docxsdrexport.cxx index 7166ed49565f..4541714fdf00 100644 --- a/sw/source/filter/ww8/docxsdrexport.cxx +++ b/sw/source/filter/ww8/docxsdrexport.cxx @@ -144,11 +144,11 @@ bool lcl_IsRotateAngleValid(const SdrObject& rObj) // have been incorporated. switch (rObj.GetObjIdentifier()) { - case OBJ_GRUP: - case OBJ_LINE: - case OBJ_PLIN: - case OBJ_PATHLINE: - case OBJ_PATHFILL: + case SdrObjKind::Group: + case SdrObjKind::Line: + case SdrObjKind::PolyLine: + case SdrObjKind::PathLine: + case SdrObjKind::PathFill: return false; default: return true; @@ -302,7 +302,7 @@ tools::Polygon lcl_CreateContourPolygon(SdrObject* pSdrObj) basegfx::B2DPolyPolygon aPolyPolygon; switch (pSdrObj->GetObjIdentifier()) { - case OBJ_CUSTOMSHAPE: + case SdrObjKind::CustomShape: { // EnhancedCustomShapeEngine::GetLineGeometry() is not directly usable, because the wrap // polygon acts on the untransformed shape in Word. We do here similar as in @@ -371,19 +371,19 @@ tools::Polygon lcl_CreateContourPolygon(SdrObject* pSdrObj) aPolyPolygon.transform(aTranslateToCenter); break; } // end case OBJ_CUSTOMSHAPE - case OBJ_LINE: + case SdrObjKind::Line: { aContour.Insert(0, Point(0, 0)); aContour.Insert(1, Point(21600, 21600)); aContour.Insert(2, Point(0, 0)); return aContour; } - case OBJ_PATHFILL: - case OBJ_PATHLINE: - case OBJ_FREEFILL: - case OBJ_FREELINE: - case OBJ_PATHPOLY: - case OBJ_PATHPLIN: + case SdrObjKind::PathFill: + case SdrObjKind::PathLine: + case SdrObjKind::FreehandFill: + case SdrObjKind::FreehandLine: + case SdrObjKind::PathPoly: + case SdrObjKind::PathPolyLine: // case OBJ_POLY: FixMe: Creating wrap polygon would work, but export to DML is currently // case OBJ_PLIN: disabled for unknown reason; related bug 75254. { @@ -424,7 +424,7 @@ tools::Polygon lcl_CreateContourPolygon(SdrObject* pSdrObj) aPolyPolygon.transform(aTranslateToCenter); break; } - case OBJ_NONE: + case SdrObjKind::NONE: default: break; } @@ -736,7 +736,7 @@ void DocxSdrExport::startDMLAnchorInline(const SwFrameFormat* pFrameFormat, cons sal_Int32 nTopExt(0); sal_Int32 nBottomExt(0); - if ((!pObj) || (pObj && (pObj->GetObjIdentifier() == SwFlyDrawObjIdentifier))) + if ((!pObj) || (pObj && (pObj->GetObjIdentifier() == SdrObjKind::SwFlyDrawObjIdentifier))) { // Frame objects have a restricted shadow and no further effects. They have border instead of // stroke. LO includes shadow and border in the object size, but Word not. @@ -804,7 +804,8 @@ void DocxSdrExport::startDMLAnchorInline(const SwFrameFormat* pFrameFormat, cons { // Word 2007 makes no width-height-swap for images. Detect this situation. sal_Int32 nMode = m_pImpl->getExport().getWordCompatibilityModeFromGrabBag(); - bool bIsWord2007Image(nMode > 0 && nMode < 14 && pObj->GetObjIdentifier() == OBJ_GRAF); + bool bIsWord2007Image(nMode > 0 && nMode < 14 + && pObj->GetObjIdentifier() == SdrObjKind::Graphic); // Word cannot handle negative EffectExtent although allowed in OOXML, the 'dist' attributes // may not be negative. Take care of that. @@ -926,7 +927,7 @@ void DocxSdrExport::startDMLAnchorInline(const SwFrameFormat* pFrameFormat, cons aPos.X += nPosXDiff; // Make the postponed position move of frames. aPos.Y += nPosYDiff; if (pObj && lcl_IsRotateAngleValid(*pObj) - && pObj->GetObjIdentifier() != SwFlyDrawObjIdentifier) + && pObj->GetObjIdentifier() != SdrObjKind::SwFlyDrawObjIdentifier) lclMovePositionWithRotation(aPos, rSize, pObj->GetRotateAngle()); const char* relativeFromH; diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx index 69528309fdd2..60c8e9f4c352 100644 --- a/sw/source/filter/ww8/wrtw8esh.cxx +++ b/sw/source/filter/ww8/wrtw8esh.cxx @@ -680,7 +680,7 @@ void PlcDrawObj::WritePlc( WW8Export& rWrt ) const // rotating to vertical means swapping height and width as seen in SvxMSDffManager::ImportShape const Degree100 nAngle = NormAngle36000( pObj->GetRotateAngle() ); - const bool bAllowSwap = pObj->GetObjIdentifier() != OBJ_LINE && pObj->GetObjIdentifier() != OBJ_GRUP; + const bool bAllowSwap = pObj->GetObjIdentifier() != SdrObjKind::Line && pObj->GetObjIdentifier() != SdrObjKind::Group; if ( bAllowSwap && (( nAngle > 4500_deg100 && nAngle <= 13500_deg100 ) || ( nAngle > 22500_deg100 && nAngle <= 31500_deg100 )) ) { const tools::Long nWidth = aRect.getWidth(); diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx index edd44eb3cfd5..c4f3bf269ce9 100644 --- a/sw/source/filter/ww8/ww8graf.cxx +++ b/sw/source/filter/ww8/ww8graf.cxx @@ -332,7 +332,7 @@ SdrObject* SwWW8ImplReader::ReadLine(WW8_DPHEAD const * pHd, SfxAllItemSet &rSet aPolygon.append(::basegfx::B2DPoint(aP[1].X(), aP[1].Y())); SdrObject* pObj = new SdrPathObj( *m_pDrawModel, - OBJ_LINE, + SdrObjKind::Line, ::basegfx::B2DPolyPolygon(aPolygon)); SetStdAttr( rSet, aLine.aLnt, aLine.aShd ); @@ -454,7 +454,7 @@ SdrObject* SwWW8ImplReader::ReadPolyLine(WW8_DPHEAD const * pHd, SfxAllItemSet & SdrObject* pObj = new SdrPathObj( *m_pDrawModel, - (SVBT16ToUInt16(aPoly.aBits1) & 0x1) ? OBJ_POLY : OBJ_PLIN, + (SVBT16ToUInt16(aPoly.aBits1) & 0x1) ? SdrObjKind::Polygon : SdrObjKind::PolyLine, ::basegfx::B2DPolyPolygon(aP.getB2DPolygon())); SetStdAttr( rSet, aPoly.aLnt, aPoly.aShd ); @@ -1255,7 +1255,7 @@ SdrObject* SwWW8ImplReader::ReadTextBox(WW8_DPHEAD const * pHd, SfxAllItemSet &r SdrRectObj* pObj = new SdrRectObj( *m_pDrawModel, - OBJ_TEXT, + SdrObjKind::Text, tools::Rectangle(aP0, aP1)); pObj->NbcSetSnapRect(tools::Rectangle(aP0, aP1)); @@ -2605,11 +2605,11 @@ SwFrameFormat* SwWW8ImplReader::Read_GrafLayer( tools::Long nGrafAnchorCp ) switch (pObject->GetObjIdentifier()) { - case OBJ_GRAF: + case SdrObjKind::Graphic: bReplaceable = true; bDone = true; break; - case OBJ_OLE2: + case SdrObjKind::OLE2: bReplaceable = true; break; default: @@ -2886,7 +2886,7 @@ SwFrameFormat* SwWW8ImplReader::MungeTextIntoDrawBox(SvxMSDffImportRec& rRecord, // the group for holding the text. pSdrTextObj = new SdrRectObj( *m_pDrawModel, - OBJ_TEXT, + SdrObjKind::Text, pThisGroup->GetCurrentBoundRect()); SfxItemSet aSet(m_pDrawModel->GetItemPool()); @@ -3120,7 +3120,7 @@ SwFlyFrameFormat* SwWW8ImplReader::ImportReplaceableDrawables(SdrObject* &rpObje MatchEscherMirrorIntoFlySet(rRecord, aGrSet); OUString aObjectName(rpObject->GetName()); - if (OBJ_OLE2 == rpObject->GetObjIdentifier()) + if (SdrObjKind::OLE2 == rpObject->GetObjIdentifier()) pRetFrameFormat = InsertOle(*static_cast<SdrOle2Obj*>(rpObject), rFlySet, &aGrSet); else { @@ -3155,7 +3155,7 @@ SwFlyFrameFormat* SwWW8ImplReader::ImportReplaceableDrawables(SdrObject* &rpObje if (pRetFrameFormat) { - if (OBJ_OLE2 != rpObject->GetObjIdentifier()) + if (SdrObjKind::OLE2 != rpObject->GetObjIdentifier()) SetAttributesAtGrfNode(rRecord, *pRetFrameFormat, &rF); // avoid multiple occurrences of the same graphic name m_aGrfNameGenerator.SetUniqueGraphName(pRetFrameFormat, aObjectName); diff --git a/sw/source/filter/ww8/ww8graf2.cxx b/sw/source/filter/ww8/ww8graf2.cxx index 8de703570f9f..5ec3a93a5059 100644 --- a/sw/source/filter/ww8/ww8graf2.cxx +++ b/sw/source/filter/ww8/ww8graf2.cxx @@ -652,7 +652,7 @@ SwFrameFormat* SwWW8ImplReader::ImportGraf(SdrTextObj const * pTextObj, ReplaceObj(*pTextObj, *pObject); else { - if (sal_uInt16(OBJ_OLE2) == pObject->GetObjIdentifier()) + if (SdrObjKind::OLE2 == pObject->GetObjIdentifier()) { // the size from BLIP, if there is any, should be already set pRet = InsertOle(*static_cast<SdrOle2Obj*>(pObject), aAttrSet, &aGrSet); diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index be454d9e8ce2..ba06e730a70d 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -784,7 +784,7 @@ SdrObject* SwMSDffManager::ProcessObj(SvStream& rSt, SdrObject::Free( pObj ); pObj = new SdrRectObj( *pSdrModel, - OBJ_TEXT, + SdrObjKind::Text, rTextRect); } diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx index 5b765f4f7816..91b4d970f5ad 100644 --- a/sw/source/uibase/docvw/edtwin.cxx +++ b/sw/source/uibase/docvw/edtwin.cxx @@ -719,7 +719,7 @@ inline void SwEditWin::EnterArea() */ void SwEditWin::InsFrame(sal_uInt16 nCols) { - StdDrawMode( OBJ_NONE, false ); + StdDrawMode( SdrObjKind::NONE, false ); m_bInsFrame = true; m_nInsFrameColCount = nCols; } @@ -4537,7 +4537,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt) { rSh.EnterSelFrameMode(); if (!m_rView.GetDrawFuncPtr()) - StdDrawMode( OBJ_NONE, true ); + StdDrawMode( SdrObjKind::NONE, true ); } else if ( rSh.IsFrameSelected() ) { @@ -5157,7 +5157,7 @@ SwEditWin::SwEditWin(vcl::Window *pParent, SwView &rMyView): m_eBezierMode(SID_BEZIER_INSERT), m_nInsFrameColCount( 1 ), - m_eDrawMode(OBJ_NONE), + m_eDrawMode(SdrObjKind::NONE), m_bMBPressed(false), m_bInsDraw(false), diff --git a/sw/source/uibase/ribbar/conarc.cxx b/sw/source/uibase/ribbar/conarc.cxx index 8be117f13c99..4e55dc59ce1f 100644 --- a/sw/source/uibase/ribbar/conarc.cxx +++ b/sw/source/uibase/ribbar/conarc.cxx @@ -75,16 +75,16 @@ void ConstArc::Activate(const sal_uInt16 nSlotId) switch (nSlotId) { case SID_DRAW_ARC: - m_pWin->SetSdrDrawMode(OBJ_CARC); + m_pWin->SetSdrDrawMode(SdrObjKind::CircleArc); break; case SID_DRAW_PIE: - m_pWin->SetSdrDrawMode(OBJ_SECT); + m_pWin->SetSdrDrawMode(SdrObjKind::CircleSection); break; case SID_DRAW_CIRCLECUT: - m_pWin->SetSdrDrawMode(OBJ_CCUT); + m_pWin->SetSdrDrawMode(SdrObjKind::CircleCut); break; default: - m_pWin->SetSdrDrawMode(OBJ_NONE); + m_pWin->SetSdrDrawMode(SdrObjKind::NONE); break; } diff --git a/sw/source/uibase/ribbar/concustomshape.cxx b/sw/source/uibase/ribbar/concustomshape.cxx index a38f5584f3f7..da15182d17f0 100644 --- a/sw/source/uibase/ribbar/concustomshape.cxx +++ b/sw/source/uibase/ribbar/concustomshape.cxx @@ -91,7 +91,7 @@ bool ConstCustomShape::MouseButtonDown(const MouseEvent& rMEvt) void ConstCustomShape::Activate(const sal_uInt16 nSlotId) { - m_pWin->SetSdrDrawMode( OBJ_CUSTOMSHAPE ); + m_pWin->SetSdrDrawMode( SdrObjKind::CustomShape ); SwDrawBase::Activate(nSlotId); } diff --git a/sw/source/uibase/ribbar/conpoly.cxx b/sw/source/uibase/ribbar/conpoly.cxx index 481722734702..c4a245fda8af 100644 --- a/sw/source/uibase/ribbar/conpoly.cxx +++ b/sw/source/uibase/ribbar/conpoly.cxx @@ -38,8 +38,8 @@ bool ConstPolygon::MouseButtonUp(const MouseEvent& rMEvt) if (m_pSh->IsDrawCreate()) { if (rMEvt.IsLeft() && rMEvt.GetClicks() == 1 && - m_pWin->GetSdrDrawMode() != OBJ_FREELINE && - m_pWin->GetSdrDrawMode() != OBJ_FREEFILL) + m_pWin->GetSdrDrawMode() != SdrObjKind::FreehandLine && + m_pWin->GetSdrDrawMode() != SdrObjKind::FreehandFill) { if (!m_pSh->EndCreate(SdrCreateCmd::NextPoint)) { @@ -69,28 +69,28 @@ void ConstPolygon::Activate(const sal_uInt16 nSlotId) { case SID_DRAW_POLYGON_NOFILL: case SID_DRAW_XPOLYGON_NOFILL: - m_pWin->SetSdrDrawMode(OBJ_PLIN); + m_pWin->SetSdrDrawMode(SdrObjKind::PolyLine); break; case SID_DRAW_POLYGON: case SID_DRAW_XPOLYGON: - m_pWin->SetSdrDrawMode(OBJ_POLY); + m_pWin->SetSdrDrawMode(SdrObjKind::Polygon); break; case SID_DRAW_BEZIER_NOFILL: - m_pWin->SetSdrDrawMode(OBJ_PATHLINE); + m_pWin->SetSdrDrawMode(SdrObjKind::PathLine); break; case SID_DRAW_BEZIER_FILL: - m_pWin->SetSdrDrawMode(OBJ_PATHFILL); + m_pWin->SetSdrDrawMode(SdrObjKind::PathFill); break; case SID_DRAW_FREELINE_NOFILL: - m_pWin->SetSdrDrawMode(OBJ_FREELINE); + m_pWin->SetSdrDrawMode(SdrObjKind::FreehandLine); break; case SID_DRAW_FREELINE: - m_pWin->SetSdrDrawMode(OBJ_FREEFILL); + m_pWin->SetSdrDrawMode(SdrObjKind::FreehandFill); break; default: diff --git a/sw/source/uibase/ribbar/conrect.cxx b/sw/source/uibase/ribbar/conrect.cxx index 59630eef8389..589db379e660 100644 --- a/sw/source/uibase/ribbar/conrect.cxx +++ b/sw/source/uibase/ribbar/conrect.cxx @@ -50,7 +50,7 @@ bool ConstRectangle::MouseButtonDown(const MouseEvent& rMEvt) if (bReturn) { - if (m_pWin->GetSdrDrawMode() == OBJ_CAPTION) + if (m_pWin->GetSdrDrawMode() == SdrObjKind::Caption) { m_pView->NoRotate(); if (m_pView->IsDrawSelMode()) @@ -85,7 +85,7 @@ bool ConstRectangle::MouseButtonUp(const MouseEvent& rMEvt) : nullptr; switch( m_pWin->GetSdrDrawMode() ) { - case OBJ_TEXT: + case SdrObjKind::Text: if( bMarquee ) { m_pSh->ChgAnchor(RndStdIds::FLY_AS_CHAR); @@ -133,7 +133,7 @@ bool ConstRectangle::MouseButtonUp(const MouseEvent& rMEvt) m_pSh->GetView().GetViewFrame()->GetBindings().Invalidate(SID_INSERT_DRAW); break; - case OBJ_CAPTION: + case SdrObjKind::Caption: { SdrCaptionObj* pCaptObj = dynamic_cast<SdrCaptionObj*>(pObj); if( bCapVertical && pCaptObj ) @@ -167,44 +167,44 @@ void ConstRectangle::Activate(const sal_uInt16 nSlotId) case SID_LINE_ARROWS: case SID_DRAW_LINE: case SID_DRAW_XLINE: - m_pWin->SetSdrDrawMode(OBJ_LINE); + m_pWin->SetSdrDrawMode(SdrObjKind::Line); break; case SID_DRAW_MEASURELINE: - m_pWin->SetSdrDrawMode(OBJ_MEASURE); + m_pWin->SetSdrDrawMode(SdrObjKind::Measure); break; case SID_DRAW_RECT: - m_pWin->SetSdrDrawMode(OBJ_RECT); + m_pWin->SetSdrDrawMode(SdrObjKind::Rectangle); break; case SID_DRAW_ELLIPSE: - m_pWin->SetSdrDrawMode(OBJ_CIRC); + m_pWin->SetSdrDrawMode(SdrObjKind::CircleOrEllipse); break; case SID_DRAW_TEXT_MARQUEE: bMarquee = true; - m_pWin->SetSdrDrawMode(OBJ_TEXT); + m_pWin->SetSdrDrawMode(SdrObjKind::Text); break; case SID_DRAW_TEXT_VERTICAL: mbVertical = true; - m_pWin->SetSdrDrawMode(OBJ_TEXT); + m_pWin->SetSdrDrawMode(SdrObjKind::Text); break; case SID_DRAW_TEXT: - m_pWin->SetSdrDrawMode(OBJ_TEXT); + m_pWin->SetSdrDrawMode(SdrObjKind::Text); break; case SID_DRAW_CAPTION_VERTICAL: bCapVertical = true; [[fallthrough]]; case SID_DRAW_CAPTION: - m_pWin->SetSdrDrawMode(OBJ_CAPTION); + m_pWin->SetSdrDrawMode(SdrObjKind::Caption); break; default: - m_pWin->SetSdrDrawMode(OBJ_NONE); + m_pWin->SetSdrDrawMode(SdrObjKind::NONE); break; } diff --git a/sw/source/uibase/ribbar/drawbase.cxx b/sw/source/uibase/ribbar/drawbase.cxx index 2072ee25a12b..b88c964aa7f2 100644 --- a/sw/source/uibase/ribbar/drawbase.cxx +++ b/sw/source/uibase/ribbar/drawbase.cxx @@ -248,12 +248,12 @@ bool SwDrawBase::MouseButtonUp(const MouseEvent& rMEvt) { const SdrObjKind nDrawMode = m_pWin->GetSdrDrawMode(); //objects with multiple point may end at the start position - bool bMultiPoint = OBJ_PLIN == nDrawMode || - OBJ_POLY == nDrawMode || - OBJ_PATHLINE == nDrawMode || - OBJ_PATHFILL == nDrawMode || - OBJ_FREELINE == nDrawMode || - OBJ_FREEFILL == nDrawMode; + bool bMultiPoint = SdrObjKind::PolyLine == nDrawMode || + SdrObjKind::Polygon == nDrawMode || + SdrObjKind::PathLine == nDrawMode || + SdrObjKind::PathFill == nDrawMode || + SdrObjKind::FreehandLine == nDrawMode || + SdrObjKind::FreehandFill == nDrawMode; if(rMEvt.IsRight() || (aPnt == m_aStartPos && !bMultiPoint)) { m_pSh->BreakCreate(); @@ -261,7 +261,7 @@ bool SwDrawBase::MouseButtonUp(const MouseEvent& rMEvt) } else { - if (OBJ_NONE == nDrawMode) + if (SdrObjKind::NONE == nDrawMode) { SwRewriter aRewriter; @@ -270,7 +270,7 @@ bool SwDrawBase::MouseButtonUp(const MouseEvent& rMEvt) } m_pSh->EndCreate(SdrCreateCmd::ForceEnd); - if (OBJ_NONE == nDrawMode) // Text border inserted + if (SdrObjKind::NONE == nDrawMode) // Text border inserted { uno::Reference< frame::XDispatchRecorder > xRecorder = m_pSh->GetView().GetViewFrame()->GetBindings().GetRecorder(); @@ -298,7 +298,7 @@ bool SwDrawBase::MouseButtonUp(const MouseEvent& rMEvt) m_pSh->SetFlyFrameAttr( aSet ); } } - if (m_pWin->GetSdrDrawMode() == OBJ_NONE) + if (m_pWin->GetSdrDrawMode() == SdrObjKind::NONE) { m_pSh->EndUndo(); } diff --git a/sw/source/uibase/ribbar/dselect.cxx b/sw/source/uibase/ribbar/dselect.cxx index 4758934a34e9..205cb81fa5f5 100644 --- a/sw/source/uibase/ribbar/dselect.cxx +++ b/sw/source/uibase/ribbar/dselect.cxx @@ -34,7 +34,7 @@ DrawSelection::DrawSelection(SwWrtShell* pWrtShell, SwEditWin* pEditWin, SwView* void DrawSelection::Activate(const sal_uInt16 nSlotId) { - m_pWin->SetSdrDrawMode(OBJ_NONE); + m_pWin->SetSdrDrawMode(SdrObjKind::NONE); m_pWin->SetObjectSelect(true); SwDrawBase::Activate(nSlotId); diff --git a/sw/source/uibase/shells/drwbassh.cxx b/sw/source/uibase/shells/drwbassh.cxx index ff8579368812..dbc8aba00740 100644 --- a/sw/source/uibase/shells/drwbassh.cxx +++ b/sw/source/uibase/shells/drwbassh.cxx @@ -83,7 +83,7 @@ SwDrawBaseShell::SwDrawBaseShell(SwView &_rView) rWin.SetBezierMode(SID_BEZIER_MOVE); if ( !_rView.GetDrawFuncPtr() ) - _rView.GetEditWin().StdDrawMode( OBJ_NONE, true ); + _rView.GetEditWin().StdDrawMode( SdrObjKind::NONE, true ); SwTransferable::CreateSelection( GetShell() ); } @@ -184,7 +184,7 @@ void SwDrawBaseShell::Execute(SfxRequest const &rReq) if ( pSh->IsFlyInFly() ) nAllowedAnchors |= SvxAnchorIds::Fly; - if (pObj->GetObjIdentifier() == OBJ_CAPTION ) + if (pObj->GetObjIdentifier() == SdrObjKind::Caption ) bCaption = true; if (bCaption) @@ -861,23 +861,23 @@ void SwDrawBaseShell::GetState(SfxItemSet& rSet) const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList(); SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj(); - sal_uInt16 nObjType = pObj->GetObjIdentifier(); + SdrObjKind nObjType = pObj->GetObjIdentifier(); // Only enable hyperlink for the following types switch (nObjType) { - case OBJ_PATHFILL: - case OBJ_SECT: - case OBJ_LINE: - case OBJ_CUSTOMSHAPE: - case OBJ_TEXT: - case OBJ_RECT: - case OBJ_CAPTION: - case OBJ_POLY: - case OBJ_PLIN: - case E3D_SCENE_ID: - case OBJ_MEASURE: - case OBJ_EDGE: + case SdrObjKind::PathFill: + case SdrObjKind::CircleSection: + case SdrObjKind::Line: + case SdrObjKind::CustomShape: + case SdrObjKind::Text: + case SdrObjKind::Rectangle: + case SdrObjKind::Caption: + case SdrObjKind::Polygon: + case SdrObjKind::PolyLine: + case SdrObjKind::E3D_Scene: + case SdrObjKind::Measure: + case SdrObjKind::Edge: break; default: rSet.DisableItem(nWhich); @@ -954,18 +954,18 @@ void SwDrawBaseShell::DisableState( SfxItemSet& rSet ) for (size_t i = 0; i < nMarkCount && i < 50; ++i) { SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj(); - sal_uInt16 nObjType = pObj->GetObjIdentifier(); + SdrObjKind nObjType = pObj->GetObjIdentifier(); - if ( nObjType != OBJ_MEASURE ) + if ( nObjType != SdrObjKind::Measure ) bShowMeasure = false; // If marked object is 2D, disable format area command. - if ( nObjType == OBJ_PLIN || - nObjType == OBJ_LINE || - nObjType == OBJ_PATHLINE || - nObjType == OBJ_FREELINE || - nObjType == OBJ_EDGE || - nObjType == OBJ_CARC || + if ( nObjType == SdrObjKind::PolyLine || + nObjType == SdrObjKind::Line || + nObjType == SdrObjKind::PathLine || + nObjType == SdrObjKind::FreehandLine || + nObjType == SdrObjKind::Edge || + nObjType == SdrObjKind::CircleArc || bShowMeasure ) bShowArea = false; diff --git a/sw/source/uibase/shells/textdrw.cxx b/sw/source/uibase/shells/textdrw.cxx index b5b81e3f2228..881468c5d717 100644 --- a/sw/source/uibase/shells/textdrw.cxx +++ b/sw/source/uibase/shells/textdrw.cxx @@ -50,14 +50,14 @@ void SwBaseShell::InsertURLButton(const OUString& rURL, const OUString& rTarget, // OBJ_FM_BUTTON pSdrView->SetDesignMode(); - pSdrView->SetCurrentObj(OBJ_FM_BUTTON); + pSdrView->SetCurrentObj(SdrObjKind::FormButton); pSdrView->SetEditMode(false); Point aStartPos(rSh.GetCharRect().Pos() + Point(0, 1)); rSh.StartAction(); rSh.StartUndo( SwUndoId::UI_INSERT_URLBTN ); - if (rSh.BeginCreate(OBJ_FM_BUTTON, SdrInventor::FmForm, aStartPos)) + if (rSh.BeginCreate(SdrObjKind::FormButton, SdrInventor::FmForm, aStartPos)) { pSdrView->SetOrtho(false); Size aSz(GetView().GetEditWin().PixelToLogic(Size(140, 20))); diff --git a/sw/source/uibase/uiview/view.cxx b/sw/source/uibase/uiview/view.cxx index 094f3b92cad7..aa0a4738ee55 100644 --- a/sw/source/uibase/uiview/view.cxx +++ b/sw/source/uibase/uiview/view.cxx @@ -736,7 +736,7 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh ) m_nPageCnt(0), m_nDrawSfxId( USHRT_MAX ), m_nFormSfxId( USHRT_MAX ), - m_eFormObjKind(OBJ_NONE), + m_eFormObjKind(SdrObjKind::NONE), m_nLastPasteDestination( static_cast<SotExchangeDest>(0xFFFF) ), m_nLeftBorderDistance( 0 ), m_nRightBorderDistance( 0 ), diff --git a/sw/source/uibase/uiview/viewdraw.cxx b/sw/source/uibase/uiview/viewdraw.cxx index 5b5799123708..c0214b893f19 100644 --- a/sw/source/uibase/uiview/viewdraw.cxx +++ b/sw/source/uibase/uiview/viewdraw.cxx @@ -82,7 +82,7 @@ void SwView::ExecDraw(const SfxRequest& rReq) if(pArgs && SfxItemState::SET == pArgs->GetItemState(GetPool().GetWhich(nSlotId), false, &pItem)) pStringItem = dynamic_cast< const SfxStringItem*>(pItem); - SdrObjKind eNewFormObjKind = OBJ_NONE; + SdrObjKind eNewFormObjKind = SdrObjKind::NONE; if (nSlotId == SID_FM_CREATE_CONTROL) { const SfxUInt16Item* pIdentifierItem = rReq.GetArg<SfxUInt16Item>(SID_FM_CONTROL_IDENTIFIER); @@ -96,7 +96,7 @@ void SwView::ExecDraw(const SfxRequest& rReq) } else if (nSlotId == SID_FM_CREATE_CONTROL) { - if (eNewFormObjKind == m_eFormObjKind || eNewFormObjKind == OBJ_NONE) + if (eNewFormObjKind == m_eFormObjKind || eNewFormObjKind == SdrObjKind::NONE) { bDeselect = true; GetViewFrame()->GetDispatcher()->Execute(SID_FM_LEAVE_CREATE); // Button should popping out diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index 11fa8afc92ab..0be83743b438 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -4224,24 +4224,24 @@ IMPL_LINK(SwContentTree, KeyInputHdl, const KeyEvent&, rEvent, bool) bool bMark = pDrawView->IsObjMarked(pTemp); switch( pTemp->GetObjIdentifier() ) { - case OBJ_GRUP: - case OBJ_TEXT: - case OBJ_LINE: - case OBJ_RECT: - case OBJ_CIRC: - case OBJ_SECT: - case OBJ_CARC: - case OBJ_CCUT: - case OBJ_POLY: - case OBJ_PLIN: - case OBJ_PATHLINE: - case OBJ_PATHFILL: - case OBJ_FREELINE: - case OBJ_FREEFILL: - case OBJ_PATHPOLY: - case OBJ_PATHPLIN: - case OBJ_CAPTION: - case OBJ_CUSTOMSHAPE: + case SdrObjKind::Group: + case SdrObjKind::Text: + case SdrObjKind::Line: + case SdrObjKind::Rectangle: + case SdrObjKind::CircleOrEllipse: + case SdrObjKind::CircleSection: + case SdrObjKind::CircleArc: + case SdrObjKind::CircleCut: + case SdrObjKind::Polygon: + case SdrObjKind::PolyLine: + case SdrObjKind::PathLine: + case SdrObjKind::PathFill: + case SdrObjKind::FreehandLine: + case SdrObjKind::FreehandFill: + case SdrObjKind::PathPoly: + case SdrObjKind::PathPolyLine: + case SdrObjKind::Caption: + case SdrObjKind::CustomShape: if( bMark ) hasObjectMarked = true; break; |