diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2016-05-21 15:37:47 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-05-22 17:53:52 +0000 |
commit | ef0e063938d1821f362a975ae83c2ab212267b98 (patch) | |
tree | 7538dfc1f8c54ab4a90edea815ce6564c8754682 | |
parent | a887bed580a3e6388f8da0c5a19fd87888e11e95 (diff) |
Convert RSC_IMAGELIST to scoped enum
Change-Id: Iaf5f0723ab3e23e9afa1836a1b4cd8af2d86f010
Reviewed-on: https://gerrit.libreoffice.org/25257
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
-rw-r--r-- | include/tools/rc.h | 11 | ||||
-rw-r--r-- | rsc/source/parser/rscicpx.cxx | 6 | ||||
-rw-r--r-- | vcl/source/image/ImageList.cxx | 8 |
3 files changed, 15 insertions, 10 deletions
diff --git a/include/tools/rc.h b/include/tools/rc.h index 97e17fb524d9..87c7713935c1 100644 --- a/include/tools/rc.h +++ b/include/tools/rc.h @@ -153,9 +153,14 @@ namespace o3tl { #define RSC_IMAGE_MASKCOLOR 0x04 // For "ImageList": -#define RSC_IMAGELIST_MASKCOLOR 0x04 -#define RSC_IMAGELIST_IDLIST 0x08 -#define RSC_IMAGELIST_IDCOUNT 0x10 +enum class RscImageListFlags { + MaskColor = 0x04, + IdList = 0x08, + IdCount = 0x10 +}; +namespace o3tl { + template<> struct typed_flags<RscImageListFlags> : is_typed_flags<RscImageListFlags, 0x1c> {}; +} // FIXME obsolete, should be removed by MM #define RSC_COLOR (RSC_NOTYPE + 0x16) diff --git a/rsc/source/parser/rscicpx.cxx b/rsc/source/parser/rscicpx.cxx index 1e072918c365..86a9a299bf15 100644 --- a/rsc/source/parser/rscicpx.cxx +++ b/rsc/source/parser/rscicpx.cxx @@ -179,21 +179,21 @@ RscTop * RscTypCont::InitClassImageList( RscTop * pSuper, nId = aNmTb.Put( "MaskColor", VARNAME ); pClassImageList->SetVariable( nId, pClassColor, nullptr, - VAR_SVDYNAMIC, RSC_IMAGELIST_MASKCOLOR ); + VAR_SVDYNAMIC, (sal_uInt32)RscImageListFlags::MaskColor ); RscCont * pCont = new RscCont( pHS->getID( "sal_uInt16 *" ), RSC_NOTYPE ); pCont->SetTypeClass( &aIdUShort ); aBaseLst.push_back( pCont ); nId = aNmTb.Put( "IdList", VARNAME ); pClassImageList->SetVariable( nId, pCont, nullptr, 0, - RSC_IMAGELIST_IDLIST ); + (sal_uInt32)RscImageListFlags::IdList ); nId = aNmTb.Put( "FileList", VARNAME ); pClassImageList->SetVariable( nId, pStrLst ); nId = aNmTb.Put( "IdCount", VARNAME ); pClassImageList->SetVariable( nId, &aUShort, nullptr, 0, - RSC_IMAGELIST_IDCOUNT ); + (sal_uInt32)RscImageListFlags::IdCount ); return pClassImageList; } diff --git a/vcl/source/image/ImageList.cxx b/vcl/source/image/ImageList.cxx index 7c602223e4c2..1ba8768f22a2 100644 --- a/vcl/source/image/ImageList.cxx +++ b/vcl/source/image/ImageList.cxx @@ -55,16 +55,16 @@ ImageList::ImageList( const ResId& rResId ) : { pResMgr->Increment( sizeof( RSHEADER_TYPE ) ); - sal_uLong nObjMask = pResMgr->ReadLong(); + RscImageListFlags nObjMask = (RscImageListFlags)pResMgr->ReadLong(); pResMgr->ReadString(); //skip string std::unique_ptr< Color > xMaskColor; - if( nObjMask & RSC_IMAGE_MASKCOLOR ) + if( nObjMask & RscImageListFlags::MaskColor ) xMaskColor.reset( new Color( ResId( static_cast<RSHEADER_TYPE*>(pResMgr->GetClass()), *pResMgr ) ) ); pResMgr->Increment( ResMgr::GetObjSize( static_cast<RSHEADER_TYPE*>(pResMgr->GetClass()) ) ); - if( nObjMask & RSC_IMAGELIST_IDLIST ) + if( nObjMask & RscImageListFlags::IdList ) { for( sal_Int32 i = 0, nCount = pResMgr->ReadLong(); i < nCount; ++i ) pResMgr->ReadLong(); @@ -81,7 +81,7 @@ ImageList::ImageList( const ResId& rResId ) : mpImplData->AddImage( aName, nId, aEmpty ); } - if( nObjMask & RSC_IMAGELIST_IDCOUNT ) + if( nObjMask & RscImageListFlags::IdCount ) pResMgr->ReadShort(); } } |