diff options
-rwxr-xr-x | basic/inc/basic/sbdef.hxx | 3 | ||||
-rwxr-xr-x | basic/inc/basic/sbuno.hxx | 2 | ||||
-rwxr-xr-x | basic/source/app/mybasic.cxx | 2 | ||||
-rwxr-xr-x | basic/source/classes/sb.cxx | 6 | ||||
-rwxr-xr-x | basic/source/classes/sbunoobj.cxx | 393 | ||||
-rwxr-xr-x | basic/source/inc/runtime.hxx | 4 | ||||
-rwxr-xr-x | basic/source/inc/sbunoobj.hxx | 30 | ||||
-rwxr-xr-x | basic/source/runtime/iosys.cxx | 2 | ||||
-rwxr-xr-x | basic/source/runtime/step1.cxx | 10 | ||||
-rwxr-xr-x | basic/source/uno/namecont.cxx | 2 |
10 files changed, 227 insertions, 227 deletions
diff --git a/basic/inc/basic/sbdef.hxx b/basic/inc/basic/sbdef.hxx index 85218a34965f..43d35d011b5c 100755 --- a/basic/inc/basic/sbdef.hxx +++ b/basic/inc/basic/sbdef.hxx @@ -31,6 +31,7 @@ #include <basic/sbxdef.hxx> #include <svl/svarray.hxx> +#include <rtl/ustring.hxx> #define _BASIC_TEXTPORTIONS @@ -76,7 +77,7 @@ String getBasicTypeName( SbxDataType eType ); // important for SbUnoObj instances // implementation: basic/source/classes/sbunoobj.cxx class SbxObject; -String getBasicObjectTypeName( SbxObject* pObj ); +::rtl::OUString getBasicObjectTypeName( SbxObject* pObj ); // Allows Basic IDE to set watch mode to suppress errors // implementation: basic/source/runtime/runtime.cxx diff --git a/basic/inc/basic/sbuno.hxx b/basic/inc/basic/sbuno.hxx index 0539246e071b..faeb99ef2160 100755 --- a/basic/inc/basic/sbuno.hxx +++ b/basic/inc/basic/sbuno.hxx @@ -35,7 +35,7 @@ namespace com { namespace sun { namespace star { namespace uno { class Any; }}}} // Returns a SbxObject that wrapps an Uno Interface // Implementation in basic/source/classes/sbunoobj.cxx -SbxObjectRef GetSbUnoObject( const String& aName, const com::sun::star::uno::Any& aUnoObj_ ); +SbxObjectRef GetSbUnoObject( const ::rtl::OUString& aName, const com::sun::star::uno::Any& aUnoObj_ ); // Force creation of all properties for debugging void createAllObjectProperties( SbxObject* pObj ); diff --git a/basic/source/app/mybasic.cxx b/basic/source/app/mybasic.cxx index 12e902e53c79..d178dbb7066e 100755 --- a/basic/source/app/mybasic.cxx +++ b/basic/source/app/mybasic.cxx @@ -99,7 +99,7 @@ MyBasic::MyBasic() : StarBASIC() UsrAny aObjAny = getIntrospectionTestObject(); // Box object into SbUnoObject - String aName( "UnoObject" ); + ::rtl:OUString aName( "UnoObject" ); SbxObjectRef xSbUnoObj = GetSbUnoObject( aName, aObjAny ); Insert( (SbxObject*)xSbUnoObj ); #endif diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx index 5cfdc1dcea4f..5859cb285802 100755 --- a/basic/source/classes/sb.cxx +++ b/basic/source/classes/sb.cxx @@ -442,7 +442,7 @@ class SbOLEFactory : public SbxFactory { public: virtual SbxBase* Create( sal_uInt16 nSbxId, sal_uInt32 = SBXCR_SBX ); - virtual SbxObject* CreateObject( const String& ); + virtual SbxObject* CreateObject( const ::rtl::OUString& ); }; SbxBase* SbOLEFactory::Create( sal_uInt16, sal_uInt32 ) @@ -451,9 +451,9 @@ SbxBase* SbOLEFactory::Create( sal_uInt16, sal_uInt32 ) return NULL; } -SbUnoObject* createOLEObject_Impl( const String& aType ); // sbunoobj.cxx +SbUnoObject* createOLEObject_Impl( const ::rtl::OUString& aType ); // sbunoobj.cxx -SbxObject* SbOLEFactory::CreateObject( const String& rClassName ) +SbxObject* SbOLEFactory::CreateObject( const ::rtl::OUString& rClassName ) { SbxObject* pRet = createOLEObject_Impl( rClassName ); return pRet; diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx index 7695f73a317f..53ce88c82149 100755 --- a/basic/source/classes/sbunoobj.cxx +++ b/basic/source/classes/sbunoobj.cxx @@ -128,14 +128,14 @@ static ::rtl::OUString defaultNameSpace( RTL_CONSTASCII_USTRINGPARAM("ooo.vba") // redirection built in. The property name specifies the name // of the default property. -bool SbUnoObject::getDefaultPropName( SbUnoObject* pUnoObj, String& sDfltProp ) +bool SbUnoObject::getDefaultPropName( SbUnoObject* pUnoObj, ::rtl::OUString& sDfltProp ) { bool result = false; Reference< XDefaultProperty> xDefaultProp( pUnoObj->maTmpUnoObj, UNO_QUERY ); if ( xDefaultProp.is() ) { sDfltProp = xDefaultProp->getDefaultPropertyName(); - if ( sDfltProp.Len() ) + if ( !sDfltProp.isEmpty() ) result = true; } return result; @@ -166,7 +166,7 @@ void SetSbUnoObjectDfltPropName( SbxObject* pObj ) SbUnoObject* pUnoObj = PTR_CAST(SbUnoObject,(SbxObject*) pObj); if ( pUnoObj ) { - String sDfltPropName; + ::rtl::OUString sDfltPropName; if ( SbUnoObject::getDefaultPropName( pUnoObj, sDfltPropName ) ) { @@ -296,7 +296,7 @@ Reference< XTypeConverter > getTypeConverter_Impl( void ) // #111851 factory function to create an OLE object -SbUnoObject* createOLEObject_Impl( const String& aType ) +SbUnoObject* createOLEObject_Impl( const ::rtl::OUString& aType ) { static Reference< XMultiServiceFactory > xOLEFactory; static bool bNeedsInit = true; @@ -321,7 +321,7 @@ SbUnoObject* createOLEObject_Impl( const String& aType ) { // some type names available in VBA can not be directly used in COM ::rtl::OUString aOLEType = aType; - if ( aOLEType.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "SAXXMLReader30" ) ) ) ) + if ( aOLEType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "SAXXMLReader30" ) ) ) aOLEType = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Msxml2.SAXXMLReader.3.0" ) ); Reference< XInterface > xOLEObject = xOLEFactory->createInstance( aOLEType ); @@ -341,24 +341,24 @@ namespace void lcl_indent( ::rtl::OUStringBuffer& _inout_rBuffer, sal_Int32 _nLevel ) { while ( _nLevel-- > 0 ) - _inout_rBuffer.appendAscii( " " ); + _inout_rBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM(" ") ); } } void implAppendExceptionMsg( ::rtl::OUStringBuffer& _inout_rBuffer, const Exception& _e, const ::rtl::OUString& _rExceptionType, sal_Int32 _nLevel ) { - _inout_rBuffer.appendAscii( "\n" ); + _inout_rBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "\n" ) ); lcl_indent( _inout_rBuffer, _nLevel ); - _inout_rBuffer.appendAscii( "Type: " ); + _inout_rBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "Type: " ) ); - if ( _rExceptionType.getLength() == 0 ) - _inout_rBuffer.appendAscii( "Unknown" ); + if ( _rExceptionType.isEmpty() ) + _inout_rBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "Unknown" ) ); else _inout_rBuffer.append( _rExceptionType ); - _inout_rBuffer.appendAscii( "\n" ); + _inout_rBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "\n" ) ); lcl_indent( _inout_rBuffer, _nLevel ); - _inout_rBuffer.appendAscii( "Message: " ); + _inout_rBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM( "Message: " ) ); _inout_rBuffer.append( _e.Message ); } @@ -371,7 +371,7 @@ void implAppendExceptionMsg( ::rtl::OUStringBuffer& _inout_rBuffer, const Except return aMessageBuf.makeStringAndClear(); } -String implGetExceptionMsg( const Any& _rCaughtException ) +::rtl::OUString implGetExceptionMsg( const Any& _rCaughtException ) { OSL_PRECOND( _rCaughtException.getValueTypeClass() == TypeClass_EXCEPTION, "implGetExceptionMsg: illegal argument!" ); if ( _rCaughtException.getValueTypeClass() != TypeClass_EXCEPTION ) @@ -396,7 +396,7 @@ Any convertAny( const Any& rVal, const Type& aDestType ) } catch( CannotConvertException& e2 ) { - String aCannotConvertExceptionName + ::rtl::OUString aCannotConvertExceptionName ( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.lang.IllegalArgumentException" ) ); StarBASIC::Error( ERRCODE_BASIC_EXCEPTION, implGetExceptionMsg( e2, aCannotConvertExceptionName ) ); @@ -429,15 +429,15 @@ Reference<XIdlClass> TypeToIdlClass( const Type& rType ) // Exception type unknown template< class EXCEPTION > -String implGetExceptionMsg( const EXCEPTION& e ) +::rtl::OUString implGetExceptionMsg( const EXCEPTION& e ) { return implGetExceptionMsg( e, ::getCppuType( &e ).getTypeName() ); } // Error-Message fuer WrappedTargetExceptions -String implGetWrappedMsg( const WrappedTargetException& e ) +::rtl::OUString implGetWrappedMsg( const WrappedTargetException& e ) { - String aMsg; + ::rtl::OUString aMsg; Any aWrappedAny = e.TargetException; Type aExceptionType = aWrappedAny.getValueType(); @@ -445,7 +445,7 @@ String implGetWrappedMsg( const WrappedTargetException& e ) if( aExceptionType.getTypeClass() == TypeClass_EXCEPTION ) { Exception& e_ = *( (Exception*)aWrappedAny.getValue() ); - aMsg = implGetExceptionMsg( e_, String( aExceptionType.getTypeName() ) ); + aMsg = implGetExceptionMsg( e_, ::rtl::OUString( aExceptionType.getTypeName() ) ); } // Otherwise use WrappedTargetException itself else @@ -521,7 +521,7 @@ void implHandleWrappedTargetException( const Any& _rWrappedTargetException ) implAppendExceptionMsg( aMessageBuf, aWrapped, aExamine.getValueTypeName(), nLevel ); if ( aWrapped.TargetException.getValueTypeClass() == TypeClass_EXCEPTION ) // there is a next chain element - aMessageBuf.appendAscii( "\nTargetException:" ); + aMessageBuf.appendAscii( RTL_CONSTASCII_STRINGPARAM("\nTargetException:") ); // next round aExamine = aWrapped.TargetException; @@ -738,7 +738,7 @@ void unoToSbxValue( SbxVariable* pVar, const Any& aValue ) aClassAny <<= xClass; // instantiate SbUnoObject - String aName; + ::rtl::OUString aName; SbUnoObject* pSbUnoObject = new SbUnoObject( aName, aClassAny ); SbxObjectRef xWrapper = (SbxObject*)pSbUnoObject; @@ -826,7 +826,7 @@ void unoToSbxValue( SbxVariable* pVar, const Any& aValue ) } } // instantiate a SbUnoObject - String aName; + ::rtl::OUString aName; SbUnoObject* pSbUnoObject = new SbUnoObject( aName, aValue ); //If this is called externally e.g. from the scripting //framework then there is no 'active' runtime the default property will not be set up @@ -834,7 +834,7 @@ void unoToSbxValue( SbxVariable* pVar, const Any& aValue ) //test seems a bit of overkill //if ( SbiRuntime::isVBAEnabled() ) { - String sDfltPropName; + ::rtl::OUString sDfltPropName; if ( SbUnoObject::getDefaultPropName( pSbUnoObject, sDfltPropName ) ) pSbUnoObject->SetDfltProperty( sDfltPropName ); @@ -915,7 +915,7 @@ void unoToSbxValue( SbxVariable* pVar, const Any& aValue ) pVar->PutChar( *(sal_Unicode*)aValue.getValue() ); break; } - case TypeClass_STRING: { ::rtl::OUString val; aValue >>= val; pVar->PutString( String( val ) ); } break; + case TypeClass_STRING: { ::rtl::OUString val; aValue >>= val; pVar->PutString( val); } break; case TypeClass_FLOAT: { float val = 0; aValue >>= val; pVar->PutSingle( val ); } break; case TypeClass_DOUBLE: { double val = 0; aValue >>= val; pVar->PutDouble( val ); } break; case TypeClass_BYTE: { sal_Int8 val = 0; aValue >>= val; pVar->PutInteger( val ); } break; @@ -1601,7 +1601,7 @@ void processAutomationParams( SbxArray* pParams, Sequence< Any >& args, bool bOL bBlockConversionToSmallestType ); ::rtl::OUString aParamName = pNames[iSbx]; - if( aParamName.getLength() ) + if( !aParamName.isEmpty() ) { oleautomation::NamedArgument aNamedArgument; aNamedArgument.Name = aParamName; @@ -1630,7 +1630,7 @@ enum INVOKETYPE SetProp, Func }; -Any invokeAutomationMethod( const String& Name, Sequence< Any >& args, SbxArray* pParams, sal_uInt32 nParamCount, Reference< XInvocation >& rxInvocation, INVOKETYPE invokeType = Func ) +Any invokeAutomationMethod( const ::rtl::OUString& Name, Sequence< Any >& args, SbxArray* pParams, sal_uInt32 nParamCount, Reference< XInvocation >& rxInvocation, INVOKETYPE invokeType = Func ) { Sequence< sal_Int16 > OutParamIndex; Sequence< Any > OutParam; @@ -1674,27 +1674,27 @@ Any invokeAutomationMethod( const String& Name, Sequence< Any >& args, SbxArray* } // Debugging help method to readout the imlemented interfaces of an object -String Impl_GetInterfaceInfo( const Reference< XInterface >& x, const Reference< XIdlClass >& xClass, sal_uInt16 nRekLevel ) +::rtl::OUString Impl_GetInterfaceInfo( const Reference< XInterface >& x, const Reference< XIdlClass >& xClass, sal_uInt16 nRekLevel ) { Type aIfaceType = ::getCppuType( (const Reference< XInterface > *)0 ); static Reference< XIdlClass > xIfaceClass = TypeToIdlClass( aIfaceType ); - String aRetStr; + ::rtl::OUStringBuffer aRetStr; for( sal_uInt16 i = 0 ; i < nRekLevel ; i++ ) - aRetStr.AppendAscii( " " ); - aRetStr += String( xClass->getName() ); + aRetStr.appendAscii( RTL_CONSTASCII_STRINGPARAM( " " ) ); + aRetStr.append( xClass->getName() ); ::rtl::OUString aClassName = xClass->getName(); Type aClassType( xClass->getTypeClass(), aClassName.getStr() ); // checking if the interface is realy supported if( !x->queryInterface( aClassType ).hasValue() ) { - aRetStr.AppendAscii( " (ERROR: Not really supported!)\n" ); + aRetStr.appendAscii( RTL_CONSTASCII_STRINGPARAM( " (ERROR: Not really supported!)\n" ) ); } // Are there super interfaces? else { - aRetStr.AppendAscii( "\n" ); + aRetStr.appendAscii( RTL_CONSTASCII_STRINGPARAM( "\n" ) ); // get the super interfaces Sequence< Reference< XIdlClass > > aSuperClassSeq = xClass->getSuperclasses(); @@ -1704,19 +1704,19 @@ String Impl_GetInterfaceInfo( const Reference< XInterface >& x, const Reference< { const Reference< XIdlClass >& rxIfaceClass = pClasses[j]; if( !rxIfaceClass->equals( xIfaceClass ) ) - aRetStr += Impl_GetInterfaceInfo( x, rxIfaceClass, nRekLevel + 1 ); + aRetStr.append( Impl_GetInterfaceInfo( x, rxIfaceClass, nRekLevel + 1 ) ); } } - return aRetStr; + return aRetStr.makeStringAndClear(); } -String getDbgObjectNameImpl( SbUnoObject* pUnoObj ) +::rtl::OUString getDbgObjectNameImpl( SbUnoObject* pUnoObj ) { - String aName; + ::rtl::OUString aName; if( pUnoObj ) { aName = pUnoObj->GetClassName(); - if( !aName.Len() ) + if( aName.isEmpty() ) { Any aToInspectObj = pUnoObj->getUnoAny(); TypeClass eType = aToInspectObj.getValueType().getTypeClass(); @@ -1734,24 +1734,25 @@ String getDbgObjectNameImpl( SbUnoObject* pUnoObj ) return aName; } -String getDbgObjectName( SbUnoObject* pUnoObj ) +::rtl::OUString getDbgObjectName( SbUnoObject* pUnoObj ) { - String aName = getDbgObjectNameImpl( pUnoObj ); - if( !aName.Len() ) - aName.AppendAscii( "Unknown" ); + ::rtl::OUString const aName( getDbgObjectNameImpl( pUnoObj ) ); + ::rtl::OUStringBuffer aRet; + if( aName.getLength() > 20 ) + aRet.appendAscii( RTL_CONSTASCII_STRINGPARAM("\n") ); + aRet.appendAscii( RTL_CONSTASCII_STRINGPARAM("\"") ); - String aRet; - if( aName.Len() > 20 ) - aRet.AppendAscii( "\n" ); - aRet.AppendAscii( "\"" ); - aRet += aName; - aRet.AppendAscii( "\":" ); - return aRet; + if( !aName.isEmpty() ) + aRet.append( aName ); + else + aRet.appendAscii( RTL_CONSTASCII_STRINGPARAM( "Unknown" ) ); + aRet.appendAscii( RTL_CONSTASCII_STRINGPARAM( "\":" ) ); + return aRet.makeStringAndClear(); } -String getBasicObjectTypeName( SbxObject* pObj ) +::rtl::OUString getBasicObjectTypeName( SbxObject* pObj ) { - String aName; + ::rtl::OUString aName; if( pObj ) { SbUnoObject* pUnoObj = PTR_CAST(SbUnoObject,pObj); @@ -1762,7 +1763,7 @@ String getBasicObjectTypeName( SbxObject* pObj ) } bool checkUnoObjectType( SbUnoObject* pUnoObj, - const String& aClass ) + const ::rtl::OUString& aClass ) { Any aToInspectObj = pUnoObj->getUnoAny(); TypeClass eType = aToInspectObj.getValueType().getTypeClass(); @@ -1793,7 +1794,7 @@ bool checkUnoObjectType( SbUnoObject* pUnoObj, break; } ::rtl::OUString sClassName = xClass->getName(); - if ( sClassName.equals( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.bridge.oleautomation.XAutomationObject" ) ) ) ) + if ( sClassName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("com.sun.star.bridge.oleautomation.XAutomationObject" ) ) ) { // there is a hack in the extensions/source/ole/oleobj.cxx to return the typename of the automation object, lets check if it // matches @@ -1802,7 +1803,7 @@ bool checkUnoObjectType( SbUnoObject* pUnoObj, { rtl::OUString sTypeName; xInv->getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("$GetTypeName") ) ) >>= sTypeName; - if ( sTypeName.getLength() == 0 || sTypeName.equals( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("IDispatch") ) ) ) + if ( sTypeName.isEmpty() || sTypeName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("IDispatch") ) ) // can't check type, leave it pass result = true; else @@ -1830,17 +1831,17 @@ bool checkUnoObjectType( SbUnoObject* pUnoObj, } // Debugging help method to readout the imlemented interfaces of an object -String Impl_GetSupportedInterfaces( SbUnoObject* pUnoObj ) +::rtl::OUString Impl_GetSupportedInterfaces( SbUnoObject* pUnoObj ) { Any aToInspectObj = pUnoObj->getUnoAny(); // allow only TypeClass interface TypeClass eType = aToInspectObj.getValueType().getTypeClass(); - String aRet; + ::rtl::OUStringBuffer aRet; if( eType != TypeClass_INTERFACE ) { - aRet.AppendAscii( RTL_CONSTASCII_STRINGPARAM(ID_DBG_SUPPORTEDINTERFACES) ); - aRet.AppendAscii( " not available.\n(TypeClass is not TypeClass_INTERFACE)\n" ); + aRet.appendAscii( RTL_CONSTASCII_STRINGPARAM(ID_DBG_SUPPORTEDINTERFACES) ); + aRet.appendAscii( RTL_CONSTASCII_STRINGPARAM(" not available.\n(TypeClass is not TypeClass_INTERFACE)\n") ); } else { @@ -1851,10 +1852,9 @@ String Impl_GetSupportedInterfaces( SbUnoObject* pUnoObj ) Reference< XIdlClassProvider > xClassProvider( x, UNO_QUERY ); Reference< XTypeProvider > xTypeProvider( x, UNO_QUERY ); - aRet.AssignAscii( "Supported interfaces by object " ); - String aObjName = getDbgObjectName( pUnoObj ); - aRet += aObjName; - aRet.AppendAscii( "\n" ); + aRet.appendAscii( RTL_CONSTASCII_STRINGPARAM("Supported interfaces by object ") ); + aRet.append( getDbgObjectName( pUnoObj ) ); + aRet.appendAscii( RTL_CONSTASCII_STRINGPARAM("\n") ); if( xTypeProvider.is() ) { // get the interfaces of the implementation @@ -1868,17 +1868,16 @@ String Impl_GetSupportedInterfaces( SbUnoObject* pUnoObj ) Reference<XIdlClass> xClass = TypeToIdlClass( rType ); if( xClass.is() ) { - aRet += Impl_GetInterfaceInfo( x, xClass, 1 ); + aRet.append( Impl_GetInterfaceInfo( x, xClass, 1 ) ); } else { typelib_TypeDescription * pTD = 0; rType.getDescription( &pTD ); - String TypeName( ::rtl::OUString( pTD->pTypeName ) ); - aRet.AppendAscii( "*** ERROR: No IdlClass for type \"" ); - aRet += TypeName; - aRet.AppendAscii( "\"\n*** Please check type library\n" ); + aRet.appendAscii( RTL_CONSTASCII_STRINGPARAM("*** ERROR: No IdlClass for type \"") ); + aRet.append( pTD->pTypeName ); + aRet.appendAscii( RTL_CONSTASCII_STRINGPARAM("\"\n*** Please check type library\n") ); } } } @@ -1888,61 +1887,62 @@ String Impl_GetSupportedInterfaces( SbUnoObject* pUnoObj ) OSL_FAIL( "XClassProvider not supported in UNO3" ); } } - return aRet; + return aRet.makeStringAndClear(); } // Debugging help method SbxDataType -> String -String Dbg_SbxDataType2String( SbxDataType eType ) +::rtl::OUString Dbg_SbxDataType2String( SbxDataType eType ) { - String aRet( RTL_CONSTASCII_USTRINGPARAM("Unknown Sbx-Type!") ); + ::rtl::OUStringBuffer aRet; + aRet.appendAscii(RTL_CONSTASCII_STRINGPARAM("Unknown Sbx-Type!")); switch( +eType ) { - case SbxEMPTY: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxEMPTY") ); break; - case SbxNULL: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxNULL") ); break; - case SbxINTEGER: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxINTEGER") ); break; - case SbxLONG: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxLONG") ); break; - case SbxSINGLE: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxSINGLE") ); break; - case SbxDOUBLE: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxDOUBLE") ); break; - case SbxCURRENCY: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxCURRENCY") ); break; - case SbxDECIMAL: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxDECIMAL") ); break; - case SbxDATE: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxDATE") ); break; - case SbxSTRING: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxSTRING") ); break; - case SbxOBJECT: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxOBJECT") ); break; - case SbxERROR: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxERROR") ); break; - case SbxBOOL: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxBOOL") ); break; - case SbxVARIANT: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxVARIANT") ); break; - case SbxDATAOBJECT: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxDATAOBJECT") ); break; - case SbxCHAR: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxCHAR") ); break; - case SbxBYTE: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxBYTE") ); break; - case SbxUSHORT: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxUSHORT") ); break; - case SbxULONG: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxULONG") ); break; - case SbxSALINT64: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxINT64") ); break; - case SbxSALUINT64: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxUINT64") ); break; - case SbxINT: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxINT") ); break; - case SbxUINT: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxUINT") ); break; - case SbxVOID: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxVOID") ); break; - case SbxHRESULT: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxHRESULT") ); break; - case SbxPOINTER: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxPOINTER") ); break; - case SbxDIMARRAY: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxDIMARRAY") ); break; - case SbxCARRAY: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxCARRAY") ); break; - case SbxUSERDEF: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxUSERDEF") ); break; - case SbxLPSTR: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxLPSTR") ); break; - case SbxLPWSTR: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxLPWSTR") ); break; - case SbxCoreSTRING: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxCoreSTRING" ) ); break; - case SbxOBJECT | SbxARRAY: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxARRAY") ); break; + case SbxEMPTY: aRet.appendAscii(RTL_CONSTASCII_STRINGPARAM("SbxEMPTY")); break; + case SbxNULL: aRet.appendAscii(RTL_CONSTASCII_STRINGPARAM("SbxNULL")); break; + case SbxINTEGER: aRet.appendAscii(RTL_CONSTASCII_STRINGPARAM("SbxINTEGER")); break; + case SbxLONG: aRet.appendAscii(RTL_CONSTASCII_STRINGPARAM("SbxLONG")); break; + case SbxSINGLE: aRet.appendAscii(RTL_CONSTASCII_STRINGPARAM("SbxSINGLE")); break; + case SbxDOUBLE: aRet.appendAscii(RTL_CONSTASCII_STRINGPARAM("SbxDOUBLE")); break; + case SbxCURRENCY: aRet.appendAscii(RTL_CONSTASCII_STRINGPARAM("SbxCURRENCY")); break; + case SbxDECIMAL: aRet.appendAscii(RTL_CONSTASCII_STRINGPARAM("SbxDECIMAL")); break; + case SbxDATE: aRet.appendAscii(RTL_CONSTASCII_STRINGPARAM("SbxDATE")); break; + case SbxSTRING: aRet.appendAscii(RTL_CONSTASCII_STRINGPARAM("SbxSTRING")); break; + case SbxOBJECT: aRet.appendAscii(RTL_CONSTASCII_STRINGPARAM("SbxOBJECT")); break; + case SbxERROR: aRet.appendAscii(RTL_CONSTASCII_STRINGPARAM("SbxERROR")); break; + case SbxBOOL: aRet.appendAscii(RTL_CONSTASCII_STRINGPARAM("SbxBOOL")); break; + case SbxVARIANT: aRet.appendAscii(RTL_CONSTASCII_STRINGPARAM("SbxVARIANT")); break; + case SbxDATAOBJECT: aRet.appendAscii(RTL_CONSTASCII_STRINGPARAM("SbxDATAOBJECT")); break; + case SbxCHAR: aRet.appendAscii(RTL_CONSTASCII_STRINGPARAM("SbxCHAR")); break; + case SbxBYTE: aRet.appendAscii(RTL_CONSTASCII_STRINGPARAM("SbxBYTE")); break; + case SbxUSHORT: aRet.appendAscii(RTL_CONSTASCII_STRINGPARAM("SbxUSHORT")); break; + case SbxULONG: aRet.appendAscii(RTL_CONSTASCII_STRINGPARAM("SbxULONG")); break; + case SbxSALINT64: aRet.appendAscii(RTL_CONSTASCII_STRINGPARAM("SbxINT64")); break; + case SbxSALUINT64: aRet.appendAscii(RTL_CONSTASCII_STRINGPARAM("SbxUINT64")); break; + case SbxINT: aRet.appendAscii(RTL_CONSTASCII_STRINGPARAM("SbxINT")); break; + case SbxUINT: aRet.appendAscii(RTL_CONSTASCII_STRINGPARAM("SbxUINT")); break; + case SbxVOID: aRet.appendAscii(RTL_CONSTASCII_STRINGPARAM("SbxVOID")); break; + case SbxHRESULT: aRet.appendAscii(RTL_CONSTASCII_STRINGPARAM("SbxHRESULT")); break; + case SbxPOINTER: aRet.appendAscii(RTL_CONSTASCII_STRINGPARAM("SbxPOINTER")); break; + case SbxDIMARRAY: aRet.appendAscii(RTL_CONSTASCII_STRINGPARAM("SbxDIMARRAY")); break; + case SbxCARRAY: aRet.appendAscii(RTL_CONSTASCII_STRINGPARAM("SbxCARRAY")); break; + case SbxUSERDEF: aRet.appendAscii(RTL_CONSTASCII_STRINGPARAM("SbxUSERDEF")); break; + case SbxLPSTR: aRet.appendAscii(RTL_CONSTASCII_STRINGPARAM("SbxLPSTR")); break; + case SbxLPWSTR: aRet.appendAscii(RTL_CONSTASCII_STRINGPARAM("SbxLPWSTR")); break; + case SbxCoreSTRING: aRet.appendAscii(RTL_CONSTASCII_STRINGPARAM("SbxCoreSTRING")); break; + case SbxOBJECT | SbxARRAY: aRet.appendAscii(RTL_CONSTASCII_STRINGPARAM("SbxARRAY")); break; default: break; } - return aRet; + return aRet.makeStringAndClear(); } // Debugging help method to display the properties of a SbUnoObjects -String Impl_DumpProperties( SbUnoObject* pUnoObj ) +::rtl::OUString Impl_DumpProperties( SbUnoObject* pUnoObj ) { - String aRet( RTL_CONSTASCII_USTRINGPARAM("Properties of object ") ); - String aObjName = getDbgObjectName( pUnoObj ); - aRet += aObjName; + ::rtl::OUStringBuffer aRet; + aRet.appendAscii(RTL_CONSTASCII_STRINGPARAM("Properties of object ")); + aRet.append( getDbgObjectName( pUnoObj ) ); // analyse the Uno-Infos to recognise the arrays Reference< XIntrospectionAccess > xAccess = pUnoObj->getIntrospectionAccess(); @@ -1954,8 +1954,8 @@ String Impl_DumpProperties( SbUnoObject* pUnoObj ) } if( !xAccess.is() ) { - aRet.AppendAscii( "\nUnknown, no introspection available\n" ); - return aRet; + aRet.appendAscii( RTL_CONSTASCII_STRINGPARAM("\nUnknown, no introspection available\n") ); + return aRet.makeStringAndClear(); } Sequence<Property> props = xAccess->getProperties( PropertyConcept::ALL - PropertyConcept::DANGEROUS ); @@ -1970,9 +1970,9 @@ String Impl_DumpProperties( SbUnoObject* pUnoObj ) SbxVariable* pVar = pProps->Get( i ); if( pVar ) { - String aPropStr; + ::rtl::OUStringBuffer aPropStr; if( (i % nPropsPerLine) == 0 ) - aPropStr.AppendAscii( "\n" ); + aPropStr.appendAscii( RTL_CONSTASCII_STRINGPARAM("\n") ); // output the type and name // Is it in Uno a sequence? @@ -1997,29 +1997,29 @@ String Impl_DumpProperties( SbUnoObject* pUnoObj ) eType = (SbxDataType) ( SbxOBJECT | SbxARRAY ); } } - aPropStr += Dbg_SbxDataType2String( eType ); + aPropStr.append( Dbg_SbxDataType2String( eType ) ); if( bMaybeVoid ) - aPropStr.AppendAscii( "/void" ); - aPropStr.AppendAscii( " " ); - aPropStr += pVar->GetName(); + aPropStr.appendAscii( RTL_CONSTASCII_STRINGPARAM("/void") ); + aPropStr.appendAscii( RTL_CONSTASCII_STRINGPARAM(" ") ); + aPropStr.append( pVar->GetName() ); if( i == nPropCount - 1 ) - aPropStr.AppendAscii( "\n" ); + aPropStr.appendAscii( RTL_CONSTASCII_STRINGPARAM("\n") ); else - aPropStr.AppendAscii( "; " ); + aPropStr.appendAscii( RTL_CONSTASCII_STRINGPARAM("; ") ); - aRet += aPropStr; + aRet.append( aPropStr.makeStringAndClear() ); } } - return aRet; + return aRet.makeStringAndClear(); } // Debugging help method to display the methods of an SbUnoObjects -String Impl_DumpMethods( SbUnoObject* pUnoObj ) +::rtl::OUString Impl_DumpMethods( SbUnoObject* pUnoObj ) { - String aRet( RTL_CONSTASCII_USTRINGPARAM("Methods of object ") ); - String aObjName = getDbgObjectName( pUnoObj ); - aRet += aObjName; + ::rtl::OUStringBuffer aRet; + aRet.appendAscii(RTL_CONSTASCII_STRINGPARAM("Methods of object ")); + aRet.append( getDbgObjectName( pUnoObj ) ); // XIntrospectionAccess, so that the types of the parameter could be outputed Reference< XIntrospectionAccess > xAccess = pUnoObj->getIntrospectionAccess(); @@ -2031,8 +2031,8 @@ String Impl_DumpMethods( SbUnoObject* pUnoObj ) } if( !xAccess.is() ) { - aRet.AppendAscii( "\nUnknown, no introspection available\n" ); - return aRet; + aRet.appendAscii( RTL_CONSTASCII_STRINGPARAM("\nUnknown, no introspection available\n") ); + return aRet.makeStringAndClear(); } Sequence< Reference< XIdlMethod > > methods = xAccess->getMethods ( MethodConcept::ALL - MethodConcept::DANGEROUS ); @@ -2042,8 +2042,8 @@ String Impl_DumpMethods( SbUnoObject* pUnoObj ) sal_uInt16 nMethodCount = pMethods->Count(); if( !nMethodCount ) { - aRet.AppendAscii( "\nNo methods found\n" ); - return aRet; + aRet.appendAscii( RTL_CONSTASCII_STRINGPARAM("\nNo methods found\n") ); + return aRet.makeStringAndClear(); } sal_uInt16 nPropsPerLine = 1 + nMethodCount / 30; for( sal_uInt16 i = 0; i < nMethodCount; i++ ) @@ -2051,9 +2051,9 @@ String Impl_DumpMethods( SbUnoObject* pUnoObj ) SbxVariable* pVar = pMethods->Get( i ); if( pVar ) { - String aPropStr; + ::rtl::OUStringBuffer aPropStr; if( (i % nPropsPerLine) == 0 ) - aPropStr.AppendAscii( "\n" ); + aPropStr.appendAscii( RTL_CONSTASCII_STRINGPARAM("\n") ); // address the method const Reference< XIdlMethod >& rxMethod = pUnoMethods[i]; @@ -2067,10 +2067,10 @@ String Impl_DumpMethods( SbUnoObject* pUnoObj ) eType = (SbxDataType) ( SbxOBJECT | SbxARRAY ); } // output the name and the type - aPropStr += Dbg_SbxDataType2String( eType ); - aPropStr.AppendAscii( " " ); - aPropStr += pVar->GetName(); - aPropStr.AppendAscii( " ( " ); + aPropStr.append( Dbg_SbxDataType2String( eType ) ); + aPropStr.appendAscii( RTL_CONSTASCII_STRINGPARAM(" ") ); + aPropStr.append ( pVar->GetName() ); + aPropStr.appendAscii( RTL_CONSTASCII_STRINGPARAM(" ( ") ); // the get-method mustn't have a parameter Sequence< Reference< XIdlClass > > aParamsSeq = rxMethod->getParameterTypes(); @@ -2081,27 +2081,26 @@ String Impl_DumpMethods( SbUnoObject* pUnoObj ) { for( sal_uInt16 j = 0; j < nParamCount; j++ ) { - String aTypeStr = Dbg_SbxDataType2String( unoToSbxType( pParams[ j ] ) ); - aPropStr += aTypeStr; + aPropStr.append ( Dbg_SbxDataType2String( unoToSbxType( pParams[ j ] ) ) ); if( j < nParamCount - 1 ) - aPropStr.AppendAscii( ", " ); + aPropStr.appendAscii( RTL_CONSTASCII_STRINGPARAM(", ") ); } } else - aPropStr.AppendAscii( "void" ); + aPropStr.appendAscii( RTL_CONSTASCII_STRINGPARAM("void") ); - aPropStr.AppendAscii( " ) " ); + aPropStr.appendAscii( RTL_CONSTASCII_STRINGPARAM(" ) ") ); if( i == nMethodCount - 1 ) - aPropStr.AppendAscii( "\n" ); + aPropStr.appendAscii( RTL_CONSTASCII_STRINGPARAM("\n") ); else - aPropStr.AppendAscii( "; " ); + aPropStr.appendAscii( RTL_CONSTASCII_STRINGPARAM("; ") ); - aRet += aPropStr; + aRet.append( aPropStr.makeStringAndClear() ); } } - return aRet; + return aRet.makeStringAndClear(); } TYPEINIT1(AutomationNamedArgsSbxArray,SbxArray) @@ -2132,7 +2131,7 @@ void SbUnoObject::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType, // Id == -1: Display implemented interfaces according the ClassProvider if( nId == -1 ) // Property ID_DBG_SUPPORTEDINTERFACES" { - String aRetStr = Impl_GetSupportedInterfaces( this ); + ::rtl::OUString aRetStr = Impl_GetSupportedInterfaces( this ); pVar->PutString( aRetStr ); } // Id == -2: output properties @@ -2140,7 +2139,7 @@ void SbUnoObject::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType, { // by now all properties must be established implCreateAll(); - String aRetStr = Impl_DumpProperties( this ); + ::rtl::OUString aRetStr = Impl_DumpProperties( this ); pVar->PutString( aRetStr ); } // Id == -3: output the methods @@ -2148,7 +2147,7 @@ void SbUnoObject::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType, { // y now all properties must be established implCreateAll(); - String aRetStr = Impl_DumpMethods( this ); + ::rtl::OUString aRetStr = Impl_DumpMethods( this ); pVar->PutString( aRetStr ); } return; @@ -2380,7 +2379,7 @@ void SbUnoObject::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType, Reference< XInvocation > createDynamicInvocationFor( const Any& aAny ); #endif -SbUnoObject::SbUnoObject( const String& aName_, const Any& aUnoObj_ ) +SbUnoObject::SbUnoObject( const ::rtl::OUString& aName_, const Any& aUnoObj_ ) : SbxObject( aName_ ) , bNeedIntrospection( sal_True ) , bNativeCOMObject( sal_False ) @@ -2388,8 +2387,8 @@ SbUnoObject::SbUnoObject( const String& aName_, const Any& aUnoObj_ ) static Reference< XIntrospection > xIntrospection; // beat out again the default properties of Sbx - Remove( XubString( RTL_CONSTASCII_USTRINGPARAM("Name") ), SbxCLASS_DONTCARE ); - Remove( XubString( RTL_CONSTASCII_USTRINGPARAM("Parent") ), SbxCLASS_DONTCARE ); + Remove( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Name") ), SbxCLASS_DONTCARE ); + Remove( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Parent") ), SbxCLASS_DONTCARE ); // check the type of the ojekts TypeClass eType = aUnoObj_.getValueType().getTypeClass(); @@ -2448,9 +2447,9 @@ SbUnoObject::SbUnoObject( const String& aName_, const Any& aUnoObj_ ) bFatalError = sal_False; // insert the real name of the class - if( aName_.Len() == 0 ) + if( !aName_.isEmpty() ) { - aClassName_ = String( aUnoObj_.getValueType().getTypeName() ); + aClassName_ = aUnoObj_.getValueType().getTypeName(); bSetClassName = sal_True; } } @@ -2464,7 +2463,7 @@ SbUnoObject::SbUnoObject( const String& aName_, const Any& aUnoObj_ ) if( xClassProvider.is() ) { // Insert the real name of the class - if( aName_.Len() == 0 ) + if( aName_.isEmpty() ) { Sequence< Reference< XIdlClass > > szClasses = xClassProvider->getIdlClasses(); sal_uInt32 nLen = szClasses.getLength(); @@ -2473,7 +2472,7 @@ SbUnoObject::SbUnoObject( const String& aName_, const Any& aUnoObj_ ) const Reference< XIdlClass > xImplClass = szClasses.getConstArray()[ 0 ]; if( xImplClass.is() ) { - aClassName_ = String( xImplClass->getName() ); + aClassName_ = xImplClass->getName(); bSetClassName = sal_True; } } @@ -2607,7 +2606,7 @@ void clearUnoMethods( void ) SbUnoMethod::SbUnoMethod ( - const String& aName_, + const ::rtl::OUString& aName_, SbxDataType eSbxType, Reference< XIdlMethod > xUnoMethod_, bool bInvocation, @@ -2679,7 +2678,7 @@ const Sequence<ParamInfo>& SbUnoMethod::getParamInfos( void ) SbUnoProperty::SbUnoProperty ( - const String& aName_, + const ::rtl::OUString& aName_, SbxDataType eSbxType, const Property& aUnoProp_, sal_Int32 nId_, @@ -2700,7 +2699,7 @@ SbUnoProperty::~SbUnoProperty() {} -SbxVariable* SbUnoObject::Find( const String& rName, SbxClassType t ) +SbxVariable* SbUnoObject::Find( const ::rtl::OUString& rName, SbxClassType t ) { static Reference< XIdlMethod > xDummyMethod; static Property aDummyProp; @@ -2720,7 +2719,7 @@ SbxVariable* SbUnoObject::Find( const String& rName, SbxClassType t ) if( mxExactName.is() ) { ::rtl::OUString aUExactName = mxExactName->getExactName( aUName ); - if( aUExactName.getLength() ) + if( !aUExactName.isEmpty() ) aUName = aUExactName; } if( mxUnoAccess->hasProperty( aUName, PropertyConcept::ALL - PropertyConcept::DANGEROUS ) ) @@ -2796,7 +2795,7 @@ SbxVariable* SbUnoObject::Find( const String& rName, SbxClassType t ) if( mxExactNameInvocation.is() ) { ::rtl::OUString aUExactName = mxExactNameInvocation->getExactName( aUName ); - if( aUExactName.getLength() ) + if( !aUExactName.isEmpty() ) aUName = aUExactName; } @@ -2843,9 +2842,9 @@ SbxVariable* SbUnoObject::Find( const String& rName, SbxClassType t ) if( !pRes ) { - if( rName.EqualsIgnoreCaseAscii( ID_DBG_SUPPORTEDINTERFACES ) || - rName.EqualsIgnoreCaseAscii( ID_DBG_PROPERTIES ) || - rName.EqualsIgnoreCaseAscii( ID_DBG_METHODS ) ) + if( rName.equalsIgnoreAsciiCaseAsciiL( RTL_CONSTASCII_STRINGPARAM(ID_DBG_SUPPORTEDINTERFACES)) || + rName.equalsIgnoreAsciiCaseAsciiL( RTL_CONSTASCII_STRINGPARAM(ID_DBG_PROPERTIES)) || + rName.equalsIgnoreAsciiCaseAsciiL( RTL_CONSTASCII_STRINGPARAM(ID_DBG_METHODS)) ) { // Create implCreateDbgProperties(); @@ -2864,15 +2863,15 @@ void SbUnoObject::implCreateDbgProperties( void ) Property aProp; // Id == -1: display the implemented interfaces corresponding the ClassProvider - SbxVariableRef xVarRef = new SbUnoProperty( String(RTL_CONSTASCII_USTRINGPARAM(ID_DBG_SUPPORTEDINTERFACES)), SbxSTRING, aProp, -1, false ); + SbxVariableRef xVarRef = new SbUnoProperty( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ID_DBG_SUPPORTEDINTERFACES)), SbxSTRING, aProp, -1, false ); QuickInsert( (SbxVariable*)xVarRef ); // Id == -2: output the properties - xVarRef = new SbUnoProperty( String(RTL_CONSTASCII_USTRINGPARAM(ID_DBG_PROPERTIES)), SbxSTRING, aProp, -2, false ); + xVarRef = new SbUnoProperty( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ID_DBG_PROPERTIES)), SbxSTRING, aProp, -2, false ); QuickInsert( (SbxVariable*)xVarRef ); // Id == -3: output the Methods - xVarRef = new SbUnoProperty( String(RTL_CONSTASCII_USTRINGPARAM(ID_DBG_METHODS)), SbxSTRING, aProp, -3, false ); + xVarRef = new SbUnoProperty( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ID_DBG_METHODS)), SbxSTRING, aProp, -3, false ); QuickInsert( (SbxVariable*)xVarRef ); } @@ -2952,7 +2951,7 @@ Any SbUnoObject::getUnoAny( void ) } // help method to create an Uno-Struct per CoreReflection -SbUnoObject* Impl_CreateUnoStruct( const String& aClassName ) +SbUnoObject* Impl_CreateUnoStruct( const ::rtl::OUString& aClassName ) { // get CoreReflection Reference< XIdlReflection > xCoreReflection = getCoreReflection_Impl(); @@ -2990,7 +2989,7 @@ SbxBase* SbUnoFactory::Create( sal_uInt16, sal_uInt32 ) return NULL; } -SbxObject* SbUnoFactory::CreateObject( const String& rClassName ) +SbxObject* SbUnoFactory::CreateObject( const ::rtl::OUString& rClassName ) { return Impl_CreateUnoStruct( rClassName ); } @@ -2998,7 +2997,7 @@ SbxObject* SbUnoFactory::CreateObject( const String& rClassName ) // Provisional interface for the UNO-Connection // Deliver a SbxObject, that wrap an Uno-Interface -SbxObjectRef GetSbUnoObject( const String& aName, const Any& aUnoObj_ ) +SbxObjectRef GetSbUnoObject( const ::rtl::OUString& aName, const Any& aUnoObj_ ) { return new SbUnoObject( aName, aUnoObj_ ); } @@ -3030,7 +3029,7 @@ void RTL_Impl_CreateUnoStruct( StarBASIC* pBasic, SbxArray& rPar, sal_Bool bWrit } // get the name of the class of the struct - String aClassName = rPar.Get(1)->GetString(); + ::rtl::OUString aClassName = rPar.Get(1)->GetString(); // try to create Struct with the same name SbUnoObjectRef xUnoObj = Impl_CreateUnoStruct( aClassName ); @@ -3055,7 +3054,7 @@ void RTL_Impl_CreateUnoService( StarBASIC* pBasic, SbxArray& rPar, sal_Bool bWri } // get the name of the class of the struct - String aServiceName = rPar.Get(1)->GetString(); + ::rtl::OUString aServiceName = rPar.Get(1)->GetString(); // search for the service and instatiate it Reference< XMultiServiceFactory > xFactory( comphelper::getProcessServiceFactory() ); @@ -3109,7 +3108,7 @@ void RTL_Impl_CreateUnoServiceWithArguments( StarBASIC* pBasic, SbxArray& rPar, } // get the name of the class of the struct - String aServiceName = rPar.Get(1)->GetString(); + ::rtl::OUString aServiceName = rPar.Get(1)->GetString(); Any aArgAsAny = sbxToUnoValue( rPar.Get(2), getCppuType( (Sequence<Any>*)0 ) ); Sequence< Any > aArgs; @@ -3169,7 +3168,7 @@ void RTL_Impl_GetProcessServiceManager( StarBASIC* pBasic, SbxArray& rPar, sal_B aAny <<= xFactory; // Create a SbUnoObject out of it and return it - SbUnoObjectRef xUnoObj = new SbUnoObject( String( RTL_CONSTASCII_USTRINGPARAM("ProcessServiceManager") ), aAny ); + SbUnoObjectRef xUnoObj = new SbUnoObject( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ProcessServiceManager") ), aAny ); refVar->PutObject( (SbUnoObject*)xUnoObj ); } else @@ -3215,7 +3214,7 @@ void RTL_Impl_HasInterfaces( StarBASIC* pBasic, SbxArray& rPar, sal_Bool bWrite for( sal_uInt16 i = 2 ; i < nParCount ; i++ ) { // get the name of the interface of the struct - String aIfaceName = rPar.Get( i )->GetString(); + ::rtl::OUString aIfaceName = rPar.Get( i )->GetString(); // search for the class Reference< XIdlClass > xClass = xCoreReflection->forName( aIfaceName ); @@ -3391,7 +3390,7 @@ VBAConstantHelper::init() } bool -VBAConstantHelper::isVBAConstantType( const String& rName ) +VBAConstantHelper::isVBAConstantType( const ::rtl::OUString& rName ) { init(); bool bConstant = false; @@ -3410,7 +3409,7 @@ VBAConstantHelper::isVBAConstantType( const String& rName ) } SbxVariable* -VBAConstantHelper::getVBAConstant( const String& rName ) +VBAConstantHelper::getVBAConstant( const ::rtl::OUString& rName ) { SbxVariable* pConst = NULL; init(); @@ -3431,7 +3430,7 @@ VBAConstantHelper::getVBAConstant( const String& rName ) // Function to search for a global identifier in the // UnoScope and to wrap it for Sbx -SbUnoClass* findUnoClass( const String& rName ) +SbUnoClass* findUnoClass( const ::rtl::OUString& rName ) { // #105550 Check if module exists SbUnoClass* pUnoClass = NULL; @@ -3453,7 +3452,7 @@ SbUnoClass* findUnoClass( const String& rName ) return pUnoClass; } -SbxVariable* SbUnoClass::Find( const XubString& rName, SbxClassType t ) +SbxVariable* SbUnoClass::Find( const ::rtl::OUString& rName, SbxClassType t ) { (void)t; @@ -3490,8 +3489,8 @@ SbxVariable* SbUnoClass::Find( const XubString& rName, SbxClassType t ) else { // expand fully qualified name - String aNewName = GetName(); - aNewName.AppendAscii( "." ); + ::rtl::OUString aNewName = GetName(); + aNewName += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "." ) ); aNewName += rName; // get CoreReflection @@ -3527,7 +3526,7 @@ SbxVariable* SbUnoClass::Find( const XubString& rName, SbxClassType t ) } catch( NoSuchElementException& e1 ) { - String aMsg = implGetExceptionMsg( e1 ); + ::rtl::OUString aMsg = implGetExceptionMsg( e1 ); } } @@ -3586,7 +3585,7 @@ SbxVariable* SbUnoClass::Find( const XubString& rName, SbxClassType t ) } -SbUnoService* findUnoService( const String& rName ) +SbUnoService* findUnoService( const ::rtl::OUString& rName ) { SbUnoService* pSbUnoService = NULL; @@ -3611,7 +3610,7 @@ SbUnoService* findUnoService( const String& rName ) return pSbUnoService; } -SbxVariable* SbUnoService::Find( const String& rName, SbxClassType ) +SbxVariable* SbUnoService::Find( const ::rtl::OUString& rName, SbxClassType ) { SbxVariable* pRes = SbxObject::Find( rName, SbxCLASS_METHOD ); @@ -3629,14 +3628,14 @@ SbxVariable* SbUnoService::Find( const String& rName, SbxClassType ) { Reference< XServiceConstructorDescription > xCtor = pCtorSeq[i]; - String aName( xCtor->getName() ); - if( !aName.Len() ) + ::rtl::OUString aName( xCtor->getName() ); + if( aName.isEmpty() ) { if( xCtor->isDefaultConstructor() ) - aName = String::CreateFromAscii( "create" ); + aName += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "create" ) ); } - if( aName.Len() ) + if( !aName.isEmpty() ) { // Create and insert SbUnoServiceCtor SbxVariableRef xSbCtorRef = new SbUnoServiceCtor( aName, xCtor ); @@ -3778,7 +3777,7 @@ void SbUnoService::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType, Any aRetAny; if( xServiceMgr.is() ) { - String aServiceName = GetName(); + ::rtl::OUString const aServiceName( GetName() ); Reference < XInterface > xRet; try { @@ -3828,7 +3827,7 @@ void clearUnoServiceCtors( void ) } } -SbUnoServiceCtor::SbUnoServiceCtor( const String& aName_, Reference< XServiceConstructorDescription > xServiceCtorDesc ) +SbUnoServiceCtor::SbUnoServiceCtor( const ::rtl::OUString& aName_, Reference< XServiceConstructorDescription > xServiceCtorDesc ) : SbxMethod( aName_, SbxOBJECT ) , m_xServiceCtorDesc( xServiceCtorDesc ) { @@ -3846,7 +3845,7 @@ SbxInfo* SbUnoServiceCtor::GetInfo() } -SbUnoSingleton* findUnoSingleton( const String& rName ) +SbUnoSingleton* findUnoSingleton( const ::rtl::OUString& rName ) { SbUnoSingleton* pSbUnoSingleton = NULL; @@ -3871,13 +3870,13 @@ SbUnoSingleton* findUnoSingleton( const String& rName ) return pSbUnoSingleton; } -SbUnoSingleton::SbUnoSingleton( const String& aName_, +SbUnoSingleton::SbUnoSingleton( const ::rtl::OUString& aName_, const Reference< XSingletonTypeDescription >& xSingletonTypeDesc ) : SbxObject( aName_ ) , m_xSingletonTypeDesc( xSingletonTypeDesc ) { SbxVariableRef xGetMethodRef = - new SbxMethod( String( RTL_CONSTASCII_USTRINGPARAM( "get" ) ), SbxOBJECT ); + new SbxMethod( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "get" ) ), SbxOBJECT ); QuickInsert( (SbxVariable*)xGetMethodRef ); } @@ -3918,7 +3917,7 @@ void SbUnoSingleton::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType, Any aRetAny; if( xContextToUse.is() ) { - String aSingletonName( RTL_CONSTASCII_USTRINGPARAM("/singletons/") ); + ::rtl::OUString aSingletonName( RTL_CONSTASCII_USTRINGPARAM("/singletons/") ); aSingletonName += GetName(); Reference < XInterface > xRet; xContextToUse->getValueByName( aSingletonName ) >>= xRet; @@ -4216,8 +4215,8 @@ void SbRtl_CreateUnoListener( StarBASIC* pBasic, SbxArray& rPar, sal_Bool bWrite } // get the name of the class of the struct - String aPrefixName = rPar.Get(1)->GetString(); - String aListenerClassName = rPar.Get(2)->GetString(); + ::rtl::OUString const aPrefixName(rPar.Get(1)->GetString()); + ::rtl::OUString const aListenerClassName(rPar.Get(2)->GetString()); // get the CoreReflection Reference< XIdlReflection > xCoreReflection = getCoreReflection_Impl(); @@ -4279,10 +4278,10 @@ void RTL_Impl_GetDefaultContext( StarBASIC* pBasic, SbxArray& rPar, sal_Bool bWr if( xPSMPropertySet.is() ) { Any aContextAny = xPSMPropertySet->getPropertyValue( - String( RTL_CONSTASCII_USTRINGPARAM("DefaultContext") ) ); + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("DefaultContext") ) ); SbUnoObjectRef xUnoObj = new SbUnoObject - ( String( RTL_CONSTASCII_USTRINGPARAM("DefaultContext") ), + ( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("DefaultContext") ), aContextAny ); refVar->PutObject( (SbUnoObject*)xUnoObj ); } @@ -4300,7 +4299,7 @@ void RTL_Impl_CreateUnoValue( StarBASIC* pBasic, SbxArray& rPar, sal_Bool bWrite (void)pBasic; (void)bWrite; - static String aTypeTypeString( RTL_CONSTASCII_USTRINGPARAM("type") ); + static ::rtl::OUString const aTypeTypeString( RTL_CONSTASCII_USTRINGPARAM("type") ); // 2 parameters needed if ( rPar.Count() != 3 ) @@ -4310,7 +4309,7 @@ void RTL_Impl_CreateUnoValue( StarBASIC* pBasic, SbxArray& rPar, sal_Bool bWrite } // get the name of the class of the struct - String aTypeName = rPar.Get(1)->GetString(); + ::rtl::OUString const aTypeName(rPar.Get(1)->GetString()); SbxVariable* pVal = rPar.Get(2); if( aTypeName == aTypeTypeString ) @@ -4357,7 +4356,7 @@ void RTL_Impl_CreateUnoValue( StarBASIC* pBasic, SbxArray& rPar, sal_Bool bWrite } catch( NoSuchElementException& e1 ) { - String aNoSuchElementExceptionName + ::rtl::OUString aNoSuchElementExceptionName ( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.container.NoSuchElementException" ) ); StarBASIC::Error( ERRCODE_BASIC_EXCEPTION, implGetExceptionMsg( e1, aNoSuchElementExceptionName ) ); @@ -4754,7 +4753,7 @@ bool SbModule::createCOMWrapperForIface( Any& o_rRetAny, SbClassModuleObject* pP SbxVariable* pVar = pModIfaces->Get( i ); ::rtl::OUString aIfaceName = pVar->GetName(); - if( aIfaceName.getLength() != 0 ) + if( !aIfaceName.isEmpty() ) { ::rtl::OUString aPureIfaceName = aIfaceName; sal_Int32 indexLastDot = aIfaceName.lastIndexOf('.'); diff --git a/basic/source/inc/runtime.hxx b/basic/source/inc/runtime.hxx index afac6fec2807..21eec568f796 100755 --- a/basic/source/inc/runtime.hxx +++ b/basic/source/inc/runtime.hxx @@ -376,7 +376,7 @@ class SbiRuntime // #56204 DIM-Funktionalitaet in Hilfsmethode auslagern (step0.cxx) void DimImpl( SbxVariableRef refVar ); - bool implIsClass( SbxObject* pObj, const String& aClass ); + bool implIsClass( SbxObject* pObj, const ::rtl::OUString& aClass ); void StepSETCLASS_impl( sal_uInt32 nOp1, bool bHandleDflt = false ); @@ -408,7 +408,7 @@ class SbiRuntime void StepGOSUB( sal_uInt32 ), StepRETURN( sal_uInt32 ); void StepTESTFOR( sal_uInt32 ), StepCASETO( sal_uInt32 ), StepERRHDL( sal_uInt32 ); void StepRESUME( sal_uInt32 ), StepSETCLASS( sal_uInt32 ), StepVBASETCLASS( sal_uInt32 ), StepTESTCLASS( sal_uInt32 ), StepLIB( sal_uInt32 ); - bool checkClass_Impl( const SbxVariableRef& refVal, const String& aClass, bool bRaiseErrors, bool bDefault = true ); + bool checkClass_Impl( const SbxVariableRef& refVal, const rtl::OUString& aClass, bool bRaiseErrors, bool bDefault = true ); void StepCLOSE( sal_uInt32 ), StepPRCHAR( sal_uInt32 ), StepARGTYP( sal_uInt32 ); // Alle Opcodes mit zwei Operanden void StepRTL( sal_uInt32, sal_uInt32 ), StepPUBLIC( sal_uInt32, sal_uInt32 ), StepPUBLIC_P( sal_uInt32, sal_uInt32 ); diff --git a/basic/source/inc/sbunoobj.hxx b/basic/source/inc/sbunoobj.hxx index ea3d62c80e7f..456f2b7c42ca 100755 --- a/basic/source/inc/sbunoobj.hxx +++ b/basic/source/inc/sbunoobj.hxx @@ -64,16 +64,16 @@ class SbUnoObject: public SbxObject void implCreateAll( void ); public: - static bool getDefaultPropName( SbUnoObject* pUnoObj, String& sDfltProp ); + static bool getDefaultPropName( SbUnoObject* pUnoObj, ::rtl::OUString& sDfltProp ); TYPEINFO(); - SbUnoObject( const String& aName_, const ::com::sun::star::uno::Any& aUnoObj_ ); + SbUnoObject( const ::rtl::OUString& aName_, const ::com::sun::star::uno::Any& aUnoObj_ ); ~SbUnoObject(); // #76470 Introspection on Demand durchfuehren void doIntrospection( void ); // Find ueberladen, um z.B. NameAccess zu unterstuetzen - virtual SbxVariable* Find( const String&, SbxClassType ); + virtual SbxVariable* Find( const ::rtl::OUString&, SbxClassType ); // Force creation of all properties for debugging void createAllProperties( void ) @@ -115,7 +115,7 @@ class SbUnoMethod : public SbxMethod public: TYPEINFO(); - SbUnoMethod( const String& aName_, SbxDataType eSbxType, ::com::sun::star::uno::Reference< ::com::sun::star::reflection::XIdlMethod > xUnoMethod_, + SbUnoMethod( const ::rtl::OUString& aName_, SbxDataType eSbxType, ::com::sun::star::uno::Reference< ::com::sun::star::reflection::XIdlMethod > xUnoMethod_, bool bInvocation, bool bDirect = false ); virtual ~SbUnoMethod(); @@ -143,7 +143,7 @@ class SbUnoProperty : public SbxProperty virtual ~SbUnoProperty(); public: TYPEINFO(); - SbUnoProperty( const String& aName_, SbxDataType eSbxType, + SbUnoProperty( const ::rtl::OUString& aName_, SbxDataType eSbxType, const ::com::sun::star::beans::Property& aUnoProp_, sal_Int32 nId_, bool bInvocation ); bool isInvocationBased( void ) @@ -155,7 +155,7 @@ class SbUnoFactory : public SbxFactory { public: virtual SbxBase* Create( sal_uInt16 nSbxId, sal_uInt32 = SBXCR_SBX ); - virtual SbxObject* CreateObject( const String& ); + virtual SbxObject* CreateObject( const ::rtl::OUString& ); }; // Wrapper fuer eine Uno-Klasse @@ -174,7 +174,7 @@ public: {} // Find ueberladen, um Elemente on Demand anzulegen - virtual SbxVariable* Find( const String&, SbxClassType ); + virtual SbxVariable* Find( const ::rtl::OUString&, SbxClassType ); // Wert rausgeben const ::com::sun::star::uno::Reference< ::com::sun::star::reflection::XIdlClass >& getUnoClass( void ) { return m_xClass; } @@ -185,7 +185,7 @@ SV_DECL_IMPL_REF(SbUnoClass); // Funktion, um einen globalen Bezeichner im // UnoScope zu suchen und fuer Sbx zu wrappen -SbUnoClass* findUnoClass( const String& rName ); +SbUnoClass* findUnoClass( const ::rtl::OUString& rName ); // Wrapper for UNO Service @@ -203,13 +203,13 @@ public: , m_bNeedsInit( true ) {} - virtual SbxVariable* Find( const String&, SbxClassType ); + virtual SbxVariable* Find( const ::rtl::OUString&, SbxClassType ); void SFX_NOTIFY( SfxBroadcaster&, const TypeId&, const SfxHint& rHint, const TypeId& ); }; SV_DECL_IMPL_REF(SbUnoService); -SbUnoService* findUnoService( const String& rName ); +SbUnoService* findUnoService( const ::rtl::OUString& rName ); void clearUnoServiceCtors( void ); @@ -227,7 +227,7 @@ class SbUnoServiceCtor : public SbxMethod public: TYPEINFO(); - SbUnoServiceCtor( const String& aName_, ::com::sun::star::uno::Reference< ::com::sun::star::reflection::XServiceConstructorDescription > xServiceCtorDesc ); + SbUnoServiceCtor( const::rtl::OUString& aName_, ::com::sun::star::uno::Reference< ::com::sun::star::reflection::XServiceConstructorDescription > xServiceCtorDesc ); virtual ~SbUnoServiceCtor(); virtual SbxInfo* GetInfo(); @@ -243,14 +243,14 @@ class SbUnoSingleton : public SbxObject public: TYPEINFO(); - SbUnoSingleton( const String& aName_, + SbUnoSingleton( const ::rtl::OUString& aName_, const ::com::sun::star::uno::Reference< ::com::sun::star::reflection::XSingletonTypeDescription >& xSingletonTypeDesc ); void SFX_NOTIFY( SfxBroadcaster&, const TypeId&, const SfxHint& rHint, const TypeId& ); }; SV_DECL_IMPL_REF(SbUnoSingleton); -SbUnoSingleton* findUnoSingleton( const String& rName ); +SbUnoSingleton* findUnoSingleton( const ::rtl::OUString& rName ); // #105565 Special Object to wrap a strongly typed Uno Any @@ -348,8 +348,8 @@ private: void init(); public: static VBAConstantHelper& instance(); - SbxVariable* getVBAConstant( const String& rName ); - bool isVBAConstantType( const String& rName ); + SbxVariable* getVBAConstant( const ::rtl::OUString& rName ); + bool isVBAConstantType( const ::rtl::OUString& rName ); }; #endif diff --git a/basic/source/runtime/iosys.cxx b/basic/source/runtime/iosys.cxx index af0f5609be2c..05b384d9b082 100755 --- a/basic/source/runtime/iosys.cxx +++ b/basic/source/runtime/iosys.cxx @@ -199,7 +199,7 @@ void SbiStream::MapError() ::rtl::OUString right = INetURLObject::decode( token.copy(eindex + 1).trim(), '%', INetURLObject::DECODE_WITH_CHARSET ); - if(left.equals(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("user")))) + if(left.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("user"))) { user = right; break; diff --git a/basic/source/runtime/step1.cxx b/basic/source/runtime/step1.cxx index 53b482b8f22e..88661ead396d 100755 --- a/basic/source/runtime/step1.cxx +++ b/basic/source/runtime/step1.cxx @@ -40,7 +40,7 @@ #include "errobject.hxx" bool checkUnoObjectType( SbUnoObject* refVal, - const String& aClass ); + const ::rtl::OUString& aClass ); // Laden einer numerischen Konstanten (+ID) @@ -437,15 +437,15 @@ void SbiRuntime::StepPRCHAR( sal_uInt32 nOp1 ) // Check, ob TOS eine bestimmte Objektklasse ist (+StringID) -bool SbiRuntime::implIsClass( SbxObject* pObj, const String& aClass ) +bool SbiRuntime::implIsClass( SbxObject* pObj, const ::rtl::OUString& aClass ) { bool bRet = true; - if( aClass.Len() != 0 ) + if( !aClass.isEmpty() ) { bRet = pObj->IsClass( aClass ); if( !bRet ) - bRet = aClass.EqualsIgnoreCaseAscii( String( RTL_CONSTASCII_USTRINGPARAM("object") ) ); + bRet = aClass.equalsIgnoreAsciiCaseAsciiL( RTL_CONSTASCII_STRINGPARAM("object") ); if( !bRet ) { String aObjClass = pObj->GetClassName(); @@ -463,7 +463,7 @@ bool SbiRuntime::implIsClass( SbxObject* pObj, const String& aClass ) } bool SbiRuntime::checkClass_Impl( const SbxVariableRef& refVal, - const String& aClass, bool bRaiseErrors, bool bDefault ) + const ::rtl::OUString& aClass, bool bRaiseErrors, bool bDefault ) { bool bOk = bDefault; diff --git a/basic/source/uno/namecont.cxx b/basic/source/uno/namecont.cxx index e1e7fd3cf5f6..ceb3a48ff83c 100755 --- a/basic/source/uno/namecont.cxx +++ b/basic/source/uno/namecont.cxx @@ -448,7 +448,7 @@ sal_Bool SfxLibraryContainer::isModified() throw (RuntimeException) SfxLibrary* pImplLib = getImplLib( aName ); if( pImplLib->isModified() ) { - if ( aName.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Standard") ) ) ) + if ( aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("Standard") ) ) { // this is a workaround that has to be implemented because // empty standard library should stay marked as modified |