[Libreoffice-commits] .: 2 commits - sc/inc sc/source

Kohei Yoshida kohei at kemper.freedesktop.org
Fri Mar 9 09:37:19 PST 2012


 sc/inc/dpitemdata.hxx              |    4 +---
 sc/source/core/data/dpitemdata.cxx |   27 +++++++++++----------------
 2 files changed, 12 insertions(+), 19 deletions(-)

New commits:
commit 1bb7875f275d95a0a764df5d8d6954b7e8841152
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date:   Fri Mar 9 12:37:30 2012 -0500

    Correct equality check & disable Dump() for normal build.

diff --git a/sc/inc/dpitemdata.hxx b/sc/inc/dpitemdata.hxx
index 4aac20c..3e09d89 100644
--- a/sc/inc/dpitemdata.hxx
+++ b/sc/inc/dpitemdata.hxx
@@ -40,7 +40,7 @@
 
 #include <boost/unordered_map.hpp>
 
-#define DEBUG_DP_ITEM_DATA 1
+#define DEBUG_DP_ITEM_DATA 0
 
 class ScDocument;
 
diff --git a/sc/source/core/data/dpitemdata.cxx b/sc/source/core/data/dpitemdata.cxx
index f0ac5d5..2870a5c 100644
--- a/sc/source/core/data/dpitemdata.cxx
+++ b/sc/source/core/data/dpitemdata.cxx
@@ -186,8 +186,17 @@ bool ScDPItemData::IsCaseInsEqual(const ScDPItemData& r) const
     if (meType != r.meType)
         return false;
 
-    if (meType == Value)
-        return rtl::math::approxEqual(mfValue, r.mfValue);
+    switch (meType)
+    {
+        case Value:
+        case RangeStart:
+            return rtl::math::approxEqual(mfValue, r.mfValue);
+        case GroupValue:
+            return maGroupValue.mnGroupType == r.maGroupValue.mnGroupType &&
+                maGroupValue.mnValue == r.maGroupValue.mnValue;
+        default:
+            ;
+    }
 
     return ScGlobal::GetpTransliteration()->isEqual(GetString(), r.GetString());
 }
commit 5e9d811ab8a1c0481c67e3d4589e0a16fb781120
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date:   Fri Mar 9 12:35:33 2012 -0500

    Apparently nobody uses Hash() anymore.

diff --git a/sc/inc/dpitemdata.hxx b/sc/inc/dpitemdata.hxx
index 926ce7a..4aac20c 100644
--- a/sc/inc/dpitemdata.hxx
+++ b/sc/inc/dpitemdata.hxx
@@ -93,8 +93,6 @@ public:
     void SetErrorString(const rtl::OUString& rS);
     bool IsCaseInsEqual(const ScDPItemData& r) const;
 
-    size_t Hash() const;
-
     // exact equality
     bool operator==(const ScDPItemData& r) const;
 
diff --git a/sc/source/core/data/dpitemdata.cxx b/sc/source/core/data/dpitemdata.cxx
index 8f16a33..f0ac5d5 100644
--- a/sc/source/core/data/dpitemdata.cxx
+++ b/sc/source/core/data/dpitemdata.cxx
@@ -192,20 +192,6 @@ bool ScDPItemData::IsCaseInsEqual(const ScDPItemData& r) const
     return ScGlobal::GetpTransliteration()->isEqual(GetString(), r.GetString());
 }
 
-size_t ScDPItemData::Hash() const
-{
-    if (meType == Value)
-        return static_cast<size_t>(rtl::math::approxFloor(mfValue));
-
-    // If we do unicode safe case insensitive hash we can drop
-    // ScDPItemData::operator== and use ::IsCasInsEqual
-    rtl::OUString aStr = GetString();
-    if (aStr.isEmpty())
-        return 0;
-
-    return rtl_ustr_hashCode_WithLength(aStr.getStr(), aStr.getLength());
-}
-
 bool ScDPItemData::operator== (const ScDPItemData& r) const
 {
     if (meType != r.meType)


More information about the Libreoffice-commits mailing list