diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-11-05 14:04:04 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-11-06 17:16:09 +0100 |
commit | de78304d92140901d19a6ea17bdc1d568df955c4 (patch) | |
tree | f0494ee90a4d7493e2381bbd17f5c1f337a35f0e | |
parent | 8c9b8c5970a08c2ef0ccddb7a691f3731d39175a (diff) |
make SdrObject Identifiers SdrObjKind enum members
with unique values so that, e.g.
if (pObj->GetObjIdentifier() == OBJ_LINE)
is only true if pObj is a SdrPathObj and not a E3dScene
Change-Id: I30c91e57eb27141390c644dec42e2a4bee96edf0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105374
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
146 files changed, 516 insertions, 531 deletions
diff --git a/basctl/source/basicide/baside3.cxx b/basctl/source/basicide/baside3.cxx index ab451f482a15..063828689a0f 100644 --- a/basctl/source/basicide/baside3.cxx +++ b/basctl/source/basicide/baside3.cxx @@ -391,7 +391,7 @@ void DialogWindow::GetState( SfxItemSet& rSet ) void DialogWindow::ExecuteCommand( SfxRequest& rReq ) { const sal_uInt16 nSlotId(rReq.GetSlot()); - sal_uInt16 nInsertObj(0); + SdrObjKind nInsertObj(OBJ_NONE); switch ( nSlotId ) { diff --git a/basctl/source/dlged/dlged.cxx b/basctl/source/dlged/dlged.cxx index b9da399830ac..533e2381f3e7 100644 --- a/basctl/source/dlged/dlged.cxx +++ b/basctl/source/dlged/dlged.cxx @@ -601,7 +601,7 @@ void DlgEditor::SetMode (Mode eNewMode ) } -void DlgEditor::SetInsertObj( sal_uInt16 eObj ) +void DlgEditor::SetInsertObj(SdrObjKind eObj) { eActObj = eObj; diff --git a/basctl/source/dlged/dlgedfac.cxx b/basctl/source/dlged/dlgedfac.cxx index 3063e7f29e00..38c8dc0d1a9c 100644 --- a/basctl/source/dlged/dlgedfac.cxx +++ b/basctl/source/dlged/dlgedfac.cxx @@ -221,6 +221,8 @@ IMPL_LINK( DlgEdFactory, MakeObject, SdrObjCreatorParams, aParams, SdrObject* ) case OBJ_DLG_HYPERLINKCONTROL: pNewObj = new DlgEdObj(aParams.rSdrModel, "com.sun.star.awt.UnoControlFixedHyperlinkModel", xDialogSFact ); break; + default: + break; } } diff --git a/basctl/source/dlged/dlgedobj.cxx b/basctl/source/dlged/dlgedobj.cxx index 360c5b4d2d58..056006c4305e 100644 --- a/basctl/source/dlged/dlgedobj.cxx +++ b/basctl/source/dlged/dlgedobj.cxx @@ -768,7 +768,7 @@ SdrInventor DlgEdObj::GetObjInventor() const return SdrInventor::BasicDialog; } -sal_uInt16 DlgEdObj::GetObjIdentifier() const +SdrObjKind DlgEdObj::GetObjIdentifier() const { if ( supportsService( "com.sun.star.awt.UnoControlDialogModel" )) { diff --git a/basctl/source/inc/dlged.hxx b/basctl/source/inc/dlged.hxx index 6b83c402959b..82d3a14f605d 100644 --- a/basctl/source/inc/dlged.hxx +++ b/basctl/source/inc/dlged.hxx @@ -27,6 +27,7 @@ #include <o3tl/deleter.hxx> #include <svl/SfxBroadcaster.hxx> #include <svl/hint.hxx> +#include <svx/svdobjkind.hxx> #include <tools/gen.hxx> #include <vcl/timer.hxx> #include <vcl/idle.hxx> @@ -123,7 +124,7 @@ private: std::unique_ptr<DlgEdFunc> pFunc; DialogWindowLayout& rLayout; Mode eMode; - sal_uInt16 eActObj; + SdrObjKind eActObj; bool bFirstDraw; bool bCreateOK; tools::Rectangle aPaintRect; @@ -184,7 +185,7 @@ public: bool KeyInput( const KeyEvent& rKEvt ); void SetMode (Mode eMode); - void SetInsertObj( sal_uInt16 eObj ); + void SetInsertObj(SdrObjKind eObj); void CreateDefaultObject(); Mode GetMode() const { return eMode; } bool IsCreateOK() const { return bCreateOK; } diff --git a/basctl/source/inc/dlgeddef.hxx b/basctl/source/inc/dlgeddef.hxx index c19c3db282e1..0cb0a6dc8573 100644 --- a/basctl/source/inc/dlgeddef.hxx +++ b/basctl/source/inc/dlgeddef.hxx @@ -19,48 +19,10 @@ #pragma once -namespace basctl -{ +#include <svx/svdobjkind.hxx> -enum +namespace basctl { - OBJ_DLG_CONTROL = 1, - OBJ_DLG_DIALOG = 2, - OBJ_DLG_PUSHBUTTON = 3, - OBJ_DLG_RADIOBUTTON = 4, - OBJ_DLG_CHECKBOX = 5, - OBJ_DLG_LISTBOX = 6, - OBJ_DLG_COMBOBOX = 7, - OBJ_DLG_GROUPBOX = 8, - OBJ_DLG_EDIT = 9, - OBJ_DLG_FIXEDTEXT = 10, - OBJ_DLG_IMAGECONTROL = 11, - OBJ_DLG_PROGRESSBAR = 12, - OBJ_DLG_HSCROLLBAR = 13, - OBJ_DLG_VSCROLLBAR = 14, - OBJ_DLG_HFIXEDLINE = 15, - OBJ_DLG_VFIXEDLINE = 16, - OBJ_DLG_DATEFIELD = 17, - OBJ_DLG_TIMEFIELD = 18, - OBJ_DLG_NUMERICFIELD = 19, - OBJ_DLG_CURRENCYFIELD = 20, - OBJ_DLG_FORMATTEDFIELD = 21, - OBJ_DLG_PATTERNFIELD = 22, - OBJ_DLG_FILECONTROL = 23, - OBJ_DLG_TREECONTROL = 24, - OBJ_DLG_SPINBUTTON = 25, - OBJ_DLG_GRIDCONTROL = 26, - OBJ_DLG_HYPERLINKCONTROL = 27, - - OBJ_DLG_FORMRADIO = 28, - OBJ_DLG_FORMCHECK = 29, - OBJ_DLG_FORMLIST = 30, - OBJ_DLG_FORMCOMBO = 31, - OBJ_DLG_FORMSPIN = 32, - OBJ_DLG_FORMVSCROLL = 33, - OBJ_DLG_FORMHSCROLL = 34, - -}; // control properties #define DLGED_PROP_BACKGROUNDCOLOR "BackgroundColor" diff --git a/basctl/source/inc/dlgedobj.hxx b/basctl/source/inc/dlgedobj.hxx index 37e5fc3209f3..8ae88ef5c80a 100644 --- a/basctl/source/inc/dlgedobj.hxx +++ b/basctl/source/inc/dlgedobj.hxx @@ -100,7 +100,7 @@ public: DlgEdForm* GetDlgEdForm() const { return pDlgEdForm; } virtual SdrInventor GetObjInventor() const override; - virtual sal_uInt16 GetObjIdentifier() const override; + virtual SdrObjKind GetObjIdentifier() const override; virtual DlgEdObj* CloneSdrObject(SdrModel& rTargetModel) const override; // not working yet void clonedFrom(const DlgEdObj* _pSource); // not working yet diff --git a/chart2/source/controller/main/ChartController_Window.cxx b/chart2/source/controller/main/ChartController_Window.cxx index c8c46ba7541f..51ebcbf9b567 100644 --- a/chart2/source/controller/main/ChartController_Window.cxx +++ b/chart2/source/controller/main/ChartController_Window.cxx @@ -1985,7 +1985,7 @@ void ChartController::impl_SetMousePointer( const MouseEvent & rEvent ) ( !m_pDrawViewWrapper->IsMarkedHit( aMousePos ) || !m_aSelection.isDragableObjectSelected() ) ) { PointerStyle ePointerStyle = PointerStyle::DrawRect; - SdrObjKind eKind = static_cast< SdrObjKind >( m_pDrawViewWrapper->GetCurrentObjIdentifier() ); + SdrObjKind eKind = m_pDrawViewWrapper->GetCurrentObjIdentifier(); switch ( eKind ) { case OBJ_LINE: diff --git a/chart2/source/controller/main/DrawCommandDispatch.cxx b/chart2/source/controller/main/DrawCommandDispatch.cxx index 00f5b2c51f73..5f2e1a73923d 100644 --- a/chart2/source/controller/main/DrawCommandDispatch.cxx +++ b/chart2/source/controller/main/DrawCommandDispatch.cxx @@ -347,7 +347,7 @@ void DrawCommandDispatch::execute( const OUString& rCommand, const Sequence< bea SolarMutexGuard aGuard; m_pChartController->setDrawMode( eDrawMode ); - setInsertObj( sal::static_int_cast< sal_uInt16 >( eKind ) ); + setInsertObj(eKind); if ( bCreate ) { pDrawViewWrapper->SetCreateMode(); @@ -397,7 +397,7 @@ void DrawCommandDispatch::describeSupportedFeatures() implDescribeSupportedFeature( ".uno:StarShapes", COMMAND_ID_DRAWTBX_CS_STAR, CommandGroup::INSERT ); } -void DrawCommandDispatch::setInsertObj( sal_uInt16 eObj ) +void DrawCommandDispatch::setInsertObj(SdrObjKind eObj) { DrawViewWrapper* pDrawViewWrapper = ( m_pChartController ? m_pChartController->GetDrawViewWrapper() : nullptr ); if ( pDrawViewWrapper ) diff --git a/chart2/source/controller/main/DrawCommandDispatch.hxx b/chart2/source/controller/main/DrawCommandDispatch.hxx index 121808d231b6..febfa8338d40 100644 --- a/chart2/source/controller/main/DrawCommandDispatch.hxx +++ b/chart2/source/controller/main/DrawCommandDispatch.hxx @@ -18,6 +18,7 @@ */ #pragma once +#include <svx/svdobjkind.hxx> #include "FeatureCommandDispatchBase.hxx" class SfxItemSet; @@ -58,7 +59,7 @@ protected: virtual void describeSupportedFeatures() override; private: - void setInsertObj( sal_uInt16 eObj ); + void setInsertObj(SdrObjKind eObj); SdrObject* createDefaultObject( const sal_uInt16 nID ); bool parseCommandURL( const OUString& rCommandURL, sal_uInt16* pnFeatureId, OUString* pBaseCommand, OUString* pCustomShapeType ); diff --git a/cui/source/tabpages/textanim.cxx b/cui/source/tabpages/textanim.cxx index e5239dede67e..a7ee4b3aade9 100644 --- a/cui/source/tabpages/textanim.cxx +++ b/cui/source/tabpages/textanim.cxx @@ -70,7 +70,7 @@ void SvxTextTabDialog::PageCreated(const OString& rId, SfxTabPage &rPage) if (rMarkList.GetMarkCount() == 1) { const SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj(); - eKind = static_cast<SdrObjKind>(pObj->GetObjIdentifier()); + eKind = pObj->GetObjIdentifier(); } } } diff --git a/cui/source/tabpages/transfrm.cxx b/cui/source/tabpages/transfrm.cxx index 42b17b553cc2..cec57ecbbbe7 100644 --- a/cui/source/tabpages/transfrm.cxx +++ b/cui/source/tabpages/transfrm.cxx @@ -860,7 +860,7 @@ void SvxPositionSizeTabPage::Construct() if(1 == rMarkList.GetMarkCount()) { const SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj(); - const SdrObjKind eKind(static_cast<SdrObjKind>(pObj->GetObjIdentifier())); + const SdrObjKind eKind(pObj->GetObjIdentifier()); if((pObj->GetObjInventor() == SdrInventor::Default) && (OBJ_TEXT == eKind || OBJ_TITLETEXT == eKind || OBJ_OUTLINETEXT == eKind) && diff --git a/include/svx/cube3d.hxx b/include/svx/cube3d.hxx index d9b660fa6e52..515e8331c044 100644 --- a/include/svx/cube3d.hxx +++ b/include/svx/cube3d.hxx @@ -67,7 +67,7 @@ public: const basegfx::B3DVector& r3DSize); E3dCubeObj(SdrModel& rSdrModel); - virtual sal_uInt16 GetObjIdentifier() const override; + virtual SdrObjKind GetObjIdentifier() const override; virtual SdrObjectUniquePtr DoConvertToPolyObj(bool bBezier, bool bAddText) const override; virtual E3dCubeObj* CloneSdrObject(SdrModel& rTargetModel) const override; diff --git a/include/svx/fmglob.hxx b/include/svx/fmglob.hxx deleted file mode 100644 index 35f3460f19a3..000000000000 --- a/include/svx/fmglob.hxx +++ /dev/null @@ -1,52 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_SVX_FMGLOB_HXX -#define INCLUDED_SVX_FMGLOB_HXX - -#include <com/sun/star/form/FormComponentType.hpp> - -const sal_uInt16 OBJ_FM_CONTROL = css::form::FormComponentType::CONTROL; - // for form components -const sal_uInt16 OBJ_FM_EDIT = css::form::FormComponentType::TEXTFIELD; -const sal_uInt16 OBJ_FM_BUTTON = css::form::FormComponentType::COMMANDBUTTON; -const sal_uInt16 OBJ_FM_FIXEDTEXT = css::form::FormComponentType::FIXEDTEXT; -const sal_uInt16 OBJ_FM_LISTBOX = css::form::FormComponentType::LISTBOX; -const sal_uInt16 OBJ_FM_CHECKBOX = css::form::FormComponentType::CHECKBOX; -const sal_uInt16 OBJ_FM_COMBOBOX = css::form::FormComponentType::COMBOBOX; -const sal_uInt16 OBJ_FM_RADIOBUTTON = css::form::FormComponentType::RADIOBUTTON; -const sal_uInt16 OBJ_FM_GROUPBOX = css::form::FormComponentType::GROUPBOX; -const sal_uInt16 OBJ_FM_GRID = css::form::FormComponentType::GRIDCONTROL; -const sal_uInt16 OBJ_FM_IMAGEBUTTON = css::form::FormComponentType::IMAGEBUTTON; -const sal_uInt16 OBJ_FM_FILECONTROL = css::form::FormComponentType::FILECONTROL; -const sal_uInt16 OBJ_FM_DATEFIELD = css::form::FormComponentType::DATEFIELD; -const sal_uInt16 OBJ_FM_TIMEFIELD = css::form::FormComponentType::TIMEFIELD; -const sal_uInt16 OBJ_FM_NUMERICFIELD = css::form::FormComponentType::NUMERICFIELD; -const sal_uInt16 OBJ_FM_CURRENCYFIELD = css::form::FormComponentType::CURRENCYFIELD; -const sal_uInt16 OBJ_FM_PATTERNFIELD = css::form::FormComponentType::PATTERNFIELD; -const sal_uInt16 OBJ_FM_HIDDEN = css::form::FormComponentType::HIDDENCONTROL; -const sal_uInt16 OBJ_FM_IMAGECONTROL = css::form::FormComponentType::IMAGECONTROL; -const sal_uInt16 OBJ_FM_FORMATTEDFIELD = css::form::FormComponentType::PATTERNFIELD + 1; -const sal_uInt16 OBJ_FM_SCROLLBAR = css::form::FormComponentType::PATTERNFIELD + 2; -const sal_uInt16 OBJ_FM_SPINBUTTON = css::form::FormComponentType::PATTERNFIELD + 3; -const sal_uInt16 OBJ_FM_NAVIGATIONBAR = css::form::FormComponentType::PATTERNFIELD + 4; - -#endif // _FM_FMGLOB_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/fmview.hxx b/include/svx/fmview.hxx index 00cecc94d8be..13c1ec711745 100644 --- a/include/svx/fmview.hxx +++ b/include/svx/fmview.hxx @@ -91,9 +91,9 @@ public: sal_Int32 _nYOffsetMM, const css::uno::Reference< css::beans::XPropertySet >& _rxField, const css::uno::Reference< css::util::XNumberFormats >& _rxNumberFormats, - sal_uInt16 _nControlObjectID, + SdrObjKind _nControlObjectID, SdrInventor _nInventor, - sal_uInt16 _nLabelObjectID, + SdrObjKind _nLabelObjectID, // tdf#118963 Need a SdrModel for SdrObject creation. To make the // demand clear, hand over a SdrMldel& diff --git a/include/svx/globl3d.hxx b/include/svx/globl3d.hxx deleted file mode 100644 index 2eed87268988..000000000000 --- a/include/svx/globl3d.hxx +++ /dev/null @@ -1,36 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_SVX_GLOBL3D_HXX -#define INCLUDED_SVX_GLOBL3D_HXX - -#include <sal/types.h> - -const sal_uInt16 E3D_SCENE_ID = 2; -const sal_uInt16 E3D_OBJECT_ID = 3; // should not be used, it's only a helper class for E3DScene and E3DCompoundObject -const sal_uInt16 E3D_CUBEOBJ_ID = 4; -const sal_uInt16 E3D_SPHEREOBJ_ID = 5; -const sal_uInt16 E3D_EXTRUDEOBJ_ID = 6; -const sal_uInt16 E3D_LATHEOBJ_ID = 7; -const sal_uInt16 E3D_COMPOUNDOBJ_ID = 8; -const sal_uInt16 E3D_POLYGONOBJ_ID = 9; - -#endif // INCLUDED_SVX_GLOBL3D_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/lathe3d.hxx b/include/svx/lathe3d.hxx index a14ae9a0ea6c..db2c868280ce 100644 --- a/include/svx/lathe3d.hxx +++ b/include/svx/lathe3d.hxx @@ -98,7 +98,7 @@ public: bool GetCloseBack() const { return GetObjectItemSet().Get(SDRATTR_3DOBJ_CLOSE_BACK).GetValue(); } - virtual sal_uInt16 GetObjIdentifier() const override; + virtual SdrObjKind GetObjIdentifier() const override; virtual E3dLatheObj* CloneSdrObject(SdrModel& rTargetModel) const override; diff --git a/include/svx/obj3d.hxx b/include/svx/obj3d.hxx index 5a51cc34c603..b9f43315d730 100644 --- a/include/svx/obj3d.hxx +++ b/include/svx/obj3d.hxx @@ -93,7 +93,7 @@ public: virtual void RecalcSnapRect() override; virtual SdrInventor GetObjInventor() const override; - virtual sal_uInt16 GetObjIdentifier() const override; + virtual SdrObjKind GetObjIdentifier() const override; virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const override; virtual void NbcMove(const Size& rSize) override; virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) override; @@ -176,7 +176,7 @@ public: virtual sal_uInt32 GetHdlCount() const override; virtual void AddToHdlList(SdrHdlList& rHdlList) const override; - virtual sal_uInt16 GetObjIdentifier() const override; + virtual SdrObjKind GetObjIdentifier() const override; virtual void RecalcSnapRect() override; virtual E3dCompoundObject* CloneSdrObject(SdrModel& rTargetModel) const override; diff --git a/include/svx/scene3d.hxx b/include/svx/scene3d.hxx index e3fb1b5c779c..3ff3a5562e44 100644 --- a/include/svx/scene3d.hxx +++ b/include/svx/scene3d.hxx @@ -114,7 +114,7 @@ public: // set flag to draw only selected void SetDrawOnlySelected(bool bNew) { bDrawOnlySelected = bNew; } bool GetDrawOnlySelected() const { return bDrawOnlySelected; } - virtual sal_uInt16 GetObjIdentifier() const override; + virtual SdrObjKind GetObjIdentifier() const override; virtual void NbcSetSnapRect(const tools::Rectangle& rRect) override; virtual void NbcMove(const Size& rSize) override; diff --git a/include/svx/sphere3d.hxx b/include/svx/sphere3d.hxx index 3bc2ab2f192c..0ee9bc0531b3 100644 --- a/include/svx/sphere3d.hxx +++ b/include/svx/sphere3d.hxx @@ -66,7 +66,7 @@ public: sal_uInt32 GetVerticalSegments() const { return GetObjectItemSet().Get(SDRATTR_3DOBJ_VERT_SEGS).GetValue(); } - virtual sal_uInt16 GetObjIdentifier() const override; + virtual SdrObjKind GetObjIdentifier() const override; virtual SdrObjectUniquePtr DoConvertToPolyObj(bool bBezier, bool bAddText) const override; virtual E3dSphereObj* CloneSdrObject(SdrModel& rTargetModel) const override; diff --git a/include/svx/svdcrtv.hxx b/include/svx/svdcrtv.hxx index 6868e7ba1cb2..253d1060aba9 100644 --- a/include/svx/svdcrtv.hxx +++ b/include/svx/svdcrtv.hxx @@ -50,7 +50,7 @@ protected: sal_Int32 nAutoCloseDistPix; sal_Int32 nFreeHandMinDistPix; SdrInventor nCurrentInvent; // set the current ones - sal_uInt16 nCurrentIdent; // Obj for re-creating + SdrObjKind nCurrentIdent; // Obj for re-creating bool b1stPointAsCenter : 1; bool bUseIncompatiblePathCreateInterface : 1; @@ -58,7 +58,7 @@ protected: void ImpClearConnectMarker(); protected: - bool ImpBegCreateObj(SdrInventor nInvent, sal_uInt16 nIdent, const Point& rPnt, OutputDevice* pOut, + bool ImpBegCreateObj(SdrInventor nInvent, SdrObjKind nIdent, const Point& rPnt, OutputDevice* pOut, sal_Int16 nMinMov, const tools::Rectangle& rLogRect, SdrObject* pPreparedFactoryObject); void ShowCreateObj(/*OutputDevice* pOut, bool bFull*/); @@ -100,10 +100,10 @@ public: // Determine whether a measurement tool activated bool IsMeasureTool() const; - void SetCurrentObj(sal_uInt16 nIdent, SdrInventor nInvent=SdrInventor::Default); - void TakeCurrentObj(sal_uInt16& nIdent, SdrInventor& nInvent) const { nInvent=nCurrentInvent; nIdent=nCurrentIdent; } + void SetCurrentObj(SdrObjKind nIdent, SdrInventor nInvent=SdrInventor::Default); + void TakeCurrentObj(SdrObjKind& nIdent, SdrInventor& nInvent) const { nInvent=nCurrentInvent; nIdent=nCurrentIdent; } SdrInventor GetCurrentObjInventor() const { return nCurrentInvent; } - sal_uInt16 GetCurrentObjIdentifier() const { return nCurrentIdent; } + SdrObjKind GetCurrentObjIdentifier() const { return nCurrentIdent; } // Beginning the regular Create bool BegCreateObj(const Point& rPnt, OutputDevice* pOut=nullptr, short nMinMov=-3); diff --git a/include/svx/svdoashp.hxx b/include/svx/svdoashp.hxx index 040302faa4c0..2014e0998c2d 100644 --- a/include/svx/svdoashp.hxx +++ b/include/svx/svdoashp.hxx @@ -164,7 +164,7 @@ public: }; bool IsDefaultGeometry( const DefaultType eDefaultType ) const; - virtual sal_uInt16 GetObjIdentifier() const override; + virtual SdrObjKind GetObjIdentifier() const override; virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const override; virtual void Move(const Size& rSiz) override; diff --git a/include/svx/svdobj.hxx b/include/svx/svdobj.hxx index bb09c6856d3e..bd528c9fe4cb 100644 --- a/include/svx/svdobj.hxx +++ b/include/svx/svdobj.hxx @@ -30,6 +30,7 @@ #include <svl/typedwhich.hxx> #include <svx/DiagramDataInterface.hxx> #include <svx/svdtypes.hxx> +#include <svx/svdobjkind.hxx> #include <svx/svxdllapi.h> #include <svx/shapeproperty.hxx> #include <tools/link.hxx> @@ -114,42 +115,6 @@ struct SVXCORE_DLLPUBLIC SdrObjectFreeOp; // deleter is needed - here, SdrObject::Free needs to be used. typedef std::unique_ptr< SdrObject, SdrObjectFreeOp > SdrObjectUniquePtr; -enum SdrObjKind { - 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 - OBJ_MAXI -}; - enum class SdrInventor : sal_uInt32 { Unknown = 0, BasicDialog = sal_uInt32( 'D' | ('L' << 8) | ('G' << 16) | ('1' << 24) ), @@ -410,7 +375,7 @@ public: void AddReference(SdrVirtObj& rVrtObj); void DelReference(SdrVirtObj& rVrtObj); virtual SdrInventor GetObjInventor() const; - virtual sal_uInt16 GetObjIdentifier() const; + virtual SdrObjKind GetObjIdentifier() const; virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const; // Layer interface @@ -1048,7 +1013,7 @@ struct SVXCORE_DLLPUBLIC SdrObjectFreeOp struct SdrObjCreatorParams { SdrInventor nInventor; - sal_uInt16 nObjIdentifier; + SdrObjKind nObjIdentifier; SdrModel& rSdrModel; }; @@ -1066,7 +1031,7 @@ public: static SdrObject* MakeNewObject( SdrModel& rSdrModel, SdrInventor nInventor, - sal_uInt16 nObjIdentifier, + SdrObjKind nObjIdentifier, const tools::Rectangle* pSnapRect = nullptr); static void InsertMakeObjectHdl(Link<SdrObjCreatorParams, SdrObject*> const & rLink); @@ -1076,7 +1041,7 @@ private: static SVX_DLLPRIVATE SdrObject* CreateObjectFromFactory( SdrModel& rSdrModel, SdrInventor nInventor, - sal_uInt16 nIdentifier); + SdrObjKind nIdentifier); SdrObjFactory() = delete; }; diff --git a/include/svx/svdobjkind.hxx b/include/svx/svdobjkind.hxx new file mode 100644 index 000000000000..827b35e3b339 --- /dev/null +++ b/include/svx/svdobjkind.hxx @@ -0,0 +1,147 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#pragma once + +#include <com/sun/star/form/FormComponentType.hpp> + +enum SdrObjKind +{ + 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 + + OBJ_OLE2_APPLET = 100, + OBJ_OLE2_PLUGIN = 101, + + // engine3d, arbitrarily place at 200 + E3D_SCENE_ID = 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, + + // 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, + + // 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, + + 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, + + // 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, + + // writer, arbitrarily place at 600 + SwFlyDrawObjIdentifier = 601 +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/svdocapt.hxx b/include/svx/svdocapt.hxx index 01b928b612ed..c313fb9a1bb4 100644 --- a/include/svx/svdocapt.hxx +++ b/include/svx/svdocapt.hxx @@ -83,7 +83,7 @@ public: bool isSuppressGetBitmap() const { return mbSuppressGetBitmap; } virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const override; - virtual sal_uInt16 GetObjIdentifier() const override; + virtual SdrObjKind GetObjIdentifier() const override; virtual SdrCaptionObj* CloneSdrObject(SdrModel& rTargetModel) const override; // implemented mainly for the purposes of Clone() diff --git a/include/svx/svdocirc.hxx b/include/svx/svdocirc.hxx index dc0956388ed1..15c27ddbe10f 100644 --- a/include/svx/svdocirc.hxx +++ b/include/svx/svdocirc.hxx @@ -92,7 +92,7 @@ public: SdrCircKind GetCircleKind() const { return meCircleKind; } virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const override; - virtual sal_uInt16 GetObjIdentifier() const override; + virtual SdrObjKind GetObjIdentifier() const override; virtual void TakeUnrotatedSnapRect(tools::Rectangle& rRect) const override; virtual OUString TakeObjNameSingul() const override; diff --git a/include/svx/svdoedge.hxx b/include/svx/svdoedge.hxx index d1f9558a0648..5d0116cb97d8 100644 --- a/include/svx/svdoedge.hxx +++ b/include/svx/svdoedge.hxx @@ -196,7 +196,7 @@ public: SdrObjConnection& GetConnection(bool bTail1) { return *(bTail1 ? &aCon1 : &aCon2); } virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const override; - virtual sal_uInt16 GetObjIdentifier() const override; + virtual SdrObjKind GetObjIdentifier() const override; virtual const tools::Rectangle& GetCurrentBoundRect() const override; virtual const tools::Rectangle& GetSnapRect() const override; virtual SdrGluePoint GetVertexGluePoint(sal_uInt16 nNum) const override; diff --git a/include/svx/svdograf.hxx b/include/svx/svdograf.hxx index 11ab6f115780..21ab9b3a2fb5 100644 --- a/include/svx/svdograf.hxx +++ b/include/svx/svdograf.hxx @@ -172,7 +172,7 @@ public: void StartAnimation(); virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const override; - virtual sal_uInt16 GetObjIdentifier() const override; + virtual SdrObjKind GetObjIdentifier() const override; virtual OUString TakeObjNameSingul() const override; virtual OUString TakeObjNamePlural() const override; diff --git a/include/svx/svdogrp.hxx b/include/svx/svdogrp.hxx index 7c44fa6afb4f..b63cf4b63d53 100644 --- a/include/svx/svdogrp.hxx +++ b/include/svx/svdogrp.hxx @@ -52,7 +52,7 @@ public: virtual SdrObjList* getChildrenOfSdrObject() const override; virtual void SetBoundRectDirty() override; - virtual sal_uInt16 GetObjIdentifier() const override; + virtual SdrObjKind GetObjIdentifier() const override; virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const override; virtual SdrLayerID GetLayer() const override; virtual void NbcSetLayer(SdrLayerID nLayer) override; diff --git a/include/svx/svdomeas.hxx b/include/svx/svdomeas.hxx index 3591a27c0d69..d72798e23111 100644 --- a/include/svx/svdomeas.hxx +++ b/include/svx/svdomeas.hxx @@ -83,7 +83,7 @@ public: const Point& rPt2); virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const override; - virtual sal_uInt16 GetObjIdentifier() const override; + virtual SdrObjKind GetObjIdentifier() const override; virtual void TakeUnrotatedSnapRect(tools::Rectangle& rRect) const override; virtual SdrMeasureObj* CloneSdrObject(SdrModel& rTargetModel) const override; diff --git a/include/svx/svdomedia.hxx b/include/svx/svdomedia.hxx index 258a287509a4..9eab605e8ef4 100644 --- a/include/svx/svdomedia.hxx +++ b/include/svx/svdomedia.hxx @@ -48,7 +48,7 @@ public: virtual bool HasTextEdit() const override; virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const override; - virtual sal_uInt16 GetObjIdentifier() const override; + virtual SdrObjKind GetObjIdentifier() const override; virtual OUString TakeObjNameSingul() const override; virtual OUString TakeObjNamePlural() const override; diff --git a/include/svx/svdoole2.hxx b/include/svx/svdoole2.hxx index 85f0125c17b0..8c209ce7f281 100644 --- a/include/svx/svdoole2.hxx +++ b/include/svx/svdoole2.hxx @@ -134,7 +134,7 @@ public: virtual SdrObjectUniquePtr getFullDragClone() const override; virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const override; - virtual sal_uInt16 GetObjIdentifier() const override; + virtual SdrObjKind GetObjIdentifier() const override; virtual OUString TakeObjNameSingul() const override; virtual OUString TakeObjNamePlural() const override; diff --git a/include/svx/svdopage.hxx b/include/svx/svdopage.hxx index af557b27be86..601b86d5480c 100644 --- a/include/svx/svdopage.hxx +++ b/include/svx/svdopage.hxx @@ -57,7 +57,7 @@ public: // #i96598# virtual void SetBoundRectDirty() override; - virtual sal_uInt16 GetObjIdentifier() const override; + virtual SdrObjKind GetObjIdentifier() const override; virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const override; virtual SdrPageObj* CloneSdrObject(SdrModel& rTargetModel) const override; SdrPageObj& operator=(const SdrPageObj& rObj); diff --git a/include/svx/svdopath.hxx b/include/svx/svdopath.hxx index 6c8de0e5ae0b..5f56fd38e5ae 100644 --- a/include/svx/svdopath.hxx +++ b/include/svx/svdopath.hxx @@ -73,7 +73,7 @@ public: const basegfx::B2DPolyPolygon& rPathPoly); virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const override; - virtual sal_uInt16 GetObjIdentifier() const override; + virtual SdrObjKind GetObjIdentifier() const override; virtual void TakeUnrotatedSnapRect(tools::Rectangle& rRect) const override; virtual SdrPathObj* CloneSdrObject(SdrModel& rTargetModel) const override; SdrPathObj& operator=(const SdrPathObj& rObj); diff --git a/include/svx/svdorect.hxx b/include/svx/svdorect.hxx index 92c4e1d665cb..9480acdb103a 100644 --- a/include/svx/svdorect.hxx +++ b/include/svx/svdorect.hxx @@ -86,7 +86,7 @@ public: const tools::Rectangle& rRect); virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const override; - virtual sal_uInt16 GetObjIdentifier() const override; + virtual SdrObjKind GetObjIdentifier() const override; virtual void TakeUnrotatedSnapRect(tools::Rectangle& rRect) const override; virtual OUString TakeObjNameSingul() const override; diff --git a/include/svx/svdotable.hxx b/include/svx/svdotable.hxx index df713b66c951..98b9229df404 100644 --- a/include/svx/svdotable.hxx +++ b/include/svx/svdotable.hxx @@ -196,7 +196,7 @@ public: virtual bool IsFontwork() const override; virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const override; - virtual sal_uInt16 GetObjIdentifier() const override; + virtual SdrObjKind GetObjIdentifier() const override; virtual void SetChanged() override; virtual bool AdjustTextFrameWidthAndHeight(tools::Rectangle& rR, bool bHgt = true, bool bWdt = true) const override; diff --git a/include/svx/svdotext.hxx b/include/svx/svdotext.hxx index 21a25330e913..9d74bffec93e 100644 --- a/include/svx/svdotext.hxx +++ b/include/svx/svdotext.hxx @@ -440,7 +440,7 @@ public: virtual void handlePageChange(SdrPage* pOldPage, SdrPage* pNewPage) override; virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const override; - virtual sal_uInt16 GetObjIdentifier() const override; + virtual SdrObjKind GetObjIdentifier() const override; // needed to determine text anchor area virtual void TakeUnrotatedSnapRect(tools::Rectangle& rRect) const; diff --git a/include/svx/svdouno.hxx b/include/svx/svdouno.hxx index 22f10d334a09..3796b086c8b9 100644 --- a/include/svx/svdouno.hxx +++ b/include/svx/svdouno.hxx @@ -73,7 +73,7 @@ public: const css::uno::Reference< css::lang::XMultiServiceFactory >& rxSFac); virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const override; - virtual sal_uInt16 GetObjIdentifier() const override; + virtual SdrObjKind GetObjIdentifier() const override; virtual SdrUnoObj* CloneSdrObject(SdrModel& rTargetModel) const override; SdrUnoObj& operator= (const SdrUnoObj& rObj); diff --git a/include/svx/svdovirt.hxx b/include/svx/svdovirt.hxx index bede9e4356eb..a9864189da3f 100644 --- a/include/svx/svdovirt.hxx +++ b/include/svx/svdovirt.hxx @@ -60,7 +60,7 @@ public: virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const override; virtual SdrInventor GetObjInventor() const override; - virtual sal_uInt16 GetObjIdentifier() const override; + virtual SdrObjKind GetObjIdentifier() const override; virtual SdrObjList* GetSubList() const override; virtual const tools::Rectangle& GetCurrentBoundRect() const override; diff --git a/include/svx/unopage.hxx b/include/svx/unopage.hxx index 911be0c2a66e..a428254f6af7 100644 --- a/include/svx/unopage.hxx +++ b/include/svx/unopage.hxx @@ -29,6 +29,7 @@ #include <com/sun/star/lang/XUnoTunnel.hpp> #include <editeng/mutxhelp.hxx> #include <svx/svxdllapi.h> +#include <svx/svdobjkind.hxx> #include <cppuhelper/implbase7.hxx> #include <comphelper/servicehelper.hxx> @@ -83,7 +84,7 @@ class SVXCORE_DLLPUBLIC SvxDrawPage : public ::cppu::WeakAggImplHelper7< css::dr SdrObject *CreateSdrObject( const css::uno::Reference< css::drawing::XShape >& xShape, bool bBeginning = false ) throw(); // Determine Type and Inventor - static void GetTypeAndInventor( sal_uInt16& rType, SdrInventor& rInventor, const OUString& aName ) throw(); + static void GetTypeAndInventor( SdrObjKind& rType, SdrInventor& rInventor, const OUString& aName ) throw(); // Creating a SdrObject using it's Description. // Can be used by derived classes to support their owen Shapes (e.g. Controls). diff --git a/include/svx/unoprov.hxx b/include/svx/unoprov.hxx index d69ddfca1d8b..7292bb1d5fdd 100644 --- a/include/svx/unoprov.hxx +++ b/include/svx/unoprov.hxx @@ -96,9 +96,6 @@ public: * Globals */ -const sal_Int16 OBJ_OLE2_APPLET = 100; -const sal_Int16 OBJ_OLE2_PLUGIN = 101; - #define E3D_INVENTOR_FLAG (0x80000000) /** diff --git a/reportdesign/IwyuFilter_reportdesign.yaml b/reportdesign/IwyuFilter_reportdesign.yaml index df8d5db20e36..49d95b6f0143 100644 --- a/reportdesign/IwyuFilter_reportdesign.yaml +++ b/reportdesign/IwyuFilter_reportdesign.yaml @@ -1,9 +1,6 @@ --- assumeFilename: reportdesign/source/ui/report/ReportController.cxx excludelist: - reportdesign/inc/RptDef.hxx: - # Needed for macro define - - svx/fmglob.hxx reportdesign/source/core/api/FormatCondition.cxx: # Needed for COL_TRANSPARENT in REPORTCONTROLFORMAT_IMPL - tools/color.hxx diff --git a/reportdesign/inc/RptDef.hxx b/reportdesign/inc/RptDef.hxx index fab7f9df7a57..f2dd5952684a 100644 --- a/reportdesign/inc/RptDef.hxx +++ b/reportdesign/inc/RptDef.hxx @@ -28,7 +28,7 @@ #include "dllapi.h" #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/style/XStyle.hpp> -#include <svx/fmglob.hxx> +#include <svx/svdobjkind.hxx> #include <svx/svdtypes.hxx> namespace com::sun::star { @@ -45,15 +45,6 @@ constexpr SdrLayerID RPT_LAYER_FRONT (0); constexpr SdrLayerID RPT_LAYER_BACK (1); constexpr SdrLayerID RPT_LAYER_HIDDEN (2); - - -#define OBJ_DLG_FIXEDTEXT (sal_uInt16(OBJ_MAXI) + 1) -#define OBJ_DLG_IMAGECONTROL OBJ_FM_IMAGECONTROL -#define OBJ_DLG_FORMATTEDFIELD (sal_uInt16(OBJ_MAXI) + 3) -#define OBJ_DLG_HFIXEDLINE (sal_uInt16(OBJ_MAXI) + 4) -#define OBJ_DLG_VFIXEDLINE (sal_uInt16(OBJ_MAXI) + 5) -#define OBJ_DLG_SUBREPORT (sal_uInt16(OBJ_MAXI) + 6) - // allows the alignment and resizing of controls enum class ControlModification { diff --git a/reportdesign/inc/RptObject.hxx b/reportdesign/inc/RptObject.hxx index 652ae055af8c..fa2c7c3890ed 100644 --- a/reportdesign/inc/RptObject.hxx +++ b/reportdesign/inc/RptObject.hxx @@ -114,7 +114,7 @@ public: static SdrObject* createObject( SdrModel& rTargetModel, const css::uno::Reference< css::report::XReportComponent>& _xComponent); - static sal_uInt16 getObjectType(const css::uno::Reference< css::report::XReportComponent>& _xComponent); + static SdrObjKind getObjectType(const css::uno::Reference< css::report::XReportComponent>& _xComponent); }; // OCustomShape @@ -139,7 +139,7 @@ public: virtual css::uno::Reference< css::beans::XPropertySet> getAwtComponent() override; virtual css::uno::Reference< css::uno::XInterface > getUnoShape() override; - virtual sal_uInt16 GetObjIdentifier() const override; + virtual SdrObjKind GetObjIdentifier() const override; virtual SdrInventor GetObjInventor() const override; private: @@ -176,7 +176,7 @@ public: static OOle2Obj* Create( SdrModel& rSdrModel, const css::uno::Reference< css::report::XReportComponent>& _xComponent, - sal_uInt16 _nType) + SdrObjKind _nType) { return new OOle2Obj(rSdrModel, _xComponent, _nType); } @@ -184,7 +184,7 @@ public: virtual css::uno::Reference< css::beans::XPropertySet> getAwtComponent() override; virtual css::uno::Reference< css::uno::XInterface > getUnoShape() override; - virtual sal_uInt16 GetObjIdentifier() const override; + virtual SdrObjKind GetObjIdentifier() const override; virtual SdrInventor GetObjInventor() const override; // Clone() should make a complete copy of the object. virtual OOle2Obj* CloneSdrObject(SdrModel& rTargetModel) const override; @@ -198,11 +198,11 @@ private: OOle2Obj( SdrModel& rSdrModel, const css::uno::Reference< css::report::XReportComponent>& _xComponent, - sal_uInt16 _nType); + SdrObjKind _nType); OOle2Obj( SdrModel& rSdrModel, const OUString& _sComponentName, - sal_uInt16 _nType); + SdrObjKind _nType); virtual void NbcMove( const Size& rSize ) override; virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) override; @@ -214,7 +214,7 @@ private: void impl_createDataProvider_nothrow( const css::uno::Reference< css::frame::XModel>& _xModel); virtual void impl_setUnoShape( const css::uno::Reference< css::uno::XInterface >& rxUnoShape ) override; - sal_uInt16 m_nType; + SdrObjKind m_nType; bool m_bOnlyOnce; }; @@ -227,7 +227,7 @@ class REPORTDESIGN_DLLPUBLIC OUnoObject: public SdrUnoObj , public OObjectBase friend class OObjectBase; friend class DlgEdFactory; - sal_uInt16 m_nObjectType; + SdrObjKind m_nObjectType; // tdf#118730 remember if this object was created interactively (due to ::EndCreate being called) bool m_bSetDefaultLabel; @@ -235,12 +235,12 @@ protected: OUnoObject(SdrModel& rSdrModel, const OUString& _sComponentName, const OUString& rModelName, - sal_uInt16 _nObjectType); + SdrObjKind _nObjectType); OUnoObject( SdrModel& rSdrModel, const css::uno::Reference< css::report::XReportComponent>& _xComponent, const OUString& rModelName, - sal_uInt16 _nObjectType); + SdrObjKind _nObjectType); // protected destructor virtual ~OUnoObject() override; @@ -266,7 +266,7 @@ public: static OUString GetDefaultName(const OUnoObject* _pObj); virtual css::uno::Reference< css::uno::XInterface > getUnoShape() override; - virtual sal_uInt16 GetObjIdentifier() const override; + virtual SdrObjKind GetObjIdentifier() const override; virtual SdrInventor GetObjInventor() const override; virtual OUnoObject* CloneSdrObject(SdrModel& rTargetModel) const override; diff --git a/reportdesign/source/core/sdr/ReportDrawPage.cxx b/reportdesign/source/core/sdr/ReportDrawPage.cxx index e3053e57fe4c..5c8da47c1cc6 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_DLG_FIXEDTEXT) + if (rUnoObj.GetObjIdentifier() == OBJ_RD_FIXEDTEXT) { 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_DLG_HFIXEDLINE; + bChangeOrientation = rUnoObj.GetObjIdentifier() == OBJ_RD_HFIXEDLINE; SvxShapeControl* pShape = new SvxShapeControl( pObj ); xShape = static_cast<SvxShape_UnoImplHelper *>(pShape); pShape->setShapeKind(pObj->GetObjIdentifier()); diff --git a/reportdesign/source/core/sdr/RptObject.cxx b/reportdesign/source/core/sdr/RptObject.cxx index df0062753b6f..427bf45aa16a 100644 --- a/reportdesign/source/core/sdr/RptObject.cxx +++ b/reportdesign/source/core/sdr/RptObject.cxx @@ -58,32 +58,32 @@ using namespace reportdesign; using namespace container; using namespace report; -sal_uInt16 OObjectBase::getObjectType(const uno::Reference< report::XReportComponent>& _xComponent) +SdrObjKind OObjectBase::getObjectType(const uno::Reference< report::XReportComponent>& _xComponent) { uno::Reference< lang::XServiceInfo > xServiceInfo( _xComponent , uno::UNO_QUERY ); OSL_ENSURE(xServiceInfo.is(),"Who deletes the XServiceInfo interface!"); if ( xServiceInfo.is() ) { if ( xServiceInfo->supportsService( SERVICE_FIXEDTEXT )) - return OBJ_DLG_FIXEDTEXT; + return OBJ_RD_FIXEDTEXT; if ( xServiceInfo->supportsService( SERVICE_FIXEDLINE )) { uno::Reference< report::XFixedLine> xFixedLine(_xComponent,uno::UNO_QUERY); - return xFixedLine->getOrientation() ? OBJ_DLG_HFIXEDLINE : OBJ_DLG_VFIXEDLINE; + return xFixedLine->getOrientation() ? OBJ_RD_HFIXEDLINE : OBJ_RD_VFIXEDLINE; } if ( xServiceInfo->supportsService( SERVICE_IMAGECONTROL)) - return OBJ_DLG_IMAGECONTROL; + return OBJ_RD_IMAGECONTROL; if ( xServiceInfo->supportsService( SERVICE_FORMATTEDFIELD )) - return OBJ_DLG_FORMATTEDFIELD; + return OBJ_RD_FORMATTEDFIELD; if ( xServiceInfo->supportsService("com.sun.star.drawing.OLE2Shape") ) return OBJ_OLE2; if ( xServiceInfo->supportsService( SERVICE_SHAPE )) return OBJ_CUSTOMSHAPE; if ( xServiceInfo->supportsService( SERVICE_REPORTDEFINITION ) ) - return OBJ_DLG_SUBREPORT; + return OBJ_RD_SUBREPORT; return OBJ_OLE2; } - return 0; + return OBJ_NONE; } SdrObject* OObjectBase::createObject( @@ -91,16 +91,16 @@ SdrObject* OObjectBase::createObject( const uno::Reference< report::XReportComponent>& _xComponent) { SdrObject* pNewObj = nullptr; - sal_uInt16 nType = OObjectBase::getObjectType(_xComponent); + SdrObjKind nType = OObjectBase::getObjectType(_xComponent); switch( nType ) { - case OBJ_DLG_FIXEDTEXT: + case OBJ_RD_FIXEDTEXT: { OUnoObject* pUnoObj = new OUnoObject( rTargetModel, _xComponent, OUString("com.sun.star.form.component.FixedText"), - OBJ_DLG_FIXEDTEXT); + OBJ_RD_FIXEDTEXT); pNewObj = pUnoObj; uno::Reference<beans::XPropertySet> xControlModel(pUnoObj->GetUnoControlModel(),uno::UNO_QUERY); @@ -108,22 +108,22 @@ SdrObject* OObjectBase::createObject( xControlModel->setPropertyValue( PROPERTY_MULTILINE,uno::makeAny(true)); } break; - case OBJ_DLG_IMAGECONTROL: + case OBJ_RD_IMAGECONTROL: pNewObj = new OUnoObject( rTargetModel, _xComponent, OUString("com.sun.star.form.component.DatabaseImageControl"), - OBJ_DLG_IMAGECONTROL); + OBJ_RD_IMAGECONTROL); break; - case OBJ_DLG_FORMATTEDFIELD: + case OBJ_RD_FORMATTEDFIELD: pNewObj = new OUnoObject( rTargetModel, _xComponent, OUString("com.sun.star.form.component.FormattedField"), - OBJ_DLG_FORMATTEDFIELD); + OBJ_RD_FORMATTEDFIELD); break; - case OBJ_DLG_HFIXEDLINE: - case OBJ_DLG_VFIXEDLINE: + case OBJ_RD_HFIXEDLINE: + case OBJ_RD_VFIXEDLINE: pNewObj = new OUnoObject( rTargetModel, _xComponent, @@ -145,7 +145,7 @@ SdrObject* OObjectBase::createObject( DBG_UNHANDLED_EXCEPTION("reportdesign"); } break; - case OBJ_DLG_SUBREPORT: + case OBJ_RD_SUBREPORT: case OBJ_OLE2: pNewObj = OOle2Obj::Create( rTargetModel, @@ -227,7 +227,7 @@ const TPropertyNamePair& getPropertyNameMap(sal_uInt16 _nObjectId) { switch(_nObjectId) { - case OBJ_DLG_IMAGECONTROL: + case OBJ_RD_IMAGECONTROL: { static TPropertyNamePair s_aNameMap = [&]() { @@ -241,7 +241,7 @@ const TPropertyNamePair& getPropertyNameMap(sal_uInt16 _nObjectId) return s_aNameMap; } - case OBJ_DLG_FIXEDTEXT: + case OBJ_RD_FIXEDTEXT: { static TPropertyNamePair s_aNameMap = [&]() { @@ -263,7 +263,7 @@ const TPropertyNamePair& getPropertyNameMap(sal_uInt16 _nObjectId) }(); return s_aNameMap; } - case OBJ_DLG_FORMATTEDFIELD: + case OBJ_RD_FORMATTEDFIELD: { static TPropertyNamePair s_aNameMap = [&]() { @@ -476,9 +476,9 @@ OCustomShape::~OCustomShape() { } -sal_uInt16 OCustomShape::GetObjIdentifier() const +SdrObjKind OCustomShape::GetObjIdentifier() const { - return sal_uInt16(OBJ_CUSTOMSHAPE); + return OBJ_CUSTOMSHAPE; } SdrInventor OCustomShape::GetObjInventor() const @@ -574,7 +574,7 @@ OUnoObject::OUnoObject( SdrModel& rSdrModel, const OUString& _sComponentName, const OUString& rModelName, - sal_uInt16 _nObjectType) + SdrObjKind _nObjectType) : SdrUnoObj(rSdrModel, rModelName) ,OObjectBase(_sComponentName) ,m_nObjectType(_nObjectType) @@ -589,7 +589,7 @@ OUnoObject::OUnoObject( SdrModel& rSdrModel, const uno::Reference< report::XReportComponent>& _xComponent, const OUString& rModelName, - sal_uInt16 _nObjectType) + SdrObjKind _nObjectType) : SdrUnoObj(rSdrModel, rModelName) ,OObjectBase(_xComponent) ,m_nObjectType(_nObjectType) @@ -625,7 +625,7 @@ void OUnoObject::impl_initializeModel_nothrow() } } -sal_uInt16 OUnoObject::GetObjIdentifier() const +SdrObjKind OUnoObject::GetObjIdentifier() const { return m_nObjectType; } @@ -907,7 +907,7 @@ OUnoObject& OUnoObject::operator=(const OUnoObject& rObj) OOle2Obj::OOle2Obj( SdrModel& rSdrModel, const uno::Reference< report::XReportComponent>& _xComponent, - sal_uInt16 _nType) + SdrObjKind _nType) : SdrOle2Obj(rSdrModel) ,OObjectBase(_xComponent) ,m_nType(_nType) @@ -920,7 +920,7 @@ OOle2Obj::OOle2Obj( OOle2Obj::OOle2Obj( SdrModel& rSdrModel, const OUString& _sComponentName, - sal_uInt16 _nType) + SdrObjKind _nType) : SdrOle2Obj(rSdrModel) ,OObjectBase(_sComponentName) ,m_nType(_nType) @@ -933,7 +933,7 @@ OOle2Obj::~OOle2Obj() { } -sal_uInt16 OOle2Obj::GetObjIdentifier() const +SdrObjKind OOle2Obj::GetObjIdentifier() const { return m_nType; } diff --git a/reportdesign/source/ui/inc/DesignView.hxx b/reportdesign/source/ui/inc/DesignView.hxx index 60ee506da7f7..15a7d2ed25b8 100644 --- a/reportdesign/source/ui/inc/DesignView.hxx +++ b/reportdesign/source/ui/inc/DesignView.hxx @@ -61,7 +61,7 @@ namespace rptui std::shared_ptr<ONavigator> m_xReportExplorer; Idle m_aMarkIdle; DlgEdMode m_eMode; - sal_uInt16 m_eActObj; + SdrObjKind m_eActObj; Size m_aGridSizeCoarse; Size m_aGridSizeFine; bool m_bDeleted; @@ -97,8 +97,8 @@ namespace rptui OReportController& getController() const { return m_rReportController; } void SetMode( DlgEdMode m_eMode ); - void SetInsertObj( sal_uInt16 eObj,const OUString& _sShapeType = OUString()); - sal_uInt16 GetInsertObj() const { return m_eActObj;} + void SetInsertObj( SdrObjKind eObj,const OUString& _sShapeType = OUString()); + SdrObjKind GetInsertObj() const { return m_eActObj;} OUString const & GetInsertObjString() const; DlgEdMode GetMode() const { return m_eMode; } diff --git a/reportdesign/source/ui/inc/ReportController.hxx b/reportdesign/source/ui/inc/ReportController.hxx index 06ee94c3bd49..326c5ff0308c 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 ,sal_uInt16 _nObjectId = OBJ_DLG_FORMATTEDFIELD); + 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); /** 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/ReportWindow.hxx b/reportdesign/source/ui/inc/ReportWindow.hxx index d794a33f13a4..c634dcf098f4 100644 --- a/reportdesign/source/ui/inc/ReportWindow.hxx +++ b/reportdesign/source/ui/inc/ReportWindow.hxx @@ -74,7 +74,7 @@ namespace rptui OScrollWindowHelper* getScrollWindow() const { return m_pParent; } void SetMode( DlgEdMode m_eMode ); - void SetInsertObj( sal_uInt16 eObj, const OUString& _sShapeType); + void SetInsertObj(SdrObjKind eObj, const OUString& _sShapeType); OUString const & GetInsertObjString() const; void setGridSnap(bool bOn); void setDragStripes(bool bOn); diff --git a/reportdesign/source/ui/inc/ScrollHelper.hxx b/reportdesign/source/ui/inc/ScrollHelper.hxx index c166e1f759d5..eab5c7dd3b8b 100644 --- a/reportdesign/source/ui/inc/ScrollHelper.hxx +++ b/reportdesign/source/ui/inc/ScrollHelper.hxx @@ -84,7 +84,7 @@ namespace rptui // forwards void SetMode( DlgEdMode _eMode ); - void SetInsertObj( sal_uInt16 eObj,const OUString& _sShapeType); + void SetInsertObj(SdrObjKind eObj, const OUString& _sShapeType); OUString const & GetInsertObjString() const; void setGridSnap(bool bOn); void setDragStripes(bool bOn); diff --git a/reportdesign/source/ui/inc/ViewsWindow.hxx b/reportdesign/source/ui/inc/ViewsWindow.hxx index e03ff63648df..c270aae409fc 100644 --- a/reportdesign/source/ui/inc/ViewsWindow.hxx +++ b/reportdesign/source/ui/inc/ViewsWindow.hxx @@ -148,7 +148,7 @@ namespace rptui bool empty() const { return m_aSections.empty(); } void SetMode( DlgEdMode m_eMode ); - void SetInsertObj( sal_uInt16 eObj,const OUString& _sShapeType); + void SetInsertObj( SdrObjKind eObj,const OUString& _sShapeType); const OUString& GetInsertObjString() const { return m_sShapeType;} /** copies the current selection in this section */ diff --git a/reportdesign/source/ui/report/DesignView.cxx b/reportdesign/source/ui/report/DesignView.cxx index dc85e34acd2d..e4eb5f653659 100644 --- a/reportdesign/source/ui/report/DesignView.cxx +++ b/reportdesign/source/ui/report/DesignView.cxx @@ -289,7 +289,7 @@ void ODesignView::SetMode( DlgEdMode _eNewMode ) m_aScrollWindow->SetMode(_eNewMode); } -void ODesignView::SetInsertObj( sal_uInt16 eObj,const OUString& _sShapeType ) +void ODesignView::SetInsertObj( SdrObjKind eObj,const OUString& _sShapeType ) { m_eActObj = eObj; m_aScrollWindow->SetInsertObj( eObj,_sShapeType ); diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx index 0c2ba10ea590..cae05f329d5a 100644 --- a/reportdesign/source/ui/report/ReportController.cxx +++ b/reportdesign/source/ui/report/ReportController.cxx @@ -600,23 +600,23 @@ FeatureState OReportController::GetState(sal_uInt16 _nId) const break; case SID_FM_FIXEDTEXT: aReturn.bEnabled = isEditable(); - aReturn.bChecked = getDesignView()->GetInsertObj() == OBJ_DLG_FIXEDTEXT; + aReturn.bChecked = getDesignView()->GetInsertObj() == OBJ_RD_FIXEDTEXT; break; case SID_INSERT_HFIXEDLINE: aReturn.bEnabled = isEditable(); - aReturn.bChecked = getDesignView()->GetInsertObj() == OBJ_DLG_HFIXEDLINE; + aReturn.bChecked = getDesignView()->GetInsertObj() == OBJ_RD_HFIXEDLINE; break; case SID_INSERT_VFIXEDLINE: aReturn.bEnabled = isEditable(); - aReturn.bChecked = getDesignView()->GetInsertObj() == OBJ_DLG_VFIXEDLINE; + aReturn.bChecked = getDesignView()->GetInsertObj() == OBJ_RD_VFIXEDLINE; break; case SID_FM_EDIT: aReturn.bEnabled = isEditable(); - aReturn.bChecked = getDesignView()->GetInsertObj() == OBJ_DLG_FORMATTEDFIELD; + aReturn.bChecked = getDesignView()->GetInsertObj() == OBJ_RD_FORMATTEDFIELD; break; case SID_FM_IMAGECONTROL: aReturn.bEnabled = isEditable(); - aReturn.bChecked = getDesignView()->GetInsertObj() == OBJ_DLG_IMAGECONTROL; + aReturn.bChecked = getDesignView()->GetInsertObj() == OBJ_RD_IMAGECONTROL; break; case SID_DRAWTBX_CS_BASIC: case SID_DRAWTBX_CS_BASIC1: @@ -1116,10 +1116,10 @@ void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue > InvalidateFeature( SID_OBJECT_SELECT ); break; case SID_SELECT_ALL_EDITS: - getDesignView()->SelectAll(OBJ_DLG_FORMATTEDFIELD); + getDesignView()->SelectAll(OBJ_RD_FORMATTEDFIELD); break; case SID_SELECT_ALL_LABELS: - getDesignView()->SelectAll(OBJ_DLG_FIXEDTEXT); + getDesignView()->SelectAll(OBJ_RD_FIXEDTEXT); break; case SID_TERMINATE_INPLACEACTIVATION: { @@ -1200,31 +1200,31 @@ void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue > break; case SID_FM_FIXEDTEXT: getDesignView()->SetMode( DlgEdMode::Insert ); - getDesignView()->SetInsertObj( OBJ_DLG_FIXEDTEXT ); + getDesignView()->SetInsertObj( OBJ_RD_FIXEDTEXT ); createDefaultControl(aArgs); InvalidateAll(); break; case SID_INSERT_HFIXEDLINE: getDesignView()->SetMode( DlgEdMode::Insert ); - getDesignView()->SetInsertObj( OBJ_DLG_HFIXEDLINE ); + getDesignView()->SetInsertObj( OBJ_RD_HFIXEDLINE ); createDefaultControl(aArgs); InvalidateAll(); break; case SID_INSERT_VFIXEDLINE: getDesignView()->SetMode( DlgEdMode::Insert ); - getDesignView()->SetInsertObj( OBJ_DLG_VFIXEDLINE ); + getDesignView()->SetInsertObj( OBJ_RD_VFIXEDLINE ); createDefaultControl(aArgs); InvalidateAll(); break; case SID_FM_EDIT: getDesignView()->SetMode( DlgEdMode::Insert ); - getDesignView()->SetInsertObj( OBJ_DLG_FORMATTEDFIELD ); + getDesignView()->SetInsertObj( OBJ_RD_FORMATTEDFIELD ); createDefaultControl(aArgs); InvalidateAll(); break; case SID_FM_IMAGECONTROL: getDesignView()->SetMode( DlgEdMode::Insert ); - getDesignView()->SetInsertObj( OBJ_DLG_IMAGECONTROL ); + getDesignView()->SetInsertObj( OBJ_RD_IMAGECONTROL ); createDefaultControl(aArgs); InvalidateAll(); break; @@ -3012,7 +3012,7 @@ void OReportController::insertGraphic() { PROPERTY_IMAGEURL, Any(aDialog.GetPath()) }, { PROPERTY_PRESERVEIRI, Any(bLink) } })); - createControl(aArgs,xSection,OUString(),OBJ_DLG_IMAGECONTROL); + createControl(aArgs,xSection,OUString(),OBJ_RD_IMAGECONTROL); } } catch(const Exception&) @@ -3099,7 +3099,7 @@ IMPL_LINK_NOARG( OReportController, OnExecuteReport, void*, void ) executeReport(); } -void OReportController::createControl(const Sequence< PropertyValue >& _aArgs,const uno::Reference< report::XSection>& _xSection,const OUString& _sFunction,sal_uInt16 _nObjectId) +void OReportController::createControl(const Sequence< PropertyValue >& _aArgs,const uno::Reference< report::XSection>& _xSection,const OUString& _sFunction,SdrObjKind _nObjectId) { SequenceAsHashMap aMap(_aArgs); getDesignView()->setMarked(_xSection, true); @@ -3131,7 +3131,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_DLG_SUBREPORT == _nObjectId ) + else if ( _nObjectId == OBJ_OLE2 || OBJ_RD_SUBREPORT == _nObjectId ) { pNewControl = SdrObjFactory::MakeNewObject( *m_aReportModel, @@ -3159,7 +3159,7 @@ void OReportController::createControl(const Sequence< PropertyValue >& _aArgs,co nullptr, _nObjectId, SdrInventor::ReportDesign, - OBJ_DLG_FIXEDTEXT, + OBJ_RD_FIXEDTEXT, // tdf#118963 Need a SdrModel for SdrObject creation. Dereferencing // m_aReportModel seems pretty safe, it's done in other places, initialized @@ -3216,9 +3216,9 @@ void OReportController::createControl(const Sequence< PropertyValue >& _aArgs,co pObj->CreateMediator(true); - if ( _nObjectId == OBJ_DLG_FIXEDTEXT ) // special case for fixed text + if ( _nObjectId == OBJ_RD_FIXEDTEXT ) // special case for fixed text xUnoProp->setPropertyValue(PROPERTY_LABEL,uno::makeAny(OUnoObject::GetDefaultName(pObj))); - else if ( _nObjectId == OBJ_DLG_VFIXEDLINE ) + else if ( _nObjectId == OBJ_RD_VFIXEDLINE ) { awt::Size aOlSize = xShapeProp->getSize(); xShapeProp->setSize(awt::Size(aOlSize.Height,aOlSize.Width)); // switch height and width @@ -3427,7 +3427,7 @@ void OReportController::addPairControls(const Sequence< PropertyValue >& aArgs) if ( !xField.is() ) continue; - sal_uInt16 nOBJID = 0; + SdrObjKind nOBJID = OBJ_NONE; sal_Int32 nDataType = sdbc::DataType::BINARY; xField->getPropertyValue(PROPERTY_TYPE) >>= nDataType; switch ( nDataType ) @@ -3435,10 +3435,10 @@ void OReportController::addPairControls(const Sequence< PropertyValue >& aArgs) case sdbc::DataType::BINARY: case sdbc::DataType::VARBINARY: case sdbc::DataType::LONGVARBINARY: - nOBJID = OBJ_DLG_IMAGECONTROL; + nOBJID = OBJ_RD_IMAGECONTROL; break; default: - nOBJID = OBJ_DLG_FORMATTEDFIELD; + nOBJID = OBJ_RD_FORMATTEDFIELD; break; } @@ -3466,7 +3466,7 @@ void OReportController::addPairControls(const Sequence< PropertyValue >& aArgs) xNumberFormats, nOBJID, SdrInventor::ReportDesign, - OBJ_DLG_FIXEDTEXT, + OBJ_RD_FIXEDTEXT, // tdf#118963 Need a SdrModel for SdrObject creation. Dereferencing // m_aReportModel seems pretty safe, it's done in other places, initialized @@ -3537,7 +3537,7 @@ void OReportController::addPairControls(const Sequence< PropertyValue >& aArgs) xField->getPropertyValue(PROPERTY_LABEL) >>= sLabel; if (pSectionViews[0] != pSectionViews[1] && - nOBJID == OBJ_DLG_FORMATTEDFIELD) // we want this nice feature only at FORMATTEDFIELD + nOBJID == OBJ_RD_FORMATTEDFIELD) // 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); diff --git a/reportdesign/source/ui/report/ReportWindow.cxx b/reportdesign/source/ui/report/ReportWindow.cxx index 674e72da8e9c..ed6f614b5859 100644 --- a/reportdesign/source/ui/report/ReportWindow.cxx +++ b/reportdesign/source/ui/report/ReportWindow.cxx @@ -89,7 +89,7 @@ void OReportWindow::dispose() vcl::Window::dispose(); } -void OReportWindow::SetInsertObj( sal_uInt16 eObj,const OUString& _sShapeType ) +void OReportWindow::SetInsertObj( SdrObjKind eObj,const OUString& _sShapeType ) { m_aViewsWindow->SetInsertObj( eObj,_sShapeType); } diff --git a/reportdesign/source/ui/report/ScrollHelper.cxx b/reportdesign/source/ui/report/ScrollHelper.cxx index a7a8fda02ad3..bb9691e8eabf 100644 --- a/reportdesign/source/ui/report/ScrollHelper.cxx +++ b/reportdesign/source/ui/report/ScrollHelper.cxx @@ -218,7 +218,7 @@ sal_uInt16 OScrollWindowHelper::getSectionCount() const return m_aReportWindow->getSectionCount(); } -void OScrollWindowHelper::SetInsertObj( sal_uInt16 eObj,const OUString& _sShapeType ) +void OScrollWindowHelper::SetInsertObj(SdrObjKind eObj, const OUString& _sShapeType) { m_aReportWindow->SetInsertObj(eObj,_sShapeType); } diff --git a/reportdesign/source/ui/report/ViewsWindow.cxx b/reportdesign/source/ui/report/ViewsWindow.cxx index db2b44b6d731..2274e85ca529 100644 --- a/reportdesign/source/ui/report/ViewsWindow.cxx +++ b/reportdesign/source/ui/report/ViewsWindow.cxx @@ -330,7 +330,7 @@ sal_uInt16 OViewsWindow::getSectionCount() const return static_cast<sal_uInt16>(m_aSections.size()); } -void OViewsWindow::SetInsertObj( sal_uInt16 eObj,const OUString& _sShapeType ) +void OViewsWindow::SetInsertObj( SdrObjKind eObj,const OUString& _sShapeType ) { for (const auto& rxSection : m_aSections) rxSection->getReportSection().getSectionView().SetCurrentObj( eObj, SdrInventor::ReportDesign ); diff --git a/reportdesign/source/ui/report/dlgedfac.cxx b/reportdesign/source/ui/report/dlgedfac.cxx index a0db6c64bc5d..bc68d60b896d 100644 --- a/reportdesign/source/ui/report/dlgedfac.cxx +++ b/reportdesign/source/ui/report/dlgedfac.cxx @@ -48,29 +48,29 @@ IMPL_STATIC_LINK( { switch( aParams.nObjIdentifier ) { - case OBJ_DLG_FIXEDTEXT: + case OBJ_RD_FIXEDTEXT: pNewObj = new OUnoObject(aParams.rSdrModel, SERVICE_FIXEDTEXT ,OUString("com.sun.star.form.component.FixedText") - ,OBJ_DLG_FIXEDTEXT); + ,OBJ_RD_FIXEDTEXT); break; - case OBJ_DLG_IMAGECONTROL: + case OBJ_RD_IMAGECONTROL: pNewObj = new OUnoObject(aParams.rSdrModel, SERVICE_IMAGECONTROL ,OUString("com.sun.star.form.component.DatabaseImageControl") - ,OBJ_DLG_IMAGECONTROL); + ,OBJ_RD_IMAGECONTROL); break; - case OBJ_DLG_FORMATTEDFIELD: + case OBJ_RD_FORMATTEDFIELD: pNewObj = new OUnoObject(aParams.rSdrModel, SERVICE_FORMATTEDFIELD ,OUString("com.sun.star.form.component.FormattedField") - ,OBJ_DLG_FORMATTEDFIELD); + ,OBJ_RD_FORMATTEDFIELD); break; - case OBJ_DLG_VFIXEDLINE: - case OBJ_DLG_HFIXEDLINE: + case OBJ_RD_VFIXEDLINE: + case OBJ_RD_HFIXEDLINE: { OUnoObject* pObj = new OUnoObject(aParams.rSdrModel, SERVICE_FIXEDLINE ,OUString("com.sun.star.awt.UnoControlFixedLineModel") ,aParams.nObjIdentifier); pNewObj = pObj; - if ( aParams.nObjIdentifier == OBJ_DLG_HFIXEDLINE ) + if ( aParams.nObjIdentifier == OBJ_RD_HFIXEDLINE ) { uno::Reference<beans::XPropertySet> xProp = pObj->getAwtComponent(); xProp->setPropertyValue( PROPERTY_ORIENTATION, uno::makeAny(sal_Int32(0)) ); @@ -80,8 +80,8 @@ IMPL_STATIC_LINK( case OBJ_CUSTOMSHAPE: pNewObj = new OCustomShape(aParams.rSdrModel, SERVICE_SHAPE); break; - case OBJ_DLG_SUBREPORT: - pNewObj = new OOle2Obj(aParams.rSdrModel, SERVICE_REPORTDEFINITION, OBJ_DLG_SUBREPORT); + case OBJ_RD_SUBREPORT: + pNewObj = new OOle2Obj(aParams.rSdrModel, SERVICE_REPORTDEFINITION, OBJ_RD_SUBREPORT); break; case OBJ_OLE2: pNewObj = new OOle2Obj(aParams.rSdrModel, "com.sun.star.chart2.ChartDocument", OBJ_OLE2); diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx index 4ef2e7d492c4..a9e177f01567 100644 --- a/sc/source/core/data/drwlayer.cxx +++ b/sc/source/core/data/drwlayer.cxx @@ -910,16 +910,13 @@ void ScDrawLayer::InitializeCellAnchoredObj(SdrObject* pObj, ScDrawObjData& rDat const ScAnchorType aAnchorType = ScDrawLayer::GetAnchorType(*pObj); if (aAnchorType == SCA_CELL_RESIZE) { - SdrPathObj* pLineObj = nullptr; if (pObj->GetObjIdentifier() == OBJ_LINE) - pLineObj = dynamic_cast<SdrPathObj*>(pObj); - if (pLineObj) { // 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 // object are correct. Use them for recreating the anchor. const basegfx::B2DPolygon aPoly( - pLineObj->GetPathPoly().getB2DPolygon(0)); + static_cast<SdrPathObj*>(pObj)->GetPathPoly().getB2DPolygon(0)); const basegfx::B2DPoint aB2DPoint0(aPoly.getB2DPoint(0)); const basegfx::B2DPoint aB2DPoint1(aPoly.getB2DPoint(1)); const Point aPointLT(FRound(std::min(aB2DPoint0.getX(), aB2DPoint1.getX())), diff --git a/sc/source/ui/drawfunc/fuconarc.cxx b/sc/source/ui/drawfunc/fuconarc.cxx index 8ae2002b0b49..368a1fd68c06 100644 --- a/sc/source/ui/drawfunc/fuconarc.cxx +++ b/sc/source/ui/drawfunc/fuconarc.cxx @@ -95,7 +95,7 @@ void FuConstArc::Activate() break; } - pView->SetCurrentObj( sal::static_int_cast<sal_uInt16>( aObjKind ) ); + pView->SetCurrentObj(aObjKind); aOldPointer = pWindow->GetPointer(); rViewShell.SetActivePointer( aNewPointer ); diff --git a/sc/source/ui/drawfunc/fuconpol.cxx b/sc/source/ui/drawfunc/fuconpol.cxx index e622a3e84fb4..bdb6807dcd56 100644 --- a/sc/source/ui/drawfunc/fuconpol.cxx +++ b/sc/source/ui/drawfunc/fuconpol.cxx @@ -150,7 +150,7 @@ void FuConstPolygon::Activate() break; } - pView->SetCurrentObj(sal::static_int_cast<sal_uInt16>(eKind)); + pView->SetCurrentObj(eKind); pView->SetEditMode(SdrViewEditMode::Create); diff --git a/sc/source/ui/drawfunc/fuconrec.cxx b/sc/source/ui/drawfunc/fuconrec.cxx index edb82a66d32a..3ef1a03752cb 100644 --- a/sc/source/ui/drawfunc/fuconrec.cxx +++ b/sc/source/ui/drawfunc/fuconrec.cxx @@ -195,7 +195,7 @@ void FuConstRectangle::Activate() break; } - pView->SetCurrentObj(sal::static_int_cast<sal_uInt16>(aObjKind)); + pView->SetCurrentObj(aObjKind); aOldPointer = pWindow->GetPointer(); rViewShell.SetActivePointer( aNewPointer ); diff --git a/sc/source/ui/drawfunc/fuconuno.cxx b/sc/source/ui/drawfunc/fuconuno.cxx index 6614b93776ca..6f543e516878 100644 --- a/sc/source/ui/drawfunc/fuconuno.cxx +++ b/sc/source/ui/drawfunc/fuconuno.cxx @@ -27,14 +27,14 @@ FuConstUnoControl::FuConstUnoControl(ScTabViewShell& rViewSh, vcl::Window* pWin, SdrModel* pDoc, const SfxRequest& rReq) : FuConstruct(rViewSh, pWin, pViewP, pDoc, rReq) , nInventor(SdrInventor::Unknown) - , nIdentifier(0) + , nIdentifier(OBJ_NONE) { const SfxUInt32Item* pInventorItem = rReq.GetArg<SfxUInt32Item>(SID_FM_CONTROL_INVENTOR); const SfxUInt16Item* pIdentifierItem = rReq.GetArg<SfxUInt16Item>(SID_FM_CONTROL_IDENTIFIER); if( pInventorItem ) nInventor = static_cast<SdrInventor>(pInventorItem->GetValue()); if( pIdentifierItem ) - nIdentifier = pIdentifierItem->GetValue(); + nIdentifier = static_cast<SdrObjKind>(pIdentifierItem->GetValue()); } FuConstUnoControl::~FuConstUnoControl() diff --git a/sc/source/ui/inc/fuconuno.hxx b/sc/source/ui/inc/fuconuno.hxx index 80bce194635d..4353243eef6c 100644 --- a/sc/source/ui/inc/fuconuno.hxx +++ b/sc/source/ui/inc/fuconuno.hxx @@ -28,7 +28,7 @@ enum class SdrInventor : sal_uInt32; class FuConstUnoControl final : public FuConstruct { SdrInventor nInventor; - sal_uInt16 nIdentifier; + SdrObjKind nIdentifier; public: FuConstUnoControl(ScTabViewShell& rViewSh, vcl::Window* pWin, ScDrawView* pView, diff --git a/sc/source/ui/inc/tabvwsh.hxx b/sc/source/ui/inc/tabvwsh.hxx index 02b27c5cd2e3..480f4ca9c73b 100644 --- a/sc/source/ui/inc/tabvwsh.hxx +++ b/sc/source/ui/inc/tabvwsh.hxx @@ -94,7 +94,7 @@ class SC_DLLPUBLIC ScTabViewShell: public SfxViewShell, public ScDBFunc private: ObjectSelectionType eCurOST; sal_uInt16 nDrawSfxId; - sal_uInt16 nFormSfxId; + SdrObjKind eFormObjKind; OUString sDrawCustom; // current custom shape type std::unique_ptr<ScDrawShell> pDrawShell; std::unique_ptr<ScDrawTextObjectBar> pDrawTextShell; diff --git a/sc/source/ui/view/tabvwsh2.cxx b/sc/source/ui/view/tabvwsh2.cxx index 9e0a81600e8f..5a7bcc2088b6 100644 --- a/sc/source/ui/view/tabvwsh2.cxx +++ b/sc/source/ui/view/tabvwsh2.cxx @@ -94,12 +94,12 @@ void ScTabViewShell::ExecDraw(SfxRequest& rReq) if ( nNewId == SID_DRAW_SELECT ) nNewId = SID_OBJECT_SELECT; - sal_uInt16 nNewFormId = 0; + SdrObjKind eNewFormObjKind = OBJ_NONE; if (nNewId == SID_FM_CREATE_CONTROL) { const SfxUInt16Item* pIdentifierItem = rReq.GetArg<SfxUInt16Item>(SID_FM_CONTROL_IDENTIFIER); if (pIdentifierItem) - nNewFormId = pIdentifierItem->GetValue(); + eNewFormObjKind = static_cast<SdrObjKind>(pIdentifierItem->GetValue()); } OUString sStringItemValue; @@ -128,12 +128,12 @@ void ScTabViewShell::ExecDraw(SfxRequest& rReq) bEx = true; } else if ( nNewId == nDrawSfxId && ( nNewId != SID_FM_CREATE_CONTROL || - nNewFormId == nFormSfxId || nNewFormId == 0 ) && !bSwitchCustom ) + eNewFormObjKind == eFormObjKind || eNewFormObjKind == OBJ_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. - // SID_FM_CREATE_CONTROL with nNewFormId==0 (without parameter) comes + // SID_FM_CREATE_CONTROL with eNewFormObjKind==OBJ_NONE (without parameter) comes // from FuConstruct::SimpleMouseButtonUp when deactivating // Execute for the form shell, to deselect the controller if ( nNewId == SID_FM_CREATE_CONTROL ) @@ -265,7 +265,7 @@ void ScTabViewShell::ExecDraw(SfxRequest& rReq) case SID_FM_CREATE_CONTROL: SetDrawFormShell(true); pTabView->SetDrawFuncPtr(new FuConstUnoControl(*this, pWin, pView, pDoc, aNewReq)); - nFormSfxId = nNewFormId; + eFormObjKind = eNewFormObjKind; break; case SID_DRAWTBX_CS_BASIC : diff --git a/sc/source/ui/view/tabvwshg.cxx b/sc/source/ui/view/tabvwshg.cxx index 007d437b7833..fa939bb6317c 100644 --- a/sc/source/ui/view/tabvwshg.cxx +++ b/sc/source/ui/view/tabvwshg.cxx @@ -20,7 +20,7 @@ #include <config_features.h> #include <tools/urlobj.hxx> -#include <svx/fmglob.hxx> +#include <svx/svdobjkind.hxx> #include <svx/svdouno.hxx> #include <sfx2/objsh.hxx> #include <sfx2/docfile.hxx> diff --git a/sd/qa/unit/export-tests-ooxml1.cxx b/sd/qa/unit/export-tests-ooxml1.cxx index 7e47d964f7a0..861ca9517044 100644 --- a/sd/qa/unit/export-tests-ooxml1.cxx +++ b/sd/qa/unit/export-tests-ooxml1.cxx @@ -838,7 +838,7 @@ void SdOOXMLExportTest1::testTdf111884() CPPUNIT_ASSERT_MESSAGE("no shape", pShape != nullptr); // must be a group shape - CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt16>(OBJ_GRUP), pShape->GetObjIdentifier()); + CPPUNIT_ASSERT_EQUAL(OBJ_GRUP, pShape->GetObjIdentifier()); xDocShRef->DoClose(); } diff --git a/sd/qa/unit/export-tests-ooxml2.cxx b/sd/qa/unit/export-tests-ooxml2.cxx index e71c4f5ec904..71f44a0776b6 100644 --- a/sd/qa/unit/export-tests-ooxml2.cxx +++ b/sd/qa/unit/export-tests-ooxml2.cxx @@ -400,7 +400,7 @@ void SdOOXMLExportTest2::testBnc822341() const SdrObject* pObj = pPage->GetObj(0); CPPUNIT_ASSERT_MESSAGE( "no object", pObj != nullptr); - CPPUNIT_ASSERT_EQUAL( static_cast<sal_uInt16>(OBJ_OLE2), pObj->GetObjIdentifier() ); + CPPUNIT_ASSERT_EQUAL( OBJ_OLE2, pObj->GetObjIdentifier() ); } utl::TempFile tempFile2; @@ -433,7 +433,7 @@ void SdOOXMLExportTest2::testBnc822341() const SdrObject* pObj = pPage->GetObj(0); CPPUNIT_ASSERT_MESSAGE( "no object", pObj != nullptr); - CPPUNIT_ASSERT_EQUAL( static_cast<sal_uInt16>(OBJ_OLE2), pObj->GetObjIdentifier() ); + CPPUNIT_ASSERT_EQUAL( OBJ_OLE2, pObj->GetObjIdentifier() ); } xDocShRef->DoClose(); @@ -460,7 +460,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(static_cast<sal_uInt16>(OBJ_OLE2), pObj->GetObjIdentifier()); + CPPUNIT_ASSERT_EQUAL(OBJ_OLE2, pObj->GetObjIdentifier()); } utl::TempFile tempFile2; @@ -480,7 +480,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(static_cast<sal_uInt16>(OBJ_OLE2), pObj->GetObjIdentifier()); + CPPUNIT_ASSERT_EQUAL(OBJ_OLE2, pObj->GetObjIdentifier()); } xDocShRef->DoClose(); @@ -507,7 +507,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(static_cast<sal_uInt16>(OBJ_OLE2), pObj->GetObjIdentifier()); + CPPUNIT_ASSERT_EQUAL(OBJ_OLE2, pObj->GetObjIdentifier()); } xDocShRef->DoClose(); @@ -2918,7 +2918,7 @@ void SdOOXMLExportTest2::testTdf129372() const SdrObject* pObj = pPage->GetObj(0); CPPUNIT_ASSERT_MESSAGE( "no object", pObj != nullptr); - CPPUNIT_ASSERT_EQUAL( static_cast<sal_uInt16>(OBJ_OLE2), pObj->GetObjIdentifier() ); + CPPUNIT_ASSERT_EQUAL( OBJ_OLE2, pObj->GetObjIdentifier() ); } void SdOOXMLExportTest2::testShapeGlowEffect() diff --git a/sd/qa/unit/import-tests-smartart.cxx b/sd/qa/unit/import-tests-smartart.cxx index 4a7da0915f24..6cb1e91f7307 100644 --- a/sd/qa/unit/import-tests-smartart.cxx +++ b/sd/qa/unit/import-tests-smartart.cxx @@ -1478,7 +1478,7 @@ void SdImportTestSmartArt::testTdf131553() CPPUNIT_ASSERT(pObjGroup); const SdrObject *pObj = pObjGroup->GetSubList()->GetObj(1); CPPUNIT_ASSERT_MESSAGE("no object", pObj != nullptr); - CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt16>(OBJ_OLE2), pObj->GetObjIdentifier()); + CPPUNIT_ASSERT_EQUAL(OBJ_OLE2, pObj->GetObjIdentifier()); xDocShRef->DoClose(); } diff --git a/sd/qa/unit/tiledrendering/LOKitSearchTest.cxx b/sd/qa/unit/tiledrendering/LOKitSearchTest.cxx index 07e50a93051b..a34914b88a60 100644 --- a/sd/qa/unit/tiledrendering/LOKitSearchTest.cxx +++ b/sd/qa/unit/tiledrendering/LOKitSearchTest.cxx @@ -621,7 +621,7 @@ void LOKitSearchTest::testSearchIn2MixedObjects() SdrObject* pObject = pPage->GetObj(0); CPPUNIT_ASSERT(pObject); - CPPUNIT_ASSERT_EQUAL(sal_uInt16(OBJ_TEXT), pObject->GetObjIdentifier()); + CPPUNIT_ASSERT_EQUAL(OBJ_TEXT, pObject->GetObjIdentifier()); } // Check Object 2 @@ -629,7 +629,7 @@ void LOKitSearchTest::testSearchIn2MixedObjects() SdrObject* pObject = pPage->GetObj(1); CPPUNIT_ASSERT(pObject); - CPPUNIT_ASSERT_EQUAL(sal_uInt16(OBJ_GRAF), pObject->GetObjIdentifier()); + CPPUNIT_ASSERT_EQUAL(OBJ_GRAF, pObject->GetObjIdentifier()); SdrGrafObj* pGraphicObject = dynamic_cast<SdrGrafObj*>(pObject); CPPUNIT_ASSERT(pGraphicObject); @@ -709,14 +709,14 @@ void LOKitSearchTest::testSearchIn6MixedObjects() { SdrObject* pObject = pPage->GetObj(0); CPPUNIT_ASSERT(pObject); - CPPUNIT_ASSERT_EQUAL(sal_uInt16(OBJ_TEXT), pObject->GetObjIdentifier()); + CPPUNIT_ASSERT_EQUAL(OBJ_TEXT, pObject->GetObjIdentifier()); } // Check Object 2 { SdrObject* pObject = pPage->GetObj(1); CPPUNIT_ASSERT(pObject); - CPPUNIT_ASSERT_EQUAL(sal_uInt16(OBJ_GRAF), pObject->GetObjIdentifier()); + CPPUNIT_ASSERT_EQUAL(OBJ_GRAF, pObject->GetObjIdentifier()); SdrGrafObj* pGraphicObject = dynamic_cast<SdrGrafObj*>(pObject); CPPUNIT_ASSERT(pGraphicObject); auto const& pVectorGraphicData = pGraphicObject->GetGraphic().getVectorGraphicData(); @@ -729,21 +729,21 @@ void LOKitSearchTest::testSearchIn6MixedObjects() { SdrObject* pObject = pPage->GetObj(2); CPPUNIT_ASSERT(pObject); - CPPUNIT_ASSERT_EQUAL(sal_uInt16(OBJ_CUSTOMSHAPE), pObject->GetObjIdentifier()); + CPPUNIT_ASSERT_EQUAL(OBJ_CUSTOMSHAPE, pObject->GetObjIdentifier()); } // Check Object 4 { SdrObject* pObject = pPage->GetObj(3); CPPUNIT_ASSERT(pObject); - CPPUNIT_ASSERT_EQUAL(sal_uInt16(OBJ_CUSTOMSHAPE), pObject->GetObjIdentifier()); + CPPUNIT_ASSERT_EQUAL(OBJ_CUSTOMSHAPE, pObject->GetObjIdentifier()); } // Check Object 5 { SdrObject* pObject = pPage->GetObj(4); CPPUNIT_ASSERT(pObject); - CPPUNIT_ASSERT_EQUAL(sal_uInt16(OBJ_GRAF), pObject->GetObjIdentifier()); + CPPUNIT_ASSERT_EQUAL(OBJ_GRAF, pObject->GetObjIdentifier()); SdrGrafObj* pGraphicObject = dynamic_cast<SdrGrafObj*>(pObject); CPPUNIT_ASSERT(pGraphicObject); auto const& pVectorGraphicData = pGraphicObject->GetGraphic().getVectorGraphicData(); @@ -756,7 +756,7 @@ void LOKitSearchTest::testSearchIn6MixedObjects() { SdrObject* pObject = pPage->GetObj(5); CPPUNIT_ASSERT(pObject); - CPPUNIT_ASSERT_EQUAL(sal_uInt16(OBJ_GRAF), pObject->GetObjIdentifier()); + CPPUNIT_ASSERT_EQUAL(OBJ_GRAF, 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 86c522723904..b71e91b6b820 100644 --- a/sd/qa/unit/tiledrendering/tiledrendering.cxx +++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx @@ -405,7 +405,7 @@ void SdTiledRenderingTest::testPostKeyEvent() sd::ViewShell* pViewShell = pXImpressDocument->GetDocShell()->GetViewShell(); SdPage* pActualPage = pViewShell->GetActualPage(); SdrObject* pObject = pActualPage->GetObj(0); - CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt16>(OBJ_TITLETEXT), pObject->GetObjIdentifier()); + CPPUNIT_ASSERT_EQUAL(OBJ_TITLETEXT, pObject->GetObjIdentifier()); SdrTextObj* pTextObj = static_cast<SdrTextObj*>(pObject); SdrView* pView = pViewShell->GetView(); pView->MarkObj(pTextObj, pView->GetSdrPageView()); @@ -433,7 +433,7 @@ void SdTiledRenderingTest::testPostMouseEvent() sd::ViewShell* pViewShell = pXImpressDocument->GetDocShell()->GetViewShell(); SdPage* pActualPage = pViewShell->GetActualPage(); SdrObject* pObject = pActualPage->GetObj(0); - CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt16>(OBJ_TITLETEXT), pObject->GetObjIdentifier()); + CPPUNIT_ASSERT_EQUAL(OBJ_TITLETEXT, pObject->GetObjIdentifier()); SdrTextObj* pTextObj = static_cast<SdrTextObj*>(pObject); SdrView* pView = pViewShell->GetView(); pView->MarkObj(pTextObj, pView->GetSdrPageView()); @@ -1084,7 +1084,7 @@ void SdTiledRenderingTest::testCursorVisibility_SingleClick() SdPage* pActualPage = pViewShell->GetActualPage(); SdrObject* pObject1 = pActualPage->GetObj(0); CPPUNIT_ASSERT(pObject1 != nullptr); - CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt16>(OBJ_TITLETEXT), pObject1->GetObjIdentifier()); + CPPUNIT_ASSERT_EQUAL(OBJ_TITLETEXT, pObject1->GetObjIdentifier()); SdrTextObj* pTextObject = static_cast<SdrTextObj*>(pObject1); // Click once outside of the text (in the first quartile) => no editing. @@ -1133,7 +1133,7 @@ void SdTiledRenderingTest::testCursorVisibility_DoubleClick() SdPage* pActualPage = pViewShell->GetActualPage(); SdrObject* pObject1 = pActualPage->GetObj(0); CPPUNIT_ASSERT(pObject1 != nullptr); - CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt16>(OBJ_TITLETEXT), pObject1->GetObjIdentifier()); + CPPUNIT_ASSERT_EQUAL(OBJ_TITLETEXT, pObject1->GetObjIdentifier()); SdrTextObj* pTextObject = static_cast<SdrTextObj*>(pObject1); // Double-click outside the text to enter edit mode. @@ -1165,7 +1165,7 @@ void SdTiledRenderingTest::testCursorVisibility_MultiView() SdPage* pActualPage = pViewShell->GetActualPage(); SdrObject* pObject1 = pActualPage->GetObj(0); CPPUNIT_ASSERT(pObject1); - CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt16>(OBJ_TITLETEXT), pObject1->GetObjIdentifier()); + CPPUNIT_ASSERT_EQUAL(OBJ_TITLETEXT, pObject1->GetObjIdentifier()); SdrTextObj* pTextObject = static_cast<SdrTextObj*>(pObject1); // Make sure that cursor state is not changed just because we create a second view. @@ -1213,7 +1213,7 @@ void SdTiledRenderingTest::testCursorVisibility_Escape() SdPage* pActualPage = pViewShell->GetActualPage(); SdrObject* pObject1 = pActualPage->GetObj(0); CPPUNIT_ASSERT(pObject1 != nullptr); - CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt16>(OBJ_TITLETEXT), pObject1->GetObjIdentifier()); + CPPUNIT_ASSERT_EQUAL(OBJ_TITLETEXT, pObject1->GetObjIdentifier()); SdrTextObj* pTextObject = static_cast<SdrTextObj*>(pObject1); // Click once on the text to start editing. @@ -1504,7 +1504,7 @@ void SdTiledRenderingTest::testTdf103083() SdPage* pActualPage = pViewShell->GetActualPage(); SdrObject* pObject1 = pActualPage->GetObj(1); - CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt16>(OBJ_OUTLINETEXT), pObject1->GetObjIdentifier()); + CPPUNIT_ASSERT_EQUAL(OBJ_OUTLINETEXT, pObject1->GetObjIdentifier()); SdrTextObj* pTextObject = static_cast<SdrTextObj*>(pObject1); SdrView* pView = pViewShell->GetView(); @@ -2280,7 +2280,7 @@ void SdTiledRenderingTest::testPasteTextOnSlide() CPPUNIT_ASSERT(pObject); SdrTextObj* pTextObj = dynamic_cast<SdrTextObj*>(pObject); CPPUNIT_ASSERT(pTextObj); - CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt16>(OBJ_TEXT), pTextObj->GetObjIdentifier()); + CPPUNIT_ASSERT_EQUAL(OBJ_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/sdpage.cxx b/sd/source/core/sdpage.cxx index 15f2be5fc22e..fb670e9585d4 100644 --- a/sd/source/core/sdpage.cxx +++ b/sd/source/core/sdpage.cxx @@ -1508,7 +1508,7 @@ static void findAutoLayoutShapesImpl( SdPage& rPage, const LayoutDescriptor& rDe continue; bool bPresStyle = pObj->GetStyleSheet() && (pObj->GetStyleSheet()->GetFamily() == SfxStyleFamily::Page); - SdrObjKind eSdrObjKind = static_cast< SdrObjKind >( pObj->GetObjIdentifier() ); + SdrObjKind eSdrObjKind = pObj->GetObjIdentifier(); switch( eKind ) { @@ -1910,7 +1910,7 @@ void SdPage::ScaleObjects(const Size& rNewPageSize, const ::tools::Rectangle& rN if (mbScaleObjects) { - SdrObjKind eObjKind = static_cast<SdrObjKind>(pObj->GetObjIdentifier()); + SdrObjKind eObjKind = pObj->GetObjIdentifier(); if (bIsPresObjOnMaster) { @@ -2191,6 +2191,7 @@ static SdrObject* convertPresentationObjectImpl(SdPage& rPage, SdrObject* pSourc case OBJ_MEDIA: eObjKind = PresObjKind::Media; break; case OBJ_GRAF: eObjKind = PresObjKind::Graphic; break; case OBJ_OLE2: eObjKind = PresObjKind::Object; break; + default: break; } } diff --git a/sd/source/ui/app/sdxfer.cxx b/sd/source/ui/app/sdxfer.cxx index c473468e1dfe..a5d599de1a1e 100644 --- a/sd/source/ui/app/sdxfer.cxx +++ b/sd/source/ui/app/sdxfer.cxx @@ -35,7 +35,7 @@ #include <editeng/outlobj.hxx> #include <sot/storage.hxx> #include <editeng/editobj.hxx> -#include <svx/fmglob.hxx> +#include <svx/svdobjkind.hxx> #include <svx/svdouno.hxx> #include <svx/ImageMapInfo.hxx> #include <sot/formats.hxx> diff --git a/sd/source/ui/dlg/dlgolbul.cxx b/sd/source/ui/dlg/dlgolbul.cxx index 0f8f46c4a5fd..5065ced24d20 100644 --- a/sd/source/ui/dlg/dlgolbul.cxx +++ b/sd/source/ui/dlg/dlgolbul.cxx @@ -68,7 +68,6 @@ OutlineBulletDlg::OutlineBulletDlg(weld::Window* pParent, const SfxItemSet* pAtt SdrObject* pObj = rMarkList.GetMark(nNum)->GetMarkedSdrObj(); if( pObj->GetObjInventor() == SdrInventor::Default ) { - switch(pObj->GetObjIdentifier()) { case OBJ_TITLETEXT: @@ -77,6 +76,8 @@ OutlineBulletDlg::OutlineBulletDlg(weld::Window* pParent, const SfxItemSet* pAtt case OBJ_OUTLINETEXT: bOutliner = true; break; + default: + break; } } } diff --git a/sd/source/ui/func/fuconarc.cxx b/sd/source/ui/func/fuconarc.cxx index e42db7025863..2d2fa73574b3 100644 --- a/sd/source/ui/func/fuconarc.cxx +++ b/sd/source/ui/func/fuconarc.cxx @@ -92,7 +92,7 @@ void FuConstructArc::DoExecute( SfxRequest& rReq ) SdrCircObj* pNewCircle = new SdrCircObj( mpView->getSdrModelFromSdrView(), - ToSdrCircKind(static_cast<SdrObjKind>(mpView->GetCurrentObjIdentifier())), + ToSdrCircKind(mpView->GetCurrentObjIdentifier()), aNewRectangle, static_cast<::tools::Long>(pPhiStart->GetValue () * 10.0), static_cast<::tools::Long>(pPhiEnd->GetValue () * 10.0)); @@ -193,7 +193,7 @@ void FuConstructArc::Activate() break; } - mpView->SetCurrentObj(static_cast<sal_uInt16>(aObjKind)); + mpView->SetCurrentObj(aObjKind); FuConstruct::Activate(); } diff --git a/sd/source/ui/func/fuconbez.cxx b/sd/source/ui/func/fuconbez.cxx index dffec4d18d99..a28bb06eb959 100644 --- a/sd/source/ui/func/fuconbez.cxx +++ b/sd/source/ui/func/fuconbez.cxx @@ -333,7 +333,7 @@ void FuConstructBezierPolygon::Activate() break; } - mpView->SetCurrentObj(static_cast<sal_uInt16>(eKind)); + mpView->SetCurrentObj(eKind); FuConstruct::Activate(); } diff --git a/sd/source/ui/func/fuconrec.cxx b/sd/source/ui/func/fuconrec.cxx index b74547587fc3..958ed8042c81 100644 --- a/sd/source/ui/func/fuconrec.cxx +++ b/sd/source/ui/func/fuconrec.cxx @@ -424,7 +424,7 @@ void FuConstructRectangle::Activate() break; } - mpView->SetCurrentObj(static_cast<sal_uInt16>(aObjKind)); + mpView->SetCurrentObj(aObjKind); FuConstruct::Activate(); } diff --git a/sd/source/ui/func/fuconuno.cxx b/sd/source/ui/func/fuconuno.cxx index 6edfaaa769c9..27d3ae247b25 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(0) + , nIdentifier(OBJ_NONE) { } @@ -67,7 +67,7 @@ void FuConstructUnoControl::DoExecute( SfxRequest& rReq ) if( pInventorItem ) nInventor = static_cast<SdrInventor>(pInventorItem->GetValue()); if( pIdentifierItem ) - nIdentifier = pIdentifierItem->GetValue(); + nIdentifier = static_cast<SdrObjKind>(pIdentifierItem->GetValue()); mpViewShell->GetViewShellBase().GetToolBarManager()->SetToolBar( ToolBarManager::ToolBarGroup::Function, diff --git a/sd/source/ui/func/fuoaprms.cxx b/sd/source/ui/func/fuoaprms.cxx index 38bb2b032d82..2673611f63a4 100644 --- a/sd/source/ui/func/fuoaprms.cxx +++ b/sd/source/ui/func/fuoaprms.cxx @@ -287,8 +287,8 @@ void FuObjectAnimationParameters::DoExecute( SfxRequest& rReq ) { SdrObject* pObject1 = rMarkList.GetMark(0)->GetMarkedSdrObj(); SdrObject* pObject2 = rMarkList.GetMark(1)->GetMarkedSdrObj(); - SdrObjKind eKind1 = static_cast<SdrObjKind>(pObject1->GetObjIdentifier()); - SdrObjKind eKind2 = static_cast<SdrObjKind>(pObject2->GetObjIdentifier()); + SdrObjKind eKind1 = pObject1->GetObjIdentifier(); + SdrObjKind eKind2 = pObject2->GetObjIdentifier(); SdAnimationInfo* pInfo1 = SdDrawDocument::GetAnimationInfo(pObject1); SdAnimationInfo* pInfo2 = SdDrawDocument::GetAnimationInfo(pObject2); pInfo = nullptr; @@ -629,8 +629,8 @@ void FuObjectAnimationParameters::DoExecute( SfxRequest& rReq ) DBG_ASSERT(nCount == 2, "This effect expects two selected objects"); SdrObject* pObject1 = rMarkList.GetMark(0)->GetMarkedSdrObj(); SdrObject* pObject2 = rMarkList.GetMark(1)->GetMarkedSdrObj(); - SdrObjKind eKind1 = static_cast<SdrObjKind>(pObject1->GetObjIdentifier()); - SdrObjKind eKind2 = static_cast<SdrObjKind>(pObject2->GetObjIdentifier()); + SdrObjKind eKind1 = pObject1->GetObjIdentifier(); + SdrObjKind eKind2 = pObject2->GetObjIdentifier(); SdrObject* pRunningObj = nullptr; if (pObject1->GetObjInventor() == SdrInventor::Default && diff --git a/sd/source/ui/func/fuolbull.cxx b/sd/source/ui/func/fuolbull.cxx index a5fe859d4f0a..b8e141daad5d 100644 --- a/sd/source/ui/func/fuolbull.cxx +++ b/sd/source/ui/func/fuolbull.cxx @@ -296,6 +296,8 @@ const SfxPoolItem* FuBulletAndPosition::GetNumBulletItem(SfxItemSet& aNewAttr, s case OBJ_OUTLINETEXT: bOutliner = true; break; + default: + break; } } } diff --git a/sd/source/ui/inc/fuconuno.hxx b/sd/source/ui/inc/fuconuno.hxx index c627f81d7780..d66b2713848e 100644 --- a/sd/source/ui/inc/fuconuno.hxx +++ b/sd/source/ui/inc/fuconuno.hxx @@ -57,7 +57,7 @@ private: OUString aOldLayer; SdrInventor nInventor; - sal_uInt16 nIdentifier; + SdrObjKind nIdentifier; }; } // end of namespace sd diff --git a/sd/source/ui/view/drviews4.cxx b/sd/source/ui/view/drviews4.cxx index f71ecc6a6014..b6a9d424a8db 100644 --- a/sd/source/ui/view/drviews4.cxx +++ b/sd/source/ui/view/drviews4.cxx @@ -31,7 +31,7 @@ #include <editeng/flditem.hxx> #include <svx/svxids.hrc> #include <svx/ruler.hxx> -#include <svx/globl3d.hxx> +#include <svx/svdobjkind.hxx> #include <editeng/outliner.hxx> #include <sfx2/ipclient.hxx> #include <sfx2/dispatch.hxx> diff --git a/sd/source/ui/view/drviewse.cxx b/sd/source/ui/view/drviewse.cxx index bde926aef869..db9662bb7650 100644 --- a/sd/source/ui/view/drviewse.cxx +++ b/sd/source/ui/view/drviewse.cxx @@ -49,7 +49,7 @@ #include <svx/svxids.hrc> #include <editeng/flditem.hxx> #include <svx/obj3d.hxx> -#include <svx/fmglob.hxx> +#include <svx/svdobjkind.hxx> #include <svx/svdouno.hxx> #include <svx/dataaccessdescriptor.hxx> #include <tools/urlobj.hxx> diff --git a/sd/source/ui/view/viewshel.cxx b/sd/source/ui/view/viewshel.cxx index f97c26ea5ece..1ae50f7ae7e6 100644 --- a/sd/source/ui/view/viewshel.cxx +++ b/sd/source/ui/view/viewshel.cxx @@ -829,6 +829,8 @@ const SfxPoolItem* ViewShell::GetNumBulletItem(SfxItemSet& aNewAttr, sal_uInt16& case OBJ_OUTLINETEXT: bOutliner = true; break; + default: + break; } } } diff --git a/solenv/clang-format/excludelist b/solenv/clang-format/excludelist index 6afc193dd6c8..5e167f6cb01b 100644 --- a/solenv/clang-format/excludelist +++ b/solenv/clang-format/excludelist @@ -6609,7 +6609,6 @@ include/svx/flagsdef.hxx include/svx/float3d.hxx include/svx/fmdmod.hxx include/svx/fmdpage.hxx -include/svx/fmglob.hxx include/svx/fmgridcl.hxx include/svx/fmgridif.hxx include/svx/fmmodel.hxx @@ -6637,7 +6636,6 @@ include/svx/gallery1.hxx include/svx/galleryitem.hxx include/svx/galmisc.hxx include/svx/galtheme.hxx -include/svx/globl3d.hxx include/svx/grafctrl.hxx include/svx/graphctl.hxx include/svx/graphichelper.hxx diff --git a/svx/inc/extrud3d.hxx b/svx/inc/extrud3d.hxx index 8b6d99d9ecf1..6836359a6ab5 100644 --- a/svx/inc/extrud3d.hxx +++ b/svx/inc/extrud3d.hxx @@ -92,7 +92,7 @@ public: bool GetCloseBack() const { return GetObjectItemSet().Get(SDRATTR_3DOBJ_CLOSE_BACK).GetValue(); } - virtual sal_uInt16 GetObjIdentifier() const override; + virtual SdrObjKind GetObjIdentifier() const override; virtual E3dExtrudeObj* CloneSdrObject(SdrModel& rTargetModel) const override; diff --git a/svx/inc/pch/precompiled_svxcore.hxx b/svx/inc/pch/precompiled_svxcore.hxx index ecdcb1a6c289..d9b27ecb0499 100644 --- a/svx/inc/pch/precompiled_svxcore.hxx +++ b/svx/inc/pch/precompiled_svxcore.hxx @@ -13,7 +13,7 @@ manual changes will be rewritten by the next run of update_pch.sh (which presumably also fixes all possible problems, so it's usually better to use it). - Generated on 2020-09-21 15:24:05 using: + Generated on 2020-11-05 12:52:18 using: ./bin/update_pch svx svxcore --cutoff=7 --exclude:system --include:module --exclude:local If after updating build fails, use the following command to locate conflicting headers: @@ -65,6 +65,7 @@ #include <osl/getglobalmutex.hxx> #include <osl/interlck.h> #include <osl/mutex.hxx> +#include <osl/thread.h> #include <osl/time.h> #include <rtl/alloc.h> #include <rtl/character.hxx> @@ -384,6 +385,7 @@ #include <tools/date.hxx> #include <tools/datetime.hxx> #include <tools/debug.hxx> +#include <tools/degree.hxx> #include <tools/diagnose_ex.h> #include <tools/fldunit.hxx> #include <tools/fontenum.hxx> @@ -392,6 +394,7 @@ #include <tools/helpers.hxx> #include <tools/lineend.hxx> #include <tools/link.hxx> +#include <tools/long.hxx> #include <tools/mapunit.hxx> #include <tools/ref.hxx> #include <tools/solar.h> @@ -437,11 +440,11 @@ #include <svx/gallery1.hxx> #include <svx/galmisc.hxx> #include <svx/galtheme.hxx> -#include <svx/globl3d.hxx> #include <svx/ipolypolygoneditorcontroller.hxx> #include <svx/lathe3d.hxx> #include <svx/obj3d.hxx> #include <svx/scene3d.hxx> +#include <svx/sdasitm.hxx> #include <svx/sdmetitm.hxx> #include <svx/sdooitm.hxx> #include <svx/sdr/animation/scheduler.hxx> @@ -473,6 +476,7 @@ #include <svx/svdmrkv.hxx> #include <svx/svdoashp.hxx> #include <svx/svdobj.hxx> +#include <svx/svdobjkind.hxx> #include <svx/svdocapt.hxx> #include <svx/svdoedge.hxx> #include <svx/svdograf.hxx> diff --git a/svx/inc/polygn3d.hxx b/svx/inc/polygn3d.hxx index a97104cc412e..05b15c83fd1d 100644 --- a/svx/inc/polygn3d.hxx +++ b/svx/inc/polygn3d.hxx @@ -53,7 +53,7 @@ public: const basegfx::B3DPolyPolygon& GetPolyNormals3D() const { return aPolyNormals3D; } const basegfx::B2DPolyPolygon& GetPolyTexture2D() const { return aPolyTexture2D; } - virtual sal_uInt16 GetObjIdentifier() const override; + virtual SdrObjKind GetObjIdentifier() const override; virtual SdrObjectUniquePtr DoConvertToPolyObj(bool bBezier, bool bAddText) const override; virtual E3dPolygonObj* CloneSdrObject(SdrModel& rTargetModel) const override; diff --git a/svx/source/dialog/graphctl.cxx b/svx/source/dialog/graphctl.cxx index 87943b34d804..05a02788d246 100644 --- a/svx/source/dialog/graphctl.cxx +++ b/svx/source/dialog/graphctl.cxx @@ -702,7 +702,7 @@ void GraphCtrl::SetEditMode( const bool _bEditMode ) bEditMode = _bEditMode; pView->SetEditMode( bEditMode ); eObjKind = OBJ_NONE; - pView->SetCurrentObj( sal::static_int_cast< sal_uInt16 >( eObjKind ) ); + pView->SetCurrentObj(eObjKind); } else bEditMode = false; @@ -730,7 +730,7 @@ void GraphCtrl::SetObjKind( const SdrObjKind _eObjKind ) bEditMode = false; pView->SetEditMode( bEditMode ); eObjKind = _eObjKind; - pView->SetCurrentObj( sal::static_int_cast< sal_uInt16 >( eObjKind ) ); + pView->SetCurrentObj(eObjKind); } else eObjKind = OBJ_NONE; diff --git a/svx/source/engine3d/cube3d.cxx b/svx/source/engine3d/cube3d.cxx index 401e1b085410..9ee267afb061 100644 --- a/svx/source/engine3d/cube3d.cxx +++ b/svx/source/engine3d/cube3d.cxx @@ -22,7 +22,7 @@ #include <svx/deflt3d.hxx> #include <svx/dialmgr.hxx> #include <svx/cube3d.hxx> -#include <svx/globl3d.hxx> +#include <svx/svdobjkind.hxx> #include <basegfx/point/b3dpoint.hxx> #include <sdr/contact/viewcontactofe3dcube.hxx> #include <rtl/ustrbuf.hxx> @@ -71,7 +71,7 @@ void E3dCubeObj::SetDefaultAttributes(const E3dDefaultAttributes& rDefault) bPosIsCenter = rDefault.GetDefaultCubePosIsCenter(); } -sal_uInt16 E3dCubeObj::GetObjIdentifier() const +SdrObjKind E3dCubeObj::GetObjIdentifier() const { return E3D_CUBEOBJ_ID; } diff --git a/svx/source/engine3d/extrud3d.cxx b/svx/source/engine3d/extrud3d.cxx index d4aa1f024ae5..4a6d73419a6f 100644 --- a/svx/source/engine3d/extrud3d.cxx +++ b/svx/source/engine3d/extrud3d.cxx @@ -21,7 +21,7 @@ #include <svx/strings.hrc> #include <svx/deflt3d.hxx> #include <svx/dialmgr.hxx> -#include <svx/globl3d.hxx> +#include <svx/svdobjkind.hxx> #include <extrud3d.hxx> #include <svx/svdopath.hxx> @@ -96,7 +96,7 @@ void E3dExtrudeObj::SetDefaultAttributes(const E3dDefaultAttributes& rDefault) GetProperties().SetObjectItemDirect(Svx3DTextureProjectionYItem(1)); } -sal_uInt16 E3dExtrudeObj::GetObjIdentifier() const +SdrObjKind E3dExtrudeObj::GetObjIdentifier() const { return E3D_EXTRUDEOBJ_ID; } diff --git a/svx/source/engine3d/lathe3d.cxx b/svx/source/engine3d/lathe3d.cxx index fbcfe3e44029..ebb04d5aaef5 100644 --- a/svx/source/engine3d/lathe3d.cxx +++ b/svx/source/engine3d/lathe3d.cxx @@ -21,7 +21,7 @@ #include <svx/deflt3d.hxx> #include <svx/strings.hrc> #include <svx/dialmgr.hxx> -#include <svx/globl3d.hxx> +#include <svx/svdobjkind.hxx> #include <svx/lathe3d.hxx> #include <svx/svdopath.hxx> #include <svx/svdmodel.hxx> @@ -101,7 +101,7 @@ void E3dLatheObj::SetDefaultAttributes(const E3dDefaultAttributes& rDefault) GetProperties().SetObjectItemDirect(Svx3DCloseBackItem(rDefault.GetDefaultLatheCloseBack())); } -sal_uInt16 E3dLatheObj::GetObjIdentifier() const +SdrObjKind E3dLatheObj::GetObjIdentifier() const { return E3D_LATHEOBJ_ID; } diff --git a/svx/source/engine3d/obj3d.cxx b/svx/source/engine3d/obj3d.cxx index 91f2bed2ae8e..8d813176ced4 100644 --- a/svx/source/engine3d/obj3d.cxx +++ b/svx/source/engine3d/obj3d.cxx @@ -23,7 +23,7 @@ #include <svx/dialmgr.hxx> #include <svx/svdhdl.hxx> #include <svx/svdmodel.hxx> -#include <svx/globl3d.hxx> +#include <svx/svdobjkind.hxx> #include <svx/scene3d.hxx> #include <svx/obj3d.hxx> #include <sdr/properties/e3dproperties.hxx> @@ -88,7 +88,7 @@ SdrInventor E3dObject::GetObjInventor() const return SdrInventor::E3d; } -sal_uInt16 E3dObject::GetObjIdentifier() const +SdrObjKind E3dObject::GetObjIdentifier() const { return E3D_OBJECT_ID; } @@ -542,7 +542,7 @@ void E3dCompoundObject::AddToHdlList(SdrHdlList& rHdlList) const } } -sal_uInt16 E3dCompoundObject::GetObjIdentifier() const +SdrObjKind E3dCompoundObject::GetObjIdentifier() const { return E3D_COMPOUNDOBJ_ID; } diff --git a/svx/source/engine3d/objfac3d.cxx b/svx/source/engine3d/objfac3d.cxx index 5c617127b0ec..db626f649463 100644 --- a/svx/source/engine3d/objfac3d.cxx +++ b/svx/source/engine3d/objfac3d.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include <svx/globl3d.hxx> +#include <svx/svdobjkind.hxx> #include <svx/cube3d.hxx> #include <svx/sphere3d.hxx> #include <extrud3d.hxx> @@ -64,6 +64,8 @@ IMPL_STATIC_LINK( E3dObjFactory, MakeObject, SdrObjCreatorParams, aParams, SdrOb return new E3dLatheObj(aParams.rSdrModel); case E3D_COMPOUNDOBJ_ID: return new E3dCompoundObject(aParams.rSdrModel); + default: + break; } } return nullptr; diff --git a/svx/source/engine3d/polygn3d.cxx b/svx/source/engine3d/polygn3d.cxx index c33d9f096d23..5d2d290b3821 100644 --- a/svx/source/engine3d/polygn3d.cxx +++ b/svx/source/engine3d/polygn3d.cxx @@ -18,7 +18,7 @@ */ #include <polygn3d.hxx> -#include <svx/globl3d.hxx> +#include <svx/svdobjkind.hxx> #include <basegfx/point/b3dpoint.hxx> #include <sdr/contact/viewcontactofe3dpolygon.hxx> #include <basegfx/polygon/b3dpolygon.hxx> @@ -169,7 +169,7 @@ E3dPolygonObj::~E3dPolygonObj() { } -sal_uInt16 E3dPolygonObj::GetObjIdentifier() const +SdrObjKind E3dPolygonObj::GetObjIdentifier() const { return E3D_POLYGONOBJ_ID; } diff --git a/svx/source/engine3d/scene3d.cxx b/svx/source/engine3d/scene3d.cxx index 9b52aceb5f2a..abd592d6ce01 100644 --- a/svx/source/engine3d/scene3d.cxx +++ b/svx/source/engine3d/scene3d.cxx @@ -23,7 +23,7 @@ #include <svx/svditer.hxx> #include <stdlib.h> -#include <svx/globl3d.hxx> +#include <svx/svdobjkind.hxx> #include <svx/svdpage.hxx> #include <svx/scene3d.hxx> #include <svx/svdtrans.hxx> @@ -261,7 +261,7 @@ sal_uInt32 E3dScene::RemapOrdNum(sal_uInt32 nNewOrdNum) const return nNewOrdNum; } -sal_uInt16 E3dScene::GetObjIdentifier() const +SdrObjKind E3dScene::GetObjIdentifier() const { return E3D_SCENE_ID; } diff --git a/svx/source/engine3d/sphere3d.cxx b/svx/source/engine3d/sphere3d.cxx index e5e6939c1872..5749be7696e6 100644 --- a/svx/source/engine3d/sphere3d.cxx +++ b/svx/source/engine3d/sphere3d.cxx @@ -22,7 +22,7 @@ #include <svx/deflt3d.hxx> #include <svx/dialmgr.hxx> #include <svx/svdmodel.hxx> -#include <svx/globl3d.hxx> +#include <svx/svdobjkind.hxx> #include <svx/sphere3d.hxx> #include <sdr/properties/e3dsphereproperties.hxx> @@ -77,7 +77,7 @@ void E3dSphereObj::SetDefaultAttributes(const E3dDefaultAttributes& rDefault) aSize = rDefault.GetDefaultSphereSize(); } -sal_uInt16 E3dSphereObj::GetObjIdentifier() const +SdrObjKind E3dSphereObj::GetObjIdentifier() const { return E3D_SPHEREOBJ_ID; } diff --git a/svx/source/form/fmexpl.cxx b/svx/source/form/fmexpl.cxx index aeb070082c1d..1d4e3db2a160 100644 --- a/svx/source/form/fmexpl.cxx +++ b/svx/source/form/fmexpl.cxx @@ -22,7 +22,7 @@ #include <fmexpl.hxx> #include <helpids.h> -#include <svx/fmglob.hxx> +#include <svx/svdobjkind.hxx> #include <svx/fmtools.hxx> #include <fmexch.hxx> diff --git a/svx/source/form/fmobj.cxx b/svx/source/form/fmobj.cxx index b589077068e7..92d21e907c32 100644 --- a/svx/source/form/fmobj.cxx +++ b/svx/source/form/fmobj.cxx @@ -312,19 +312,16 @@ void FmFormObj::handlePageChange(SdrPage* pOldPage, SdrPage* pNewPage) pNewFormPage->GetImpl().formObjectInserted( *this ); } - SdrInventor FmFormObj::GetObjInventor() const { return SdrInventor::FmForm; } - -sal_uInt16 FmFormObj::GetObjIdentifier() const +SdrObjKind FmFormObj::GetObjIdentifier() const { return OBJ_UNO; } - void FmFormObj::clonedFrom(const FmFormObj* _pSource) { DBG_ASSERT(_pSource != nullptr, "FmFormObj::clonedFrom : invalid source !"); diff --git a/svx/source/form/fmobjfac.cxx b/svx/source/form/fmobjfac.cxx index 5694776e09cd..799106579ced 100644 --- a/svx/source/form/fmobjfac.cxx +++ b/svx/source/form/fmobjfac.cxx @@ -26,7 +26,7 @@ #include <svx/fmobjfac.hxx> -#include <svx/fmglob.hxx> +#include <svx/svdobjkind.hxx> #include <fmobj.hxx> @@ -206,6 +206,9 @@ IMPL_STATIC_LINK(FmFormObjFactory, MakeObject, SdrObjCreatorParams, aParams, Sdr sServiceSpecifier = FM_SUN_COMPONENT_SPINBUTTON; aInitialProperties.emplace_back( FM_PROP_BORDER, makeAny( sal_Int16(0) ) ); break; + + default: + break; } // create the actual object diff --git a/svx/source/form/fmshell.cxx b/svx/source/form/fmshell.cxx index 848f5a9f0a01..572b4d59d155 100644 --- a/svx/source/form/fmshell.cxx +++ b/svx/source/form/fmshell.cxx @@ -42,7 +42,7 @@ #include <svx/svxids.hrc> -#include <svx/fmglob.hxx> +#include <svx/svdobjkind.hxx> #include <svl/eitem.hxx> #include <tools/diagnose_ex.h> #include <svx/svdpage.hxx> @@ -354,7 +354,7 @@ void FmFormShell::Execute(SfxRequest &rReq) // set the Identifier and Inventor of the Uno control - sal_uInt16 nIdentifier = 0; + SdrObjKind nIdentifier = OBJ_NONE; switch( nSlot ) { case SID_FM_CHECKBOX: diff --git a/svx/source/form/fmshimp.cxx b/svx/source/form/fmshimp.cxx index df80dae12a11..b83e2a1cbc07 100644 --- a/svx/source/form/fmshimp.cxx +++ b/svx/source/form/fmshimp.cxx @@ -36,7 +36,7 @@ #include <svx/svditer.hxx> #include <svx/dialmgr.hxx> #include <svx/strings.hrc> -#include <svx/fmglob.hxx> +#include <svx/svdobjkind.hxx> #include <svx/fmmodel.hxx> #include <svx/fmpage.hxx> #include <svx/fmshell.hxx> diff --git a/svx/source/form/fmtools.cxx b/svx/source/form/fmtools.cxx index 43cdd150a143..99e82fca3a33 100644 --- a/svx/source/form/fmtools.cxx +++ b/svx/source/form/fmtools.cxx @@ -21,7 +21,7 @@ #include <fmprop.hxx> #include <fmservs.hxx> #include <svx/fmtools.hxx> -#include <svx/fmglob.hxx> +#include <svx/svdobjkind.hxx> #include <com/sun/star/awt/LineEndFormat.hpp> #include <com/sun/star/beans/XPropertySet.hpp> diff --git a/svx/source/form/fmview.cxx b/svx/source/form/fmview.cxx index dec92f21f711..aec343857f75 100644 --- a/svx/source/form/fmview.cxx +++ b/svx/source/form/fmview.cxx @@ -545,10 +545,9 @@ FmFormObj* FmFormView::getMarkedGrid() const return pFormObject; } - void FmFormView::createControlLabelPair( OutputDevice const * _pOutDev, sal_Int32 _nXOffsetMM, sal_Int32 _nYOffsetMM, const Reference< XPropertySet >& _rxField, const Reference< XNumberFormats >& _rxNumberFormats, - sal_uInt16 _nControlObjectID, SdrInventor _nInventor, sal_uInt16 _nLabelObjectID, + SdrObjKind _nControlObjectID, SdrInventor _nInventor, SdrObjKind _nLabelObjectID, SdrModel& _rModel, std::unique_ptr<SdrUnoObj, SdrObjectFreeOp>& _rpLabel, std::unique_ptr<SdrUnoObj, SdrObjectFreeOp>& _rpControl ) diff --git a/svx/source/form/fmvwimp.cxx b/svx/source/form/fmvwimp.cxx index dee422c834d0..148eba130028 100644 --- a/svx/source/form/fmvwimp.cxx +++ b/svx/source/form/fmvwimp.cxx @@ -33,7 +33,7 @@ #include <svx/svditer.hxx> #include <svx/dataaccessdescriptor.hxx> #include <svx/dialmgr.hxx> -#include <svx/fmglob.hxx> +#include <svx/svdobjkind.hxx> #include <svx/fmmodel.hxx> #include <svx/fmpage.hxx> #include <svx/fmshell.hxx> @@ -1239,7 +1239,7 @@ SdrObjectUniquePtr FmXFormView::implCreateFieldControl( const svx::ODataAccessDe // determine the control type by examining the data type of the bound column - sal_uInt16 nOBJID = 0; + SdrObjKind nOBJID = OBJ_NONE; bool bDateNTimeField = false; bool bIsCurrency = false; @@ -1384,7 +1384,7 @@ SdrObjectUniquePtr FmXFormView::implCreateXFormsControl( const svx::OXFormsDescr // The service name decides which control should be created - sal_uInt16 nOBJID = OBJ_FM_EDIT; + SdrObjKind nOBJID = OBJ_FM_EDIT; if(_rDesc.szServiceName == FM_SUN_COMPONENT_NUMERICFIELD) nOBJID = OBJ_FM_NUMERICFIELD; if(_rDesc.szServiceName == FM_SUN_COMPONENT_CHECKBOX) @@ -1434,7 +1434,7 @@ SdrObjectUniquePtr FmXFormView::implCreateXFormsControl( const svx::OXFormsDescr // create a button control const MapMode& eTargetMode( pOutDev->GetMapMode() ); const MapMode eSourceMode(MapUnit::Map100thMM); - const sal_uInt16 nObjID = OBJ_FM_BUTTON; + const SdrObjKind nObjID = OBJ_FM_BUTTON; ::Size controlSize(4000, 500); FmFormObj *pControl = static_cast<FmFormObj*>( SdrObjFactory::MakeNewObject( @@ -1469,10 +1469,9 @@ SdrObjectUniquePtr FmXFormView::implCreateXFormsControl( const svx::OXFormsDescr return nullptr; } - bool FmXFormView::createControlLabelPair( OutputDevice const & _rOutDev, sal_Int32 _nXOffsetMM, sal_Int32 _nYOffsetMM, const Reference< XPropertySet >& _rxField, const Reference< XNumberFormats >& _rxNumberFormats, - sal_uInt16 _nControlObjectID, const OUString& _rFieldPostfix, + SdrObjKind _nControlObjectID, const OUString& _rFieldPostfix, std::unique_ptr<SdrUnoObj, SdrObjectFreeOp>& _rpLabel, std::unique_ptr<SdrUnoObj, SdrObjectFreeOp>& _rpControl, const Reference< XDataSource >& _rxDataSource, const OUString& _rDataSourceName, @@ -1517,8 +1516,8 @@ bool FmXFormView::createControlLabelPair( OutputDevice const & _rOutDev, sal_Int bool FmXFormView::createControlLabelPair( OutputDevice const & _rOutDev, sal_Int32 _nXOffsetMM, sal_Int32 _nYOffsetMM, const Reference< XPropertySet >& _rxField, - const Reference< XNumberFormats >& _rxNumberFormats, sal_uInt16 _nControlObjectID, - const OUString& _rFieldPostfix, SdrInventor _nInventor, sal_uInt16 _nLabelObjectID, + const Reference< XNumberFormats >& _rxNumberFormats, SdrObjKind _nControlObjectID, + const OUString& _rFieldPostfix, SdrInventor _nInventor, SdrObjKind _nLabelObjectID, SdrModel& _rModel, std::unique_ptr<SdrUnoObj, SdrObjectFreeOp>& _rpLabel, std::unique_ptr<SdrUnoObj, SdrObjectFreeOp>& _rpControl) { diff --git a/svx/source/inc/fmobj.hxx b/svx/source/inc/fmobj.hxx index 4f7467f493ce..d53ec819a808 100644 --- a/svx/source/inc/fmobj.hxx +++ b/svx/source/inc/fmobj.hxx @@ -75,7 +75,7 @@ public: virtual void handlePageChange(SdrPage* pOldPage, SdrPage* pNewPage) override; SAL_DLLPRIVATE virtual SdrInventor GetObjInventor() const override; - SAL_DLLPRIVATE virtual sal_uInt16 GetObjIdentifier() const override; + SAL_DLLPRIVATE virtual SdrObjKind GetObjIdentifier() const override; SAL_DLLPRIVATE virtual void NbcReformatText() override; SAL_DLLPRIVATE virtual FmFormObj* CloneSdrObject(SdrModel& rTargetModel) const override; diff --git a/svx/source/inc/fmvwimp.hxx b/svx/source/inc/fmvwimp.hxx index 278c4eda597b..3a1f254d51e5 100644 --- a/svx/source/inc/fmvwimp.hxx +++ b/svx/source/inc/fmvwimp.hxx @@ -248,10 +248,10 @@ private: sal_Int32 _nYOffsetMM, const css::uno::Reference< css::beans::XPropertySet >& _rxField, const css::uno::Reference< css::util::XNumberFormats >& _rxNumberFormats, - sal_uInt16 _nControlObjectID, + SdrObjKind _nControlObjectID, const OUString& _rFieldPostfix, SdrInventor _nInventor, - sal_uInt16 _nLabelObjectID, + SdrObjKind _nLabelObjectID, // tdf#118963 Need a SdrModel for SdrObject creation. To make the // demand clear, hand over a SdrMldel& @@ -267,7 +267,7 @@ private: sal_Int32 _nYOffsetMM, const css::uno::Reference< css::beans::XPropertySet >& _rxField, const css::uno::Reference< css::util::XNumberFormats >& _rxNumberFormats, - sal_uInt16 _nControlObjectID, + SdrObjKind _nControlObjectID, const OUString& _rFieldPostfix, std::unique_ptr<SdrUnoObj, SdrObjectFreeOp>& _rpLabel, std::unique_ptr<SdrUnoObj, SdrObjectFreeOp>& _rpControl, diff --git a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx index 141c2f4cf22a..47a7d405c6e5 100644 --- a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx +++ b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx @@ -181,7 +181,7 @@ namespace if(1 == rMarkList.GetMarkCount()) { const SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj(); - const SdrObjKind eKind(static_cast<SdrObjKind>(pObj->GetObjIdentifier())); + const SdrObjKind eKind(pObj->GetObjIdentifier()); if((pObj->GetObjInventor() == SdrInventor::Default) && (OBJ_TEXT == eKind || OBJ_TITLETEXT == eKind || OBJ_OUTLINETEXT == eKind)) { @@ -713,7 +713,7 @@ void PosSizePropertyPanel::NotifyItemUpdate( case 1: { const SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj(); - const SdrObjKind eKind(static_cast<SdrObjKind>(pObj->GetObjIdentifier())); + const SdrObjKind eKind(pObj->GetObjIdentifier()); if(((nCombinedContext == CombinedEnumContext(Application::DrawImpress, Context::Draw) || nCombinedContext == CombinedEnumContext(Application::DrawImpress, Context::TextObject) @@ -737,7 +737,7 @@ void PosSizePropertyPanel::NotifyItemUpdate( while(isNoEdge && rMarkList.GetMark(nMarkObj)) { const SdrObject* pObj = rMarkList.GetMark(nMarkObj)->GetMarkedSdrObj(); - const SdrObjKind eKind(static_cast<SdrObjKind>(pObj->GetObjIdentifier())); + const SdrObjKind eKind(pObj->GetObjIdentifier()); if(((nCombinedContext == CombinedEnumContext(Application::DrawImpress, Context::Draw) || nCombinedContext == CombinedEnumContext(Application::DrawImpress, Context::TextObject) diff --git a/svx/source/svdraw/svdcrtv.cxx b/svx/source/svdraw/svdcrtv.cxx index d5e9f8d08473..de4d6b0ef466 100644 --- a/svx/source/svdraw/svdcrtv.cxx +++ b/svx/source/svdraw/svdcrtv.cxx @@ -328,7 +328,7 @@ bool SdrCreateView::IsMeasureTool() const return meEditMode==SdrViewEditMode::Create && nCurrentInvent==SdrInventor::Default && (nCurrentIdent==OBJ_MEASURE); } -void SdrCreateView::SetCurrentObj(sal_uInt16 nIdent, SdrInventor nInvent) +void SdrCreateView::SetCurrentObj(SdrObjKind nIdent, SdrInventor nInvent) { if (nCurrentInvent!=nInvent || nCurrentIdent!=nIdent) { @@ -365,7 +365,7 @@ void SdrCreateView::SetCurrentObj(sal_uInt16 nIdent, SdrInventor nInvent) ImpSetGlueVisible3(IsEdgeTool()); } -bool SdrCreateView::ImpBegCreateObj(SdrInventor nInvent, sal_uInt16 nIdent, const Point& rPnt, OutputDevice* pOut, +bool SdrCreateView::ImpBegCreateObj(SdrInventor nInvent, SdrObjKind nIdent, const Point& rPnt, OutputDevice* pOut, sal_Int16 nMinMov, const tools::Rectangle& rLogRect, SdrObject* pPreparedFactoryObject) { bool bRet=false; @@ -498,7 +498,7 @@ bool SdrCreateView::BegCreateObj(const Point& rPnt, OutputDevice* pOut, short nM bool SdrCreateView::BegCreatePreparedObject(const Point& rPnt, sal_Int16 nMinMov, SdrObject* pPreparedFactoryObject) { SdrInventor nInvent(nCurrentInvent); - sal_uInt16 nIdent(nCurrentIdent); + SdrObjKind nIdent(nCurrentIdent); if(pPreparedFactoryObject) { diff --git a/svx/source/svdraw/svdedtv2.cxx b/svx/source/svdraw/svdedtv2.cxx index a9af1d278458..11b4401349b8 100644 --- a/svx/source/svdraw/svdedtv2.cxx +++ b/svx/source/svdraw/svdedtv2.cxx @@ -1582,7 +1582,7 @@ void SdrEditView::ImpDismantleOneObject(const SdrObject* pObj, SdrObjList& rOL, { SdrPathObj* pPath = new SdrPathObj( pSrcPath->getSdrModelFromSdrObject(), - static_cast<SdrObjKind>(pSrcPath->GetObjIdentifier()), + pSrcPath->GetObjIdentifier(), basegfx::B2DPolyPolygon(rCandidate)); ImpCopyAttributes(pSrcPath, pPath); pLast = pPath; diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx index 55674f28e8dd..d761998f540c 100644 --- a/svx/source/svdraw/svdedxv.cxx +++ b/svx/source/svdraw/svdedxv.cxx @@ -1546,7 +1546,7 @@ SdrEndTextEditKind SdrObjEditView::SdrEndTextEdit(bool bDontDeleteReally) if (pTEObj->IsInserted() && bDelObj && pTEObj->GetObjInventor() == SdrInventor::Default && !bDontDeleteReally) { - SdrObjKind eIdent = static_cast<SdrObjKind>(pTEObj->GetObjIdentifier()); + SdrObjKind eIdent = pTEObj->GetObjIdentifier(); if (eIdent == OBJ_TEXT) { pDelUndo = GetModel()->GetSdrUndoFactory().CreateUndoDeleteObject(*pTEObj); diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx index 4413d3d700fb..09976fa5b7b0 100644 --- a/svx/source/svdraw/svdoashp.cxx +++ b/svx/source/svdraw/svdoashp.cxx @@ -1347,9 +1347,9 @@ void SdrObjCustomShape::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const } } -sal_uInt16 SdrObjCustomShape::GetObjIdentifier() const +SdrObjKind SdrObjCustomShape::GetObjIdentifier() const { - return sal_uInt16(OBJ_CUSTOMSHAPE); + return OBJ_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 90ae586775ef..638c590a52cd 100644 --- a/svx/source/svdraw/svdobj.cxx +++ b/svx/source/svdraw/svdobj.cxx @@ -555,9 +555,9 @@ SdrInventor SdrObject::GetObjInventor() const return SdrInventor::Default; } -sal_uInt16 SdrObject::GetObjIdentifier() const +SdrObjKind SdrObject::GetObjIdentifier() const { - return sal_uInt16(OBJ_NONE); + return OBJ_NONE; } void SdrObject::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const @@ -3041,7 +3041,7 @@ void SdrObject::MakeNameUnique(std::unordered_set<OUString>& rNameSet) SetName(sName); } -SdrObject* SdrObjFactory::CreateObjectFromFactory(SdrModel& rSdrModel, SdrInventor nInventor, sal_uInt16 nObjIdentifier) +SdrObject* SdrObjFactory::CreateObjectFromFactory(SdrModel& rSdrModel, SdrInventor nInventor, SdrObjKind nObjIdentifier) { SdrObjCreatorParams aParams { nInventor, nObjIdentifier, rSdrModel }; for (const auto & i : ImpGetUserMakeObjHdl()) { @@ -3056,7 +3056,7 @@ SdrObject* SdrObjFactory::CreateObjectFromFactory(SdrModel& rSdrModel, SdrInvent SdrObject* SdrObjFactory::MakeNewObject( SdrModel& rSdrModel, SdrInventor nInventor, - sal_uInt16 nIdentifier, + SdrObjKind nIdentifier, const tools::Rectangle* pSnapRect) { SdrObject* pObj(nullptr); @@ -3116,7 +3116,7 @@ SdrObject* SdrObjFactory::MakeNewObject( { pObj = new SdrRectObj( rSdrModel, - static_cast<SdrObjKind>(nIdentifier), + nIdentifier, *pSnapRect); bSetSnapRect = false; } @@ -3124,7 +3124,7 @@ SdrObject* SdrObjFactory::MakeNewObject( { pObj = new SdrRectObj( rSdrModel, - static_cast<SdrObjKind>(nIdentifier)); + nIdentifier); } } break; @@ -3133,7 +3133,7 @@ SdrObject* SdrObjFactory::MakeNewObject( case OBJ_CARC: case OBJ_CCUT: { - SdrCircKind eCircKind = ToSdrCircKind(static_cast<SdrObjKind>(nIdentifier)); + SdrCircKind eCircKind = ToSdrCircKind(nIdentifier); if(nullptr != pSnapRect) { pObj = new SdrCircObj(rSdrModel, eCircKind, *pSnapRect); @@ -3145,29 +3145,30 @@ SdrObject* SdrObjFactory::MakeNewObject( } } break; - case sal_uInt16(OBJ_NONE ): pObj=new SdrObject(rSdrModel); break; - case sal_uInt16(OBJ_GRUP ): pObj=new SdrObjGroup(rSdrModel); break; - case sal_uInt16(OBJ_POLY ): pObj=new SdrPathObj(rSdrModel, OBJ_POLY ); break; - case sal_uInt16(OBJ_PLIN ): pObj=new SdrPathObj(rSdrModel, OBJ_PLIN ); break; - case sal_uInt16(OBJ_PATHLINE ): pObj=new SdrPathObj(rSdrModel, OBJ_PATHLINE ); break; - case sal_uInt16(OBJ_PATHFILL ): pObj=new SdrPathObj(rSdrModel, OBJ_PATHFILL ); break; - case sal_uInt16(OBJ_FREELINE ): pObj=new SdrPathObj(rSdrModel, OBJ_FREELINE ); break; - case sal_uInt16(OBJ_FREEFILL ): pObj=new SdrPathObj(rSdrModel, OBJ_FREEFILL ); break; - case sal_uInt16(OBJ_PATHPOLY ): pObj=new SdrPathObj(rSdrModel, OBJ_POLY ); break; - case sal_uInt16(OBJ_PATHPLIN ): pObj=new SdrPathObj(rSdrModel, OBJ_PLIN ); break; - case sal_uInt16(OBJ_EDGE ): pObj=new SdrEdgeObj(rSdrModel); break; - case sal_uInt16(OBJ_RECT ): pObj=new SdrRectObj(rSdrModel); break; - case sal_uInt16(OBJ_GRAF ): pObj=new SdrGrafObj(rSdrModel); break; - case sal_uInt16(OBJ_OLE2 ): pObj=new SdrOle2Obj(rSdrModel); break; - case sal_uInt16(OBJ_FRAME ): pObj=new SdrOle2Obj(rSdrModel, true); break; - case sal_uInt16(OBJ_CAPTION ): pObj=new SdrCaptionObj(rSdrModel); break; - case sal_uInt16(OBJ_PAGE ): pObj=new SdrPageObj(rSdrModel); break; - case sal_uInt16(OBJ_UNO ): pObj=new SdrUnoObj(rSdrModel, OUString()); break; - case sal_uInt16(OBJ_CUSTOMSHAPE ): pObj=new SdrObjCustomShape(rSdrModel); 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; #if HAVE_FEATURE_AVMEDIA - case sal_uInt16(OBJ_MEDIA ): pObj=new SdrMediaObj(rSdrModel); break; + case OBJ_MEDIA : pObj=new SdrMediaObj(rSdrModel); break; #endif - case sal_uInt16(OBJ_TABLE ): pObj=new sdr::table::SdrTableObj(rSdrModel); break; + case OBJ_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 29819052cdb4..1773901490e3 100644 --- a/svx/source/svdraw/svdocapt.cxx +++ b/svx/source/svdraw/svdocapt.cxx @@ -225,9 +225,9 @@ void SdrCaptionObj::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const rInfo.bCanConvToContour = (rInfo.bCanConvToPoly || LineGeometryUsageIsNecessary()); } -sal_uInt16 SdrCaptionObj::GetObjIdentifier() const +SdrObjKind SdrCaptionObj::GetObjIdentifier() const { - return sal_uInt16(OBJ_CAPTION); + return OBJ_CAPTION; } SdrCaptionObj* SdrCaptionObj::CloneSdrObject(SdrModel& rTargetModel) const diff --git a/svx/source/svdraw/svdocirc.cxx b/svx/source/svdraw/svdocirc.cxx index ec8b177550f0..47e03148a5fd 100644 --- a/svx/source/svdraw/svdocirc.cxx +++ b/svx/source/svdraw/svdocirc.cxx @@ -167,7 +167,7 @@ void SdrCircObj::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const rInfo.bCanConvToContour = !IsFontwork() && (rInfo.bCanConvToPoly || LineGeometryUsageIsNecessary()); } -sal_uInt16 SdrCircObj::GetObjIdentifier() const +SdrObjKind SdrCircObj::GetObjIdentifier() const { switch (meCircleKind) { diff --git a/svx/source/svdraw/svdoedge.cxx b/svx/source/svdraw/svdoedge.cxx index 0e16e33b41c2..f1395767cd29 100644 --- a/svx/source/svdraw/svdoedge.cxx +++ b/svx/source/svdraw/svdoedge.cxx @@ -367,9 +367,9 @@ void SdrEdgeObj::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const rInfo.bCanConvToContour = (rInfo.bCanConvToPoly || LineGeometryUsageIsNecessary()); } -sal_uInt16 SdrEdgeObj::GetObjIdentifier() const +SdrObjKind SdrEdgeObj::GetObjIdentifier() const { - return sal_uInt16(OBJ_EDGE); + return OBJ_EDGE; } const tools::Rectangle& SdrEdgeObj::GetCurrentBoundRect() const diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx index 2359380c95e0..37a07321441e 100644 --- a/svx/source/svdraw/svdograf.cxx +++ b/svx/source/svdraw/svdograf.cxx @@ -534,9 +534,9 @@ void SdrGrafObj::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const rInfo.bCanConvToContour = (rInfo.bCanConvToPoly || LineGeometryUsageIsNecessary()); } -sal_uInt16 SdrGrafObj::GetObjIdentifier() const +SdrObjKind SdrGrafObj::GetObjIdentifier() const { - return sal_uInt16( OBJ_GRAF ); + return OBJ_GRAF; } void SdrGrafObj::ImpSetLinkedGraphic( const Graphic& rGraphic ) diff --git a/svx/source/svdraw/svdogrp.cxx b/svx/source/svdraw/svdogrp.cxx index 7c32abb35cc0..b78a02cdfafe 100644 --- a/svx/source/svdraw/svdogrp.cxx +++ b/svx/source/svdraw/svdogrp.cxx @@ -121,19 +121,17 @@ void SdrObjGroup::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const } } - void SdrObjGroup::SetBoundRectDirty() { // avoid resetting aOutRect which in case of this object is model data, // not re-creatable view data } -sal_uInt16 SdrObjGroup::GetObjIdentifier() const +SdrObjKind SdrObjGroup::GetObjIdentifier() const { - return sal_uInt16(OBJ_GRUP); + return OBJ_GRUP; } - SdrLayerID SdrObjGroup::GetLayer() const { bool b1st = true; diff --git a/svx/source/svdraw/svdomeas.cxx b/svx/source/svdraw/svdomeas.cxx index 30f9e32ee482..4bbfb61ea289 100644 --- a/svx/source/svdraw/svdomeas.cxx +++ b/svx/source/svdraw/svdomeas.cxx @@ -243,9 +243,9 @@ void SdrMeasureObj::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const rInfo.bCanConvToContour = LineGeometryUsageIsNecessary(); } -sal_uInt16 SdrMeasureObj::GetObjIdentifier() const +SdrObjKind SdrMeasureObj::GetObjIdentifier() const { - return sal_uInt16(OBJ_MEASURE); + return OBJ_MEASURE; } struct ImpMeasureRec : public SdrDragStatUserData diff --git a/svx/source/svdraw/svdomedia.cxx b/svx/source/svdraw/svdomedia.cxx index 19f04554a246..42c7a6c59c8d 100644 --- a/svx/source/svdraw/svdomedia.cxx +++ b/svx/source/svdraw/svdomedia.cxx @@ -102,9 +102,9 @@ void SdrMediaObj::TakeObjInfo( SdrObjTransformInfoRec& rInfo ) const rInfo.bCanConvToPolyLineToArea = false; } -sal_uInt16 SdrMediaObj::GetObjIdentifier() const +SdrObjKind SdrMediaObj::GetObjIdentifier() const { - return sal_uInt16( OBJ_MEDIA ); + return OBJ_MEDIA; } OUString SdrMediaObj::TakeObjNameSingul() const diff --git a/svx/source/svdraw/svdoole2.cxx b/svx/source/svdraw/svdoole2.cxx index 83267133ac55..23eb06465e87 100644 --- a/svx/source/svdraw/svdoole2.cxx +++ b/svx/source/svdraw/svdoole2.cxx @@ -1343,9 +1343,9 @@ void SdrOle2Obj::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const rInfo.bCanConvToContour = true; } -sal_uInt16 SdrOle2Obj::GetObjIdentifier() const +SdrObjKind SdrOle2Obj::GetObjIdentifier() const { - return mpImpl->mbFrame ? sal_uInt16(OBJ_FRAME) : sal_uInt16(OBJ_OLE2); + return mpImpl->mbFrame ? OBJ_FRAME : OBJ_OLE2; } OUString SdrOle2Obj::TakeObjNameSingul() const diff --git a/svx/source/svdraw/svdopage.cxx b/svx/source/svdraw/svdopage.cxx index 9b48e34436ef..f57dd7dd5e4d 100644 --- a/svx/source/svdraw/svdopage.cxx +++ b/svx/source/svdraw/svdopage.cxx @@ -123,9 +123,9 @@ void SdrPageObj::SetBoundRectDirty() // not re-creatable view data } -sal_uInt16 SdrPageObj::GetObjIdentifier() const +SdrObjKind SdrPageObj::GetObjIdentifier() const { - return sal_uInt16(OBJ_PAGE); + return OBJ_PAGE; } void SdrPageObj::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const diff --git a/svx/source/svdraw/svdopath.cxx b/svx/source/svdraw/svdopath.cxx index 2ba5f7436781..a26aaec73210 100644 --- a/svx/source/svdraw/svdopath.cxx +++ b/svx/source/svdraw/svdopath.cxx @@ -1248,11 +1248,11 @@ bool ImpPathForDragAndCreate::MovCreate(SdrDragStat& rStat) XPolygon& rXPoly=aPathPolygon[aPathPolygon.Count()-1]; if (pView!=nullptr && pView->IsCreateMode()) { // switch to different CreateTool, if appropriate - sal_uInt16 nIdent; + SdrObjKind nIdent; SdrInventor nInvent; pView->TakeCurrentObj(nIdent,nInvent); - if (nInvent==SdrInventor::Default && pU->eCurrentKind!=static_cast<SdrObjKind>(nIdent)) { - SdrObjKind eNewKind=static_cast<SdrObjKind>(nIdent); + if (nInvent==SdrInventor::Default && pU->eCurrentKind != nIdent) { + SdrObjKind eNewKind = nIdent; switch (eNewKind) { case OBJ_CARC: case OBJ_CIRC: @@ -1810,9 +1810,9 @@ void SdrPathObj::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const rInfo.bCanConvToContour = !IsFontwork() && (rInfo.bCanConvToPoly || LineGeometryUsageIsNecessary()); } -sal_uInt16 SdrPathObj::GetObjIdentifier() const +SdrObjKind SdrPathObj::GetObjIdentifier() const { - return sal_uInt16(meKind); + return meKind; } SdrPathObj* SdrPathObj::CloneSdrObject(SdrModel& rTargetModel) const diff --git a/svx/source/svdraw/svdorect.cxx b/svx/source/svdraw/svdorect.cxx index e2a78f35aaa1..c3a2a66c8483 100644 --- a/svx/source/svdraw/svdorect.cxx +++ b/svx/source/svdraw/svdorect.cxx @@ -161,10 +161,10 @@ void SdrRectObj::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const rInfo.bCanConvToContour = (rInfo.bCanConvToPoly || LineGeometryUsageIsNecessary()); } -sal_uInt16 SdrRectObj::GetObjIdentifier() const +SdrObjKind SdrRectObj::GetObjIdentifier() const { - if (IsTextFrame()) return sal_uInt16(eTextKind); - else return sal_uInt16(OBJ_RECT); + if (IsTextFrame()) return eTextKind; + else return OBJ_RECT; } void SdrRectObj::TakeUnrotatedSnapRect(tools::Rectangle& rRect) const diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index b7450c83a44d..e58c5f89d629 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -412,9 +412,9 @@ void SdrTextObj::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const rInfo.bCanConvToContour = (rInfo.bCanConvToPoly || LineGeometryUsageIsNecessary()); } -sal_uInt16 SdrTextObj::GetObjIdentifier() const +SdrObjKind SdrTextObj::GetObjIdentifier() const { - return sal_uInt16(eTextKind); + return eTextKind; } bool SdrTextObj::HasTextImpl( SdrOutliner const * pOutliner ) diff --git a/svx/source/svdraw/svdouno.cxx b/svx/source/svdraw/svdouno.cxx index 0116ee8f3992..95c73228e64e 100644 --- a/svx/source/svdraw/svdouno.cxx +++ b/svx/source/svdraw/svdouno.cxx @@ -205,9 +205,9 @@ void SdrUnoObj::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const rInfo.bCanConvToContour = false; } -sal_uInt16 SdrUnoObj::GetObjIdentifier() const +SdrObjKind SdrUnoObj::GetObjIdentifier() const { - return sal_uInt16(OBJ_UNO); + return OBJ_UNO; } void SdrUnoObj::SetContextWritingMode( const sal_Int16 _nContextWritingMode ) diff --git a/svx/source/svdraw/svdovirt.cxx b/svx/source/svdraw/svdovirt.cxx index eba2814f6c28..9a1957c628f4 100644 --- a/svx/source/svdraw/svdovirt.cxx +++ b/svx/source/svdraw/svdovirt.cxx @@ -88,7 +88,7 @@ SdrInventor SdrVirtObj::GetObjInventor() const return rRefObj.GetObjInventor(); } -sal_uInt16 SdrVirtObj::GetObjIdentifier() const +SdrObjKind SdrVirtObj::GetObjIdentifier() const { return rRefObj.GetObjIdentifier(); } diff --git a/svx/source/table/svdotable.cxx b/svx/source/table/svdotable.cxx index 8eec244b8fcc..53e6133ac6de 100644 --- a/svx/source/table/svdotable.cxx +++ b/svx/source/table/svdotable.cxx @@ -1450,10 +1450,9 @@ void SdrTableObj::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const rInfo.bCanConvToContour = false; } - -sal_uInt16 SdrTableObj::GetObjIdentifier() const +SdrObjKind SdrTableObj::GetObjIdentifier() const { - return static_cast<sal_uInt16>(OBJ_TABLE); + return OBJ_TABLE; } void SdrTableObj::TakeTextRect( SdrOutliner& rOutliner, tools::Rectangle& rTextRect, bool bNoEditText, tools::Rectangle* pAnchorRect, bool /*bLineWidth*/ ) const diff --git a/svx/source/unodraw/unopage.cxx b/svx/source/unodraw/unopage.cxx index 0e3ce64a4166..27651bc95e70 100644 --- a/svx/source/unodraw/unopage.cxx +++ b/svx/source/unodraw/unopage.cxx @@ -43,7 +43,7 @@ #include <svx/unopage.hxx> #include "shapeimpl.hxx" #include <svx/dialmgr.hxx> -#include <svx/globl3d.hxx> +#include <svx/svdobjkind.hxx> #include <svx/unoprov.hxx> #include <svx/unoapi.hxx> #include <extrud3d.hxx> @@ -498,7 +498,7 @@ void SAL_CALL SvxDrawPage::ungroup( const Reference< drawing::XShapeGroup >& aGr SdrObject* SvxDrawPage::CreateSdrObject_(const Reference< drawing::XShape > & xShape) { - sal_uInt16 nType = 0; + SdrObjKind nType = OBJ_NONE; SdrInventor nInventor; GetTypeAndInventor( nType, nInventor, xShape->getShapeType() ); @@ -566,7 +566,7 @@ SdrObject* SvxDrawPage::CreateSdrObject_(const Reference< drawing::XShape > & xS return pNewObj; } -void SvxDrawPage::GetTypeAndInventor( sal_uInt16& rType, SdrInventor& rInventor, const OUString& aName ) throw() +void SvxDrawPage::GetTypeAndInventor( SdrObjKind& rType, SdrInventor& rInventor, const OUString& aName ) throw() { sal_uInt32 nTempType = UHashMap::getId( aName ); @@ -589,12 +589,12 @@ void SvxDrawPage::GetTypeAndInventor( sal_uInt16& rType, SdrInventor& rInventor, else if(nTempType & E3D_INVENTOR_FLAG) { rInventor = SdrInventor::E3d; - rType = static_cast<sal_uInt16>(nTempType & ~E3D_INVENTOR_FLAG); + rType = static_cast<SdrObjKind>(nTempType & ~E3D_INVENTOR_FLAG); } else { rInventor = SdrInventor::Default; - rType = static_cast<sal_uInt16>(nTempType); + rType = static_cast<SdrObjKind>(nTempType); switch( rType ) { @@ -603,6 +603,8 @@ void SvxDrawPage::GetTypeAndInventor( sal_uInt16& rType, SdrInventor& rInventor, case OBJ_OLE2_APPLET: rType = OBJ_OLE2; break; + default: + break; } } } diff --git a/svx/source/unodraw/unoprov.cxx b/svx/source/unodraw/unoprov.cxx index dcb8d61e8334..c6a6ab7ada94 100644 --- a/svx/source/unodraw/unoprov.cxx +++ b/svx/source/unodraw/unoprov.cxx @@ -38,7 +38,7 @@ #include <svx/unoshprp.hxx> #include <svx/svx3ditems.hxx> #include <svx/svxids.hrc> -#include <svx/globl3d.hxx> +#include <svx/svdobjkind.hxx> #include <svx/strings.hrc> #include <strings.hxx> #include <svx/svdobj.hxx> diff --git a/svx/source/unodraw/unoshap2.cxx b/svx/source/unodraw/unoshap2.cxx index c7b0b6de609b..1ff2d3e03e9d 100644 --- a/svx/source/unodraw/unoshap2.cxx +++ b/svx/source/unodraw/unoshap2.cxx @@ -1132,6 +1132,7 @@ drawing::PolygonKind SvxShapePolyPolygon::GetPolygonKind() const case OBJ_PATHFILL: aRetval = drawing::PolygonKind_PATHFILL; break; case OBJ_FREELINE: aRetval = drawing::PolygonKind_FREELINE; break; case OBJ_FREEFILL: aRetval = drawing::PolygonKind_FREEFILL; break; + default: break; } } diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx index 9fbb60dbc55e..b60c6e686aea 100644 --- a/svx/source/unodraw/unoshape.cxx +++ b/svx/source/unodraw/unoshape.cxx @@ -43,7 +43,7 @@ #include <svx/xlnstit.hxx> #include <svx/xlnedit.hxx> #include <svx/svdmodel.hxx> -#include <svx/globl3d.hxx> +#include <svx/svdobjkind.hxx> #include <svx/unopage.hxx> #include <svx/unoshape.hxx> #include <svx/unoshtxt.hxx> @@ -1120,6 +1120,8 @@ static bool svx_needLogicRectHack( SdrObject const * pObj ) case OBJ_PATHPLIN: case OBJ_MEASURE: return true; + default: + break; } } return false; @@ -1961,6 +1963,8 @@ uno::Any SvxShape::GetAnyForItem( SfxItemSet const & aSet, const SfxItemProperty case OBJ_SECT: // sector eKind = drawing::CircleKind_SECTION; break; + default: + break; } aAny <<= eKind; } diff --git a/sw/inc/fesh.hxx b/sw/inc/fesh.hxx index a363c241d2b1..95eb809aebfa 100644 --- a/sw/inc/fesh.hxx +++ b/sw/inc/fesh.hxx @@ -528,13 +528,13 @@ public: or SdrCreateCmd::NextPoint for a polygon may be relevant. After RESTRAINTEND the object is created and selected. BreakCreate interrupts the process. In this case no object is selected. */ - bool BeginCreate( sal_uInt16 /*SdrObjKind ?*/ eSdrObjectKind, const Point &rPos ); - bool BeginCreate( sal_uInt16 /*SdrObjKind ?*/ eSdrObjectKind, SdrInventor eObjInventor, const Point &); + bool BeginCreate( SdrObjKind eSdrObjectKind, const Point &rPos ); + bool BeginCreate( SdrObjKind eSdrObjectKind, SdrInventor eObjInventor, const Point &); void MoveCreate ( const Point &rPos ); bool EndCreate ( SdrCreateCmd eSdrCreateCmd ); void BreakCreate(); bool IsDrawCreate() const; - void CreateDefaultShape( sal_uInt16 /*SdrObjKind ?*/ eSdrObjectKind, const tools::Rectangle& rRect, sal_uInt16 nSlotId); + void CreateDefaultShape(SdrObjKind eSdrObjectKind, const tools::Rectangle& rRect, sal_uInt16 nSlotId); /// Functions for Rubberbox, ti select Draw-Objects bool BeginMark( const Point &rPos ); diff --git a/sw/inc/view.hxx b/sw/inc/view.hxx index 4130142662e4..280388e1ac25 100644 --- a/sw/inc/view.hxx +++ b/sw/inc/view.hxx @@ -214,7 +214,7 @@ class SW_DLLPUBLIC SwView: public SfxViewShell sal_uInt16 m_nDrawSfxId; OUString m_sDrawCustom; //some drawing types are marked with strings! sal_uInt16 m_nFormSfxId; - sal_uInt16 m_eFormObjKind; + SdrObjKind m_eFormObjKind; SotExchangeDest m_nLastPasteDestination; // save the border distance status from SwView::StateTabWin to re-use it in SwView::ExecTabWin() @@ -521,7 +521,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 = 0; } + void LeaveDrawCreate() { m_nDrawSfxId = m_nFormSfxId = USHRT_MAX; m_sDrawCustom.clear(); m_eFormObjKind = OBJ_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 c2bc2914ade0..31ce73fb1c0b 100644 --- a/sw/qa/extras/uiwriter/uiwriter2.cxx +++ b/sw/qa/extras/uiwriter/uiwriter2.cxx @@ -1815,7 +1815,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(static_cast<sal_uInt16>(OBJ_CUSTOMSHAPE), aStartPos); + pWrtShell->BeginCreate(OBJ_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 f3684b08cc39..963fc6dd4f2a 100644 --- a/sw/qa/uibase/shells/shells.cxx +++ b/sw/qa/uibase/shells/shells.cxx @@ -74,7 +74,7 @@ CPPUNIT_TEST_FIXTURE(SwUibaseShellsTest, testShapeTextAlignment) SwDoc* pDoc = createSwDoc(); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); Point aStartPos(1000, 1000); - pWrtShell->BeginCreate(static_cast<sal_uInt16>(OBJ_RECT), aStartPos); + pWrtShell->BeginCreate(OBJ_RECT, aStartPos); Point aMovePos(2000, 2000); pWrtShell->MoveCreate(aMovePos); pWrtShell->EndCreate(SdrCreateCmd::ForceEnd); diff --git a/sw/source/core/draw/dflyobj.cxx b/sw/source/core/draw/dflyobj.cxx index 3360229124df..1d46ff307b63 100644 --- a/sw/source/core/draw/dflyobj.cxx +++ b/sw/source/core/draw/dflyobj.cxx @@ -139,7 +139,7 @@ SdrInventor SwFlyDrawObj::GetObjInventor() const return SdrInventor::Swg; } -sal_uInt16 SwFlyDrawObj::GetObjIdentifier() const +SdrObjKind SwFlyDrawObj::GetObjIdentifier() const { return SwFlyDrawObjIdentifier; } diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx index 8cf74ca1e8f7..ee81434e9b59 100644 --- a/sw/source/core/frmedt/feshview.cxx +++ b/sw/source/core/frmedt/feshview.cxx @@ -1676,7 +1676,7 @@ bool SwFEShell::GotoObj( bool bNext, GotoObjFlags eType ) return true; } -bool SwFEShell::BeginCreate( sal_uInt16 /*SdrObjKind ?*/ eSdrObjectKind, const Point &rPos ) +bool SwFEShell::BeginCreate( SdrObjKind eSdrObjectKind, const Point &rPos ) { bool bRet = false; @@ -1700,7 +1700,7 @@ bool SwFEShell::BeginCreate( sal_uInt16 /*SdrObjKind ?*/ eSdrObjectKind, const return bRet; } -bool SwFEShell::BeginCreate( sal_uInt16 /*SdrObjKind ?*/ eSdrObjectKind, SdrInventor eObjInventor, +bool SwFEShell::BeginCreate( SdrObjKind eSdrObjectKind, SdrInventor eObjInventor, const Point &rPos ) { bool bRet = false; @@ -2938,7 +2938,7 @@ tools::Long SwFEShell::GetSectionWidth( SwFormat const & rFormat ) const return 0; } - void SwFEShell::CreateDefaultShape( sal_uInt16 /*SdrObjKind ?*/ eSdrObjectKind, const tools::Rectangle& rRect, +void SwFEShell::CreateDefaultShape( SdrObjKind eSdrObjectKind, const tools::Rectangle& rRect, sal_uInt16 nSlotId) { SdrView* pDrawView = GetDrawView(); @@ -3071,6 +3071,8 @@ tools::Long SwFEShell::GetSectionWidth( SwFormat const & rFormat ) const pObj->SetMergedItemSet(aAttr); } break; + default: + break; } static_cast<SdrPathObj*>(pObj)->SetPathPoly(aPoly); diff --git a/sw/source/core/inc/dflyobj.hxx b/sw/source/core/inc/dflyobj.hxx index e0ace3274bf5..a59e7cf23d54 100644 --- a/sw/source/core/inc/dflyobj.hxx +++ b/sw/source/core/inc/dflyobj.hxx @@ -28,8 +28,6 @@ namespace drawinglayer::geometry { class ViewInformation2D; } class SwFlyFrame; class SwFrameFormat; -const sal_uInt16 SwFlyDrawObjIdentifier = 0x0001; - // DrawObjects for Flys class SwFlyDrawObj : public SdrObject { @@ -50,7 +48,7 @@ public: // for instantiation of this class while loading (via factory) virtual SdrInventor GetObjInventor() const override; - virtual sal_uInt16 GetObjIdentifier() const override; + virtual SdrObjKind GetObjIdentifier() const override; virtual bool IsTextBox() const override { return mbIsTextBox; } void SetTextBox(bool bIsTextBox) { mbIsTextBox = bIsTextBox; } }; diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx index 2a98d6ad3570..c141c857f37c 100644 --- a/sw/source/filter/ww8/ww8graf.cxx +++ b/sw/source/filter/ww8/ww8graf.cxx @@ -2592,7 +2592,7 @@ SwFrameFormat* SwWW8ImplReader::Read_GrafLayer( tools::Long nGrafAnchorCp ) SdrObject* pOurNewObject = nullptr; bool bReplaceable = false; - switch (SdrObjKind(pObject->GetObjIdentifier())) + switch (pObject->GetObjIdentifier()) { case OBJ_GRAF: bReplaceable = true; @@ -3108,7 +3108,7 @@ SwFlyFrameFormat* SwWW8ImplReader::ImportReplaceableDrawables( SdrObject* &rpObj } OUString aObjectName(rpObject->GetName()); - if (OBJ_OLE2 == SdrObjKind(rpObject->GetObjIdentifier())) + if (OBJ_OLE2 == rpObject->GetObjIdentifier()) pRetFrameFormat = InsertOle(*static_cast<SdrOle2Obj*>(rpObject), rFlySet, &aGrSet); else { @@ -3145,7 +3145,7 @@ SwFlyFrameFormat* SwWW8ImplReader::ImportReplaceableDrawables( SdrObject* &rpObj { if( pRecord ) { - if( OBJ_OLE2 != SdrObjKind(rpObject->GetObjIdentifier()) ) + if( OBJ_OLE2 != rpObject->GetObjIdentifier() ) SetAttributesAtGrfNode( pRecord, pRetFrameFormat, pF ); } // avoid multiple occurrences of the same graphic name diff --git a/sw/source/uibase/inc/conform.hxx b/sw/source/uibase/inc/conform.hxx index 3459347ddb3f..449594c2c75c 100644 --- a/sw/source/uibase/inc/conform.hxx +++ b/sw/source/uibase/inc/conform.hxx @@ -24,10 +24,10 @@ class ConstFormControl : public SwDrawBase { private: - sal_uInt16 m_eObjKind; + SdrObjKind m_eObjKind; public: - ConstFormControl(SwWrtShell* pSh, SwEditWin* pWin, SwView* pView, sal_uInt16 eObjKind); + ConstFormControl(SwWrtShell* pSh, SwEditWin* pWin, SwView* pView, SdrObjKind eObjKind); // Mouse- & Key-Events virtual bool MouseButtonDown(const MouseEvent& rMEvt) override; diff --git a/sw/source/uibase/ribbar/conform.cxx b/sw/source/uibase/ribbar/conform.cxx index c016e1240619..393896e22d27 100644 --- a/sw/source/uibase/ribbar/conform.cxx +++ b/sw/source/uibase/ribbar/conform.cxx @@ -27,7 +27,7 @@ #include <drawbase.hxx> #include <conform.hxx> -ConstFormControl::ConstFormControl(SwWrtShell* pWrtShell, SwEditWin* pEditWin, SwView* pSwView, sal_uInt16 eObjKind) +ConstFormControl::ConstFormControl(SwWrtShell* pWrtShell, SwEditWin* pEditWin, SwView* pSwView, SdrObjKind eObjKind) : SwDrawBase(pWrtShell, pEditWin, pSwView) , m_eObjKind(eObjKind) { @@ -67,7 +67,7 @@ bool ConstFormControl::MouseButtonDown(const MouseEvent& rMEvt) m_pWin->SetPointer(PointerStyle::DrawRect); m_aStartPos = m_pWin->PixelToLogic(rMEvt.GetPosPixel()); - bReturn = m_pSh->BeginCreate( static_cast< sal_uInt16 >(m_pWin->GetSdrDrawMode()), SdrInventor::FmForm, m_aStartPos); + bReturn = m_pSh->BeginCreate(m_pWin->GetSdrDrawMode(), SdrInventor::FmForm, m_aStartPos); if (bReturn) m_pWin->SetDrawAction(true); @@ -80,7 +80,7 @@ bool ConstFormControl::MouseButtonDown(const MouseEvent& rMEvt) void ConstFormControl::Activate(const sal_uInt16 nSlotId) { - m_pWin->SetSdrDrawMode(static_cast<SdrObjKind>(m_eObjKind)); + m_pWin->SetSdrDrawMode(m_eObjKind); SwDrawBase::Activate(nSlotId); m_pSh->GetDrawView()->SetCurrentObj(m_eObjKind); @@ -101,7 +101,7 @@ void ConstFormControl::CreateDefaultObject() SdrView *pSdrView = m_pSh->GetDrawView(); pSdrView->SetDesignMode(); - m_pSh->BeginCreate( static_cast< sal_uInt16 >(m_pWin->GetSdrDrawMode()), SdrInventor::FmForm, aStartPos); + m_pSh->BeginCreate(m_pWin->GetSdrDrawMode(), SdrInventor::FmForm, aStartPos); m_pSh->MoveCreate(aEndPos); m_pSh->EndCreate(SdrCreateCmd::ForceEnd); } diff --git a/sw/source/uibase/ribbar/drawbase.cxx b/sw/source/uibase/ribbar/drawbase.cxx index 7d835b54bd1a..c35563f167dc 100644 --- a/sw/source/uibase/ribbar/drawbase.cxx +++ b/sw/source/uibase/ribbar/drawbase.cxx @@ -93,7 +93,7 @@ bool SwDrawBase::MouseButtonDown(const MouseEvent& rMEvt) m_aStartPos = m_pWin->PixelToLogic(rMEvt.GetPosPixel()); - bReturn = m_pSh->BeginCreate( static_cast< sal_uInt16 >(m_pWin->GetSdrDrawMode()), m_aStartPos); + bReturn = m_pSh->BeginCreate(m_pWin->GetSdrDrawMode(), m_aStartPos); SetDrawPointer(); @@ -429,7 +429,7 @@ void SwDrawBase::Activate(const sal_uInt16 nSlot) SetSlotId(nSlot); SdrView *pSdrView = m_pSh->GetDrawView(); - pSdrView->SetCurrentObj( static_cast< sal_uInt16 >(m_pWin->GetSdrDrawMode()) ); + pSdrView->SetCurrentObj(m_pWin->GetSdrDrawMode()); pSdrView->SetEditMode(false); SetDrawPointer(); @@ -518,7 +518,7 @@ void SwDrawBase::CreateDefaultObject() aEndPos.AdjustX(6 * MM50 ); aEndPos.AdjustY(6 * MM50 ); tools::Rectangle aRect(aStartPos, aEndPos); - m_pSh->CreateDefaultShape( static_cast< sal_uInt16 >(m_pWin->GetSdrDrawMode()), aRect, m_nSlotId); + m_pSh->CreateDefaultShape(m_pWin->GetSdrDrawMode(), aRect, m_nSlotId); } Point SwDrawBase::GetDefaultCenterPos() const diff --git a/sw/source/uibase/shells/textdrw.cxx b/sw/source/uibase/shells/textdrw.cxx index 0303576e2fd6..e92f11130b86 100644 --- a/sw/source/uibase/shells/textdrw.cxx +++ b/sw/source/uibase/shells/textdrw.cxx @@ -21,7 +21,7 @@ #include <svx/svdview.hxx> #include <tools/urlobj.hxx> -#include <svx/fmglob.hxx> +#include <svx/svdobjkind.hxx> #include <svx/svdouno.hxx> #include <com/sun/star/form/FormButtonType.hpp> #include <com/sun/star/beans/XPropertySet.hpp> diff --git a/sw/source/uibase/uiview/view.cxx b/sw/source/uibase/uiview/view.cxx index a031b6fab422..2b5670cffc11 100644 --- a/sw/source/uibase/uiview/view.cxx +++ b/sw/source/uibase/uiview/view.cxx @@ -720,7 +720,7 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh ) m_nPageCnt(0), m_nDrawSfxId( USHRT_MAX ), m_nFormSfxId( USHRT_MAX ), - m_eFormObjKind(0), + m_eFormObjKind(OBJ_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 7a8cacfaad41..e5284b48e04a 100644 --- a/sw/source/uibase/uiview/viewdraw.cxx +++ b/sw/source/uibase/uiview/viewdraw.cxx @@ -81,12 +81,12 @@ void SwView::ExecDraw(SfxRequest& rReq) if(pArgs && SfxItemState::SET == pArgs->GetItemState(GetPool().GetWhich(nSlotId), false, &pItem)) pStringItem = dynamic_cast< const SfxStringItem*>(pItem); - sal_uInt16 eNewFormObjKind = 0; + SdrObjKind eNewFormObjKind = OBJ_NONE; if (nSlotId == SID_FM_CREATE_CONTROL) { const SfxUInt16Item* pIdentifierItem = rReq.GetArg<SfxUInt16Item>(SID_FM_CONTROL_IDENTIFIER); if (pIdentifierItem) - eNewFormObjKind = pIdentifierItem->GetValue(); + eNewFormObjKind = static_cast<SdrObjKind>(pIdentifierItem->GetValue()); } if (nSlotId == SID_OBJECT_SELECT && m_nFormSfxId == nSlotId) @@ -95,7 +95,7 @@ void SwView::ExecDraw(SfxRequest& rReq) } else if (nSlotId == SID_FM_CREATE_CONTROL) { - if (eNewFormObjKind == m_eFormObjKind || eNewFormObjKind == 0) + if (eNewFormObjKind == m_eFormObjKind || eNewFormObjKind == OBJ_NONE) { bDeselect = true; GetViewFrame()->GetDispatcher()->Execute(SID_FM_LEAVE_CREATE); // Button should popping out @@ -595,10 +595,9 @@ bool SwView::BeginTextEdit(SdrObject* pObj, SdrPageView* pPV, vcl::Window* pWin, } // Is a DrawTextObject selected? - bool SwView::IsTextTool() const { - sal_uInt16 nId; + SdrObjKind nId; SdrInventor nInvent; SdrView *pSdrView = GetWrtShell().GetDrawView(); OSL_ENSURE( pSdrView, "IsTextTool without DrawView?" ); |