[Libreoffice-commits] core.git: sc/inc sc/Library_sc.mk sc/source

Kohei Yoshida kohei.yoshida at collabora.com
Tue Nov 25 20:19:47 PST 2014


 sc/Library_sc.mk                   |    1 
 sc/inc/formulagroup.hxx            |    2 -
 sc/inc/listenerquery.hxx           |    2 +
 sc/inc/refhint.hxx                 |    1 
 sc/inc/reordermap.hxx              |   39 +++++++++++++++++++++++++++++++++++++
 sc/inc/tokenarray.hxx              |    1 
 sc/inc/types.hxx                   |    3 --
 sc/source/core/data/table3.cxx     |    1 
 sc/source/core/tool/reordermap.cxx |   33 +++++++++++++++++++++++++++++++
 sc/source/core/tool/token.cxx      |    1 
 10 files changed, 80 insertions(+), 4 deletions(-)

New commits:
commit 57fbefe751978c33c205de454a8932145e5f438c
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Tue Nov 25 23:18:32 2014 -0500

    remove boost/unordered_map.hpp include from types.hxx.
    
    types.hxx is included by pretty much everyone inside sc.  Let's not
    stick a boost header in there...
    
    Change-Id: Iaf2aa9e13d0e02437bcd9e71a0143432abfa0a7c

diff --git a/sc/Library_sc.mk b/sc/Library_sc.mk
index a3373b0..ca854a8 100644
--- a/sc/Library_sc.mk
+++ b/sc/Library_sc.mk
@@ -265,6 +265,7 @@ $(eval $(call gb_Library_add_exception_objects,sc,\
     sc/source/core/tool/refreshtimer \
     sc/source/core/tool/reftokenhelper \
     sc/source/core/tool/refupdat \
+    sc/source/core/tool/reordermap \
     sc/source/core/tool/scmatrix \
     sc/source/core/tool/scopetools \
     sc/source/core/tool/sharedformula \
diff --git a/sc/inc/formulagroup.hxx b/sc/inc/formulagroup.hxx
index 3c2c282..ba5f318 100644
--- a/sc/inc/formulagroup.hxx
+++ b/sc/inc/formulagroup.hxx
@@ -22,7 +22,7 @@
 #include <vector>
 #include <boost/noncopyable.hpp>
 #include <boost/ptr_container/ptr_vector.hpp>
-#include <boost/unordered_set.hpp>
+#include <boost/unordered_map.hpp>
 
 class ScDocument;
 class ScTokenArray;
diff --git a/sc/inc/listenerquery.hxx b/sc/inc/listenerquery.hxx
index 2cbc957..c0620bb 100644
--- a/sc/inc/listenerquery.hxx
+++ b/sc/inc/listenerquery.hxx
@@ -13,6 +13,8 @@
 #include <address.hxx>
 #include <svl/listener.hxx>
 
+#include <boost/unordered_map.hpp>
+
 namespace sc {
 
 /**
diff --git a/sc/inc/refhint.hxx b/sc/inc/refhint.hxx
index 0f65aae..7081522 100644
--- a/sc/inc/refhint.hxx
+++ b/sc/inc/refhint.hxx
@@ -16,6 +16,7 @@
 namespace sc {
 
 struct RefUpdateContext;
+class ColRowReorderMapType;
 
 class RefHint : public SfxSimpleHint
 {
diff --git a/sc/inc/reordermap.hxx b/sc/inc/reordermap.hxx
new file mode 100644
index 0000000..8323384
--- /dev/null
+++ b/sc/inc/reordermap.hxx
@@ -0,0 +1,39 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#ifndef INCLUDED_SC_REORDERMAP_HXX
+#define INCLUDED_SC_REORDERMAP_HXX
+
+#include <types.hxx>
+#include <boost/unordered_map.hpp>
+
+namespace sc {
+
+class ColRowReorderMapType
+{
+    typedef boost::unordered_map<SCCOLROW,SCCOLROW> DataType;
+    DataType maData;
+public:
+    typedef DataType::value_type value_type;
+    typedef DataType::const_iterator const_iterator;
+    typedef DataType::iterator iterator;
+
+    const_iterator end() const;
+
+    std::pair<iterator, bool>
+        insert( DataType::value_type const& val );
+
+    const_iterator find( DataType::key_type const& key ) const;
+};
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/tokenarray.hxx b/sc/inc/tokenarray.hxx
index 07f344b..5d6593d 100644
--- a/sc/inc/tokenarray.hxx
+++ b/sc/inc/tokenarray.hxx
@@ -36,6 +36,7 @@ struct RefUpdateDeleteTabContext;
 struct RefUpdateMoveTabContext;
 struct RefUpdateResult;
 struct TokenStringContext;
+class ColRowReorderMapType;
 
 }
 
diff --git a/sc/inc/types.hxx b/sc/inc/types.hxx
index d92c9b5..039010a 100644
--- a/sc/inc/types.hxx
+++ b/sc/inc/types.hxx
@@ -13,7 +13,6 @@
 #include <sal/types.h>
 
 #include <boost/intrusive_ptr.hpp>
-#include <boost/unordered_map.hpp>
 
 class ScMatrix;
 
@@ -98,8 +97,6 @@ struct RangeMatrix
     bool isRangeValid() const;
 };
 
-typedef boost::unordered_map<SCCOLROW,SCCOLROW> ColRowReorderMapType;
-
 enum AreaOverlapType
 {
     AreaInside,
diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index 227dfab..f808db5 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -62,6 +62,7 @@
 #include <refhint.hxx>
 #include <listenerquery.hxx>
 #include <bcaslot.hxx>
+#include <reordermap.hxx>
 
 #include <svl/sharedstringpool.hxx>
 
diff --git a/sc/source/core/tool/reordermap.cxx b/sc/source/core/tool/reordermap.cxx
new file mode 100644
index 0000000..0aecc89
--- /dev/null
+++ b/sc/source/core/tool/reordermap.cxx
@@ -0,0 +1,33 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include <reordermap.hxx>
+
+namespace sc {
+
+ColRowReorderMapType::const_iterator ColRowReorderMapType::end() const
+{
+    return maData.end();
+}
+
+std::pair<ColRowReorderMapType::iterator, bool>
+ColRowReorderMapType::insert( ColRowReorderMapType::value_type const& val )
+{
+    return maData.insert(val);
+}
+
+ColRowReorderMapType::const_iterator
+ColRowReorderMapType::find( DataType::key_type const& key ) const
+{
+    return maData.find(key);
+}
+
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index 77f7cc2..b0bfb99 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -43,6 +43,7 @@
 #include "types.hxx"
 #include "globstr.hrc"
 #include "addincol.hxx"
+#include <reordermap.hxx>
 #include <svl/sharedstring.hxx>
 
 using ::std::vector;


More information about the Libreoffice-commits mailing list