summaryrefslogtreecommitdiff
path: root/basic
diff options
context:
space:
mode:
authorNorbert Thiebaud <nthiebaud@gmail.com>2012-11-06 23:34:23 -0600
committerNorbert Thiebaud <nthiebaud@gmail.com>2012-11-07 02:14:53 -0600
commit27239ad23006b1fd1ddb21467f4c1fd637b560d5 (patch)
tree605b30a50f25ef7e8f0d6511d6df24790ece90b9 /basic
parentf510217832a6edaf6a44169cabdf739985d00125 (diff)
basic: String -> OUString
Change-Id: I42479b4bade5111e38d69f04c889c166f340d5ba
Diffstat (limited to 'basic')
-rw-r--r--basic/inc/basic/basmgr.hxx3
-rw-r--r--basic/inc/basic/sbmeth.hxx6
-rw-r--r--basic/inc/basic/sbmod.hxx44
-rw-r--r--basic/inc/basic/sbobjmod.hxx20
-rw-r--r--basic/inc/basic/sbprop.hxx4
-rw-r--r--basic/inc/basic/sbstar.hxx43
-rw-r--r--basic/inc/basic/sbstdobj.hxx36
-rw-r--r--basic/inc/basic/sbuno.hxx2
-rw-r--r--basic/inc/basic/sbx.hxx84
-rw-r--r--basic/inc/basic/sbxcore.hxx2
-rw-r--r--basic/inc/basic/sbxform.hxx92
-rw-r--r--basic/inc/basic/sbxmeth.hxx2
-rw-r--r--basic/inc/basic/sbxobj.hxx32
-rw-r--r--basic/inc/basic/sbxprop.hxx2
-rw-r--r--basic/inc/basic/sbxvar.hxx40
-rw-r--r--basic/source/basmgr/basmgr.cxx309
-rw-r--r--basic/source/classes/errobject.cxx6
-rw-r--r--basic/source/classes/image.cxx37
-rw-r--r--basic/source/classes/sb.cxx181
-rw-r--r--basic/source/classes/sbunoobj.cxx437
-rw-r--r--basic/source/classes/sbxmod.cxx213
-rw-r--r--basic/source/comp/buffer.cxx91
-rw-r--r--basic/source/comp/codegen.cxx84
-rw-r--r--basic/source/comp/dim.cxx173
-rw-r--r--basic/source/comp/exprgen.cxx2
-rw-r--r--basic/source/comp/exprnode.cxx51
-rw-r--r--basic/source/comp/exprtree.cxx57
-rw-r--r--basic/source/comp/loops.cxx4
-rw-r--r--basic/source/comp/parser.cxx25
-rw-r--r--basic/source/comp/sbcomp.cxx80
-rw-r--r--basic/source/comp/symtbl.cxx65
-rw-r--r--basic/source/comp/token.cxx2
-rw-r--r--basic/source/inc/buffer.hxx7
-rw-r--r--basic/source/inc/errobject.hxx4
-rw-r--r--basic/source/inc/expr.hxx18
-rw-r--r--basic/source/inc/image.hxx39
-rw-r--r--basic/source/inc/namecont.hxx174
-rw-r--r--basic/source/inc/parser.hxx4
-rw-r--r--basic/source/inc/runtime.hxx30
-rw-r--r--basic/source/inc/sbintern.hxx14
-rw-r--r--basic/source/inc/sbjsmeth.hxx2
-rw-r--r--basic/source/inc/sbjsmod.hxx2
-rw-r--r--basic/source/inc/sbunoobj.hxx72
-rw-r--r--basic/source/inc/stdobj.hxx4
-rw-r--r--basic/source/inc/symtbl.hxx69
-rw-r--r--basic/source/runtime/inputbox.cxx6
-rw-r--r--basic/source/runtime/iosys.cxx32
-rw-r--r--basic/source/runtime/methods.cxx609
-rw-r--r--basic/source/runtime/methods1.cxx165
-rw-r--r--basic/source/runtime/runtime.cxx10
-rw-r--r--basic/source/runtime/sbdiagnose.cxx8
-rw-r--r--basic/source/runtime/stdobj.cxx20
-rw-r--r--basic/source/runtime/stdobj1.cxx54
-rw-r--r--basic/source/runtime/step0.cxx201
-rw-r--r--basic/source/runtime/step2.cxx17
-rw-r--r--basic/source/sbx/sbxarray.cxx36
-rw-r--r--basic/source/sbx/sbxcoll.cxx64
-rw-r--r--basic/source/sbx/sbxdate.cxx617
-rw-r--r--basic/source/sbx/sbxexec.cxx44
-rw-r--r--basic/source/sbx/sbxform.cxx977
-rw-r--r--basic/source/sbx/sbxobj.cxx273
-rw-r--r--basic/source/sbx/sbxscan.cxx301
-rw-r--r--basic/source/sbx/sbxstr.cxx10
-rw-r--r--basic/source/sbx/sbxvalue.cxx23
-rw-r--r--basic/source/sbx/sbxvar.cxx208
-rw-r--r--basic/source/uno/namecont.cxx145
-rw-r--r--basic/source/uno/scriptcont.cxx16
67 files changed, 3529 insertions, 2975 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)
diff --git a/basic/source/basmgr/basmgr.cxx b/basic/source/basmgr/basmgr.cxx
index 98b6425b981f..d177d73a3647 100644
--- a/basic/source/basmgr/basmgr.cxx
+++ b/basic/source/basmgr/basmgr.cxx
@@ -143,17 +143,17 @@ typedef ::cppu::WeakImplHelper1< container::XContainerListener > ContainerListen
class BasMgrContainerListenerImpl: public ContainerListenerHelper
{
BasicManager* mpMgr;
- ::rtl::OUString maLibName; // empty -> no lib, but lib container
+ OUString maLibName; // empty -> no lib, but lib container
public:
- BasMgrContainerListenerImpl( BasicManager* pMgr, ::rtl::OUString aLibName )
+ BasMgrContainerListenerImpl( BasicManager* pMgr, OUString aLibName )
: mpMgr( pMgr )
, maLibName( aLibName ) {}
static void insertLibraryImpl( const uno::Reference< script::XLibraryContainer >& xScriptCont, BasicManager* pMgr,
- uno::Any aLibAny, ::rtl::OUString aLibName );
+ uno::Any aLibAny, OUString aLibName );
static void addLibraryModulesImpl( BasicManager* pMgr, uno::Reference< container::XNameAccess > xLibNameAccess,
- ::rtl::OUString aLibName );
+ OUString aLibName );
// XEventListener
@@ -175,7 +175,7 @@ public:
//============================================================================
void BasMgrContainerListenerImpl::insertLibraryImpl( const uno::Reference< script::XLibraryContainer >& xScriptCont,
- BasicManager* pMgr, uno::Any aLibAny, ::rtl::OUString aLibName )
+ BasicManager* pMgr, uno::Any aLibAny, OUString aLibName )
{
Reference< container::XNameAccess > xLibNameAccess;
aLibAny >>= xLibNameAccess;
@@ -208,21 +208,21 @@ void BasMgrContainerListenerImpl::insertLibraryImpl( const uno::Reference< scrip
void BasMgrContainerListenerImpl::addLibraryModulesImpl( BasicManager* pMgr,
- uno::Reference< container::XNameAccess > xLibNameAccess, ::rtl::OUString aLibName )
+ uno::Reference< container::XNameAccess > xLibNameAccess, OUString aLibName )
{
- uno::Sequence< ::rtl::OUString > aModuleNames = xLibNameAccess->getElementNames();
+ uno::Sequence< OUString > aModuleNames = xLibNameAccess->getElementNames();
sal_Int32 nModuleCount = aModuleNames.getLength();
StarBASIC* pLib = pMgr->GetLib( aLibName );
DBG_ASSERT( pLib, "BasMgrContainerListenerImpl::addLibraryModulesImpl: Unknown lib!");
if( pLib )
{
- const ::rtl::OUString* pNames = aModuleNames.getConstArray();
+ const OUString* pNames = aModuleNames.getConstArray();
for( sal_Int32 j = 0 ; j < nModuleCount ; j++ )
{
- ::rtl::OUString aModuleName = pNames[ j ];
+ OUString aModuleName = pNames[ j ];
uno::Any aElement = xLibNameAccess->getByName( aModuleName );
- ::rtl::OUString aMod;
+ OUString aMod;
aElement >>= aMod;
uno::Reference< vba::XVBAModuleInfo > xVBAModuleInfo( xLibNameAccess, uno::UNO_QUERY );
if ( xVBAModuleInfo.is() && xVBAModuleInfo->hasModuleInfo( aModuleName ) )
@@ -257,7 +257,7 @@ void SAL_CALL BasMgrContainerListenerImpl::elementInserted( const container::Con
throw( uno::RuntimeException )
{
sal_Bool bLibContainer = ( maLibName.getLength() == 0 );
- ::rtl::OUString aName;
+ OUString aName;
Event.Accessor >>= aName;
if( bLibContainer )
@@ -282,7 +282,7 @@ void SAL_CALL BasMgrContainerListenerImpl::elementInserted( const container::Con
SbModule* pMod = pLib->FindModule( aName );
if( !pMod )
{
- ::rtl::OUString aMod;
+ OUString aMod;
Event.Element >>= aMod;
uno::Reference< vba::XVBAModuleInfo > xVBAModuleInfo( Event.Source, uno::UNO_QUERY );
if ( xVBAModuleInfo.is() && xVBAModuleInfo->hasModuleInfo( aName ) )
@@ -303,7 +303,7 @@ void SAL_CALL BasMgrContainerListenerImpl::elementInserted( const container::Con
void SAL_CALL BasMgrContainerListenerImpl::elementReplaced( const container::ContainerEvent& Event )
throw( uno::RuntimeException )
{
- ::rtl::OUString aName;
+ OUString aName;
Event.Accessor >>= aName;
// Replace not possible for library container
@@ -316,7 +316,7 @@ void SAL_CALL BasMgrContainerListenerImpl::elementReplaced( const container::Con
if( pLib )
{
SbModule* pMod = pLib->FindModule( aName );
- ::rtl::OUString aMod;
+ OUString aMod;
Event.Element >>= aMod;
if( pMod )
@@ -333,7 +333,7 @@ void SAL_CALL BasMgrContainerListenerImpl::elementReplaced( const container::Con
void SAL_CALL BasMgrContainerListenerImpl::elementRemoved( const container::ContainerEvent& Event )
throw( uno::RuntimeException )
{
- ::rtl::OUString aName;
+ OUString aName;
Event.Accessor >>= aName;
sal_Bool bLibContainer = ( maLibName.getLength() == 0 );
@@ -380,7 +380,7 @@ class BasicLibInfo
private:
StarBASICRef xLib;
OUString aLibName;
- OUString aStorageName; // String is sufficient, unique at runtime
+ OUString aStorageName; // string is sufficient, unique at runtime
OUString aRelStorageName;
OUString aPassword;
@@ -529,8 +529,8 @@ BasicLibInfo::BasicLibInfo()
bPasswordVerified = sal_False;
bDoLoad = sal_False;
mxScriptCont = NULL;
- aStorageName = rtl::OUString(szImbedded);
- aRelStorageName = rtl::OUString(szImbedded);
+ aStorageName = szImbedded;
+ aRelStorageName = szImbedded;
}
BasicLibInfo* BasicLibInfo::Create( SotStorageStream& rSStream )
@@ -653,7 +653,7 @@ BasicManager::BasicManager( SotStorage& rStorage, const OUString& rBaseURL, Star
else
{
ImpCreateStdLib( pParentFromStdLib );
- if ( rStorage.IsStream( rtl::OUString(szOldManagerStream) ) )
+ if ( rStorage.IsStream( OUString(szOldManagerStream) ) )
LoadOldBasicManager( rStorage );
}
}
@@ -786,8 +786,8 @@ BasicManager::BasicManager( StarBASIC* pSLib, OUString* pLibPath, bool bDocMgr )
BasicLibInfo* pStdLibInfo = CreateLibInfo();
pStdLibInfo->SetLib( pSLib );
StarBASICRef xStdLib = pStdLibInfo->GetLib();
- xStdLib->SetName(rtl::OUString(szStdLibName));
- pStdLibInfo->SetLibName( rtl::OUString(szStdLibName) );
+ xStdLib->SetName(OUString(szStdLibName));
+ pStdLibInfo->SetLibName(OUString(szStdLibName) );
pSLib->SetFlag( SBX_DONTSTORE | SBX_EXTSEARCH );
// Save is only necessary if basic has changed
@@ -805,8 +805,8 @@ void BasicManager::ImpMgrNotLoaded( const OUString& rStorageName )
BasicLibInfo* pStdLibInfo = CreateLibInfo();
pStdLibInfo->SetLib( new StarBASIC( NULL, mbDocMgr ) );
StarBASICRef xStdLib = pStdLibInfo->GetLib();
- xStdLib->SetName( rtl::OUString(szStdLibName) );
- pStdLibInfo->SetLibName( rtl::OUString(szStdLibName) );
+ xStdLib->SetName( OUString(szStdLibName) );
+ pStdLibInfo->SetLibName( OUString(szStdLibName) );
xStdLib->SetFlag( SBX_DONTSTORE | SBX_EXTSEARCH );
xStdLib->SetModified( sal_False );
}
@@ -817,8 +817,8 @@ void BasicManager::ImpCreateStdLib( StarBASIC* pParentFromStdLib )
BasicLibInfo* pStdLibInfo = CreateLibInfo();
StarBASIC* pStdLib = new StarBASIC( pParentFromStdLib, mbDocMgr );
pStdLibInfo->SetLib( pStdLib );
- pStdLib->SetName( rtl::OUString(szStdLibName) );
- pStdLibInfo->SetLibName( rtl::OUString(szStdLibName) );
+ pStdLib->SetName( OUString(szStdLibName) );
+ pStdLibInfo->SetLibName( OUString(szStdLibName) );
pStdLib->SetFlag( SBX_DONTSTORE | SBX_EXTSEARCH );
}
@@ -898,7 +898,7 @@ void BasicManager::LoadBasicManager( SotStorage& rStorage, const OUString& rBase
// Libs from external files should be loaded only when necessary.
// But references are loaded at once, otherwise some big customers get into trouble
if ( bLoadLibs && pInfo->DoLoad() &&
- ( ( !pInfo->IsExtern() ) || ( pInfo->IsReference() ) ) )
+ ( !pInfo->IsExtern() || pInfo->IsReference()))
{
ImpLoadLibrary( pInfo, &rStorage );
}
@@ -1144,7 +1144,7 @@ sal_Bool BasicManager::ImpLoadLibrary( BasicLibInfo* pLibInfo, SotStorage* pCurS
xBasicStream->GetStreamCharSet());
pLibInfo->SetPassword( aPassword );
}
- xBasicStream->SetCryptMaskKey(rtl::OString());
+ xBasicStream->SetCryptMaskKey(OString());
CheckModules( pLibInfo->GetLib(), pLibInfo->IsReference() );
}
return bLoaded;
@@ -1203,7 +1203,7 @@ sal_Bool BasicManager::ImplLoadBasic( SvStream& rStrm, StarBASICRef& rOldBasic )
}
if ( bProtected )
{
- rStrm.SetCryptMaskKey(rtl::OString());
+ rStrm.SetCryptMaskKey(OString());
}
return bLoaded;
}
@@ -1275,7 +1275,7 @@ StarBASIC* BasicManager::AddLib( SotStorage& rStorage, const OUString& rLibName,
else
{
pLibInfo->GetLib()->SetModified( sal_True ); // Must be saved after Add!
- pLibInfo->SetStorageName( rtl::OUString(szImbedded) ); // Save in BasicManager-Storage
+ pLibInfo->SetStorageName( OUString(szImbedded) ); // Save in BasicManager-Storage
}
}
else
@@ -1666,16 +1666,16 @@ uno::Any BasicManager::SetGlobalUNOConstant( const sal_Char* _pAsciiName, const
return aOldValue;
}
-bool BasicManager::LegacyPsswdBinaryLimitExceeded( uno::Sequence< rtl::OUString >& _out_rModuleNames )
+bool BasicManager::LegacyPsswdBinaryLimitExceeded( uno::Sequence< OUString >& _out_rModuleNames )
{
try
{
uno::Reference< container::XNameAccess > xScripts( GetScriptLibraryContainer(), uno::UNO_QUERY_THROW );
uno::Reference< script::XLibraryContainerPassword > xPassword( GetScriptLibraryContainer(), uno::UNO_QUERY_THROW );
- uno::Sequence< ::rtl::OUString > aNames( xScripts->getElementNames() );
- const ::rtl::OUString* pNames = aNames.getConstArray();
- const ::rtl::OUString* pNamesEnd = aNames.getConstArray() + aNames.getLength();
+ uno::Sequence< OUString > aNames( xScripts->getElementNames() );
+ const OUString* pNames = aNames.getConstArray();
+ const OUString* pNamesEnd = aNames.getConstArray() + aNames.getLength();
for ( ; pNames != pNamesEnd; ++pNames )
{
if( !xPassword->isLibraryPasswordProtected( *pNames ) )
@@ -1686,14 +1686,14 @@ bool BasicManager::LegacyPsswdBinaryLimitExceeded( uno::Sequence< rtl::OUString
continue;
uno::Reference< container::XNameAccess > xScriptLibrary( xScripts->getByName( *pNames ), uno::UNO_QUERY_THROW );
- uno::Sequence< ::rtl::OUString > aElementNames( xScriptLibrary->getElementNames() );
+ uno::Sequence< OUString > aElementNames( xScriptLibrary->getElementNames() );
sal_Int32 nLen = aElementNames.getLength();
- uno::Sequence< ::rtl::OUString > aBigModules( nLen );
+ uno::Sequence< OUString > aBigModules( nLen );
sal_Int32 nBigModules = 0;
- const ::rtl::OUString* pElementNames = aElementNames.getConstArray();
- const ::rtl::OUString* pElementNamesEnd = aElementNames.getConstArray() + aElementNames.getLength();
+ const OUString* pElementNames = aElementNames.getConstArray();
+ const OUString* pElementNamesEnd = aElementNames.getConstArray() + aElementNames.getLength();
for ( ; pElementNames != pElementNamesEnd; ++pElementNames )
{
SbModule* pMod = pBasicLib->FindModule( *pElementNames );
@@ -1790,50 +1790,56 @@ ErrCode BasicManager::ExecuteMacro( OUString const& i_fullyQualifiedName, SbxArr
return nError;
}
-ErrCode BasicManager::ExecuteMacro( OUString const& i_fullyQualifiedName, String const& i_commaSeparatedArgs, SbxValue* i_retValue )
+ErrCode BasicManager::ExecuteMacro( OUString const& i_fullyQualifiedName, OUString const& i_commaSeparatedArgs, SbxValue* i_retValue )
{
SbMethod* pMethod = lcl_queryMacro( this, i_fullyQualifiedName );
if ( !pMethod )
+ {
return ERRCODE_BASIC_PROC_UNDEFINED;
-
+ }
// arguments must be quoted
- String sQuotedArgs;
- String sArgs( i_commaSeparatedArgs );
- if ( sArgs.Len()<2 || sArgs.GetBuffer()[1] == '\"')
+ OUString sQuotedArgs;
+ OUStringBuffer sArgs( i_commaSeparatedArgs );
+ if ( sArgs.getLength()<2 || sArgs[1] == '\"')
+ {
// no args or already quoted args
- sQuotedArgs = sArgs;
+ sQuotedArgs = sArgs.makeStringAndClear();
+ }
else
{
// quote parameters
- sArgs.Erase( 0, 1 );
- sArgs.Erase( sArgs.Len()-1, 1 );
-
- sQuotedArgs = '(';
+ sArgs.remove( 0, 1 );
+ sArgs.remove( sArgs.getLength() - 1, 1 );
- sal_Int32 nCount = comphelper::string::getTokenCount(sArgs, ',');
- for (sal_Int32 n=0; n < nCount; ++n)
+ sQuotedArgs = "(";
+ OUString sArgs2 = sArgs.makeStringAndClear();
+ sal_Int32 nCount = comphelper::string::getTokenCount(sArgs2, ',');
+ for (sal_Int32 n = 0; n < nCount; ++n)
{
- sQuotedArgs += '\"';
- sQuotedArgs += comphelper::string::getToken(sArgs, n, ',');
- sQuotedArgs += '\"';
- if ( n<nCount-1 )
- sQuotedArgs += ',';
+ sQuotedArgs += "\"";
+ sQuotedArgs += comphelper::string::getToken(sArgs2, n, ',');
+ sQuotedArgs += "\"";
+ if ( n < nCount - 1 )
+ {
+ sQuotedArgs += ",";
+ }
}
- sQuotedArgs += ')';
+ sQuotedArgs += ")";
}
// add quoted arguments and do the call
- rtl::OUString sCall = rtl::OUStringBuffer().
- append('[').
- append(pMethod->GetName()).
- append(sQuotedArgs).
- append(']').
- makeStringAndClear();
+ OUString sCall;
+ sCall += "[";
+ sCall += pMethod->GetName();
+ sCall += sQuotedArgs;
+ sCall += "]";
SbxVariable* pRet = pMethod->GetParent()->Execute( sCall );
if ( pRet && ( pRet != pMethod ) )
+ {
*i_retValue = *pRet;
+ }
return SbxBase::GetError();
}
@@ -1841,20 +1847,20 @@ ErrCode BasicManager::ExecuteMacro( OUString const& i_fullyQualifiedName, String
class ModuleInfo_Impl : public ModuleInfoHelper
{
- ::rtl::OUString maName;
- ::rtl::OUString maLanguage;
- ::rtl::OUString maSource;
+ OUString maName;
+ OUString maLanguage;
+ OUString maSource;
public:
- ModuleInfo_Impl( const ::rtl::OUString& aName, const ::rtl::OUString& aLanguage, const ::rtl::OUString& aSource )
+ ModuleInfo_Impl( const OUString& aName, const OUString& aLanguage, const OUString& aSource )
: maName( aName ), maLanguage( aLanguage), maSource( aSource ) {}
// Methods XStarBasicModuleInfo
- virtual ::rtl::OUString SAL_CALL getName() throw(uno::RuntimeException)
+ virtual OUString SAL_CALL getName() throw(uno::RuntimeException)
{ return maName; }
- virtual ::rtl::OUString SAL_CALL getLanguage() throw(uno::RuntimeException)
+ virtual OUString SAL_CALL getLanguage() throw(uno::RuntimeException)
{ return maLanguage; }
- virtual ::rtl::OUString SAL_CALL getSource() throw(uno::RuntimeException)
+ virtual OUString SAL_CALL getSource() throw(uno::RuntimeException)
{ return maSource; }
};
@@ -1863,15 +1869,15 @@ public:
class DialogInfo_Impl : public DialogInfoHelper
{
- ::rtl::OUString maName;
+ OUString maName;
uno::Sequence< sal_Int8 > mData;
public:
- DialogInfo_Impl( const ::rtl::OUString& aName, uno::Sequence< sal_Int8 > Data )
+ DialogInfo_Impl( const OUString& aName, uno::Sequence< sal_Int8 > Data )
: maName( aName ), mData( Data ) {}
// Methods XStarBasicDialogInfo
- virtual ::rtl::OUString SAL_CALL getName() throw(uno::RuntimeException)
+ virtual OUString SAL_CALL getName() throw(uno::RuntimeException)
{ return maName; }
virtual uno::Sequence< sal_Int8 > SAL_CALL getData() throw(uno::RuntimeException)
{ return mData; }
@@ -1882,22 +1888,22 @@ public:
class LibraryInfo_Impl : public LibraryInfoHelper
{
- ::rtl::OUString maName;
+ OUString maName;
uno::Reference< container::XNameContainer > mxModuleContainer;
uno::Reference< container::XNameContainer > mxDialogContainer;
- ::rtl::OUString maPassword;
- ::rtl::OUString maExternaleSourceURL;
- ::rtl::OUString maLinkTargetURL;
+ OUString maPassword;
+ OUString maExternaleSourceURL;
+ OUString maLinkTargetURL;
public:
LibraryInfo_Impl
(
- const ::rtl::OUString& aName,
+ const OUString& aName,
uno::Reference< container::XNameContainer > xModuleContainer,
uno::Reference< container::XNameContainer > xDialogContainer,
- const ::rtl::OUString& aPassword,
- const ::rtl::OUString& aExternaleSourceURL,
- const ::rtl::OUString& aLinkTargetURL
+ const OUString& aPassword,
+ const OUString& aExternaleSourceURL,
+ const OUString& aLinkTargetURL
)
: maName( aName )
, mxModuleContainer( xModuleContainer )
@@ -1908,17 +1914,17 @@ public:
{}
// Methods XStarBasicLibraryInfo
- virtual ::rtl::OUString SAL_CALL getName() throw(uno::RuntimeException)
+ virtual OUString SAL_CALL getName() throw(uno::RuntimeException)
{ return maName; }
virtual uno::Reference< container::XNameContainer > SAL_CALL getModuleContainer() throw(uno::RuntimeException)
{ return mxModuleContainer; }
virtual uno::Reference< container::XNameContainer > SAL_CALL getDialogContainer() throw(uno::RuntimeException)
{ return mxDialogContainer; }
- virtual ::rtl::OUString SAL_CALL getPassword() throw(uno::RuntimeException)
+ virtual OUString SAL_CALL getPassword() throw(uno::RuntimeException)
{ return maPassword; }
- virtual ::rtl::OUString SAL_CALL getExternalSourceURL() throw(uno::RuntimeException)
+ virtual OUString SAL_CALL getExternalSourceURL() throw(uno::RuntimeException)
{ return maExternaleSourceURL; }
- virtual ::rtl::OUString SAL_CALL getLinkTargetURL() throw(uno::RuntimeException)
+ virtual OUString SAL_CALL getLinkTargetURL() throw(uno::RuntimeException)
{ return maLinkTargetURL; }
};
@@ -1939,23 +1945,23 @@ public:
throw(uno::RuntimeException);
// Methods XNameAccess
- virtual uno::Any SAL_CALL getByName( const ::rtl::OUString& aName )
+ virtual uno::Any SAL_CALL getByName( const OUString& aName )
throw(container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException);
- virtual uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames()
+ virtual uno::Sequence< OUString > SAL_CALL getElementNames()
throw(uno::RuntimeException);
- virtual sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName )
+ virtual sal_Bool SAL_CALL hasByName( const OUString& aName )
throw(uno::RuntimeException);
// Methods XNameReplace
- virtual void SAL_CALL replaceByName( const ::rtl::OUString& aName, const uno::Any& aElement )
+ virtual void SAL_CALL replaceByName( const OUString& aName, const uno::Any& aElement )
throw(lang::IllegalArgumentException, container::NoSuchElementException,
lang::WrappedTargetException, uno::RuntimeException);
// Methods XNameContainer
- virtual void SAL_CALL insertByName( const ::rtl::OUString& aName, const uno::Any& aElement )
+ virtual void SAL_CALL insertByName( const OUString& aName, const uno::Any& aElement )
throw(lang::IllegalArgumentException, container::ElementExistException,
lang::WrappedTargetException, uno::RuntimeException);
- virtual void SAL_CALL removeByName( const ::rtl::OUString& Name )
+ virtual void SAL_CALL removeByName( const OUString& Name )
throw(container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException);
};
@@ -1975,7 +1981,7 @@ sal_Bool ModuleContainer_Impl::hasElements()
}
// Methods XNameAccess
-uno::Any ModuleContainer_Impl::getByName( const ::rtl::OUString& aName )
+uno::Any ModuleContainer_Impl::getByName( const OUString& aName )
throw(container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
{
SbModule* pMod = mpLib ? mpLib->FindModule( aName ) : NULL;
@@ -1988,22 +1994,22 @@ uno::Any ModuleContainer_Impl::getByName( const ::rtl::OUString& aName )
return aRetAny;
}
-uno::Sequence< ::rtl::OUString > ModuleContainer_Impl::getElementNames()
+uno::Sequence< OUString > ModuleContainer_Impl::getElementNames()
throw(uno::RuntimeException)
{
SbxArray* pMods = mpLib ? mpLib->GetModules() : NULL;
sal_uInt16 nMods = pMods ? pMods->Count() : 0;
- uno::Sequence< ::rtl::OUString > aRetSeq( nMods );
- ::rtl::OUString* pRetSeq = aRetSeq.getArray();
+ uno::Sequence< OUString > aRetSeq( nMods );
+ OUString* pRetSeq = aRetSeq.getArray();
for( sal_uInt16 i = 0 ; i < nMods ; i++ )
{
SbxVariable* pMod = pMods->Get( i );
- pRetSeq[i] = ::rtl::OUString( pMod->GetName() );
+ pRetSeq[i] = OUString( pMod->GetName() );
}
return aRetSeq;
}
-sal_Bool ModuleContainer_Impl::hasByName( const ::rtl::OUString& aName )
+sal_Bool ModuleContainer_Impl::hasByName( const OUString& aName )
throw(uno::RuntimeException)
{
SbModule* pMod = mpLib ? mpLib->FindModule( aName ) : NULL;
@@ -2013,7 +2019,7 @@ sal_Bool ModuleContainer_Impl::hasByName( const ::rtl::OUString& aName )
// Methods XNameReplace
-void ModuleContainer_Impl::replaceByName( const ::rtl::OUString& aName, const uno::Any& aElement )
+void ModuleContainer_Impl::replaceByName( const OUString& aName, const uno::Any& aElement )
throw(lang::IllegalArgumentException, container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
{
removeByName( aName );
@@ -2022,24 +2028,28 @@ void ModuleContainer_Impl::replaceByName( const ::rtl::OUString& aName, const un
// Methods XNameContainer
-void ModuleContainer_Impl::insertByName( const ::rtl::OUString& aName, const uno::Any& aElement )
+void ModuleContainer_Impl::insertByName( const OUString& aName, const uno::Any& aElement )
throw(lang::IllegalArgumentException, container::ElementExistException, lang::WrappedTargetException, uno::RuntimeException)
{
uno::Type aModuleType = ::getCppuType( (const uno::Reference< script::XStarBasicModuleInfo > *)0 );
uno::Type aAnyType = aElement.getValueType();
if( aModuleType != aAnyType )
+ {
throw lang::IllegalArgumentException();
+ }
uno::Reference< script::XStarBasicModuleInfo > xMod;
aElement >>= xMod;
mpLib->MakeModule32( aName, xMod->getSource() );
}
-void ModuleContainer_Impl::removeByName( const ::rtl::OUString& Name )
+void ModuleContainer_Impl::removeByName( const OUString& Name )
throw(container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
{
SbModule* pMod = mpLib ? mpLib->FindModule( Name ) : NULL;
if( !pMod )
+ {
throw container::NoSuchElementException();
+ }
mpLib->Remove( pMod );
}
@@ -2086,21 +2096,21 @@ public:
throw(uno::RuntimeException);
// Methods XNameAccess
- virtual uno::Any SAL_CALL getByName( const ::rtl::OUString& aName )
+ virtual uno::Any SAL_CALL getByName( const OUString& aName )
throw(container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException);
- virtual uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames()
+ virtual uno::Sequence< OUString > SAL_CALL getElementNames()
throw(uno::RuntimeException);
- virtual sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName )
+ virtual sal_Bool SAL_CALL hasByName( const OUString& aName )
throw(uno::RuntimeException);
// Methods XNameReplace
- virtual void SAL_CALL replaceByName( const ::rtl::OUString& aName, const uno::Any& aElement )
+ virtual void SAL_CALL replaceByName( const OUString& aName, const uno::Any& aElement )
throw(lang::IllegalArgumentException, container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException);
// Methods XNameContainer
- virtual void SAL_CALL insertByName( const ::rtl::OUString& aName, const uno::Any& aElement )
+ virtual void SAL_CALL insertByName( const OUString& aName, const uno::Any& aElement )
throw(lang::IllegalArgumentException, container::ElementExistException, lang::WrappedTargetException, uno::RuntimeException);
- virtual void SAL_CALL removeByName( const ::rtl::OUString& Name )
+ virtual void SAL_CALL removeByName( const OUString& Name )
throw(container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException);
};
@@ -2132,7 +2142,7 @@ sal_Bool DialogContainer_Impl::hasElements()
}
// Methods XNameAccess
-uno::Any DialogContainer_Impl::getByName( const ::rtl::OUString& aName )
+uno::Any DialogContainer_Impl::getByName( const OUString& aName )
throw(container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
{
SbxVariable* pVar = mpLib->GetObjects()->Find( aName, SbxCLASS_DONTCARE );
@@ -2151,13 +2161,13 @@ uno::Any DialogContainer_Impl::getByName( const ::rtl::OUString& aName )
return aRetAny;
}
-uno::Sequence< ::rtl::OUString > DialogContainer_Impl::getElementNames()
+uno::Sequence< OUString > DialogContainer_Impl::getElementNames()
throw(uno::RuntimeException)
{
mpLib->GetAll( SbxCLASS_OBJECT );
sal_Int16 nCount = mpLib->GetObjects()->Count();
- uno::Sequence< ::rtl::OUString > aRetSeq( nCount );
- ::rtl::OUString* pRetSeq = aRetSeq.getArray();
+ uno::Sequence< OUString > aRetSeq( nCount );
+ OUString* pRetSeq = aRetSeq.getArray();
sal_Int32 nDialogCounter = 0;
for( sal_Int16 nObj = 0; nObj < nCount ; nObj++ )
@@ -2165,7 +2175,7 @@ uno::Sequence< ::rtl::OUString > DialogContainer_Impl::getElementNames()
SbxVariable* pVar = mpLib->GetObjects()->Get( nObj );
if ( pVar->ISA( SbxObject ) && ( ((SbxObject*)pVar)->GetSbxId() == SBXID_DIALOG ) )
{
- pRetSeq[ nDialogCounter ] = ::rtl::OUString( pVar->GetName() );
+ pRetSeq[ nDialogCounter ] = OUString( pVar->GetName() );
nDialogCounter++;
}
}
@@ -2173,7 +2183,7 @@ uno::Sequence< ::rtl::OUString > DialogContainer_Impl::getElementNames()
return aRetSeq;
}
-sal_Bool DialogContainer_Impl::hasByName( const ::rtl::OUString& aName )
+sal_Bool DialogContainer_Impl::hasByName( const OUString& aName )
throw(uno::RuntimeException)
{
sal_Bool bRet = sal_False;
@@ -2188,7 +2198,7 @@ sal_Bool DialogContainer_Impl::hasByName( const ::rtl::OUString& aName )
// Methods XNameReplace
-void DialogContainer_Impl::replaceByName( const ::rtl::OUString& aName, const uno::Any& aElement )
+void DialogContainer_Impl::replaceByName( const OUString& aName, const uno::Any& aElement )
throw(lang::IllegalArgumentException, container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
{
removeByName( aName );
@@ -2197,21 +2207,23 @@ void DialogContainer_Impl::replaceByName( const ::rtl::OUString& aName, const un
// Methods XNameContainer
-void DialogContainer_Impl::insertByName( const ::rtl::OUString& aName, const uno::Any& aElement )
+void DialogContainer_Impl::insertByName( const OUString& aName, const uno::Any& aElement )
throw(lang::IllegalArgumentException, container::ElementExistException, lang::WrappedTargetException, uno::RuntimeException)
{
(void)aName;
uno::Type aModuleType = ::getCppuType( (const uno::Reference< script::XStarBasicDialogInfo > *)0 );
uno::Type aAnyType = aElement.getValueType();
if( aModuleType != aAnyType )
+ {
throw lang::IllegalArgumentException();
+ }
uno::Reference< script::XStarBasicDialogInfo > xMod;
aElement >>= xMod;
SbxObjectRef xDialog = implCreateDialog( xMod->getData() );
mpLib->Insert( xDialog );
}
-void DialogContainer_Impl::removeByName( const ::rtl::OUString& Name )
+void DialogContainer_Impl::removeByName( const OUString& Name )
throw(container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
{
(void)Name;
@@ -2243,21 +2255,21 @@ public:
throw(uno::RuntimeException);
// Methods XNameAccess
- virtual uno::Any SAL_CALL getByName( const ::rtl::OUString& aName )
+ virtual uno::Any SAL_CALL getByName( const OUString& aName )
throw(container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException);
- virtual uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames()
+ virtual uno::Sequence< OUString > SAL_CALL getElementNames()
throw(uno::RuntimeException);
- virtual sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName )
+ virtual sal_Bool SAL_CALL hasByName( const OUString& aName )
throw(uno::RuntimeException);
// Methods XNameReplace
- virtual void SAL_CALL replaceByName( const ::rtl::OUString& aName, const uno::Any& aElement )
+ virtual void SAL_CALL replaceByName( const OUString& aName, const uno::Any& aElement )
throw(lang::IllegalArgumentException, container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException);
// Methods XNameContainer
- virtual void SAL_CALL insertByName( const ::rtl::OUString& aName, const uno::Any& aElement )
+ virtual void SAL_CALL insertByName( const OUString& aName, const uno::Any& aElement )
throw(lang::IllegalArgumentException, container::ElementExistException, lang::WrappedTargetException, uno::RuntimeException);
- virtual void SAL_CALL removeByName( const ::rtl::OUString& Name )
+ virtual void SAL_CALL removeByName( const OUString& Name )
throw(container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException);
};
@@ -2279,7 +2291,7 @@ sal_Bool LibraryContainer_Impl::hasElements()
}
// Methods XNameAccess
-uno::Any LibraryContainer_Impl::getByName( const ::rtl::OUString& aName )
+uno::Any LibraryContainer_Impl::getByName( const OUString& aName )
throw(container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
{
uno::Any aRetAny;
@@ -2295,16 +2307,19 @@ uno::Any LibraryContainer_Impl::getByName( const ::rtl::OUString& aName )
BasicLibInfo* pLibInfo = mpMgr->FindLibInfo( pLib );
- ::rtl::OUString aPassword = pLibInfo->GetPassword();
+ OUString aPassword = pLibInfo->GetPassword();
// TODO Only provide extern info!
- ::rtl::OUString aExternaleSourceURL;
- ::rtl::OUString aLinkTargetURL;
+ OUString aExternaleSourceURL;
+ OUString aLinkTargetURL;
if( pLibInfo->IsReference() )
+ {
aLinkTargetURL = pLibInfo->GetStorageName();
+ }
else if( pLibInfo->IsExtern() )
+ {
aExternaleSourceURL = pLibInfo->GetStorageName();
-
+ }
uno::Reference< script::XStarBasicLibraryInfo > xLibInfo = new LibraryInfo_Impl
(
aName,
@@ -2319,20 +2334,20 @@ uno::Any LibraryContainer_Impl::getByName( const ::rtl::OUString& aName )
return aRetAny;
}
-uno::Sequence< ::rtl::OUString > LibraryContainer_Impl::getElementNames()
+uno::Sequence< OUString > LibraryContainer_Impl::getElementNames()
throw(uno::RuntimeException)
{
sal_uInt16 nLibs = mpMgr->GetLibCount();
- uno::Sequence< ::rtl::OUString > aRetSeq( nLibs );
- ::rtl::OUString* pRetSeq = aRetSeq.getArray();
+ uno::Sequence< OUString > aRetSeq( nLibs );
+ OUString* pRetSeq = aRetSeq.getArray();
for( sal_uInt16 i = 0 ; i < nLibs ; i++ )
{
- pRetSeq[i] = ::rtl::OUString( mpMgr->GetLibName( i ) );
+ pRetSeq[i] = OUString( mpMgr->GetLibName( i ) );
}
return aRetSeq;
}
-sal_Bool LibraryContainer_Impl::hasByName( const ::rtl::OUString& aName )
+sal_Bool LibraryContainer_Impl::hasByName( const OUString& aName )
throw(uno::RuntimeException)
{
sal_Bool bRet = mpMgr->HasLib( aName );
@@ -2340,7 +2355,7 @@ sal_Bool LibraryContainer_Impl::hasByName( const ::rtl::OUString& aName )
}
// Methods XNameReplace
-void LibraryContainer_Impl::replaceByName( const ::rtl::OUString& aName, const uno::Any& aElement )
+void LibraryContainer_Impl::replaceByName( const OUString& aName, const uno::Any& aElement )
throw(lang::IllegalArgumentException, container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
{
removeByName( aName );
@@ -2348,7 +2363,7 @@ void LibraryContainer_Impl::replaceByName( const ::rtl::OUString& aName, const u
}
// Methods XNameContainer
-void LibraryContainer_Impl::insertByName( const ::rtl::OUString& aName, const uno::Any& aElement )
+void LibraryContainer_Impl::insertByName( const OUString& aName, const uno::Any& aElement )
throw(lang::IllegalArgumentException, container::ElementExistException, lang::WrappedTargetException, uno::RuntimeException)
{
(void)aName;
@@ -2356,7 +2371,7 @@ void LibraryContainer_Impl::insertByName( const ::rtl::OUString& aName, const un
// TODO: Insert a complete Library?!
}
-void LibraryContainer_Impl::removeByName( const ::rtl::OUString& Name )
+void LibraryContainer_Impl::removeByName( const OUString& Name )
throw(container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
{
StarBASIC* pLib = mpMgr->GetLib( Name );
@@ -2386,13 +2401,13 @@ public:
// Methods
virtual uno::Reference< container::XNameContainer > SAL_CALL getLibraryContainer()
throw(uno::RuntimeException);
- virtual void SAL_CALL createLibrary( const ::rtl::OUString& LibName, const ::rtl::OUString& Password,
- const ::rtl::OUString& ExternalSourceURL, const ::rtl::OUString& LinkTargetURL )
+ virtual void SAL_CALL createLibrary( const OUString& LibName, const OUString& Password,
+ const OUString& ExternalSourceURL, const OUString& LinkTargetURL )
throw(container::ElementExistException, uno::RuntimeException);
- virtual void SAL_CALL addModule( const ::rtl::OUString& LibraryName, const ::rtl::OUString& ModuleName,
- const ::rtl::OUString& Language, const ::rtl::OUString& Source )
+ virtual void SAL_CALL addModule( const OUString& LibraryName, const OUString& ModuleName,
+ const OUString& Language, const OUString& Source )
throw(container::NoSuchElementException, uno::RuntimeException);
- virtual void SAL_CALL addDialog( const ::rtl::OUString& LibraryName, const ::rtl::OUString& DialogName,
+ virtual void SAL_CALL addDialog( const OUString& LibraryName, const OUString& DialogName,
const uno::Sequence< sal_Int8 >& Data )
throw(container::NoSuchElementException, uno::RuntimeException);
};
@@ -2407,10 +2422,10 @@ uno::Reference< container::XNameContainer > SAL_CALL StarBasicAccess_Impl::getLi
void SAL_CALL StarBasicAccess_Impl::createLibrary
(
- const ::rtl::OUString& LibName,
- const ::rtl::OUString& Password,
- const ::rtl::OUString& ExternalSourceURL,
- const ::rtl::OUString& LinkTargetURL
+ const OUString& LibName,
+ const OUString& Password,
+ const OUString& ExternalSourceURL,
+ const OUString& LinkTargetURL
)
throw(container::ElementExistException, uno::RuntimeException)
{
@@ -2424,10 +2439,10 @@ void SAL_CALL StarBasicAccess_Impl::createLibrary
void SAL_CALL StarBasicAccess_Impl::addModule
(
- const ::rtl::OUString& LibraryName,
- const ::rtl::OUString& ModuleName,
- const ::rtl::OUString& Language,
- const ::rtl::OUString& Source
+ const OUString& LibraryName,
+ const OUString& ModuleName,
+ const OUString& Language,
+ const OUString& Source
)
throw(container::NoSuchElementException, uno::RuntimeException)
{
@@ -2442,8 +2457,8 @@ void SAL_CALL StarBasicAccess_Impl::addModule
void SAL_CALL StarBasicAccess_Impl::addDialog
(
- const ::rtl::OUString& LibraryName,
- const ::rtl::OUString& DialogName,
+ const OUString& LibraryName,
+ const OUString& DialogName,
const uno::Sequence< sal_Int8 >& Data
)
throw(container::NoSuchElementException, uno::RuntimeException)
diff --git a/basic/source/classes/errobject.cxx b/basic/source/classes/errobject.cxx
index c5bd012a529b..557295769fda 100644
--- a/basic/source/classes/errobject.cxx
+++ b/basic/source/classes/errobject.cxx
@@ -173,7 +173,7 @@ void ErrObject::setData( const uno::Any& Number, const uno::Any& Source, const u
}
// SbxErrObject
-SbxErrObject::SbxErrObject( const String& rName, const Any& rUnoObj )
+SbxErrObject::SbxErrObject( const OUString& rName, const Any& rUnoObj )
: SbUnoObject( rName, rUnoObj )
, m_pErrObject( NULL )
{
@@ -202,11 +202,11 @@ SbxErrObject::getUnoErrObject()
SbxVariableRef
SbxErrObject::getErrObject()
{
- static SbxVariableRef pGlobErr = new SbxErrObject( String( RTL_CONSTASCII_USTRINGPARAM("Err")), uno::makeAny( uno::Reference< vba::XErrObject >( new ErrObject() ) ) );
+ static SbxVariableRef pGlobErr = new SbxErrObject( OUString("Err"), uno::makeAny( uno::Reference< vba::XErrObject >( new ErrObject() ) ) );
return pGlobErr;
}
-void SbxErrObject::setNumberAndDescription( ::sal_Int32 _number, const ::rtl::OUString& _description )
+void SbxErrObject::setNumberAndDescription( ::sal_Int32 _number, const OUString& _description )
throw (uno::RuntimeException)
{
if( m_pErrObject != NULL )
diff --git a/basic/source/classes/image.cxx b/basic/source/classes/image.cxx
index 1d756701ca63..cdc2239901c2 100644
--- a/basic/source/classes/image.cxx
+++ b/basic/source/classes/image.cxx
@@ -153,8 +153,7 @@ bool SbiImage::Load( SvStream& r, sal_uInt32& nVersion )
{
for( sal_uInt16 j = 0 ; j < nCount ; j++ )
{
- String aTmp = r.ReadUniOrByteString(eCharSet);
- aOUSource += aTmp;
+ aOUSource += r.ReadUniOrByteString(eCharSet);
}
break;
}
@@ -209,8 +208,8 @@ bool SbiImage::Load( SvStream& r, sal_uInt32& nVersion )
for( short j = 0; j < nStrings; j++ )
{
sal_uInt16 nOff2 = (sal_uInt16) pStringOff[ j ];
- String aStr( pByteStrings + nOff2, eCharSet );
- memcpy( pStrings + nOff2, aStr.GetBuffer(), (aStr.Len() + 1) * sizeof( sal_Unicode ) );
+ OUString aStr( pByteStrings + nOff2, strlen(pByteStrings + nOff2), eCharSet );
+ memcpy( pStrings + nOff2, aStr.getStr(), (aStr.getLength() + 1) * sizeof( sal_Unicode ) );
}
delete[] pByteStrings;
}
@@ -270,14 +269,14 @@ bool SbiImage::Save( SvStream& r, sal_uInt32 nVer )
<< (sal_Int32) 0;
// Name?
- if( aName.Len() && SbiGood( r ) )
+ if( !aName.isEmpty() && SbiGood( r ) )
{
nPos = SbiOpenRecord( r, B_NAME, 1 );
r.WriteUniOrByteString( aName, eCharSet );
SbiCloseRecord( r, nPos );
}
// Comment?
- if( aComment.Len() && SbiGood( r ) )
+ if( !aComment.isEmpty() && SbiGood( r ) )
{
nPos = SbiOpenRecord( r, B_COMMENT, 1 );
r.WriteUniOrByteString( aComment, eCharSet );
@@ -287,7 +286,7 @@ bool SbiImage::Save( SvStream& r, sal_uInt32 nVer )
if( !aOUSource.isEmpty() && SbiGood( r ) )
{
nPos = SbiOpenRecord( r, B_SOURCE, 1 );
- String aTmp;
+ OUString aTmp;
sal_Int32 nLen = aOUSource.getLength();
const sal_Int32 nMaxUnitSize = STRING_MAXLEN - 1;
if( nLen > STRING_MAXLEN )
@@ -308,9 +307,8 @@ bool SbiImage::Save( SvStream& r, sal_uInt32 nVer )
nPos = SbiOpenRecord( r, B_EXTSOURCE, nUnitCount );
for( sal_uInt16 i = 0 ; i < nUnitCount ; i++ )
{
- sal_Int32 nCopyLen =
- (nRemainingLen > nMaxUnitSize) ? nMaxUnitSize : nRemainingLen;
- String aTmp2 = aOUSource.copy( (i+1) * nMaxUnitSize, nCopyLen );
+ sal_Int32 nCopyLen = (nRemainingLen > nMaxUnitSize) ? nMaxUnitSize : nRemainingLen;
+ OUString aTmp2 = aOUSource.copy( (i+1) * nMaxUnitSize, nCopyLen );
nRemainingLen -= nCopyLen;
r.WriteUniOrByteString( aTmp2, eCharSet );
}
@@ -399,7 +397,7 @@ void SbiImage::MakeStrings( short nSize )
// Add a string to StringPool. The String buffer is dynamically
// growing in 1K-Steps
-void SbiImage::AddString( const String& r )
+void SbiImage::AddString( const OUString& r )
{
if( nStringIdx >= nStrings )
{
@@ -407,7 +405,7 @@ void SbiImage::AddString( const String& r )
}
if( !bError )
{
- xub_StrLen len = r.Len() + 1;
+ sal_Int32 len = r.getLength() + 1;
sal_uInt32 needed = nStringOff + len;
if( needed > 0xFFFFFF00L )
{
@@ -437,7 +435,7 @@ void SbiImage::AddString( const String& r )
if( !bError )
{
pStringOff[ nStringIdx++ ] = nStringOff;
- memcpy( pStrings + nStringOff, r.GetBuffer(), len * sizeof( sal_Unicode ) );
+ memcpy( pStrings + nStringOff, r.getStr(), len * sizeof( sal_Unicode ) );
nStringOff = nStringOff + len;
// Last String? The update the size of the buffer
if( nStringIdx >= nStrings )
@@ -486,7 +484,7 @@ void SbiImage::AddEnum(SbxObject* pObject) // Register enum type
**************************************************************************/
// Note: IDs start with 1
-String SbiImage::GetString( short nId ) const
+OUString SbiImage::GetString( short nId ) const
{
if( nId && nId <= nStrings )
{
@@ -501,18 +499,19 @@ String SbiImage::GetString( short nId ) const
if( nLen == 1 )
{
// Force length 1 and make char 0 afterwards
- String aNullCharStr( rtl::OUString(" ") );
- aNullCharStr.SetChar( 0, 0 );
+ OUString aNullCharStr( (sal_Unicode)0);
return aNullCharStr;
}
}
else
- return rtl::OUString(pStr);
+ {
+ return OUString(pStr);
+ }
}
- return rtl::OUString();
+ return OUString();
}
-const SbxObject* SbiImage::FindType (String aTypeName) const
+const SbxObject* SbiImage::FindType (OUString aTypeName) const
{
return rTypes.Is() ? (SbxObject*)rTypes->Find(aTypeName,SbxCLASS_OBJECT) : NULL;
}
diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx
index 24cc887c5e65..990651568e99 100644
--- a/basic/source/classes/sb.cxx
+++ b/basic/source/classes/sb.cxx
@@ -94,7 +94,7 @@ private:
DocBasicItem::DocBasicItem( StarBASIC& rDocBasic ) :
mrDocBasic( rDocBasic ),
- mxClassModules( new SbxObject( String() ) ),
+ mxClassModules( new SbxObject( OUString() ) ),
mbDocClosed( false ),
mbDisposed( false )
{
@@ -229,7 +229,7 @@ SbxObject* StarBASIC::getVBAGlobals( )
}
}
}
- const String aVBAHook( RTL_CONSTASCII_USTRINGPARAM( "VBAGlobals" ) );
+ const OUString aVBAHook("VBAGlobals");
pVBAGlobals = (SbUnoObject*)Find( aVBAHook , SbxCLASS_DONTCARE );
}
return pVBAGlobals;
@@ -393,7 +393,7 @@ SbxBase* SbiFactory::Create( sal_uInt16 nSbxId, sal_uInt32 nCreator )
{
if( nCreator == SBXCR_SBX )
{
- String aEmpty;
+ OUString aEmpty;
switch( nSbxId )
{
case SBXID_BASIC:
@@ -413,7 +413,7 @@ SbxBase* SbiFactory::Create( sal_uInt16 nSbxId, sal_uInt32 nCreator )
return NULL;
}
-SbxObject* SbiFactory::CreateObject( const rtl::OUString& rClass )
+SbxObject* SbiFactory::CreateObject( const OUString& rClass )
{
if( rClass.equalsIgnoreAsciiCase( "StarBASIC" ) )
{
@@ -421,18 +421,18 @@ SbxObject* SbiFactory::CreateObject( const rtl::OUString& rClass )
}
else if( rClass.equalsIgnoreAsciiCase( "StarBASICModule" ) )
{
- return new SbModule( rtl::OUString() );
+ return new SbModule( OUString() );
}
else if( rClass.equalsIgnoreAsciiCase( "Collection" ) )
{
- return new BasicCollection( rtl::OUString("Collection"));
+ return new BasicCollection( OUString("Collection"));
}
else if( rClass.equalsIgnoreAsciiCase( "FileSystemObject" ) )
{
try
{
Reference< XMultiServiceFactory > xFactory( comphelper::getProcessServiceFactory(), UNO_SET_THROW );
- ::rtl::OUString aServiceName( RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.FileSystemObject" ) );
+ OUString aServiceName("ooo.vba.FileSystemObject");
Reference< XInterface > xInterface( xFactory->createInstance( aServiceName ), UNO_SET_THROW );
return new SbUnoObject( aServiceName, uno::makeAny( xInterface ) );
}
@@ -449,7 +449,7 @@ class SbOLEFactory : public SbxFactory
{
public:
virtual SbxBase* Create( sal_uInt16 nSbxId, sal_uInt32 = SBXCR_SBX );
- virtual SbxObject* CreateObject( const rtl::OUString& );
+ virtual SbxObject* CreateObject( const OUString& );
};
SbxBase* SbOLEFactory::Create( sal_uInt16, sal_uInt32 )
@@ -458,9 +458,9 @@ SbxBase* SbOLEFactory::Create( sal_uInt16, sal_uInt32 )
return NULL;
}
-SbUnoObject* createOLEObject_Impl( const ::rtl::OUString& aType ); // sbunoobj.cxx
+SbUnoObject* createOLEObject_Impl( const OUString& aType ); // sbunoobj.cxx
-SbxObject* SbOLEFactory::CreateObject( const rtl::OUString& rClassName )
+SbxObject* SbOLEFactory::CreateObject( const OUString& rClassName )
{
SbxObject* pRet = createOLEObject_Impl( rClassName );
return pRet;
@@ -474,7 +474,7 @@ class SbFormFactory : public SbxFactory
{
public:
virtual SbxBase* Create( sal_uInt16 nSbxId, sal_uInt32 = SBXCR_SBX );
- virtual SbxObject* CreateObject( const rtl::OUString& );
+ virtual SbxObject* CreateObject( const OUString& );
};
SbxBase* SbFormFactory::Create( sal_uInt16, sal_uInt32 )
@@ -483,7 +483,7 @@ SbxBase* SbFormFactory::Create( sal_uInt16, sal_uInt32 )
return NULL;
}
-SbxObject* SbFormFactory::CreateObject( const rtl::OUString& rClassName )
+SbxObject* SbFormFactory::CreateObject( const OUString& rClassName )
{
if( SbModule* pMod = GetSbData()->pMod )
{
@@ -578,7 +578,7 @@ class SbTypeFactory : public SbxFactory
{
public:
virtual SbxBase* Create( sal_uInt16 nSbxId, sal_uInt32 = SBXCR_SBX );
- virtual SbxObject* CreateObject( const rtl::OUString& );
+ virtual SbxObject* CreateObject( const OUString& );
};
SbxBase* SbTypeFactory::Create( sal_uInt16, sal_uInt32 )
@@ -587,7 +587,7 @@ SbxBase* SbTypeFactory::Create( sal_uInt16, sal_uInt32 )
return NULL;
}
-SbxObject* SbTypeFactory::CreateObject( const rtl::OUString& rClassName )
+SbxObject* SbTypeFactory::CreateObject( const OUString& rClassName )
{
SbxObject* pRet = NULL;
SbModule* pMod = GetSbData()->pMod;
@@ -671,8 +671,7 @@ SbClassModuleObject::SbClassModuleObject( SbModule* pClassModule )
}
// Search for own copy of ImplMethod
- String aImplMethodName = pImplMethod->GetName();
- SbxVariable* p = pMethods->Find( aImplMethodName, SbxCLASS_METHOD );
+ SbxVariable* p = pMethods->Find( pImplMethod->GetName(), SbxCLASS_METHOD );
SbMethod* pImplMethodCopy = p ? PTR_CAST(SbMethod,p) : NULL;
if( !pImplMethodCopy )
{
@@ -722,7 +721,7 @@ SbClassModuleObject::SbClassModuleObject( SbModule* pClassModule )
SbxObject* pObj = PTR_CAST(SbxObject,pObjBase);
if( pObj != NULL )
{
- String aObjClass = pObj->GetClassName();
+ OUString aObjClass = pObj->GetClassName();
SbClassModuleObject* pClassModuleObj = PTR_CAST(SbClassModuleObject,pObjBase);
if( pClassModuleObj != NULL )
@@ -733,9 +732,9 @@ SbClassModuleObject::SbClassModuleObject( SbModule* pClassModule )
pNewObj->SetParent( pLclClassModule->pParent );
pNewProp->PutObject( pNewObj );
}
- else if( aObjClass.EqualsIgnoreCaseAscii( "Collection" ) )
+ else if( aObjClass.equalsIgnoreAsciiCase( "Collection" ) )
{
- String aCollectionName( RTL_CONSTASCII_USTRINGPARAM("Collection") );
+ OUString aCollectionName("Collection");
BasicCollection* pNewCollection = new BasicCollection( aCollectionName );
pNewCollection->SetName( pProp->GetName() );
pNewCollection->SetParent( pClassModule->pParent );
@@ -776,7 +775,7 @@ void SbClassModuleObject::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType
handleProcedureProperties( rBC, rHint );
}
-SbxVariable* SbClassModuleObject::Find( const rtl::OUString& rName, SbxClassType t )
+SbxVariable* SbClassModuleObject::Find( const OUString& rName, SbxClassType t )
{
SbxVariable* pRes = SbxObject::Find( rName, t );
if( pRes )
@@ -803,7 +802,7 @@ void SbClassModuleObject::triggerInitializeEvent( void )
mbInitializeEventDone = true;
// Search method
- SbxVariable* pMeth = SbxObject::Find(rtl::OUString("Class_Initialize"), SbxCLASS_METHOD);
+ SbxVariable* pMeth = SbxObject::Find(OUString("Class_Initialize"), SbxCLASS_METHOD);
if( pMeth )
{
SbxValues aVals;
@@ -818,7 +817,7 @@ void SbClassModuleObject::triggerTerminateEvent( void )
return;
}
// Search method
- SbxVariable* pMeth = SbxObject::Find( rtl::OUString("Class_Terminate"), SbxCLASS_METHOD );
+ SbxVariable* pMeth = SbxObject::Find(OUString("Class_Terminate"), SbxCLASS_METHOD );
if( pMeth )
{
SbxValues aVals;
@@ -840,7 +839,7 @@ void SbClassData::clear( void )
SbClassFactory::SbClassFactory( void )
{
- String aDummyName;
+ OUString aDummyName;
xClassModules = new SbxObject( aDummyName );
}
@@ -871,7 +870,7 @@ SbxBase* SbClassFactory::Create( sal_uInt16, sal_uInt32 )
return NULL;
}
-SbxObject* SbClassFactory::CreateObject( const rtl::OUString& rClassName )
+SbxObject* SbClassFactory::CreateObject( const OUString& rClassName )
{
SbxObjectRef xToUseClassModules = xClassModules;
@@ -895,7 +894,7 @@ SbxObject* SbClassFactory::CreateObject( const rtl::OUString& rClassName )
return pRet;
}
-SbModule* SbClassFactory::FindClass( const String& rClassName )
+SbModule* SbClassFactory::FindClass( const OUString& rClassName )
{
SbxVariable* pVar = xClassModules->Find( rClassName, SbxCLASS_DONTCARE );
SbModule* pMod = pVar ? (SbModule*)pVar : NULL;
@@ -903,7 +902,7 @@ SbModule* SbClassFactory::FindClass( const String& rClassName )
}
StarBASIC::StarBASIC( StarBASIC* p, bool bIsDocBasic )
- : SbxObject( String( RTL_CONSTASCII_USTRINGPARAM("StarBASIC") ) ), bDocBasic( bIsDocBasic )
+ : SbxObject( OUString("StarBASIC") ), bDocBasic( bIsDocBasic )
{
SetParent( p );
pLibInfo = NULL;
@@ -926,7 +925,7 @@ StarBASIC::StarBASIC( StarBASIC* p, bool bIsDocBasic )
GetSbData()->pUnoFac = new SbUnoFactory;
AddFactory( GetSbData()->pUnoFac );
}
- pRtl = new SbiStdObject( String( RTL_CONSTASCII_USTRINGPARAM(RTLNAME) ), this );
+ pRtl = new SbiStdObject(OUString(RTLNAME), this );
// Search via StarBasic is always global
SetFlag( SBX_GBLSEARCH );
pVBAGlobals = NULL;
@@ -1050,18 +1049,18 @@ void StarBASIC::implClearDependingVarsOnDelete( StarBASIC* pDeletedBasic )
*
**************************************************************************/
-SbModule* StarBASIC::MakeModule( const String& rName, const String& rSrc )
+SbModule* StarBASIC::MakeModule( const OUString& rName, const OUString& rSrc )
{
return MakeModule32( rName, rSrc );
}
-SbModule* StarBASIC::MakeModule32( const String& rName, const ::rtl::OUString& rSrc )
+SbModule* StarBASIC::MakeModule32( const OUString& rName, const OUString& rSrc )
{
ModuleInfo mInfo;
mInfo.ModuleType = ModuleType::NORMAL;
return MakeModule32( rName, mInfo, rSrc );
}
-SbModule* StarBASIC::MakeModule32( const String& rName, const ModuleInfo& mInfo, const rtl::OUString& rSrc )
+SbModule* StarBASIC::MakeModule32( const OUString& rName, const ModuleInfo& mInfo, const OUString& rSrc )
{
OSL_TRACE("create module %s type mInfo %d", rtl::OUStringToOString( rName, RTL_TEXTENCODING_UTF8 ).getStr(), mInfo.ModuleType );
@@ -1140,12 +1139,12 @@ void StarBASIC::Clear()
}
}
-SbModule* StarBASIC::FindModule( const String& rName )
+SbModule* StarBASIC::FindModule( const OUString& rName )
{
for( sal_uInt16 i = 0; i < pModules->Count(); i++ )
{
SbModule* p = (SbModule*) pModules->Get( i );
- if( p->GetName().EqualsIgnoreCaseAscii( rName ) )
+ if( p->GetName().equalsIgnoreAsciiCase( rName ) )
{
return p;
}
@@ -1175,8 +1174,8 @@ struct ClassModuleRunInitItem
// Derive from unordered_map type instead of typedef
// to allow forward declaration in sbmod.hxx
class ModuleInitDependencyMap : public
- boost::unordered_map< ::rtl::OUString, ClassModuleRunInitItem,
- ::rtl::OUStringHash, ::std::equal_to< ::rtl::OUString > >
+ boost::unordered_map< OUString, ClassModuleRunInitItem,
+ ::rtl::OUStringHash, ::std::equal_to< OUString > >
{};
void SbModule::implProcessModuleRunInit( ModuleInitDependencyMap& rMap, ClassModuleRunInitItem& rItem )
@@ -1191,7 +1190,7 @@ void SbModule::implProcessModuleRunInit( ModuleInitDependencyMap& rMap, ClassMod
{
for( StringVector::iterator it = rReqTypes.begin() ; it != rReqTypes.end() ; ++it )
{
- String& rStr = *it;
+ OUString& rStr = *it;
// Is required type a class module?
ModuleInitDependencyMap::iterator itFind = rMap.find( rStr );
@@ -1243,7 +1242,7 @@ void StarBASIC::InitAllModules( StarBASIC* pBasicNotToInit )
for ( sal_uInt16 nMod = 0; nMod < pModules->Count(); nMod++ )
{
SbModule* pModule = (SbModule*)pModules->Get( nMod );
- String aModuleName = pModule->GetName();
+ OUString aModuleName = pModule->GetName();
if( pModule->isProxyModule() )
{
aMIDMap[aModuleName] = ClassModuleRunInitItem( pModule );
@@ -1311,7 +1310,7 @@ void StarBASIC::DeInitAllModules( void )
// method and a module with the given name is found the search continues
// for entrypoint "Main".
// If this fails again a conventional search over objects is performend.
-SbxVariable* StarBASIC::Find( const rtl::OUString& rName, SbxClassType t )
+SbxVariable* StarBASIC::Find( const OUString& rName, SbxClassType t )
{
SbxVariable* pRes = NULL;
SbModule* pNamed = NULL;
@@ -1345,7 +1344,7 @@ SbxVariable* StarBASIC::Find( const rtl::OUString& rName, SbxClassType t )
{
// Remember modul fpr Main() call
// or is the name equal?!?
- if( p->GetName().EqualsIgnoreCaseAscii( rName ) )
+ if( p->GetName().equalsIgnoreAsciiCase( rName ) )
{
if( t == SbxCLASS_OBJECT || t == SbxCLASS_DONTCARE )
{
@@ -1375,7 +1374,7 @@ SbxVariable* StarBASIC::Find( const rtl::OUString& rName, SbxClassType t )
}
OUString aMainStr("Main");
if( !pRes && pNamed && ( t == SbxCLASS_METHOD || t == SbxCLASS_DONTCARE ) &&
- !pNamed->GetName().EqualsIgnoreCaseAscii( aMainStr ) )
+ !pNamed->GetName().equalsIgnoreAsciiCase( aMainStr ) )
{
pRes = pNamed->Find( aMainStr, SbxCLASS_METHOD );
}
@@ -1386,7 +1385,7 @@ SbxVariable* StarBASIC::Find( const rtl::OUString& rName, SbxClassType t )
return pRes;
}
-sal_Bool StarBASIC::Call( const String& rName, SbxArray* pParam )
+sal_Bool StarBASIC::Call( const OUString& rName, SbxArray* pParam )
{
sal_Bool bRes = SbxObject::Call( rName, pParam );
if( !bRes )
@@ -1402,7 +1401,7 @@ sal_Bool StarBASIC::Call( const String& rName, SbxArray* pParam )
}
// Find method via name (e.g. query via BASIC IDE)
-SbxBase* StarBASIC::FindSBXInCurrentScope( const String& rName )
+SbxBase* StarBASIC::FindSBXInCurrentScope( const OUString& rName )
{
if( !GetSbData()->pInst )
{
@@ -1466,7 +1465,7 @@ SbModule* StarBASIC::GetActiveModule()
}
}
-sal_uInt16 StarBASIC::BreakPoint( sal_uInt16 l, sal_uInt16 c1, sal_uInt16 c2 )
+sal_uInt16 StarBASIC::BreakPoint( sal_Int32 l, sal_Int32 c1, sal_Int32 c2 )
{
SetErrorData( 0, l, c1, c2 );
bBreak = true;
@@ -1480,7 +1479,7 @@ sal_uInt16 StarBASIC::BreakPoint( sal_uInt16 l, sal_uInt16 c1, sal_uInt16 c2 )
}
}
-sal_uInt16 StarBASIC::StepPoint( sal_uInt16 l, sal_uInt16 c1, sal_uInt16 c2 )
+sal_uInt16 StarBASIC::StepPoint( sal_Int32 l, sal_Int32 c1, sal_Int32 c2 )
{
SetErrorData( 0, l, c1, c2 );
bBreak = false;
@@ -1506,7 +1505,7 @@ sal_uInt16 StarBASIC::GetCol2() { return GetSbData()->nCol2; }
// Specific to error handler
SbError StarBASIC::GetErrorCode() { return GetSbData()->nCode; }
-const String& StarBASIC::GetErrorText() { return GetSbData()->aErrMsg; }
+const OUString& StarBASIC::GetErrorText() { return GetSbData()->aErrMsg; }
bool StarBASIC::IsCompilerError() { return GetSbData()->bCompiler; }
// From 1996-03-29:
@@ -1632,13 +1631,13 @@ struct BasicStringList_Impl : private Resource
: Resource( rErrIdP ),aResId(nId, *rErrIdP.GetResMgr() ){}
~BasicStringList_Impl() { FreeResource(); }
- String GetString(){ return aResId.toString(); }
+ OUString GetString(){ return aResId.toString(); }
sal_Bool IsErrorTextAvailable( void )
{ return IsAvailableRes(aResId.SetRT(RSC_STRING)); }
};
//----------------------------------------------------------------
-void StarBASIC::MakeErrorText( SbError nId, const ::rtl::OUString& aMsg )
+void StarBASIC::MakeErrorText( SbError nId, const OUString& aMsg )
{
SolarMutexGuard aSolarGuard;
sal_uInt16 nOldID = GetVBErrorCode( nId );
@@ -1650,32 +1649,32 @@ void StarBASIC::MakeErrorText( SbError nId, const ::rtl::OUString& aMsg )
if( aMyStringList.IsErrorTextAvailable() )
{
// merge message with additional text
- String aMsg1 = aMyStringList.GetString();
+ OUStringBuffer aMsg1(aMyStringList.GetString());
// replace argument placeholder with %s
- String aSrgStr( RTL_CONSTASCII_USTRINGPARAM("$(ARG1)") );
- sal_uInt16 nResult = aMsg1.Search( aSrgStr );
+ OUString aSrgStr( "$(ARG1)" );
+ sal_Int32 nResult = aMyStringList.GetString().indexOf( aSrgStr );
- if( nResult != STRING_NOTFOUND )
+ if( nResult >= 0 )
{
- aMsg1.Erase( nResult, aSrgStr.Len() );
- aMsg1.Insert( aMsg, nResult );
+ aMsg1.remove(nResult, aSrgStr.getLength());
+ aMsg1.insert(nResult, aMsg);
}
- GetSbData()->aErrMsg = aMsg1;
+ GetSbData()->aErrMsg = aMsg1.makeStringAndClear();
}
else if( nOldID != 0 )
{
- rtl::OUStringBuffer aStdMsg;
+ OUStringBuffer aStdMsg;
aStdMsg.append("Fehler ").append(static_cast<sal_Int32>(nOldID)).append(": Kein Fehlertext verfuegbar!");
GetSbData()->aErrMsg = aStdMsg.makeStringAndClear();
}
else
{
- GetSbData()->aErrMsg = String::EmptyString();
+ GetSbData()->aErrMsg = "";
}
}
sal_Bool StarBASIC::CError( SbError code, const OUString& rMsg,
- sal_uInt16 l, sal_uInt16 c1, sal_uInt16 c2 )
+ sal_Int32 l, sal_Int32 c1, sal_Int32 c2 )
{
SolarMutexGuard aSolarGuard;
@@ -1717,12 +1716,12 @@ sal_Bool StarBASIC::CError( SbError code, const OUString& rMsg,
return bRet;
}
-sal_Bool StarBASIC::RTError( SbError code, sal_uInt16 l, sal_uInt16 c1, sal_uInt16 c2 )
+sal_Bool StarBASIC::RTError( SbError code, sal_Int32 l, sal_Int32 c1, sal_Int32 c2 )
{
- return RTError( code, String(), l, c1, c2 );
+ return RTError( code, OUString(), l, c1, c2 );
}
-sal_Bool StarBASIC::RTError( SbError code, const String& rMsg, sal_uInt16 l, sal_uInt16 c1, sal_uInt16 c2 )
+sal_Bool StarBASIC::RTError( SbError code, const OUString& rMsg, sal_Int32 l, sal_Int32 c1, sal_Int32 c2 )
{
SolarMutexGuard aSolarGuard;
@@ -1734,7 +1733,7 @@ sal_Bool StarBASIC::RTError( SbError code, const String& rMsg, sal_uInt16 l, sal
MakeErrorText( c, rMsg );
// Implementation of the code for the string transport to SFX-Error
- if( rMsg.Len() )
+ if( !rMsg.isEmpty() )
{
// very confusing, even though MakeErrorText sets up the error text
// seems that this is not used ( if rMsg already has content )
@@ -1742,14 +1741,14 @@ sal_Bool StarBASIC::RTError( SbError code, const String& rMsg, sal_uInt16 l, sal
// like vba ( adds an error number etc )
if ( SbiRuntime::isVBAEnabled() && ( code == SbERR_BASIC_COMPAT ) )
{
- rtl::OUStringBuffer aTmp;
+ OUStringBuffer aTmp;
aTmp.append('\'').append(SbxErrObject::getUnoErrObject()->getNumber())
- .append("\'\n").append(GetSbData()->aErrMsg.Len() ? GetSbData()->aErrMsg : rMsg);
+ .append("\'\n").append(!GetSbData()->aErrMsg.isEmpty() ? GetSbData()->aErrMsg : rMsg);
code = (sal_uIntPtr)*new StringErrorInfo( code, aTmp.makeStringAndClear() );
}
else
{
- code = (sal_uIntPtr)*new StringErrorInfo( code, String(rMsg) );
+ code = (sal_uIntPtr)*new StringErrorInfo( code, rMsg );
}
}
@@ -1766,10 +1765,10 @@ sal_Bool StarBASIC::RTError( SbError code, const String& rMsg, sal_uInt16 l, sal
void StarBASIC::Error( SbError n )
{
- Error( n, String() );
+ Error( n, OUString() );
}
-void StarBASIC::Error( SbError n, const String& rMsg )
+void StarBASIC::Error( SbError n, const OUString& rMsg )
{
if( GetSbData()->pInst )
{
@@ -1785,7 +1784,7 @@ void StarBASIC::FatalError( SbError n )
}
}
-void StarBASIC::FatalError( SbError _errCode, const String& _details )
+void StarBASIC::FatalError( SbError _errCode, const OUString& _details )
{
if( GetSbData()->pInst )
{
@@ -1806,7 +1805,7 @@ SbError StarBASIC::GetErrBasic()
}
// make the additional message for the RTL function error accessible
-String StarBASIC::GetErrorMsg()
+OUString StarBASIC::GetErrorMsg()
{
if( GetSbData()->pInst )
{
@@ -1814,11 +1813,11 @@ String StarBASIC::GetErrorMsg()
}
else
{
- return String();
+ return OUString();
}
}
-sal_uInt16 StarBASIC::GetErl()
+sal_Int32 StarBASIC::GetErl()
{
if( GetSbData()->pInst )
{
@@ -1917,12 +1916,12 @@ sal_Bool StarBASIC::LoadData( SvStream& r, sal_uInt16 nVer )
}
}
// HACK for SFX-Bullshit!
- SbxVariable* p = Find( String( RTL_CONSTASCII_USTRINGPARAM("FALSE") ), SbxCLASS_PROPERTY );
+ SbxVariable* p = Find( OUString("FALSE"), SbxCLASS_PROPERTY );
if( p )
{
Remove( p );
}
- p = Find( String( RTL_CONSTASCII_USTRINGPARAM("TRUE") ), SbxCLASS_PROPERTY );
+ p = Find( OUString("TRUE"), SbxCLASS_PROPERTY );
if( p )
{
Remove( p );
@@ -1975,7 +1974,7 @@ Reference< frame::XModel > StarBASIC::GetModelFromBasic( SbxObject* pBasic )
// look for the ThisComponent variable, first in the parent (which
// might be the document's Basic), then in the parent's parent (which might be
// the application Basic)
- const OUString sThisComponent( RTL_CONSTASCII_USTRINGPARAM( "ThisComponent" ) );
+ const OUString sThisComponent( "ThisComponent");
SbxVariable* pThisComponent = NULL;
SbxObject* pLookup = pBasic->GetParent();
@@ -2030,15 +2029,15 @@ static sal_uInt16 nCountHash = 0, nAddHash, nItemHash, nRemoveHash;
SbxInfoRef BasicCollection::xAddInfo = NULL;
SbxInfoRef BasicCollection::xItemInfo = NULL;
-BasicCollection::BasicCollection( const rtl::OUString& rClass )
+BasicCollection::BasicCollection( const OUString& rClass )
: SbxObject( rClass )
{
if( !nCountHash )
{
- nCountHash = MakeHashCode( rtl::OUString::createFromAscii( pCountStr ) );
- nAddHash = MakeHashCode( rtl::OUString::createFromAscii( pAddStr ) );
- nItemHash = MakeHashCode( rtl::OUString::createFromAscii( pItemStr ) );
- nRemoveHash = MakeHashCode( rtl::OUString::createFromAscii( pRemoveStr ) );
+ nCountHash = MakeHashCode( OUString::createFromAscii( pCountStr ) );
+ nAddHash = MakeHashCode( OUString::createFromAscii( pAddStr ) );
+ nItemHash = MakeHashCode( OUString::createFromAscii( pItemStr ) );
+ nRemoveHash = MakeHashCode( OUString::createFromAscii( pRemoveStr ) );
}
Initialize();
@@ -2060,31 +2059,31 @@ void BasicCollection::Initialize()
SetFlag( SBX_FIXED );
ResetFlag( SBX_WRITE );
SbxVariable* p;
- p = Make( rtl::OUString::createFromAscii( pCountStr ), SbxCLASS_PROPERTY, SbxINTEGER );
+ p = Make( OUString::createFromAscii( pCountStr ), SbxCLASS_PROPERTY, SbxINTEGER );
p->ResetFlag( SBX_WRITE );
p->SetFlag( SBX_DONTSTORE );
- p = Make( rtl::OUString::createFromAscii( pAddStr ), SbxCLASS_METHOD, SbxEMPTY );
+ p = Make( OUString::createFromAscii( pAddStr ), SbxCLASS_METHOD, SbxEMPTY );
p->SetFlag( SBX_DONTSTORE );
- p = Make( rtl::OUString::createFromAscii( pItemStr ), SbxCLASS_METHOD, SbxVARIANT );
+ p = Make( OUString::createFromAscii( pItemStr ), SbxCLASS_METHOD, SbxVARIANT );
p->SetFlag( SBX_DONTSTORE );
- p = Make( rtl::OUString::createFromAscii( pRemoveStr ), SbxCLASS_METHOD, SbxEMPTY );
+ p = Make( OUString::createFromAscii( pRemoveStr ), SbxCLASS_METHOD, SbxEMPTY );
p->SetFlag( SBX_DONTSTORE );
if ( !xAddInfo.Is() )
{
xAddInfo = new SbxInfo;
- xAddInfo->AddParam( String( RTL_CONSTASCII_USTRINGPARAM("Item") ), SbxVARIANT, SBX_READ );
- xAddInfo->AddParam( String( RTL_CONSTASCII_USTRINGPARAM("Key") ), SbxVARIANT, SBX_READ | SBX_OPTIONAL );
- xAddInfo->AddParam( String( RTL_CONSTASCII_USTRINGPARAM("Before") ), SbxVARIANT, SBX_READ | SBX_OPTIONAL );
- xAddInfo->AddParam( String( RTL_CONSTASCII_USTRINGPARAM("After") ), SbxVARIANT, SBX_READ | SBX_OPTIONAL );
+ xAddInfo->AddParam( OUString( "Item" ), SbxVARIANT, SBX_READ );
+ xAddInfo->AddParam( OUString( "Key" ), SbxVARIANT, SBX_READ | SBX_OPTIONAL );
+ xAddInfo->AddParam( OUString( "Before" ), SbxVARIANT, SBX_READ | SBX_OPTIONAL );
+ xAddInfo->AddParam( OUString( "After" ), SbxVARIANT, SBX_READ | SBX_OPTIONAL );
}
if ( !xItemInfo.Is() )
{
xItemInfo = new SbxInfo;
- xItemInfo->AddParam( String( RTL_CONSTASCII_USTRINGPARAM("Index") ), SbxVARIANT, SBX_READ | SBX_OPTIONAL);
+ xItemInfo->AddParam( OUString( "Index" ), SbxVARIANT, SBX_READ | SBX_OPTIONAL);
}
}
-SbxVariable* BasicCollection::Find( const rtl::OUString& rName, SbxClassType t )
+SbxVariable* BasicCollection::Find( const OUString& rName, SbxClassType t )
{
SbxVariable* pFind = SbxObject::Find( rName, t );
return pFind;
@@ -2153,7 +2152,7 @@ sal_Int32 BasicCollection::implGetIndex( SbxVariable* pIndexVar )
sal_Int32 nIndex = -1;
if( pIndexVar->GetType() == SbxSTRING )
{
- nIndex = implGetIndexForName( pIndexVar->GetString() );
+ nIndex = implGetIndexForName( pIndexVar->GetOUString() );
}
else
{
@@ -2162,7 +2161,7 @@ sal_Int32 BasicCollection::implGetIndex( SbxVariable* pIndexVar )
return nIndex;
}
-sal_Int32 BasicCollection::implGetIndexForName( const String& rName )
+sal_Int32 BasicCollection::implGetIndexForName( const OUString& rName )
{
sal_Int32 nIndex = -1;
sal_Int32 nCount = xItemArray->Count32();
@@ -2171,7 +2170,7 @@ sal_Int32 BasicCollection::implGetIndexForName( const String& rName )
{
SbxVariable* pVar = xItemArray->Get32( i );
if( pVar->GetHashCode() == nNameHash &&
- pVar->GetName().EqualsIgnoreCaseAscii( rName ) )
+ pVar->GetName().equalsIgnoreAsciiCase( rName ) )
{
nIndex = i;
break;
@@ -2239,7 +2238,7 @@ void BasicCollection::CollAdd( SbxArray* pPar_ )
SetError( SbERR_BAD_ARGUMENT );
return;
}
- String aKey = pKey->GetString();
+ OUString aKey = pKey->GetOUString();
if( implGetIndexForName( aKey ) != -1 )
{
SetError( SbERR_BAD_ARGUMENT );
diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx
index 4519cee47286..54d2a26e2006 100644
--- a/basic/source/classes/sbunoobj.cxx
+++ b/basic/source/classes/sbunoobj.cxx
@@ -115,7 +115,7 @@ static char const defaultNameSpace[] = "ooo.vba";
// redirection built in. The property name specifies the name
// of the default property.
-bool SbUnoObject::getDefaultPropName( SbUnoObject* pUnoObj, ::rtl::OUString& sDfltProp )
+bool SbUnoObject::getDefaultPropName( SbUnoObject* pUnoObj, OUString& sDfltProp )
{
bool result = false;
Reference< XDefaultProperty> xDefaultProp( pUnoObj->maTmpUnoObj, UNO_QUERY );
@@ -153,7 +153,7 @@ void SetSbUnoObjectDfltPropName( SbxObject* pObj )
SbUnoObject* pUnoObj = PTR_CAST(SbUnoObject,(SbxObject*) pObj);
if ( pUnoObj )
{
- ::rtl::OUString sDfltPropName;
+ OUString sDfltPropName;
if ( SbUnoObject::getDefaultPropName( pUnoObj, sDfltPropName ) )
{
@@ -176,14 +176,14 @@ Reference< XIdlReflection > getCoreReflection_Impl( void )
if( xContext.is() )
{
xContext->getValueByName(
- ::rtl::OUString( "/singletons/com.sun.star.reflection.theCoreReflection" ) )
+ OUString( "/singletons/com.sun.star.reflection.theCoreReflection" ) )
>>= xCoreReflection;
OSL_ENSURE( xCoreReflection.is(), "### CoreReflection singleton not accessable!?" );
}
if( !xCoreReflection.is() )
{
throw DeploymentException(
- ::rtl::OUString( "/singletons/com.sun.star.reflection.theCoreReflection singleton not accessable" ),
+ OUString( "/singletons/com.sun.star.reflection.theCoreReflection singleton not accessable" ),
Reference< XInterface >() );
}
}
@@ -220,15 +220,14 @@ Reference< XHierarchicalNameAccess > getTypeProvider_Impl( void )
if( xContext.is() )
{
xContext->getValueByName(
- ::rtl::OUString( "/singletons/com.sun.star.reflection.theTypeDescriptionManager" ) )
+ OUString( "/singletons/com.sun.star.reflection.theTypeDescriptionManager" ) )
>>= xAccess;
OSL_ENSURE( xAccess.is(), "### TypeDescriptionManager singleton not accessable!?" );
}
if( !xAccess.is() )
{
throw DeploymentException(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM
- ("/singletons/com.sun.star.reflection.theTypeDescriptionManager singleton not accessable") ),
+ OUString("/singletons/com.sun.star.reflection.theTypeDescriptionManager singleton not accessable"),
Reference< XInterface >() );
}
}
@@ -252,8 +251,7 @@ Reference< XTypeConverter > getTypeConverter_Impl( void )
if( !xTypeConverter.is() )
{
throw DeploymentException(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM
- ("com.sun.star.script.Converter service not accessable") ),
+ OUString("com.sun.star.script.Converter service not accessable"),
Reference< XInterface >() );
}
}
@@ -262,7 +260,7 @@ Reference< XTypeConverter > getTypeConverter_Impl( void )
// #111851 factory function to create an OLE object
-SbUnoObject* createOLEObject_Impl( const ::rtl::OUString& aType )
+SbUnoObject* createOLEObject_Impl( const OUString& aType )
{
static Reference< XMultiServiceFactory > xOLEFactory;
static bool bNeedsInit = true;
@@ -278,7 +276,7 @@ SbUnoObject* createOLEObject_Impl( const ::rtl::OUString& aType )
Reference<XMultiComponentFactory> xSMgr = xContext->getServiceManager();
xOLEFactory = Reference<XMultiServiceFactory>(
xSMgr->createInstanceWithContext(
- ::rtl::OUString( "com.sun.star.bridge.OleObjectFactory"),
+ OUString( "com.sun.star.bridge.OleObjectFactory"),
xContext ), UNO_QUERY );
}
}
@@ -287,10 +285,11 @@ SbUnoObject* createOLEObject_Impl( const ::rtl::OUString& aType )
if( xOLEFactory.is() )
{
// some type names available in VBA can not be directly used in COM
- ::rtl::OUString aOLEType = aType;
+ OUString aOLEType = aType;
if ( aOLEType == "SAXXMLReader30" )
- aOLEType = ::rtl::OUString( "Msxml2.SAXXMLReader.3.0" );
-
+ {
+ aOLEType = "Msxml2.SAXXMLReader.3.0";
+ }
Reference< XInterface > xOLEObject = xOLEFactory->createInstance( aOLEType );
if( xOLEObject.is() )
{
@@ -305,7 +304,7 @@ SbUnoObject* createOLEObject_Impl( const ::rtl::OUString& aType )
namespace
{
- void lcl_indent( ::rtl::OUStringBuffer& _inout_rBuffer, sal_Int32 _nLevel )
+ void lcl_indent( OUStringBuffer& _inout_rBuffer, sal_Int32 _nLevel )
{
while ( _nLevel-- > 0 )
{
@@ -314,7 +313,7 @@ namespace
}
}
-void implAppendExceptionMsg( ::rtl::OUStringBuffer& _inout_rBuffer, const Exception& _e, const ::rtl::OUString& _rExceptionType, sal_Int32 _nLevel )
+void implAppendExceptionMsg( OUStringBuffer& _inout_rBuffer, const Exception& _e, const OUString& _rExceptionType, sal_Int32 _nLevel )
{
_inout_rBuffer.appendAscii( "\n" );
lcl_indent( _inout_rBuffer, _nLevel );
@@ -333,19 +332,20 @@ void implAppendExceptionMsg( ::rtl::OUStringBuffer& _inout_rBuffer, const Except
}
// construct an error message for the exception
-::rtl::OUString implGetExceptionMsg( const Exception& e, const ::rtl::OUString& aExceptionType_ )
+OUString implGetExceptionMsg( const Exception& e, const OUString& aExceptionType_ )
{
- ::rtl::OUStringBuffer aMessageBuf;
+ OUStringBuffer aMessageBuf;
implAppendExceptionMsg( aMessageBuf, e, aExceptionType_, 0 );
return aMessageBuf.makeStringAndClear();
}
-::rtl::OUString implGetExceptionMsg( const Any& _rCaughtException )
+OUString implGetExceptionMsg( const Any& _rCaughtException )
{
OSL_PRECOND( _rCaughtException.getValueTypeClass() == TypeClass_EXCEPTION, "implGetExceptionMsg: illegal argument!" );
if ( _rCaughtException.getValueTypeClass() != TypeClass_EXCEPTION )
- return String();
-
+ {
+ return OUString();
+ }
return implGetExceptionMsg( *static_cast< const Exception* >( _rCaughtException.getValue() ), _rCaughtException.getValueTypeName() );
}
@@ -365,10 +365,9 @@ Any convertAny( const Any& rVal, const Type& aDestType )
}
catch( const CannotConvertException& e2 )
{
- ::rtl::OUString aCannotConvertExceptionName
- ( "com.sun.star.lang.IllegalArgumentException" );
+ OUString aCannotConvertExceptionName( "com.sun.star.lang.IllegalArgumentException");
StarBASIC::Error( ERRCODE_BASIC_EXCEPTION,
- implGetExceptionMsg( e2, aCannotConvertExceptionName ) );
+ implGetExceptionMsg( e2, aCannotConvertExceptionName ) );
return aConvertedVal;
}
return aConvertedVal;
@@ -389,7 +388,7 @@ Reference<XIdlClass> TypeToIdlClass( const Type& rType )
if( pTD )
{
- ::rtl::OUString sOWName( pTD->pTypeName );
+ OUString sOWName( pTD->pTypeName );
Reference< XIdlReflection > xRefl = getCoreReflection_Impl();
xRetClass = xRefl->forName( sOWName );
}
@@ -398,7 +397,7 @@ Reference<XIdlClass> TypeToIdlClass( const Type& rType )
// Exception type unknown
template< class EXCEPTION >
-::rtl::OUString implGetExceptionMsg( const EXCEPTION& e )
+OUString implGetExceptionMsg( const EXCEPTION& e )
{
return implGetExceptionMsg( e, ::getCppuType( &e ).getTypeName() );
}
@@ -422,7 +421,7 @@ void implHandleWrappedTargetException( const Any& _rWrappedTargetException )
BasicErrorException aBasicError;
SbError nError( ERRCODE_BASIC_EXCEPTION );
- ::rtl::OUStringBuffer aMessageBuf;
+ OUStringBuffer aMessageBuf;
// strip any other WrappedTargetException instances, but this time preserve the error messages.
WrappedTargetException aWrapped;
@@ -662,7 +661,7 @@ void unoToSbxValue( SbxVariable* pVar, const Any& aValue )
aClassAny <<= xClass;
// instantiate SbUnoObject
- ::rtl::OUString aName;
+ OUString aName;
SbUnoObject* pSbUnoObject = new SbUnoObject( aName, aClassAny );
SbxObjectRef xWrapper = (SbxObject*)pSbUnoObject;
@@ -750,7 +749,7 @@ void unoToSbxValue( SbxVariable* pVar, const Any& aValue )
}
}
// instantiate a SbUnoObject
- ::rtl::OUString aName;
+ 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
@@ -758,10 +757,12 @@ void unoToSbxValue( SbxVariable* pVar, const Any& aValue )
//test seems a bit of overkill
//if ( SbiRuntime::isVBAEnabled() )
{
- ::rtl::OUString sDfltPropName;
+ OUString sDfltPropName;
if ( SbUnoObject::getDefaultPropName( pSbUnoObject, sDfltPropName ) )
- pSbUnoObject->SetDfltProperty( sDfltPropName );
+ {
+ pSbUnoObject->SetDfltProperty( sDfltPropName );
+ }
}
SbxObjectRef xWrapper = (SbxObject*)pSbUnoObject;
@@ -839,7 +840,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( val ); } break;
+ case TypeClass_STRING: { 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;
@@ -874,7 +875,7 @@ Type getUnoTypeForSbxBaseType( SbxDataType eType )
aRetType = ::getCppuType( (oleautomation::Date*)0 );
}
break;
- case SbxSTRING: aRetType = ::getCppuType( (::rtl::OUString*)0 ); break;
+ case SbxSTRING: aRetType = ::getCppuType( (OUString*)0 ); break;
case SbxBOOL: aRetType = ::getCppuType( (sal_Bool*)0 ); break;
case SbxVARIANT: aRetType = ::getCppuType( (Any*)0 ); break;
case SbxCHAR: aRetType = ::getCppuType( (sal_Unicode*)0 ); break;
@@ -953,7 +954,7 @@ Type getUnoTypeForSbxValue( SbxValue* pVal )
}
}
- ::rtl::OUStringBuffer aSeqTypeName;
+ OUStringBuffer aSeqTypeName;
aSeqTypeName.appendAscii(RTL_CONSTASCII_STRINGPARAM(aSeqLevelStr))
.append(aElementType.getTypeName());
aRetType = Type( TypeClass_SEQUENCE, aSeqTypeName.makeStringAndClear() );
@@ -992,9 +993,11 @@ Type getUnoTypeForSbxValue( SbxValue* pVal )
}
}
- ::rtl::OUStringBuffer aSeqTypeName;
+ OUStringBuffer aSeqTypeName;
for( short iDim = 0 ; iDim < nDims ; iDim++ )
+ {
aSeqTypeName.appendAscii(RTL_CONSTASCII_STRINGPARAM(aSeqLevelStr));
+ }
aSeqTypeName.append(aElementType.getTypeName());
aRetType = Type( TypeClass_SEQUENCE, aSeqTypeName.makeStringAndClear() );
}
@@ -1130,10 +1133,12 @@ static Any implRekMultiDimArrayToSequence( SbxDimArray* pArray,
sal_Int32* pActualIndices, sal_Int32* pLowerBounds, sal_Int32* pUpperBounds )
{
sal_Int32 nSeqLevel = nMaxDimIndex - nActualDim + 1;
- ::rtl::OUStringBuffer aSeqTypeName;
+ OUStringBuffer aSeqTypeName;
sal_Int32 i;
for( i = 0 ; i < nSeqLevel ; i++ )
+ {
aSeqTypeName.appendAscii(RTL_CONSTASCII_STRINGPARAM(aSeqLevelStr));
+ }
aSeqTypeName.append(aElemType.getTypeName());
Type aSeqType( TypeClass_SEQUENCE, aSeqTypeName.makeStringAndClear() );
@@ -1192,7 +1197,7 @@ Any sbxToUnoValue( SbxVariable* pVar )
// function to find a global identifier in
// the UnoScope and to wrap it for Sbx
-static bool implGetTypeByName( const String& rName, Type& rRetType )
+static bool implGetTypeByName( const OUString& rName, Type& rRetType )
{
bool bSuccess = false;
@@ -1248,7 +1253,7 @@ Any sbxToUnoValue( SbxVariable* pVar, const Type& rType, Property* pUnoProperty
if( pVar->IsNull() && eType == TypeClass_INTERFACE )
{
Reference< XInterface > xRef;
- ::rtl::OUString aClassName = xIdlTargetClass->getName();
+ OUString aClassName = xIdlTargetClass->getName();
Type aClassType( xIdlTargetClass->getTypeClass(), aClassName.getStr() );
aRetVal.setValue( &xRef, aClassType );
}
@@ -1318,19 +1323,20 @@ Any sbxToUnoValue( SbxVariable* pVar, const Type& rType, Property* pUnoProperty
if( xIdlClass.is() )
{
- ::rtl::OUString aClassName = xIdlClass->getName();
+ OUString aClassName = xIdlClass->getName();
Type aType( xIdlClass->getTypeClass(), aClassName.getStr() );
aRetVal <<= aType;
}
}
else if( eBaseType == SbxSTRING )
{
- // String representing type?
- String aTypeName = pVar->GetString();
+ OUString aTypeName = pVar->GetOUString();
Type aType;
bool bSuccess = implGetTypeByName( aTypeName, aType );
if( bSuccess )
+ {
aRetVal <<= aType;
+ }
}
}
break;
@@ -1365,7 +1371,7 @@ Any sbxToUnoValue( SbxVariable* pVar, const Type& rType, Property* pUnoProperty
xArray->realloc( aRetVal, nSeqSize );
// Element-Type
- ::rtl::OUString aClassName = xIdlTargetClass->getName();
+ OUString aClassName = xIdlTargetClass->getName();
typelib_TypeDescription * pSeqTD = 0;
typelib_typedescription_getByName( &pSeqTD, aClassName.pData );
OSL_ASSERT( pSeqTD );
@@ -1406,7 +1412,7 @@ Any sbxToUnoValue( SbxVariable* pVar, const Type& rType, Property* pUnoProperty
Type aElemType;
do
{
- ::rtl::OUString aTypeName = aCurType.getTypeName();
+ OUString aTypeName = aCurType.getTypeName();
typelib_typedescription_getByName( &pSeqTD, aTypeName.pData );
OSL_ASSERT( pSeqTD );
if( pSeqTD->eTypeClass == typelib_TypeClass_SEQUENCE )
@@ -1518,8 +1524,8 @@ void processAutomationParams( SbxArray* pParams, Sequence< Any >& args, bool bOL
sal_uInt32 i = 0;
if( pArgNamesArray )
{
- Sequence< ::rtl::OUString >& rNameSeq = pArgNamesArray->getNames();
- ::rtl::OUString* pNames = rNameSeq.getArray();
+ Sequence< OUString >& rNameSeq = pArgNamesArray->getNames();
+ OUString* pNames = rNameSeq.getArray();
Any aValAny;
for( i = 0 ; i < nParamCount ; i++ )
{
@@ -1528,7 +1534,7 @@ void processAutomationParams( SbxArray* pParams, Sequence< Any >& args, bool bOL
aValAny = sbxToUnoValueImpl( pParams->Get( iSbx ),
bBlockConversionToSmallestType );
- ::rtl::OUString aParamName = pNames[iSbx];
+ OUString aParamName = pNames[iSbx];
if( !aParamName.isEmpty() )
{
oleautomation::NamedArgument aNamedArgument;
@@ -1558,7 +1564,7 @@ enum INVOKETYPE
SetProp,
Func
};
-Any invokeAutomationMethod( const rtl::OUString& Name, Sequence< Any >& args, SbxArray* pParams, sal_uInt32 nParamCount, Reference< XInvocation >& rxInvocation, INVOKETYPE invokeType = Func )
+Any invokeAutomationMethod( const OUString& Name, Sequence< Any >& args, SbxArray* pParams, sal_uInt32 nParamCount, Reference< XInvocation >& rxInvocation, INVOKETYPE invokeType = Func )
{
Sequence< sal_Int16 > OutParamIndex;
Sequence< Any > OutParam;
@@ -1602,16 +1608,16 @@ Any invokeAutomationMethod( const rtl::OUString& Name, Sequence< Any >& args, Sb
}
// Debugging help method to readout the imlemented interfaces of an object
-rtl::OUString Impl_GetInterfaceInfo( const Reference< XInterface >& x, const Reference< XIdlClass >& xClass, sal_uInt16 nRekLevel )
+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 );
- rtl::OUStringBuffer aRetStr;
+ OUStringBuffer aRetStr;
for( sal_uInt16 i = 0 ; i < nRekLevel ; i++ )
aRetStr.appendAscii( " " );
aRetStr.append( xClass->getName() );
- ::rtl::OUString aClassName = xClass->getName();
+ OUString aClassName = xClass->getName();
Type aClassType( xClass->getTypeClass(), aClassName.getStr() );
// checking if the interface is realy supported
@@ -1638,9 +1644,9 @@ rtl::OUString Impl_GetInterfaceInfo( const Reference< XInterface >& x, const Ref
return aRetStr.makeStringAndClear();
}
-::rtl::OUString getDbgObjectNameImpl( SbUnoObject* pUnoObj )
+OUString getDbgObjectNameImpl( SbUnoObject* pUnoObj )
{
- ::rtl::OUString aName;
+ OUString aName;
if( pUnoObj )
{
aName = pUnoObj->GetClassName();
@@ -1662,24 +1668,26 @@ rtl::OUString Impl_GetInterfaceInfo( const Reference< XInterface >& x, const Ref
return aName;
}
-::rtl::OUString getDbgObjectName( SbUnoObject* pUnoObj )
+OUString getDbgObjectName( SbUnoObject* pUnoObj )
{
- ::rtl::OUString aName = getDbgObjectNameImpl( pUnoObj );
+ OUString aName = getDbgObjectNameImpl( pUnoObj );
if( aName.isEmpty() )
aName += ::rtl::OUString("Unknown");
- ::rtl::OUStringBuffer aRet;
+ OUStringBuffer aRet;
if( aName.getLength() > 20 )
+ {
aRet.appendAscii( "\n" );
+ }
aRet.appendAscii( "\"" );
aRet.append( aName );
aRet.appendAscii( "\":" );
return aRet.makeStringAndClear();
}
-::rtl::OUString getBasicObjectTypeName( SbxObject* pObj )
+OUString getBasicObjectTypeName( SbxObject* pObj )
{
- ::rtl::OUString aName;
+ OUString aName;
if( pObj )
{
SbUnoObject* pUnoObj = PTR_CAST(SbUnoObject,pObj);
@@ -1692,19 +1700,22 @@ rtl::OUString Impl_GetInterfaceInfo( const Reference< XInterface >& x, const Ref
return aName;
}
-bool checkUnoObjectType( SbUnoObject* pUnoObj, const ::rtl::OUString& rClass )
+bool checkUnoObjectType( SbUnoObject* pUnoObj, const OUString& rClass )
{
Any aToInspectObj = pUnoObj->getUnoAny();
TypeClass eType = aToInspectObj.getValueType().getTypeClass();
if( eType != TypeClass_INTERFACE )
+ {
return false;
+ }
const Reference< XInterface > x = *(Reference< XInterface >*)aToInspectObj.getValue();
// Return true for XInvocation based objects as interface type names don't count then
Reference< XInvocation > xInvocation( x, UNO_QUERY );
if( xInvocation.is() )
+ {
return true;
-
+ }
bool result = false;
Reference< XTypeProvider > xTypeProvider( x, UNO_QUERY );
if( xTypeProvider.is() )
@@ -1717,13 +1728,16 @@ bool checkUnoObjectType( SbUnoObject* pUnoObj, const ::rtl::OUString& rClass )
which matches the interface names 'ooo.vba.excel.XWorkbooks' or
'ooo.vba.msforms.XLabel'.
*/
- ::rtl::OUString aClassName( sal_Unicode( '.' ) );
+ OUString aClassName( sal_Unicode( '.' ) );
sal_Int32 nClassNameDot = rClass.lastIndexOf( '.' );
if( nClassNameDot >= 0 )
- aClassName += rClass.copy( 0, nClassNameDot + 1 ) + ::rtl::OUString( sal_Unicode( 'X' ) ) + rClass.copy( nClassNameDot + 1 );
+ {
+ aClassName += rClass.copy( 0, nClassNameDot + 1 ) + OUString( sal_Unicode( 'X' ) ) + rClass.copy( nClassNameDot + 1 );
+ }
else
+ {
aClassName += ::rtl::OUString( sal_Unicode( 'X' ) ) + rClass;
-
+ }
Sequence< Type > aTypeSeq = xTypeProvider->getTypes();
const Type* pTypeArray = aTypeSeq.getConstArray();
sal_uInt32 nIfaceCount = aTypeSeq.getLength();
@@ -1737,7 +1751,7 @@ bool checkUnoObjectType( SbUnoObject* pUnoObj, const ::rtl::OUString& rClass )
OSL_FAIL("failed to get XIdlClass for type");
break;
}
- ::rtl::OUString aInterfaceName = xClass->getName();
+ OUString aInterfaceName = xClass->getName();
if ( aInterfaceName == "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
@@ -1745,13 +1759,17 @@ bool checkUnoObjectType( SbUnoObject* pUnoObj, const ::rtl::OUString& rClass )
Reference< XInvocation > xInv( aToInspectObj, UNO_QUERY );
if ( xInv.is() )
{
- rtl::OUString sTypeName;
- xInv->getValue( rtl::OUString( "$GetTypeName" ) ) >>= sTypeName;
+ OUString sTypeName;
+ xInv->getValue( OUString( "$GetTypeName" ) ) >>= sTypeName;
if ( sTypeName.isEmpty() || sTypeName == "IDispatch" )
+ {
// can't check type, leave it pass
result = true;
+ }
else
+ {
result = sTypeName.equals( rClass );
+ }
}
break; // finished checking automation object
}
@@ -1770,13 +1788,13 @@ bool checkUnoObjectType( SbUnoObject* pUnoObj, const ::rtl::OUString& rClass )
}
// Debugging help method to readout the imlemented interfaces of an object
-::rtl::OUString Impl_GetSupportedInterfaces( SbUnoObject* pUnoObj )
+OUString Impl_GetSupportedInterfaces( SbUnoObject* pUnoObj )
{
Any aToInspectObj = pUnoObj->getUnoAny();
// allow only TypeClass interface
TypeClass eType = aToInspectObj.getValueType().getTypeClass();
- ::rtl::OUStringBuffer aRet;
+ OUStringBuffer aRet;
if( eType != TypeClass_INTERFACE )
{
aRet.appendAscii( RTL_CONSTASCII_STRINGPARAM(ID_DBG_SUPPORTEDINTERFACES) );
@@ -1825,9 +1843,9 @@ bool checkUnoObjectType( SbUnoObject* pUnoObj, const ::rtl::OUString& rClass )
// Debugging help method SbxDataType -> String
-::rtl::OUString Dbg_SbxDataType2String( SbxDataType eType )
+OUString Dbg_SbxDataType2String( SbxDataType eType )
{
- ::rtl::OUStringBuffer aRet;
+ OUStringBuffer aRet;
switch( +eType )
{
case SbxEMPTY: aRet.appendAscii("SbxEMPTY"); break;
@@ -1869,9 +1887,9 @@ bool checkUnoObjectType( SbUnoObject* pUnoObj, const ::rtl::OUString& rClass )
}
// Debugging help method to display the properties of a SbUnoObjects
-::rtl::OUString Impl_DumpProperties( SbUnoObject* pUnoObj )
+OUString Impl_DumpProperties( SbUnoObject* pUnoObj )
{
- ::rtl::OUStringBuffer aRet;
+ OUStringBuffer aRet;
aRet.appendAscii("Properties of object ");
aRet.append( getDbgObjectName( pUnoObj ) );
@@ -1901,7 +1919,7 @@ bool checkUnoObjectType( SbUnoObject* pUnoObj, const ::rtl::OUString& rClass )
SbxVariable* pVar = pProps->Get( i );
if( pVar )
{
- ::rtl::OUStringBuffer aPropStr;
+ OUStringBuffer aPropStr;
if( (i % nPropsPerLine) == 0 )
aPropStr.appendAscii( "\n" );
@@ -1946,9 +1964,9 @@ bool checkUnoObjectType( SbUnoObject* pUnoObj, const ::rtl::OUString& rClass )
}
// Debugging help method to display the methods of an SbUnoObjects
-::rtl::OUString Impl_DumpMethods( SbUnoObject* pUnoObj )
+OUString Impl_DumpMethods( SbUnoObject* pUnoObj )
{
- ::rtl::OUStringBuffer aRet;
+ OUStringBuffer aRet;
aRet.appendAscii("Methods of object ");
aRet.append( getDbgObjectName( pUnoObj ) );
@@ -2058,7 +2076,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"
{
- ::rtl::OUString aRetStr = Impl_GetSupportedInterfaces( this );
+ OUString aRetStr = Impl_GetSupportedInterfaces( this );
pVar->PutString( aRetStr );
}
// Id == -2: output properties
@@ -2066,7 +2084,7 @@ void SbUnoObject::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType,
{
// by now all properties must be established
implCreateAll();
- ::rtl::OUString aRetStr = Impl_DumpProperties( this );
+ OUString aRetStr = Impl_DumpProperties( this );
pVar->PutString( aRetStr );
}
// Id == -3: output the methods
@@ -2074,7 +2092,7 @@ void SbUnoObject::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType,
{
// y now all properties must be established
implCreateAll();
- ::rtl::OUString aRetStr = Impl_DumpMethods( this );
+ OUString aRetStr = Impl_DumpMethods( this );
pVar->PutString( aRetStr );
}
return;
@@ -2316,7 +2334,7 @@ void SbUnoObject::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType,
}
-SbUnoObject::SbUnoObject( const rtl::OUString& aName_, const Any& aUnoObj_ )
+SbUnoObject::SbUnoObject( const OUString& aName_, const Any& aUnoObj_ )
: SbxObject( aName_ )
, bNeedIntrospection( true )
, bNativeCOMObject( false )
@@ -2324,8 +2342,8 @@ SbUnoObject::SbUnoObject( const rtl::OUString& aName_, const Any& aUnoObj_ )
static Reference< XIntrospection > xIntrospection;
// beat out again the default properties of Sbx
- Remove( rtl::OUString("Name"), SbxCLASS_DONTCARE );
- Remove( rtl::OUString("Parent"), SbxCLASS_DONTCARE );
+ Remove( OUString("Name"), SbxCLASS_DONTCARE );
+ Remove( OUString("Parent"), SbxCLASS_DONTCARE );
// check the type of the ojekts
TypeClass eType = aUnoObj_.getValueType().getTypeClass();
@@ -2372,7 +2390,7 @@ SbUnoObject::SbUnoObject( const rtl::OUString& aName_, const Any& aUnoObj_ )
// Is it an interface or a struct?
sal_Bool bSetClassName = sal_False;
- rtl::OUString aClassName_;
+ OUString aClassName_;
if( eType == TypeClass_STRUCT || eType == TypeClass_EXCEPTION )
{
// Struct is Ok
@@ -2511,7 +2529,7 @@ void clearUnoMethods( void )
SbUnoMethod::SbUnoMethod
(
- const rtl::OUString& aName_,
+ const OUString& aName_,
SbxDataType eSbxType,
Reference< XIdlMethod > xUnoMethod_,
bool bInvocation,
@@ -2560,7 +2578,7 @@ SbxInfo* SbUnoMethod::GetInfo()
for( sal_uInt32 i = 0 ; i < nParamCount ; i++ )
{
const ParamInfo& rInfo = pParamInfos[i];
- ::rtl::OUString aParamName = rInfo.aName;
+ OUString aParamName = rInfo.aName;
SbxDataType t = SbxVARIANT;
sal_uInt16 nFlags_ = SBX_READ;
@@ -2583,7 +2601,7 @@ const Sequence<ParamInfo>& SbUnoMethod::getParamInfos( void )
SbUnoProperty::SbUnoProperty
(
- const rtl::OUString& aName_,
+ const OUString& aName_,
SbxDataType eSbxType,
SbxDataType eRealSbxType,
const Property& aUnoProp_,
@@ -2608,7 +2626,7 @@ SbUnoProperty::~SbUnoProperty()
{}
-SbxVariable* SbUnoObject::Find( const rtl::OUString& rName, SbxClassType t )
+SbxVariable* SbUnoObject::Find( const OUString& rName, SbxClassType t )
{
static Reference< XIdlMethod > xDummyMethod;
static Property aDummyProp;
@@ -2622,14 +2640,16 @@ SbxVariable* SbUnoObject::Find( const rtl::OUString& rName, SbxClassType t )
// if a property or a method of the required name exist
if( !pRes )
{
- ::rtl::OUString aUName( rName );
+ OUString aUName( rName );
if( mxUnoAccess.is() && !bNativeCOMObject )
{
if( mxExactName.is() )
{
- ::rtl::OUString aUExactName = mxExactName->getExactName( aUName );
+ OUString aUExactName = mxExactName->getExactName( aUName );
if( !aUExactName.isEmpty() )
+ {
aUName = aUExactName;
+ }
}
if( mxUnoAccess->hasProperty( aUName, PropertyConcept::ALL - PropertyConcept::DANGEROUS ) )
{
@@ -2670,7 +2690,7 @@ SbxVariable* SbUnoObject::Find( const rtl::OUString& rName, SbxClassType t )
try
{
Reference< XNameAccess > xNameAccess( mxUnoAccess->queryAdapter( ::getCppuType( (const Reference< XPropertySet > *)0 ) ), UNO_QUERY );
- ::rtl::OUString aUName2( rName );
+ OUString aUName2( rName );
if( xNameAccess.is() && xNameAccess->hasByName( aUName2 ) )
{
@@ -2705,7 +2725,7 @@ SbxVariable* SbUnoObject::Find( const rtl::OUString& rName, SbxClassType t )
{
if( mxExactNameInvocation.is() )
{
- ::rtl::OUString aUExactName = mxExactNameInvocation->getExactName( aUName );
+ OUString aUExactName = mxExactNameInvocation->getExactName( aUName );
if( !aUExactName.isEmpty() )
{
aUName = aUExactName;
@@ -2776,15 +2796,15 @@ void SbUnoObject::implCreateDbgProperties( void )
Property aProp;
// Id == -1: display the implemented interfaces corresponding the ClassProvider
- SbxVariableRef xVarRef = new SbUnoProperty( ::rtl::OUString(ID_DBG_SUPPORTEDINTERFACES), SbxSTRING, SbxSTRING, aProp, -1, false, false );
+ SbxVariableRef xVarRef = new SbUnoProperty( OUString(ID_DBG_SUPPORTEDINTERFACES), SbxSTRING, SbxSTRING, aProp, -1, false, false );
QuickInsert( (SbxVariable*)xVarRef );
// Id == -2: output the properties
- xVarRef = new SbUnoProperty( ::rtl::OUString(ID_DBG_PROPERTIES), SbxSTRING, SbxSTRING, aProp, -2, false, false );
+ xVarRef = new SbUnoProperty( OUString(ID_DBG_PROPERTIES), SbxSTRING, SbxSTRING, aProp, -2, false, false );
QuickInsert( (SbxVariable*)xVarRef );
// Id == -3: output the Methods
- xVarRef = new SbUnoProperty( ::rtl::OUString(ID_DBG_METHODS), SbxSTRING, SbxSTRING, aProp, -3, false, false );
+ xVarRef = new SbUnoProperty( OUString(ID_DBG_METHODS), SbxSTRING, SbxSTRING, aProp, -3, false, false );
QuickInsert( (SbxVariable*)xVarRef );
}
@@ -2865,7 +2885,7 @@ Any SbUnoObject::getUnoAny( void )
}
// help method to create an Uno-Struct per CoreReflection
-SbUnoObject* Impl_CreateUnoStruct( const ::rtl::OUString& aClassName )
+SbUnoObject* Impl_CreateUnoStruct( const OUString& aClassName )
{
// get CoreReflection
Reference< XIdlReflection > xCoreReflection = getCoreReflection_Impl();
@@ -2902,7 +2922,7 @@ SbxBase* SbUnoFactory::Create( sal_uInt16, sal_uInt32 )
return NULL;
}
-SbxObject* SbUnoFactory::CreateObject( const rtl::OUString& rClassName )
+SbxObject* SbUnoFactory::CreateObject( const OUString& rClassName )
{
return Impl_CreateUnoStruct( rClassName );
}
@@ -2910,7 +2930,7 @@ SbxObject* SbUnoFactory::CreateObject( const rtl::OUString& rClassName )
// Provisional interface for the UNO-Connection
// Deliver a SbxObject, that wrap an Uno-Interface
-SbxObjectRef GetSbUnoObject( const ::rtl::OUString& aName, const Any& aUnoObj_ )
+SbxObjectRef GetSbUnoObject( const OUString& aName, const Any& aUnoObj_ )
{
return new SbUnoObject( aName, aUnoObj_ );
}
@@ -2951,7 +2971,7 @@ void RTL_Impl_CreateUnoStruct( StarBASIC* pBasic, SbxArray& rPar, sal_Bool bWrit
}
// get the name of the class of the struct
- ::rtl::OUString aClassName = rPar.Get(1)->GetString();
+ OUString aClassName = rPar.Get(1)->GetOUString();
// try to create Struct with the same name
SbUnoObjectRef xUnoObj = Impl_CreateUnoStruct( aClassName );
@@ -2977,7 +2997,7 @@ void RTL_Impl_CreateUnoService( StarBASIC* pBasic, SbxArray& rPar, sal_Bool bWri
}
// get the name of the class of the struct
- ::rtl::OUString aServiceName = rPar.Get(1)->GetString();
+ OUString aServiceName = rPar.Get(1)->GetOUString();
// search for the service and instatiate it
Reference< XMultiServiceFactory > xFactory( comphelper::getProcessServiceFactory() );
@@ -3031,7 +3051,7 @@ void RTL_Impl_CreateUnoServiceWithArguments( StarBASIC* pBasic, SbxArray& rPar,
}
// get the name of the class of the struct
- ::rtl::OUString aServiceName = rPar.Get(1)->GetString();
+ OUString aServiceName = rPar.Get(1)->GetOUString();
Any aArgAsAny = sbxToUnoValue( rPar.Get(2),
getCppuType( (Sequence<Any>*)0 ) );
Sequence< Any > aArgs;
@@ -3091,7 +3111,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( ::rtl::OUString( "ProcessServiceManager" ), aAny );
+ SbUnoObjectRef xUnoObj = new SbUnoObject( OUString( "ProcessServiceManager" ), aAny );
refVar->PutObject( (SbUnoObject*)xUnoObj );
}
else
@@ -3141,7 +3161,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
- rtl::OUString aIfaceName = rPar.Get( i )->GetString();
+ OUString aIfaceName = rPar.Get( i )->GetOUString();
// search for the class
Reference< XIdlClass > xClass = xCoreReflection->forName( aIfaceName );
@@ -3150,7 +3170,7 @@ void RTL_Impl_HasInterfaces( StarBASIC* pBasic, SbxArray& rPar, sal_Bool bWrite
return;
}
// check if the interface will be supported
- ::rtl::OUString aClassName = xClass->getName();
+ OUString aClassName = xClass->getName();
Type aClassType( xClass->getTypeClass(), aClassName.getStr() );
if( !x->queryInterface( aClassType ).hasValue() )
{
@@ -3264,9 +3284,9 @@ void RTL_Impl_EqualUnoObjects( StarBASIC* pBasic, SbxArray& rPar, sal_Bool bWrit
// if it fails for whatever reason
// returned Reference<> be null e.g. .is() will be false
-Reference< XTypeDescriptionEnumeration >
-getTypeDescriptorEnumeration( const ::rtl::OUString& sSearchRoot,
- const Sequence< TypeClass >& types, TypeDescriptionSearchDepth depth )
+Reference< XTypeDescriptionEnumeration > getTypeDescriptorEnumeration( const OUString& sSearchRoot,
+ const Sequence< TypeClass >& types,
+ TypeDescriptionSearchDepth depth )
{
Reference< XTypeDescriptionEnumeration > xEnum;
Reference< XTypeDescriptionEnumerationAccess> xTypeEnumAccess( getTypeProvider_Impl(), UNO_QUERY );
@@ -3283,7 +3303,7 @@ getTypeDescriptorEnumeration( const ::rtl::OUString& sSearchRoot,
return xEnum;
}
-typedef boost::unordered_map< ::rtl::OUString, Any, ::rtl::OUStringHash, ::std::equal_to< ::rtl::OUString > > VBAConstantsHash;
+typedef boost::unordered_map< OUString, Any, ::rtl::OUStringHash, ::std::equal_to< OUString > > VBAConstantsHash;
VBAConstantHelper&
VBAConstantHelper::instance()
@@ -3298,7 +3318,7 @@ void VBAConstantHelper::init()
{
Sequence< TypeClass > types(1);
types[ 0 ] = TypeClass_CONSTANTS;
- Reference< XTypeDescriptionEnumeration > xEnum = getTypeDescriptorEnumeration( rtl::OUString(defaultNameSpace), types, TypeDescriptionSearchDepth_INFINITE );
+ Reference< XTypeDescriptionEnumeration > xEnum = getTypeDescriptorEnumeration( OUString(defaultNameSpace), types, TypeDescriptionSearchDepth_INFINITE );
if ( !xEnum.is())
{
@@ -3310,11 +3330,13 @@ void VBAConstantHelper::init()
if ( xConstants.is() )
{
// store constant group name
- ::rtl::OUString sFullName = xConstants->getName();
+ OUString sFullName = xConstants->getName();
sal_Int32 indexLastDot = sFullName.lastIndexOf('.');
- ::rtl::OUString sLeafName( sFullName );
+ OUString sLeafName( sFullName );
if ( indexLastDot > -1 )
+ {
sLeafName = sFullName.copy( indexLastDot + 1);
+ }
aConstCache.push_back( sLeafName ); // assume constant group names are unique
Sequence< Reference< XConstantTypeDescription > > aConsts = xConstants->getConstants();
Reference< XConstantTypeDescription >* pSrc = aConsts.getArray();
@@ -3322,13 +3344,14 @@ void VBAConstantHelper::init()
for ( sal_Int32 index =0; index<nLen; ++pSrc, ++index )
{
// store constant member name
- Reference< XConstantTypeDescription >& rXConst =
- *pSrc;
+ Reference< XConstantTypeDescription >& rXConst = *pSrc;
sFullName = rXConst->getName();
indexLastDot = sFullName.lastIndexOf('.');
sLeafName = sFullName;
if ( indexLastDot > -1 )
+ {
sLeafName = sFullName.copy( indexLastDot + 1);
+ }
aConstHash[ sLeafName.toAsciiLowerCase() ] = rXConst->getConstantValue();
}
}
@@ -3338,11 +3361,11 @@ void VBAConstantHelper::init()
}
bool
-VBAConstantHelper::isVBAConstantType( const ::rtl::OUString& rName )
+VBAConstantHelper::isVBAConstantType( const OUString& rName )
{
init();
bool bConstant = false;
- ::rtl::OUString sKey( rName );
+ OUString sKey( rName );
VBAConstantsVector::const_iterator it = aConstCache.begin();
for( ; it != aConstCache.end(); ++it )
@@ -3357,12 +3380,12 @@ VBAConstantHelper::isVBAConstantType( const ::rtl::OUString& rName )
}
SbxVariable*
-VBAConstantHelper::getVBAConstant( const ::rtl::OUString& rName )
+VBAConstantHelper::getVBAConstant( const OUString& rName )
{
SbxVariable* pConst = NULL;
init();
- ::rtl::OUString sKey( rName );
+ OUString sKey( rName );
VBAConstantsHash::const_iterator it = aConstHash.find( sKey.toAsciiLowerCase() );
@@ -3378,7 +3401,7 @@ VBAConstantHelper::getVBAConstant( const ::rtl::OUString& rName )
// Function to search for a global identifier in the
// UnoScope and to wrap it for Sbx
-SbUnoClass* findUnoClass( const ::rtl::OUString& rName )
+SbUnoClass* findUnoClass( const OUString& rName )
{
// #105550 Check if module exists
SbUnoClass* pUnoClass = NULL;
@@ -3394,13 +3417,15 @@ SbUnoClass* findUnoClass( const ::rtl::OUString& rName )
{
TypeClass eTypeClass = xTypeDesc->getTypeClass();
if( eTypeClass == TypeClass_MODULE || eTypeClass == TypeClass_CONSTANTS )
+ {
pUnoClass = new SbUnoClass( rName );
+ }
}
}
return pUnoClass;
}
-SbxVariable* SbUnoClass::Find( const rtl::OUString& rName, SbxClassType )
+SbxVariable* SbUnoClass::Find( const OUString& rName, SbxClassType )
{
SbxVariable* pRes = SbxObject::Find( rName, SbxCLASS_VARIABLE );
@@ -3435,8 +3460,8 @@ SbxVariable* SbUnoClass::Find( const rtl::OUString& rName, SbxClassType )
else
{
// expand fully qualified name
- ::rtl::OUString aNewName = GetName();
- aNewName += ::rtl::OUString(".");
+ OUString aNewName = GetName();
+ aNewName += ".";
aNewName += rName;
// get CoreReflection
@@ -3530,7 +3555,7 @@ SbxVariable* SbUnoClass::Find( const rtl::OUString& rName, SbxClassType )
}
-SbUnoService* findUnoService( const ::rtl::OUString& rName )
+SbUnoService* findUnoService( const OUString& rName )
{
SbUnoService* pSbUnoService = NULL;
@@ -3555,7 +3580,7 @@ SbUnoService* findUnoService( const ::rtl::OUString& rName )
return pSbUnoService;
}
-SbxVariable* SbUnoService::Find( const rtl::OUString& rName, SbxClassType )
+SbxVariable* SbUnoService::Find( const OUString& rName, SbxClassType )
{
SbxVariable* pRes = SbxObject::Find( rName, SbxCLASS_METHOD );
@@ -3573,11 +3598,13 @@ SbxVariable* SbUnoService::Find( const rtl::OUString& rName, SbxClassType )
{
Reference< XServiceConstructorDescription > xCtor = pCtorSeq[i];
- ::rtl::OUString aName( xCtor->getName() );
+ OUString aName( xCtor->getName() );
if( aName.isEmpty() )
{
if( xCtor->isDefaultConstructor() )
- aName = ::rtl::OUString("create");
+ {
+ aName = OUString("create");
+ }
}
if( !aName.isEmpty() )
@@ -3587,7 +3614,6 @@ SbxVariable* SbUnoService::Find( const rtl::OUString& rName, SbxClassType )
QuickInsert( (SbxVariable*)xSbCtorRef );
}
}
-
pRes = SbxObject::Find( rName, SbxCLASS_METHOD );
}
}
@@ -3714,7 +3740,7 @@ void SbUnoService::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType,
Reference< XMultiComponentFactory > xServiceMgr( xContext->getServiceManager() );
Any aRetAny;
- ::rtl::OUString aServiceName = GetName();
+ OUString aServiceName = GetName();
Reference < XInterface > xRet;
try
{
@@ -3763,7 +3789,7 @@ void clearUnoServiceCtors( void )
}
}
-SbUnoServiceCtor::SbUnoServiceCtor( const ::rtl::OUString& aName_, Reference< XServiceConstructorDescription > xServiceCtorDesc )
+SbUnoServiceCtor::SbUnoServiceCtor( const OUString& aName_, Reference< XServiceConstructorDescription > xServiceCtorDesc )
: SbxMethod( aName_, SbxOBJECT )
, m_xServiceCtorDesc( xServiceCtorDesc )
{
@@ -3781,7 +3807,7 @@ SbxInfo* SbUnoServiceCtor::GetInfo()
}
-SbUnoSingleton* findUnoSingleton( const ::rtl::OUString& rName )
+SbUnoSingleton* findUnoSingleton( const OUString& rName )
{
SbUnoSingleton* pSbUnoSingleton = NULL;
@@ -3806,13 +3832,12 @@ SbUnoSingleton* findUnoSingleton( const ::rtl::OUString& rName )
return pSbUnoSingleton;
}
-SbUnoSingleton::SbUnoSingleton( const ::rtl::OUString& aName_,
+SbUnoSingleton::SbUnoSingleton( const OUString& aName_,
const Reference< XSingletonTypeDescription >& xSingletonTypeDesc )
: SbxObject( aName_ )
, m_xSingletonTypeDesc( xSingletonTypeDesc )
{
- SbxVariableRef xGetMethodRef =
- new SbxMethod( ::rtl::OUString( "get" ), SbxOBJECT );
+ SbxVariableRef xGetMethodRef = new SbxMethod( OUString( "get" ), SbxOBJECT );
QuickInsert( (SbxVariable*)xGetMethodRef );
}
@@ -3852,7 +3877,7 @@ void SbUnoSingleton::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType,
Any aRetAny;
if( xContextToUse.is() )
{
- ::rtl::OUString aSingletonName( "/singletons/" );
+ OUString aSingletonName( "/singletons/" );
aSingletonName += GetName();
Reference < XInterface > xRet;
xContextToUse->getValueByName( aSingletonName ) >>= xRet;
@@ -3877,9 +3902,9 @@ class BasicAllListener_Impl : public BasicAllListenerHelper
public:
SbxObjectRef xSbxObj;
- ::rtl::OUString aPrefixName;
+ OUString aPrefixName;
- BasicAllListener_Impl( const ::rtl::OUString& aPrefixName );
+ BasicAllListener_Impl( const OUString& aPrefixName );
~BasicAllListener_Impl();
// Methods of XAllListener
@@ -3910,7 +3935,7 @@ void BasicAllListener_Impl::firing_impl( const AllEventObject& Event, Any* pRet
if( xSbxObj.Is() )
{
- ::rtl::OUString aMethodName = aPrefixName;
+ OUString aMethodName = aPrefixName;
aMethodName = aMethodName + Event.MethodName;
SbxVariable * pP = xSbxObj;
@@ -3990,13 +4015,13 @@ public:
// XInvocation
virtual Reference< XIntrospectionAccess > SAL_CALL getIntrospection(void) throw( RuntimeException );
- virtual Any SAL_CALL invoke(const ::rtl::OUString& FunctionName, const Sequence< Any >& Params, Sequence< sal_Int16 >& OutParamIndex, Sequence< Any >& OutParam)
+ virtual Any SAL_CALL invoke(const OUString& FunctionName, const Sequence< Any >& Params, Sequence< sal_Int16 >& OutParamIndex, Sequence< Any >& OutParam)
throw( IllegalArgumentException, CannotConvertException, InvocationTargetException, RuntimeException );
- virtual void SAL_CALL setValue(const ::rtl::OUString& PropertyName, const Any& Value)
+ virtual void SAL_CALL setValue(const OUString& PropertyName, const Any& Value)
throw( UnknownPropertyException, CannotConvertException, InvocationTargetException, RuntimeException );
- virtual Any SAL_CALL getValue(const ::rtl::OUString& PropertyName) throw( UnknownPropertyException, RuntimeException );
- virtual sal_Bool SAL_CALL hasMethod(const ::rtl::OUString& Name) throw( RuntimeException );
- virtual sal_Bool SAL_CALL hasProperty(const ::rtl::OUString& Name) throw( RuntimeException );
+ virtual Any SAL_CALL getValue(const OUString& PropertyName) throw( UnknownPropertyException, RuntimeException );
+ virtual sal_Bool SAL_CALL hasMethod(const OUString& Name) throw( RuntimeException );
+ virtual sal_Bool SAL_CALL hasProperty(const OUString& Name) throw( RuntimeException );
private:
Reference< XIdlReflection > m_xCoreReflection;
@@ -4045,7 +4070,7 @@ Reference< XIntrospectionAccess > SAL_CALL InvocationToAllListenerMapper::getInt
}
//*************************************************************************
-Any SAL_CALL InvocationToAllListenerMapper::invoke(const ::rtl::OUString& FunctionName, const Sequence< Any >& Params,
+Any SAL_CALL InvocationToAllListenerMapper::invoke(const OUString& FunctionName, const Sequence< Any >& Params,
Sequence< sal_Int16 >& OutParamIndex, Sequence< Any >& OutParam)
throw( IllegalArgumentException, CannotConvertException,
InvocationTargetException, RuntimeException )
@@ -4099,7 +4124,7 @@ Any SAL_CALL InvocationToAllListenerMapper::invoke(const ::rtl::OUString& Functi
}
//*************************************************************************
-void SAL_CALL InvocationToAllListenerMapper::setValue(const ::rtl::OUString& PropertyName, const Any& Value)
+void SAL_CALL InvocationToAllListenerMapper::setValue(const OUString& PropertyName, const Any& Value)
throw( UnknownPropertyException, CannotConvertException,
InvocationTargetException, RuntimeException )
{
@@ -4108,7 +4133,7 @@ void SAL_CALL InvocationToAllListenerMapper::setValue(const ::rtl::OUString& Pro
}
//*************************************************************************
-Any SAL_CALL InvocationToAllListenerMapper::getValue(const ::rtl::OUString& PropertyName)
+Any SAL_CALL InvocationToAllListenerMapper::getValue(const OUString& PropertyName)
throw( UnknownPropertyException, RuntimeException )
{
(void)PropertyName;
@@ -4117,7 +4142,7 @@ Any SAL_CALL InvocationToAllListenerMapper::getValue(const ::rtl::OUString& Prop
}
//*************************************************************************
-sal_Bool SAL_CALL InvocationToAllListenerMapper::hasMethod(const ::rtl::OUString& Name)
+sal_Bool SAL_CALL InvocationToAllListenerMapper::hasMethod(const OUString& Name)
throw( RuntimeException )
{
Reference< XIdlMethod > xMethod = m_xListenerType->getMethod( Name );
@@ -4125,7 +4150,7 @@ sal_Bool SAL_CALL InvocationToAllListenerMapper::hasMethod(const ::rtl::OUString
}
//*************************************************************************
-sal_Bool SAL_CALL InvocationToAllListenerMapper::hasProperty(const ::rtl::OUString& Name)
+sal_Bool SAL_CALL InvocationToAllListenerMapper::hasProperty(const OUString& Name)
throw( RuntimeException )
{
Reference< XIdlField > xField = m_xListenerType->getField( Name );
@@ -4149,8 +4174,8 @@ void SbRtl_CreateUnoListener( StarBASIC* pBasic, SbxArray& rPar, sal_Bool bWrite
}
// get the name of the class of the struct
- ::rtl::OUString aPrefixName = rPar.Get(1)->GetString();
- ::rtl::OUString aListenerClassName = rPar.Get(2)->GetString();
+ OUString aPrefixName = rPar.Get(1)->GetOUString();
+ OUString aListenerClassName = rPar.Get(2)->GetOUString();
// get the CoreReflection
Reference< XIdlReflection > xCoreReflection = getCoreReflection_Impl();
@@ -4169,7 +4194,7 @@ void SbRtl_CreateUnoListener( StarBASIC* pBasic, SbxArray& rPar, sal_Bool bWrite
// From 1999-11-30: get the InvocationAdapterFactory
Reference< XInvocationAdapterFactory > xInvocationAdapterFactory = Reference< XInvocationAdapterFactory >(
- xFactory->createInstance( rtl::OUString("com.sun.star.script.InvocationAdapterFactory") ), UNO_QUERY );
+ xFactory->createInstance( OUString("com.sun.star.script.InvocationAdapterFactory") ), UNO_QUERY );
BasicAllListener_Impl * p;
Reference< XAllListener > xAllLst = p = new BasicAllListener_Impl( aPrefixName );
@@ -4178,7 +4203,7 @@ void SbRtl_CreateUnoListener( StarBASIC* pBasic, SbxArray& rPar, sal_Bool bWrite
if( !xLst.is() )
return;
- ::rtl::OUString aClassName = xClass->getName();
+ OUString aClassName = xClass->getName();
Type aClassType( xClass->getTypeClass(), aClassName.getStr() );
aTmp = xLst->queryInterface( aClassType );
if( !aTmp.hasValue() )
@@ -4209,9 +4234,7 @@ void RTL_Impl_GetDefaultContext( StarBASIC* pBasic, SbxArray& rPar, sal_Bool bWr
Any aContextAny( comphelper::getProcessComponentContext() );
- SbUnoObjectRef xUnoObj = new SbUnoObject
- ( ::rtl::OUString( "DefaultContext" ),
- aContextAny );
+ SbUnoObjectRef xUnoObj = new SbUnoObject( OUString( "DefaultContext" ), aContextAny );
refVar->PutObject( (SbUnoObject*)xUnoObj );
}
@@ -4223,7 +4246,7 @@ void RTL_Impl_CreateUnoValue( StarBASIC* pBasic, SbxArray& rPar, sal_Bool bWrite
(void)pBasic;
(void)bWrite;
- static rtl::OUString aTypeTypeString( "type" );
+ static OUString aTypeTypeString( "type" );
// 2 parameters needed
if ( rPar.Count() != 3 )
@@ -4233,16 +4256,16 @@ void RTL_Impl_CreateUnoValue( StarBASIC* pBasic, SbxArray& rPar, sal_Bool bWrite
}
// get the name of the class of the struct
- rtl::OUString aTypeName = rPar.Get(1)->GetString();
+ OUString aTypeName = rPar.Get(1)->GetOUString();
SbxVariable* pVal = rPar.Get(2);
if( aTypeName == aTypeTypeString )
{
SbxDataType eBaseType = pVal->SbxValue::GetType();
- String aValTypeName;
+ OUString aValTypeName;
if( eBaseType == SbxSTRING )
{
- aValTypeName = pVal->GetString();
+ aValTypeName = pVal->GetOUString();
}
else if( eBaseType == SbxOBJECT )
{
@@ -4257,7 +4280,9 @@ void RTL_Impl_CreateUnoValue( StarBASIC* pBasic, SbxArray& rPar, sal_Bool bWrite
}
if( xIdlClass.is() )
+ {
aValTypeName = xIdlClass->getName();
+ }
}
Type aType;
bool bSuccess = implGetTypeByName( aValTypeName, aType );
@@ -4280,8 +4305,7 @@ void RTL_Impl_CreateUnoValue( StarBASIC* pBasic, SbxArray& rPar, sal_Bool bWrite
}
catch( const NoSuchElementException& e1 )
{
- ::rtl::OUString aNoSuchElementExceptionName
- ( "com.sun.star.container.NoSuchElementException" );
+ OUString aNoSuchElementExceptionName( "com.sun.star.container.NoSuchElementException" );
StarBASIC::Error( ERRCODE_BASIC_EXCEPTION,
implGetExceptionMsg( e1, aNoSuchElementExceptionName ) );
return;
@@ -4296,7 +4320,6 @@ void RTL_Impl_CreateUnoValue( StarBASIC* pBasic, SbxArray& rPar, sal_Bool bWrite
Any aVal = sbxToUnoValueImpl( pVal );
Any aConvertedVal = convertAny( aVal, aDestType );
-
SbxVariableRef refVar = rPar.Get(0);
SbxObjectRef xUnoAnyObject = new SbUnoAnyObject( aConvertedVal );
refVar->PutObject( xUnoAnyObject );
@@ -4318,27 +4341,27 @@ typedef WeakImplHelper2< XInvocation, XComponent > ModuleInvocationProxyHelper;
class ModuleInvocationProxy : public OMutexBasis,
public ModuleInvocationProxyHelper
{
- ::rtl::OUString m_aPrefix;
+ OUString m_aPrefix;
SbxObjectRef m_xScopeObj;
bool m_bProxyIsClassModuleObject;
::cppu::OInterfaceContainerHelper m_aListeners;
public:
- ModuleInvocationProxy( const ::rtl::OUString& aPrefix, SbxObjectRef xScopeObj );
+ ModuleInvocationProxy( const OUString& aPrefix, SbxObjectRef xScopeObj );
~ModuleInvocationProxy()
{}
// XInvocation
virtual Reference< XIntrospectionAccess > SAL_CALL getIntrospection() throw();
- virtual void SAL_CALL setValue( const ::rtl::OUString& rProperty, const Any& rValue )
+ virtual void SAL_CALL setValue( const OUString& rProperty, const Any& rValue )
throw( UnknownPropertyException );
- virtual Any SAL_CALL getValue( const ::rtl::OUString& rProperty )
+ virtual Any SAL_CALL getValue( const OUString& rProperty )
throw( UnknownPropertyException );
- virtual sal_Bool SAL_CALL hasMethod( const ::rtl::OUString& rName ) throw();
- virtual sal_Bool SAL_CALL hasProperty( const ::rtl::OUString& rProp ) throw();
+ virtual sal_Bool SAL_CALL hasMethod( const OUString& rName ) throw();
+ virtual sal_Bool SAL_CALL hasProperty( const OUString& rProp ) throw();
- virtual Any SAL_CALL invoke( const ::rtl::OUString& rFunction,
+ virtual Any SAL_CALL invoke( const OUString& rFunction,
const Sequence< Any >& rParams,
Sequence< sal_Int16 >& rOutParamIndex,
Sequence< Any >& rOutParam )
@@ -4350,8 +4373,8 @@ public:
virtual void SAL_CALL removeEventListener( const Reference< XEventListener >& aListener ) throw (RuntimeException);
};
-ModuleInvocationProxy::ModuleInvocationProxy( const ::rtl::OUString& aPrefix, SbxObjectRef xScopeObj )
- : m_aPrefix( aPrefix + ::rtl::OUString( "_" ) )
+ModuleInvocationProxy::ModuleInvocationProxy( const OUString& aPrefix, SbxObjectRef xScopeObj )
+ : m_aPrefix( aPrefix + OUString( "_" ) )
, m_xScopeObj( xScopeObj )
, m_aListeners( m_aMutex )
{
@@ -4363,14 +4386,14 @@ Reference< XIntrospectionAccess > SAL_CALL ModuleInvocationProxy::getIntrospecti
return Reference< XIntrospectionAccess >();
}
-void SAL_CALL ModuleInvocationProxy::setValue( const ::rtl::OUString& rProperty, const Any& rValue ) throw( UnknownPropertyException )
+void SAL_CALL ModuleInvocationProxy::setValue( const OUString& rProperty, const Any& rValue ) throw( UnknownPropertyException )
{
if( !m_bProxyIsClassModuleObject )
throw UnknownPropertyException();
SolarMutexGuard guard;
- ::rtl::OUString aPropertyFunctionName( "Property Set " );
+ OUString aPropertyFunctionName( "Property Set " );
aPropertyFunctionName += m_aPrefix;
aPropertyFunctionName += rProperty;
@@ -4401,7 +4424,7 @@ void SAL_CALL ModuleInvocationProxy::setValue( const ::rtl::OUString& rProperty,
}
-Any SAL_CALL ModuleInvocationProxy::getValue( const ::rtl::OUString& rProperty ) throw( UnknownPropertyException )
+Any SAL_CALL ModuleInvocationProxy::getValue( const OUString& rProperty ) throw( UnknownPropertyException )
{
if( !m_bProxyIsClassModuleObject )
{
@@ -4409,7 +4432,7 @@ Any SAL_CALL ModuleInvocationProxy::getValue( const ::rtl::OUString& rProperty )
}
SolarMutexGuard guard;
- ::rtl::OUString aPropertyFunctionName( "Property Get " );
+ OUString aPropertyFunctionName( "Property Get " );
aPropertyFunctionName += m_aPrefix;
aPropertyFunctionName += rProperty;
@@ -4429,17 +4452,17 @@ Any SAL_CALL ModuleInvocationProxy::getValue( const ::rtl::OUString& rProperty )
return aRet;
}
-sal_Bool SAL_CALL ModuleInvocationProxy::hasMethod( const ::rtl::OUString& ) throw()
+sal_Bool SAL_CALL ModuleInvocationProxy::hasMethod( const OUString& ) throw()
{
return sal_False;
}
-sal_Bool SAL_CALL ModuleInvocationProxy::hasProperty( const ::rtl::OUString& ) throw()
+sal_Bool SAL_CALL ModuleInvocationProxy::hasProperty( const OUString& ) throw()
{
return sal_False;
}
-Any SAL_CALL ModuleInvocationProxy::invoke( const ::rtl::OUString& rFunction,
+Any SAL_CALL ModuleInvocationProxy::invoke( const OUString& rFunction,
const Sequence< Any >& rParams,
Sequence< sal_Int16 >&,
Sequence< Any >& )
@@ -4450,9 +4473,10 @@ Any SAL_CALL ModuleInvocationProxy::invoke( const ::rtl::OUString& rFunction,
Any aRet;
SbxObjectRef xScopeObj = m_xScopeObj;
if( !xScopeObj.Is() )
+ {
return aRet;
-
- ::rtl::OUString aFunctionName = m_aPrefix;
+ }
+ OUString aFunctionName = m_aPrefix;
aFunctionName += rFunction;
sal_Bool bSetRescheduleBack = sal_False;
@@ -4532,8 +4556,8 @@ void SAL_CALL ModuleInvocationProxy::removeEventListener( const Reference< XEven
}
-Reference< XInterface > createComListener( const Any& aControlAny, const ::rtl::OUString& aVBAType,
- const ::rtl::OUString& aPrefix, SbxObjectRef xScopeObj )
+Reference< XInterface > createComListener( const Any& aControlAny, const OUString& aVBAType,
+ const OUString& aPrefix, SbxObjectRef xScopeObj )
{
Reference< XInterface > xRet;
@@ -4551,7 +4575,7 @@ Reference< XInterface > createComListener( const Any& aControlAny, const ::rtl::
try
{
xRet = xServiceMgr->createInstanceWithArgumentsAndContext(
- ::rtl::OUString( "com.sun.star.custom.UnoComListener"),
+ OUString( "com.sun.star.custom.UnoComListener"),
args, xContext );
}
catch( const Exception& )
@@ -4665,7 +4689,7 @@ bool SbModule::createCOMWrapperForIface( Any& o_rRetAny, SbClassModuleObject* pP
Reference< XSingleServiceFactory > xComImplementsFactory
(
xServiceMgr->createInstanceWithContext(
- ::rtl::OUString( "com.sun.star.custom.ComImplementsFactory"), xContext ),
+ OUString( "com.sun.star.custom.ComImplementsFactory"), xContext ),
UNO_QUERY
);
if( !xComImplementsFactory.is() )
@@ -4678,11 +4702,11 @@ bool SbModule::createCOMWrapperForIface( Any& o_rRetAny, SbClassModuleObject* pP
for( sal_uInt16 i = 0 ; i < nCount ; ++i )
{
SbxVariable* pVar = pModIfaces->Get( i );
- ::rtl::OUString aIfaceName = pVar->GetName();
+ OUString aIfaceName = pVar->GetName();
if( !aIfaceName.isEmpty() )
{
- ::rtl::OUString aPureIfaceName = aIfaceName;
+ OUString aPureIfaceName = aIfaceName;
sal_Int32 indexLastDot = aIfaceName.lastIndexOf('.');
if ( indexLastDot > -1 )
{
@@ -4748,7 +4772,7 @@ bool handleToStringForCOMObjects( SbxObject* pObj, SbxValue* pVal )
// Only for native COM objects
if( pUnoObj->isNativeCOMObject() )
{
- SbxVariableRef pMeth = pObj->Find( ::rtl::OUString( "toString" ), SbxCLASS_METHOD );
+ SbxVariableRef pMeth = pObj->Find( OUString( "toString" ), SbxCLASS_METHOD );
if ( pMeth.Is() )
{
SbxValues aRes;
@@ -4783,9 +4807,9 @@ void StructRefInfo::setValue( const Any& rValue )
reinterpret_cast< uno_ReleaseFunc >(cpp_release) );
}
-rtl::OUString StructRefInfo::getTypeName() const
+OUString StructRefInfo::getTypeName() const
{
- rtl::OUString sTypeName;
+ OUString sTypeName;
if ( mpTD )
{
sTypeName = mpTD->pTypeName;
@@ -4806,9 +4830,9 @@ TypeClass StructRefInfo::getTypeClass() const
return t;
}
-SbUnoStructRefObject::SbUnoStructRefObject( const ::rtl::OUString& aName_, const StructRefInfo& rMemberInfo ) : SbxObject( aName_ ), maMemberInfo( rMemberInfo ), mbMemberCacheInit( false )
+SbUnoStructRefObject::SbUnoStructRefObject( const OUString& aName_, const StructRefInfo& rMemberInfo ) : SbxObject( aName_ ), maMemberInfo( rMemberInfo ), mbMemberCacheInit( false )
{
- SetClassName( rtl::OUString( maMemberInfo.getTypeName() ) );
+ SetClassName( OUString( maMemberInfo.getTypeName() ) );
}
SbUnoStructRefObject::~SbUnoStructRefObject()
@@ -4839,7 +4863,7 @@ void SbUnoStructRefObject::initMemberCache()
OSL_ENSURE( pMemberTD, "### cannot get field in struct!" );
if (pMemberTD)
{
- rtl::OUString aName( ppNames[nPos] );
+ OUString aName( ppNames[nPos] );
TYPELIB_DANGER_RELEASE( pMemberTD );
maFields[ aName ] = new StructRefInfo( maMemberInfo.getRootAnyRef(), pMemberTD, maMemberInfo.getPos() + pMemberOffsets[nPos] );
}
@@ -4848,14 +4872,14 @@ void SbUnoStructRefObject::initMemberCache()
mbMemberCacheInit = true;
}
-SbxVariable* SbUnoStructRefObject::Find( const rtl::OUString& rName, SbxClassType t )
+SbxVariable* SbUnoStructRefObject::Find( const OUString& rName, SbxClassType t )
{
SbxVariable* pRes = SbxObject::Find( rName, t );
if ( !pRes )
{
if ( !mbMemberCacheInit )
initMemberCache();
- StructFieldInfo::iterator it = maFields.find( String( rName ).ToUpperAscii() );
+ StructFieldInfo::iterator it = maFields.find( OUString( rName ).toAsciiUpperCase() );
if ( it != maFields.end() )
{
SbxDataType eSbxType;
@@ -4894,15 +4918,15 @@ void SbUnoStructRefObject::implCreateDbgProperties( void )
Property aProp;
// Id == -1: display the implemented interfaces corresponding the ClassProvider
- SbxVariableRef xVarRef = new SbUnoProperty( ::rtl::OUString(ID_DBG_SUPPORTEDINTERFACES), SbxSTRING, SbxSTRING, aProp, -1, false, false );
+ SbxVariableRef xVarRef = new SbUnoProperty( OUString(ID_DBG_SUPPORTEDINTERFACES), SbxSTRING, SbxSTRING, aProp, -1, false, false );
QuickInsert( (SbxVariable*)xVarRef );
// Id == -2: output the properties
- xVarRef = new SbUnoProperty( ::rtl::OUString(ID_DBG_PROPERTIES), SbxSTRING, SbxSTRING, aProp, -2, false, false );
+ xVarRef = new SbUnoProperty( OUString(ID_DBG_PROPERTIES), SbxSTRING, SbxSTRING, aProp, -2, false, false );
QuickInsert( (SbxVariable*)xVarRef );
// Id == -3: output the Methods
- xVarRef = new SbUnoProperty( ::rtl::OUString(ID_DBG_METHODS), SbxSTRING, SbxSTRING, aProp, -3, false, false );
+ xVarRef = new SbUnoProperty( OUString(ID_DBG_METHODS), SbxSTRING, SbxSTRING, aProp, -3, false, false );
QuickInsert( (SbxVariable*)xVarRef );
}
@@ -4917,7 +4941,7 @@ void SbUnoStructRefObject::implCreateAll()
for ( StructFieldInfo::iterator it = maFields.begin(), it_end = maFields.end(); it != it_end; ++it )
{
- const rtl::OUString& rName = it->first;
+ const OUString& rName = it->first;
SbxDataType eSbxType;
eSbxType = unoToSbxType( it->second->getTypeClass() );
SbxDataType eRealSbxType = eSbxType;
@@ -4939,9 +4963,9 @@ Any SbUnoStructRefObject::getUnoAny( void )
return maMemberInfo.getValue();
}
-::rtl::OUString SbUnoStructRefObject::Impl_DumpProperties()
+OUString SbUnoStructRefObject::Impl_DumpProperties()
{
- ::rtl::OUStringBuffer aRet;
+ OUStringBuffer aRet;
aRet.appendAscii("Properties of object ");
aRet.append( getDbgObjectName() );
@@ -4952,7 +4976,7 @@ Any SbUnoStructRefObject::getUnoAny( void )
SbxVariable* pVar = pProps->Get( i );
if( pVar )
{
- ::rtl::OUStringBuffer aPropStr;
+ OUStringBuffer aPropStr;
if( (i % nPropsPerLine) == 0 )
{
aPropStr.appendAscii( "\n" );
@@ -4962,7 +4986,7 @@ Any SbUnoStructRefObject::getUnoAny( void )
SbxDataType eType = pVar->GetFullType();
sal_Bool bMaybeVoid = sal_False;
- rtl::OUString aName( pVar->GetName() );
+ OUString aName( pVar->GetName() );
StructFieldInfo::iterator it = maFields.find( aName );
if ( it != maFields.end() )
@@ -5022,7 +5046,7 @@ void SbUnoStructRefObject::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCTyp
// Id == -1: Display implemented interfaces according the ClassProvider
if( nId == -1 ) // Property ID_DBG_SUPPORTEDINTERFACES"
{
- ::rtl::OUStringBuffer aRet;
+ OUStringBuffer aRet;
aRet.appendAscii( RTL_CONSTASCII_STRINGPARAM(ID_DBG_SUPPORTEDINTERFACES) );
aRet.appendAscii( " not available.\n(TypeClass is not TypeClass_INTERFACE)\n" );
@@ -5033,7 +5057,7 @@ void SbUnoStructRefObject::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCTyp
{
// by now all properties must be established
implCreateAll();
- ::rtl::OUString aRetStr = Impl_DumpProperties();
+ OUString aRetStr = Impl_DumpProperties();
pVar->PutString( aRetStr );
}
// Id == -3: output the methods
@@ -5041,7 +5065,7 @@ void SbUnoStructRefObject::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCTyp
{
// by now all properties must be established
implCreateAll();
- ::rtl::OUStringBuffer aRet;
+ OUStringBuffer aRet;
aRet.appendAscii("Methods of object ");
aRet.append( getDbgObjectName() );
aRet.appendAscii( "\nNo methods found\n" );
@@ -5075,7 +5099,7 @@ void SbUnoStructRefObject::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCTyp
}
}
-StructRefInfo SbUnoStructRefObject::getStructMember( const rtl::OUString& rMemberName )
+StructRefInfo SbUnoStructRefObject::getStructMember( const OUString& rMemberName )
{
if (!mbMemberCacheInit)
{
@@ -5095,15 +5119,18 @@ StructRefInfo SbUnoStructRefObject::getStructMember( const rtl::OUString& rMembe
return aRet;
}
-rtl::OUString SbUnoStructRefObject::getDbgObjectName()
+OUString SbUnoStructRefObject::getDbgObjectName()
{
- ::rtl::OUString aName = GetClassName();
+ OUString aName = GetClassName();
if( aName.isEmpty() )
+ {
aName += ::rtl::OUString("Unknown");
-
- ::rtl::OUStringBuffer aRet;
+ }
+ OUStringBuffer aRet;
if( aName.getLength() > 20 )
+ {
aRet.appendAscii( "\n" );
+ }
aRet.appendAscii( "\"" );
aRet.append( aName );
aRet.appendAscii( "\":" );
diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx
index d6c2a9bc0e45..e577882b1c8b 100644
--- a/basic/source/classes/sbxmod.cxx
+++ b/basic/source/classes/sbxmod.cxx
@@ -102,9 +102,9 @@ class DocObjectWrapper : public DocObjectWrapper_BASE
Reference< XTypeProvider > m_xAggregateTypeProv;
Sequence< Type > m_Types;
SbModule* m_pMod;
- SbMethodRef getMethod( const rtl::OUString& aName ) throw (RuntimeException);
- SbPropertyRef getProperty( const rtl::OUString& aName ) throw (RuntimeException);
- String mName; // for debugging
+ SbMethodRef getMethod( const OUString& aName ) throw (RuntimeException);
+ SbPropertyRef getProperty( const OUString& aName ) throw (RuntimeException);
+ OUString mName; // for debugging
public:
DocObjectWrapper( SbModule* pMod );
@@ -122,11 +122,11 @@ public:
virtual Reference< XIntrospectionAccess > SAL_CALL getIntrospection( ) throw (RuntimeException);
- virtual Any SAL_CALL invoke( const ::rtl::OUString& aFunctionName, const Sequence< Any >& aParams, Sequence< ::sal_Int16 >& aOutParamIndex, Sequence< Any >& aOutParam ) throw (IllegalArgumentException, CannotConvertException, InvocationTargetException, RuntimeException);
- virtual void SAL_CALL setValue( const ::rtl::OUString& aPropertyName, const Any& aValue ) throw (UnknownPropertyException, CannotConvertException, InvocationTargetException, RuntimeException);
- virtual Any SAL_CALL getValue( const ::rtl::OUString& aPropertyName ) throw (UnknownPropertyException, RuntimeException);
- virtual ::sal_Bool SAL_CALL hasMethod( const ::rtl::OUString& aName ) throw (RuntimeException);
- virtual ::sal_Bool SAL_CALL hasProperty( const ::rtl::OUString& aName ) throw (RuntimeException);
+ virtual Any SAL_CALL invoke( const OUString& aFunctionName, const Sequence< Any >& aParams, Sequence< ::sal_Int16 >& aOutParamIndex, Sequence< Any >& aOutParam ) throw (IllegalArgumentException, CannotConvertException, InvocationTargetException, RuntimeException);
+ virtual void SAL_CALL setValue( const OUString& aPropertyName, const Any& aValue ) throw (UnknownPropertyException, CannotConvertException, InvocationTargetException, RuntimeException);
+ virtual Any SAL_CALL getValue( const OUString& aPropertyName ) throw (UnknownPropertyException, RuntimeException);
+ virtual ::sal_Bool SAL_CALL hasMethod( const OUString& aName ) throw (RuntimeException);
+ virtual ::sal_Bool SAL_CALL hasProperty( const OUString& aName ) throw (RuntimeException);
virtual Any SAL_CALL queryInterface( const Type& aType ) throw ( RuntimeException );
virtual Sequence< Type > SAL_CALL getTypes() throw ( RuntimeException );
@@ -160,7 +160,7 @@ DocObjectWrapper::DocObjectWrapper( SbModule* pVar ) : m_pMod( pVar ), mName( pV
comphelper::getProcessComponentContext() );
Reference< XMultiComponentFactory > xMFac(
xCtx->getServiceManager() );
- Reference< XProxyFactory > xProxyFac( xMFac->createInstanceWithContext( rtl::OUString( "com.sun.star.reflection.ProxyFactory" ), xCtx ), UNO_QUERY_THROW );
+ Reference< XProxyFactory > xProxyFac( xMFac->createInstanceWithContext( OUString( "com.sun.star.reflection.ProxyFactory" ), xCtx ), UNO_QUERY_THROW );
m_xAggProxy = xProxyFac->createProxy( xIf );
}
catch(const Exception& )
@@ -245,7 +245,7 @@ DocObjectWrapper::getIntrospection( ) throw (RuntimeException)
}
Any SAL_CALL
-DocObjectWrapper::invoke( const ::rtl::OUString& aFunctionName, const Sequence< Any >& aParams, Sequence< ::sal_Int16 >& aOutParamIndex, Sequence< Any >& aOutParam ) throw (IllegalArgumentException, CannotConvertException, InvocationTargetException, RuntimeException)
+DocObjectWrapper::invoke( const OUString& aFunctionName, const Sequence< Any >& aParams, Sequence< ::sal_Int16 >& aOutParamIndex, Sequence< Any >& aOutParam ) throw (IllegalArgumentException, CannotConvertException, InvocationTargetException, RuntimeException)
{
if ( m_xAggInv.is() && m_xAggInv->hasMethod( aFunctionName ) )
return m_xAggInv->invoke( aFunctionName, aParams, aOutParamIndex, aOutParam );
@@ -269,7 +269,7 @@ DocObjectWrapper::invoke( const ::rtl::OUString& aFunctionName, const Sequence<
sal_Int32 nSbxCount = n - 1;
if ( nParamsCount < nSbxCount - nSbxOptional )
{
- throw RuntimeException( ::rtl::OUString( "wrong number of parameters!" ), Reference< XInterface >() );
+ throw RuntimeException( OUString( "wrong number of parameters!" ), Reference< XInterface >() );
}
}
// set parameters
@@ -339,7 +339,7 @@ DocObjectWrapper::invoke( const ::rtl::OUString& aFunctionName, const Sequence<
}
void SAL_CALL
-DocObjectWrapper::setValue( const ::rtl::OUString& aPropertyName, const Any& aValue ) throw (UnknownPropertyException, CannotConvertException, InvocationTargetException, RuntimeException)
+DocObjectWrapper::setValue( const OUString& aPropertyName, const Any& aValue ) throw (UnknownPropertyException, CannotConvertException, InvocationTargetException, RuntimeException)
{
if ( m_xAggInv.is() && m_xAggInv->hasProperty( aPropertyName ) )
return m_xAggInv->setValue( aPropertyName, aValue );
@@ -351,7 +351,7 @@ DocObjectWrapper::setValue( const ::rtl::OUString& aPropertyName, const Any& aVa
}
Any SAL_CALL
-DocObjectWrapper::getValue( const ::rtl::OUString& aPropertyName ) throw (UnknownPropertyException, RuntimeException)
+DocObjectWrapper::getValue( const OUString& aPropertyName ) throw (UnknownPropertyException, RuntimeException)
{
if ( m_xAggInv.is() && m_xAggInv->hasProperty( aPropertyName ) )
return m_xAggInv->getValue( aPropertyName );
@@ -369,7 +369,7 @@ DocObjectWrapper::getValue( const ::rtl::OUString& aPropertyName ) throw (Unknow
}
::sal_Bool SAL_CALL
-DocObjectWrapper::hasMethod( const ::rtl::OUString& aName ) throw (RuntimeException)
+DocObjectWrapper::hasMethod( const OUString& aName ) throw (RuntimeException)
{
if ( m_xAggInv.is() && m_xAggInv->hasMethod( aName ) )
return sal_True;
@@ -377,7 +377,7 @@ DocObjectWrapper::hasMethod( const ::rtl::OUString& aName ) throw (RuntimeExcept
}
::sal_Bool SAL_CALL
-DocObjectWrapper::hasProperty( const ::rtl::OUString& aName ) throw (RuntimeException)
+DocObjectWrapper::hasProperty( const OUString& aName ) throw (RuntimeException)
{
sal_Bool bRes = sal_False;
if ( m_xAggInv.is() && m_xAggInv->hasProperty( aName ) )
@@ -397,7 +397,7 @@ Any SAL_CALL DocObjectWrapper::queryInterface( const Type& aType )
return aRet;
}
-SbMethodRef DocObjectWrapper::getMethod( const rtl::OUString& aName ) throw (RuntimeException)
+SbMethodRef DocObjectWrapper::getMethod( const OUString& aName ) throw (RuntimeException)
{
SbMethodRef pMethod = NULL;
if ( m_pMod )
@@ -412,7 +412,7 @@ SbMethodRef DocObjectWrapper::getMethod( const rtl::OUString& aName ) throw (Run
return pMethod;
}
-SbPropertyRef DocObjectWrapper::getProperty( const rtl::OUString& aName ) throw (RuntimeException)
+SbPropertyRef DocObjectWrapper::getProperty( const OUString& aName ) throw (RuntimeException)
{
SbPropertyRef pProperty = NULL;
if ( m_pMod )
@@ -454,7 +454,7 @@ uno::Reference< vba::XVBACompatibility > getVBACompatibility( const uno::Referen
try
{
uno::Reference< beans::XPropertySet > xModelProps( rxModel, uno::UNO_QUERY_THROW );
- xVBACompat.set( xModelProps->getPropertyValue( ::rtl::OUString( "BasicLibraries" ) ), uno::UNO_QUERY );
+ xVBACompat.set( xModelProps->getPropertyValue( OUString( "BasicLibraries" ) ), uno::UNO_QUERY );
}
catch(const uno::Exception& )
{
@@ -484,7 +484,7 @@ public:
uno::Reference< lang::XMultiServiceFactory > xFactory = comphelper::getProcessServiceFactory();
if ( xFactory.is() )
{
- uno::Reference< frame::XDesktop > xDeskTop( xFactory->createInstance( rtl::OUString( "com.sun.star.frame.Desktop" ) ), uno::UNO_QUERY );
+ uno::Reference< frame::XDesktop > xDeskTop( xFactory->createInstance( OUString( "com.sun.star.frame.Desktop" ) ), uno::UNO_QUERY );
if ( xDeskTop.is() )
xDeskTop->terminate();
}
@@ -501,8 +501,8 @@ IMPL_LINK( AsyncQuitHandler, OnAsyncQuit, void*, /*pNull*/ )
// A Basic module has set EXTSEARCH, so that the elements, that the modul contains,
// could be found from other module.
-SbModule::SbModule( const String& rName, sal_Bool bVBACompat )
- : SbxObject( String( RTL_CONSTASCII_USTRINGPARAM("StarBASICModule") ) ),
+SbModule::SbModule( const OUString& rName, sal_Bool bVBACompat )
+ : SbxObject( OUString("StarBASICModule") ),
pImage( NULL ), pBreaks( NULL ), pClassData( NULL ), mbVBACompat( bVBACompat ), pDocObject( NULL ), bIsProxyModule( false )
{
SetName( rName );
@@ -510,7 +510,7 @@ SbModule::SbModule( const String& rName, sal_Bool bVBACompat )
SetModuleType( script::ModuleType::NORMAL );
// #i92642: Set name property to intitial name
- SbxVariable* pNameProp = pProps->Find( String( RTL_CONSTASCII_USTRINGPARAM("Name") ), SbxCLASS_PROPERTY );
+ SbxVariable* pNameProp = pProps->Find( OUString("Name"), SbxCLASS_PROPERTY );
if( pNameProp != NULL )
{
pNameProp->PutString( GetName() );
@@ -541,7 +541,7 @@ sal_Bool SbModule::IsCompiled() const
return sal_Bool( pImage != 0 );
}
-const SbxObject* SbModule::FindType( String aTypeName ) const
+const SbxObject* SbModule::FindType( OUString aTypeName ) const
{
return pImage ? pImage->FindType( aTypeName ) : NULL;
}
@@ -576,7 +576,7 @@ void SbModule::StartDefinitions()
// request/create method
-SbMethod* SbModule::GetMethod( const String& rName, SbxDataType t )
+SbMethod* SbModule::GetMethod( const OUString& rName, SbxDataType t )
{
SbxVariable* p = pMethods->Find( rName, SbxCLASS_METHOD );
SbMethod* pMeth = p ? PTR_CAST(SbMethod,p) : NULL;
@@ -608,7 +608,7 @@ SbMethod* SbModule::GetMethod( const String& rName, SbxDataType t )
// request/create property
-SbProperty* SbModule::GetProperty( const String& rName, SbxDataType t )
+SbProperty* SbModule::GetProperty( const OUString& rName, SbxDataType t )
{
SbxVariable* p = pProps->Find( rName, SbxCLASS_PROPERTY );
SbProperty* pProp = p ? PTR_CAST(SbProperty,p) : NULL;
@@ -627,8 +627,7 @@ SbProperty* SbModule::GetProperty( const String& rName, SbxDataType t )
return pProp;
}
-SbProcedureProperty* SbModule::GetProcedureProperty
- ( const String& rName, SbxDataType t )
+SbProcedureProperty* SbModule::GetProcedureProperty( const OUString& rName, SbxDataType t )
{
SbxVariable* p = pProps->Find( rName, SbxCLASS_PROPERTY );
SbProcedureProperty* pProp = p ? PTR_CAST(SbProcedureProperty,p) : NULL;
@@ -647,8 +646,7 @@ SbProcedureProperty* SbModule::GetProcedureProperty
return pProp;
}
-SbIfaceMapperMethod* SbModule::GetIfaceMapperMethod
- ( const String& rName, SbMethod* pImplMeth )
+SbIfaceMapperMethod* SbModule::GetIfaceMapperMethod( const OUString& rName, SbMethod* pImplMeth )
{
SbxVariable* p = pMethods->Find( rName, SbxCLASS_METHOD );
SbIfaceMapperMethod* pMapperMethod = p ? PTR_CAST(SbIfaceMapperMethod,p) : NULL;
@@ -706,7 +704,7 @@ void SbModule::Clear()
}
-SbxVariable* SbModule::Find( const rtl::OUString& rName, SbxClassType t )
+SbxVariable* SbModule::Find( const OUString& rName, SbxClassType t )
{
// make sure a search in an uninstatiated class module will fail
SbxVariable* pRes = SbxObject::Find( rName, t );
@@ -729,7 +727,7 @@ SbxVariable* SbModule::Find( const rtl::OUString& rName, SbxClassType t )
if( pEnumObject )
{
bool bPrivate = pEnumObject->IsSet( SBX_PRIVATE );
- String aEnumName = pEnumObject->GetName();
+ OUString aEnumName = pEnumObject->GetName();
pRes = new SbxVariable( SbxOBJECT );
pRes->SetName( aEnumName );
@@ -747,14 +745,14 @@ SbxVariable* SbModule::Find( const rtl::OUString& rName, SbxClassType t )
return pRes;
}
-const ::rtl::OUString& SbModule::GetSource32() const
+const OUString& SbModule::GetSource32() const
{
return aOUSource;
}
-const String& SbModule::GetSource() const
+const OUString& SbModule::GetSource() const
{
- static String aRetStr;
+ static OUString aRetStr;
aRetStr = aOUSource;
return aRetStr;
}
@@ -781,8 +779,7 @@ void SbModule::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType,
if( pHint->GetId() == SBX_HINT_DATAWANTED )
{
- String aProcName;
- aProcName.AppendAscii( "Property Get " );
+ OUString aProcName("Property Get ");
aProcName += pProcProperty->GetName();
SbxVariable* pMethVar = Find( aProcName, SbxCLASS_METHOD );
@@ -824,15 +821,13 @@ void SbModule::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType,
{
pProcProperty->setSet( false );
- String aProcName;
- aProcName.AppendAscii( "Property Set " );
+ OUString aProcName("Property Set ");
aProcName += pProcProperty->GetName();
pMethVar = Find( aProcName, SbxCLASS_METHOD );
}
if( !pMethVar ) // Let
{
- String aProcName;
- aProcName.AppendAscii( "Property Let " );
+ OUString aProcName("Property Let " );
aProcName += pProcProperty->GetName();
pMethVar = Find( aProcName, SbxCLASS_METHOD );
}
@@ -883,7 +878,7 @@ void SbModule::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType,
sal_uIntPtr nId = pHint->GetId();
if( (nId == SBX_HINT_DATAWANTED || nId == SBX_HINT_DATACHANGED) &&
- pVar->GetName().EqualsIgnoreCaseAscii( "name" ) )
+ pVar->GetName().equalsIgnoreAsciiCase( "name" ) )
{
bForwardToSbxObject = false;
}
@@ -898,12 +893,12 @@ void SbModule::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType,
// The setting of the source makes the image invalid
// and scans the method definitions newly in
-void SbModule::SetSource( const String& r )
+void SbModule::SetSource( const OUString& r )
{
SetSource32( r );
}
-void SbModule::SetSource32( const ::rtl::OUString& r )
+void SbModule::SetSource32( const OUString& r )
{
// Default basic mode to library container mode, but.. allow Option VBASupport 0/1 override
SetVBACompat( getDefaultVBAMode( static_cast< StarBASIC*>( GetParent() ) ) );
@@ -959,17 +954,21 @@ void SbModule::SetSource32( const ::rtl::OUString& r )
sal_uInt16 nLine1 = aTok.GetLine();
if( aTok.Next() == SYMBOL )
{
- String aName_( aTok.GetSym() );
+ OUString aName_( aTok.GetSym() );
SbxDataType t = aTok.GetType();
if( t == SbxVARIANT && eEndTok == ENDSUB )
+ {
t = SbxVOID;
+ }
pMeth = GetMethod( aName_, t );
pMeth->nLine1 = pMeth->nLine2 = nLine1;
// The method is for a start VALID
pMeth->bInvalid = sal_False;
}
else
+ {
eEndTok = NIL;
+ }
}
// Skip up to END SUB/END FUNCTION
if( eEndTok != NIL )
@@ -983,7 +982,9 @@ void SbModule::SetSource32( const ::rtl::OUString& r )
}
}
if( aTok.IsEof() )
+ {
pMeth->nLine2 = aTok.GetLine();
+ }
}
}
EndDefinitions( sal_True );
@@ -1032,29 +1033,33 @@ static void SendHint( SbxObject* pObj, sal_uIntPtr nId, SbMethod* p )
void ClearUnoObjectsInRTL_Impl_Rek( StarBASIC* pBasic )
{
// delete the return value of CreateUnoService
- static String aName( RTL_CONSTASCII_USTRINGPARAM("CreateUnoService") );
+ static OUString aName("CreateUnoService");
SbxVariable* pVar = pBasic->GetRtl()->Find( aName, SbxCLASS_METHOD );
if( pVar )
+ {
pVar->SbxValue::Clear();
-
+ }
// delete the return value of CreateUnoDialog
- static String aName2( RTL_CONSTASCII_USTRINGPARAM("CreateUnoDialog") );
+ static OUString aName2("CreateUnoDialog");
pVar = pBasic->GetRtl()->Find( aName2, SbxCLASS_METHOD );
if( pVar )
+ {
pVar->SbxValue::Clear();
-
+ }
// delete the return value of CDec
- static String aName3( RTL_CONSTASCII_USTRINGPARAM("CDec") );
+ static OUString aName3("CDec");
pVar = pBasic->GetRtl()->Find( aName3, SbxCLASS_METHOD );
if( pVar )
+ {
pVar->SbxValue::Clear();
-
+ }
// delete return value of CreateObject
- static String aName4( RTL_CONSTASCII_USTRINGPARAM("CreateObject") );
+ static OUString aName4("CreateObject");
pVar = pBasic->GetRtl()->Find( aName4, SbxCLASS_METHOD );
if( pVar )
+ {
pVar->SbxValue::Clear();
-
+ }
// Go over all Sub-Basics
SbxArray* pObjs = pBasic->GetObjects();
sal_uInt16 nCount = pObjs->Count();
@@ -1063,7 +1068,9 @@ void ClearUnoObjectsInRTL_Impl_Rek( StarBASIC* pBasic )
SbxVariable* pObjVar = pObjs->Get( i );
StarBASIC* pSubBasic = PTR_CAST( StarBASIC, pObjVar );
if( pSubBasic )
+ {
ClearUnoObjectsInRTL_Impl_Rek( pSubBasic );
+ }
}
}
@@ -1098,7 +1105,7 @@ void SbModule::SetVBACompat( bool bCompat )
{
StarBASIC* pBasic = static_cast< StarBASIC* >( GetParent() );
uno::Reference< lang::XMultiServiceFactory > xFactory( getDocumentModel( pBasic ), uno::UNO_QUERY_THROW );
- xFactory->createInstance( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.VBAGlobals" ) ) );
+ xFactory->createInstance( OUString("ooo.vba.VBAGlobals") );
}
catch( Exception& )
{
@@ -1145,7 +1152,7 @@ sal_uInt16 SbModule::Run( SbMethod* pMeth )
// Launcher problem
// i80726 The Find below will genarate an error in Testtool so we reset it unless there was one before already
sal_Bool bWasError = SbxBase::GetError() != 0;
- SbxVariable* pMSOMacroRuntimeLibVar = Find( rtl::OUString("Launcher"), SbxCLASS_OBJECT );
+ SbxVariable* pMSOMacroRuntimeLibVar = Find( OUString("Launcher"), SbxCLASS_OBJECT );
if ( !bWasError && (SbxBase::GetError() == SbxERR_PROC_UNDEFINED) )
SbxBase::ResetError();
if( pMSOMacroRuntimeLibVar )
@@ -1155,7 +1162,7 @@ sal_uInt16 SbModule::Run( SbMethod* pMeth )
{
sal_uInt16 nGblFlag = pMSOMacroRuntimeLib->GetFlags() & SBX_GBLSEARCH;
pMSOMacroRuntimeLib->ResetFlag( SBX_GBLSEARCH );
- SbxVariable* pAppSymbol = pMSOMacroRuntimeLib->Find( rtl::OUString("Application"), SbxCLASS_METHOD );
+ SbxVariable* pAppSymbol = pMSOMacroRuntimeLib->Find( OUString("Application"), SbxCLASS_METHOD );
pMSOMacroRuntimeLib->SetFlag( nGblFlag );
if( pAppSymbol )
{
@@ -1352,11 +1359,11 @@ void SbModule::RunInit()
// Delete with private/dim declared variables
-void SbModule::AddVarName( const String& aName )
+void SbModule::AddVarName( const OUString& aName )
{
// see if the name is added allready
- std::vector< String >::iterator it_end = mModuleVariableNames.end();
- for ( std::vector< String >::iterator it = mModuleVariableNames.begin(); it != it_end; ++it )
+ std::vector< OUString >::iterator it_end = mModuleVariableNames.end();
+ for ( std::vector< OUString >::iterator it = mModuleVariableNames.begin(); it != it_end; ++it )
{
if ( aName == *it )
return;
@@ -1366,8 +1373,8 @@ void SbModule::AddVarName( const String& aName )
void SbModule::RemoveVars()
{
- std::vector< String >::iterator it_end = mModuleVariableNames.end();
- for ( std::vector< String >::iterator it = mModuleVariableNames.begin(); it != it_end; ++it )
+ std::vector< OUString >::iterator it_end = mModuleVariableNames.end();
+ for ( std::vector< OUString >::iterator it = mModuleVariableNames.begin(); it != it_end; ++it )
{
// We don't want a Find being called in a derived class ( e.g.
// SbUserform because it could trigger say an initialise event
@@ -1850,7 +1857,7 @@ sal_Bool SbModule::StoreBinaryData( SvStream& rStrm, sal_uInt16 nVer )
bRet = SbxObject::StoreData( rStrm );
if( bRet )
{
- pImage->aOUSource = ::rtl::OUString();
+ pImage->aOUSource = OUString();
pImage->aComment = aComment;
pImage->aName = GetName();
@@ -1872,7 +1879,7 @@ sal_Bool SbModule::StoreBinaryData( SvStream& rStrm, sal_uInt16 nVer )
sal_Bool SbModule::LoadBinaryData( SvStream& rStrm )
{
- ::rtl::OUString aKeepSource = aOUSource;
+ OUString aKeepSource = aOUSource;
bool bRet = LoadData( rStrm, 2 );
LoadCompleted();
aOUSource = aKeepSource;
@@ -1914,8 +1921,7 @@ void SbModule::handleProcedureProperties( SfxBroadcaster& rBC, const SfxHint& rH
if( pHint->GetId() == SBX_HINT_DATAWANTED )
{
- String aProcName;
- aProcName.AppendAscii( "Property Get " );
+ OUString aProcName("Property Get ");
aProcName += pProcProperty->GetName();
SbxVariable* pMeth = Find( aProcName, SbxCLASS_METHOD );
@@ -1957,15 +1963,13 @@ void SbModule::handleProcedureProperties( SfxBroadcaster& rBC, const SfxHint& rH
{
pProcProperty->setSet( false );
- String aProcName;
- aProcName.AppendAscii( "Property Set " );
+ OUString aProcName("Property Set " );
aProcName += pProcProperty->GetName();
pMeth = Find( aProcName, SbxCLASS_METHOD );
}
if( !pMeth ) // Let
{
- String aProcName;
- aProcName.AppendAscii( "Property Let " );
+ OUString aProcName("Property Set " );
aProcName += pProcProperty->GetName();
pMeth = Find( aProcName, SbxCLASS_METHOD );
}
@@ -1992,7 +1996,7 @@ void SbModule::handleProcedureProperties( SfxBroadcaster& rBC, const SfxHint& rH
// Implementation SbJScriptModule (Basic module for JavaScript source code)
-SbJScriptModule::SbJScriptModule( const String& rName )
+SbJScriptModule::SbJScriptModule( const OUString& rName )
:SbModule( rName )
{
}
@@ -2016,7 +2020,7 @@ sal_Bool SbJScriptModule::StoreData( SvStream& rStrm ) const
return sal_False;
// Write the source string
- String aTmp = aOUSource;
+ OUString aTmp = aOUSource;
rStrm.WriteUniOrByteString( aTmp, osl_getThreadTextEncoding() );
return sal_True;
}
@@ -2024,7 +2028,7 @@ sal_Bool SbJScriptModule::StoreData( SvStream& rStrm ) const
/////////////////////////////////////////////////////////////////////////
-SbMethod::SbMethod( const String& r, SbxDataType t, SbModule* p )
+SbMethod::SbMethod( const OUString& r, SbxDataType t, SbModule* p )
: SbxMethod( r, t ), pMod( p )
{
bInvalid = sal_True;
@@ -2192,7 +2196,7 @@ void SbMethod::Broadcast( sal_uIntPtr nHintId )
// Implementation of SbJScriptMethod (method class as a wrapper for JavaScript-functions)
-SbJScriptMethod::SbJScriptMethod( const String& r, SbxDataType t, SbModule* p )
+SbJScriptMethod::SbJScriptMethod( const OUString& r, SbxDataType t, SbModule* p )
: SbMethod( r, t, p )
{
}
@@ -2201,16 +2205,18 @@ SbJScriptMethod::~SbJScriptMethod()
{}
-SbObjModule::SbObjModule( const String& rName, const com::sun::star::script::ModuleInfo& mInfo, bool bIsVbaCompatible )
+SbObjModule::SbObjModule( const OUString& rName, const com::sun::star::script::ModuleInfo& mInfo, bool bIsVbaCompatible )
: SbModule( rName, bIsVbaCompatible )
{
SetModuleType( mInfo.ModuleType );
if ( mInfo.ModuleType == script::ModuleType::FORM )
{
- SetClassName( rtl::OUString("Form" ) );
+ SetClassName( OUString("Form" ) );
}
else if ( mInfo.ModuleObject.is() )
+ {
SetUnoObject( uno::makeAny( mInfo.ModuleObject ) );
+ }
}
SbObjModule::~SbObjModule()
@@ -2226,13 +2232,13 @@ SbObjModule::SetUnoObject( const uno::Any& aObj ) throw ( uno::RuntimeException
pDocObject = new SbUnoObject( GetName(), uno::makeAny( aObj ) );
com::sun::star::uno::Reference< com::sun::star::lang::XServiceInfo > xServiceInfo( aObj, com::sun::star::uno::UNO_QUERY_THROW );
- if( xServiceInfo->supportsService( rtl::OUString("ooo.vba.excel.Worksheet" ) ) )
+ if( xServiceInfo->supportsService( OUString("ooo.vba.excel.Worksheet" ) ) )
{
- SetClassName( rtl::OUString("Worksheet" ) );
+ SetClassName( OUString("Worksheet" ) );
}
- else if( xServiceInfo->supportsService( rtl::OUString("ooo.vba.excel.Workbook" ) ) )
+ else if( xServiceInfo->supportsService( OUString("ooo.vba.excel.Workbook" ) ) )
{
- SetClassName( rtl::OUString("Workbook" ) );
+ SetClassName( OUString("Workbook" ) );
}
}
@@ -2242,7 +2248,7 @@ SbObjModule::GetObject()
return pDocObject;
}
SbxVariable*
-SbObjModule::Find( const rtl::OUString& rName, SbxClassType t )
+SbObjModule::Find( const OUString& rName, SbxClassType t )
{
SbxVariable* pVar = NULL;
if ( pDocObject)
@@ -2378,15 +2384,14 @@ public:
aParams[0] <<= nCancel;
aParams[1] <<= nCloseMode;
- mpUserForm->triggerMethod( rtl::OUString("Userform_QueryClose" ),
- aParams);
+ mpUserForm->triggerMethod( OUString("Userform_QueryClose" ), aParams);
return;
}
}
}
- mpUserForm->triggerMethod( rtl::OUString("Userform_QueryClose" ) );
+ mpUserForm->triggerMethod( OUString("Userform_QueryClose" ) );
#endif
}
@@ -2469,7 +2474,7 @@ public:
}
};
-SbUserFormModule::SbUserFormModule( const String& rName, const com::sun::star::script::ModuleInfo& mInfo, bool bIsCompat )
+SbUserFormModule::SbUserFormModule( const OUString& rName, const com::sun::star::script::ModuleInfo& mInfo, bool bIsCompat )
: SbObjModule( rName, mInfo, bIsCompat )
, m_mInfo( mInfo )
, mbInit( false )
@@ -2492,13 +2497,13 @@ void SbUserFormModule::ResetApiObj( bool bTriggerTerminateEvent )
m_xDialog = NULL;
}
-void SbUserFormModule::triggerMethod( const String& aMethodToRun )
+void SbUserFormModule::triggerMethod( const OUString& aMethodToRun )
{
Sequence< Any > aArguments;
triggerMethod( aMethodToRun, aArguments );
}
-void SbUserFormModule::triggerMethod( const String& aMethodToRun, Sequence< Any >& aArguments )
+void SbUserFormModule::triggerMethod( const OUString& aMethodToRun, Sequence< Any >& aArguments )
{
OSL_TRACE("*** trigger %s ***", rtl::OUStringToOString( aMethodToRun, RTL_TEXTENCODING_UTF8 ).getStr() );
// Search method
@@ -2542,14 +2547,14 @@ void SbUserFormModule::triggerMethod( const String& aMethodToRun, Sequence< Any
void SbUserFormModule::triggerActivateEvent( void )
{
OSL_TRACE("**** entering SbUserFormModule::triggerActivate");
- triggerMethod( rtl::OUString( "UserForm_Activate" ) );
+ triggerMethod( OUString( "UserForm_Activate" ) );
OSL_TRACE("**** leaving SbUserFormModule::triggerActivate");
}
void SbUserFormModule::triggerDeactivateEvent( void )
{
OSL_TRACE("**** SbUserFormModule::triggerDeactivate");
- triggerMethod( rtl::OUString("Userform_Deactivate" ) );
+ triggerMethod( OUString("Userform_Deactivate" ) );
}
void SbUserFormModule::triggerInitializeEvent( void )
@@ -2557,7 +2562,7 @@ void SbUserFormModule::triggerInitializeEvent( void )
if ( mbInit )
return;
OSL_TRACE("**** SbUserFormModule::triggerInitializeEvent");
- static String aInitMethodName( RTL_CONSTASCII_USTRINGPARAM("Userform_Initialize") );
+ static OUString aInitMethodName( "Userform_Initialize");
triggerMethod( aInitMethodName );
mbInit = true;
}
@@ -2565,20 +2570,20 @@ void SbUserFormModule::triggerInitializeEvent( void )
void SbUserFormModule::triggerTerminateEvent( void )
{
OSL_TRACE("**** SbUserFormModule::triggerTerminateEvent");
- static String aTermMethodName( RTL_CONSTASCII_USTRINGPARAM("Userform_Terminate") );
+ static OUString aTermMethodName( "Userform_Terminate" );
triggerMethod( aTermMethodName );
mbInit=false;
}
void SbUserFormModule::triggerLayoutEvent( void )
{
- static String aMethodName( RTL_CONSTASCII_USTRINGPARAM("Userform_Layout") );
+ static OUString aMethodName( "Userform_Layout" );
triggerMethod( aMethodName );
}
void SbUserFormModule::triggerResizeEvent( void )
{
- static String aMethodName( RTL_CONSTASCII_USTRINGPARAM("Userform_Resize") );
+ static OUString aMethodName("Userform_Resize");
triggerMethod( aMethodName );
}
@@ -2589,20 +2594,20 @@ SbUserFormModuleInstance* SbUserFormModule::CreateInstance()
}
SbUserFormModuleInstance::SbUserFormModuleInstance( SbUserFormModule* pParentModule,
- const rtl::OUString& rName, const com::sun::star::script::ModuleInfo& mInfo, bool bIsVBACompat )
+ const OUString& rName, const com::sun::star::script::ModuleInfo& mInfo, bool bIsVBACompat )
: SbUserFormModule( rName, mInfo, bIsVBACompat )
, m_pParentModule( pParentModule )
{
}
-sal_Bool SbUserFormModuleInstance::IsClass( const rtl::OUString& rName ) const
+sal_Bool SbUserFormModuleInstance::IsClass( const OUString& rName ) const
{
- sal_Bool bParentNameMatches = m_pParentModule->GetName().EqualsIgnoreCaseAscii( rName );
+ sal_Bool bParentNameMatches = m_pParentModule->GetName().equalsIgnoreAsciiCase( rName );
sal_Bool bRet = bParentNameMatches || SbxObject::IsClass( rName );
return bRet;
}
-SbxVariable* SbUserFormModuleInstance::Find( const rtl::OUString& rName, SbxClassType t )
+SbxVariable* SbUserFormModuleInstance::Find( const OUString& rName, SbxClassType t )
{
SbxVariable* pVar = m_pParentModule->Find( rName, t );
return pVar;
@@ -2630,7 +2635,7 @@ void SbUserFormModule::Unload()
aParams[0] <<= nCancel;
aParams[1] <<= nCloseMode;
- triggerMethod( rtl::OUString("Userform_QueryClose" ), aParams);
+ triggerMethod( OUString("Userform_QueryClose" ), aParams);
aParams[0] >>= nCancel;
// basic boolean ( and what the user might use ) can be ambiguous ( e.g. basic true = -1 )
@@ -2646,7 +2651,7 @@ void SbUserFormModule::Unload()
triggerTerminateEvent();
}
// Search method
- SbxVariable* pMeth = SbObjModule::Find( rtl::OUString("UnloadObject"), SbxCLASS_METHOD );
+ SbxVariable* pMeth = SbObjModule::Find( OUString("UnloadObject"), SbxCLASS_METHOD );
if( pMeth )
{
OSL_TRACE("Attempting too run the UnloadObjectMethod");
@@ -2675,7 +2680,7 @@ void SbUserFormModule::InitObject()
{
try
{
- String aHook( RTL_CONSTASCII_USTRINGPARAM( "VBAGlobals" ) );
+ OUString aHook("VBAGlobals");
SbUnoObject* pGlobs = (SbUnoObject*)GetParent()->Find( aHook, SbxCLASS_DONTCARE );
if ( m_xModel.is() && pGlobs )
{
@@ -2687,20 +2692,20 @@ void SbUserFormModule::InitObject()
uno::Reference< lang::XMultiServiceFactory > xFactory = comphelper::getProcessServiceFactory();
uno::Sequence< uno::Any > aArgs(1);
aArgs[ 0 ] <<= m_xModel;
- rtl::OUString sDialogUrl( "vnd.sun.star.script:" );
- rtl::OUString sProjectName( "Standard" );
+ OUString sDialogUrl( "vnd.sun.star.script:" );
+ OUString sProjectName( "Standard" );
try
{
Reference< beans::XPropertySet > xProps( m_xModel, UNO_QUERY_THROW );
- uno::Reference< script::vba::XVBACompatibility > xVBAMode( xProps->getPropertyValue( rtl::OUString( "BasicLibraries" ) ), uno::UNO_QUERY_THROW );
+ uno::Reference< script::vba::XVBACompatibility > xVBAMode( xProps->getPropertyValue( OUString( "BasicLibraries" ) ), uno::UNO_QUERY_THROW );
sProjectName = xVBAMode->getProjectName();
}
catch(const Exception& ) {}
- sDialogUrl = sDialogUrl.concat( sProjectName ).concat( rtl::OUString( '.') ).concat( GetName() ).concat( rtl::OUString( "?location=document" ) );
+ sDialogUrl = sDialogUrl + sProjectName + "." + GetName() + "?location=document";
- uno::Reference< awt::XDialogProvider > xProvider( xFactory->createInstanceWithArguments( rtl::OUString( "com.sun.star.awt.DialogProvider"), aArgs ), uno::UNO_QUERY_THROW );
+ uno::Reference< awt::XDialogProvider > xProvider( xFactory->createInstanceWithArguments( OUString( "com.sun.star.awt.DialogProvider"), aArgs ), uno::UNO_QUERY_THROW );
m_xDialog = xProvider->createDialog( sDialogUrl );
// create vba api object
@@ -2749,7 +2754,7 @@ SbUserFormModule::Find( const rtl::OUString& rName, SbxClassType t )
return SbObjModule::Find( rName, t );
}
-SbProperty::SbProperty( const String& r, SbxDataType t, SbModule* p )
+SbProperty::SbProperty( const OUString& r, SbxDataType t, SbModule* p )
: SbxProperty( r, t ), pMod( p )
{
bInvalid = sal_False;
diff --git a/basic/source/comp/buffer.cxx b/basic/source/comp/buffer.cxx
index 6eb01f59a2f4..e3312c91e9c4 100644
--- a/basic/source/comp/buffer.cxx
+++ b/basic/source/comp/buffer.cxx
@@ -58,18 +58,33 @@ char* SbiBuffer::GetBuffer()
// Test, if the buffer can contain n Bytes.
// In case of doubt it will be enlarged
-bool SbiBuffer::Check( sal_uInt16 n )
+bool SbiBuffer::Check( sal_Int32 n )
{
- if( !n ) return true;
- if( ( static_cast<sal_uInt32>( nOff )+ n ) > static_cast<sal_uInt32>( nSize ) )
+ if( !n )
+ {
+ return true;
+ }
+ if( nOff + n > nSize )
{
if( nInc == 0 )
+ {
return false;
- sal_uInt16 nn = 0;
- while( nn < n ) nn = nn + nInc;
+ }
+
+ sal_Int32 nn = 0;
+ while( nn < n )
+ {
+ nn = nn + nInc;
+ }
char* p;
- if( ( static_cast<sal_uInt32>( nSize ) + nn ) > UP_LIMIT ) p = NULL;
- else p = new char [nSize + nn];
+ if( ( nSize + nn ) > UP_LIMIT )
+ {
+ p = NULL;
+ }
+ else
+ {
+ p = new char [nSize + nn];
+ }
if( !p )
{
pParser->Error( SbERR_PROG_TOO_LARGE );
@@ -140,16 +155,28 @@ bool SbiBuffer::operator +=( sal_Int8 n )
{
if( Check( 1 ) )
{
- *pCur++ = (char) n; nOff++; return true;
- } else return false;
+ *pCur++ = (char) n;
+ nOff += 1;
+ return true;
+ }
+ else
+ {
+ return false;
+ }
}
bool SbiBuffer::operator +=( sal_uInt8 n )
{
if( Check( 1 ) )
{
- *pCur++ = (char) n; nOff++; return true;
- } else return false;
+ *pCur++ = (char) n;
+ nOff += 1;
+ return true;
+ }
+ else
+ {
+ return false;
+ }
}
bool SbiBuffer::operator +=( sal_Int16 n )
@@ -158,8 +185,13 @@ bool SbiBuffer::operator +=( sal_Int16 n )
{
*pCur++ = (char) ( n & 0xFF );
*pCur++ = (char) ( n >> 8 );
- nOff += 2; return true;
- } else return false;
+ nOff += 2;
+ return true;
+ }
+ else
+ {
+ return false;
+ }
}
bool SbiBuffer::operator +=( sal_uInt16 n )
@@ -168,8 +200,13 @@ bool SbiBuffer::operator +=( sal_uInt16 n )
{
*pCur++ = (char) ( n & 0xFF );
*pCur++ = (char) ( n >> 8 );
- nOff += 2; return true;
- } else return false;
+ nOff += 2;
+ return true;
+ }
+ else
+ {
+ return false;
+ }
}
bool SbiBuffer::operator +=( sal_uInt32 n )
@@ -179,10 +216,15 @@ bool SbiBuffer::operator +=( sal_uInt32 n )
sal_uInt16 n1 = static_cast<sal_uInt16>( n & 0xFFFF );
sal_uInt16 n2 = static_cast<sal_uInt16>( n >> 16 );
if ( operator +=( n1 ) && operator +=( n2 ) )
+ {
return true;
+ }
return true;
}
- return false;
+ else
+ {
+ return false;
+ }
}
bool SbiBuffer::operator +=( sal_Int32 n )
@@ -191,18 +233,21 @@ bool SbiBuffer::operator +=( sal_Int32 n )
}
-bool SbiBuffer::operator +=( const String& n )
+bool SbiBuffer::operator +=( const OUString& n )
{
- sal_uInt16 l = n.Len() + 1;
- if( Check( l ) )
+ sal_uInt32 len = n.getLength() + 1;
+ if( Check( len ) )
{
rtl::OString aByteStr(rtl::OUStringToOString(n, osl_getThreadTextEncoding()));
- memcpy( pCur, aByteStr.getStr(), l );
- pCur += l;
- nOff = nOff + l;
+ memcpy( pCur, aByteStr.getStr(), len );
+ pCur += len;
+ nOff += len;
return true;
}
- else return false;
+ else
+ {
+ return false;
+ }
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/basic/source/comp/codegen.cxx b/basic/source/comp/codegen.cxx
index 3f389eb04188..77542dd58ae9 100644
--- a/basic/source/comp/codegen.cxx
+++ b/basic/source/comp/codegen.cxx
@@ -135,7 +135,7 @@ void SbiCodeGen::Save()
{
for( int i = 0 ; i < nIfaceCount ; i++ )
{
- const String& rIfaceName = pParser->aIfaceVector[i];
+ const OUString& rIfaceName = pParser->aIfaceVector[i];
SbxVariable* pIfaceVar = new SbxVariable( SbxVARIANT );
pIfaceVar->SetName( rIfaceName );
SbxArray* pIfaces = rMod.pClassData->mxIfaces;
@@ -168,30 +168,31 @@ void SbiCodeGen::Save()
SbiProcDef* pProc = pDef->GetProcDef();
if( pProc && pProc->IsDefined() )
{
- String aProcName = pProc->GetName();
- String aIfaceProcName;
- String aIfaceName;
+ OUString aProcName = pProc->GetName();
+ OUString aIfaceProcName;
+ OUString aIfaceName;
sal_uInt16 nPassCount = 1;
if( nIfaceCount )
{
- int nPropPrefixFound =
- aProcName.Search( String( RTL_CONSTASCII_USTRINGPARAM("Property ") ) );
- String aPureProcName = aProcName;
- String aPropPrefix;
+ int nPropPrefixFound = aProcName.indexOf(OUString("Property "));
+ OUString aPureProcName = aProcName;
+ OUString aPropPrefix;
if( nPropPrefixFound == 0 )
{
- aPropPrefix = aProcName.Copy( 0, 13 ); // 13 == Len( "Property ?et " )
- aPureProcName = aProcName.Copy( 13 );
+ aPropPrefix = aProcName.copy( 0, 13 ); // 13 == Len( "Property ?et " )
+ aPureProcName = aProcName.copy( 13 );
}
for( int i = 0 ; i < nIfaceCount ; i++ )
{
- const String& rIfaceName = pParser->aIfaceVector[i];
- int nFound = aPureProcName.Search( rIfaceName );
- if( nFound == 0 && '_' == aPureProcName.GetChar( rIfaceName.Len() ) )
+ const OUString& rIfaceName = pParser->aIfaceVector[i];
+ int nFound = aPureProcName.indexOf( rIfaceName );
+ if( nFound == 0 && '_' == aPureProcName[rIfaceName.getLength()] )
{
if( nPropPrefixFound == 0 )
+ {
aIfaceProcName += aPropPrefix;
- aIfaceProcName += aPureProcName.Copy( rIfaceName.Len() + 1 );
+ }
+ aIfaceProcName += aPureProcName.copy( rIfaceName.getLength() + 1 );
aIfaceName = rIfaceName;
nPassCount = 2;
break;
@@ -211,34 +212,38 @@ void SbiCodeGen::Save()
SbxDataType ePropType = SbxEMPTY;
switch( ePropMode )
{
- case PROPERTY_MODE_GET:
- ePropType = pProc->GetType();
- break;
- case PROPERTY_MODE_LET:
+ case PROPERTY_MODE_GET:
+ ePropType = pProc->GetType();
+ break;
+ case PROPERTY_MODE_LET:
+ {
+ // type == type of first parameter
+ ePropType = SbxVARIANT; // Default
+ SbiSymPool* pPool = &pProc->GetParams();
+ if( pPool->GetSize() > 1 )
{
- // type == type of first parameter
- ePropType = SbxVARIANT; // Default
- SbiSymPool* pPool = &pProc->GetParams();
- if( pPool->GetSize() > 1 )
+ SbiSymDef* pPar = pPool->Get( 1 );
+ if( pPar )
{
- SbiSymDef* pPar = pPool->Get( 1 );
- if( pPar )
- ePropType = pPar->GetType();
+ ePropType = pPar->GetType();
}
- break;
}
- case PROPERTY_MODE_SET:
- ePropType = SbxOBJECT;
- break;
- case PROPERTY_MODE_NONE:
- OSL_FAIL( "Illegal PropertyMode PROPERTY_MODE_NONE" );
- break;
+ break;
}
- String aPropName = pProc->GetPropName();
+ case PROPERTY_MODE_SET:
+ ePropType = SbxOBJECT;
+ break;
+ case PROPERTY_MODE_NONE:
+ OSL_FAIL( "Illegal PropertyMode PROPERTY_MODE_NONE" );
+ break;
+ }
+ OUString aPropName = pProc->GetPropName();
if( nPass == 1 )
- aPropName = aPropName.Copy( aIfaceName.Len() + 1 );
+ {
+ aPropName = aPropName.copy( aIfaceName.getLength() + 1 );
+ }
OSL_TRACE("*** getProcedureProperty for thing %s",
- rtl::OUStringToOString( aPropName,RTL_TEXTENCODING_UTF8 ).getStr() );
+ rtl::OUStringToOString( aPropName,RTL_TEXTENCODING_UTF8 ).getStr() );
rMod.GetProcedureProperty( aPropName, ePropType );
}
if( nPass == 1 )
@@ -250,10 +255,11 @@ void SbiCodeGen::Save()
pMeth = rMod.GetMethod( aProcName, pProc->GetType() );
if( !pProc->IsPublic() )
+ {
pMeth->SetFlag( SBX_PRIVATE );
-
+ }
// Declare? -> Hidden
- if( pProc->GetLib().Len() > 0 )
+ if( !pProc->GetLib().isEmpty())
{
pMeth->SetFlag( SBX_HIDDEN );
}
@@ -262,7 +268,7 @@ void SbiCodeGen::Save()
pMeth->nLine2 = pProc->GetLine2();
// The parameter:
SbxInfo* pInfo = pMeth->GetInfo();
- String aHelpFile, aComment;
+ OUString aHelpFile, aComment;
sal_uIntPtr nHelpId = 0;
if( pInfo )
{
@@ -289,7 +295,7 @@ void SbiCodeGen::Save()
t = (SbxDataType) ( t | SbxARRAY );
}
// #33677 hand-over an Optional-Info
- sal_uInt16 nFlags = SBX_READ;
+ sal_uInt16 nFlags = SBX_READ;
if( pPar->IsOptional() )
{
nFlags |= SBX_OPTIONAL;
diff --git a/basic/source/comp/dim.cxx b/basic/source/comp/dim.cxx
index b2f5dc55080b..3a6c5c93d971 100644
--- a/basic/source/comp/dim.cxx
+++ b/basic/source/comp/dim.cxx
@@ -124,7 +124,7 @@ void SbiParser::TypeDecl( SbiSymDef& rDef, bool bAsNewAlreadyParsed )
Error( SbERR_SYNTAX );
else
{
- String aCompleteName = aSym;
+ OUString aCompleteName = aSym;
// #52709 DIM AS NEW for Uno with full-qualified name
if( Peek() == DOT )
@@ -154,7 +154,7 @@ void SbiParser::TypeDecl( SbiSymDef& rDef, bool bAsNewAlreadyParsed )
break;
}
- // Take over in the String pool
+ // Take over in the string pool
rDef.SetTypeId( aGblStrings.Add( aCompleteName ) );
if( rDef.IsNew() && pProc == NULL )
@@ -390,9 +390,11 @@ void SbiParser::DefVar( SbiOpcode eOp, bool bStatic )
{
if( !bCompatible && !pDef->IsNew() )
{
- String aTypeName( aGblStrings.Find( pDef->GetTypeId() ) );
+ OUString aTypeName( aGblStrings.Find( pDef->GetTypeId() ) );
if( rTypeArray->Find( aTypeName, SbxCLASS_OBJECT ) == NULL )
+ {
Error( SbERR_UNDEF_TYPE, aTypeName );
+ }
}
if( bConst )
@@ -595,9 +597,11 @@ void SbiParser::DefType( bool bPrivate )
if( pElem )
{
SbxArray *pTypeMembers = pType->GetProperties();
- String aElemName = pElem->GetName();
+ OUString aElemName = pElem->GetName();
if( pTypeMembers->Find( aElemName, SbxCLASS_DONTCARE) )
+ {
Error (SbERR_VAR_DEFINED);
+ }
else
{
SbxDataType eElemType = pElem->GetType();
@@ -644,7 +648,7 @@ void SbiParser::DefType( bool bPrivate )
sal_uInt16 nElemTypeId = pElem->GetTypeId();
if( nElemTypeId != 0 )
{
- String aTypeName( aGblStrings.Find( nElemTypeId ) );
+ OUString aTypeName( aGblStrings.Find( nElemTypeId ) );
SbxObject* pTypeObj = static_cast< SbxObject* >( rTypeArray->Find( aTypeName, SbxCLASS_OBJECT ) );
if( pTypeObj != NULL )
{
@@ -680,7 +684,7 @@ void SbiParser::DefEnum( bool bPrivate )
if (!TestSymbol())
return;
- String aEnumName = aSym;
+ OUString aEnumName = aSym;
if( rEnumArray->Find(aEnumName,SbxCLASS_OBJECT) )
{
Error( SbERR_VAR_DEFINED, aSym );
@@ -689,8 +693,9 @@ void SbiParser::DefEnum( bool bPrivate )
SbxObject *pEnum = new SbxObject( aEnumName );
if( bPrivate )
+ {
pEnum->SetFlag( SBX_PRIVATE );
-
+ }
SbiSymDef* pElem;
SbiDimList* pDim;
bool bDone = false;
@@ -812,7 +817,7 @@ SbiProcDef* SbiParser::ProcDecl( bool bDecl )
bool bFunc = ( eCurTok == FUNCTION );
bool bProp = ( eCurTok == GET || eCurTok == SET || eCurTok == LET );
if( !TestSymbol() ) return NULL;
- String aName( aSym );
+ OUString aName( aSym );
SbxDataType eType = eScanType;
SbiProcDef* pDef = new SbiProcDef( this, aName, true );
pDef->SetType( eType );
@@ -847,22 +852,26 @@ SbiProcDef* SbiParser::ProcDecl( bool bDecl )
if( !bDecl )
{
// CDECL, LIB and ALIAS are invalid
- if( pDef->GetLib().Len() )
+ if( !pDef->GetLib().isEmpty() )
+ {
Error( SbERR_UNEXPECTED, LIB );
- if( pDef->GetAlias().Len() )
+ }
+ if( !pDef->GetAlias().isEmpty() )
+ {
Error( SbERR_UNEXPECTED, ALIAS );
+ }
if( pDef->IsCdecl() )
{
Error( SbERR_UNEXPECTED, _CDECL_ );
}
pDef->SetCdecl( false );
- pDef->GetLib().Erase();
- pDef->GetAlias().Erase();
+ pDef->GetLib() = "";
+ pDef->GetAlias() = "";
}
- else if( !pDef->GetLib().Len() )
+ else if( pDef->GetLib().isEmpty() )
{
// ALIAS and CDECL only together with LIB
- if( pDef->GetAlias().Len() )
+ if( !pDef->GetAlias().isEmpty() )
{
Error( SbERR_UNEXPECTED, ALIAS );
}
@@ -871,72 +880,104 @@ SbiProcDef* SbiParser::ProcDecl( bool bDecl )
Error( SbERR_UNEXPECTED, _CDECL_ );
}
pDef->SetCdecl( false );
- pDef->GetAlias().Erase();
+ pDef->GetAlias() = "";
}
// Brackets?
if( Peek() == LPAREN )
{
Next();
if( Peek() == RPAREN )
+ {
Next();
+ }
else
- for(;;) {
- bool bByVal = false;
- bool bOptional = false;
- bool bParamArray = false;
- while( Peek() == BYVAL || Peek() == BYREF || Peek() == _OPTIONAL_ )
- {
- if ( Peek() == BYVAL ) Next(), bByVal = true;
- else if ( Peek() == BYREF ) Next(), bByVal = false;
- else if ( Peek() == _OPTIONAL_ ) Next(), bOptional = true;
- }
- if( bCompatible && Peek() == PARAMARRAY )
- {
- if( bByVal || bOptional )
- Error( SbERR_UNEXPECTED, PARAMARRAY );
- Next();
- bParamArray = true;
- }
- SbiSymDef* pPar = VarDecl( NULL, false, false );
- if( !pPar )
- break;
- if( bByVal )
- pPar->SetByVal();
- if( bOptional )
- pPar->SetOptional();
- if( bParamArray )
- pPar->SetParamArray();
- pDef->GetParams().Add( pPar );
- SbiToken eTok = Next();
- if( eTok != COMMA && eTok != RPAREN )
+ {
+ for(;;)
{
- bool bError2 = true;
- if( bOptional && bCompatible && eTok == EQ )
+ bool bByVal = false;
+ bool bOptional = false;
+ bool bParamArray = false;
+ while( Peek() == BYVAL || Peek() == BYREF || Peek() == _OPTIONAL_ )
{
- SbiConstExpression* pDefaultExpr = new SbiConstExpression( this );
- SbxDataType eType2 = pDefaultExpr->GetType();
-
- sal_uInt16 nStringId;
- if( eType2 == SbxSTRING )
- nStringId = aGblStrings.Add( pDefaultExpr->GetString() );
- else
- nStringId = aGblStrings.Add( pDefaultExpr->GetValue(), eType2 );
+ if( Peek() == BYVAL )
+ {
+ bByVal = true;
+ }
+ else if ( Peek() == BYREF )
+ {
+ bByVal = false;
+ }
+ else if ( Peek() == _OPTIONAL_ )
+ {
+ bOptional = true;
+ }
+ Next();
+ }
+ if( bCompatible && Peek() == PARAMARRAY )
+ {
+ if( bByVal || bOptional )
+ {
+ Error( SbERR_UNEXPECTED, PARAMARRAY );
+ }
+ Next();
+ bParamArray = true;
+ }
+ SbiSymDef* pPar = VarDecl( NULL, false, false );
+ if( !pPar )
+ {
+ break;
+ }
+ if( bByVal )
+ {
+ pPar->SetByVal();
+ }
+ if( bOptional )
+ {
+ pPar->SetOptional();
+ }
+ if( bParamArray )
+ {
+ pPar->SetParamArray();
+ }
+ pDef->GetParams().Add( pPar );
+ SbiToken eTok = Next();
+ if( eTok != COMMA && eTok != RPAREN )
+ {
+ bool bError2 = true;
+ if( bOptional && bCompatible && eTok == EQ )
+ {
+ SbiConstExpression* pDefaultExpr = new SbiConstExpression( this );
+ SbxDataType eType2 = pDefaultExpr->GetType();
- pPar->SetDefaultId( nStringId );
- delete pDefaultExpr;
+ sal_uInt16 nStringId;
+ if( eType2 == SbxSTRING )
+ {
+ nStringId = aGblStrings.Add( pDefaultExpr->GetString() );
+ }
+ else
+ {
+ nStringId = aGblStrings.Add( pDefaultExpr->GetValue(), eType2 );
+ }
+ pPar->SetDefaultId( nStringId );
+ delete pDefaultExpr;
- eTok = Next();
- if( eTok == COMMA || eTok == RPAREN )
- bError2 = false;
+ eTok = Next();
+ if( eTok == COMMA || eTok == RPAREN )
+ {
+ bError2 = false;
+ }
+ }
+ if( bError2 )
+ {
+ Error( SbERR_EXPECTED, RPAREN );
+ break;
+ }
}
- if( bError2 )
+ if( eTok == RPAREN )
{
- Error( SbERR_EXPECTED, RPAREN );
break;
}
}
- if( eTok == RPAREN )
- break;
}
}
TypeDecl( *pDef );
@@ -972,7 +1013,7 @@ void SbiParser::DefDeclare( bool bPrivate )
SbiProcDef* pDef = ProcDecl( true );
if( pDef )
{
- if( !pDef->GetLib().Len() )
+ if( pDef->GetLib().isEmpty() )
{
Error( SbERR_EXPECTED, LIB );
}
@@ -1002,7 +1043,7 @@ void SbiParser::DefDeclare( bool bPrivate )
pDef->SetPublic( !bPrivate );
// New declare handling
- if( pDef->GetLib().Len() > 0 )
+ if( !pDef->GetLib().isEmpty())
{
if( bNewGblDefs && nGblChain == 0 )
{
@@ -1051,7 +1092,7 @@ void SbiParser::DefDeclare( bool bPrivate )
SbiOpcode eOp = pDef->IsCdecl() ? _CALLC : _CALL;
sal_uInt16 nId = pDef->GetId();
- if( pDef->GetAlias().Len() )
+ if( !pDef->GetAlias().isEmpty() )
{
nId = ( nId & 0x8000 ) | aGblStrings.Add( pDef->GetAlias() );
}
diff --git a/basic/source/comp/exprgen.cxx b/basic/source/comp/exprgen.cxx
index 13ce100fe1cb..357809757c5a 100644
--- a/basic/source/comp/exprgen.cxx
+++ b/basic/source/comp/exprgen.cxx
@@ -216,7 +216,7 @@ void SbiExprList::Gen()
for( SbiExpression* pExpr = pFirst; pExpr; pExpr = pExpr->pNext,nCount++ )
{
pExpr->Gen();
- if( pExpr->GetName().Len() )
+ if( !pExpr->GetName().isEmpty() )
{
// named arg
sal_uInt16 nSid = pParser->aGblStrings.Add( pExpr->GetName() );
diff --git a/basic/source/comp/exprnode.cxx b/basic/source/comp/exprnode.cxx
index a863413a65ba..10c98942d492 100644
--- a/basic/source/comp/exprnode.cxx
+++ b/basic/source/comp/exprnode.cxx
@@ -53,7 +53,7 @@ SbiExprNode::SbiExprNode( SbiParser* p, double n, SbxDataType t )
nVal = n;
}
-SbiExprNode::SbiExprNode( SbiParser* p, const String& rVal )
+SbiExprNode::SbiExprNode( SbiParser* p, const OUString& rVal )
{
BaseInit( p );
@@ -256,8 +256,8 @@ void SbiExprNode::FoldConstants()
eType = SbxSTRING;
if( eType == SbxSTRING )
{
- String rl( pLeft->GetString() );
- String rr( pRight->GetString() );
+ OUString rl( pLeft->GetString() );
+ OUString rr( pRight->GetString() );
delete pLeft; pLeft = NULL;
delete pRight; pRight = NULL;
if( eTok == PLUS || eTok == CAT )
@@ -273,30 +273,31 @@ void SbiExprNode::FoldConstants()
{
eType = SbxDOUBLE;
eNodeType = SbxNUMVAL;
- StringCompare eRes = rr.CompareTo( rl );
+ int eRes = rr.compareTo( rl );
switch( eTok )
{
- case EQ:
- nVal = ( eRes == COMPARE_EQUAL ) ? SbxTRUE : SbxFALSE;
- break;
- case NE:
- nVal = ( eRes != COMPARE_EQUAL ) ? SbxTRUE : SbxFALSE;
- break;
- case LT:
- nVal = ( eRes == COMPARE_LESS ) ? SbxTRUE : SbxFALSE;
- break;
- case GT:
- nVal = ( eRes == COMPARE_GREATER ) ? SbxTRUE : SbxFALSE;
- break;
- case LE:
- nVal = ( eRes != COMPARE_GREATER ) ? SbxTRUE : SbxFALSE;
- break;
- case GE:
- nVal = ( eRes != COMPARE_LESS ) ? SbxTRUE : SbxFALSE;
- break;
- default:
- pGen->GetParser()->Error( SbERR_CONVERSION );
- bError = true;
+ case EQ:
+ nVal = ( eRes == 0 ) ? SbxTRUE : SbxFALSE;
+ break;
+ case NE:
+ nVal = ( eRes != 0 ) ? SbxTRUE : SbxFALSE;
+ break;
+ case LT:
+ nVal = ( eRes < 0 ) ? SbxTRUE : SbxFALSE;
+ break;
+ case GT:
+ nVal = ( eRes > 0 ) ? SbxTRUE : SbxFALSE;
+ break;
+ case LE:
+ nVal = ( eRes <= 0 ) ? SbxTRUE : SbxFALSE;
+ break;
+ case GE:
+ nVal = ( eRes >= 0 ) ? SbxTRUE : SbxFALSE;
+ break;
+ default:
+ pGen->GetParser()->Error( SbERR_CONVERSION );
+ bError = true;
+ break;
}
}
}
diff --git a/basic/source/comp/exprtree.cxx b/basic/source/comp/exprtree.cxx
index 33857568b8bc..1037e77e190f 100644
--- a/basic/source/comp/exprtree.cxx
+++ b/basic/source/comp/exprtree.cxx
@@ -116,9 +116,8 @@ static sal_Bool DoParametersFollow( SbiParser* p, SbiExprType eCurExpr, SbiToken
// definition of a new symbol
-static SbiSymDef* AddSym
- ( SbiToken eTok, SbiSymPool& rPool, SbiExprType eCurExpr,
- const String& rName, SbxDataType eType, SbiParameters* pPar )
+static SbiSymDef* AddSym ( SbiToken eTok, SbiSymPool& rPool, SbiExprType eCurExpr,
+ const OUString& rName, SbxDataType eType, SbiParameters* pPar )
{
SbiSymDef* pDef;
// A= is not a procedure
@@ -145,12 +144,13 @@ static SbiSymDef* AddSym
if( pPar )
{
// generate dummy parameters
- sal_uInt16 n = 1;
+ sal_Int32 n = 1;
for( short i = 0; i < pPar->GetSize(); i++ )
{
- String aPar = rtl::OUString("PAR");
- aPar += ++n;
- pProc->GetParams().AddSym( aPar );
+ n += 1;
+ OUStringBuffer aPar("PAR");
+ aPar.append(n);
+ pProc->GetParams().AddSym( aPar.makeStringAndClear() );
}
}
}
@@ -196,7 +196,7 @@ SbiExprNode* SbiExpression::Term( const KeywordSymbolInfo* pKeywordSymbolInfo )
SbiToken eTok = (pKeywordSymbolInfo == NULL) ? pParser->Next() : pKeywordSymbolInfo->m_eTok;
// memorize the parsing's begin
pParser->LockColumn();
- String aSym( (pKeywordSymbolInfo == NULL) ? pParser->GetSym() : pKeywordSymbolInfo->m_aKeywordSymbol );
+ OUString aSym( (pKeywordSymbolInfo == NULL) ? pParser->GetSym() : pKeywordSymbolInfo->m_aKeywordSymbol );
SbxDataType eType = (pKeywordSymbolInfo == NULL) ? pParser->GetType() : pKeywordSymbolInfo->m_eSbxDataType;
SbiParameters* pPar = NULL;
SbiExprListVector* pvMoreParLcl = NULL;
@@ -332,10 +332,12 @@ SbiExprNode* SbiExpression::Term( const KeywordSymbolInfo* pKeywordSymbolInfo )
bError = true;
}
else if ( eType == SbxVARIANT )
+ {
// if there's nothing named, take the type of the entry,
// but only if the var hasn't been defined with AS XXX
// so that we catch n% = 5 : print n
eType = eDefType;
+ }
}
// checking type of variables:
// is there named anything different in the scanner?
@@ -360,7 +362,9 @@ SbiExprNode* SbiExpression::Term( const KeywordSymbolInfo* pKeywordSymbolInfo )
}
SbiExprNode* pNd = new SbiExprNode( pParser, *pDef, eType );
if( !pPar )
+ {
pPar = new SbiParameters( pParser,sal_False,sal_False );
+ }
pNd->aVar.pPar = pPar;
pNd->aVar.pvMorePar = pvMoreParLcl;
if( bObj )
@@ -409,9 +413,10 @@ SbiExprNode* SbiExpression::ObjTerm( SbiSymDef& rObj )
}
if( bError )
+ {
return NULL;
-
- String aSym( pParser->GetSym() );
+ }
+ OUString aSym( pParser->GetSym() );
SbxDataType eType = pParser->GetType();
SbiParameters* pPar = NULL;
SbiExprListVector* pvMoreParLcl = NULL;
@@ -609,7 +614,7 @@ SbiExprNode* SbiExpression::Unary()
bool bUsedForTypeOf = true;
SbiExprNode* pObjNode = Operand( bUsedForTypeOf );
pParser->TestToken( IS );
- String aDummy;
+ OUString aDummy;
SbiSymDef* pTypeDef = new SbiSymDef( aDummy );
pParser->TypeDecl( *pTypeDef, sal_True );
pNd = new SbiExprNode( pParser, pObjNode, pTypeDef->GetTypeId() );
@@ -618,7 +623,7 @@ SbiExprNode* SbiExpression::Unary()
case NEW:
{
pParser->Next();
- String aStr;
+ OUString aStr;
SbiSymDef* pTypeDef = new SbiSymDef( aStr );
pParser->TypeDecl( *pTypeDef, sal_True );
pNd = new SbiExprNode( pParser, pTypeDef->GetTypeId() );
@@ -739,10 +744,14 @@ SbiExprNode* SbiExpression::Comp()
{
SbiToken eTok = pParser->Peek();
if( m_eMode == EXPRMODE_ARRAY_OR_OBJECT )
+ {
break;
- if( eTok != EQ && eTok != NE && eTok != LT
- && eTok != GT && eTok != LE && eTok != GE )
+ }
+ if( eTok != EQ && eTok != NE && eTok != LT &&
+ eTok != GT && eTok != LE && eTok != GE )
+ {
break;
+ }
eTok = pParser->Next();
pNd = new SbiExprNode( pParser, pNd, eTok, Cat() );
nCount++;
@@ -775,7 +784,8 @@ SbiExprNode* SbiExpression::Like()
if( m_eMode != EXPRMODE_EMPTY_PAREN )
{
short nCount = 0;
- while( pParser->Peek() == LIKE ) {
+ while( pParser->Peek() == LIKE )
+ {
SbiToken eTok = pParser->Next();
pNd = new SbiExprNode( pParser, pNd, eTok, Comp() ), nCount++;
}
@@ -797,9 +807,12 @@ SbiExprNode* SbiExpression::Boolean()
for( ;; )
{
SbiToken eTok = pParser->Peek();
- if( eTok != AND && eTok != OR && eTok != XOR
- && eTok != EQV && eTok != IMP && eTok != IS )
+ if( (eTok != AND) && (eTok != OR) &&
+ (eTok != XOR) && (eTok != EQV) &&
+ (eTok != IMP) && (eTok != IS) )
+ {
break;
+ }
eTok = pParser->Next();
pNd = new SbiExprNode( pParser, pNd, eTok, Like() );
}
@@ -837,12 +850,12 @@ SbiConstExpression::SbiConstExpression( SbiParser* p ) : SbiExpression( p )
SbiSymDef* pVarDef = pExpr->GetVar();
sal_Bool bBoolVal = sal_False;
- if( pVarDef->GetName().EqualsIgnoreCaseAscii( "true" ) )
+ if( pVarDef->GetName().equalsIgnoreAsciiCase( "true" ) )
{
bIsBool = sal_True;
bBoolVal = sal_True;
}
- else if( pVarDef->GetName().EqualsIgnoreCaseAscii( "false" ) )
+ else if( pVarDef->GetName().equalsIgnoreAsciiCase( "false" ) )
//else if( pVarDef->GetName().ICompare( "false" ) == COMPARE_EQUAL )
{
bIsBool = sal_True;
@@ -1002,15 +1015,17 @@ SbiParameters::SbiParameters( SbiParser* p, bool bStandaloneExpression, bool bPa
if( ( bBracket && eTok == RPAREN ) || pParser->IsEoln( eTok ) )
{
if( eTok == RPAREN )
+ {
pParser->Next();
+ }
return;
}
// read in parameter table and lay down in correct order!
SbiExpression* pLast = NULL;
- String aName;
+ OUString aName;
while( !bError )
{
- aName.Erase();
+ aName = "";
// missing argument
if( eTok == COMMA )
{
diff --git a/basic/source/comp/loops.cxx b/basic/source/comp/loops.cxx
index 51953e068ca9..388911be93c7 100644
--- a/basic/source/comp/loops.cxx
+++ b/basic/source/comp/loops.cxx
@@ -458,8 +458,8 @@ done:
void SbiParser::On()
{
SbiToken eTok = Peek();
- String aString = SbiTokenizer::Symbol(eTok);
- if (aString.EqualsIgnoreCaseAscii("ERROR"))
+ OUString aString = SbiTokenizer::Symbol(eTok);
+ if (aString.equalsIgnoreAsciiCase("ERROR"))
{
eTok = _ERROR_; // Error comes as SYMBOL
}
diff --git a/basic/source/comp/parser.cxx b/basic/source/comp/parser.cxx
index 587b478fcf9e..a4a4501077d9 100644
--- a/basic/source/comp/parser.cxx
+++ b/basic/source/comp/parser.cxx
@@ -155,7 +155,7 @@ SbiParser::SbiParser( StarBASIC* pb, SbModule* pm )
// part of the runtime-library?
-SbiSymDef* SbiParser::CheckRTLForSym( const String& rSym, SbxDataType eType )
+SbiSymDef* SbiParser::CheckRTLForSym( const OUString& rSym, SbxDataType eType )
{
SbxVariable* pVar = GetBasic()->GetRtl()->Find( rSym, SbxCLASS_DONTCARE );
SbiSymDef* pDef = NULL;
@@ -495,8 +495,8 @@ void SbiParser::Symbol( const KeywordSymbolInfo* pKeywordSymbolInfo )
SbiSymDef* pDef = aVar.GetRealVar();
if( bEQ && pDef && pDef->GetScope() == SbRTL )
{
- String aRtlName = pDef->GetName();
- if( aRtlName.EqualsIgnoreCaseAscii("Mid") )
+ OUString aRtlName = pDef->GetName();
+ if( aRtlName.equalsIgnoreAsciiCase("Mid") )
{
SbiExprNode* pExprNode = aVar.GetExprNode();
if( pExprNode && pExprNode->GetNodeType() == SbxVARVAL )
@@ -588,7 +588,7 @@ void SbiParser::Set()
if( eTok == NEW )
{
Next();
- String aStr;
+ OUString aStr;
SbiSymDef* pTypeDef = new SbiSymDef( aStr );
TypeDecl( *pTypeDef, sal_True );
@@ -715,11 +715,11 @@ void SbiParser::Implements()
return;
}
- String aImplementedIface = aSym;
+ OUString aImplementedIface = aSym;
Next();
if( Peek() == DOT )
{
- rtl::OUString aDotStr( '.' );
+ OUString aDotStr( '.' );
while( Peek() == DOT )
{
aImplementedIface += aDotStr;
@@ -769,9 +769,11 @@ void SbiParser::Option()
break;
case PRIVATE:
{
- String aString = SbiTokenizer::Symbol(Next());
- if( !aString.EqualsIgnoreCaseAscii("Module") )
+ OUString aString = SbiTokenizer::Symbol(Next());
+ if( !aString.equalsIgnoreAsciiCase("Module") )
+ {
Error( SbERR_EXPECTED, "Module" );
+ }
break;
}
case COMPARE:
@@ -825,9 +827,9 @@ void SbiParser::Option()
}
}
-void addStringConst( SbiSymPool& rPool, const char* pSym, const String& rStr )
+void addStringConst( SbiSymPool& rPool, const char* pSym, const OUString& rStr )
{
- SbiConstDef* pConst = new SbiConstDef( rtl::OUString::createFromAscii( pSym ) );
+ SbiConstDef* pConst = new SbiConstDef( OUString::createFromAscii( pSym ) );
pConst->SetType( SbxSTRING );
pConst->Set( rStr );
rPool.Add( pConst );
@@ -855,8 +857,7 @@ void SbiParser::AddConstants( void )
addStringConst( aPublics, "vbVerticalTab", "\x0B" );
// Force length 1 and make char 0 afterwards
- String aNullCharStr( rtl::OUString(" ") );
- aNullCharStr.SetChar( 0, 0 );
+ OUString aNullCharStr((sal_Unicode)0);
addStringConst( aPublics, "vbNullChar", aNullCharStr );
}
diff --git a/basic/source/comp/sbcomp.cxx b/basic/source/comp/sbcomp.cxx
index a9288d3d1d2a..45c94148529c 100644
--- a/basic/source/comp/sbcomp.cxx
+++ b/basic/source/comp/sbcomp.cxx
@@ -257,7 +257,7 @@ const char* lcl_getSpaces( int nSpaceCount )
return pSpacesEnd - nSpaceCount;
}
-static rtl::OString lcl_toOStringSkipLeadingWhites( const String& aStr )
+static rtl::OString lcl_toOStringSkipLeadingWhites( const OUString& aStr )
{
static sal_Char Buffer[1000];
@@ -282,7 +282,7 @@ static rtl::OString lcl_toOStringSkipLeadingWhites( const String& aStr )
String lcl_dumpMethodParameters( SbMethod* pMethod )
{
- String aStr;
+ OUString aStr;
if( pMethod == NULL )
{
return aStr;
@@ -299,7 +299,7 @@ String lcl_dumpMethodParameters( SbMethod* pMethod )
{
SbxVariable* pVar = pParams->Get( nParam );
DBG_ASSERT( pVar, "Parameter?!" );
- if ( pVar->GetName().Len() )
+ if ( !pVar->GetName().isEmpty() )
{
aStr += pVar->GetName();
}
@@ -314,11 +314,17 @@ String lcl_dumpMethodParameters( SbMethod* pMethod )
aStr += '=';
SbxDataType eType = pVar->GetType();
if( eType & SbxARRAY )
- aStr += String( RTL_CONSTASCII_USTRINGPARAM( "..." ) );
+ {
+ aStr += "...";
+ }
else if( eType != SbxOBJECT )
+ {
aStr += pVar->GetString();
+ }
if ( nParam < ( pParams->Count() - 1 ) )
- aStr += String( RTL_CONSTASCII_USTRINGPARAM( ", " ) );
+ {
+ aStr += ", ";
+ }
}
aStr += ')';
}
@@ -344,7 +350,7 @@ static bool GbBlockAll = false;
struct FunctionItem
{
- String m_aCompleteFunctionName;
+ OUString m_aCompleteFunctionName;
double m_dTotalTime;
double m_dNetTime;
int m_nCallCount;
@@ -405,7 +411,7 @@ void lcl_printTimeOutput( void )
FunctionItem* pFunctionItem = *itv;
if( pFunctionItem != NULL )
{
- rtl::OUString aCompleteFunctionName = pFunctionItem->m_aCompleteFunctionName;
+ OUString aCompleteFunctionName = pFunctionItem->m_aCompleteFunctionName;
const char* pName = OUStringToOString( aCompleteFunctionName, RTL_TEXTENCODING_ASCII_US ).getStr();
int nNameLen = aCompleteFunctionName.getLength();
@@ -512,7 +518,7 @@ void dbg_DeInitTrace( void )
static sal_Int32 GnLastCallLvl = 0;
-void dbg_tracePrint( const String& aStr, sal_Int32 nCallLvl, bool bCallLvlRelativeToCurrent )
+void dbg_tracePrint( const OUString& aStr, sal_Int32 nCallLvl, bool bCallLvlRelativeToCurrent )
{
if( bCallLvlRelativeToCurrent )
{
@@ -554,7 +560,7 @@ void dbg_traceStep( SbModule* pModule, sal_uInt32 nPC, sal_Int32 nCallLvl )
pTraceMod = pClassModuleObj->getClassModule();
}
- String aModuleName = pTraceMod->GetName();
+ OUString aModuleName = pTraceMod->GetName();
ModuleTraceMap::iterator it = rModuleTraceMap.find( aModuleName );
if( it == rModuleTraceMap.end() )
{
@@ -663,16 +669,16 @@ void dbg_traceNotifyCall( SbModule* pModule, SbMethod* pMethod, sal_Int32 nCallL
pTraceMod = pClassModuleObj->getClassModule();
}
- String aCompleteFunctionName = pTraceMod->GetName();
+ OUString aCompleteFunctionName = pTraceMod->GetName();
if( pMethod != NULL )
{
- aCompleteFunctionName.AppendAscii( "::" );
- String aMethodName = pMethod->GetName();
+ aCompleteFunctionName += "::";
+ OUString aMethodName = pMethod->GetName();
aCompleteFunctionName += aMethodName;
}
else
{
- aCompleteFunctionName.AppendAscii( "/RunInit" );
+ aCompleteFunctionName += "/RunInit";
}
bool bOwnBlockSteps = false;
@@ -761,27 +767,28 @@ void dbg_traceNotifyCall( SbModule* pModule, SbMethod* pMethod, sal_Int32 nCallL
lcl_lineOut( pSeparator, lcl_getSpaces( nIndent ) );
}
- String aStr;
+ OUString aStr;
if( bLeave )
{
if( !bOwnBlockSteps )
{
lcl_lineOut( "}", lcl_getSpaces( nIndent ) );
- aStr.AppendAscii( "' Leaving " );
+ aStr = "' Leaving ";
}
}
else
{
- aStr.AppendAscii( "Entering " );
+ aStr = "Entering " ;
}
if( !bLeave || !bOwnBlockSteps )
+ {
aStr += aCompleteFunctionName;
-
+ }
if( !bOwnBlockSteps && pClassModuleObj != NULL )
{
- aStr.AppendAscii( "[this=" );
+ aStr += "[this=";
aStr += pClassModuleObj->GetName();
- aStr.AppendAscii( "]" );
+ aStr += "]" ;
}
if( !bLeave )
{
@@ -814,7 +821,8 @@ void dbg_traceNotifyCall( SbModule* pModule, SbMethod* pMethod, sal_Int32 nCallL
#endif
}
-void dbg_traceNotifyError( SbError nTraceErr, const String& aTraceErrMsg, bool bTraceErrHandled, sal_Int32 nCallLvl )
+void dbg_traceNotifyError( SbError nTraceErr, const OUString& aTraceErrMsg,
+ bool bTraceErrHandled, sal_Int32 nCallLvl )
{
if( !GbTraceOn )
{
@@ -838,9 +846,9 @@ void dbg_traceNotifyError( SbError nTraceErr, const String& aTraceErrMsg, bool b
}
void dbg_RegisterTraceTextForPC( SbModule* pModule, sal_uInt32 nPC,
- const String& aTraceStr_STMNT, const String& aTraceStr_PCode )
+ const OUString& aTraceStr_STMNT, const OUString& aTraceStr_PCode )
{
- String aModuleName = pModule->GetName();
+ OUString aModuleName = pModule->GetName();
ModuleTraceMap::iterator it = rModuleTraceMap.find( aModuleName );
PCToTextDataMap* pInnerMap;
if( it == rModuleTraceMap.end() )
@@ -875,21 +883,25 @@ void RTL_Impl_TraceCommand( StarBASIC* pBasic, SbxArray& rPar, sal_Bool bWrite )
return;
}
- String aCommand = rPar.Get(1)->GetString();
+ OUString aCommand = rPar.Get(1)->GetString();
- if( aCommand.EqualsIgnoreCaseAscii( "TraceOn" ) )
+ if( aCommand.equalsIngoreAsciiCase( "TraceOn" ) )
+ {
GbTraceOn = true;
- else
- if( aCommand.EqualsIgnoreCaseAscii( "TraceOff" ) )
+ }
+ else if( aCommand.equalsIngoreAsciiCase( "TraceOff" ) )
+ {
GbTraceOn = false;
- else
- if( aCommand.EqualsIgnoreCaseAscii( "PCodeOn" ) )
+ }
+ else if( aCommand.equalsIngoreAsciiCase( "PCodeOn" ) )
+ {
GbIncludePCodes = true;
- else
- if( aCommand.EqualsIgnoreCaseAscii( "PCodeOff" ) )
+ }
+ else if( aCommand.equalsIngoreAsciiCase( "PCodeOff" ) )
+ {
GbIncludePCodes = false;
- else
- if( aCommand.EqualsIgnoreCaseAscii( "Print" ) )
+ }
+ else if( aCommand.equalsIngoreAsciiCase( "Print" ) )
{
if ( rPar.Count() < 3 )
{
@@ -901,11 +913,11 @@ void RTL_Impl_TraceCommand( StarBASIC* pBasic, SbxArray& rPar, sal_Bool bWrite )
if( eOld != SbxERR_OK )
SbxBase::ResetError();
- String aValStr = rPar.Get(2)->GetString();
+ OUString aValStr = rPar.Get(2)->GetString();
SbxError eErr = SbxBase::GetError();
if( eErr != SbxERR_OK )
{
- aValStr = String( RTL_CONSTASCII_USTRINGPARAM( "<ERROR converting value to String>" ) );
+ aValStr = "<ERROR converting value to String>";
SbxBase::ResetError();
}
diff --git a/basic/source/comp/symtbl.cxx b/basic/source/comp/symtbl.cxx
index 4c550497a423..005ae381ebcc 100644
--- a/basic/source/comp/symtbl.cxx
+++ b/basic/source/comp/symtbl.cxx
@@ -51,12 +51,12 @@ const rtl::OUString& SbiStringPool::Find( sal_uInt32 n ) const
return aData[n - 1];
}
-short SbiStringPool::Add( const rtl::OUString& rVal, bool bNoCase )
+short SbiStringPool::Add( const OUString& rVal, bool bNoCase )
{
sal_uInt32 n = aData.size();
for( sal_uInt32 i = 0; i < n; ++i )
{
- rtl::OUString& p = aData[i];
+ OUString& p = aData[i];
if( ( bNoCase && p == rVal )
|| ( !bNoCase && p.equalsIgnoreAsciiCase( rVal ) ) )
return i+1;
@@ -114,7 +114,7 @@ SbiSymDef* SbiSymPool::Next()
}
-SbiSymDef* SbiSymPool::AddSym( const String& rName )
+SbiSymDef* SbiSymPool::AddSym( const OUString& rName )
{
SbiSymDef* p = new SbiSymDef( rName );
p->nPos = aData.size();
@@ -125,7 +125,7 @@ SbiSymDef* SbiSymPool::AddSym( const String& rName )
return p;
}
-SbiProcDef* SbiSymPool::AddProc( const String& rName )
+SbiProcDef* SbiSymPool::AddProc( const OUString& rName )
{
SbiProcDef* p = new SbiProcDef( pParser, rName );
p->nPos = aData.size();
@@ -157,11 +157,11 @@ void SbiSymPool::Add( SbiSymDef* pDef )
{
// A unique name must be created in the string pool
// for static variables (Form ProcName:VarName)
- String aName( pDef->aName );
+ OUString aName( pDef->aName );
if( pDef->IsStatic() )
{
aName = pParser->aGblStrings.Find( nProcId );
- aName += ':';
+ aName += ":";
aName += pDef->aName;
}
pDef->nId = rStrings.Add( aName );
@@ -177,15 +177,17 @@ void SbiSymPool::Add( SbiSymDef* pDef )
}
-SbiSymDef* SbiSymPool::Find( const String& rName ) const
+SbiSymDef* SbiSymPool::Find( const OUString& rName ) const
{
sal_uInt16 nCount = aData.size();
for( sal_uInt16 i = 0; i < nCount; i++ )
{
SbiSymDef* p = aData[ nCount - i - 1 ];
- if( ( !p->nProcId || ( p->nProcId == nProcId ) )
- && ( p->aName.EqualsIgnoreCaseAscii( rName ) ) )
+ if( ( !p->nProcId || ( p->nProcId == nProcId)) &&
+ ( p->aName.equalsIgnoreAsciiCase(rName)))
+ {
return p;
+ }
}
if( pParent )
{
@@ -232,7 +234,7 @@ SbiSymDef* SbiSymPool::Get( sal_uInt16 n ) const
}
}
-sal_uInt32 SbiSymPool::Define( const String& rName )
+sal_uInt32 SbiSymPool::Define( const OUString& rName )
{
SbiSymDef* p = Find( rName );
if( p )
@@ -249,7 +251,7 @@ sal_uInt32 SbiSymPool::Define( const String& rName )
return p->Define();
}
-sal_uInt32 SbiSymPool::Reference( const String& rName )
+sal_uInt32 SbiSymPool::Reference( const OUString& rName )
{
SbiSymDef* p = Find( rName );
if( !p )
@@ -280,7 +282,7 @@ void SbiSymPool::CheckRefs()
|*
***************************************************************************/
-SbiSymDef::SbiSymDef( const String& rName ) : aName( rName )
+SbiSymDef::SbiSymDef( const OUString& rName ) : aName( rName )
{
eType = SbxEMPTY;
nDims = 0;
@@ -322,7 +324,7 @@ SbiConstDef* SbiSymDef::GetConstDef()
}
-const String& SbiSymDef::GetName()
+const OUString& SbiSymDef::GetName()
{
if( pIn )
{
@@ -336,15 +338,20 @@ void SbiSymDef::SetType( SbxDataType t )
{
if( t == SbxVARIANT && pIn )
{
- sal_Unicode cu = aName.GetBuffer()[0];
+ sal_Unicode cu = aName[0];
if( cu < 256 )
{
- char ch = (char)aName.GetBuffer()[0];
- if( ch == '_' ) ch = 'Z';
+ char ch = (char)cu;
+ if( ch == '_' )
+ {
+ ch = 'Z';
+ }
int ch2 = toupper( ch );
unsigned char c = (unsigned char)ch2;
if( c > 0 && c < 128 )
+ {
t = pIn->pParser->eDefTypes[ ch2 - 'A' ];
+ }
}
}
eType = t;
@@ -369,7 +376,10 @@ sal_uInt32 SbiSymDef::Define()
{
sal_uInt32 n = pIn->pParser->aGen.GetPC();
pIn->pParser->aGen.GenStmnt();
- if( nChain ) pIn->pParser->aGen.BackChain( nChain );
+ if( nChain )
+ {
+ pIn->pParser->aGen.BackChain( nChain );
+ }
nChain = n;
bChained = true;
return nChain;
@@ -400,7 +410,7 @@ SbiSymScope SbiSymDef::GetScope() const
// 2) pPool: all local variables
// 3) aLabels: labels
-SbiProcDef::SbiProcDef( SbiParser* pParser, const String& rName,
+SbiProcDef::SbiProcDef( SbiParser* pParser, const OUString& rName,
bool bProcDecl )
: SbiSymDef( rName )
, aParams( pParser->aGblStrings, SbPARAM ) // is dumped
@@ -484,16 +494,13 @@ void SbiProcDef::setPropertyMode( PropertyMode ePropMode )
// CompleteProcName includes "Property xxx "
// to avoid conflicts with other symbols
- String aCompleteProcName;
- aCompleteProcName.AppendAscii( "Property " );
+ OUString aCompleteProcName = "Property ";
switch( mePropMode )
{
- case PROPERTY_MODE_GET: aCompleteProcName.AppendAscii( "Get " ); break;
- case PROPERTY_MODE_LET: aCompleteProcName.AppendAscii( "Let " ); break;
- case PROPERTY_MODE_SET: aCompleteProcName.AppendAscii( "Set " ); break;
- case PROPERTY_MODE_NONE:
- OSL_FAIL( "Illegal PropertyMode PROPERTY_MODE_NONE" );
- break;
+ case PROPERTY_MODE_GET: aCompleteProcName += "Get "; break;
+ case PROPERTY_MODE_LET: aCompleteProcName += "Let "; break;
+ case PROPERTY_MODE_SET: aCompleteProcName += "Set "; break;
+ case PROPERTY_MODE_NONE: OSL_FAIL( "Illegal PropertyMode PROPERTY_MODE_NONE" ); break;
}
aCompleteProcName += aName;
aName = aCompleteProcName;
@@ -502,7 +509,7 @@ void SbiProcDef::setPropertyMode( PropertyMode ePropMode )
-SbiConstDef::SbiConstDef( const String& rName )
+SbiConstDef::SbiConstDef( const OUString& rName )
: SbiSymDef( rName )
{
nVal = 0; eType = SbxINTEGER;
@@ -510,10 +517,10 @@ SbiConstDef::SbiConstDef( const String& rName )
void SbiConstDef::Set( double n, SbxDataType t )
{
- aVal.Erase(); nVal = n; eType = t;
+ aVal = ""; nVal = n; eType = t;
}
-void SbiConstDef::Set( const String& n )
+void SbiConstDef::Set( const OUString& n )
{
aVal = n; nVal = 0; eType = SbxSTRING;
}
diff --git a/basic/source/comp/token.cxx b/basic/source/comp/token.cxx
index 7ebcb17eeb43..a6054c19415a 100644
--- a/basic/source/comp/token.cxx
+++ b/basic/source/comp/token.cxx
@@ -452,7 +452,7 @@ special:
sal_uInt16 nOldCol = nCol;
sal_uInt16 nOldCol1 = nCol1;
sal_uInt16 nOldCol2 = nCol2;
- String aOldSym = aSym;
+ OUString aOldSym = aSym;
SaveLine(); // save pLine in the scanner
eCurTok = Peek();
diff --git a/basic/source/inc/buffer.hxx b/basic/source/inc/buffer.hxx
index 08a1f2f5f2df..5ac631a71e12 100644
--- a/basic/source/inc/buffer.hxx
+++ b/basic/source/inc/buffer.hxx
@@ -19,9 +19,8 @@
#ifndef _BUFFER_HXX
#define _BUFFER_HXX
-
+#include <rtl/ustring.hxx>
#include <tools/solar.h>
-#include <tools/string.hxx>
class SbiParser;
@@ -32,13 +31,13 @@ class SbiBuffer {
sal_uInt32 nOff;
sal_uInt32 nSize;
short nInc;
- bool Check( sal_uInt16 );
+ bool Check( sal_Int32 );
public:
SbiBuffer( SbiParser*, short ); // increment
~SbiBuffer();
void Patch( sal_uInt32, sal_uInt32 );
void Chain( sal_uInt32 );
- bool operator += (const String&); // save basic-string
+ bool operator += (const OUString&); // save basic-string
bool operator += (sal_Int8); // save character
bool operator += (sal_Int16); // save integer
bool operator += (sal_uInt8); // save character
diff --git a/basic/source/inc/errobject.hxx b/basic/source/inc/errobject.hxx
index db4433268ee9..2c59e478cd7e 100644
--- a/basic/source/inc/errobject.hxx
+++ b/basic/source/inc/errobject.hxx
@@ -28,7 +28,7 @@ class SbxErrObject : public SbUnoObject
class ErrObject* m_pErrObject;
com::sun::star::uno::Reference< ooo::vba::XErrObject > m_xErr;
- SbxErrObject( const String& aName_, const com::sun::star::uno::Any& aUnoObj_ );
+ SbxErrObject( const OUString& aName_, const com::sun::star::uno::Any& aUnoObj_ );
~SbxErrObject();
class ErrObject* getImplErrObject( void )
@@ -38,7 +38,7 @@ public:
static SbxVariableRef getErrObject();
static com::sun::star::uno::Reference< ooo::vba::XErrObject > getUnoErrObject();
- void setNumberAndDescription( ::sal_Int32 _number, const ::rtl::OUString& _description )
+ void setNumberAndDescription( ::sal_Int32 _number, const OUString& _description )
throw (com::sun::star::uno::RuntimeException);
};
#endif
diff --git a/basic/source/inc/expr.hxx b/basic/source/inc/expr.hxx
index 92a67b907aed..0b9eb229a795 100644
--- a/basic/source/inc/expr.hxx
+++ b/basic/source/inc/expr.hxx
@@ -46,7 +46,7 @@ struct SbVar {
struct KeywordSymbolInfo
{
- ::rtl::OUString m_aKeywordSymbol;
+ OUString m_aKeywordSymbol;
SbxDataType m_eSbxDataType;
SbiToken m_eTok;
};
@@ -94,7 +94,7 @@ class SbiExprNode { // operators (and operands)
double nVal; // numeric value
SbVar aVar; // or variable
};
- String aStrVal; // #i59791/#i45570 Store string directly
+ OUString aStrVal; // #i59791/#i45570 Store string directly
SbiExprNode* pLeft; // right branch
SbiExprNode* pRight; // right branch (NULL for unary ops)
SbiExprNode* pWithParent; // node, whose member is "this per with"
@@ -118,7 +118,7 @@ class SbiExprNode { // operators (and operands)
public:
SbiExprNode( void );
SbiExprNode( SbiParser*, double, SbxDataType );
- SbiExprNode( SbiParser*, const String& );
+ SbiExprNode( SbiParser*, const OUString& );
SbiExprNode( SbiParser*, const SbiSymDef&, SbxDataType, SbiExprList* = NULL );
SbiExprNode( SbiParser*, SbiExprNode*, SbiToken, SbiExprNode* );
SbiExprNode( SbiParser*, SbiExprNode*, sal_uInt16 ); // #120061 TypeOf
@@ -141,7 +141,7 @@ public:
SbiSymDef* GetRealVar(); // last variable in x.y.z
SbiExprNode* GetRealNode(); // last node in x.y.z
short GetDepth(); // compute a tree's depth
- const String& GetString() { return aStrVal; }
+ const OUString& GetString() { return aStrVal; }
short GetNumber() { return (short)nVal; }
SbiExprList* GetParameters() { return aVar.pPar; }
SbiExprListVector* GetMoreParameters() { return aVar.pvMorePar; }
@@ -156,7 +156,7 @@ class SbiExpression {
friend class SbiParameters;
friend class SbiDimList;
protected:
- String aArgName;
+ OUString aArgName;
SbiParser* pParser;
SbiExpression* pNext; // link at parameter lists
SbiExprNode* pExpr; // expression tree
@@ -187,7 +187,7 @@ public:
SbiExpression( SbiParser*, double, SbxDataType = SbxDOUBLE );
SbiExpression( SbiParser*, const SbiSymDef&, SbiExprList* = NULL );
~SbiExpression();
- String& GetName() { return aArgName; }
+ OUString& GetName() { return aArgName; }
void SetBased() { bBased = true; }
bool IsBased() { return bBased; }
void SetByVal() { bByVal = true; }
@@ -198,7 +198,7 @@ public:
bool IsVariable() { return pExpr->IsVariable(); }
bool IsLvalue() { return pExpr->IsLvalue(); }
bool IsIntConstant() { return pExpr->IsIntConst(); }
- const String& GetString() { return pExpr->GetString(); }
+ const OUString& GetString() { return pExpr->GetString(); }
SbiSymDef* GetVar() { return pExpr->GetVar(); }
SbiSymDef* GetRealVar() { return pExpr->GetRealVar(); }
SbiExprNode* GetExprNode() { return pExpr; }
@@ -209,12 +209,12 @@ public:
class SbiConstExpression : public SbiExpression {
double nVal;
- String aVal;
+ OUString aVal;
SbxDataType eType;
public: // numeric constant
SbiConstExpression( SbiParser* );
SbxDataType GetType() { return eType; }
- const String& GetString() { return aVal; }
+ const OUString& GetString() { return aVal; }
double GetValue() { return nVal; }
short GetShortValue();
};
diff --git a/basic/source/inc/image.hxx b/basic/source/inc/image.hxx
index 96474ad78ca1..42d19f97b675 100644
--- a/basic/source/inc/image.hxx
+++ b/basic/source/inc/image.hxx
@@ -32,32 +32,32 @@ class SbiImage {
SbxArrayRef rTypes; // User defined types
SbxArrayRef rEnums; // Enum types
- sal_uInt32* pStringOff; // StringId-Offsets
+ sal_uInt32* pStringOff; // StringId-Offsets
sal_Unicode* pStrings; // StringPool
char* pCode; // Code-Image
char* pLegacyPCode; // Code-Image
bool bError;
- sal_uInt16 nFlags;
+ sal_uInt16 nFlags;
short nStrings;
- sal_uInt32 nStringSize;
- sal_uInt32 nCodeSize;
- sal_uInt16 nLegacyCodeSize;
- sal_uInt16 nDimBase; // OPTION BASE value
+ sal_uInt32 nStringSize;
+ sal_uInt32 nCodeSize;
+ sal_uInt16 nLegacyCodeSize;
+ sal_uInt16 nDimBase; // OPTION BASE value
rtl_TextEncoding eCharSet;
// temporary management-variable:
short nStringIdx;
- sal_uInt32 nStringOff; // current Pos in the stringbuffer
+ sal_uInt32 nStringOff; // current Pos in the stringbuffer
// routines for the compiler:
void MakeStrings( short ); // establish StringPool
- void AddString( const String& );
+ void AddString( const OUString& );
void AddCode( char*, sal_uInt32 );
void AddType(SbxObject *);
void AddEnum(SbxObject *);
public:
- String aName; // macro name
- ::rtl::OUString aOUSource; // source code
- String aComment;
+ OUString aName; // macro name
+ OUString aOUSource; // source code
+ OUString aComment;
bool bInit;
bool bFirstInit;
@@ -71,21 +71,20 @@ public:
bool IsError() { return bError; }
const char* GetCode() const { return pCode; }
- sal_uInt32 GetCodeSize() const { return nCodeSize; }
- ::rtl::OUString& GetSource32() { return aOUSource; }
- sal_uInt16 GetBase() const { return nDimBase; }
- String GetString( short nId ) const;
- const SbxObject* FindType (String aTypeName) const;
+ sal_uInt32 GetCodeSize() const { return nCodeSize; }
+ OUString& GetSource32() { return aOUSource; }
+ sal_uInt16 GetBase() const { return nDimBase; }
+ OUString GetString( short nId ) const;
+ const SbxObject* FindType (OUString aTypeName) const;
SbxArrayRef GetEnums() { return rEnums; }
void SetFlag( sal_uInt16 n ) { nFlags |= n; }
- sal_uInt16 GetFlag( sal_uInt16 n ) const { return nFlags & n; }
- sal_uInt16 CalcLegacyOffset( sal_Int32 nOffset );
- sal_uInt32 CalcNewOffset( sal_Int16 nOffset );
+ sal_uInt16 GetFlag( sal_uInt16 n ) const { return nFlags & n; }
+ sal_uInt16 CalcLegacyOffset( sal_Int32 nOffset );
+ sal_uInt32 CalcNewOffset( sal_Int16 nOffset );
void ReleaseLegacyBuffer();
bool ExceedsLegacyLimits();
-
};
#define SBIMG_EXPLICIT 0x0001 // OPTION EXPLICIT is active
diff --git a/basic/source/inc/namecont.hxx b/basic/source/inc/namecont.hxx
index bfb867d3b360..5213510493fe 100644
--- a/basic/source/inc/namecont.hxx
+++ b/basic/source/inc/namecont.hxx
@@ -71,10 +71,10 @@ typedef ::cppu::WeakImplHelper3<
class NameContainer : public ::cppu::BaseMutex, public NameContainer_BASE
{
- typedef boost::unordered_map < ::rtl::OUString, sal_Int32, ::rtl::OUStringHash > NameContainerNameMap;
+ typedef boost::unordered_map < OUString, sal_Int32, ::rtl::OUStringHash > NameContainerNameMap;
NameContainerNameMap mHashMap;
- ::com::sun::star::uno::Sequence< ::rtl::OUString > mNames;
+ ::com::sun::star::uno::Sequence< OUString > mNames;
::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > mValues;
sal_Int32 mnElementCount;
@@ -103,29 +103,29 @@ public:
throw(::com::sun::star::uno::RuntimeException);
// Methods XNameAccess
- virtual ::com::sun::star::uno::Any SAL_CALL getByName( const ::rtl::OUString& aName )
+ virtual ::com::sun::star::uno::Any SAL_CALL getByName( const OUString& aName )
throw(::com::sun::star::container::NoSuchElementException,
::com::sun::star::lang::WrappedTargetException,
::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames( )
+ virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getElementNames( )
throw(::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName )
+ virtual sal_Bool SAL_CALL hasByName( const OUString& aName )
throw(::com::sun::star::uno::RuntimeException);
// Methods XNameReplace
- virtual void SAL_CALL replaceByName( const ::rtl::OUString& aName, const ::com::sun::star::uno::Any& aElement )
+ virtual void SAL_CALL replaceByName( const OUString& aName, const ::com::sun::star::uno::Any& aElement )
throw(::com::sun::star::lang::IllegalArgumentException,
::com::sun::star::container::NoSuchElementException,
::com::sun::star::lang::WrappedTargetException,
::com::sun::star::uno::RuntimeException);
// Methods XNameContainer
- virtual void SAL_CALL insertByName( const ::rtl::OUString& aName, const ::com::sun::star::uno::Any& aElement )
+ virtual void SAL_CALL insertByName( const OUString& aName, const ::com::sun::star::uno::Any& aElement )
throw(::com::sun::star::lang::IllegalArgumentException,
::com::sun::star::container::ElementExistException,
::com::sun::star::lang::WrappedTargetException,
::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL removeByName( const ::rtl::OUString& Name )
+ virtual void SAL_CALL removeByName( const OUString& Name )
throw(::com::sun::star::container::NoSuchElementException,
::com::sun::star::lang::WrappedTargetException,
::com::sun::star::uno::RuntimeException);
@@ -216,7 +216,7 @@ class SfxLibraryContainer : public SfxLibraryContainer_BASE, public ::utl::OEven
VBAScriptListenerContainer maVBAScriptListeners;
sal_Int32 mnRunningVBAScripts;
sal_Bool mbVBACompat;
- rtl::OUString msProjectName;
+ OUString msProjectName;
protected:
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > mxMSF;
::com::sun::star::uno::Reference< ::com::sun::star::ucb::XSimpleFileAccess2 > mxSFI;
@@ -231,12 +231,12 @@ protected:
bool mbOldInfoFormat;
bool mbOasis2OOoFormat;
- ::rtl::OUString maInitialDocumentURL;
- ::rtl::OUString maInfoFileName;
- ::rtl::OUString maOldInfoFileName;
- ::rtl::OUString maLibElementFileExtension;
- ::rtl::OUString maLibraryPath;
- ::rtl::OUString maLibrariesDir;
+ OUString maInitialDocumentURL;
+ OUString maInfoFileName;
+ OUString maOldInfoFileName;
+ OUString maLibElementFileExtension;
+ OUString maLibraryPath;
+ OUString maLibrariesDir;
::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > mxStorage;
BasicManager* mpBasMgr;
@@ -252,14 +252,14 @@ protected:
} meInitMode;
void implStoreLibrary( SfxLibrary* pLib,
- const ::rtl::OUString& aName,
+ const OUString& aName,
const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage );
// New variant for library export
void implStoreLibrary( SfxLibrary* pLib,
- const ::rtl::OUString& aName,
+ const OUString& aName,
const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage,
- const ::rtl::OUString& aTargetURL,
+ const OUString& aTargetURL,
const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XSimpleFileAccess2 > xToUseSFI,
const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& xHandler );
@@ -269,27 +269,27 @@ protected:
// New variant for library export
void implStoreLibraryIndexFile( SfxLibrary* pLib, const ::xmlscript::LibDescriptor& rLib,
const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage,
- const ::rtl::OUString& aTargetURL,
+ const OUString& aTargetURL,
const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XSimpleFileAccess2 > xToUseSFI );
bool implLoadLibraryIndexFile( SfxLibrary* pLib,
::xmlscript::LibDescriptor& rLib,
const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage,
- const ::rtl::OUString& aIndexFileName );
+ const OUString& aIndexFileName );
void implImportLibDescriptor( SfxLibrary* pLib, ::xmlscript::LibDescriptor& rLib );
// Methods to distinguish between deffirent library types
- virtual SfxLibrary* SAL_CALL implCreateLibrary( const ::rtl::OUString& aName ) = 0;
+ virtual SfxLibrary* SAL_CALL implCreateLibrary( const OUString& aName ) = 0;
virtual SfxLibrary* SAL_CALL implCreateLibraryLink
- ( const ::rtl::OUString& aName, const ::rtl::OUString& aLibInfoFileURL,
- const ::rtl::OUString& StorageURL, sal_Bool ReadOnly ) = 0;
+ ( const OUString& aName, const OUString& aLibInfoFileURL,
+ const OUString& StorageURL, sal_Bool ReadOnly ) = 0;
virtual ::com::sun::star::uno::Any SAL_CALL createEmptyLibraryElement( void ) = 0;
virtual bool SAL_CALL isLibraryElementValid( ::com::sun::star::uno::Any aElement ) const = 0;
virtual void SAL_CALL writeLibraryElement
(
const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer>& xLibrary,
- const ::rtl::OUString& aElementName,
+ const OUString& aElementName,
const ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >& xOutput
)
throw(::com::sun::star::uno::Exception) = 0;
@@ -297,22 +297,22 @@ protected:
virtual ::com::sun::star::uno::Any SAL_CALL importLibraryElement
(
const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer>& xLibrary,
- const ::rtl::OUString& aElementName,
- const ::rtl::OUString& aFile,
+ const OUString& aElementName,
+ const OUString& aFile,
const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xElementStream ) = 0;
- virtual void SAL_CALL importFromOldStorage( const ::rtl::OUString& aFile ) = 0;
+ virtual void SAL_CALL importFromOldStorage( const OUString& aFile ) = 0;
// Password encryption
- virtual sal_Bool implStorePasswordLibrary( SfxLibrary* pLib, const ::rtl::OUString& aName,
+ virtual sal_Bool implStorePasswordLibrary( SfxLibrary* pLib, const OUString& aName,
const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage, const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& Handler );
// New variant for library export
- virtual sal_Bool implStorePasswordLibrary( SfxLibrary* pLib, const ::rtl::OUString& aName,
+ virtual sal_Bool implStorePasswordLibrary( SfxLibrary* pLib, const OUString& aName,
const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage,
- const ::rtl::OUString& aTargetURL,
+ const OUString& aTargetURL,
const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XSimpleFileAccess2 > xToUseSFI, const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& Handler );
- virtual sal_Bool implLoadPasswordLibrary( SfxLibrary* pLib, const ::rtl::OUString& Name,
+ virtual sal_Bool implLoadPasswordLibrary( SfxLibrary* pLib, const OUString& Name,
sal_Bool bVerifyPasswordOnly=false )
throw(::com::sun::star::lang::WrappedTargetException,
::com::sun::star::uno::RuntimeException);
@@ -327,9 +327,9 @@ protected:
// Interface to get the BasicManager (Hack for password implementation)
BasicManager* getBasicManager( void );
- ::rtl::OUString createAppLibraryFolder( SfxLibrary* pLib, const ::rtl::OUString& aName );
+ OUString createAppLibraryFolder( SfxLibrary* pLib, const OUString& aName );
- void init( const ::rtl::OUString& rInitialDocumentURL,
+ void init( const OUString& rInitialDocumentURL,
const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& _rxInitialStorage );
virtual const sal_Char* SAL_CALL getInfoFileName() const = 0;
@@ -340,21 +340,21 @@ protected:
// Handle maLibInfoFileURL and maStorageURL correctly
void checkStorageURL
(
- const ::rtl::OUString& aSourceURL,
- ::rtl::OUString& aLibInfoFileURL,
- ::rtl::OUString& aStorageURL,
- ::rtl::OUString& aUnexpandedStorageURL
+ const OUString& aSourceURL,
+ OUString& aLibInfoFileURL,
+ OUString& aStorageURL,
+ OUString& aUnexpandedStorageURL
);
- ::rtl::OUString expand_url( const ::rtl::OUString& url )
+ OUString expand_url( const OUString& url )
throw(::com::sun::star::uno::RuntimeException);
- SfxLibrary* getImplLib( const String& rLibraryName );
+ SfxLibrary* getImplLib( const OUString& rLibraryName );
void storeLibraries_Impl(
const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage,
bool bComplete );
- void SAL_CALL initializeFromDocumentURL( const ::rtl::OUString& _rInitialDocumentURL );
+ void SAL_CALL initializeFromDocumentURL( const OUString& _rInitialDocumentURL );
void SAL_CALL initializeFromDocument( const ::com::sun::star::uno::Reference< ::com::sun::star::document::XStorageBasedDocument >& _rxDocument );
// OEventListenerAdapter
@@ -364,7 +364,7 @@ protected:
virtual void SAL_CALL disposing();
private:
- void init_Impl( const ::rtl::OUString& rInitialDocumentURL,
+ void init_Impl( const OUString& rInitialDocumentURL,
const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& _rxInitialStorage );
void implScanExtensions( void );
@@ -391,13 +391,13 @@ public:
throw(::com::sun::star::uno::RuntimeException);
// Methods XNameAccess
- virtual ::com::sun::star::uno::Any SAL_CALL getByName( const ::rtl::OUString& aName )
+ virtual ::com::sun::star::uno::Any SAL_CALL getByName( const OUString& aName )
throw(::com::sun::star::container::NoSuchElementException,
::com::sun::star::lang::WrappedTargetException,
::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames()
+ virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getElementNames()
throw(::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName )
+ virtual sal_Bool SAL_CALL hasByName( const OUString& aName )
throw(::com::sun::star::uno::RuntimeException);
// Members XStorageBasedLibraryContainer
@@ -413,53 +413,53 @@ public:
// Methods XPersistentLibraryContainer (base of XStorageBasedLibraryContainer)
virtual ::com::sun::star::uno::Any SAL_CALL getRootLocation() throw (::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getContainerLocationName() throw (::com::sun::star::uno::RuntimeException);
+ virtual OUString SAL_CALL getContainerLocationName() throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL storeLibraries( ) throw (::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
//Methods XLibraryContainer3
- virtual ::rtl::OUString SAL_CALL getOriginalLibraryLinkURL( const ::rtl::OUString& Name )
+ virtual OUString SAL_CALL getOriginalLibraryLinkURL( const OUString& Name )
throw (::com::sun::star::lang::IllegalArgumentException,
::com::sun::star::container::NoSuchElementException,
::com::sun::star::uno::RuntimeException);
// Methods XLibraryContainer2 (base of XPersistentLibraryContainer)
- virtual sal_Bool SAL_CALL isLibraryLink( const ::rtl::OUString& Name )
+ virtual sal_Bool SAL_CALL isLibraryLink( const OUString& Name )
throw (::com::sun::star::container::NoSuchElementException,
::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getLibraryLinkURL( const ::rtl::OUString& Name )
+ virtual OUString SAL_CALL getLibraryLinkURL( const OUString& Name )
throw (::com::sun::star::lang::IllegalArgumentException,
::com::sun::star::container::NoSuchElementException,
::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isLibraryReadOnly( const ::rtl::OUString& Name )
+ virtual sal_Bool SAL_CALL isLibraryReadOnly( const OUString& Name )
throw (::com::sun::star::container::NoSuchElementException,
::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setLibraryReadOnly( const ::rtl::OUString& Name, sal_Bool bReadOnly )
+ virtual void SAL_CALL setLibraryReadOnly( const OUString& Name, sal_Bool bReadOnly )
throw (::com::sun::star::container::NoSuchElementException,
::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL renameLibrary( const ::rtl::OUString& Name, const ::rtl::OUString& NewName )
+ virtual void SAL_CALL renameLibrary( const OUString& Name, const OUString& NewName )
throw (::com::sun::star::container::NoSuchElementException,
::com::sun::star::container::ElementExistException,
::com::sun::star::uno::RuntimeException);
// Methods XLibraryContainer (base of XLibraryContainer2)
virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > SAL_CALL
- createLibrary( const ::rtl::OUString& Name )
+ createLibrary( const OUString& Name )
throw(::com::sun::star::lang::IllegalArgumentException,
::com::sun::star::container::ElementExistException,
::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL createLibraryLink
- ( const ::rtl::OUString& Name, const ::rtl::OUString& StorageURL, sal_Bool ReadOnly )
+ ( const OUString& Name, const OUString& StorageURL, sal_Bool ReadOnly )
throw(::com::sun::star::lang::IllegalArgumentException,
::com::sun::star::container::ElementExistException,
::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL removeLibrary( const ::rtl::OUString& Name )
+ virtual void SAL_CALL removeLibrary( const OUString& Name )
throw(::com::sun::star::container::NoSuchElementException,
::com::sun::star::lang::WrappedTargetException,
::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isLibraryLoaded( const ::rtl::OUString& Name )
+ virtual sal_Bool SAL_CALL isLibraryLoaded( const OUString& Name )
throw(::com::sun::star::container::NoSuchElementException,
::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL loadLibrary( const ::rtl::OUString& Name )
+ virtual void SAL_CALL loadLibrary( const OUString& Name )
throw(::com::sun::star::container::NoSuchElementException,
::com::sun::star::lang::WrappedTargetException,
::com::sun::star::uno::RuntimeException);
@@ -471,19 +471,19 @@ public:
::com::sun::star::uno::RuntimeException);
// Methods XLibraryContainerPassword
- virtual sal_Bool SAL_CALL isLibraryPasswordProtected( const ::rtl::OUString& Name )
+ virtual sal_Bool SAL_CALL isLibraryPasswordProtected( const OUString& Name )
throw (::com::sun::star::container::NoSuchElementException,
::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isLibraryPasswordVerified( const ::rtl::OUString& Name )
+ virtual sal_Bool SAL_CALL isLibraryPasswordVerified( const OUString& Name )
throw (::com::sun::star::lang::IllegalArgumentException,
::com::sun::star::container::NoSuchElementException,
::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL verifyLibraryPassword( const ::rtl::OUString& Name, const ::rtl::OUString& Password )
+ virtual sal_Bool SAL_CALL verifyLibraryPassword( const OUString& Name, const OUString& Password )
throw (::com::sun::star::lang::IllegalArgumentException,
::com::sun::star::container::NoSuchElementException,
::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL changeLibraryPassword( const ::rtl::OUString& Name,
- const ::rtl::OUString& OldPassword, const ::rtl::OUString& NewPassword )
+ virtual void SAL_CALL changeLibraryPassword( const OUString& Name,
+ const OUString& OldPassword, const OUString& NewPassword )
throw (::com::sun::star::lang::IllegalArgumentException,
::com::sun::star::container::NoSuchElementException,
::com::sun::star::uno::RuntimeException);
@@ -497,24 +497,24 @@ public:
throw (::com::sun::star::uno::RuntimeException);
// Methods XLibraryContainerExport
- virtual void SAL_CALL exportLibrary( const ::rtl::OUString& Name, const ::rtl::OUString& URL,
+ virtual void SAL_CALL exportLibrary( const OUString& Name, const OUString& URL,
const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& Handler )
throw (::com::sun::star::uno::Exception,
::com::sun::star::container::NoSuchElementException,
::com::sun::star::uno::RuntimeException);
// Methods XServiceInfo
- virtual ::rtl::OUString SAL_CALL getImplementationName( )
+ virtual OUString SAL_CALL getImplementationName( )
throw (::com::sun::star::uno::RuntimeException) = 0;
- virtual ::sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
+ virtual ::sal_Bool SAL_CALL supportsService( const OUString& ServiceName )
throw (::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( )
+ virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( )
throw (::com::sun::star::uno::RuntimeException) = 0;
// Methods XVBACompatibility
virtual ::sal_Bool SAL_CALL getVBACompatibilityMode() throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL setVBACompatibilityMode( ::sal_Bool _vbacompatmodeon ) throw (::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL getProjectName() throw (::com::sun::star::uno::RuntimeException) { return msProjectName; }
- virtual void SAL_CALL setProjectName( const ::rtl::OUString& _projectname ) throw (::com::sun::star::uno::RuntimeException);
+ virtual OUString SAL_CALL getProjectName() throw (::com::sun::star::uno::RuntimeException) { return msProjectName; }
+ virtual void SAL_CALL setProjectName( const OUString& _projectname ) throw (::com::sun::star::uno::RuntimeException);
virtual sal_Int32 SAL_CALL getRunningVBAScripts()
throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL addVBAScriptListener(
@@ -523,7 +523,7 @@ public:
virtual void SAL_CALL removeVBAScriptListener(
const ::com::sun::star::uno::Reference< ::com::sun::star::script::vba::XVBAScriptListener >& Listener )
throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL broadcastVBAScriptEvent( sal_Int32 nIdentifier, const ::rtl::OUString& rModuleName )
+ virtual void SAL_CALL broadcastVBAScriptEvent( sal_Int32 nIdentifier, const OUString& rModuleName )
throw (::com::sun::star::uno::RuntimeException);
};
@@ -571,11 +571,11 @@ class SfxLibrary
private:
- ::rtl::OUString maLibElementFileExtension;
- ::rtl::OUString maLibInfoFileURL;
- ::rtl::OUString maStorageURL;
- ::rtl::OUString maUnexpandedStorageURL;
- ::rtl::OUString maOriginalStorageURL;
+ OUString maLibElementFileExtension;
+ OUString maLibInfoFileURL;
+ OUString maStorageURL;
+ OUString maUnexpandedStorageURL;
+ OUString maOriginalStorageURL;
sal_Bool mbLink;
sal_Bool mbReadOnly;
@@ -585,7 +585,7 @@ private:
sal_Bool mbPasswordProtected;
sal_Bool mbPasswordVerified;
bool mbDoc50Password;
- ::rtl::OUString maPassword;
+ OUString maPassword;
bool mbSharedIndexFile;
bool mbExtension;
@@ -594,8 +594,8 @@ private:
// Provide modify state including resources
virtual sal_Bool isModified( void ) = 0;
virtual void storeResources( void ) = 0;
- virtual void storeResourcesAsURL( const ::rtl::OUString& URL, const ::rtl::OUString& NewName ) = 0;
- virtual void storeResourcesToURL( const ::rtl::OUString& URL,
+ virtual void storeResourcesAsURL( const OUString& URL, const OUString& NewName ) = 0;
+ virtual void storeResourcesToURL( const OUString& URL,
const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& xHandler ) = 0;
virtual void storeResourcesToStorage( const ::com::sun::star::uno::Reference
< ::com::sun::star::embed::XStorage >& xStorage ) = 0;
@@ -614,7 +614,7 @@ private:
void impl_checkLoaded();
private:
- void impl_removeWithoutChecks( const ::rtl::OUString& _rElementName );
+ void impl_removeWithoutChecks( const OUString& _rElementName );
public:
SfxLibrary(
@@ -628,8 +628,8 @@ public:
const ::com::sun::star::uno::Type& aType,
const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xMSF,
const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XSimpleFileAccess2 >& xSFI,
- const ::rtl::OUString& aLibInfoFileURL,
- const ::rtl::OUString&
+ const OUString& aLibInfoFileURL,
+ const OUString&
aStorageURL,
sal_Bool ReadOnly
);
@@ -646,29 +646,29 @@ public:
throw(::com::sun::star::uno::RuntimeException);
// Methods XNameAccess
- virtual ::com::sun::star::uno::Any SAL_CALL getByName( const ::rtl::OUString& aName )
+ virtual ::com::sun::star::uno::Any SAL_CALL getByName( const OUString& aName )
throw(::com::sun::star::container::NoSuchElementException,
::com::sun::star::lang::WrappedTargetException,
::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames( )
+ virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getElementNames( )
throw(::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName )
+ virtual sal_Bool SAL_CALL hasByName( const OUString& aName )
throw(::com::sun::star::uno::RuntimeException);
// Methods XNameReplace
- virtual void SAL_CALL replaceByName( const ::rtl::OUString& aName, const ::com::sun::star::uno::Any& aElement )
+ virtual void SAL_CALL replaceByName( const OUString& aName, const ::com::sun::star::uno::Any& aElement )
throw(::com::sun::star::lang::IllegalArgumentException,
::com::sun::star::container::NoSuchElementException,
::com::sun::star::lang::WrappedTargetException,
::com::sun::star::uno::RuntimeException);
// Methods XNameContainer
- virtual void SAL_CALL insertByName( const ::rtl::OUString& aName, const ::com::sun::star::uno::Any& aElement )
+ virtual void SAL_CALL insertByName( const OUString& aName, const ::com::sun::star::uno::Any& aElement )
throw(::com::sun::star::lang::IllegalArgumentException,
::com::sun::star::container::ElementExistException,
::com::sun::star::lang::WrappedTargetException,
::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL removeByName( const ::rtl::OUString& Name )
+ virtual void SAL_CALL removeByName( const OUString& Name )
throw(::com::sun::star::container::NoSuchElementException,
::com::sun::star::lang::WrappedTargetException,
::com::sun::star::uno::RuntimeException);
@@ -697,7 +697,7 @@ public:
public:
struct LibraryContainerAccess { friend class SfxLibraryContainer; private: LibraryContainerAccess() { } };
- void removeElementWithoutChecks( const ::rtl::OUString& _rElementName, LibraryContainerAccess )
+ void removeElementWithoutChecks( const OUString& _rElementName, LibraryContainerAccess )
{
impl_removeWithoutChecks( _rElementName );
}
@@ -736,7 +736,7 @@ class ScriptExtensionIterator
{
public:
ScriptExtensionIterator( void );
- rtl::OUString nextBasicOrDialogLibrary( bool& rbPureDialogLib );
+ OUString nextBasicOrDialogLibrary( bool& rbPureDialogLib );
protected:
com::sun::star::uno::Reference< com::sun::star::deployment::XPackage >
diff --git a/basic/source/inc/parser.hxx b/basic/source/inc/parser.hxx
index 68dd9f18f39a..d6c14a6b27ee 100644
--- a/basic/source/inc/parser.hxx
+++ b/basic/source/inc/parser.hxx
@@ -26,7 +26,7 @@
#include <vector>
-typedef ::std::vector< String > StringVector;
+typedef ::std::vector< OUString > StringVector;
struct SbiParseStack;
@@ -82,7 +82,7 @@ public:
SbiExprNode* GetWithVar();
// from 31.3.1996, search symbol in the runtime-library
- SbiSymDef* CheckRTLForSym( const String& rSym, SbxDataType eType );
+ SbiSymDef* CheckRTLForSym( const OUString& rSym, SbxDataType eType );
void AddConstants( void );
bool HasGlobalCode();
diff --git a/basic/source/inc/runtime.hxx b/basic/source/inc/runtime.hxx
index 005f262b81b8..fd5313775ded 100644
--- a/basic/source/inc/runtime.hxx
+++ b/basic/source/inc/runtime.hxx
@@ -112,7 +112,7 @@ public:
sal_Int16 nDirFlags;
short nCurDirPos;
- String sFullNameToBeChecked;
+ OUString sFullNameToBeChecked;
WildCard* pWildCard;
Sequence< ::rtl::OUString > aDirSeq;
@@ -148,10 +148,10 @@ class SbiInstance
sal_uInt32 nStdDateIdx, nStdTimeIdx, nStdDateTimeIdx;
SbError nErr;
- OUString aErrorMsg; // last error message for $ARG
- sal_uInt16 nErl; // current error line
- sal_Bool bReschedule; // Flag: sal_True = Reschedule in main loop
- sal_Bool bCompatibility; // Flag: sal_True = VBA runtime compatibility mode
+ OUString aErrorMsg; // last error message for $ARG
+ sal_Int32 nErl; // current error line
+ sal_Bool bReschedule; // Flag: sal_True = Reschedule in main loop
+ sal_Bool bCompatibility; // Flag: sal_True = VBA runtime compatibility mode
ComponentVector_t ComponentVector;
public:
@@ -178,7 +178,7 @@ public:
void Stop();
SbError GetErr() { return nErr; }
OUString GetErrorMsg() { return aErrorMsg; }
- xub_StrLen GetErl() { return nErl; }
+ sal_Int32 GetErl() { return nErl; }
void EnableReschedule( sal_Bool bEnable ) { bReschedule = bEnable; }
sal_Bool IsReschedule( void ) { return bReschedule; }
void EnableCompatibility( sal_Bool bEnable ) { bCompatibility = bEnable; }
@@ -257,7 +257,7 @@ class SbiRuntime
const sal_uInt8* pRestart; // restart-address
const sal_uInt8* pErrCode; // restart-adresse RESUME NEXT
const sal_uInt8* pErrStmnt; // Restart-Adresse RESUMT 0
- String aLibName; // Lib-name for declare-call
+ OUString aLibName; // Lib-name for declare-call
SbxArrayRef refParams; // current procedure parameters
SbxArrayRef refLocals; // local variable
SbxArrayRef refArgv;
@@ -329,12 +329,12 @@ class SbiRuntime
void SetParameters( SbxArray* );
// HAS TO BE IMPLEMENTED SOME TIME
- void DllCall( const String&, const String&, SbxArray*, SbxDataType, bool );
+ void DllCall( const OUString&, const OUString&, SbxArray*, SbxDataType, bool );
// #56204 swap out DIM-functionality into help method (step0.cxx)
void DimImpl( SbxVariableRef refVar );
- bool implIsClass( SbxObject* pObj, const ::rtl::OUString& aClass );
+ bool implIsClass( SbxObject* pObj, const OUString& aClass );
void StepSETCLASS_impl( sal_uInt32 nOp1, bool bHandleDflt = false );
@@ -366,7 +366,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 ::rtl::OUString& aClass, bool bRaiseErrors, bool bDefault = true );
+ bool checkClass_Impl( const SbxVariableRef& refVal, const OUString& aClass, bool bRaiseErrors, bool bDefault = true );
void StepCLOSE( sal_uInt32 ), StepPRCHAR( sal_uInt32 ), StepARGTYP( sal_uInt32 );
// all opcodes with two operands
void StepRTL( sal_uInt32, sal_uInt32 ), StepPUBLIC( sal_uInt32, sal_uInt32 ), StepPUBLIC_P( sal_uInt32, sal_uInt32 );
@@ -389,7 +389,7 @@ public:
void SetVBAEnabled( bool bEnabled );
sal_uInt16 GetImageFlag( sal_uInt16 n ) const;
sal_uInt16 GetBase();
- xub_StrLen nLine,nCol1,nCol2;
+ sal_Int32 nLine,nCol1,nCol2;
SbiRuntime* pNext; // Stack-Chain
SbiRuntime( SbModule*, SbMethod*, sal_uInt32 );
@@ -451,20 +451,20 @@ bool hasUno( void );
// Converts possibly relative paths to absolute paths
// according to the setting done by ChDir/ChDrive
// (Implemented in methods.cxx)
-String getFullPath( const String& aRelPath );
+OUString getFullPath( const OUString& aRelPath );
// Implementation of StepRENAME with UCB
// (Implemented in methods.cxx, so step0.cxx
// has not to be infected with UNO)
-void implStepRenameUCB( const String& aSource, const String& aDest );
+void implStepRenameUCB( const OUString& aSource, const OUString& aDest );
//*** OSL file access ***
// #87427 OSL need File URLs, so map to getFullPath
-inline String getFullPathUNC( const String& aRelPath )
+inline OUString getFullPathUNC( const OUString& aRelPath )
{
return getFullPath( aRelPath );
}
-void implStepRenameOSL( const String& aSource, const String& aDest );
+void implStepRenameOSL( const OUString& aSource, const OUString& aDest );
bool IsBaseIndexOne();
#endif
diff --git a/basic/source/inc/sbintern.hxx b/basic/source/inc/sbintern.hxx
index a4ff91f6d268..7dfd011f8385 100644
--- a/basic/source/inc/sbintern.hxx
+++ b/basic/source/inc/sbintern.hxx
@@ -40,10 +40,10 @@ class SbiFactory : public SbxFactory
{
public:
virtual SbxBase* Create( sal_uInt16 nSbxId, sal_uInt32 = SBXCR_SBX );
- virtual SbxObject* CreateObject( const rtl::OUString& );
+ virtual SbxObject* CreateObject( const OUString& );
};
-typedef ::std::vector< String > StringVector;
+typedef ::std::vector< OUString > StringVector;
struct SbClassData
{
@@ -73,9 +73,9 @@ public:
void RemoveClassModule( SbModule* pClassModule );
virtual SbxBase* Create( sal_uInt16 nSbxId, sal_uInt32 = SBXCR_SBX );
- virtual SbxObject* CreateObject( const rtl::OUString& );
+ virtual SbxObject* CreateObject( const OUString& );
- SbModule* FindClass( const String& rClassName );
+ SbModule* FindClass( const OUString& rClassName );
};
struct SbiGlobals
@@ -93,12 +93,12 @@ struct SbiGlobals
Link aErrHdl; // global error handler
Link aBreakHdl; // global break handler
SbError nCode;
- xub_StrLen nLine;
- xub_StrLen nCol1,nCol2; // from... to...
+ sal_Int32 nLine;
+ sal_Int32 nCol1,nCol2; // from... to...
bool bCompiler; // flag for compiler error
bool bGlobalInitErr;
bool bRunInit; // true, if RunInit active from the Basic
- String aErrMsg; // buffer for GetErrorText()
+ OUString aErrMsg; // buffer for GetErrorText()
::utl::TransliterationWrapper* pTransliterationWrapper; // For StrComp
bool bBlockCompilerError;
BasicManager* pAppBasMgr;
diff --git a/basic/source/inc/sbjsmeth.hxx b/basic/source/inc/sbjsmeth.hxx
index e53473a16b7e..acfe8aa711f0 100644
--- a/basic/source/inc/sbjsmeth.hxx
+++ b/basic/source/inc/sbjsmeth.hxx
@@ -30,7 +30,7 @@
class SbJScriptMethod : public SbMethod
{
public:
- SbJScriptMethod( const String&, SbxDataType, SbModule* );
+ SbJScriptMethod( const OUString&, SbxDataType, SbModule* );
virtual ~SbJScriptMethod();
SBX_DECL_PERSIST_NODATA(SBXCR_SBX,SBXID_JSCRIPTMETH,2);
diff --git a/basic/source/inc/sbjsmod.hxx b/basic/source/inc/sbjsmod.hxx
index 5149df447853..02c100aa6070 100644
--- a/basic/source/inc/sbjsmod.hxx
+++ b/basic/source/inc/sbjsmod.hxx
@@ -33,7 +33,7 @@ class SbJScriptModule : public SbModule
public:
SBX_DECL_PERSIST_NODATA(SBXCR_SBX,SBXID_JSCRIPTMOD,1);
TYPEINFO();
- SbJScriptModule( const String& ); // hand through
+ SbJScriptModule( const OUString& ); // hand through
};
#endif
diff --git a/basic/source/inc/sbunoobj.hxx b/basic/source/inc/sbunoobj.hxx
index ab0f43901099..a90197e73409 100644
--- a/basic/source/inc/sbunoobj.hxx
+++ b/basic/source/inc/sbunoobj.hxx
@@ -49,7 +49,7 @@ public:
sal_Int32 getPos() const { return mnPos; }
typelib_TypeDescription* getTD() const { return mpTD; }
- rtl::OUString getTypeName() const;
+ OUString getTypeName() const;
com::sun::star::uno::Any& getRootAnyRef() { return maAny; };
com::sun::star::uno::TypeClass getTypeClass() const;
@@ -65,29 +65,29 @@ class SbUnoStructRefObject: public SbxObject
{
struct caseLessComp
{
- bool operator() (const ::rtl::OUString& rProp, const ::rtl::OUString& rOtherProp ) const
+ bool operator() (const OUString& rProp, const OUString& rOtherProp ) const
{
return rProp.toAsciiUpperCase().compareTo( rOtherProp.toAsciiUpperCase() ) < 0;
}
};
- typedef ::std::map< rtl::OUString, StructRefInfo*, caseLessComp > StructFieldInfo;
+ typedef ::std::map< OUString, StructRefInfo*, caseLessComp > StructFieldInfo;
StructFieldInfo maFields;
StructRefInfo maMemberInfo;
bool mbMemberCacheInit;
void implCreateAll();
void implCreateDbgProperties();
void initMemberCache();
- rtl::OUString Impl_DumpProperties();
- rtl::OUString getDbgObjectName();
+ OUString Impl_DumpProperties();
+ OUString getDbgObjectName();
public:
TYPEINFO();
- StructRefInfo getStructMember( const rtl::OUString& rMember );
+ StructRefInfo getStructMember( const OUString& rMember );
StructRefInfo getStructInfo() { return maMemberInfo; }
- SbUnoStructRefObject( const ::rtl::OUString& aName_, const StructRefInfo& rMemberInfo );
+ SbUnoStructRefObject( const OUString& aName_, const StructRefInfo& rMemberInfo );
~SbUnoStructRefObject();
// Find overloaded to support e. g. NameAccess
- virtual SbxVariable* Find( const rtl::OUString&, SbxClassType );
+ virtual SbxVariable* Find( const OUString&, SbxClassType );
// Force creation of all properties for debugging
void createAllProperties( void )
@@ -118,16 +118,16 @@ class SbUnoObject: public SbxObject
void implCreateAll( void );
public:
- static bool getDefaultPropName( SbUnoObject* pUnoObj, ::rtl::OUString& sDfltProp );
+ static bool getDefaultPropName( SbUnoObject* pUnoObj, OUString& sDfltProp );
TYPEINFO();
- SbUnoObject( const ::rtl::OUString& aName_, const ::com::sun::star::uno::Any& aUnoObj_ );
+ SbUnoObject( const OUString& aName_, const ::com::sun::star::uno::Any& aUnoObj_ );
~SbUnoObject();
// #76470 do introspection on demand
void doIntrospection( void );
// Find overloaded to support e. g. NameAccess
- virtual SbxVariable* Find( const rtl::OUString&, SbxClassType );
+ virtual SbxVariable* Find( const OUString&, SbxClassType );
// Force creation of all properties for debugging
void createAllProperties( void )
@@ -168,7 +168,7 @@ class SbUnoMethod : public SbxMethod
public:
TYPEINFO();
- SbUnoMethod( const rtl::OUString& aName_, SbxDataType eSbxType, ::com::sun::star::uno::Reference< ::com::sun::star::reflection::XIdlMethod > xUnoMethod_,
+ SbUnoMethod( const OUString& aName_, SbxDataType eSbxType, ::com::sun::star::uno::Reference< ::com::sun::star::reflection::XIdlMethod > xUnoMethod_,
bool bInvocation,
bool bDirect = false );
virtual ~SbUnoMethod();
@@ -201,7 +201,7 @@ class SbUnoProperty : public SbxProperty
public:
TYPEINFO();
- SbUnoProperty( const rtl::OUString& aName_, SbxDataType eSbxType, SbxDataType eRealSbxType,
+ SbUnoProperty( const OUString& aName_, SbxDataType eSbxType, SbxDataType eRealSbxType,
const ::com::sun::star::beans::Property& aUnoProp_, sal_Int32 nId_, bool bInvocation, bool bUnoStruct );
bool isUnoStruct() { return mbUnoStruct; }
@@ -215,7 +215,7 @@ class SbUnoFactory : public SbxFactory
{
public:
virtual SbxBase* Create( sal_uInt16 nSbxId, sal_uInt32 = SBXCR_SBX );
- virtual SbxObject* CreateObject( const rtl::OUString& );
+ virtual SbxObject* CreateObject( const OUString& );
};
// wrapper for an uno-class
@@ -225,16 +225,16 @@ class SbUnoClass : public SbxObject
public:
TYPEINFO();
- SbUnoClass( const String& aName_ )
+ SbUnoClass( const OUString& aName_ )
: SbxObject( aName_ )
{}
- SbUnoClass( const String& aName_, const ::com::sun::star::uno::Reference< ::com::sun::star::reflection::XIdlClass >& xClass_ )
+ SbUnoClass( const OUString& aName_, const ::com::sun::star::uno::Reference< ::com::sun::star::reflection::XIdlClass >& xClass_ )
: SbxObject( aName_ )
, m_xClass( xClass_ )
{}
- virtual SbxVariable* Find( const rtl::OUString&, SbxClassType );
+ virtual SbxVariable* Find( const OUString&, SbxClassType );
const ::com::sun::star::uno::Reference< ::com::sun::star::reflection::XIdlClass >& getUnoClass( void ) { return m_xClass; }
@@ -245,31 +245,31 @@ SV_DECL_IMPL_REF(SbUnoClass);
// function to find a global identifier in
// the UnoScope and to wrap it for Sbx
-SbUnoClass* findUnoClass( const ::rtl::OUString& rName );
+SbUnoClass* findUnoClass( const OUString& rName );
// Wrapper for UNO Service
class SbUnoService : public SbxObject
{
- const ::com::sun::star::uno::Reference< ::com::sun::star::reflection::XServiceTypeDescription2 > m_xServiceTypeDesc;
- bool m_bNeedsInit;
+ const ::com::sun::star::uno::Reference< ::com::sun::star::reflection::XServiceTypeDescription2 > m_xServiceTypeDesc;
+ bool m_bNeedsInit;
public:
TYPEINFO();
- SbUnoService( const String& aName_,
+ SbUnoService( const OUString& aName_,
const ::com::sun::star::uno::Reference< ::com::sun::star::reflection::XServiceTypeDescription2 >& xServiceTypeDesc )
: SbxObject( aName_ )
, m_xServiceTypeDesc( xServiceTypeDesc )
, m_bNeedsInit( true )
{}
- virtual SbxVariable* Find( const rtl::OUString&, SbxClassType );
+ virtual SbxVariable* Find( const OUString&, SbxClassType );
void SFX_NOTIFY( SfxBroadcaster&, const TypeId&, const SfxHint& rHint, const TypeId& );
};
SV_DECL_IMPL_REF(SbUnoService);
-SbUnoService* findUnoService( const ::rtl::OUString& rName );
+SbUnoService* findUnoService( const OUString& rName );
void clearUnoServiceCtors( void );
@@ -286,7 +286,7 @@ class SbUnoServiceCtor : public SbxMethod
public:
TYPEINFO();
- SbUnoServiceCtor( const::rtl::OUString& aName_, ::com::sun::star::uno::Reference< ::com::sun::star::reflection::XServiceConstructorDescription > xServiceCtorDesc );
+ SbUnoServiceCtor( const OUString& aName_, ::com::sun::star::uno::Reference< ::com::sun::star::reflection::XServiceConstructorDescription > xServiceCtorDesc );
virtual ~SbUnoServiceCtor();
virtual SbxInfo* GetInfo();
@@ -302,14 +302,14 @@ class SbUnoSingleton : public SbxObject
public:
TYPEINFO();
- SbUnoSingleton( const ::rtl::OUString& aName_,
+ SbUnoSingleton( const 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 ::rtl::OUString& rName );
+SbUnoSingleton* findUnoSingleton( const OUString& rName );
// #105565 Special Object to wrap a strongly typed Uno Any
@@ -319,7 +319,7 @@ class SbUnoAnyObject: public SbxObject
public:
SbUnoAnyObject( const ::com::sun::star::uno::Any& rVal )
- : SbxObject( String() )
+ : SbxObject( OUString() )
, mVal( rVal )
{}
@@ -335,14 +335,14 @@ public:
class AutomationNamedArgsSbxArray : public SbxArray
{
- ::com::sun::star::uno::Sequence< ::rtl::OUString > maNameSeq;
+ ::com::sun::star::uno::Sequence< OUString > maNameSeq;
public:
TYPEINFO();
AutomationNamedArgsSbxArray( sal_Int32 nSeqSize )
: maNameSeq( nSeqSize )
{}
- ::com::sun::star::uno::Sequence< ::rtl::OUString >& getNames( void )
+ ::com::sun::star::uno::Sequence< OUString >& getNames( void )
{ return maNameSeq; }
};
@@ -379,21 +379,21 @@ class BasicCollection : public SbxObject
virtual void SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType,
const SfxHint& rHint, const TypeId& rHintType );
sal_Int32 implGetIndex( SbxVariable* pIndexVar );
- sal_Int32 implGetIndexForName( const String& rName );
+ sal_Int32 implGetIndexForName( const OUString& rName );
void CollAdd( SbxArray* pPar_ );
void CollItem( SbxArray* pPar_ );
void CollRemove( SbxArray* pPar_ );
public:
TYPEINFO();
- BasicCollection( const rtl::OUString& rClassname );
- virtual SbxVariable* Find( const rtl::OUString&, SbxClassType );
+ BasicCollection( const OUString& rClassname );
+ virtual SbxVariable* Find( const OUString&, SbxClassType );
virtual void Clear();
};
-typedef boost::unordered_map< ::rtl::OUString, ::com::sun::star::uno::Any, ::rtl::OUStringHash, ::std::equal_to< ::rtl::OUString > > VBAConstantsHash;
+typedef boost::unordered_map< OUString, ::com::sun::star::uno::Any, ::rtl::OUStringHash, ::std::equal_to< ::rtl::OUString > > VBAConstantsHash;
-typedef std::vector< rtl::OUString > VBAConstantsVector;
+typedef std::vector< OUString > VBAConstantsVector;
class VBAConstantHelper
{
@@ -407,8 +407,8 @@ private:
void init();
public:
static VBAConstantHelper& instance();
- SbxVariable* getVBAConstant( const ::rtl::OUString& rName );
- bool isVBAConstantType( const ::rtl::OUString& rName );
+ SbxVariable* getVBAConstant( const OUString& rName );
+ bool isVBAConstantType( const OUString& rName );
};
#endif
diff --git a/basic/source/inc/stdobj.hxx b/basic/source/inc/stdobj.hxx
index 324cdf242a86..12935f78d688 100644
--- a/basic/source/inc/stdobj.hxx
+++ b/basic/source/inc/stdobj.hxx
@@ -35,8 +35,8 @@ class SbiStdObject : public SbxObject
virtual void SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType,
const SfxHint& rHint, const TypeId& rHintType );
public:
- SbiStdObject( const String&, StarBASIC* );
- virtual SbxVariable* Find( const rtl::OUString&, SbxClassType );
+ SbiStdObject( const OUString&, StarBASIC* );
+ virtual SbxVariable* Find( const OUString&, SbxClassType );
virtual void SetModified( sal_Bool );
};
diff --git a/basic/source/inc/symtbl.hxx b/basic/source/inc/symtbl.hxx
index 87d329c99809..fa7309e0467c 100644
--- a/basic/source/inc/symtbl.hxx
+++ b/basic/source/inc/symtbl.hxx
@@ -34,8 +34,8 @@ enum SbiSymScope { SbLOCAL, SbPARAM, SbPUBLIC, SbGLOBAL, SbRTL };
// makes sure that they don't exist twice.
class SbiStringPool {
- const rtl::OUString aEmpty;
- std::vector<rtl::OUString> aData;
+ const OUString aEmpty;
+ std::vector<OUString> aData;
SbiParser* pParser;
public:
SbiStringPool( SbiParser* );
@@ -43,9 +43,9 @@ public:
sal_uInt32 GetSize() const { return aData.size(); }
// From 8.4.1999: default changed to true because of #64236 -
// change it back to false when the bug is cleanly removed.
- short Add( const rtl::OUString&, bool=true );
+ short Add( const OUString&, bool=true );
short Add( double, SbxDataType );
- const rtl::OUString& Find( sal_uInt32 ) const;
+ const OUString& Find( sal_uInt32 ) const;
SbiParser* GetParser() { return pParser; }
};
@@ -78,16 +78,16 @@ public:
void SetScope( SbiSymScope s ) { eScope = s; }
SbiParser* GetParser() { return pParser; }
- SbiSymDef* AddSym( const String& );
- SbiProcDef* AddProc( const String& );
+ SbiSymDef* AddSym( const OUString& );
+ SbiProcDef* AddProc( const OUString& );
void Add( SbiSymDef* );
- SbiSymDef* Find( const String& ) const; // variable name
+ SbiSymDef* Find( const OUString& ) const; // variable name
SbiSymDef* FindId( sal_uInt16 ) const;
SbiSymDef* Get( sal_uInt16 ) const; // find variable per position
SbiSymDef* First(), *Next(); // iterators
- sal_uInt32 Define( const String& );
- sal_uInt32 Reference( const String& );
+ sal_uInt32 Define( const OUString& );
+ sal_uInt32 Reference( const OUString& );
void CheckRefs();
};
@@ -95,7 +95,7 @@ public:
class SbiSymDef { // general symbol entry
friend class SbiSymPool;
protected:
- String aName;
+ OUString aName;
SbxDataType eType;
SbiSymPool* pIn; // parent pool
SbiSymPool* pPool; // pool for sub-elements
@@ -119,21 +119,21 @@ protected:
sal_uInt16 nDefaultId; // Symbol number of default value
short nFixedStringLength; // String length in: Dim foo As String*Length
public:
- SbiSymDef( const String& );
+ SbiSymDef( const OUString& );
virtual ~SbiSymDef();
virtual SbiProcDef* GetProcDef();
virtual SbiConstDef* GetConstDef();
SbxDataType GetType() const { return eType; }
virtual void SetType( SbxDataType );
- const String& GetName();
+ const OUString& GetName();
SbiSymScope GetScope() const;
- sal_uInt16 GetProcId() const{ return nProcId; }
- sal_uInt32 GetAddr() const { return nChain; }
- sal_uInt16 GetId() const { return nId; }
- sal_uInt16 GetTypeId() const{ return nTypeId; }
+ sal_uInt16 GetProcId() const{ return nProcId; }
+ sal_uInt32 GetAddr() const { return nChain; }
+ sal_uInt16 GetId() const { return nId; }
+ sal_uInt16 GetTypeId() const{ return nTypeId; }
void SetTypeId( sal_uInt16 n ) { nTypeId = n; eType = SbxOBJECT; }
- sal_uInt16 GetPos() const { return nPos; }
+ sal_uInt16 GetPos() const { return nPos; }
void SetLen( short n ){ nLen = n; }
short GetLen() const { return nLen; }
void SetDims( short n ) { nDims = n; }
@@ -143,14 +143,13 @@ public:
void SetParamArray() { bParamArray = true; }
void SetWithEvents() { bWithEvents = true; }
void SetWithBrackets(){ bWithBrackets = true; }
- void SetByVal( bool bByVal_ = true )
- { bByVal = bByVal_; }
+ void SetByVal( bool bByVal_ = true ) { bByVal = bByVal_; }
void SetStatic( bool bAsStatic = true ) { bStatic = bAsStatic; }
void SetNew() { bNew = true; }
void SetDefinedAs() { bAs = true; }
void SetGlobal(bool b){ bGlobal = b; }
void SetDefaultId( sal_uInt16 n ) { nDefaultId = n; }
- sal_uInt16 GetDefaultId( void ) { return nDefaultId; }
+ sal_uInt16 GetDefaultId( void ) { return nDefaultId; }
bool IsOptional() const{ return bOpt; }
bool IsParamArray() const{ return bParamArray; }
bool IsWithEvents() const{ return bWithEvents; }
@@ -175,36 +174,36 @@ private:
class SbiProcDef : public SbiSymDef { // procedure definition (from basic):
SbiSymPool aParams;
SbiSymPool aLabels; // local jump targets
- String aLibName;
- String aAlias;
+ OUString aLibName;
+ OUString aAlias;
sal_uInt16 nLine1, nLine2; // line area
PropertyMode mePropMode; // Marks if this is a property procedure and which
- String maPropName; // Property name if property procedure (!= proc name)
+ OUString maPropName; // Property name if property procedure (!= proc name)
bool bCdecl : 1; // true: CDECL given
bool bPublic : 1; // true: proc is PUBLIC
bool mbProcDecl : 1; // true: instanciated by SbiParser::ProcDecl
public:
- SbiProcDef( SbiParser*, const String&, bool bProcDecl=false );
+ SbiProcDef( SbiParser*, const OUString&, bool bProcDecl=false );
virtual ~SbiProcDef();
virtual SbiProcDef* GetProcDef();
virtual void SetType( SbxDataType );
SbiSymPool& GetParams() { return aParams; }
SbiSymPool& GetLabels() { return aLabels; }
SbiSymPool& GetLocals() { return GetPool();}
- String& GetLib() { return aLibName; }
- String& GetAlias() { return aAlias; }
+ OUString& GetLib() { return aLibName; }
+ OUString& GetAlias() { return aAlias; }
void SetPublic( bool b ) { bPublic = b; }
bool IsPublic() const { return bPublic; }
void SetCdecl( bool b = true) { bCdecl = b; }
bool IsCdecl() const { return bCdecl; }
bool IsUsedForProcDecl() const { return mbProcDecl; }
- void SetLine1( sal_uInt16 n ) { nLine1 = n; }
- sal_uInt16 GetLine1() const { return nLine1; }
- void SetLine2( sal_uInt16 n ) { nLine2 = n; }
- sal_uInt16 GetLine2() const { return nLine2; }
+ void SetLine1( sal_uInt16 n ) { nLine1 = n; }
+ sal_uInt16 GetLine1() const { return nLine1; }
+ void SetLine2( sal_uInt16 n ) { nLine2 = n; }
+ sal_uInt16 GetLine2() const { return nLine2; }
PropertyMode getPropertyMode() { return mePropMode; }
void setPropertyMode( PropertyMode ePropMode );
- const String& GetPropName() { return maPropName; }
+ const OUString& GetPropName() { return maPropName; }
// Match with a forward-declaration. The parameter names are
// compared and the forward declaration is replaced by this
@@ -218,15 +217,15 @@ private:
class SbiConstDef : public SbiSymDef
{
double nVal;
- String aVal;
+ OUString aVal;
public:
- SbiConstDef( const String& );
+ SbiConstDef( const OUString& );
virtual ~SbiConstDef();
virtual SbiConstDef* GetConstDef();
void Set( double, SbxDataType );
- void Set( const String& );
+ void Set( const OUString& );
double GetValue() { return nVal; }
- const String& GetString() { return aVal; }
+ const OUString& GetString() { return aVal; }
};
diff --git a/basic/source/runtime/inputbox.cxx b/basic/source/runtime/inputbox.cxx
index 2bfc65e79af9..8a03001ef4f6 100644
--- a/basic/source/runtime/inputbox.cxx
+++ b/basic/source/runtime/inputbox.cxx
@@ -156,11 +156,11 @@ RTLFUNC(InputBox)
String aTitle;
String aDefault;
sal_Int32 nX = -1, nY = -1; // center
- const String& rPrompt = rPar.Get(1)->GetString();
+ const String& rPrompt = rPar.Get(1)->GetOUString();
if ( nArgCount > 2 && !rPar.Get(2)->IsErr() )
- aTitle = rPar.Get(2)->GetString();
+ aTitle = rPar.Get(2)->GetOUString();
if ( nArgCount > 3 && !rPar.Get(3)->IsErr() )
- aDefault = rPar.Get(3)->GetString();
+ aDefault = rPar.Get(3)->GetOUString();
if ( nArgCount > 4 )
{
if ( nArgCount != 6 )
diff --git a/basic/source/runtime/iosys.cxx b/basic/source/runtime/iosys.cxx
index d1d7c32631cc..c6cf5fad1cb5 100644
--- a/basic/source/runtime/iosys.cxx
+++ b/basic/source/runtime/iosys.cxx
@@ -71,15 +71,15 @@ class SbiInputDialog : public ModalDialog {
Edit aInput;
OKButton aOk;
CancelButton aCancel;
- String aText;
+ OUString aText;
DECL_LINK( Ok, Window * );
DECL_LINK( Cancel, Window * );
public:
- SbiInputDialog( Window*, const String& );
- const String& GetInput() { return aText; }
+ SbiInputDialog( Window*, const OUString& );
+ const OUString& GetInput() { return aText; }
};
-SbiInputDialog::SbiInputDialog( Window* pParent, const String& rPrompt )
+SbiInputDialog::SbiInputDialog( Window* pParent, const OUString& rPrompt )
:ModalDialog( pParent, WB_3DLOOK | WB_MOVEABLE | WB_CLOSEABLE ),
aInput( this, WB_3DLOOK | WB_LEFT | WB_BORDER ),
aOk( this ), aCancel( this )
@@ -306,7 +306,7 @@ class OslStream : public SvStream
osl::File maFile;
public:
- OslStream( const String& rName, short nStrmMode );
+ OslStream( const OUString& rName, short nStrmMode );
~OslStream();
virtual sal_uIntPtr GetData( void* pData, sal_uIntPtr nSize );
virtual sal_uIntPtr PutData( const void* pData, sal_uIntPtr nSize );
@@ -315,7 +315,7 @@ public:
virtual void SetSize( sal_uIntPtr nSize );
};
-OslStream::OslStream( const String& rName, short nStrmMode )
+OslStream::OslStream( const OUString& rName, short nStrmMode )
: maFile( rName )
{
sal_uInt32 nFlags;
@@ -563,9 +563,11 @@ SbError SbiStream::Open
nLine = 0;
nExpandOnWriteTo = 0;
if( ( nStrmMode & ( STREAM_READ|STREAM_WRITE ) ) == STREAM_READ )
+ {
nStrmMode |= STREAM_NOCREATE;
- String aStr(rtl::OStringToOUString(rName, osl_getThreadTextEncoding()));
- String aNameStr = getFullPath( aStr );
+ }
+ OUString aStr(rtl::OStringToOUString(rName, osl_getThreadTextEncoding()));
+ OUString aNameStr = getFullPath( aStr );
if( hasUno() )
{
@@ -849,9 +851,9 @@ void SbiIoSystem::Shutdown()
rtl::OUString aOutStr(rtl::OStringToOUString(aOut, osl_getThreadTextEncoding()));
#if defined GCC
Window* pParent = Application::GetDefDialogParent();
- MessBox( pParent, WinBits( WB_OK ), String(), aOutStr ).Execute();
+ MessBox( pParent, WinBits( WB_OK ), OUString(), aOutStr ).Execute();
#else
- MessBox( GetpApp()->GetDefDialogParent(), WinBits( WB_OK ), String(), aOutStr ).Execute();
+ MessBox( GetpApp()->GetDefDialogParent(), WinBits( WB_OK ), OUString(), aOutStr ).Execute();
#endif
}
aOut = rtl::OString();
@@ -983,17 +985,21 @@ void SbiIoSystem::WriteCon(const rtl::OString& rText)
n2 = n1;
}
if( n1 > n2 )
+ {
n1 = n2;
- rtl::OString s(aOut.copy(0, n1));
+ }
+ OString s(aOut.copy(0, n1));
aOut = aOut.copy(n1);
while (aOut[0] == '\n' || aOut[0] == '\r')
+ {
aOut = aOut.copy(1);
- String aStr(rtl::OStringToOUString(s, osl_getThreadTextEncoding()));
+ }
+ OUString aStr(rtl::OStringToOUString(s, osl_getThreadTextEncoding()));
{
SolarMutexGuard aSolarGuard;
if( !MessBox( GetpApp()->GetDefDialogParent(),
WinBits( WB_OK_CANCEL | WB_DEF_OK ),
- String(), aStr ).Execute() )
+ OUString(), aStr ).Execute() )
{
nError = SbERR_USER_ABORT;
}
diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx
index 5dab1a21a084..881ee8678c0e 100644
--- a/basic/source/runtime/methods.cxx
+++ b/basic/source/runtime/methods.cxx
@@ -107,16 +107,17 @@ SbxVariable* getDefaultProp( SbxVariable* pRef );
// from source/classes/sbxmod.cxx
uno::Reference< frame::XModel > getDocumentModel( StarBASIC* );
-static void FilterWhiteSpace( String& rStr )
+static void FilterWhiteSpace( OUString& rStr )
{
- if (!rStr.Len())
+ if (rStr.isEmpty())
+ {
return;
-
+ }
rtl::OUStringBuffer aRet;
- for (xub_StrLen i = 0; i < rStr.Len(); ++i)
+ for (sal_Int32 i = 0; i < rStr.getLength(); ++i)
{
- sal_Unicode cChar = rStr.GetChar(i);
+ sal_Unicode cChar = rStr[i];
if ((cChar != ' ') && (cChar != '\t') &&
(cChar != '\n') && (cChar != '\r'))
{
@@ -152,7 +153,7 @@ static inline bool isFolder( FileStatus::Type aType )
// Converts possibly relative paths to absolute paths
// according to the setting done by ChDir/ChDrive
-String getFullPath( const String& aRelPath )
+OUString getFullPath( const OUString& aRelPath )
{
OUString aFileURL;
@@ -195,7 +196,7 @@ RTLFUNC(CreateObject)
{
(void)bWrite;
- String aClass( rPar.Get( 1 )->GetString() );
+ OUString aClass( rPar.Get( 1 )->GetOUString() );
SbxObjectRef p = SbxBase::CreateObject( aClass );
if( !p )
StarBASIC::Error( SbERR_CANNOT_LOAD );
@@ -217,7 +218,7 @@ RTLFUNC(Error)
StarBASIC::Error( SbERR_INTERNAL_ERROR );
else
{
- String aErrorMsg;
+ OUString aErrorMsg;
SbError nErr = 0L;
sal_Int32 nCode = 0;
if( rPar.Count() == 1 )
@@ -239,8 +240,8 @@ RTLFUNC(Error)
}
bool bVBA = SbiRuntime::isVBAEnabled();
- String tmpErrMsg;
- if( bVBA && aErrorMsg.Len() > 0 )
+ OUString tmpErrMsg;
+ if( bVBA && !aErrorMsg.isEmpty())
{
tmpErrMsg = aErrorMsg;
}
@@ -341,15 +342,15 @@ RTLFUNC(Asc)
else
{
SbxVariableRef pArg = rPar.Get( 1 );
- String aStr( pArg->GetString() );
- if ( aStr.Len() == 0 )
+ OUString aStr( pArg->GetOUString() );
+ if ( aStr.isEmpty())
{
StarBASIC::Error( SbERR_BAD_ARGUMENT );
rPar.Get(0)->PutEmpty();
}
else
{
- sal_Unicode aCh = aStr.GetBuffer()[0];
+ sal_Unicode aCh = aStr[0];
rPar.Get(0)->PutLong( aCh );
}
}
@@ -418,15 +419,15 @@ RTLFUNC(CurDir)
int nCurDir = 0; // Current dir // JSM
if ( rPar.Count() == 2 )
{
- String aDrive = rPar.Get(1)->GetString();
- if ( aDrive.Len() != 1 )
+ OUString aDrive = rPar.Get(1)->GetOUString();
+ if ( aDrive.getLength() != 1 )
{
StarBASIC::Error( SbERR_BAD_ARGUMENT );
return;
}
else
{
- nCurDir = (int)aDrive.GetBuffer()[0];
+ nCurDir = (int)aDrive[0];
if ( !isalpha( nCurDir ) )
{
StarBASIC::Error( SbERR_BAD_ARGUMENT );
@@ -492,10 +493,11 @@ RTLFUNC(ChDir)
{
::basic::vba::registerCurrentDirectory( getDocumentModel( pBasic ), rPar.Get(1)->GetOUString() );
}
- ::basic::vba::registerCurrentDirectory( getDocumentModel( pBasic ), rPar.Get(1)->GetString() );
}
else
+ {
StarBASIC::Error( SbERR_BAD_ARGUMENT );
+ }
}
RTLFUNC(ChDrive)
@@ -505,26 +507,28 @@ RTLFUNC(ChDrive)
rPar.Get(0)->PutEmpty();
if (rPar.Count() != 2)
+ {
StarBASIC::Error( SbERR_BAD_ARGUMENT );
+ }
}
// Implementation of StepRENAME with UCB
-void implStepRenameUCB( const String& aSource, const String& aDest )
+void implStepRenameUCB( const OUString& aSource, const OUString& aDest )
{
uno::Reference< ucb::XSimpleFileAccess3 > xSFI = getFileAccess();
if( xSFI.is() )
{
try
{
- String aSourceFullPath = getFullPath( aSource );
+ OUString aSourceFullPath = getFullPath( aSource );
if( !xSFI->exists( aSourceFullPath ) )
{
StarBASIC::Error( SbERR_FILE_NOT_FOUND );
return;
}
- String aDestFullPath = getFullPath( aDest );
+ OUString aDestFullPath = getFullPath( aDest );
if( xSFI->exists( aDestFullPath ) )
{
StarBASIC::Error( SbERR_FILE_EXISTS );
@@ -542,7 +546,7 @@ void implStepRenameUCB( const String& aSource, const String& aDest )
}
// Implementation of StepRENAME with OSL
-void implStepRenameOSL( const String& aSource, const String& aDest )
+void implStepRenameOSL( const OUString& aSource, const OUString& aDest )
{
FileBase::RC nRet = File::move( getFullPathUNC( aSource ), getFullPathUNC( aDest ) );
if( nRet != FileBase::E_None )
@@ -559,8 +563,8 @@ RTLFUNC(FileCopy)
rPar.Get(0)->PutEmpty();
if (rPar.Count() == 3)
{
- String aSource = rPar.Get(1)->GetString();
- String aDest = rPar.Get(2)->GetString();
+ OUString aSource = rPar.Get(1)->GetOUString();
+ OUString aDest = rPar.Get(2)->GetOUString();
if( hasUno() )
{
uno::Reference< ucb::XSimpleFileAccess3 > xSFI = getFileAccess();
@@ -597,14 +601,14 @@ RTLFUNC(Kill)
rPar.Get(0)->PutEmpty();
if (rPar.Count() == 2)
{
- String aFileSpec = rPar.Get(1)->GetString();
+ OUString aFileSpec = rPar.Get(1)->GetOUString();
if( hasUno() )
{
uno::Reference< ucb::XSimpleFileAccess3 > xSFI = getFileAccess();
if( xSFI.is() )
{
- String aFullPath = getFullPath( aFileSpec );
+ OUString aFullPath = getFullPath( aFileSpec );
if( !xSFI->exists( aFullPath ) || xSFI->isFolder( aFullPath ) )
{
StarBASIC::Error( SbERR_FILE_NOT_FOUND );
@@ -639,7 +643,7 @@ RTLFUNC(MkDir)
rPar.Get(0)->PutEmpty();
if (rPar.Count() == 2)
{
- String aPath = rPar.Get(1)->GetString();
+ OUString aPath = rPar.Get(1)->GetOUString();
if( hasUno() )
{
@@ -670,7 +674,7 @@ RTLFUNC(MkDir)
// In OSL only empty directories can be deleted
// so we have to delete all files recursively
-void implRemoveDirRecursive( const String& aDirPath )
+void implRemoveDirRecursive( const OUString& aDirPath )
{
DirectoryItem aItem;
FileBase::RC nRet = DirectoryItem::get( aDirPath, aItem );
@@ -700,12 +704,13 @@ void implRemoveDirRecursive( const String& aDirPath )
DirectoryItem aItem2;
nRet = aDir.getNextItem( aItem2 );
if( nRet != FileBase::E_None )
+ {
break;
-
+ }
// Handle flags
FileStatus aFileStatus2( osl_FileStatus_Mask_Type | osl_FileStatus_Mask_FileURL );
nRet = aItem2.getFileStatus( aFileStatus2 );
- ::rtl::OUString aPath = aFileStatus2.getFileURL();
+ OUString aPath = aFileStatus2.getFileURL();
// Directory?
FileStatus::Type aType2 = aFileStatus2.getFileType();
@@ -733,7 +738,7 @@ RTLFUNC(RmDir)
rPar.Get(0)->PutEmpty();
if (rPar.Count() == 2)
{
- String aPath = rPar.Get(1)->GetString();
+ OUString aPath = rPar.Get(1)->GetOUString();
if( hasUno() )
{
uno::Reference< ucb::XSimpleFileAccess3 > xSFI = getFileAccess();
@@ -750,7 +755,7 @@ RTLFUNC(RmDir)
bool bCompatibility = ( pInst && pInst->IsCompatibility() );
if( bCompatibility )
{
- Sequence< ::rtl::OUString > aContent = xSFI->getFolderContents( aPath, true );
+ Sequence< OUString > aContent = xSFI->getFolderContents( aPath, true );
sal_Int32 nCount = aContent.getLength();
if( nCount > 0 )
{
@@ -815,7 +820,7 @@ RTLFUNC(FileLen)
else
{
SbxVariableRef pArg = rPar.Get( 1 );
- String aStr( pArg->GetString() );
+ OUString aStr( pArg->GetOUString() );
sal_Int32 nLen = 0;
if( hasUno() )
{
@@ -897,18 +902,17 @@ RTLFUNC(InStr)
StarBASIC::Error( SbERR_BAD_ARGUMENT );
else
{
- sal_uInt16 nStartPos = 1;
+ sal_Int32 nStartPos = 1;
+ sal_Int32 nFirstStringPos = 1;
- sal_uInt16 nFirstStringPos = 1;
if ( nArgCount >= 3 )
{
- sal_Int32 lStartPos = rPar.Get(1)->GetLong();
- if( lStartPos <= 0 || lStartPos > 0xffff )
+ nStartPos = rPar.Get(1)->GetLong();
+ if( nStartPos <= 0 )
{
StarBASIC::Error( SbERR_BAD_ARGUMENT );
- lStartPos = 1;
+ nStartPos = 1;
}
- nStartPos = (sal_uInt16)lStartPos;
nFirstStringPos++;
}
@@ -928,11 +932,11 @@ RTLFUNC(InStr)
{
bTextMode = rPar.Get(4)->GetInteger();
}
- sal_uInt16 nPos;
- const String& rToken = rPar.Get(nFirstStringPos+1)->GetString();
+ sal_Int32 nPos;
+ const OUString& rToken = rPar.Get(nFirstStringPos+1)->GetOUString();
// #97545 Always find empty string
- if( !rToken.Len() )
+ if( rToken.isEmpty() )
{
nPos = nStartPos;
}
@@ -940,27 +944,18 @@ RTLFUNC(InStr)
{
if( !bTextMode )
{
- const String& rStr1 = rPar.Get(nFirstStringPos)->GetString();
-
- nPos = rStr1.Search( rToken, nStartPos-1 );
- if ( nPos == STRING_NOTFOUND )
- nPos = 0;
- else
- nPos++;
+ const OUString& rStr1 = rPar.Get(nFirstStringPos)->GetOUString();
+ nPos = rStr1.indexOf( rToken, nStartPos - 1 ) + 1;
}
else
{
- String aStr1 = rPar.Get(nFirstStringPos)->GetString();
- String aToken = rToken;
+ OUString aStr1 = rPar.Get(nFirstStringPos)->GetOUString();
+ OUString aToken = rToken;
- aStr1.ToUpperAscii();
- aToken.ToUpperAscii();
+ aStr1 = aStr1.toAsciiUpperCase();
+ aToken = aToken.toAsciiUpperCase();
- nPos = aStr1.Search( aToken, nStartPos-1 );
- if ( nPos == STRING_NOTFOUND )
- nPos = 0;
- else
- nPos++;
+ nPos = aStr1.indexOf( aToken, nStartPos-1 ) + 1;
}
}
rPar.Get(0)->PutLong( nPos );
@@ -982,17 +977,17 @@ RTLFUNC(InStrRev)
}
else
{
- String aStr1 = rPar.Get(1)->GetString();
- String aToken = rPar.Get(2)->GetString();
+ OUString aStr1 = rPar.Get(1)->GetOUString();
+ OUString aToken = rPar.Get(2)->GetOUString();
- sal_Int32 lStartPos = -1;
+ sal_Int32 nStartPos = -1;
if ( nArgCount >= 3 )
{
- lStartPos = rPar.Get(3)->GetLong();
- if( (lStartPos <= 0 && lStartPos != -1) || lStartPos > 0xffff )
+ nStartPos = rPar.Get(3)->GetLong();
+ if( (nStartPos <= 0 && nStartPos != -1))
{
StarBASIC::Error( SbERR_BAD_ARGUMENT );
- lStartPos = -1;
+ nStartPos = -1;
}
}
@@ -1009,15 +1004,19 @@ RTLFUNC(InStrRev)
bTextMode = 1;;
}
if ( nArgCount == 4 )
+ {
bTextMode = rPar.Get(4)->GetInteger();
+ }
+ sal_Int32 nStrLen = aStr1.getLength();
+ if( nStartPos == -1 )
+ {
+ nStartPos = nStrLen;
+ }
- sal_uInt16 nStrLen = aStr1.Len();
- sal_uInt16 nStartPos = lStartPos == -1 ? nStrLen : (sal_uInt16)lStartPos;
-
- sal_uInt16 nPos = 0;
+ sal_Int32 nPos = 0;
if( nStartPos <= nStrLen )
{
- sal_uInt16 nTokenLen = aToken.Len();
+ sal_Int32 nTokenLen = aToken.getLength();
if( !nTokenLen )
{
// Always find empty string
@@ -1027,27 +1026,14 @@ RTLFUNC(InStrRev)
{
if( !bTextMode )
{
- ::rtl::OUString aOUStr1 ( aStr1 );
- ::rtl::OUString aOUToken( aToken );
- sal_Int32 nRet = aOUStr1.lastIndexOf( aOUToken, nStartPos );
- if( nRet == -1 )
- nPos = 0;
- else
- nPos = (sal_uInt16)nRet + 1;
+ nPos = aStr1.lastIndexOf( aToken, nStartPos ) + 1;
}
else
{
- aStr1.ToUpperAscii();
- aToken.ToUpperAscii();
-
- ::rtl::OUString aOUStr1 ( aStr1 );
- ::rtl::OUString aOUToken( aToken );
- sal_Int32 nRet = aOUStr1.lastIndexOf( aOUToken, nStartPos );
+ aStr1 = aStr1.toAsciiUpperCase();
+ aToken = aToken.toAsciiUpperCase();
- if( nRet == -1 )
- nPos = 0;
- else
- nPos = (sal_uInt16)nRet + 1;
+ nPos = aStr1.lastIndexOf( aToken, nStartPos ) + 1;
}
}
}
@@ -1117,7 +1103,7 @@ RTLFUNC(LCase)
else
{
const CharClass& rCharClass = GetCharClass();
- String aStr( rPar.Get(1)->GetString() );
+ OUString aStr( rPar.Get(1)->GetOUString() );
aStr = rCharClass.lowercase(aStr);
rPar.Get(0)->PutString( aStr );
}
@@ -1134,18 +1120,18 @@ RTLFUNC(Left)
}
else
{
- String aStr( rPar.Get(1)->GetString() );
- sal_Int32 lResultLen = rPar.Get(2)->GetLong();
- if( lResultLen > 0xffff )
+ OUString aStr( rPar.Get(1)->GetOUString() );
+ sal_Int32 nResultLen = rPar.Get(2)->GetLong();
+ if( nResultLen < 0 )
{
- lResultLen = 0xffff;
+ nResultLen = 0;
+ StarBASIC::Error( SbERR_BAD_ARGUMENT );
}
- else if( lResultLen < 0 )
+ else if(nResultLen > aStr.getLength())
{
- lResultLen = 0;
- StarBASIC::Error( SbERR_BAD_ARGUMENT );
+ nResultLen = aStr.getLength();
}
- aStr.Erase( (sal_uInt16)lResultLen );
+ aStr = aStr.copy(0, nResultLen );
rPar.Get(0)->PutString( aStr );
}
}
@@ -1199,7 +1185,7 @@ RTLFUNC(Mid)
(void)pBasic;
(void)bWrite;
- sal_uIntPtr nArgCount = rPar.Count()-1;
+ int nArgCount = rPar.Count()-1;
if ( nArgCount < 2 )
{
StarBASIC::Error( SbERR_BAD_ARGUMENT );
@@ -1211,41 +1197,46 @@ RTLFUNC(Mid)
// In contrast to the original the third parameter (nLength)
// can't be left out here. That's considered in bWrite already.
if( nArgCount == 4 )
+ {
bWrite = sal_True;
-
- String aArgStr = rPar.Get(1)->GetString();
- sal_uInt16 nStartPos = (sal_uInt16)(rPar.Get(2)->GetLong() );
+ }
+ OUString aArgStr = rPar.Get(1)->GetOUString();
+ sal_Int32 nStartPos = rPar.Get(2)->GetLong();
if ( nStartPos == 0 )
+ {
StarBASIC::Error( SbERR_BAD_ARGUMENT );
+ }
else
{
nStartPos--;
- sal_uInt16 nLen = 0xffff;
+ sal_Int32 nLen = -1;
bool bWriteNoLenParam = false;
if ( nArgCount == 3 || bWrite )
{
sal_Int32 n = rPar.Get(3)->GetLong();
if( bWrite && n == -1 )
+ {
bWriteNoLenParam = true;
- nLen = (sal_uInt16)n;
+ }
+ nLen = n;
}
- String aResultStr;
if ( bWrite )
{
+ OUStringBuffer aResultStr;
SbiInstance* pInst = GetSbData()->pInst;
bool bCompatibility = ( pInst && pInst->IsCompatibility() );
if( bCompatibility )
{
- sal_uInt16 nArgLen = aArgStr.Len();
+ sal_Int32 nArgLen = aArgStr.getLength();
if( nStartPos + 1 > nArgLen )
{
StarBASIC::Error( SbERR_BAD_ARGUMENT );
return;
}
- String aReplaceStr = rPar.Get(4)->GetString();
- sal_uInt16 nReplaceStrLen = aReplaceStr.Len();
- sal_uInt16 nReplaceLen;
+ OUString aReplaceStr = rPar.Get(4)->GetOUString();
+ sal_Int32 nReplaceStrLen = aReplaceStr.getLength();
+ sal_Int32 nReplaceLen;
if( bWriteNoLenParam )
{
nReplaceLen = nReplaceStrLen;
@@ -1253,31 +1244,35 @@ RTLFUNC(Mid)
else
{
nReplaceLen = nLen;
- if( nReplaceLen > nReplaceStrLen )
+ if( nReplaceLen < 0 || nReplaceLen > nReplaceStrLen )
+ {
nReplaceLen = nReplaceStrLen;
+ }
}
- sal_uInt16 nReplaceEndPos = nStartPos + nReplaceLen;
+ sal_Int32 nReplaceEndPos = nStartPos + nReplaceLen;
if( nReplaceEndPos > nArgLen )
+ {
nReplaceLen -= (nReplaceEndPos - nArgLen);
-
+ }
aResultStr = aArgStr;
- sal_uInt16 nErase = nReplaceLen;
- aResultStr.Erase( nStartPos, nErase );
- aResultStr.Insert( aReplaceStr, 0, nReplaceLen, nStartPos );
+ sal_Int32 nErase = nReplaceLen;
+ aResultStr.remove( nStartPos, nErase );
+ aResultStr.insert( nStartPos, aReplaceStr.getStr(), nReplaceLen);
}
else
{
aResultStr = aArgStr;
- aResultStr.Erase( nStartPos, nLen );
- aResultStr.Insert(rPar.Get(4)->GetString(),0,nLen,nStartPos);
+ aResultStr.remove( nStartPos, nLen );
+ aResultStr.insert( nStartPos, rPar.Get(4)->GetOUString().getStr(), nLen);
}
- rPar.Get(1)->PutString( aResultStr );
+ rPar.Get(1)->PutString( aResultStr.makeStringAndClear() );
}
else
{
- aResultStr = aArgStr.Copy( nStartPos, nLen );
+ OUString aResultStr;
+ aResultStr = aArgStr.copy( nStartPos, nLen );
rPar.Get(0)->PutString( aResultStr );
}
}
@@ -1323,9 +1318,9 @@ RTLFUNC(Replace)
}
else
{
- String aExpStr = rPar.Get(1)->GetString();
- String aFindStr = rPar.Get(2)->GetString();
- String aReplaceStr = rPar.Get(3)->GetString();
+ OUString aExpStr = rPar.Get(1)->GetOUString();
+ OUString aFindStr = rPar.Get(2)->GetOUString();
+ OUString aReplaceStr = rPar.Get(3)->GetOUString();
sal_Int32 lStartPos = 1;
if ( nArgCount >= 4 )
@@ -1334,7 +1329,7 @@ RTLFUNC(Replace)
{
lStartPos = rPar.Get(4)->GetLong();
}
- if( lStartPos < 1 || lStartPos > 0xffff )
+ if( lStartPos < 1)
{
StarBASIC::Error( SbERR_BAD_ARGUMENT );
lStartPos = 1;
@@ -1348,7 +1343,7 @@ RTLFUNC(Replace)
{
lCount = rPar.Get(5)->GetLong();
}
- if( lCount < -1 || lCount > 0xffff )
+ if( lCount < -1)
{
StarBASIC::Error( SbERR_BAD_ARGUMENT );
lCount = -1;
@@ -1368,28 +1363,29 @@ RTLFUNC(Replace)
bTextMode = 1;
}
if ( nArgCount == 6 )
+ {
bTextMode = rPar.Get(6)->GetInteger();
-
- sal_uInt16 nExpStrLen = aExpStr.Len();
- sal_uInt16 nFindStrLen = aFindStr.Len();
- sal_uInt16 nReplaceStrLen = aReplaceStr.Len();
+ }
+ sal_Int32 nExpStrLen = aExpStr.getLength();
+ sal_Int32 nFindStrLen = aFindStr.getLength();
+ sal_Int32 nReplaceStrLen = aReplaceStr.getLength();
if( lStartPos <= nExpStrLen )
{
- sal_uInt16 nPos = static_cast<sal_uInt16>( lStartPos - 1 );
- sal_uInt16 nCounts = 0;
+ sal_Int32 nPos = lStartPos - 1;
+ sal_Int32 nCounts = 0;
while( lCount == -1 || lCount > nCounts )
{
- String aSrcStr( aExpStr );
+ OUString aSrcStr( aExpStr );
if( bTextMode )
{
- aSrcStr.ToUpperAscii();
- aFindStr.ToUpperAscii();
+ aSrcStr = aSrcStr.toAsciiUpperCase();
+ aFindStr = aFindStr.toAsciiUpperCase();
}
- nPos = aSrcStr.Search( aFindStr, nPos );
- if( nPos != STRING_NOTFOUND )
+ nPos = aSrcStr.indexOf( aFindStr, nPos );
+ if( nPos >= 0 )
{
- aExpStr.Replace( nPos, nFindStrLen, aReplaceStr );
+ aExpStr = aExpStr.replaceAt( nPos, nFindStrLen, aReplaceStr );
nPos = nPos - nFindStrLen + nReplaceStrLen + 1;
nCounts++;
}
@@ -1399,7 +1395,7 @@ RTLFUNC(Replace)
}
}
}
- rPar.Get(0)->PutString( aExpStr.Copy( static_cast<sal_uInt16>(lStartPos - 1) ) );
+ rPar.Get(0)->PutString( aExpStr.copy( lStartPos - 1 ) );
}
}
@@ -1491,7 +1487,7 @@ RTLFUNC(Space)
}
else
{
- rtl::OUStringBuffer aBuf;
+ OUStringBuffer aBuf;
string::padToLength(aBuf, rPar.Get(1)->GetLong(), ' ');
rPar.Get(0)->PutString(aBuf.makeStringAndClear());
}
@@ -1508,7 +1504,7 @@ RTLFUNC(Spc)
}
else
{
- rtl::OUStringBuffer aBuf;
+ OUStringBuffer aBuf;
string::padToLength(aBuf, rPar.Get(1)->GetLong(), ' ');
rPar.Get(0)->PutString(aBuf.makeStringAndClear());
}
@@ -1548,7 +1544,8 @@ RTLFUNC(Str)
}
else
{
- String aStr;
+ OUString aStr;
+ OUString aStrNew("");
SbxVariableRef pArg = rPar.Get( 1 );
pArg->Format( aStr );
@@ -1556,34 +1553,47 @@ RTLFUNC(Str)
if( pArg->IsNumericRTL() )
{
// replace commas by points so that it's symmetric to Val!
- aStr.SearchAndReplace( ',', '.' );
+ aStr = aStr.replaceFirst( ",", "." );
SbiInstance* pInst = GetSbData()->pInst;
bool bCompatibility = ( pInst && pInst->IsCompatibility() );
if( bCompatibility )
{
- xub_StrLen nLen = aStr.Len();
+ sal_Int32 nLen = aStr.getLength();
- const sal_Unicode* pBuf = aStr.GetBuffer();
+ const sal_Unicode* pBuf = aStr.getStr();
bool bNeg = ( pBuf[0] == '-' );
- sal_uInt16 iZeroSearch = 0;
+ sal_Int32 iZeroSearch = 0;
if( bNeg )
+ {
+ aStrNew += "-";
iZeroSearch++;
-
- sal_uInt16 iNext = iZeroSearch + 1;
+ }
+ else
+ {
+ if( pBuf[0] != ' ' )
+ {
+ aStrNew += " ";
+ }
+ }
+ sal_Int32 iNext = iZeroSearch + 1;
if( pBuf[iZeroSearch] == '0' && nLen > iNext && pBuf[iNext] == '.' )
{
- aStr.Erase( iZeroSearch, 1 );
- pBuf = aStr.GetBuffer();
+ iZeroSearch += 1;
}
- if( !bNeg )
- aStr.Insert( ' ', 0 );
+ aStrNew += aStr.copy(iZeroSearch);
}
else
- aStr.Insert( ' ', 0 );
+ {
+ aStrNew = " " + aStr;
+ }
}
- rPar.Get(0)->PutString( aStr );
+ else
+ {
+ aStrNew = aStr;
+ }
+ rPar.Get(0)->PutString( aStrNew );
}
}
@@ -1598,8 +1608,8 @@ RTLFUNC(StrComp)
rPar.Get(0)->PutEmpty();
return;
}
- const String& rStr1 = rPar.Get(1)->GetString();
- const String& rStr2 = rPar.Get(2)->GetString();
+ const OUString& rStr1 = rPar.Get(1)->GetOUString();
+ const OUString& rStr2 = rPar.Get(2)->GetOUString();
SbiInstance* pInst = GetSbData()->pInst;
sal_Int16 nTextCompare;
@@ -1617,9 +1627,9 @@ RTLFUNC(StrComp)
nTextCompare = rPar.Get(3)->GetInteger();
if( !bCompatibility )
+ {
nTextCompare = !nTextCompare;
-
- StringCompare aResult;
+ }
sal_Int32 nRetValue = 0;
if( nTextCompare )
{
@@ -1640,13 +1650,17 @@ RTLFUNC(StrComp)
}
else
{
- aResult = rStr1.CompareTo( rStr2 );
- if ( aResult == COMPARE_LESS )
+ sal_Int32 aResult;
+ aResult = rStr1.compareTo( rStr2 );
+ if ( aResult < 0 )
+ {
nRetValue = -1;
- else if ( aResult == COMPARE_GREATER )
+ }
+ else if ( aResult > 0)
+ {
nRetValue = 1;
+ }
}
-
rPar.Get(0)->PutInteger( sal::static_int_cast< sal_Int16 >( nRetValue ) );
}
@@ -1664,17 +1678,20 @@ RTLFUNC(String)
sal_Unicode aFiller;
sal_Int32 lCount = rPar.Get(1)->GetLong();
if( lCount < 0 || lCount > 0xffff )
+ {
StarBASIC::Error( SbERR_BAD_ARGUMENT );
- sal_uInt16 nCount = (sal_uInt16)lCount;
+ }
if( rPar.Get(2)->GetType() == SbxINTEGER )
+ {
aFiller = (sal_Unicode)rPar.Get(2)->GetInteger();
+ }
else
{
- const String& rStr = rPar.Get(2)->GetString();
- aFiller = rStr.GetBuffer()[0];
+ const OUString& rStr = rPar.Get(2)->GetOUString();
+ aFiller = rStr[0];
}
- rtl::OUStringBuffer aBuf;
- string::padToLength(aBuf, nCount, aFiller);
+ OUStringBuffer aBuf(lCount);
+ string::padToLength(aBuf, lCount, aFiller);
rPar.Get(0)->PutString(aBuf.makeStringAndClear());
}
}
@@ -1707,7 +1724,7 @@ RTLFUNC(UCase)
else
{
const CharClass& rCharClass = GetCharClass();
- String aStr( rPar.Get(1)->GetString() );
+ OUString aStr( rPar.Get(1)->GetOUString() );
aStr = rCharClass.uppercase( aStr );
rPar.Get(0)->PutString( aStr );
}
@@ -1728,13 +1745,13 @@ RTLFUNC(Val)
double nResult = 0.0;
char* pEndPtr;
- String aStr( rPar.Get(1)->GetString() );
+ OUString aStr( rPar.Get(1)->GetOUString() );
FilterWhiteSpace( aStr );
- if ( aStr.GetBuffer()[0] == '&' && aStr.Len() > 1 )
+ if ( aStr[0] == '&' && aStr.getLength() > 1 )
{
int nRadix = 10;
- char aChar = (char)aStr.GetBuffer()[1];
+ char aChar = (char)aStr[1];
if ( aChar == 'h' || aChar == 'H' )
{
nRadix = 16;
@@ -1745,7 +1762,7 @@ RTLFUNC(Val)
}
if ( nRadix != 10 )
{
- rtl::OString aByteStr(rtl::OUStringToOString(aStr, osl_getThreadTextEncoding()));
+ OString aByteStr(rtl::OUStringToOString(aStr, osl_getThreadTextEncoding()));
sal_Int16 nlResult = (sal_Int16)strtol( aByteStr.getStr()+2, &pEndPtr, nRadix);
nResult = (double)nlResult;
}
@@ -1807,7 +1824,7 @@ RTLFUNC(CDateToIso)
implGetDateYear( aDate ),
implGetDateMonth( aDate ),
implGetDateDay( aDate ) );
- String aRetStr = rtl::OUString::createFromAscii( Buffer );
+ OUString aRetStr = rtl::OUString::createFromAscii( Buffer );
rPar.Get(0)->PutString( aRetStr );
}
else
@@ -1824,15 +1841,15 @@ RTLFUNC(CDateFromIso)
if ( rPar.Count() == 2 )
{
- String aStr = rPar.Get(1)->GetString();
- sal_Int16 iMonthStart = aStr.Len() - 4;
- String aYearStr = aStr.Copy( 0, iMonthStart );
- String aMonthStr = aStr.Copy( iMonthStart, 2 );
- String aDayStr = aStr.Copy( iMonthStart+2, 2 );
+ OUString aStr = rPar.Get(1)->GetOUString();
+ sal_Int16 iMonthStart = aStr.getLength() - 4;
+ OUString aYearStr = aStr.copy( 0, iMonthStart );
+ OUString aMonthStr = aStr.copy( iMonthStart, 2 );
+ OUString aDayStr = aStr.copy( iMonthStart+2, 2 );
double dDate;
- if( implDateSerial( (sal_Int16)aYearStr.ToInt32(),
- (sal_Int16)aMonthStr.ToInt32(), (sal_Int16)aDayStr.ToInt32(), dDate ) )
+ if( implDateSerial( (sal_Int16)aYearStr.toInt32(),
+ (sal_Int16)aMonthStr.toInt32(), (sal_Int16)aDayStr.toInt32(), dDate ) )
{
rPar.Get(0)->PutDate( dDate );
}
@@ -1922,7 +1939,7 @@ RTLFUNC(DateValue)
sal_uInt32 nIndex;
double fResult;
- String aStr( rPar.Get(1)->GetString() );
+ OUString aStr( rPar.Get(1)->GetOUString() );
sal_Bool bSuccess = pFormatter->IsNumberFormat( aStr, nIndex, fResult );
short nType = pFormatter->GetType( nIndex );
@@ -1991,7 +2008,7 @@ RTLFUNC(TimeValue)
sal_uInt32 nIndex;
double fResult;
- sal_Bool bSuccess = pFormatter->IsNumberFormat( rPar.Get(1)->GetString(),
+ sal_Bool bSuccess = pFormatter->IsNumberFormat( rPar.Get(1)->GetOUString(),
nIndex, fResult );
short nType = pFormatter->GetType(nIndex);
if(bSuccess && (nType==NUMBERFORMAT_TIME||nType==NUMBERFORMAT_DATETIME))
@@ -2180,13 +2197,13 @@ RTLFUNC(Time)
{
Time aTime( Time::SYSTEM );
SbxVariable* pMeth = rPar.Get( 0 );
- String aRes;
+ OUString aRes;
if( pMeth->IsFixed() )
{
// Time$: hh:mm:ss
char buf[ 20 ];
snprintf( buf, sizeof(buf), "%02d:%02d:%02d",
- aTime.GetHour(), aTime.GetMin(), aTime.GetSec() );
+ aTime.GetHour(), aTime.GetMin(), aTime.GetSec() );
aRes = rtl::OUString::createFromAscii( buf );
}
else
@@ -2253,7 +2270,7 @@ RTLFUNC(Date)
SbxVariable* pMeth = rPar.Get( 0 );
if( pMeth->IsString() )
{
- String aRes;
+ OUString aRes;
Color* pCol;
SvNumberFormatter* pFormatter = NULL;
@@ -2496,7 +2513,7 @@ RTLFUNC(IsMissing)
}
// Function looks for wildcards, removes them and always returns the pure path
-String implSetupWildcard( const String& rFileParam, SbiRTLData* pRTLData )
+OUString implSetupWildcard( const OUString& rFileParam, SbiRTLData* pRTLData )
{
static sal_Char cDelim1 = (sal_Char)'/';
static sal_Char cDelim2 = (sal_Char)'\\';
@@ -2505,47 +2522,54 @@ String implSetupWildcard( const String& rFileParam, SbiRTLData* pRTLData )
delete pRTLData->pWildCard;
pRTLData->pWildCard = NULL;
- pRTLData->sFullNameToBeChecked = String();
-
- String aFileParam = rFileParam;
- xub_StrLen nLastWild = aFileParam.SearchBackward( cWild1 );
- if( nLastWild == STRING_NOTFOUND )
- nLastWild = aFileParam.SearchBackward( cWild2 );
- bool bHasWildcards = ( nLastWild != STRING_NOTFOUND );
+ pRTLData->sFullNameToBeChecked = OUString();
+ OUString aFileParam = rFileParam;
+ sal_Int32 nLastWild = aFileParam.lastIndexOf( cWild1 );
+ if( nLastWild < 0 )
+ {
+ nLastWild = aFileParam.lastIndexOf( cWild2 );
+ }
+ bool bHasWildcards = ( nLastWild >= 0 );
- xub_StrLen nLastDelim = aFileParam.SearchBackward( cDelim1 );
- if( nLastDelim == STRING_NOTFOUND )
- nLastDelim = aFileParam.SearchBackward( cDelim2 );
+ sal_Int32 nLastDelim = aFileParam.lastIndexOf( cDelim1 );
+ if( nLastDelim < 0 )
+ {
+ nLastDelim = aFileParam.lastIndexOf( cDelim2 );
+ }
if( bHasWildcards )
{
// Wildcards in path?
- if( nLastDelim != STRING_NOTFOUND && nLastDelim > nLastWild )
+ if( nLastDelim >= 0 && nLastDelim > nLastWild )
+ {
return aFileParam;
+ }
}
else
{
- String aPathStr = getFullPath( aFileParam );
- if( nLastDelim != aFileParam.Len() - 1 )
+ OUString aPathStr = getFullPath( aFileParam );
+ if( nLastDelim != aFileParam.getLength() - 1 )
+ {
pRTLData->sFullNameToBeChecked = aPathStr;
+ }
return aPathStr;
}
- rtl::OUString aPureFileName;
- if( nLastDelim == STRING_NOTFOUND )
+ OUString aPureFileName;
+ if( nLastDelim < 0 )
{
aPureFileName = aFileParam;
- aFileParam = String();
+ aFileParam = OUString();
}
else
{
- aPureFileName = aFileParam.Copy( nLastDelim + 1 );
- aFileParam = aFileParam.Copy( 0, nLastDelim );
+ aPureFileName = aFileParam.copy( nLastDelim + 1 );
+ aFileParam = aFileParam.copy( 0, nLastDelim );
}
// Try again to get a valid URL/UNC-path with only the path
- String aPathStr = getFullPath( aFileParam );
+ OUString aPathStr = getFullPath( aFileParam );
// Is there a pure file name left? Otherwise the path is
// invalid anyway because it was not accepted by OSL before
@@ -2556,7 +2580,7 @@ String implSetupWildcard( const String& rFileParam, SbiRTLData* pRTLData )
return aPathStr;
}
-inline sal_Bool implCheckWildcard( const String& rName, SbiRTLData* pRTLData )
+inline sal_Bool implCheckWildcard( const OUString& rName, SbiRTLData* pRTLData )
{
sal_Bool bMatch = sal_True;
@@ -2568,7 +2592,7 @@ inline sal_Bool implCheckWildcard( const String& rName, SbiRTLData* pRTLData )
}
-bool isRootDir( String aDirURLStr )
+bool isRootDir( OUString aDirURLStr )
{
INetURLObject aDirURLObj( aDirURLStr );
bool bRoot = false;
@@ -2604,7 +2628,7 @@ RTLFUNC(Dir)
(void)pBasic;
(void)bWrite;
- String aPath;
+ OUString aPath;
sal_uInt16 nParCount = rPar.Count();
if( nParCount > 3 )
@@ -2628,21 +2652,21 @@ RTLFUNC(Dir)
{
if ( nParCount >= 2 )
{
- String aFileParam = rPar.Get(1)->GetString();
+ OUString aFileParam = rPar.Get(1)->GetOUString();
- String aFileURLStr = implSetupWildcard( aFileParam, pRTLData );
- if( pRTLData->sFullNameToBeChecked.Len() > 0 )
+ OUString aFileURLStr = implSetupWildcard( aFileParam, pRTLData );
+ if( !pRTLData->sFullNameToBeChecked.isEmpty())
{
sal_Bool bExists = sal_False;
try { bExists = xSFI->exists( aFileURLStr ); }
catch(const Exception & ) {}
- String aNameOnlyStr;
+ OUString aNameOnlyStr;
if( bExists )
{
INetURLObject aFileURL( aFileURLStr );
aNameOnlyStr = aFileURL.getName( INetURLObject::LAST_SEGMENT,
- true, INetURLObject::DECODE_WITH_CHARSET );
+ true, INetURLObject::DECODE_WITH_CHARSET );
}
rPar.Get(0)->PutString( aNameOnlyStr );
return;
@@ -2650,7 +2674,7 @@ RTLFUNC(Dir)
try
{
- String aDirURLStr;
+ OUString aDirURLStr;
sal_Bool bFolder = xSFI->isFolder( aFileURLStr );
if( bFolder )
@@ -2659,7 +2683,7 @@ RTLFUNC(Dir)
}
else
{
- String aEmptyStr;
+ OUString aEmptyStr;
rPar.Get(0)->PutString( aEmptyStr );
}
@@ -2721,7 +2745,7 @@ RTLFUNC(Dir)
else if( pRTLData->nCurDirPos >= pRTLData->aDirSeq.getLength() )
{
pRTLData->aDirSeq.realloc( 0 );
- aPath.Erase();
+ aPath = "";
break;
}
else
@@ -2773,9 +2797,9 @@ RTLFUNC(Dir)
// TODO: OSL
if ( nParCount >= 2 )
{
- String aFileParam = rPar.Get(1)->GetString();
+ OUString aFileParam = rPar.Get(1)->GetOUString();
- String aDirURL = implSetupWildcard( aFileParam, pRTLData );
+ OUString aDirURL = implSetupWildcard( aFileParam, pRTLData );
sal_uInt16 nFlags = 0;
if ( nParCount > 2 )
@@ -2795,7 +2819,7 @@ RTLFUNC(Dir)
{
delete pRTLData->pDir;
pRTLData->pDir = NULL;
- rPar.Get(0)->PutString( String() );
+ rPar.Get(0)->PutString( OUString() );
return;
}
@@ -2842,7 +2866,7 @@ RTLFUNC(Dir)
{
delete pRTLData->pDir;
pRTLData->pDir = NULL;
- aPath.Erase();
+ aPath = "";
break;
}
@@ -2892,12 +2916,12 @@ RTLFUNC(GetAttr)
#if defined( WNT )
if( SbiRuntime::isVBAEnabled() )
{
- DirEntry aEntry( rPar.Get(1)->GetString() );
+ DirEntry aEntry( rPar.Get(1)->GetOUString() );
aEntry.ToAbs();
// #57064 extract the real-path for virtual URLs
- rtl::OString aByteStrFullPath(rtl::OUStringToOString(aEntry.GetFull(),
- osl_getThreadTextEncoding()));
+ OString aByteStrFullPath(rtl::OUStringToOString(aEntry.GetFull(),
+ osl_getThreadTextEncoding()));
DWORD nRealFlags = GetFileAttributes (aByteStrFullPath.getStr());
if (nRealFlags != 0xffffffff)
{
@@ -2924,7 +2948,7 @@ RTLFUNC(GetAttr)
{
try
{
- String aPath = getFullPath( rPar.Get(1)->GetString() );
+ OUString aPath = getFullPath( rPar.Get(1)->GetOUString() );
sal_Bool bExists = sal_False;
try { bExists = xSFI->exists( aPath ); }
catch(const Exception & ) {}
@@ -2959,7 +2983,7 @@ RTLFUNC(GetAttr)
else
{
DirectoryItem aItem;
- DirectoryItem::get( getFullPathUNC( rPar.Get(1)->GetString() ), aItem );
+ DirectoryItem::get( getFullPathUNC( rPar.Get(1)->GetOUString() ), aItem );
FileStatus aFileStatus( osl_FileStatus_Mask_Attributes | osl_FileStatus_Mask_Type );
aItem.getFileStatus( aFileStatus );
sal_uInt64 nAttributes = aFileStatus.getAttributes();
@@ -2996,7 +3020,7 @@ RTLFUNC(FileDateTime)
}
else
{
- String aPath = rPar.Get(1)->GetString();
+ OUString aPath = rPar.Get(1)->GetOUString();
Time aTime( Time::EMPTY );
Date aDate( Date::EMPTY );
if( hasUno() )
@@ -3053,7 +3077,7 @@ RTLFUNC(FileDateTime)
SbiInstance::PrepareNumberFormatter( pFormatter, n, n, nIndex );
}
- String aRes;
+ OUString aRes;
pFormatter->GetOutputString( fSerial, nIndex, aRes, &pCol );
rPar.Get(0)->PutString( aRes );
@@ -3281,14 +3305,14 @@ RTLFUNC(Format)
}
else
{
- String aResult;
+ OUString aResult;
if( nArgCount == 2 )
{
rPar.Get(1)->Format( aResult );
}
else
{
- String aFmt( rPar.Get(2)->GetString() );
+ OUString aFmt( rPar.Get(2)->GetOUString() );
rPar.Get(1)->Format( aResult, &aFmt );
}
rPar.Get(0)->PutString( aResult );
@@ -3365,64 +3389,66 @@ RTLFUNC(Shell)
{
oslProcessOption nOptions = osl_Process_SEARCHPATH | osl_Process_DETACHED;
- String aCmdLine = rPar.Get(1)->GetString();
+ OUString aCmdLine = rPar.Get(1)->GetOUString();
// attach additional parameters - everything must be parsed anyway
if( nArgCount >= 4 )
{
- aCmdLine.AppendAscii( " " );
- aCmdLine += rPar.Get(3)->GetString();
+ aCmdLine += " ";
+ aCmdLine += rPar.Get(3)->GetOUString();
}
- else if( !aCmdLine.Len() )
+ else if( aCmdLine.isEmpty() )
{
// avaoid special treatment (empty list)
- aCmdLine.AppendAscii( " " );
+ aCmdLine += " ";
}
- sal_uInt16 nLen = aCmdLine.Len();
+ sal_Int32 nLen = aCmdLine.getLength();
// #55735 if there are parameters, they have to be seperated
// #72471 also seperate the single parameters
std::list<String> aTokenList;
- String aToken;
- sal_uInt16 i = 0;
+ OUString aToken;
+ sal_Int32 i = 0;
sal_Unicode c;
while( i < nLen )
{
for ( ;; ++i )
{
- c = aCmdLine.GetBuffer()[ i ];
+ c = aCmdLine[ i ];
if ( c != ' ' && c != '\t' )
+ {
break;
+ }
}
if( c == '\"' || c == '\'' )
{
- sal_uInt16 iFoundPos = aCmdLine.Search( c, i + 1 );
+ sal_Int32 iFoundPos = aCmdLine.indexOf( c, i + 1 );
- if( iFoundPos == STRING_NOTFOUND )
+ if( iFoundPos < 0 )
{
- aToken = aCmdLine.Copy( i, STRING_LEN );
+ aToken = aCmdLine.copy( i);
i = nLen;
}
else
{
- aToken = aCmdLine.Copy( i + 1, (iFoundPos - i - 1) );
+ aToken = aCmdLine.copy( i + 1, (iFoundPos - i - 1) );
i = iFoundPos + 1;
}
}
else
{
- sal_uInt16 iFoundSpacePos = aCmdLine.Search( ' ', i );
- sal_uInt16 iFoundTabPos = aCmdLine.Search( '\t', i );
- sal_uInt16 iFoundPos = Min( iFoundSpacePos, iFoundTabPos );
+ sal_Int32 iFoundSpacePos = aCmdLine.indexOf( ' ', i );
+ sal_Int32 iFoundTabPos = aCmdLine.indexOf( '\t', i );
+ sal_Int32 iFoundPos = iFoundSpacePos >= 0 ? iFoundTabPos >= 0 ? Min( iFoundSpacePos, iFoundTabPos ) : iFoundSpacePos : -1;
- if( iFoundPos == STRING_NOTFOUND )
+ if( iFoundPos < 0 )
{
- aToken = aCmdLine.Copy( i, STRING_LEN );
+ aToken = aCmdLine.copy( i );
i = nLen;
}
else
{
- aToken = aCmdLine.Copy( i, (iFoundPos - i) );
+ aToken = aCmdLine.copy( i, (iFoundPos - i) );
i = iFoundPos;
}
}
@@ -3462,22 +3488,21 @@ RTLFUNC(Shell)
// #72471 work parameter(s) up
std::list<String>::const_iterator iter = aTokenList.begin();
- const String& rStr = *iter;
- ::rtl::OUString aOUStrProg( rStr.GetBuffer(), rStr.Len() );
- ::rtl::OUString aOUStrProgUNC = getFullPathUNC( aOUStrProg );
+ const OUString& rStr = *iter;
+ OUString aOUStrProg( rStr.getStr(), rStr.getLength() );
+ OUString aOUStrProgUNC = getFullPathUNC( aOUStrProg );
++iter;
- sal_uInt16 nParamCount = sal::static_int_cast< sal_uInt16 >(
- aTokenList.size() - 1 );
+ sal_uInt16 nParamCount = sal::static_int_cast< sal_uInt16 >(aTokenList.size() - 1 );
rtl_uString** pParamList = NULL;
if( nParamCount )
{
pParamList = new rtl_uString*[nParamCount];
for(int iList = 0; iter != aTokenList.end(); ++iList, ++iter)
{
- const String& rParamStr = (*iter);
- const ::rtl::OUString aTempStr( rParamStr.GetBuffer(), rParamStr.Len());
+ const OUString& rParamStr = (*iter);
+ const OUString aTempStr( rParamStr.getStr(), rParamStr.getLength());
pParamList[iList] = NULL;
rtl_uString_assign(&(pParamList[iList]), aTempStr.pData);
}
@@ -3530,7 +3555,7 @@ RTLFUNC(VarType)
}
// Exported function
-rtl::OUString getBasicTypeName( SbxDataType eType )
+OUString getBasicTypeName( SbxDataType eType )
{
static const char* pTypeNames[] =
{
@@ -3590,7 +3615,9 @@ String getObjectTypeName( SbxVariable* pVar )
{
SbxBase* pObj = pVar->GetObject();
if( !pObj )
- sRet = String( RTL_CONSTASCII_USTRINGPARAM("Nothing") );
+ {
+ sRet = OUString("Nothing");
+ }
else
{
SbUnoObject* pUnoObj = PTR_CAST(SbUnoObject,pVar );
@@ -3662,7 +3689,7 @@ RTLFUNC(TypeName)
SbxDataType eType = rPar.Get(1)->GetType();
bool bIsArray = ( ( eType & SbxARRAY ) != 0 );
- String aRetStr;
+ OUString aRetStr;
if ( SbiRuntime::isVBAEnabled() && eType == SbxOBJECT )
{
aRetStr = getObjectTypeName( rPar.Get(1) );
@@ -3672,7 +3699,9 @@ RTLFUNC(TypeName)
aRetStr = getBasicTypeName( eType );
}
if( bIsArray )
- aRetStr.AppendAscii( "()" );
+ {
+ aRetStr += "()";
+ }
rPar.Get(0)->PutString( aRetStr );
}
}
@@ -3688,8 +3717,8 @@ RTLFUNC(Len)
}
else
{
- const String& rStr = rPar.Get(1)->GetString();
- rPar.Get(0)->PutLong( (sal_Int32)rStr.Len() );
+ const OUString& rStr = rPar.Get(1)->GetOUString();
+ rPar.Get(0)->PutLong( rStr.getLength() );
}
}
@@ -3711,8 +3740,8 @@ RTLFUNC(DDEInitiate)
StarBASIC::Error( SbERR_BAD_ARGUMENT );
return;
}
- const OUString& rApp = rPar.Get(1)->GetString();
- const OUString& rTopic = rPar.Get(2)->GetString();
+ const OUString& rApp = rPar.Get(1)->GetOUString();
+ const OUString& rTopic = rPar.Get(2)->GetOUString();
SbiDdeControl* pDDE = GetSbData()->pInst->GetDdeControl();
size_t nChannel;
@@ -3802,7 +3831,7 @@ RTLFUNC(DDERequest)
return;
}
size_t nChannel = rPar.Get(1)->GetInteger();
- const OUString& rItem = rPar.Get(2)->GetString();
+ const OUString& rItem = rPar.Get(2)->GetOUString();
SbiDdeControl* pDDE = GetSbData()->pInst->GetDdeControl();
OUString aResult;
SbError nDdeErr = pDDE->Request( nChannel, rItem, aResult );
@@ -3836,7 +3865,7 @@ RTLFUNC(DDEExecute)
return;
}
size_t nChannel = rPar.Get(1)->GetInteger();
- const OUString& rCommand = rPar.Get(2)->GetString();
+ const OUString& rCommand = rPar.Get(2)->GetOUString();
SbiDdeControl* pDDE = GetSbData()->pInst->GetDdeControl();
SbError nDdeErr = pDDE->Execute( nChannel, rCommand );
if( nDdeErr )
@@ -3865,8 +3894,8 @@ RTLFUNC(DDEPoke)
return;
}
size_t nChannel = rPar.Get(1)->GetInteger();
- const OUString& rItem = rPar.Get(2)->GetString();
- const OUString& rData = rPar.Get(3)->GetString();
+ const OUString& rItem = rPar.Get(2)->GetOUString();
+ const OUString& rData = rPar.Get(3)->GetOUString();
SbiDdeControl* pDDE = GetSbData()->pInst->GetDdeControl();
SbError nDdeErr = pDDE->Poke( nChannel, rItem, rData );
if( nDdeErr )
@@ -4037,12 +4066,12 @@ RTLFUNC(StrConv)
return;
}
- String aOldStr = rPar.Get(1)->GetString();
+ OUString aOldStr = rPar.Get(1)->GetOUString();
sal_Int32 nConversion = rPar.Get(2)->GetLong();
sal_uInt16 nLanguage = LANGUAGE_SYSTEM;
- sal_uInt16 nOldLen = aOldStr.Len();
+ sal_Int32 nOldLen = aOldStr.getLength();
if( nOldLen == 0 )
{
// null string,return
@@ -4054,7 +4083,7 @@ RTLFUNC(StrConv)
if ( (nConversion & 0x03) == 3 ) // vbProperCase
{
const CharClass& rCharClass = GetCharClass();
- aOldStr = rCharClass.titlecase( aOldStr.ToLowerAscii(), 0, nOldLen );
+ aOldStr = rCharClass.titlecase( aOldStr.toAsciiLowerCase(), 0, nOldLen );
}
else if ( (nConversion & 0x01) == 1 ) // vbUpperCase
{
@@ -4077,9 +4106,10 @@ RTLFUNC(StrConv)
nType |= i18n::TransliterationModules_HIRAGANA_KATAKANA;
}
else if ( (nConversion & 0x20) == 32 ) // vbHiragana
+ {
nType |= i18n::TransliterationModules_KATAKANA_HIRAGANA;
-
- String aNewStr( aOldStr );
+ }
+ OUString aNewStr( aOldStr );
if( nType != 0 )
{
uno::Reference< uno::XComponentContext > xContext = getProcessComponentContext();
@@ -4092,32 +4122,33 @@ RTLFUNC(StrConv)
if ( (nConversion & 0x40) == 64 ) // vbUnicode
{
// convert the string to byte string, preserving unicode (2 bytes per character)
- sal_uInt16 nSize = aNewStr.Len()*2;
- const sal_Unicode* pSrc = aNewStr.GetBuffer();
+ sal_Int32 nSize = aNewStr.getLength()*2;
+ const sal_Unicode* pSrc = aNewStr.getStr();
sal_Char* pChar = new sal_Char[nSize+1];
- for( sal_uInt16 i=0; i < nSize; i++ )
+ for( sal_Int32 i=0; i < nSize; i++ )
{
pChar[i] = static_cast< sal_Char >( (i%2) ? ((*pSrc) >> 8) & 0xff : (*pSrc) & 0xff );
if( i%2 )
+ {
pSrc++;
+ }
}
pChar[nSize] = '\0';
::rtl::OString aOStr(pChar);
delete[] pChar;
// there is no concept about default codepage in unix. so it is incorrectly in unix
- ::rtl::OUString aOUStr = ::rtl::OStringToOUString(aOStr, osl_getThreadTextEncoding());
- aNewStr = String(aOUStr);
- rPar.Get(0)->PutString( aNewStr );
+ OUString aOUStr = ::rtl::OStringToOUString(aOStr, osl_getThreadTextEncoding());
+ rPar.Get(0)->PutString( aOUStr );
return;
}
else if ( (nConversion & 0x80) == 128 ) // vbFromUnicode
{
- ::rtl::OUString aOUStr(aNewStr);
+ OUString aOUStr(aNewStr);
// there is no concept about default codepage in unix. so it is incorrectly in unix
::rtl::OString aOStr = ::rtl::OUStringToOString(aNewStr,osl_getThreadTextEncoding());
const sal_Char* pChar = aOStr.getStr();
- sal_uInt16 nArraySize = static_cast< sal_uInt16 >( aOStr.getLength() );
+ sal_Int32 nArraySize = aOStr.getLength();
SbxDimArray* pArray = new SbxDimArray(SbxBYTE);
bool bIncIndex = (IsBaseIndexOne() && SbiRuntime::isVBAEnabled() );
if(nArraySize)
@@ -4136,7 +4167,7 @@ RTLFUNC(StrConv)
pArray->unoAddDim( 0, -1 );
}
- for( sal_uInt16 i=0; i< nArraySize; i++)
+ for( sal_Int32 i=0; i< nArraySize; i++)
{
SbxVariable* pNew = new SbxVariable( SbxBYTE );
pNew->PutByte(*pChar);
@@ -4195,8 +4226,7 @@ RTLFUNC(Load)
}
else if( pObj->IsA( TYPE( SbxObject ) ) )
{
- SbxVariable* pVar = ((SbxObject*)pObj)->
- Find( String( RTL_CONSTASCII_USTRINGPARAM("Load") ), SbxCLASS_METHOD );
+ SbxVariable* pVar = ((SbxObject*)pObj)->Find( OUString("Load"), SbxCLASS_METHOD );
if( pVar )
{
pVar->GetInteger();
@@ -4228,8 +4258,7 @@ RTLFUNC(Unload)
}
else if( pObj->IsA( TYPE( SbxObject ) ) )
{
- SbxVariable* pVar = ((SbxObject*)pObj)->
- Find( String( RTL_CONSTASCII_USTRINGPARAM("Unload") ), SbxCLASS_METHOD );
+ SbxVariable* pVar = ((SbxObject*)pObj)->Find( OUString("Unload"), SbxCLASS_METHOD );
if( pVar )
{
pVar->GetInteger();
@@ -4249,7 +4278,7 @@ RTLFUNC(LoadPicture)
return;
}
- String aFileURL = getFullPath( rPar.Get(1)->GetString() );
+ OUString aFileURL = getFullPath( rPar.Get(1)->GetOUString() );
SvStream* pStream = utl::UcbStreamHelper::CreateStream( aFileURL, STREAM_READ );
if( pStream != NULL )
{
@@ -4279,7 +4308,7 @@ RTLFUNC(SavePicture)
SbxBase* pObj = (SbxObject*)rPar.Get(1)->GetObject();
if( pObj->IsA( TYPE( SbStdPicture ) ) )
{
- SvFileStream aOStream( rPar.Get(2)->GetString(), STREAM_WRITE | STREAM_TRUNC );
+ SvFileStream aOStream( rPar.Get(2)->GetOUString(), STREAM_WRITE | STREAM_TRUNC );
Graphic aGraphic = ((SbStdPicture*)pObj)->GetGraphic();
aOStream << aGraphic;
}
@@ -4371,10 +4400,12 @@ RTLFUNC(MsgBox)
}
nWinBits |= nWinDefBits;
- String aMsg = rPar.Get(1)->GetString();
- String aTitle;
+ OUString aMsg = rPar.Get(1)->GetOUString();
+ OUString aTitle;
if( nArgCount >= 4 )
- aTitle = rPar.Get(3)->GetString();
+ {
+ aTitle = rPar.Get(3)->GetOUString();
+ }
else
{
aTitle = GetpApp()->GetAppName();
@@ -4431,7 +4462,7 @@ RTLFUNC(SetAttr)
rPar.Get(0)->PutEmpty();
if ( rPar.Count() == 3 )
{
- String aStr = rPar.Get(1)->GetString();
+ OUString aStr = rPar.Get(1)->GetOUString();
sal_Int16 nFlags = rPar.Get(2)->GetInteger();
if( hasUno() )
@@ -4490,8 +4521,10 @@ RTLFUNC(DumpAllObjects)
{
SbxObject* p = pBasic;
while( p->GetParent() )
+ {
p = p->GetParent();
- SvFileStream aStrm( rPar.Get( 1 )->GetString(),
+ }
+ SvFileStream aStrm( rPar.Get( 1 )->GetOUString(),
STREAM_WRITE | STREAM_TRUNC );
p->Dump( aStrm, rPar.Get( 2 )->GetBool() );
aStrm.Close();
@@ -4510,7 +4543,7 @@ RTLFUNC(FileExists)
if ( rPar.Count() == 2 )
{
- String aStr = rPar.Get(1)->GetString();
+ OUString aStr = rPar.Get(1)->GetOUString();
sal_Bool bExists = sal_False;
if( hasUno() )
@@ -4622,7 +4655,7 @@ RTLFUNC(Partition)
}
}
aRetStr.append( aUpperValue );
- rPar.Get(0)->PutString( String(aRetStr.makeStringAndClear()) );
+ rPar.Get(0)->PutString( aRetStr.makeStringAndClear());
}
#endif
diff --git a/basic/source/runtime/methods1.cxx b/basic/source/runtime/methods1.cxx
index 0d55f47b1be1..e12a69f0e94a 100644
--- a/basic/source/runtime/methods1.cxx
+++ b/basic/source/runtime/methods1.cxx
@@ -128,7 +128,7 @@ RTLFUNC(CallByName)
}
// 2. parameter is ProcedureName
- String aNameStr = rPar.Get(2)->GetString();
+ OUString aNameStr = rPar.Get(2)->GetOUString();
// 3. parameter is CallType
sal_Int16 nCallType = rPar.Get(3)->GetInteger();
@@ -323,7 +323,7 @@ RTLFUNC(CDbl) // JSM
if( pSbxVariable->GetType() == SbxSTRING )
{
// #41690
- String aScanStr = pSbxVariable->GetString();
+ OUString aScanStr = pSbxVariable->GetOUString();
SbError Error = SbxValue::ScanNumIntnl( aScanStr, nVal );
if( Error != SbxERR_OK )
{
@@ -392,7 +392,7 @@ RTLFUNC(CSng) // JSM
{
// #41690
double dVal = 0.0;
- String aScanStr = pSbxVariable->GetString();
+ OUString aScanStr = pSbxVariable->GetOUString();
SbError Error = SbxValue::ScanNumIntnl( aScanStr, dVal, /*bSingle=*/true );
if( SbxBase::GetError() == SbxERR_OK && Error != SbxERR_OK )
{
@@ -417,11 +417,11 @@ RTLFUNC(CStr) // JSM
(void)pBasic;
(void)bWrite;
- String aString;
+ OUString aString;
if ( rPar.Count() == 2 )
{
SbxVariable *pSbxVariable = rPar.Get(1);
- aString = pSbxVariable->GetString();
+ aString = pSbxVariable->GetOUString();
}
else
{
@@ -718,7 +718,7 @@ RTLFUNC(Trim)
}
else
{
- rtl::OUString aStr(comphelper::string::strip(rPar.Get(1)->GetString(), ' '));
+ rtl::OUString aStr(comphelper::string::strip(rPar.Get(1)->GetOUString(), ' '));
rPar.Get(0)->PutString(aStr);
}
}
@@ -772,8 +772,10 @@ RTLFUNC(FreeLibrary)
(void)bWrite;
if ( rPar.Count() != 2 )
+ {
StarBASIC::Error( SbERR_BAD_ARGUMENT );
- GetSbData()->pInst->GetDllMgr()->FreeDll( rPar.Get(1)->GetString() );
+ }
+ GetSbData()->pInst->GetDllMgr()->FreeDll( rPar.Get(1)->GetOUString() );
}
bool IsBaseIndexOne()
{
@@ -916,7 +918,7 @@ RTLFUNC(FindObject)
return;
}
- String aNameStr = rPar.Get(1)->GetString();
+ OUString aNameStr = rPar.Get(1)->GetOUString();
SbxBase* pFind = StarBASIC::FindSBXInCurrentScope( aNameStr );
SbxObject* pFindObj = NULL;
@@ -954,7 +956,7 @@ RTLFUNC(FindPropertyObject)
pObj = PTR_CAST(SbxObject,pObjVarObj);
}
- String aNameStr = rPar.Get(2)->GetString();
+ OUString aNameStr = rPar.Get(2)->GetOUString();
SbxObject* pFindObj = NULL;
if( pObj )
@@ -1314,10 +1316,10 @@ RTLFUNC(Environ)
StarBASIC::Error( SbERR_BAD_ARGUMENT );
return;
}
- String aResult;
+ OUString aResult;
// should be ANSI but that's not possible under Win16 in the DLL
- rtl::OString aByteStr(rtl::OUStringToOString(rPar.Get(1)->GetString(),
- osl_getThreadTextEncoding()));
+ rtl::OString aByteStr(rtl::OUStringToOString(rPar.Get(1)->GetOUString(),
+ osl_getThreadTextEncoding()));
const char* pEnvStr = getenv(aByteStr.getStr());
if ( pEnvStr )
{
@@ -1428,7 +1430,7 @@ RTLFUNC(ResolvePath)
if ( rPar.Count() == 2 )
{
- String aStr = rPar.Get(1)->GetString();
+ OUString aStr = rPar.Get(1)->GetOUString();
DirEntry aEntry( aStr );
rPar.Get(0)->PutString( aStr );
}
@@ -1637,7 +1639,7 @@ RTLFUNC(ConvertToUrl)
if ( rPar.Count() == 2 )
{
- String aStr = rPar.Get(1)->GetString();
+ OUString aStr = rPar.Get(1)->GetOUString();
INetURLObject aURLObj( aStr, INET_PROT_FILE );
OUString aFileURL = aURLObj.GetMainURL( INetURLObject::NO_DECODE );
if( aFileURL.isEmpty() )
@@ -1648,6 +1650,7 @@ RTLFUNC(ConvertToUrl)
{
aFileURL = aStr;
}
+ rPar.Get(0)->PutString(aFileURL);
}
else
{
@@ -1662,12 +1665,14 @@ RTLFUNC(ConvertFromUrl)
if ( rPar.Count() == 2 )
{
- String aStr = rPar.Get(1)->GetString();
+ OUString aStr = rPar.Get(1)->GetOUString();
OUString aSysPath;
::osl::File::getSystemPathFromFileURL( aStr, aSysPath );
if( aSysPath.isEmpty() )
+ {
aSysPath = aStr;
- rPar.Get(0)->PutString( String(aSysPath) );
+ }
+ rPar.Get(0)->PutString(aSysPath);
}
else
{
@@ -1708,20 +1713,24 @@ RTLFUNC(Join)
if( pArr )
{
if( pArr->GetDims() != 1 )
+ {
StarBASIC::Error( SbERR_WRONG_DIMS ); // Syntax Error?!
-
- String aDelim;
+ }
+ OUString aDelim;
if( nParCount == 3 )
- aDelim = rPar.Get(2)->GetString();
+ {
+ aDelim = rPar.Get(2)->GetOUString();
+ }
else
- aDelim = rtl::OUString(" ");
-
- String aRetStr;
+ {
+ aDelim = " ";
+ }
+ OUString aRetStr;
short nLower, nUpper;
pArr->GetDim( 1, nLower, nUpper );
for( short i = nLower ; i <= nUpper ; ++i )
{
- String aStr = pArr->Get( &i )->GetString();
+ OUString aStr = pArr->Get( &i )->GetOUString();
aRetStr += aStr;
if( i != nUpper )
{
@@ -1749,50 +1758,58 @@ RTLFUNC(Split)
return;
}
- String aExpression = rPar.Get(1)->GetString();
+ OUString aExpression = rPar.Get(1)->GetOUString();
short nArraySize = 0;
StringVector vRet;
- if( aExpression.Len() )
+ if( !aExpression.isEmpty() )
{
- String aDelim;
+ OUString aDelim;
if( nParCount >= 3 )
- aDelim = rPar.Get(2)->GetString();
+ {
+ aDelim = rPar.Get(2)->GetOUString();
+ }
else
- aDelim = rtl::OUString(" ");
+ {
+ aDelim = " ";
+ }
sal_Int32 nCount = -1;
if( nParCount == 4 )
+ {
nCount = rPar.Get(3)->GetLong();
-
- xub_StrLen nDelimLen = aDelim.Len();
+ }
+ sal_Int32 nDelimLen = aDelim.getLength();
if( nDelimLen )
{
- xub_StrLen iSearch = STRING_NOTFOUND;
- xub_StrLen iStart = 0;
+ sal_Int32 iSearch = -1;
+ sal_Int32 iStart = 0;
do
{
bool bBreak = false;
if( nCount >= 0 && nArraySize == nCount - 1 )
+ {
bBreak = true;
-
- iSearch = aExpression.Search( aDelim, iStart );
- String aSubStr;
- if( iSearch != STRING_NOTFOUND && !bBreak )
+ }
+ iSearch = aExpression.indexOf( aDelim, iStart );
+ OUString aSubStr;
+ if( iSearch >= 0 && !bBreak )
{
- aSubStr = aExpression.Copy( iStart, iSearch - iStart );
+ aSubStr = aExpression.copy( iStart, iSearch - iStart );
iStart = iSearch + nDelimLen;
}
else
{
- aSubStr = aExpression.Copy( iStart );
+ aSubStr = aExpression.copy( iStart );
}
vRet.push_back( aSubStr );
nArraySize++;
if( bBreak )
+ {
break;
+ }
}
- while( iSearch != STRING_NOTFOUND );
+ while( iSearch >= 0 );
}
else
{
@@ -1967,13 +1984,13 @@ enum Interval
struct IntervalInfo
{
Interval meInterval;
- const char* mpStringCode;
+ const OUString mStringCode;
double mdValue;
bool mbSimple;
- IntervalInfo( Interval eInterval, const char* pStringCode, double dValue, bool bSimple )
+ IntervalInfo( Interval eInterval, const OUString sStringCode, double dValue, bool bSimple )
: meInterval( eInterval )
- , mpStringCode( pStringCode )
+ , mStringCode( sStringCode )
, mdValue( dValue )
, mbSimple( bSimple )
{}
@@ -1991,17 +2008,19 @@ static IntervalInfo pIntervalTable[] =
IntervalInfo( INTERVAL_H, "h", (1.0 / 24.0), true ), // Hour
IntervalInfo( INTERVAL_N, "n", (1.0 / 1440.0), true), // Minute
IntervalInfo( INTERVAL_S, "s", (1.0 / 86400.0), true ), // Second
- IntervalInfo( INTERVAL_NONE, NULL, 0.0, false )
+ IntervalInfo( INTERVAL_NONE, "", 0.0, false )
};
-IntervalInfo* getIntervalInfo( const String& rStringCode )
+IntervalInfo* getIntervalInfo( const OUString& rStringCode )
{
IntervalInfo* pInfo = NULL;
sal_Int16 i = 0;
- while( (pInfo = pIntervalTable + i)->mpStringCode != NULL )
+ while( !(pInfo = pIntervalTable + i)->mStringCode.isEmpty() )
{
- if( rStringCode.EqualsIgnoreCaseAscii( pInfo->mpStringCode ) )
+ if( rStringCode.equalsIgnoreAsciiCase( pInfo->mStringCode ) )
+ {
break;
+ }
i++;
}
return pInfo;
@@ -2039,7 +2058,7 @@ RTLFUNC(DateAdd)
return;
}
- String aStringCode = rPar.Get(1)->GetString();
+ OUString aStringCode = rPar.Get(1)->GetOUString();
IntervalInfo* pInfo = getIntervalInfo( aStringCode );
if( !pInfo )
{
@@ -2164,7 +2183,7 @@ RTLFUNC(DateDiff)
return;
}
- String aStringCode = rPar.Get(1)->GetString();
+ OUString aStringCode = rPar.Get(1)->GetOUString();
IntervalInfo* pInfo = getIntervalInfo( aStringCode );
if( !pInfo )
{
@@ -2364,7 +2383,7 @@ RTLFUNC(DatePart)
return;
}
- String aStringCode = rPar.Get(1)->GetString();
+ OUString aStringCode = rPar.Get(1)->GetOUString();
IntervalInfo* pInfo = getIntervalInfo( aStringCode );
if( !pInfo )
{
@@ -2504,7 +2523,7 @@ RTLFUNC(FormatDateTime)
return;
}
- String aRetStr;
+ OUString aRetStr;
SbxVariableRef pSbxVar = new SbxVariable( SbxSTRING );
switch( nNamedFormat )
{
@@ -2515,20 +2534,22 @@ RTLFUNC(FormatDateTime)
// 12/21/2004 11:24:50 AM
// 21.12.2004 12:13:51
- case 0:
- pSbxVar->PutDate( dDate );
- aRetStr = pSbxVar->GetString();
- break;
+ case 0:
+ pSbxVar->PutDate( dDate );
+ aRetStr = pSbxVar->GetOUString();
+ break;
// LongDate: Display a date using the long date format specified
// in your computer's regional settings.
// Tuesday, December 21, 2004
// Dienstag, 21. December 2004
- case 1:
+ case 1:
{
SvNumberFormatter* pFormatter = NULL;
if( GetSbData()->pInst )
+ {
pFormatter = GetSbData()->pInst->GetNumberFormatter();
+ }
else
{
sal_uInt32 n; // Dummy
@@ -2550,27 +2571,31 @@ RTLFUNC(FormatDateTime)
// ShortDate: Display a date using the short date format specified
// in your computer's regional settings.
// 21.12.2004
- case 2:
- pSbxVar->PutDate( floor(dDate) );
- aRetStr = pSbxVar->GetString();
- break;
+ case 2:
+ pSbxVar->PutDate( floor(dDate) );
+ aRetStr = pSbxVar->GetOUString();
+ break;
// LongTime: Display a time using the time format specified
// in your computer's regional settings.
// 11:24:50 AM
// 12:13:51
- case 3:
+ case 3:
// ShortTime: Display a time using the 24-hour format (hh:mm).
// 11:24
- case 4:
- double n;
- double dTime = modf( dDate, &n );
- pSbxVar->PutDate( dTime );
- if( nNamedFormat == 3 )
- aRetStr = pSbxVar->GetString();
- else
- aRetStr = pSbxVar->GetString().Copy( 0, 5 );
- break;
+ case 4:
+ double n;
+ double dTime = modf( dDate, &n );
+ pSbxVar->PutDate( dTime );
+ if( nNamedFormat == 3 )
+ {
+ aRetStr = pSbxVar->GetOUString();
+ }
+ else
+ {
+ aRetStr = pSbxVar->GetOUString().copy( 0, 5 );
+ }
+ break;
}
rPar.Get(0)->PutString( aRetStr );
@@ -3207,7 +3232,7 @@ RTLFUNC(StrReverse)
return;
}
- rtl::OUString aStr = comphelper::string::reverseString(pSbxVariable->GetString());
+ rtl::OUString aStr = comphelper::string::reverseString(pSbxVariable->GetOUString());
rPar.Get(0)->PutString( aStr );
}
diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx
index 84e320fe4429..3c2c661cc9fc 100644
--- a/basic/source/runtime/runtime.cxx
+++ b/basic/source/runtime/runtime.cxx
@@ -373,7 +373,7 @@ void SbiInstance::PrepareNumberFormatter( SvNumberFormatter*& rpNumberFormatter,
rpNumberFormatter = new SvNumberFormatter( xFactory, eLangType );
- xub_StrLen nCheckPos = 0; short nType;
+ sal_uInt16 nCheckPos = 0; short nType;
rnStdTimeIdx = rpNumberFormatter->GetStandardFormat( NUMBERFORMAT_TIME, eLangType );
// the formatter's standard templates have only got a two-digit date
@@ -422,7 +422,7 @@ void setBasicWatchMode( bool bOn )
void SbiInstance::Error( SbError n )
{
- Error( n, String() );
+ Error( n, OUString() );
}
void SbiInstance::Error( SbError n, const OUString& rMsg )
@@ -963,7 +963,7 @@ SbxVariableRef SbiRuntime::PopVar()
#endif
SbxVariableRef xVar = refExprStk->Get( --nExprLvl );
#ifdef DBG_UTIL
- if ( xVar->GetName().EqualsAscii( "Cells" ) )
+ if ( xVar->GetName().equalsAscii( "Cells" ) )
OSL_TRACE( "" );
#endif
// methods hold themselves in parameter 0
@@ -1256,8 +1256,8 @@ SbiForStack* SbiRuntime::FindForStackItemForCollection( class BasicCollection* p
// DLL-calls
void SbiRuntime::DllCall
- ( const String& aFuncName,
- const String& aDLLName,
+ ( const OUString& aFuncName,
+ const OUString& aDLLName,
SbxArray* pArgs, // parameter (from index 1, can be NULL)
SbxDataType eResType, // return value
bool bCDecl ) // true: according to C-conventions
diff --git a/basic/source/runtime/sbdiagnose.cxx b/basic/source/runtime/sbdiagnose.cxx
index 2e5c1dcb3835..2168c04956f2 100644
--- a/basic/source/runtime/sbdiagnose.cxx
+++ b/basic/source/runtime/sbdiagnose.cxx
@@ -31,7 +31,7 @@
static DbgChannelId nRestoreChannelId = 0;
static DbgChannelId nAssertionChannelId = 0;
static StarBASICRef xAssertionChannelBasic;
-static String sCaptureFunctionName;
+static OUString sCaptureFunctionName;
static bool bReportingAssertion = false;
void ResetCapturedAssertions()
@@ -42,7 +42,7 @@ void ResetCapturedAssertions()
}
nRestoreChannelId = 0;
xAssertionChannelBasic = NULL;
- sCaptureFunctionName = String();
+ sCaptureFunctionName = OUString();
bReportingAssertion = false;
}
@@ -90,8 +90,8 @@ RTLFUNC(CaptureAssertions)
#ifdef DBG_UTIL
DBG_TESTSOLARMUTEX();
- String const sFunctionName = rPar.Get(1)->GetString();
- if ( sFunctionName.Len() == 0 )
+ OUString const sFunctionName = rPar.Get(1)->GetOUString();
+ if ( sFunctionName.isEmpty() )
{
ResetCapturedAssertions();
return;
diff --git a/basic/source/runtime/stdobj.cxx b/basic/source/runtime/stdobj.cxx
index 70384dbf3f04..2a69f445d513 100644
--- a/basic/source/runtime/stdobj.cxx
+++ b/basic/source/runtime/stdobj.cxx
@@ -72,9 +72,9 @@ struct Methods {
struct StringHashCode
{
- size_t operator()( const String& rStr ) const
+ size_t operator()( const OUString& rStr ) const
{
- return rtl_ustr_hashCode_WithLength( rStr.GetBuffer(), rStr.Len() );
+ return rtl_ustr_hashCode_WithLength( rStr.getStr(), rStr.getLength() );
}
};
@@ -715,21 +715,21 @@ static Methods aMethods[] = {
{ NULL, SbxNULL, -1,NULL,0 }}; // end of the table
-SbiStdObject::SbiStdObject( const String& r, StarBASIC* pb ) : SbxObject( r )
+SbiStdObject::SbiStdObject( const OUString& r, StarBASIC* pb ) : SbxObject( r )
{
// do we have to initialize the hashcodes?
Methods* p = aMethods;
if( !p->nHash )
while( p->nArgs != -1 )
{
- String aName_ = rtl::OUString::createFromAscii( p->pName );
+ OUString aName_ = rtl::OUString::createFromAscii( p->pName );
p->nHash = SbxVariable::MakeHashCode( aName_ );
p += ( p->nArgs & _ARGSMASK ) + 1;
}
// #i92642: Remove default properties
- Remove( rtl::OUString("Name"), SbxCLASS_DONTCARE );
- Remove( rtl::OUString("Parent"), SbxCLASS_DONTCARE );
+ Remove( OUString("Name"), SbxCLASS_DONTCARE );
+ Remove( OUString("Parent"), SbxCLASS_DONTCARE );
SetParent( pb );
@@ -753,7 +753,7 @@ SbiStdObject::~SbiStdObject()
// return NULL without error code, so that a whole chain of
// objects can be asked for the method/property.
-SbxVariable* SbiStdObject::Find( const rtl::OUString& rName, SbxClassType t )
+SbxVariable* SbiStdObject::Find( const OUString& rName, SbxClassType t )
{
// entered already?
SbxVariable* pVar = SbxObject::Find( rName, t );
@@ -798,7 +798,7 @@ SbxVariable* SbiStdObject::Find( const rtl::OUString& rName, SbxClassType t )
short nType = ( p->nArgs & _TYPEMASK );
if( p->nArgs & _CONST )
nAccess |= SBX_CONST;
- String aName_ = rtl::OUString::createFromAscii( p->pName );
+ OUString aName_ = rtl::OUString::createFromAscii( p->pName );
SbxClassType eCT = SbxCLASS_OBJECT;
if( nType & _PROPERTY )
{
@@ -873,10 +873,12 @@ SbxInfo* SbiStdObject::GetInfo( short nIdx )
for( short i = 0; i < nPar; i++ )
{
p++;
- String aName_ = rtl::OUString::createFromAscii( p->pName );
+ OUString aName_ = rtl::OUString::createFromAscii( p->pName );
sal_uInt16 nFlags_ = ( p->nArgs >> 8 ) & 0x03;
if( p->nArgs & _OPT )
+ {
nFlags_ |= SBX_OPTIONAL;
+ }
pInfo_->AddParam( aName_, p->eType, nFlags_ );
}
return pInfo_;
diff --git a/basic/source/runtime/stdobj1.cxx b/basic/source/runtime/stdobj1.cxx
index 0cd55efb3a6f..6b8f6a9bf7c6 100644
--- a/basic/source/runtime/stdobj1.cxx
+++ b/basic/source/runtime/stdobj1.cxx
@@ -46,7 +46,7 @@ SbStdFactory::SbStdFactory()
{
}
-SbxObject* SbStdFactory::CreateObject( const rtl::OUString& rClassName )
+SbxObject* SbStdFactory::CreateObject( const OUString& rClassName )
{
if( rClassName.equalsIgnoreAsciiCase("Picture") )
return new SbStdPicture;
@@ -115,16 +115,16 @@ void SbStdPicture::PropHeight( SbxVariable* pVar, SbxArray*, sal_Bool bWrite )
TYPEINIT1( SbStdPicture, SbxObject );
SbStdPicture::SbStdPicture() :
- SbxObject( String( RTL_CONSTASCII_USTRINGPARAM("Picture") ) )
+ SbxObject( OUString("Picture"))
{
// Properties
- SbxVariable* p = Make( String( RTL_CONSTASCII_USTRINGPARAM("Type") ), SbxCLASS_PROPERTY, SbxVARIANT );
+ SbxVariable* p = Make( OUString("Type"), SbxCLASS_PROPERTY, SbxVARIANT );
p->SetFlags( SBX_READ | SBX_DONTSTORE );
p->SetUserData( ATTR_IMP_TYPE );
- p = Make( String( RTL_CONSTASCII_USTRINGPARAM("Width") ), SbxCLASS_PROPERTY, SbxVARIANT );
+ p = Make( OUString("Width"), SbxCLASS_PROPERTY, SbxVARIANT );
p->SetFlags( SBX_READ | SBX_DONTSTORE );
p->SetUserData( ATTR_IMP_WIDTH );
- p = Make( String( RTL_CONSTASCII_USTRINGPARAM("Height") ), SbxCLASS_PROPERTY, SbxVARIANT );
+ p = Make( OUString("Height"), SbxCLASS_PROPERTY, SbxVARIANT );
p->SetFlags( SBX_READ | SBX_DONTSTORE );
p->SetUserData( ATTR_IMP_HEIGHT );
}
@@ -134,7 +134,7 @@ SbStdPicture::~SbStdPicture()
}
-SbxVariable* SbStdPicture::Find( const rtl::OUString& rName, SbxClassType t )
+SbxVariable* SbStdPicture::Find( const OUString& rName, SbxClassType t )
{
// entered already?
return SbxObject::Find( rName, t );
@@ -218,36 +218,40 @@ void SbStdFont::PropSize( SbxVariable* pVar, SbxArray*, sal_Bool bWrite )
void SbStdFont::PropName( SbxVariable* pVar, SbxArray*, sal_Bool bWrite )
{
if( bWrite )
- SetFontName( pVar->GetString() );
+ {
+ SetFontName( pVar->GetOUString() );
+ }
else
+ {
pVar->PutString( GetFontName() );
+ }
}
TYPEINIT1( SbStdFont, SbxObject );
SbStdFont::SbStdFont() :
- SbxObject( String( RTL_CONSTASCII_USTRINGPARAM("Font") ) )
+ SbxObject( OUString("Font") )
{
// Properties
- SbxVariable* p = Make( String( RTL_CONSTASCII_USTRINGPARAM("Bold") ), SbxCLASS_PROPERTY, SbxVARIANT );
+ SbxVariable* p = Make( OUString("Bold"), SbxCLASS_PROPERTY, SbxVARIANT );
p->SetFlags( SBX_READWRITE | SBX_DONTSTORE );
p->SetUserData( ATTR_IMP_BOLD );
- p = Make( String( RTL_CONSTASCII_USTRINGPARAM("Italic") ), SbxCLASS_PROPERTY, SbxVARIANT );
+ p = Make( OUString("Italic"), SbxCLASS_PROPERTY, SbxVARIANT );
p->SetFlags( SBX_READWRITE | SBX_DONTSTORE );
p->SetUserData( ATTR_IMP_ITALIC );
- p = Make( String( RTL_CONSTASCII_USTRINGPARAM("StrikeThrough") ), SbxCLASS_PROPERTY, SbxVARIANT );
+ p = Make( OUString("StrikeThrough"), SbxCLASS_PROPERTY, SbxVARIANT );
p->SetFlags( SBX_READWRITE | SBX_DONTSTORE );
p->SetUserData( ATTR_IMP_STRIKETHROUGH );
- p = Make( String( RTL_CONSTASCII_USTRINGPARAM("Underline") ), SbxCLASS_PROPERTY, SbxVARIANT );
+ p = Make( OUString("Underline"), SbxCLASS_PROPERTY, SbxVARIANT );
p->SetFlags( SBX_READWRITE | SBX_DONTSTORE );
p->SetUserData( ATTR_IMP_UNDERLINE );
- p = Make( String( RTL_CONSTASCII_USTRINGPARAM("Size") ), SbxCLASS_PROPERTY, SbxVARIANT );
+ p = Make( OUString("Size"), SbxCLASS_PROPERTY, SbxVARIANT );
p->SetFlags( SBX_READWRITE | SBX_DONTSTORE );
p->SetUserData( ATTR_IMP_SIZE );
// handle name property yourself
- p = Find( String( RTL_CONSTASCII_USTRINGPARAM("Name") ), SbxCLASS_PROPERTY );
+ p = Find( OUString("Name"), SbxCLASS_PROPERTY );
DBG_ASSERT( p, "Keine Name Property" );
p->SetUserData( ATTR_IMP_NAME );
}
@@ -257,7 +261,7 @@ SbStdFont::~SbStdFont()
}
-SbxVariable* SbStdFont::Find( const rtl::OUString& rName, SbxClassType t )
+SbxVariable* SbStdFont::Find( const OUString& rName, SbxClassType t )
{
return SbxObject::Find( rName, t );
}
@@ -356,7 +360,7 @@ void SbStdClipboard::MethGetText( SbxVariable* pVar, SbxArray* pPar_, sal_Bool )
return;
}
- pVar->PutString( String() );
+ pVar->PutString( OUString() );
}
void SbStdClipboard::MethSetData( SbxVariable* pVar, SbxArray* pPar_, sal_Bool )
@@ -394,29 +398,29 @@ void SbStdClipboard::MethSetText( SbxVariable* pVar, SbxArray* pPar_, sal_Bool )
TYPEINIT1( SbStdClipboard, SbxObject );
SbStdClipboard::SbStdClipboard() :
- SbxObject( String( RTL_CONSTASCII_USTRINGPARAM("Clipboard") ) )
+ SbxObject( OUString("Clipboard") )
{
- SbxVariable* p = Find( String( RTL_CONSTASCII_USTRINGPARAM("Name") ), SbxCLASS_PROPERTY );
+ SbxVariable* p = Find( OUString("Name"), SbxCLASS_PROPERTY );
DBG_ASSERT( p, "Keine Name Property" );
p->SetUserData( ATTR_IMP_NAME );
// register methods
- p = Make( String( RTL_CONSTASCII_USTRINGPARAM("Clear") ), SbxCLASS_METHOD, SbxEMPTY );
+ p = Make( OUString("Clear"), SbxCLASS_METHOD, SbxEMPTY );
p->SetFlag( SBX_DONTSTORE );
p->SetUserData( METH_CLEAR );
- p = Make( String( RTL_CONSTASCII_USTRINGPARAM("GetData") ), SbxCLASS_METHOD, SbxEMPTY );
+ p = Make( OUString("GetData"), SbxCLASS_METHOD, SbxEMPTY );
p->SetFlag( SBX_DONTSTORE );
p->SetUserData( METH_GETDATA );
- p = Make( String( RTL_CONSTASCII_USTRINGPARAM("GetFormat") ), SbxCLASS_METHOD, SbxEMPTY );
+ p = Make( OUString("GetFormat"), SbxCLASS_METHOD, SbxEMPTY );
p->SetFlag( SBX_DONTSTORE );
p->SetUserData( METH_GETFORMAT );
- p = Make( String( RTL_CONSTASCII_USTRINGPARAM("GetText") ), SbxCLASS_METHOD, SbxEMPTY );
+ p = Make( OUString("GetText"), SbxCLASS_METHOD, SbxEMPTY );
p->SetFlag( SBX_DONTSTORE );
p->SetUserData( METH_GETTEXT );
- p = Make( String( RTL_CONSTASCII_USTRINGPARAM("SetData") ), SbxCLASS_METHOD, SbxEMPTY );
+ p = Make( OUString("SetData"), SbxCLASS_METHOD, SbxEMPTY );
p->SetFlag( SBX_DONTSTORE );
p->SetUserData( METH_SETDATA );
- p = Make( String( RTL_CONSTASCII_USTRINGPARAM("SetText") ), SbxCLASS_METHOD, SbxEMPTY );
+ p = Make( OUString("SetText"), SbxCLASS_METHOD, SbxEMPTY );
p->SetFlag( SBX_DONTSTORE );
p->SetUserData( METH_SETTEXT );
}
@@ -426,7 +430,7 @@ SbStdClipboard::~SbStdClipboard()
}
-SbxVariable* SbStdClipboard::Find( const rtl::OUString& rName, SbxClassType t )
+SbxVariable* SbStdClipboard::Find( const OUString& rName, SbxClassType t )
{
return SbxObject::Find( rName, t );
}
diff --git a/basic/source/runtime/step0.cxx b/basic/source/runtime/step0.cxx
index 9f938eeec268..dc0798499e74 100644
--- a/basic/source/runtime/step0.cxx
+++ b/basic/source/runtime/step0.cxx
@@ -201,75 +201,79 @@ namespace
}
}
- String VBALikeToRegexp(const String &rIn)
+ OUString VBALikeToRegexp(const OUString &rIn)
{
- String sResult;
- const sal_Unicode *start = rIn.GetBuffer();
- const sal_Unicode *end = start + rIn.Len();
+ OUStringBuffer sResult;
+ const sal_Unicode *start = rIn.getStr();
+ const sal_Unicode *end = start + rIn.getLength();
int seenright = 0;
- sResult.Append('^');
+ sResult.append('^');
while (start < end)
{
switch (*start)
{
- case '?':
- sResult.Append('.');
- start++;
- break;
- case '*':
- sResult.Append(String(RTL_CONSTASCII_USTRINGPARAM(".*")));
- start++;
- break;
- case '#':
- sResult.Append(String(RTL_CONSTASCII_USTRINGPARAM("[0-9]")));
- start++;
- break;
- case ']':
- sResult.Append('\\');
- sResult.Append(*start++);
- break;
- case '[':
- sResult.Append(*start++);
- seenright = 0;
- while (start < end && !seenright)
+ case '?':
+ sResult.append('.');
+ start++;
+ break;
+ case '*':
+ sResult.append(".*");
+ start++;
+ break;
+ case '#':
+ sResult.append("[0-9]");
+ start++;
+ break;
+ case ']':
+ sResult.append('\\');
+ sResult.append(*start++);
+ break;
+ case '[':
+ sResult.append(*start++);
+ seenright = 0;
+ while (start < end && !seenright)
+ {
+ switch (*start)
{
- switch (*start)
+ case '[':
+ case '?':
+ case '*':
+ sResult.append('\\');
+ sResult.append(*start);
+ break;
+ case ']':
+ sResult.append(*start);
+ seenright = 1;
+ break;
+ case '!':
+ sResult.append('^');
+ break;
+ default:
+ if (NeedEsc(*start))
{
- case '[':
- case '?':
- case '*':
- sResult.Append('\\');
- sResult.Append(*start);
- break;
- case ']':
- sResult.Append(*start);
- seenright = 1;
- break;
- case '!':
- sResult.Append('^');
- break;
- default:
- if (NeedEsc(*start))
- sResult.Append('\\');
- sResult.Append(*start);
- break;
+ sResult.append('\\');
}
- start++;
+ sResult.append(*start);
+ break;
}
- break;
- default:
- if (NeedEsc(*start))
- sResult.Append('\\');
- sResult.Append(*start++);
+ start++;
+ }
+ break;
+ default:
+ if (NeedEsc(*start))
+ {
+ sResult.append('\\');
+ }
+ sResult.append(*start++);
}
}
- sResult.Append('$');
+ sResult.append('$');
- return sResult;
+ return sResult.makeStringAndClear();
}
}
@@ -278,8 +282,8 @@ void SbiRuntime::StepLIKE()
SbxVariableRef refVar1 = PopVar();
SbxVariableRef refVar2 = PopVar();
- String pattern = VBALikeToRegexp(refVar1->GetString());
- String value = refVar2->GetString();
+ OUString pattern = VBALikeToRegexp(refVar1->GetOUString());
+ OUString value = refVar2->GetOUString();
com::sun::star::util::SearchOptions aSearchOpt;
@@ -300,7 +304,7 @@ void SbiRuntime::StepLIKE()
}
SbxVariable* pRes = new SbxVariable;
utl::TextSearch aSearch(aSearchOpt);
- xub_StrLen nStart=0, nEnd=value.Len();
+ sal_uInt16 nStart=0, nEnd=value.getLength();
int bRes = aSearch.SearchFrwrd(value, &nStart, &nEnd);
pRes->PutBool( bRes != 0 );
@@ -390,8 +394,8 @@ inline bool checkUnoStructCopy( bool bVBA, SbxVariableRef& refVal, SbxVariableRe
if ( ( !pUnoVal && !pUnoStructVal ) )
return false;
- String sClassName = pUnoVal ? pUnoVal->GetClassName() : pUnoStructVal->GetClassName();
- String sName = pUnoVal ? pUnoVal->GetName() : pUnoStructVal->GetName();
+ OUString sClassName = pUnoVal ? pUnoVal->GetClassName() : pUnoStructVal->GetClassName();
+ OUString sName = pUnoVal ? pUnoVal->GetName() : pUnoStructVal->GetName();
if ( pUnoStructObj )
{
@@ -633,7 +637,7 @@ void SbiRuntime::StepSET_Impl( SbxVariableRef& refVal, SbxVariableRef& refVar, b
if( pUnoObj != NULL )
{
Any aControlAny = pUnoObj->getUnoAny();
- String aDeclareClassName = refVar->GetDeclareClassName();
+ OUString aDeclareClassName = refVar->GetDeclareClassName();
OUString aVBAType = aDeclareClassName;
OUString aPrefix = refVar->GetName();
SbxObjectRef xScopeObj = refVar->GetParent();
@@ -696,7 +700,7 @@ void SbiRuntime::StepSET_Impl( SbxVariableRef& refVal, SbxVariableRef& refVar, b
SbxObject* pValObj = PTR_CAST(SbxObject,pValObjBase);
if( pValObj != NULL )
{
- String aObjClass = pValObj->GetClassName();
+ OUString aObjClass = pValObj->GetClassName();
SbClassModuleObject* pClassModuleObj = PTR_CAST(SbClassModuleObject,pValObjBase);
DimAsNewRecoverHash &rDimAsNewRecoverHash = GaDimAsNewRecoverHash::get();
@@ -706,7 +710,7 @@ void SbiRuntime::StepSET_Impl( SbxVariableRef& refVal, SbxVariableRef& refVar, b
rDimAsNewRecoverHash[refVar] =
DimAsNewRecoverItem( aObjClass, pValObj->GetName(), pValObj->GetParent(), pClassModule );
}
- else if( aObjClass.EqualsIgnoreCaseAscii( "Collection" ) )
+ else if( aObjClass.equalsIgnoreAsciiCase( "Collection" ) )
{
rDimAsNewRecoverHash[refVar] =
DimAsNewRecoverItem( aObjClass, pValObj->GetName(), pValObj->GetParent(), NULL );
@@ -753,13 +757,15 @@ void SbiRuntime::StepLSET()
{
sal_uInt16 n = refVar->GetFlags();
if( (SbxVariable*) refVar == (SbxVariable*) pMeth )
+ {
refVar->SetFlag( SBX_WRITE );
- String aRefVarString = refVar->GetString();
- String aRefValString = refVal->GetString();
+ }
+ OUString aRefVarString = refVar->GetOUString();
+ OUString aRefValString = refVal->GetOUString();
- sal_uInt16 nVarStrLen = aRefVarString.Len();
- sal_uInt16 nValStrLen = aRefValString.Len();
- rtl::OUStringBuffer aNewStr;
+ sal_Int32 nVarStrLen = aRefVarString.getLength();
+ sal_Int32 nValStrLen = aRefValString.getLength();
+ OUStringBuffer aNewStr;
if( nVarStrLen > nValStrLen )
{
aNewStr.append(aRefValString);
@@ -767,7 +773,7 @@ void SbiRuntime::StepLSET()
}
else
{
- aNewStr.append(aRefValString.Copy(0, nVarStrLen));
+ aNewStr = aRefValString.copy( 0, nVarStrLen );
}
refVar->PutString(aNewStr.makeStringAndClear());
@@ -787,13 +793,15 @@ void SbiRuntime::StepRSET()
{
sal_uInt16 n = refVar->GetFlags();
if( (SbxVariable*) refVar == (SbxVariable*) pMeth )
+ {
refVar->SetFlag( SBX_WRITE );
- String aRefVarString = refVar->GetString();
- String aRefValString = refVal->GetString();
+ }
+ OUString aRefVarString = refVar->GetOUString();
+ OUString aRefValString = refVal->GetOUString();
+ sal_Int32 nVarStrLen = aRefVarString.getLength();
+ sal_Int32 nValStrLen = aRefValString.getLength();
- sal_uInt16 nVarStrLen = aRefVarString.Len();
- sal_uInt16 nValStrLen = aRefValString.Len();
- rtl::OUStringBuffer aNewStr;
+ OUStringBuffer aNewStr(nVarStrLen);
if (nVarStrLen > nValStrLen)
{
comphelper::string::padToLength(aNewStr, nVarStrLen - nValStrLen, ' ');
@@ -801,7 +809,7 @@ void SbiRuntime::StepRSET()
}
else
{
- aNewStr.append(aRefValString.Copy(0, nVarStrLen));
+ aNewStr.append(aRefValString.copy(0, nVarStrLen));
}
refVar->PutString(aNewStr.makeStringAndClear());
@@ -1161,10 +1169,10 @@ void SbiRuntime::StepARGV()
// Input to Variable. The variable is on TOS and is
// is removed afterwards.
-
void SbiRuntime::StepINPUT()
{
- String s;
+ OUStringBuffer sin = "";
+ OUString s;
char ch = 0;
SbError err;
// Skip whitespace
@@ -1195,8 +1203,10 @@ void SbiRuntime::StepINPUT()
}
}
else if( !sep && (ch == ',' || ch == '\n') )
+ {
break;
- s += ch;
+ }
+ sin.append( ch );
ch = pIosys->Read();
}
// skip whitespace
@@ -1214,6 +1224,7 @@ void SbiRuntime::StepINPUT()
}
if( !err )
{
+ s = sin.makeStringAndClear();
SbxVariableRef pVar = GetTOS();
// try to fill the variable with a numeric value first,
// then with a string value
@@ -1226,12 +1237,12 @@ void SbiRuntime::StepINPUT()
SbxBase::ResetError();
}
// the value has to be scanned in completely
- else if( nLen != s.Len() && !pVar->PutString( s ) )
+ else if( nLen != s.getLength() && !pVar->PutString( s ) )
{
err = SbxBase::GetError();
SbxBase::ResetError();
}
- else if( nLen != s.Len() && pVar->IsNumeric() )
+ else if( nLen != s.getLength() && pVar->IsNumeric() )
{
err = SbxBase::GetError();
SbxBase::ResetError();
@@ -1344,7 +1355,7 @@ void SbiRuntime::StepENDCASE()
void SbiRuntime::StepSTDERROR()
{
pError = NULL; bError = true;
- pInst->aErrorMsg = String();
+ pInst->aErrorMsg = OUString();
pInst->nErr = 0L;
pInst->nErl = 0;
nError = 0L;
@@ -1353,7 +1364,7 @@ void SbiRuntime::StepSTDERROR()
void SbiRuntime::StepNOERROR()
{
- pInst->aErrorMsg = String();
+ pInst->aErrorMsg = OUString();
pInst->nErr = 0L;
pInst->nErl = 0;
nError = 0L;
@@ -1389,12 +1400,14 @@ void SbiRuntime::StepCHANNEL0()
void SbiRuntime::StepPRINT() // print TOS
{
SbxVariableRef p = PopVar();
- String s1 = p->GetString();
- String s;
+ OUString s1 = p->GetOUString();
+ OUString s;
if( p->GetType() >= SbxINTEGER && p->GetType() <= SbxDOUBLE )
- s = ' '; // one blank before
+ {
+ s = " "; // one blank before
+ }
s += s1;
- rtl::OString aByteStr(rtl::OUStringToOString(s, osl_getThreadTextEncoding()));
+ OString aByteStr(rtl::OUStringToOString(s, osl_getThreadTextEncoding()));
pIosys->Write( aByteStr );
Error( pIosys->GetError() );
}
@@ -1402,7 +1415,7 @@ void SbiRuntime::StepPRINT() // print TOS
void SbiRuntime::StepPRINTF() // print TOS in field
{
SbxVariableRef p = PopVar();
- OUString s1 = p->GetString();
+ OUString s1 = p->GetOUString();
OUStringBuffer s;
if( p->GetType() >= SbxINTEGER && p->GetType() <= SbxDOUBLE )
{
@@ -1428,13 +1441,17 @@ void SbiRuntime::StepWRITE() // write TOS
case SbxDATE: ch = '#'; break;
default: break;
}
- String s;
+ OUString s;
if( ch )
- s += ch;
- s += p->GetString();
+ {
+ s += OUString(ch);
+ }
+ s += p->GetOUString();
if( ch )
- s += ch;
- rtl::OString aByteStr(rtl::OUStringToOString(s, osl_getThreadTextEncoding()));
+ {
+ s += OUString(ch);
+ }
+ OString aByteStr(rtl::OUStringToOString(s, osl_getThreadTextEncoding()));
pIosys->Write( aByteStr );
Error( pIosys->GetError() );
}
@@ -1443,8 +1460,8 @@ void SbiRuntime::StepRENAME() // Rename Tos+1 to Tos
{
SbxVariableRef pTos1 = PopVar();
SbxVariableRef pTos = PopVar();
- String aDest = pTos1->GetString();
- String aSource = pTos->GetString();
+ OUString aDest = pTos1->GetOUString();
+ OUString aSource = pTos->GetOUString();
if( hasUno() )
{
@@ -1461,7 +1478,7 @@ void SbiRuntime::StepRENAME() // Rename Tos+1 to Tos
void SbiRuntime::StepPROMPT()
{
SbxVariableRef p = PopVar();
- rtl::OString aStr(rtl::OUStringToOString(p->GetString(), osl_getThreadTextEncoding()));
+ rtl::OString aStr(rtl::OUStringToOString(p->GetOUString(), osl_getThreadTextEncoding()));
pIosys->SetPrompt( aStr );
}
diff --git a/basic/source/runtime/step2.cxx b/basic/source/runtime/step2.cxx
index 841fbe25202f..0f6c07bd2b67 100644
--- a/basic/source/runtime/step2.cxx
+++ b/basic/source/runtime/step2.cxx
@@ -327,7 +327,7 @@ SbxBase* SbiRuntime::FindElementExtern( const OUString& rName )
const SbxParamInfo* pParam = pInfo->GetParam( j );
while( pParam )
{
- if( pParam->aName.EqualsIgnoreCaseAscii( rName ) )
+ if( pParam->aName.equalsIgnoreAsciiCase( rName ) )
{
if( j >= nParamCount )
{
@@ -372,7 +372,7 @@ void SbiRuntime::SetupArgs( SbxVariable* p, sal_uInt32 nOp1 )
sal_uInt16 nArgCount = refArgv->Count();
for( i = 1 ; i < nArgCount ; i++ )
{
- if( refArgv->GetAlias( i ).Len() )
+ if( !refArgv->GetAlias(i).isEmpty() )
{
bHasNamed = true; break;
}
@@ -470,7 +470,7 @@ void SbiRuntime::SetupArgs( SbxVariable* p, sal_uInt32 nOp1 )
const SbxParamInfo* pParam = pInfo->GetParam( j );
while( pParam )
{
- if( pParam->aName.EqualsIgnoreCaseAscii( rName ) )
+ if( pParam->aName.equalsIgnoreAsciiCase( rName ) )
{
nCurPar = j;
break;
@@ -664,8 +664,8 @@ void SbiRuntime::StepRTL( sal_uInt32 nOp1, sal_uInt32 nOp2 )
PushVar( FindElement( rBasic.pRtl, nOp1, nOp2, SbERR_PROC_UNDEFINED, false ) );
}
-void
-SbiRuntime::StepFIND_Impl( SbxObject* pObj, sal_uInt32 nOp1, sal_uInt32 nOp2, SbError nNotFound, bool bLocal, bool bStatic )
+void SbiRuntime::StepFIND_Impl( SbxObject* pObj, sal_uInt32 nOp1, sal_uInt32 nOp2,
+ SbError nNotFound, bool bLocal, bool bStatic )
{
if( !refLocals )
{
@@ -782,8 +782,7 @@ void SbiRuntime::StepPARAM( sal_uInt32 nOp1, sal_uInt32 nOp2 )
if( pParam && ( (pParam->nFlags & SBX_OPTIONAL) != 0 ) )
{
// Default value?
- sal_uInt16 nDefaultId = sal::static_int_cast< sal_uInt16 >(
- pParam->nUserData & 0xffff );
+ sal_uInt16 nDefaultId = (sal_uInt16)(pParam->nUserData & 0x0ffff);
if( nDefaultId > 0 )
{
OUString aDefaultStr = pImg->GetString( nDefaultId );
@@ -980,7 +979,7 @@ void SbiRuntime::StepOPEN( sal_uInt32 nOp1, sal_uInt32 nOp2 )
SbxVariableRef pLen = PopVar();
short nBlkLen = pLen->GetInteger();
short nChan = pChan->GetInteger();
- OString aName(rtl::OUStringToOString(pName->GetString(), osl_getThreadTextEncoding()));
+ OString aName(rtl::OUStringToOString(pName->GetOUString(), osl_getThreadTextEncoding()));
pIosys->Open( nChan, aName, static_cast<short>( nOp1 ),
static_cast<short>( nOp2 ), nBlkLen );
Error( pIosys->GetError() );
@@ -1190,7 +1189,7 @@ void SbiRuntime::implHandleSbxFlags( SbxVariable* pVar, SbxDataType t, sal_uInt3
if( bFixedString )
{
sal_uInt16 nCount = static_cast<sal_uInt16>( nOp2 >> 17 ); // len = all bits above 0x10000
- rtl::OUStringBuffer aBuf;
+ OUStringBuffer aBuf;
comphelper::string::padToLength(aBuf, nCount, 0);
pVar->PutString(aBuf.makeStringAndClear());
}
diff --git a/basic/source/sbx/sbxarray.cxx b/basic/source/sbx/sbxarray.cxx
index 546727290348..9a68c1379c80 100644
--- a/basic/source/sbx/sbxarray.cxx
+++ b/basic/source/sbx/sbxarray.cxx
@@ -31,7 +31,7 @@ struct SbxDim { // an array-dimension:
class SbxVarEntry : public SbxVariableRef {
public:
- XubString* pAlias;
+ OUString* pAlias;
SbxVarEntry() : SbxVariableRef(), pAlias( NULL ) {}
~SbxVarEntry() { delete pAlias; }
};
@@ -83,11 +83,17 @@ SbxArray& SbxArray::operator=( const SbxArray& rArray )
SbxVarEntryPtr pDstRef = new SbxVarEntry;
*((SbxVariableRef*) pDstRef) = *((SbxVariableRef*) pSrcRef);
if( pSrcRef->pAlias )
- pDstRef->pAlias = new XubString( *pSrcRef->pAlias );
+ {
+ pDstRef->pAlias = new OUString( *pSrcRef->pAlias );
+ }
if( eType != SbxVARIANT )
+ {
// Convert no objects
if( eType != SbxOBJECT || pSrc_->GetClass() != SbxCLASS_OBJECT )
+ {
((SbxVariable*) pSrc_)->Convert( eType );
+ }
+ }
pData->push_back( pDstRef );
}
}
@@ -247,17 +253,21 @@ void SbxArray::Put( SbxVariable* pVar, sal_uInt16 nIdx )
}
}
-const XubString& SbxArray::GetAlias( sal_uInt16 nIdx )
+const OUString& SbxArray::GetAlias( sal_uInt16 nIdx )
{
+static const OUString sEmpty("");
+
if( !CanRead() )
{
SetError( SbxERR_PROP_WRITEONLY );
- return String::EmptyString();
+ return sEmpty;
}
SbxVarEntry& rRef = (SbxVarEntry&) GetRef( nIdx );
if ( !rRef.pAlias )
- return String::EmptyString();
+ {
+ return sEmpty;
+ }
#ifdef DBG_UTIL
else
{
@@ -268,7 +278,7 @@ const XubString& SbxArray::GetAlias( sal_uInt16 nIdx )
return *rRef.pAlias;
}
-void SbxArray::PutAlias( const XubString& rAlias, sal_uInt16 nIdx )
+void SbxArray::PutAlias( const OUString& rAlias, sal_uInt16 nIdx )
{
if( !CanWrite() )
{
@@ -278,7 +288,9 @@ void SbxArray::PutAlias( const XubString& rAlias, sal_uInt16 nIdx )
{
SbxVarEntry& rRef = (SbxVarEntry&) GetRef( nIdx );
if( !rRef.pAlias )
- rRef.pAlias = new XubString( rAlias );
+ {
+ rRef.pAlias = new OUString( rAlias );
+ }
else
{
*rRef.pAlias = rAlias;
@@ -378,13 +390,13 @@ void SbxArray::Merge( SbxArray* p )
SbxVariable* pVar = *pRef1;
if( pVar )
{
- XubString aName = pVar->GetName();
+ OUString aName = pVar->GetName();
sal_uInt16 nHash = pVar->GetHashCode();
for( sal_uInt32 j = 0; j < pData->size(); j++ )
{
SbxVariableRef* pRef2 = (*pData)[j];
if( (*pRef2)->GetHashCode() == nHash
- && (*pRef2)->GetName().EqualsIgnoreCaseAscii( aName ) )
+ && (*pRef2)->GetName().equalsIgnoreAsciiCase( aName ) )
{
*pRef2 = pVar; pRef1 = NULL;
break;
@@ -397,7 +409,9 @@ void SbxArray::Merge( SbxArray* p )
pData->push_back( pTemp );
*((SbxVariableRef*) pRef) = *((SbxVariableRef*) pRef1);
if( pRef1->pAlias )
- pRef->pAlias = new XubString( *pRef1->pAlias );
+ {
+ pRef->pAlias = new OUString( *pRef1->pAlias );
+ }
}
}
}
@@ -473,7 +487,7 @@ SbxVariable* SbxArray::Find( const OUString& rName, SbxClassType t )
sal_uInt16 nVarHash = pVar->GetHashCode();
if( ( !nVarHash || nVarHash == nHash )
&& ( t == SbxCLASS_DONTCARE || pVar->GetClass() == t )
- && ( pVar->GetName().EqualsIgnoreCaseAscii( rName ) ) )
+ && ( pVar->GetName().equalsIgnoreAsciiCase( rName ) ) )
{
p = pVar;
p->ResetFlag( SBX_EXTFOUND );
diff --git a/basic/source/sbx/sbxcoll.cxx b/basic/source/sbx/sbxcoll.cxx
index 69d159749a7d..40b4a9fb2fd7 100644
--- a/basic/source/sbx/sbxcoll.cxx
+++ b/basic/source/sbx/sbxcoll.cxx
@@ -25,26 +25,26 @@
TYPEINIT1(SbxCollection,SbxObject)
TYPEINIT1(SbxStdCollection,SbxCollection)
-static const char* pCount;
-static const char* pAdd;
-static const char* pItem;
-static const char* pRemove;
+static OUString pCount;
+static OUString pAdd;
+static OUString pItem;
+static OUString pRemove;
static sal_uInt16 nCountHash = 0, nAddHash, nItemHash, nRemoveHash;
-SbxCollection::SbxCollection( const XubString& rClass )
+SbxCollection::SbxCollection( const OUString& rClass )
: SbxObject( rClass )
{
if( !nCountHash )
{
- pCount = GetSbxRes( STRING_COUNTPROP );
- pAdd = GetSbxRes( STRING_ADDMETH );
- pItem = GetSbxRes( STRING_ITEMMETH );
- pRemove = GetSbxRes( STRING_REMOVEMETH );
- nCountHash = MakeHashCode( rtl::OUString::createFromAscii( pCount ) );
- nAddHash = MakeHashCode( rtl::OUString::createFromAscii( pAdd ) );
- nItemHash = MakeHashCode( rtl::OUString::createFromAscii( pItem ) );
- nRemoveHash = MakeHashCode( rtl::OUString::createFromAscii( pRemove ) );
+ pCount = rtl::OUString::createFromAscii(GetSbxRes( STRING_COUNTPROP ));
+ pAdd = rtl::OUString::createFromAscii(GetSbxRes( STRING_ADDMETH ));
+ pItem = rtl::OUString::createFromAscii(GetSbxRes( STRING_ITEMMETH ));
+ pRemove = rtl::OUString::createFromAscii(GetSbxRes( STRING_REMOVEMETH ));
+ nCountHash = MakeHashCode( pCount );
+ nAddHash = MakeHashCode( pAdd );
+ nItemHash = MakeHashCode( pItem );
+ nRemoveHash = MakeHashCode( pRemove );
}
Initialize();
// For Access on itself
@@ -77,14 +77,14 @@ void SbxCollection::Initialize()
SetFlag( SBX_FIXED );
ResetFlag( SBX_WRITE );
SbxVariable* p;
- p = Make( rtl::OUString::createFromAscii( pCount ), SbxCLASS_PROPERTY, SbxINTEGER );
+ p = Make( pCount , SbxCLASS_PROPERTY, SbxINTEGER );
p->ResetFlag( SBX_WRITE );
p->SetFlag( SBX_DONTSTORE );
- p = Make( rtl::OUString::createFromAscii( pAdd ), SbxCLASS_METHOD, SbxEMPTY );
+ p = Make( pAdd, SbxCLASS_METHOD, SbxEMPTY );
p->SetFlag( SBX_DONTSTORE );
- p = Make( rtl::OUString::createFromAscii( pItem ), SbxCLASS_METHOD, SbxOBJECT );
+ p = Make( pItem , SbxCLASS_METHOD, SbxOBJECT );
p->SetFlag( SBX_DONTSTORE );
- p = Make( rtl::OUString::createFromAscii( pRemove ), SbxCLASS_METHOD, SbxEMPTY );
+ p = Make( pRemove, SbxCLASS_METHOD, SbxEMPTY );
p->SetFlag( SBX_DONTSTORE );
}
@@ -127,23 +127,35 @@ void SbxCollection::SFX_NOTIFY( SfxBroadcaster& rCst, const TypeId& rId1,
SbxArray* pArg = pVar->GetParameters();
if( bRead || bWrite )
{
- XubString aVarName( pVar->GetName() );
+ OUString aVarName( pVar->GetName() );
if( pVar == this )
+ {
CollItem( pArg );
+ }
else if( pVar->GetHashCode() == nCountHash
- && aVarName.EqualsIgnoreCaseAscii( pCount ) )
+ && aVarName.equalsIgnoreAsciiCase( pCount ) )
+ {
pVar->PutLong( pObjs->Count() );
+ }
else if( pVar->GetHashCode() == nAddHash
- && aVarName.EqualsIgnoreCaseAscii( pAdd ) )
+ && aVarName.equalsIgnoreAsciiCase( pAdd ) )
+ {
CollAdd( pArg );
+ }
else if( pVar->GetHashCode() == nItemHash
- && aVarName.EqualsIgnoreCaseAscii( pItem ) )
+ && aVarName.equalsIgnoreAsciiCase( pItem ) )
+ {
CollItem( pArg );
+ }
else if( pVar->GetHashCode() == nRemoveHash
- && aVarName.EqualsIgnoreCaseAscii( pRemove ) )
+ && aVarName.equalsIgnoreAsciiCase( pRemove ) )
+ {
CollRemove( pArg );
+ }
else
+ {
SbxObject::SFX_NOTIFY( rCst, rId1, rHint, rId2 );
+ }
return;
}
}
@@ -185,7 +197,9 @@ void SbxCollection::CollItem( SbxArray* pPar_ )
SbxVariable* pRes = NULL;
SbxVariable* p = pPar_->Get( 1 );
if( p->GetType() == SbxSTRING )
- pRes = Find( p->GetString(), SbxCLASS_OBJECT );
+ {
+ pRes = Find( p->GetOUString(), SbxCLASS_OBJECT );
+ }
else
{
short n = p->GetInteger();
@@ -227,7 +241,7 @@ sal_Bool SbxCollection::LoadData( SvStream& rStrm, sal_uInt16 nVer )
SbxStdCollection::SbxStdCollection
- ( const XubString& rClass, const XubString& rElem, sal_Bool b )
+ ( const OUString& rClass, const OUString& rElem, sal_Bool b )
: SbxCollection( rClass ), aElemClass( rElem ),
bAddRemoveOk( b )
{}
@@ -241,7 +255,7 @@ SbxStdCollection& SbxStdCollection::operator=( const SbxStdCollection& r )
{
if( &r != this )
{
- if( !r.aElemClass.EqualsIgnoreCaseAscii( aElemClass ) )
+ if( !r.aElemClass.equalsIgnoreAsciiCase( aElemClass ) )
{
SetError( SbxERR_CONVERSION );
}
diff --git a/basic/source/sbx/sbxdate.cxx b/basic/source/sbx/sbxdate.cxx
index 7c78518ffcf8..cc6aedc5cb04 100644
--- a/basic/source/sbx/sbxdate.cxx
+++ b/basic/source/sbx/sbxdate.cxx
@@ -31,143 +31,175 @@
double ImpGetDate( const SbxValues* p )
{
double nRes;
+ SbxValue* pVal;
+
switch( +p->eType )
{
- case SbxNULL:
- SbxBase::SetError( SbxERR_CONVERSION );
- case SbxEMPTY:
- nRes = 0; break;
- case SbxCHAR:
- nRes = p->nChar; break;
- case SbxBYTE:
- nRes = p->nByte; break;
- case SbxINTEGER:
- case SbxBOOL:
- nRes = p->nInteger; break;
- case SbxERROR:
- case SbxUSHORT:
- nRes = p->nUShort; break;
- case SbxLONG:
- nRes = (double) p->nLong; break;
- case SbxULONG:
- nRes = (double) p->nULong; break;
- case SbxSINGLE:
- nRes = p->nSingle; break;
- case SbxDATE:
- case SbxDOUBLE:
- nRes = p->nDouble; break;
- case SbxCURRENCY:
- nRes = ImpCurrencyToDouble( p->nInt64 ); break;
- case SbxSALINT64:
- nRes = static_cast< double >(p->nInt64); break;
- case SbxSALUINT64:
- nRes = ImpSalUInt64ToDouble( p->uInt64 ); break;
- case SbxDECIMAL:
- case SbxBYREF | SbxDECIMAL:
- if( p->pDecimal )
- p->pDecimal->getDouble( nRes );
- else
- nRes = 0.0;
- break;
- case SbxBYREF | SbxSTRING:
- case SbxSTRING:
- case SbxLPSTR:
- if( !p->pOUString )
- nRes = 0;
- else
- {
- LanguageType eLangType = GetpApp()->GetSettings().GetLanguage();
-
- SvNumberFormatter* pFormatter;
- com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >
- xFactory = comphelper::getProcessServiceFactory();
- pFormatter = new SvNumberFormatter( xFactory, eLangType );
+ case SbxNULL:
+ SbxBase::SetError( SbxERR_CONVERSION );
+ case SbxEMPTY:
+ nRes = 0;
+ break;
+ case SbxCHAR:
+ nRes = p->nChar;
+ break;
+ case SbxBYTE:
+ nRes = p->nByte;
+ break;
+ case SbxINTEGER:
+ case SbxBOOL:
+ nRes = p->nInteger;
+ break;
+ case SbxERROR:
+ case SbxUSHORT:
+ nRes = p->nUShort;
+ break;
+ case SbxLONG:
+ nRes = (double) p->nLong;
+ break;
+ case SbxULONG:
+ nRes = (double) p->nULong;
+ break;
+ case SbxSINGLE:
+ nRes = p->nSingle;
+ break;
+ case SbxDATE:
+ case SbxDOUBLE:
+ nRes = p->nDouble;
+ break;
+ case SbxCURRENCY:
+ nRes = ImpCurrencyToDouble( p->nInt64 );
+ break;
+ case SbxSALINT64:
+ nRes = static_cast< double >(p->nInt64);
+ break;
+ case SbxSALUINT64:
+ nRes = ImpSalUInt64ToDouble( p->uInt64 );
+ break;
+ case SbxDECIMAL:
+ case SbxBYREF | SbxDECIMAL:
+ if( p->pDecimal )
+ {
+ p->pDecimal->getDouble( nRes );
+ }
+ else
+ {
+ nRes = 0.0;
+ }
+ break;
+ case SbxBYREF | SbxSTRING:
+ case SbxSTRING:
+ case SbxLPSTR:
+ if( !p->pOUString )
+ {
+ nRes = 0;
+ }
+ else
+ {
+ LanguageType eLangType = GetpApp()->GetSettings().GetLanguage();
- sal_uInt32 nIndex;
- xub_StrLen nCheckPos = 0;
- short nType = 127;
+ SvNumberFormatter* pFormatter;
+ com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >
+ xFactory = comphelper::getProcessServiceFactory();
+ pFormatter = new SvNumberFormatter( xFactory, eLangType );
- // Default templates of the formatter have only two-digit
- // date. Therefore register an own format.
+ sal_uInt32 nIndex;
+ sal_uInt16 nCheckPos = 0;
+ short nType = 127;
- // HACK, because the number formatter in PutandConvertEntry replace the wildcard
- // for month, day, year not according to the configuration.
- // Problem: Print Year(Date) under Engl. OS
- // quod vide basic\source\runtime\runtime.cxx
+ // Default templates of the formatter have only two-digit
+ // date. Therefore register an own format.
- SvtSysLocale aSysLocale;
- DateFormat eDate = aSysLocale.GetLocaleData().getDateFormat();
- String aDateStr;
- switch( eDate )
- {
- case MDY: aDateStr.AssignAscii( "MM.TT.JJJJ" ); break;
- case DMY: aDateStr.AssignAscii( "TT.MM.JJJJ" ); break;
- case YMD: aDateStr.AssignAscii( "JJJJ.MM.TT" ); break;
- default: aDateStr.AssignAscii( "MM.TT.JJJJ" );
- }
+ // HACK, because the number formatter in PutandConvertEntry replace the wildcard
+ // for month, day, year not according to the configuration.
+ // Problem: Print Year(Date) under Engl. OS
+ // quod vide basic\source\runtime\runtime.cxx
- String aStr( aDateStr );
- aStr.AppendAscii( " HH:MM:SS" );
+ SvtSysLocale aSysLocale;
+ DateFormat eDate = aSysLocale.GetLocaleData().getDateFormat();
+ OUString aDateStr;
+ switch( eDate )
+ {
+ case MDY: aDateStr = "MM.TT.JJJJ"; break;
+ case DMY: aDateStr = "TT.MM.JJJJ"; break;
+ case YMD: aDateStr = "JJJJ.MM.TT"; break;
+ default: aDateStr = "MM.TT.JJJJ";
+ }
- pFormatter->PutandConvertEntry( aStr, nCheckPos, nType,
- nIndex, LANGUAGE_GERMAN, eLangType );
- sal_Bool bSuccess = pFormatter->IsNumberFormat( *p->pOUString, nIndex, nRes );
- if ( bSuccess )
- {
- short nType_ = pFormatter->GetType( nIndex );
- if(!(nType_ & ( NUMBERFORMAT_DATETIME | NUMBERFORMAT_DATE |
- NUMBERFORMAT_TIME | NUMBERFORMAT_DEFINED )))
- bSuccess = sal_False;
- }
+ OUString aStr( aDateStr );
+ aStr += " HH:MM:SS";
- if ( !bSuccess )
+ pFormatter->PutandConvertEntry( aStr, nCheckPos, nType,
+ nIndex, LANGUAGE_GERMAN, eLangType );
+ sal_Bool bSuccess = pFormatter->IsNumberFormat( *p->pOUString, nIndex, nRes );
+ if ( bSuccess )
+ {
+ short nType_ = pFormatter->GetType( nIndex );
+ if(!(nType_ & ( NUMBERFORMAT_DATETIME | NUMBERFORMAT_DATE |
+ NUMBERFORMAT_TIME | NUMBERFORMAT_DEFINED )))
{
- SbxBase::SetError( SbxERR_CONVERSION ); nRes = 0;
+ bSuccess = sal_False;
}
-
- delete pFormatter;
}
- break;
- case SbxOBJECT:
- {
- SbxValue* pVal = PTR_CAST(SbxValue,p->pObj);
- if( pVal )
- nRes = pVal->GetDate();
- else
+
+ if ( !bSuccess )
{
- SbxBase::SetError( SbxERR_NO_OBJECT ); nRes = 0;
+ SbxBase::SetError( SbxERR_CONVERSION ); nRes = 0;
}
- break;
- }
-
- case SbxBYREF | SbxCHAR:
- nRes = *p->pChar; break;
- case SbxBYREF | SbxBYTE:
- nRes = *p->pByte; break;
- case SbxBYREF | SbxINTEGER:
- case SbxBYREF | SbxBOOL:
- nRes = *p->pInteger; break;
- case SbxBYREF | SbxLONG:
- nRes = *p->pLong; break;
- case SbxBYREF | SbxULONG:
- nRes = *p->pULong; break;
- case SbxBYREF | SbxERROR:
- case SbxBYREF | SbxUSHORT:
- nRes = *p->pUShort; break;
- case SbxBYREF | SbxSINGLE:
- nRes = *p->pSingle; break;
- case SbxBYREF | SbxDATE:
- case SbxBYREF | SbxDOUBLE:
- nRes = *p->pDouble; break;
- case SbxBYREF | SbxCURRENCY:
- nRes = ImpCurrencyToDouble( *p->pnInt64 ); break;
- case SbxBYREF | SbxSALINT64:
- nRes = static_cast< double >(*p->pnInt64); break;
- case SbxBYREF | SbxSALUINT64:
- nRes = ImpSalUInt64ToDouble( *p->puInt64 ); break;
- default:
- SbxBase::SetError( SbxERR_CONVERSION ); nRes = 0;
+ delete pFormatter;
+ }
+ break;
+ case SbxOBJECT:
+ pVal = PTR_CAST(SbxValue,p->pObj);
+ if( pVal )
+ {
+ nRes = pVal->GetDate();
+ }
+ else
+ {
+ SbxBase::SetError( SbxERR_NO_OBJECT ); nRes = 0;
+ }
+ break;
+ case SbxBYREF | SbxCHAR:
+ nRes = *p->pChar;
+ break;
+ case SbxBYREF | SbxBYTE:
+ nRes = *p->pByte;
+ break;
+ case SbxBYREF | SbxINTEGER:
+ case SbxBYREF | SbxBOOL:
+ nRes = *p->pInteger;
+ break;
+ case SbxBYREF | SbxLONG:
+ nRes = *p->pLong;
+ break;
+ case SbxBYREF | SbxULONG:
+ nRes = *p->pULong;
+ break;
+ case SbxBYREF | SbxERROR:
+ case SbxBYREF | SbxUSHORT:
+ nRes = *p->pUShort;
+ break;
+ case SbxBYREF | SbxSINGLE:
+ nRes = *p->pSingle;
+ break;
+ case SbxBYREF | SbxDATE:
+ case SbxBYREF | SbxDOUBLE:
+ nRes = *p->pDouble;
+ break;
+ case SbxBYREF | SbxCURRENCY:
+ nRes = ImpCurrencyToDouble( *p->pnInt64 );
+ break;
+ case SbxBYREF | SbxSALINT64:
+ nRes = static_cast< double >(*p->pnInt64);
+ break;
+ case SbxBYREF | SbxSALUINT64:
+ nRes = ImpSalUInt64ToDouble( *p->puInt64 );
+ break;
+ default:
+ SbxBase::SetError( SbxERR_CONVERSION ); nRes = 0;
+ break;
}
return nRes;
}
@@ -175,54 +207,67 @@ double ImpGetDate( const SbxValues* p )
void ImpPutDate( SbxValues* p, double n )
{
SbxValues aTmp;
+ SbxDecimal* pDec;
+ SbxValue* pVal;
start:
switch( +p->eType )
{
- case SbxDATE:
- case SbxDOUBLE:
- p->nDouble = n; break;
-
+ case SbxDATE:
+ case SbxDOUBLE:
+ p->nDouble = n;
+ break;
// from here will be tested
- case SbxCHAR:
- aTmp.pChar = &p->nChar; goto direct;
- case SbxBYTE:
- aTmp.pByte = &p->nByte; goto direct;
- case SbxINTEGER:
- case SbxBOOL:
- aTmp.pInteger = &p->nInteger; goto direct;
- case SbxLONG:
- aTmp.pLong = &p->nLong; goto direct;
- case SbxULONG:
- aTmp.pULong = &p->nULong; goto direct;
- case SbxERROR:
- case SbxUSHORT:
- aTmp.pUShort = &p->nUShort; goto direct;
- case SbxSINGLE:
- aTmp.pSingle = &p->nSingle; goto direct;
- case SbxCURRENCY:
- case SbxSALINT64:
- aTmp.pnInt64 = &p->nInt64; goto direct;
- case SbxSALUINT64:
- aTmp.puInt64 = &p->uInt64; goto direct;
- case SbxDECIMAL:
- case SbxBYREF | SbxDECIMAL:
- {
- SbxDecimal* pDec = ImpCreateDecimal( p );
- if( !pDec->setDouble( n ) )
- SbxBase::SetError( SbxERR_OVERFLOW );
- break;
- }
- direct:
- aTmp.eType = SbxDataType( p->eType | SbxBYREF );
- p = &aTmp; goto start;
+ case SbxCHAR:
+ aTmp.pChar = &p->nChar;
+ goto direct;
+ case SbxBYTE:
+ aTmp.pByte = &p->nByte;
+ goto direct;
+ case SbxINTEGER:
+ case SbxBOOL:
+ aTmp.pInteger = &p->nInteger;
+ goto direct;
+ case SbxLONG:
+ aTmp.pLong = &p->nLong;
+ goto direct;
+ case SbxULONG:
+ aTmp.pULong = &p->nULong;
+ goto direct;
+ case SbxERROR:
+ case SbxUSHORT:
+ aTmp.pUShort = &p->nUShort;
+ goto direct;
+ case SbxSINGLE:
+ aTmp.pSingle = &p->nSingle;
+ goto direct;
+ case SbxCURRENCY:
+ case SbxSALINT64:
+ aTmp.pnInt64 = &p->nInt64;
+ goto direct;
+ case SbxSALUINT64:
+ aTmp.puInt64 = &p->uInt64;
+ goto direct;
+ case SbxDECIMAL:
+ case SbxBYREF | SbxDECIMAL:
+ pDec = ImpCreateDecimal( p );
+ if( !pDec->setDouble( n ) )
+ {
+ SbxBase::SetError( SbxERR_OVERFLOW );
+ }
+ break;
+ direct:
+ aTmp.eType = SbxDataType( p->eType | SbxBYREF );
+ p = &aTmp; goto start;
- case SbxBYREF | SbxSTRING:
- case SbxSTRING:
- case SbxLPSTR:
+ case SbxBYREF | SbxSTRING:
+ case SbxSTRING:
+ case SbxLPSTR:
{
if( !p->pOUString )
- p->pOUString = new ::rtl::OUString;
+ {
+ p->pOUString = new OUString;
+ }
Color* pColor;
LanguageType eLangType = GetpApp()->GetSettings().GetLanguage();
@@ -232,12 +277,12 @@ start:
pFormatter = new SvNumberFormatter( xFactory, eLangType );
sal_uInt32 nIndex;
- xub_StrLen nCheckPos = 0;
+ sal_uInt16 nCheckPos = 0;
short nType;
SvtSysLocale aSysLocale;
DateFormat eDate = aSysLocale.GetLocaleData().getDateFormat();
- String aStr;
+ OUString aStr;
// if the whole-number part is 0, we want no year!
if( n <= -1.0 || n >= 1.0 )
{
@@ -246,139 +291,153 @@ start:
{
switch( eDate )
{
- case MDY: aStr.AssignAscii( "MM.TT.JJJJ" ); break;
- case DMY: aStr.AssignAscii( "TT.MM.JJJJ" ); break;
- case YMD: aStr.AssignAscii( "JJJJ.MM.TT" ); break;
- default: aStr.AssignAscii( "MM.TT.JJJJ" );
+ case MDY: aStr = "MM.TT.JJJJ"; break;
+ case DMY: aStr = "TT.MM.JJJJ"; break;
+ case YMD: aStr = "JJJJ.MM.TT"; break;
+ default: aStr = "MM.TT.JJJJ";
}
}
else
{
switch( eDate )
{
- case MDY: aStr.AssignAscii( "MM.TT.JJJJ HH:MM:SS" ); break;
- case DMY: aStr.AssignAscii( "TT.MM.JJJJ HH:MM:SS" ); break;
- case YMD: aStr.AssignAscii( "JJJJ.MM.TT HH:MM:SS" ); break;
- default: aStr.AssignAscii( "MM.TT.JJJJ HH:MM:SS" );
+ case MDY: aStr = "MM.TT.JJJJ HH:MM:SS"; break;
+ case DMY: aStr = "TT.MM.JJJJ HH:MM:SS"; break;
+ case YMD: aStr = "JJJJ.MM.TT HH:MM:SS"; break;
+ default: aStr = "MM.TT.JJJJ HH:MM:SS";
}
}
}
else
- aStr.AppendAscii( "HH:MM:SS" );
-
+ {
+ aStr = "HH:MM:SS";
+ }
pFormatter->PutandConvertEntry( aStr,
- nCheckPos,
- nType,
- nIndex,
- LANGUAGE_GERMAN,
- eLangType );
- String aTmpString;
+ nCheckPos,
+ nType,
+ nIndex,
+ LANGUAGE_GERMAN,
+ eLangType );
+ OUString aTmpString;
pFormatter->GetOutputString( n, nIndex, aTmpString, &pColor );
*p->pOUString = aTmpString;
delete pFormatter;
break;
}
- case SbxOBJECT:
+ case SbxOBJECT:
+ pVal = PTR_CAST(SbxValue,p->pObj);
+ if( pVal )
{
- SbxValue* pVal = PTR_CAST(SbxValue,p->pObj);
- if( pVal )
- pVal->PutDate( n );
- else
- SbxBase::SetError( SbxERR_NO_OBJECT );
- break;
+ pVal->PutDate( n );
}
- case SbxBYREF | SbxCHAR:
- if( n > SbxMAXCHAR )
- {
- SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMAXCHAR;
- }
- else if( n < SbxMINCHAR )
- {
- SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMINCHAR;
- }
- *p->pChar = (sal_Unicode) n; break;
- case SbxBYREF | SbxBYTE:
- if( n > SbxMAXBYTE )
- {
- SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMAXBYTE;
- }
- else if( n < 0 )
- {
- SbxBase::SetError( SbxERR_OVERFLOW ); n = 0;
- }
- *p->pByte = (sal_uInt8) n; break;
- case SbxBYREF | SbxINTEGER:
- case SbxBYREF | SbxBOOL:
- if( n > SbxMAXINT )
- {
- SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMAXINT;
- }
- else if( n < SbxMININT )
- {
- SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMININT;
- }
- *p->pInteger = (sal_Int16) n; break;
- case SbxBYREF | SbxERROR:
- case SbxBYREF | SbxUSHORT:
- if( n > SbxMAXUINT )
- {
- SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMAXUINT;
- }
- else if( n < 0 )
- {
- SbxBase::SetError( SbxERR_OVERFLOW ); n = 0;
- }
- *p->pUShort = (sal_uInt16) n; break;
- case SbxBYREF | SbxLONG:
- if( n > SbxMAXLNG )
- {
- SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMAXLNG;
- }
- else if( n < SbxMINLNG )
- {
- SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMINLNG;
- }
- *p->pLong = (sal_Int32) n; break;
- case SbxBYREF | SbxULONG:
- if( n > SbxMAXULNG )
- {
- SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMAXULNG;
- }
- else if( n < 0 )
- {
- SbxBase::SetError( SbxERR_OVERFLOW ); n = 0;
- }
- *p->pULong = (sal_uInt32) n; break;
- case SbxBYREF | SbxSINGLE:
- if( n > SbxMAXSNG )
- {
- SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMAXSNG;
- }
- else if( n < SbxMINSNG )
- {
- SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMINSNG;
- }
- *p->pSingle = (float) n; break;
- case SbxBYREF | SbxSALINT64:
- *p->pnInt64 = ImpDoubleToSalInt64( n ); break;
- case SbxBYREF | SbxSALUINT64:
- *p->puInt64 = ImpDoubleToSalUInt64( n ); break;
- case SbxBYREF | SbxDATE:
- case SbxBYREF | SbxDOUBLE:
- *p->pDouble = (double) n; break;
- case SbxBYREF | SbxCURRENCY:
- if( n > SbxMAXCURR )
- {
- SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMAXCURR;
- }
- else if( n < SbxMINCURR )
- {
- SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMINCURR;
- }
- *p->pnInt64 = ImpDoubleToCurrency( n ); break;
-
- default:
- SbxBase::SetError( SbxERR_CONVERSION );
+ else
+ {
+ SbxBase::SetError( SbxERR_NO_OBJECT );
+ }
+ break;
+ case SbxBYREF | SbxCHAR:
+ if( n > SbxMAXCHAR )
+ {
+ SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMAXCHAR;
+ }
+ else if( n < SbxMINCHAR )
+ {
+ SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMINCHAR;
+ }
+ *p->pChar = (sal_Unicode) n;
+ break;
+ case SbxBYREF | SbxBYTE:
+ if( n > SbxMAXBYTE )
+ {
+ SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMAXBYTE;
+ }
+ else if( n < 0 )
+ {
+ SbxBase::SetError( SbxERR_OVERFLOW ); n = 0;
+ }
+ *p->pByte = (sal_uInt8) n;
+ break;
+ case SbxBYREF | SbxINTEGER:
+ case SbxBYREF | SbxBOOL:
+ if( n > SbxMAXINT )
+ {
+ SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMAXINT;
+ }
+ else if( n < SbxMININT )
+ {
+ SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMININT;
+ }
+ *p->pInteger = (sal_Int16) n;
+ break;
+ case SbxBYREF | SbxERROR:
+ case SbxBYREF | SbxUSHORT:
+ if( n > SbxMAXUINT )
+ {
+ SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMAXUINT;
+ }
+ else if( n < 0 )
+ {
+ SbxBase::SetError( SbxERR_OVERFLOW ); n = 0;
+ }
+ *p->pUShort = (sal_uInt16) n;
+ break;
+ case SbxBYREF | SbxLONG:
+ if( n > SbxMAXLNG )
+ {
+ SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMAXLNG;
+ }
+ else if( n < SbxMINLNG )
+ {
+ SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMINLNG;
+ }
+ *p->pLong = (sal_Int32) n;
+ break;
+ case SbxBYREF | SbxULONG:
+ if( n > SbxMAXULNG )
+ {
+ SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMAXULNG;
+ }
+ else if( n < 0 )
+ {
+ SbxBase::SetError( SbxERR_OVERFLOW ); n = 0;
+ }
+ *p->pULong = (sal_uInt32) n;
+ break;
+ case SbxBYREF | SbxSINGLE:
+ if( n > SbxMAXSNG )
+ {
+ SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMAXSNG;
+ }
+ else if( n < SbxMINSNG )
+ {
+ SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMINSNG;
+ }
+ *p->pSingle = (float) n;
+ break;
+ case SbxBYREF | SbxSALINT64:
+ *p->pnInt64 = ImpDoubleToSalInt64( n );
+ break;
+ case SbxBYREF | SbxSALUINT64:
+ *p->puInt64 = ImpDoubleToSalUInt64( n );
+ break;
+ case SbxBYREF | SbxDATE:
+ case SbxBYREF | SbxDOUBLE:
+ *p->pDouble = (double) n;
+ break;
+ case SbxBYREF | SbxCURRENCY:
+ if( n > SbxMAXCURR )
+ {
+ SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMAXCURR;
+ }
+ else if( n < SbxMINCURR )
+ {
+ SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMINCURR;
+ }
+ *p->pnInt64 = ImpDoubleToCurrency( n );
+ break;
+ default:
+ SbxBase::SetError( SbxERR_CONVERSION );
+ break;
}
}
diff --git a/basic/source/sbx/sbxexec.cxx b/basic/source/sbx/sbxexec.cxx
index 3376d977c82f..3eaaecf8b7c2 100644
--- a/basic/source/sbx/sbxexec.cxx
+++ b/basic/source/sbx/sbxexec.cxx
@@ -59,7 +59,7 @@ static const sal_Unicode* SkipWhitespace( const sal_Unicode* p )
// Scanning of a symbol. The symbol were inserted in rSym, the return value
// is the new scan position. The symbol is at errors empty.
-static const sal_Unicode* Symbol( const sal_Unicode* p, XubString& rSym, const SbxSimpleCharClass& rCharClass )
+static const sal_Unicode* Symbol( const sal_Unicode* p, OUString& rSym, const SbxSimpleCharClass& rCharClass )
{
sal_uInt16 nLen = 0;
// Did we have a nonstandard symbol?
@@ -67,26 +67,34 @@ static const sal_Unicode* Symbol( const sal_Unicode* p, XubString& rSym, const S
{
rSym = ++p;
while( *p && *p != ']' )
+ {
p++, nLen++;
+ }
p++;
}
else
{
// A symbol had to begin with a alphabetic character or an underline
if( !rCharClass.isAlpha( *p ) && *p != '_' )
+ {
SbxBase::SetError( SbxERR_SYNTAX );
+ }
else
{
rSym = p;
// The it can contain alphabetic characters, numbers or underlines
while( *p && (rCharClass.isAlphaNumeric( *p ) || *p == '_') )
+ {
p++, nLen++;
+ }
// BASIC-Standard-Suffixes were ignored
if( *p && (*p == '%' || *p == '&' || *p == '!' || *p == '#' || *p == '$' ) )
+ {
p++;
+ }
}
}
- rSym.Erase( nLen );
+ rSym = rSym.copy( 0, nLen );
return p;
}
@@ -156,18 +164,24 @@ static SbxVariable* Operand
else if( !bVar && *p == '"' )
{
// A string
- XubString aString;
+ OUString aString;
p++;
for( ;; )
{
// This is perhaps an error
if( !*p )
+ {
return NULL;
+ }
// Double quotes are OK
if( *p == '"' )
+ {
if( *++p != '"' )
+ {
break;
- aString += *p++;
+ }
+ }
+ aString += OUString(*p++);
}
refVar->PutString( aString );
}
@@ -294,14 +308,16 @@ static SbxVariable* Element
( SbxObject* pObj, SbxObject* pGbl, const sal_Unicode** ppBuf,
SbxClassType t, const SbxSimpleCharClass& rCharClass )
{
- XubString aSym;
+ OUString aSym;
const sal_Unicode* p = Symbol( *ppBuf, aSym, rCharClass );
SbxVariableRef refVar;
- if( aSym.Len() )
+ if( !aSym.isEmpty() )
{
sal_uInt16 nOld = pObj->GetFlags();
if( pObj == pGbl )
+ {
pObj->SetFlag( SBX_GBLSEARCH );
+ }
refVar = pObj->Find( aSym, t );
pObj->SetFlags( nOld );
if( refVar.Is() )
@@ -354,22 +370,26 @@ static SbxVariable* Element
// Mainroutine
-SbxVariable* SbxObject::Execute( const XubString& rTxt )
+SbxVariable* SbxObject::Execute( const OUString& rTxt )
{
SbxVariable* pVar = NULL;
- const sal_Unicode* p = rTxt.GetBuffer();
+ const sal_Unicode* p = rTxt.getStr();
for( ;; )
{
p = SkipWhitespace( p );
if( !*p )
+ {
break;
+ }
if( *p++ != '[' )
{
SetError( SbxERR_SYNTAX ); break;
}
pVar = Assign( this, this, &p );
if( !pVar )
+ {
break;
+ }
p = SkipWhitespace( p );
if( *p++ != ']' )
{
@@ -379,17 +399,21 @@ SbxVariable* SbxObject::Execute( const XubString& rTxt )
return pVar;
}
-SbxVariable* SbxObject::FindQualified( const XubString& rName, SbxClassType t )
+SbxVariable* SbxObject::FindQualified( const OUString& rName, SbxClassType t )
{
SbxVariable* pVar = NULL;
- const sal_Unicode* p = rName.GetBuffer();
+ const sal_Unicode* p = rName.getStr();
p = SkipWhitespace( p );
if( !*p )
+ {
return NULL;;
+ }
pVar = QualifiedName( this, this, &p, t );
p = SkipWhitespace( p );
if( *p )
+ {
SetError( SbxERR_SYNTAX );
+ }
return pVar;
}
diff --git a/basic/source/sbx/sbxform.cxx b/basic/source/sbx/sbxform.cxx
index b267df7cfc3d..0661861f4694 100644
--- a/basic/source/sbx/sbxform.cxx
+++ b/basic/source/sbx/sbxform.cxx
@@ -21,6 +21,7 @@
#include <stdlib.h>
#include <basic/sbxform.hxx>
+#include <rtl/ustrbuf.hxx>
/*
TODO: are there any Star-Basic characteristics unconsidered?
@@ -107,14 +108,14 @@ double get_number_of_digits( double dNumber )
//=================================================================
SbxBasicFormater::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 )
{
cDecPoint = _cDecPoint;
cThousandSep = _cThousandSep;
@@ -133,46 +134,50 @@ SbxBasicFormater::SbxBasicFormater( sal_Unicode _cDecPoint, sal_Unicode _cThousa
// for one position to larger indexes, i. e. place for a new
// character (which is to be inserted) is created.
// ATTENTION: the string MUST be long enough!
-inline void SbxBasicFormater::ShiftString( String& sStrg, sal_uInt16 nStartPos )
+inline void SbxBasicFormater::ShiftString( OUStringBuffer& sStrg, sal_uInt16 nStartPos )
{
- sStrg.Erase( nStartPos,1 );
+ sStrg.remove(nStartPos,1);
}
-inline void SbxBasicFormater::StrAppendChar( String& sStrg, sal_Unicode ch )
-{
- sStrg.Insert( ch );
-}
-
-void SbxBasicFormater::AppendDigit( String& sStrg, short nDigit )
+void SbxBasicFormater::AppendDigit( OUStringBuffer& sStrg, short nDigit )
{
if( nDigit>=0 && nDigit<=9 )
- StrAppendChar( sStrg, (sal_Unicode)(nDigit+ASCII_0) );
+ {
+ sStrg.append((sal_Unicode)(nDigit+ASCII_0));
+ }
}
-void SbxBasicFormater::LeftShiftDecimalPoint( String& sStrg )
+void SbxBasicFormater::LeftShiftDecimalPoint( OUStringBuffer& sStrg )
{
- sal_uInt16 nPos = sStrg.Search( cDecPoint );
+ sal_Int32 nPos = -1;
- if( nPos!=STRING_NOTFOUND )
+ for(sal_Int32 i = 0; i < sStrg.getLength(); i++)
{
- // swap decimal point
- sStrg.SetChar( nPos, sStrg.GetChar( nPos - 1 ) );
- sStrg.SetChar( nPos-1, cDecPoint );
+ if(sStrg[i] == cDecPoint)
+ {
+ nPos = i;
+ break;
+ }
+ }
+ if( nPos >= 0 )
+ {
+ sStrg[nPos] = sStrg[nPos - 1];
+ sStrg[nPos - 1] = cDecPoint;
}
}
// returns a flag if rounding a 9
-void SbxBasicFormater::StrRoundDigit( String& sStrg, short nPos, sal_Bool& bOverflow )
+void SbxBasicFormater::StrRoundDigit( OUStringBuffer& sStrg, short nPos, sal_Bool& bOverflow )
{
if( nPos<0 )
+ {
return;
-
+ }
bOverflow = sal_False;
-
- sal_Unicode c = sStrg.GetChar( nPos );
- if( nPos>0 && (c == cDecPoint || c == cThousandSep) )
+ sal_Unicode c = sStrg[nPos];
+ if( nPos > 0 && (c == cDecPoint || c == cThousandSep) )
{
- StrRoundDigit( sStrg,nPos-1,bOverflow );
+ StrRoundDigit( sStrg, nPos - 1, bOverflow );
// CHANGE from 9.3.1997: end the method immediately after recursive call!
return;
}
@@ -182,52 +187,56 @@ void SbxBasicFormater::StrRoundDigit( String& sStrg, short nPos, sal_Bool& bOver
// in one piece, i. e. special characters should ONLY be in
// front OR behind the number and not right in the middle of
// the format information for the number
- while( nPos>=0 && (sStrg.GetChar( nPos )<ASCII_0 || sStrg.GetChar( nPos )>ASCII_9) )
+ while( nPos >= 0 && ( sStrg[nPos] < ASCII_0 || sStrg[nPos] > ASCII_9 ))
+ {
nPos--;
-
+ }
if( nPos==-1 )
{
- ShiftString( sStrg,0 );
- sStrg.SetChar( 0, '1' );
+ ShiftString( sStrg, 0 );
+ sStrg[0] = (sal_Unicode)'1';
bOverflow = sal_True;
}
else
{
- sal_Unicode c2 = sStrg.GetChar( nPos );
+ sal_Unicode c2 = sStrg[nPos];
if( c2 >= ASCII_0 && c2 <= ASCII_9 )
{
if( c2 == ASCII_9 )
{
- sStrg.SetChar( nPos, '0' );
- StrRoundDigit( sStrg,nPos-1,bOverflow );
+ sStrg[nPos] = (sal_Unicode)'0';
+ StrRoundDigit( sStrg, nPos - 1, bOverflow );
}
else
- sStrg.SetChar( nPos, c2+1 );
+ {
+ sStrg[nPos] = c2 + 1;
+ }
}
else
{
ShiftString( sStrg,nPos+1 );
- sStrg.SetChar( nPos+1, '1' );
+ sStrg[nPos + 1] = (sal_Unicode)'1';
bOverflow = sal_True;
}
}
}
-
-void SbxBasicFormater::StrRoundDigit( String& sStrg, short nPos )
+void SbxBasicFormater::StrRoundDigit( OUStringBuffer& sStrg, short nPos )
{
sal_Bool bOverflow;
- StrRoundDigit( sStrg,nPos,bOverflow );
+ StrRoundDigit( sStrg, nPos, bOverflow );
}
-void SbxBasicFormater::ParseBack( String& sStrg, const String& sFormatStrg,
+void SbxBasicFormater::ParseBack( OUStringBuffer& sStrg, const OUString& sFormatStrg,
short nFormatPos )
{
- for( short i=nFormatPos;
- i>0 && sFormatStrg.GetChar( i ) == '#' && sStrg.GetChar( (sStrg.Len()-1) ) == '0';
+ for( sal_Int32 i = nFormatPos;
+ i>0 && sFormatStrg[ i ] == (sal_Unicode)'#' && sStrg[sStrg.getLength() - 1] == (sal_Unicode)'0';
i-- )
- { sStrg.Erase( sStrg.Len()-1 ); }
+ {
+ sStrg.setLength(sStrg.getLength() - 1 );
+ }
}
#ifdef _with_sprintf
@@ -241,7 +250,7 @@ void SbxBasicFormater::InitScan( double _dNum )
InitExp( get_number_of_digits( dNum ) );
// maximum of 15 positions behind the decimal point, example: -1.234000000000000E-001
/*int nCount =*/ sprintf( sBuffer,"%+22.15lE",dNum );
- sSciNumStrg.AssignAscii( sBuffer );
+ sSciNumStrg = rtl::OUString::createFromAscii( sBuffer );
}
@@ -250,7 +259,7 @@ void SbxBasicFormater::InitExp( double _dNewExp )
char sBuffer[ MAX_DOUBLE_BUFFER_LENGTH ];
nNumExp = (short)_dNewExp;
/*int nCount =*/ sprintf( sBuffer,"%+i",nNumExp );
- sNumExpStrg.AssignAscii( sBuffer );
+ sNumExpStrg = rtl::OUString::createFromAscii( sBuffer );
nExpExp = (short)get_number_of_digits( (double)nNumExp );
}
@@ -262,7 +271,9 @@ short SbxBasicFormater::GetDigitAtPosScan( short nPos, sal_Bool& bFoundFirstDigi
// or to read a digit outside of the
// number's dissolution (double)
if( nPos>nNumExp || abs(nNumExp-nPos)>MAX_NO_OF_DIGITS )
+ {
return _NO_DIGIT;
+ }
// determine the index of the position in the number-string:
// skip the leading sign
sal_uInt16 no = 1;
@@ -273,7 +284,7 @@ short SbxBasicFormater::GetDigitAtPosScan( short nPos, sal_Bool& bFoundFirstDigi
// query of the number's first valid digit --> set flag
if( nPos==nNumExp )
bFoundFirstDigit = sal_True;
- return (short)(sSciNumStrg.GetChar( no ) - ASCII_0);
+ return (short)(sSciNumStrg[ no ] - ASCII_0);
}
short SbxBasicFormater::GetDigitAtPosExpScan( short nPos, sal_Bool& bFoundFirstDigit )
@@ -286,7 +297,7 @@ short SbxBasicFormater::GetDigitAtPosExpScan( short nPos, sal_Bool& bFoundFirstD
if( nPos==nExpExp )
bFoundFirstDigit = sal_True;
- return (short)(sNumExpStrg.GetChar( no ) - ASCII_0);
+ return (short)(sNumExpStrg[ no ] - ASCII_0);
}
// a value for the exponent can be given because the number maybe shall
@@ -365,108 +376,115 @@ short SbxBasicFormater::RoundDigit( double dNumber )
// Copies the respective part of the format-string, if existing, and returns it.
// So a new string is created, which has to be freed by the caller later.
-String SbxBasicFormater::GetPosFormatString( const String& sFormatStrg, sal_Bool & bFound )
+OUString SbxBasicFormater::GetPosFormatString( const OUString& sFormatStrg, sal_Bool & bFound )
{
bFound = sal_False; // default...
- sal_uInt16 nPos = sFormatStrg.Search( FORMAT_SEPARATOR );
+ sal_Int32 nPos = sFormatStrg.indexOf( FORMAT_SEPARATOR );
- if( nPos!=STRING_NOTFOUND )
+ if( nPos >= 0 )
{
bFound = sal_True;
// the format-string for positive numbers is
// everything before the first ';'
- return sFormatStrg.Copy( 0,nPos );
+ return sFormatStrg.copy( 0,nPos );
}
- String aRetStr;
- aRetStr.AssignAscii( EMPTYFORMATSTRING );
+ OUString aRetStr;
+ aRetStr = rtl::OUString::createFromAscii( EMPTYFORMATSTRING );
return aRetStr;
}
// see also GetPosFormatString()
-String SbxBasicFormater::GetNegFormatString( const String& sFormatStrg, sal_Bool & bFound )
+OUString SbxBasicFormater::GetNegFormatString( const OUString& sFormatStrg, sal_Bool & bFound )
{
bFound = sal_False; // default...
- sal_uInt16 nPos = sFormatStrg.Search( FORMAT_SEPARATOR );
+ sal_Int32 nPos = sFormatStrg.indexOf( FORMAT_SEPARATOR );
- if( nPos!=STRING_NOTFOUND )
+ if( nPos >= 0)
{
// the format-string for negative numbers is
// everything between the first and the second ';'
- String sTempStrg = sFormatStrg.Copy( nPos+1 );
- nPos = sTempStrg.Search( FORMAT_SEPARATOR );
+ OUString sTempStrg = sFormatStrg.copy( nPos+1 );
+ nPos = sTempStrg.indexOf( FORMAT_SEPARATOR );
bFound = sal_True;
- if( nPos==STRING_NOTFOUND )
+ if( nPos < 0 )
+ {
return sTempStrg;
+ }
else
- return sTempStrg.Copy( 0,nPos );
+ {
+ return sTempStrg.copy( 0,nPos );
+ }
}
- String aRetStr;
- aRetStr.AssignAscii( EMPTYFORMATSTRING );
+ OUString aRetStr;
+ aRetStr = rtl::OUString::createFromAscii( EMPTYFORMATSTRING );
return aRetStr;
}
// see also GetPosFormatString()
-String SbxBasicFormater::Get0FormatString( const String& sFormatStrg, sal_Bool & bFound )
+OUString SbxBasicFormater::Get0FormatString( const OUString& sFormatStrg, sal_Bool & bFound )
{
bFound = sal_False; // default...
- sal_uInt16 nPos = sFormatStrg.Search( FORMAT_SEPARATOR );
+ sal_Int32 nPos = sFormatStrg.indexOf( FORMAT_SEPARATOR );
- if( nPos!=STRING_NOTFOUND )
+ if( nPos >= 0 )
{
// the format string for the zero is
// everything after the second ';'
- String sTempStrg = sFormatStrg.Copy( nPos+1 );
- nPos = sTempStrg.Search( FORMAT_SEPARATOR );
- if( nPos!=STRING_NOTFOUND )
+ OUString sTempStrg = sFormatStrg.copy( nPos+1 );
+ nPos = sTempStrg.indexOf( FORMAT_SEPARATOR );
+ if( nPos >= 0 )
{
bFound = sal_True;
- sTempStrg = sTempStrg.Copy( nPos+1 );
- nPos = sTempStrg.Search( FORMAT_SEPARATOR );
- if( nPos==STRING_NOTFOUND )
+ sTempStrg = sTempStrg.copy( nPos+1 );
+ nPos = sTempStrg.indexOf( FORMAT_SEPARATOR );
+ if( nPos < 0 )
+ {
return sTempStrg;
+ }
else
- return sTempStrg.Copy( 0,nPos );
+ {
+ return sTempStrg.copy( 0,nPos );
+ }
}
}
- String aRetStr;
- aRetStr.AssignAscii( EMPTYFORMATSTRING );
+ OUString aRetStr;
+ aRetStr = rtl::OUString::createFromAscii( EMPTYFORMATSTRING );
return aRetStr;
}
// see also GetPosFormatString()
-String SbxBasicFormater::GetNullFormatString( const String& sFormatStrg, sal_Bool & bFound )
+OUString SbxBasicFormater::GetNullFormatString( const OUString& sFormatStrg, sal_Bool & bFound )
{
bFound = sal_False; // default...
- sal_uInt16 nPos = sFormatStrg.Search( FORMAT_SEPARATOR );
+ sal_Int32 nPos = sFormatStrg.indexOf( FORMAT_SEPARATOR );
- if( nPos!=STRING_NOTFOUND )
+ if( nPos >= 0 )
{
// the format-string for the Null is
// everything after the third ';'
- String sTempStrg = sFormatStrg.Copy( nPos+1 );
- nPos = sTempStrg.Search( FORMAT_SEPARATOR );
- if( nPos!=STRING_NOTFOUND )
+ OUString sTempStrg = sFormatStrg.copy( nPos+1 );
+ nPos = sTempStrg.indexOf( FORMAT_SEPARATOR );
+ if( nPos >= 0 )
{
- sTempStrg = sTempStrg.Copy( nPos+1 );
- nPos = sTempStrg.Search( FORMAT_SEPARATOR );
- if( nPos!=STRING_NOTFOUND )
+ sTempStrg = sTempStrg.copy( nPos+1 );
+ nPos = sTempStrg.indexOf( FORMAT_SEPARATOR );
+ if( nPos >= 0 )
{
bFound = sal_True;
- return sTempStrg.Copy( nPos+1 );
+ return sTempStrg.copy( nPos+1 );
}
}
}
- String aRetStr;
- aRetStr.AssignAscii( EMPTYFORMATSTRING );
+ OUString aRetStr;
+ aRetStr = rtl::OUString::createFromAscii( EMPTYFORMATSTRING );
return aRetStr;
}
-
// returns value <> 0 in case of an error
-short SbxBasicFormater::AnalyseFormatString( const String& sFormatStrg,
+short SbxBasicFormater::AnalyseFormatString( const OUString& sFormatStrg,
short& nNoOfDigitsLeft, short& nNoOfDigitsRight,
short& nNoOfOptionalDigitsLeft,
short& nNoOfExponentDigits, short& nNoOfOptionalExponentDigits,
@@ -474,10 +492,10 @@ short SbxBasicFormater::AnalyseFormatString( const String& sFormatStrg,
sal_Bool& bGenerateThousandSeparator,
short& nMultipleThousandSeparators )
{
- sal_uInt16 nLen;
+ sal_Int32 nLen;
short nState = 0;
- nLen = sFormatStrg.Len();
+ nLen = sFormatStrg.getLength();
nNoOfDigitsLeft = 0;
nNoOfDigitsRight = 0;
nNoOfOptionalDigitsLeft = 0;
@@ -488,81 +506,93 @@ short SbxBasicFormater::AnalyseFormatString( const String& sFormatStrg,
bScientific = sal_False;
// from 11.7.97: as soon as a comma (point?) is found in the format string,
// all three decimal powers are marked (i. e. thousand, million, ...)
- bGenerateThousandSeparator = sFormatStrg.Search( ',' ) != STRING_NOTFOUND;
+ bGenerateThousandSeparator = sFormatStrg.indexOf( ',' ) >= 0;
nMultipleThousandSeparators = 0;
- for( sal_uInt16 i=0; i<nLen; i++ )
+ for( sal_Int32 i = 0; i < nLen; i++ )
{
- sal_Unicode c = sFormatStrg.GetChar( i );
- switch( c ) {
- case '#':
- case '0':
- if( nState==0 )
- {
- nNoOfDigitsLeft++;
+ sal_Unicode c = sFormatStrg[ i ];
+ switch( c )
+ {
+ case '#':
+ case '0':
+ if( nState==0 )
+ {
+ nNoOfDigitsLeft++;
// TODO here maybe better error inspection of the mantissa for valid syntax (see grammar)h
- // ATTENTION: 'undefined' behaviour if # and 0 are combined!
- // REMARK: #-placeholders are actually useless for
- // scientific display before the decimal point!
- if( c=='#' )
- nNoOfOptionalDigitsLeft++;
- }
- else if( nState==1 )
- nNoOfDigitsRight++;
- else if( nState==-1 ) // search 0 in the exponent
+ // ATTENTION: 'undefined' behaviour if # and 0 are combined!
+ // REMARK: #-placeholders are actually useless for
+ // scientific display before the decimal point!
+ if( c=='#' )
{
- if( c=='#' ) // # switches on the condition
- {
- nNoOfOptionalExponentDigits++;
- nState = -2;
- }
- nNoOfExponentDigits++;
+ nNoOfOptionalDigitsLeft++;
}
- else if( nState==-2 ) // search # in the exponent
+ }
+ else if( nState==1 )
+ {
+ nNoOfDigitsRight++;
+ }
+ else if( nState==-1 ) // search 0 in the exponent
+ {
+ if( c=='#' ) // # switches on the condition
{
- if( c=='0' )
- // ERROR: 0 after # in the exponent is NOT allowed!!
- return -4;
nNoOfOptionalExponentDigits++;
- nNoOfExponentDigits++;
+ nState = -2;
}
- break;
- case '.':
- nState++;
- if( nState>1 )
- return -1; // ERROR: too many decimal points
- break;
- case '%':
- bPercent = sal_True;
- break;
- case '(':
- bCurrency = sal_True;
- break;
- case ',':
+ nNoOfExponentDigits++;
+ }
+ else if( nState==-2 ) // search # in the exponent
+ {
+ if( c=='0' )
+ {
+ // ERROR: 0 after # in the exponent is NOT allowed!!
+ return -4;
+ }
+ nNoOfOptionalExponentDigits++;
+ nNoOfExponentDigits++;
+ }
+ break;
+ case '.':
+ nState++;
+ if( nState>1 )
{
- sal_Unicode ch = sFormatStrg.GetChar( i+1 );
+ return -1; // ERROR: too many decimal points
+ }
+ break;
+ case '%':
+ bPercent = sal_True;
+ break;
+ case '(':
+ bCurrency = sal_True;
+ break;
+ case ',':
+ {
+ sal_Unicode ch = sFormatStrg[ i+1 ];
if( ch!=0 && (ch==',' || ch=='.') )
- nMultipleThousandSeparators++;
- } break;
- case 'e':
- case 'E':
- // #i13821 not when no digits before
- if( nNoOfDigitsLeft > 0 || nNoOfDigitsRight > 0 )
{
- nState = -1; // abort counting digits
- bScientific = sal_True;
+ nMultipleThousandSeparators++;
}
- break;
+ }
+ break;
+ case 'e':
+ case 'E':
+ // #i13821 not when no digits before
+ if( nNoOfDigitsLeft > 0 || nNoOfDigitsRight > 0 )
+ {
+ nState = -1; // abort counting digits
+ bScientific = sal_True;
+ }
+ break;
// OWN command-character which turns on
// the creation of thousand-separators
- case '\\':
- // Ignore next char
- i++;
- break;
- case CREATE_1000SEP_CHAR:
- bGenerateThousandSeparator = sal_True;
- break;
+ case '\\':
+ // Ignore next char
+ i++;
+ break;
+ case CREATE_1000SEP_CHAR:
+ bGenerateThousandSeparator = sal_True;
+ break;
}
}
return 0;
@@ -571,15 +601,15 @@ short SbxBasicFormater::AnalyseFormatString( const String& sFormatStrg,
// the flag bCreateSign says that at the mantissa a leading sign
// shall be created
void SbxBasicFormater::ScanFormatString( double dNumber,
- const String& sFormatStrg, String& sReturnStrg,
- sal_Bool bCreateSign )
+ const OUString& sFormatStrg, OUString& sReturnStrgFinal,
+ sal_Bool bCreateSign )
{
short /*nErr,*/nNoOfDigitsLeft,nNoOfDigitsRight,nNoOfOptionalDigitsLeft,
- nNoOfExponentDigits,nNoOfOptionalExponentDigits,
- nMultipleThousandSeparators;
+ nNoOfExponentDigits,nNoOfOptionalExponentDigits,
+ nMultipleThousandSeparators;
sal_Bool bPercent,bCurrency,bScientific,bGenerateThousandSeparator;
- sReturnStrg = String();
+ OUStringBuffer sReturnStrg = OUStringBuffer();
// analyse the format-string, i. e. determine the following values:
/*
@@ -598,353 +628,404 @@ void SbxBasicFormater::ScanFormatString( double dNumber,
- other errors? multiple decimal points, E's, etc.
--> errors are simply ignored at the moment
*/
- AnalyseFormatString( sFormatStrg,nNoOfDigitsLeft,nNoOfDigitsRight,
- nNoOfOptionalDigitsLeft,nNoOfExponentDigits,
- nNoOfOptionalExponentDigits,
- bPercent,bCurrency,bScientific,bGenerateThousandSeparator,
- nMultipleThousandSeparators );
- // special handling for special characters
- if( bPercent )
- dNumber *= 100.0;
+ AnalyseFormatString( sFormatStrg, nNoOfDigitsLeft, nNoOfDigitsRight,
+ nNoOfOptionalDigitsLeft, nNoOfExponentDigits,
+ nNoOfOptionalExponentDigits,
+ bPercent, bCurrency, bScientific,
+ bGenerateThousandSeparator, nMultipleThousandSeparators );
+ // special handling for special characters
+ if( bPercent )
+ {
+ dNumber *= 100.0;
+ }
// TODO: this condition (,, or ,.) is NOT Visual-Basic compatible!
// Question: shall this stay here (requirements)?
- if( nMultipleThousandSeparators )
- dNumber /= 1000.0;
-
- double dExponent;
- short i,nLen;
- short nState,nDigitPos,nExponentPos,nMaxDigit,nMaxExponentDigit;
- sal_Bool bFirstDigit,bFirstExponentDigit,bFoundFirstDigit,
- bIsNegative,bZeroSpaceOn, bSignHappend,bDigitPosNegative;
-
- bSignHappend = sal_False;
- bFoundFirstDigit = sal_False;
- bIsNegative = dNumber<0.0;
- nLen = sFormatStrg.Len();
- dExponent = get_number_of_digits( dNumber );
- nExponentPos = 0;
- nMaxExponentDigit = 0;
- nMaxDigit = (short)dExponent;
- bDigitPosNegative = false;
- if( bScientific )
+ if( nMultipleThousandSeparators )
+ {
+ dNumber /= 1000.0;
+ }
+ double dExponent;
+ short i,nLen;
+ short nState,nDigitPos,nExponentPos,nMaxDigit,nMaxExponentDigit;
+ sal_Bool bFirstDigit,bFirstExponentDigit,bFoundFirstDigit,
+ bIsNegative,bZeroSpaceOn, bSignHappend,bDigitPosNegative;
+
+ bSignHappend = sal_False;
+ bFoundFirstDigit = sal_False;
+ bIsNegative = dNumber < 0.0;
+ nLen = sFormatStrg.getLength();
+ dExponent = get_number_of_digits( dNumber );
+ nExponentPos = 0;
+ nMaxExponentDigit = 0;
+ nMaxDigit = (short)dExponent;
+ bDigitPosNegative = false;
+ if( bScientific )
+ {
+ dExponent = dExponent - (double)(nNoOfDigitsLeft-1);
+ nDigitPos = nMaxDigit;
+ nMaxExponentDigit = (short)get_number_of_digits( dExponent );
+ nExponentPos = nNoOfExponentDigits - 1 - nNoOfOptionalExponentDigits;
+ }
+ else
+ {
+ nDigitPos = nNoOfDigitsLeft - 1; // counting starts at 0, 10^0
+ // no exponent-data is needed here!
+ bDigitPosNegative = (nDigitPos < 0);
+ }
+ bFirstDigit = sal_True;
+ bFirstExponentDigit = sal_True;
+ nState = 0; // 0 --> mantissa; 1 --> exponent
+ bZeroSpaceOn = 0;
+
+
+#ifdef _with_sprintf
+ InitScan( dNumber );
+#endif
+ // scanning the format-string:
+ sal_Unicode cForce = 0;
+ for( i = 0; i < nLen; i++ )
+ {
+ sal_Unicode c;
+ if( cForce )
{
- dExponent = dExponent - (double)(nNoOfDigitsLeft-1);
- nDigitPos = nMaxDigit;
- nMaxExponentDigit = (short)get_number_of_digits( dExponent );
- nExponentPos = nNoOfExponentDigits-1 - nNoOfOptionalExponentDigits;
+ c = cForce;
+ cForce = 0;
}
else
{
- nDigitPos = nNoOfDigitsLeft-1; // counting starts at 0, 10^0
- // no exponent-data is needed here!
- bDigitPosNegative = (nDigitPos < 0);
+ c = sFormatStrg[ i ];
}
- bFirstDigit = sal_True;
- bFirstExponentDigit = sal_True;
- nState = 0; // 0 --> mantissa; 1 --> exponent
- bZeroSpaceOn = 0;
-
-
-#ifdef _with_sprintf
- InitScan( dNumber );
-#endif
- // scanning the format-string:
- sal_Unicode cForce = 0;
- for( i=0; i<nLen; i++ )
+ switch( c )
{
- sal_Unicode c;
- if( cForce )
- {
- c = cForce;
- cForce = 0;
- }
- else
+ case '0':
+ case '#':
+ if( nState==0 )
{
- c = sFormatStrg.GetChar( i );
- }
- switch( c ) {
- case '0':
- case '#':
- if( nState==0 )
+ // handling of the mantissa
+ if( bFirstDigit )
+ {
+ // remark: at bCurrency the negative
+ // leading sign shall be shown with ()
+ if( bIsNegative && !bCreateSign && !bSignHappend )
{
- // handling of the mantissa
- if( bFirstDigit )
+ bSignHappend = sal_True;
+ sReturnStrg.append('-');
+ }
+ // output redundant positions, i. e. those which
+ // are undocumented by the format-string
+ if( nMaxDigit > nDigitPos )
+ {
+ for( short j = nMaxDigit; j > nDigitPos; j-- )
{
- // remark: at bCurrency the negative
- // leading sign shall be shown with ()
- if( bIsNegative && !bCreateSign && !bSignHappend )
- {
- bSignHappend = sal_True;
- StrAppendChar( sReturnStrg,'-' );
- }
- // output redundant positions, i. e. those which
- // are undocumented by the format-string
- if( nMaxDigit>nDigitPos )
- {
- for( short j=nMaxDigit; j>nDigitPos; j-- )
- {
- short nTempDigit;
+ short nTempDigit;
#ifdef _with_sprintf
- AppendDigit( sReturnStrg,nTempDigit = GetDigitAtPosScan( j,bFoundFirstDigit ) );
+ AppendDigit( sReturnStrg, nTempDigit = GetDigitAtPosScan( j, bFoundFirstDigit ) );
#else
- AppendDigit( sReturnStrg,nTempDigit = GetDigitAtPos( dNumber,j,dNumber,bFoundFirstDigit ) );
+ AppendDigit( sReturnStrg, nTempDigit = GetDigitAtPos( dNumber, j, dNumber, bFoundFirstDigit ) );
#endif
-
- if( nTempDigit!=_NO_DIGIT )
- bFirstDigit = sal_False;
-
- if( bGenerateThousandSeparator && ( c=='0' || nMaxDigit>=nDigitPos ) && j>0 && (j % 3 == 0) )
- StrAppendChar( sReturnStrg,cThousandSep );
- }
+ if( nTempDigit!=_NO_DIGIT )
+ {
+ bFirstDigit = sal_False;
+ }
+ if( bGenerateThousandSeparator && ( c=='0' || nMaxDigit >= nDigitPos ) && j > 0 && (j % 3 == 0) )
+ {
+ sReturnStrg.append(cThousandSep );
}
}
+ }
+ }
- if( nMaxDigit<nDigitPos && ( c=='0' || bZeroSpaceOn ) )
- {
- AppendDigit( sReturnStrg,0 );
-
- bFirstDigit = sal_False;
- bZeroSpaceOn = 1;
- // Remark: in Visual-Basic the first 0 turns on the 0 for
- // all the following # (up to the decimal point),
- // this behaviour is simulated here with the flag.
-
- if( bGenerateThousandSeparator && ( c=='0' || nMaxDigit>=nDigitPos ) && nDigitPos>0 && (nDigitPos % 3 == 0) )
- StrAppendChar( sReturnStrg,cThousandSep );
- }
- else
- {
- short nTempDigit;
+ if( nMaxDigit<nDigitPos && ( c=='0' || bZeroSpaceOn ) )
+ {
+ AppendDigit( sReturnStrg, 0 );
+ bFirstDigit = sal_False;
+ bZeroSpaceOn = 1;
+ // Remark: in Visual-Basic the first 0 turns on the 0 for
+ // all the following # (up to the decimal point),
+ // this behaviour is simulated here with the flag.
+ if( bGenerateThousandSeparator && ( c=='0' || nMaxDigit >= nDigitPos ) && nDigitPos > 0 && (nDigitPos % 3 == 0) )
+ {
+ sReturnStrg.append(cThousandSep);
+ }
+ }
+ else
+ {
+ short nTempDigit;
#ifdef _with_sprintf
- AppendDigit( sReturnStrg,nTempDigit = GetDigitAtPosScan( nDigitPos,bFoundFirstDigit ) );
+ AppendDigit( sReturnStrg, nTempDigit = GetDigitAtPosScan( nDigitPos, bFoundFirstDigit ) );
#else
- AppendDigit( sReturnStrg,nTempDigit = GetDigitAtPos( dNumber,nDigitPos,dNumber,bFoundFirstDigit ) );
+ AppendDigit( sReturnStrg, nTempDigit = GetDigitAtPos( dNumber, nDigitPos, dNumber, bFoundFirstDigit ) );
#endif
- if( nTempDigit!=_NO_DIGIT )
- bFirstDigit = sal_False;
-
- if( bGenerateThousandSeparator && ( c=='0' || nMaxDigit>=nDigitPos ) && nDigitPos>0 && (nDigitPos % 3 == 0) )
- StrAppendChar( sReturnStrg,cThousandSep );
- }
-
- nDigitPos--;
+ if( nTempDigit != _NO_DIGIT )
+ {
+ bFirstDigit = sal_False;
}
- else
+ if( bGenerateThousandSeparator && ( c=='0' || nMaxDigit>=nDigitPos ) && nDigitPos>0 && (nDigitPos % 3 == 0) )
{
- // handling the exponent
- if( bFirstExponentDigit )
+ sReturnStrg.append(cThousandSep);
+ }
+ }
+ nDigitPos--;
+ }
+ else
+ {
+ // handling the exponent
+ if( bFirstExponentDigit )
+ {
+ // leading sign has been given out at e/E already
+ bFirstExponentDigit = sal_False;
+ if( nMaxExponentDigit > nExponentPos )
+ // output redundant positions, i. e. those which
+ // are undocumented by the format-string
+ {
+ for( short j = nMaxExponentDigit; j > nExponentPos; j-- )
{
- // leading sign has been given out at e/E already
- bFirstExponentDigit = sal_False;
- if( nMaxExponentDigit>nExponentPos )
- // output redundant positions, i. e. those which
- // are undocumented by the format-string
- {
- for( short j=nMaxExponentDigit; j>nExponentPos; j-- )
- {
#ifdef _with_sprintf
- AppendDigit( sReturnStrg,GetDigitAtPosExpScan( dExponent,j,bFoundFirstDigit ) );
+ AppendDigit( sReturnStrg, GetDigitAtPosExpScan( dExponent, j, bFoundFirstDigit ) );
#else
- AppendDigit( sReturnStrg,GetDigitAtPos( dExponent,j,dExponent,bFoundFirstDigit ) );
+ AppendDigit( sReturnStrg,GetDigitAtPos( dExponent, j, dExponent, bFoundFirstDigit ) );
#endif
- }
- }
}
+ }
+ }
- if( nMaxExponentDigit<nExponentPos && c=='0' )
- AppendDigit( sReturnStrg,0 );
- else
+ if( nMaxExponentDigit < nExponentPos && c=='0' )
+ {
+ AppendDigit( sReturnStrg, 0 );
+ }
+ else
+ {
#ifdef _with_sprintf
- AppendDigit( sReturnStrg,GetDigitAtPosExpScan( dExponent,nExponentPos,bFoundFirstDigit ) );
+ AppendDigit( sReturnStrg, GetDigitAtPosExpScan( dExponent, nExponentPos, bFoundFirstDigit ) );
#else
- AppendDigit( sReturnStrg,GetDigitAtPos( dExponent,nExponentPos,dExponent,bFoundFirstDigit ) );
+ AppendDigit( sReturnStrg, GetDigitAtPos( dExponent, nExponentPos, dExponent, bFoundFirstDigit ) );
#endif
- nExponentPos--;
- }
- break;
- case '.':
- if( bDigitPosNegative ) // #i13821: If no digits before .
- {
- bDigitPosNegative = false;
- nDigitPos = 0;
- cForce = '#';
- i-=2;
- break;
- }
- StrAppendChar( sReturnStrg,cDecPoint );
- break;
- case '%':
- // maybe remove redundant 0s, e. g. 4.500e4 in 0.0##e-00
- ParseBack( sReturnStrg,sFormatStrg,i-1 );
- sReturnStrg.Insert('%');
- break;
- case 'e':
- case 'E':
- // does mantissa have to be rounded, before the exponent is displayed?
- {
- // is there a mantissa at all?
- if( bFirstDigit )
- {
- // apparently not, i. e. invalid format string, e. g. E000.00
- // so ignore these e and E characters
- // maybe output an error (like in Visual Basic)?
+ }
+ nExponentPos--;
+ }
+ break;
+ case '.':
+ if( bDigitPosNegative ) // #i13821: If no digits before .
+ {
+ bDigitPosNegative = false;
+ nDigitPos = 0;
+ cForce = '#';
+ i-=2;
+ break;
+ }
+ sReturnStrg.append(cDecPoint);
+ break;
+ case '%':
+ // maybe remove redundant 0s, e. g. 4.500e4 in 0.0##e-00
+ ParseBack( sReturnStrg, sFormatStrg, i-1 );
+ sReturnStrg.insert(0,'%');
+ break;
+ case 'e':
+ case 'E':
+ // does mantissa have to be rounded, before the exponent is displayed?
+ {
+ // is there a mantissa at all?
+ if( bFirstDigit )
+ {
+ // apparently not, i. e. invalid format string, e. g. E000.00
+ // so ignore these e and E characters
+ // maybe output an error (like in Visual Basic)?
- // #i13821: VB 6 behaviour
- StrAppendChar( sReturnStrg,c );
- break;
- }
+ // #i13821: VB 6 behaviour
+ sReturnStrg.append(c);
+ break;
+ }
- sal_Bool bOverflow = sal_False;
+ sal_Bool bOverflow = sal_False;
#ifdef _with_sprintf
- short nNextDigit = GetDigitAtPosScan( nDigitPos,bFoundFirstDigit );
+ short nNextDigit = GetDigitAtPosScan( nDigitPos, bFoundFirstDigit );
#else
- short nNextDigit = GetDigitAtPos( dNumber,nDigitPos,dNumber,bFoundFirstDigit );
+ short nNextDigit = GetDigitAtPos( dNumber, nDigitPos, dNumber, bFoundFirstDigit );
#endif
- if( nNextDigit>=5 )
- StrRoundDigit( sReturnStrg,sReturnStrg.Len()-1,bOverflow );
- if( bOverflow )
- {
- // a leading 9 has been rounded
- LeftShiftDecimalPoint( sReturnStrg );
- sReturnStrg.SetChar( sReturnStrg.Len()-1 , 0 );
- dExponent += 1.0;
- }
- // maybe remove redundant 0s, e. g. 4.500e4 in 0.0##e-00
- ParseBack( sReturnStrg,sFormatStrg,i-1 );
+ if( nNextDigit>=5 )
+ {
+ StrRoundDigit( sReturnStrg, sReturnStrg.getLength() - 1, bOverflow );
+ }
+ if( bOverflow )
+ {
+ // a leading 9 has been rounded
+ LeftShiftDecimalPoint( sReturnStrg );
+ sReturnStrg[sReturnStrg.getLength() - 1] = 0;
+ dExponent += 1.0;
+ }
+ // maybe remove redundant 0s, e. g. 4.500e4 in 0.0##e-00
+ ParseBack( sReturnStrg, sFormatStrg, i-1 );
+ }
+ // change the scanner's condition
+ nState++;
+ // output exponent character
+ sReturnStrg.append(c);
+ // i++; // MANIPULATION of the loop-variable!
+ c = sFormatStrg[ ++i ];
+ // output leading sign / exponent
+ if( c != 0 )
+ {
+ if( c == '-' )
+ {
+ if( dExponent < 0.0 )
+ {
+ sReturnStrg.append('-');
}
- // change the scanner's condition
- nState++;
- // output exponent character
- StrAppendChar( sReturnStrg,c );
- // i++; // MANIPULATION of the loop-variable!
- c = sFormatStrg.GetChar( ++i );
- // output leading sign / exponent
- if( c!=0 )
+ }
+ else if( c == '+' )
+ {
+ if( dExponent < 0.0 )
{
- if( c=='-' )
- {
- if( dExponent<0.0 )
- StrAppendChar( sReturnStrg,'-' );
- }
- else if( c=='+' )
- {
- if( dExponent<0.0 )
- StrAppendChar( sReturnStrg,'-' );
- else
- StrAppendChar( sReturnStrg,'+' );
- }
+ sReturnStrg.append('-');
}
- break;
- case ',':
- break;
- case ';':
- break;
- case '(':
- case ')':
- // maybe remove redundant 0s, e. g. 4.500e4 in 0.0##e-00
- ParseBack( sReturnStrg,sFormatStrg,i-1 );
- if( bIsNegative )
- StrAppendChar( sReturnStrg,c );
- break;
- case '$':
- // append the string for the currency:
- sReturnStrg += sCurrencyStrg;
- break;
- case ' ':
- case '-':
- case '+':
- ParseBack( sReturnStrg,sFormatStrg,i-1 );
- StrAppendChar( sReturnStrg,c );
- break;
- case '\\':
- ParseBack( sReturnStrg,sFormatStrg,i-1 );
- // special character found, output next
- // character directly (if existing)
- c = sFormatStrg.GetChar( ++i );
- if( c!=0 )
- StrAppendChar( sReturnStrg,c );
- break;
- case CREATE_1000SEP_CHAR:
- // ignore here, action has already been
- // executed in AnalyseFormatString
- break;
- default:
- // output characters and digits, too (like in Visual-Basic)
- if( ( c>='a' && c<='z' ) ||
- ( c>='A' && c<='Z' ) ||
- ( c>='1' && c<='9' ) )
- StrAppendChar( sReturnStrg,c );
+ else
+ {
+ sReturnStrg.append('+');
+ }
+ }
+ }
+ break;
+ case ',':
+ break;
+ case ';':
+ break;
+ case '(':
+ case ')':
+ // maybe remove redundant 0s, e. g. 4.500e4 in 0.0##e-00
+ ParseBack( sReturnStrg, sFormatStrg, i-1 );
+ if( bIsNegative )
+ {
+ sReturnStrg.append(c);
+ }
+ break;
+ case '$':
+ // append the string for the currency:
+ sReturnStrg.append(sCurrencyStrg);
+ break;
+ case ' ':
+ case '-':
+ case '+':
+ ParseBack( sReturnStrg, sFormatStrg, i-1 );
+ sReturnStrg.append(c);
+ break;
+ case '\\':
+ ParseBack( sReturnStrg, sFormatStrg, i-1 );
+ // special character found, output next
+ // character directly (if existing)
+ c = sFormatStrg[ ++i ];
+ if( c!=0 )
+ {
+ sReturnStrg.append(c);
+ }
+ break;
+ case CREATE_1000SEP_CHAR:
+ // ignore here, action has already been
+ // executed in AnalyseFormatString
+ break;
+ default:
+ // output characters and digits, too (like in Visual-Basic)
+ if( ( c>='a' && c<='z' ) ||
+ ( c>='A' && c<='Z' ) ||
+ ( c>='1' && c<='9' ) )
+ {
+ sReturnStrg.append(c);
}
}
+ }
- // scan completed - rounding necessary?
- if( !bScientific )
- {
+ // scan completed - rounding necessary?
+ if( !bScientific )
+ {
#ifdef _with_sprintf
- short nNextDigit = GetDigitAtPosScan( nDigitPos,bFoundFirstDigit );
+ short nNextDigit = GetDigitAtPosScan( nDigitPos, bFoundFirstDigit );
#else
- short nNextDigit = GetDigitAtPos( dNumber,nDigitPos,dNumber,bFoundFirstDigit );
+ short nNextDigit = GetDigitAtPos( dNumber, nDigitPos, dNumber, bFoundFirstDigit );
#endif
- if( nNextDigit>=5 )
- StrRoundDigit( sReturnStrg,sReturnStrg.Len()-1 );
+ if( nNextDigit>=5 )
+ {
+ StrRoundDigit( sReturnStrg, sReturnStrg.getLength() - 1 );
}
+ }
- if( nNoOfDigitsRight>0 )
- ParseBack( sReturnStrg,sFormatStrg,sFormatStrg.Len()-1 );
+ if( nNoOfDigitsRight>0 )
+ {
+ ParseBack( sReturnStrg, sFormatStrg, sFormatStrg.getLength()-1 );
+ }
+ sReturnStrgFinal = sReturnStrg.makeStringAndClear();
}
-String SbxBasicFormater::BasicFormatNull( String sFormatStrg )
+OUString SbxBasicFormater::BasicFormatNull( OUString sFormatStrg )
{
sal_Bool bNullFormatFound;
- String sNullFormatStrg = GetNullFormatString( sFormatStrg,bNullFormatFound );
+ OUString sNullFormatStrg = GetNullFormatString( sFormatStrg, bNullFormatFound );
if( bNullFormatFound )
+ {
return sNullFormatStrg;
- String aRetStr;
- aRetStr.AssignAscii( "null" );
+ }
+ OUString aRetStr;
+ aRetStr = rtl::OUString::createFromAscii( "null" );
return aRetStr;
}
-String SbxBasicFormater::BasicFormat( double dNumber, String sFormatStrg )
+OUString SbxBasicFormater::BasicFormat( double dNumber, OUString sFormatStrg )
{
sal_Bool bPosFormatFound,bNegFormatFound,b0FormatFound;
// analyse format-string concerning predefined formats:
- if( sFormatStrg.EqualsIgnoreCaseAscii( BASICFORMAT_GENERALNUMBER ) )
- sFormatStrg.AssignAscii( GENERALNUMBER_FORMAT );
- if( sFormatStrg.EqualsIgnoreCaseAscii( BASICFORMAT_CURRENCY ) )
+ if( sFormatStrg.equalsIgnoreAsciiCase( BASICFORMAT_GENERALNUMBER ) )
+ {
+ sFormatStrg = rtl::OUString::createFromAscii( GENERALNUMBER_FORMAT );
+ }
+ if( sFormatStrg.equalsIgnoreAsciiCase( BASICFORMAT_CURRENCY ) )
+ {
sFormatStrg = sCurrencyFormatStrg; // old: CURRENCY_FORMAT;
- if( sFormatStrg.EqualsIgnoreCaseAscii( BASICFORMAT_FIXED ) )
- sFormatStrg.AssignAscii( FIXED_FORMAT );
- if( sFormatStrg.EqualsIgnoreCaseAscii( BASICFORMAT_STANDARD ) )
- sFormatStrg.AssignAscii( STANDARD_FORMAT );
- if( sFormatStrg.EqualsIgnoreCaseAscii( BASICFORMAT_PERCENT ) )
- sFormatStrg.AssignAscii( PERCENT_FORMAT );
- if( sFormatStrg.EqualsIgnoreCaseAscii( BASICFORMAT_SCIENTIFIC ) )
- sFormatStrg.AssignAscii( SCIENTIFIC_FORMAT );
- if( sFormatStrg.EqualsIgnoreCaseAscii( BASICFORMAT_YESNO ) )
+ }
+ if( sFormatStrg.equalsIgnoreAsciiCase( BASICFORMAT_FIXED ) )
+ {
+ sFormatStrg = rtl::OUString::createFromAscii( FIXED_FORMAT );
+ }
+ if( sFormatStrg.equalsIgnoreAsciiCase( BASICFORMAT_STANDARD ) )
+ {
+ sFormatStrg = rtl::OUString::createFromAscii( STANDARD_FORMAT );
+ }
+ if( sFormatStrg.equalsIgnoreAsciiCase( BASICFORMAT_PERCENT ) )
+ {
+ sFormatStrg = rtl::OUString::createFromAscii( PERCENT_FORMAT );
+ }
+ if( sFormatStrg.equalsIgnoreAsciiCase( BASICFORMAT_SCIENTIFIC ) )
+ {
+ sFormatStrg = rtl::OUString::createFromAscii( SCIENTIFIC_FORMAT );
+ }
+ if( sFormatStrg.equalsIgnoreAsciiCase( BASICFORMAT_YESNO ) )
+ {
return ( dNumber==0.0 ) ? sNoStrg : sYesStrg ;
- if( sFormatStrg.EqualsIgnoreCaseAscii( BASICFORMAT_TRUEFALSE ) )
+ }
+ if( sFormatStrg.equalsIgnoreAsciiCase( BASICFORMAT_TRUEFALSE ) )
+ {
return ( dNumber==0.0 ) ? sFalseStrg : sTrueStrg ;
- if( sFormatStrg.EqualsIgnoreCaseAscii( BASICFORMAT_ONOFF ) )
+ }
+ if( sFormatStrg.equalsIgnoreAsciiCase( BASICFORMAT_ONOFF ) )
+ {
return ( dNumber==0.0 ) ? sOffStrg : sOnStrg ;
+ }
// analyse format-string concerning ';', i. e. format-strings for
// positive-, negative- and 0-values
- String sPosFormatStrg = GetPosFormatString( sFormatStrg, bPosFormatFound );
- String sNegFormatStrg = GetNegFormatString( sFormatStrg, bNegFormatFound );
- String s0FormatStrg = Get0FormatString( sFormatStrg, b0FormatFound );
+ OUString sPosFormatStrg = GetPosFormatString( sFormatStrg, bPosFormatFound );
+ OUString sNegFormatStrg = GetNegFormatString( sFormatStrg, bNegFormatFound );
+ OUString s0FormatStrg = Get0FormatString( sFormatStrg, b0FormatFound );
- String sReturnStrg;
- String sTempStrg;
+ OUString sReturnStrg;
+ OUString sTempStrg;
if( dNumber==0.0 )
{
sTempStrg = sFormatStrg;
if( b0FormatFound )
{
- if( s0FormatStrg.Len() == 0 && bPosFormatFound )
+ if( s0FormatStrg.isEmpty() && bPosFormatFound )
{
sTempStrg = sPosFormatStrg;
}
@@ -965,9 +1046,9 @@ String SbxBasicFormater::BasicFormat( double dNumber, String sFormatStrg )
{
if( bNegFormatFound )
{
- if( sNegFormatStrg.Len() == 0 && bPosFormatFound )
+ if( sNegFormatStrg.isEmpty() && bPosFormatFound )
{
- sTempStrg = rtl::OUString("-");
+ sTempStrg = "-";
sTempStrg += sPosFormatStrg;
}
else
@@ -993,26 +1074,44 @@ String SbxBasicFormater::BasicFormat( double dNumber, String sFormatStrg )
return sReturnStrg;
}
-sal_Bool SbxBasicFormater::isBasicFormat( String sFormatStrg )
+sal_Bool SbxBasicFormater::isBasicFormat( OUString sFormatStrg )
{
- if( sFormatStrg.EqualsIgnoreCaseAscii( BASICFORMAT_GENERALNUMBER ) )
+ if( sFormatStrg.equalsIgnoreAsciiCase( BASICFORMAT_GENERALNUMBER ) )
+ {
return sal_True;
- if( sFormatStrg.EqualsIgnoreCaseAscii( BASICFORMAT_CURRENCY ) )
+ }
+ if( sFormatStrg.equalsIgnoreAsciiCase( BASICFORMAT_CURRENCY ) )
+ {
return sal_True;
- if( sFormatStrg.EqualsIgnoreCaseAscii( BASICFORMAT_FIXED ) )
+ }
+ if( sFormatStrg.equalsIgnoreAsciiCase( BASICFORMAT_FIXED ) )
+ {
return sal_True;
- if( sFormatStrg.EqualsIgnoreCaseAscii( BASICFORMAT_STANDARD ) )
+ }
+ if( sFormatStrg.equalsIgnoreAsciiCase( BASICFORMAT_STANDARD ) )
+ {
return sal_True;
- if( sFormatStrg.EqualsIgnoreCaseAscii( BASICFORMAT_PERCENT ) )
+ }
+ if( sFormatStrg.equalsIgnoreAsciiCase( BASICFORMAT_PERCENT ) )
+ {
return sal_True;
- if( sFormatStrg.EqualsIgnoreCaseAscii( BASICFORMAT_SCIENTIFIC ) )
+ }
+ if( sFormatStrg.equalsIgnoreAsciiCase( BASICFORMAT_SCIENTIFIC ) )
+ {
return sal_True;
- if( sFormatStrg.EqualsIgnoreCaseAscii( BASICFORMAT_YESNO ) )
+ }
+ if( sFormatStrg.equalsIgnoreAsciiCase( BASICFORMAT_YESNO ) )
+ {
return sal_True;
- if( sFormatStrg.EqualsIgnoreCaseAscii( BASICFORMAT_TRUEFALSE ) )
+ }
+ if( sFormatStrg.equalsIgnoreAsciiCase( BASICFORMAT_TRUEFALSE ) )
+ {
return sal_True;
- if( sFormatStrg.EqualsIgnoreCaseAscii( BASICFORMAT_ONOFF ) )
+ }
+ if( sFormatStrg.equalsIgnoreAsciiCase( BASICFORMAT_ONOFF ) )
+ {
return sal_True;
+ }
return sal_False;
}
diff --git a/basic/source/sbx/sbxobj.cxx b/basic/source/sbx/sbxobj.cxx
index 4c7c966f5bb0..e72a2821c5f0 100644
--- a/basic/source/sbx/sbxobj.cxx
+++ b/basic/source/sbx/sbxobj.cxx
@@ -26,23 +26,23 @@ TYPEINIT1(SbxMethod,SbxVariable)
TYPEINIT1(SbxProperty,SbxVariable)
TYPEINIT2(SbxObject,SbxVariable,SfxListener)
-static const char* pNameProp; // Name-Property
-static const char* pParentProp; // Parent-Property
+static OUString pNameProp; // Name-Property
+static OUString pParentProp; // Parent-Property
static sal_uInt16 nNameHash = 0, nParentHash = 0;
-SbxObject::SbxObject( const XubString& rClass )
+SbxObject::SbxObject( const OUString& rClass )
: SbxVariable( SbxOBJECT ), aClassName( rClass )
{
aData.pObj = this;
if( !nNameHash )
{
- pNameProp = GetSbxRes( STRING_NAMEPROP );
- pParentProp = GetSbxRes( STRING_PARENTPROP );
- nNameHash = MakeHashCode( rtl::OUString::createFromAscii( pNameProp ) );
- nParentHash = MakeHashCode( rtl::OUString::createFromAscii( pParentProp ) );
+ pNameProp = ::rtl::OUString::createFromAscii(GetSbxRes( STRING_NAMEPROP ));
+ pParentProp = ::rtl::OUString::createFromAscii(GetSbxRes( STRING_PARENTPROP ));
+ nNameHash = MakeHashCode( pNameProp );
+ nParentHash = MakeHashCode( pParentProp );
}
SbxObject::Clear();
SbxObject::SetName( rClass );
@@ -83,7 +83,9 @@ static void CheckParentsOnDelete( SbxObject* pObj, SbxArray* p )
{
SbxVariableRef& rRef = p->GetRef( i );
if( rRef->IsBroadcaster() )
+ {
pObj->EndListening( rRef->GetBroadcaster(), sal_True );
+ }
// Did the element have more then one reference and still a Listener?
if( rRef->GetRefCount() > 1 )
{
@@ -119,9 +121,9 @@ void SbxObject::Clear()
pProps = new SbxArray;
pObjs = new SbxArray( SbxOBJECT );
SbxVariable* p;
- p = Make( rtl::OUString::createFromAscii( pNameProp ), SbxCLASS_PROPERTY, SbxSTRING );
+ p = Make( pNameProp, SbxCLASS_PROPERTY, SbxSTRING );
p->SetFlag( SBX_DONTSTORE );
- p = Make( rtl::OUString::createFromAscii( pParentProp ), SbxCLASS_PROPERTY, SbxOBJECT );
+ p = Make( pParentProp, SbxCLASS_PROPERTY, SbxOBJECT );
p->ResetFlag( SBX_WRITE );
p->SetFlag( SBX_DONTSTORE );
pDfltProp = NULL;
@@ -140,20 +142,20 @@ void SbxObject::SFX_NOTIFY( SfxBroadcaster&, const TypeId&,
SbxVariable* pVar = p->GetVar();
if( bRead || bWrite )
{
- XubString aVarName( pVar->GetName() );
+ OUString aVarName( pVar->GetName() );
sal_uInt16 nHash_ = MakeHashCode( aVarName );
- if( nHash_ == nNameHash
- && aVarName.EqualsIgnoreCaseAscii( pNameProp ) )
+ if( nHash_ == nNameHash && aVarName.equalsIgnoreAsciiCase( pNameProp ) )
{
if( bRead )
{
pVar->PutString( GetName() );
}
else
- SetName( pVar->GetString() );
+ {
+ SetName( pVar->GetOUString() );
+ }
}
- else if( nHash_ == nParentHash
- && aVarName.EqualsIgnoreCaseAscii( pParentProp ) )
+ else if( nHash_ == nParentHash && aVarName.equalsIgnoreAsciiCase( pParentProp ) )
{
SbxObject* p_ = GetParent();
if( !p_ )
@@ -166,9 +168,9 @@ void SbxObject::SFX_NOTIFY( SfxBroadcaster&, const TypeId&,
}
}
-sal_Bool SbxObject::IsClass( const rtl::OUString& rName ) const
+sal_Bool SbxObject::IsClass( const OUString& rName ) const
{
- return sal_Bool( aClassName.EqualsIgnoreCaseAscii( rName ) );
+ return sal_Bool( aClassName.equalsIgnoreAsciiCase( rName ) );
}
SbxVariable* SbxObject::FindUserData( sal_uInt32 nData )
@@ -294,7 +296,7 @@ SbxVariable* SbxObject::Find( const OUString& rName, SbxClassType t )
// The whole thing recursive, because Call() might be overloaded
// Qualified names are allowed
-sal_Bool SbxObject::Call( const XubString& rName, SbxArray* pParam )
+sal_Bool SbxObject::Call( const OUString& rName, SbxArray* pParam )
{
SbxVariable* pMeth = FindQualified( rName, SbxCLASS_DONTCARE);
if( pMeth && pMeth->ISA(SbxMethod) )
@@ -314,7 +316,7 @@ sal_Bool SbxObject::Call( const XubString& rName, SbxArray* pParam )
SbxProperty* SbxObject::GetDfltProperty()
{
- if ( !pDfltProp && aDfltPropName.Len() )
+ if ( !pDfltProp && !aDfltPropName.isEmpty() )
{
pDfltProp = (SbxProperty*) Find( aDfltPropName, SbxCLASS_PROPERTY );
if( !pDfltProp )
@@ -324,7 +326,7 @@ SbxProperty* SbxObject::GetDfltProperty()
}
return pDfltProp;
}
-void SbxObject::SetDfltProperty( const XubString& rName )
+void SbxObject::SetDfltProperty( const OUString& rName )
{
if ( rName != aDfltPropName )
{
@@ -373,7 +375,7 @@ SbxArray* SbxObject::FindVar( SbxVariable* pVar, sal_uInt16& nArrayIdx )
// If a new object will be established, this object will be indexed,
// if an object of this name exists already.
-SbxVariable* SbxObject::Make( const XubString& rName, SbxClassType ct, SbxDataType dt )
+SbxVariable* SbxObject::Make( const OUString& rName, SbxClassType ct, SbxDataType dt )
{
// Is the object already available?
SbxArray* pArray = NULL;
@@ -386,7 +388,9 @@ SbxVariable* SbxObject::Make( const XubString& rName, SbxClassType ct, SbxDataTy
default: DBG_ASSERT( !this, "Ungueltige SBX-Klasse" ); break;
}
if( !pArray )
+ {
return NULL;
+ }
// Collections may contain objects of the same name
if( !( ct == SbxCLASS_OBJECT && ISA(SbxCollection) ) )
{
@@ -421,7 +425,7 @@ SbxVariable* SbxObject::Make( const XubString& rName, SbxClassType ct, SbxDataTy
return pVar;
}
-SbxObject* SbxObject::MakeObject( const XubString& rName, const XubString& rClass )
+SbxObject* SbxObject::MakeObject( const OUString& rName, const OUString& rClass )
{
// Is the object already available?
if( !ISA(SbxCollection) )
@@ -458,40 +462,49 @@ void SbxObject::Insert( SbxVariable* pVar )
// Then this element exists already
// There are objects of the same name allowed at collections
if( pArray == pObjs && ISA(SbxCollection) )
+ {
nIdx = pArray->Count();
+ }
else
{
SbxVariable* pOld = pArray->Get( nIdx );
// already inside: overwrite
if( pOld == pVar )
+ {
return;
-
+ }
EndListening( pOld->GetBroadcaster(), sal_True );
if( pVar->GetClass() == SbxCLASS_PROPERTY )
{
if( pOld == pDfltProp )
+ {
pDfltProp = (SbxProperty*) pVar;
+ }
}
}
}
StartListening( pVar->GetBroadcaster(), sal_True );
pArray->Put( pVar, nIdx );
if( pVar->GetParent() != this )
+ {
pVar->SetParent( this );
+ }
SetModified( sal_True );
Broadcast( SBX_HINT_OBJECTCHANGED );
#ifdef DBG_UTIL
- static const char* pCls[] =
- { "DontCare","Array","Value","Variable","Method","Property","Object" };
- XubString aVarName( pVar->GetName() );
- if ( !aVarName.Len() && pVar->ISA(SbxObject) )
- aVarName = PTR_CAST(SbxObject,pVar)->GetClassName();
- rtl::OString aNameStr1(rtl::OUStringToOString(aVarName, RTL_TEXTENCODING_ASCII_US));
- rtl::OString aNameStr2(rtl::OUStringToOString(SbxVariable::GetName(), RTL_TEXTENCODING_ASCII_US));
- DbgOutf( "SBX: Insert %s %s in %s",
- ( pVar->GetClass() >= SbxCLASS_DONTCARE &&
- pVar->GetClass() <= SbxCLASS_OBJECT )
- ? pCls[ pVar->GetClass()-1 ] : "Unknown class", aNameStr1.getStr(), aNameStr1.getStr() );
+ static const char* pCls[] =
+ { "DontCare","Array","Value","Variable","Method","Property","Object" };
+ OUString aVarName( pVar->GetName() );
+ if ( aVarName.isEmpty() && pVar->ISA(SbxObject) )
+ {
+ aVarName = PTR_CAST(SbxObject,pVar)->GetClassName();
+ }
+ rtl::OString aNameStr1(rtl::OUStringToOString(aVarName, RTL_TEXTENCODING_ASCII_US));
+ rtl::OString aNameStr2(rtl::OUStringToOString(SbxVariable::GetName(), RTL_TEXTENCODING_ASCII_US));
+ DbgOutf( "SBX: Insert %s %s in %s",
+ ( pVar->GetClass() >= SbxCLASS_DONTCARE &&
+ pVar->GetClass() <= SbxCLASS_OBJECT )
+ ? pCls[ pVar->GetClass()-1 ] : "Unknown class", aNameStr1.getStr(), aNameStr1.getStr() );
#endif
}
}
@@ -517,25 +530,29 @@ void SbxObject::QuickInsert( SbxVariable* pVar )
StartListening( pVar->GetBroadcaster(), sal_True );
pArray->Put( pVar, pArray->Count() );
if( pVar->GetParent() != this )
+ {
pVar->SetParent( this );
+ }
SetModified( sal_True );
#ifdef DBG_UTIL
- static const char* pCls[] =
- { "DontCare","Array","Value","Variable","Method","Property","Object" };
- XubString aVarName( pVar->GetName() );
- if ( !aVarName.Len() && pVar->ISA(SbxObject) )
- aVarName = PTR_CAST(SbxObject,pVar)->GetClassName();
- rtl::OString aNameStr1(rtl::OUStringToOString(aVarName, RTL_TEXTENCODING_ASCII_US));
- rtl::OString aNameStr2(rtl::OUStringToOString(SbxVariable::GetName(), RTL_TEXTENCODING_ASCII_US));
- DbgOutf( "SBX: Insert %s %s in %s",
- ( pVar->GetClass() >= SbxCLASS_DONTCARE &&
- pVar->GetClass() <= SbxCLASS_OBJECT )
- ? pCls[ pVar->GetClass()-1 ] : "Unknown class", aNameStr1.getStr(), aNameStr1.getStr() );
+ static const char* pCls[] =
+ { "DontCare","Array","Value","Variable","Method","Property","Object" };
+ OUString aVarName( pVar->GetName() );
+ if ( aVarName.isEmpty() && pVar->ISA(SbxObject) )
+ {
+ aVarName = PTR_CAST(SbxObject,pVar)->GetClassName();
+ }
+ rtl::OString aNameStr1(rtl::OUStringToOString(aVarName, RTL_TEXTENCODING_ASCII_US));
+ rtl::OString aNameStr2(rtl::OUStringToOString(SbxVariable::GetName(), RTL_TEXTENCODING_ASCII_US));
+ DbgOutf( "SBX: Insert %s %s in %s",
+ ( pVar->GetClass() >= SbxCLASS_DONTCARE &&
+ pVar->GetClass() <= SbxCLASS_OBJECT )
+ ? pCls[ pVar->GetClass()-1 ] : "Unknown class", aNameStr1.getStr(), aNameStr1.getStr() );
#endif
}
}
-void SbxObject::Remove( const XubString& rName, SbxClassType t )
+void SbxObject::Remove( const OUString& rName, SbxClassType t )
{
Remove( SbxObject::Find( rName, t ) );
}
@@ -547,11 +564,13 @@ void SbxObject::Remove( SbxVariable* pVar )
if( pArray && nIdx < pArray->Count() )
{
#ifdef DBG_UTIL
- XubString aVarName( pVar->GetName() );
- if ( !aVarName.Len() && pVar->ISA(SbxObject) )
- aVarName = PTR_CAST(SbxObject,pVar)->GetClassName();
- rtl::OString aNameStr1(rtl::OUStringToOString(aVarName, RTL_TEXTENCODING_ASCII_US));
- rtl::OString aNameStr2(rtl::OUStringToOString(SbxVariable::GetName(), RTL_TEXTENCODING_ASCII_US));
+ OUString aVarName( pVar->GetName() );
+ if ( aVarName.isEmpty() && pVar->ISA(SbxObject) )
+ {
+ aVarName = PTR_CAST(SbxObject,pVar)->GetClassName();
+ }
+ rtl::OString aNameStr1(rtl::OUStringToOString(aVarName, RTL_TEXTENCODING_ASCII_US));
+ rtl::OString aNameStr2(rtl::OUStringToOString(SbxVariable::GetName(), RTL_TEXTENCODING_ASCII_US));
#endif
SbxVariableRef pVar_ = pArray->Get( nIdx );
if( pVar_->IsBroadcaster() )
@@ -614,15 +633,15 @@ sal_Bool SbxObject::LoadData( SvStream& rStrm, sal_uInt16 nVer )
aData.pObj = this;
}
sal_uInt32 nSize;
- XubString aDfltProp;
- aClassName = read_lenPrefixed_uInt8s_ToOUString<sal_uInt16>(rStrm,
- RTL_TEXTENCODING_ASCII_US);
- aDfltProp = read_lenPrefixed_uInt8s_ToOUString<sal_uInt16>(rStrm,
- RTL_TEXTENCODING_ASCII_US);
+ OUString aDfltProp;
+ aClassName = read_lenPrefixed_uInt8s_ToOUString<sal_uInt16>(rStrm, RTL_TEXTENCODING_ASCII_US);
+ aDfltProp = read_lenPrefixed_uInt8s_ToOUString<sal_uInt16>(rStrm, RTL_TEXTENCODING_ASCII_US);
sal_uIntPtr nPos = rStrm.Tell();
rStrm >> nSize;
if( !LoadPrivateData( rStrm, nVer ) )
+ {
return sal_False;
+ }
sal_uIntPtr nNewPos = rStrm.Tell();
nPos += nSize;
DBG_ASSERT( nPos >= nNewPos, "SBX: Zu viele Daten eingelesen" );
@@ -637,7 +656,7 @@ sal_Bool SbxObject::LoadData( SvStream& rStrm, sal_uInt16 nVer )
return sal_False;
}
// Set properties
- if( aDfltProp.Len() )
+ if( !aDfltProp.isEmpty() )
{
pDfltProp = (SbxProperty*) pProps->Find( aDfltProp, SbxCLASS_PROPERTY );
}
@@ -648,8 +667,10 @@ sal_Bool SbxObject::LoadData( SvStream& rStrm, sal_uInt16 nVer )
sal_Bool SbxObject::StoreData( SvStream& rStrm ) const
{
if( !SbxVariable::StoreData( rStrm ) )
+ {
return sal_False;
- XubString aDfltProp;
+ }
+ OUString aDfltProp;
if( pDfltProp )
{
aDfltProp = pDfltProp->GetName();
@@ -682,94 +703,101 @@ sal_Bool SbxObject::StoreData( SvStream& rStrm ) const
return sal_True;
}
-XubString SbxObject::GenerateSource( const XubString &rLinePrefix,
- const SbxObject* )
+OUString SbxObject::GenerateSource( const OUString &rLinePrefix,
+ const SbxObject* )
{
// Collect the properties in a String
- XubString aSource;
+ OUString aSource;
SbxArrayRef xProps( GetProperties() );
bool bLineFeed = false;
for ( sal_uInt16 nProp = 0; nProp < xProps->Count(); ++nProp )
{
SbxPropertyRef xProp = (SbxProperty*) xProps->Get(nProp);
- XubString aPropName( xProp->GetName() );
- if ( xProp->CanWrite()
- && !( xProp->GetHashCode() == nNameHash
- && aPropName.EqualsIgnoreCaseAscii( pNameProp ) ) )
+ OUString aPropName( xProp->GetName() );
+ if ( xProp->CanWrite() &&
+ !( xProp->GetHashCode() == nNameHash &&
+ aPropName.equalsIgnoreAsciiCase(pNameProp)))
{
// Insert a break except in front of the first property
if ( bLineFeed )
- aSource.AppendAscii( "\n" );
+ {
+ aSource += "\n";
+ }
else
+ {
bLineFeed = true;
-
+ }
aSource += rLinePrefix;
- aSource += '.';
+ aSource += ".";
aSource += aPropName;
- aSource.AppendAscii( " = " );
+ aSource += " = ";
// Display the property value textual
switch ( xProp->GetType() )
{
- case SbxEMPTY:
- case SbxNULL:
- // no value
- break;
-
- case SbxSTRING:
- {
- // Strings in quotation mark
- aSource.AppendAscii( "\"" );
- aSource += xProp->GetString();
- aSource.AppendAscii( "\"" );
- break;
- }
-
- default:
- {
- // miscellaneous, such as e.g.numerary directly
- aSource += xProp->GetString();
- break;
- }
+ case SbxEMPTY:
+ case SbxNULL:
+ // no value
+ break;
+
+ case SbxSTRING:
+ // Strings in quotation mark
+ aSource += "\"";
+ aSource += xProp->GetOUString();
+ aSource += "\"";
+ break;
+
+ default:
+ // miscellaneous, such as e.g.numerary directly
+ aSource += xProp->GetOUString();
+ break;
}
}
}
return aSource;
}
-static sal_Bool CollectAttrs( const SbxBase* p, XubString& rRes )
+static sal_Bool CollectAttrs( const SbxBase* p, OUString& rRes )
{
- XubString aAttrs;
+ OUString aAttrs;
if( p->IsHidden() )
- aAttrs.AssignAscii( "Hidden" );
+ {
+ aAttrs = "Hidden";
+ }
if( p->IsSet( SBX_EXTSEARCH ) )
{
- if( aAttrs.Len() )
- aAttrs += ',';
- aAttrs.AppendAscii( "ExtSearch" );
+ if( !aAttrs.isEmpty() )
+ {
+ aAttrs += ",";
+ }
+ aAttrs += "ExtSearch";
}
if( !p->IsVisible() )
{
- if( aAttrs.Len() )
- aAttrs += ',';
- aAttrs.AppendAscii( "Invisible" );
+ if( !aAttrs.isEmpty() )
+ {
+ aAttrs += ",";
+ }
+ aAttrs += "Invisible";
}
if( p->IsSet( SBX_DONTSTORE ) )
{
- if( aAttrs.Len() )
- aAttrs += ',';
- aAttrs.AppendAscii( "DontStore" );
+ if( !aAttrs.isEmpty() )
+ {
+ aAttrs += ",";
+ }
+ aAttrs += "DontStore";
}
- if( aAttrs.Len() )
+ if( !aAttrs.isEmpty() )
{
- rRes.AssignAscii( " (" );
+ rRes = " (";
rRes += aAttrs;
- rRes += ')';
+ rRes += ")";
return sal_True;
}
else
{
- rRes.Erase();
+ rRes = "";
return sal_False;
}
}
@@ -784,10 +812,11 @@ void SbxObject::Dump( SvStream& rStrm, sal_Bool bFill )
return;
}
++nLevel;
- String aIndent;
+ OUString aIndent("");
for ( sal_uInt16 n = 1; n < nLevel; ++n )
- aIndent.AppendAscii( " " );
-
+ {
+ aIndent += " ";
+ }
// if necessary complete the object
if ( bFill )
{
@@ -819,7 +848,7 @@ void SbxObject::Dump( SvStream& rStrm, sal_Bool bFill )
rStrm << aIndentNameStr.getStr() << "{" << endl;
// Flags
- XubString aAttrs;
+ OUString aAttrs;
if( CollectAttrs( this, aAttrs ) )
{
rtl::OString aAttrStr(rtl::OUStringToOString(aAttrs, RTL_TEXTENCODING_ASCII_US));
@@ -834,14 +863,18 @@ void SbxObject::Dump( SvStream& rStrm, sal_Bool bFill )
SbxVariable* pVar = r;
if( pVar )
{
- XubString aLine( aIndent );
- aLine.AppendAscii( " - " );
+ OUString aLine( aIndent );
+ aLine += " - ";
aLine += pVar->GetName( SbxNAME_SHORT_TYPES );
- XubString aAttrs2;
+ OUString aAttrs2;
if( CollectAttrs( pVar, aAttrs2 ) )
+ {
aLine += aAttrs2;
+ }
if( !pVar->IsA( TYPE(SbxMethod) ) )
- aLine.AppendAscii( " !! Not a Method !!" );
+ {
+ aLine += " !! Not a Method !!";
+ }
write_lenPrefixed_uInt8s_FromOUString<sal_uInt16>(rStrm, aLine, RTL_TEXTENCODING_ASCII_US);
// Output also the object at object-methods
@@ -869,16 +902,18 @@ void SbxObject::Dump( SvStream& rStrm, sal_Bool bFill )
SbxVariable* pVar = r;
if( pVar )
{
- XubString aLine( aIndent );
- aLine.AppendAscii( " - " );
+ OUString aLine( aIndent );
+ aLine += " - ";
aLine += pVar->GetName( SbxNAME_SHORT_TYPES );
- XubString aAttrs3;
+ OUString aAttrs3;
if( CollectAttrs( pVar, aAttrs3 ) )
{
aLine += aAttrs3;
}
if( !pVar->IsA( TYPE(SbxProperty) ) )
- aLine.AppendAscii( " !! Not a Property !!" );
+ {
+ aLine += " !! Not a Property !!";
+ }
write_lenPrefixed_uInt8s_FromOUString<sal_uInt16>(rStrm, aLine, RTL_TEXTENCODING_ASCII_US);
// output also the object at object properties
@@ -924,7 +959,7 @@ void SbxObject::Dump( SvStream& rStrm, sal_Bool bFill )
--nLevel;
}
-SbxMethod::SbxMethod( const String& r, SbxDataType t )
+SbxMethod::SbxMethod( const OUString& r, SbxDataType t )
: SbxVariable( t )
{
SetName( r );
@@ -944,7 +979,7 @@ SbxClassType SbxMethod::GetClass() const
return SbxCLASS_METHOD;
}
-SbxProperty::SbxProperty( const String& r, SbxDataType t )
+SbxProperty::SbxProperty( const OUString& r, SbxDataType t )
: SbxVariable( t )
{
SetName( r );
diff --git a/basic/source/sbx/sbxscan.cxx b/basic/source/sbx/sbxscan.cxx
index 58c9be87a8f6..3257354bfc74 100644
--- a/basic/source/sbx/sbxscan.cxx
+++ b/basic/source/sbx/sbxscan.cxx
@@ -229,16 +229,17 @@ SbxError ImpScan( const ::rtl::OUString& rWSrc, double& nVal, SbxDataType& rType
}
// port for CDbl in the Basic
-SbxError SbxValue::ScanNumIntnl( const String& rSrc, double& nVal, bool bSingle )
+SbxError SbxValue::ScanNumIntnl( const OUString& rSrc, double& nVal, bool bSingle )
{
SbxDataType t;
sal_uInt16 nLen = 0;
SbxError nRetError = ImpScan( rSrc, nVal, t, &nLen,
/*bAllowIntntl*/false, /*bOnlyIntntl*/true );
// read completely?
- if( nRetError == SbxERR_OK && nLen != rSrc.Len() )
+ if( nRetError == SbxERR_OK && nLen != rSrc.getLength() )
+ {
nRetError = SbxERR_CONVERSION;
-
+ }
if( bSingle )
{
SbxValues aValues( nVal );
@@ -469,7 +470,7 @@ bool ImpConvStringExt( ::rtl::OUString& rSrc, SbxDataType eTargetType )
#ifdef _old_format_code_
// leave the code provisionally to copy the previous implementation
-static sal_uInt16 printfmtnum( double nNum, XubString& rRes, const XubString& rWFmt )
+static sal_uInt16 printfmtnum( double nNum, OUString& rRes, const OUString& rWFmt )
{
const String& rFmt = rWFmt;
char cFill = ' '; // filling characters
@@ -557,36 +558,41 @@ static sal_uInt16 printfmtnum( double nNum, XubString& rRes, const XubString& rW
#endif //_old_format_code_
-static sal_uInt16 printfmtstr( const XubString& rStr, XubString& rRes, const XubString& rFmt )
+static sal_uInt16 printfmtstr( const OUString& rStr, OUString& rRes, const OUString& rFmt )
{
- const sal_Unicode* pStr = rStr.GetBuffer();
- const sal_Unicode* pFmtStart = rFmt.GetBuffer();
+ OUStringBuffer aTemp;
+ const sal_Unicode* pStr = rStr.getStr();
+ const sal_Unicode* pFmtStart = rFmt.getStr();
const sal_Unicode* pFmt = pFmtStart;
- rRes.Erase();
+
switch( *pFmt )
{
- case '!':
- rRes += *pStr++; pFmt++; break;
- case '\\':
- do
- {
- rRes += *pStr ? *pStr++ : static_cast< sal_Unicode >(' ');
- pFmt++;
- } while( *pFmt != '\\' );
- rRes += *pStr ? *pStr++ : static_cast< sal_Unicode >(' ');
- pFmt++; break;
- case '&':
- rRes = rStr;
- pFmt++; break;
- default:
- rRes = rStr;
- break;
+ case '!':
+ aTemp.append(*pStr++);
+ pFmt++;
+ break;
+ case '\\':
+ do
+ {
+ aTemp.append( *pStr ? *pStr++ : static_cast< sal_Unicode >(' '));
+ pFmt++;
+ }
+ while( *pFmt != '\\' );
+ aTemp.append(*pStr ? *pStr++ : static_cast< sal_Unicode >(' '));
+ pFmt++; break;
+ case '&':
+ aTemp = rStr;
+ pFmt++; break;
+ default:
+ aTemp = rStr;
+ break;
}
+ rRes = aTemp.makeStringAndClear();
return (sal_uInt16) ( pFmt - pFmtStart );
}
-sal_Bool SbxValue::Scan( const XubString& rSrc, sal_uInt16* pLen )
+sal_Bool SbxValue::Scan( const OUString& rSrc, sal_uInt16* pLen )
{
SbxError eRes = SbxERR_OK;
if( !CanWrite() )
@@ -696,7 +702,7 @@ VbaFormatInfo* getFormatInfo( const String& rFmt )
#define VBAFORMAT_LOWERCASE "<"
#define VBAFORMAT_UPPERCASE ">"
-void SbxValue::Format( XubString& rRes, const XubString* pFmt ) const
+void SbxValue::Format( OUString& rRes, const OUString* pFmt ) const
{
short nComma = 0;
double d = 0;
@@ -706,16 +712,16 @@ void SbxValue::Format( XubString& rRes, const XubString* pFmt ) const
// VBA output besides the OOo-basic output
if( pFmt && !SbxBasicFormater::isBasicFormat( *pFmt ) )
{
- String aStr = GetString();
+ OUString aStr = GetOUString();
- if( pFmt->EqualsIgnoreCaseAscii( VBAFORMAT_LOWERCASE ) )
+ if( pFmt->equalsIgnoreAsciiCase( VBAFORMAT_LOWERCASE ) )
{
- rRes = aStr.ToLowerAscii();
+ rRes = aStr.toAsciiLowerCase();
return;
}
- if( pFmt->EqualsIgnoreCaseAscii( VBAFORMAT_UPPERCASE ) )
+ if( pFmt->equalsIgnoreAsciiCase( VBAFORMAT_UPPERCASE ) )
{
- rRes = aStr.ToUpperAscii();
+ rRes = aStr.toAsciiUpperCase();
return;
}
@@ -733,74 +739,74 @@ void SbxValue::Format( XubString& rRes, const XubString* pFmt ) const
// number format, use SvNumberFormatter to handle it.
if( bSuccess )
{
- xub_StrLen nCheckPos = 0;
+ sal_uInt16 nCheckPos = 0;
short nType;
- String aFmtStr = *pFmt;
+ OUString aFmtStr = *pFmt;
VbaFormatInfo* pInfo = getFormatInfo( aFmtStr );
if( pInfo && pInfo->meType != VBA_FORMAT_TYPE_NULL )
- {
+ {
if( pInfo->meType == VBA_FORMAT_TYPE_OFFSET )
{
nIndex = aFormatter.GetFormatIndex( pInfo->meOffset, eLangType );
}
else
- {
- aFmtStr.AssignAscii( pInfo->mpOOoFormat );
+ {
+ aFmtStr = rtl::OUString::createFromAscii(pInfo->mpOOoFormat);
aFormatter.PutandConvertEntry( aFmtStr, nCheckPos, nType, nIndex, LANGUAGE_ENGLISH, eLangType );
}
aFormatter.GetOutputString( nNumber, nIndex, rRes, &pCol );
}
- else if( aFmtStr.EqualsIgnoreCaseAscii( VBAFORMAT_GENERALDATE )
- || aFmtStr.EqualsIgnoreCaseAscii( VBAFORMAT_C ))
+ else if( aFmtStr.equalsIgnoreAsciiCase( VBAFORMAT_GENERALDATE )
+ || aFmtStr.equalsIgnoreAsciiCase( VBAFORMAT_C ))
{
if( nNumber <=-1.0 || nNumber >= 1.0 )
{
// short date
nIndex = aFormatter.GetFormatIndex( NF_DATE_SYSTEM_SHORT, eLangType );
- aFormatter.GetOutputString( nNumber, nIndex, rRes, &pCol );
+ aFormatter.GetOutputString( nNumber, nIndex, rRes, &pCol );
// long time
if( floor( nNumber ) != nNumber )
{
- aFmtStr.AssignAscii( "H:MM:SS AM/PM" );
+ aFmtStr = "H:MM:SS AM/PM";
aFormatter.PutandConvertEntry( aFmtStr, nCheckPos, nType, nIndex, LANGUAGE_ENGLISH, eLangType );
- String aTime;
+ OUString aTime;
aFormatter.GetOutputString( nNumber, nIndex, aTime, &pCol );
- rRes.AppendAscii(" ");
+ rRes += " ";
rRes += aTime;
}
}
else
{
// long time only
- aFmtStr.AssignAscii( "H:MM:SS AM/PM" );
+ aFmtStr = "H:MM:SS AM/PM";
aFormatter.PutandConvertEntry( aFmtStr, nCheckPos, nType, nIndex, LANGUAGE_ENGLISH, eLangType );
aFormatter.GetOutputString( nNumber, nIndex, rRes, &pCol );
}
}
- else if( aFmtStr.EqualsIgnoreCaseAscii( VBAFORMAT_N )
- || aFmtStr.EqualsIgnoreCaseAscii( VBAFORMAT_NN ))
+ else if( aFmtStr.equalsIgnoreAsciiCase( VBAFORMAT_N ) ||
+ aFmtStr.equalsIgnoreAsciiCase( VBAFORMAT_NN ))
{
sal_Int32 nMin = implGetMinute( nNumber );
- if( nMin < 10 && aFmtStr.EqualsIgnoreCaseAscii( VBAFORMAT_NN ) )
+ if( nMin < 10 && aFmtStr.equalsIgnoreAsciiCase( VBAFORMAT_NN ))
{
// Minute in two digits
sal_Unicode aBuf[2];
aBuf[0] = '0';
aBuf[1] = '0' + nMin;
- rRes = rtl::OUString(aBuf, SAL_N_ELEMENTS(aBuf));
+ rRes = OUString(aBuf, SAL_N_ELEMENTS(aBuf));
}
else
{
rRes = rtl::OUString::valueOf(nMin);
}
}
- else if( aFmtStr.EqualsIgnoreCaseAscii( VBAFORMAT_W ))
+ else if( aFmtStr.equalsIgnoreAsciiCase( VBAFORMAT_W ))
{
sal_Int32 nWeekDay = implGetWeekDay( nNumber );
rRes = rtl::OUString::valueOf(nWeekDay);
}
- else if( aFmtStr.EqualsIgnoreCaseAscii( VBAFORMAT_Y ))
+ else if( aFmtStr.equalsIgnoreAsciiCase( VBAFORMAT_Y ))
{
sal_Int16 nYear = implGetDateYear( nNumber );
double dBaseDate;
@@ -821,120 +827,115 @@ void SbxValue::Format( XubString& rRes, const XubString* pFmt ) const
SbxDataType eType = GetType();
switch( eType )
{
- case SbxCHAR:
- case SbxBYTE:
- case SbxINTEGER:
- case SbxUSHORT:
- case SbxLONG:
- case SbxULONG:
- case SbxINT:
- case SbxUINT:
- case SbxNULL: // #45929 NULL with a little cheating
- nComma = 0; goto cvt;
- case SbxSINGLE:
- nComma = 6; goto cvt;
- case SbxDOUBLE:
- nComma = 14;
-
- cvt:
- if( eType != SbxNULL )
- d = GetDouble();
+ case SbxCHAR:
+ case SbxBYTE:
+ case SbxINTEGER:
+ case SbxUSHORT:
+ case SbxLONG:
+ case SbxULONG:
+ case SbxINT:
+ case SbxUINT:
+ case SbxNULL: // #45929 NULL with a little cheating
+ nComma = 0; goto cvt;
+ case SbxSINGLE:
+ nComma = 6; goto cvt;
+ case SbxDOUBLE:
+ nComma = 14;
+
+ cvt:
+ if( eType != SbxNULL )
+ {
+ d = GetDouble();
+ }
+ // #45355 another point to jump in for isnumeric-String
+ cvt2:
+ if( pFmt )
+ {
+ SbxAppData& rAppData = GetSbxData_Impl();
- // #45355 another point to jump in for isnumeric-String
- cvt2:
- if( pFmt )
+ LanguageType eLangType = GetpApp()->GetSettings().GetLanguage();
+ if( rAppData.pBasicFormater )
{
- SbxAppData& rAppData = GetSbxData_Impl();
-
- LanguageType eLangType = GetpApp()->GetSettings().GetLanguage();
- if( rAppData.pBasicFormater )
+ if( rAppData.eBasicFormaterLangType != eLangType )
{
- if( rAppData.eBasicFormaterLangType != eLangType )
- {
- delete rAppData.pBasicFormater;
- rAppData.pBasicFormater = NULL;
- }
+ delete rAppData.pBasicFormater;
+ rAppData.pBasicFormater = NULL;
}
- rAppData.eBasicFormaterLangType = eLangType;
-
+ }
+ rAppData.eBasicFormaterLangType = eLangType;
- if( !rAppData.pBasicFormater )
- {
- SvtSysLocale aSysLocale;
- const LocaleDataWrapper& rData = aSysLocale.GetLocaleData();
- sal_Unicode cComma = rData.getNumDecimalSep()[0];
- sal_Unicode c1000 = rData.getNumThousandSep()[0];
- String aCurrencyStrg = rData.getCurrSymbol();
-
- // initialize the Basic-formater help object:
- // get resources for predefined output
- // of the Format()-command, e. g. for "On/Off"
- rtl::OUString aOnStrg = SbxValueFormatResId(
- STR_BASICKEY_FORMAT_ON).toString();
- rtl::OUString aOffStrg = SbxValueFormatResId(
- STR_BASICKEY_FORMAT_OFF).toString();
- rtl::OUString aYesStrg = SbxValueFormatResId(
- STR_BASICKEY_FORMAT_YES).toString();
- rtl::OUString aNoStrg = SbxValueFormatResId(
- STR_BASICKEY_FORMAT_NO).toString();
- rtl::OUString aTrueStrg = SbxValueFormatResId(
- STR_BASICKEY_FORMAT_TRUE).toString();
- rtl::OUString aFalseStrg = SbxValueFormatResId(
- STR_BASICKEY_FORMAT_FALSE).toString();
- rtl::OUString aCurrencyFormatStrg = SbxValueFormatResId(
- STR_BASICKEY_FORMAT_CURRENCY).toString();
-
- rAppData.pBasicFormater
- = new SbxBasicFormater( cComma,c1000,aOnStrg,aOffStrg,
- aYesStrg,aNoStrg,aTrueStrg,aFalseStrg,
- aCurrencyStrg,aCurrencyFormatStrg );
- }
- // Remark: For performance reasons there's only ONE BasicFormater-
- // object created and 'stored', so that the expensive resource-
- // loading is saved (for country-specific predefined outputs,
- // e. g. "On/Off") and the continous string-creation
- // operations, too.
- // BUT: therefore this code is NOT multithreading capable!
-
- // here are problems with ;;;Null because this method is only
- // called, if SbxValue is a number!!!
- // in addition rAppData.pBasicFormater->BasicFormatNull( *pFmt ); could be called!
- if( eType != SbxNULL )
- {
- rRes = rAppData.pBasicFormater->BasicFormat( d ,*pFmt );
- }
- else
- {
- rRes = rAppData.pBasicFormater->BasicFormatNull( *pFmt );
- }
+ if( !rAppData.pBasicFormater )
+ {
+ SvtSysLocale aSysLocale;
+ const LocaleDataWrapper& rData = aSysLocale.GetLocaleData();
+ sal_Unicode cComma = rData.getNumDecimalSep()[0];
+ sal_Unicode c1000 = rData.getNumThousandSep()[0];
+ OUString aCurrencyStrg = rData.getCurrSymbol();
+
+ // initialize the Basic-formater help object:
+ // get resources for predefined output
+ // of the Format()-command, e. g. for "On/Off"
+ OUString aOnStrg = SbxValueFormatResId(STR_BASICKEY_FORMAT_ON).toString();
+ OUString aOffStrg = SbxValueFormatResId(STR_BASICKEY_FORMAT_OFF).toString();
+ OUString aYesStrg = SbxValueFormatResId(STR_BASICKEY_FORMAT_YES).toString();
+ OUString aNoStrg = SbxValueFormatResId(STR_BASICKEY_FORMAT_NO).toString();
+ OUString aTrueStrg = SbxValueFormatResId(STR_BASICKEY_FORMAT_TRUE).toString();
+ OUString aFalseStrg = SbxValueFormatResId(STR_BASICKEY_FORMAT_FALSE).toString();
+ OUString aCurrencyFormatStrg = SbxValueFormatResId(STR_BASICKEY_FORMAT_CURRENCY).toString();
+
+ rAppData.pBasicFormater = new SbxBasicFormater( cComma,c1000,aOnStrg,aOffStrg,
+ aYesStrg,aNoStrg,aTrueStrg,aFalseStrg,
+ aCurrencyStrg,aCurrencyFormatStrg );
+ }
+ // Remark: For performance reasons there's only ONE BasicFormater-
+ // object created and 'stored', so that the expensive resource-
+ // loading is saved (for country-specific predefined outputs,
+ // e. g. "On/Off") and the continous string-creation
+ // operations, too.
+ // BUT: therefore this code is NOT multithreading capable!
+
+ // here are problems with ;;;Null because this method is only
+ // called, if SbxValue is a number!!!
+ // in addition rAppData.pBasicFormater->BasicFormatNull( *pFmt ); could be called!
+ if( eType != SbxNULL )
+ {
+ rRes = rAppData.pBasicFormater->BasicFormat( d ,*pFmt );
}
else
{
- ::rtl::OUString aTmpString( rRes );
- ImpCvtNum( GetDouble(), nComma, aTmpString );
- rRes = aTmpString;
+ rRes = rAppData.pBasicFormater->BasicFormatNull( *pFmt );
}
- break;
- case SbxSTRING:
- if( pFmt )
+
+ }
+ else
+ {
+ OUString aTmpString( rRes );
+ ImpCvtNum( GetDouble(), nComma, aTmpString );
+ rRes = aTmpString;
+ }
+ break;
+ case SbxSTRING:
+ if( pFmt )
+ {
+ // #45355 converting if numeric
+ if( IsNumericRTL() )
{
- // #45355 converting if numeric
- if( IsNumericRTL() )
- {
- ScanNumIntnl( GetString(), d, /*bSingle*/false );
- goto cvt2;
- }
- else
- {
- printfmtstr( GetString(), rRes, *pFmt );
- }
+ ScanNumIntnl( GetOUString(), d, /*bSingle*/false );
+ goto cvt2;
}
else
- rRes = GetString();
- break;
- default:
- rRes = GetString();
+ {
+ printfmtstr( GetOUString(), rRes, *pFmt );
+ }
+ }
+ else
+ {
+ rRes = GetOUString();
+ }
+ break;
+ default:
+ rRes = GetOUString();
}
}
diff --git a/basic/source/sbx/sbxstr.cxx b/basic/source/sbx/sbxstr.cxx
index a17cb1690fb6..e0306fcfb6a3 100644
--- a/basic/source/sbx/sbxstr.cxx
+++ b/basic/source/sbx/sbxstr.cxx
@@ -70,23 +70,31 @@
case SbxSTRING:
case SbxLPSTR:
if ( p->pOUString )
+ {
*aTmp.pOUString = *p->pOUString;
+ }
break;
case SbxOBJECT:
{
SbxValue* pVal = PTR_CAST(SbxValue,p->pObj);
if( pVal )
- aRes = pVal->GetString();
+ {
+ aRes = pVal->GetOUString();
+ }
else if( p->pObj && p->pObj->IsFixed()
&& (p->pObj->GetType() == (SbxARRAY | SbxBYTE )) )
{
// convert byte array to string
SbxArray* pArr = PTR_CAST(SbxArray, p->pObj);
if( pArr )
+ {
aRes = ByteArrayToString( pArr );
+ }
}
else
+ {
SbxBase::SetError( SbxERR_NO_OBJECT );
+ }
break;
}
case SbxERROR:
diff --git a/basic/source/sbx/sbxvalue.cxx b/basic/source/sbx/sbxvalue.cxx
index a30780de5c33..1bd875bec702 100644
--- a/basic/source/sbx/sbxvalue.cxx
+++ b/basic/source/sbx/sbxvalue.cxx
@@ -405,27 +405,18 @@ sal_Bool SbxValue::Get( SbxValues& rRes ) const
return bRes;
}
-const XubString& SbxValue::GetString() const
-{
- SbxValues aRes;
- aRes.eType = SbxSTRING;
- if( Get( aRes ) )
- ((SbxValue*) this)->aToolString = *aRes.pOUString;
- else
- ((SbxValue*) this)->aToolString.Erase();
-
- return aToolString;
-}
-
-const XubString& SbxValue::GetCoreString() const
+const OUString& SbxValue::GetCoreString() const
{
SbxValues aRes;
aRes.eType = SbxCoreSTRING;
if( Get( aRes ) )
+ {
((SbxValue*) this)->aToolString = *aRes.pOUString;
+ }
else
- ((SbxValue*) this)->aToolString.Erase();
-
+ {
+ ((SbxValue*) this)->aToolString = "";
+ }
return aToolString;
}
@@ -816,7 +807,7 @@ sal_Bool SbxValue::SetType( SbxDataType t )
sal_uInt16 nSlotId = pThisVar
? ( (sal_Int16) ( pThisVar->GetUserData() & 0xFFFF ) )
: 0;
- DBG_ASSERT( nSlotId != 5345 || pThisVar->GetName().EqualsAscii("Parent"),
+ DBG_ASSERT( nSlotId != 5345 || pThisVar->GetName().equalsAscii("Parent"),
"SID_PARENTOBJECT heisst nicht 'Parent'" );
sal_Bool bParentProp = 5345 == nSlotId;
if ( !bParentProp )
diff --git a/basic/source/sbx/sbxvar.cxx b/basic/source/sbx/sbxvar.cxx
index 8999122c49e6..f9148c75003f 100644
--- a/basic/source/sbx/sbxvar.cxx
+++ b/basic/source/sbx/sbxvar.cxx
@@ -43,7 +43,7 @@ static sal_uIntPtr nVar = 0;
class SbxVariableImpl
{
friend class SbxVariable;
- String m_aDeclareClassName;
+ OUString m_aDeclareClassName;
Reference< XInterface > m_xComListener;
StarBASIC* m_pComListenerParentBasic;
@@ -76,7 +76,10 @@ SbxVariable::SbxVariable() : SbxValue()
void registerComListenerVariableForBasic( SbxVariable* pVar, StarBASIC* pBasic );
SbxVariable::SbxVariable( const SbxVariable& r )
- : SvRefBase( r ), SbxValue( r ), mpPar( r.mpPar ), pInfo( r.pInfo )
+ : SvRefBase( r ),
+ SbxValue( r ),
+ mpPar( r.mpPar ),
+ pInfo( r.pInfo )
{
mpSbxVariableImpl = NULL;
if( r.mpSbxVariableImpl != NULL )
@@ -104,9 +107,10 @@ SbxVariable::SbxVariable( const SbxVariable& r )
nHash = 0;
}
#ifdef DBG_UTIL
- static sal_Char const aCellsStr[] = "Cells";
- if ( maName.EqualsAscii( aCellsStr ) )
- maName.AssignAscii( aCellsStr, sizeof( aCellsStr )-1 );
+ if ( maName.equalsAscii( "Cells"))
+ {
+ maName = "Cells";
+ }
DbgOutf( "SbxVariable::Ctor %lx=%ld", (void*)this, ++nVar );
#endif
}
@@ -128,11 +132,12 @@ void removeDimAsNewRecoverItem( SbxVariable* pVar );
SbxVariable::~SbxVariable()
{
#ifdef DBG_UTIL
- rtl::OString aBStr(rtl::OUStringToOString(maName, RTL_TEXTENCODING_ASCII_US));
+ OString aBStr(rtl::OUStringToOString(maName, RTL_TEXTENCODING_ASCII_US));
DbgOutf( "SbxVariable::Dtor %lx (%s)", (void*)this, aBStr.getStr() );
- static sal_Char const aCellsStr[] = "Cells";
- if ( maName.EqualsAscii( aCellsStr ) )
- maName.AssignAscii( aCellsStr, sizeof( aCellsStr )-1 );
+ if ( maName.equalsAscii( "Cells"))
+ {
+ maName = "Cells";
+ }
#endif
#ifndef DISABLE_SCRIPTING
if( IsSet( SBX_DIM_AS_NEW ))
@@ -231,25 +236,28 @@ void SbxVariable::SetParameters( SbxArray* p )
/////////////////////////// Name of the variables ///////////////////////////
-void SbxVariable::SetName( const XubString& rName )
+void SbxVariable::SetName( const OUString& rName )
{
maName = rName;
nHash = MakeHashCode( rName );
}
-const XubString& SbxVariable::GetName( SbxNameType t ) const
+const OUString& SbxVariable::GetName( SbxNameType t ) const
{
static char cSuffixes[] = " %&!#@ $";
if( t == SbxNAME_NONE )
+ {
return maName;
+ }
// Request parameter-information (not for objects)
((SbxVariable*)this)->GetInfo();
// Append nothing, if it is a simple property (no empty brackets)
- if( !pInfo
- || ( pInfo->aParams.empty() && GetClass() == SbxCLASS_PROPERTY ) )
+ if( !pInfo || ( pInfo->aParams.empty() && GetClass() == SbxCLASS_PROPERTY ))
+ {
return maName;
+ }
sal_Unicode cType = ' ';
- XubString aTmp( maName );
+ OUString aTmp( maName );
// short type? Then fetch it, posible this is 0.
SbxDataType et = GetType();
if( t == SbxNAME_SHORT_TYPES )
@@ -259,58 +267,79 @@ const XubString& SbxVariable::GetName( SbxNameType t ) const
cType = cSuffixes[ et ];
}
if( cType != ' ' )
- aTmp += cType;
+ {
+ aTmp += OUString(sal_Unicode(cType));
+ }
}
- aTmp += '(';
+ aTmp += "(";
+
for(SbxParams::const_iterator i = pInfo->aParams.begin(); i != pInfo->aParams.end(); ++i)
{
int nt = i->eType & 0x0FFF;
if( i != pInfo->aParams.begin() )
- aTmp += ',';
+ {
+ aTmp += ",";
+ }
if( i->nFlags & SBX_OPTIONAL )
- aTmp += String( SbxRes( STRING_OPTIONAL ) );
+ {
+ aTmp += OUString( SbxRes( STRING_OPTIONAL ) );
+ }
if( i->eType & SbxBYREF )
- aTmp += String( SbxRes( STRING_BYREF ) );
+ {
+ aTmp += OUString( SbxRes( STRING_BYREF ) );
+ }
aTmp += i->aName;
cType = ' ';
// short type? Then fetch it, posible this is 0.
if( t == SbxNAME_SHORT_TYPES )
{
if( nt <= SbxSTRING )
+ {
cType = cSuffixes[ nt ];
+ }
}
if( cType != ' ' )
{
- aTmp += cType;
+ aTmp += OUString((sal_Unicode)cType);
if( i->eType & SbxARRAY )
- aTmp.AppendAscii( "()" );
+ {
+ aTmp += "()";
+ }
}
else
{
if( i->eType & SbxARRAY )
- aTmp.AppendAscii( "()" );
+ {
+ aTmp += "()";
+ }
// long type?
if( t != SbxNAME_SHORT )
{
- aTmp += String( SbxRes( STRING_AS ) );
+ aTmp += OUString( SbxRes( STRING_AS ) );
if( nt < 32 )
- aTmp += String( SbxRes(
- sal::static_int_cast< sal_uInt16 >( STRING_TYPES + nt ) ) );
+ {
+ aTmp += OUString( SbxRes( sal::static_int_cast< sal_uInt16 >( STRING_TYPES + nt ) ) );
+ }
else
- aTmp += String( SbxRes( STRING_ANY ) );
+ {
+ aTmp += OUString( SbxRes( STRING_ANY ) );
+ }
}
}
}
- aTmp += ')';
+ aTmp += ")";
// Long type? Then fetch it
if( t == SbxNAME_LONG_TYPES && et != SbxEMPTY )
{
- aTmp += String( SbxRes( STRING_AS ) );
+ aTmp += OUString( SbxRes( STRING_AS ) );
if( et < 32 )
- aTmp += String( SbxRes(
- sal::static_int_cast< sal_uInt16 >( STRING_TYPES + et ) ) );
+ {
+ aTmp += OUString( SbxRes( sal::static_int_cast< sal_uInt16 >( STRING_TYPES + et ) ) );
+ }
else
- aTmp += String( SbxRes( STRING_ANY ) );
+ {
+ aTmp += OUString( SbxRes( STRING_ANY ) );
+ }
}
((SbxVariable*) this)->aToolString = aTmp;
return aToolString;
@@ -318,20 +347,23 @@ const XubString& SbxVariable::GetName( SbxNameType t ) const
// Create a simple hashcode: the first six characters were evaluated.
-sal_uInt16 SbxVariable::MakeHashCode( const XubString& rName )
+sal_uInt16 SbxVariable::MakeHashCode( const OUString& rName )
{
sal_uInt16 n = 0;
- sal_uInt16 nLen = rName.Len();
+ sal_Int32 i = 0;
+ sal_uInt16 nLen = rName.getLength();
if( nLen > 6 )
+ {
nLen = 6;
- const sal_Unicode* p = rName.GetBuffer();
- while( nLen-- )
+ }
+ while( nLen-- )
{
- sal_uInt8 c = (sal_uInt8)*p;
- p++;
+ sal_uInt8 c = (sal_uInt8)rName[i++];
// If we have a commen sigen break!!
if( c >= 0x80 )
+ {
return 0;
+ }
n = sal::static_int_cast< sal_uInt16 >( ( n << 3 ) + toupper( c ) );
}
return n;
@@ -414,11 +446,11 @@ void SbxVariable::SetParent( SbxObject* p )
}
if ( !bFound )
{
- String aMsg = rtl::OUString("dangling: [");
+ OUString aMsg = "dangling: [";
aMsg += GetName();
- aMsg.AppendAscii( "].SetParent([" );
+ aMsg += "].SetParent([";
aMsg += p->GetName();
- aMsg.AppendAscii( "])" );
+ aMsg += "])";
rtl::OString aBStr(rtl::OUStringToOString(aMsg, RTL_TEXTENCODING_ASCII_US));
DbgOut( aBStr.getStr(), DBG_OUT_WARNING, __FILE__, __LINE__);
}
@@ -437,13 +469,13 @@ SbxVariableImpl* SbxVariable::getImpl( void )
return mpSbxVariableImpl;
}
-const String& SbxVariable::GetDeclareClassName( void )
+const OUString& SbxVariable::GetDeclareClassName( void )
{
SbxVariableImpl* pImpl = getImpl();
return pImpl->m_aDeclareClassName;
}
-void SbxVariable::SetDeclareClassName( const String& rDeclareClassName )
+void SbxVariable::SetDeclareClassName( const OUString& rDeclareClassName )
{
SbxVariableImpl* pImpl = getImpl();
pImpl->m_aDeclareClassName = rDeclareClassName;
@@ -497,60 +529,62 @@ sal_Bool SbxVariable::LoadData( SvStream& rStrm, sal_uInt16 nVer )
nUserData = nTemp;
// correction: old methods have instead of SbxNULL now SbxEMPTY
if( nType == SbxNULL && GetClass() == SbxCLASS_METHOD )
+ {
nType = SbxEMPTY;
+ }
SbxValues aTmp;
- String aTmpString;
- ::rtl::OUString aVal;
+ OUString aTmpString;
+ OUString aVal;
aTmp.eType = aData.eType = (SbxDataType) nType;
aTmp.pOUString = &aVal;
switch( nType )
{
- case SbxBOOL:
- case SbxERROR:
- case SbxINTEGER:
- rStrm >> aTmp.nInteger; break;
- case SbxLONG:
- rStrm >> aTmp.nLong; break;
- case SbxSINGLE:
- {
- // Floats as ASCII
- aTmpString = read_lenPrefixed_uInt8s_ToOUString<sal_uInt16>(
+ case SbxBOOL:
+ case SbxERROR:
+ case SbxINTEGER:
+ rStrm >> aTmp.nInteger; break;
+ case SbxLONG:
+ rStrm >> aTmp.nLong; break;
+ case SbxSINGLE:
+ {
+ // Floats as ASCII
+ aTmpString = read_lenPrefixed_uInt8s_ToOUString<sal_uInt16>(
rStrm, RTL_TEXTENCODING_ASCII_US);
- double d;
- SbxDataType t;
- if( ImpScan( aTmpString, d, t, NULL ) != SbxERR_OK || t == SbxDOUBLE )
- {
- aTmp.nSingle = 0;
- return sal_False;
- }
- aTmp.nSingle = (float) d;
- break;
- }
- case SbxDATE:
- case SbxDOUBLE:
+ double d;
+ SbxDataType t;
+ if( ImpScan( aTmpString, d, t, NULL ) != SbxERR_OK || t == SbxDOUBLE )
{
- // Floats as ASCII
- aTmpString = read_lenPrefixed_uInt8s_ToOUString<sal_uInt16>(rStrm,
- RTL_TEXTENCODING_ASCII_US);
- SbxDataType t;
- if( ImpScan( aTmpString, aTmp.nDouble, t, NULL ) != SbxERR_OK )
- {
- aTmp.nDouble = 0;
- return sal_False;
- }
- break;
+ aTmp.nSingle = 0;
+ return sal_False;
}
- case SbxSTRING:
- aVal = read_lenPrefixed_uInt8s_ToOUString<sal_uInt16>(rStrm,
- RTL_TEXTENCODING_ASCII_US);
- break;
- case SbxEMPTY:
- case SbxNULL:
- break;
- default:
- aData.eType = SbxNULL;
- DBG_ASSERT( !this, "Nicht unterstuetzer Datentyp geladen" );
+ aTmp.nSingle = (float) d;
+ break;
+ }
+ case SbxDATE:
+ case SbxDOUBLE:
+ {
+ // Floats as ASCII
+ aTmpString = read_lenPrefixed_uInt8s_ToOUString<sal_uInt16>(rStrm,
+ RTL_TEXTENCODING_ASCII_US);
+ SbxDataType t;
+ if( ImpScan( aTmpString, aTmp.nDouble, t, NULL ) != SbxERR_OK )
+ {
+ aTmp.nDouble = 0;
return sal_False;
+ }
+ break;
+ }
+ case SbxSTRING:
+ aVal = read_lenPrefixed_uInt8s_ToOUString<sal_uInt16>(rStrm,
+ RTL_TEXTENCODING_ASCII_US);
+ break;
+ case SbxEMPTY:
+ case SbxNULL:
+ break;
+ default:
+ aData.eType = SbxNULL;
+ DBG_ASSERT( !this, "Nicht unterstuetzer Datentyp geladen" );
+ return sal_False;
}
// putt value
if( nType != SbxNULL && nType != SbxEMPTY && !Put( aTmp ) )
@@ -638,7 +672,7 @@ sal_Bool SbxVariable::StoreData( SvStream& rStrm ) const
SbxInfo::SbxInfo() : aHelpFile(), nHelpId( 0 ), aParams()
{}
-SbxInfo::SbxInfo( const String& r, sal_uInt32 n )
+SbxInfo::SbxInfo( const OUString& r, sal_uInt32 n )
: aHelpFile( r ), nHelpId( n ), aParams()
{}
diff --git a/basic/source/uno/namecont.cxx b/basic/source/uno/namecont.cxx
index c6252c75fe2a..7d49a15ef850 100644
--- a/basic/source/uno/namecont.cxx
+++ b/basic/source/uno/namecont.cxx
@@ -84,8 +84,6 @@ using namespace osl;
using com::sun::star::uno::Reference;
-using ::rtl::OStringBuffer;
-using ::rtl::OUStringToOString;
using ::rtl::Uri;
// #i34411: Flag for error handling during migration
@@ -143,8 +141,9 @@ void NameContainer::replaceByName( const OUString& aName, const Any& aElement )
{
Type aAnyType = aElement.getValueType();
if( mType != aAnyType )
+ {
throw IllegalArgumentException();
-
+ }
NameContainerNameMap::iterator aIt = mHashMap.find( aName );
if( aIt == mHashMap.end() )
{
@@ -189,8 +188,9 @@ void NameContainer::insertByName( const OUString& aName, const Any& aElement )
{
Type aAnyType = aElement.getValueType();
if( mType != aAnyType )
+ {
throw IllegalArgumentException();
-
+ }
NameContainerNameMap::iterator aIt = mHashMap.find( aName );
if( aIt != mHashMap.end() )
{
@@ -237,7 +237,7 @@ void NameContainer::removeByName( const OUString& aName )
NameContainerNameMap::iterator aIt = mHashMap.find( aName );
if( aIt == mHashMap.end() )
{
- rtl::OUString sMessage = rtl::OUStringBuffer().append('"')
+ OUString sMessage = OUStringBuffer().append('"')
.append(aName).append("\" not found")
.makeStringAndClear();
throw NoSuchElementException(sMessage, uno::Reference< uno::XInterface >());
@@ -699,11 +699,13 @@ void SfxLibraryContainer::init_Impl( const OUString& rInitialDocumentURL,
{
uno::Reference< embed::XStorage > xLibrariesStor;
- String aFileName;
+ OUString aFileName;
int nPassCount = 1;
if( !bStorage && meInitMode == DEFAULT )
+ {
nPassCount = 2;
+ }
for( int nPass = 0 ; nPass < nPassCount ; nPass++ )
{
if( bStorage )
@@ -719,7 +721,7 @@ void SfxLibraryContainer::init_Impl( const OUString& rInitialDocumentURL,
if ( xLibrariesStor.is() )
{
aFileName = maInfoFileName;
- aFileName += String( RTL_CONSTASCII_USTRINGPARAM("-lc.xml") );
+ aFileName += "-lc.xml";
try
{
@@ -734,7 +736,7 @@ void SfxLibraryContainer::init_Impl( const OUString& rInitialDocumentURL,
// Check old version
aFileName = maOldInfoFileName;
- aFileName += String( RTL_CONSTASCII_USTRINGPARAM(".xml") );
+ aFileName += ".xml";
try
{
@@ -747,14 +749,16 @@ void SfxLibraryContainer::init_Impl( const OUString& rInitialDocumentURL,
{
// Check for EA2 document version with wrong extensions
aFileName = maOldInfoFileName;
- aFileName += String( RTL_CONSTASCII_USTRINGPARAM(".xli") );
+ aFileName += ".xli";
xStream = xLibrariesStor->openStreamElement( aFileName, embed::ElementModes::READ );
}
}
}
if ( xStream.is() )
+ {
xInput = xStream->getInputStream();
+ }
}
catch(const uno::Exception& )
{
@@ -771,9 +775,13 @@ void SfxLibraryContainer::init_Impl( const OUString& rInitialDocumentURL,
else
{
if( nPass == 1 )
- pLibInfoInetObj = new INetURLObject( String(maLibraryPath).GetToken(0) );
+ {
+ pLibInfoInetObj = new INetURLObject( maLibraryPath.getToken(0, (sal_Unicode)';') );
+ }
else
- pLibInfoInetObj = new INetURLObject( String(maLibraryPath).GetToken(1) );
+ {
+ pLibInfoInetObj = new INetURLObject( maLibraryPath.getToken(1, (sal_Unicode)';') );
+ }
pLibInfoInetObj->insertName( maInfoFileName, sal_False, INetURLObject::LAST_SEGMENT, sal_True, INetURLObject::ENCODE_ALL );
pLibInfoInetObj->setExtension( OUString("xlc") );
aFileName = pLibInfoInetObj->GetMainURL( INetURLObject::NO_DECODE );
@@ -792,7 +800,7 @@ void SfxLibraryContainer::init_Impl( const OUString& rInitialDocumentURL,
// Old variant?
if( !xInput.is() && nPass == 0 )
{
- INetURLObject aLibInfoInetObj( String(maLibraryPath).GetToken(1) );
+ INetURLObject aLibInfoInetObj( maLibraryPath.getToken(1, (sal_Unicode)';') );
aLibInfoInetObj.insertName( maOldInfoFileName, sal_False, INetURLObject::LAST_SEGMENT, sal_True, INetURLObject::ENCODE_ALL );
aLibInfoInetObj.setExtension( OUString( "xli") );
aFileName = aLibInfoInetObj.GetMainURL( INetURLObject::NO_DECODE );
@@ -845,11 +853,15 @@ void SfxLibraryContainer::init_Impl( const OUString& rInitialDocumentURL,
OUString aStorageURL = rLib.aStorageURL;
if( !bStorage && aStorageURL.isEmpty() && nPass == 0 )
{
- String aLibraryPath;
+ OUString aLibraryPath;
if( meInitMode == CONTAINER_INIT_FILE )
+ {
aLibraryPath = maLibraryPath;
+ }
else
- aLibraryPath = String(maLibraryPath).GetToken(1);
+ {
+ aLibraryPath = maLibraryPath.getToken(1, (sal_Unicode)';');
+ }
INetURLObject aInetObj( aLibraryPath );
aInetObj.insertName( rLib.aName, sal_True, INetURLObject::LAST_SEGMENT,
@@ -863,7 +875,7 @@ void SfxLibraryContainer::init_Impl( const OUString& rInitialDocumentURL,
else if( rLib.bLink )
{
// Check "share" path
- INetURLObject aShareInetObj( String(maLibraryPath).GetToken(0) );
+ INetURLObject aShareInetObj( maLibraryPath.getToken(0, (sal_Unicode)';') );
aShareInetObj.insertName( rLib.aName, sal_True, INetURLObject::LAST_SEGMENT,
sal_True, INetURLObject::ENCODE_ALL );
OUString aShareLibDirPath = aShareInetObj.GetMainURL( INetURLObject::NO_DECODE );
@@ -885,8 +897,9 @@ void SfxLibraryContainer::init_Impl( const OUString& rInitialDocumentURL,
// If the same library name is used by the shared and the
// user lib container index files the user file wins
if( nPass == 1 && hasByName( aLibName ) )
+ {
continue;
-
+ }
SfxLibrary* pImplLib;
if( rLib.bLink )
{
@@ -1008,7 +1021,7 @@ void SfxLibraryContainer::init_Impl( const OUString& rInitialDocumentURL,
if( meInitMode == DEFAULT )
{
- INetURLObject aUserBasicInetObj( String(maLibraryPath).GetToken(1) );
+ INetURLObject aUserBasicInetObj( maLibraryPath.getToken(1, (sal_Unicode)';') );
OUString aStandardStr( RTL_CONSTASCII_USTRINGPARAM("Standard") );
static char const strPrevFolderName_1[] = "__basic_80";
@@ -1024,7 +1037,7 @@ void SfxLibraryContainer::init_Impl( const OUString& rInitialDocumentURL,
try
{
INetURLObject aPrevUserBasicInetObj = aPrevUserBasicInetObj_1;
- String aPrevFolder = aPrevUserBasicInetObj.GetMainURL( INetURLObject::NO_DECODE );
+ OUString aPrevFolder = aPrevUserBasicInetObj.GetMainURL( INetURLObject::NO_DECODE );
if( mxSFI->isFolder( aPrevFolder ) )
{
// Check if Standard folder exists and is complete
@@ -1037,35 +1050,35 @@ void SfxLibraryContainer::init_Impl( const OUString& rInitialDocumentURL,
OUString aPrevStandardFolder = aPrevUserBasicStandardInetObj.GetMainURL( INetURLObject::NO_DECODE );
if( mxSFI->isFolder( aPrevStandardFolder ) )
{
- OUString aXlbExtension( OUString( RTL_CONSTASCII_USTRINGPARAM("xlb") ) );
+ OUString aXlbExtension( "xlb" );
OUString aCheckFileName;
// Check if script.xlb exists
- aCheckFileName = OUString( RTL_CONSTASCII_USTRINGPARAM("script") );
+ aCheckFileName = OUString("script");
checkAndCopyFileImpl( aUserBasicStandardInetObj,
aPrevUserBasicStandardInetObj,
aCheckFileName, aXlbExtension, mxSFI );
// Check if dialog.xlb exists
- aCheckFileName = OUString( RTL_CONSTASCII_USTRINGPARAM("dialog") );
+ aCheckFileName = OUString("dialog");
checkAndCopyFileImpl( aUserBasicStandardInetObj,
aPrevUserBasicStandardInetObj,
aCheckFileName, aXlbExtension, mxSFI );
// Check if module1.xba exists
- OUString aXbaExtension( OUString( RTL_CONSTASCII_USTRINGPARAM("xba") ) );
- aCheckFileName = OUString( RTL_CONSTASCII_USTRINGPARAM("Module1") );
+ OUString aXbaExtension("xba");
+ aCheckFileName = OUString("Module1");
checkAndCopyFileImpl( aUserBasicStandardInetObj,
aPrevUserBasicStandardInetObj,
aCheckFileName, aXbaExtension, mxSFI );
}
else
{
- String aStandardFolder = aUserBasicStandardInetObj.GetMainURL( INetURLObject::NO_DECODE );
+ OUString aStandardFolder = aUserBasicStandardInetObj.GetMainURL( INetURLObject::NO_DECODE );
mxSFI->copy( aStandardFolder, aPrevStandardFolder );
}
- String aPrevCopyToFolder = aPrevUserBasicInetObj_2.GetMainURL( INetURLObject::NO_DECODE );
+ OUString aPrevCopyToFolder = aPrevUserBasicInetObj_2.GetMainURL( INetURLObject::NO_DECODE );
mxSFI->copy( aPrevFolder, aPrevCopyToFolder );
}
else
@@ -1079,11 +1092,11 @@ void SfxLibraryContainer::init_Impl( const OUString& rInitialDocumentURL,
Reference< XInterface > xRef = static_cast< XInterface* >( static_cast< OWeakObject* >(pPrevCont) );
// Rename previous basic folder to make storage URLs correct during initialisation
- String aFolderUserBasic = aUserBasicInetObj.GetMainURL( INetURLObject::NO_DECODE );
+ OUString aFolderUserBasic = aUserBasicInetObj.GetMainURL( INetURLObject::NO_DECODE );
INetURLObject aUserBasicTmpInetObj( aUserBasicInetObj );
aUserBasicTmpInetObj.removeSegment();
aUserBasicTmpInetObj.Append( rtl::OString( "__basic_tmp" ));
- String aFolderTmp = aUserBasicTmpInetObj.GetMainURL( INetURLObject::NO_DECODE );
+ OUString aFolderTmp = aUserBasicTmpInetObj.GetMainURL( INetURLObject::NO_DECODE );
mxSFI->move( aFolderUserBasic, aFolderTmp );
try
@@ -1106,7 +1119,7 @@ void SfxLibraryContainer::init_Impl( const OUString& rInitialDocumentURL,
INetURLObject aPrevUserBasicLibInfoInetObj( aUserBasicInetObj );
aPrevUserBasicLibInfoInetObj.insertName( maInfoFileName, sal_False, INetURLObject::LAST_SEGMENT,
sal_True, INetURLObject::ENCODE_ALL );
- aPrevUserBasicLibInfoInetObj.setExtension( OUString( RTL_CONSTASCII_USTRINGPARAM("xlc") ) );
+ aPrevUserBasicLibInfoInetObj.setExtension( OUString("xlc"));
OUString aLibInfoFileName = aPrevUserBasicLibInfoInetObj.GetMainURL( INetURLObject::NO_DECODE );
Sequence<Any> aInitSeq( 1 );
aInitSeq.getArray()[0] <<= aLibInfoFileName;
@@ -1136,7 +1149,7 @@ void SfxLibraryContainer::init_Impl( const OUString& rInitialDocumentURL,
{
SfxLibrary* pImplLib = getImplLib( aStandardStr );
INetURLObject aStandardFolderInetObj( pImplLib->maStorageURL );
- String aStandardFolder = pImplLib->maStorageURL;
+ OUString aStandardFolder = pImplLib->maStorageURL;
mxSFI->kill( aStandardFolder );
}
else
@@ -1167,11 +1180,11 @@ void SfxLibraryContainer::init_Impl( const OUString& rInitialDocumentURL,
// Move folder if not already done
INetURLObject aUserBasicLibFolderInetObj( aUserBasicInetObj );
aUserBasicLibFolderInetObj.Append( aLibName );
- String aLibFolder = aUserBasicLibFolderInetObj.GetMainURL( INetURLObject::NO_DECODE );
+ OUString aLibFolder = aUserBasicLibFolderInetObj.GetMainURL( INetURLObject::NO_DECODE );
INetURLObject aPrevUserBasicLibFolderInetObj( aPrevUserBasicInetObj );
aPrevUserBasicLibFolderInetObj.Append( aLibName );
- String aPrevLibFolder = aPrevUserBasicLibFolderInetObj.GetMainURL( INetURLObject::NO_DECODE );
+ OUString aPrevLibFolder = aPrevUserBasicLibFolderInetObj.GetMainURL( INetURLObject::NO_DECODE );
if( mxSFI->isFolder( aPrevLibFolder ) && !mxSFI->isFolder( aLibFolder ) )
{
@@ -1213,12 +1226,12 @@ void SfxLibraryContainer::init_Impl( const OUString& rInitialDocumentURL,
INetURLObject aPrevUserBasicInetObj_Err( aUserBasicInetObj );
aPrevUserBasicInetObj_Err.removeSegment();
aPrevUserBasicInetObj_Err.Append( rtl::OString( strErrorSavFolderName ));
- String aPrevFolder_Err = aPrevUserBasicInetObj_Err.GetMainURL( INetURLObject::NO_DECODE );
+ OUString aPrevFolder_Err = aPrevUserBasicInetObj_Err.GetMainURL( INetURLObject::NO_DECODE );
bool bSaved = false;
try
{
- String aPrevFolder_1 = aPrevUserBasicInetObj_1.GetMainURL( INetURLObject::NO_DECODE );
+ OUString aPrevFolder_1 = aPrevUserBasicInetObj_1.GetMainURL( INetURLObject::NO_DECODE );
if( mxSFI->isFolder( aPrevFolder_1 ) )
{
mxSFI->move( aPrevFolder_1, aPrevFolder_Err );
@@ -1229,11 +1242,15 @@ void SfxLibraryContainer::init_Impl( const OUString& rInitialDocumentURL,
{}
try
{
- String aPrevFolder_2 = aPrevUserBasicInetObj_2.GetMainURL( INetURLObject::NO_DECODE );
+ OUString aPrevFolder_2 = aPrevUserBasicInetObj_2.GetMainURL( INetURLObject::NO_DECODE );
if( !bSaved && mxSFI->isFolder( aPrevFolder_2 ) )
+ {
mxSFI->move( aPrevFolder_2, aPrevFolder_Err );
+ }
else
+ {
mxSFI->kill( aPrevFolder_2 );
+ }
}
catch(const Exception& )
{}
@@ -1273,14 +1290,15 @@ void SfxLibraryContainer::implScanExtensions( void )
// Add index file to URL
OUString aIndexFileURL = aLibURL;
if( nReduceCopy == 0 )
- aIndexFileURL += OUString(sal_Unicode('/'));
+ {
+ aIndexFileURL += "/";
+ }
aIndexFileURL += maInfoFileName;
- aIndexFileURL += OUString(RTL_CONSTASCII_USTRINGPARAM(".xlb"));
+ aIndexFileURL += OUString(".xlb");
// Create link
const bool bReadOnly = false;
- Reference< XNameAccess > xLib =
- createLibraryLink( aLibName, aIndexFileURL, bReadOnly );
+ Reference< XNameAccess > xLib = createLibraryLink( aLibName, aIndexFileURL, bReadOnly );
}
}
@@ -1313,7 +1331,7 @@ void SfxLibraryContainer::checkStorageURL( const OUString& aSourceURL,
}
}
-SfxLibrary* SfxLibraryContainer::getImplLib( const String& rLibraryName )
+SfxLibrary* SfxLibraryContainer::getImplLib( const OUString& rLibraryName )
{
Any aLibAny = maNameContainer.getByName( rLibraryName ) ;
Reference< XNameAccess > xNameAccess;
@@ -1357,17 +1375,16 @@ throw(WrappedTargetException, RuntimeException)
#define EXPAND_PROTOCOL "vnd.sun.star.expand"
-#define OUSTR(x) ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(x) )
OUString SfxLibraryContainer::createAppLibraryFolder( SfxLibrary* pLib, const OUString& aName )
{
OUString aLibDirPath = pLib->maStorageURL;
if( aLibDirPath.isEmpty() )
{
- INetURLObject aInetObj( String(maLibraryPath).GetToken(1) );
+ INetURLObject aInetObj( maLibraryPath.getToken(1, (sal_Unicode)';') );
aInetObj.insertName( aName, sal_True, INetURLObject::LAST_SEGMENT, sal_True, INetURLObject::ENCODE_ALL );
checkStorageURL( aInetObj.GetMainURL( INetURLObject::NO_DECODE ), pLib->maLibInfoFileURL,
- pLib->maStorageURL, pLib->maUnexpandedStorageURL );
+ pLib->maStorageURL, pLib->maUnexpandedStorageURL );
aLibDirPath = pLib->maStorageURL;
}
@@ -1499,7 +1516,7 @@ void SfxLibraryContainer::implStoreLibrary( SfxLibrary* pLib,
INetURLObject::LAST_SEGMENT, sal_True,
INetURLObject::ENCODE_ALL );
aElementInetObj.setExtension( maLibElementFileExtension );
- String aElementPath( aElementInetObj.GetMainURL( INetURLObject::NO_DECODE ) );
+ OUString aElementPath( aElementInetObj.GetMainURL( INetURLObject::NO_DECODE ) );
if( !isLibraryElementValid( pLib->getByName( aElementName ) ) )
{
@@ -1672,7 +1689,7 @@ bool SfxLibraryContainer::implLoadLibraryIndexFile( SfxLibrary* pLib,
// Read info file
uno::Reference< io::XInputStream > xInput;
- String aLibInfoPath;
+ OUString aLibInfoPath;
if( bStorage )
{
aLibInfoPath = maInfoFileName;
@@ -1828,11 +1845,11 @@ void SfxLibraryContainer::storeLibraries_Impl( const uno::Reference< embed::XSto
if ( bInplaceStorage )
{
// create a temporary target storage
- const ::rtl::OUStringBuffer aTempTargetNameBase = maLibrariesDir + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_temp_" ) );
+ const OUStringBuffer aTempTargetNameBase = maLibrariesDir + OUString( "_temp_" );
sal_Int32 index = 0;
do
{
- ::rtl::OUStringBuffer aTempTargetName( aTempTargetNameBase );
+ OUStringBuffer aTempTargetName( aTempTargetNameBase );
aTempTargetName.append( index++ );
sTargetLibrariesStoreName = aTempTargetName.makeStringAndClear();
@@ -1976,7 +1993,6 @@ void SfxLibraryContainer::storeLibraries_Impl( const uno::Reference< embed::XSto
}
}
}
-
maModifiable.setModified( sal_True );
pImplLib->implSetModified( sal_False );
}
@@ -2042,7 +2058,9 @@ void SfxLibraryContainer::storeLibraries_Impl( const uno::Reference< embed::XSto
}
if( !mbOldInfoFormat && !maModifiable.isModified() )
+ {
return;
+ }
maModifiable.setModified( sal_False );
mbOldInfoFormat = false;
@@ -2086,10 +2104,10 @@ void SfxLibraryContainer::storeLibraries_Impl( const uno::Reference< embed::XSto
else
{
// Create Output stream
- INetURLObject aLibInfoInetObj( String(maLibraryPath).GetToken(1) );
+ INetURLObject aLibInfoInetObj( maLibraryPath.getToken(1, (sal_Unicode)';') );
aLibInfoInetObj.insertName( maInfoFileName, sal_False, INetURLObject::LAST_SEGMENT, sal_True, INetURLObject::ENCODE_ALL );
- aLibInfoInetObj.setExtension( OUString( RTL_CONSTASCII_USTRINGPARAM("xlc") ) );
- String aLibInfoPath( aLibInfoInetObj.GetMainURL( INetURLObject::NO_DECODE ) );
+ aLibInfoInetObj.setExtension( OUString("xlc") );
+ OUString aLibInfoPath( aLibInfoInetObj.GetMainURL( INetURLObject::NO_DECODE ) );
try
{
@@ -2285,7 +2303,7 @@ void SAL_CALL SfxLibraryContainer::removeLibrary( const OUString& Name )
// Delete index file
createAppLibraryFolder( pImplLib, Name );
- String aLibInfoPath = pImplLib->maLibInfoFileURL;
+ OUString aLibInfoPath = pImplLib->maLibInfoFileURL;
try
{
if( mxSFI->exists( aLibInfoPath ) )
@@ -2296,7 +2314,7 @@ void SAL_CALL SfxLibraryContainer::removeLibrary( const OUString& Name )
catch(const Exception& ) {}
// Delete folder if empty
- INetURLObject aInetObj( String(maLibraryPath).GetToken(1) );
+ INetURLObject aInetObj( maLibraryPath.getToken(1, (sal_Unicode)';') );
aInetObj.insertName( Name, sal_True, INetURLObject::LAST_SEGMENT,
sal_True, INetURLObject::ENCODE_ALL );
OUString aLibDirPath = aInetObj.GetMainURL( INetURLObject::NO_DECODE );
@@ -2406,7 +2424,7 @@ void SAL_CALL SfxLibraryContainer::loadLibrary( const OUString& Name )
uno::Reference< io::XStream > xElementStream;
aFile = aElementName;
- aFile += String( RTL_CONSTASCII_USTRINGPARAM(".xml") );
+ aFile += ".xml";
try
{
@@ -2419,7 +2437,7 @@ void SAL_CALL SfxLibraryContainer::loadLibrary( const OUString& Name )
{
// Check for EA2 document version with wrong extensions
aFile = aElementName;
- aFile += String( RTL_CONSTASCII_USTRINGPARAM(".") );
+ aFile += ".";
aFile += maLibElementFileExtension;
try
{
@@ -2444,7 +2462,7 @@ void SAL_CALL SfxLibraryContainer::loadLibrary( const OUString& Name )
}
else
{
- String aLibDirPath = pImplLib->maStorageURL;
+ OUString aLibDirPath = pImplLib->maStorageURL;
INetURLObject aElementInetObj( aLibDirPath );
aElementInetObj.insertName( aElementName, sal_False,
INetURLObject::LAST_SEGMENT, sal_True,
@@ -2565,7 +2583,7 @@ void SAL_CALL SfxLibraryContainer::renameLibrary( const OUString& Name, const OU
OUString aLibDirPath = pImplLib->maStorageURL;
- INetURLObject aDestInetObj( String(maLibraryPath).GetToken(1) );
+ INetURLObject aDestInetObj( maLibraryPath.getToken(1, (sal_Unicode)';'));
aDestInetObj.insertName( NewName, sal_True, INetURLObject::LAST_SEGMENT,
sal_True, INetURLObject::ENCODE_ALL );
OUString aDestDirPath = aDestInetObj.GetMainURL( INetURLObject::NO_DECODE );
@@ -2607,19 +2625,21 @@ void SAL_CALL SfxLibraryContainer::renameLibrary( const OUString& Name, const OU
aElementInetObj.insertName( aElementName, sal_False,
INetURLObject::LAST_SEGMENT, sal_True, INetURLObject::ENCODE_ALL );
aElementInetObj.setExtension( maLibElementFileExtension );
- String aElementPath( aElementInetObj.GetMainURL( INetURLObject::NO_DECODE ) );
+ OUString aElementPath( aElementInetObj.GetMainURL( INetURLObject::NO_DECODE ) );
INetURLObject aElementDestInetObj( aDestDirPath );
aElementDestInetObj.insertName( aElementName, sal_False,
INetURLObject::LAST_SEGMENT, sal_True,
INetURLObject::ENCODE_ALL );
aElementDestInetObj.setExtension( maLibElementFileExtension );
- String aDestElementPath( aElementDestInetObj.GetMainURL( INetURLObject::NO_DECODE ) );
+ OUString aDestElementPath( aElementDestInetObj.GetMainURL( INetURLObject::NO_DECODE ) );
try
{
if( mxSFI->exists( aDestElementPath ) )
+ {
mxSFI->kill( aDestElementPath );
+ }
mxSFI->move( aElementPath, aDestElementPath );
}
catch(const Exception& )
@@ -2899,10 +2919,11 @@ void SAL_CALL SfxLibraryContainer::setVBACompatibilityMode( ::sal_Bool _vbacompa
if( BasicManager* pBasMgr = getBasicManager() )
{
// get the standard library
- String aLibName = pBasMgr->GetName();
- if ( aLibName.Len() == 0 )
- aLibName = String( RTL_CONSTASCII_USTRINGPARAM( "Standard" ) );
-
+ OUString aLibName = pBasMgr->GetName();
+ if ( aLibName.isEmpty())
+ {
+ aLibName = "Standard";
+ }
if( StarBASIC* pBasic = pBasMgr->GetLib( aLibName ) )
{
pBasic->SetVBAEnabled( _vbacompatmodeon );
diff --git a/basic/source/uno/scriptcont.cxx b/basic/source/uno/scriptcont.cxx
index 6607aa85b8a2..00ffe7893b94 100644
--- a/basic/source/uno/scriptcont.cxx
+++ b/basic/source/uno/scriptcont.cxx
@@ -201,16 +201,16 @@ void SAL_CALL SfxScriptLibraryContainer::writeLibraryElement( const Reference <
switch( aModInfo.ModuleType )
{
case ModuleType::NORMAL:
- aMod.aModuleType = OUString( "normal" );
+ aMod.aModuleType = "normal";
break;
case ModuleType::CLASS:
- aMod.aModuleType = OUString( "class" );
+ aMod.aModuleType ="class";
break;
case ModuleType::FORM:
- aMod.aModuleType = OUString( "form" );
+ aMod.aModuleType = "form";
break;
case ModuleType::DOCUMENT:
- aMod.aModuleType = OUString( "document" );
+ aMod.aModuleType = "document";
break;
case ModuleType::UNKNOWN:
// nothing
@@ -544,13 +544,19 @@ void SAL_CALL SfxScriptLibraryContainer::changeLibraryPassword( const OUString&
INetURLObject::LAST_SEGMENT, sal_True,
INetURLObject::ENCODE_ALL );
if( bKillUncryptedFiles )
+ {
aElementInetObj.setExtension( maLibElementFileExtension );
+ }
else
+ {
aElementInetObj.setExtension( OUString( "pba" ) );
- String aElementPath( aElementInetObj.GetMainURL( INetURLObject::NO_DECODE ) );
+ }
+ OUString aElementPath( aElementInetObj.GetMainURL( INetURLObject::NO_DECODE ) );
if( mxSFI->exists( aElementPath ) )
+ {
mxSFI->kill( aElementPath );
+ }
}
}
catch(const Exception& ) {}