diff options
author | Rüdiger Timm <rt@openoffice.org> | 2008-07-02 09:05:05 +0000 |
---|---|---|
committer | Rüdiger Timm <rt@openoffice.org> | 2008-07-02 09:05:05 +0000 |
commit | 409ad4ff01a86b0c820977bb1749efaec856d51d (patch) | |
tree | a557fd92fdbc61c5b848ab0680bba8372c851ddf /basic | |
parent | 23860798f88f52cc718477b4acbd3579a97626b1 (diff) |
INTEGRATION: CWS npower10 (1.10.40); FILE MERGED
2008/05/07 07:10:24 pflin 1.10.40.5: RESYNC: (1.11-1.12); FILE MERGED
2008/02/26 21:59:34 npower 1.10.40.4: RESYNC: (1.10-1.11); FILE MERGED
2008/02/26 04:57:10 pflin 1.10.40.3: Issue number: i85349
Submitted by: jiaojianhua
Reviewed by: npower
2008/01/28 09:42:55 pflin 1.10.40.2: Issue number: i84407
Submitted by: pflin
Reviewed by: npower
Fixed for the convertion between byte array and string
2008/01/07 06:45:49 pflin 1.10.40.1: Issue number: #i84407#
Submitted by: pflin
Reviewed by: npower
Support the conversion between string and byte array
Diffstat (limited to 'basic')
-rw-r--r-- | basic/source/sbx/sbxvalue.cxx | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/basic/source/sbx/sbxvalue.cxx b/basic/source/sbx/sbxvalue.cxx index d0a885322950..a93574577b27 100644 --- a/basic/source/sbx/sbxvalue.cxx +++ b/basic/source/sbx/sbxvalue.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: sbxvalue.cxx,v $ - * $Revision: 1.12 $ + * $Revision: 1.13 $ * * This file is part of OpenOffice.org. * @@ -307,6 +307,30 @@ SbxValue& SbxValue::operator=( const SbxValue& r ) SetError( SbxERR_PROP_READONLY ); else { + // string -> byte array + if( IsFixed() && (aData.eType == SbxOBJECT) + && aData.pObj && ( aData.pObj->GetType() & (SbxARRAY | SbxBYTE) ) + && (r.aData.eType == SbxSTRING) ) + { + String aStr = r.GetString(); + SbxArray* pArr = StringToByteArray(aStr); + PutObject(pArr); + return *this; + } + // byte array -> string + if( r.IsFixed() && (r.aData.eType == SbxOBJECT) + && r.aData.pObj && ( r.aData.pObj->GetType() & (SbxARRAY | SbxBYTE) ) + && (aData.eType == SbxSTRING) ) + { + SbxBase* pObj = r.GetObject(); + SbxArray* pArr = PTR_CAST(SbxArray, pObj); + if( pArr ) + { + String aStr = ByteArrayToString( pArr ); + PutString(aStr); + return *this; + } + } // Den Inhalt der Variablen auslesen SbxValues aNew; if( IsFixed() ) @@ -1434,8 +1458,10 @@ BOOL SbxValue::Compare( SbxOperator eOp, const SbxValue& rOp ) const ResetError(); if( !CanRead() || !rOp.CanRead() ) SetError( SbxERR_PROP_WRITEONLY ); - else if( GetType() == SbxNULL && rOp.GetType() == SbxNULL ) + else if( GetType() == SbxNULL && rOp.GetType() == SbxNULL && !bVBAInterop ) + { bRes = TRUE; + } else if( GetType() == SbxEMPTY && rOp.GetType() == SbxEMPTY ) bRes = TRUE; // Sonderregel 1: Ist ein Operand Null, ist das Ergebnis FALSE |