summaryrefslogtreecommitdiff
path: root/reportdesign
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2021-12-30 20:33:52 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-01-07 14:22:07 +0100
commit8295a3344704ce9a18489933c499a50c403f1a3d (patch)
tree92a10017311909e3010624b39acddfcf7d3eba00 /reportdesign
parent8accfa30343195b5d7cfd111301677a6a9b6a21b (diff)
remove E3D_INVENTOR_FLAG and convert SdrObjKind to scoped enum
We don't need E3D_INVENTOR_FLAG, we can just check if the SdrObjKind is in the right range. Which exposes some dodgy code in DrawViewShell::GetMenuStateSel SfxItemState::DEFAULT == rSet.GetItemState( OBJ_TITLETEXT ) || SfxItemState::DEFAULT == rSet.GetItemState( OBJ_OUTLINETEXT ) || which has been there ever since commit f47a9d9db3d06927380bb79b04bb6d4721a92d2b Date: Mon Sep 18 16:07:07 2000 +0000 initial import just remove that. In SwFEShell::ImpEndCreate() move some logic around to avoid using an out-of-range SdrObjKind value Change-Id: I4620bfe61aca8f7415503debe3c84bfe5f4368a0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127763 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'reportdesign')
-rw-r--r--reportdesign/inc/RptDef.hxx2
-rw-r--r--reportdesign/source/core/sdr/ReportDrawPage.cxx4
-rw-r--r--reportdesign/source/core/sdr/RptObject.cxx52
-rw-r--r--reportdesign/source/ui/inc/DesignView.hxx2
-rw-r--r--reportdesign/source/ui/inc/ReportController.hxx2
-rw-r--r--reportdesign/source/ui/inc/ReportSection.hxx2
-rw-r--r--reportdesign/source/ui/inc/ReportWindow.hxx2
-rw-r--r--reportdesign/source/ui/inc/ScrollHelper.hxx2
-rw-r--r--reportdesign/source/ui/inc/ViewsWindow.hxx2
-rw-r--r--reportdesign/source/ui/misc/UITools.cxx2
-rw-r--r--reportdesign/source/ui/report/DesignView.cxx6
-rw-r--r--reportdesign/source/ui/report/ReportController.cxx58
-rw-r--r--reportdesign/source/ui/report/ReportSection.cxx4
-rw-r--r--reportdesign/source/ui/report/ReportWindow.cxx2
-rw-r--r--reportdesign/source/ui/report/ScrollHelper.cxx2
-rw-r--r--reportdesign/source/ui/report/ViewsWindow.cxx2
-rw-r--r--reportdesign/source/ui/report/dlgedfac.cxx28
-rw-r--r--reportdesign/source/ui/report/dlgedfunc.cxx12
18 files changed, 93 insertions, 93 deletions
diff --git a/reportdesign/inc/RptDef.hxx b/reportdesign/inc/RptDef.hxx
index 91fff4ae2342..9d60fe3594aa 100644
--- a/reportdesign/inc/RptDef.hxx
+++ b/reportdesign/inc/RptDef.hxx
@@ -74,7 +74,7 @@ typedef std::map<OUString, TPropertyConverter> TPropertyNamePair;
/** returns the property name map for the given property id
@param _nObjectId the object id
*/
-REPORTDESIGN_DLLPUBLIC const TPropertyNamePair& getPropertyNameMap(sal_uInt16 _nObjectId);
+REPORTDESIGN_DLLPUBLIC const TPropertyNamePair& getPropertyNameMap(SdrObjKind _nObjectId);
REPORTDESIGN_DLLPUBLIC css::uno::Reference< css::style::XStyle> getUsedStyle(const css::uno::Reference< css::report::XReportDefinition>& _xReport);
template < typename T> T getStyleProperty(const css::uno::Reference< css::report::XReportDefinition>& _xReport,const OUString& _sPropertyName)
diff --git a/reportdesign/source/core/sdr/ReportDrawPage.cxx b/reportdesign/source/core/sdr/ReportDrawPage.cxx
index 1823c3c07527..abb56f534a58 100644
--- a/reportdesign/source/core/sdr/ReportDrawPage.cxx
+++ b/reportdesign/source/core/sdr/ReportDrawPage.cxx
@@ -78,14 +78,14 @@ uno::Reference< drawing::XShape > OReportDrawPage::CreateShape( SdrObject *pObj
if (dynamic_cast< const OUnoObject* >(pObj) != nullptr)
{
OUnoObject& rUnoObj = dynamic_cast<OUnoObject&>(*pObj);
- if (rUnoObj.GetObjIdentifier() == OBJ_RD_FIXEDTEXT)
+ if (rUnoObj.GetObjIdentifier() == SdrObjKind::ReportDesignFixedText)
{
uno::Reference<beans::XPropertySet> xControlModel(rUnoObj.GetUnoControlModel(),uno::UNO_QUERY);
if ( xControlModel.is() )
xControlModel->setPropertyValue( PROPERTY_MULTILINE,uno::makeAny(true));
}
else
- bChangeOrientation = rUnoObj.GetObjIdentifier() == OBJ_RD_HFIXEDLINE;
+ bChangeOrientation = rUnoObj.GetObjIdentifier() == SdrObjKind::ReportDesignHorizontalFixedLine;
rtl::Reference<SvxShapeControl> pShape = new SvxShapeControl( pObj );
xShape = static_cast<SvxShape_UnoImplHelper *>(pShape.get());
pShape->setShapeKind(pObj->GetObjIdentifier());
diff --git a/reportdesign/source/core/sdr/RptObject.cxx b/reportdesign/source/core/sdr/RptObject.cxx
index e3cfb19d9037..dd83ccef4ba6 100644
--- a/reportdesign/source/core/sdr/RptObject.cxx
+++ b/reportdesign/source/core/sdr/RptObject.cxx
@@ -63,26 +63,26 @@ SdrObjKind OObjectBase::getObjectType(const uno::Reference< report::XReportCompo
uno::Reference< lang::XServiceInfo > xServiceInfo( _xComponent , uno::UNO_QUERY );
OSL_ENSURE(xServiceInfo.is(),"Who deletes the XServiceInfo interface!");
if ( !xServiceInfo )
- return OBJ_NONE;
+ return SdrObjKind::NONE;
if ( xServiceInfo->supportsService( SERVICE_FIXEDTEXT ))
- return OBJ_RD_FIXEDTEXT;
+ return SdrObjKind::ReportDesignFixedText;
if ( xServiceInfo->supportsService( SERVICE_FIXEDLINE ))
{
uno::Reference< report::XFixedLine> xFixedLine(_xComponent,uno::UNO_QUERY);
- return xFixedLine->getOrientation() ? OBJ_RD_HFIXEDLINE : OBJ_RD_VFIXEDLINE;
+ return xFixedLine->getOrientation() ? SdrObjKind::ReportDesignHorizontalFixedLine : SdrObjKind::ReportDesignVerticalFixedLine;
}
if ( xServiceInfo->supportsService( SERVICE_IMAGECONTROL))
- return OBJ_RD_IMAGECONTROL;
+ return SdrObjKind::ReportDesignImageControl;
if ( xServiceInfo->supportsService( SERVICE_FORMATTEDFIELD ))
- return OBJ_RD_FORMATTEDFIELD;
+ return SdrObjKind::ReportDesignFormattedField;
if ( xServiceInfo->supportsService("com.sun.star.drawing.OLE2Shape") )
- return OBJ_OLE2;
+ return SdrObjKind::OLE2;
if ( xServiceInfo->supportsService( SERVICE_SHAPE ))
- return OBJ_CUSTOMSHAPE;
+ return SdrObjKind::CustomShape;
if ( xServiceInfo->supportsService( SERVICE_REPORTDEFINITION ) )
- return OBJ_RD_SUBREPORT;
- return OBJ_OLE2;
+ return SdrObjKind::ReportDesignSubReport;
+ return SdrObjKind::OLE2;
}
SdrObject* OObjectBase::createObject(
@@ -93,13 +93,13 @@ SdrObject* OObjectBase::createObject(
SdrObjKind nType = OObjectBase::getObjectType(_xComponent);
switch( nType )
{
- case OBJ_RD_FIXEDTEXT:
+ case SdrObjKind::ReportDesignFixedText:
{
OUnoObject* pUnoObj = new OUnoObject(
rTargetModel,
_xComponent,
OUString("com.sun.star.form.component.FixedText"),
- OBJ_RD_FIXEDTEXT);
+ SdrObjKind::ReportDesignFixedText);
pNewObj = pUnoObj;
uno::Reference<beans::XPropertySet> xControlModel(pUnoObj->GetUnoControlModel(),uno::UNO_QUERY);
@@ -107,29 +107,29 @@ SdrObject* OObjectBase::createObject(
xControlModel->setPropertyValue( PROPERTY_MULTILINE,uno::makeAny(true));
}
break;
- case OBJ_RD_IMAGECONTROL:
+ case SdrObjKind::ReportDesignImageControl:
pNewObj = new OUnoObject(
rTargetModel,
_xComponent,
OUString("com.sun.star.form.component.DatabaseImageControl"),
- OBJ_RD_IMAGECONTROL);
+ SdrObjKind::ReportDesignImageControl);
break;
- case OBJ_RD_FORMATTEDFIELD:
+ case SdrObjKind::ReportDesignFormattedField:
pNewObj = new OUnoObject(
rTargetModel,
_xComponent,
OUString("com.sun.star.form.component.FormattedField"),
- OBJ_RD_FORMATTEDFIELD);
+ SdrObjKind::ReportDesignFormattedField);
break;
- case OBJ_RD_HFIXEDLINE:
- case OBJ_RD_VFIXEDLINE:
+ case SdrObjKind::ReportDesignHorizontalFixedLine:
+ case SdrObjKind::ReportDesignVerticalFixedLine:
pNewObj = new OUnoObject(
rTargetModel,
_xComponent,
OUString("com.sun.star.awt.UnoControlFixedLineModel"),
nType);
break;
- case OBJ_CUSTOMSHAPE:
+ case SdrObjKind::CustomShape:
pNewObj = OCustomShape::Create(
rTargetModel,
_xComponent);
@@ -144,8 +144,8 @@ SdrObject* OObjectBase::createObject(
DBG_UNHANDLED_EXCEPTION("reportdesign");
}
break;
- case OBJ_RD_SUBREPORT:
- case OBJ_OLE2:
+ case SdrObjKind::ReportDesignSubReport:
+ case SdrObjKind::OLE2:
pNewObj = OOle2Obj::Create(
rTargetModel,
_xComponent,
@@ -222,11 +222,11 @@ namespace
};
}
-const TPropertyNamePair& getPropertyNameMap(sal_uInt16 _nObjectId)
+const TPropertyNamePair& getPropertyNameMap(SdrObjKind _nObjectId)
{
switch(_nObjectId)
{
- case OBJ_RD_IMAGECONTROL:
+ case SdrObjKind::ReportDesignImageControl:
{
static TPropertyNamePair s_aNameMap = []()
{
@@ -240,7 +240,7 @@ const TPropertyNamePair& getPropertyNameMap(sal_uInt16 _nObjectId)
return s_aNameMap;
}
- case OBJ_RD_FIXEDTEXT:
+ case SdrObjKind::ReportDesignFixedText:
{
static TPropertyNamePair s_aNameMap = []()
{
@@ -262,7 +262,7 @@ const TPropertyNamePair& getPropertyNameMap(sal_uInt16 _nObjectId)
}();
return s_aNameMap;
}
- case OBJ_RD_FORMATTEDFIELD:
+ case SdrObjKind::ReportDesignFormattedField:
{
static TPropertyNamePair s_aNameMap = []()
{
@@ -284,7 +284,7 @@ const TPropertyNamePair& getPropertyNameMap(sal_uInt16 _nObjectId)
return s_aNameMap;
}
- case OBJ_CUSTOMSHAPE:
+ case SdrObjKind::CustomShape:
{
static TPropertyNamePair s_aNameMap = []()
{
@@ -477,7 +477,7 @@ OCustomShape::~OCustomShape()
SdrObjKind OCustomShape::GetObjIdentifier() const
{
- return OBJ_CUSTOMSHAPE;
+ return SdrObjKind::CustomShape;
}
SdrInventor OCustomShape::GetObjInventor() const
diff --git a/reportdesign/source/ui/inc/DesignView.hxx b/reportdesign/source/ui/inc/DesignView.hxx
index 15a7d2ed25b8..def0495c1b2e 100644
--- a/reportdesign/source/ui/inc/DesignView.hxx
+++ b/reportdesign/source/ui/inc/DesignView.hxx
@@ -131,7 +131,7 @@ namespace rptui
/** All objects will be marked.
*/
- void SelectAll(const sal_uInt16 _nObjectType);
+ void SelectAll(const SdrObjKind _nObjectType);
/// checks if a selection exists
bool HasSelection() const;
diff --git a/reportdesign/source/ui/inc/ReportController.hxx b/reportdesign/source/ui/inc/ReportController.hxx
index cb86ce7cf235..726ac8012370 100644
--- a/reportdesign/source/ui/inc/ReportController.hxx
+++ b/reportdesign/source/ui/inc/ReportController.hxx
@@ -126,7 +126,7 @@ namespace rptui
* \param _xSection the section where to create the formatted field
* \param _sFunction the function which will be set at the data field.
*/
- void createControl(const css::uno::Sequence< css::beans::PropertyValue >& _aArgs,const css::uno::Reference< css::report::XSection>& _xSection,const OUString& _sFunction ,SdrObjKind _nObjectId = OBJ_RD_FORMATTEDFIELD);
+ void createControl(const css::uno::Sequence< css::beans::PropertyValue >& _aArgs,const css::uno::Reference< css::report::XSection>& _xSection,const OUString& _sFunction ,SdrObjKind _nObjectId = SdrObjKind::ReportDesignFormattedField);
/** switch the report header/footer sectionon off with undo or without depending on the given id.
*
* \param _nId Can either be SID_REPORTHEADER_WITHOUT_UNDO or SID_REPORTFOOTER_WITHOUT_UNDO or SID_REPORTHEADERFOOTER.
diff --git a/reportdesign/source/ui/inc/ReportSection.hxx b/reportdesign/source/ui/inc/ReportSection.hxx
index ad334f194234..03bb57199bac 100644
--- a/reportdesign/source/ui/inc/ReportSection.hxx
+++ b/reportdesign/source/ui/inc/ReportSection.hxx
@@ -104,7 +104,7 @@ namespace rptui
/** All objects will be marked.
*/
- void SelectAll(const sal_uInt16 _nObjectType);
+ void SelectAll(const SdrObjKind _nObjectType);
/** makes the grid visible
*
diff --git a/reportdesign/source/ui/inc/ReportWindow.hxx b/reportdesign/source/ui/inc/ReportWindow.hxx
index c634dcf098f4..7e1716384548 100644
--- a/reportdesign/source/ui/inc/ReportWindow.hxx
+++ b/reportdesign/source/ui/inc/ReportWindow.hxx
@@ -100,7 +100,7 @@ namespace rptui
/** All objects will be marked.
*/
- void SelectAll(const sal_uInt16 _nObjectType);
+ void SelectAll(const SdrObjKind _nObjectType);
/** returns <TRUE/> when an object is marked
*/
diff --git a/reportdesign/source/ui/inc/ScrollHelper.hxx b/reportdesign/source/ui/inc/ScrollHelper.hxx
index eab5c7dd3b8b..076943ff76fc 100644
--- a/reportdesign/source/ui/inc/ScrollHelper.hxx
+++ b/reportdesign/source/ui/inc/ScrollHelper.hxx
@@ -109,7 +109,7 @@ namespace rptui
/** All objects will be marked.
*/
- void SelectAll(const sal_uInt16 _nObjectType);
+ void SelectAll(const SdrObjKind _nObjectType);
/** returns <TRUE/> when an object is marked
*/
diff --git a/reportdesign/source/ui/inc/ViewsWindow.hxx b/reportdesign/source/ui/inc/ViewsWindow.hxx
index c270aae409fc..f83e28ca8a24 100644
--- a/reportdesign/source/ui/inc/ViewsWindow.hxx
+++ b/reportdesign/source/ui/inc/ViewsWindow.hxx
@@ -171,7 +171,7 @@ namespace rptui
/** All objects will be marked.
*/
- void SelectAll(const sal_uInt16 _nObjectType);
+ void SelectAll(const SdrObjKind _nObjectType);
/** returns <TRUE/> when an object is marked
*/
diff --git a/reportdesign/source/ui/misc/UITools.cxx b/reportdesign/source/ui/misc/UITools.cxx
index d5f48ca60ad0..066d330df338 100644
--- a/reportdesign/source/ui/misc/UITools.cxx
+++ b/reportdesign/source/ui/misc/UITools.cxx
@@ -878,7 +878,7 @@ SdrObject* isOver(const tools::Rectangle& _rRect, SdrPage const & _rPage, SdrVie
&& (_bAllObjects || !_rView.IsObjMarked(pObjIter))
&& (dynamic_cast<OUnoObject*>(pObjIter) != nullptr || dynamic_cast<OOle2Obj*>(pObjIter) != nullptr))
{
- if (_nIgnoreType == ISOVER_IGNORE_CUSTOMSHAPES && pObjIter->GetObjIdentifier() == OBJ_CUSTOMSHAPE)
+ if (_nIgnoreType == ISOVER_IGNORE_CUSTOMSHAPES && pObjIter->GetObjIdentifier() == SdrObjKind::CustomShape)
{
continue;
}
diff --git a/reportdesign/source/ui/report/DesignView.cxx b/reportdesign/source/ui/report/DesignView.cxx
index c77c6d5a8eaa..ab213479b9f6 100644
--- a/reportdesign/source/ui/report/DesignView.cxx
+++ b/reportdesign/source/ui/report/DesignView.cxx
@@ -92,7 +92,7 @@ ODesignView::ODesignView( vcl::Window* pParent,
,m_pCurrentView(nullptr)
,m_aMarkIdle("reportdesign ODesignView Mark Idle")
,m_eMode( DlgEdMode::Select )
- ,m_eActObj( OBJ_NONE )
+ ,m_eActObj( SdrObjKind::NONE )
,m_aGridSizeCoarse( 1000, 1000 ) // #i93595# 100TH_MM changed to grid using coarse 1 cm grid
,m_aGridSizeFine( 250, 250 ) // and a 0,25 cm subdivision for better visualisation
,m_bDeleted( false )
@@ -287,7 +287,7 @@ void ODesignView::SetMode( DlgEdMode _eNewMode )
{
m_eMode = _eNewMode;
if ( m_eMode == DlgEdMode::Select )
- m_eActObj = OBJ_NONE;
+ m_eActObj = SdrObjKind::NONE;
m_aScrollWindow->SetMode(_eNewMode);
}
@@ -413,7 +413,7 @@ IMPL_LINK_NOARG( ODesignView, SplitHdl, SplitWindow*, void )
}
}
-void ODesignView::SelectAll(const sal_uInt16 _nObjectType)
+void ODesignView::SelectAll(const SdrObjKind _nObjectType)
{
m_aScrollWindow->SelectAll(_nObjectType);
}
diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx
index d81d100bc129..9e1df7251c9d 100644
--- a/reportdesign/source/ui/report/ReportController.cxx
+++ b/reportdesign/source/ui/report/ReportController.cxx
@@ -598,27 +598,27 @@ FeatureState OReportController::GetState(sal_uInt16 _nId) const
case SID_INSERT_DIAGRAM:
aReturn.bEnabled = isEditable();
aReturn.bInvisible = !m_bChartEnabled;
- aReturn.bChecked = getDesignView()->GetInsertObj() == OBJ_OLE2;
+ aReturn.bChecked = getDesignView()->GetInsertObj() == SdrObjKind::OLE2;
break;
case SID_FM_FIXEDTEXT:
aReturn.bEnabled = isEditable();
- aReturn.bChecked = getDesignView()->GetInsertObj() == OBJ_RD_FIXEDTEXT;
+ aReturn.bChecked = getDesignView()->GetInsertObj() == SdrObjKind::ReportDesignFixedText;
break;
case SID_INSERT_HFIXEDLINE:
aReturn.bEnabled = isEditable();
- aReturn.bChecked = getDesignView()->GetInsertObj() == OBJ_RD_HFIXEDLINE;
+ aReturn.bChecked = getDesignView()->GetInsertObj() == SdrObjKind::ReportDesignHorizontalFixedLine;
break;
case SID_INSERT_VFIXEDLINE:
aReturn.bEnabled = isEditable();
- aReturn.bChecked = getDesignView()->GetInsertObj() == OBJ_RD_VFIXEDLINE;
+ aReturn.bChecked = getDesignView()->GetInsertObj() == SdrObjKind::ReportDesignVerticalFixedLine;
break;
case SID_FM_EDIT:
aReturn.bEnabled = isEditable();
- aReturn.bChecked = getDesignView()->GetInsertObj() == OBJ_RD_FORMATTEDFIELD;
+ aReturn.bChecked = getDesignView()->GetInsertObj() == SdrObjKind::ReportDesignFormattedField;
break;
case SID_FM_IMAGECONTROL:
aReturn.bEnabled = isEditable();
- aReturn.bChecked = getDesignView()->GetInsertObj() == OBJ_RD_IMAGECONTROL;
+ aReturn.bChecked = getDesignView()->GetInsertObj() == SdrObjKind::ReportDesignImageControl;
break;
case SID_DRAWTBX_CS_BASIC:
case SID_DRAWTBX_CS_BASIC1:
@@ -1104,7 +1104,7 @@ void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >
break;
case SID_SELECTALL:
- getDesignView()->SelectAll(OBJ_NONE);
+ getDesignView()->SelectAll(SdrObjKind::NONE);
break;
case SID_SELECTALL_IN_SECTION:
{
@@ -1118,10 +1118,10 @@ void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >
InvalidateFeature( SID_OBJECT_SELECT );
break;
case SID_SELECT_ALL_EDITS:
- getDesignView()->SelectAll(OBJ_RD_FORMATTEDFIELD);
+ getDesignView()->SelectAll(SdrObjKind::ReportDesignFormattedField);
break;
case SID_SELECT_ALL_LABELS:
- getDesignView()->SelectAll(OBJ_RD_FIXEDTEXT);
+ getDesignView()->SelectAll(SdrObjKind::ReportDesignFixedText);
break;
case SID_TERMINATE_INPLACEACTIVATION:
{
@@ -1196,37 +1196,37 @@ void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >
break;
case SID_INSERT_DIAGRAM:
getDesignView()->SetMode( DlgEdMode::Insert );
- getDesignView()->SetInsertObj( OBJ_OLE2);
+ getDesignView()->SetInsertObj( SdrObjKind::OLE2);
createDefaultControl(aArgs);
InvalidateAll();
break;
case SID_FM_FIXEDTEXT:
getDesignView()->SetMode( DlgEdMode::Insert );
- getDesignView()->SetInsertObj( OBJ_RD_FIXEDTEXT );
+ getDesignView()->SetInsertObj( SdrObjKind::ReportDesignFixedText );
createDefaultControl(aArgs);
InvalidateAll();
break;
case SID_INSERT_HFIXEDLINE:
getDesignView()->SetMode( DlgEdMode::Insert );
- getDesignView()->SetInsertObj( OBJ_RD_HFIXEDLINE );
+ getDesignView()->SetInsertObj( SdrObjKind::ReportDesignHorizontalFixedLine );
createDefaultControl(aArgs);
InvalidateAll();
break;
case SID_INSERT_VFIXEDLINE:
getDesignView()->SetMode( DlgEdMode::Insert );
- getDesignView()->SetInsertObj( OBJ_RD_VFIXEDLINE );
+ getDesignView()->SetInsertObj( SdrObjKind::ReportDesignVerticalFixedLine );
createDefaultControl(aArgs);
InvalidateAll();
break;
case SID_FM_EDIT:
getDesignView()->SetMode( DlgEdMode::Insert );
- getDesignView()->SetInsertObj( OBJ_RD_FORMATTEDFIELD );
+ getDesignView()->SetInsertObj( SdrObjKind::ReportDesignFormattedField );
createDefaultControl(aArgs);
InvalidateAll();
break;
case SID_FM_IMAGECONTROL:
getDesignView()->SetMode( DlgEdMode::Insert );
- getDesignView()->SetInsertObj( OBJ_RD_IMAGECONTROL );
+ getDesignView()->SetInsertObj( SdrObjKind::ReportDesignImageControl );
createDefaultControl(aArgs);
InvalidateAll();
break;
@@ -1380,7 +1380,7 @@ void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >
else
sType = aUrl.Complete.getToken(0,'.',nIndex);
- getDesignView()->SetInsertObj( OBJ_CUSTOMSHAPE ,sType);
+ getDesignView()->SetInsertObj( SdrObjKind::CustomShape ,sType);
createDefaultControl(aArgs);
}
InvalidateAll();
@@ -3010,7 +3010,7 @@ void OReportController::insertGraphic()
{ PROPERTY_IMAGEURL, Any(aDialog.GetPath()) },
{ PROPERTY_PRESERVEIRI, Any(bLink) }
}));
- createControl(aArgs,xSection,OUString(),OBJ_RD_IMAGECONTROL);
+ createControl(aArgs,xSection,OUString(),SdrObjKind::ReportDesignImageControl);
}
}
catch(const Exception&)
@@ -3115,7 +3115,7 @@ void OReportController::createControl(const Sequence< PropertyValue >& _aArgs,co
SdrObject* pNewControl = nullptr;
uno::Reference< report::XReportComponent> xShapeProp;
- if ( _nObjectId == OBJ_CUSTOMSHAPE )
+ if ( _nObjectId == SdrObjKind::CustomShape )
{
pNewControl = SdrObjFactory::MakeNewObject(
*m_aReportModel,
@@ -3128,7 +3128,7 @@ void OReportController::createControl(const Sequence< PropertyValue >& _aArgs,co
OReportSection::createDefault(sCustomShapeType,pNewControl);
pNewControl->SetLogicRect(tools::Rectangle(3000,500,6000,3500)); // switch height and width
}
- else if ( _nObjectId == OBJ_OLE2 || OBJ_RD_SUBREPORT == _nObjectId )
+ else if ( _nObjectId == SdrObjKind::OLE2 || SdrObjKind::ReportDesignSubReport == _nObjectId )
{
pNewControl = SdrObjFactory::MakeNewObject(
*m_aReportModel,
@@ -3156,7 +3156,7 @@ void OReportController::createControl(const Sequence< PropertyValue >& _aArgs,co
nullptr,
_nObjectId,
SdrInventor::ReportDesign,
- OBJ_RD_FIXEDTEXT,
+ SdrObjKind::ReportDesignFixedText,
// tdf#118963 Need a SdrModel for SdrObject creation. Dereferencing
// m_aReportModel seems pretty safe, it's done in other places, initialized
@@ -3213,9 +3213,9 @@ void OReportController::createControl(const Sequence< PropertyValue >& _aArgs,co
pObj->CreateMediator(true);
- if ( _nObjectId == OBJ_RD_FIXEDTEXT ) // special case for fixed text
+ if ( _nObjectId == SdrObjKind::ReportDesignFixedText ) // special case for fixed text
xUnoProp->setPropertyValue(PROPERTY_LABEL,uno::makeAny(OUnoObject::GetDefaultName(pObj)));
- else if ( _nObjectId == OBJ_RD_VFIXEDLINE )
+ else if ( _nObjectId == SdrObjKind::ReportDesignVerticalFixedLine )
{
awt::Size aOlSize = xShapeProp->getSize();
xShapeProp->setSize(awt::Size(aOlSize.Height,aOlSize.Width)); // switch height and width
@@ -3424,7 +3424,7 @@ void OReportController::addPairControls(const Sequence< PropertyValue >& aArgs)
if ( !xField.is() )
continue;
- SdrObjKind nOBJID = OBJ_NONE;
+ SdrObjKind nOBJID = SdrObjKind::NONE;
sal_Int32 nDataType = sdbc::DataType::BINARY;
xField->getPropertyValue(PROPERTY_TYPE) >>= nDataType;
switch ( nDataType )
@@ -3432,14 +3432,14 @@ void OReportController::addPairControls(const Sequence< PropertyValue >& aArgs)
case sdbc::DataType::BINARY:
case sdbc::DataType::VARBINARY:
case sdbc::DataType::LONGVARBINARY:
- nOBJID = OBJ_RD_IMAGECONTROL;
+ nOBJID = SdrObjKind::ReportDesignImageControl;
break;
default:
- nOBJID = OBJ_RD_FORMATTEDFIELD;
+ nOBJID = SdrObjKind::ReportDesignFormattedField;
break;
}
- if ( !nOBJID )
+ if ( nOBJID == SdrObjKind::NONE )
continue;
Reference< util::XNumberFormatsSupplier > xSupplier = getReportNumberFormatter()->getNumberFormatsSupplier();
@@ -3463,7 +3463,7 @@ void OReportController::addPairControls(const Sequence< PropertyValue >& aArgs)
xNumberFormats,
nOBJID,
SdrInventor::ReportDesign,
- OBJ_RD_FIXEDTEXT,
+ SdrObjKind::ReportDesignFixedText,
// tdf#118963 Need a SdrModel for SdrObject creation. Dereferencing
// m_aReportModel seems pretty safe, it's done in other places, initialized
@@ -3534,7 +3534,7 @@ void OReportController::addPairControls(const Sequence< PropertyValue >& aArgs)
xField->getPropertyValue(PROPERTY_LABEL) >>= sLabel;
if (pSectionViews[0] != pSectionViews[1] &&
- nOBJID == OBJ_RD_FORMATTEDFIELD) // we want this nice feature only at FORMATTEDFIELD
+ nOBJID == SdrObjKind::ReportDesignFormattedField) // we want this nice feature only at FORMATTEDFIELD
{
uno::Reference< report::XReportComponent> xShapePropLabel(pObjs[0]->getUnoShape(),uno::UNO_QUERY_THROW);
uno::Reference< report::XReportComponent> xShapePropTextField(pObjs[1]->getUnoShape(),uno::UNO_QUERY_THROW);
@@ -4182,7 +4182,7 @@ bool OReportController::impl_setPropertyAtControls_throw(TranslateId pUndoResId,
void OReportController::impl_fillCustomShapeState_nothrow(const char* _pCustomShapeType,dbaui::FeatureState& _rState) const
{
_rState.bEnabled = isEditable();
- _rState.bChecked = getDesignView()->GetInsertObj() == OBJ_CUSTOMSHAPE && getDesignView()->GetInsertObjString().equalsAscii(_pCustomShapeType);
+ _rState.bChecked = getDesignView()->GetInsertObj() == SdrObjKind::CustomShape && getDesignView()->GetInsertObjString().equalsAscii(_pCustomShapeType);
}
diff --git a/reportdesign/source/ui/report/ReportSection.cxx b/reportdesign/source/ui/report/ReportSection.cxx
index 35aff0e6d6b3..57c1bddb2797 100644
--- a/reportdesign/source/ui/report/ReportSection.cxx
+++ b/reportdesign/source/ui/report/ReportSection.cxx
@@ -391,12 +391,12 @@ void OReportSection::SetGridVisible(bool _bVisible)
m_pView->SetGridVisible( _bVisible );
}
-void OReportSection::SelectAll(const sal_uInt16 _nObjectType)
+void OReportSection::SelectAll(const SdrObjKind _nObjectType)
{
if ( !m_pView )
return;
- if ( _nObjectType == OBJ_NONE )
+ if ( _nObjectType == SdrObjKind::NONE )
m_pView->MarkAllObj();
else
{
diff --git a/reportdesign/source/ui/report/ReportWindow.cxx b/reportdesign/source/ui/report/ReportWindow.cxx
index ed6f614b5859..8da0855f6146 100644
--- a/reportdesign/source/ui/report/ReportWindow.cxx
+++ b/reportdesign/source/ui/report/ReportWindow.cxx
@@ -272,7 +272,7 @@ bool OReportWindow::IsPasteAllowed() const
return m_aViewsWindow->IsPasteAllowed();
}
-void OReportWindow::SelectAll(const sal_uInt16 _nObjectType)
+void OReportWindow::SelectAll(const SdrObjKind _nObjectType)
{
m_aViewsWindow->SelectAll(_nObjectType);
diff --git a/reportdesign/source/ui/report/ScrollHelper.cxx b/reportdesign/source/ui/report/ScrollHelper.cxx
index 07dd4fd50016..bf5f261cfd7f 100644
--- a/reportdesign/source/ui/report/ScrollHelper.cxx
+++ b/reportdesign/source/ui/report/ScrollHelper.cxx
@@ -258,7 +258,7 @@ bool OScrollWindowHelper::IsPasteAllowed() const
return m_aReportWindow->IsPasteAllowed();
}
-void OScrollWindowHelper::SelectAll(const sal_uInt16 _nObjectType)
+void OScrollWindowHelper::SelectAll(const SdrObjKind _nObjectType)
{
m_aReportWindow->SelectAll(_nObjectType);
}
diff --git a/reportdesign/source/ui/report/ViewsWindow.cxx b/reportdesign/source/ui/report/ViewsWindow.cxx
index 68c110780ce1..f856654fed63 100644
--- a/reportdesign/source/ui/report/ViewsWindow.cxx
+++ b/reportdesign/source/ui/report/ViewsWindow.cxx
@@ -479,7 +479,7 @@ bool OViewsWindow::IsPasteAllowed() const
return aTransferData.HasFormat(OReportExchange::getDescriptorFormatId());
}
-void OViewsWindow::SelectAll(const sal_uInt16 _nObjectType)
+void OViewsWindow::SelectAll(const SdrObjKind _nObjectType)
{
m_bInUnmark = true;
::std::for_each(m_aSections.begin(),m_aSections.end(),
diff --git a/reportdesign/source/ui/report/dlgedfac.cxx b/reportdesign/source/ui/report/dlgedfac.cxx
index ceb2d6402ee5..f7b8a27f64b4 100644
--- a/reportdesign/source/ui/report/dlgedfac.cxx
+++ b/reportdesign/source/ui/report/dlgedfac.cxx
@@ -49,43 +49,43 @@ IMPL_STATIC_LINK(
{
switch( aParams.nObjIdentifier )
{
- case OBJ_RD_FIXEDTEXT:
+ case SdrObjKind::ReportDesignFixedText:
pNewObj = new OUnoObject(aParams.rSdrModel, SERVICE_FIXEDTEXT
,OUString("com.sun.star.form.component.FixedText")
- ,OBJ_RD_FIXEDTEXT);
+ ,SdrObjKind::ReportDesignFixedText);
break;
- case OBJ_RD_IMAGECONTROL:
+ case SdrObjKind::ReportDesignImageControl:
pNewObj = new OUnoObject(aParams.rSdrModel, SERVICE_IMAGECONTROL
,OUString("com.sun.star.form.component.DatabaseImageControl")
- ,OBJ_RD_IMAGECONTROL);
+ ,SdrObjKind::ReportDesignImageControl);
break;
- case OBJ_RD_FORMATTEDFIELD:
+ case SdrObjKind::ReportDesignFormattedField:
pNewObj = new OUnoObject(aParams.rSdrModel, SERVICE_FORMATTEDFIELD
,OUString("com.sun.star.form.component.FormattedField")
- ,OBJ_RD_FORMATTEDFIELD);
+ ,SdrObjKind::ReportDesignFormattedField);
break;
- case OBJ_RD_VFIXEDLINE:
- case OBJ_RD_HFIXEDLINE:
+ case SdrObjKind::ReportDesignVerticalFixedLine:
+ case SdrObjKind::ReportDesignHorizontalFixedLine:
{
OUnoObject* pObj = new OUnoObject(aParams.rSdrModel, SERVICE_FIXEDLINE
,OUString("com.sun.star.awt.UnoControlFixedLineModel")
,aParams.nObjIdentifier);
pNewObj = pObj;
- if ( aParams.nObjIdentifier == OBJ_RD_HFIXEDLINE )
+ if ( aParams.nObjIdentifier == SdrObjKind::ReportDesignHorizontalFixedLine )
{
uno::Reference<beans::XPropertySet> xProp = pObj->getAwtComponent();
xProp->setPropertyValue( PROPERTY_ORIENTATION, uno::makeAny(sal_Int32(0)) );
}
}
break;
- case OBJ_CUSTOMSHAPE:
+ case SdrObjKind::CustomShape:
pNewObj = new OCustomShape(aParams.rSdrModel, SERVICE_SHAPE);
break;
- case OBJ_RD_SUBREPORT:
- pNewObj = new OOle2Obj(aParams.rSdrModel, SERVICE_REPORTDEFINITION, OBJ_RD_SUBREPORT);
+ case SdrObjKind::ReportDesignSubReport:
+ pNewObj = new OOle2Obj(aParams.rSdrModel, SERVICE_REPORTDEFINITION, SdrObjKind::ReportDesignSubReport);
break;
- case OBJ_OLE2:
- pNewObj = new OOle2Obj(aParams.rSdrModel, "com.sun.star.chart2.ChartDocument", OBJ_OLE2);
+ case SdrObjKind::OLE2:
+ pNewObj = new OOle2Obj(aParams.rSdrModel, "com.sun.star.chart2.ChartDocument", SdrObjKind::OLE2);
break;
default:
OSL_FAIL("Unknown object id");
diff --git a/reportdesign/source/ui/report/dlgedfunc.cxx b/reportdesign/source/ui/report/dlgedfunc.cxx
index e258f659e05b..a5456ce9865e 100644
--- a/reportdesign/source/ui/report/dlgedfunc.cxx
+++ b/reportdesign/source/ui/report/dlgedfunc.cxx
@@ -375,11 +375,11 @@ void DlgEdFunc::activateOle(SdrObject* _pObj)
if ( !_pObj )
return;
- const sal_uInt16 nSdrObjKind = _pObj->GetObjIdentifier();
+ const SdrObjKind nSdrObjKind = _pObj->GetObjIdentifier();
// OLE: activate
- if (nSdrObjKind != OBJ_OLE2)
+ if (nSdrObjKind != SdrObjKind::OLE2)
return;
SdrOle2Obj* pOleObj = dynamic_cast<SdrOle2Obj*>(_pObj);
@@ -537,7 +537,7 @@ bool DlgEdFunc::isOnlyCustomShapeMarked() const
{
SdrMark* pMark = rMarkList.GetMark(i);
SdrObject* pObj = pMark->GetMarkedSdrObj();
- if (pObj->GetObjIdentifier() != OBJ_CUSTOMSHAPE)
+ if (pObj->GetObjIdentifier() != SdrObjKind::CustomShape)
{
// we found an object in the marked objects, which is not a custom shape.
bReturn = false;
@@ -597,7 +597,7 @@ bool DlgEdFunc::isRectangleHit(const MouseEvent& rMEvt)
}
}
}
- else if (aVEvt.mpObj && (aVEvt.mpObj->GetObjIdentifier() != OBJ_CUSTOMSHAPE) && !m_bSelectionMode)
+ else if (aVEvt.mpObj && (aVEvt.mpObj->GetObjIdentifier() != SdrObjKind::CustomShape) && !m_bSelectionMode)
{
colorizeOverlappedObject(aVEvt.mpObj);
}
@@ -643,11 +643,11 @@ bool DlgEdFuncInsert::MouseButtonDown( const MouseEvent& rMEvt )
return true;
SdrViewEvent aVEvt;
- sal_Int16 nId = m_rView.GetCurrentObjIdentifier();
+ SdrObjKind nId = m_rView.GetCurrentObjIdentifier();
const SdrHitKind eHit = m_rView.PickAnything(rMEvt, SdrMouseEventKind::BUTTONDOWN, aVEvt);
- if (eHit == SdrHitKind::UnmarkedObject && nId != OBJ_CUSTOMSHAPE)
+ if (eHit == SdrHitKind::UnmarkedObject && nId != SdrObjKind::CustomShape)
{
// there is an object under the mouse cursor, but not a customshape
m_pParent->getSectionWindow()->getViewsWindow()->BrkAction();