Reduce the number of arguments. The first argument can go now.

Change-Id: Id2b9ca7b6e24edc0da4735c01798ab580fba910d
This commit is contained in:
Kohei Yoshida 2013-10-17 21:03:12 -04:00
parent 60cc84c953
commit 10ccf6acde
4 changed files with 9 additions and 9 deletions

View File

@ -62,7 +62,10 @@ private:
CompareOptions& operator=( const CompareOptions & );
};
double CompareFunc( bool bIgnoreCase, const Compare& rComp, CompareOptions* pOptions = NULL );
/** @param pOptions
NULL means case sensitivity document option is to be used!
*/
double CompareFunc( const Compare& rComp, CompareOptions* pOptions = NULL );
}

View File

@ -38,10 +38,7 @@ CompareOptions::CompareOptions( ScDocument* pDoc, const ScQueryEntry& rEntry, bo
// struct if needed.
}
/** @param pOptions
NULL means case sensitivity document option is to be used!
*/
double CompareFunc( bool bIgnoreCase, const Compare& rComp, CompareOptions* pOptions )
double CompareFunc( const Compare& rComp, CompareOptions* pOptions )
{
// Keep DoubleError if encountered
// #i40539# if bEmpty is set, bVal/nVal are uninitialized
@ -165,7 +162,7 @@ double CompareFunc( bool bIgnoreCase, const Compare& rComp, CompareOptions* pOpt
fRes = (double) ScGlobal::GetCaseCollator()->compareString(
*rComp.pVal[ 0 ], *rComp.pVal[ 1 ] );
}
else if (bIgnoreCase)
else if (rComp.mbIgnoreCase)
fRes = (double) ScGlobal::GetCollator()->compareString(
*rComp.pVal[ 0 ], *rComp.pVal[ 1 ] );
else

View File

@ -875,7 +875,7 @@ double ScInterpreter::Compare()
if( nGlobalError )
return 0;
nCurFmtType = nFuncFmtType = NUMBERFORMAT_LOGICAL;
return sc::CompareFunc(pDok->GetDocOptions().IsIgnoreCase(), aComp);
return sc::CompareFunc(aComp);
}
@ -976,7 +976,7 @@ sc::RangeMatrix ScInterpreter::CompareMat( sc::CompareOptions* pOptions )
aComp.bEmpty[i] = false;
}
}
aRes.mpMat->PutDouble(sc::CompareFunc(pDok->GetDocOptions().IsIgnoreCase(), aComp, pOptions), j, k);
aRes.mpMat->PutDouble(sc::CompareFunc(aComp, pOptions), j, k);
}
else
aRes.mpMat->PutString(mrStrPool.intern(ScGlobal::GetRscString(STR_NO_VALUE)), j, k);

View File

@ -1332,7 +1332,7 @@ class CompareMatrixFunc : std::unary_function<MatrixImplType::element_block_type
void compare()
{
maResValues.push_back(sc::CompareFunc(mrComp.mbIgnoreCase, mrComp, mpOptions));
maResValues.push_back(sc::CompareFunc(mrComp, mpOptions));
}
public: