diff options
-rw-r--r-- | sc/inc/scmatrix.hxx | 4 | ||||
-rw-r--r-- | sc/source/core/data/validat.cxx | 2 | ||||
-rw-r--r-- | sc/source/core/tool/interpr1.cxx | 10 | ||||
-rw-r--r-- | sc/source/core/tool/interpr5.cxx | 48 | ||||
-rw-r--r-- | sc/source/core/tool/scmatrix.cxx | 26 |
5 files changed, 31 insertions, 59 deletions
diff --git a/sc/inc/scmatrix.hxx b/sc/inc/scmatrix.hxx index d4f96d6a7341..fd665919d845 100644 --- a/sc/inc/scmatrix.hxx +++ b/sc/inc/scmatrix.hxx @@ -298,9 +298,7 @@ public: void PutEmpty( SCSIZE nC, SCSIZE nR); /// Jump FALSE without path void PutEmptyPath( SCSIZE nC, SCSIZE nR); - void PutEmptyPath( SCSIZE nIndex); void PutError( USHORT nErrorCode, SCSIZE nC, SCSIZE nR ); - void PutError( USHORT nErrorCode, SCSIZE nIndex ); void PutBoolean( bool bVal, SCSIZE nC, SCSIZE nR); void PutBoolean( bool bVal, SCSIZE nIndex); @@ -319,8 +317,6 @@ public: @returns 0 if no error or string element, else one of err... constants */ USHORT GetErrorIfNotString( SCSIZE nC, SCSIZE nR) const { return IsValue( nC, nR) ? GetError( nC, nR) : 0; } - USHORT GetErrorIfNotString( SCSIZE nIndex) const - { return IsValue( nIndex) ? GetError( nIndex) : 0; } /// @return 0.0 if empty or empty path, else value or DoubleError. double GetDouble( SCSIZE nC, SCSIZE nR) const; diff --git a/sc/source/core/data/validat.cxx b/sc/source/core/data/validat.cxx index 54f5bca1b9b9..7e2d138891c2 100644 --- a/sc/source/core/data/validat.cxx +++ b/sc/source/core/data/validat.cxx @@ -660,7 +660,7 @@ bool ScValidationData::GetSelectionFromFormula( TypedScStrCollection* pStrings, * rStrResult += ScGlobal::GetLongErrorString(nErrCode); */ - xMatRef->PutError( nErrCode, 0); + xMatRef->PutError( nErrCode, 0, 0); bOk = false; } else if (aValidationSrc.HasValueData()) diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx index f42f3dcbe4b4..4c32894c7d74 100644 --- a/sc/source/core/tool/interpr1.cxx +++ b/sc/source/core/tool/interpr1.cxx @@ -2144,8 +2144,8 @@ void ScInterpreter::ScIsValue() ; // nothing else if ( !pJumpMatrix ) { - if (pMat->GetErrorIfNotString( 0 ) == 0) - nRes = pMat->IsValue( 0 ); + if (pMat->GetErrorIfNotString( 0, 0) == 0) + nRes = pMat->IsValue( 0, 0); } else { @@ -2250,7 +2250,7 @@ void ScInterpreter::ScIsNV() if ( !pMat ) ; // nothing else if ( !pJumpMatrix ) - nRes = (pMat->GetErrorIfNotString( 0 ) == NOTAVAILABLE); + nRes = (pMat->GetErrorIfNotString( 0, 0) == NOTAVAILABLE); else { SCSIZE nCols, nRows, nC, nR; @@ -2300,7 +2300,7 @@ void ScInterpreter::ScIsErr() nRes = ((nGlobalError && nGlobalError != NOTAVAILABLE) || !pMat); else if ( !pJumpMatrix ) { - USHORT nErr = pMat->GetErrorIfNotString( 0 ); + USHORT nErr = pMat->GetErrorIfNotString( 0, 0); nRes = (nErr && nErr != NOTAVAILABLE); } else @@ -2357,7 +2357,7 @@ void ScInterpreter::ScIsError() if ( nGlobalError || !pMat ) nRes = 1; else if ( !pJumpMatrix ) - nRes = (pMat->GetErrorIfNotString( 0 ) != 0); + nRes = (pMat->GetErrorIfNotString( 0, 0) != 0); else { SCSIZE nCols, nRows, nC, nR; diff --git a/sc/source/core/tool/interpr5.cxx b/sc/source/core/tool/interpr5.cxx index 5f407f40abca..18f1b0967f5a 100644 --- a/sc/source/core/tool/interpr5.cxx +++ b/sc/source/core/tool/interpr5.cxx @@ -1339,41 +1339,43 @@ void ScInterpreter::ScAmpersand() ScMatrixRef pResMat = GetNewMat(nC, nR); if (pResMat) { - SCSIZE nCount = nC * nR; if (nGlobalError) { - for ( SCSIZE i = 0; i < nCount; i++ ) - pResMat->PutError( nGlobalError, i); + for (SCSIZE i = 0; i < nC; ++i) + for (SCSIZE j = 0; j < nR; ++j) + pResMat->PutError( nGlobalError, i, j); } else if (bFlag) { - for ( SCSIZE i = 0; i < nCount; i++ ) - { - USHORT nErr = pMat->GetErrorIfNotString( i); - if (nErr) - pResMat->PutError( nErr, i); - else + for (SCSIZE i = 0; i < nC; ++i) + for (SCSIZE j = 0; j < nR; ++j) { - String aTmp( sStr); - aTmp += pMat->GetString( *pFormatter, i); - pResMat->PutString( aTmp, i); + USHORT nErr = pMat->GetErrorIfNotString( i, j); + if (nErr) + pResMat->PutError( nErr, i, j); + else + { + String aTmp( sStr); + aTmp += pMat->GetString( *pFormatter, i, j); + pResMat->PutString( aTmp, i, j); + } } - } } else { - for ( SCSIZE i = 0; i < nCount; i++ ) - { - USHORT nErr = pMat->GetErrorIfNotString( i); - if (nErr) - pResMat->PutError( nErr, i); - else + for (SCSIZE i = 0; i < nC; ++i) + for (SCSIZE j = 0; j < nR; ++j) { - String aTmp( pMat->GetString( *pFormatter, i)); - aTmp += sStr; - pResMat->PutString( aTmp, i); + USHORT nErr = pMat->GetErrorIfNotString( i, j); + if (nErr) + pResMat->PutError( nErr, i, j); + else + { + String aTmp( pMat->GetString( *pFormatter, i, j)); + aTmp += sStr; + pResMat->PutString( aTmp, i, j); + } } - } } PushMatrix(pResMat); } diff --git a/sc/source/core/tool/scmatrix.cxx b/sc/source/core/tool/scmatrix.cxx index 36e71c4571d9..7bcf781b7754 100644 --- a/sc/source/core/tool/scmatrix.cxx +++ b/sc/source/core/tool/scmatrix.cxx @@ -181,9 +181,7 @@ public: void PutEmpty(SCSIZE nC, SCSIZE nR); void PutEmptyPath(SCSIZE nC, SCSIZE nR); - void PutEmptyPath(SCSIZE nIndex); void PutError( USHORT nErrorCode, SCSIZE nC, SCSIZE nR ); - void PutError( USHORT nErrorCode, SCSIZE nIndex ); void PutBoolean(bool bVal, SCSIZE nC, SCSIZE nR); void PutBoolean( bool bVal, SCSIZE nIndex); USHORT GetError( SCSIZE nC, SCSIZE nR) const; @@ -385,25 +383,11 @@ void ScMatrixImpl::PutEmptyPath(SCSIZE nC, SCSIZE nR) } } -void ScMatrixImpl::PutEmptyPath(SCSIZE nIndex) -{ - SCSIZE nC, nR; - CalcPosition(nIndex, nC, nR); - PutEmptyPath(nC, nR); -} - void ScMatrixImpl::PutError( USHORT nErrorCode, SCSIZE nC, SCSIZE nR ) { maMat.set_numeric(nR, nC, CreateDoubleError(nErrorCode)); } -void ScMatrixImpl::PutError( USHORT nErrorCode, SCSIZE nIndex ) -{ - SCSIZE nC, nR; - CalcPosition(nIndex, nC, nR); - PutError(nErrorCode, nC, nR); -} - void ScMatrixImpl::PutBoolean(bool bVal, SCSIZE nC, SCSIZE nR) { if (ValidColRow( nC, nR)) @@ -912,21 +896,11 @@ void ScMatrix::PutEmptyPath(SCSIZE nC, SCSIZE nR) pImpl->PutEmptyPath(nC, nR); } -void ScMatrix::PutEmptyPath(SCSIZE nIndex) -{ - pImpl->PutEmptyPath(nIndex); -} - void ScMatrix::PutError( USHORT nErrorCode, SCSIZE nC, SCSIZE nR ) { pImpl->PutError(nErrorCode, nC, nR); } -void ScMatrix::PutError( USHORT nErrorCode, SCSIZE nIndex ) -{ - pImpl->PutError(nErrorCode, nIndex); -} - void ScMatrix::PutBoolean(bool bVal, SCSIZE nC, SCSIZE nR) { pImpl->PutBoolean(bVal, nC, nR); |