From 41dec09ed3469d1e4dc53aeb7034a45bcff8e1e5 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 16 Sep 2013 10:06:54 +0200 Subject: convert BASIC from String to OUString Change-Id: I4b046e4c460305acad29862341092af948639215 --- basic/source/basmgr/basmgr.cxx | 4 ++-- basic/source/runtime/inputbox.cxx | 20 ++++++++++---------- basic/source/runtime/methods.cxx | 6 +++--- basic/source/sbx/sbxscan.cxx | 14 +++++++------- basic/source/uno/namecont.cxx | 2 +- 5 files changed, 23 insertions(+), 23 deletions(-) (limited to 'basic/source') diff --git a/basic/source/basmgr/basmgr.cxx b/basic/source/basmgr/basmgr.cxx index d4bcac2afbb5..6621a4014b36 100644 --- a/basic/source/basmgr/basmgr.cxx +++ b/basic/source/basmgr/basmgr.cxx @@ -1315,7 +1315,7 @@ sal_Bool BasicManager::RemoveLib( sal_uInt16 nLib, sal_Bool bDelBasicFromStorage if ( !pLibInfo || !nLib ) { - StringErrorInfo* pErrInf = new StringErrorInfo( ERRCODE_BASMGR_REMOVELIB, String(), ERRCODE_BUTTON_OK ); + StringErrorInfo* pErrInf = new StringErrorInfo( ERRCODE_BASMGR_REMOVELIB, OUString(), ERRCODE_BUTTON_OK ); aErrors.push_back(BasicError(*pErrInf, BASERR_REASON_STDLIB, pLibInfo->GetLibName())); return sal_False; } @@ -1342,7 +1342,7 @@ sal_Bool BasicManager::RemoveLib( sal_uInt16 nLib, sal_Bool bDelBasicFromStorage if ( !xBasicStorage.Is() || xBasicStorage->GetError() ) { - StringErrorInfo* pErrInf = new StringErrorInfo( ERRCODE_BASMGR_REMOVELIB, String(), ERRCODE_BUTTON_OK ); + StringErrorInfo* pErrInf = new StringErrorInfo( ERRCODE_BASMGR_REMOVELIB, OUString(), ERRCODE_BUTTON_OK ); aErrors.push_back(BasicError(*pErrInf, BASERR_REASON_OPENLIBSTORAGE, pLibInfo->GetLibName())); } else if ( xBasicStorage->IsStream( pLibInfo->GetLibName() ) ) diff --git a/basic/source/runtime/inputbox.cxx b/basic/source/runtime/inputbox.cxx index c009f88818d0..db457608495b 100644 --- a/basic/source/runtime/inputbox.cxx +++ b/basic/source/runtime/inputbox.cxx @@ -38,18 +38,18 @@ class SvRTLInputBox : public ModalDialog void PositionDialog( long nXTwips, long nYTwips, const Size& rDlgSize ); void InitButtons( const Size& rDlgSize ); void PositionEdit( const Size& rDlgSize ); - void PositionPrompt( const String& rPrompt, const Size& rDlgSize ); + void PositionPrompt( const OUString& rPrompt, const Size& rDlgSize ); DECL_LINK( OkHdl, Button * ); DECL_LINK( CancelHdl, Button * ); public: - SvRTLInputBox( Window* pParent, const String& rPrompt, const String& rTitle, - const String& rDefault, long nXTwips = -1, long nYTwips = -1 ); + SvRTLInputBox( Window* pParent, const OUString& rPrompt, const OUString& rTitle, + const OUString& rDefault, long nXTwips = -1, long nYTwips = -1 ); OUString GetText() const { return aText; } }; -SvRTLInputBox::SvRTLInputBox( Window* pParent, const String& rPrompt, - const String& rTitle, const String& rDefault, +SvRTLInputBox::SvRTLInputBox( Window* pParent, const OUString& rPrompt, + const OUString& rTitle, const OUString& rDefault, long nXTwips, long nYTwips ) : ModalDialog( pParent,WB_3DLOOK | WB_MOVEABLE | WB_CLOSEABLE ), aEdit( this, WB_LEFT | WB_BORDER ), @@ -103,9 +103,9 @@ void SvRTLInputBox::PositionEdit( const Size& rDlgSize ) } -void SvRTLInputBox::PositionPrompt(const String& rPrompt,const Size& rDlgSize) +void SvRTLInputBox::PositionPrompt(const OUString& rPrompt,const Size& rDlgSize) { - if ( rPrompt.Len() == 0 ) + if ( rPrompt.isEmpty() ) return; OUString aText_(convertLineEnd(rPrompt, LINEEND_CR)); aPromptText.SetPosPixel( LogicToPixel(Point(5,5))); @@ -153,10 +153,10 @@ RTLFUNC(InputBox) StarBASIC::Error( SbERR_BAD_ARGUMENT ); else { - String aTitle; - String aDefault; + OUString aTitle; + OUString aDefault; sal_Int32 nX = -1, nY = -1; // center - const String& rPrompt = rPar.Get(1)->GetOUString(); + const OUString& rPrompt = rPar.Get(1)->GetOUString(); if ( nArgCount > 2 && !rPar.Get(2)->IsErr() ) aTitle = rPar.Get(2)->GetOUString(); if ( nArgCount > 3 && !rPar.Get(3)->IsErr() ) diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx index 048ca0c3a716..1180a81a4f85 100644 --- a/basic/source/runtime/methods.cxx +++ b/basic/source/runtime/methods.cxx @@ -3617,7 +3617,7 @@ RTLFUNC(Shell) // #55735 if there are parameters, they have to be separated // #72471 also separate the single parameters - std::list aTokenList; + std::list aTokenList; OUString aToken; sal_Int32 i = 0; sal_Unicode c; @@ -3699,7 +3699,7 @@ RTLFUNC(Shell) } // #72471 work parameter(s) up - std::list::const_iterator iter = aTokenList.begin(); + std::list::const_iterator iter = aTokenList.begin(); const OUString& rStr = *iter; OUString aOUStrProg( rStr.getStr(), rStr.getLength() ); OUString aOUStrProgURL = getFullPath( aOUStrProg ); @@ -3824,7 +3824,7 @@ OUString getBasicTypeName( SbxDataType eType ) return OUString::createFromAscii(pTypeNames[nPos]); } -String getObjectTypeName( SbxVariable* pVar ) +OUString getObjectTypeName( SbxVariable* pVar ) { OUString sRet( "Object" ); if ( pVar ) diff --git a/basic/source/sbx/sbxscan.cxx b/basic/source/sbx/sbxscan.cxx index e3545ef1a130..4c919d5923ff 100644 --- a/basic/source/sbx/sbxscan.cxx +++ b/basic/source/sbx/sbxscan.cxx @@ -680,16 +680,16 @@ enum VbaFormatType struct VbaFormatInfo { VbaFormatType meType; - const char* mpVbaFormat; // Format string in vba + OUString mpVbaFormat; // Format string in vba NfIndexTableOffset meOffset; // SvNumberFormatter format index, if meType = VBA_FORMAT_TYPE_OFFSET const char* mpOOoFormat; // if meType = VBA_FORMAT_TYPE_USERDEFINED }; #define VBA_FORMAT_OFFSET( pcUtf8, eOffset ) \ - { VBA_FORMAT_TYPE_OFFSET, pcUtf8, eOffset, 0 } + { VBA_FORMAT_TYPE_OFFSET, OUString(pcUtf8), eOffset, 0 } #define VBA_FORMAT_USERDEFINED( pcUtf8, pcDefinedUtf8 ) \ - { VBA_FORMAT_TYPE_USERDEFINED, pcUtf8, NF_NUMBER_STANDARD, pcDefinedUtf8 } + { VBA_FORMAT_TYPE_USERDEFINED, OUString(pcUtf8), NF_NUMBER_STANDARD, pcDefinedUtf8 } static VbaFormatInfo pFormatInfoTable[] = { @@ -703,16 +703,16 @@ static VbaFormatInfo pFormatInfoTable[] = VBA_FORMAT_OFFSET( "dddddd", NF_DATE_SYSTEM_LONG ), VBA_FORMAT_USERDEFINED( "ttttt", "H:MM:SS AM/PM" ), VBA_FORMAT_OFFSET( "ww", NF_DATE_WW ), - { VBA_FORMAT_TYPE_NULL, 0, NF_INDEX_TABLE_ENTRIES, 0 } + { VBA_FORMAT_TYPE_NULL, OUString(""), NF_INDEX_TABLE_ENTRIES, 0 } }; -VbaFormatInfo* getFormatInfo( const String& rFmt ) +VbaFormatInfo* getFormatInfo( const OUString& rFmt ) { VbaFormatInfo* pInfo = NULL; sal_Int16 i = 0; - while( (pInfo = pFormatInfoTable + i )->mpVbaFormat != NULL ) + while( (pInfo = pFormatInfoTable + i )->meType != VBA_FORMAT_TYPE_NULL ) { - if( rFmt.EqualsIgnoreCaseAscii( pInfo->mpVbaFormat ) ) + if( rFmt.equalsIgnoreAsciiCase( pInfo->mpVbaFormat ) ) break; i++; } diff --git a/basic/source/uno/namecont.cxx b/basic/source/uno/namecont.cxx index f2e6656d684b..62896ac4d4ff 100644 --- a/basic/source/uno/namecont.cxx +++ b/basic/source/uno/namecont.cxx @@ -1687,7 +1687,7 @@ bool SfxLibraryContainer::implLoadLibraryIndexFile( SfxLibrary* pLib, if( bStorage ) { aLibInfoPath = maInfoFileName; - aLibInfoPath += String( "-lb.xml" ); + aLibInfoPath += "-lb.xml"; try { -- cgit