Kaydet (Commit) 63685652 authored tarafından Caolán McNamara's avatar Caolán McNamara

coverity#1260333 Unused value

Change-Id: I2c6faad05d7e1c92e554864abfb257907f803d51
üst 548dbc6b
...@@ -137,10 +137,6 @@ bool ExcelToSc8::HandleOleLink(sal_uInt16 nXtiIndex, const XclImpExtName& rExtNa ...@@ -137,10 +137,6 @@ bool ExcelToSc8::HandleOleLink(sal_uInt16 nXtiIndex, const XclImpExtName& rExtNa
// otherwise it will seek to the first byte past additional content after <nFormulaLen> // otherwise it will seek to the first byte past additional content after <nFormulaLen>
ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn, sal_Size nFormulaLen, bool bAllowArrays, const FORMULA_TYPE eFT ) ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn, sal_Size nFormulaLen, bool bAllowArrays, const FORMULA_TYPE eFT )
{ {
sal_uInt8 nOp, nLen, nByte;
sal_uInt16 nUINT16;
double fDouble;
OUString aString;
bool bError = false; bool bError = false;
bool bArrayFormula = false; bool bArrayFormula = false;
TokenId nMerk0; TokenId nMerk0;
...@@ -171,7 +167,7 @@ ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn, ...@@ -171,7 +167,7 @@ ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn,
while( (aIn.GetRecPos() < nEndPos) && !bError ) while( (aIn.GetRecPos() < nEndPos) && !bError )
{ {
nOp = aIn.ReaduInt8(); sal_uInt8 nOp = aIn.ReaduInt8();
// always reset flags // always reset flags
aSRD.InitFlags(); aSRD.InitFlags();
...@@ -295,11 +291,13 @@ ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn, ...@@ -295,11 +291,13 @@ ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn,
GetTracer().TraceFormulaMissingArg(); GetTracer().TraceFormulaMissingArg();
break; break;
case 0x17: // String Constant [314 266] case 0x17: // String Constant [314 266]
nLen = aIn.ReaduInt8(); // und? {
aString = aIn.ReadUniString( nLen ); // reads Grbit even if nLen==0 sal_uInt8 nLen = aIn.ReaduInt8(); // und?
OUString aString = aIn.ReadUniString( nLen ); // reads Grbit even if nLen==0
aStack << aPool.Store( aString ); aStack << aPool.Store( aString );
break; break;
}
case 0x18: // natural language formula case 0x18: // natural language formula
{ {
sal_uInt8 nEptg; sal_uInt8 nEptg;
...@@ -330,8 +328,9 @@ ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn, ...@@ -330,8 +328,9 @@ ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn,
aSRD.SetAddress(aAddr, aEingPos); aSRD.SetAddress(aAddr, aEingPos);
aStack << aPool.StoreNlf( aSRD ); aStack << aPool.StoreNlf( aSRD );
}
break; break;
}
case 0x0A: // Radical 13 - ref case 0x0A: // Radical 13 - ref
{ {
nRow = aIn.ReaduInt16(); nRow = aIn.ReaduInt16();
...@@ -343,8 +342,9 @@ ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn, ...@@ -343,8 +342,9 @@ ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn,
aSRD.SetAddress(aAddr, aEingPos); aSRD.SetAddress(aAddr, aEingPos);
aStack << aPool.StoreNlf( aSRD ); aStack << aPool.StoreNlf( aSRD );
}
break; break;
}
case 0x0B: // RadicalS 13 x ref case 0x0B: // RadicalS 13 x ref
aIn.Ignore( 13 ); aIn.Ignore( 13 );
aExtensions.push_back( EXTENSION_NLR ); aExtensions.push_back( EXTENSION_NLR );
...@@ -389,11 +389,11 @@ ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn, ...@@ -389,11 +389,11 @@ ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn,
} }
else if( nOpt & 0x10 ) // AttrSum else if( nOpt & 0x10 ) // AttrSum
DoMulArgs( ocSum, 1 ); DoMulArgs( ocSum, 1 );
}
break; break;
}
case 0x1C: // Error Value [314 266] case 0x1C: // Error Value [314 266]
{ {
nByte = aIn.ReaduInt8(); sal_uInt8 nByte = aIn.ReaduInt8();
DefTokenId eOc; DefTokenId eOc;
switch( nByte ) switch( nByte )
...@@ -411,30 +411,36 @@ ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn, ...@@ -411,30 +411,36 @@ ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn,
if( eOc != ocStop ) if( eOc != ocStop )
aPool << ocOpen << ocClose; aPool << ocOpen << ocClose;
aPool >> aStack; aPool >> aStack;
}
break; break;
}
case 0x1D: // Boolean [315 266] case 0x1D: // Boolean [315 266]
nByte = aIn.ReaduInt8(); {
sal_uInt8 nByte = aIn.ReaduInt8();
if( nByte == 0 ) if( nByte == 0 )
aPool << ocFalse << ocOpen << ocClose; aPool << ocFalse << ocOpen << ocClose;
else else
aPool << ocTrue << ocOpen << ocClose; aPool << ocTrue << ocOpen << ocClose;
aPool >> aStack; aPool >> aStack;
break; break;
}
case 0x1E: // Integer [315 266] case 0x1E: // Integer [315 266]
nUINT16 = aIn.ReaduInt16(); {
sal_uInt16 nUINT16 = aIn.ReaduInt16();
aStack << aPool.Store( ( double ) nUINT16 ); aStack << aPool.Store( ( double ) nUINT16 );
break; break;
}
case 0x1F: // Number [315 266] case 0x1F: // Number [315 266]
fDouble = aIn.ReadDouble(); {
double fDouble = aIn.ReadDouble();
aStack << aPool.Store( fDouble ); aStack << aPool.Store( fDouble );
break; break;
}
case 0x40: case 0x40:
case 0x60: case 0x60:
case 0x20: // Array Constant [317 268] case 0x20: // Array Constant [317 268]
nByte = aIn.ReaduInt8(); {
nUINT16 = aIn.ReaduInt16(); aIn.Ignore( 7 );
aIn.Ignore( 4 );
if( bAllowArrays ) if( bAllowArrays )
{ {
aStack << aPool.StoreMatrix(); aStack << aPool.StoreMatrix();
...@@ -446,6 +452,7 @@ ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn, ...@@ -446,6 +452,7 @@ ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn,
aPool >> aStack; aPool >> aStack;
} }
break; break;
}
case 0x41: case 0x41:
case 0x61: case 0x61:
case 0x21: // Function, Fixed Number of Arguments [333 282] case 0x21: // Function, Fixed Number of Arguments [333 282]
...@@ -456,8 +463,8 @@ ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn, ...@@ -456,8 +463,8 @@ ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn,
DoMulArgs( pFuncInfo->meOpCode, pFuncInfo->mnMaxParamCount ); DoMulArgs( pFuncInfo->meOpCode, pFuncInfo->mnMaxParamCount );
else else
DoMulArgs( ocNoName, 0 ); DoMulArgs( ocNoName, 0 );
}
break; break;
}
case 0x42: case 0x42:
case 0x62: case 0x62:
case 0x22: // Function, Variable Number of Arg. [333 283] case 0x22: // Function, Variable Number of Arg. [333 283]
...@@ -471,13 +478,13 @@ ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn, ...@@ -471,13 +478,13 @@ ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn,
DoMulArgs( pFuncInfo->meOpCode, nParamCount ); DoMulArgs( pFuncInfo->meOpCode, nParamCount );
else else
DoMulArgs( ocNoName, 0 ); DoMulArgs( ocNoName, 0 );
}
break; break;
}
case 0x43: case 0x43:
case 0x63: case 0x63:
case 0x23: // Name [318 269] case 0x23: // Name [318 269]
{ {
nUINT16 = aIn.ReaduInt16(); sal_uInt16 nUINT16 = aIn.ReaduInt16();
aIn.Ignore( 2 ); aIn.Ignore( 2 );
const XclImpName* pName = GetNameManager().GetName( nUINT16 ); const XclImpName* pName = GetNameManager().GetName( nUINT16 );
if (pName) if (pName)
...@@ -488,8 +495,8 @@ ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn, ...@@ -488,8 +495,8 @@ ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn,
else else
aStack << aPool.StoreName(nUINT16, pName->IsGlobal()); aStack << aPool.StoreName(nUINT16, pName->IsGlobal());
} }
}
break; break;
}
case 0x44: case 0x44:
case 0x64: case 0x64:
case 0x24: // Cell Reference [319 270] case 0x24: // Cell Reference [319 270]
...@@ -518,8 +525,8 @@ ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn, ...@@ -518,8 +525,8 @@ ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn,
} }
aStack << aPool.Store( aSRD ); aStack << aPool.Store( aSRD );
}
break; break;
}
case 0x45: case 0x45:
case 0x65: case 0x65:
case 0x25: // Area Reference [320 270] case 0x25: // Area Reference [320 270]
...@@ -563,8 +570,8 @@ ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn, ...@@ -563,8 +570,8 @@ ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn,
} }
aStack << aPool.Store( aCRD ); aStack << aPool.Store( aCRD );
}
break; break;
}
case 0x46: case 0x46:
case 0x66: case 0x66:
case 0x26: // Constant Reference Subexpression [321 271] case 0x26: // Constant Reference Subexpression [321 271]
...@@ -602,8 +609,8 @@ ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn, ...@@ -602,8 +609,8 @@ ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn,
ExcRelToScRel8( nRow, nCol, aSRD, bRNorSF ); ExcRelToScRel8( nRow, nCol, aSRD, bRNorSF );
aStack << aPool.Store( aSRD ); aStack << aPool.Store( aSRD );
}
break; break;
}
case 0x4D: case 0x4D:
case 0x6D: case 0x6D:
case 0x2D: // Area Reference Within a Name [324 ] case 0x2D: // Area Reference Within a Name [324 ]
...@@ -630,8 +637,8 @@ ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn, ...@@ -630,8 +637,8 @@ ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn,
SetComplRow( aCRD ); SetComplRow( aCRD );
aStack << aPool.Store( aCRD ); aStack << aPool.Store( aCRD );
}
break; break;
}
case 0x4E: case 0x4E:
case 0x6E: case 0x6E:
case 0x2E: // Reference Subexpression Within a Name [332 282] case 0x2E: // Reference Subexpression Within a Name [332 282]
...@@ -645,13 +652,15 @@ ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn, ...@@ -645,13 +652,15 @@ ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn,
case 0x58: case 0x58:
case 0x78: case 0x78:
case 0x38: // Command-Equivalent Function [333 ] case 0x38: // Command-Equivalent Function [333 ]
aString = "COMM_EQU_FUNC"; {
nByte = aIn.ReaduInt8(); OUString aString = "COMM_EQU_FUNC";
sal_uInt8 nByte = aIn.ReaduInt8();
aString += OUString::number( nByte ); aString += OUString::number( nByte );
nByte = aIn.ReaduInt8(); nByte = aIn.ReaduInt8();
aStack << aPool.Store( aString ); aStack << aPool.Store( aString );
DoMulArgs( ocPush, nByte + 1 ); DoMulArgs( ocPush, nByte + 1 );
break; break;
}
case 0x59: case 0x59:
case 0x79: case 0x79:
case 0x39: // Name or External Name [ 275] case 0x39: // Name or External Name [ 275]
...@@ -760,8 +769,8 @@ ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn, ...@@ -760,8 +769,8 @@ ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn,
aPool << ocBad; aPool << ocBad;
aPool >> aStack; aPool >> aStack;
} }
}
break; break;
}
case 0x5A: case 0x5A:
case 0x7A: case 0x7A:
case 0x3A: // 3-D Cell Reference [ 275] case 0x3A: // 3-D Cell Reference [ 275]
...@@ -831,8 +840,8 @@ ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn, ...@@ -831,8 +840,8 @@ ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn,
else else
aStack << aPool.Store( aSRD ); aStack << aPool.Store( aSRD );
} }
}
break; break;
}
case 0x5B: case 0x5B:
case 0x7B: case 0x7B:
case 0x3B: // 3-D Area Reference [ 276] case 0x3B: // 3-D Area Reference [ 276]
...@@ -896,9 +905,10 @@ ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn, ...@@ -896,9 +905,10 @@ ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn,
aStack << aPool.Store( aCRD ); aStack << aPool.Store( aCRD );
} }
}
break; break;
default: bError = true; }
default:
bError = true;
} }
bError |= !aIn.IsValid(); bError |= !aIn.IsValid();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment