diff options
author | Noel Grandin <noel@peralex.com> | 2016-02-24 12:19:44 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2016-02-24 12:19:44 +0200 |
commit | 670c2b3ca99c9ae4a75c508408023de198e3ac5e (patch) | |
tree | 2c71b7d2e598fea55b9d6096f8214c72f07eeda7 /basic | |
parent | 459e3fe7c97abe922e42e464ace2914546602f44 (diff) |
simply the SbxRes stuff, inheriting from OUString is icky
Change-Id: Ie9794ea164d587ad87ee13d360cb3abc18166051
Diffstat (limited to 'basic')
-rw-r--r-- | basic/source/sbx/sbxbool.cxx | 8 | ||||
-rw-r--r-- | basic/source/sbx/sbxcoll.cxx | 8 | ||||
-rw-r--r-- | basic/source/sbx/sbxobj.cxx | 4 | ||||
-rw-r--r-- | basic/source/sbx/sbxres.cxx | 8 | ||||
-rw-r--r-- | basic/source/sbx/sbxres.hxx | 8 | ||||
-rw-r--r-- | basic/source/sbx/sbxstr.cxx | 4 | ||||
-rw-r--r-- | basic/source/sbx/sbxvar.cxx | 16 |
7 files changed, 23 insertions, 33 deletions
diff --git a/basic/source/sbx/sbxbool.cxx b/basic/source/sbx/sbxbool.cxx index 402214b4b275..563c9f47070b 100644 --- a/basic/source/sbx/sbxbool.cxx +++ b/basic/source/sbx/sbxbool.cxx @@ -70,9 +70,9 @@ enum SbxBOOL ImpGetBool( const SbxValues* p ) nRes = SbxFALSE; if ( p->pOUString ) { - if( p->pOUString->equalsIgnoreAsciiCase( SbxRes( StringId::True ) ) ) + if( p->pOUString->equalsIgnoreAsciiCase( GetSbxRes( StringId::True ) ) ) nRes = SbxTRUE; - else if( !p->pOUString->equalsIgnoreAsciiCase( SbxRes( StringId::False ) ) ) + else if( !p->pOUString->equalsIgnoreAsciiCase( GetSbxRes( StringId::False ) ) ) { // it can be convertible to a number bool bError = true; @@ -174,9 +174,9 @@ void ImpPutBool( SbxValues* p, sal_Int16 n ) case SbxSTRING: case SbxLPSTR: if ( !p->pOUString ) - p->pOUString = new OUString( SbxRes( n ? StringId::True : StringId::False ) ); + p->pOUString = new OUString( GetSbxRes( n ? StringId::True : StringId::False ) ); else - *p->pOUString = SbxRes( n ? StringId::True : StringId::False ); + *p->pOUString = GetSbxRes( n ? StringId::True : StringId::False ); break; case SbxOBJECT: diff --git a/basic/source/sbx/sbxcoll.cxx b/basic/source/sbx/sbxcoll.cxx index 6b8ba2fc029a..58d7dec9a8a8 100644 --- a/basic/source/sbx/sbxcoll.cxx +++ b/basic/source/sbx/sbxcoll.cxx @@ -35,10 +35,10 @@ SbxCollection::SbxCollection( const OUString& rClass ) { if( !nCountHash ) { - pCount = OUString::createFromAscii(GetSbxRes( StringId::CountProp )); - pAdd = OUString::createFromAscii(GetSbxRes( StringId::AddMeth )); - pItem = OUString::createFromAscii(GetSbxRes( StringId::ItemMeth )); - pRemove = OUString::createFromAscii(GetSbxRes( StringId::RemoveMeth )); + pCount = GetSbxRes( StringId::CountProp ); + pAdd = GetSbxRes( StringId::AddMeth ); + pItem = GetSbxRes( StringId::ItemMeth ); + pRemove = GetSbxRes( StringId::RemoveMeth ); nCountHash = MakeHashCode( pCount ); nAddHash = MakeHashCode( pAdd ); nItemHash = MakeHashCode( pItem ); diff --git a/basic/source/sbx/sbxobj.cxx b/basic/source/sbx/sbxobj.cxx index 33dae801cd48..ce7f866058e6 100644 --- a/basic/source/sbx/sbxobj.cxx +++ b/basic/source/sbx/sbxobj.cxx @@ -40,8 +40,8 @@ SbxObject::SbxObject( const OUString& rClass ) aData.pObj = this; if( !nNameHash ) { - pNameProp = OUString::createFromAscii(GetSbxRes( StringId::NameProp )); - pParentProp = OUString::createFromAscii(GetSbxRes( StringId::ParentProp )); + pNameProp = GetSbxRes( StringId::NameProp ); + pParentProp = GetSbxRes( StringId::ParentProp ); nNameHash = MakeHashCode( pNameProp ); nParentHash = MakeHashCode( pParentProp ); } diff --git a/basic/source/sbx/sbxres.cxx b/basic/source/sbx/sbxres.cxx index 608b3e224a3c..125969e3efd9 100644 --- a/basic/source/sbx/sbxres.cxx +++ b/basic/source/sbx/sbxres.cxx @@ -72,13 +72,9 @@ static const char* pSbxRes[] = { "True" }; -const char* GetSbxRes( StringId nId ) +OUString GetSbxRes( StringId nId ) { - return ( ( nId > StringId::LastValue ) ? "???" : pSbxRes[ static_cast<int>( nId ) ] ); + return OUString::createFromAscii( ( nId > StringId::LastValue ) ? "???" : pSbxRes[ static_cast<int>( nId ) ] ); } -SbxRes::SbxRes( StringId nId ) - : OUString( OUString::createFromAscii( GetSbxRes( nId ) ) ) -{} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/basic/source/sbx/sbxres.hxx b/basic/source/sbx/sbxres.hxx index 82ffe7c39839..995c31d53a3f 100644 --- a/basic/source/sbx/sbxres.hxx +++ b/basic/source/sbx/sbxres.hxx @@ -47,13 +47,7 @@ enum class StringId { LastValue = 44 }; -class SbxRes : public OUString -{ -public: - explicit SbxRes( StringId ); -}; - -const char* GetSbxRes( StringId ); +OUString GetSbxRes( StringId ); #endif diff --git a/basic/source/sbx/sbxstr.cxx b/basic/source/sbx/sbxstr.cxx index 465a72f95628..1bdc6fa03764 100644 --- a/basic/source/sbx/sbxstr.cxx +++ b/basic/source/sbx/sbxstr.cxx @@ -102,8 +102,8 @@ OUString ImpGetString( const SbxValues* p ) } case SbxERROR: // Here the String "Error n" is generated - aRes = SbxRes( StringId::ErrorMsg ); - aRes += OUString::number(p->nUShort); break; + aRes = GetSbxRes( StringId::ErrorMsg ) + OUString::number(p->nUShort); + break; case SbxDATE: ImpPutDate( &aTmp, p->nDouble ); break; diff --git a/basic/source/sbx/sbxvar.cxx b/basic/source/sbx/sbxvar.cxx index 2a15eed59ff2..20361375a669 100644 --- a/basic/source/sbx/sbxvar.cxx +++ b/basic/source/sbx/sbxvar.cxx @@ -258,11 +258,11 @@ const OUString& SbxVariable::GetName( SbxNameType t ) const } if( i->nFlags & SbxFlagBits::Optional ) { - aTmp += OUString( SbxRes( StringId::Optional ) ); + aTmp += GetSbxRes( StringId::Optional ); } if( i->eType & SbxBYREF ) { - aTmp += OUString( SbxRes( StringId::ByRef ) ); + aTmp += GetSbxRes( StringId::ByRef ); } aTmp += i->aName; cType = ' '; @@ -291,14 +291,14 @@ const OUString& SbxVariable::GetName( SbxNameType t ) const // long type? if( t != SbxNAME_SHORT ) { - aTmp += OUString( SbxRes( StringId::As ) ); + aTmp += GetSbxRes( StringId::As ); if( nt < 32 ) { - aTmp += OUString( SbxRes( static_cast<StringId>( static_cast<int>( StringId::Types ) + nt ) ) ); + aTmp += GetSbxRes( static_cast<StringId>( static_cast<int>( StringId::Types ) + nt ) ); } else { - aTmp += OUString( SbxRes( StringId::Any ) ); + aTmp += GetSbxRes( StringId::Any ); } } } @@ -307,14 +307,14 @@ const OUString& SbxVariable::GetName( SbxNameType t ) const // Long type? Then fetch it if( t == SbxNAME_LONG_TYPES && et != SbxEMPTY ) { - aTmp += OUString( SbxRes( StringId::As ) ); + aTmp += GetSbxRes( StringId::As ); if( et < 32 ) { - aTmp += OUString( SbxRes( static_cast<StringId>( static_cast<int>( StringId::Types ) + et ) ) ); + aTmp += GetSbxRes( static_cast<StringId>( static_cast<int>( StringId::Types ) + et ) ); } else { - aTmp += OUString( SbxRes( StringId::Any ) ); + aTmp += GetSbxRes( StringId::Any ); } } const_cast<SbxVariable*>(this)->aToolString = aTmp; |