From bcb41235deaf4b7ca90522bda3ba21a686819e6e Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 4 May 2016 11:31:33 +0200 Subject: convert SfxStyleFamily to scoped enum and update the RSC compiler to accept such In the process fix some confusion in SD where it was confusing SfxStyleFamily and the index of the relevant family (which other parts of the code in SVL use) Change-Id: I1efc9f85fbed8ab76eafe8f6e1ada411753ae5f9 --- rsc/inc/rscdb.hxx | 2 ++ rsc/source/parser/rscicpx.cxx | 10 +++++----- rsc/source/parser/rsclex.cxx | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) (limited to 'rsc') diff --git a/rsc/inc/rscdb.hxx b/rsc/inc/rscdb.hxx index 4f76a146fe1d..ea4cdd029923 100644 --- a/rsc/inc/rscdb.hxx +++ b/rsc/inc/rscdb.hxx @@ -44,6 +44,7 @@ enum class MenuItemBits : sal_Int16; enum class ToolBoxItemType; enum class ButtonType; enum class WindowAlign; +enum class SfxStyleFamily; struct WriteRcContext { @@ -151,6 +152,7 @@ class RscTypCont inline void SETCONST( RscConst *p1, const char * p2, ToolBoxItemType p3 ) { SETCONST(p1, p2, static_cast(p3)); } inline void SETCONST( RscConst *p1, const char * p2, ButtonType p3 ) { SETCONST(p1, p2, static_cast(p3)); } inline void SETCONST( RscConst *p1, const char * p2, WindowAlign p3 ) { SETCONST(p1, p2, static_cast(p3)); } + inline void SETCONST( RscConst *p1, const char * p2, SfxStyleFamily p3 ) { SETCONST(p1, p2, static_cast(p3)); } void InitLangType(); RscEnum * InitFieldUnitsType(); RscEnum * InitColor(); diff --git a/rsc/source/parser/rscicpx.cxx b/rsc/source/parser/rscicpx.cxx index e11f08aa4339..2060798e9cfd 100644 --- a/rsc/source/parser/rscicpx.cxx +++ b/rsc/source/parser/rscicpx.cxx @@ -1312,11 +1312,11 @@ RscTop * RscTypCont::InitClassSfxStyleFamilyItem( RscTop * pSuper, pSfxStyleFamily = new RscEnum( pHS->getID( "StyleFamily" ), RSC_NOTYPE ); - SETCONST( pSfxStyleFamily, "SFX_STYLE_FAMILY_PARA", SFX_STYLE_FAMILY_PARA ); - SETCONST( pSfxStyleFamily, "SFX_STYLE_FAMILY_CHAR", SFX_STYLE_FAMILY_CHAR ); - SETCONST( pSfxStyleFamily, "SFX_STYLE_FAMILY_FRAME",SFX_STYLE_FAMILY_FRAME); - SETCONST( pSfxStyleFamily, "SFX_STYLE_FAMILY_PAGE", SFX_STYLE_FAMILY_PAGE ); - SETCONST( pSfxStyleFamily, "SFX_STYLE_FAMILY_PSEUDO", SFX_STYLE_FAMILY_PSEUDO ); + SETCONST( pSfxStyleFamily, "SfxStyleFamily::Para", SfxStyleFamily::Para ); + SETCONST( pSfxStyleFamily, "SfxStyleFamily::Char", SfxStyleFamily::Char ); + SETCONST( pSfxStyleFamily, "SfxStyleFamily::Frame",SfxStyleFamily::Frame); + SETCONST( pSfxStyleFamily, "SfxStyleFamily::Page", SfxStyleFamily::Page ); + SETCONST( pSfxStyleFamily, "SfxStyleFamily::Pseudo", SfxStyleFamily::Pseudo ); aBaseLst.push_back( pSfxStyleFamily ); nId = aNmTb.Put( "StyleFamily", VARNAME ); diff --git a/rsc/source/parser/rsclex.cxx b/rsc/source/parser/rsclex.cxx index f5f7c0cb7871..5edea4cee401 100644 --- a/rsc/source/parser/rsclex.cxx +++ b/rsc/source/parser/rsclex.cxx @@ -221,7 +221,7 @@ int MakeToken( YYSTYPE * pTokenVal ) Atom nHashId; OStringBuffer aBuf( 256 ); - while( isalnum (c) || (c == '_') || (c == '-') ) + while( isalnum (c) || (c == '_') || (c == '-') || (c == ':')) { aBuf.append( sal_Char(c) ); c = pFI->GetFastChar(); -- cgit