[Libreoffice-commits] core.git: Branch 'private/kohei/calc-shared-string' - editeng/source include/editeng include/svl sc/inc sc/qa sc/source svl/Library_svl.mk svl/qa svl/source

Kohei Yoshida kohei.yoshida at collabora.com
Fri Oct 4 16:12:43 PDT 2013


 editeng/source/editeng/editobj.cxx     |   20 ++--
 editeng/source/editeng/editobj2.hxx    |   14 +--
 include/editeng/editobj.hxx            |    8 -
 include/svl/sharedstringpool.hxx       |   94 +++++++++++++++++++++
 include/svl/stringpool.hxx             |   94 ---------------------
 sc/inc/document.hxx                    |    8 -
 sc/inc/formulagroup.hxx                |    4 
 sc/qa/unit/ucalc.cxx                   |    4 
 sc/source/core/data/column3.cxx        |    2 
 sc/source/core/data/documen2.cxx       |    8 -
 sc/source/core/data/documentimport.cxx |    2 
 sc/source/core/tool/interpr1.cxx       |    2 
 svl/Library_svl.mk                     |    2 
 svl/qa/unit/svl.cxx                    |    6 -
 svl/source/misc/sharedstringpool.cxx   |  145 +++++++++++++++++++++++++++++++++
 svl/source/misc/stringpool.cxx         |  145 ---------------------------------
 16 files changed, 279 insertions(+), 279 deletions(-)

New commits:
commit 6ba52e44e9719185b0726e241d178bcbbda67ae4
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Fri Oct 4 19:13:26 2013 -0400

    Rename StringPool to SharedStringPool because that's what it is.
    
    Change-Id: I2fc3ce4f0c2291d402cb470346d5561373fb51e7

diff --git a/editeng/source/editeng/editobj.cxx b/editeng/source/editeng/editobj.cxx
index 4e6af47..3a5d41c 100644
--- a/editeng/source/editeng/editobj.cxx
+++ b/editeng/source/editeng/editobj.cxx
@@ -44,7 +44,7 @@
 
 #include <vcl/graph.hxx>
 #include <svl/intitem.hxx>
-#include "svl/stringpool.hxx"
+#include "svl/sharedstringpool.hxx"
 #include <unotools/fontcvt.hxx>
 #include <tools/tenccvt.hxx>
 
@@ -149,17 +149,17 @@ ContentInfo::~ContentInfo()
     aAttribs.clear();
 }
 
-void ContentInfo::NormalizeString( svl::StringPool& rPool )
+void ContentInfo::NormalizeString( svl::SharedStringPool& rPool )
 {
     aText = OUString(rPool.intern(aText));
 }
 
-sal_uIntPtr ContentInfo::GetStringID( const svl::StringPool& rPool ) const
+sal_uIntPtr ContentInfo::GetStringID( const svl::SharedStringPool& rPool ) const
 {
     return rPool.getIdentifier(aText);
 }
 
-sal_uIntPtr ContentInfo::GetStringIDIgnoreCase( const svl::StringPool& rPool ) const
+sal_uIntPtr ContentInfo::GetStringIDIgnoreCase( const svl::SharedStringPool& rPool ) const
 {
     return rPool.getIdentifierIgnoreCase(aText);
 }
@@ -332,17 +332,17 @@ editeng::FieldUpdater EditTextObject::GetFieldUpdater()
     return mpImpl->GetFieldUpdater();
 }
 
-void EditTextObject::NormalizeString( svl::StringPool& rPool )
+void EditTextObject::NormalizeString( svl::SharedStringPool& rPool )
 {
     mpImpl->NormalizeString(rPool);
 }
 
-bool EditTextObject::GetStringIDs( const svl::StringPool& rPool, std::vector<sal_uIntPtr>& rIDs ) const
+bool EditTextObject::GetStringIDs( const svl::SharedStringPool& rPool, std::vector<sal_uIntPtr>& rIDs ) const
 {
     return mpImpl->GetStringIDs(rPool, rIDs);
 }
 
-bool EditTextObject::GetStringIDsIgnoreCase( const svl::StringPool& rPool, std::vector<sal_uIntPtr>& rIDs ) const
+bool EditTextObject::GetStringIDsIgnoreCase( const svl::SharedStringPool& rPool, std::vector<sal_uIntPtr>& rIDs ) const
 {
     return mpImpl->GetStringIDsIgnoreCase(rPool, rIDs);
 }
@@ -633,7 +633,7 @@ void EditTextObjectImpl::SetUserType( sal_uInt16 n )
     nUserType = n;
 }
 
-void EditTextObjectImpl::NormalizeString( svl::StringPool& rPool )
+void EditTextObjectImpl::NormalizeString( svl::SharedStringPool& rPool )
 {
     ContentInfosType::iterator it = aContents.begin(), itEnd = aContents.end();
     for (; it != itEnd; ++it)
@@ -643,7 +643,7 @@ void EditTextObjectImpl::NormalizeString( svl::StringPool& rPool )
     }
 }
 
-bool EditTextObjectImpl::GetStringIDs( const svl::StringPool& rPool, std::vector<sal_uIntPtr>& rIDs ) const
+bool EditTextObjectImpl::GetStringIDs( const svl::SharedStringPool& rPool, std::vector<sal_uIntPtr>& rIDs ) const
 {
     std::vector<sal_uIntPtr> aIDs;
     aIDs.reserve(aContents.size());
@@ -662,7 +662,7 @@ bool EditTextObjectImpl::GetStringIDs( const svl::StringPool& rPool, std::vector
     return true;
 }
 
-bool EditTextObjectImpl::GetStringIDsIgnoreCase( const svl::StringPool& rPool, std::vector<sal_uIntPtr>& rIDs ) const
+bool EditTextObjectImpl::GetStringIDsIgnoreCase( const svl::SharedStringPool& rPool, std::vector<sal_uIntPtr>& rIDs ) const
 {
     std::vector<sal_uIntPtr> aIDs;
     aIDs.reserve(aContents.size());
diff --git a/editeng/source/editeng/editobj2.hxx b/editeng/source/editeng/editobj2.hxx
index d2118d7..20dafe9 100644
--- a/editeng/source/editeng/editobj2.hxx
+++ b/editeng/source/editeng/editobj2.hxx
@@ -37,7 +37,7 @@ struct Section;
 
 namespace svl {
 
-class StringPool;
+class SharedStringPool;
 
 }
 
@@ -142,9 +142,9 @@ private:
 public:
                         ~ContentInfo();
 
-    void NormalizeString( svl::StringPool& rPool );
-    sal_uIntPtr GetStringID( const svl::StringPool& rPool ) const;
-    sal_uIntPtr GetStringIDIgnoreCase( const svl::StringPool& rPool ) const;
+    void NormalizeString( svl::SharedStringPool& rPool );
+    sal_uIntPtr GetStringID( const svl::SharedStringPool& rPool ) const;
+    sal_uIntPtr GetStringIDIgnoreCase( const svl::SharedStringPool& rPool ) const;
 
     const XEditAttributesType& GetAttribs() const { return aAttribs; }
     XEditAttributesType& GetAttribs() { return aAttribs; }
@@ -208,9 +208,9 @@ public:
     sal_uInt16 GetUserType() const;
     void SetUserType( sal_uInt16 n );
 
-    void NormalizeString( svl::StringPool& rPool );
-    bool GetStringIDs( const svl::StringPool& rPool, std::vector<sal_uIntPtr>& rIDs ) const;
-    bool GetStringIDsIgnoreCase( const svl::StringPool& rPool, std::vector<sal_uIntPtr>& rIDs ) const;
+    void NormalizeString( svl::SharedStringPool& rPool );
+    bool GetStringIDs( const svl::SharedStringPool& rPool, std::vector<sal_uIntPtr>& rIDs ) const;
+    bool GetStringIDsIgnoreCase( const svl::SharedStringPool& rPool, std::vector<sal_uIntPtr>& rIDs ) const;
 
     bool                    IsVertical() const;
     void                    SetVertical( bool b );
diff --git a/include/editeng/editobj.hxx b/include/editeng/editobj.hxx
index 4751469..3d1ccca 100644
--- a/include/editeng/editobj.hxx
+++ b/include/editeng/editobj.hxx
@@ -51,7 +51,7 @@ struct Section;
 
 namespace svl {
 
-class StringPool;
+class SharedStringPool;
 
 }
 
@@ -83,10 +83,10 @@ public:
      *
      * @param rPool shared string pool.
      */
-    void NormalizeString( svl::StringPool& rPool );
+    void NormalizeString( svl::SharedStringPool& rPool );
 
-    bool GetStringIDs( const svl::StringPool& rPool, std::vector<sal_uIntPtr>& rIDs ) const;
-    bool GetStringIDsIgnoreCase( const svl::StringPool& rPool, std::vector<sal_uIntPtr>& rIDs ) const;
+    bool GetStringIDs( const svl::SharedStringPool& rPool, std::vector<sal_uIntPtr>& rIDs ) const;
+    bool GetStringIDsIgnoreCase( const svl::SharedStringPool& rPool, std::vector<sal_uIntPtr>& rIDs ) const;
 
     const SfxItemPool* GetPool() const;
     sal_uInt16 GetUserType() const;    // For OutlinerMode, it can however not save in compatible format
diff --git a/include/svl/stringpool.hxx b/include/svl/sharedstringpool.hxx
similarity index 95%
rename from include/svl/stringpool.hxx
rename to include/svl/sharedstringpool.hxx
index fbcff1e..6793162 100644
--- a/include/svl/stringpool.hxx
+++ b/include/svl/sharedstringpool.hxx
@@ -25,7 +25,7 @@ namespace svl {
  * original-cased strings to upper-cased strings for case insensitive
  * operations.
  */
-class SVL_DLLPUBLIC StringPool
+class SVL_DLLPUBLIC SharedStringPool
 {
     typedef boost::unordered_set<OUString, OUStringHash> StrHashType;
     typedef std::pair<StrHashType::iterator, bool> InsertResultType;
@@ -38,8 +38,8 @@ class SVL_DLLPUBLIC StringPool
 
 public:
 
-    StringPool();
-    StringPool( const CharClass* pCharClass );
+    SharedStringPool();
+    SharedStringPool( const CharClass* pCharClass );
 
     /**
      * Intern a string object into the shared string pool.
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index 2ef6073..550f7b7 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -50,7 +50,7 @@
 
 namespace editeng { class SvxBorderLine; }
 namespace formula { struct VectorRefArray; }
-namespace svl { class StringPool; }
+namespace svl { class SharedStringPool; }
 
 namespace sc {
     struct FormulaGroupContext;
@@ -245,7 +245,7 @@ private:
 
     rtl::Reference<ScPoolHelper> xPoolHelper;
 
-    boost::scoped_ptr<svl::StringPool> mpCellStringPool;
+    boost::scoped_ptr<svl::SharedStringPool> mpCellStringPool;
 
     SfxUndoManager*     mpUndoManager;
     ScFieldEditEngine*  pEditEngine;                    // uses pEditPool from xPoolHelper
@@ -859,8 +859,8 @@ public:
      */
     double* GetValueCell( const ScAddress& rPos );
 
-    svl::StringPool& GetCellStringPool();
-    const svl::StringPool& GetCellStringPool() const;
+    svl::SharedStringPool& GetCellStringPool();
+    const svl::SharedStringPool& GetCellStringPool() const;
     sal_uIntPtr GetCellStringID( const ScAddress& rPos ) const;
     sal_uIntPtr GetCellStringIDIgnoreCase( const ScAddress& rPos ) const;
 
diff --git a/sc/inc/formulagroup.hxx b/sc/inc/formulagroup.hxx
index a8d20bb..fc3af2a 100644
--- a/sc/inc/formulagroup.hxx
+++ b/sc/inc/formulagroup.hxx
@@ -14,7 +14,7 @@
 #include "types.hxx"
 #include "platforminfo.hxx"
 
-#include "svl/stringpool.hxx"
+#include "svl/sharedstringpool.hxx"
 
 #include <vector>
 #include <boost/noncopyable.hpp>
@@ -33,7 +33,7 @@ struct FormulaGroupContext : boost::noncopyable
     typedef boost::ptr_vector<NumArrayType> NumArrayStoreType;
     typedef boost::ptr_vector<StrArrayType> StrArrayStoreType;
 
-    svl::StringPool maStrPool;
+    svl::SharedStringPool maStrPool;
     NumArrayStoreType maNumArrays;
     StrArrayStoreType maStrArrays;
 };
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index 3e7239e..eb61b90 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -65,7 +65,7 @@
 #include <svx/svdocirc.hxx>
 #include <svx/svdopath.hxx>
 #include "svl/srchitem.hxx"
-#include "svl/stringpool.hxx"
+#include "svl/sharedstringpool.hxx"
 
 #include <sfx2/docfile.hxx>
 
@@ -502,7 +502,7 @@ void Test::testCellStringPool()
     CPPUNIT_ASSERT_MESSAGE("They must be equal when cases are ignored.", nId1 == nId2);
 
     // Check the string counts after purging. Purging shouldn't remove any strings in this case.
-    svl::StringPool& rPool = m_pDoc->GetCellStringPool();
+    svl::SharedStringPool& rPool = m_pDoc->GetCellStringPool();
     rPool.purge();
     CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(4), rPool.getCount());
     CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(2), rPool.getCountIgnoreCase());
diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index 6c964ca..c651cca 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -57,7 +57,7 @@
 #include <svl/zforlist.hxx>
 #include <svl/zformat.hxx>
 #include <svl/broadcast.hxx>
-#include "svl/stringpool.hxx"
+#include "svl/sharedstringpool.hxx"
 #include "editeng/editstat.hxx"
 
 #include <cstdio>
diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx
index ea00606..0fb6755 100644
--- a/sc/source/core/data/documen2.cxx
+++ b/sc/source/core/data/documen2.cxx
@@ -35,7 +35,7 @@
 #include <vcl/virdev.hxx>
 #include <comphelper/processfactory.hxx>
 #include <svl/PasswordHelper.hxx>
-#include "svl/stringpool.hxx"
+#include "svl/sharedstringpool.hxx"
 #include <tools/tenccvt.hxx>
 #include <tools/urlobj.hxx>
 #include <rtl/crc.h>
@@ -119,7 +119,7 @@ private:
 // STATIC DATA -----------------------------------------------------------
 
 ScDocument::ScDocument( ScDocumentMode eMode, SfxObjectShell* pDocShell ) :
-        mpCellStringPool(new svl::StringPool(ScGlobal::pCharClass)),
+        mpCellStringPool(new svl::SharedStringPool(ScGlobal::pCharClass)),
         mpUndoManager( NULL ),
         pEditEngine( NULL ),
         pNoteEngine( NULL ),
@@ -600,12 +600,12 @@ ScRefCellValue ScDocument::GetRefCellValue( const ScAddress& rPos )
     return maTabs[rPos.Tab()]->GetRefCellValue(rPos.Col(), rPos.Row());
 }
 
