diff options
author | Eike Rathke <erack@redhat.com> | 2015-07-20 19:13:06 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2015-07-20 19:18:37 +0200 |
commit | 1e5e7b9323c3321a380edf86097ccc2e3f0a7a7a (patch) | |
tree | 00026556e9096333536f504828aedaddc6717c05 /sc/source/core/tool/interpr1.cxx | |
parent | 06f65a10aec23f4442bd42d1d117d0e8d648c52a (diff) |
Resolves: tdf#58838 do not use collation for Equal/NotEqual operators
Unicode collation ignores control characters and other specific
characters, see
http://www.unicode.org/charts/collation/chart_Ignored.html
and thus is not suitable to be used for Equal/NotEqual operators.
Change-Id: Ib84713e1da59d92e07bc974d93b6def8217bb067
Diffstat (limited to 'sc/source/core/tool/interpr1.cxx')
-rw-r--r-- | sc/source/core/tool/interpr1.cxx | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx index 78922695f522..b464da4e8716 100644 --- a/sc/source/core/tool/interpr1.cxx +++ b/sc/source/core/tool/interpr1.cxx @@ -801,9 +801,10 @@ bool ScInterpreter::JumpMatrix( short nStackLevel ) return false; } -double ScInterpreter::Compare() +double ScInterpreter::Compare( ScQueryOp eOp ) { sc::Compare aComp; + aComp.meOp = eOp; aComp.mbIgnoreCase = pDok->GetDocOptions().IsIgnoreCase(); for( short i = 1; i >= 0; i-- ) { @@ -888,7 +889,7 @@ double ScInterpreter::Compare() if( nGlobalError ) return 0; nCurFmtType = nFuncFmtType = css::util::NumberFormat::LOGICAL; - return sc::CompareFunc(aComp.maCells[0], aComp.maCells[1], aComp.mbIgnoreCase); + return sc::CompareFunc(aComp); } sc::RangeMatrix ScInterpreter::CompareMat( ScQueryOp eOp, sc::CompareOptions* pOptions ) @@ -997,8 +998,7 @@ sc::RangeMatrix ScInterpreter::CompareMat( ScQueryOp eOp, sc::CompareOptions* pO rCell.mbEmpty = false; } } - aRes.mpMat->PutDouble( - sc::CompareFunc(aComp.maCells[0], aComp.maCells[1], aComp.mbIgnoreCase, pOptions), j, k); + aRes.mpMat->PutDouble( sc::CompareFunc( aComp, pOptions), j, k); } else aRes.mpMat->PutError( errNoValue, j, k); @@ -1088,7 +1088,7 @@ void ScInterpreter::ScEqual() PushMatrix(aMat); } else - PushInt( int(Compare() == 0) ); + PushInt( int(Compare( SC_EQUAL) == 0) ); } void ScInterpreter::ScNotEqual() @@ -1105,7 +1105,7 @@ void ScInterpreter::ScNotEqual() PushMatrix(aMat); } else - PushInt( int(Compare() != 0) ); + PushInt( int(Compare( SC_NOT_EQUAL) != 0) ); } void ScInterpreter::ScLess() @@ -1122,7 +1122,7 @@ void ScInterpreter::ScLess() PushMatrix(aMat); } else - PushInt( int(Compare() < 0) ); + PushInt( int(Compare( SC_LESS) < 0) ); } void ScInterpreter::ScGreater() @@ -1139,7 +1139,7 @@ void ScInterpreter::ScGreater() PushMatrix(aMat); } else - PushInt( int(Compare() > 0) ); + PushInt( int(Compare( SC_GREATER) > 0) ); } void ScInterpreter::ScLessEqual() @@ -1156,7 +1156,7 @@ void ScInterpreter::ScLessEqual() PushMatrix(aMat); } else - PushInt( int(Compare() <= 0) ); + PushInt( int(Compare( SC_LESS_EQUAL) <= 0) ); } void ScInterpreter::ScGreaterEqual() @@ -1173,7 +1173,7 @@ void ScInterpreter::ScGreaterEqual() PushMatrix(aMat); } else - PushInt( int(Compare() >= 0) ); + PushInt( int(Compare( SC_GREATER_EQUAL) >= 0) ); } void ScInterpreter::ScAnd() |