diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-02-16 13:45:37 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-02-17 07:52:09 +0200 |
commit | f1421a3e12167fafc966d069b3a4f7eb84ffda05 (patch) | |
tree | 478c783517a88afdcc238fe95eda06e57fa61a3f /basic/source/sbx | |
parent | fb4bf693999b8a1ebf79bad0d223ae2d4398cf81 (diff) |
convert SbxNameType to scoped enum
and drop unused enumerators
Change-Id: I2b47828b2146fcda335f1dc1c1f61a1139abbe19
Diffstat (limited to 'basic/source/sbx')
-rw-r--r-- | basic/source/sbx/sbxobj.cxx | 4 | ||||
-rw-r--r-- | basic/source/sbx/sbxvar.cxx | 38 |
2 files changed, 13 insertions, 29 deletions
diff --git a/basic/source/sbx/sbxobj.cxx b/basic/source/sbx/sbxobj.cxx index 69533d97ccf4..7763e96d90bf 100644 --- a/basic/source/sbx/sbxobj.cxx +++ b/basic/source/sbx/sbxobj.cxx @@ -764,7 +764,7 @@ void SbxObject::Dump( SvStream& rStrm, bool bFill ) SbxVariable* pVar = r.get(); if( pVar ) { - OUString aLine = aIndent + " - " + pVar->GetName( SbxNAME_SHORT_TYPES ); + OUString aLine = aIndent + " - " + pVar->GetName( SbxNameType::ShortTypes ); OUString aAttrs2; if( CollectAttrs( pVar, aAttrs2 ) ) { @@ -801,7 +801,7 @@ void SbxObject::Dump( SvStream& rStrm, bool bFill ) SbxVariable* pVar = r.get(); if( pVar ) { - OUString aLine = aIndent + " - " + pVar->GetName( SbxNAME_SHORT_TYPES ); + OUString aLine = aIndent + " - " + pVar->GetName( SbxNameType::ShortTypes ); OUString aAttrs3; if( CollectAttrs( pVar, aAttrs3 ) ) { diff --git a/basic/source/sbx/sbxvar.cxx b/basic/source/sbx/sbxvar.cxx index 097b04c0b1a6..dcd969426561 100644 --- a/basic/source/sbx/sbxvar.cxx +++ b/basic/source/sbx/sbxvar.cxx @@ -232,7 +232,7 @@ void SbxVariable::SetName( const OUString& rName ) const OUString& SbxVariable::GetName( SbxNameType t ) const { static const char cSuffixes[] = " %&!#@ $"; - if( t == SbxNAME_NONE ) + if( t == SbxNameType::NONE ) { return maName; } @@ -247,7 +247,7 @@ const OUString& SbxVariable::GetName( SbxNameType t ) const OUString aTmp( maName ); // short type? Then fetch it, possible this is 0. SbxDataType et = GetType(); - if( t == SbxNAME_SHORT_TYPES ) + if( t == SbxNameType::ShortTypes ) { if( et <= SbxSTRING ) { @@ -279,7 +279,7 @@ const OUString& SbxVariable::GetName( SbxNameType t ) const aTmp += i->aName; cType = ' '; // short type? Then fetch it, possible this is 0. - if( t == SbxNAME_SHORT_TYPES ) + if( t == SbxNameType::ShortTypes ) { if( nt <= SbxSTRING ) { @@ -301,34 +301,18 @@ const OUString& SbxVariable::GetName( SbxNameType t ) const aTmp += "()"; } // long type? - if( t != SbxNAME_SHORT ) + aTmp += GetSbxRes( StringId::As ); + if( nt < 32 ) { - aTmp += GetSbxRes( StringId::As ); - if( nt < 32 ) - { - aTmp += GetSbxRes( static_cast<StringId>( static_cast<int>( StringId::Types ) + nt ) ); - } - else - { - aTmp += GetSbxRes( StringId::Any ); - } + aTmp += GetSbxRes( static_cast<StringId>( static_cast<int>( StringId::Types ) + nt ) ); + } + else + { + aTmp += GetSbxRes( StringId::Any ); } } } aTmp += ")"; - // Long type? Then fetch it - if( t == SbxNAME_LONG_TYPES && et != SbxEMPTY ) - { - aTmp += GetSbxRes( StringId::As ); - if( et < 32 ) - { - aTmp += GetSbxRes( static_cast<StringId>( static_cast<int>( StringId::Types ) + et ) ); - } - else - { - aTmp += GetSbxRes( StringId::Any ); - } - } const_cast<SbxVariable*>(this)->aToolString = aTmp; return aToolString; } @@ -699,7 +683,7 @@ void SbxAlias::Notify( SfxBroadcaster&, const SfxHint& rHint ) void SbxVariable::Dump( SvStream& rStrm, bool bFill ) { - OString aBNameStr(OUStringToOString(GetName( SbxNAME_SHORT_TYPES ), RTL_TEXTENCODING_ASCII_US)); + OString aBNameStr(OUStringToOString(GetName( SbxNameType::ShortTypes ), RTL_TEXTENCODING_ASCII_US)); rStrm.WriteCharPtr( "Variable( " ) .WriteCharPtr( OString::number(reinterpret_cast<sal_Int64>(this)).getStr() ).WriteCharPtr( "==" ) .WriteCharPtr( aBNameStr.getStr() ); |