-svl::StringPool& ScDocument::GetCellStringPool()
+svl::SharedStringPool& ScDocument::GetCellStringPool()
 {
     return *mpCellStringPool;
 }
 
-const svl::StringPool& ScDocument::GetCellStringPool() const
+const svl::SharedStringPool& ScDocument::GetCellStringPool() const
 {
     return *mpCellStringPool;
 }
diff --git a/sc/source/core/data/documentimport.cxx b/sc/source/core/data/documentimport.cxx
index 4c9157d..4822557 100644
--- a/sc/source/core/data/documentimport.cxx
+++ b/sc/source/core/data/documentimport.cxx
@@ -17,7 +17,7 @@
 #include "mtvelements.hxx"
 #include "tokenarray.hxx"
 
-#include "svl/stringpool.hxx"
+#include "svl/sharedstringpool.hxx"
 
 struct ScDocumentImportImpl
 {
diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index 7026a46..6bf0093 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -60,7 +60,7 @@
 
 #include <comphelper/processfactory.hxx>
 #include <comphelper/string.hxx>
-#include "svl/stringpool.hxx"
+#include "svl/sharedstringpool.hxx"
 
 #include <stdlib.h>
 #include <string.h>
diff --git a/svl/Library_svl.mk b/svl/Library_svl.mk
index eddabf0..dc2bf41 100644
--- a/svl/Library_svl.mk
+++ b/svl/Library_svl.mk
@@ -110,7 +110,7 @@ $(eval $(call gb_Library_add_exception_objects,svl,\
     svl/source/misc/lockfilecommon \
     svl/source/misc/ownlist \
     svl/source/misc/sharecontrolfile \
-    svl/source/misc/stringpool \
+    svl/source/misc/sharedstringpool \
     svl/source/misc/strmadpt \
     svl/source/misc/urihelper \
     svl/source/notify/brdcst \
diff --git a/svl/qa/unit/svl.cxx b/svl/qa/unit/svl.cxx
index a34bb47..fe987ec 100644
--- a/svl/qa/unit/svl.cxx
+++ b/svl/qa/unit/svl.cxx
@@ -33,7 +33,7 @@
 
 #include "svl/zforlist.hxx"
 #include "svl/zformat.hxx"
-#include "svl/stringpool.hxx"
+#include "svl/sharedstringpool.hxx"
 #include "unotools/syslocale.hxx"
 
 #include <boost/scoped_ptr.hpp>
@@ -299,7 +299,7 @@ void Test::testNumberFormat()
 void Test::testStringPool()
 {
     SvtSysLocale aSysLocale;
-    svl::StringPool aPool(aSysLocale.GetCharClassPtr());
+    svl::SharedStringPool aPool(aSysLocale.GetCharClassPtr());
 
     const rtl_uString* p1 = aPool.intern("Andy");
     const rtl_uString* p2 = aPool.intern("Andy");
@@ -342,7 +342,7 @@ void Test::testStringPool()
 void Test::testStringPoolPurge()
 {
     SvtSysLocale aSysLocale;
-    svl::StringPool aPool(aSysLocale.GetCharClassPtr());
+    svl::SharedStringPool aPool(aSysLocale.GetCharClassPtr());
     aPool.intern("Andy");
     aPool.intern("andy");
     aPool.intern("ANDY");
diff --git a/svl/source/misc/stringpool.cxx b/svl/source/misc/sharedstringpool.cxx
similarity index 83%
rename from svl/source/misc/stringpool.cxx
rename to svl/source/misc/sharedstringpool.cxx
index 7ebc207..805a6fc 100644
--- a/svl/source/misc/stringpool.cxx
+++ b/svl/source/misc/sharedstringpool.cxx
@@ -7,15 +7,15 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#include "svl/stringpool.hxx"
+#include "svl/sharedstringpool.hxx"
 #include "unotools/charclass.hxx"
 
 namespace svl {
 
-StringPool::StringPool() : mpCharClass(NULL) {}
-StringPool::StringPool( const CharClass* pCharClass ) : mpCharClass(pCharClass) {}
+SharedStringPool::SharedStringPool() : mpCharClass(NULL) {}
+SharedStringPool::SharedStringPool( const CharClass* pCharClass ) : mpCharClass(pCharClass) {}
 
-rtl_uString* StringPool::intern( const OUString& rStr )
+rtl_uString* SharedStringPool::intern( const OUString& rStr )
 {
     InsertResultType aRes = findOrInsert(maStrPool, rStr);
     if (aRes.first == maStrPool.end())
@@ -45,13 +45,13 @@ rtl_uString* StringPool::intern( const OUString& rStr )
     return pOrig;
 }
 
-sal_uIntPtr StringPool::getIdentifier( const OUString& rStr ) const
+sal_uIntPtr SharedStringPool::getIdentifier( const OUString& rStr ) const
 {
     StrHashType::const_iterator it = maStrPool.find(rStr);
     return (it == maStrPool.end()) ? 0 : reinterpret_cast<sal_uIntPtr>(it->pData);
 }
 
-sal_uIntPtr StringPool::getIdentifierIgnoreCase( const OUString& rStr ) const
+sal_uIntPtr SharedStringPool::getIdentifierIgnoreCase( const OUString& rStr ) const
 {
     StrHashType::const_iterator itOrig = maStrPool.find(rStr);
     if (itOrig == maStrPool.end())
@@ -76,7 +76,7 @@ inline sal_Int32 getRefCount( const rtl_uString* p )
 
 }
 
-void StringPool::purge()
+void SharedStringPool::purge()
 {
     StrHashType aNewStrPool;
     StrHashType::iterator it = maStrPool.begin(), itEnd = maStrPool.end();
@@ -111,17 +111,17 @@ void StringPool::purge()
     maStrPoolUpper.swap(aNewStrPool);
 }
 
-size_t StringPool::getCount() const
+size_t SharedStringPool::getCount() const
 {
     return maStrPool.size();
 }
 
-size_t StringPool::getCountIgnoreCase() const
+size_t SharedStringPool::getCountIgnoreCase() const
 {
     return maStrPoolUpper.size();
 }
 
-StringPool::InsertResultType StringPool::findOrInsert( StrHashType& rPool, const OUString& rStr ) const
+SharedStringPool::InsertResultType SharedStringPool::findOrInsert( StrHashType& rPool, const OUString& rStr ) const
 {
     StrHashType::iterator it = rPool.find(rStr);
     bool bInserted = false;


More information about the Libreoffice-commits mailing list