diff options
26 files changed, 948 insertions, 637 deletions
diff --git a/sc/source/filter/excel/excform.cxx b/sc/source/filter/excel/excform.cxx index 630997a7d06f..79c33732b23e 100644 --- a/sc/source/filter/excel/excform.cxx +++ b/sc/source/filter/excel/excform.cxx @@ -54,22 +54,21 @@ void ImportExcel::Formula25() if( GetBiff() == EXC_BIFF2 ) {// BIFF2 - sal_uInt8 nDummy; - aIn.Ignore( 3 ); - aIn >> fCurVal; + fCurVal = aIn.ReadDouble(); aIn.Ignore( 1 ); - aIn >> nDummy; - nFormLen = nDummy; + nFormLen = aIn.ReaduInt8(); bShrFmla = false; } else {// BIFF5 - aIn >> nXF >> fCurVal >> nFlag0; + nXF = aIn.ReaduInt16(); + fCurVal = aIn.ReadDouble(); + nFlag0 = aIn.ReaduInt8(); aIn.Ignore( 5 ); - aIn >> nFormLen; + nFormLen = aIn.ReaduInt16(); bShrFmla = nFlag0 & 0x08; // shared or not shared } @@ -89,9 +88,12 @@ void ImportExcel::Formula4() double fCurVal; sal_uInt8 nFlag0; - aIn >> aXclPos >> nXF >> fCurVal >> nFlag0; + aIn >> aXclPos; + nXF = aIn.ReaduInt16(); + fCurVal = aIn.ReadDouble(); + nFlag0 = aIn.ReaduInt8(); aIn.Ignore( 1 ); - aIn >> nFormLen; + nFormLen = aIn.ReaduInt16(); Formula( aXclPos, nXF, nFormLen, fCurVal, false ); } @@ -241,7 +243,7 @@ ConvErr ExcelToSc::Convert( const ScTokenArray*& pErgebnis, XclImpStream& aIn, s while( (aIn.GetRecPos() < nEndPos) && !bError ) { - aIn >> nOp; + nOp = aIn.ReaduInt8(); // always reset flags aSRD.InitFlags(); @@ -370,7 +372,7 @@ ConvErr ExcelToSc::Convert( const ScTokenArray*& pErgebnis, XclImpStream& aIn, s GetTracer().TraceFormulaMissingArg(); break; case 0x17: // String Constant [314 266] - aIn >> nLen; + nLen = aIn.ReaduInt8(); aString = aIn.ReadRawByteString( nLen ); aStack << aPool.Store( aString ); @@ -380,7 +382,7 @@ ConvErr ExcelToSc::Convert( const ScTokenArray*& pErgebnis, XclImpStream& aIn, s sal_uInt16 nData(0), nFakt(0); sal_uInt8 nOpt(0); - aIn >> nOpt; + nOpt = aIn.ReaduInt8(); if( meBiff == EXC_BIFF2 ) { @@ -389,7 +391,7 @@ ConvErr ExcelToSc::Convert( const ScTokenArray*& pErgebnis, XclImpStream& aIn, s } else { - aIn >> nData; + nData = aIn.ReaduInt16(); nFakt = 2; } @@ -431,7 +433,7 @@ ConvErr ExcelToSc::Convert( const ScTokenArray*& pErgebnis, XclImpStream& aIn, s break; case 0x1C: // Error Value [314 266] { - aIn >> nByte; + nByte = aIn.ReaduInt8(); DefTokenId eOc; switch( nByte ) { @@ -451,7 +453,7 @@ ConvErr ExcelToSc::Convert( const ScTokenArray*& pErgebnis, XclImpStream& aIn, s } break; case 0x1D: // Boolean [315 266] - aIn >> nByte; + nByte = aIn.ReaduInt8(); if( nByte == 0 ) aPool << ocFalse << ocOpen << ocClose; else @@ -459,17 +461,18 @@ ConvErr ExcelToSc::Convert( const ScTokenArray*& pErgebnis, XclImpStream& aIn, s aPool >> aStack; break; case 0x1E: // Integer [315 266] - aIn >> nUINT16; + nUINT16 = aIn.ReaduInt16(); aStack << aPool.Store( ( double ) nUINT16 ); break; case 0x1F: // Number [315 266] - aIn >> fDouble; + fDouble = aIn.ReadDouble(); aStack << aPool.Store( fDouble ); break; case 0x40: case 0x60: case 0x20: // Array Constant [317 268] - aIn >> nByte >> nUINT16; + nByte = aIn.ReaduInt8(); + nUINT16 = aIn.ReaduInt16(); aIn.Ignore( (meBiff == EXC_BIFF2) ? 3 : 4 ); if( bAllowArrays ) { @@ -490,7 +493,7 @@ ConvErr ExcelToSc::Convert( const ScTokenArray*& pErgebnis, XclImpStream& aIn, s if( meBiff <= EXC_BIFF3 ) nXclFunc = aIn.ReaduInt8(); else - aIn >> nXclFunc; + nXclFunc = aIn.ReaduInt16(); if( const XclFunctionInfo* pFuncInfo = maFuncProv.GetFuncInfoFromXclFunc( nXclFunc ) ) DoMulArgs( pFuncInfo->meOpCode, pFuncInfo->mnMaxParamCount ); else @@ -503,12 +506,12 @@ ConvErr ExcelToSc::Convert( const ScTokenArray*& pErgebnis, XclImpStream& aIn, s { sal_uInt16 nXclFunc; sal_uInt8 nParamCount; - aIn >> nParamCount; + nParamCount = aIn.ReaduInt8(); nParamCount &= 0x7F; if( meBiff <= EXC_BIFF3 ) nXclFunc = aIn.ReaduInt8(); else - aIn >> nXclFunc; + nXclFunc = aIn.ReaduInt16(); if( const XclFunctionInfo* pFuncInfo = maFuncProv.GetFuncInfoFromXclFunc( nXclFunc ) ) DoMulArgs( pFuncInfo->meOpCode, nParamCount ); else @@ -519,7 +522,7 @@ ConvErr ExcelToSc::Convert( const ScTokenArray*& pErgebnis, XclImpStream& aIn, s case 0x63: case 0x23: // Name [318 269] { - aIn >> nUINT16; + nUINT16 = aIn.ReaduInt16(); switch( meBiff ) { case EXC_BIFF2: aIn.Ignore( 5 ); break; @@ -543,7 +546,8 @@ ConvErr ExcelToSc::Convert( const ScTokenArray*& pErgebnis, XclImpStream& aIn, s case 0x4A: case 0x6A: case 0x2A: // Deleted Cell Reference [323 273] - aIn >> nUINT16 >> nByte; + nUINT16 = aIn.ReaduInt16(); + nByte = aIn.ReaduInt8(); aSRD.SetAbsCol(static_cast<SCsCOL>(nByte)); aSRD.SetAbsRow(nUINT16 & 0x3FFF); aSRD.SetRelTab(0); @@ -575,7 +579,10 @@ ConvErr ExcelToSc::Convert( const ScTokenArray*& pErgebnis, XclImpStream& aIn, s ScSingleRefData& rSRef1 = aCRD.Ref1; ScSingleRefData& rSRef2 = aCRD.Ref2; - aIn >> nRowFirst >> nRowLast >> nColFirst >> nColLast; + nRowFirst = aIn.ReaduInt16(); + nRowLast = aIn.ReaduInt16(); + nColFirst = aIn.ReaduInt8(); + nColLast = aIn.ReaduInt8(); rSRef1.SetRelTab(0); rSRef2.SetRelTab(0); @@ -624,7 +631,8 @@ ConvErr ExcelToSc::Convert( const ScTokenArray*& pErgebnis, XclImpStream& aIn, s case 0x2C: // Cell Reference Within a Name [323 ] // Cell Reference Within a Shared Formula[ 273] { - aIn >> nUINT16 >> nByte; // >> Attribute, Row >> Col + nUINT16 = aIn.ReaduInt16(); + nByte = aIn.ReaduInt8(); // >> Attribute, Row >> Col aSRD.SetRelTab(0); aSRD.SetFlag3D( bRangeName ); @@ -646,7 +654,10 @@ ConvErr ExcelToSc::Convert( const ScTokenArray*& pErgebnis, XclImpStream& aIn, s aCRD.Ref1.SetFlag3D( bRangeName ); aCRD.Ref2.SetFlag3D( bRangeName ); - aIn >> nRowFirst >> nRowLast >> nColFirst >> nColLast; + nRowFirst = aIn.ReaduInt16(); + nRowLast = aIn.ReaduInt16(); + nColFirst = aIn.ReaduInt8(); + nColLast = aIn.ReaduInt8( ); ExcRelToScRel( nRowFirst, nColFirst, aCRD.Ref1, bRNorSF ); ExcRelToScRel( nRowLast, nColLast, aCRD.Ref2, bRNorSF ); @@ -674,18 +685,18 @@ ConvErr ExcelToSc::Convert( const ScTokenArray*& pErgebnis, XclImpStream& aIn, s case 0x78: case 0x38: // Command-Equivalent Function [333 ] aString = "COMM_EQU_FUNC"; - aIn >> nByte; + nByte = aIn.ReaduInt8(); aString += OUString::number( nByte ); - aIn >> nByte; + nByte = aIn.ReaduInt8(); aStack << aPool.Store( aString ); DoMulArgs( ocPush, nByte + 1 ); break; case 0x59: case 0x79: case 0x39: // Name or External Name [ 275] - aIn >> nINT16; + nINT16 = aIn.ReadInt16(); aIn.Ignore( 8 ); - aIn >> nUINT16; + nUINT16 = aIn.ReaduInt16(); if( nINT16 >= 0 ) { const ExtName* pExtName = rR.pExtNameBuff->GetNameByIndex( nINT16, nUINT16 ); @@ -724,9 +735,12 @@ ConvErr ExcelToSc::Convert( const ScTokenArray*& pErgebnis, XclImpStream& aIn, s sal_Int16 nExtSheet; sal_uInt8 nCol; - aIn >> nExtSheet; + nExtSheet = aIn.ReadInt16(); aIn.Ignore( 8 ); - aIn >> nTabFirst >> nTabLast >> nRow >> nCol; + nTabFirst = aIn.ReaduInt16(); + nTabLast = aIn.ReaduInt16(); + nRow = aIn.ReaduInt16(); + nCol = aIn.ReaduInt8(); if( nExtSheet >= 0 ) { // from external @@ -786,10 +800,14 @@ ConvErr ExcelToSc::Convert( const ScTokenArray*& pErgebnis, XclImpStream& aIn, s sal_Int16 nExtSheet; sal_uInt8 nColFirst, nColLast; - aIn >> nExtSheet; + nExtSheet = aIn.ReadInt16(); aIn.Ignore( 8 ); - aIn >> nTabFirst >> nTabLast >> nRowFirst >> nRowLast - >> nColFirst >> nColLast; + nTabFirst = aIn.ReaduInt16(); + nTabLast = aIn.ReaduInt16(); + nRowFirst = aIn.ReaduInt16(); + nRowLast = aIn.ReaduInt16(); + nColFirst = aIn.ReaduInt8(); + nColLast = aIn.ReaduInt8(); if( nExtSheet >= 0 ) // von extern @@ -925,7 +943,7 @@ ConvErr ExcelToSc::Convert( _ScRangeListTabs& rRangeList, XclImpStream& aIn, sal while( (aIn.GetRecPos() < nEndPos) && !bError ) { - aIn >> nOp; + nOp = aIn.ReaduInt8(); nIgnore = 0; // always reset flags @@ -963,7 +981,7 @@ ConvErr ExcelToSc::Convert( _ScRangeListTabs& rRangeList, XclImpStream& aIn, sal case 0x16: // Missing Argument [314 266] break; case 0x17: // String Constant [314 266] - aIn >> nLen; + nLen = aIn.ReaduInt8(); nIgnore = nLen; break; case 0x19: // Special Attribute [327 279] @@ -971,7 +989,7 @@ ConvErr ExcelToSc::Convert( _ScRangeListTabs& rRangeList, XclImpStream& aIn, sal sal_uInt16 nData(0), nFakt(0); sal_uInt8 nOpt(0); - aIn >> nOpt; + nOpt = aIn.ReaduInt8(); if( meBiff == EXC_BIFF2 ) { @@ -980,7 +998,7 @@ ConvErr ExcelToSc::Convert( _ScRangeListTabs& rRangeList, XclImpStream& aIn, sal } else { - aIn >> nData; + nData = aIn.ReaduInt16(); nFakt = 2; } @@ -1054,7 +1072,8 @@ ConvErr ExcelToSc::Convert( _ScRangeListTabs& rRangeList, XclImpStream& aIn, sal case 0x44: case 0x64: case 0x24: // Cell Reference [319 270] - aIn >> nUINT16 >> nByte; + nUINT16 = aIn.ReaduInt16(); + nByte = aIn.ReaduInt8(); aSRD.SetAbsCol(static_cast<SCsCOL>(nByte)); aSRD.SetAbsRow(nUINT16 & 0x3FFF); aSRD.SetRelTab(0); @@ -1073,7 +1092,10 @@ ConvErr ExcelToSc::Convert( _ScRangeListTabs& rRangeList, XclImpStream& aIn, sal ScSingleRefData &rSRef1 = aCRD.Ref1; ScSingleRefData &rSRef2 = aCRD.Ref2; - aIn >> nRowFirst >> nRowLast >> nColFirst >> nColLast; + nRowFirst = aIn.ReaduInt16(); + nRowLast = aIn.ReaduInt16(); + nColFirst = aIn.ReaduInt8(); + nColLast = aIn.ReaduInt8(); rSRef1.SetRelTab(0); rSRef2.SetRelTab(0); @@ -1117,7 +1139,8 @@ ConvErr ExcelToSc::Convert( _ScRangeListTabs& rRangeList, XclImpStream& aIn, sal case 0x2C: // Cell Reference Within a Name [323 ] // Cell Reference Within a Shared Formula[ 273] { - aIn >> nUINT16 >> nByte; // >> Attribute, Row >> Col + nUINT16 = aIn.ReaduInt16(); + nByte = aIn.ReaduInt8(); // >> Attribute, Row >> Col aSRD.SetRelTab(0); aSRD.SetFlag3D( bRangeName ); @@ -1139,7 +1162,10 @@ ConvErr ExcelToSc::Convert( _ScRangeListTabs& rRangeList, XclImpStream& aIn, sal aCRD.Ref1.SetFlag3D( bRangeName ); aCRD.Ref2.SetFlag3D( bRangeName ); - aIn >> nRowFirst >> nRowLast >> nColFirst >> nColLast; + nRowFirst = aIn.ReaduInt16(); + nRowLast = aIn.ReaduInt16(); + nColFirst = aIn.ReaduInt8(); + nColLast = aIn.ReaduInt8(); ExcRelToScRel( nRowFirst, nColFirst, aCRD.Ref1, bRNorSF ); ExcRelToScRel( nRowLast, nColLast, aCRD.Ref2, bRNorSF ); @@ -1181,9 +1207,12 @@ ConvErr ExcelToSc::Convert( _ScRangeListTabs& rRangeList, XclImpStream& aIn, sal sal_Int16 nExtSheet; sal_uInt8 nCol; - aIn >> nExtSheet; + nExtSheet = aIn.ReadInt16(); aIn.Ignore( 8 ); - aIn >> nTabFirst >> nTabLast >> nRow >> nCol; + nTabFirst = aIn.ReaduInt16(); + nTabLast = aIn.ReaduInt16(); + nRow = aIn.ReaduInt16(); + nCol = aIn.ReaduInt8(); if( nExtSheet >= 0 ) // from external @@ -1232,10 +1261,14 @@ ConvErr ExcelToSc::Convert( _ScRangeListTabs& rRangeList, XclImpStream& aIn, sal sal_Int16 nExtSheet; sal_uInt8 nColFirst, nColLast; - aIn >> nExtSheet; + nExtSheet = aIn.ReadInt16(); aIn.Ignore( 8 ); - aIn >> nTabFirst >> nTabLast >> nRowFirst >> nRowLast - >> nColFirst >> nColLast; + nTabFirst = aIn.ReaduInt16(); + nTabLast = aIn.ReaduInt16(); + nRowFirst = aIn.ReaduInt16(); + nRowLast = aIn.ReaduInt16(); + nColFirst = aIn.ReaduInt8(); + nColLast = aIn.ReaduInt8(); if( nExtSheet >= 0 ) // from external @@ -1333,7 +1366,7 @@ bool ExcelToSc::GetAbsRefs( ScRangeList& rRangeList, XclImpStream& rStrm, sal_Si while( rStrm.IsValid() && (rStrm.GetRecPos() < nEndPos) ) { - rStrm >> nOp; + nOp = rStrm.ReaduInt8(); nSeek = 0; switch( nOp ) @@ -1345,7 +1378,8 @@ bool ExcelToSc::GetAbsRefs( ScRangeList& rRangeList, XclImpStream& rStrm, sal_Si case 0x6C: case 0x2C: // Cell Reference Within a Name [323 ] // Cell Reference Within a Shared Formula[ 273] - rStrm >> nRow1 >> nCol1; + nRow1 = rStrm.ReaduInt16(); + nCol1 = rStrm.ReaduInt8(); nRow2 = nRow1; nCol2 = nCol1; @@ -1358,16 +1392,22 @@ bool ExcelToSc::GetAbsRefs( ScRangeList& rRangeList, XclImpStream& rStrm, sal_Si case 0x6D: case 0x2D: // Area Reference Within a Name [324 ] // Area Reference Within a Shared Formula[ 274] - rStrm >> nRow1 >> nRow2 >> nCol1 >> nCol2; + nRow1 = rStrm.ReaduInt16(); + nRow2 = rStrm.ReaduInt16(); + nCol1 = rStrm.ReaduInt8(); + nCol2 = rStrm.ReaduInt8(); nTab1 = nTab2 = GetCurrScTab(); goto _common; case 0x5A: case 0x7A: case 0x3A: // 3-D Cell Reference [ 275] - rStrm >> nRefIdx; + nRefIdx = rStrm.ReadInt16(); rStrm.Ignore( 8 ); - rStrm >> nTabFirst >> nTabLast >> nRow1 >> nCol1; + nTabFirst = rStrm.ReaduInt16(); + nTabLast = rStrm.ReaduInt16(); + nRow1 = rStrm.ReaduInt16(); + nCol1 = rStrm.ReaduInt8(); nRow2 = nRow1; nCol2 = nCol1; @@ -1376,9 +1416,14 @@ bool ExcelToSc::GetAbsRefs( ScRangeList& rRangeList, XclImpStream& rStrm, sal_Si case 0x5B: case 0x7B: case 0x3B: // 3-D Area Reference [ 276] - rStrm >> nRefIdx; + nRefIdx = rStrm.ReadInt16(); rStrm.Ignore( 8 ); - rStrm >> nTabFirst >> nTabLast >> nRow1 >> nRow2 >> nCol1 >> nCol2; + nTabFirst = rStrm.ReaduInt16(); + nTabLast = rStrm.ReaduInt16(); + nRow1 = rStrm.ReaduInt16(); + nRow2 = rStrm.ReaduInt16(); + nCol1 = rStrm.ReaduInt8(); + nCol2 = rStrm.ReaduInt8(); _3d_common: nTab1 = static_cast< SCTAB >( nTabFirst ); @@ -1505,7 +1550,8 @@ bool ExcelToSc::GetAbsRefs( ScRangeList& rRangeList, XclImpStream& rStrm, sal_Si { sal_uInt8 nOpt; sal_uInt16 nData; - rStrm >> nOpt >> nData; + nOpt = rStrm.ReaduInt8(); + nData = rStrm.ReaduInt16(); if( nOpt & 0x04 ) nSeek = nData * 2 + 2; } @@ -1696,7 +1742,7 @@ bool ExcelToSc::ReadSharedFormulaPosition( XclImpStream& rStrm, SCCOL& rCol, SCR rStrm.PushPosition(); sal_uInt8 nOp; - rStrm >> nOp; + nOp = rStrm.ReaduInt8(); if (nOp != 0x01) // must be PtgExp token. { @@ -1705,7 +1751,8 @@ bool ExcelToSc::ReadSharedFormulaPosition( XclImpStream& rStrm, SCCOL& rCol, SCR } sal_uInt16 nRow, nCol; - rStrm >> nRow >> nCol; + nRow = rStrm.ReaduInt16(); + nCol = rStrm.ReaduInt16(); rStrm.PopPosition(); rCol = nCol; rRow = nRow; @@ -1759,7 +1806,8 @@ void ExcelToSc::ReadExtensionArray( unsigned int n, XclImpStream& aIn ) OUString aString; ScMatrix* pMatrix; - aIn >> nByte >> nUINT16; + nByte = aIn.ReaduInt8(); + nUINT16 = aIn.ReaduInt16(); SCSIZE nC, nCols; SCSIZE nR, nRows; @@ -1806,7 +1854,7 @@ void ExcelToSc::ReadExtensionArray( unsigned int n, XclImpStream& aIn ) { for( nC = 0 ; nC < nCols; nC++ ) { - aIn >> nByte; + nByte = aIn.ReaduInt8(); switch( nByte ) { case EXC_CACHEDVAL_EMPTY: @@ -1818,7 +1866,7 @@ void ExcelToSc::ReadExtensionArray( unsigned int n, XclImpStream& aIn ) break; case EXC_CACHEDVAL_DOUBLE: - aIn >> fDouble; + fDouble = aIn.ReadDouble(); if( NULL != pMatrix ) { pMatrix->PutDouble( fDouble, nC, nR ); @@ -1828,12 +1876,12 @@ void ExcelToSc::ReadExtensionArray( unsigned int n, XclImpStream& aIn ) case EXC_CACHEDVAL_STRING: if( GetBiff() == EXC_BIFF8 ) { - aIn >> nUINT16; + nUINT16 = aIn.ReaduInt16(); aString = aIn.ReadUniString( nUINT16 ); } else { - aIn >> nByte; + nByte = aIn.ReaduInt8(); aString = aIn.ReadRawByteString( nByte ); } if( NULL != pMatrix ) @@ -1843,7 +1891,7 @@ void ExcelToSc::ReadExtensionArray( unsigned int n, XclImpStream& aIn ) break; case EXC_CACHEDVAL_BOOL: - aIn >> nByte; + nByte = aIn.ReaduInt8(); aIn.Ignore( 7 ); if( NULL != pMatrix ) { @@ -1852,7 +1900,7 @@ void ExcelToSc::ReadExtensionArray( unsigned int n, XclImpStream& aIn ) break; case EXC_CACHEDVAL_ERROR: - aIn >> nByte; + nByte = aIn.ReaduInt8(); aIn.Ignore( 7 ); if( NULL != pMatrix ) { @@ -1867,7 +1915,7 @@ void ExcelToSc::ReadExtensionArray( unsigned int n, XclImpStream& aIn ) void ExcelToSc::ReadExtensionNlr( XclImpStream& aIn ) { sal_uInt32 nFlags; - aIn >> nFlags; + nFlags = aIn.ReaduInt32(); sal_uInt32 nCount = nFlags & EXC_TOK_NLR_ADDMASK; aIn.Ignore( nCount * 4 ); // Drop the cell positions @@ -1876,7 +1924,7 @@ void ExcelToSc::ReadExtensionNlr( XclImpStream& aIn ) void ExcelToSc::ReadExtensionMemArea( XclImpStream& aIn ) { sal_uInt16 nCount(0); - aIn >> nCount; + nCount = aIn.ReaduInt16(); aIn.Ignore( static_cast<sal_Size>(nCount) * ((GetBiff() == EXC_BIFF8) ? 8 : 6) ); // drop the ranges } diff --git a/sc/source/filter/excel/excform8.cxx b/sc/source/filter/excel/excform8.cxx index a4f3bf634e94..e9d4e2cbc9ca 100644 --- a/sc/source/filter/excel/excform8.cxx +++ b/sc/source/filter/excel/excform8.cxx @@ -171,7 +171,7 @@ ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn, while( (aIn.GetRecPos() < nEndPos) && !bError ) { - aIn >> nOp; + nOp = aIn.ReaduInt8(); // always reset flags aSRD.InitFlags(); @@ -295,7 +295,7 @@ ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn, GetTracer().TraceFormulaMissingArg(); break; case 0x17: // String Constant [314 266] - aIn >> nLen; // und? + nLen = aIn.ReaduInt8(); // und? aString = aIn.ReadUniString( nLen ); // reads Grbit even if nLen==0 aStack << aPool.Store( aString ); @@ -304,7 +304,7 @@ ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn, { sal_uInt8 nEptg; sal_uInt16 nCol, nRow; - aIn >> nEptg; + nEptg = aIn.ReaduInt8(); switch( nEptg ) { // name size ext type case 0x01: // Lel 4 - err @@ -317,7 +317,8 @@ ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn, case 0x06: // RwV 4 - val case 0x07: // ColV 4 - val { - aIn >> nRow >> nCol; + nRow = aIn.ReaduInt16(); + nCol = aIn.ReaduInt16(); ScAddress aAddr(static_cast<SCCOL>(nCol & 0xFF), static_cast<SCROW>(nRow), aEingPos.Tab()); aSRD.InitAddress(aAddr); @@ -333,7 +334,8 @@ ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn, break; case 0x0A: // Radical 13 - ref { - aIn >> nRow >> nCol; + nRow = aIn.ReaduInt16(); + nCol = aIn.ReaduInt16(); aIn.Ignore( 9 ); ScAddress aAddr(static_cast<SCCOL>(nCol & 0xFF), static_cast<SCROW>(nRow), aEingPos.Tab()); aSRD.InitAddress(aAddr); @@ -375,7 +377,8 @@ ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn, sal_uInt16 nData(0), nFakt(0); sal_uInt8 nOpt(0); - aIn >> nOpt >> nData; + nOpt = aIn.ReaduInt8(); + nData = aIn.ReaduInt16(); nFakt = 2; if( nOpt & 0x04 ) @@ -390,7 +393,7 @@ ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn, break; case 0x1C: // Error Value [314 266] { - aIn >> nByte; + nByte = aIn.ReaduInt8(); DefTokenId eOc; switch( nByte ) @@ -411,7 +414,7 @@ ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn, } break; case 0x1D: // Boolean [315 266] - aIn >> nByte; + nByte = aIn.ReaduInt8(); if( nByte == 0 ) aPool << ocFalse << ocOpen << ocClose; else @@ -419,17 +422,18 @@ ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn, aPool >> aStack; break; case 0x1E: // Integer [315 266] - aIn >> nUINT16; + nUINT16 = aIn.ReaduInt16(); aStack << aPool.Store( ( double ) nUINT16 ); break; case 0x1F: // Number [315 266] - aIn >> fDouble; + fDouble = aIn.ReadDouble(); aStack << aPool.Store( fDouble ); break; case 0x40: case 0x60: case 0x20: // Array Constant [317 268] - aIn >> nByte >> nUINT16; + nByte = aIn.ReaduInt8(); + nUINT16 = aIn.ReaduInt16(); aIn.Ignore( 4 ); if( bAllowArrays ) { @@ -447,7 +451,7 @@ ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn, case 0x21: // Function, Fixed Number of Arguments [333 282] { sal_uInt16 nXclFunc; - aIn >> nXclFunc; + nXclFunc = aIn.ReaduInt16(); if( const XclFunctionInfo* pFuncInfo = maFuncProv.GetFuncInfoFromXclFunc( nXclFunc ) ) DoMulArgs( pFuncInfo->meOpCode, pFuncInfo->mnMaxParamCount ); else @@ -460,7 +464,8 @@ ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn, { sal_uInt16 nXclFunc; sal_uInt8 nParamCount; - aIn >> nParamCount >> nXclFunc; + nParamCount = aIn.ReaduInt8(); + nXclFunc = aIn.ReaduInt16(); nParamCount &= 0x7F; if( const XclFunctionInfo* pFuncInfo = maFuncProv.GetFuncInfoFromXclFunc( nXclFunc ) ) DoMulArgs( pFuncInfo->meOpCode, nParamCount ); @@ -472,7 +477,7 @@ ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn, case 0x63: case 0x23: // Name [318 269] { - aIn >> nUINT16; + nUINT16 = aIn.ReaduInt16(); aIn.Ignore( 2 ); const XclImpName* pName = GetNameManager().GetName( nUINT16 ); if (pName) @@ -494,7 +499,8 @@ ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn, { sal_uInt16 nCol, nRow; - aIn >> nRow >> nCol; + nRow = aIn.ReaduInt16(); + nCol = aIn.ReaduInt16(); aSRD.SetRelTab(0); aSRD.SetFlag3D( bRangeName && !bCondFormat ); @@ -526,7 +532,10 @@ ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn, ScSingleRefData &rSRef1 = aCRD.Ref1; ScSingleRefData &rSRef2 = aCRD.Ref2; - aIn >> nRowFirst >> nRowLast >> nColFirst >> nColLast; + nRowFirst = aIn.ReaduInt16(); + nRowLast = aIn.ReaduInt16(); + nColFirst = aIn.ReaduInt16(); + nColLast = aIn.ReaduInt16(); rSRef1.SetRelTab(0); rSRef2.SetRelTab(0); @@ -584,7 +593,8 @@ ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn, { sal_uInt16 nRow, nCol; - aIn >> nRow >> nCol; + nRow = aIn.ReaduInt16(); + nCol = aIn.ReaduInt16(); aSRD.SetRelTab(0); aSRD.SetFlag3D( bRangeName ); @@ -606,7 +616,10 @@ ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn, aCRD.Ref1.SetFlag3D( bRangeName ); aCRD.Ref2.SetFlag3D( bRangeName ); - aIn >> nRowFirst >> nRowLast >> nColFirst >> nColLast; + nRowFirst = aIn.ReaduInt16(); + nRowLast = aIn.ReaduInt16(); + nColFirst = aIn.ReaduInt16(); + nColLast = aIn.ReaduInt16(); ExcRelToScRel8( nRowFirst, nColFirst, aCRD.Ref1, bRNorSF ); ExcRelToScRel8( nRowLast, nColLast, aCRD.Ref2, bRNorSF ); @@ -633,9 +646,9 @@ ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn, case 0x78: case 0x38: // Command-Equivalent Function [333 ] aString = "COMM_EQU_FUNC"; - aIn >> nByte; + nByte = aIn.ReaduInt8(); aString += OUString::number( nByte ); - aIn >> nByte; + nByte = aIn.ReaduInt8(); aStack << aPool.Store( aString ); DoMulArgs( ocPush, nByte + 1 ); break; @@ -644,7 +657,8 @@ ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn, case 0x39: // Name or External Name [ 275] { sal_uInt16 nXtiIndex, nNameIdx; - aIn >> nXtiIndex >> nNameIdx; + nXtiIndex = aIn.ReaduInt16(); + nNameIdx = aIn.ReaduInt16(); aIn.Ignore( 2 ); if( rLinkMan.IsSelfRef( nXtiIndex ) ) @@ -758,7 +772,9 @@ ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn, sal_uInt16 nIxti, nRw, nGrbitCol; SCTAB nTabFirst, nTabLast; - aIn >> nIxti >> nRw >> nGrbitCol; + nIxti = aIn.ReaduInt16(); + nRw = aIn.ReaduInt16(); + nGrbitCol = aIn.ReaduInt16(); ExternalTabInfo aExtInfo; if (!Read3DTabReference(nIxti, nTabFirst, nTabLast, aExtInfo)) @@ -826,7 +842,11 @@ ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn, { sal_uInt16 nIxti, nRw1, nGrbitCol1, nRw2, nGrbitCol2; SCTAB nTabFirst, nTabLast; - aIn >> nIxti >> nRw1 >> nRw2 >> nGrbitCol1 >> nGrbitCol2; + nIxti = aIn.ReaduInt16(); + nRw1 = aIn.ReaduInt16(); + nRw2 = aIn.ReaduInt16(); + nGrbitCol1 = aIn.ReaduInt16(); + nGrbitCol2 = aIn.ReaduInt16(); ExternalTabInfo aExtInfo; if (!Read3DTabReference(nIxti, nTabFirst, nTabLast, aExtInfo)) @@ -947,7 +967,7 @@ ConvErr ExcelToSc8::Convert( _ScRangeListTabs& rRangeList, XclImpStream& aIn, sa while( (aIn.GetRecPos() < nEndPos) && !bError ) { - aIn >> nOp; + nOp = aIn.ReaduInt8(); // always reset flags aSRD.InitFlags(); @@ -984,7 +1004,7 @@ ConvErr ExcelToSc8::Convert( _ScRangeListTabs& rRangeList, XclImpStream& aIn, sa case 0x16: // Missing Argument [314 266] break; case 0x17: // String Constant [314 266] - aIn >> nLen; // und? + nLen = aIn.ReaduInt8(); // und? aIn.IgnoreUniString( nLen ); // reads Grbit even if nLen==0 break; @@ -993,7 +1013,8 @@ ConvErr ExcelToSc8::Convert( _ScRangeListTabs& rRangeList, XclImpStream& aIn, sa sal_uInt16 nData(0), nFakt(0); sal_uInt8 nOpt(0); - aIn >> nOpt >> nData; + nOpt = aIn.ReaduInt8(); + nData = aIn.ReaduInt16(); nFakt = 2; if( nOpt & 0x04 ) @@ -1040,7 +1061,8 @@ ConvErr ExcelToSc8::Convert( _ScRangeListTabs& rRangeList, XclImpStream& aIn, sa { sal_uInt16 nCol, nRow; - aIn >> nRow >> nCol; + nRow = aIn.ReaduInt16(); + nCol = aIn.ReaduInt16(); aSRD.SetRelTab(0); aSRD.SetFlag3D( bRangeName && !bCondFormat ); @@ -1059,7 +1081,10 @@ ConvErr ExcelToSc8::Convert( _ScRangeListTabs& rRangeList, XclImpStream& aIn, sa ScSingleRefData &rSRef1 = aCRD.Ref1; ScSingleRefData &rSRef2 = aCRD.Ref2; - aIn >> nRowFirst >> nRowLast >> nColFirst >> nColLast; + nRowFirst = aIn.ReaduInt16(); + nRowLast = aIn.ReaduInt16(); + nColFirst = aIn.ReaduInt16(); + nColLast = aIn.ReaduInt16(); rSRef1.SetRelTab(0); rSRef2.SetRelTab(0); @@ -1110,7 +1135,8 @@ ConvErr ExcelToSc8::Convert( _ScRangeListTabs& rRangeList, XclImpStream& aIn, sa { sal_uInt16 nRow, nCol; - aIn >> nRow >> nCol; + nRow = aIn.ReaduInt16(); + nCol = aIn.ReaduInt16(); aSRD.SetRelTab(0); aSRD.SetFlag3D( bRangeName ); @@ -1132,7 +1158,10 @@ ConvErr ExcelToSc8::Convert( _ScRangeListTabs& rRangeList, XclImpStream& aIn, sa aCRD.Ref1.SetFlag3D( bRangeName ); aCRD.Ref2.SetFlag3D( bRangeName ); - aIn >> nRowFirst >> nRowLast >> nColFirst >> nColLast; + nRowFirst = aIn.ReaduInt16(); + nRowLast = aIn.ReaduInt16(); + nColFirst = aIn.ReaduInt16( ); + nColLast = aIn.ReaduInt16(); ExcRelToScRel8( nRowFirst, nColFirst, aCRD.Ref1, bRNorSF ); ExcRelToScRel8( nRowLast, nColLast, aCRD.Ref2, bRNorSF ); @@ -1167,7 +1196,9 @@ ConvErr ExcelToSc8::Convert( _ScRangeListTabs& rRangeList, XclImpStream& aIn, sa { sal_uInt16 nIxti, nRw, nGrbitCol; - aIn >> nIxti >> nRw >> nGrbitCol; + nIxti = aIn.ReaduInt16(); + nRw = aIn.ReaduInt16(); + nGrbitCol = aIn.ReaduInt16(); SCTAB nFirstScTab, nLastScTab; if( rLinkMan.GetScTabRange( nFirstScTab, nLastScTab, nIxti ) ) @@ -1195,7 +1226,11 @@ ConvErr ExcelToSc8::Convert( _ScRangeListTabs& rRangeList, XclImpStream& aIn, sa { sal_uInt16 nIxti, nRw1, nGrbitCol1, nRw2, nGrbitCol2; - aIn >> nIxti >> nRw1 >> nRw2 >> nGrbitCol1 >> nGrbitCol2; + nIxti = aIn.ReaduInt16(); + nRw1 = aIn.ReaduInt16(); + nRw2 = aIn.ReaduInt16(); + nGrbitCol1 = aIn.ReaduInt16(); + nGrbitCol2 = aIn.ReaduInt16(); SCTAB nFirstScTab, nLastScTab; if( rLinkMan.GetScTabRange( nFirstScTab, nLastScTab, nIxti ) ) @@ -1287,7 +1322,7 @@ ConvErr ExcelToSc8::ConvertExternName( const ScTokenArray*& rpArray, XclImpStrea while( (rStrm.GetRecPos() < nEndPos) && !bError ) { - rStrm >> nOp; + nOp = rStrm.ReaduInt8(); // always reset flags aSRD.InitFlags(); @@ -1297,7 +1332,7 @@ ConvErr ExcelToSc8::ConvertExternName( const ScTokenArray*& rpArray, XclImpStrea { case 0x1C: // Error Value { - rStrm >> nByte; + nByte = rStrm.ReaduInt8(); DefTokenId eOc; switch( nByte ) { @@ -1320,7 +1355,10 @@ ConvErr ExcelToSc8::ConvertExternName( const ScTokenArray*& rpArray, XclImpStrea { // cell reference in external range name sal_uInt16 nExtTab1, nExtTab2, nRow, nGrbitCol; - rStrm >> nExtTab1 >> nExtTab2 >> nRow >> nGrbitCol; + nExtTab1 = rStrm.ReaduInt16(); + nExtTab2 = rStrm.ReaduInt16(); + nRow = rStrm.ReaduInt16(); + nGrbitCol = rStrm.ReaduInt16(); if (nExtTab1 >= nTabCount || nExtTab2 >= nTabCount) { bError = true; @@ -1350,7 +1388,12 @@ ConvErr ExcelToSc8::ConvertExternName( const ScTokenArray*& rpArray, XclImpStrea { // area reference sal_uInt16 nExtTab1, nExtTab2, nRow1, nRow2, nGrbitCol1, nGrbitCol2; - rStrm >> nExtTab1 >> nExtTab2 >> nRow1 >> nRow2 >> nGrbitCol1 >> nGrbitCol2; + nExtTab1 = rStrm.ReaduInt16(); + nExtTab2 = rStrm.ReaduInt16(); + nRow1 = rStrm.ReaduInt16(); + nRow2 = rStrm.ReaduInt16(); + nGrbitCol1 = rStrm.ReaduInt16(); + nGrbitCol2 = rStrm.ReaduInt16(); ScSingleRefData& rR1 = aCRD.Ref1; ScSingleRefData& rR2 = aCRD.Ref2; @@ -1448,7 +1491,7 @@ bool ExcelToSc8::GetAbsRefs( ScRangeList& r, XclImpStream& aIn, sal_Size nLen ) while( aIn.IsValid() && (aIn.GetRecPos() < nEndPos) ) { - aIn >> nOp; + nOp = aIn.ReaduInt8(); nSeek = 0; switch( nOp ) @@ -1460,7 +1503,8 @@ bool ExcelToSc8::GetAbsRefs( ScRangeList& r, XclImpStream& aIn, sal_Size nLen ) case 0x6C: case 0x2C: // Cell Reference Within a Name [323 ] // Cell Reference Within a Shared Formula[ 273] - aIn >> nRow1 >> nCol1; + nRow1 = aIn.ReaduInt16(); + nCol1 = aIn.ReaduInt16(); nRow2 = nRow1; nCol2 = nCol1; @@ -1473,14 +1517,19 @@ bool ExcelToSc8::GetAbsRefs( ScRangeList& r, XclImpStream& aIn, sal_Size nLen ) case 0x6D: case 0x2D: // Area Reference Within a Name [324 ] // Area Reference Within a Shared Formula[ 274] - aIn >> nRow1 >> nRow2 >> nCol1 >> nCol2; + nRow1 = aIn.ReaduInt16(); + nRow2 = aIn.ReaduInt16(); + nCol1 = aIn.ReaduInt16(); + nCol2 = aIn.ReaduInt16(); nTab1 = nTab2 = GetCurrScTab(); goto _common; case 0x5A: case 0x7A: case 0x3A: // 3-D Cell Reference [ 275] - aIn >> nIxti >> nRow1 >> nCol1; + nIxti = aIn.ReaduInt16(); + nRow1 = aIn.ReaduInt16(); + nCol1 = aIn.ReaduInt16(); nRow2 = nRow1; nCol2 = nCol1; @@ -1489,7 +1538,11 @@ bool ExcelToSc8::GetAbsRefs( ScRangeList& r, XclImpStream& aIn, sal_Size nLen ) case 0x5B: case 0x7B: case 0x3B: // 3-D Area Reference [ 276] - aIn >> nIxti >> nRow1 >> nRow2 >> nCol1 >> nCol2; + nIxti = aIn.ReaduInt16(); + nRow1 = aIn.ReaduInt16(); + nRow2 = aIn.ReaduInt16(); + nCol1 = aIn.ReaduInt16(); + nCol2 = aIn.ReaduInt16(); _3d_common: // skip references to deleted sheets @@ -1580,7 +1633,7 @@ bool ExcelToSc8::GetAbsRefs( ScRangeList& r, XclImpStream& aIn, sal_Size nLen ) case 0x17: // String Constant [314 266] { sal_uInt8 nStrLen; - aIn >> nStrLen; + nStrLen = aIn.ReaduInt8(); aIn.IgnoreUniString( nStrLen ); // reads Grbit even if nLen==0 nSeek = 0; } @@ -1589,7 +1642,8 @@ bool ExcelToSc8::GetAbsRefs( ScRangeList& r, XclImpStream& aIn, sal_Size nLen ) { sal_uInt16 nData; sal_uInt8 nOpt; - aIn >> nOpt >> nData; + nOpt = aIn.ReaduInt8(); + nData = aIn.ReaduInt16(); if( nOpt & 0x04 ) {// nFakt -> skip bytes or words AttrChoose nData++; diff --git a/sc/source/filter/excel/excimp8.cxx b/sc/source/filter/excel/excimp8.cxx index 3f6317fccd99..55d4f1f0454a 100644 --- a/sc/source/filter/excel/excimp8.cxx +++ b/sc/source/filter/excel/excimp8.cxx @@ -251,7 +251,8 @@ void ImportExcel8::Boundsheet( void ) aIn.DisableDecryption(); maSheetOffsets.push_back( aIn.ReaduInt32() ); aIn.EnableDecryption(); - aIn >> nGrbit >> nLen; + nGrbit = aIn.ReaduInt16(); + nLen = aIn.ReaduInt8(); OUString aName( aIn.ReadUniString( nLen ) ); GetTabInfo().AppendXclTabName( aName, nBdshtTab ); @@ -280,7 +281,7 @@ void ImportExcel8::Scenman( void ) sal_uInt16 nLastDispl; aIn.Ignore( 4 ); - aIn >> nLastDispl; + nLastDispl = aIn.ReaduInt16(); maScenList.nLastScenario = nLastDispl; } @@ -296,7 +297,9 @@ void ImportExcel8::Labelsst( void ) sal_uInt16 nXF; sal_uInt32 nSst; - aIn >> aXclPos >> nXF >> nSst; + aIn >> aXclPos; + nXF = aIn.ReaduInt16(); + nSst = aIn.ReaduInt32( ); ScAddress aScPos( ScAddress::UNINITIALIZED ); if( GetAddressConverter().ConvertAddress( aScPos, aXclPos, GetCurrScTab(), true ) ) @@ -613,7 +616,8 @@ void XclImpAutoFilterData::ReadAutoFilter( XclImpStream& rStrm, svl::SharedStringPool& rPool ) { sal_uInt16 nCol, nFlags; - rStrm >> nCol >> nFlags; + nCol = rStrm.ReaduInt16(); + nFlags = rStrm.ReaduInt16(); ScQueryConnect eConn = ::get_flagvalue( nFlags, EXC_AFFLAG_ANDORMASK, SC_OR, SC_AND ); bool bSimple1 = ::get_flag(nFlags, EXC_AFFLAG_SIMPLE1); @@ -654,7 +658,8 @@ void XclImpAutoFilterData::ReadAutoFilter( ScQueryEntry::Item& rItem = rEntry.GetQueryItem(); bIgnore = false; - rStrm >> nType >> nOper; + nType = rStrm.ReaduInt8(); + nOper = rStrm.ReaduInt8(); switch( nOper ) { case EXC_AFOPER_LESS: @@ -682,23 +687,24 @@ void XclImpAutoFilterData::ReadAutoFilter( switch( nType ) { case EXC_AFTYPE_RK: - rStrm >> nRK; + nRK = rStrm.ReadInt32(); rStrm.Ignore( 4 ); rItem.maString = rPool.intern( CreateFromDouble(XclTools::GetDoubleFromRK(nRK))); break; case EXC_AFTYPE_DOUBLE: - rStrm >> fVal; + fVal = rStrm.ReadDouble(); rItem.maString = rPool.intern(CreateFromDouble(fVal)); break; case EXC_AFTYPE_STRING: rStrm.Ignore( 4 ); - rStrm >> nStrLen[ nE ]; + nStrLen[ nE ] = rStrm.ReaduInt8(); rStrm.Ignore( 3 ); rItem.maString = svl::SharedString(); break; case EXC_AFTYPE_BOOLERR: - rStrm >> nBoolErr >> nVal; + nBoolErr = rStrm.ReaduInt8(); + nVal = rStrm.ReaduInt8(); rStrm.Ignore( 6 ); rItem.maString = rPool.intern(OUString::number(nVal)); bIgnore = (nBoolErr != 0); diff --git a/sc/source/filter/excel/exctools.cxx b/sc/source/filter/excel/exctools.cxx index cf6d867a853c..53df97379afe 100644 --- a/sc/source/filter/excel/exctools.cxx +++ b/sc/source/filter/excel/exctools.cxx @@ -180,10 +180,11 @@ ExcScenario::ExcScenario( XclImpStream& rIn, const RootData& rR ) sal_uInt16 nCref; sal_uInt8 nName, nComment; - rIn >> nCref; - rIn >> nProtected; + nCref = rIn.ReaduInt16(); + nProtected = rIn.ReaduInt8(); rIn.Ignore( 1 ); // Hide - rIn >> nName >> nComment; + nName = rIn.ReaduInt8(); + nComment = rIn.ReaduInt8(); rIn.Ignore( 1 ); // statt nUser! if( nName ) @@ -205,7 +206,8 @@ ExcScenario::ExcScenario( XclImpStream& rIn, const RootData& rR ) sal_uInt16 nC, nR; while( n ) { - rIn >> nR >> nC; + nR = rIn.ReaduInt16(); + nC = rIn.ReaduInt16(); aEntries.push_back(new ExcScenarioCell( nC, nR )); diff --git a/sc/source/filter/excel/impop.cxx b/sc/source/filter/excel/impop.cxx index ca1ca7506c9f..667c88a2c11a 100644 --- a/sc/source/filter/excel/impop.cxx +++ b/sc/source/filter/excel/impop.cxx @@ -186,7 +186,8 @@ void ImportExcel::SetLastFormula( SCCOL nCol, SCROW nRow, double fVal, sal_uInt1 void ImportExcel::ReadFileSharing() { sal_uInt16 nRecommendReadOnly, nPasswordHash; - maStrm >> nRecommendReadOnly >> nPasswordHash; + nRecommendReadOnly = maStrm.ReaduInt16(); + nPasswordHash = maStrm.ReaduInt16(); if( (nRecommendReadOnly != 0) || (nPasswordHash != 0) ) { @@ -219,7 +220,9 @@ sal_uInt16 ImportExcel::ReadXFIndex( const ScAddress& rScPos, bool bBiff2 ) } // read formatting information (includes the XF identifier) sal_uInt8 nFlags1, nFlags2, nFlags3; - maStrm >> nFlags1 >> nFlags2 >> nFlags3; + nFlags1 = maStrm.ReaduInt8(); + nFlags2 = maStrm.ReaduInt8(); + nFlags3 = maStrm.ReaduInt8(); /* If the file contains XFs, extract and set the XF identifier, otherwise get the explicit formatting. */ if( mbBiff2HasXfs ) @@ -239,7 +242,7 @@ sal_uInt16 ImportExcel::ReadXFIndex( const ScAddress& rScPos, bool bBiff2 ) } } else - aIn >> nXFIdx; + nXFIdx = aIn.ReaduInt16(); return nXFIdx; } @@ -264,7 +267,10 @@ void ImportExcel::ReadDimensions() else { sal_uInt32 nXclRow1, nXclRow2; - maStrm >> nXclRow1 >> nXclRow2 >> aXclUsedArea.maFirst.mnCol >> aXclUsedArea.maLast.mnCol; + nXclRow1 = maStrm.ReaduInt32(); + nXclRow2 = maStrm.ReaduInt32(); + aXclUsedArea.maFirst.mnCol = maStrm.ReaduInt16(); + aXclUsedArea.maLast.mnCol = maStrm.ReaduInt16(); if( (nXclRow1 < nXclRow2) && (aXclUsedArea.GetColCount() > 1) && (nXclRow1 <= static_cast< sal_uInt32 >( GetScMaxPos().Row() )) ) { @@ -307,7 +313,7 @@ void ImportExcel::ReadInteger() { sal_uInt16 nXFIdx = ReadXFIndex( aScPos, true ); sal_uInt16 nValue; - maStrm >> nValue; + nValue = maStrm.ReaduInt16(); GetXFRangeBuffer().SetXF( aScPos, nXFIdx ); GetDocImport().setNumericCell(aScPos, nValue); @@ -324,7 +330,7 @@ void ImportExcel::ReadNumber() { sal_uInt16 nXFIdx = ReadXFIndex( aScPos, maStrm.GetRecId() == EXC_ID2_NUMBER ); double fValue; - maStrm >> fValue; + fValue = maStrm.ReadDouble(); GetXFRangeBuffer().SetXF( aScPos, nXFIdx ); GetDocImport().setNumericCell(aScPos, fValue); @@ -371,7 +377,8 @@ void ImportExcel::ReadBoolErr() { sal_uInt16 nXFIdx = ReadXFIndex( aScPos, maStrm.GetRecId() == EXC_ID2_BOOLERR ); sal_uInt8 nValue, nType; - maStrm >> nValue >> nType; + nValue = maStrm.ReaduInt8(); + nType = maStrm.ReaduInt8(); if( nType == EXC_BOOLERR_BOOL ) GetXFRangeBuffer().SetBoolXF( aScPos, nXFIdx ); @@ -396,7 +403,7 @@ void ImportExcel::ReadRk() { sal_uInt16 nXFIdx = ReadXFIndex( aScPos, false ); sal_Int32 nRk; - maStrm >> nRk; + nRk = maStrm.ReadInt32(); GetXFRangeBuffer().SetXF( aScPos, nXFIdx ); GetDocImport().setNumericCell(aScPos, XclTools::GetDoubleFromRK(nRk)); @@ -412,12 +419,12 @@ void ImportExcel::Row25( void ) { sal_uInt16 nRow, nRowHeight; - aIn >> nRow; + nRow = aIn.ReaduInt16(); aIn.Ignore( 4 ); if( ValidRow( nRow ) ) { - aIn >> nRowHeight; // specify direct in Twips + nRowHeight = aIn.ReaduInt16(); // specify direct in Twips aIn.Ignore( 2 ); if( GetBiff() == EXC_BIFF2 ) @@ -429,7 +436,7 @@ void ImportExcel::Row25( void ) sal_uInt16 nGrbit; aIn.Ignore( 2 ); // reserved - aIn >> nGrbit; + nGrbit = aIn.ReaduInt16(); sal_uInt8 nLevel = ::extract_value< sal_uInt8 >( nGrbit, 0, 3 ); pRowOutlineBuff->SetLevel( nRow, nLevel, ::get_flag( nGrbit, EXC_ROW_COLLAPSED ) ); @@ -443,7 +450,7 @@ void ImportExcel::Bof2( void ) sal_uInt16 nSubType; maStrm.DisableDecryption(); maStrm.Ignore( 2 ); - maStrm >> nSubType; + nSubType = maStrm.ReaduInt16(); if( nSubType == 0x0020 ) // Chart pExcRoot->eDateiTyp = Biff2C; @@ -490,7 +497,8 @@ void ImportExcel::Columndefault( void ) sal_uInt16 nColMic, nColMac; sal_uInt8 nOpt0; - aIn >> nColMic >> nColMac; + nColMic = aIn.ReaduInt16(); + nColMac = aIn.ReaduInt16(); OSL_ENSURE( aIn.GetRecLeft() == (sal_Size)(nColMac - nColMic) * 3 + 2, "ImportExcel::Columndefault - wrong record size" ); @@ -502,7 +510,7 @@ void ImportExcel::Columndefault( void ) for( sal_uInt16 nCol = nColMic ; nCol <= nColMac ; nCol++ ) { - aIn >> nOpt0; + nOpt0 = aIn.ReaduInt8(); aIn.Ignore( 2 ); // only 0. Attribut-Byte used if( nOpt0 & 0x80 ) // Col hidden? @@ -515,7 +523,10 @@ void ImportExcel::Array25( void ) sal_uInt16 nFirstRow, nLastRow, nFormLen; sal_uInt8 nFirstCol, nLastCol; - aIn >> nFirstRow >> nLastRow >> nFirstCol >> nLastCol; + nFirstRow = aIn.ReaduInt16(); + nLastRow = aIn.ReaduInt16(); + nFirstCol = aIn.ReaduInt8(); + nLastCol = aIn.ReaduInt8(); if( GetBiff() == EXC_BIFF2 ) {// BIFF2 @@ -525,7 +536,7 @@ void ImportExcel::Array25( void ) else {// BIFF5 aIn.Ignore( 6 ); - aIn >> nFormLen; + nFormLen = aIn.ReaduInt16(); } if( ValidColRow( nLastCol, nLastRow ) ) @@ -549,7 +560,7 @@ void ImportExcel::Rec1904( void ) { sal_uInt16 n1904; - aIn >> n1904; + n1904 = aIn.ReaduInt16(); if( n1904 ) {// 1904 date system @@ -565,7 +576,8 @@ void ImportExcel::Externname25( void ) sal_uInt32 nRes; sal_uInt16 nOpt; - aIn >> nOpt >> nRes; + nOpt = aIn.ReaduInt16(); + nRes = aIn.ReaduInt32(); OUString aName( aIn.ReadByteString( false ) ); @@ -589,7 +601,9 @@ void ImportExcel::Colwidth( void ) sal_uInt8 nColFirst, nColLast; sal_uInt16 nColWidth; - aIn >> nColFirst >> nColLast >> nColWidth; + nColFirst = aIn.ReaduInt8(); + nColLast = aIn.ReaduInt8(); + nColWidth = aIn.ReaduInt16(); //! TODO: add a check for the unlikely case of changed MAXCOL (-> XclImpAddressConverter) // if( nColLast > MAXCOL ) @@ -602,7 +616,7 @@ void ImportExcel::Colwidth( void ) void ImportExcel::Defrowheight2( void ) { sal_uInt16 nDefHeight; - maStrm >> nDefHeight; + nDefHeight = maStrm.ReaduInt16(); nDefHeight &= 0x7FFF; pColRowBuff->SetDefHeight( nDefHeight, EXC_DEFROW_UNSYNCED ); } @@ -638,7 +652,7 @@ void ImportExcel::Codepage( void ) void ImportExcel::Ixfe( void ) { - maStrm >> mnIxfeIndex; + mnIxfeIndex = maStrm.ReaduInt16(); } void ImportExcel::DefColWidth( void ) @@ -663,7 +677,11 @@ void ImportExcel::Colinfo( void ) sal_uInt16 nColFirst, nColLast, nColWidth, nXF; sal_uInt16 nOpt; - aIn >> nColFirst >> nColLast >> nColWidth >> nXF >> nOpt; + nColFirst = aIn.ReaduInt16(); + nColLast = aIn.ReaduInt16(); + nColWidth = aIn.ReaduInt16(); + nXF = aIn.ReaduInt16(); + nOpt = aIn.ReaduInt16(); if( nColFirst > MAXCOL ) return; @@ -687,7 +705,7 @@ void ImportExcel::Colinfo( void ) void ImportExcel::Wsbool( void ) { sal_uInt16 nFlags; - aIn >> nFlags; + nFlags = aIn.ReaduInt16(); pRowOutlineBuff->SetButtonMode( ::get_flag( nFlags, EXC_WSBOOL_ROWBELOW ) ); pColOutlineBuff->SetButtonMode( ::get_flag( nFlags, EXC_WSBOOL_COLBELOW ) ); @@ -704,7 +722,7 @@ void ImportExcel::Boundsheet( void ) aIn.DisableDecryption(); maSheetOffsets.push_back( aIn.ReaduInt32() ); aIn.EnableDecryption(); - aIn >> nGrbit; + nGrbit = aIn.ReaduInt16(); } OUString aName( aIn.ReadByteString( false ) ); @@ -731,7 +749,8 @@ void ImportExcel::Boundsheet( void ) void ImportExcel::Country( void ) { sal_uInt16 nUICountry, nDocCountry; - maStrm >> nUICountry >> nDocCountry; + nUICountry = maStrm.ReaduInt16(); + nDocCountry = maStrm.ReaduInt16(); // Store system language in XclRoot LanguageType eLanguage = ::msfilter::ConvertCountryToLanguage( static_cast< ::msfilter::CountryId >( nDocCountry ) ); @@ -759,7 +778,7 @@ void ImportExcel::Hideobj( void ) sal_uInt16 nHide; ScVObjMode eOle, eChart, eDraw; - aIn >> nHide; + nHide = aIn.ReaduInt16(); ScViewOptions aOpts( pD->GetViewOptions() ); @@ -819,9 +838,12 @@ void ImportExcel::Shrfmla( void ) sal_uInt16 nFirstRow, nLastRow, nLenExpr; sal_uInt8 nFirstCol, nLastCol; - aIn >> nFirstRow >> nLastRow >> nFirstCol >> nLastCol; + nFirstRow = aIn.ReaduInt16(); + nLastRow = aIn.ReaduInt16(); + nFirstCol = aIn.ReaduInt8(); + nLastCol = aIn.ReaduInt8(); aIn.Ignore( 2 ); - aIn >> nLenExpr; + nLenExpr = aIn.ReaduInt16(); // read mark is now on the formula @@ -866,7 +888,8 @@ void ImportExcel::Mulrk( void ) for( XclAddress aCurrXclPos( aXclPos ); (aXclPos.mnCol <= aCurrXclPos.mnCol) && (aIn.GetRecLeft() > 2); ++aCurrXclPos.mnCol ) { - aIn >> nXF >> nRkNum; + nXF = aIn.ReaduInt16(); + nRkNum = aIn.ReadInt32(); ScAddress aScPos( ScAddress::UNINITIALIZED ); if( GetAddressConverter().ConvertAddress( aScPos, aCurrXclPos, GetCurrScTab(), true ) ) @@ -886,7 +909,7 @@ void ImportExcel::Mulblank( void ) for( XclAddress aCurrXclPos( aXclPos ); (aXclPos.mnCol <= aCurrXclPos.mnCol) && (aIn.GetRecLeft() > 2); ++aCurrXclPos.mnCol ) { - aIn >> nXF; + nXF = aIn.ReaduInt16(); ScAddress aScPos( ScAddress::UNINITIALIZED ); if( GetAddressConverter().ConvertAddress( aScPos, aCurrXclPos, GetCurrScTab(), true ) ) @@ -898,7 +921,8 @@ void ImportExcel::Rstring( void ) { XclAddress aXclPos; sal_uInt16 nXFIdx; - aIn >> aXclPos >> nXFIdx; + aIn >> aXclPos; + nXFIdx = aIn.ReaduInt16(); ScAddress aScPos( ScAddress::UNINITIALIZED ); if( GetAddressConverter().ConvertAddress( aScPos, aXclPos, GetCurrScTab(), true ) ) @@ -928,7 +952,7 @@ void ImportExcel::Cellmerging() SCTAB nScTab = GetCurrScTab(); sal_uInt16 nCount; - maStrm >> nCount; + nCount = maStrm.ReaduInt16(); for( sal_uInt16 nIdx = 0; (nIdx < nCount) && (maStrm.GetRecLeft() >= 8); ++nIdx ) { XclRange aXclRange; @@ -953,21 +977,22 @@ void ImportExcel::Row34( void ) { sal_uInt16 nRow, nRowHeight, nGrbit, nXF; - aIn >> nRow; + nRow = aIn.ReaduInt16(); aIn.Ignore( 4 ); SCROW nScRow = static_cast< SCROW >( nRow ); if( ValidRow( nScRow ) ) { - aIn >> nRowHeight; // specify direct in Twips + nRowHeight = aIn.ReaduInt16(); // specify direct in Twips aIn.Ignore( 4 ); nRowHeight = nRowHeight & 0x7FFF; // Bit 15: Row Height not changed manually if( !nRowHeight ) nRowHeight = (GetBiff() == EXC_BIFF2) ? 0x25 : 0x225; - aIn >> nGrbit >> nXF; + nGrbit = aIn.ReaduInt16(); + nXF = aIn.ReaduInt16(); sal_uInt8 nLevel = ::extract_value< sal_uInt8 >( nGrbit, 0, 3 ); pRowOutlineBuff->SetLevel( nScRow, nLevel, ::get_flag( nGrbit, EXC_ROW_COLLAPSED ) ); @@ -983,7 +1008,7 @@ void ImportExcel::Bof3( void ) sal_uInt16 nSubType; maStrm.DisableDecryption(); maStrm.Ignore( 2 ); - maStrm >> nSubType; + nSubType = maStrm.ReaduInt16(); OSL_ENSURE( nSubType != 0x0100, "*ImportExcel::Bof3(): Biff3 as Workbook?!" ); if( nSubType == 0x0100 ) // Book @@ -1001,9 +1026,12 @@ void ImportExcel::Array34( void ) sal_uInt16 nFirstRow, nLastRow, nFormLen; sal_uInt8 nFirstCol, nLastCol; - aIn >> nFirstRow >> nLastRow >> nFirstCol >> nLastCol; + nFirstRow = aIn.ReaduInt16(); + nLastRow = aIn.ReaduInt16(); + nFirstCol = aIn.ReaduInt8(); + nLastCol = aIn.ReaduInt8(); aIn.Ignore( (GetBiff() >= EXC_BIFF5) ? 6 : 2 ); - aIn >> nFormLen; + nFormLen = aIn.ReaduInt16(); if( ValidColRow( nLastCol, nLastRow ) ) { @@ -1029,7 +1057,8 @@ void ImportExcel::Externname34( void ) void ImportExcel::Defrowheight345( void ) { sal_uInt16 nFlags, nDefHeight; - maStrm >> nFlags >> nDefHeight; + nFlags = maStrm.ReaduInt16(); + nDefHeight = maStrm.ReaduInt16(); pColRowBuff->SetDefHeight( nDefHeight, nFlags ); } @@ -1040,8 +1069,15 @@ void ImportExcel::TableOp( void ) sal_uInt16 nGrbit; sal_uInt16 nInpRow, nInpCol, nInpRow2, nInpCol2; - aIn >> nFirstRow >> nLastRow >> nFirstCol >> nLastCol >> nGrbit - >> nInpRow >> nInpCol >> nInpRow2 >> nInpCol2; + nFirstRow = aIn.ReaduInt16(); + nLastRow = aIn.ReaduInt16(); + nFirstCol = aIn.ReaduInt8(); + nLastCol = aIn.ReaduInt8(); + nGrbit = aIn.ReaduInt16(); + nInpRow = aIn.ReaduInt16(); + nInpCol = aIn.ReaduInt16(); + nInpRow2 = aIn.ReaduInt16(); + nInpCol2 = aIn.ReaduInt16(); if( ValidColRow( nLastCol, nLastRow ) ) { @@ -1113,7 +1149,7 @@ void ImportExcel::Bof4( void ) sal_uInt16 nSubType; maStrm.DisableDecryption(); maStrm.Ignore( 2 ); - maStrm >> nSubType; + nSubType = maStrm.ReaduInt16(); if( nSubType == 0x0100 ) // Book pExcRoot->eDateiTyp = Biff4W; @@ -1132,7 +1168,8 @@ void ImportExcel::Bof5( void ) BiffTyp eDatei; maStrm.DisableDecryption(); - maStrm >> nVers >> nSubType; + nVers = maStrm.ReaduInt16(); + nSubType = maStrm.ReaduInt16( ); switch( nSubType ) { diff --git a/sc/source/filter/excel/xichart.cxx b/sc/source/filter/excel/xichart.cxx index 6313fa533074..5ef1b5781860 100644 --- a/sc/source/filter/excel/xichart.cxx +++ b/sc/source/filter/excel/xichart.cxx @@ -135,7 +135,11 @@ namespace { XclImpStream& operator>>( XclImpStream& rStrm, XclChRectangle& rRect ) { - return rStrm >> rRect.mnX >> rRect.mnY >> rRect.mnWidth >> rRect.mnHeight; + rRect.mnX = rStrm.ReadInt32(); + rRect.mnY = rStrm.ReadInt32(); + rRect.mnWidth = rStrm.ReadInt32(); + rRect.mnHeight = rStrm.ReadInt32(); + return rStrm; } inline void lclSetValueOrClearAny( Any& rAny, double fValue, bool bClear ) @@ -436,7 +440,8 @@ void XclImpChGroupBase::SkipBlock( XclImpStream& rStrm ) void XclImpChFramePos::ReadChFramePos( XclImpStream& rStrm ) { - rStrm >> maData.mnTLMode >> maData.mnBRMode; + maData.mnTLMode = rStrm.ReaduInt16(); + maData.mnBRMode = rStrm.ReaduInt16(); /* According to the spec, the upper 16 bits of all members in the rectangle are unused and may contain garbage. */ maData.maRect.mnX = rStrm.ReadInt16(); rStrm.Ignore( 2 ); @@ -447,7 +452,10 @@ void XclImpChFramePos::ReadChFramePos( XclImpStream& rStrm ) void XclImpChLineFormat::ReadChLineFormat( XclImpStream& rStrm ) { - rStrm >> maData.maColor >> maData.mnPattern >> maData.mnWeight >> maData.mnFlags; + rStrm >> maData.maColor; + maData.mnPattern = rStrm.ReaduInt16(); + maData.mnWeight = rStrm.ReadInt16(); + maData.mnFlags = rStrm.ReaduInt16(); const XclImpRoot& rRoot = rStrm.GetRoot(); if( rRoot.GetBiff() == EXC_BIFF8 ) @@ -477,7 +485,9 @@ void XclImpChLineFormat::Convert( const XclImpChRoot& rRoot, void XclImpChAreaFormat::ReadChAreaFormat( XclImpStream& rStrm ) { - rStrm >> maData.maPattColor >> maData.maBackColor >> maData.mnPattern >> maData.mnFlags; + rStrm >> maData.maPattColor >> maData.maBackColor; + maData.mnPattern = rStrm.ReaduInt16(); + maData.mnFlags = rStrm.ReaduInt16(); const XclImpRoot& rRoot = rStrm.GetRoot(); if( rRoot.GetBiff() == EXC_BIFF8 ) @@ -532,9 +542,10 @@ void XclImpChEscherFormat::ReadSubRecord( XclImpStream& rStrm ) switch( rStrm.GetRecId() ) { case EXC_ID_CHPICFORMAT: - rStrm >> maPicFmt.mnBmpMode; + maPicFmt.mnBmpMode = rStrm.ReaduInt16(); rStrm.Ignore( 2 ); - rStrm >> maPicFmt.mnFlags >> maPicFmt.mfScale; + maPicFmt.mnFlags = rStrm.ReaduInt16(); + maPicFmt.mfScale = rStrm.ReadDouble(); break; } } @@ -630,7 +641,8 @@ XclImpChFrame::XclImpChFrame( const XclImpChRoot& rRoot, XclChObjectType eObjTyp void XclImpChFrame::ReadHeaderRecord( XclImpStream& rStrm ) { - rStrm >> maData.mnFormat >> maData.mnFlags; + maData.mnFormat = rStrm.ReaduInt16(); + maData.mnFlags = rStrm.ReaduInt16(); } void XclImpChFrame::UpdateObjFrame( const XclObjLineData& rLineData, const XclObjFillData& rFillData ) @@ -728,10 +740,10 @@ XclImpChSourceLink::~XclImpChSourceLink() void XclImpChSourceLink::ReadChSourceLink( XclImpStream& rStrm ) { - rStrm >> maData.mnDestType - >> maData.mnLinkType - >> maData.mnFlags - >> maData.mnNumFmtIdx; + maData.mnDestType = rStrm.ReaduInt8(); + maData.mnLinkType = rStrm.ReaduInt8(); + maData.mnFlags = rStrm.ReaduInt16(); + maData.mnNumFmtIdx = rStrm.ReaduInt16(); mxTokenArray.reset(); if( GetLinkType() == EXC_CHSRCLINK_WORKSHEET ) @@ -919,7 +931,7 @@ XclImpChFont::XclImpChFont() : void XclImpChFont::ReadChFont( XclImpStream& rStrm ) { - rStrm >> mnFontIdx; + mnFontIdx = rStrm.ReaduInt16(); } XclImpChText::XclImpChText( const XclImpChRoot& rRoot ) : @@ -929,19 +941,20 @@ XclImpChText::XclImpChText( const XclImpChRoot& rRoot ) : void XclImpChText::ReadHeaderRecord( XclImpStream& rStrm ) { - rStrm >> maData.mnHAlign - >> maData.mnVAlign - >> maData.mnBackMode - >> maData.maTextColor - >> maData.maRect - >> maData.mnFlags; + maData.mnHAlign = rStrm.ReaduInt8(); + maData.mnVAlign = rStrm.ReaduInt8(); + maData.mnBackMode = rStrm.ReaduInt16(); + rStrm >> maData.maTextColor + >> maData.maRect; + maData.mnFlags = rStrm.ReaduInt16(); if( GetBiff() == EXC_BIFF8 ) { // BIFF8: index into palette used instead of RGB data maData.maTextColor = GetPalette().GetColor( rStrm.ReaduInt16() ); // placement and rotation - rStrm >> maData.mnFlags2 >> maData.mnRotation; + maData.mnFlags2 = rStrm.ReaduInt16(); + maData.mnRotation = rStrm.ReaduInt16(); } else { @@ -976,7 +989,9 @@ void XclImpChText::ReadSubRecord( XclImpStream& rStrm ) mxFrame->ReadRecordGroup( rStrm ); break; case EXC_ID_CHOBJECTLINK: - rStrm >> maObjLink.mnTarget >> maObjLink.maPointPos.mnSeriesIdx >> maObjLink.maPointPos.mnPointIdx; + maObjLink.mnTarget = rStrm.ReaduInt16(); + maObjLink.maPointPos.mnSeriesIdx = rStrm.ReaduInt16(); + maObjLink.maPointPos.mnPointIdx = rStrm.ReaduInt16(); break; case EXC_ID_CHFRLABELPROPS: ReadChFrLabelProps( rStrm ); @@ -1207,7 +1222,8 @@ void XclImpChText::ReadChFrLabelProps( XclImpStream& rStrm ) mxLabelProps.reset( new XclChFrLabelProps ); sal_uInt16 nSepLen; rStrm.Ignore( 12 ); - rStrm >> mxLabelProps->mnFlags >> nSepLen; + mxLabelProps->mnFlags = rStrm.ReaduInt16(); + nSepLen = rStrm.ReaduInt16(); if( nSepLen > 0 ) mxLabelProps->maSeparator = rStrm.ReadUniString( nSepLen ); } @@ -1247,7 +1263,9 @@ void lclFinalizeTitle( XclImpChTextRef& rxTitle, const XclImpChText* pDefText, c void XclImpChMarkerFormat::ReadChMarkerFormat( XclImpStream& rStrm ) { - rStrm >> maData.maLineColor >> maData.maFillColor >> maData.mnMarkerType >> maData.mnFlags; + rStrm >> maData.maLineColor >> maData.maFillColor; + maData.mnMarkerType = rStrm.ReaduInt16(); + maData.mnFlags = rStrm.ReaduInt16(); const XclImpRoot& rRoot = rStrm.GetRoot(); if( rRoot.GetBiff() == EXC_BIFF8 ) @@ -1257,7 +1275,7 @@ void XclImpChMarkerFormat::ReadChMarkerFormat( XclImpStream& rStrm ) maData.maLineColor = rPal.GetColor( rStrm.ReaduInt16() ); maData.maFillColor = rPal.GetColor( rStrm.ReaduInt16() ); // marker size - rStrm >> maData.mnMarkerSize; + maData.mnMarkerSize = rStrm.ReaduInt32(); } } @@ -1301,7 +1319,7 @@ XclImpChPieFormat::XclImpChPieFormat() : void XclImpChPieFormat::ReadChPieFormat( XclImpStream& rStrm ) { - rStrm >> mnPieDist; + mnPieDist = rStrm.ReaduInt16(); } void XclImpChPieFormat::Convert( ScfPropertySet& rPropSet ) const @@ -1317,12 +1335,13 @@ XclImpChSeriesFormat::XclImpChSeriesFormat() : void XclImpChSeriesFormat::ReadChSeriesFormat( XclImpStream& rStrm ) { - rStrm >> mnFlags; + mnFlags = rStrm.ReaduInt16(); } void XclImpCh3dDataFormat::ReadCh3dDataFormat( XclImpStream& rStrm ) { - rStrm >> maData.mnBase >> maData.mnTop; + maData.mnBase = rStrm.ReaduInt8(); + maData.mnTop = rStrm.ReaduInt8(); } void XclImpCh3dDataFormat::Convert( ScfPropertySet& rPropSet ) const @@ -1342,7 +1361,7 @@ XclImpChAttachedLabel::XclImpChAttachedLabel( const XclImpChRoot& rRoot ) : void XclImpChAttachedLabel::ReadChAttachedLabel( XclImpStream& rStrm ) { - rStrm >> mnFlags; + mnFlags = rStrm.ReaduInt16(); } XclImpChTextRef XclImpChAttachedLabel::CreateDataLabel( const XclImpChText* pParent ) const @@ -1366,10 +1385,10 @@ XclImpChDataFormat::XclImpChDataFormat( const XclImpChRoot& rRoot ) : void XclImpChDataFormat::ReadHeaderRecord( XclImpStream& rStrm ) { - rStrm >> maData.maPointPos.mnPointIdx - >> maData.maPointPos.mnSeriesIdx - >> maData.mnFormatIdx - >> maData.mnFlags; + maData.maPointPos.mnPointIdx = rStrm.ReaduInt16(); + maData.maPointPos.mnSeriesIdx = rStrm.ReaduInt16(); + maData.mnFormatIdx = rStrm.ReaduInt16(); + maData.mnFlags = rStrm.ReaduInt16(); } void XclImpChDataFormat::ReadSubRecord( XclImpStream& rStrm ) @@ -1578,13 +1597,13 @@ XclImpChSerTrendLine::XclImpChSerTrendLine( const XclImpChRoot& rRoot ) : void XclImpChSerTrendLine::ReadChSerTrendLine( XclImpStream& rStrm ) { - rStrm >> maData.mnLineType - >> maData.mnOrder - >> maData.mfIntercept - >> maData.mnShowEquation - >> maData.mnShowRSquared - >> maData.mfForecastFor - >> maData.mfForecastBack; + maData.mnLineType = rStrm.ReaduInt8(); + maData.mnOrder = rStrm.ReaduInt8(); + maData.mfIntercept = rStrm.ReadDouble(); + maData.mnShowEquation = rStrm.ReaduInt8(); + maData.mnShowRSquared = rStrm.ReaduInt8(); + maData.mfForecastFor = rStrm.ReadDouble(); + maData.mfForecastBack = rStrm.ReadDouble(); } Reference< XRegressionCurve > XclImpChSerTrendLine::CreateRegressionCurve() const @@ -1664,9 +1683,12 @@ XclImpChSerErrorBar::XclImpChSerErrorBar( const XclImpChRoot& rRoot ) : void XclImpChSerErrorBar::ReadChSerErrorBar( XclImpStream& rStrm ) { - rStrm >> maData.mnBarType >> maData.mnSourceType >> maData.mnLineEnd; + maData.mnBarType = rStrm.ReaduInt8(); + maData.mnSourceType = rStrm.ReaduInt8(); + maData.mnLineEnd = rStrm.ReaduInt8(); rStrm.Ignore( 1 ); - rStrm >> maData.mfValue >> maData.mnValueCount; + maData.mfValue = rStrm.ReadDouble(); + maData.mnValueCount = rStrm.ReaduInt16(); } void XclImpChSerErrorBar::SetSeriesData( XclImpChSourceLinkRef xValueLink, XclImpChDataFormatRef xDataFmt ) @@ -1766,9 +1788,15 @@ XclImpChSeries::XclImpChSeries( const XclImpChRoot& rRoot, sal_uInt16 nSeriesIdx void XclImpChSeries::ReadHeaderRecord( XclImpStream& rStrm ) { - rStrm >> maData.mnCategType >> maData.mnValueType >> maData.mnCategCount >> maData.mnValueCount; + maData.mnCategType = rStrm.ReaduInt16(); + maData.mnValueType = rStrm.ReaduInt16(); + maData.mnCategCount = rStrm.ReaduInt16(); + maData.mnValueCount = rStrm.ReaduInt16(); if( GetBiff() == EXC_BIFF8 ) - rStrm >> maData.mnBubbleType >> maData.mnBubbleCount; + { + maData.mnBubbleType = rStrm.ReaduInt16(); + maData.mnBubbleCount = rStrm.ReaduInt16(); + } } void XclImpChSeries::ReadSubRecord( XclImpStream& rStrm ) @@ -1782,7 +1810,7 @@ void XclImpChSeries::ReadSubRecord( XclImpStream& rStrm ) ReadChDataFormat( rStrm ); break; case EXC_ID_CHSERGROUP: - rStrm >> mnGroupIdx; + mnGroupIdx = rStrm.ReaduInt16(); break; case EXC_ID_CHSERPARENT: ReadChSerParent( rStrm ); @@ -2093,7 +2121,7 @@ void XclImpChSeries::ReadChDataFormat( XclImpStream& rStrm ) void XclImpChSeries::ReadChSerParent( XclImpStream& rStrm ) { - rStrm >> mnParentIdx; + mnParentIdx = rStrm.ReaduInt16(); // index to parent series is 1-based, convert it to 0-based if( mnParentIdx > 0 ) --mnParentIdx; @@ -2174,20 +2202,23 @@ void XclImpChType::ReadChType( XclImpStream& rStrm ) switch( nRecId ) { case EXC_ID_CHBAR: - rStrm >> maData.mnOverlap >> maData.mnGap >> maData.mnFlags; + maData.mnOverlap = rStrm.ReadInt16(); + maData.mnGap = rStrm.ReadInt16(); + maData.mnFlags = rStrm.ReaduInt16(); break; case EXC_ID_CHLINE: case EXC_ID_CHAREA: case EXC_ID_CHRADARLINE: case EXC_ID_CHRADARAREA: - rStrm >> maData.mnFlags; + maData.mnFlags = rStrm.ReaduInt16(); break; case EXC_ID_CHPIE: - rStrm >> maData.mnRotation >> maData.mnPieHole; + maData.mnRotation = rStrm.ReaduInt16(); + maData.mnPieHole = rStrm.ReaduInt16(); if( GetBiff() == EXC_BIFF8 ) - rStrm >> maData.mnFlags; + maData.mnFlags = rStrm.ReaduInt16(); else maData.mnFlags = 0; break; @@ -2200,13 +2231,17 @@ void XclImpChType::ReadChType( XclImpStream& rStrm ) case EXC_ID_CHSCATTER: if( GetBiff() == EXC_BIFF8 ) - rStrm >> maData.mnBubbleSize >> maData.mnBubbleType >> maData.mnFlags; + { + maData.mnBubbleSize = rStrm.ReaduInt16(); + maData.mnBubbleType = rStrm.ReaduInt16(); + maData.mnFlags = rStrm.ReaduInt16(); + } else maData.mnFlags = 0; break; case EXC_ID_CHSURFACE: - rStrm >> maData.mnFlags; + maData.mnFlags = rStrm.ReaduInt16(); break; default: @@ -2371,13 +2406,13 @@ Reference< XChartType > XclImpChType::CreateChartType( Reference< XDiagram > xDi void XclImpChChart3d::ReadChChart3d( XclImpStream& rStrm ) { - rStrm >> maData.mnRotation - >> maData.mnElevation - >> maData.mnEyeDist - >> maData.mnRelHeight - >> maData.mnRelDepth - >> maData.mnDepthGap - >> maData.mnFlags; + maData.mnRotation = rStrm.ReaduInt16(); + maData.mnElevation = rStrm.ReadInt16(); + maData.mnEyeDist = rStrm.ReaduInt16(); + maData.mnRelHeight = rStrm.ReaduInt16(); + maData.mnRelDepth = rStrm.ReaduInt16(); + maData.mnDepthGap = rStrm.ReaduInt16(); + maData.mnFlags = rStrm.ReaduInt16(); } void XclImpChChart3d::Convert( ScfPropertySet& rPropSet, bool b3dWallChart ) const @@ -2455,7 +2490,10 @@ XclImpChLegend::XclImpChLegend( const XclImpChRoot& rRoot ) : void XclImpChLegend::ReadHeaderRecord( XclImpStream& rStrm ) { - rStrm >> maData.maRect >> maData.mnDockMode >> maData.mnSpacing >> maData.mnFlags; + rStrm >> maData.maRect; + maData.mnDockMode = rStrm.ReaduInt8(); + maData.mnSpacing = rStrm.ReaduInt8(); + maData.mnFlags = rStrm.ReaduInt16(); // trace unsupported features if( GetTracer().IsEnabled() ) @@ -2593,7 +2631,7 @@ XclImpChDropBar::XclImpChDropBar( sal_uInt16 nDropBar ) : void XclImpChDropBar::ReadHeaderRecord( XclImpStream& rStrm ) { - rStrm >> mnBarDist; + mnBarDist = rStrm.ReaduInt16(); } void XclImpChDropBar::Convert( const XclImpChRoot& rRoot, ScfPropertySet& rPropSet ) const @@ -2620,7 +2658,8 @@ XclImpChTypeGroup::XclImpChTypeGroup( const XclImpChRoot& rRoot ) : void XclImpChTypeGroup::ReadHeaderRecord( XclImpStream& rStrm ) { rStrm.Ignore( 16 ); - rStrm >> maData.mnFlags >> maData.mnGroupIdx; + maData.mnFlags = rStrm.ReaduInt16(); + maData.mnGroupIdx = rStrm.ReaduInt16(); } void XclImpChTypeGroup::ReadSubRecord( XclImpStream& rStrm ) @@ -2925,20 +2964,23 @@ XclImpChLabelRange::XclImpChLabelRange( const XclImpChRoot& rRoot ) : void XclImpChLabelRange::ReadChLabelRange( XclImpStream& rStrm ) { - rStrm >> maLabelData.mnCross >> maLabelData.mnLabelFreq >> maLabelData.mnTickFreq >> maLabelData.mnFlags; + maLabelData.mnCross = rStrm.ReaduInt16(); + maLabelData.mnLabelFreq = rStrm.ReaduInt16(); + maLabelData.mnTickFreq = rStrm.ReaduInt16(); + maLabelData.mnFlags = rStrm.ReaduInt16(); } void XclImpChLabelRange::ReadChDateRange( XclImpStream& rStrm ) { - rStrm >> maDateData.mnMinDate - >> maDateData.mnMaxDate - >> maDateData.mnMajorStep - >> maDateData.mnMajorUnit - >> maDateData.mnMinorStep - >> maDateData.mnMinorUnit - >> maDateData.mnBaseUnit - >> maDateData.mnCross - >> maDateData.mnFlags; + maDateData.mnMinDate = rStrm.ReaduInt16(); + maDateData.mnMaxDate = rStrm.ReaduInt16(); + maDateData.mnMajorStep = rStrm.ReaduInt16(); + maDateData.mnMajorUnit = rStrm.ReaduInt16(); + maDateData.mnMinorStep = rStrm.ReaduInt16(); + maDateData.mnMinorUnit = rStrm.ReaduInt16(); + maDateData.mnBaseUnit = rStrm.ReaduInt16(); + maDateData.mnCross = rStrm.ReaduInt16(); + maDateData.mnFlags = rStrm.ReaduInt16(); } void XclImpChLabelRange::Convert( ScfPropertySet& rPropSet, ScaleData& rScaleData, bool bMirrorOrient ) const @@ -3022,12 +3064,12 @@ XclImpChValueRange::XclImpChValueRange( const XclImpChRoot& rRoot ) : void XclImpChValueRange::ReadChValueRange( XclImpStream& rStrm ) { - rStrm >> maData.mfMin - >> maData.mfMax - >> maData.mfMajorStep - >> maData.mfMinorStep - >> maData.mfCross - >> maData.mnFlags; + maData.mfMin = rStrm.ReadDouble(); + maData.mfMax = rStrm.ReadDouble(); + maData.mfMajorStep = rStrm.ReadDouble(); + maData.mfMinorStep = rStrm.ReadDouble(); + maData.mfCross = rStrm.ReadDouble(); + maData.mnFlags = rStrm.ReaduInt16(); } void XclImpChValueRange::Convert( ScaleData& rScaleData, bool bMirrorOrient ) const @@ -3122,20 +3164,20 @@ XclImpChTick::XclImpChTick( const XclImpChRoot& rRoot ) : void XclImpChTick::ReadChTick( XclImpStream& rStrm ) { - rStrm >> maData.mnMajor - >> maData.mnMinor - >> maData.mnLabelPos - >> maData.mnBackMode; + maData.mnMajor = rStrm.ReaduInt8(); + maData.mnMinor = rStrm.ReaduInt8(); + maData.mnLabelPos = rStrm.ReaduInt8(); + maData.mnBackMode = rStrm.ReaduInt8(); rStrm.Ignore( 16 ); - rStrm >> maData.maTextColor - >> maData.mnFlags; + rStrm >> maData.maTextColor; + maData.mnFlags = rStrm.ReaduInt16(); if( GetBiff() == EXC_BIFF8 ) { // BIFF8: index into palette used instead of RGB data maData.maTextColor = GetPalette().GetColor( rStrm.ReaduInt16() ); // rotation - rStrm >> maData.mnRotation; + maData.mnRotation = rStrm.ReaduInt16(); } else { @@ -3177,7 +3219,7 @@ XclImpChAxis::XclImpChAxis( const XclImpChRoot& rRoot, sal_uInt16 nAxisType ) : void XclImpChAxis::ReadHeaderRecord( XclImpStream& rStrm ) { - rStrm >> maData.mnType; + maData.mnType = rStrm.ReaduInt16(); } void XclImpChAxis::ReadSubRecord( XclImpStream& rStrm ) @@ -3198,7 +3240,7 @@ void XclImpChAxis::ReadSubRecord( XclImpStream& rStrm ) mxValueRange->ReadChValueRange( rStrm ); break; case EXC_ID_CHFORMAT: - rStrm >> mnNumFmtIdx; + mnNumFmtIdx = rStrm.ReaduInt16(); break; case EXC_ID_CHTICK: mxTick.reset( new XclImpChTick( GetChRoot() ) ); @@ -3449,7 +3491,8 @@ XclImpChAxesSet::XclImpChAxesSet( const XclImpChRoot& rRoot, sal_uInt16 nAxesSet void XclImpChAxesSet::ReadHeaderRecord( XclImpStream& rStrm ) { - rStrm >> maData.mnAxesSetId >> maData.maRect; + maData.mnAxesSetId = rStrm.ReaduInt16(); + rStrm >> maData.maRect; } void XclImpChAxesSet::ReadSubRecord( XclImpStream& rStrm ) @@ -3989,7 +4032,8 @@ void XclImpChChart::ReadChSeries( XclImpStream& rStrm ) void XclImpChChart::ReadChProperties( XclImpStream& rStrm ) { - rStrm >> maProps.mnFlags >> maProps.mnEmptyMode; + maProps.mnFlags = rStrm.ReaduInt16(); + maProps.mnEmptyMode = rStrm.ReaduInt8(); } void XclImpChChart::ReadChAxesSet( XclImpStream& rStrm ) diff --git a/sc/source/filter/excel/xicontent.cxx b/sc/source/filter/excel/xicontent.cxx index 1baf0e29d450..51e2f187a062 100644 --- a/sc/source/filter/excel/xicontent.cxx +++ b/sc/source/filter/excel/xicontent.cxx @@ -76,7 +76,7 @@ void XclImpSst::ReadSst( XclImpStream& rStrm ) { rStrm.Ignore( 4 ); sal_uInt32 nStrCount(0); - rStrm >> nStrCount; + nStrCount = rStrm.ReaduInt32(); maStrings.clear(); maStrings.reserve( static_cast< size_t >( nStrCount ) ); while( (nStrCount > 0) && rStrm.IsValid() ) @@ -123,7 +123,7 @@ void lclAppendString32( OUString& rString, XclImpStream& rStrm, bool b16Bit ) void lclIgnoreString32( XclImpStream& rStrm, bool b16Bit ) { sal_uInt32 nChars(0); - rStrm >> nChars; + nChars = rStrm.ReaduInt32(); if( b16Bit ) nChars *= 2; rStrm.Ignore( nChars ); @@ -237,7 +237,7 @@ OUString XclImpHyperlink::ReadEmbeddedData( XclImpStream& rStrm ) rStrm >> aGuid; rStrm.Ignore( 4 ); sal_uInt32 nFlags(0); - rStrm >> nFlags; + nFlags = rStrm.ReaduInt32(); OSL_ENSURE( aGuid == XclTools::maGuidStdLink, "XclImpHyperlink::ReadEmbeddedData - unknown header GUID" ); @@ -271,17 +271,17 @@ OUString XclImpHyperlink::ReadEmbeddedData( XclImpStream& rStrm ) if( aGuid == XclTools::maGuidFileMoniker ) { sal_uInt16 nLevel = 0; // counter for level to climb down in path - rStrm >> nLevel; + nLevel = rStrm.ReaduInt16(); xShortName.reset( new OUString ); lclAppendString32( *xShortName, rStrm, false ); rStrm.Ignore( 24 ); sal_uInt32 nStrLen = 0; - rStrm >> nStrLen; + nStrLen = rStrm.ReaduInt32(); if( nStrLen ) { nStrLen = 0; - rStrm >> nStrLen; + nStrLen = rStrm.ReaduInt32(); nStrLen /= 2; // it's byte count here... rStrm.Ignore( 2 ); xLongName.reset( new OUString ); @@ -294,7 +294,7 @@ OUString XclImpHyperlink::ReadEmbeddedData( XclImpStream& rStrm ) else if( aGuid == XclTools::maGuidUrlMoniker ) { sal_uInt32 nStrLen(0); - rStrm >> nStrLen; + nStrLen = rStrm.ReaduInt32(); nStrLen /= 2; // it's byte count here... xLongName.reset( new OUString ); lclAppendString32( *xLongName, rStrm, nStrLen, true ); @@ -489,7 +489,7 @@ void XclImpCondFormat::ReadCondfmt( XclImpStream& rStrm ) { OSL_ENSURE( !mnCondCount, "XclImpCondFormat::ReadCondfmt - already initialized" ); XclRangeList aXclRanges; - rStrm >> mnCondCount; + mnCondCount = rStrm.ReaduInt16(); rStrm.Ignore( 10 ); rStrm >> aXclRanges; GetAddressConverter().ConvertRangeList( maRanges, aXclRanges, GetCurrScTab(), true ); @@ -512,7 +512,12 @@ void XclImpCondFormat::ReadCF( XclImpStream& rStrm ) sal_uInt32 nFlags(0); sal_uInt16 nFlagsExtended(0); - rStrm >> nType >> nOperator >> nFmlaSize1 >> nFmlaSize2 >> nFlags >> nFlagsExtended; + nType = rStrm.ReaduInt8(); + nOperator = rStrm.ReaduInt8(); + nFmlaSize1 = rStrm.ReaduInt16(); + nFmlaSize2 = rStrm.ReaduInt16(); + nFlags = rStrm.ReaduInt32(); + nFlagsExtended = rStrm.ReaduInt16(); // *** mode and comparison operator *** @@ -578,7 +583,8 @@ void XclImpCondFormat::ReadCF( XclImpStream& rStrm ) XclImpCellAlign aAlign; sal_uInt16 nAlign(0); sal_uInt16 nAlignMisc(0); - rStrm >> nAlign >> nAlignMisc; + nAlign = rStrm.ReaduInt16(); + nAlignMisc = rStrm.ReaduInt16(); aAlign.FillFromCF( nAlign, nAlignMisc ); aAlign.FillToItemSet( rStyleItemSet, NULL ); rStrm.Ignore(4); @@ -590,7 +596,8 @@ void XclImpCondFormat::ReadCF( XclImpStream& rStrm ) { sal_uInt16 nLineStyle(0); sal_uInt32 nLineColor(0); - rStrm >> nLineStyle >> nLineColor; + nLineStyle = rStrm.ReaduInt16(); + nLineColor = rStrm.ReaduInt32(); rStrm.Ignore( 2 ); XclImpCellBorder aBorder; @@ -603,7 +610,8 @@ void XclImpCondFormat::ReadCF( XclImpStream& rStrm ) if( ::get_flag( nFlags, EXC_CF_BLOCK_AREA ) ) { sal_uInt16 nPattern(0), nColor(0); - rStrm >> nPattern >> nColor; + nPattern = rStrm.ReaduInt16(); + nColor = rStrm.ReaduInt16(); XclImpCellArea aArea; aArea.FillFromCF8( nPattern, nColor, nFlags ); @@ -613,7 +621,7 @@ void XclImpCondFormat::ReadCF( XclImpStream& rStrm ) if( get_flag( nFlags, EXC_CF_BLOCK_PROTECTION ) ) { sal_uInt16 nCellProt; - rStrm >> nCellProt; + nCellProt = rStrm.ReaduInt16(); XclImpCellProt aCellProt; aCellProt.FillFromXF3(nCellProt); aCellProt.FillToItemSet( rStyleItemSet ); @@ -718,7 +726,7 @@ void XclImpValidationManager::ReadDval( XclImpStream& rStrm ) sal_uInt32 nObjId(0); rStrm.Ignore( 10 ); - rStrm >> nObjId; + nObjId = rStrm.ReaduInt32(); if( nObjId != EXC_DVAL_NOOBJ ) { OSL_ENSURE( nObjId <= 0xFFFF, "XclImpValidation::ReadDval - invalid object ID" ); @@ -737,7 +745,7 @@ void XclImpValidationManager::ReadDV( XclImpStream& rStrm ) // flags sal_uInt32 nFlags(0); - rStrm >> nFlags; + nFlags = rStrm.ReaduInt32(); // message strings /* Empty strings are single NUL characters in Excel (string length is 1). @@ -760,7 +768,7 @@ void XclImpValidationManager::ReadDV( XclImpStream& rStrm ) ::std::unique_ptr< ScTokenArray > xTokArr1; sal_uInt16 nLen = 0; - rStrm >> nLen; + nLen = rStrm.ReaduInt16(); rStrm.Ignore( 2 ); if( nLen > 0 ) { @@ -777,7 +785,7 @@ void XclImpValidationManager::ReadDV( XclImpStream& rStrm ) ::std::unique_ptr< ScTokenArray > xTokArr2; nLen = 0; - rStrm >> nLen; + nLen = rStrm.ReaduInt16(); rStrm.Ignore( 2 ); if( nLen > 0 ) { @@ -932,9 +940,9 @@ void XclImpWebQuery::ReadWqsettings( XclImpStream& rStrm ) { rStrm.Ignore( 10 ); sal_uInt16 nFlags(0); - rStrm >> nFlags; + nFlags = rStrm.ReaduInt16(); rStrm.Ignore( 10 ); - rStrm >> mnRefresh; + mnRefresh = rStrm.ReaduInt16(); if( ::get_flag( nFlags, EXC_WQSETT_SPECTABLES ) && (meMode == xlWQAllTables) ) meMode = xlWQSpecTables; @@ -1054,7 +1062,8 @@ XclImpDecrypterRef lclReadFilepass5( XclImpStream& rStrm ) if( rStrm.GetRecLeft() == 4 ) { sal_uInt16 nKey(0), nHash(0); - rStrm >> nKey >> nHash; + nKey = rStrm.ReaduInt16(); + nHash = rStrm.ReaduInt16(); xDecr.reset( new XclImpBiff5Decrypter( nKey, nHash ) ); } return xDecr; @@ -1088,7 +1097,7 @@ XclImpDecrypterRef lclReadFilepass8( XclImpStream& rStrm ) XclImpDecrypterRef xDecr; sal_uInt16 nMode(0); - rStrm >> nMode; + nMode = rStrm.ReaduInt16(); switch( nMode ) { case EXC_FILEPASS_BIFF5: @@ -1099,7 +1108,7 @@ XclImpDecrypterRef lclReadFilepass8( XclImpStream& rStrm ) { rStrm.Ignore( 2 ); sal_uInt16 nSubMode(0); - rStrm >> nSubMode; + nSubMode = rStrm.ReaduInt16(); switch( nSubMode ) { case EXC_FILEPASS_BIFF8_STD: @@ -1240,14 +1249,14 @@ void XclImpSheetProtectBuffer::ReadOptions( XclImpStream& rStrm, SCTAB nTab ) // For enhanced protection data, the size is always 4. For the most xls // documents out there this value is almost always -1. sal_Int32 nFlagSize(0); - rStrm >> nFlagSize; + nFlagSize = rStrm.ReadInt32(); if (nFlagSize != -1) return; // There are actually 4 bytes to read, but the upper 2 bytes currently // don't store any bits. sal_uInt16 nOptions(0); - rStrm >> nOptions; + nOptions = rStrm.ReaduInt16(); Sheet* pSheet = GetSheetItem(nTab); if (pSheet) @@ -1264,7 +1273,7 @@ void XclImpSheetProtectBuffer::AppendEnhancedProtection( const ScEnhancedProtect void XclImpSheetProtectBuffer::ReadPasswordHash( XclImpStream& rStrm, SCTAB nTab ) { sal_uInt16 nHash(0); - rStrm >> nHash; + nHash = rStrm.ReaduInt16(); Sheet* pSheet = GetSheetItem(nTab); if (pSheet) pSheet->mnPasswordHash = nHash; diff --git a/sc/source/filter/excel/xiescher.cxx b/sc/source/filter/excel/xiescher.cxx index 276782cb872f..b990a115c60c 100644 --- a/sc/source/filter/excel/xiescher.cxx +++ b/sc/source/filter/excel/xiescher.cxx @@ -188,7 +188,7 @@ XclImpDrawObjRef XclImpDrawObjBase::ReadObj3( const XclImpRoot& rRoot, XclImpStr { sal_uInt16 nObjType; rStrm.Ignore( 4 ); - rStrm >> nObjType; + nObjType = rStrm.ReaduInt16(); switch( nObjType ) { case EXC_OBJTYPE_GROUP: xDrawObj.reset( new XclImpGroupObj( rRoot ) ); break; @@ -220,7 +220,7 @@ XclImpDrawObjRef XclImpDrawObjBase::ReadObj4( const XclImpRoot& rRoot, XclImpStr { sal_uInt16 nObjType; rStrm.Ignore( 4 ); - rStrm >> nObjType; + nObjType = rStrm.ReaduInt16(); switch( nObjType ) { case EXC_OBJTYPE_GROUP: xDrawObj.reset( new XclImpGroupObj( rRoot ) ); break; @@ -253,7 +253,7 @@ XclImpDrawObjRef XclImpDrawObjBase::ReadObj5( const XclImpRoot& rRoot, XclImpStr { sal_uInt16 nObjType(EXC_OBJTYPE_UNKNOWN); rStrm.Ignore( 4 ); - rStrm >> nObjType; + nObjType = rStrm.ReaduInt16(); switch( nObjType ) { case EXC_OBJTYPE_GROUP: xDrawObj.reset( new XclImpGroupObj( rRoot ) ); break; @@ -300,7 +300,9 @@ XclImpDrawObjRef XclImpDrawObjBase::ReadObj8( const XclImpRoot& rRoot, XclImpStr if( rStrm.GetRecLeft() >= 10 ) { sal_uInt16 nSubRecId(0), nSubRecSize(0), nObjType(0); - rStrm >> nSubRecId >> nSubRecSize >> nObjType; + nSubRecId = rStrm.ReaduInt16(); + nSubRecSize = rStrm.ReaduInt16(); + nObjType = rStrm.ReaduInt16(); OSL_ENSURE( nSubRecId == EXC_ID_OBJCMO, "XclImpDrawObjBase::ReadObj8 - OBJCMO subrecord expected" ); if( (nSubRecId == EXC_ID_OBJCMO) && (nSubRecSize >= 6) ) { @@ -587,14 +589,16 @@ void XclImpDrawObjBase::ReadMacro8( XclImpStream& rStrm ) { // macro is stored in a tNameXR token containing a link to a defined name sal_uInt16 nFmlaSize; - rStrm >> nFmlaSize; + nFmlaSize = rStrm.ReaduInt16(); rStrm.Ignore( 4 ); OSL_ENSURE( nFmlaSize == 7, "XclImpDrawObjBase::ReadMacro - unexpected formula size" ); if( nFmlaSize == 7 ) { sal_uInt8 nTokenId; sal_uInt16 nExtSheet, nExtName; - rStrm >> nTokenId >> nExtSheet >> nExtName; + nTokenId = rStrm.ReaduInt8(); + nExtSheet = rStrm.ReaduInt16(); + nExtName = rStrm.ReaduInt16(); OSL_ENSURE( nTokenId == XclTokenArrayHelper::GetTokenId( EXC_TOKID_NAMEX, EXC_TOKCLASS_REF ), "XclImpDrawObjBase::ReadMacro - tNameXR token expected" ); if( nTokenId == XclTokenArrayHelper::GetTokenId( EXC_TOKID_NAMEX, EXC_TOKCLASS_REF ) ) @@ -823,7 +827,11 @@ void XclImpDrawObjBase::ImplReadObj3( XclImpStream& rStrm ) rStrm.Seek( 4 ); sal_uInt16 nObjFlags, nMacroSize; - rStrm >> mnObjType >> mnObjId >> nObjFlags >> maAnchor >> nMacroSize; + mnObjType = rStrm.ReaduInt16(); + mnObjId = rStrm.ReaduInt16(); + nObjFlags = rStrm.ReaduInt16(); + rStrm >> maAnchor; + nMacroSize = rStrm.ReaduInt16(); rStrm.Ignore( 2 ); mbHasAnchor = true; @@ -838,7 +846,11 @@ void XclImpDrawObjBase::ImplReadObj4( XclImpStream& rStrm ) rStrm.Seek( 4 ); sal_uInt16 nObjFlags, nMacroSize; - rStrm >> mnObjType >> mnObjId >> nObjFlags >> maAnchor >> nMacroSize; + mnObjType = rStrm.ReaduInt16(); + mnObjId = rStrm.ReaduInt16(); + nObjFlags = rStrm.ReaduInt16(); + rStrm >> maAnchor; + nMacroSize = rStrm.ReaduInt16(); rStrm.Ignore( 2 ); mbHasAnchor = true; @@ -854,9 +866,13 @@ void XclImpDrawObjBase::ImplReadObj5( XclImpStream& rStrm ) rStrm.Seek( 4 ); sal_uInt16 nObjFlags, nMacroSize, nNameLen; - rStrm >> mnObjType >> mnObjId >> nObjFlags >> maAnchor >> nMacroSize; + mnObjType = rStrm.ReaduInt16(); + mnObjId = rStrm.ReaduInt16(); + nObjFlags = rStrm.ReaduInt16(); + rStrm >> maAnchor; + nMacroSize = rStrm.ReaduInt16(); rStrm.Ignore( 2 ); - rStrm >> nNameLen; + nNameLen = rStrm.ReaduInt16(); rStrm.Ignore( 2 ); mbHasAnchor = true; @@ -875,7 +891,8 @@ void XclImpDrawObjBase::ImplReadObj8( XclImpStream& rStrm ) while( bLoop && (rStrm.GetRecLeft() >= 4) ) { sal_uInt16 nSubRecId, nSubRecSize; - rStrm >> nSubRecId >> nSubRecSize; + nSubRecId = rStrm.ReaduInt16(); + nSubRecSize = rStrm.ReaduInt16(); rStrm.PushPosition(); // sometimes the last subrecord has an invalid length (OBJLBSDATA) -> min() nSubRecSize = static_cast< sal_uInt16 >( ::std::min< sal_Size >( nSubRecSize, rStrm.GetRecLeft() ) ); @@ -887,7 +904,9 @@ void XclImpDrawObjBase::ImplReadObj8( XclImpStream& rStrm ) if( (rStrm.GetRecPos() == 4) && (nSubRecSize >= 6) ) { sal_uInt16 nObjFlags; - rStrm >> mnObjType >> mnObjId >> nObjFlags; + mnObjType = rStrm.ReaduInt16(); + mnObjId = rStrm.ReaduInt16( ); + nObjFlags = rStrm.ReaduInt16( ); mbPrintable = ::get_flag( nObjFlags, EXC_OBJCMO_PRINTABLE ); } break; @@ -920,7 +939,7 @@ void XclImpDrawObjBase::ImplReadObj8( XclImpStream& rStrm ) { sal_uInt32 nDataSize; rStrm.Ignore( 4 ); - rStrm >> nDataSize; + nDataSize = rStrm.ReaduInt32(); nDataSize -= rStrm.GetRecLeft(); // skip following CONTINUE records until IMGDATA ends while( (nDataSize > 0) && (rStrm.GetNextRecId() == EXC_ID_CONT) && rStrm.StartNextRecord() ) @@ -974,7 +993,7 @@ bool XclImpGroupObj::TryInsert( XclImpDrawObjRef xDrawObj ) void XclImpGroupObj::DoReadObj3( XclImpStream& rStrm, sal_uInt16 nMacroSize ) { rStrm.Ignore( 4 ); - rStrm >> mnFirstUngrouped; + mnFirstUngrouped = rStrm.ReaduInt16(); rStrm.Ignore( 16 ); ReadMacro3( rStrm, nMacroSize ); } @@ -982,7 +1001,7 @@ void XclImpGroupObj::DoReadObj3( XclImpStream& rStrm, sal_uInt16 nMacroSize ) void XclImpGroupObj::DoReadObj4( XclImpStream& rStrm, sal_uInt16 nMacroSize ) { rStrm.Ignore( 4 ); - rStrm >> mnFirstUngrouped; + mnFirstUngrouped = rStrm.ReaduInt16(); rStrm.Ignore( 16 ); ReadMacro4( rStrm, nMacroSize ); } @@ -990,7 +1009,7 @@ void XclImpGroupObj::DoReadObj4( XclImpStream& rStrm, sal_uInt16 nMacroSize ) void XclImpGroupObj::DoReadObj5( XclImpStream& rStrm, sal_uInt16 nNameLen, sal_uInt16 nMacroSize ) { rStrm.Ignore( 4 ); - rStrm >> mnFirstUngrouped; + mnFirstUngrouped = rStrm.ReaduInt16(); rStrm.Ignore( 16 ); ReadName5( rStrm, nNameLen ); ReadMacro5( rStrm, nMacroSize ); @@ -1022,21 +1041,27 @@ XclImpLineObj::XclImpLineObj( const XclImpRoot& rRoot ) : void XclImpLineObj::DoReadObj3( XclImpStream& rStrm, sal_uInt16 nMacroSize ) { - rStrm >> maLineData >> mnArrows >> mnStartPoint; + rStrm >> maLineData; + mnArrows = rStrm.ReaduInt16(); + mnStartPoint = rStrm.ReaduInt8(); rStrm.Ignore( 1 ); ReadMacro3( rStrm, nMacroSize ); } void XclImpLineObj::DoReadObj4( XclImpStream& rStrm, sal_uInt16 nMacroSize ) { - rStrm >> maLineData >> mnArrows >> mnStartPoint; + rStrm >> maLineData; + mnArrows = rStrm.ReaduInt16(); + mnStartPoint = rStrm.ReaduInt8(); rStrm.Ignore( 1 ); ReadMacro4( rStrm, nMacroSize ); } void XclImpLineObj::DoReadObj5( XclImpStream& rStrm, sal_uInt16 nNameLen, sal_uInt16 nMacroSize ) { - rStrm >> maLineData >> mnArrows >> mnStartPoint; + rStrm >> maLineData; + mnArrows = rStrm.ReaduInt16(); + mnStartPoint = rStrm.ReaduInt8(); rStrm.Ignore( 1 ); ReadName5( rStrm, nNameLen ); ReadMacro5( rStrm, nMacroSize ); @@ -1148,7 +1173,8 @@ XclImpRectObj::XclImpRectObj( const XclImpRoot& rRoot ) : void XclImpRectObj::ReadFrameData( XclImpStream& rStrm ) { - rStrm >> maFillData >> maLineData >> mnFrameFlags; + rStrm >> maFillData >> maLineData; + mnFrameFlags = rStrm.ReaduInt16(); } void XclImpRectObj::ConvertRectStyle( SdrObject& rSdrObj ) const @@ -1207,21 +1233,24 @@ XclImpArcObj::XclImpArcObj( const XclImpRoot& rRoot ) : void XclImpArcObj::DoReadObj3( XclImpStream& rStrm, sal_uInt16 nMacroSize ) { - rStrm >> maFillData >> maLineData >> mnQuadrant; + rStrm >> maFillData >> maLineData; + mnQuadrant = rStrm.ReaduInt8(); rStrm.Ignore( 1 ); ReadMacro3( rStrm, nMacroSize ); } void XclImpArcObj::DoReadObj4( XclImpStream& rStrm, sal_uInt16 nMacroSize ) { - rStrm >> maFillData >> maLineData >> mnQuadrant; + rStrm >> maFillData >> maLineData; + mnQuadrant = rStrm.ReaduInt8(); rStrm.Ignore( 1 ); ReadMacro4( rStrm, nMacroSize ); } void XclImpArcObj::DoReadObj5( XclImpStream& rStrm, sal_uInt16 nNameLen, sal_uInt16 nMacroSize ) { - rStrm >> maFillData >> maLineData >> mnQuadrant; + rStrm >> maFillData >> maLineData; + mnQuadrant = rStrm.ReaduInt8(); rStrm.Ignore( 1 ); ReadName5( rStrm, nNameLen ); ReadMacro5( rStrm, nMacroSize ); @@ -1284,7 +1313,8 @@ void XclImpPolygonObj::ReadCoordList( XclImpStream& rStrm ) while( rStrm.GetRecLeft() >= 4 ) { sal_uInt16 nX, nY; - rStrm >> nX >> nY; + nX = rStrm.ReaduInt16(); + nY = rStrm.ReaduInt16(); maCoords.push_back( Point( nX, nY ) ); } } @@ -1293,9 +1323,9 @@ void XclImpPolygonObj::ReadCoordList( XclImpStream& rStrm ) void XclImpPolygonObj::DoReadObj4( XclImpStream& rStrm, sal_uInt16 nMacroSize ) { ReadFrameData( rStrm ); - rStrm >> mnPolyFlags; + mnPolyFlags = rStrm.ReaduInt16(); rStrm.Ignore( 10 ); - rStrm >> mnPointCount; + mnPointCount = rStrm.ReaduInt16(); rStrm.Ignore( 8 ); ReadMacro4( rStrm, nMacroSize ); ReadCoordList( rStrm ); @@ -1304,9 +1334,9 @@ void XclImpPolygonObj::DoReadObj4( XclImpStream& rStrm, sal_uInt16 nMacroSize ) void XclImpPolygonObj::DoReadObj5( XclImpStream& rStrm, sal_uInt16 nNameLen, sal_uInt16 nMacroSize ) { ReadFrameData( rStrm ); - rStrm >> mnPolyFlags; + mnPolyFlags = rStrm.ReaduInt16(); rStrm.Ignore( 10 ); - rStrm >> mnPointCount; + mnPointCount = rStrm.ReaduInt16(); rStrm.Ignore( 8 ); ReadName5( rStrm, nNameLen ); ReadMacro5( rStrm, nMacroSize ); @@ -1593,7 +1623,7 @@ void XclImpChartObj::ReadChartSubStream( XclImpStream& rStrm ) { sal_uInt16 nBofType; rStrm.Seek( 2 ); - rStrm >> nBofType; + nBofType = rStrm.ReaduInt16(); DBG_ASSERT( nBofType == EXC_BOF_CHART, "XclImpChartObj::ReadChartSubStream - no chart BOF record" ); } else @@ -1941,7 +1971,7 @@ void XclImpControlHelper::ReadRangeList( ScRangeList& rScRanges, XclImpStream& r if( bWithBoundSize ) { sal_uInt16 nSize; - rStrm >> nSize; + nSize = rStrm.ReaduInt16(); if( nSize > 0 ) { rStrm.PushPosition(); @@ -2123,14 +2153,17 @@ void XclImpCheckBoxObj::DoReadObj5( XclImpStream& rStrm, sal_uInt16 nNameLen, sa { ReadFrameData( rStrm ); rStrm.Ignore( 10 ); - rStrm >> maTextData.maData.mnFlags; + maTextData.maData.mnFlags = rStrm.ReaduInt16(); rStrm.Ignore( 20 ); ReadName5( rStrm, nNameLen ); ReadMacro5( rStrm, rStrm.ReaduInt16() ); // fist macro size invalid and unused ReadCellLinkFormula( rStrm, true ); - rStrm >> maTextData.maData.mnTextLen; + maTextData.maData.mnTextLen = rStrm.ReaduInt16(); maTextData.ReadByteString( rStrm ); - rStrm >> mnState >> maTextData.maData.mnShortcut >> maTextData.maData.mnShortcutEA >> mnCheckBoxFlags; + mnState = rStrm.ReaduInt16(); + maTextData.maData.mnShortcut = rStrm.ReaduInt16(); + maTextData.maData.mnShortcutEA = rStrm.ReaduInt16(); + mnCheckBoxFlags = rStrm.ReaduInt16(); } void XclImpCheckBoxObj::DoReadObj8SubRec( XclImpStream& rStrm, sal_uInt16 nSubRecId, sal_uInt16 nSubRecSize ) @@ -2139,9 +2172,11 @@ void XclImpCheckBoxObj::DoReadObj8SubRec( XclImpStream& rStrm, sal_uInt16 nSubRe { case EXC_ID_OBJCBLS: // do not read EXC_ID_OBJCBLSDATA, not written by OOo Excel export - rStrm >> mnState; + mnState = rStrm.ReaduInt16(); rStrm.Ignore( 4 ); - rStrm >> maTextData.maData.mnShortcut >> maTextData.maData.mnShortcutEA >> mnCheckBoxFlags; + maTextData.maData.mnShortcut = rStrm.ReaduInt16(); + maTextData.maData.mnShortcutEA = rStrm.ReaduInt16(); + mnCheckBoxFlags = rStrm.ReaduInt16(); break; case EXC_ID_OBJCBLSFMLA: ReadCellLinkFormula( rStrm, false ); @@ -2210,15 +2245,19 @@ void XclImpOptionButtonObj::DoReadObj5( XclImpStream& rStrm, sal_uInt16 nNameLen { ReadFrameData( rStrm ); rStrm.Ignore( 10 ); - rStrm >> maTextData.maData.mnFlags; + maTextData.maData.mnFlags = rStrm.ReaduInt16(); rStrm.Ignore( 32 ); ReadName5( rStrm, nNameLen ); ReadMacro5( rStrm, rStrm.ReaduInt16() ); // fist macro size invalid and unused ReadCellLinkFormula( rStrm, true ); - rStrm >> maTextData.maData.mnTextLen; + maTextData.maData.mnTextLen = rStrm.ReaduInt16(); maTextData.ReadByteString( rStrm ); - rStrm >> mnState >> maTextData.maData.mnShortcut >> maTextData.maData.mnShortcutEA; - rStrm >> mnCheckBoxFlags >> mnNextInGroup >> mnFirstInGroup; + mnState = rStrm.ReaduInt16(); + maTextData.maData.mnShortcut = rStrm.ReaduInt16(); + maTextData.maData.mnShortcutEA = rStrm.ReaduInt16(); + mnCheckBoxFlags = rStrm.ReaduInt16(); + mnNextInGroup = rStrm.ReaduInt16(); + mnFirstInGroup = rStrm.ReaduInt16(); } void XclImpOptionButtonObj::DoReadObj8SubRec( XclImpStream& rStrm, sal_uInt16 nSubRecId, sal_uInt16 nSubRecSize ) @@ -2226,7 +2265,8 @@ void XclImpOptionButtonObj::DoReadObj8SubRec( XclImpStream& rStrm, sal_uInt16 nS switch( nSubRecId ) { case EXC_ID_OBJRBODATA: - rStrm >> mnNextInGroup >> mnFirstInGroup; + mnNextInGroup = rStrm.ReaduInt16(); + mnFirstInGroup = rStrm.ReaduInt16(); break; default: XclImpCheckBoxObj::DoReadObj8SubRec( rStrm, nSubRecId, nSubRecSize ); @@ -2328,13 +2368,15 @@ void XclImpGroupBoxObj::DoReadObj5( XclImpStream& rStrm, sal_uInt16 nNameLen, sa { ReadFrameData( rStrm ); rStrm.Ignore( 10 ); - rStrm >> maTextData.maData.mnFlags; + maTextData.maData.mnFlags = rStrm.ReaduInt16(); rStrm.Ignore( 26 ); ReadName5( rStrm, nNameLen ); ReadMacro5( rStrm, rStrm.ReaduInt16() ); // fist macro size invalid and unused - rStrm >> maTextData.maData.mnTextLen; + maTextData.maData.mnTextLen = rStrm.ReaduInt16(); maTextData.ReadByteString( rStrm ); - rStrm >> maTextData.maData.mnShortcut >> maTextData.maData.mnShortcutEA >> mnGroupBoxFlags; + maTextData.maData.mnShortcut = rStrm.ReaduInt16(); + maTextData.maData.mnShortcutEA = rStrm.ReaduInt16( ); + mnGroupBoxFlags = rStrm.ReaduInt16(); } void XclImpGroupBoxObj::DoReadObj8SubRec( XclImpStream& rStrm, sal_uInt16 nSubRecId, sal_uInt16 nSubRecSize ) @@ -2342,7 +2384,9 @@ void XclImpGroupBoxObj::DoReadObj8SubRec( XclImpStream& rStrm, sal_uInt16 nSubRe switch( nSubRecId ) { case EXC_ID_OBJGBODATA: - rStrm >> maTextData.maData.mnShortcut >> maTextData.maData.mnShortcutEA >> mnGroupBoxFlags; + maTextData.maData.mnShortcut = rStrm.ReaduInt16(); + maTextData.maData.mnShortcutEA = rStrm.ReaduInt16(); + mnGroupBoxFlags = rStrm.ReaduInt16(); break; default: XclImpTbxObjBase::DoReadObj8SubRec( rStrm, nSubRecId, nSubRecSize ); @@ -2405,13 +2449,16 @@ void XclImpEditObj::DoReadObj5( XclImpStream& rStrm, sal_uInt16 nNameLen, sal_uI { ReadFrameData( rStrm ); rStrm.Ignore( 10 ); - rStrm >> maTextData.maData.mnFlags; + maTextData.maData.mnFlags = rStrm.ReaduInt16(); rStrm.Ignore( 14 ); ReadName5( rStrm, nNameLen ); ReadMacro5( rStrm, rStrm.ReaduInt16() ); // fist macro size invalid and unused - rStrm >> maTextData.maData.mnTextLen; + maTextData.maData.mnTextLen = rStrm.ReaduInt16(); maTextData.ReadByteString( rStrm ); - rStrm >> mnContentType >> mnMultiLine >> mnScrollBar >> mnListBoxObjId; + mnContentType = rStrm.ReaduInt16(); + mnMultiLine = rStrm.ReaduInt16(); + mnScrollBar = rStrm.ReaduInt16(); + mnListBoxObjId = rStrm.ReaduInt16(); } void XclImpEditObj::DoReadObj8SubRec( XclImpStream& rStrm, sal_uInt16 nSubRecId, sal_uInt16 nSubRecSize ) @@ -2419,7 +2466,10 @@ void XclImpEditObj::DoReadObj8SubRec( XclImpStream& rStrm, sal_uInt16 nSubRecId, switch( nSubRecId ) { case EXC_ID_OBJEDODATA: - rStrm >> mnContentType >> mnMultiLine >> mnScrollBar >> mnListBoxObjId; + mnContentType = rStrm.ReaduInt16(); + mnMultiLine = rStrm.ReaduInt16(); + mnScrollBar = rStrm.ReaduInt16(); + mnListBoxObjId = rStrm.ReaduInt16(); break; default: XclImpTbxObjBase::DoReadObj8SubRec( rStrm, nSubRecId, nSubRecSize ); @@ -2475,7 +2525,14 @@ XclImpTbxObjScrollableBase::XclImpTbxObjScrollableBase( const XclImpRoot& rRoot void XclImpTbxObjScrollableBase::ReadSbs( XclImpStream& rStrm ) { rStrm.Ignore( 4 ); - rStrm >> mnValue >> mnMin >> mnMax >> mnStep >> mnPageStep >> mnOrient >> mnThumbWidth >> mnScrollFlags; + mnValue = rStrm.ReaduInt16(); + mnMin = rStrm.ReaduInt16(); + mnMax = rStrm.ReaduInt16(); + mnStep = rStrm.ReaduInt16(); + mnPageStep = rStrm.ReaduInt16(); + mnOrient = rStrm.ReaduInt16(); + mnThumbWidth = rStrm.ReaduInt16(); + mnScrollFlags = rStrm.ReaduInt16(); } void XclImpTbxObjScrollableBase::DoReadObj8SubRec( XclImpStream& rStrm, sal_uInt16 nSubRecId, sal_uInt16 nSubRecSize ) @@ -2583,7 +2640,10 @@ XclImpTbxObjListBase::XclImpTbxObjListBase( const XclImpRoot& rRoot ) : void XclImpTbxObjListBase::ReadLbsData( XclImpStream& rStrm ) { ReadSourceRangeFormula( rStrm, true ); - rStrm >> mnEntryCount >> mnSelEntry >> mnListFlags >> mnEditObjId; + mnEntryCount = rStrm.ReaduInt16(); + mnSelEntry = rStrm.ReaduInt16(); + mnListFlags = rStrm.ReaduInt16(); + mnEditObjId = rStrm.ReaduInt16(); } void XclImpTbxObjListBase::SetBoxFormatting( ScfPropertySet& rPropSet ) const @@ -2620,7 +2680,7 @@ void XclImpListBoxObj::DoReadObj5( XclImpStream& rStrm, sal_uInt16 nNameLen, sal ReadFrameData( rStrm ); ReadSbs( rStrm ); rStrm.Ignore( 18 ); - rStrm >> maTextData.maData.mnDefFontIdx; + maTextData.maData.mnDefFontIdx = rStrm.ReaduInt16(); rStrm.Ignore( 4 ); ReadName5( rStrm, nNameLen ); ReadMacro5( rStrm, rStrm.ReaduInt16() ); // fist macro size invalid and unused @@ -2705,7 +2765,10 @@ sal_uInt16 XclImpDropDownObj::GetDropDownType() const void XclImpDropDownObj::ReadFullLbsData( XclImpStream& rStrm ) { ReadLbsData( rStrm ); - rStrm >> mnDropDownFlags >> mnLineCount >> mnMinWidth >> maTextData.maData.mnTextLen; + mnDropDownFlags = rStrm.ReaduInt16(); + mnLineCount = rStrm.ReaduInt16(); + mnMinWidth = rStrm.ReaduInt16(); + maTextData.maData.mnTextLen = rStrm.ReaduInt16(); maTextData.ReadByteString( rStrm ); // dropdowns of auto-filters have 'simple' style, they don't have a text area if( GetDropDownType() == EXC_OBJ_DROPDOWN_SIMPLE ) @@ -2717,9 +2780,12 @@ void XclImpDropDownObj::DoReadObj5( XclImpStream& rStrm, sal_uInt16 nNameLen, sa ReadFrameData( rStrm ); ReadSbs( rStrm ); rStrm.Ignore( 18 ); - rStrm >> maTextData.maData.mnDefFontIdx; + maTextData.maData.mnDefFontIdx = rStrm.ReaduInt16(); rStrm.Ignore( 14 ); - rStrm >> mnLeft >> mnTop >> mnRight >> mnBottom; + mnLeft = rStrm.ReaduInt16(); + mnTop = rStrm.ReaduInt16(); + mnRight = rStrm.ReaduInt16(); + mnBottom = rStrm.ReaduInt16(); rStrm.Ignore( 4 ); ReadName5( rStrm, nNameLen ); ReadMacro5( rStrm, rStrm.ReaduInt16() ); // fist macro size invalid and unused @@ -2814,7 +2880,7 @@ void XclImpPictureObj::DoReadObj3( XclImpStream& rStrm, sal_uInt16 nMacroSize ) sal_uInt16 nLinkSize; ReadFrameData( rStrm ); rStrm.Ignore( 6 ); - rStrm >> nLinkSize; + nLinkSize = rStrm.ReaduInt16(); rStrm.Ignore( 2 ); ReadFlags3( rStrm ); ReadMacro3( rStrm, nMacroSize ); @@ -2829,7 +2895,7 @@ void XclImpPictureObj::DoReadObj4( XclImpStream& rStrm, sal_uInt16 nMacroSize ) sal_uInt16 nLinkSize; ReadFrameData( rStrm ); rStrm.Ignore( 6 ); - rStrm >> nLinkSize; + nLinkSize = rStrm.ReaduInt16(); rStrm.Ignore( 2 ); ReadFlags3( rStrm ); ReadMacro4( rStrm, nMacroSize ); @@ -2844,7 +2910,7 @@ void XclImpPictureObj::DoReadObj5( XclImpStream& rStrm, sal_uInt16 nNameLen, sal sal_uInt16 nLinkSize; ReadFrameData( rStrm ); rStrm.Ignore( 6 ); - rStrm >> nLinkSize; + nLinkSize = rStrm.ReaduInt16(); rStrm.Ignore( 2 ); ReadFlags3( rStrm ); rStrm.Ignore( 4 ); @@ -2962,14 +3028,14 @@ void XclImpPictureObj::DoPreProcessSdrObj( XclImpDffConverter& rDffConv, SdrObje void XclImpPictureObj::ReadFlags3( XclImpStream& rStrm ) { sal_uInt16 nFlags; - rStrm >> nFlags; + nFlags = rStrm.ReaduInt16(); mbSymbol = ::get_flag( nFlags, EXC_OBJ_PIC_SYMBOL ); } void XclImpPictureObj::ReadFlags8( XclImpStream& rStrm ) { sal_uInt16 nFlags; - rStrm >> nFlags; + nFlags = rStrm.ReaduInt16(); mbSymbol = ::get_flag( nFlags, EXC_OBJ_PIC_SYMBOL ); mbControl = ::get_flag( nFlags, EXC_OBJ_PIC_CONTROL ); mbUseCtlsStrm = ::get_flag( nFlags, EXC_OBJ_PIC_CTLSSTREAM ); @@ -2983,14 +3049,14 @@ void XclImpPictureObj::ReadPictFmla( XclImpStream& rStrm, sal_uInt16 nLinkSize ) if( nLinkSize >= 6 ) { sal_uInt16 nFmlaSize; - rStrm >> nFmlaSize; + nFmlaSize = rStrm.ReaduInt16(); OSL_ENSURE( nFmlaSize > 0, "XclImpPictureObj::ReadPictFmla - missing link formula" ); // BIFF3/BIFF4 do not support storages, nothing to do here if( (nFmlaSize > 0) && (GetBiff() >= EXC_BIFF5) ) { rStrm.Ignore( 4 ); sal_uInt8 nToken; - rStrm >> nToken; + nToken = rStrm.ReaduInt8(); // different processing for linked vs. embedded OLE objects if( nToken == XclTokenArrayHelper::GetTokenId( EXC_TOKID_NAMEX, EXC_TOKCLASS_REF ) ) @@ -3002,9 +3068,9 @@ void XclImpPictureObj::ReadPictFmla( XclImpStream& rStrm, sal_uInt16 nLinkSize ) { sal_Int16 nRefIdx; sal_uInt16 nNameIdx; - rStrm >> nRefIdx; + nRefIdx = rStrm.ReadInt16(); rStrm.Ignore( 8 ); - rStrm >> nNameIdx; + nNameIdx = rStrm.ReaduInt16(); rStrm.Ignore( 12 ); const ExtName* pExtName = GetOldRoot().pExtNameBuff->GetNameByIndex( nRefIdx, nNameIdx ); if( pExtName && pExtName->IsOLE() ) @@ -3014,7 +3080,8 @@ void XclImpPictureObj::ReadPictFmla( XclImpStream& rStrm, sal_uInt16 nLinkSize ) case EXC_BIFF8: { sal_uInt16 nXti, nExtName; - rStrm >> nXti >> nExtName; + nXti = rStrm.ReaduInt16(); + nExtName = rStrm.ReaduInt16(); const XclImpExtName* pExtName = GetLinkManager().GetExternName( nXti, nExtName ); if( pExtName && (pExtName->GetType() == xlExtOLE) ) mnStorageId = pExtName->GetStorageId(); @@ -3036,7 +3103,7 @@ void XclImpPictureObj::ReadPictFmla( XclImpStream& rStrm, sal_uInt16 nLinkSize ) if( rStrm.GetRecPos() + 2 <= nLinkEnd ) { sal_uInt16 nLen; - rStrm >> nLen; + nLen = rStrm.ReaduInt16(); if( nLen > 0 ) maClassName = (GetBiff() == EXC_BIFF8) ? rStrm.ReadUniString( nLen ) : rStrm.ReadRawByteString( nLen ); } @@ -3068,7 +3135,7 @@ void XclImpPictureObj::ReadPictFmla( XclImpStream& rStrm, sal_uInt16 nLinkSize ) // additional string (16-bit characters), e.g. for progress bar control sal_uInt32 nAddStrSize; - rStrm >> nAddStrSize; + nAddStrSize = rStrm.ReaduInt32(); OSL_ENSURE( rStrm.GetRecLeft() >= nAddStrSize + 4, "XclImpPictureObj::ReadPictFmla - missing data" ); if( rStrm.GetRecLeft() >= nAddStrSize + 4 ) { @@ -3080,7 +3147,7 @@ void XclImpPictureObj::ReadPictFmla( XclImpStream& rStrm, sal_uInt16 nLinkSize ) } else if( mbEmbedded && (rStrm.GetRecLeft() >= 4) ) { - rStrm >> mnStorageId; + mnStorageId = rStrm.ReaduInt32(); } } @@ -3753,7 +3820,9 @@ Graphic XclImpDrawing::ReadImgData( const XclImpRoot& rRoot, XclImpStream& rStrm Graphic aGraphic; sal_uInt16 nFormat, nEnv; sal_uInt32 nDataSize; - rStrm >> nFormat >> nEnv >> nDataSize; + nFormat = rStrm.ReaduInt16(); + nEnv = rStrm.ReaduInt16(); + nDataSize = rStrm.ReaduInt32(); if( nDataSize <= rStrm.GetRecLeft() ) { switch( nFormat ) @@ -3943,7 +4012,11 @@ void XclImpDrawing::ReadBmp( Graphic& rGraphic, const XclImpRoot& rRoot, XclImpS rStrm.PushPosition(); sal_uInt32 nHdrSize; sal_uInt16 nWidth, nHeight, nPlanes, nDepth; - rStrm >> nHdrSize >> nWidth >> nHeight >> nPlanes >> nDepth; + nHdrSize = rStrm.ReaduInt32(); + nWidth = rStrm.ReaduInt16(); + nHeight = rStrm.ReaduInt16(); + nPlanes = rStrm.ReaduInt16(); + nDepth = rStrm.ReaduInt16(); if( (nHdrSize == 12) && (nPlanes == 1) && (nDepth == 32) ) { rStrm.Ignore( 3 ); @@ -4068,7 +4141,8 @@ void XclImpSheetDrawing::ReadNote3( XclImpStream& rStrm ) { XclAddress aXclPos; sal_uInt16 nTotalLen; - rStrm >> aXclPos >> nTotalLen; + rStrm >> aXclPos; + nTotalLen = rStrm.ReaduInt16(); ScAddress aScNotePos( ScAddress::UNINITIALIZED ); if( GetAddressConverter().ConvertAddress( aScNotePos, aXclPos, maScUsedArea.aStart.Tab(), true ) ) @@ -4078,7 +4152,8 @@ void XclImpSheetDrawing::ReadNote3( XclImpStream& rStrm ) nTotalLen = nTotalLen - nPartLen; while( (nTotalLen > 0) && (rStrm.GetNextRecId() == EXC_ID_NOTE) && rStrm.StartNextRecord() ) { - rStrm >> aXclPos >> nPartLen; + rStrm >> aXclPos; + nPartLen = rStrm.ReaduInt16(); OSL_ENSURE( aXclPos.mnRow == 0xFFFF, "XclImpObjectManager::ReadNote3 - missing continuation NOTE record" ); if( aXclPos.mnRow == 0xFFFF ) { @@ -4102,7 +4177,9 @@ void XclImpSheetDrawing::ReadNote8( XclImpStream& rStrm ) { XclAddress aXclPos; sal_uInt16 nFlags, nObjId; - rStrm >> aXclPos >> nFlags >> nObjId; + rStrm >> aXclPos; + nFlags = rStrm.ReaduInt16(); + nObjId = rStrm.ReaduInt16(); ScAddress aScNotePos( ScAddress::UNINITIALIZED ); if( GetAddressConverter().ConvertAddress( aScNotePos, aXclPos, maScUsedArea.aStart.Tab(), true ) ) @@ -4215,7 +4292,7 @@ void XclImpDffPropSet::Read( XclImpStream& rStrm ) rStrm.PushPosition(); rStrm.Ignore( 4 ); - rStrm >> nPropSetSize; + nPropSetSize = rStrm.ReaduInt32(); rStrm.PopPosition(); mxMemStrm.reset( new SvMemoryStream ); diff --git a/sc/source/filter/excel/xihelper.cxx b/sc/source/filter/excel/xihelper.cxx index 4762e669327a..3940b63c99e9 100644 --- a/sc/source/filter/excel/xihelper.cxx +++ b/sc/source/filter/excel/xihelper.cxx @@ -777,14 +777,14 @@ XclImpCachedValue::XclImpCachedValue( XclImpStream& rStrm ) : mfValue( 0.0 ), mnBoolErr( 0 ) { - rStrm >> mnType; + mnType = rStrm.ReaduInt8(); switch( mnType ) { case EXC_CACHEDVAL_EMPTY: rStrm.Ignore( 8 ); break; case EXC_CACHEDVAL_DOUBLE: - rStrm >> mfValue; + mfValue = rStrm.ReadDouble(); break; case EXC_CACHEDVAL_STRING: maStr = rStrm.ReadUniString(); @@ -793,7 +793,7 @@ XclImpCachedValue::XclImpCachedValue( XclImpStream& rStrm ) : case EXC_CACHEDVAL_ERROR: { double fVal; - rStrm >> mnBoolErr; + mnBoolErr = rStrm.ReaduInt8(); rStrm.Ignore( 7 ); const ScTokenArray* pScTokArr = rStrm.GetRoot().GetOldFmlaConverter().GetBoolErr( diff --git a/sc/source/filter/excel/xilink.cxx b/sc/source/filter/excel/xilink.cxx index 51da063dec35..4f31285eacfd 100644 --- a/sc/source/filter/excel/xilink.cxx +++ b/sc/source/filter/excel/xilink.cxx @@ -149,7 +149,10 @@ struct XclImpXti inline XclImpStream& operator>>( XclImpStream& rStrm, XclImpXti& rXti ) { - return rStrm >> rXti.mnSupbook >> rXti.mnSBTabFirst >> rXti.mnSBTabLast; + rXti.mnSupbook = rStrm.ReaduInt16(); + rXti.mnSBTabFirst = rStrm.ReaduInt16(); + rXti.mnSBTabLast = rStrm.ReaduInt16(); + return rStrm; } /** Implementation of the link manager. */ @@ -289,7 +292,7 @@ XclImpExtName::MOper::MOper(svl::SharedStringPool& rPool, XclImpStream& rStrm) : for (SCSIZE nCol = 0; nCol <= nLastCol; ++nCol) { sal_uInt8 nOp; - rStrm >> nOp; + nOp = rStrm.ReaduInt8(); switch (nOp) { case 0x01: @@ -338,7 +341,9 @@ XclImpExtName::XclImpExtName( XclImpSupbook& rSupbook, XclImpStream& rStrm, XclS sal_uInt16 nFlags(0); sal_uInt8 nLen(0); - rStrm >> nFlags >> mnStorageId >> nLen ; + nFlags = rStrm.ReaduInt16(); + mnStorageId = rStrm.ReaduInt32(); + nLen = rStrm.ReaduInt8(); maName = rStrm.ReadUniString( nLen ); if( ::get_flag( nFlags, EXC_EXTN_BUILTIN ) || !::get_flag( nFlags, EXC_EXTN_OLE_OR_DDE ) ) { @@ -376,7 +381,7 @@ XclImpExtName::XclImpExtName( XclImpSupbook& rSupbook, XclImpStream& rStrm, XclS { const ScTokenArray* pArray = NULL; sal_uInt16 nFmlaLen; - rStrm >> nFmlaLen; + nFmlaLen = rStrm.ReaduInt16(); vector<OUString> aTabNames; sal_uInt16 nCount = rSupbook.GetTabCount(); aTabNames.reserve(nCount); @@ -620,7 +625,7 @@ XclImpSupbook::XclImpSupbook( XclImpStream& rStrm ) : mnSBTab( EXC_TAB_DELETED ) { sal_uInt16 nSBTabCnt; - rStrm >> nSBTabCnt; + nSBTabCnt = rStrm.ReaduInt16(); if( rStrm.GetRecLeft() == 2 ) { @@ -673,7 +678,7 @@ XclImpSupbook::XclImpSupbook( XclImpStream& rStrm ) : void XclImpSupbook::ReadXct( XclImpStream& rStrm ) { rStrm.Ignore( 2 ); - rStrm >> mnSBTab; + mnSBTab = rStrm.ReaduInt16(); } void XclImpSupbook::ReadCrn( XclImpStream& rStrm ) @@ -683,7 +688,9 @@ void XclImpSupbook::ReadCrn( XclImpStream& rStrm ) XclImpSupbookTab& rSbTab = maSupbTabList[mnSBTab]; sal_uInt8 nXclColLast, nXclColFirst; sal_uInt16 nXclRow; - rStrm >> nXclColLast >> nXclColFirst >> nXclRow; + nXclColLast = rStrm.ReaduInt8(); + nXclColFirst = rStrm.ReaduInt8(); + nXclRow = rStrm.ReaduInt16(); for( sal_uInt8 nXclCol = nXclColFirst; (nXclCol <= nXclColLast) && (rStrm.GetRecLeft() > 1); ++nXclCol ) rSbTab.ReadCrn( rStrm, XclAddress( nXclCol, nXclRow ) ); @@ -760,7 +767,7 @@ XclImpLinkManagerImpl::XclImpLinkManagerImpl( const XclImpRoot& rRoot ) : void XclImpLinkManagerImpl::ReadExternsheet( XclImpStream& rStrm ) { sal_uInt16 nXtiCount; - rStrm >> nXtiCount; + nXtiCount = rStrm.ReaduInt16(); OSL_ENSURE( static_cast< sal_Size >( nXtiCount * 6 ) == rStrm.GetRecLeft(), "XclImpLinkManagerImpl::ReadExternsheet - invalid count" ); nXtiCount = static_cast< sal_uInt16 >( ::std::min< sal_Size >( nXtiCount, rStrm.GetRecLeft() / 6 ) ); diff --git a/sc/source/filter/excel/xiname.cxx b/sc/source/filter/excel/xiname.cxx index 4a96220bb198..3a69c09e2ec6 100644 --- a/sc/source/filter/excel/xiname.cxx +++ b/sc/source/filter/excel/xiname.cxx @@ -54,9 +54,10 @@ XclImpName::XclImpName( XclImpStream& rStrm, sal_uInt16 nXclNameIdx ) : case EXC_BIFF2: { sal_uInt8 nFlagsBiff2; - rStrm >> nFlagsBiff2; + nFlagsBiff2 = rStrm.ReaduInt8(); rStrm.Ignore( 1 ); - rStrm >> nShortCut >> nNameLen; + nShortCut = rStrm.ReaduInt8(); + nNameLen = rStrm.ReaduInt8(); nFmlaSize = rStrm.ReaduInt8(); ::set_flag( nFlags, EXC_NAME_FUNC, ::get_flag( nFlagsBiff2, EXC_NAME2_FUNC ) ); } @@ -65,14 +66,22 @@ XclImpName::XclImpName( XclImpStream& rStrm, sal_uInt16 nXclNameIdx ) : case EXC_BIFF3: case EXC_BIFF4: { - rStrm >> nFlags >> nShortCut >> nNameLen >> nFmlaSize; + nFlags = rStrm.ReaduInt16(); + nShortCut = rStrm.ReaduInt8(); + nNameLen = rStrm.ReaduInt8(); + nFmlaSize = rStrm.ReaduInt16(); } break; case EXC_BIFF5: case EXC_BIFF8: { - rStrm >> nFlags >> nShortCut >> nNameLen >> nFmlaSize >> nExtSheet >> mnXclTab; + nFlags = rStrm.ReaduInt16(); + nShortCut = rStrm.ReaduInt8(); + nNameLen = rStrm.ReaduInt8(); + nFmlaSize = rStrm.ReaduInt16(); + nExtSheet = rStrm.ReaduInt16(); + mnXclTab = rStrm.ReaduInt16(); rStrm.Ignore( 4 ); } break; diff --git a/sc/source/filter/excel/xipage.cxx b/sc/source/filter/excel/xipage.cxx index d521f898d01b..a3d2b2fa5763 100644 --- a/sc/source/filter/excel/xipage.cxx +++ b/sc/source/filter/excel/xipage.cxx @@ -57,8 +57,12 @@ void XclImpPageSettings::ReadSetup( XclImpStream& rStrm ) // BIFF4 - BIFF8 sal_uInt16 nFlags; - rStrm >> maData.mnPaperSize >> maData.mnScaling >> maData.mnStartPage - >> maData.mnFitToWidth >> maData.mnFitToHeight >> nFlags; + maData.mnPaperSize = rStrm.ReaduInt16(); + maData.mnScaling = rStrm.ReaduInt16(); + maData.mnStartPage = rStrm.ReaduInt16(); + maData.mnFitToWidth = rStrm.ReaduInt16(); + maData.mnFitToHeight = rStrm.ReaduInt16(); + nFlags = rStrm.ReaduInt16(); mbValidPaper = maData.mbValid = !::get_flag( nFlags, EXC_SETUP_INVALID ); maData.mbPrintInRows = ::get_flag( nFlags, EXC_SETUP_INROWS ); @@ -69,8 +73,11 @@ void XclImpPageSettings::ReadSetup( XclImpStream& rStrm ) // new in BIFF5 - BIFF8 if( GetBiff() >= EXC_BIFF5 ) { - rStrm >> maData.mnHorPrintRes >> maData.mnVerPrintRes - >> maData.mfHeaderMargin >> maData.mfFooterMargin >> maData.mnCopies; + maData.mnHorPrintRes = rStrm.ReaduInt16(); + maData.mnVerPrintRes = rStrm.ReaduInt16(); + maData.mfHeaderMargin = rStrm.ReadDouble(); + maData.mfFooterMargin = rStrm.ReadDouble(); + maData.mnCopies = rStrm.ReaduInt16(); maData.mbDraftQuality = ::get_flag( nFlags, EXC_SETUP_DRAFT ); maData.mbPrintNotes = ::get_flag( nFlags, EXC_SETUP_PRINTNOTES ); @@ -82,10 +89,10 @@ void XclImpPageSettings::ReadMargin( XclImpStream& rStrm ) { switch( rStrm.GetRecId() ) { - case EXC_ID_LEFTMARGIN: rStrm >> maData.mfLeftMargin; break; - case EXC_ID_RIGHTMARGIN: rStrm >> maData.mfRightMargin; break; - case EXC_ID_TOPMARGIN: rStrm >> maData.mfTopMargin; break; - case EXC_ID_BOTTOMMARGIN: rStrm >> maData.mfBottomMargin; break; + case EXC_ID_LEFTMARGIN: maData.mfLeftMargin = rStrm.ReadDouble(); break; + case EXC_ID_RIGHTMARGIN: maData.mfRightMargin = rStrm.ReadDouble(); break; + case EXC_ID_TOPMARGIN: maData.mfTopMargin = rStrm.ReadDouble(); break; + case EXC_ID_BOTTOMMARGIN: maData.mfBottomMargin = rStrm.ReadDouble(); break; default: OSL_FAIL( "XclImpPageSettings::ReadMargin - unknown record" ); } } @@ -131,13 +138,13 @@ void XclImpPageSettings::ReadPageBreaks( XclImpStream& rStrm ) bool bIgnore = GetBiff() == EXC_BIFF8; // ignore start/end columns or rows in BIFF8 sal_uInt16 nCount, nBreak; - rStrm >> nCount; + nCount = rStrm.ReaduInt16(); pVec->clear(); pVec->reserve( nCount ); while( nCount-- ) { - rStrm >> nBreak; + nBreak = rStrm.ReaduInt16(); if( nBreak ) pVec->push_back( nBreak ); if( bIgnore ) diff --git a/sc/source/filter/excel/xipivot.cxx b/sc/source/filter/excel/xipivot.cxx index 2b48bcb116b0..178d145eb49b 100644 --- a/sc/source/filter/excel/xipivot.cxx +++ b/sc/source/filter/excel/xipivot.cxx @@ -159,7 +159,12 @@ void XclImpPCItem::ReadSxdatetime( XclImpStream& rStrm ) OSL_ENSURE( rStrm.GetRecSize() == 8, "XclImpPCItem::ReadSxdatetime - wrong record size" ); sal_uInt16 nYear, nMonth; sal_uInt8 nDay, nHour, nMin, nSec; - rStrm >> nYear >> nMonth >> nDay >> nHour >> nMin >> nSec; + nYear = rStrm.ReaduInt16(); + nMonth = rStrm.ReaduInt16(); + nDay = rStrm.ReaduInt8(); + nHour = rStrm.ReaduInt8(); + nMin = rStrm.ReaduInt8(); + nSec = rStrm.ReaduInt8(); SetDateTime( DateTime( Date( nDay, nMonth, nYear ), tools::Time( nHour, nMin, nSec ) ) ); } @@ -377,7 +382,7 @@ void XclImpPCField::ReadSxgroupinfo( XclImpStream& rStrm ) size_t nSize = rStrm.GetRecLeft() / 2; maGroupOrder.resize( nSize, 0 ); for( size_t nIdx = 0; nIdx < nSize; ++nIdx ) - rStrm >> maGroupOrder[ nIdx ]; + maGroupOrder[ nIdx ] = rStrm.ReaduInt16(); } // grouping ------------------------------------------------------------------- @@ -606,12 +611,12 @@ const XclImpPCField* XclImpPivotCache::GetField( sal_uInt16 nFieldIdx ) const void XclImpPivotCache::ReadSxidstm( XclImpStream& rStrm ) { - rStrm >> mnStrmId; + mnStrmId = rStrm.ReaduInt16(); } void XclImpPivotCache::ReadSxvs( XclImpStream& rStrm ) { - rStrm >> mnSrcType; + mnSrcType = rStrm.ReaduInt16(); GetTracer().TracePivotDataSource( mnSrcType != EXC_SXVS_SHEET ); } @@ -645,7 +650,7 @@ void XclImpPivotCache::ReadDConName( XclImpStream& rStrm ) // indicates that the name has a workbook scope. For now, we only support // internal defined name with a workbook scope. sal_uInt16 nFlag; - rStrm >> nFlag; + nFlag = rStrm.ReaduInt16(); mbSelfRef = (nFlag == 0); if (!mbSelfRef) @@ -1286,7 +1291,7 @@ void XclImpPivotTable::ReadSxivd( XclImpStream& rStrm ) for( sal_uInt16 nIdx = 0; nIdx < nSize; ++nIdx ) { sal_uInt16 nFieldIdx; - rStrm >> nFieldIdx; + nFieldIdx = rStrm.ReaduInt16(); pFieldVec->push_back( nFieldIdx ); // set orientation at special data orientation field diff --git a/sc/source/filter/excel/xistream.cxx b/sc/source/filter/excel/xistream.cxx index 7b42b8812d2a..8be07596abc0 100644 --- a/sc/source/filter/excel/xistream.cxx +++ b/sc/source/filter/excel/xistream.cxx @@ -590,177 +590,110 @@ sal_uInt16 XclImpStream::PeekRecId( sal_Size nPos ) return nRecId; } -XclImpStream& XclImpStream::operator>>( sal_Int8& rnValue ) -{ - if( EnsureRawReadSize( 1 ) ) - { - if( mbUseDecr ) - mxDecrypter->Read( mrStrm, &rnValue, 1 ); - else - mrStrm.ReadSChar( rnValue ); - --mnRawRecLeft; - } - return *this; -} - -XclImpStream& XclImpStream::operator>>( sal_uInt8& rnValue ) +sal_uInt8 XclImpStream::ReaduInt8() { + sal_uInt8 nValue = 0; if( EnsureRawReadSize( 1 ) ) { if( mbUseDecr ) - mxDecrypter->Read( mrStrm, &rnValue, 1 ); + mxDecrypter->Read( mrStrm, &nValue, 1 ); else - mrStrm.ReadUChar( rnValue ); + mrStrm.ReadUChar( nValue ); --mnRawRecLeft; } - return *this; + return nValue; } -XclImpStream& XclImpStream::operator>>( sal_Int16& rnValue ) +sal_Int16 XclImpStream::ReadInt16() { + sal_Int16 nValue = 0; if( EnsureRawReadSize( 2 ) ) { if( mbUseDecr ) { SVBT16 pnBuffer; mxDecrypter->Read( mrStrm, pnBuffer, 2 ); - rnValue = static_cast< sal_Int16 >( SVBT16ToShort( pnBuffer ) ); + nValue = static_cast< sal_Int16 >( SVBT16ToShort( pnBuffer ) ); } else - mrStrm.ReadInt16( rnValue ); + mrStrm.ReadInt16( nValue ); mnRawRecLeft -= 2; } - return *this; + return nValue; } -XclImpStream& XclImpStream::operator>>( sal_uInt16& rnValue ) +sal_uInt16 XclImpStream::ReaduInt16() { + sal_uInt16 nValue = 0; if( EnsureRawReadSize( 2 ) ) { if( mbUseDecr ) { SVBT16 pnBuffer; mxDecrypter->Read( mrStrm, pnBuffer, 2 ); - rnValue = SVBT16ToShort( pnBuffer ); + nValue = SVBT16ToShort( pnBuffer ); } else - mrStrm.ReadUInt16( rnValue ); + mrStrm.ReadUInt16( nValue ); mnRawRecLeft -= 2; } - return *this; -} - -XclImpStream& XclImpStream::operator>>( sal_Int32& rnValue ) -{ - if( EnsureRawReadSize( 4 ) ) - { - if( mbUseDecr ) - { - SVBT32 pnBuffer; - mxDecrypter->Read( mrStrm, pnBuffer, 4 ); - rnValue = static_cast< sal_Int32 >( SVBT32ToUInt32( pnBuffer ) ); - } - else - mrStrm.ReadInt32( rnValue ); - mnRawRecLeft -= 4; - } - return *this; + return nValue; } -XclImpStream& XclImpStream::operator>>( sal_uInt32& rnValue ) +sal_Int32 XclImpStream::ReadInt32() { + sal_Int32 nValue = 0; if( EnsureRawReadSize( 4 ) ) { if( mbUseDecr ) { SVBT32 pnBuffer; mxDecrypter->Read( mrStrm, pnBuffer, 4 ); - rnValue = SVBT32ToUInt32( pnBuffer ); + nValue = static_cast< sal_Int32 >( SVBT32ToUInt32( pnBuffer ) ); } else - mrStrm.ReadUInt32( rnValue ); + mrStrm.ReadInt32( nValue ); mnRawRecLeft -= 4; } - return *this; + return nValue; } -XclImpStream& XclImpStream::operator>>( float& rfValue ) +sal_uInt32 XclImpStream::ReaduInt32() { + sal_uInt32 nValue = 0; if( EnsureRawReadSize( 4 ) ) { if( mbUseDecr ) { SVBT32 pnBuffer; mxDecrypter->Read( mrStrm, pnBuffer, 4 ); - sal_uInt32 nValue = SVBT32ToUInt32( pnBuffer ); - memcpy( &rfValue, &nValue, 4 ); + nValue = SVBT32ToUInt32( pnBuffer ); } else - mrStrm.ReadFloat( rfValue ); + mrStrm.ReadUInt32( nValue ); mnRawRecLeft -= 4; } - return *this; + return nValue; } -XclImpStream& XclImpStream::operator>>( double& rfValue ) +double XclImpStream::ReadDouble() { + double nValue = 0; if( EnsureRawReadSize( 8 ) ) { if( mbUseDecr ) { SVBT64 pnBuffer; mxDecrypter->Read( mrStrm, pnBuffer, 8 ); - rfValue = SVBT64ToDouble( pnBuffer ); + nValue = SVBT64ToDouble( pnBuffer ); } else - mrStrm.ReadDouble( rfValue ); + mrStrm.ReadDouble( nValue ); mnRawRecLeft -= 8; } - return *this; -} - -sal_uInt8 XclImpStream::ReaduInt8() -{ - sal_uInt8 nValue(0); - operator>>( nValue ); - return nValue; -} - -sal_Int16 XclImpStream::ReadInt16() -{ - sal_Int16 nValue(0); - operator>>( nValue ); - return nValue; -} - -sal_uInt16 XclImpStream::ReaduInt16() -{ - sal_uInt16 nValue(0); - operator>>( nValue ); - return nValue; -} - -sal_Int32 XclImpStream::ReadInt32() -{ - sal_Int32 nValue(0); - operator>>( nValue ); return nValue; } -sal_uInt32 XclImpStream::ReaduInt32() -{ - sal_uInt32 nValue(0); - operator>>( nValue ); - return nValue; -} - -double XclImpStream::ReadDouble() -{ - double fValue(0.0); - operator>>( fValue ); - return fValue; -} - sal_Size XclImpStream::Read( void* pData, sal_Size nBytes ) { sal_Size nRet = 0; @@ -902,7 +835,7 @@ OUString XclImpStream::ReadRawUniString( sal_uInt16 nChars, bool b16Bit ) sal_uInt16 nReadChar; for( ; IsValid() && (pcUniChar < pcEndChar); ++pcUniChar ) { - operator>>( nReadChar ); + nReadChar = ReaduInt16(); (*pcUniChar) = (nReadChar == EXC_NUL) ? mcNulSubst : static_cast< sal_Unicode >( nReadChar ); } } @@ -911,7 +844,7 @@ OUString XclImpStream::ReadRawUniString( sal_uInt16 nChars, bool b16Bit ) sal_uInt8 nReadChar; for( ; IsValid() && (pcUniChar < pcEndChar); ++pcUniChar ) { - operator>>( nReadChar ); + nReadChar = ReaduInt8(); (*pcUniChar) = (nReadChar == EXC_NUL_C) ? mcNulSubst : static_cast< sal_Unicode >( nReadChar ); } } diff --git a/sc/source/filter/excel/xistring.cxx b/sc/source/filter/excel/xistring.cxx index c4165dd8b9c8..2fafbbeec841 100644 --- a/sc/source/filter/excel/xistring.cxx +++ b/sc/source/filter/excel/xistring.cxx @@ -66,7 +66,7 @@ void XclImpString::Read( XclImpStream& rStrm, XclStrFlags nFlags ) sal_uInt16 nChars = b16BitLen ? rStrm.ReaduInt16() : rStrm.ReaduInt8(); sal_uInt8 nFlagField = 0; if( nChars || !::get_flag( nFlags, EXC_STR_SMARTFLAGS ) ) - rStrm >> nFlagField; + nFlagField = rStrm.ReaduInt8(); bool b16Bit, bRich, bFarEast; sal_uInt16 nRunCount; @@ -119,7 +119,8 @@ void XclImpString::ReadFormats( XclImpStream& rStrm, XclFormatRunVec& rFormats, for( sal_uInt16 nIdx = 0; nIdx < nRunCount; ++nIdx ) { sal_uInt16 nChar, nFontIdx; - rStrm >> nChar >> nFontIdx; + nChar = rStrm.ReaduInt16(); + nFontIdx = rStrm.ReaduInt16(); AppendFormat( rFormats, nChar, nFontIdx ); } } @@ -128,7 +129,8 @@ void XclImpString::ReadFormats( XclImpStream& rStrm, XclFormatRunVec& rFormats, for( sal_uInt16 nIdx = 0; nIdx < nRunCount; ++nIdx ) { sal_uInt8 nChar, nFontIdx; - rStrm >> nChar >> nFontIdx; + nChar = rStrm.ReaduInt8(); + nFontIdx = rStrm.ReaduInt8(); AppendFormat( rFormats, nChar, nFontIdx ); } } @@ -143,7 +145,8 @@ void XclImpString::ReadObjFormats( XclImpStream& rStrm, XclFormatRunVec& rFormat for( sal_uInt16 nIdx = 0; nIdx < nRunCount; ++nIdx ) { sal_uInt16 nChar, nFontIdx; - rStrm >> nChar >> nFontIdx; + nChar = rStrm.ReaduInt16(); + nFontIdx = rStrm.ReaduInt16(); rStrm.Ignore( 4 ); AppendFormat( rFormats, nChar, nFontIdx ); } diff --git a/sc/source/filter/excel/xistyle.cxx b/sc/source/filter/excel/xistyle.cxx index 63f8f57e94b9..8670051769e9 100644 --- a/sc/source/filter/excel/xistyle.cxx +++ b/sc/source/filter/excel/xistyle.cxx @@ -149,7 +149,7 @@ ColorData XclImpPalette::GetColorData( sal_uInt16 nXclIndex ) const void XclImpPalette::ReadPalette( XclImpStream& rStrm ) { sal_uInt16 nCount; - rStrm >> nCount; + nCount = rStrm.ReaduInt16(); const size_t nMinRecordSize = 4; const size_t nMaxRecords = rStrm.GetRecLeft() / nMinRecordSize; @@ -272,11 +272,17 @@ void XclImpFont::ReadCFFontBlock( XclImpStream& rStrm ) sal_uInt8 nUnderl; rStrm.Ignore( 64 ); - rStrm >> nHeight >> nStyle >> nWeight >> nEscapem >> nUnderl; + nHeight = rStrm.ReaduInt32(); + nStyle = rStrm.ReaduInt32(); + nWeight = rStrm.ReaduInt16(); + nEscapem = rStrm.ReaduInt16(); + nUnderl = rStrm.ReaduInt8(); rStrm.Ignore( 3 ); - rStrm >> nColor; + nColor = rStrm.ReaduInt32(); rStrm.Ignore( 4 ); - rStrm >> nFontFlags1 >> nFontFlags2 >> nFontFlags3; + nFontFlags1 = rStrm.ReaduInt32(); + nFontFlags2 = rStrm.ReaduInt32(); + nFontFlags3 = rStrm.ReaduInt32(); rStrm.Ignore( 18 ); if( (mbHeightUsed = (nHeight <= 0x7FFF)) == true ) @@ -401,7 +407,8 @@ void XclImpFont::WriteFontProperties( ScfPropertySet& rPropSet, void XclImpFont::ReadFontData2( XclImpStream& rStrm ) { sal_uInt16 nFlags; - rStrm >> maData.mnHeight >> nFlags; + maData.mnHeight = rStrm.ReaduInt16(); + nFlags = rStrm.ReaduInt16(); maData.mnWeight = ::get_flagvalue( nFlags, EXC_FONTATTR_BOLD, EXC_FONTWGHT_BOLD, EXC_FONTWGHT_NORMAL ); maData.mnUnderline = ::get_flagvalue( nFlags, EXC_FONTATTR_UNDERLINE, EXC_FONTUNDERL_SINGLE, EXC_FONTUNDERL_NONE ); @@ -416,9 +423,14 @@ void XclImpFont::ReadFontData5( XclImpStream& rStrm ) { sal_uInt16 nFlags; - rStrm >> maData.mnHeight >> nFlags; + maData.mnHeight = rStrm.ReaduInt16(); + nFlags = rStrm.ReaduInt16(); ReadFontColor( rStrm ); - rStrm >> maData.mnWeight >> maData.mnEscapem >> maData.mnUnderline >> maData.mnFamily >> maData.mnCharSet; + maData.mnWeight = rStrm.ReaduInt16(); + maData.mnEscapem = rStrm.ReaduInt16(); + maData.mnUnderline = rStrm.ReaduInt8(); + maData.mnFamily = rStrm.ReaduInt8(); + maData.mnCharSet = rStrm.ReaduInt8(); rStrm.Ignore( 1 ); maData.mbItalic = ::get_flag( nFlags, EXC_FONTATTR_ITALIC ); @@ -635,12 +647,12 @@ void XclImpNumFmtBuffer::ReadFormat( XclImpStream& rStrm ) break; case EXC_BIFF5: - rStrm >> mnNextXclIdx; + mnNextXclIdx = rStrm.ReaduInt16(); aFormat = rStrm.ReadByteString( false ); break; case EXC_BIFF8: - rStrm >> mnNextXclIdx; + mnNextXclIdx = rStrm.ReaduInt16(); aFormat = rStrm.ReadUniString(); break; @@ -663,7 +675,7 @@ sal_uInt16 XclImpNumFmtBuffer::ReadCFFormat( XclImpStream& rStrm, bool bIFmt ) { rStrm.Ignore(1); sal_uInt8 nIndex; - rStrm >> nIndex; + nIndex = rStrm.ReaduInt8(); return nIndex; } else @@ -1092,9 +1104,10 @@ XclImpXF::~XclImpXF() void XclImpXF::ReadXF2( XclImpStream& rStrm ) { sal_uInt8 nReadFont, nReadNumFmt, nFlags; - rStrm >> nReadFont; + nReadFont = rStrm.ReaduInt8(); rStrm.Ignore( 1 ); - rStrm >> nReadNumFmt >> nFlags; + nReadNumFmt = rStrm.ReaduInt8(); + nFlags = rStrm.ReaduInt8(); // XF type always cell, no parent, used flags always true SetAllUsedFlags( true ); @@ -1113,7 +1126,12 @@ void XclImpXF::ReadXF3( XclImpStream& rStrm ) sal_uInt32 nBorder; sal_uInt16 nTypeProt, nAlign, nArea; sal_uInt8 nReadFont, nReadNumFmt; - rStrm >> nReadFont >> nReadNumFmt >> nTypeProt >> nAlign >> nArea >> nBorder; + nReadFont = rStrm.ReaduInt8(); + nReadNumFmt = rStrm.ReaduInt8(); + nTypeProt = rStrm.ReaduInt16(); + nAlign = rStrm.ReaduInt16(); + nArea = rStrm.ReaduInt16(); + nBorder = rStrm.ReaduInt32(); // XF type/parent, attribute used flags mbCellXF = !::get_flag( nTypeProt, EXC_XF_STYLE ); // new in BIFF3 @@ -1134,7 +1152,12 @@ void XclImpXF::ReadXF4( XclImpStream& rStrm ) sal_uInt32 nBorder; sal_uInt16 nTypeProt, nAlign, nArea; sal_uInt8 nReadFont, nReadNumFmt; - rStrm >> nReadFont >> nReadNumFmt >> nTypeProt >> nAlign >> nArea >> nBorder; + nReadFont = rStrm.ReaduInt8(); + nReadNumFmt = rStrm.ReaduInt8(); + nTypeProt = rStrm.ReaduInt16(); + nAlign = rStrm.ReaduInt16(); + nArea = rStrm.ReaduInt16(); + nBorder = rStrm.ReaduInt32(); // XF type/parent, attribute used flags mbCellXF = !::get_flag( nTypeProt, EXC_XF_STYLE ); @@ -1154,7 +1177,12 @@ void XclImpXF::ReadXF5( XclImpStream& rStrm ) { sal_uInt32 nArea, nBorder; sal_uInt16 nTypeProt, nAlign; - rStrm >> mnXclFont >> mnXclNumFmt >> nTypeProt >> nAlign >> nArea >> nBorder; + mnXclFont = rStrm.ReaduInt16(); + mnXclNumFmt = rStrm.ReaduInt16(); + nTypeProt = rStrm.ReaduInt16(); + nAlign = rStrm.ReaduInt16(); + nArea = rStrm.ReaduInt32(); + nBorder = rStrm.ReaduInt32(); // XF type/parent, attribute used flags mbCellXF = !::get_flag( nTypeProt, EXC_XF_STYLE ); @@ -1172,7 +1200,14 @@ void XclImpXF::ReadXF8( XclImpStream& rStrm ) { sal_uInt32 nBorder1, nBorder2; sal_uInt16 nTypeProt, nAlign, nMiscAttrib, nArea; - rStrm >> mnXclFont >> mnXclNumFmt >> nTypeProt >> nAlign >> nMiscAttrib >> nBorder1 >> nBorder2 >> nArea; + mnXclFont = rStrm.ReaduInt16(); + mnXclNumFmt = rStrm.ReaduInt16(); + nTypeProt = rStrm.ReaduInt16(); + nAlign = rStrm.ReaduInt16(); + nMiscAttrib = rStrm.ReaduInt16(); + nBorder1 = rStrm.ReaduInt32(); + nBorder2 = rStrm.ReaduInt32( ); + nArea = rStrm.ReaduInt16(); // XF type/parent, attribute used flags mbCellXF = !::get_flag( nTypeProt, EXC_XF_STYLE ); @@ -1444,13 +1479,14 @@ void XclImpStyle::ReadStyle( XclImpStream& rStrm ) OSL_ENSURE_BIFF( GetBiff() >= EXC_BIFF3 ); sal_uInt16 nXFIndex; - rStrm >> nXFIndex; + nXFIndex = rStrm.ReaduInt16(); mnXfId = nXFIndex & EXC_STYLE_XFMASK; mbBuiltin = ::get_flag( nXFIndex, EXC_STYLE_BUILTIN ); if( mbBuiltin ) { - rStrm >> mnBuiltinId >> mnLevel; + mnBuiltinId = rStrm.ReaduInt8(); + mnLevel = rStrm.ReaduInt8(); } else { @@ -1460,14 +1496,15 @@ void XclImpStyle::ReadStyle( XclImpStream& rStrm ) { sal_uInt8 nExtFlags; rStrm.Ignore( 12 ); - rStrm >> nExtFlags; + nExtFlags = rStrm.ReaduInt8(); mbBuiltin = ::get_flag( nExtFlags, EXC_STYLEEXT_BUILTIN ); mbCustom = ::get_flag( nExtFlags, EXC_STYLEEXT_CUSTOM ); mbHidden = ::get_flag( nExtFlags, EXC_STYLEEXT_HIDDEN ); if( mbBuiltin ) { rStrm.Ignore( 1 ); // category - rStrm >> mnBuiltinId >> mnLevel; + mnBuiltinId = rStrm.ReaduInt8(); + mnLevel = rStrm.ReaduInt8(); } } } diff --git a/sc/source/filter/excel/xiview.cxx b/sc/source/filter/excel/xiview.cxx index e7b91d4d804f..4e5ffc6fdf44 100644 --- a/sc/source/filter/excel/xiview.cxx +++ b/sc/source/filter/excel/xiview.cxx @@ -34,17 +34,17 @@ XclImpDocViewSettings::XclImpDocViewSettings( const XclImpRoot& rRoot ) : void XclImpDocViewSettings::ReadWindow1( XclImpStream& rStrm ) { - rStrm >> maData.mnWinX - >> maData.mnWinY - >> maData.mnWinWidth - >> maData.mnWinHeight - >> maData.mnFlags; + maData.mnWinX = rStrm.ReaduInt16(); + maData.mnWinY = rStrm.ReaduInt16(); + maData.mnWinWidth = rStrm.ReaduInt16(); + maData.mnWinHeight = rStrm.ReaduInt16(); + maData.mnFlags = rStrm.ReaduInt16(); if( GetBiff() >= EXC_BIFF5 ) { - rStrm >> maData.mnDisplXclTab - >> maData.mnFirstVisXclTab - >> maData.mnXclSelectCnt - >> maData.mnTabBarWidth; + maData.mnDisplXclTab = rStrm.ReaduInt16(); + maData.mnFirstVisXclTab = rStrm.ReaduInt16(); + maData.mnXclSelectCnt = rStrm.ReaduInt16(); + maData.mnTabBarWidth = rStrm.ReaduInt16(); } } @@ -128,7 +128,8 @@ void XclImpTabViewSettings::ReadWindow2( XclImpStream& rStrm, bool bChart ) else { sal_uInt16 nFlags; - rStrm >> nFlags >> maData.maFirstXclPos; + nFlags = rStrm.ReaduInt16(); + rStrm >> maData.maFirstXclPos; // #i59590# real life: Excel ignores some view settings in chart sheets maData.mbSelected = ::get_flag( nFlags, EXC_WIN2_SELECTED ); @@ -153,12 +154,13 @@ void XclImpTabViewSettings::ReadWindow2( XclImpStream& rStrm, bool bChart ) case EXC_BIFF8: { sal_uInt16 nGridColorIdx; - rStrm >> nGridColorIdx; + nGridColorIdx = rStrm.ReaduInt16(); // zoom data not included in chart sheets if( rStrm.GetRecLeft() >= 6 ) { rStrm.Ignore( 2 ); - rStrm >> maData.mnPageZoom >> maData.mnNormalZoom; + maData.mnPageZoom = rStrm.ReaduInt16(); + maData.mnNormalZoom = rStrm.ReaduInt16(); } if( !maData.mbDefGridColor ) @@ -177,7 +179,8 @@ void XclImpTabViewSettings::ReadWindow2( XclImpStream& rStrm, bool bChart ) void XclImpTabViewSettings::ReadScl( XclImpStream& rStrm ) { sal_uInt16 nNum, nDenom; - rStrm >> nNum >> nDenom; + nNum = rStrm.ReaduInt16(); + nDenom = rStrm.ReaduInt16(); OSL_ENSURE( nDenom > 0, "XclImpPageSettings::ReadScl - invalid denominator" ); if( nDenom > 0 ) maData.mnCurrentZoom = limit_cast< sal_uInt16 >( (nNum * 100) / nDenom ); @@ -185,21 +188,22 @@ void XclImpTabViewSettings::ReadScl( XclImpStream& rStrm ) void XclImpTabViewSettings::ReadPane( XclImpStream& rStrm ) { - rStrm >> maData.mnSplitX; + maData.mnSplitX = rStrm.ReaduInt16(); maData.mnSplitY = rStrm.ReaduInt16(); - rStrm >> maData.maSecondXclPos - >> maData.mnActivePane; + rStrm >> maData.maSecondXclPos; + maData.mnActivePane = rStrm.ReaduInt8(); } void XclImpTabViewSettings::ReadSelection( XclImpStream& rStrm ) { // pane of this selection sal_uInt8 nPane; - rStrm >> nPane; + nPane = rStrm.ReaduInt8(); XclSelectionData& rSelData = maData.CreateSelectionData( nPane ); // cursor position and selection - rStrm >> rSelData.maXclCursor >> rSelData.mnCursorIdx; + rStrm >> rSelData.maXclCursor; + rSelData.mnCursorIdx = rStrm.ReaduInt16(); rSelData.maXclSelection.Read( rStrm, false ); } diff --git a/sc/source/filter/excel/xladdress.cxx b/sc/source/filter/excel/xladdress.cxx index 4e0fb7dbee4d..85418ca85620 100644 --- a/sc/source/filter/excel/xladdress.cxx +++ b/sc/source/filter/excel/xladdress.cxx @@ -28,7 +28,7 @@ void XclAddress::Read( XclImpStream& rStrm, bool bCol16Bit ) { mnRow = rStrm.ReaduInt16(); if( bCol16Bit ) - rStrm >> mnCol; + mnCol = rStrm.ReaduInt16(); else mnCol = rStrm.ReaduInt8(); } @@ -54,7 +54,10 @@ void XclRange::Read( XclImpStream& rStrm, bool bCol16Bit ) maLast.mnRow = rStrm.ReaduInt16(); if( bCol16Bit ) - rStrm >> maFirst.mnCol >> maLast.mnCol; + { + maFirst.mnCol = rStrm.ReaduInt16(); + maLast.mnCol = rStrm.ReaduInt16(); + } else { maFirst.mnCol = rStrm.ReaduInt8(); @@ -95,7 +98,7 @@ void XclRangeList::Read( XclImpStream& rStrm, bool bCol16Bit, sal_uInt16 nCountI if (nCountInStream) nCount = nCountInStream; else - rStrm >> nCount; + nCount = rStrm.ReaduInt16(); size_t nOldSize = mRanges.size(); mRanges.resize( nOldSize + nCount ); for( XclRangeVector::iterator aIt = mRanges.begin() + nOldSize; rStrm.IsValid() && (nCount > 0); --nCount, ++aIt ) diff --git a/sc/source/filter/excel/xlescher.cxx b/sc/source/filter/excel/xlescher.cxx index 986d77cf8a51..5134f23a2dbd 100644 --- a/sc/source/filter/excel/xlescher.cxx +++ b/sc/source/filter/excel/xlescher.cxx @@ -213,11 +213,11 @@ XclObjLineData::XclObjLineData() : XclImpStream& operator>>( XclImpStream& rStrm, XclObjLineData& rLineData ) { - return rStrm - >> rLineData.mnColorIdx - >> rLineData.mnStyle - >> rLineData.mnWidth - >> rLineData.mnAuto; + rLineData.mnColorIdx = rStrm.ReaduInt8(); + rLineData.mnStyle = rStrm.ReaduInt8(); + rLineData.mnWidth = rStrm.ReaduInt8(); + rLineData.mnAuto = rStrm.ReaduInt8(); + return rStrm; } XclObjFillData::XclObjFillData() : @@ -230,11 +230,11 @@ XclObjFillData::XclObjFillData() : XclImpStream& operator>>( XclImpStream& rStrm, XclObjFillData& rFillData ) { - return rStrm - >> rFillData.mnBackColorIdx - >> rFillData.mnPattColorIdx - >> rFillData.mnPattern - >> rFillData.mnAuto; + rFillData.mnBackColorIdx = rStrm.ReaduInt8(); + rFillData.mnPattColorIdx = rStrm.ReaduInt8(); + rFillData.mnPattern = rStrm.ReaduInt8(); + rFillData.mnAuto = rStrm.ReaduInt8(); + return rStrm; } XclObjTextData::XclObjTextData() : @@ -252,30 +252,42 @@ XclObjTextData::XclObjTextData() : void XclObjTextData::ReadObj3( XclImpStream& rStrm ) { - rStrm >> mnTextLen; + mnTextLen = rStrm.ReaduInt16(); rStrm.Ignore( 2 ); - rStrm >> mnFormatSize >> mnDefFontIdx; + mnFormatSize = rStrm.ReaduInt16(); + mnDefFontIdx = rStrm.ReaduInt16(); rStrm.Ignore( 2 ); - rStrm >> mnFlags >> mnOrient; + mnFlags = rStrm.ReaduInt16(); + mnOrient = rStrm.ReaduInt16(); rStrm.Ignore( 8 ); } void XclObjTextData::ReadObj5( XclImpStream& rStrm ) { - rStrm >> mnTextLen; + mnTextLen = rStrm.ReaduInt16(); rStrm.Ignore( 2 ); - rStrm >> mnFormatSize >> mnDefFontIdx; + mnFormatSize = rStrm.ReaduInt16(); + mnDefFontIdx = rStrm.ReaduInt16(); rStrm.Ignore( 2 ); - rStrm >> mnFlags >> mnOrient; + mnFlags = rStrm.ReaduInt16(); + mnOrient = rStrm.ReaduInt16(); rStrm.Ignore( 2 ); - rStrm >> mnLinkSize; + mnLinkSize = rStrm.ReaduInt16(); rStrm.Ignore( 2 ); - rStrm >> mnButtonFlags >> mnShortcut >> mnShortcutEA; + mnButtonFlags = rStrm.ReaduInt16(); + mnShortcut = rStrm.ReaduInt16(); + mnShortcutEA = rStrm.ReaduInt16(); } void XclObjTextData::ReadTxo8( XclImpStream& rStrm ) { - rStrm >> mnFlags >> mnOrient >> mnButtonFlags >> mnShortcut >> mnShortcutEA >> mnTextLen >> mnFormatSize; + mnFlags = rStrm.ReaduInt16(); + mnOrient = rStrm.ReaduInt16(); + mnButtonFlags = rStrm.ReaduInt16(); + mnShortcut = rStrm.ReaduInt16(); + mnShortcutEA = rStrm.ReaduInt16(); + mnTextLen = rStrm.ReaduInt16(); + mnFormatSize = rStrm.ReaduInt16(); } Reference< XControlModel > XclControlHelper::GetControlModel( Reference< XShape > xShape ) diff --git a/sc/source/filter/excel/xlformula.cxx b/sc/source/filter/excel/xlformula.cxx index d50b163e8d4d..c5ff9806b330 100644 --- a/sc/source/filter/excel/xlformula.cxx +++ b/sc/source/filter/excel/xlformula.cxx @@ -689,7 +689,7 @@ sal_uInt16 XclTokenArray::GetSize() const void XclTokenArray::ReadSize( XclImpStream& rStrm ) { sal_uInt16 nSize; - rStrm >> nSize; + nSize = rStrm.ReaduInt16(); maTokVec.resize( nSize ); } diff --git a/sc/source/filter/excel/xlpivot.cxx b/sc/source/filter/excel/xlpivot.cxx index 38924a63a3bf..0813381c1245 100644 --- a/sc/source/filter/excel/xlpivot.cxx +++ b/sc/source/filter/excel/xlpivot.cxx @@ -175,13 +175,13 @@ XclPCFieldInfo::XclPCFieldInfo() : XclImpStream& operator>>( XclImpStream& rStrm, XclPCFieldInfo& rInfo ) { - rStrm >> rInfo.mnFlags - >> rInfo.mnGroupChild - >> rInfo.mnGroupBase - >> rInfo.mnVisItems - >> rInfo.mnGroupItems - >> rInfo.mnBaseItems - >> rInfo.mnOrigItems; + rInfo.mnFlags = rStrm.ReaduInt16(); + rInfo.mnGroupChild = rStrm.ReaduInt16(); + rInfo.mnGroupBase = rStrm.ReaduInt16(); + rInfo.mnVisItems = rStrm.ReaduInt16(); + rInfo.mnGroupItems = rStrm.ReaduInt16(); + rInfo.mnBaseItems = rStrm.ReaduInt16(); + rInfo.mnOrigItems = rStrm.ReaduInt16(); if( rStrm.GetRecLeft() >= 3 ) rInfo.maName = rStrm.ReadUniString(); else @@ -261,7 +261,8 @@ void XclPCNumGroupInfo::SetXclDataType( sal_uInt16 nXclType ) XclImpStream& operator>>( XclImpStream& rStrm, XclPCNumGroupInfo& rInfo ) { - return rStrm >> rInfo.mnFlags; + rInfo.mnFlags = rStrm.ReaduInt16(); + return rStrm;; } XclExpStream& operator<<( XclExpStream& rStrm, const XclPCNumGroupInfo& rInfo ) @@ -357,14 +358,14 @@ XclPCInfo::XclPCInfo() : XclImpStream& operator>>( XclImpStream& rStrm, XclPCInfo& rInfo ) { - rStrm >> rInfo.mnSrcRecs - >> rInfo.mnStrmId - >> rInfo.mnFlags - >> rInfo.mnBlockRecs - >> rInfo.mnStdFields - >> rInfo.mnTotalFields; + rInfo.mnSrcRecs = rStrm.ReaduInt32(); + rInfo.mnStrmId = rStrm.ReaduInt16(); + rInfo.mnFlags = rStrm.ReaduInt16(); + rInfo.mnBlockRecs = rStrm.ReaduInt16(); + rInfo.mnStdFields = rStrm.ReaduInt16(); + rInfo.mnTotalFields = rStrm.ReaduInt16(); rStrm.Ignore( 2 ); - rStrm >> rInfo.mnSrcType; + rInfo.mnSrcType = rStrm.ReaduInt16(); rInfo.maUserName = rStrm.ReadUniString(); return rStrm; } @@ -390,7 +391,7 @@ XclExpStream& operator<<( XclExpStream& rStrm, const XclPCInfo& rInfo ) XclImpStream& operator>>( XclImpStream& rStrm, XclPTCachedName& rCachedName ) { sal_uInt16 nStrLen; - rStrm >> nStrLen; + nStrLen = rStrm.ReaduInt16(); rCachedName.mbUseCache = nStrLen == EXC_PT_NOSTRING; if( rCachedName.mbUseCache ) rCachedName.maName.clear(); @@ -430,11 +431,11 @@ XclPTItemInfo::XclPTItemInfo() : XclImpStream& operator>>( XclImpStream& rStrm, XclPTItemInfo& rInfo ) { - return rStrm - >> rInfo.mnType - >> rInfo.mnFlags - >> rInfo.mnCacheIdx - >> rInfo.maVisName; + rInfo.mnType = rStrm.ReaduInt16(); + rInfo.mnFlags = rStrm.ReaduInt16(); + rInfo.mnCacheIdx = rStrm.ReaduInt16(); + rStrm >> rInfo.maVisName; + return rStrm; } XclExpStream& operator<<( XclExpStream& rStrm, const XclPTItemInfo& rInfo ) @@ -539,12 +540,12 @@ void XclPTFieldInfo::SetSubtotals( const XclPTSubtotalVec& rSubtotals ) XclImpStream& operator>>( XclImpStream& rStrm, XclPTFieldInfo& rInfo ) { // rInfo.mnCacheIdx is not part of the SXVD record - return rStrm - >> rInfo.mnAxes - >> rInfo.mnSubtCount - >> rInfo.mnSubtotals - >> rInfo.mnItemCount - >> rInfo.maVisName; + rInfo.mnAxes = rStrm.ReaduInt16(); + rInfo.mnSubtCount = rStrm.ReaduInt16(); + rInfo.mnSubtotals = rStrm.ReaduInt16(); + rInfo.mnItemCount = rStrm.ReaduInt16(); + rStrm >> rInfo.maVisName; + return rStrm; } XclExpStream& operator<<( XclExpStream& rStrm, const XclPTFieldInfo& rInfo ) @@ -624,11 +625,11 @@ void XclPTFieldExtInfo::SetApiLayoutMode( sal_Int32 nLayoutMode ) XclImpStream& operator>>( XclImpStream& rStrm, XclPTFieldExtInfo& rInfo ) { sal_uInt8 nNameLen = 0; - rStrm >> rInfo.mnFlags - >> rInfo.mnSortField - >> rInfo.mnShowField - >> rInfo.mnNumFmt - >> nNameLen; + rInfo.mnFlags = rStrm.ReaduInt32(); + rInfo.mnSortField = rStrm.ReaduInt16(); + rInfo.mnShowField = rStrm.ReaduInt16(); + rInfo.mnNumFmt = rStrm.ReaduInt16(); + nNameLen = rStrm.ReaduInt8(); rStrm.Ignore(10); if (nNameLen != 0xFF) @@ -674,10 +675,10 @@ XclPTPageFieldInfo::XclPTPageFieldInfo() : XclImpStream& operator>>( XclImpStream& rStrm, XclPTPageFieldInfo& rInfo ) { - return rStrm - >> rInfo.mnField - >> rInfo.mnSelItem - >> rInfo.mnObjId; + rInfo.mnField = rStrm.ReaduInt16(); + rInfo.mnSelItem = rStrm.ReaduInt16(); + rInfo.mnObjId = rStrm.ReaduInt16(); + return rStrm; } XclExpStream& operator<<( XclExpStream& rStrm, const XclPTPageFieldInfo& rInfo ) @@ -802,14 +803,14 @@ void XclPTDataFieldInfo::SetApiRefItemType( sal_Int32 nRefItemType ) XclImpStream& operator>>( XclImpStream& rStrm, XclPTDataFieldInfo& rInfo ) { - return rStrm - >> rInfo.mnField - >> rInfo.mnAggFunc - >> rInfo.mnRefType - >> rInfo.mnRefField - >> rInfo.mnRefItem - >> rInfo.mnNumFmt - >> rInfo.maVisName; + rInfo.mnField = rStrm.ReaduInt16(); + rInfo.mnAggFunc = rStrm.ReaduInt16(); + rInfo.mnRefType = rStrm.ReaduInt16(); + rInfo.mnRefField = rStrm.ReaduInt16(); + rInfo.mnRefItem = rStrm.ReaduInt16(); + rInfo.mnNumFmt = rStrm.ReaduInt16(); + rStrm >> rInfo.maVisName; + return rStrm; } XclExpStream& operator<<( XclExpStream& rStrm, const XclPTDataFieldInfo& rInfo ) @@ -847,19 +848,24 @@ XclImpStream& operator>>( XclImpStream& rStrm, XclPTInfo& rInfo ) { sal_uInt16 nTabLen, nDataLen; - rStrm >> rInfo.maOutXclRange - >> rInfo.mnFirstHeadRow - >> rInfo.maDataXclPos - >> rInfo.mnCacheIdx; + rStrm >> rInfo.maOutXclRange; + rInfo.mnFirstHeadRow = rStrm.ReaduInt16(); + rStrm >> rInfo.maDataXclPos; + rInfo.mnCacheIdx = rStrm.ReaduInt16(); rStrm.Ignore( 2 ); - rStrm >> rInfo.mnDataAxis >> rInfo.mnDataPos - >> rInfo.mnFields - >> rInfo.mnRowFields >> rInfo.mnColFields - >> rInfo.mnPageFields >> rInfo.mnDataFields - >> rInfo.mnDataRows >> rInfo.mnDataCols - >> rInfo.mnFlags - >> rInfo.mnAutoFmtIdx - >> nTabLen >> nDataLen; + rInfo.mnDataAxis = rStrm.ReaduInt16(); + rInfo.mnDataPos = rStrm.ReaduInt16(); + rInfo.mnFields = rStrm.ReaduInt16(); + rInfo.mnRowFields = rStrm.ReaduInt16(); + rInfo.mnColFields = rStrm.ReaduInt16(); + rInfo.mnPageFields = rStrm.ReaduInt16(); + rInfo.mnDataFields = rStrm.ReaduInt16(); + rInfo.mnDataRows = rStrm.ReaduInt16(); + rInfo.mnDataCols = rStrm.ReaduInt16(); + rInfo.mnFlags = rStrm.ReaduInt16(); + rInfo.mnAutoFmtIdx = rStrm.ReaduInt16(); + nTabLen = rStrm.ReaduInt16(); + nDataLen = rStrm.ReaduInt16(); rInfo.maTableName = rStrm.ReadUniString( nTabLen ); rInfo.maDataName = rStrm.ReadUniString( nDataLen ); return rStrm; @@ -903,13 +909,13 @@ XclPTExtInfo::XclPTExtInfo() : XclImpStream& operator>>( XclImpStream& rStrm, XclPTExtInfo& rInfo ) { - rStrm >> rInfo.mnSxformulaRecs; + rInfo.mnSxformulaRecs = rStrm.ReaduInt16(); rStrm.Ignore( 6 ); - return rStrm - >> rInfo.mnSxselectRecs - >> rInfo.mnPagePerRow - >> rInfo.mnPagePerCol - >> rInfo.mnFlags; + rInfo.mnSxselectRecs = rStrm.ReaduInt16(); + rInfo.mnPagePerRow = rStrm.ReaduInt16(); + rInfo.mnPagePerCol = rStrm.ReaduInt16(); + rInfo.mnFlags = rStrm.ReaduInt32(); + return rStrm; } XclExpStream& operator<<( XclExpStream& rStrm, const XclPTExtInfo& rInfo ) @@ -992,9 +998,10 @@ void XclPTViewEx9Info::Init( const ScDPObject& rDPObj ) XclImpStream& operator>>( XclImpStream& rStrm, XclPTViewEx9Info& rInfo ) { rStrm.Ignore( 2 ); - rStrm >> rInfo.mbReport; /// 2 for report* fmts ? + rInfo.mbReport = rStrm.ReaduInt32(); /// 2 for report* fmts ? rStrm.Ignore( 6 ); - rStrm >> rInfo.mnAutoFormat >> rInfo.mnGridLayout; + rInfo.mnAutoFormat = rStrm.ReaduInt8(); + rInfo.mnGridLayout = rStrm.ReaduInt8(); rInfo.maGrandTotalName = rStrm.ReadUniString(); return rStrm; } diff --git a/sc/source/filter/excel/xltools.cxx b/sc/source/filter/excel/xltools.cxx index 3c6d0f27e34f..08b871f2a34d 100644 --- a/sc/source/filter/excel/xltools.cxx +++ b/sc/source/filter/excel/xltools.cxx @@ -714,7 +714,10 @@ OUString XclTools::GetXclMacroName( const OUString& rSbMacroUrl ) XclImpStream& operator>>( XclImpStream& rStrm, Color& rColor ) { sal_uInt8 nR, nG, nB, nD; - rStrm >> nR >> nG >> nB >> nD; + nR = rStrm.ReaduInt8(); + nG = rStrm.ReaduInt8(); + nB = rStrm.ReaduInt8(); + nD = rStrm.ReaduInt8(); rColor.SetColor( RGB_COLORDATA( nR, nG, nB ) ); return rStrm; } diff --git a/sc/source/filter/inc/XclImpChangeTrack.hxx b/sc/source/filter/inc/XclImpChangeTrack.hxx index ac589b91ddad..e681f08a3667 100644 --- a/sc/source/filter/inc/XclImpChangeTrack.hxx +++ b/sc/source/filter/inc/XclImpChangeTrack.hxx @@ -41,7 +41,10 @@ struct XclImpChTrRecHeader inline XclImpStream& operator>>( XclImpStream& rStrm, XclImpChTrRecHeader& rRecHeader ) { - rStrm >> rRecHeader.nSize >> rRecHeader.nIndex >> rRecHeader.nOpCode >> rRecHeader.nAccept; + rRecHeader.nSize = rStrm.ReaduInt32(); + rRecHeader.nIndex = rStrm.ReaduInt32(); + rRecHeader.nOpCode = rStrm.ReaduInt16(); + rRecHeader.nAccept = rStrm.ReaduInt16(); return rStrm; } @@ -112,7 +115,7 @@ inline sal_uInt8 XclImpChangeTrack::LookAtuInt8() { pStrm->PushPosition(); sal_uInt8 nValue; - *pStrm >> nValue; + nValue = pStrm->ReaduInt8(); pStrm->PopPosition(); return nValue; } diff --git a/sc/source/filter/inc/xistream.hxx b/sc/source/filter/inc/xistream.hxx index bcc29bad8b0e..85e949888b80 100644 --- a/sc/source/filter/inc/xistream.hxx +++ b/sc/source/filter/inc/xistream.hxx @@ -326,20 +326,17 @@ public: sal_uInt16 PeekRecId( sal_Size nPos ); - XclImpStream& operator>>( sal_Int8& rnValue ); - XclImpStream& operator>>( sal_uInt8& rnValue ); - XclImpStream& operator>>( sal_Int16& rnValue ); - XclImpStream& operator>>( sal_uInt16& rnValue ); - XclImpStream& operator>>( sal_Int32& rnValue ); - XclImpStream& operator>>( sal_uInt32& rnValue ); - XclImpStream& operator>>( float& rfValue ); - XclImpStream& operator>>( double& rfValue ); - + SAL_WARN_UNUSED_RESULT sal_uInt8 ReaduInt8(); + SAL_WARN_UNUSED_RESULT sal_Int16 ReadInt16(); + SAL_WARN_UNUSED_RESULT sal_uInt16 ReaduInt16(); + SAL_WARN_UNUSED_RESULT sal_Int32 ReadInt32(); + SAL_WARN_UNUSED_RESULT sal_uInt32 ReaduInt32(); + SAL_WARN_UNUSED_RESULT double ReadDouble(); /** Reads nBytes bytes to the existing(!) buffer pData. diff --git a/sc/source/filter/inc/xlescher.hxx b/sc/source/filter/inc/xlescher.hxx index 90ef41c29e9e..a46aca9121e9 100644 --- a/sc/source/filter/inc/xlescher.hxx +++ b/sc/source/filter/inc/xlescher.hxx @@ -25,6 +25,7 @@ #include "fapihelper.hxx" #include "xladdress.hxx" #include "xlstyle.hxx" +#include "xistream.hxx" namespace com { namespace sun { namespace star { namespace drawing { class XShape; } @@ -33,7 +34,6 @@ namespace com { namespace sun { namespace star { } } } class Rectangle; -class XclImpStream; // Constants and Enumerations ================================================= @@ -321,17 +321,18 @@ inline SvStream& operator>>( SvStream& rStrm, XclObjAnchor& rAnchor ) return rStrm; } -// creates read method for XclImpStream -template< typename StreamType > -StreamType& operator>>( StreamType& rStrm, XclObjAnchor& rAnchor ) +inline XclImpStream& operator>>( XclImpStream& rStrm, XclObjAnchor& rAnchor ) { sal_uInt16 tmpFirstRow, tmpTY, tmpLastRow, tmpBY; - rStrm - >> rAnchor.maFirst.mnCol >> rAnchor.mnLX - >> tmpFirstRow >> tmpTY - >> rAnchor.maLast.mnCol >> rAnchor.mnRX - >> tmpLastRow >> tmpBY; + rAnchor.maFirst.mnCol = rStrm.ReaduInt16(); + rAnchor.mnLX = rStrm.ReaduInt16(); + tmpFirstRow = rStrm.ReaduInt16(); + tmpTY = rStrm.ReaduInt16(); + rAnchor.maLast.mnCol = rStrm.ReaduInt16(); + rAnchor.mnRX = rStrm.ReaduInt16(); + tmpLastRow = rStrm.ReaduInt16(); + tmpBY = rStrm.ReaduInt16(); rAnchor.maFirst.mnRow = static_cast<sal_uInt32> (tmpFirstRow); rAnchor.mnTY = static_cast<sal_uInt32> (tmpTY); diff --git a/sc/source/filter/xcl97/XclImpChangeTrack.cxx b/sc/source/filter/xcl97/XclImpChangeTrack.cxx index 74bfb02203c0..3d3a34997ce1 100644 --- a/sc/source/filter/xcl97/XclImpChangeTrack.cxx +++ b/sc/source/filter/xcl97/XclImpChangeTrack.cxx @@ -119,7 +119,12 @@ void XclImpChangeTrack::ReadDateTime( DateTime& rDateTime ) sal_uInt16 nYear; sal_uInt8 nMonth, nDay, nHour, nMin, nSec; - *pStrm >> nYear >> nMonth >> nDay >> nHour >> nMin >> nSec; + nYear = pStrm->ReaduInt16(); + nMonth = pStrm->ReaduInt8(); + nDay = pStrm->ReaduInt8(); + nHour = pStrm->ReaduInt8(); + nMin = pStrm->ReaduInt8(); + nSec = pStrm->ReaduInt8(); rDateTime.SetYear( nYear ); rDateTime.SetMonth( nMonth ); @@ -177,8 +182,7 @@ bool XclImpChangeTrack::Read3DTabRefInfo( SCTAB& rFirstTab, SCTAB& rLastTab, Exc void XclImpChangeTrack::ReadFormula( ScTokenArray*& rpTokenArray, const ScAddress& rPosition ) { - sal_uInt16 nFmlSize; - *pStrm >> nFmlSize; + sal_uInt16 nFmlSize = pStrm->ReaduInt16(); // create a memory stream and copy the formula to be able to read simultaneously // the formula and the additional 3D tab ref data following the formula @@ -233,8 +237,7 @@ void XclImpChangeTrack::ReadCell( break; case EXC_CHTR_TYPE_DOUBLE: { - double fValue; - *pStrm >> fValue; + double fValue = pStrm->ReadDouble(); if( pStrm->IsValid() ) { rCell.meType = CELLTYPE_VALUE; @@ -347,13 +350,13 @@ void XclImpChangeTrack::ReadChTrCellContent() SCTAB nTab = ReadTabNum(); aPosition.SetTab( nTab ); sal_uInt16 nValueType; - *pStrm >> nValueType; + nValueType = pStrm->ReaduInt16(); sal_uInt16 nOldValueType = (nValueType >> 3) & EXC_CHTR_TYPE_MASK; sal_uInt16 nNewValueType = nValueType & EXC_CHTR_TYPE_MASK; pStrm->Ignore( 2 ); Read2DAddress( aPosition ); sal_uInt16 nOldSize; - *pStrm >> nOldSize; + nOldSize = pStrm->ReaduInt16(); OSL_ENSURE( (nOldSize == 0) == (nOldValueType == EXC_CHTR_TYPE_EMPTY), "XclImpChangeTrack::ReadChTrCellContent - old value mismatch" ); pStrm->Ignore( 4 ); |