diff options
author | Norbert Thiebaud <nthiebaud@gmail.com> | 2012-11-06 23:34:23 -0600 |
---|---|---|
committer | Norbert Thiebaud <nthiebaud@gmail.com> | 2012-11-07 02:14:53 -0600 |
commit | 27239ad23006b1fd1ddb21467f4c1fd637b560d5 (patch) | |
tree | 605b30a50f25ef7e8f0d6511d6df24790ece90b9 /basic/inc | |
parent | f510217832a6edaf6a44169cabdf739985d00125 (diff) |
basic: String -> OUString
Change-Id: I42479b4bade5111e38d69f04c889c166f340d5ba
Diffstat (limited to 'basic/inc')
-rw-r--r-- | basic/inc/basic/basmgr.hxx | 3 | ||||
-rw-r--r-- | basic/inc/basic/sbmeth.hxx | 6 | ||||
-rw-r--r-- | basic/inc/basic/sbmod.hxx | 44 | ||||
-rw-r--r-- | basic/inc/basic/sbobjmod.hxx | 20 | ||||
-rw-r--r-- | basic/inc/basic/sbprop.hxx | 4 | ||||
-rw-r--r-- | basic/inc/basic/sbstar.hxx | 43 | ||||
-rw-r--r-- | basic/inc/basic/sbstdobj.hxx | 36 | ||||
-rw-r--r-- | basic/inc/basic/sbuno.hxx | 2 | ||||
-rw-r--r-- | basic/inc/basic/sbx.hxx | 84 | ||||
-rw-r--r-- | basic/inc/basic/sbxcore.hxx | 2 | ||||
-rw-r--r-- | basic/inc/basic/sbxform.hxx | 92 | ||||
-rw-r--r-- | basic/inc/basic/sbxmeth.hxx | 2 | ||||
-rw-r--r-- | basic/inc/basic/sbxobj.hxx | 32 | ||||
-rw-r--r-- | basic/inc/basic/sbxprop.hxx | 2 | ||||
-rw-r--r-- | basic/inc/basic/sbxvar.hxx | 40 |
15 files changed, 202 insertions, 210 deletions
diff --git a/basic/inc/basic/basmgr.hxx b/basic/inc/basic/basmgr.hxx index f59b4149120c..9c731369d1be 100644 --- a/basic/inc/basic/basmgr.hxx +++ b/basic/inc/basic/basmgr.hxx @@ -19,7 +19,6 @@ #ifndef _BASMGR_HXX #define _BASMGR_HXX -#include <tools/string.hxx> #include <svl/brdcst.hxx> #include <basic/sbstar.hxx> #include <com/sun/star/script/XStorageBasedLibraryContainer.hpp> @@ -213,7 +212,7 @@ public: /// executes a given macro ErrCode ExecuteMacro( OUString const& i_fullyQualifiedName, SbxArray* i_arguments, SbxValue* i_retValue ); /// executes a given macro - ErrCode ExecuteMacro( OUString const& i_fullyQualifiedName, String const& i_commaSeparatedArgs, SbxValue* i_retValue ); + ErrCode ExecuteMacro( OUString const& i_fullyQualifiedName, OUString const& i_commaSeparatedArgs, SbxValue* i_retValue ); private: BASIC_DLLPRIVATE sal_Bool IsReference( sal_uInt16 nLib ); diff --git a/basic/inc/basic/sbmeth.hxx b/basic/inc/basic/sbmeth.hxx index 0f24d4a9800e..9d4afbc37a24 100644 --- a/basic/inc/basic/sbmeth.hxx +++ b/basic/inc/basic/sbmeth.hxx @@ -43,8 +43,8 @@ class BASIC_DLLPUBLIC SbMethod : public SbxMethod sal_uInt16 nLine1, nLine2; sal_uInt32 nStart; sal_Bool bInvalid; - SbxArrayRef refStatics; - BASIC_DLLPRIVATE SbMethod( const String&, SbxDataType, SbModule* ); + SbxArrayRef refStatics; + BASIC_DLLPRIVATE SbMethod( const OUString&, SbxDataType, SbModule* ); BASIC_DLLPRIVATE SbMethod( const SbMethod& ); virtual sal_Bool LoadData( SvStream&, sal_uInt16 ); virtual sal_Bool StoreData( SvStream& ) const; @@ -77,7 +77,7 @@ class BASIC_DLLPUBLIC SbIfaceMapperMethod : public SbMethod public: TYPEINFO(); - SbIfaceMapperMethod( const String& rName, SbMethod* pImplMeth ) + SbIfaceMapperMethod( const OUString& rName, SbMethod* pImplMeth ) : SbMethod( rName, pImplMeth->GetType(), NULL ) , mxImplMeth( pImplMeth ) {} diff --git a/basic/inc/basic/sbmod.hxx b/basic/inc/basic/sbmod.hxx index 7d32abc41f09..1ff5b11c9b8b 100644 --- a/basic/inc/basic/sbmod.hxx +++ b/basic/inc/basic/sbmod.hxx @@ -51,14 +51,14 @@ class BASIC_DLLPUBLIC SbModule : public SbxObject, private ::boost::noncopyable friend class StarBASIC; friend class SbClassModuleObject; - std::vector< String > mModuleVariableNames; + std::vector< OUString > mModuleVariableNames; BASIC_DLLPRIVATE void implClearIfVarDependsOnDeletedBasic( SbxVariable* pVar, StarBASIC* pDeletedBasic ); protected: com::sun::star::uno::Reference< com::sun::star::script::XInvocation > mxWrapper; - ::rtl::OUString aOUSource; - String aComment; + OUString aOUSource; + OUString aComment; SbiImage* pImage; // the Image SbiBreakpoints* pBreaks; // Breakpoints SbClassData* pClassData; @@ -69,10 +69,10 @@ protected: static void implProcessModuleRunInit( ModuleInitDependencyMap& rMap, ClassModuleRunInitItem& rItem ); void StartDefinitions(); - SbMethod* GetMethod( const String&, SbxDataType ); - SbProperty* GetProperty( const String&, SbxDataType ); - SbProcedureProperty* GetProcedureProperty( const String&, SbxDataType ); - SbIfaceMapperMethod* GetIfaceMapperMethod( const String&, SbMethod* ); + SbMethod* GetMethod( const OUString&, SbxDataType ); + SbProperty* GetProperty( const OUString&, SbxDataType ); + SbProcedureProperty* GetProcedureProperty( const OUString&, SbxDataType ); + SbIfaceMapperMethod* GetIfaceMapperMethod( const OUString&, SbMethod* ); void EndDefinitions( sal_Bool=sal_False ); sal_uInt16 Run( SbMethod* ); void RunInit(); @@ -93,21 +93,21 @@ protected: public: SBX_DECL_PERSIST_NODATA(SBXCR_SBX,SBXID_BASICMOD,2); TYPEINFO(); - SbModule( const String&, sal_Bool bCompat = sal_False ); + SbModule( const OUString&, sal_Bool bCompat = sal_False ); virtual void SetParent( SbxObject* ); virtual void Clear(); - virtual SbxVariable* Find( const rtl::OUString&, SbxClassType ); + virtual SbxVariable* Find( const OUString&, SbxClassType ); - virtual const String& GetSource() const; - const ::rtl::OUString& GetSource32() const; - const String& GetComment() const { return aComment; } - virtual void SetSource( const String& r ); - void SetSource32( const ::rtl::OUString& r ); + virtual const OUString& GetSource() const; + const OUString& GetSource32() const; + const OUString& GetComment() const { return aComment; } + virtual void SetSource( const OUString& r ); + void SetSource32( const OUString& r ); - virtual sal_Bool Compile(); - virtual sal_Bool IsCompiled() const; - const SbxObject* FindType( String aTypeName ) const; + virtual sal_Bool Compile(); + virtual sal_Bool IsCompiled() const; + const SbxObject* FindType( OUString aTypeName ) const; virtual sal_Bool IsBreakable( sal_uInt16 nLine ) const; virtual size_t GetBPCount() const; @@ -131,10 +131,10 @@ public: bool IsVBACompat() const; void SetVBACompat( bool bCompat ); sal_Int32 GetModuleType() { return mnType; } - void SetModuleType( sal_Int32 nType ) { mnType = nType; } - bool isProxyModule() { return bIsProxyModule; } - void AddVarName( const String& aName ); - void RemoveVars(); + void SetModuleType( sal_Int32 nType ) { mnType = nType; } + bool isProxyModule() { return bIsProxyModule; } + void AddVarName( const OUString& aName ); + void RemoveVars(); ::com::sun::star::uno::Reference< ::com::sun::star::script::XInvocation > GetUnoModule(); bool createCOMWrapperForIface( ::com::sun::star::uno::Any& o_rRetAny, SbClassModuleObject* pProxyClassModuleObject ); }; @@ -153,7 +153,7 @@ public: ~SbClassModuleObject(); // Overridden to support NameAccess etc. - virtual SbxVariable* Find( const rtl::OUString&, SbxClassType ); + virtual SbxVariable* Find( const OUString&, SbxClassType ); virtual void SFX_NOTIFY( SfxBroadcaster&, const TypeId&, const SfxHint& rHint, const TypeId& ); diff --git a/basic/inc/basic/sbobjmod.hxx b/basic/inc/basic/sbobjmod.hxx index b3ff31f64d7a..768a273b26c8 100644 --- a/basic/inc/basic/sbobjmod.hxx +++ b/basic/inc/basic/sbobjmod.hxx @@ -40,8 +40,8 @@ protected: public: TYPEINFO(); - SbObjModule( const String& rName, const com::sun::star::script::ModuleInfo& mInfo, bool bIsVbaCompatible ); - virtual SbxVariable* Find( const rtl::OUString& rName, SbxClassType t ); + SbObjModule( const OUString& rName, const com::sun::star::script::ModuleInfo& mInfo, bool bIsVbaCompatible ); + virtual SbxVariable* Find( const OUString& rName, SbxClassType t ); virtual void SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType, const SfxHint& rHint, const TypeId& rHintType ); @@ -59,21 +59,21 @@ class BASIC_DLLPUBLIC SbUserFormModule : public SbObjModule ::rtl::Reference< FormObjEventListenerImpl > m_DialogListener; css::uno::Reference<css::awt::XDialog> m_xDialog; css::uno::Reference<css::frame::XModel> m_xModel; - String sFormName; + OUString sFormName; bool mbInit; //protected: virtual void InitObject(); public: TYPEINFO(); - SbUserFormModule( const String& rName, const com::sun::star::script::ModuleInfo& mInfo, bool bIsVBACompat ); + SbUserFormModule( const OUString& rName, const com::sun::star::script::ModuleInfo& mInfo, bool bIsVBACompat ); virtual ~SbUserFormModule(); - virtual SbxVariable* Find( const rtl::OUString& rName, SbxClassType t ); + virtual SbxVariable* Find( const OUString& rName, SbxClassType t ); void ResetApiObj( bool bTriggerTerminateEvent = true ); void Unload(); void Load(); - void triggerMethod( const String& ); - void triggerMethod( const String&, css::uno::Sequence< css::uno::Any >& ); + void triggerMethod( const OUString& ); + void triggerMethod( const OUString&, css::uno::Sequence< css::uno::Any >& ); void triggerActivateEvent(); void triggerDeactivateEvent(); void triggerInitializeEvent(); @@ -94,11 +94,11 @@ class BASIC_DLLPUBLIC SbUserFormModuleInstance : public SbUserFormModule SbUserFormModule* m_pParentModule; public: - SbUserFormModuleInstance( SbUserFormModule* pParentModule, const rtl::OUString& rName, + SbUserFormModuleInstance( SbUserFormModule* pParentModule, const OUString& rName, const com::sun::star::script::ModuleInfo& mInfo, bool bIsVBACompat ); - virtual sal_Bool IsClass( const rtl::OUString& ) const; - virtual SbxVariable* Find( const rtl::OUString& rName, SbxClassType t ); + virtual sal_Bool IsClass( const OUString& ) const; + virtual SbxVariable* Find( const OUString& rName, SbxClassType t ); }; #endif diff --git a/basic/inc/basic/sbprop.hxx b/basic/inc/basic/sbprop.hxx index 3e66f7e4c855..463fd5d41c73 100644 --- a/basic/inc/basic/sbprop.hxx +++ b/basic/inc/basic/sbprop.hxx @@ -33,7 +33,7 @@ class BASIC_DLLPUBLIC SbProperty : public SbxProperty friend class SbProcedureProperty; SbModule* pMod; sal_Bool bInvalid; - BASIC_DLLPRIVATE SbProperty( const String&, SbxDataType, SbModule* ); + BASIC_DLLPRIVATE SbProperty( const OUString&, SbxDataType, SbModule* ); virtual ~SbProperty(); public: SBX_DECL_PERSIST_NODATA(SBXCR_SBX,SBXID_BASICPROP,1); @@ -50,7 +50,7 @@ class BASIC_DLLPUBLIC SbProcedureProperty : public SbxProperty virtual ~SbProcedureProperty(); public: - SbProcedureProperty( const String& r, SbxDataType t ) + SbProcedureProperty( const OUString& r, SbxDataType t ) : SbxProperty( r, t ) // , pMod( p ) , mbSet( false ) {} diff --git a/basic/inc/basic/sbstar.hxx b/basic/inc/basic/sbstar.hxx index af3fa605381b..c84b62494169 100644 --- a/basic/inc/basic/sbstar.hxx +++ b/basic/inc/basic/sbstar.hxx @@ -69,17 +69,16 @@ class BASIC_DLLPUBLIC StarBASIC : public SbxObject BASIC_DLLPRIVATE void implClearDependingVarsOnDelete( StarBASIC* pDeletedBasic ); protected: - sal_Bool CError( SbError, const ::rtl::OUString&, xub_StrLen, xub_StrLen, xub_StrLen ); + sal_Bool CError( SbError, const OUString&, sal_Int32, sal_Int32, sal_Int32 ); private: - BASIC_DLLPRIVATE sal_Bool RTError( SbError, xub_StrLen, xub_StrLen, xub_StrLen ); - BASIC_DLLPRIVATE sal_Bool RTError( SbError, const String& rMsg, xub_StrLen, xub_StrLen, xub_StrLen ); - BASIC_DLLPRIVATE sal_uInt16 BreakPoint( xub_StrLen nLine, xub_StrLen nCol1, xub_StrLen nCol2 ); - BASIC_DLLPRIVATE sal_uInt16 StepPoint( xub_StrLen nLine, xub_StrLen nCol1, xub_StrLen nCol2 ); + BASIC_DLLPRIVATE sal_Bool RTError( SbError, sal_Int32, sal_Int32, sal_Int32 ); + BASIC_DLLPRIVATE sal_Bool RTError( SbError, const OUString& rMsg, sal_Int32, sal_Int32, sal_Int32 ); + BASIC_DLLPRIVATE sal_uInt16 BreakPoint( sal_Int32 nLine, sal_Int32 nCol1, sal_Int32 nCol2 ); + BASIC_DLLPRIVATE sal_uInt16 StepPoint( sal_Int32 nLine, sal_Int32 nCol1, sal_Int32 nCol2 ); virtual sal_Bool LoadData( SvStream&, sal_uInt16 ); virtual sal_Bool StoreData( SvStream& ) const; protected: - virtual sal_Bool ErrorHdl(); virtual sal_uInt16 BreakHdl(); virtual ~StarBASIC(); @@ -107,27 +106,27 @@ public: void SetLibInfo( BasicLibInfo* p ) { pLibInfo = p; } // Compiler-Interface - SbModule* MakeModule( const String& rName, const String& rSrc ); - SbModule* MakeModule32( const String& rName, const ::rtl::OUString& rSrc ); - SbModule* MakeModule32( const String& rName, const com::sun::star::script::ModuleInfo& mInfo, const ::rtl::OUString& rSrc ); - sal_Bool Compile( SbModule* ); + SbModule* MakeModule( const OUString& rName, const OUString& rSrc ); + SbModule* MakeModule32( const OUString& rName, const OUString& rSrc ); + SbModule* MakeModule32( const OUString& rName, const com::sun::star::script::ModuleInfo& mInfo, const OUString& rSrc ); + sal_Bool Compile( SbModule* ); static void Stop(); static void Error( SbError ); - static void Error( SbError, const String& rMsg ); + static void Error( SbError, const OUString& rMsg ); static void FatalError( SbError ); - static void FatalError( SbError, const String& rMsg ); + static void FatalError( SbError, const OUString& rMsg ); static bool IsRunning(); static SbError GetErrBasic(); // #66536 make additional message accessible by RTL function Error - static String GetErrorMsg(); - static xub_StrLen GetErl(); + static OUString GetErrorMsg(); + static sal_Int32 GetErl(); - virtual SbxVariable* Find( const rtl::OUString&, SbxClassType ); - virtual sal_Bool Call( const String&, SbxArray* = NULL ); + virtual SbxVariable* Find( const OUString&, SbxClassType ); + virtual sal_Bool Call( const OUString&, SbxArray* = NULL ); SbxArray* GetModules() { return pModules; } SbxObject* GetRtl() { return pRtl; } - SbModule* FindModule( const String& ); + SbModule* FindModule( const OUString& ); // Run init code of all modules (including the inserted Doc-Basics) void InitAllModules( StarBASIC* pBasicNotToInit = NULL ); void DeInitAllModules( void ); @@ -141,11 +140,11 @@ public: sal_uInt16 nCol1, sal_uInt16 nCol2 ); // Specific to error handler - static void MakeErrorText( SbError, const ::rtl::OUString& aMsg ); - static const String& GetErrorText(); + static void MakeErrorText( SbError, const OUString& aMsg ); + static const OUString& GetErrorText(); static SbError GetErrorCode(); static bool IsCompilerError(); - static sal_uInt16 GetVBErrorCode( SbError nError ); + static sal_uInt16 GetVBErrorCode( SbError nError ); static SbError GetSfxFromVBError( sal_uInt16 nError ); bool IsBreak() const { return bBreak; } @@ -160,7 +159,7 @@ public: SbxArrayRef getUnoListeners( void ); - static SbxBase* FindSBXInCurrentScope( const String& rName ); + static SbxBase* FindSBXInCurrentScope( const OUString& rName ); static SbMethod* GetActiveMethod( sal_uInt16 nLevel = 0 ); static SbModule* GetActiveModule(); void SetVBAEnabled( bool bEnabled ); @@ -168,7 +167,7 @@ public: SbxObjectRef getRTL( void ) { return pRtl; } bool IsDocBasic() { return bDocBasic; } - SbxVariable* VBAFind( const rtl::OUString& rName, SbxClassType t ); + SbxVariable* VBAFind( const OUString& rName, SbxClassType t ); bool GetUNOConstant( const sal_Char* _pAsciiName, ::com::sun::star::uno::Any& aOut ); void QuitAndExitApplication(); bool IsQuitApplication() { return bQuit; }; diff --git a/basic/inc/basic/sbstdobj.hxx b/basic/inc/basic/sbstdobj.hxx index cd0436416efa..75a5a6ecb452 100644 --- a/basic/inc/basic/sbstdobj.hxx +++ b/basic/inc/basic/sbstdobj.hxx @@ -33,7 +33,7 @@ class BASIC_DLLPUBLIC SbStdFactory : public SbxFactory public: SbStdFactory(); - virtual SbxObject* CreateObject( const rtl::OUString& rClassName ); + virtual SbxObject* CreateObject( const OUString& rClassName ); }; //-------------------- @@ -56,7 +56,7 @@ public: TYPEINFO(); SbStdPicture(); - virtual SbxVariable* Find( const rtl::OUString&, SbxClassType ); + virtual SbxVariable* Find( const OUString&, SbxClassType ); Graphic GetGraphic() const { return aGraphic; } void SetGraphic( const Graphic& rGrf ) { aGraphic = rGrf; } @@ -73,7 +73,7 @@ protected: sal_Bool bStrikeThrough; sal_Bool bUnderline; sal_uInt16 nSize; - String aName; + OUString aName; ~SbStdFont(); virtual void SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType, @@ -90,20 +90,20 @@ public: TYPEINFO(); SbStdFont(); - virtual SbxVariable* Find( const rtl::OUString&, SbxClassType ); - - void SetBold( sal_Bool bB ) { bBold = bB; } - sal_Bool IsBold() const { return bBold; } - void SetItalic( sal_Bool bI ) { bItalic = bI; } - sal_Bool IsItalic() const { return bItalic; } - void SetStrikeThrough( sal_Bool bS ) { bStrikeThrough = bS; } - sal_Bool IsStrikeThrough() const { return bStrikeThrough; } - void SetUnderline( sal_Bool bU ) { bUnderline = bU; } - sal_Bool IsUnderline() const { return bUnderline; } - void SetSize( sal_uInt16 nS ) { nSize = nS; } - sal_uInt16 GetSize() const { return nSize; } - void SetFontName( const String& rName ) { aName = rName; } - String GetFontName() const { return aName; } + virtual SbxVariable* Find( const OUString&, SbxClassType ); + + void SetBold( sal_Bool bB ) { bBold = bB; } + sal_Bool IsBold() const { return bBold; } + void SetItalic( sal_Bool bI ) { bItalic = bI; } + sal_Bool IsItalic() const { return bItalic; } + void SetStrikeThrough( sal_Bool bS ) { bStrikeThrough = bS; } + sal_Bool IsStrikeThrough() const { return bStrikeThrough; } + void SetUnderline( sal_Bool bU ) { bUnderline = bU; } + sal_Bool IsUnderline() const { return bUnderline; } + void SetSize( sal_uInt16 nS ) { nSize = nS; } + sal_uInt16 GetSize() const { return nSize; } + void SetFontName( const OUString& rName ) { aName = rName; } + OUString GetFontName() const { return aName; } }; //---------------------- @@ -128,7 +128,7 @@ public: TYPEINFO(); SbStdClipboard(); - virtual SbxVariable* Find( const rtl::OUString&, SbxClassType ); + virtual SbxVariable* Find( const OUString&, SbxClassType ); }; #endif diff --git a/basic/inc/basic/sbuno.hxx b/basic/inc/basic/sbuno.hxx index 9c3099169bfc..55d487a48b75 100644 --- a/basic/inc/basic/sbuno.hxx +++ b/basic/inc/basic/sbuno.hxx @@ -27,7 +27,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 -BASIC_DLLPUBLIC SbxObjectRef GetSbUnoObject( const ::rtl::OUString& aName, const com::sun::star::uno::Any& aUnoObj_ ); +BASIC_DLLPUBLIC SbxObjectRef GetSbUnoObject( const OUString& aName, const com::sun::star::uno::Any& aUnoObj_ ); // Force creation of all properties for debugging BASIC_DLLPUBLIC void createAllObjectProperties( SbxObject* pObj ); diff --git a/basic/inc/basic/sbx.hxx b/basic/inc/basic/sbx.hxx index f6e924ef096e..d5fba159e510 100644 --- a/basic/inc/basic/sbx.hxx +++ b/basic/inc/basic/sbx.hxx @@ -33,7 +33,6 @@ #include <boost/ptr_container/ptr_vector.hpp> -class String; class SvStream; class SbxBase; class SbxVariable; @@ -49,13 +48,13 @@ class SfxBroadcaster; // Parameter information struct SbxParamInfo { - const String aName; // Name of the parameter - SbxBaseRef aTypeRef; // Object, if object type - SbxDataType eType; // Data type - sal_uInt16 nFlags; // Flag-Bits - sal_uInt32 nUserData; // IDs etc. - SbxParamInfo( const String& s, SbxDataType t, sal_uInt16 n, SbxBase* b = NULL ) - : aName( s ), aTypeRef( b ), eType( t ), nFlags( n ), nUserData( 0 ) {} + const OUString aName; // Name of the parameter + SbxBaseRef aTypeRef; // Object, if object type + SbxDataType eType; // Data type + sal_uInt16 nFlags; // Flag-Bits + sal_uInt32 nUserData; // IDs etc. + SbxParamInfo( const OUString& s, SbxDataType t, sal_uInt16 n, SbxBase* b = NULL ) + : aName( s ), aTypeRef( b ), eType( t ), nFlags( n ), nUserData( 0 ) {} ~SbxParamInfo() {} }; @@ -66,8 +65,8 @@ class BASIC_DLLPUBLIC SbxInfo : public SvRefBase friend class SbxVariable; friend class SbMethod; - String aComment; - String aHelpFile; + OUString aComment; + OUString aHelpFile; sal_uInt32 nHelpId; SbxParams aParams; @@ -77,16 +76,16 @@ protected: virtual ~SbxInfo(); public: SbxInfo(); - SbxInfo( const String&, sal_uInt32 ); + SbxInfo( const OUString&, sal_uInt32 ); - void AddParam( const rtl::OUString&, SbxDataType, sal_uInt16=SBX_READ ); + void AddParam( const OUString&, SbxDataType, sal_uInt16=SBX_READ ); const SbxParamInfo* GetParam( sal_uInt16 n ) const; // index starts with 1! - const String& GetComment() const { return aComment; } - const String& GetHelpFile() const { return aHelpFile; } - sal_uInt32 GetHelpId() const { return nHelpId; } + const OUString& GetComment() const { return aComment; } + const OUString& GetHelpFile() const { return aHelpFile; } + sal_uInt32 GetHelpId() const { return nHelpId; } - void SetComment( const String& r ) { aComment = r; } - void SetHelpFile( const String& r ) { aHelpFile = r; } + void SetComment( const OUString& r ) { aComment = r; } + void SetHelpFile( const OUString& r ) { aHelpFile = r; } void SetHelpId( sal_uInt32 nId ) { nHelpId = nId; } }; @@ -142,28 +141,28 @@ public: SbxArray( const SbxArray& ); SbxArray& operator=( const SbxArray& ); virtual void Clear(); - sal_uInt16 Count() const; - virtual SbxDataType GetType() const; + sal_uInt16 Count() const; + virtual SbxDataType GetType() const; virtual SbxClassType GetClass() const; - SbxVariableRef& GetRef( sal_uInt16 ); - SbxVariable* Get( sal_uInt16 ); - void Put( SbxVariable*, sal_uInt16 ); - void Insert( SbxVariable*, sal_uInt16 ); - void Remove( sal_uInt16 ); - void Remove( SbxVariable* ); - void Merge( SbxArray* ); - const String& GetAlias( sal_uInt16 ); - void PutAlias( const String&, sal_uInt16 ); - SbxVariable* FindUserData( sal_uInt32 nUserData ); - virtual SbxVariable* Find( const rtl::OUString&, SbxClassType ); + SbxVariableRef& GetRef( sal_uInt16 ); + SbxVariable* Get( sal_uInt16 ); + void Put( SbxVariable*, sal_uInt16 ); + void Insert( SbxVariable*, sal_uInt16 ); + void Remove( sal_uInt16 ); + void Remove( SbxVariable* ); + void Merge( SbxArray* ); + const OUString& GetAlias( sal_uInt16 ); + void PutAlias( const OUString&, sal_uInt16 ); + SbxVariable* FindUserData( sal_uInt32 nUserData ); + virtual SbxVariable* Find( const OUString&, SbxClassType ); // Additional methods for 32-bit indices - sal_uInt32 Count32() const; - SbxVariableRef& GetRef32( sal_uInt32 ); - SbxVariable* Get32( sal_uInt32 ); - void Put32( SbxVariable*, sal_uInt32 ); - void Insert32( SbxVariable*, sal_uInt32 ); - void Remove32( sal_uInt32 ); + sal_uInt32 Count32() const; + SbxVariableRef& GetRef32( sal_uInt32 ); + SbxVariable* Get32( sal_uInt32 ); + void Put32( SbxVariable*, sal_uInt32 ); + void Insert32( SbxVariable*, sal_uInt32 ); + void Remove32( sal_uInt32 ); }; // SbxDimArray is an array that can dimensioned using BASIC conventions. @@ -229,19 +228,19 @@ protected: public: SBX_DECL_PERSIST_NODATA(SBXCR_SBX,SBXID_COLLECTION,1); TYPEINFO(); - SbxCollection( const String& rClassname ); + SbxCollection( const OUString& rClassname ); SbxCollection( const SbxCollection& ); SbxCollection& operator=( const SbxCollection& ); virtual SbxVariable* FindUserData( sal_uInt32 nUserData ); - virtual SbxVariable* Find( const rtl::OUString&, SbxClassType ); + virtual SbxVariable* Find( const OUString&, SbxClassType ); virtual void Clear(); }; class BASIC_DLLPUBLIC SbxStdCollection : public SbxCollection { protected: - String aElemClass; - sal_Bool bAddRemoveOk; + OUString aElemClass; + sal_Bool bAddRemoveOk; virtual ~SbxStdCollection(); virtual sal_Bool LoadData( SvStream&, sal_uInt16 ); virtual sal_Bool StoreData( SvStream& ) const; @@ -250,12 +249,11 @@ protected: public: SBX_DECL_PERSIST_NODATA(SBXCR_SBX,SBXID_FIXCOLLECTION,1); TYPEINFO(); - SbxStdCollection - ( const String& rClassname, const String& rElemClass, sal_Bool=sal_True ); + SbxStdCollection( const OUString& rClassname, const OUString& rElemClass, sal_Bool=sal_True ); SbxStdCollection( const SbxStdCollection& ); SbxStdCollection& operator=( const SbxStdCollection& ); virtual void Insert( SbxVariable* ); - const String& GetElementClass() const { return aElemClass; } + const OUString& GetElementClass() const { return aElemClass; } }; SV_IMPL_REF(SbxBase) diff --git a/basic/inc/basic/sbxcore.hxx b/basic/inc/basic/sbxcore.hxx index ce86fd695e0e..5d45d4bbc9c5 100644 --- a/basic/inc/basic/sbxcore.hxx +++ b/basic/inc/basic/sbxcore.hxx @@ -28,8 +28,6 @@ #include "basicdllapi.h" class SvStream; -class String; -namespace rtl { class OUString; } // The following Macro defines four (five) necessary methods within a // SBX object. LoadPrivateData() and StorePrivateData() must be implemented. diff --git a/basic/inc/basic/sbxform.hxx b/basic/inc/basic/sbxform.hxx index 42ff9d63c9c4..589f3ec24fd0 100644 --- a/basic/inc/basic/sbxform.hxx +++ b/basic/inc/basic/sbxform.hxx @@ -75,7 +75,8 @@ */ #define _with_sprintf // use a) -#include <tools/string.hxx> +#include <rtl/ustring.hxx> +#include <rtl/ustrbuf.hxx> #include "basicdllapi.h" class BASIC_DLLPUBLIC SbxBasicFormater { @@ -83,14 +84,14 @@ class BASIC_DLLPUBLIC SbxBasicFormater { // Constructor takes signs for decimal point, thousand separation sign // and necessary resource strings. SbxBasicFormater( sal_Unicode _cDecPoint, sal_Unicode _cThousandSep, - String _sOnStrg, - String _sOffStrg, - String _sYesStrg, - String _sNoStrg, - String _sTrueStrg, - String _sFalseStrg, - String _sCurrencyStrg, - String _sCurrencyFormatStrg ); + OUString _sOnStrg, + OUString _sOffStrg, + OUString _sYesStrg, + OUString _sNoStrg, + OUString _sTrueStrg, + OUString _sFalseStrg, + OUString _sCurrencyStrg, + OUString _sCurrencyFormatStrg ); /* Basic command: Format$( number,format-string ) @@ -101,68 +102,67 @@ class BASIC_DLLPUBLIC SbxBasicFormater { Return value: String containing the formatted output */ - String BasicFormat( double dNumber, String sFormatStrg ); - String BasicFormatNull( String sFormatStrg ); + OUString BasicFormat( double dNumber, OUString sFormatStrg ); + OUString BasicFormatNull( OUString sFormatStrg ); - static sal_Bool isBasicFormat( String sFormatStrg ); + static sal_Bool isBasicFormat( OUString sFormatStrg ); private: - BASIC_DLLPRIVATE inline void ShiftString( String& sStrg, sal_uInt16 nStartPos ); - BASIC_DLLPRIVATE inline void StrAppendChar( String& sStrg, sal_Unicode ch ); - BASIC_DLLPRIVATE void AppendDigit( String& sStrg, short nDigit ); - BASIC_DLLPRIVATE void LeftShiftDecimalPoint( String& sStrg ); - BASIC_DLLPRIVATE void StrRoundDigit( String& sStrg, short nPos, sal_Bool& bOverflow ); - BASIC_DLLPRIVATE void StrRoundDigit( String& sStrg, short nPos ); - BASIC_DLLPRIVATE void ParseBack( String& sStrg, const String& sFormatStrg, - short nFormatPos ); + BASIC_DLLPRIVATE inline void ShiftString( OUStringBuffer& sStrg, sal_uInt16 nStartPos ); + BASIC_DLLPRIVATE void AppendDigit( OUStringBuffer& sStrg, short nDigit ); + BASIC_DLLPRIVATE void LeftShiftDecimalPoint( OUStringBuffer& sStrg ); + BASIC_DLLPRIVATE void StrRoundDigit( OUStringBuffer& sStrg, short nPos, sal_Bool& bOverflow ); + BASIC_DLLPRIVATE void StrRoundDigit( OUStringBuffer& sStrg, short nPos ); + BASIC_DLLPRIVATE void ParseBack( OUStringBuffer& sStrg, const OUString& sFormatStrg, + short nFormatPos ); #ifdef _with_sprintf // Methods for string conversion with sprintf(): BASIC_DLLPRIVATE void InitScan( double _dNum ); BASIC_DLLPRIVATE void InitExp( double _dNewExp ); BASIC_DLLPRIVATE short GetDigitAtPosScan( short nPos, sal_Bool& bFoundFirstDigit ); BASIC_DLLPRIVATE short GetDigitAtPosExpScan( double dNewExponent, short nPos, - sal_Bool& bFoundFirstDigit ); + sal_Bool& bFoundFirstDigit ); BASIC_DLLPRIVATE short GetDigitAtPosExpScan( short nPos, sal_Bool& bFoundFirstDigit ); #else // Methods for direct 'calculation' with log10() and pow(): BASIC_DLLPRIVATE short GetDigitAtPos( double dNumber, short nPos, double& dNextNumber, - sal_Bool& bFoundFirstDigit ); + sal_Bool& bFoundFirstDigit ); BASIC_DLLPRIVATE short RoundDigit( double dNumber ); #endif - BASIC_DLLPRIVATE String GetPosFormatString( const String& sFormatStrg, sal_Bool & bFound ); - BASIC_DLLPRIVATE String GetNegFormatString( const String& sFormatStrg, sal_Bool & bFound ); - BASIC_DLLPRIVATE String Get0FormatString( const String& sFormatStrg, sal_Bool & bFound ); - BASIC_DLLPRIVATE String GetNullFormatString( const String& sFormatStrg, sal_Bool & bFound ); - BASIC_DLLPRIVATE short AnalyseFormatString( const String& sFormatStrg, - short& nNoOfDigitsLeft, short& nNoOfDigitsRight, - short& nNoOfOptionalDigitsLeft, - short& nNoOfExponentDigits, - short& nNoOfOptionalExponentDigits, - sal_Bool& bPercent, sal_Bool& bCurrency, sal_Bool& bScientific, - sal_Bool& bGenerateThousandSeparator, - short& nMultipleThousandSeparators ); - BASIC_DLLPRIVATE void ScanFormatString( double dNumber, const String& sFormatStrg, - String& sReturnStrg, sal_Bool bCreateSign ); + BASIC_DLLPRIVATE OUString GetPosFormatString( const OUString& sFormatStrg, sal_Bool & bFound ); + BASIC_DLLPRIVATE OUString GetNegFormatString( const OUString& sFormatStrg, sal_Bool & bFound ); + BASIC_DLLPRIVATE OUString Get0FormatString( const OUString& sFormatStrg, sal_Bool & bFound ); + BASIC_DLLPRIVATE OUString GetNullFormatString( const OUString& sFormatStrg, sal_Bool & bFound ); + BASIC_DLLPRIVATE short AnalyseFormatString( const OUString& sFormatStrg, + short& nNoOfDigitsLeft, short& nNoOfDigitsRight, + short& nNoOfOptionalDigitsLeft, + short& nNoOfExponentDigits, + short& nNoOfOptionalExponentDigits, + sal_Bool& bPercent, sal_Bool& bCurrency, sal_Bool& bScientific, + sal_Bool& bGenerateThousandSeparator, + short& nMultipleThousandSeparators ); + BASIC_DLLPRIVATE void ScanFormatString( double dNumber, const OUString& sFormatStrg, + OUString& sReturnStrg, sal_Bool bCreateSign ); //*** Data *** sal_Unicode cDecPoint; // sign for the decimal point sal_Unicode cThousandSep; // sign for thousand delimiter // Text for output: - String sOnStrg; - String sOffStrg; - String sYesStrg; - String sNoStrg; - String sTrueStrg; - String sFalseStrg; - String sCurrencyStrg; - String sCurrencyFormatStrg; + OUString sOnStrg; + OUString sOffStrg; + OUString sYesStrg; + OUString sNoStrg; + OUString sTrueStrg; + OUString sFalseStrg; + OUString sCurrencyStrg; + OUString sCurrencyFormatStrg; //*** temporary data for scan loop *** //----------------------------------------------- // String containing the number in scientific format - String sSciNumStrg; + OUString sSciNumStrg; // String containing the exponent of the number - String sNumExpStrg; + OUString sNumExpStrg; double dNum; // the number that is scanned short nNumExp; // the exponent of the number short nExpExp; // the number of digits in the exponent diff --git a/basic/inc/basic/sbxmeth.hxx b/basic/inc/basic/sbxmeth.hxx index 3bdde98d064a..227c00cbad88 100644 --- a/basic/inc/basic/sbxmeth.hxx +++ b/basic/inc/basic/sbxmeth.hxx @@ -28,7 +28,7 @@ class BASIC_DLLPUBLIC SbxMethod : public SbxVariable public: SBX_DECL_PERSIST_NODATA(SBXCR_SBX,SBXID_METHOD,1); TYPEINFO(); - SbxMethod( const String& r, SbxDataType t ); + SbxMethod( const OUString& r, SbxDataType t ); SbxMethod( const SbxMethod& r ); ~SbxMethod(); SbxMethod& operator=( const SbxMethod& r ) { SbxVariable::operator=( r ); return *this; } diff --git a/basic/inc/basic/sbxobj.hxx b/basic/inc/basic/sbxobj.hxx index 378ac20716ef..2dc4aa735513 100644 --- a/basic/inc/basic/sbxobj.hxx +++ b/basic/inc/basic/sbxobj.hxx @@ -35,8 +35,8 @@ protected: SbxArrayRef pProps; // Properties SbxArrayRef pObjs; // Objects SbxProperty* pDfltProp; // Default-Property - String aClassName; // Classname - String aDfltPropName; + OUString aClassName; // Classname + OUString aDfltPropName; virtual sal_Bool LoadData( SvStream&, sal_uInt16 ); virtual sal_Bool StoreData( SvStream& ) const; virtual ~SbxObject(); @@ -45,41 +45,41 @@ protected: public: SBX_DECL_PERSIST_NODATA(SBXCR_SBX,SBXID_OBJECT,1); TYPEINFO(); - SbxObject( const String& rClassname ); + SbxObject( const OUString& rClassname ); SbxObject( const SbxObject& ); SbxObject& operator=( const SbxObject& ); virtual SbxDataType GetType() const; virtual SbxClassType GetClass() const; virtual void Clear(); - virtual sal_Bool IsClass( const rtl::OUString& ) const; - const String& GetClassName() const { return aClassName; } - void SetClassName( const String &rNew ) { aClassName = rNew; } + virtual sal_Bool IsClass( const OUString& ) const; + const OUString& GetClassName() const { return aClassName; } + void SetClassName( const OUString &rNew ) { aClassName = rNew; } // Default-Property SbxProperty* GetDfltProperty(); - void SetDfltProperty( const String& r ); + void SetDfltProperty( const OUString& r ); // Search for an element virtual SbxVariable* FindUserData( sal_uInt32 nUserData ); - virtual SbxVariable* Find( const rtl::OUString&, SbxClassType ); - SbxVariable* FindQualified( const String&, SbxClassType ); + virtual SbxVariable* Find( const OUString&, SbxClassType ); + SbxVariable* FindQualified( const OUString&, SbxClassType ); // Quick-Call-Interface for Methods - virtual sal_Bool Call( const String&, SbxArray* = NULL ); + virtual sal_Bool Call( const OUString&, SbxArray* = NULL ); // Execution of DDE-Commands - SbxVariable* Execute( const String& ); + SbxVariable* Execute( const OUString& ); // Manage elements virtual sal_Bool GetAll( SbxClassType ) { return sal_True; } - SbxVariable* Make( const String&, SbxClassType, SbxDataType ); - virtual SbxObject* MakeObject( const String&, const String& ); + SbxVariable* Make( const OUString&, SbxClassType, SbxDataType ); + virtual SbxObject* MakeObject( const OUString&, const OUString& ); virtual void Insert( SbxVariable* ); // AB 23.4.1997, Optimization, Insertion without check for duplicate Entries and // without Broadcasts, only used in SO2/auto.cxx void QuickInsert( SbxVariable* ); - virtual void Remove( const String&, SbxClassType ); + virtual void Remove( const OUString&, SbxClassType ); virtual void Remove( SbxVariable* ); // Macro-Recording - virtual String GenerateSource( const String &rLinePrefix, - const SbxObject *pRelativeTo ); + virtual OUString GenerateSource( const OUString &rLinePrefix, + const SbxObject *pRelativeTo ); // Direct access on arrays SbxArray* GetMethods() { return pMethods; } SbxArray* GetProperties() { return pProps; } diff --git a/basic/inc/basic/sbxprop.hxx b/basic/inc/basic/sbxprop.hxx index 34e58778bf39..89d774d4967f 100644 --- a/basic/inc/basic/sbxprop.hxx +++ b/basic/inc/basic/sbxprop.hxx @@ -28,7 +28,7 @@ class BASIC_DLLPUBLIC SbxProperty : public SbxVariable public: SBX_DECL_PERSIST_NODATA(SBXCR_SBX,SBXID_PROPERTY,1); TYPEINFO(); - SbxProperty( const String& r, SbxDataType t ); + SbxProperty( const OUString& r, SbxDataType t ); SbxProperty( const SbxProperty& r ) : SvRefBase( r ), SbxVariable( r ) {} virtual ~SbxProperty(); SbxProperty& operator=( const SbxProperty& r ) diff --git a/basic/inc/basic/sbxvar.hxx b/basic/inc/basic/sbxvar.hxx index c02c2a1fabfd..4d4a8b625bc3 100644 --- a/basic/inc/basic/sbxvar.hxx +++ b/basic/inc/basic/sbxvar.hxx @@ -21,7 +21,6 @@ #define SBXVAR_HXX #include <rtl/ustring.hxx> -#include <tools/string.hxx> #include <com/sun/star/bridge/oleautomation/Decimal.hpp> #include <basic/sbxcore.hxx> #include "basicdllapi.h" @@ -46,7 +45,7 @@ struct SbxValues float nSingle; double nDouble; - rtl::OUString* pOUString; + OUString* pOUString; SbxDecimal* pDecimal; SbxBase* pObj; @@ -81,7 +80,7 @@ struct SbxValues SbxValues( unsigned int _nUInt ): nUInt( _nUInt ), eType(SbxUINT) {} SbxValues( float _nSingle ): nSingle( _nSingle ), eType(SbxSINGLE) {} SbxValues( double _nDouble ): nDouble( _nDouble ), eType(SbxDOUBLE) {} - SbxValues( const ::rtl::OUString* _pString ): pOUString( (::rtl::OUString*)_pString ), eType(SbxSTRING) {} + SbxValues( const OUString* _pString ): pOUString( (OUString*)_pString ), eType(SbxSTRING) {} SbxValues( SbxBase* _pObj ): pObj( _pObj ), eType(SbxOBJECT) {} SbxValues( sal_Unicode* _pChar ): pChar( _pChar ), eType(SbxLPSTR) {} SbxValues( void* _pData ): pData( _pData ), eType(SbxPOINTER) {} @@ -95,8 +94,8 @@ class BASIC_DLLPUBLIC SbxValue : public SbxBase BASIC_DLLPRIVATE SbxValue* TheRealValue() const; protected: SbxValues aData; // Data - ::rtl::OUString aPic; // Picture-String - String aToolString; // tool string copy + OUString aPic; // Picture-String + OUString aToolString; // tool string copy virtual void Broadcast( sal_uIntPtr ); // Broadcast-Call virtual ~SbxValue(); @@ -160,10 +159,9 @@ public: double GetDouble() const; double GetDate() const; - sal_Bool GetBool() const; - const String& GetString() const; - const String& GetCoreString() const; - rtl::OUString GetOUString() const; + sal_Bool GetBool() const; + const OUString& GetCoreString() const; + OUString GetOUString() const; SbxBase* GetObject() const; sal_uInt8 GetByte() const; @@ -177,10 +175,10 @@ public: sal_Bool PutDate( double ); sal_Bool PutBool( sal_Bool ); sal_Bool PutErr( sal_uInt16 ); - sal_Bool PutStringExt( const ::rtl::OUString& ); // with extended analysis (International, "sal_True"/"sal_False") + sal_Bool PutStringExt( const OUString& ); // with extended analysis (International, "sal_True"/"sal_False") sal_Bool PutInt64( sal_Int64 ); sal_Bool PutUInt64( sal_uInt64 ); - sal_Bool PutString( const ::rtl::OUString& ); + sal_Bool PutString( const OUString& ); sal_Bool PutChar( sal_Unicode ); sal_Bool PutByte( sal_uInt8 ); sal_Bool PutUShort( sal_uInt16 ); @@ -194,15 +192,15 @@ public: sal_Bool fillAutomationDecimal( com::sun::star::bridge::oleautomation::Decimal& rAutomationDec ); sal_Bool PutCurrency( const sal_Int64& ); // Interface for CDbl in Basic - static SbxError ScanNumIntnl( const String& rSrc, double& nVal, bool bSingle = false ); + static SbxError ScanNumIntnl( const OUString& rSrc, double& nVal, bool bSingle = false ); sal_Bool PutObject( SbxBase* ); virtual sal_Bool Convert( SbxDataType ); virtual sal_Bool Compute( SbxOperator, const SbxValue& ); virtual sal_Bool Compare( SbxOperator, const SbxValue& ) const; - sal_Bool Scan( const String&, sal_uInt16* = NULL ); - void Format( String&, const String* = NULL ) const; + sal_Bool Scan( const OUString&, sal_uInt16* = NULL ); + void Format( OUString&, const OUString* = NULL ) const; // The following operators are definied for easier handling. // TODO: Ensure error conditions (overflow, conversions) @@ -291,7 +289,7 @@ class BASIC_DLLPUBLIC SbxVariable : public SbxValue SbxVariableImpl* mpSbxVariableImpl; // Impl data SfxBroadcaster* pCst; // Broadcaster, if needed - String maName; // Name, if available + OUString maName; // Name, if available SbxArrayRef mpPar; // Parameter-Array, if set sal_uInt16 nHash; // Hash-ID for search @@ -314,8 +312,8 @@ public: void Dump( SvStream&, sal_Bool bDumpAll=sal_False ); - virtual void SetName( const String& ); - virtual const String& GetName( SbxNameType = SbxNAME_NONE ) const; + virtual void SetName( const OUString& ); + virtual const OUString& GetName( SbxNameType = SbxNAME_NONE ) const; sal_uInt16 GetHashCode() const { return nHash; } virtual void SetModified( sal_Bool ); @@ -342,13 +340,13 @@ public: SbxObject* GetParent(); virtual void SetParent( SbxObject* ); - const String& GetDeclareClassName( void ); - void SetDeclareClassName( const String& ); + const OUString& GetDeclareClassName( void ); + void SetDeclareClassName( const OUString& ); void SetComListener( ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > xComListener, - StarBASIC* pParentBasic ); + StarBASIC* pParentBasic ); void ClearComListener( void ); - static sal_uInt16 MakeHashCode( const String& rName ); + static sal_uInt16 MakeHashCode( const OUString& rName ); }; SV_DECL_REF(SbxVariable) |