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

Kohei Yoshida kohei at kemper.freedesktop.org
Wed Feb 8 17:35:01 PST 2012


 sc/inc/collect.hxx              |   45 ---------------
 sc/source/core/tool/collect.cxx |  120 +---------------------------------------
 sc/source/ui/app/inputhdl.cxx   |   12 ----
 3 files changed, 9 insertions(+), 168 deletions(-)

New commits:
commit 1eecb1841e8692e03e8e0aecaa99e3e7a3300d4c
Author: Kohei Yoshida <kohei.yoshida at suse.com>
Date:   Wed Feb 8 20:34:23 2012 -0500

    ScSortedCollection is now officially unused.  Nuking it.

diff --git a/sc/inc/collect.hxx b/sc/inc/collect.hxx
index d175fa3..3dc738f 100644
--- a/sc/inc/collect.hxx
+++ b/sc/inc/collect.hxx
@@ -29,22 +29,10 @@
 #ifndef SC_COLLECT_HXX
 #define SC_COLLECT_HXX
 
-#include "address.hxx"
-#include <tools/string.hxx>
-
-#ifndef INCLUDED_LIMITS_H
-#include <limits.h>
-#define INCLUDED_LIMITS_H
-#endif
 #include "scdllapi.h"
+#include "rtl/ustring.hxx"
 
-#define MAXCOLLECTIONSIZE       16384
-#define MAXDELTA                1024
-#define SCPOS_INVALID           USHRT_MAX
-
-#include <boost/ptr_container/ptr_set.hpp>
-
-class ScDocument;
+#include <set>
 
 class SC_DLLPUBLIC ScDataObject
 {
@@ -83,35 +71,6 @@ public:
             ScCollection&   operator=( const ScCollection& rCol );
 };
 
-
-class SC_DLLPUBLIC  ScSortedCollection : public ScCollection
-{
-private:
-    sal_Bool    bDuplicates;
-protected:
-                        // for ScStrCollection load/store
-            void        SetDups( sal_Bool bVal ) { bDuplicates = bVal; }
-            sal_Bool        IsDups() const { return bDuplicates; }
-public:
-    ScSortedCollection(sal_uInt16 nLim = 4, sal_uInt16 nDel = 4, sal_Bool bDup = false);
-    ScSortedCollection(const ScSortedCollection& rScSortedCollection) :
-                            ScCollection(rScSortedCollection),
-                            bDuplicates(rScSortedCollection.bDuplicates) {}
-
-    virtual sal_uInt16      IndexOf(ScDataObject* pScDataObject) const;
-    virtual short       Compare(ScDataObject* pKey1, ScDataObject* pKey2) const = 0;
-    virtual sal_Bool        IsEqual(ScDataObject* pKey1, ScDataObject* pKey2) const;
-    sal_Bool        Search(ScDataObject* pScDataObject, sal_uInt16& rIndex) const;
-    virtual sal_Bool        Insert(ScDataObject* pScDataObject);
-    virtual sal_Bool        InsertPos(ScDataObject* pScDataObject, sal_uInt16& nIndex);
-
-    sal_Bool        operator==(const ScSortedCollection& rCmp) const;
-};
-
-//------------------------------------------------------------------------
-// TypedScStrCollection: wie ScStrCollection, nur, dass Zahlen vor Strings
-//                     sortiert werden
-
 class TypedStrData
 {
 public:
diff --git a/sc/source/core/tool/collect.cxx b/sc/source/core/tool/collect.cxx
index 2bbf244..e8f3de6 100644
--- a/sc/source/core/tool/collect.cxx
+++ b/sc/source/core/tool/collect.cxx
@@ -26,16 +26,15 @@
  *
  ************************************************************************/
 
+#include <unotools/transliterationwrapper.hxx>
 
-
+#include "collect.hxx"
+#include "global.hxx"
 
 #include <string.h>
-#include <tools/stream.hxx>
-#include <unotools/transliterationwrapper.hxx>
 
-#include "rechead.hxx"
-#include "collect.hxx"
-#include "document.hxx"         // fuer TypedStrData Konstruktor
+#define MAXCOLLECTIONSIZE       16384
+#define MAXDELTA                1024
 
 // -----------------------------------------------------------------------
 
@@ -197,115 +196,6 @@ ScDataObject*   ScCollection::Clone() const
     return new ScCollection(*this);
 }
 
