diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-07-02 16:02:38 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-07-03 21:24:35 +0100 |
commit | bccf34c19ae022b67565e212fa4ec0d5213947de (patch) | |
tree | 73c2d2e29ad8d15999cbfb2ff554efa1e502a35e /basic | |
parent | 285289275d1cf1769080a208b55be984cd269e1e (diff) |
ditch String::CreateFromAscii
Change-Id: I2b482bd323ac510629c5ee31868010b7cd6ce691
Diffstat (limited to 'basic')
-rw-r--r-- | basic/source/basmgr/basmgr.cxx | 36 | ||||
-rw-r--r-- | basic/source/classes/image.cxx | 2 | ||||
-rw-r--r-- | basic/source/classes/sb.cxx | 16 | ||||
-rw-r--r-- | basic/source/comp/parser.cxx | 6 | ||||
-rw-r--r-- | basic/source/runtime/ddectrl.cxx | 2 | ||||
-rw-r--r-- | basic/source/runtime/methods.cxx | 12 | ||||
-rw-r--r-- | basic/source/runtime/methods1.cxx | 2 | ||||
-rw-r--r-- | basic/source/runtime/sbdiagnose.cxx | 2 | ||||
-rw-r--r-- | basic/source/runtime/stdobj.cxx | 6 | ||||
-rw-r--r-- | basic/source/sbx/sbxcoll.cxx | 16 | ||||
-rw-r--r-- | basic/source/sbx/sbxobj.cxx | 8 |
11 files changed, 54 insertions, 54 deletions
diff --git a/basic/source/basmgr/basmgr.cxx b/basic/source/basmgr/basmgr.cxx index f5ca16c35e28..8fa93f5458fb 100644 --- a/basic/source/basmgr/basmgr.cxx +++ b/basic/source/basmgr/basmgr.cxx @@ -101,13 +101,13 @@ typedef WeakImplHelper1< XStarBasicAccess > StarBasicAccessHelper; // Version 2 // + sal_Bool bReference -static const char* szStdLibName = "Standard"; +static const char szStdLibName[] = "Standard"; static const char szBasicStorage[] = "StarBASIC"; -static const char* szOldManagerStream = "BasicManager"; +static const char szOldManagerStream[] = "BasicManager"; static const char szManagerStream[] = "BasicManager2"; -static const char* szImbedded = "LIBIMBEDDED"; -static const char* szCryptingKey = "CryptedBasic"; -static const char* szScriptLanguage = "StarBasic"; +static const char szImbedded[] = "LIBIMBEDDED"; +static const char szCryptingKey[] = "CryptedBasic"; +static const char szScriptLanguage[] = "StarBasic"; TYPEINIT1( BasicManager, SfxBroadcaster ); DBG_NAME( BasicManager ); @@ -555,8 +555,8 @@ BasicLibInfo::BasicLibInfo() bDoLoad = sal_False; bFoundInPath = sal_False; mxScriptCont = NULL; - aStorageName = String::CreateFromAscii(szImbedded); - aRelStorageName = String::CreateFromAscii(szImbedded); + aStorageName = rtl::OUString(szImbedded); + aRelStorageName = rtl::OUString(szImbedded); } BasicLibInfo* BasicLibInfo::Create( SotStorageStream& rSStream ) @@ -632,8 +632,8 @@ BasicManager::BasicManager( SotStorage& rStorage, const String& rBaseURL, StarBA pStdLibInfo = CreateLibInfo(); pStdLibInfo->SetLib( pStdLib ); StarBASICRef xStdLib = pStdLibInfo->GetLib(); - xStdLib->SetName( String::CreateFromAscii(szStdLibName) ); - pStdLibInfo->SetLibName( String::CreateFromAscii(szStdLibName) ); + xStdLib->SetName( rtl::OUString(szStdLibName) ); + pStdLibInfo->SetLibName( rtl::OUString(szStdLibName) ); xStdLib->SetFlag( SBX_DONTSTORE | SBX_EXTSEARCH ); xStdLib->SetModified( sal_False ); } @@ -682,7 +682,7 @@ BasicManager::BasicManager( SotStorage& rStorage, const String& rBaseURL, StarBA else { ImpCreateStdLib( pParentFromStdLib ); - if ( rStorage.IsStream( String::CreateFromAscii(szOldManagerStream) ) ) + if ( rStorage.IsStream( rtl::OUString(szOldManagerStream) ) ) LoadOldBasicManager( rStorage ); } } @@ -816,8 +816,8 @@ BasicManager::BasicManager( StarBASIC* pSLib, String* pLibPath, sal_Bool bDocMgr BasicLibInfo* pStdLibInfo = CreateLibInfo(); pStdLibInfo->SetLib( pSLib ); StarBASICRef xStdLib = pStdLibInfo->GetLib(); - xStdLib->SetName( String::CreateFromAscii(szStdLibName)); - pStdLibInfo->SetLibName( String::CreateFromAscii(szStdLibName) ); + xStdLib->SetName(rtl::OUString(szStdLibName)); + pStdLibInfo->SetLibName( rtl::OUString(szStdLibName) ); pSLib->SetFlag( SBX_DONTSTORE | SBX_EXTSEARCH ); // Save is only necessary if basic has changed @@ -835,8 +835,8 @@ void BasicManager::ImpMgrNotLoaded( const String& rStorageName ) BasicLibInfo* pStdLibInfo = CreateLibInfo(); pStdLibInfo->SetLib( new StarBASIC( NULL, mbDocMgr ) ); StarBASICRef xStdLib = pStdLibInfo->GetLib(); - xStdLib->SetName( String::CreateFromAscii(szStdLibName) ); - pStdLibInfo->SetLibName( String::CreateFromAscii(szStdLibName) ); + xStdLib->SetName( rtl::OUString(szStdLibName) ); + pStdLibInfo->SetLibName( rtl::OUString(szStdLibName) ); xStdLib->SetFlag( SBX_DONTSTORE | SBX_EXTSEARCH ); xStdLib->SetModified( sal_False ); } @@ -847,8 +847,8 @@ void BasicManager::ImpCreateStdLib( StarBASIC* pParentFromStdLib ) BasicLibInfo* pStdLibInfo = CreateLibInfo(); StarBASIC* pStdLib = new StarBASIC( pParentFromStdLib, mbDocMgr ); pStdLibInfo->SetLib( pStdLib ); - pStdLib->SetName( String::CreateFromAscii(szStdLibName) ); - pStdLibInfo->SetLibName( String::CreateFromAscii(szStdLibName) ); + pStdLib->SetName( rtl::OUString(szStdLibName) ); + pStdLibInfo->SetLibName( rtl::OUString(szStdLibName) ); pStdLib->SetFlag( SBX_DONTSTORE | SBX_EXTSEARCH ); } @@ -944,7 +944,7 @@ void BasicManager::LoadOldBasicManager( SotStorage& rStorage ) SotStorageStreamRef xManagerStream = rStorage.OpenSotStream - ( String::CreateFromAscii(szOldManagerStream), eStreamReadMode ); + ( rtl::OUString(szOldManagerStream), eStreamReadMode ); String aStorName( rStorage.GetName() ); DBG_ASSERT( aStorName.Len(), "No Storage Name!" ); @@ -1287,7 +1287,7 @@ StarBASIC* BasicManager::AddLib( SotStorage& rStorage, const String& rLibName, s else { pLibInfo->GetLib()->SetModified( sal_True ); // Must be saved after Add! - pLibInfo->SetStorageName( String::CreateFromAscii(szImbedded) ); // Save in BasicManager-Storage + pLibInfo->SetStorageName( rtl::OUString(szImbedded) ); // Save in BasicManager-Storage } } else diff --git a/basic/source/classes/image.cxx b/basic/source/classes/image.cxx index 5aecb53318de..57ca034e66f3 100644 --- a/basic/source/classes/image.cxx +++ b/basic/source/classes/image.cxx @@ -474,7 +474,7 @@ String SbiImage::GetString( short nId ) const if( nLen == 1 ) { // Force length 1 and make char 0 afterwards - String aNullCharStr( String::CreateFromAscii( " " ) ); + String aNullCharStr( rtl::OUString(" ") ); aNullCharStr.SetChar( 0, 0 ); return aNullCharStr; } diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx index 79fc969aecb9..c18d0eaf501f 100644 --- a/basic/source/classes/sb.cxx +++ b/basic/source/classes/sb.cxx @@ -1915,10 +1915,10 @@ BasicCollection::BasicCollection( const XubString& rClass ) { if( !nCountHash ) { - nCountHash = MakeHashCode( String::CreateFromAscii( pCountStr ) ); - nAddHash = MakeHashCode( String::CreateFromAscii( pAddStr ) ); - nItemHash = MakeHashCode( String::CreateFromAscii( pItemStr ) ); - nRemoveHash = MakeHashCode( String::CreateFromAscii( pRemoveStr ) ); + nCountHash = MakeHashCode( rtl::OUString::createFromAscii( pCountStr ) ); + nAddHash = MakeHashCode( rtl::OUString::createFromAscii( pAddStr ) ); + nItemHash = MakeHashCode( rtl::OUString::createFromAscii( pItemStr ) ); + nRemoveHash = MakeHashCode( rtl::OUString::createFromAscii( pRemoveStr ) ); } Initialize(); @@ -1940,14 +1940,14 @@ void BasicCollection::Initialize() SetFlag( SBX_FIXED ); ResetFlag( SBX_WRITE ); SbxVariable* p; - p = Make( String::CreateFromAscii( pCountStr ), SbxCLASS_PROPERTY, SbxINTEGER ); + p = Make( rtl::OUString::createFromAscii( pCountStr ), SbxCLASS_PROPERTY, SbxINTEGER ); p->ResetFlag( SBX_WRITE ); p->SetFlag( SBX_DONTSTORE ); - p = Make( String::CreateFromAscii( pAddStr ), SbxCLASS_METHOD, SbxEMPTY ); + p = Make( rtl::OUString::createFromAscii( pAddStr ), SbxCLASS_METHOD, SbxEMPTY ); p->SetFlag( SBX_DONTSTORE ); - p = Make( String::CreateFromAscii( pItemStr ), SbxCLASS_METHOD, SbxVARIANT ); + p = Make( rtl::OUString::createFromAscii( pItemStr ), SbxCLASS_METHOD, SbxVARIANT ); p->SetFlag( SBX_DONTSTORE ); - p = Make( String::CreateFromAscii( pRemoveStr ), SbxCLASS_METHOD, SbxEMPTY ); + p = Make( rtl::OUString::createFromAscii( pRemoveStr ), SbxCLASS_METHOD, SbxEMPTY ); p->SetFlag( SBX_DONTSTORE ); if ( !xAddInfo.Is() ) { diff --git a/basic/source/comp/parser.cxx b/basic/source/comp/parser.cxx index 61a55da33e2b..1af42ef2fadb 100644 --- a/basic/source/comp/parser.cxx +++ b/basic/source/comp/parser.cxx @@ -820,7 +820,7 @@ void SbiParser::Option() void addStringConst( SbiSymPool& rPool, const char* pSym, const String& rStr ) { - SbiConstDef* pConst = new SbiConstDef( String::CreateFromAscii( pSym ) ); + SbiConstDef* pConst = new SbiConstDef( rtl::OUString::createFromAscii( pSym ) ); pConst->SetType( SbxSTRING ); pConst->Set( rStr ); rPool.Add( pConst ); @@ -828,7 +828,7 @@ void addStringConst( SbiSymPool& rPool, const char* pSym, const String& rStr ) inline void addStringConst( SbiSymPool& rPool, const char* pSym, const char* pStr ) { - addStringConst( rPool, pSym, String::CreateFromAscii( pStr ) ); + addStringConst( rPool, pSym, rtl::OUString::createFromAscii( pStr ) ); } void SbiParser::AddConstants( void ) @@ -848,7 +848,7 @@ void SbiParser::AddConstants( void ) addStringConst( aPublics, "vbVerticalTab", "\x0B" ); // Force length 1 and make char 0 afterwards - String aNullCharStr( String::CreateFromAscii( " " ) ); + String aNullCharStr( rtl::OUString(" ") ); aNullCharStr.SetChar( 0, 0 ); addStringConst( aPublics, "vbNullChar", aNullCharStr ); } diff --git a/basic/source/runtime/ddectrl.cxx b/basic/source/runtime/ddectrl.cxx index b31330c06529..47f8716465b8 100644 --- a/basic/source/runtime/ddectrl.cxx +++ b/basic/source/runtime/ddectrl.cxx @@ -72,7 +72,7 @@ SbError SbiDdeControl::GetLastErr( DdeConnection* pConv ) IMPL_LINK_INLINE( SbiDdeControl,Data , DdeData*, pData, { - aData = String::CreateFromAscii( (char*)(const void*)*pData ); + aData = rtl::OUString::createFromAscii( (const char*)(const void*)*pData ); return 1; } ) diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx index 4f6680c2212c..7050093a2e14 100644 --- a/basic/source/runtime/methods.cxx +++ b/basic/source/runtime/methods.cxx @@ -446,7 +446,7 @@ RTLFUNC(CurDir) } char* pBuffer = new char[ _MAX_PATH ]; if ( _getdcwd( nCurDir, pBuffer, _MAX_PATH ) != 0 ) - rPar.Get(0)->PutString( String::CreateFromAscii( pBuffer ) ); + rPar.Get(0)->PutString( rtl::OUString::createFromAscii( pBuffer ) ); else StarBASIC::Error( SbERR_NO_DEVICE ); delete [] pBuffer; @@ -465,7 +465,7 @@ RTLFUNC(CurDir) } if( getcwd( pMem, nSize-1 ) != NULL ) { - rPar.Get(0)->PutString( String::CreateFromAscii(pMem) ); + rPar.Get(0)->PutString( rtl::OUString::createFromAscii(pMem) ); delete [] pMem; return; } @@ -877,7 +877,7 @@ RTLFUNC(Hex) snprintf( aBuffer, sizeof(aBuffer), "%X", pArg->GetInteger() ); else snprintf( aBuffer, sizeof(aBuffer), "%lX", static_cast<long unsigned int>(pArg->GetLong()) ); - rPar.Get(0)->PutString( String::CreateFromAscii( aBuffer ) ); + rPar.Get(0)->PutString( rtl::OUString::createFromAscii( aBuffer ) ); } } @@ -1300,7 +1300,7 @@ RTLFUNC(Oct) snprintf( aBuffer, sizeof(aBuffer), "%o", pArg->GetInteger() ); else snprintf( aBuffer, sizeof(aBuffer), "%lo", static_cast<long unsigned int>(pArg->GetLong()) ); - rPar.Get(0)->PutString( String::CreateFromAscii( aBuffer ) ); + rPar.Get(0)->PutString( rtl::OUString::createFromAscii( aBuffer ) ); } } @@ -1767,7 +1767,7 @@ RTLFUNC(CDateToIso) implGetDateYear( aDate ), implGetDateMonth( aDate ), implGetDateDay( aDate ) ); - String aRetStr = String::CreateFromAscii( Buffer ); + String aRetStr = rtl::OUString::createFromAscii( Buffer ); rPar.Get(0)->PutString( aRetStr ); } else @@ -2107,7 +2107,7 @@ RTLFUNC(Time) char buf[ 20 ]; snprintf( buf, sizeof(buf), "%02d:%02d:%02d", aTime.GetHour(), aTime.GetMin(), aTime.GetSec() ); - aRes = String::CreateFromAscii( buf ); + aRes = rtl::OUString::createFromAscii( buf ); } else { diff --git a/basic/source/runtime/methods1.cxx b/basic/source/runtime/methods1.cxx index 19f4823608a4..0e418ccedf63 100644 --- a/basic/source/runtime/methods1.cxx +++ b/basic/source/runtime/methods1.cxx @@ -1252,7 +1252,7 @@ RTLFUNC(Environ) osl_getThreadTextEncoding())); const char* pEnvStr = getenv(aByteStr.getStr()); if ( pEnvStr ) - aResult = String::CreateFromAscii( pEnvStr ); + aResult = rtl::OUString::createFromAscii( pEnvStr ); rPar.Get(0)->PutString( aResult ); } diff --git a/basic/source/runtime/sbdiagnose.cxx b/basic/source/runtime/sbdiagnose.cxx index d54aea3f1697..95d2332e9900 100644 --- a/basic/source/runtime/sbdiagnose.cxx +++ b/basic/source/runtime/sbdiagnose.cxx @@ -61,7 +61,7 @@ void DbgReportAssertion( const sal_Char* i_assertionMessage ) SbxArrayRef const xArguments( new SbxArray( SbxVARIANT ) ); SbxVariableRef const xMessageText = new SbxVariable( SbxSTRING ); - xMessageText->PutString( String::CreateFromAscii( i_assertionMessage ) ); + xMessageText->PutString( rtl::OUString::createFromAscii(i_assertionMessage) ); xArguments->Put( xMessageText, 1 ); ErrCode const nError = xAssertionChannelBasic->Call( sCaptureFunctionName, xArguments ); diff --git a/basic/source/runtime/stdobj.cxx b/basic/source/runtime/stdobj.cxx index 89a244f56beb..2f95d51cef82 100644 --- a/basic/source/runtime/stdobj.cxx +++ b/basic/source/runtime/stdobj.cxx @@ -731,7 +731,7 @@ SbiStdObject::SbiStdObject( const String& r, StarBASIC* pb ) : SbxObject( r ) if( !p->nHash ) while( p->nArgs != -1 ) { - String aName_ = String::CreateFromAscii( p->pName ); + String aName_ = rtl::OUString::createFromAscii( p->pName ); p->nHash = SbxVariable::MakeHashCode( aName_ ); p += ( p->nArgs & _ARGSMASK ) + 1; } @@ -807,7 +807,7 @@ SbxVariable* SbiStdObject::Find( const String& rName, SbxClassType t ) short nType = ( p->nArgs & _TYPEMASK ); if( p->nArgs & _CONST ) nAccess |= SBX_CONST; - String aName_ = String::CreateFromAscii( p->pName ); + String aName_ = rtl::OUString::createFromAscii( p->pName ); SbxClassType eCT = SbxCLASS_OBJECT; if( nType & _PROPERTY ) eCT = SbxCLASS_PROPERTY; @@ -878,7 +878,7 @@ SbxInfo* SbiStdObject::GetInfo( short nIdx ) for( short i = 0; i < nPar; i++ ) { p++; - String aName_ = String::CreateFromAscii( p->pName ); + String aName_ = rtl::OUString::createFromAscii( p->pName ); sal_uInt16 nFlags_ = ( p->nArgs >> 8 ) & 0x03; if( p->nArgs & _OPT ) nFlags_ |= SBX_OPTIONAL; diff --git a/basic/source/sbx/sbxcoll.cxx b/basic/source/sbx/sbxcoll.cxx index c5868fd2a2c1..8bcde7d873f8 100644 --- a/basic/source/sbx/sbxcoll.cxx +++ b/basic/source/sbx/sbxcoll.cxx @@ -50,10 +50,10 @@ SbxCollection::SbxCollection( const XubString& rClass ) pAdd = GetSbxRes( STRING_ADDMETH ); pItem = GetSbxRes( STRING_ITEMMETH ); pRemove = GetSbxRes( STRING_REMOVEMETH ); - nCountHash = MakeHashCode( String::CreateFromAscii( pCount ) ); - nAddHash = MakeHashCode( String::CreateFromAscii( pAdd ) ); - nItemHash = MakeHashCode( String::CreateFromAscii( pItem ) ); - nRemoveHash = MakeHashCode( String::CreateFromAscii( pRemove ) ); + nCountHash = MakeHashCode( rtl::OUString::createFromAscii( pCount ) ); + nAddHash = MakeHashCode( rtl::OUString::createFromAscii( pAdd ) ); + nItemHash = MakeHashCode( rtl::OUString::createFromAscii( pItem ) ); + nRemoveHash = MakeHashCode( rtl::OUString::createFromAscii( pRemove ) ); } Initialize(); // For Access on itself @@ -86,14 +86,14 @@ void SbxCollection::Initialize() SetFlag( SBX_FIXED ); ResetFlag( SBX_WRITE ); SbxVariable* p; - p = Make( String::CreateFromAscii( pCount ), SbxCLASS_PROPERTY, SbxINTEGER ); + p = Make( rtl::OUString::createFromAscii( pCount ), SbxCLASS_PROPERTY, SbxINTEGER ); p->ResetFlag( SBX_WRITE ); p->SetFlag( SBX_DONTSTORE ); - p = Make( String::CreateFromAscii( pAdd ), SbxCLASS_METHOD, SbxEMPTY ); + p = Make( rtl::OUString::createFromAscii( pAdd ), SbxCLASS_METHOD, SbxEMPTY ); p->SetFlag( SBX_DONTSTORE ); - p = Make( String::CreateFromAscii( pItem ), SbxCLASS_METHOD, SbxOBJECT ); + p = Make( rtl::OUString::createFromAscii( pItem ), SbxCLASS_METHOD, SbxOBJECT ); p->SetFlag( SBX_DONTSTORE ); - p = Make( String::CreateFromAscii( pRemove ), SbxCLASS_METHOD, SbxEMPTY ); + p = Make( rtl::OUString::createFromAscii( pRemove ), SbxCLASS_METHOD, SbxEMPTY ); p->SetFlag( SBX_DONTSTORE ); } diff --git a/basic/source/sbx/sbxobj.cxx b/basic/source/sbx/sbxobj.cxx index 9038679e39a0..443412bbd3bf 100644 --- a/basic/source/sbx/sbxobj.cxx +++ b/basic/source/sbx/sbxobj.cxx @@ -51,8 +51,8 @@ SbxObject::SbxObject( const XubString& rClass ) { pNameProp = GetSbxRes( STRING_NAMEPROP ); pParentProp = GetSbxRes( STRING_PARENTPROP ); - nNameHash = MakeHashCode( String::CreateFromAscii( pNameProp ) ); - nParentHash = MakeHashCode( String::CreateFromAscii( pParentProp ) ); + nNameHash = MakeHashCode( rtl::OUString::createFromAscii( pNameProp ) ); + nParentHash = MakeHashCode( rtl::OUString::createFromAscii( pParentProp ) ); } SbxObject::Clear(); SbxObject::SetName( rClass ); @@ -129,9 +129,9 @@ void SbxObject::Clear() pProps = new SbxArray; pObjs = new SbxArray( SbxOBJECT ); SbxVariable* p; - p = Make( String::CreateFromAscii( pNameProp ), SbxCLASS_PROPERTY, SbxSTRING ); + p = Make( rtl::OUString::createFromAscii( pNameProp ), SbxCLASS_PROPERTY, SbxSTRING ); p->SetFlag( SBX_DONTSTORE ); - p = Make( String::CreateFromAscii( pParentProp ), SbxCLASS_PROPERTY, SbxOBJECT ); + p = Make( rtl::OUString::createFromAscii( pParentProp ), SbxCLASS_PROPERTY, SbxOBJECT ); p->ResetFlag( SBX_WRITE ); p->SetFlag( SBX_DONTSTORE ); pDfltProp = NULL; |