summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Power <noel.power@novell.com>2010-12-14 18:23:05 +0000
committerNoel Power <noel.power@novell.com>2010-12-14 18:23:05 +0000
commit30c79efc5903edc5bc8994f518c206a608ef3a14 (patch)
tree67b0f881791a21a9ff491deac746db97918dacb3
parentc33c38979462dad9495a020174d53ecd332021bf (diff)
redo stream operators & misc changes to prepare to integrate into master
-rw-r--r--basic/source/classes/sbunoobj.cxx4
-rw-r--r--basic/source/sbx/sbxcurr.cxx7
-rw-r--r--basic/source/sbx/sbxvalue.cxx38
3 files changed, 24 insertions, 25 deletions
diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx
index bab1cd6ff5..c97945515d 100644
--- a/basic/source/classes/sbunoobj.cxx
+++ b/basic/source/classes/sbunoobj.cxx
@@ -1149,10 +1149,6 @@ Any sbxToUnoValueImpl( SbxVariable* pVar, bool bBlockConversionToSmallestType =
aType = ::getCppuType( (sal_Int16*)0 );
else if( d >= -SbxMAXLNG && d <= SbxMAXLNG )
aType = ::getCppuType( (sal_Int32*)0 );
-#if MAYBEFUTURE
- else
- aType = ::getCppuType( (sal_Int64*)0 );
-#endif
}
break;
}
diff --git a/basic/source/sbx/sbxcurr.cxx b/basic/source/sbx/sbxcurr.cxx
index f40e0b09e6..1de0ec4514 100644
--- a/basic/source/sbx/sbxcurr.cxx
+++ b/basic/source/sbx/sbxcurr.cxx
@@ -43,8 +43,9 @@ static rtl::OUString ImpCurrencyToString( const sal_Int64 &rVal )
sal_Int64 absVal = isNeg ? -rVal : rVal;
SvtSysLocale aSysLocale;
- sal_Unicode cDecimalSep = '.', cThousandSep = ',';
+ sal_Unicode cDecimalSep = '.';
#if MAYBEFUTURE
+ sal_Unicode cThousandSep = ',';
const LocaleDataWrapper& rData = aSysLocale.GetLocaleData();
cDecimalSep = rData.getNumDecimalSep().GetBuffer()[0];
cThousandSep = rData.getNumThousandSep().GetBuffer()[0];
@@ -64,11 +65,13 @@ static rtl::OUString ImpCurrencyToString( const sal_Int64 &rVal )
if ( !bLessThanOne )
{
nCapacity = initialLen + 1;
+#if MAYBEFUTURE
if ( initialLen > 5 )
{
sal_Int32 nThouSeperators = ( initialLen - 5 ) / 3;
nCapacity += nThouSeperators;
}
+#endif
}
if ( isNeg )
@@ -85,8 +88,10 @@ static rtl::OUString ImpCurrencyToString( const sal_Int64 &rVal )
{
if ( nDigitCount == 4 )
aBuf.setCharAt( nInsertIndex--, cDecimalSep );
+#if MAYBEFUTURE
if ( nDigitCount > 4 && ! ( ( nDigitCount - 4 ) % 3) )
aBuf.setCharAt( nInsertIndex--, cThousandSep );
+#endif
if ( nDigitCount < initialLen )
aBuf.setCharAt( nInsertIndex--, aAbsStr[ charCpyIndex-- ] );
else
diff --git a/basic/source/sbx/sbxvalue.cxx b/basic/source/sbx/sbxvalue.cxx
index ff30acdb09..690df56e7d 100644
--- a/basic/source/sbx/sbxvalue.cxx
+++ b/basic/source/sbx/sbxvalue.cxx
@@ -1502,6 +1502,8 @@ BOOL SbxValue::Compare( SbxOperator eOp, const SbxValue& rOp ) const
BOOL SbxValue::LoadData( SvStream& r, USHORT )
{
+ // #TODO see if these types are really dumped to any stream
+ // more than likely this is functionality used in the binfilter alone
SbxValue::Clear();
UINT16 nType;
r >> nType;
@@ -1543,21 +1545,20 @@ BOOL SbxValue::LoadData( SvStream& r, USHORT )
break;
}
case SbxSALUINT64:
- {
-// TODO fix write for whole 64 bits was Hi then Lo
- sal_uInt32 tmpHi, tmpLo;
- r >> tmpHi >> tmpLo;
- aData.uInt64 = ((sal_Int64)tmpHi << 32) || (sal_Int64)tmpLo;
- break;
- }
case SbxSALINT64:
+ // Rather ugly use of the union here because we only
+ // have a SvStream& SvStream::operator>>(sal_uInt64&) available to us
+ // There is no SvStream::operator>>(sal_Int64&) due to conflict with
+ // SvStream::operator>>(long&) ( at least on 64 bit linux )
+ r >> aData.uInt64;
+ break;
case SbxCURRENCY:
{
-// TODO fix write for whole 64 bits was Hi then Lo
- sal_Int32 tmpHi;
- sal_uInt32 tmpLo;
+ sal_uInt32 tmpHi = 0;
+ sal_uInt32 tmpLo = 0;
r >> tmpHi >> tmpLo;
- aData.nInt64 = ((sal_Int64)tmpHi << 32) || (sal_Int64)tmpLo;
+ aData.nInt64 = ((sal_Int64)tmpHi << 32);
+ aData.nInt64 |= (sal_Int64)tmpLo;
break;
}
case SbxSTRING:
@@ -1667,18 +1668,15 @@ BOOL SbxValue::StoreData( SvStream& r ) const
r.WriteByteString( GetCoreString(), RTL_TEXTENCODING_ASCII_US );
break;
case SbxSALUINT64:
- {
-// TODO check output from this
- sal_uInt32 tmpHi = (aData.uInt64 >> 32);
- r << tmpHi << (sal_uInt32)(aData.uInt64);
- break;
- }
case SbxSALINT64:
+ // see comment in SbxValue::StoreData
+ r << aData.uInt64;
+ break;
case SbxCURRENCY:
{
-// TODO check output from this
- sal_Int32 tmpHi = (aData.nInt64 >> 32);
- r << tmpHi << (sal_Int32)(aData.nInt64);
+ sal_Int32 tmpHi = ( (aData.nInt64 >> 32) & 0xFFFFFFFF );
+ sal_Int32 tmpLo = ( sal_Int32 )aData.nInt64;
+ r << tmpHi << tmpLo;
break;
}
case SbxSTRING: