diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2020-09-10 22:15:13 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-09-11 09:09:35 +0200 |
commit | e83201a5fcfa7470cdad76c93c497e71b1caa7f4 (patch) | |
tree | 7e242be8e4d140b306148df1e166da22233a3206 | |
parent | 51f4691e7f4f3bceac1d5ec9cbbf37de7e71e471 (diff) |
convert IMAP_OBJ to scoped enum
Change-Id: Id265c098a173b2daf581568779d99c7574f067c4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102406
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | include/vcl/imapcirc.hxx | 2 | ||||
-rw-r--r-- | include/vcl/imapobj.hxx | 13 | ||||
-rw-r--r-- | include/vcl/imappoly.hxx | 2 | ||||
-rw-r--r-- | include/vcl/imaprect.hxx | 2 | ||||
-rw-r--r-- | sd/source/filter/html/htmlex.cxx | 10 | ||||
-rw-r--r-- | sfx2/source/bastyp/sfxhtml.cxx | 24 | ||||
-rw-r--r-- | svtools/source/svhtml/htmlout.cxx | 6 | ||||
-rw-r--r-- | svtools/source/uno/unoimap.cxx | 46 | ||||
-rw-r--r-- | svx/source/dialog/imapwnd.cxx | 6 | ||||
-rw-r--r-- | vcl/source/treelist/imap.cxx | 52 | ||||
-rw-r--r-- | vcl/source/treelist/imap2.cxx | 12 |
11 files changed, 89 insertions, 86 deletions
diff --git a/include/vcl/imapcirc.hxx b/include/vcl/imapcirc.hxx index 11e369d09621..0be06dff8cd3 100644 --- a/include/vcl/imapcirc.hxx +++ b/include/vcl/imapcirc.hxx @@ -49,7 +49,7 @@ public: bool bActive = true, bool bPixelCoords = true ); - virtual sal_uInt16 GetType() const override; + virtual IMapObjectType GetType() const override; virtual bool IsHit( const Point& rPoint ) const override; Point GetCenter( bool bPixelCoords = true ) const; diff --git a/include/vcl/imapobj.hxx b/include/vcl/imapobj.hxx index 982e350547e2..14a7a647e884 100644 --- a/include/vcl/imapobj.hxx +++ b/include/vcl/imapobj.hxx @@ -26,11 +26,14 @@ class Point; class SvStream; -#define IMAP_OBJ_RECTANGLE (sal_uInt16(0x0001)) -#define IMAP_OBJ_CIRCLE (sal_uInt16(0x0002)) -#define IMAP_OBJ_POLYGON (sal_uInt16(0x0003)) -#define IMAP_OBJ_VERSION (sal_uInt16(0x0005)) +enum class IMapObjectType +{ + Rectangle = 1, + Circle = 2, + Polygon = 3 +}; +#define IMAP_OBJ_VERSION (sal_uInt16(0x0005)) #define IMAGE_MAP_VERSION (sal_uInt16(0x0001)) #define IMAPMAGIC "SDIMAP" @@ -90,7 +93,7 @@ public: IMapObject & operator =(IMapObject const &) = default; IMapObject & operator =(IMapObject &&) = default; - virtual sal_uInt16 GetType() const = 0; + virtual IMapObjectType GetType() const = 0; virtual bool IsHit( const Point& rPoint ) const = 0; void Write ( SvStream& rOStm ) const; diff --git a/include/vcl/imappoly.hxx b/include/vcl/imappoly.hxx index 7bf48b6d5aa7..5a9e80c27a69 100644 --- a/include/vcl/imappoly.hxx +++ b/include/vcl/imappoly.hxx @@ -49,7 +49,7 @@ public: bool bActive = true, bool bPixelCoords = true ); - virtual sal_uInt16 GetType() const override; + virtual IMapObjectType GetType() const override; virtual bool IsHit( const Point& rPoint ) const override; tools::Polygon GetPolygon( bool bPixelCoords = true ) const; diff --git a/include/vcl/imaprect.hxx b/include/vcl/imaprect.hxx index 9f9ab842a71b..5870779f4912 100644 --- a/include/vcl/imaprect.hxx +++ b/include/vcl/imaprect.hxx @@ -47,7 +47,7 @@ public: bool bActive = true, bool bPixelCoords = true ); - virtual sal_uInt16 GetType() const override; + virtual IMapObjectType GetType() const override; virtual bool IsHit( const Point& rPoint ) const override; tools::Rectangle GetRectangle( bool bPixelCoords = true ) const; diff --git a/sd/source/filter/html/htmlex.cxx b/sd/source/filter/html/htmlex.cxx index 86853af8e241..406fbf2eb1d1 100644 --- a/sd/source/filter/html/htmlex.cxx +++ b/sd/source/filter/html/htmlex.cxx @@ -1699,7 +1699,7 @@ bool HtmlExport::CreateHtmlForPresPages() for (sal_uInt16 nArea = 0; nArea < nAreaCount; nArea++) { IMapObject* pArea = rIMap.GetIMapObject(nArea); - sal_uInt16 nType = pArea->GetType(); + IMapObjectType nType = pArea->GetType(); OUString aURL( pArea->GetURL() ); // if necessary, convert page and object names into the @@ -1723,7 +1723,7 @@ bool HtmlExport::CreateHtmlForPresPages() switch(nType) { - case IMAP_OBJ_RECTANGLE: + case IMapObjectType::Rectangle: { ::tools::Rectangle aArea(static_cast<IMapRectangleObject*>(pArea)-> GetRectangle(false)); @@ -1740,7 +1740,7 @@ bool HtmlExport::CreateHtmlForPresPages() } break; - case IMAP_OBJ_CIRCLE: + case IMapObjectType::Circle: { Point aCenter(static_cast<IMapCircleObject*>(pArea)-> GetCenter(false)); @@ -1758,7 +1758,7 @@ bool HtmlExport::CreateHtmlForPresPages() } break; - case IMAP_OBJ_POLYGON: + case IMapObjectType::Polygon: { tools::Polygon aArea(static_cast<IMapPolygonObject*>(pArea)->GetPolygon(false)); aStr.append(CreateHTMLPolygonArea(::basegfx::B2DPolyPolygon(aArea.getB2DPolygon()), @@ -1770,7 +1770,7 @@ bool HtmlExport::CreateHtmlForPresPages() default: { - SAL_INFO("sd", "unknown IMAP_OBJ_type"); + SAL_INFO("sd", "unknown IMapObjectType"); } break; } diff --git a/sfx2/source/bastyp/sfxhtml.cxx b/sfx2/source/bastyp/sfxhtml.cxx index a7c5428198a2..2e7cd46f6c30 100644 --- a/sfx2/source/bastyp/sfxhtml.cxx +++ b/sfx2/source/bastyp/sfxhtml.cxx @@ -45,15 +45,15 @@ using namespace ::com::sun::star; // <INPUT TYPE=xxx> -HTMLOptionEnum<sal_uInt16> const aAreaShapeOptEnums[] = +HTMLOptionEnum<IMapObjectType> const aAreaShapeOptEnums[] = { - { OOO_STRING_SVTOOLS_HTML_SH_rect, IMAP_OBJ_RECTANGLE }, - { OOO_STRING_SVTOOLS_HTML_SH_rectangle, IMAP_OBJ_RECTANGLE }, - { OOO_STRING_SVTOOLS_HTML_SH_circ, IMAP_OBJ_CIRCLE }, - { OOO_STRING_SVTOOLS_HTML_SH_circle, IMAP_OBJ_CIRCLE }, - { OOO_STRING_SVTOOLS_HTML_SH_poly, IMAP_OBJ_POLYGON }, - { OOO_STRING_SVTOOLS_HTML_SH_polygon, IMAP_OBJ_POLYGON }, - { nullptr, 0 } + { OOO_STRING_SVTOOLS_HTML_SH_rect, IMapObjectType::Rectangle }, + { OOO_STRING_SVTOOLS_HTML_SH_rectangle, IMapObjectType::Rectangle }, + { OOO_STRING_SVTOOLS_HTML_SH_circ, IMapObjectType::Circle }, + { OOO_STRING_SVTOOLS_HTML_SH_circle, IMapObjectType::Circle }, + { OOO_STRING_SVTOOLS_HTML_SH_poly, IMapObjectType::Polygon }, + { OOO_STRING_SVTOOLS_HTML_SH_polygon, IMapObjectType::Polygon }, + { nullptr, IMapObjectType::Rectangle } }; SfxHTMLParser::SfxHTMLParser( SvStream& rStream, bool bIsNewDoc, @@ -104,7 +104,7 @@ bool SfxHTMLParser::ParseAreaOptions(ImageMap * pImageMap, const OUString& rBase { DBG_ASSERT( pImageMap, "ParseAreaOptions: no Image-Map" ); - sal_uInt16 nShape = IMAP_OBJ_RECTANGLE; + IMapObjectType nShape = IMapObjectType::Rectangle; std::vector<sal_uInt32> aCoords; OUString aName, aHRef, aAlt, aTarget; bool bNoHRef = false; @@ -173,7 +173,7 @@ IMAPOBJ_SETEVENT: bool bNewArea = true; switch( nShape ) { - case IMAP_OBJ_RECTANGLE: + case IMapObjectType::Rectangle: if( aCoords.size() >=4 ) { tools::Rectangle aRect( aCoords[0], aCoords[1], @@ -185,7 +185,7 @@ IMAPOBJ_SETEVENT: pImageMap->InsertIMapObject( std::move(pMapRObj) ); } break; - case IMAP_OBJ_CIRCLE: + case IMapObjectType::Circle: if( aCoords.size() >=3 ) { Point aPoint( aCoords[0], aCoords[1] ); @@ -196,7 +196,7 @@ IMAPOBJ_SETEVENT: pImageMap->InsertIMapObject( std::move(pMapCObj) ); } break; - case IMAP_OBJ_POLYGON: + case IMapObjectType::Polygon: if( aCoords.size() >=6 ) { sal_uInt16 nCount = aCoords.size() / 2; diff --git a/svtools/source/svhtml/htmlout.cxx b/svtools/source/svhtml/htmlout.cxx index 20d06954fdc7..300818e665ad 100644 --- a/svtools/source/svhtml/htmlout.cxx +++ b/svtools/source/svhtml/htmlout.cxx @@ -645,7 +645,7 @@ SvStream& HTMLOutFuncs::Out_ImageMap( SvStream& rStream, OString aCoords; switch( pObj->GetType() ) { - case IMAP_OBJ_RECTANGLE: + case IMapObjectType::Rectangle: { const IMapRectangleObject* pRectObj = static_cast<const IMapRectangleObject *>(pObj); @@ -663,7 +663,7 @@ SvStream& HTMLOutFuncs::Out_ImageMap( SvStream& rStream, .makeStringAndClear(); } break; - case IMAP_OBJ_CIRCLE: + case IMapObjectType::Circle: { const IMapCircleObject* pCirc = static_cast<const IMapCircleObject *>(pObj); @@ -680,7 +680,7 @@ SvStream& HTMLOutFuncs::Out_ImageMap( SvStream& rStream, .makeStringAndClear(); } break; - case IMAP_OBJ_POLYGON: + case IMapObjectType::Polygon: { const IMapPolygonObject* pPolyObj = static_cast<const IMapPolygonObject *>(pObj); diff --git a/svtools/source/uno/unoimap.cxx b/svtools/source/uno/unoimap.cxx index c040767d3c63..05863169a3bb 100644 --- a/svtools/source/uno/unoimap.cxx +++ b/svtools/source/uno/unoimap.cxx @@ -73,7 +73,7 @@ class SvUnoImageMapObject : public OWeakAggObject, public XUnoTunnel { public: - SvUnoImageMapObject( sal_uInt16 nType, const SvEventDescription* pSupportedMacroItems ); + SvUnoImageMapObject( IMapObjectType nType, const SvEventDescription* pSupportedMacroItems ); SvUnoImageMapObject( const IMapObject& rMapObject, const SvEventDescription* pSupportedMacroItems ); UNO3_GETIMPLEMENTATION_DECL( SvUnoImageMapObject ) @@ -105,10 +105,10 @@ public: virtual Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override; private: - static rtl::Reference<PropertySetInfo> createPropertySetInfo( sal_uInt16 nType ); + static rtl::Reference<PropertySetInfo> createPropertySetInfo( IMapObjectType nType ); - sal_uInt16 mnType; + IMapObjectType mnType; OUString maURL; OUString maAltText; @@ -126,11 +126,11 @@ private: UNO3_GETIMPLEMENTATION_IMPL( SvUnoImageMapObject ); -rtl::Reference<PropertySetInfo> SvUnoImageMapObject::createPropertySetInfo( sal_uInt16 nType ) +rtl::Reference<PropertySetInfo> SvUnoImageMapObject::createPropertySetInfo( IMapObjectType nType ) { switch( nType ) { - case IMAP_OBJ_POLYGON: + case IMapObjectType::Polygon: { static PropertyMapEntry const aPolygonObj_Impl[] = { @@ -146,7 +146,7 @@ rtl::Reference<PropertySetInfo> SvUnoImageMapObject::createPropertySetInfo( sal_ return rtl::Reference<PropertySetInfo>(new PropertySetInfo( aPolygonObj_Impl )); } - case IMAP_OBJ_CIRCLE: + case IMapObjectType::Circle: { static PropertyMapEntry const aCircleObj_Impl[] = { @@ -163,7 +163,7 @@ rtl::Reference<PropertySetInfo> SvUnoImageMapObject::createPropertySetInfo( sal_ return rtl::Reference<PropertySetInfo>(new PropertySetInfo( aCircleObj_Impl )); } - case IMAP_OBJ_RECTANGLE: + case IMapObjectType::Rectangle: default: { static PropertyMapEntry const aRectangleObj_Impl[] = @@ -183,7 +183,7 @@ rtl::Reference<PropertySetInfo> SvUnoImageMapObject::createPropertySetInfo( sal_ } } -SvUnoImageMapObject::SvUnoImageMapObject( sal_uInt16 nType, const SvEventDescription* pSupportedMacroItems ) +SvUnoImageMapObject::SvUnoImageMapObject( IMapObjectType nType, const SvEventDescription* pSupportedMacroItems ) : PropertySetHelper( createPropertySetInfo( nType ) ), mnType( nType ) , mbIsActive( true ) @@ -207,7 +207,7 @@ SvUnoImageMapObject::SvUnoImageMapObject( const IMapObject& rMapObject, const Sv switch( mnType ) { - case IMAP_OBJ_RECTANGLE: + case IMapObjectType::Rectangle: { const tools::Rectangle aRect( static_cast<const IMapRectangleObject*>(&rMapObject)->GetRectangle(false) ); maBoundary.X = aRect.Left(); @@ -216,7 +216,7 @@ SvUnoImageMapObject::SvUnoImageMapObject( const IMapObject& rMapObject, const Sv maBoundary.Height = aRect.GetHeight(); } break; - case IMAP_OBJ_CIRCLE: + case IMapObjectType::Circle: { mnRadius = static_cast<sal_Int32>(static_cast<const IMapCircleObject*>(&rMapObject)->GetRadius(false)); const Point aPoint( static_cast<const IMapCircleObject*>(&rMapObject)->GetCenter(false) ); @@ -225,7 +225,7 @@ SvUnoImageMapObject::SvUnoImageMapObject( const IMapObject& rMapObject, const Sv maCenter.Y = aPoint.Y(); } break; - case IMAP_OBJ_POLYGON: + case IMapObjectType::Polygon: default: { const tools::Polygon aPoly( static_cast<const IMapPolygonObject*>(&rMapObject)->GetPolygon(false) ); @@ -260,21 +260,21 @@ std::unique_ptr<IMapObject> SvUnoImageMapObject::createIMapObject() const switch( mnType ) { - case IMAP_OBJ_RECTANGLE: + case IMapObjectType::Rectangle: { const tools::Rectangle aRect( maBoundary.X, maBoundary.Y, maBoundary.X + maBoundary.Width - 1, maBoundary.Y + maBoundary.Height - 1 ); pNewIMapObject.reset(new IMapRectangleObject( aRect, aURL, aAltText, aDesc, aTarget, aName, mbIsActive, false )); } break; - case IMAP_OBJ_CIRCLE: + case IMapObjectType::Circle: { const Point aCenter( maCenter.X, maCenter.Y ); pNewIMapObject.reset(new IMapCircleObject( aCenter, mnRadius, aURL, aAltText, aDesc, aTarget, aName, mbIsActive, false )); } break; - case IMAP_OBJ_POLYGON: + case IMapObjectType::Polygon: default: { const sal_uInt16 nCount = static_cast<sal_uInt16>(maPolygon.getLength()); @@ -368,14 +368,14 @@ Sequence< OUString > SAL_CALL SvUnoImageMapObject::getSupportedServiceNames() aSNS.getArray()[0] = "com.sun.star.image.ImageMapObject"; switch( mnType ) { - case IMAP_OBJ_POLYGON: + case IMapObjectType::Polygon: default: aSNS.getArray()[1] = "com.sun.star.image.ImageMapPolygonObject"; break; - case IMAP_OBJ_RECTANGLE: + case IMapObjectType::Rectangle: aSNS.getArray()[1] = "com.sun.star.image.ImageMapRectangleObject"; break; - case IMAP_OBJ_CIRCLE: + case IMapObjectType::Circle: aSNS.getArray()[1] = "com.sun.star.image.ImageMapCircleObject"; break; } @@ -386,12 +386,12 @@ OUString SAL_CALL SvUnoImageMapObject::getImplementationName() { switch( mnType ) { - case IMAP_OBJ_POLYGON: + case IMapObjectType::Polygon: default: return "org.openoffice.comp.svt.ImageMapPolygonObject"; - case IMAP_OBJ_CIRCLE: + case IMapObjectType::Circle: return "org.openoffice.comp.svt.ImageMapCircleObject"; - case IMAP_OBJ_RECTANGLE: + case IMapObjectType::Rectangle: return "org.openoffice.comp.svt.ImageMapRectangleObject"; } } @@ -687,17 +687,17 @@ void SvUnoImageMap::fillImageMap( ImageMap& rMap ) const Reference< XInterface > SvUnoImageMapRectangleObject_createInstance( const SvEventDescription* pSupportedMacroItems ) { - return static_cast<XWeak*>(new SvUnoImageMapObject( IMAP_OBJ_RECTANGLE, pSupportedMacroItems )); + return static_cast<XWeak*>(new SvUnoImageMapObject( IMapObjectType::Rectangle, pSupportedMacroItems )); } Reference< XInterface > SvUnoImageMapCircleObject_createInstance( const SvEventDescription* pSupportedMacroItems ) { - return static_cast<XWeak*>(new SvUnoImageMapObject( IMAP_OBJ_CIRCLE, pSupportedMacroItems )); + return static_cast<XWeak*>(new SvUnoImageMapObject( IMapObjectType::Circle, pSupportedMacroItems )); } Reference< XInterface > SvUnoImageMapPolygonObject_createInstance( const SvEventDescription* pSupportedMacroItems ) { - return static_cast<XWeak*>(new SvUnoImageMapObject( IMAP_OBJ_POLYGON, pSupportedMacroItems )); + return static_cast<XWeak*>(new SvUnoImageMapObject( IMapObjectType::Polygon, pSupportedMacroItems )); } Reference< XInterface > SvUnoImageMap_createInstance() diff --git a/svx/source/dialog/imapwnd.cxx b/svx/source/dialog/imapwnd.cxx index 65d2c95ea6a6..51fee17c8ce6 100644 --- a/svx/source/dialog/imapwnd.cxx +++ b/svx/source/dialog/imapwnd.cxx @@ -183,7 +183,7 @@ SdrObject* IMapWindow::CreateObj( const IMapObject* pIMapObj ) switch( pIMapObj->GetType() ) { - case IMAP_OBJ_RECTANGLE: + case IMapObjectType::Rectangle: { const IMapRectangleObject* pIMapRectObj = static_cast<const IMapRectangleObject*>(pIMapObj); tools::Rectangle aDrawRect( pIMapRectObj->GetRectangle( false ) ); @@ -196,7 +196,7 @@ SdrObject* IMapWindow::CreateObj( const IMapObject* pIMapObj ) } break; - case IMAP_OBJ_CIRCLE: + case IMapObjectType::Circle: { const IMapCircleObject* pIMapCircleObj = static_cast<const IMapCircleObject*>(pIMapObj); const Point aCenter( pIMapCircleObj->GetCenter( false ) ); @@ -217,7 +217,7 @@ SdrObject* IMapWindow::CreateObj( const IMapObject* pIMapObj ) } break; - case IMAP_OBJ_POLYGON: + case IMapObjectType::Polygon: { const IMapPolygonObject* pIMapPolyObj = static_cast<const IMapPolygonObject*>(pIMapObj); diff --git a/vcl/source/treelist/imap.cxx b/vcl/source/treelist/imap.cxx index 3c08c220d3fc..b2e5989a94b0 100644 --- a/vcl/source/treelist/imap.cxx +++ b/vcl/source/treelist/imap.cxx @@ -68,7 +68,7 @@ void IMapObject::Write( SvStream& rOStm ) const { const rtl_TextEncoding eEncoding = osl_getThreadTextEncoding(); - rOStm.WriteUInt16( GetType() ); + rOStm.WriteUInt16( static_cast<sal_uInt16>(GetType()) ); rOStm.WriteUInt16( IMAP_OBJ_VERSION ); rOStm.WriteUInt16( eEncoding ); @@ -187,9 +187,9 @@ void IMapRectangleObject::ReadIMapObject( SvStream& rIStm ) |* \******************************************************************************/ -sal_uInt16 IMapRectangleObject::GetType() const +IMapObjectType IMapRectangleObject::GetType() const { - return IMAP_OBJ_RECTANGLE; + return IMapObjectType::Rectangle; } @@ -304,9 +304,9 @@ void IMapCircleObject::ReadIMapObject( SvStream& rIStm ) |* \******************************************************************************/ -sal_uInt16 IMapCircleObject::GetType() const +IMapObjectType IMapCircleObject::GetType() const { - return IMAP_OBJ_CIRCLE; + return IMapObjectType::Circle; } @@ -444,9 +444,9 @@ void IMapPolygonObject::ReadIMapObject( SvStream& rIStm ) |* \******************************************************************************/ -sal_uInt16 IMapPolygonObject::GetType() const +IMapObjectType IMapPolygonObject::GetType() const { - return IMAP_OBJ_POLYGON; + return IMapObjectType::Polygon; } @@ -573,15 +573,15 @@ ImageMap::ImageMap( const ImageMap& rImageMap ) switch( pCopyObj->GetType() ) { - case IMAP_OBJ_RECTANGLE: + case IMapObjectType::Rectangle: maList.emplace_back( new IMapRectangleObject( *static_cast<IMapRectangleObject*>( pCopyObj ) ) ); break; - case IMAP_OBJ_CIRCLE: + case IMapObjectType::Circle: maList.emplace_back( new IMapCircleObject( *static_cast<IMapCircleObject*>( pCopyObj ) ) ); break; - case IMAP_OBJ_POLYGON: + case IMapObjectType::Polygon: maList.emplace_back( new IMapPolygonObject( *static_cast<IMapPolygonObject*>( pCopyObj ) ) ); break; @@ -639,15 +639,15 @@ ImageMap& ImageMap::operator=( const ImageMap& rImageMap ) switch( pCopyObj->GetType() ) { - case IMAP_OBJ_RECTANGLE: + case IMapObjectType::Rectangle: maList.emplace_back( new IMapRectangleObject( *static_cast<IMapRectangleObject*>(pCopyObj) ) ); break; - case IMAP_OBJ_CIRCLE: + case IMapObjectType::Circle: maList.emplace_back( new IMapCircleObject( *static_cast<IMapCircleObject*>(pCopyObj) ) ); break; - case IMAP_OBJ_POLYGON: + case IMapObjectType::Polygon: maList.emplace_back( new IMapPolygonObject( *static_cast<IMapPolygonObject*>(pCopyObj) ) ); break; @@ -687,21 +687,21 @@ bool ImageMap::operator==( const ImageMap& rImageMap ) { switch( pObj->GetType() ) { - case IMAP_OBJ_RECTANGLE: + case IMapObjectType::Rectangle: { if ( ! static_cast<IMapRectangleObject*>(pObj)->IsEqual( *static_cast<IMapRectangleObject*>(pEqObj) ) ) bDifferent = true; } break; - case IMAP_OBJ_CIRCLE: + case IMapObjectType::Circle: { if ( ! static_cast<IMapCircleObject*>(pObj)->IsEqual( *static_cast<IMapCircleObject*>(pEqObj) ) ) bDifferent = true; } break; - case IMAP_OBJ_POLYGON: + case IMapObjectType::Polygon: { if ( ! static_cast<IMapPolygonObject*>(pObj)->IsEqual( *static_cast<IMapPolygonObject*>(pEqObj) ) ) bDifferent = true; @@ -746,15 +746,15 @@ void ImageMap::InsertIMapObject( const IMapObject& rIMapObject ) { switch( rIMapObject.GetType() ) { - case IMAP_OBJ_RECTANGLE: + case IMapObjectType::Rectangle: maList.emplace_back( new IMapRectangleObject( static_cast<const IMapRectangleObject&>( rIMapObject ) ) ); break; - case IMAP_OBJ_CIRCLE: + case IMapObjectType::Circle: maList.emplace_back( new IMapCircleObject( static_cast<const IMapCircleObject&>( rIMapObject ) ) ); break; - case IMAP_OBJ_POLYGON: + case IMapObjectType::Polygon: maList.emplace_back( new IMapPolygonObject( static_cast<const IMapPolygonObject&>( rIMapObject ) ) ); break; @@ -814,15 +814,15 @@ void ImageMap::Scale( const Fraction& rFracX, const Fraction& rFracY ) switch( pObj->GetType() ) { - case IMAP_OBJ_RECTANGLE: + case IMapObjectType::Rectangle: static_cast<IMapRectangleObject*>( pObj )->Scale( rFracX, rFracY ); break; - case IMAP_OBJ_CIRCLE: + case IMapObjectType::Circle: static_cast<IMapCircleObject*>( pObj )->Scale( rFracX, rFracY ); break; - case IMAP_OBJ_POLYGON: + case IMapObjectType::Polygon: static_cast<IMapPolygonObject*>( pObj )->Scale( rFracX, rFracY ); break; @@ -877,9 +877,9 @@ void ImageMap::ImpReadImageMap( SvStream& rIStm, size_t nCount ) rIStm.ReadUInt16( nType ); rIStm.SeekRel( -2 ); - switch( nType ) + switch( static_cast<IMapObjectType>(nType) ) { - case IMAP_OBJ_RECTANGLE: + case IMapObjectType::Rectangle: { IMapRectangleObject* pObj = new IMapRectangleObject; pObj->Read( rIStm ); @@ -887,7 +887,7 @@ void ImageMap::ImpReadImageMap( SvStream& rIStm, size_t nCount ) } break; - case IMAP_OBJ_CIRCLE: + case IMapObjectType::Circle: { IMapCircleObject* pObj = new IMapCircleObject; pObj->Read( rIStm ); @@ -895,7 +895,7 @@ void ImageMap::ImpReadImageMap( SvStream& rIStm, size_t nCount ) } break; - case IMAP_OBJ_POLYGON: + case IMapObjectType::Polygon: { IMapPolygonObject* pObj = new IMapPolygonObject; pObj->Read( rIStm ); diff --git a/vcl/source/treelist/imap2.cxx b/vcl/source/treelist/imap2.cxx index 5f8e8bb22531..c9d0bef53ce7 100644 --- a/vcl/source/treelist/imap2.cxx +++ b/vcl/source/treelist/imap2.cxx @@ -162,15 +162,15 @@ void ImageMap::ImpWriteCERN( SvStream& rOStm ) const switch( pObj->GetType() ) { - case IMAP_OBJ_RECTANGLE: + case IMapObjectType::Rectangle: static_cast<IMapRectangleObject*>( pObj )->WriteCERN( rOStm ); break; - case IMAP_OBJ_CIRCLE: + case IMapObjectType::Circle: static_cast<IMapCircleObject*>( pObj )->WriteCERN( rOStm ); break; - case IMAP_OBJ_POLYGON: + case IMapObjectType::Polygon: static_cast<IMapPolygonObject*>( pObj )->WriteCERN( rOStm ); break; @@ -190,15 +190,15 @@ void ImageMap::ImpWriteNCSA( SvStream& rOStm ) const switch( pObj->GetType() ) { - case IMAP_OBJ_RECTANGLE: + case IMapObjectType::Rectangle: static_cast<IMapRectangleObject*>( pObj )->WriteNCSA( rOStm ); break; - case IMAP_OBJ_CIRCLE: + case IMapObjectType::Circle: static_cast<IMapCircleObject*>( pObj )->WriteNCSA( rOStm ); break; - case IMAP_OBJ_POLYGON: + case IMapObjectType::Polygon: static_cast<IMapPolygonObject*>( pObj )->WriteNCSA( rOStm ); break; |