summaryrefslogtreecommitdiff
path: root/basic
diff options
context:
space:
mode:
Diffstat (limited to 'basic')
-rw-r--r--basic/inc/basic/sbmod.hxx4
-rw-r--r--basic/inc/basic/sbxvar.hxx12
-rw-r--r--basic/source/classes/sb.cxx130
-rwxr-xr-xbasic/source/classes/sbunoobj.cxx23
-rw-r--r--basic/source/comp/codegen.cxx12
-rw-r--r--basic/source/comp/dim.cxx70
-rw-r--r--basic/source/comp/exprgen.cxx73
-rw-r--r--basic/source/comp/exprtree.cxx10
-rw-r--r--basic/source/comp/makefile.mk33
-rwxr-xr-xbasic/source/comp/sbcomp.cxx2
-rw-r--r--basic/source/inc/expr.hxx3
-rw-r--r--basic/source/inc/parser.hxx5
-rw-r--r--basic/source/inc/sbintern.hxx6
-rw-r--r--basic/source/inc/sbunoobj.hxx1
-rw-r--r--basic/source/inc/symtbl.hxx3
-rw-r--r--basic/source/runtime/methods1.cxx14
-rw-r--r--basic/source/runtime/step0.cxx229
-rw-r--r--basic/source/sbx/sbxbool.cxx18
-rw-r--r--basic/source/sbx/sbxbyte.cxx10
-rw-r--r--basic/source/sbx/sbxchar.cxx15
-rw-r--r--basic/source/sbx/sbxconv.hxx16
-rw-r--r--basic/source/sbx/sbxcurr.cxx26
-rw-r--r--basic/source/sbx/sbxdate.cxx12
-rw-r--r--basic/source/sbx/sbxdbl.cxx10
-rw-r--r--basic/source/sbx/sbxdec.cxx20
-rw-r--r--basic/source/sbx/sbxdec.hxx4
-rw-r--r--basic/source/sbx/sbxint.cxx38
-rw-r--r--basic/source/sbx/sbxlng.cxx10
-rw-r--r--basic/source/sbx/sbxres.cxx2
-rw-r--r--basic/source/sbx/sbxres.hxx2
-rw-r--r--basic/source/sbx/sbxscan.cxx37
-rw-r--r--basic/source/sbx/sbxsng.cxx10
-rw-r--r--basic/source/sbx/sbxstr.cxx50
-rw-r--r--basic/source/sbx/sbxuint.cxx10
-rw-r--r--basic/source/sbx/sbxulng.cxx10
-rw-r--r--basic/source/sbx/sbxvalue.cxx105
-rw-r--r--basic/source/sbx/sbxvar.cxx40
37 files changed, 625 insertions, 450 deletions
diff --git a/basic/inc/basic/sbmod.hxx b/basic/inc/basic/sbmod.hxx
index 15afc1f40f..ae52ca4046 100644
--- a/basic/inc/basic/sbmod.hxx
+++ b/basic/inc/basic/sbmod.hxx
@@ -44,6 +44,7 @@ class SbProcedureProperty;
class SbIfaceMapperMethod;
class SbClassModuleObject;
+struct ClassModuleRunInitItem;
struct SbClassData;
class SbModuleImpl;
@@ -71,6 +72,7 @@ protected:
SbxObjectRef pDocObject; // an impl object ( used by Document Modules )
bool bIsProxyModule;
+ static void implProcessModuleRunInit( ClassModuleRunInitItem& rItem );
void StartDefinitions();
SbMethod* GetMethod( const String&, SbxDataType );
SbProperty* GetProperty( const String&, SbxDataType );
@@ -134,7 +136,7 @@ public:
void SetVBACompat( BOOL bCompat );
INT32 GetModuleType() { return mnType; }
void SetModuleType( INT32 nType ) { mnType = nType; }
- bool GetIsProxyModule() { return bIsProxyModule; }
+ bool isProxyModule() { return bIsProxyModule; }
void AddVarName( const String& aName );
void RemoveVars();
::com::sun::star::uno::Reference< ::com::sun::star::script::XInvocation > GetUnoModule();
diff --git a/basic/inc/basic/sbxvar.hxx b/basic/inc/basic/sbxvar.hxx
index 0e44b07079..7988c95399 100644
--- a/basic/inc/basic/sbxvar.hxx
+++ b/basic/inc/basic/sbxvar.hxx
@@ -178,7 +178,7 @@ struct SbxValues
sal_uInt64 uInt64;
int nInt;
unsigned int nUInt;
- String* pString;
+ ::rtl::OUString* pOUString;
SbxDecimal* pDecimal;
SbxBase* pObj;
@@ -212,7 +212,7 @@ struct SbxValues
SbxValues( double _nDouble ): nDouble( _nDouble ), eType(SbxDOUBLE) {}
SbxValues( int _nInt ): nInt( _nInt ), eType(SbxINT) {}
SbxValues( unsigned int _nUInt ): nUInt( _nUInt ), eType(SbxUINT) {}
- SbxValues( const String* _pString ): pString( (String*) _pString ), eType(SbxSTRING) {}
+ SbxValues( const ::rtl::OUString* _pString ): pOUString( (::rtl::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) {}
@@ -237,7 +237,8 @@ class SbxValue : public SbxBase
SbxValue* TheRealValue() const;
protected:
SbxValues aData; // Data
- String aPic; // Picture-String
+ ::rtl::OUString aPic; // Picture-String
+ String aToolString; // tool string copy
virtual void Broadcast( ULONG ); // Broadcast-Call
virtual ~SbxValue();
@@ -303,6 +304,7 @@ public:
UINT16 GetErr() const;
const String& GetString() const;
const String& GetCoreString() const;
+ ::rtl::OUString GetOUString() const;
SbxDecimal* GetDecimal() const;
SbxBase* GetObject() const;
BOOL HasObject() const;
@@ -325,8 +327,8 @@ public:
BOOL PutDate( double );
BOOL PutBool( BOOL );
BOOL PutErr( USHORT );
- BOOL PutStringExt( const String& ); // with extended analysis (International, "TRUE"/"FALSE")
- BOOL PutString( const String& );
+ BOOL PutStringExt( const ::rtl::OUString& ); // with extended analysis (International, "TRUE"/"FALSE")
+ BOOL PutString( const ::rtl::OUString& );
BOOL PutString( const sal_Unicode* ); // Type = SbxSTRING
BOOL PutpChar( const sal_Unicode* ); // Type = SbxLPSTR
BOOL PutDecimal( SbxDecimal* pDecimal );
diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx
index df5bd58e90..f8aef3d6d2 100644
--- a/basic/source/classes/sb.cxx
+++ b/basic/source/classes/sb.cxx
@@ -57,6 +57,7 @@
#include <vos/mutex.hxx>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include "errobject.hxx"
+#include <hash_map>
#include <com/sun/star/script/ModuleType.hpp>
#include <com/sun/star/script/ModuleInfo.hpp>
@@ -552,6 +553,39 @@ SbClassModuleObject::SbClassModuleObject( SbModule* pClassModule )
USHORT nFlags_ = pProp->GetFlags();
pProp->SetFlag( SBX_NO_BROADCAST );
SbxProperty* pNewProp = new SbxProperty( *pProp );
+
+ // Special handling for modules instances and collections, they need
+ // to be instantiated, otherwise all refer to the same base object
+ SbxDataType eVarType = pProp->GetType();
+ if( eVarType == SbxOBJECT )
+ {
+ SbxBase* pObjBase = pProp->GetObject();
+ SbxObject* pObj = PTR_CAST(SbxObject,pObjBase);
+ if( pObj != NULL )
+ {
+ String aObjClass = pObj->GetClassName();
+ (void)aObjClass;
+
+ SbClassModuleObject* pClassModuleObj = PTR_CAST(SbClassModuleObject,pObjBase);
+ if( pClassModuleObj != NULL )
+ {
+ SbModule* pLclClassModule = pClassModuleObj->getClassModule();
+ SbClassModuleObject* pNewObj = new SbClassModuleObject( pLclClassModule );
+ pNewObj->SetName( pProp->GetName() );
+ pNewObj->SetParent( pLclClassModule->pParent );
+ pNewProp->PutObject( pNewObj );
+ }
+ else if( aObjClass.EqualsIgnoreCaseAscii( "Collection" ) )
+ {
+ String aCollectionName( RTL_CONSTASCII_USTRINGPARAM("Collection") );
+ BasicCollection* pNewCollection = new BasicCollection( aCollectionName );
+ pNewCollection->SetName( pProp->GetName() );
+ pNewCollection->SetParent( pClassModule->pParent );
+ pNewProp->PutObject( pNewCollection );
+ }
+ }
+ }
+
pNewProp->ResetFlag( SBX_NO_BROADCAST );
pNewProp->SetParent( this );
pProps->PutDirect( pNewProp, i );
@@ -726,6 +760,7 @@ SbClassData::SbClassData( void )
void SbClassData::clear( void )
{
mxIfaces->Clear();
+ maRequiredTypes.clear();
}
SbClassFactory::SbClassFactory( void )
@@ -981,6 +1016,72 @@ SbModule* StarBASIC::FindModule( const String& rName )
return NULL;
}
+
+struct ClassModuleRunInitItem
+{
+ SbModule* m_pModule;
+ bool m_bProcessing;
+ bool m_bRunInitDone;
+ //ModuleVector m_vModulesDependingOnThisModule;
+
+ ClassModuleRunInitItem( void )
+ : m_pModule( NULL )
+ , m_bProcessing( false )
+ , m_bRunInitDone( false )
+ {}
+ ClassModuleRunInitItem( SbModule* pModule )
+ : m_pModule( pModule )
+ , m_bProcessing( false )
+ , m_bRunInitDone( false )
+ {}
+};
+
+typedef std::hash_map< ::rtl::OUString, ClassModuleRunInitItem,
+ ::rtl::OUStringHash, ::std::equal_to< ::rtl::OUString > > ModuleInitDependencyMap;
+
+static ModuleInitDependencyMap* GpMIDMap = NULL;
+
+void SbModule::implProcessModuleRunInit( ClassModuleRunInitItem& rItem )
+{
+ ModuleInitDependencyMap& rMIDMap = *GpMIDMap;
+
+ rItem.m_bProcessing = true;
+
+ //bool bAnyDependencies = true;
+ SbModule* pModule = rItem.m_pModule;
+ if( pModule->pClassData != NULL )
+ {
+ StringVector& rReqTypes = pModule->pClassData->maRequiredTypes;
+ if( rReqTypes.size() > 0 )
+ {
+ for( StringVector::iterator it = rReqTypes.begin() ; it != rReqTypes.end() ; ++it )
+ {
+ String& rStr = *it;
+
+ // Is required type a class module?
+ ModuleInitDependencyMap::iterator itFind = rMIDMap.find( rStr );
+ if( itFind != rMIDMap.end() )
+ {
+ ClassModuleRunInitItem& rParentItem = itFind->second;
+ if( rParentItem.m_bProcessing )
+ {
+ // TODO: raise error?
+ DBG_ERROR( "Cyclic module dependency detected" );
+ continue;
+ }
+
+ if( !rParentItem.m_bRunInitDone )
+ implProcessModuleRunInit( rParentItem );
+ }
+ }
+ }
+ }
+
+ pModule->RunInit();
+ rItem.m_bRunInitDone = true;
+ rItem.m_bProcessing = false;
+}
+
// Run Init-Code of all modules (including inserted libraries)
void StarBASIC::InitAllModules( StarBASIC* pBasicNotToInit )
{
@@ -994,10 +1095,33 @@ void StarBASIC::InitAllModules( StarBASIC* pBasicNotToInit )
// compile modules first then RunInit ( otherwise there is
// can be order dependency, e.g. classmodule A has a member
// of of type classmodule B and classmodule B hasn't been compiled yet )
+
+ // Consider required types to init in right order. Class modules
+ // that are required by other modules have to be initialized first.
+ ModuleInitDependencyMap aMIDMap;
+ GpMIDMap = &aMIDMap;
for ( USHORT nMod = 0; nMod < pModules->Count(); nMod++ )
{
SbModule* pModule = (SbModule*)pModules->Get( nMod );
- pModule->RunInit();
+ String aModuleName = pModule->GetName();
+ if( pModule->isProxyModule() )
+ aMIDMap[aModuleName] = ClassModuleRunInitItem( pModule );
+ }
+
+ ModuleInitDependencyMap::iterator it;
+ for( it = aMIDMap.begin() ; it != aMIDMap.end(); ++it )
+ {
+ ClassModuleRunInitItem& rItem = it->second;
+ SbModule::implProcessModuleRunInit( rItem );
+ }
+ GpMIDMap = NULL;
+
+ // Call RunInit on standard modules
+ for ( USHORT nMod = 0; nMod < pModules->Count(); nMod++ )
+ {
+ SbModule* pModule = (SbModule*)pModules->Get( nMod );
+ if( !pModule->isProxyModule() )
+ pModule->RunInit();
}
// Check all objects if they are BASIC,
@@ -1962,7 +2086,7 @@ void BasicCollection::CollItem( SbxArray* pPar_ )
if( nIndex >= 0 && nIndex < (INT32)xItemArray->Count32() )
pRes = xItemArray->Get32( nIndex );
if( !pRes )
- SetError( SbxERR_BAD_INDEX );
+ SetError( SbERR_BAD_ARGUMENT );
else
*(pPar_->Get(0)) = *pRes;
}
@@ -1980,6 +2104,6 @@ void BasicCollection::CollRemove( SbxArray* pPar_ )
if( nIndex >= 0 && nIndex < (INT32)xItemArray->Count32() )
xItemArray->Remove32( nIndex );
else
- SetError( SbxERR_BAD_INDEX );
+ SetError( SbERR_BAD_ARGUMENT );
}
diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx
index 1193aad492..c0735bb1b3 100755
--- a/basic/source/classes/sbunoobj.cxx
+++ b/basic/source/classes/sbunoobj.cxx
@@ -71,6 +71,7 @@
#include <com/sun/star/bridge/oleautomation/Date.hpp>
#include <com/sun/star/bridge/oleautomation/Decimal.hpp>
#include <com/sun/star/bridge/oleautomation/Currency.hpp>
+#include <com/sun/star/bridge/oleautomation/XAutomationObject.hpp>
using com::sun::star::uno::Reference;
@@ -300,7 +301,12 @@ SbUnoObject* createOLEObject_Impl( const String& aType )
SbUnoObject* pUnoObj = NULL;
if( xOLEFactory.is() )
{
- Reference< XInterface > xOLEObject = xOLEFactory->createInstance( aType );
+ // some type names available in VBA can not be directly used in COM
+ ::rtl::OUString aOLEType = aType;
+ if ( aOLEType.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "SAXXMLReader30" ) ) ) )
+ aOLEType = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Msxml2.SAXXMLReader.3.0" ) );
+
+ Reference< XInterface > xOLEObject = xOLEFactory->createInstance( aOLEType );
if( xOLEObject.is() )
{
Any aAny;
@@ -1460,7 +1466,7 @@ Any sbxToUnoValue( SbxVariable* pVar, const Type& rType, Property* pUnoProperty
aRetVal.setValue( &c , getCharCppuType() );
break;
}
- case TypeClass_STRING: aRetVal <<= ::rtl::OUString( pVar->GetString() ); break;
+ case TypeClass_STRING: aRetVal <<= pVar->GetOUString(); break;
case TypeClass_FLOAT: aRetVal <<= pVar->GetSingle(); break;
case TypeClass_DOUBLE: aRetVal <<= pVar->GetDouble(); break;
//case TypeClass_OCTET: break;
@@ -2265,6 +2271,7 @@ Reference< XInvocation > createDynamicInvocationFor( const Any& aAny );
SbUnoObject::SbUnoObject( const String& aName_, const Any& aUnoObj_ )
: SbxObject( aName_ )
, bNeedIntrospection( TRUE )
+ , bIgnoreNativeCOMObjectMembers( FALSE )
{
static Reference< XIntrospection > xIntrospection;
@@ -2310,6 +2317,12 @@ SbUnoObject::SbUnoObject( const String& aName_, const Any& aUnoObj_ )
bNeedIntrospection = FALSE;
return;
}
+
+ // Ignore introspection based members for COM objects to avoid
+ // hiding of equally named COM symbols, e.g. XInvocation::getValue
+ Reference< oleautomation::XAutomationObject > xAutomationObject( aUnoObj_, UNO_QUERY );
+ if( xAutomationObject.is() )
+ bIgnoreNativeCOMObjectMembers = TRUE;
}
maTmpUnoObj = aUnoObj_;
@@ -2553,7 +2566,7 @@ SbxVariable* SbUnoObject::Find( const String& rName, SbxClassType t )
if( !pRes )
{
::rtl::OUString aUName( rName );
- if( mxUnoAccess.is() )
+ if( mxUnoAccess.is() && !bIgnoreNativeCOMObjectMembers )
{
if( mxExactName.is() )
{
@@ -2713,10 +2726,12 @@ void SbUnoObject::implCreateAll( void )
// Instrospection besorgen
Reference< XIntrospectionAccess > xAccess = mxUnoAccess;
- if( !xAccess.is() )
+ if( !xAccess.is() || bIgnoreNativeCOMObjectMembers )
{
if( mxInvocation.is() )
xAccess = mxInvocation->getIntrospection();
+ else if( bIgnoreNativeCOMObjectMembers )
+ return;
}
if( !xAccess.is() )
return;
diff --git a/basic/source/comp/codegen.cxx b/basic/source/comp/codegen.cxx
index c7e8f1101c..256dcf92e0 100644
--- a/basic/source/comp/codegen.cxx
+++ b/basic/source/comp/codegen.cxx
@@ -138,11 +138,10 @@ void SbiCodeGen::Save()
pCLASSFAC->AddClassModule( &rMod );
nIfaceCount = pParser->aIfaceVector.size();
+ if( !rMod.pClassData )
+ rMod.pClassData = new SbClassData;
if( nIfaceCount )
{
- if( !rMod.pClassData )
- rMod.pClassData = new SbClassData;
-
for( int i = 0 ; i < nIfaceCount ; i++ )
{
const String& rIfaceName = pParser->aIfaceVector[i];
@@ -152,6 +151,8 @@ void SbiCodeGen::Save()
pIfaces->Insert( pIfaceVar, pIfaces->Count() );
}
}
+
+ rMod.pClassData->maRequiredTypes = pParser->aRequiredTypes;
}
else
{
@@ -161,6 +162,7 @@ void SbiCodeGen::Save()
rMod.mnType = com::sun::star::script::ModuleType::NORMAL;
rMod.bIsProxyModule = false;
}
+
if( pParser->bText )
p->SetFlag( SBIMG_COMPARETEXT );
// GlobalCode-Flag
@@ -257,6 +259,10 @@ void SbiCodeGen::Save()
if( !pProc->IsPublic() )
pMeth->SetFlag( SBX_PRIVATE );
+ // Declare? -> Hidden
+ if( pProc->GetLib().Len() > 0 )
+ pMeth->SetFlag( SBX_HIDDEN );
+
pMeth->nStart = pProc->GetAddr();
pMeth->nLine1 = pProc->GetLine1();
pMeth->nLine2 = pProc->GetLine2();
diff --git a/basic/source/comp/dim.cxx b/basic/source/comp/dim.cxx
index b5131c99f1..367be2a3e3 100644
--- a/basic/source/comp/dim.cxx
+++ b/basic/source/comp/dim.cxx
@@ -161,6 +161,9 @@ void SbiParser::TypeDecl( SbiSymDef& rDef, BOOL bAsNewAlreadyParsed )
// In den String-Pool uebernehmen
rDef.SetTypeId( aGblStrings.Add( aCompleteName ) );
+
+ if( rDef.IsNew() && pProc == NULL )
+ aRequiredTypes.push_back( aCompleteName );
}
eType = SbxOBJECT;
break;
@@ -874,7 +877,7 @@ SbiProcDef* SbiParser::ProcDecl( BOOL bDecl )
}
if( bCompatible && Peek() == PARAMARRAY )
{
- if( bByVal || bByVal || bOptional )
+ if( bByVal || bOptional )
Error( SbERR_UNEXPECTED, PARAMARRAY );
Next();
bParamArray = TRUE;
@@ -946,6 +949,8 @@ void SbiParser::DefDeclare( BOOL bPrivate )
Error( SbERR_UNEXPECTED, eCurTok );
else
{
+ bool bFunction = (eCurTok == FUNCTION);
+
SbiProcDef* pDef = ProcDecl( TRUE );
if( pDef )
{
@@ -970,7 +975,70 @@ void SbiParser::DefDeclare( BOOL bPrivate )
aPublics.Add( pDef );
if ( pDef )
+ {
pDef->SetPublic( !bPrivate );
+
+ // New declare handling
+ if( pDef->GetLib().Len() > 0 )
+ {
+ if( bNewGblDefs && nGblChain == 0 )
+ {
+ nGblChain = aGen.Gen( _JUMP, 0 );
+ bNewGblDefs = FALSE;
+ }
+
+ USHORT nSavLine = nLine;
+ aGen.Statement();
+ pDef->Define();
+ pDef->SetLine1( nSavLine );
+ pDef->SetLine2( nSavLine );
+
+ SbiSymPool& rPool = pDef->GetParams();
+ USHORT nParCount = rPool.GetSize();
+
+ SbxDataType eType = pDef->GetType();
+ if( bFunction )
+ aGen.Gen( _PARAM, 0, sal::static_int_cast< UINT16 >( eType ) );
+
+ if( nParCount > 1 )
+ {
+ aGen.Gen( _ARGC );
+
+ for( USHORT i = 1 ; i < nParCount ; ++i )
+ {
+ SbiSymDef* pParDef = rPool.Get( i );
+ SbxDataType eParType = pParDef->GetType();
+
+ aGen.Gen( _PARAM, i, sal::static_int_cast< UINT16 >( eParType ) );
+ aGen.Gen( _ARGV );
+
+ USHORT nTyp = sal::static_int_cast< USHORT >( pParDef->GetType() );
+ if( pParDef->IsByVal() )
+ {
+ // Reset to avoid additional byval in call to wrapper function
+ pParDef->SetByVal( FALSE );
+ nTyp |= 0x8000;
+ }
+ aGen.Gen( _ARGTYP, nTyp );
+ }
+ }
+
+ aGen.Gen( _LIB, aGblStrings.Add( pDef->GetLib() ) );
+
+ SbiOpcode eOp = pDef->IsCdecl() ? _CALLC : _CALL;
+ USHORT nId = pDef->GetId();
+ if( pDef->GetAlias().Len() )
+ nId = ( nId & 0x8000 ) | aGblStrings.Add( pDef->GetAlias() );
+ if( nParCount > 1 )
+ nId |= 0x8000;
+ aGen.Gen( eOp, nId, sal::static_int_cast< UINT16 >( eType ) );
+
+ if( bFunction )
+ aGen.Gen( _PUT );
+
+ aGen.Gen( _LEAVE );
+ }
+ }
}
}
}
diff --git a/basic/source/comp/exprgen.cxx b/basic/source/comp/exprgen.cxx
index 82b2d39dcf..ea2dd286da 100644
--- a/basic/source/comp/exprgen.cxx
+++ b/basic/source/comp/exprgen.cxx
@@ -115,13 +115,8 @@ void SbiExprNode::Gen( RecursiveMode eRecMode )
}
else
{
- SbiProcDef* pProc = aVar.pDef->GetProcDef();
- // per DECLARE definiert?
- if( pProc && pProc->GetLib().Len() )
- eOp = pProc->IsCdecl() ? _CALLC : _CALL;
- else
- eOp = ( aVar.pDef->GetScope() == SbRTL ) ? _RTL :
- (aVar.pDef->IsGlobal() ? _FIND_G : _FIND);
+ eOp = ( aVar.pDef->GetScope() == SbRTL ) ? _RTL :
+ (aVar.pDef->IsGlobal() ? _FIND_G : _FIND);
}
if( eOp == _FIND )
@@ -187,17 +182,6 @@ void SbiExprNode::GenElement( SbiOpcode eOp )
aVar.pPar->Gen();
}
- SbiProcDef* pProc = aVar.pDef->GetProcDef();
- // per DECLARE definiert?
- if( pProc )
- {
- // Dann evtl. einen LIB-Befehl erzeugen
- if( pProc->GetLib().Len() )
- pGen->Gen( _LIB, pGen->GetParser()->aGblStrings.Add( pProc->GetLib() ) );
- // und den Aliasnamen nehmen
- if( pProc->GetAlias().Len() )
- nId = ( nId & 0x8000 ) | pGen->GetParser()->aGblStrings.Add( pProc->GetAlias() );
- }
pGen->Gen( eOp, nId, sal::static_int_cast< UINT16 >( GetType() ) );
if( aVar.pvMorePar )
@@ -223,13 +207,8 @@ void SbiExprList::Gen()
{
pParser->aGen.Gen( _ARGC );
// AB 10.1.96: Typ-Anpassung bei DECLARE
- USHORT nCount = 1, nParAnz = 0;
- SbiSymPool* pPool = NULL;
- if( pProc )
- {
- pPool = &pProc->GetParams();
- nParAnz = pPool->GetSize();
- }
+ USHORT nCount = 1 /*, nParAnz = 0*/;
+// SbiSymPool* pPool = NULL;
for( SbiExpression* pExpr = pFirst; pExpr; pExpr = pExpr->pNext,nCount++ )
{
pExpr->Gen();
@@ -239,6 +218,7 @@ void SbiExprList::Gen()
USHORT nSid = pParser->aGblStrings.Add( pExpr->GetName() );
pParser->aGen.Gen( _ARGN, nSid );
+ /* TODO: Check after Declare concept change
// AB 10.1.96: Typanpassung bei named -> passenden Parameter suchen
if( pProc )
{
@@ -246,39 +226,26 @@ void SbiExprList::Gen()
pParser->Error( SbERR_NO_NAMED_ARGS );
// Spaeter, wenn Named Args bei DECLARE moeglich
- /*
- for( USHORT i = 1 ; i < nParAnz ; i++ )
- {
- SbiSymDef* pDef = pPool->Get( i );
- const String& rName = pDef->GetName();
- if( rName.Len() )
- {
- if( pExpr->GetName().ICompare( rName )
- == COMPARE_EQUAL )
- {
- pParser->aGen.Gen( _ARGTYP, pDef->GetType() );
- break;
- }
- }
- }
- */
+ //for( USHORT i = 1 ; i < nParAnz ; i++ )
+ //{
+ // SbiSymDef* pDef = pPool->Get( i );
+ // const String& rName = pDef->GetName();
+ // if( rName.Len() )
+ // {
+ // if( pExpr->GetName().ICompare( rName )
+ // == COMPARE_EQUAL )
+ // {
+ // pParser->aGen.Gen( _ARGTYP, pDef->GetType() );
+ // break;
+ // }
+ // }
+ //}
}
+ */
}
else
{
pParser->aGen.Gen( _ARGV );
-
- // Funktion mit DECLARE -> Typ-Anpassung
- if( pProc && nCount < nParAnz )
- {
- SbiSymDef* pDef = pPool->Get( nCount );
- USHORT nTyp = sal::static_int_cast< USHORT >(
- pDef->GetType() );
- // Zusätzliches Flag für BYVAL einbauen
- if( pDef->IsByVal() )
- nTyp |= 0x8000;
- pParser->aGen.Gen( _ARGTYP, nTyp );
- }
}
}
}
diff --git a/basic/source/comp/exprtree.cxx b/basic/source/comp/exprtree.cxx
index 389b9e49c2..f858c428af 100644
--- a/basic/source/comp/exprtree.cxx
+++ b/basic/source/comp/exprtree.cxx
@@ -338,15 +338,6 @@ SbiExprNode* SbiExpression::Term( const KeywordSymbolInfo* pKeywordSymbolInfo )
// damit erwischen wir n% = 5 : print n
eType = eDefType;
}
- // Funktion?
- if( pDef->GetProcDef() )
- {
- SbiProcDef* pProc = pDef->GetProcDef();
- if( pPar && pProc->GetLib().Len() ) // DECLARE benutzt?
- pPar->SetProc( pProc );
- // Wenn keine Pars, vorerst nichts machen
- // Pruefung auf Typ-Anzahl waere denkbar
- }
// Typcheck bei Variablen:
// ist explizit im Scanner etwas anderes angegeben?
// Bei Methoden ist dies OK!
@@ -868,7 +859,6 @@ SbiExprList::SbiExprList( SbiParser* p )
{
pParser = p;
pFirst = NULL;
- pProc = NULL;
nExpr =
nDim = 0;
bError =
diff --git a/basic/source/comp/makefile.mk b/basic/source/comp/makefile.mk
index bd3c750df3..d65f6a431e 100644
--- a/basic/source/comp/makefile.mk
+++ b/basic/source/comp/makefile.mk
@@ -34,39 +34,26 @@ TARGET=comp
.INCLUDE : settings.mk
-CXXFILES= \
- sbcomp.cxx \
- dim.cxx \
- exprtree.cxx \
- exprnode.cxx \
- exprgen.cxx \
- codegen.cxx \
- io.cxx \
- loops.cxx \
- parser.cxx \
- scanner.cxx \
- token.cxx \
- symtbl.cxx \
- buffer.cxx
-
SLOFILES= \
- $(SLO)$/sbcomp.obj \
+ $(SLO)$/buffer.obj \
+ $(SLO)$/codegen.obj \
$(SLO)$/dim.obj \
- $(SLO)$/exprtree.obj \
- $(SLO)$/exprnode.obj \
$(SLO)$/exprgen.obj \
- $(SLO)$/codegen.obj \
+ $(SLO)$/exprnode.obj \
+ $(SLO)$/exprtree.obj \
$(SLO)$/io.obj \
$(SLO)$/loops.obj \
$(SLO)$/parser.obj \
+ $(SLO)$/sbcomp.obj \
$(SLO)$/scanner.obj \
- $(SLO)$/token.obj \
$(SLO)$/symtbl.obj \
- $(SLO)$/buffer.obj
+ $(SLO)$/token.obj
EXCEPTIONSFILES= \
- $(SLO)$/parser.obj \
- $(SLO)$/exprtree.obj
+ $(SLO)$/codegen.obj \
+ $(SLO)$/dim.obj \
+ $(SLO)$/exprtree.obj \
+ $(SLO)$/parser.obj
# --- Targets --------------------------------------------------------------
diff --git a/basic/source/comp/sbcomp.cxx b/basic/source/comp/sbcomp.cxx
index b1769343bb..f9cd852efc 100755
--- a/basic/source/comp/sbcomp.cxx
+++ b/basic/source/comp/sbcomp.cxx
@@ -261,7 +261,7 @@ void dbg_traceNotifyCall( SbModule* pModule, SbMethod* pMethod, INT32 nCallLvl,
{
aStr.AppendAscii( "Entering " );
}
- String aModuleName = pModule->GetName();
+ String aModuleName = pTraceMod->GetName();
aStr += aModuleName;
if( pMethod != NULL )
{
diff --git a/basic/source/inc/expr.hxx b/basic/source/inc/expr.hxx
index af7302d1e1..96604cbdd9 100644
--- a/basic/source/inc/expr.hxx
+++ b/basic/source/inc/expr.hxx
@@ -234,7 +234,6 @@ class SbiExprList { // Basisklasse fuer Parameter und Dims
protected:
SbiParser* pParser; // Parser
SbiExpression* pFirst; // Expressions
- SbiProcDef* pProc; // DECLARE-Funktion (Parameter-Anpassung)
short nExpr; // Anzahl Expressions
short nDim; // Anzahl Dimensionen
BOOL bError; // TRUE: Fehler
@@ -249,8 +248,6 @@ public:
SbiExpression* Get( short );
BOOL Test( const SbiProcDef& ); // Parameter-Checks
void Gen(); // Code-Erzeugung
- // Setzen einer Funktionsdefinition zum Abgleich der Parameter
- void SetProc( SbiProcDef* p ) { pProc = p; }
void addExpression( SbiExpression* pExpr );
};
diff --git a/basic/source/inc/parser.hxx b/basic/source/inc/parser.hxx
index 4fb7b1886c..d83bc3c68c 100644
--- a/basic/source/inc/parser.hxx
+++ b/basic/source/inc/parser.hxx
@@ -34,7 +34,7 @@
#include <vector>
-typedef ::std::vector< String > IfaceVector;
+typedef ::std::vector< String > StringVector;
struct SbiParseStack;
@@ -81,7 +81,8 @@ public:
BOOL bText; // OPTION COMPARE TEXT
BOOL bExplicit; // TRUE: OPTION EXPLICIT
BOOL bClassModule; // TRUE: OPTION ClassModule
- IfaceVector aIfaceVector; // Holds all interfaces implemented by a class module
+ StringVector aIfaceVector; // Holds all interfaces implemented by a class module
+ StringVector aRequiredTypes; // Types used in Dim As New <type> outside subs
SbxDataType eDefTypes[26]; // DEFxxx-Datentypen
SbiParser( StarBASIC*, SbModule* );
diff --git a/basic/source/inc/sbintern.hxx b/basic/source/inc/sbintern.hxx
index 938315aa12..00621e2c21 100644
--- a/basic/source/inc/sbintern.hxx
+++ b/basic/source/inc/sbintern.hxx
@@ -50,10 +50,16 @@ public:
virtual SbxObject* CreateObject( const String& );
};
+typedef ::std::vector< String > StringVector;
+
struct SbClassData
{
SbxArrayRef mxIfaces;
+ // types this module depends on because of use in Dim As New <type>
+ // needed for initialization order of class modules
+ StringVector maRequiredTypes;
+
SbClassData( void );
~SbClassData( void )
{ clear(); }
diff --git a/basic/source/inc/sbunoobj.hxx b/basic/source/inc/sbunoobj.hxx
index b8993c1e71..f2277e99d0 100644
--- a/basic/source/inc/sbunoobj.hxx
+++ b/basic/source/inc/sbunoobj.hxx
@@ -52,6 +52,7 @@ class SbUnoObject: public SbxObject
::com::sun::star::uno::Reference< ::com::sun::star::beans::XExactName > mxExactName;
::com::sun::star::uno::Reference< ::com::sun::star::beans::XExactName > mxExactNameInvocation;
BOOL bNeedIntrospection;
+ BOOL bIgnoreNativeCOMObjectMembers;
::com::sun::star::uno::Any maTmpUnoObj; // Only to save obj for doIntrospection!
// Hilfs-Methode zum Anlegen der dbg_-Properties
diff --git a/basic/source/inc/symtbl.hxx b/basic/source/inc/symtbl.hxx
index a2a5896943..fd0906e022 100644
--- a/basic/source/inc/symtbl.hxx
+++ b/basic/source/inc/symtbl.hxx
@@ -159,7 +159,8 @@ public:
void SetOptional() { bOpt = TRUE; }
void SetParamArray() { bParamArray = TRUE; }
void SetWithEvents() { bWithEvents = TRUE; }
- void SetByVal() { bByVal = TRUE; }
+ void SetByVal( BOOL bByVal_ = TRUE )
+ { bByVal = bByVal_; }
void SetStatic( BOOL bAsStatic = TRUE ) { bStatic = bAsStatic; }
void SetNew() { bNew = TRUE; }
void SetDefinedAs() { bAs = TRUE; }
diff --git a/basic/source/runtime/methods1.cxx b/basic/source/runtime/methods1.cxx
index 881a1a821b..acf6cb92ba 100644
--- a/basic/source/runtime/methods1.cxx
+++ b/basic/source/runtime/methods1.cxx
@@ -520,11 +520,13 @@ RTLFUNC(DoEvents)
(void)pBasic;
(void)bWrite;
(void)rPar;
- Timer aTimer;
- aTimer.SetTimeout( 1 );
- aTimer.Start();
- while ( aTimer.IsActive() )
- Application::Yield();
+ // Dummy implementation as the following code leads
+ // to performance problems for unknown reasons
+ //Timer aTimer;
+ //aTimer.SetTimeout( 1 );
+ //aTimer.Start();
+ //while ( aTimer.IsActive() )
+ // Application::Reschedule();
}
RTLFUNC(GetGUIVersion)
@@ -1553,8 +1555,6 @@ RTLFUNC(Join)
}
-typedef ::std::vector< String > StringVector;
-
RTLFUNC(Split)
{
(void)pBasic;
diff --git a/basic/source/runtime/step0.cxx b/basic/source/runtime/step0.cxx
index 00f72a1b9c..f5c9d5dce1 100644
--- a/basic/source/runtime/step0.cxx
+++ b/basic/source/runtime/step0.cxx
@@ -424,144 +424,143 @@ void SbiRuntime::StepPUT()
void SbiRuntime::StepSET_Impl( SbxVariableRef& refVal, SbxVariableRef& refVar, bool bHandleDefaultProp )
{
// #67733 Typen mit Array-Flag sind auch ok
- SbxDataType eValType = refVal->GetType();
+
+ // Check var, !object is no error for sure if, only if type is fixed
SbxDataType eVarType = refVar->GetType();
- if( (eValType != SbxOBJECT
- && eValType != SbxEMPTY
-// seems like when using the default method its possible for objects
-// to be empty ( no broadcast has taken place yet ) or the actual value is
-
- && !bHandleDefaultProp
- && !(eValType & SbxARRAY)) ||
- (eVarType != SbxOBJECT
- && eVarType != SbxEMPTY
- && !bHandleDefaultProp
- && !(eVarType & SbxARRAY) ) )
+ if( !bHandleDefaultProp && eVarType != SbxOBJECT && !(eVarType & SbxARRAY) && refVar->IsFixed() )
{
Error( SbERR_INVALID_USAGE_OBJECT );
+ return;
}
- else
+
+ // Check value, !object is no error for sure if, only if type is fixed
+ SbxDataType eValType = refVal->GetType();
+// bool bGetValObject = false;
+ if( !bHandleDefaultProp && eValType != SbxOBJECT && !(eValType & SbxARRAY) && refVal->IsFixed() )
+ {
+ Error( SbERR_INVALID_USAGE_OBJECT );
+ return;
+ }
+
+ // Getting in here causes problems with objects with default properties
+ // if they are SbxEMPTY I guess
+ if ( !bHandleDefaultProp || ( bHandleDefaultProp && eValType == SbxOBJECT ) )
{
- // Getting in here causes problems with objects with default properties
- // if they are SbxEMPTY I guess
- if ( !bHandleDefaultProp || ( bHandleDefaultProp && refVal->GetType() == SbxOBJECT ) )
+ // Auf refVal GetObject fuer Collections ausloesen
+ SbxBase* pObjVarObj = refVal->GetObject();
+ if( pObjVarObj )
{
- // Auf refVal GetObject fuer Collections ausloesen
- SbxBase* pObjVarObj = refVal->GetObject();
- if( pObjVarObj )
- {
- SbxVariableRef refObjVal = PTR_CAST(SbxObject,pObjVarObj);
+ SbxVariableRef refObjVal = PTR_CAST(SbxObject,pObjVarObj);
- // #67733 Typen mit Array-Flag sind auch ok
- if( refObjVal )
- refVal = refObjVal;
- else if( !(eValType & SbxARRAY) )
- refVal = NULL;
- }
+ // #67733 Typen mit Array-Flag sind auch ok
+ if( refObjVal )
+ refVal = refObjVal;
+ else if( !(eValType & SbxARRAY) )
+ refVal = NULL;
}
+ }
- // #52896 Wenn Uno-Sequences bzw. allgemein Arrays einer als
- // Object deklarierten Variable zugewiesen werden, kann hier
- // refVal ungueltig sein!
- if( !refVal )
+ // #52896 Wenn Uno-Sequences bzw. allgemein Arrays einer als
+ // Object deklarierten Variable zugewiesen werden, kann hier
+ // refVal ungueltig sein!
+ if( !refVal )
+ {
+ Error( SbERR_INVALID_USAGE_OBJECT );
+ }
+ else
+ {
+ // Store auf die eigene Methode (innerhalb einer Function)?
+ BOOL bFlagsChanged = FALSE;
+ USHORT n = 0;
+ if( (SbxVariable*) refVar == (SbxVariable*) pMeth )
{
- Error( SbERR_INVALID_USAGE_OBJECT );
+ bFlagsChanged = TRUE;
+ n = refVar->GetFlags();
+ refVar->SetFlag( SBX_WRITE );
}
- else
- {
- // Store auf die eigene Methode (innerhalb einer Function)?
- BOOL bFlagsChanged = FALSE;
- USHORT n = 0;
- if( (SbxVariable*) refVar == (SbxVariable*) pMeth )
- {
- bFlagsChanged = TRUE;
- n = refVar->GetFlags();
- refVar->SetFlag( SBX_WRITE );
- }
- SbProcedureProperty* pProcProperty = PTR_CAST(SbProcedureProperty,(SbxVariable*)refVar);
- if( pProcProperty )
- pProcProperty->setSet( true );
+ SbProcedureProperty* pProcProperty = PTR_CAST(SbProcedureProperty,(SbxVariable*)refVar);
+ if( pProcProperty )
+ pProcProperty->setSet( true );
- if ( bHandleDefaultProp )
+ if ( bHandleDefaultProp )
+ {
+ // get default properties for lhs & rhs where necessary
+ // SbxVariable* defaultProp = NULL; unused variable
+ bool bLHSHasDefaultProp = false;
+ // LHS try determine if a default prop exists
+ if ( refVar->GetType() == SbxOBJECT )
{
- // get default properties for lhs & rhs where necessary
- // SbxVariable* defaultProp = NULL; unused variable
- bool bLHSHasDefaultProp = false;
- // LHS try determine if a default prop exists
- if ( refVar->GetType() == SbxOBJECT )
+ SbxVariable* pDflt = getDefaultProp( refVar );
+ if ( pDflt )
{
- SbxVariable* pDflt = getDefaultProp( refVar );
- if ( pDflt )
- {
- refVar = pDflt;
- bLHSHasDefaultProp = true;
- }
+ refVar = pDflt;
+ bLHSHasDefaultProp = true;
}
- // RHS only get a default prop is the rhs has one
- if ( refVal->GetType() == SbxOBJECT )
- {
- // check if lhs is a null object
- // if it is then use the object not the default property
- SbxObject* pObj = NULL;
-
-
- pObj = PTR_CAST(SbxObject,(SbxVariable*)refVar);
-
- // calling GetObject on a SbxEMPTY variable raises
- // object not set errors, make sure its an Object
- if ( !pObj && refVar->GetType() == SbxOBJECT )
- {
- SbxBase* pObjVarObj = refVar->GetObject();
- pObj = PTR_CAST(SbxObject,pObjVarObj);
- }
- SbxVariable* pDflt = NULL;
- if ( pObj || bLHSHasDefaultProp )
- // lhs is either a valid object || or has a defaultProp
- pDflt = getDefaultProp( refVal );
- if ( pDflt )
- refVal = pDflt;
- }
- }
-
- // Handle withevents
- BOOL bWithEvents = refVar->IsSet( SBX_WITH_EVENTS );
- if ( bWithEvents )
+ }
+ // RHS only get a default prop is the rhs has one
+ if ( refVal->GetType() == SbxOBJECT )
{
- Reference< XInterface > xComListener;
+ // check if lhs is a null object
+ // if it is then use the object not the default property
+ SbxObject* pObj = NULL;
- SbxBase* pObj = refVal->GetObject();
- SbUnoObject* pUnoObj = (pObj != NULL) ? PTR_CAST(SbUnoObject,pObj) : NULL;
- if( pUnoObj != NULL )
- {
- Any aControlAny = pUnoObj->getUnoAny();
- String aDeclareClassName = refVar->GetDeclareClassName();
- ::rtl::OUString aVBAType = aDeclareClassName;
- ::rtl::OUString aPrefix = refVar->GetName();
- SbxObjectRef xScopeObj = refVar->GetParent();
- xComListener = createComListener( aControlAny, aVBAType, aPrefix, xScopeObj );
-
- refVal->SetDeclareClassName( aDeclareClassName );
- refVal->SetComListener( xComListener ); // Hold reference
- }
+
+ pObj = PTR_CAST(SbxObject,(SbxVariable*)refVar);
- *refVar = *refVal;
+ // calling GetObject on a SbxEMPTY variable raises
+ // object not set errors, make sure its an Object
+ if ( !pObj && refVar->GetType() == SbxOBJECT )
+ {
+ SbxBase* pObjVarObj = refVar->GetObject();
+ pObj = PTR_CAST(SbxObject,pObjVarObj);
+ }
+ SbxVariable* pDflt = NULL;
+ if ( pObj || bLHSHasDefaultProp )
+ // lhs is either a valid object || or has a defaultProp
+ pDflt = getDefaultProp( refVal );
+ if ( pDflt )
+ refVal = pDflt;
}
- else
+ }
+
+ // Handle withevents
+ BOOL bWithEvents = refVar->IsSet( SBX_WITH_EVENTS );
+ if ( bWithEvents )
+ {
+ Reference< XInterface > xComListener;
+
+ SbxBase* pObj = refVal->GetObject();
+ SbUnoObject* pUnoObj = (pObj != NULL) ? PTR_CAST(SbUnoObject,pObj) : NULL;
+ if( pUnoObj != NULL )
{
- *refVar = *refVal;
+ Any aControlAny = pUnoObj->getUnoAny();
+ String aDeclareClassName = refVar->GetDeclareClassName();
+ ::rtl::OUString aVBAType = aDeclareClassName;
+ ::rtl::OUString aPrefix = refVar->GetName();
+ SbxObjectRef xScopeObj = refVar->GetParent();
+ xComListener = createComListener( aControlAny, aVBAType, aPrefix, xScopeObj );
+
+ refVal->SetDeclareClassName( aDeclareClassName );
+ refVal->SetComListener( xComListener ); // Hold reference
}
- // lhs is a property who's value is currently (Empty e.g. no broadcast yet)
- // in this case if there is a default prop involved the value of the
- // default property may infact be void so the type will also be SbxEMPTY
- // in this case we do not want to call checkUnoStructCopy 'cause that will
- // cause an error also
- if ( !bHandleDefaultProp || ( bHandleDefaultProp && ( refVar->GetType() != SbxEMPTY ) ) )
- // #67607 Uno-Structs kopieren
- checkUnoStructCopy( refVal, refVar );
- if( bFlagsChanged )
- refVar->SetFlags( n );
+ *refVar = *refVal;
}
+ else
+ {
+ *refVar = *refVal;
+ }
+
+ // lhs is a property who's value is currently (Empty e.g. no broadcast yet)
+ // in this case if there is a default prop involved the value of the
+ // default property may infact be void so the type will also be SbxEMPTY
+ // in this case we do not want to call checkUnoStructCopy 'cause that will
+ // cause an error also
+ if ( !bHandleDefaultProp || ( bHandleDefaultProp && ( refVar->GetType() != SbxEMPTY ) ) )
+ // #67607 Uno-Structs kopieren
+ checkUnoStructCopy( refVal, refVar );
+ if( bFlagsChanged )
+ refVar->SetFlags( n );
}
}
diff --git a/basic/source/sbx/sbxbool.cxx b/basic/source/sbx/sbxbool.cxx
index 38ca84eddf..7551a586b3 100644
--- a/basic/source/sbx/sbxbool.cxx
+++ b/basic/source/sbx/sbxbool.cxx
@@ -87,21 +87,20 @@ enum SbxBOOL ImpGetBool( const SbxValues* p )
case SbxSTRING:
case SbxLPSTR:
nRes = SbxFALSE;
- if( p->pString )
+ if ( p->pOUString )
{
- if( p->pString->EqualsIgnoreCaseAscii( SbxRes( STRING_TRUE ) ) )
+ if( p->pOUString->equalsIgnoreAsciiCase( SbxRes( STRING_TRUE ) ) )
nRes = SbxTRUE;
- else if( !p->pString->EqualsIgnoreCaseAscii( SbxRes( STRING_FALSE ) ) )
+ else if( p->pOUString->equalsIgnoreAsciiCase( SbxRes( STRING_FALSE ) ) )
{
// Jetzt kann es noch in eine Zahl konvertierbar sein
BOOL bError = TRUE;
double n;
SbxDataType t;
USHORT nLen = 0;
- String s( *p->pString );
- if( ImpScan( s, n, t, &nLen ) == SbxERR_OK )
+ if( ImpScan( *p->pOUString, n, t, &nLen ) == SbxERR_OK )
{
- if( nLen == s.Len() )
+ if( nLen == p->pOUString->getLength() )
{
bError = FALSE;
if( n != 0.0 )
@@ -202,9 +201,10 @@ void ImpPutBool( SbxValues* p, INT16 n )
case SbxBYREF | SbxSTRING:
case SbxSTRING:
case SbxLPSTR:
- if( !p->pString )
- p->pString = new XubString;
- *p->pString = SbxRes( n ? STRING_TRUE : STRING_FALSE );
+ if ( !p->pOUString )
+ p->pOUString = new ::rtl::OUString( SbxRes( n ? STRING_TRUE : STRING_FALSE ) );
+ else
+ *p->pOUString = SbxRes( n ? STRING_TRUE : STRING_FALSE );
break;
case SbxOBJECT:
diff --git a/basic/source/sbx/sbxbyte.cxx b/basic/source/sbx/sbxbyte.cxx
index 12ec2fd3c6..b70b82662a 100644
--- a/basic/source/sbx/sbxbyte.cxx
+++ b/basic/source/sbx/sbxbyte.cxx
@@ -165,13 +165,13 @@ start:
case SbxBYREF | SbxSTRING:
case SbxSTRING:
case SbxLPSTR:
- if( !p->pString )
+ if( !p->pOUString )
nRes = 0;
else
{
double d;
SbxDataType t;
- if( ImpScan( *p->pString, d, t, NULL ) != SbxERR_OK )
+ if( ImpScan( *p->pOUString, d, t, NULL ) != SbxERR_OK )
nRes = 0;
else if( d > SbxMAXBYTE )
{
@@ -279,9 +279,9 @@ void ImpPutByte( SbxValues* p, BYTE n )
case SbxBYREF | SbxSTRING:
case SbxSTRING:
case SbxLPSTR:
- if( !p->pString )
- p->pString = new XubString;
- ImpCvtNum( (double) n, 0, *p->pString );
+ if( !p->pOUString )
+ p->pOUString = new ::rtl::OUString;
+ ImpCvtNum( (double) n, 0, *p->pOUString );
break;
case SbxOBJECT:
{
diff --git a/basic/source/sbx/sbxchar.cxx b/basic/source/sbx/sbxchar.cxx
index 9f0bb41ce6..ca52057a7c 100644
--- a/basic/source/sbx/sbxchar.cxx
+++ b/basic/source/sbx/sbxchar.cxx
@@ -39,7 +39,7 @@ using namespace rtl;
xub_Unicode ImpGetChar( const SbxValues* p )
{
SbxValues aTmp;
- xub_Unicode nRes;
+ xub_Unicode nRes = 0;
start:
switch( +p->eType )
{
@@ -156,13 +156,11 @@ start:
case SbxBYREF | SbxSTRING:
case SbxSTRING:
case SbxLPSTR:
- if( !p->pString )
- nRes = 0;
- else
+ if ( p->pOUString )
{
double d;
SbxDataType t;
- if( ImpScan( *p->pString, d, t, NULL ) != SbxERR_OK )
+ if( ImpScan( *p->pOUString, d, t, NULL ) != SbxERR_OK )
nRes = 0;
else if( d > SbxMAXCHAR )
{
@@ -274,9 +272,10 @@ start:
case SbxBYREF | SbxSTRING:
case SbxSTRING:
case SbxLPSTR:
- if( !p->pString )
- p->pString = new XubString;
- *p->pString = n;
+ if ( !p->pOUString )
+ p->pOUString = new ::rtl::OUString( n );
+ else
+ *p->pOUString = ::rtl::OUString( n );
break;
case SbxOBJECT:
{
diff --git a/basic/source/sbx/sbxconv.hxx b/basic/source/sbx/sbxconv.hxx
index 57c42889a0..83e1a8dbc8 100644
--- a/basic/source/sbx/sbxconv.hxx
+++ b/basic/source/sbx/sbxconv.hxx
@@ -33,13 +33,13 @@
class SbxArray;
// SBXSCAN.CXX
-extern void ImpCvtNum( double nNum, short nPrec, String& rRes, BOOL bCoreString=FALSE );
+extern void ImpCvtNum( double nNum, short nPrec, ::rtl::OUString& rRes, BOOL bCoreString=FALSE );
extern SbxError ImpScan
- ( const String& rSrc, double& nVal, SbxDataType& rType, USHORT* pLen,
+ ( const ::rtl::OUString& rSrc, double& nVal, SbxDataType& rType, USHORT* pLen,
BOOL bAllowIntntl=FALSE, BOOL bOnlyIntntl=FALSE );
// mit erweiterter Auswertung (International, "TRUE"/"FALSE")
-extern BOOL ImpConvStringExt( String& rSrc, SbxDataType eTargetType );
+extern BOOL ImpConvStringExt( ::rtl::OUString& rSrc, SbxDataType eTargetType );
// SBXINT.CXX
@@ -116,9 +116,9 @@ void ImpPutDate( SbxValues*, double );
// SBXSTR.CXX
-String ImpGetString( const SbxValues* );
-String ImpGetCoreString( const SbxValues* );
-void ImpPutString( SbxValues*, const String* );
+::rtl::OUString ImpGetString( const SbxValues* );
+::rtl::OUString ImpGetCoreString( const SbxValues* );
+void ImpPutString( SbxValues*, const ::rtl::OUString* );
// SBXCHAR.CXX
@@ -145,7 +145,7 @@ enum SbxBOOL ImpGetBool( const SbxValues* );
void ImpPutBool( SbxValues*, INT16 );
// ByteArry <--> String
-SbxArray* StringToByteArray(const String& rStr);
-String ByteArrayToString(SbxArray* pArr);
+SbxArray* StringToByteArray(const ::rtl::OUString& rStr);
+::rtl::OUString ByteArrayToString(SbxArray* pArr);
#endif
diff --git a/basic/source/sbx/sbxcurr.cxx b/basic/source/sbx/sbxcurr.cxx
index db21871188..9ca7f8e0cd 100644
--- a/basic/source/sbx/sbxcurr.cxx
+++ b/basic/source/sbx/sbxcurr.cxx
@@ -37,8 +37,8 @@
#include <basic/sbxvar.hxx>
#include "sbxconv.hxx"
-static String ImpCurrencyToString( const SbxINT64& );
-static SbxINT64 ImpStringToCurrency( const String& );
+static ::rtl::OUString ImpCurrencyToString( const SbxINT64& );
+static SbxINT64 ImpStringToCurrency( const ::rtl::OUString& );
SbxINT64 ImpGetCurrency( const SbxValues* p )
{
@@ -121,10 +121,10 @@ start:
case SbxBYREF | SbxSTRING:
case SbxSTRING:
case SbxLPSTR:
- if( !p->pString )
+ if( !p->pOUString )
nRes.SetNull();
else
- nRes = ImpStringToCurrency( *p->pString );
+ nRes = ImpStringToCurrency( *p->pOUString );
break;
case SbxOBJECT:
{
@@ -224,10 +224,10 @@ start:
case SbxBYREF | SbxSTRING:
case SbxSTRING:
case SbxLPSTR:
- if( !p->pString )
- p->pString = new XubString;
+ if( !p->pOUString )
+ p->pOUString = new ::rtl::OUString;
- *p->pString = ImpCurrencyToString( r );
+ *p->pOUString = ImpCurrencyToString( r );
break;
case SbxOBJECT:
{
@@ -319,7 +319,7 @@ start:
// Hilfs-Funktionen zur Wandlung
-static String ImpCurrencyToString( const SbxINT64 &r )
+static ::rtl::OUString ImpCurrencyToString( const SbxINT64 &r )
{
BigInt a10000 = 10000;
@@ -331,20 +331,20 @@ static String ImpCurrencyToString( const SbxINT64 &r )
aFrac %= a10000;
aFrac += a10000;
- String aString;
+ ::rtl::OUString aString;
if( r.nHigh < 0 )
- aString = '-';
+ aString = ::rtl::OUString( (sal_Unicode)'-' );
aString += aInt.GetString();
- aString += '.';
+ aString += ::rtl::OUString( (sal_Unicode)'.' );
aString += aFrac.GetString().GetBuffer()+1;
return aString;
}
-static SbxINT64 ImpStringToCurrency( const String &r )
+static SbxINT64 ImpStringToCurrency( const ::rtl::OUString &r )
{
int nDec = 4;
String aStr;
- const sal_Unicode* p = r.GetBuffer();
+ const sal_Unicode* p = r.getStr();
if( *p == '-' )
aStr += *p++;
diff --git a/basic/source/sbx/sbxdate.cxx b/basic/source/sbx/sbxdate.cxx
index f2c299ac25..f1a4c3b6a0 100644
--- a/basic/source/sbx/sbxdate.cxx
+++ b/basic/source/sbx/sbxdate.cxx
@@ -86,7 +86,7 @@ double ImpGetDate( const SbxValues* p )
case SbxBYREF | SbxSTRING:
case SbxSTRING:
case SbxLPSTR:
- if( !p->pString )
+ if( !p->pOUString )
nRes = 0;
else
{
@@ -125,7 +125,7 @@ double ImpGetDate( const SbxValues* p )
pFormatter->PutandConvertEntry( aStr, nCheckPos, nType,
nIndex, LANGUAGE_GERMAN, eLangType );
- BOOL bSuccess = pFormatter->IsNumberFormat( *p->pString, nIndex, nRes );
+ BOOL bSuccess = pFormatter->IsNumberFormat( *p->pOUString, nIndex, nRes );
if ( bSuccess )
{
short nType_ = pFormatter->GetType( nIndex );
@@ -243,8 +243,8 @@ start:
case SbxSTRING:
case SbxLPSTR:
{
- if( !p->pString )
- p->pString = new XubString;
+ if( !p->pOUString )
+ p->pOUString = new ::rtl::OUString;
Color* pColor;
LanguageType eLangType = GetpApp()->GetSettings().GetLanguage();
@@ -294,7 +294,9 @@ start:
nIndex,
LANGUAGE_GERMAN,
eLangType );
- pFormatter->GetOutputString( n, nIndex, *p->pString, &pColor );
+ String aTmpString;
+ pFormatter->GetOutputString( n, nIndex, aTmpString, &pColor );
+ *p->pOUString = aTmpString;
delete pFormatter;
break;
}
diff --git a/basic/source/sbx/sbxdbl.cxx b/basic/source/sbx/sbxdbl.cxx
index 9c28864c0d..c8009245d0 100644
--- a/basic/source/sbx/sbxdbl.cxx
+++ b/basic/source/sbx/sbxdbl.cxx
@@ -76,7 +76,7 @@ double ImpGetDouble( const SbxValues* p )
case SbxBYREF | SbxSTRING:
case SbxSTRING:
case SbxLPSTR:
- if( !p->pString )
+ if( !p->pOUString )
{
nRes = 0;
if ( SbiRuntime::isVBAEnabled() )// VBA only behaviour
@@ -86,7 +86,7 @@ double ImpGetDouble( const SbxValues* p )
{
double d;
SbxDataType t;
- if( ImpScan( *p->pString, d, t, NULL ) != SbxERR_OK )
+ if( ImpScan( *p->pOUString, d, t, NULL ) != SbxERR_OK )
{
nRes = 0;
if ( SbiRuntime::isVBAEnabled() )// VBA only behaviour
@@ -188,9 +188,9 @@ start:
case SbxBYREF | SbxSTRING:
case SbxSTRING:
case SbxLPSTR:
- if( !p->pString )
- p->pString = new XubString;
- ImpCvtNum( (double) n, 14, *p->pString, bCoreString );
+ if( !p->pOUString )
+ p->pOUString = new ::rtl::OUString;
+ ImpCvtNum( (double) n, 14, *p->pOUString, bCoreString );
break;
case SbxOBJECT:
{
diff --git a/basic/source/sbx/sbxdec.cxx b/basic/source/sbx/sbxdec.cxx
index 72c6b14f5b..09fa957041 100644
--- a/basic/source/sbx/sbxdec.cxx
+++ b/basic/source/sbx/sbxdec.cxx
@@ -211,7 +211,7 @@ void SbxDecimal::setUInt( unsigned int val )
// sbxscan.cxx
void ImpGetIntntlSep( sal_Unicode& rcDecimalSep, sal_Unicode& rcThousandSep );
-bool SbxDecimal::setString( String* pString )
+bool SbxDecimal::setString( ::rtl::OUString* pOUString )
{
static LCID nLANGID = MAKELANGID( LANG_ENGLISH, SUBLANG_ENGLISH_US );
@@ -224,11 +224,11 @@ bool SbxDecimal::setString( String* pString )
HRESULT hResult;
if( cDecimalSep != '.' || cThousandSep != ',' )
{
- int nLen = pString->Len();
+ int nLen = pOUString->getLength();
sal_Unicode* pBuffer = new sal_Unicode[nLen + 1];
pBuffer[nLen] = 0;
- const sal_Unicode* pSrc = pString->GetBuffer();
+ const sal_Unicode* pSrc = pOUString->getStr();
int i;
for( i = 0 ; i < nLen ; ++i )
pBuffer[i] = pSrc[i];
@@ -248,7 +248,7 @@ bool SbxDecimal::setString( String* pString )
}
else
{
- hResult = VarDecFromStr( (OLECHAR*)pString->GetBuffer(), nLANGID, 0, &maDec );
+ hResult = VarDecFromStr( (OLECHAR*)pOUString->getStr(), nLANGID, 0, &maDec );
}
bRet = ( hResult == S_OK );
return bRet;
@@ -373,7 +373,7 @@ bool SbxDecimal::setSingle( float val ) { (void)val; return false; }
bool SbxDecimal::setDouble( double val ) { (void)val; return false; }
void SbxDecimal::setInt( int val ) { (void)val; }
void SbxDecimal::setUInt( unsigned int val ) { (void)val; }
-bool SbxDecimal::setString( String* pString ) { (void)pString; return false; }
+bool SbxDecimal::setString( ::rtl::OUString* pOUString ) { (void)pOUString; return false; }
bool SbxDecimal::getChar( sal_Unicode& rVal ) { (void)rVal; return false; }
bool SbxDecimal::getByte( BYTE& rVal ) { (void)rVal; return false; }
@@ -388,7 +388,7 @@ bool SbxDecimal::getUInt( unsigned int& rVal ) { (void)rVal; return false; }
#endif
-bool SbxDecimal::getString( String& rString )
+bool SbxDecimal::getString( ::rtl::OUString& rString )
{
#ifdef WIN32
static LCID nLANGID = MAKELANGID( LANG_ENGLISH, SUBLANG_ENGLISH_US );
@@ -528,7 +528,7 @@ start:
case SbxLPSTR:
case SbxSTRING:
case SbxBYREF | SbxSTRING:
- pnDecRes->setString( p->pString ); break;
+ pnDecRes->setString( p->pOUString ); break;
case SbxOBJECT:
{
SbxValue* pVal = PTR_CAST(SbxValue,p->pObj);
@@ -670,10 +670,10 @@ start:
case SbxLPSTR:
case SbxSTRING:
case SbxBYREF | SbxSTRING:
- if( !p->pString )
- p->pString = new XubString;
+ if( !p->pOUString )
+ p->pOUString = new ::rtl::OUString;
// ImpCvtNum( (double) n, 0, *p->pString );
- pDec->getString( *p->pString );
+ pDec->getString( *p->pOUString );
break;
case SbxOBJECT:
{
diff --git a/basic/source/sbx/sbxdec.hxx b/basic/source/sbx/sbxdec.hxx
index 3fb31e6860..3b623476bf 100644
--- a/basic/source/sbx/sbxdec.hxx
+++ b/basic/source/sbx/sbxdec.hxx
@@ -85,7 +85,7 @@ public:
bool setDouble( double val );
void setInt( int val );
void setUInt( unsigned int val );
- bool setString( String* pString );
+ bool setString( ::rtl::OUString* pOUString );
void setDecimal( SbxDecimal* pDecimal )
{
#ifdef WIN32
@@ -106,7 +106,7 @@ public:
bool getDouble( double& rVal );
bool getInt( int& rVal );
bool getUInt( unsigned int& rVal );
- bool getString( String& rString );
+ bool getString( ::rtl::OUString& rString );
bool operator -= ( const SbxDecimal &r );
bool operator += ( const SbxDecimal &r );
diff --git a/basic/source/sbx/sbxint.cxx b/basic/source/sbx/sbxint.cxx
index f831040a1d..0ed76dfdef 100644
--- a/basic/source/sbx/sbxint.cxx
+++ b/basic/source/sbx/sbxint.cxx
@@ -154,13 +154,13 @@ start:
case SbxLPSTR:
case SbxSTRING:
case SbxBYREF | SbxSTRING:
- if( !p->pString )
+ if( !p->pOUString )
nRes = 0;
else
{
double d;
SbxDataType t;
- if( ImpScan( *p->pString, d, t, NULL ) != SbxERR_OK )
+ if( ImpScan( *p->pOUString, d, t, NULL ) != SbxERR_OK )
nRes = 0;
else if( d > SbxMAXINT )
{
@@ -275,9 +275,9 @@ start:
case SbxLPSTR:
case SbxSTRING:
case SbxBYREF | SbxSTRING:
- if( !p->pString )
- p->pString = new XubString;
- ImpCvtNum( (double) n, 0, *p->pString );
+ if( !p->pOUString )
+ p->pOUString = new ::rtl::OUString;
+ ImpCvtNum( (double) n, 0, *p->pOUString );
break;
case SbxOBJECT:
{
@@ -456,20 +456,19 @@ start:
case SbxBYREF | SbxSTRING:
case SbxSTRING:
case SbxLPSTR:
- if( !p->pString )
+ if( !p->pOUString )
nRes = 0;
else
{
- ::rtl::OUString aOUStr( *p->pString );
::rtl::OString aOStr = ::rtl::OUStringToOString
- ( aOUStr, RTL_TEXTENCODING_ASCII_US );
+ ( *p->pOUString, RTL_TEXTENCODING_ASCII_US );
nRes = aOStr.toInt64();
if( nRes == 0 )
{
// Check if really 0 or invalid conversion
double d;
SbxDataType t;
- if( ImpScan( *p->pString, d, t, NULL ) != SbxERR_OK )
+ if( ImpScan( *p->pOUString, d, t, NULL ) != SbxERR_OK )
nRes = 0;
else
nRes = ImpDoubleToSalInt64( d );
@@ -575,13 +574,12 @@ start:
case SbxSTRING:
case SbxLPSTR:
{
- if( !p->pString )
- p->pString = new XubString;
+ if( !p->pOUString )
+ p->pOUString = new ::rtl::OUString;
::rtl::OString aOStr = ::rtl::OString::valueOf( n );
- ::rtl::OUString aOUStr = ::rtl::OStringToOUString
+ (*p->pOUString) = ::rtl::OStringToOUString
( aOStr, RTL_TEXTENCODING_ASCII_US );
- (*p->pString) = aOUStr;
break;
}
case SbxOBJECT:
@@ -745,20 +743,19 @@ start:
case SbxBYREF | SbxSTRING:
case SbxSTRING:
case SbxLPSTR:
- if( !p->pString )
+ if( !p->pOUString )
nRes = 0;
else
{
- ::rtl::OUString aOUStr( *p->pString );
::rtl::OString aOStr = ::rtl::OUStringToOString
- ( aOUStr, RTL_TEXTENCODING_ASCII_US );
+ ( *p->pOUString, RTL_TEXTENCODING_ASCII_US );
sal_Int64 n64 = aOStr.toInt64();
if( n64 == 0 )
{
// Check if really 0 or invalid conversion
double d;
SbxDataType t;
- if( ImpScan( *p->pString, d, t, NULL ) != SbxERR_OK )
+ if( ImpScan( *p->pOUString, d, t, NULL ) != SbxERR_OK )
nRes = 0;
else if( d > SbxMAXSALUINT64 )
{
@@ -879,16 +876,15 @@ start:
case SbxBYREF | SbxSTRING:
case SbxSTRING:
case SbxLPSTR:
- if( !p->pString )
- p->pString = new XubString;
+ if( !p->pOUString )
+ p->pOUString = new ::rtl::OUString;
if( n > SbxMAXSALINT64 )
SbxBase::SetError( SbxERR_CONVERSION );
else
{
::rtl::OString aOStr = ::rtl::OString::valueOf( (sal_Int64)n );
- ::rtl::OUString aOUStr = ::rtl::OStringToOUString
+ (*p->pOUString) = ::rtl::OStringToOUString
( aOStr, RTL_TEXTENCODING_ASCII_US );
- (*p->pString) = aOUStr;
}
break;
case SbxOBJECT:
diff --git a/basic/source/sbx/sbxlng.cxx b/basic/source/sbx/sbxlng.cxx
index a36fd1fc49..8ef9f5bd86 100644
--- a/basic/source/sbx/sbxlng.cxx
+++ b/basic/source/sbx/sbxlng.cxx
@@ -119,13 +119,13 @@ start:
case SbxBYREF | SbxSTRING:
case SbxSTRING:
case SbxLPSTR:
- if( !p->pString )
+ if( !p->pOUString )
nRes = 0;
else
{
double d;
SbxDataType t;
- if( ImpScan( *p->pString, d, t, NULL ) != SbxERR_OK )
+ if( ImpScan( *p->pOUString, d, t, NULL ) != SbxERR_OK )
nRes = 0;
else if( d > SbxMAXLNG )
{
@@ -240,9 +240,9 @@ start:
case SbxBYREF | SbxSTRING:
case SbxSTRING:
case SbxLPSTR:
- if( !p->pString )
- p->pString = new XubString;
- ImpCvtNum( (double) n, 0, *p->pString );
+ if( !p->pOUString )
+ p->pOUString = new ::rtl::OUString;
+ ImpCvtNum( (double) n, 0, *p->pOUString );
break;
case SbxOBJECT:
{
diff --git a/basic/source/sbx/sbxres.cxx b/basic/source/sbx/sbxres.cxx
index b450bf6faa..40cae63485 100644
--- a/basic/source/sbx/sbxres.cxx
+++ b/basic/source/sbx/sbxres.cxx
@@ -86,6 +86,6 @@ const char* GetSbxRes( USHORT nId )
}
SbxRes::SbxRes( USHORT nId )
- : XubString( String::CreateFromAscii( GetSbxRes( nId ) ) )
+ : ::rtl::OUString( ::rtl::OUString::createFromAscii( GetSbxRes( nId ) ) )
{}
diff --git a/basic/source/sbx/sbxres.hxx b/basic/source/sbx/sbxres.hxx
index 0d4ad5f39e..1685123c5f 100644
--- a/basic/source/sbx/sbxres.hxx
+++ b/basic/source/sbx/sbxres.hxx
@@ -75,7 +75,7 @@
#define SBXRES_MAX 44
-class SbxRes : public String
+class SbxRes : public ::rtl::OUString
{
public:
SbxRes( USHORT );
diff --git a/basic/source/sbx/sbxscan.cxx b/basic/source/sbx/sbxscan.cxx
index f6d6842786..3bf354c41a 100644
--- a/basic/source/sbx/sbxscan.cxx
+++ b/basic/source/sbx/sbxscan.cxx
@@ -71,10 +71,10 @@ void ImpGetIntntlSep( sal_Unicode& rcDecimalSep, sal_Unicode& rcThousandSep )
// Das ganze gibt auch noch einen Konversionsfehler, wenn der Datentyp
// Fixed ist und das ganze nicht hineinpasst!
-SbxError ImpScan( const XubString& rWSrc, double& nVal, SbxDataType& rType,
+SbxError ImpScan( const ::rtl::OUString& rWSrc, double& nVal, SbxDataType& rType,
USHORT* pLen, BOOL bAllowIntntl, BOOL bOnlyIntntl )
{
- ByteString aBStr( rWSrc, RTL_TEXTENCODING_ASCII_US );
+ ::rtl::OString aBStr( ::rtl::OUStringToOString( rWSrc, RTL_TEXTENCODING_ASCII_US ) );
// Bei International Komma besorgen
char cIntntlComma, cIntntl1000;
@@ -100,7 +100,7 @@ SbxError ImpScan( const XubString& rWSrc, double& nVal, SbxDataType& rType,
cIntntl1000 = (char)cThousandSep;
}
- const char* pStart = aBStr.GetBuffer();
+ const char* pStart = aBStr.getStr();
const char* p = pStart;
char buf[ 80 ], *q = buf;
BOOL bRes = TRUE;
@@ -391,7 +391,7 @@ static void myftoa( double nNum, char * pBuf, short nPrec, short nExpWidth,
#pragma warning(disable: 4748) // "... because optimizations are disabled ..."
#endif
-void ImpCvtNum( double nNum, short nPrec, XubString& rRes, BOOL bCoreString )
+void ImpCvtNum( double nNum, short nPrec, ::rtl::OUString& rRes, BOOL bCoreString )
{
char *q;
char cBuf[ 40 ], *p = cBuf;
@@ -415,18 +415,18 @@ void ImpCvtNum( double nNum, short nPrec, XubString& rRes, BOOL bCoreString )
if( *p == cDecimalSep ) p--;
while( *q ) *++p = *q++;
*++p = 0;
- rRes = String::CreateFromAscii( cBuf );
+ rRes = ::rtl::OUString::createFromAscii( cBuf );
}
#ifdef _MSC_VER
#pragma optimize( "", on )
#endif
-BOOL ImpConvStringExt( XubString& rSrc, SbxDataType eTargetType )
+BOOL ImpConvStringExt( ::rtl::OUString& rSrc, SbxDataType eTargetType )
{
// Merken, ob ueberhaupt was geaendert wurde
BOOL bChanged = FALSE;
- String aNewString;
+ ::rtl::OUString aNewString;
// Nur Spezial-Fälle behandeln, als Default tun wir nichts
switch( eTargetType )
@@ -436,7 +436,7 @@ BOOL ImpConvStringExt( XubString& rSrc, SbxDataType eTargetType )
case SbxDOUBLE:
case SbxCURRENCY:
{
- ByteString aBStr( rSrc, RTL_TEXTENCODING_ASCII_US );
+ ::rtl::OString aBStr( ::rtl::OUStringToOString( rSrc, RTL_TEXTENCODING_ASCII_US ) );
// Komma besorgen
sal_Unicode cDecimalSep, cThousandSep;
@@ -446,10 +446,11 @@ BOOL ImpConvStringExt( XubString& rSrc, SbxDataType eTargetType )
// Ersetzen, wenn DecimalSep kein '.' (nur den ersten)
if( cDecimalSep != (sal_Unicode)'.' )
{
- USHORT nPos = aNewString.Search( cDecimalSep );
- if( nPos != STRING_NOTFOUND )
+ sal_Int32 nPos = aNewString.indexOf( cDecimalSep );
+ if( nPos != -1 )
{
- aNewString.SetChar( nPos, '.' );
+ sal_Unicode* pStr = (sal_Unicode*)aNewString.getStr();
+ pStr[nPos] = (sal_Unicode)'.';
bChanged = TRUE;
}
}
@@ -459,15 +460,15 @@ BOOL ImpConvStringExt( XubString& rSrc, SbxDataType eTargetType )
// Bei BOOL TRUE und FALSE als String pruefen
case SbxBOOL:
{
- if( rSrc.EqualsIgnoreCaseAscii( "true" ) )
+ if( rSrc.equalsIgnoreAsciiCaseAscii( "true" ) )
{
- aNewString = String::CreateFromInt32(SbxTRUE);
+ aNewString = ::rtl::OUString::valueOf( (sal_Int32)SbxTRUE );
bChanged = TRUE;
}
else
- if( rSrc.EqualsIgnoreCaseAscii( "false" ) )
+ if( rSrc.equalsIgnoreAsciiCaseAscii( "false" ) )
{
- aNewString = String::CreateFromInt32(SbxFALSE);
+ aNewString = ::rtl::OUString::valueOf( (sal_Int32)SbxFALSE );
bChanged = TRUE;
}
break;
@@ -935,7 +936,11 @@ void SbxValue::Format( XubString& rRes, const XubString* pFmt ) const
//old: printfmtnum( GetDouble(), rRes, *pFmt );
}
else
- ImpCvtNum( GetDouble(), nComma, rRes );
+ {
+ ::rtl::OUString aTmpString( rRes );
+ ImpCvtNum( GetDouble(), nComma, aTmpString );
+ rRes = aTmpString;
+ }
break;
case SbxSTRING:
if( pFmt )
diff --git a/basic/source/sbx/sbxsng.cxx b/basic/source/sbx/sbxsng.cxx
index d3b873b96a..521a8ff04a 100644
--- a/basic/source/sbx/sbxsng.cxx
+++ b/basic/source/sbx/sbxsng.cxx
@@ -112,13 +112,13 @@ start:
case SbxBYREF | SbxSTRING:
case SbxSTRING:
case SbxLPSTR:
- if( !p->pString )
+ if( !p->pOUString )
nRes = 0;
else
{
double d;
SbxDataType t;
- if( ImpScan( *p->pString, d, t, NULL ) != SbxERR_OK )
+ if( ImpScan( *p->pOUString, d, t, NULL ) != SbxERR_OK )
nRes = 0;
else if( d > SbxMAXSNG )
{
@@ -237,9 +237,9 @@ start:
case SbxSTRING:
case SbxLPSTR:
{
- if( !p->pString )
- p->pString = new XubString;
- ImpCvtNum( (double) n, 6, *p->pString );
+ if( !p->pOUString )
+ p->pOUString = new ::rtl::OUString;
+ ImpCvtNum( (double) n, 6, *p->pOUString );
break;
}
case SbxOBJECT:
diff --git a/basic/source/sbx/sbxstr.cxx b/basic/source/sbx/sbxstr.cxx
index 73167aafb2..b4d1c402dd 100644
--- a/basic/source/sbx/sbxstr.cxx
+++ b/basic/source/sbx/sbxstr.cxx
@@ -44,12 +44,12 @@ using namespace rtl;
// Die Konversion eines Items auf String wird ueber die Put-Methoden
// der einzelnen Datentypen abgewickelt, um doppelten Code zu vermeiden.
-XubString ImpGetString( const SbxValues* p )
+::rtl::OUString ImpGetString( const SbxValues* p )
{
SbxValues aTmp;
- XubString aRes;
+ ::rtl::OUString aRes;
aTmp.eType = SbxSTRING;
- aTmp.pString = &aRes;
+ aTmp.pOUString = &aRes;
switch( +p->eType )
{
case SbxNULL:
@@ -86,8 +86,8 @@ XubString ImpGetString( const SbxValues* p )
case SbxBYREF | SbxSTRING:
case SbxSTRING:
case SbxLPSTR:
- if( p->pString )
- aRes = *p->pString;
+ if ( p->pOUString )
+ *aTmp.pOUString = *p->pOUString;
break;
case SbxOBJECT:
{
@@ -109,7 +109,7 @@ XubString ImpGetString( const SbxValues* p )
case SbxERROR:
// Hier wird der String "Error n" erzeugt
aRes = SbxRes( STRING_ERRORMSG );
- aRes += p->nUShort; break;
+ aRes += ::rtl::OUString( p->nUShort ); break;
case SbxDATE:
ImpPutDate( &aTmp, p->nDouble ); break;
@@ -145,7 +145,7 @@ XubString ImpGetString( const SbxValues* p )
}
// AB 10.4.97, neue Funktion fuer SbxValue::GetCoreString()
-XubString ImpGetCoreString( const SbxValues* p )
+::rtl::OUString ImpGetCoreString( const SbxValues* p )
{
// Vorerst nur fuer double
if( ( p->eType & (~SbxBYREF) ) == SbxDOUBLE )
@@ -153,7 +153,6 @@ XubString ImpGetCoreString( const SbxValues* p )
SbxValues aTmp;
XubString aRes;
aTmp.eType = SbxSTRING;
- aTmp.pString = &aRes;
if( p->eType == SbxDOUBLE )
ImpPutDouble( &aTmp, p->nDouble, /*bCoreString=*/TRUE );
else
@@ -164,15 +163,15 @@ XubString ImpGetCoreString( const SbxValues* p )
return ImpGetString( p );
}
-void ImpPutString( SbxValues* p, const XubString* n )
+void ImpPutString( SbxValues* p, const ::rtl::OUString* n )
{
SbxValues aTmp;
aTmp.eType = SbxSTRING;
- XubString* pTmp = NULL;
+ ::rtl::OUString* pTmp = NULL;
// Sicherheitshalber, falls ein NULL-Ptr kommt
if( !n )
- n = pTmp = new XubString;
- aTmp.pString = (XubString*) n;
+ n = pTmp = new ::rtl::OUString;
+ aTmp.pOUString = (::rtl::OUString*)n;
switch( +p->eType )
{
case SbxCHAR:
@@ -209,14 +208,15 @@ void ImpPutString( SbxValues* p, const XubString* n )
case SbxBYREF | SbxSTRING:
case SbxSTRING:
case SbxLPSTR:
- if( n->Len() )
+ if( n->getLength() )
{
- if( !p->pString )
- p->pString = new XubString;
- *p->pString = *n;
+ if( !p->pOUString )
+ p->pOUString = new ::rtl::OUString( *n );
+ else
+ *p->pOUString = *n;
}
else
- delete p->pString, p->pString = NULL;
+ delete p->pOUString, p->pOUString = NULL;
break;
case SbxOBJECT:
{
@@ -258,18 +258,18 @@ void ImpPutString( SbxValues* p, const XubString* n )
}
// Convert string to an array of bytes, preserving unicode (2bytes per character)
-SbxArray* StringToByteArray(const String& rStr)
+SbxArray* StringToByteArray(const ::rtl::OUString& rStr)
{
- USHORT nArraySize = rStr.Len() * 2;
- const sal_Unicode* pSrc = rStr.GetBuffer();
+ sal_Int32 nArraySize = rStr.getLength() * 2;
+ const sal_Unicode* pSrc = rStr.getStr();
SbxDimArray* pArray = new SbxDimArray(SbxBYTE);
bool bIncIndex = ( IsBaseIndexOne() && SbiRuntime::isVBAEnabled() );
if( nArraySize )
{
if( bIncIndex )
- pArray->AddDim( 1, nArraySize );
+ pArray->AddDim32( 1, nArraySize );
else
- pArray->AddDim( 0, nArraySize-1 );
+ pArray->AddDim32( 0, nArraySize-1 );
}
else
{
@@ -290,7 +290,7 @@ SbxArray* StringToByteArray(const String& rStr)
}
// Convert an array of bytes to string (2bytes per character)
-String ByteArrayToString(SbxArray* pArr)
+::rtl::OUString ByteArrayToString(SbxArray* pArr)
{
USHORT nCount = pArr->Count();
OUStringBuffer aStrBuf;
@@ -315,7 +315,5 @@ String ByteArrayToString(SbxArray* pArr)
aStrBuf.append(aChar);
}
- String aStr(aStrBuf.makeStringAndClear());
-
- return aStr;
+ return aStrBuf.makeStringAndClear();
}
diff --git a/basic/source/sbx/sbxuint.cxx b/basic/source/sbx/sbxuint.cxx
index 008677959d..94eca8aa34 100644
--- a/basic/source/sbx/sbxuint.cxx
+++ b/basic/source/sbx/sbxuint.cxx
@@ -151,13 +151,13 @@ start:
case SbxBYREF | SbxSTRING:
case SbxSTRING:
case SbxLPSTR:
- if( !p->pString )
+ if( !p->pOUString )
nRes = 0;
else
{
double d;
SbxDataType t;
- if( ImpScan( *p->pString, d, t, NULL ) != SbxERR_OK )
+ if( ImpScan( *p->pOUString, d, t, NULL ) != SbxERR_OK )
nRes = 0;
else if( d > SbxMAXUINT )
{
@@ -272,9 +272,9 @@ start:
case SbxBYREF | SbxSTRING:
case SbxSTRING:
case SbxLPSTR:
- if( !p->pString )
- p->pString = new XubString;
- ImpCvtNum( (double) n, 0, *p->pString );
+ if( !p->pOUString )
+ p->pOUString = new ::rtl::OUString;
+ ImpCvtNum( (double) n, 0, *p->pOUString );
break;
case SbxOBJECT:
{
diff --git a/basic/source/sbx/sbxulng.cxx b/basic/source/sbx/sbxulng.cxx
index aa9f18f7da..b68358c246 100644
--- a/basic/source/sbx/sbxulng.cxx
+++ b/basic/source/sbx/sbxulng.cxx
@@ -127,13 +127,13 @@ start:
case SbxBYREF | SbxSTRING:
case SbxSTRING:
case SbxLPSTR:
- if( !p->pString )
+ if( !p->pOUString )
nRes = 0;
else
{
double d;
SbxDataType t;
- if( ImpScan( *p->pString, d, t, NULL ) != SbxERR_OK )
+ if( ImpScan( *p->pOUString, d, t, NULL ) != SbxERR_OK )
nRes = 0;
else if( d > SbxMAXULNG )
{
@@ -246,9 +246,9 @@ start:
case SbxBYREF | SbxSTRING:
case SbxSTRING:
case SbxLPSTR:
- if( !p->pString )
- p->pString = new XubString;
- ImpCvtNum( (double) n, 0, *p->pString );
+ if( !p->pOUString )
+ p->pOUString = new ::rtl::OUString;
+ ImpCvtNum( (double) n, 0, *p->pOUString );
break;
case SbxOBJECT:
{
diff --git a/basic/source/sbx/sbxvalue.cxx b/basic/source/sbx/sbxvalue.cxx
index 34ca872679..9cbdeafdb2 100644
--- a/basic/source/sbx/sbxvalue.cxx
+++ b/basic/source/sbx/sbxvalue.cxx
@@ -236,7 +236,7 @@ SbxValue::SbxValue( SbxDataType t, void* p ) : SbxBase()
case SbxSINGLE: n |= SbxBYREF; aData.pSingle = (float*) p; break;
case SbxDATE:
case SbxDOUBLE: n |= SbxBYREF; aData.pDouble = (double*) p; break;
- case SbxSTRING: n |= SbxBYREF; aData.pString = (XubString*) p; break;
+ case SbxSTRING: n |= SbxBYREF; aData.pOUString = (::rtl::OUString*) p; break;
case SbxERROR:
case SbxUSHORT:
case SbxBOOL: n |= SbxBYREF; aData.pUShort = (UINT16*) p; break;
@@ -280,8 +280,8 @@ SbxValue::SbxValue( const SbxValue& r )
switch( aData.eType )
{
case SbxSTRING:
- if( aData.pString )
- aData.pString = new XubString( *aData.pString );
+ if( aData.pOUString )
+ aData.pOUString = new ::rtl::OUString( *aData.pOUString );
break;
case SbxOBJECT:
if( aData.pObj )
@@ -309,7 +309,7 @@ SbxValue& SbxValue::operator=( const SbxValue& r )
&& aData.pObj && ( aData.pObj->GetType() == (SbxARRAY | SbxBYTE) )
&& (r.aData.eType == SbxSTRING) )
{
- String aStr = r.GetString();
+ ::rtl::OUString aStr = r.GetString();
SbxArray* pArr = StringToByteArray(aStr);
PutObject(pArr);
return *this;
@@ -323,7 +323,7 @@ SbxValue& SbxValue::operator=( const SbxValue& r )
SbxArray* pArr = PTR_CAST(SbxArray, pObj);
if( pArr )
{
- String aStr = ByteArrayToString( pArr );
+ ::rtl::OUString aStr = ByteArrayToString( pArr );
PutString(aStr);
return *this;
}
@@ -385,7 +385,7 @@ void SbxValue::Clear()
case SbxVOID:
break;
case SbxSTRING:
- delete aData.pString; aData.pString = NULL;
+ delete aData.pOUString; aData.pOUString = NULL;
break;
case SbxOBJECT:
if( aData.pObj )
@@ -551,9 +551,9 @@ BOOL SbxValue::Get( SbxValues& rRes ) const
case SbxULONG: rRes.nULong = ImpGetULong( &p->aData ); break;
case SbxLPSTR:
case SbxSTRING: p->aPic = ImpGetString( &p->aData );
- rRes.pString = &p->aPic; break;
+ rRes.pOUString = &p->aPic; break;
case SbxCoreSTRING: p->aPic = ImpGetCoreString( &p->aData );
- rRes.pString = &p->aPic; break;
+ rRes.pOUString = &p->aPic; break;
case SbxINT:
#if SAL_TYPES_SIZEOFINT == 2
rRes.nInt = (int) ImpGetInteger( &p->aData );
@@ -618,13 +618,11 @@ const XubString& SbxValue::GetString() const
SbxValues aRes;
aRes.eType = SbxSTRING;
if( Get( aRes ) )
- // Geht in Ordnung, da Ptr eine Kopie ist
- return *aRes.pString;
+ ((SbxValue*) this)->aToolString = *aRes.pOUString;
else
- {
- ((SbxValue*) this)->aPic.Erase();
- return aPic;
- }
+ ((SbxValue*) this)->aToolString.Erase();
+
+ return aToolString;
}
const XubString& SbxValue::GetCoreString() const
@@ -632,13 +630,22 @@ const XubString& SbxValue::GetCoreString() const
SbxValues aRes;
aRes.eType = SbxCoreSTRING;
if( Get( aRes ) )
- // Geht in Ordnung, da Ptr eine Kopie ist
- return *aRes.pString;
+ ((SbxValue*) this)->aToolString = *aRes.pOUString;
else
- {
- ((SbxValue*) this)->aPic.Erase();
- return aPic;
- }
+ ((SbxValue*) this)->aToolString.Erase();
+
+ return aToolString;
+}
+
+::rtl::OUString SbxValue::GetOUString() const
+{
+ ::rtl::OUString aResult;
+ SbxValues aRes;
+ aRes.eType = SbxSTRING;
+ if( Get( aRes ) )
+ aResult = *aRes.pOUString;
+
+ return aResult;
}
BOOL SbxValue::HasObject() const
@@ -727,7 +734,7 @@ BOOL SbxValue::Put( const SbxValues& rVal )
case SbxUSHORT: ImpPutUShort( &p->aData, rVal.nUShort ); break;
case SbxULONG: ImpPutULong( &p->aData, rVal.nULong ); break;
case SbxLPSTR:
- case SbxSTRING: ImpPutString( &p->aData, rVal.pString ); break;
+ case SbxSTRING: ImpPutString( &p->aData, rVal.pOUString ); break;
case SbxINT:
#if SAL_TYPES_SIZEOFINT == 2
ImpPutInteger( &p->aData, (INT16) rVal.nInt );
@@ -803,10 +810,10 @@ BOOL SbxValue::Put( const SbxValues& rVal )
// werden koennen, wenn Floats mit ',' als Dezimaltrenner oder BOOLs
// explizit mit "TRUE" oder "FALSE" angegeben werden.
// Implementierung in ImpConvStringExt (SBXSCAN.CXX)
-BOOL SbxValue::PutStringExt( const XubString& r )
+BOOL SbxValue::PutStringExt( const ::rtl::OUString& r )
{
// Kopieren, bei Unicode gleich konvertieren
- String aStr( r );
+ ::rtl::OUString aStr( r );
// Eigenen Typ bestimmen (nicht wie in Put() mit TheRealValue(),
// Objekte werden sowieso nicht behandelt)
@@ -820,9 +827,9 @@ BOOL SbxValue::PutStringExt( const XubString& r )
// sonst Original (Unicode bleibt erhalten)
BOOL bRet;
if( ImpConvStringExt( aStr, eTargetType ) )
- aRes.pString = (XubString*)&aStr;
+ aRes.pOUString = (::rtl::OUString*)&aStr;
else
- aRes.pString = (XubString*)&r;
+ aRes.pOUString = (::rtl::OUString*)&r;
// #34939: Bei Strings. die eine Zahl enthalten und wenn this einen
// Num-Typ hat, Fixed-Flag setzen, damit der Typ nicht veraendert wird
@@ -851,10 +858,10 @@ BOOL SbxValue::PutStringExt( const XubString& r )
BOOL SbxValue::PutString( const xub_Unicode* p )
{
- XubString aVal( p );
+ ::rtl::OUString aVal( p );
SbxValues aRes;
aRes.eType = SbxSTRING;
- aRes.pString = &aVal;
+ aRes.pOUString = &aVal;
Put( aRes );
return BOOL( !IsError() );
}
@@ -909,19 +916,19 @@ BOOL SbxValue::fillAutomationDecimal
BOOL SbxValue::PutpChar( const xub_Unicode* p )
{
- XubString aVal( p );
+ ::rtl::OUString aVal( p );
SbxValues aRes;
aRes.eType = SbxLPSTR;
- aRes.pString = &aVal;
+ aRes.pOUString = &aVal;
Put( aRes );
return BOOL( !IsError() );
}
-BOOL SbxValue::PutString( const XubString& r )
+BOOL SbxValue::PutString( const ::rtl::OUString& r )
{
SbxValues aRes;
aRes.eType = SbxSTRING;
- aRes.pString = (XubString*) &r;
+ aRes.pOUString = (::rtl::OUString*) &r;
Put( aRes );
return BOOL( !IsError() );
}
@@ -986,14 +993,14 @@ BOOL SbxValue::ImpIsNumeric( BOOL bOnlyIntntl ) const
SbxDataType t = GetType();
if( t == SbxSTRING )
{
- if( aData.pString )
+ if( aData.pOUString )
{
- XubString s( *aData.pString );
+ ::rtl::OUString s( *aData.pOUString );
double n;
SbxDataType t2;
USHORT nLen = 0;
if( ImpScan( s, n, t2, &nLen, /*bAllowIntntl*/FALSE, bOnlyIntntl ) == SbxERR_OK )
- return BOOL( nLen == s.Len() );
+ return BOOL( nLen == s.getLength() );
}
return FALSE;
}
@@ -1046,7 +1053,7 @@ BOOL SbxValue::SetType( SbxDataType t )
switch( aData.eType )
{
case SbxSTRING:
- delete aData.pString;
+ delete aData.pOUString;
break;
case SbxOBJECT:
if( aData.pObj && aData.pObj != this )
@@ -1163,14 +1170,14 @@ BOOL SbxValue::Compute( SbxOperator eOp, const SbxValue& rOp )
Get( aL );
// #30576: Erstmal testen, ob Wandlung geklappt hat
- if( aL.pString != NULL && aR.pString != NULL )
+ if( aL.pOUString != NULL && aR.pOUString != NULL )
{
- *aL.pString += *aR.pString;
+ *aL.pOUString += *aR.pOUString;
}
// Nicht einmal Left OK?
- else if( aL.pString == NULL )
+ else if( aL.pOUString == NULL )
{
- aL.pString = new String();
+ aL.pOUString = new ::rtl::OUString();
}
Put( aL );
}
@@ -1493,17 +1500,17 @@ BOOL SbxValue::Compare( SbxOperator eOp, const SbxValue& rOp ) const
if( Get( aL ) && rOp.Get( aR ) ) switch( eOp )
{
case SbxEQ:
- bRes = BOOL( *aL.pString == *aR.pString ); break;
+ bRes = BOOL( *aL.pOUString == *aR.pOUString ); break;
case SbxNE:
- bRes = BOOL( *aL.pString != *aR.pString ); break;
+ bRes = BOOL( *aL.pOUString != *aR.pOUString ); break;
case SbxLT:
- bRes = BOOL( *aL.pString < *aR.pString ); break;
+ bRes = BOOL( *aL.pOUString < *aR.pOUString ); break;
case SbxGT:
- bRes = BOOL( *aL.pString > *aR.pString ); break;
+ bRes = BOOL( *aL.pOUString > *aR.pOUString ); break;
case SbxLE:
- bRes = BOOL( *aL.pString <= *aR.pString ); break;
+ bRes = BOOL( *aL.pOUString <= *aR.pOUString ); break;
case SbxGE:
- bRes = BOOL( *aL.pString >= *aR.pString ); break;
+ bRes = BOOL( *aL.pOUString >= *aR.pOUString ); break;
default:
SetError( SbxERR_NOTIMP );
}
@@ -1668,9 +1675,9 @@ BOOL SbxValue::LoadData( SvStream& r, USHORT )
XubString aVal;
r.ReadByteString( aVal, RTL_TEXTENCODING_ASCII_US );
if( aVal.Len() )
- aData.pString = new XubString( aVal );
+ aData.pOUString = new ::rtl::OUString( aVal );
else
- aData.pString = NULL; // JSM 22.09.1995
+ aData.pOUString = NULL; // JSM 22.09.1995
break;
}
case SbxERROR:
@@ -1781,9 +1788,9 @@ BOOL SbxValue::StoreData( SvStream& r ) const
break;
}
case SbxSTRING:
- if( aData.pString )
+ if( aData.pOUString )
{
- r.WriteByteString( *aData.pString, RTL_TEXTENCODING_ASCII_US );
+ r.WriteByteString( *aData.pOUString, RTL_TEXTENCODING_ASCII_US );
}
else
{
diff --git a/basic/source/sbx/sbxvar.cxx b/basic/source/sbx/sbxvar.cxx
index 69ae79cad5..4ce6eaf961 100644
--- a/basic/source/sbx/sbxvar.cxx
+++ b/basic/source/sbx/sbxvar.cxx
@@ -239,9 +239,9 @@ const XubString& SbxVariable::GetName( SbxNameType t ) const
if( i )
aTmp += ',';
if( q->nFlags & SBX_OPTIONAL )
- aTmp += SbxRes( STRING_OPTIONAL );
+ aTmp += String( SbxRes( STRING_OPTIONAL ) );
if( q->eType & SbxBYREF )
- aTmp += SbxRes( STRING_BYREF );
+ aTmp += String( SbxRes( STRING_BYREF ) );
aTmp += q->aName;
cType = ' ';
// Kurzer Typ? Dann holen, evtl. ist dieser 0.
@@ -263,12 +263,12 @@ const XubString& SbxVariable::GetName( SbxNameType t ) const
// langer Typ?
if( t != SbxNAME_SHORT )
{
- aTmp += SbxRes( STRING_AS );
+ aTmp += String( SbxRes( STRING_AS ) );
if( nt < 32 )
- aTmp += SbxRes(
- sal::static_int_cast< USHORT >( STRING_TYPES + nt ) );
+ aTmp += String( SbxRes(
+ sal::static_int_cast< USHORT >( STRING_TYPES + nt ) ) );
else
- aTmp += SbxRes( STRING_ANY );
+ aTmp += String( SbxRes( STRING_ANY ) );
}
}
}
@@ -276,15 +276,15 @@ const XubString& SbxVariable::GetName( SbxNameType t ) const
// Langer Typ? Dann holen
if( t == SbxNAME_LONG_TYPES && et != SbxEMPTY )
{
- aTmp += SbxRes( STRING_AS );
+ aTmp += String( SbxRes( STRING_AS ) );
if( et < 32 )
- aTmp += SbxRes(
- sal::static_int_cast< USHORT >( STRING_TYPES + et ) );
+ aTmp += String( SbxRes(
+ sal::static_int_cast< USHORT >( STRING_TYPES + et ) ) );
else
- aTmp += SbxRes( STRING_ANY );
+ aTmp += String( SbxRes( STRING_ANY ) );
}
- ((SbxVariable*) this)->aPic = aTmp;
- return aPic;
+ ((SbxVariable*) this)->aToolString = aTmp;
+ return aToolString;
}
// Einen simplen Hashcode erzeugen: Es werden die ersten 6 Zeichen gewertet.
@@ -431,9 +431,10 @@ BOOL SbxVariable::LoadData( SvStream& rStrm, USHORT nVer )
if( nType == SbxNULL && GetClass() == SbxCLASS_METHOD )
nType = SbxEMPTY;
SbxValues aTmp;
- XubString aVal;
+ String aTmpString;
+ ::rtl::OUString aVal;
aTmp.eType = aData.eType = (SbxDataType) nType;
- aTmp.pString = &aVal;
+ aTmp.pOUString = &aVal;
switch( nType )
{
case SbxBOOL:
@@ -445,10 +446,10 @@ BOOL SbxVariable::LoadData( SvStream& rStrm, USHORT nVer )
case SbxSINGLE:
{
// Floats als ASCII
- rStrm.ReadByteString( aVal, RTL_TEXTENCODING_ASCII_US );
+ rStrm.ReadByteString( aTmpString, RTL_TEXTENCODING_ASCII_US );
double d;
SbxDataType t;
- if( ImpScan( aVal, d, t, NULL ) != SbxERR_OK || t == SbxDOUBLE )
+ if( ImpScan( aTmpString, d, t, NULL ) != SbxERR_OK || t == SbxDOUBLE )
{
aTmp.nSingle = 0;
return FALSE;
@@ -460,9 +461,9 @@ BOOL SbxVariable::LoadData( SvStream& rStrm, USHORT nVer )
case SbxDOUBLE:
{
// Floats als ASCII
- rStrm.ReadByteString( aVal, RTL_TEXTENCODING_ASCII_US );
+ rStrm.ReadByteString( aTmpString, RTL_TEXTENCODING_ASCII_US );
SbxDataType t;
- if( ImpScan( aVal, aTmp.nDouble, t, NULL ) != SbxERR_OK )
+ if( ImpScan( aTmpString, aTmp.nDouble, t, NULL ) != SbxERR_OK )
{
aTmp.nDouble = 0;
return FALSE;
@@ -470,7 +471,8 @@ BOOL SbxVariable::LoadData( SvStream& rStrm, USHORT nVer )
break;
}
case SbxSTRING:
- rStrm.ReadByteString( aVal, RTL_TEXTENCODING_ASCII_US );
+ rStrm.ReadByteString( aTmpString, RTL_TEXTENCODING_ASCII_US );
+ aVal = aTmpString;
break;
case SbxEMPTY:
case SbxNULL: