summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2014-02-28 15:44:36 +0200
committerNoel Grandin <noel@peralex.com>2014-03-03 08:59:01 +0200
commit2148c4e9439c61c63a2bcf4078a839c0f9d6ee8c (patch)
treeab9f4e25bf18369c26ed3ab7d3e1d556a12d57d0 /sc
parent3d160b1f7844098fc6ef8d717a59b25069e1df91 (diff)
remove unused code in sc::CompareFunc
sc::CompareFunc(double, sc::Compare::Cell const&, sc::CompareOptions*) Change-Id: I0fc3a1a038bb051672dcb180380e25258ac7552f
Diffstat (limited to 'sc')
-rw-r--r--sc/inc/compare.hxx1
-rw-r--r--sc/source/core/tool/compare.cxx65
2 files changed, 0 insertions, 66 deletions
diff --git a/sc/inc/compare.hxx b/sc/inc/compare.hxx
index 485f882878b5..9f09e6b5d760 100644
--- a/sc/inc/compare.hxx
+++ b/sc/inc/compare.hxx
@@ -66,7 +66,6 @@ private:
NULL means case sensitivity document option is to be used!
*/
double CompareFunc( const Compare::Cell& rCell1, const Compare::Cell& rCell2, bool bIgnoreCase, CompareOptions* pOptions = NULL );
-double CompareFunc( double fCell1, const Compare::Cell& rCell2, CompareOptions* pOptions = NULL );
double CompareFunc( const Compare::Cell& rCell1, double fCell2, CompareOptions* pOptions = NULL );
double CompareFunc( double fCell1, double fCell2 );
diff --git a/sc/source/core/tool/compare.cxx b/sc/source/core/tool/compare.cxx
index 11936b66d941..8c0f1f74223c 100644
--- a/sc/source/core/tool/compare.cxx
+++ b/sc/source/core/tool/compare.cxx
@@ -208,71 +208,6 @@ double CompareFunc( const Compare::Cell& rCell1, const Compare::Cell& rCell2, bo
return fRes;
}
-double CompareFunc( double fCell1, const Compare::Cell& rCell2, CompareOptions* pOptions )
-{
- // Keep DoubleError if encountered
- // #i40539# if bEmpty is set, bVal/nVal are uninitialized
- if (!rtl::math::isFinite(fCell1))
- return fCell1;
- if (!rCell2.mbEmpty && rCell2.mbValue && !rtl::math::isFinite(rCell2.mfValue))
- return rCell2.mfValue;
-
- bool bStringQuery = false;
- double fRes = 0;
- if (rCell2.mbEmpty)
- {
- if (fCell1 != 0.0)
- {
- if (fCell1 < 0.0)
- fRes = -1; // -x < empty cell
- else
- fRes = 1; // x > empty cell
- }
- // else: empty cell == 0.0
- }
- else
- {
- if (rCell2.mbValue)
- {
- if (!rtl::math::approxEqual(fCell1, rCell2.mfValue))
- {
- if (fCell1 - rCell2.mfValue < 0)
- fRes = -1;
- else
- fRes = 1;
- }
- }
- else
- {
- fRes = -1; // number is less than string
- bStringQuery = true;
- }
- }
-
- if (bStringQuery && pOptions)
- {
- const ScQueryEntry& rEntry = pOptions->aQueryEntry;
- const ScQueryEntry::QueryItemsType& rItems = rEntry.GetQueryItems();
- if (!rItems.empty())
- {
- const ScQueryEntry::Item& rItem = rItems[0];
- if (rItem.meType != ScQueryEntry::ByString && !rItem.maString.isEmpty() &&
- (rEntry.eOp == SC_EQUAL || rEntry.eOp == SC_NOT_EQUAL))
- {
- // As in ScTable::ValidQuery() match a numeric string for a
- // number query that originated from a string, e.g. in SUMIF
- // and COUNTIF. Transliteration is not needed here.
- bool bEqual = rCell2.maStr == rItem.maString;
-
- // match => fRes=0, else fRes=1
- fRes = double((rEntry.eOp == SC_NOT_EQUAL) ? bEqual : !bEqual);
- }
- }
- }
-
- return fRes;
-}
-
double CompareFunc( const Compare::Cell& rCell1, double fCell2, CompareOptions* pOptions )
{
// Keep DoubleError if encountered