Index: sc/source/filter/excel/biffdump.cxx
===================================================================
RCS file: /cvs/sc/sc/source/filter/excel/biffdump.cxx,v
retrieving revision 1.89
diff -u -p -r1.89 biffdump.cxx
--- sc/source/filter/excel/biffdump.cxx	3 Jul 2007 15:50:04 -0000	1.89
+++ sc/source/filter/excel/biffdump.cxx	1 Oct 2007 20:00:49 -0000
@@ -140,6 +140,16 @@ inline void lclAppendDec( ByteString& rS
     rStr.Append( ByteString::CreateFromInt32( nData ) );
 }
 
+inline void lclAppendDec( ByteString& rStr, sal_uInt64 nData )
+{
+    rStr.Append( ByteString::CreateFromInt64( nData ) );
+}
+
+inline void lclAppendDec( ByteString& rStr, sal_Int64 nData )
+{
+    rStr.Append( ByteString::CreateFromInt64( nData ) );
+}
+
 inline void lclAppendDec( ByteString& rStr, float fData )
 {
     rStr.Append( ByteString( ::rtl::math::doubleToString( fData, rtl_math_StringFormat_G, 15, '.', true ) ) );
@@ -189,6 +199,17 @@ inline void lclAppendHex( ByteString& rS
     lclAppendHex( rStr, static_cast< sal_uInt32 >( nData ), bPrefix );
 }
 
+void lclAppendHex( ByteString& rStr, sal_uInt64 nData, bool bPrefix = true )
+{
+    lclAppendHex( rStr, static_cast< sal_uInt32 >( nData >> 32 ), bPrefix );
+    lclAppendHex( rStr, static_cast< sal_uInt32 >( nData ), false );
+}
+
+inline void lclAppendHex( ByteString& rStr, sal_Int64 nData, bool bPrefix = true )
+{
+    lclAppendHex( rStr, static_cast< sal_uInt64 >( nData ), bPrefix );
+}
+
 inline void lclAppendHex( ByteString& rStr, double fData, bool bPrefix = true )
 {
     const sal_uInt32* pnData = reinterpret_cast< const sal_uInt32* >( &fData );
@@ -298,6 +319,34 @@ static void __AddHex( ByteString& r, INT
 }
 
 
+static void __AddHex( ByteString& r, UINT64 nVal )
+{
+	r += __pHexPrefix;
+	__AddHexNibble( r, ( UINT8 ) ( nVal >> 60 ) );
+	__AddHexNibble( r, ( UINT8 ) ( nVal >> 56 ) );
+	__AddHexNibble( r, ( UINT8 ) ( nVal >> 52 ) );
+	__AddHexNibble( r, ( UINT8 ) ( nVal >> 48 ) );
+	__AddHexNibble( r, ( UINT8 ) ( nVal >> 44 ) );
+	__AddHexNibble( r, ( UINT8 ) ( nVal >> 40 ) );
+	__AddHexNibble( r, ( UINT8 ) ( nVal >> 36 ) );
+	__AddHexNibble( r, ( UINT8 ) ( nVal >> 32 ) );
+	__AddHexNibble( r, ( UINT8 ) ( nVal >> 28 ) );
+	__AddHexNibble( r, ( UINT8 ) ( nVal >> 24 ) );
+	__AddHexNibble( r, ( UINT8 ) ( nVal >> 20 ) );
+	__AddHexNibble( r, ( UINT8 ) ( nVal >> 16 ) );
+	__AddHexNibble( r, ( UINT8 ) ( nVal >> 12 ) );
+	__AddHexNibble( r, ( UINT8 ) ( nVal >> 8 ) );
+	__AddHexNibble( r, ( UINT8 ) ( nVal >> 4 ) );
+	__AddHexNibble( r, ( UINT8 ) nVal );
+}
+
+
+static void __AddHex( ByteString& r, INT64 nVal )
+{
+	__AddHex( r, (UINT64) nVal );
+}
+
+
 static void __AddPureBinNibble( ByteString& r, UINT8 nVal )
 {
 	nVal <<= 4;
@@ -339,6 +388,14 @@ static void __AddPureBin( ByteString& r,
 }
 
 
+inline static void __AddDec( ByteString& r, UINT64 n )
+{
+    // FIXME: need "%llu" for ILP32 platforms, "%lu" for LP64 platforms,
+    // and I have no idea for Win32.
+    __AddDec( r, static_cast<UINT32>(n) );
+}
+
+
 inline static void __AddDec( ByteString& r, UINT32 n )
 {
 	sal_Char	p[ 32 ];
@@ -367,6 +424,14 @@ inline static void __AddDec( ByteString&
 }
 
 
+inline static void __AddDec( ByteString& r, INT64 n )
+{
+    // FIXME: need "%lld" for ILP32 platforms, "%ld" for LP64 platforms,
+    // and I have no idea for Win32.
+    __AddDec( r, static_cast<INT32>(n) );
+}
+
+
 inline static void __AddDec( ByteString& r, INT16 n )
 {
 	__AddDec( r, ( INT32 ) n );
@@ -1063,8 +1128,8 @@ UINT16 Biff8RecDumper::DumpXF( XclImpStr
     ADDTEXT( "diag-line=" );        __AddDec( t, nTmp );
     ::extract_value( nTmp, nBorder2, 14, 7 );
     ADDTEXT( " color=" );           __AddDec( t, nTmp );
-    ADDTEXT( "   diag-tl-to-br=" ); lcl_AddOnOff( t, ::get_flag( nBorder1, 0x40000000UL ) );
-    ADDTEXT( "   diag-bl-to-tr=" ); lcl_AddOnOff( t, ::get_flag( nBorder1, 0x80000000UL ) );
+    ADDTEXT( "   diag-tl-to-br=" ); lcl_AddOnOff( t, ::get_flag( nBorder1, 0x40000000U ) );
+    ADDTEXT( "   diag-bl-to-tr=" ); lcl_AddOnOff( t, ::get_flag( nBorder1, 0x80000000U ) );
     PRINT();
     LINESTART();
     ::extract_value( nTmp, nBorder2, 26, 6 );
@@ -9820,7 +9885,7 @@ BOOL Biff8RecDumper::Dump( XclImpStream&
             SvFileStream aBook( String::CreateFromAscii( aBookOutName.GetBuffer() ), STREAM_WRITE|STREAM_SHARE_DENYWRITE|STREAM_TRUNC );
             if( aBook.IsOpen() )
             {
-                const sal_uInt32 nBufLen = 0xFFFF;
+                const sal_Size nBufLen = 0xFFFF;
                 sal_uInt8 pBuffer[ nBufLen ];
                 r.StoreGlobalPosition();
                 while( r.StartNextRecord() )