-//------------------------------------------------------------------------
-// ScSortedCollection
-//------------------------------------------------------------------------
-
-ScSortedCollection::ScSortedCollection(sal_uInt16 nLim, sal_uInt16 nDel, sal_Bool bDup) :
-    ScCollection (nLim, nDel),
-    bDuplicates ( bDup)
-{
-}
-
-//------------------------------------------------------------------------
-
-sal_uInt16 ScSortedCollection::IndexOf(ScDataObject* pScDataObject) const
-{
-    sal_uInt16 nIndex;
-    if (Search(pScDataObject, nIndex))
-        return nIndex;
-    else
-        return 0xffff;
-}
-
-//------------------------------------------------------------------------
-
-sal_Bool ScSortedCollection::Search(ScDataObject* pScDataObject, sal_uInt16& rIndex) const
-{
-    rIndex = nCount;
-    sal_Bool bFound = false;
-    short nLo = 0;
-    short nHi = nCount - 1;
-    short nIndex;
-    short nCompare;
-    while (nLo <= nHi)
-    {
-        nIndex = (nLo + nHi) / 2;
-        nCompare = Compare(pItems[nIndex], pScDataObject);
-        if (nCompare < 0)
-            nLo = nIndex + 1;
-        else
-        {
-            nHi = nIndex - 1;
-            if (nCompare == 0)
-            {
-                bFound = sal_True;
-                nLo = nIndex;
-            }
-        }
-    }
-    rIndex = nLo;
-    return bFound;
-}
-
-//------------------------------------------------------------------------
-
-sal_Bool ScSortedCollection::Insert(ScDataObject* pScDataObject)
-{
-    sal_uInt16 nIndex;
-    sal_Bool bFound = Search(pScDataObject, nIndex);
-    if (bFound)
-    {
-        if (bDuplicates)
-            return AtInsert(nIndex, pScDataObject);
-        else
-            return false;
-    }
-    else
-        return AtInsert(nIndex, pScDataObject);
-}
-
-//------------------------------------------------------------------------
-
-sal_Bool ScSortedCollection::InsertPos(ScDataObject* pScDataObject, sal_uInt16& nIndex)
-{
-    sal_Bool bFound = Search(pScDataObject, nIndex);
-    if (bFound)
-    {
-        if (bDuplicates)
-            return AtInsert(nIndex, pScDataObject);
-        else
-            return false;
-    }
-    else
-        return AtInsert(nIndex, pScDataObject);
-}
-
-//------------------------------------------------------------------------
-
-sal_Bool ScSortedCollection::operator==(const ScSortedCollection& rCmp) const
-{
-    if ( nCount != rCmp.nCount )
-        return false;
-    for (sal_uInt16 i=0; i<nCount; i++)
-        if ( !IsEqual(pItems[i],rCmp.pItems[i]) )
-            return false;
-    return sal_True;
-}
-
-//------------------------------------------------------------------------
-
-//  IsEqual - komplette Inhalte vergleichen
-
-sal_Bool ScSortedCollection::IsEqual(ScDataObject* pKey1, ScDataObject* pKey2) const
-{
-    return ( Compare(pKey1, pKey2) == 0 );      // Default: nur Index vergleichen
-}
-
-//------------------------------------------------------------------------
-// TypedScStrCollection
-//------------------------------------------------------------------------
-
 bool TypedStrData::LessCaseSensitive::operator() (const TypedStrData& left, const TypedStrData& right) const
 {
     if (left.meStrType != right.meStrType)
commit 9300ae1ac0e4ed4ecdf64d59033d27f8171852c6
Author: Kohei Yoshida <kohei.yoshida at suse.com>
Date:   Wed Feb 8 20:04:56 2012 -0500

    Old result not used for now always case sensitive search.

diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index 27d333b..08459bf 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -122,14 +122,6 @@ ScTypedCaseStrSet::const_iterator findText(
     const ScTypedCaseStrSet& rDataSet, ScTypedCaseStrSet::const_iterator itPos,
     const rtl::OUString& rStart, rtl::OUString& rResult, bool bBack)
 {
-    rtl::OUString aOldResult;
-    if (itPos != rDataSet.end())
-    {
-        const TypedStrData& rData = *itPos;
-        if (rData.GetStringType())
-            aOldResult = rData.GetString();
-    }
-
     if (bBack)                                    // rueckwaerts
     {
         ScTypedCaseStrSet::const_reverse_iterator it = rDataSet.rbegin(), itEnd = rDataSet.rend();
commit 7513bba52c02d99700ce3821efe0691f89ac1bd5
Author: Kohei Yoshida <kohei.yoshida at suse.com>
Date:   Wed Feb 8 20:02:46 2012 -0500

    Apparently these two methods are now deprecated.

diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index 000625e..27d333b 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -202,8 +202,8 @@ void removeChars(rtl::OUString& rStr, sal_Unicode c)
     rtl::OUStringBuffer aBuf(rStr);
     for (sal_Int32 i = 0, n = aBuf.getLength(); i < n; ++i)
     {
-        if (aBuf.charAt(i) == c)
-            aBuf.setCharAt(i, sal_Unicode(' '));
+        if (aBuf[i] == c)
+            aBuf[i] = sal_Unicode(' ');
     }
     rStr = aBuf.makeStringAndClear();
 }


More information about the Libreoffice-commits mailing list