drawinglayer/source/primitive2d/helplineprimitive2d.cxx | 4 +- include/drawinglayer/primitive2d/helplineprimitive2d.hxx | 6 ++-- include/tools/rc.h | 22 ++++++++++----- rsc/source/parser/rscicpx.cxx | 12 ++++---- svx/source/sdr/contact/viewobjectcontactofsdrpage.cxx | 6 ++-- vcl/source/control/button.cxx | 8 ++--- vcl/source/image/ImageList.cxx | 8 ++--- 7 files changed, 38 insertions(+), 28 deletions(-)
New commits: commit e66c1a6f32fa682c60be672020f4ee8890b96a11 Author: Noel Grandin <[email protected]> Date: Sun May 22 12:52:06 2016 +0200 Convert HelplineStyle2D to scoped enum Change-Id: I32b3c61ed40fe041a395544c1ab32d8e1b5f89fa Reviewed-on: https://gerrit.libreoffice.org/25297 Tested-by: Jenkins <[email protected]> Reviewed-by: Noel Grandin <[email protected]> diff --git a/drawinglayer/source/primitive2d/helplineprimitive2d.cxx b/drawinglayer/source/primitive2d/helplineprimitive2d.cxx index dc5f846..d51c4db 100644 --- a/drawinglayer/source/primitive2d/helplineprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/helplineprimitive2d.cxx @@ -44,7 +44,7 @@ namespace drawinglayer switch(getStyle()) { - default : // HELPLINESTYLE2D_POINT + default : // HelplineStyle2D::Point { const double fViewFixValue(15.0); basegfx::B2DVector aNormalizedDirection(getDirection()); @@ -71,7 +71,7 @@ namespace drawinglayer break; } - case HELPLINESTYLE2D_LINE : + case HelplineStyle2D::Line : { basegfx::B2DPolygon aLine; diff --git a/include/drawinglayer/primitive2d/helplineprimitive2d.hxx b/include/drawinglayer/primitive2d/helplineprimitive2d.hxx index f37cf08..be3a056 100644 --- a/include/drawinglayer/primitive2d/helplineprimitive2d.hxx +++ b/include/drawinglayer/primitive2d/helplineprimitive2d.hxx @@ -37,10 +37,10 @@ namespace drawinglayer The available styles of Helplines */ - enum HelplineStyle2D + enum class HelplineStyle2D { - HELPLINESTYLE2D_POINT, - HELPLINESTYLE2D_LINE + Point, + Line }; /** HelplinePrimitive2D class diff --git a/svx/source/sdr/contact/viewobjectcontactofsdrpage.cxx b/svx/source/sdr/contact/viewobjectcontactofsdrpage.cxx index 27f951f..37112a9 100644 --- a/svx/source/sdr/contact/viewobjectcontactofsdrpage.cxx +++ b/svx/source/sdr/contact/viewobjectcontactofsdrpage.cxx @@ -551,21 +551,21 @@ drawinglayer::primitive2d::Primitive2DContainer ViewObjectContactOfPageHelplines default : // SDRHELPLINE_POINT { xRetval[a] = drawinglayer::primitive2d::Primitive2DReference(new drawinglayer::primitive2d::HelplinePrimitive2D( - aPosition, basegfx::B2DVector(1.0, 0.0), drawinglayer::primitive2d::HELPLINESTYLE2D_POINT, + aPosition, basegfx::B2DVector(1.0, 0.0), drawinglayer::primitive2d::HelplineStyle2D::Point, aRGBColorA, aRGBColorB, fDiscreteDashLength)); break; } case SDRHELPLINE_VERTICAL : { xRetval[a] = drawinglayer::primitive2d::Primitive2DReference(new drawinglayer::primitive2d::HelplinePrimitive2D( - aPosition, basegfx::B2DVector(0.0, 1.0), drawinglayer::primitive2d::HELPLINESTYLE2D_LINE, + aPosition, basegfx::B2DVector(0.0, 1.0), drawinglayer::primitive2d::HelplineStyle2D::Line, aRGBColorA, aRGBColorB, fDiscreteDashLength)); break; } case SDRHELPLINE_HORIZONTAL : { xRetval[a] = drawinglayer::primitive2d::Primitive2DReference(new drawinglayer::primitive2d::HelplinePrimitive2D( - aPosition, basegfx::B2DVector(1.0, 0.0), drawinglayer::primitive2d::HELPLINESTYLE2D_LINE, + aPosition, basegfx::B2DVector(1.0, 0.0), drawinglayer::primitive2d::HelplineStyle2D::Line, aRGBColorA, aRGBColorB, fDiscreteDashLength)); break; } commit 44e20713ebcd3b3ed9a490f54b0b17bd6cd57372 Author: Noel Grandin <[email protected]> Date: Sat May 21 15:41:43 2016 +0200 Convert RSC_IMAGEBUTTON to scoped enum Change-Id: Iedb0cfa8678627dbd0445e05524bd26a2c5838a2 Reviewed-on: https://gerrit.libreoffice.org/25258 Tested-by: Jenkins <[email protected]> Reviewed-by: Noel Grandin <[email protected]> diff --git a/include/tools/rc.h b/include/tools/rc.h index 87c7713..714ea98 100644 --- a/include/tools/rc.h +++ b/include/tools/rc.h @@ -143,9 +143,14 @@ namespace o3tl { #define RSC_DOCKINGWINDOW_FLOATING 0x08 // For "ImageButtons": -#define RSC_IMAGEBUTTON_IMAGE 0x01 -#define RSC_IMAGEBUTTON_SYMBOL 0x02 -#define RSC_IMAGEBUTTON_STATE 0x04 +enum class RscImageButtonFlags { + Image = 0x01, + Symbol = 0x02, + State = 0x04 +}; +namespace o3tl { + template<> struct typed_flags<RscImageButtonFlags> : is_typed_flags<RscImageButtonFlags, 0x07> {}; +} // For "Image": #define RSC_IMAGE_IMAGEBITMAP 0x01 diff --git a/rsc/source/parser/rscicpx.cxx b/rsc/source/parser/rscicpx.cxx index 86a9a29..8156779 100644 --- a/rsc/source/parser/rscicpx.cxx +++ b/rsc/source/parser/rscicpx.cxx @@ -378,7 +378,7 @@ RscTop * RscTypCont::InitClassImageButton( RscTop * pSuper, { nId = aNmTb.Put( "ButtonImage", VARNAME ); pClassImageButton->SetVariable( nId, pClassImage, nullptr, 0, - RSC_IMAGEBUTTON_IMAGE ); + (sal_uInt32)RscImageButtonFlags::Image ); } // initialize variables { @@ -415,11 +415,11 @@ RscTop * RscTypCont::InitClassImageButton( RscTop * pSuper, // add variable nVarId = aNmTb.Put( "Symbol", VARNAME ); pClassImageButton->SetVariable( nVarId, pSymbol, nullptr, 0, - RSC_IMAGEBUTTON_SYMBOL ); + (sal_uInt32)RscImageButtonFlags::Symbol ); } nId = aNmTb.Put( "State", VARNAME ); pClassImageButton->SetVariable( nId, pTriState, nullptr, 0, - RSC_IMAGEBUTTON_STATE ); + (sal_uInt32)RscImageButtonFlags::State ); INS_WINBIT(pClassImageButton,Repeat) INS_WINBIT(pClassImageButton,SmallStyle) diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx index 46d9f19..75e92e5 100644 --- a/vcl/source/control/button.cxx +++ b/vcl/source/control/button.cxx @@ -3800,18 +3800,18 @@ ImageButton::ImageButton( vcl::Window* pParent, WinBits nStyle ) : ImageButton::ImageButton( vcl::Window* pParent, const ResId& rResId ) : PushButton( pParent, rResId.SetRT( RSC_IMAGEBUTTON ) ) { - sal_uLong nObjMask = ReadLongRes(); + RscImageButtonFlags nObjMask = (RscImageButtonFlags)ReadLongRes(); - if ( RSC_IMAGEBUTTON_IMAGE & nObjMask ) + if ( RscImageButtonFlags::Image & nObjMask ) { SetModeImage( Image( ResId( static_cast<RSHEADER_TYPE*>(GetClassRes()), *rResId.GetResMgr() ) ) ); IncrementRes( GetObjSizeRes( static_cast<RSHEADER_TYPE*>(GetClassRes()) ) ); } - if ( RSC_IMAGEBUTTON_SYMBOL & nObjMask ) + if ( RscImageButtonFlags::Symbol & nObjMask ) SetSymbol( (SymbolType)ReadLongRes() ); - if ( RSC_IMAGEBUTTON_STATE & nObjMask ) + if ( RscImageButtonFlags::State & nObjMask ) SetState( (TriState)ReadLongRes() ); ImplInitStyle(); commit ef0e063938d1821f362a975ae83c2ab212267b98 Author: Noel Grandin <[email protected]> Date: Sat May 21 15:37:47 2016 +0200 Convert RSC_IMAGELIST to scoped enum Change-Id: Iaf5f0723ab3e23e9afa1836a1b4cd8af2d86f010 Reviewed-on: https://gerrit.libreoffice.org/25257 Tested-by: Jenkins <[email protected]> Reviewed-by: Noel Grandin <[email protected]> diff --git a/include/tools/rc.h b/include/tools/rc.h index 97e17fb..87c7713 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 1e07291..86a9a29 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 7c60222..1ba8768 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(); } } _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
