[Libreoffice-commits] core.git: Branch 'feature/formula-core-rework' - sc/inc sc/source

Kohei Yoshida kohei.yoshida at gmail.com
Wed May 22 17:46:05 PDT 2013


 sc/inc/clipcontext.hxx                  |   10 +++++++---
 sc/inc/listenercontext.hxx              |    9 ++++++---
 sc/source/core/data/clipcontext.cxx     |    5 +++--
 sc/source/core/data/listenercontext.cxx |   11 +++++++----
 4 files changed, 23 insertions(+), 12 deletions(-)

New commits:
commit 4add59245371c68b67bc0270bb1fef5000d0e97e
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date:   Wed May 22 20:46:42 2013 -0400

    Reduce dependency on mtvelements.hxx header.
    
    Because that header includes lots of template definitions which would
    undoubtedly slow down compilation speed.
    
    Change-Id: Ifdd686a250d341a7a6877cca41f042f8dfdbbaf9

diff --git a/sc/inc/clipcontext.hxx b/sc/inc/clipcontext.hxx
index 84b1fcc..8a847bd 100644
--- a/sc/inc/clipcontext.hxx
+++ b/sc/inc/clipcontext.hxx
@@ -11,18 +11,22 @@
 #define SC_CLIPCONTEXT_HXX
 
 #include "address.hxx"
-#include "mtvelements.hxx"
 
 #include <vector>
 #include <boost/unordered_map.hpp>
+#include <boost/noncopyable.hpp>
+#include <boost/scoped_ptr.hpp>
 
 class ScDocument;
 
 namespace sc {
 
-class ClipContextBase
+struct ColumnBlockPosition;
+class ColumnBlockPositionSet;
+
+class ClipContextBase : boost::noncopyable
 {
-    sc::ColumnBlockPositionSet maSet;
+    boost::scoped_ptr<ColumnBlockPositionSet> mpSet;
 
     ClipContextBase(); // disabled
 
diff --git a/sc/inc/listenercontext.hxx b/sc/inc/listenercontext.hxx
index f4fbb0f..1e7d067 100644
--- a/sc/inc/listenercontext.hxx
+++ b/sc/inc/listenercontext.hxx
@@ -12,18 +12,21 @@
 
 #include "address.hxx"
 #include "columnspanset.hxx"
-#include "mtvelements.hxx"
 
 #include <boost/noncopyable.hpp>
+#include <boost/scoped_ptr.hpp>
 
 class ScDocument;
 
 namespace sc {
 
+struct ColumnBlockPosition;
+class ColumnBlockPositionSet;
+
 class StartListeningContext : boost::noncopyable
 {
     ScDocument& mrDoc;
-    ColumnBlockPositionSet maSet;
+    boost::scoped_ptr<ColumnBlockPositionSet> mpSet;
 public:
     StartListeningContext(ScDocument& rDoc);
     ScDocument& getDoc();
@@ -35,7 +38,7 @@ class EndListeningContext : boost::noncopyable
 {
     ScDocument& mrDoc;
     ColumnSpanSet maSet;
-    ColumnBlockPositionSet maPosSet;
+    boost::scoped_ptr<ColumnBlockPositionSet> mpPosSet;
 public:
     EndListeningContext(ScDocument& rDoc);
     ScDocument& getDoc();
diff --git a/sc/source/core/data/clipcontext.cxx b/sc/source/core/data/clipcontext.cxx
index 2b51076..782c0f9 100644
--- a/sc/source/core/data/clipcontext.cxx
+++ b/sc/source/core/data/clipcontext.cxx
@@ -9,17 +9,18 @@
 
 #include "clipcontext.hxx"
 #include "document.hxx"
+#include "mtvelements.hxx"
 
 namespace sc {
 
 ClipContextBase::ClipContextBase(ScDocument& rDoc) :
-    maSet(rDoc) {}
+    mpSet(new ColumnBlockPositionSet(rDoc)) {}
 
 ClipContextBase::~ClipContextBase() {}
 
 ColumnBlockPosition* ClipContextBase::getBlockPosition(SCTAB nTab, SCCOL nCol)
 {
-    return maSet.getBlockPosition(nTab, nCol);
+    return mpSet->getBlockPosition(nTab, nCol);
 }
 
 CopyFromClipContext::CopyFromClipContext(ScDocument& rDoc,
diff --git a/sc/source/core/data/listenercontext.cxx b/sc/source/core/data/listenercontext.cxx
index 1f4c995..6f67920 100644
--- a/sc/source/core/data/listenercontext.cxx
+++ b/sc/source/core/data/listenercontext.cxx
@@ -9,6 +9,7 @@
 
 #include "listenercontext.hxx"
 #include "document.hxx"
+#include "mtvelements.hxx"
 
 namespace sc {
 
@@ -38,7 +39,8 @@ public:
 
 }
 
-StartListeningContext::StartListeningContext(ScDocument& rDoc) : mrDoc(rDoc), maSet(rDoc) {}
+StartListeningContext::StartListeningContext(ScDocument& rDoc) :
+    mrDoc(rDoc), mpSet(new ColumnBlockPositionSet(rDoc)) {}
 
 ScDocument& StartListeningContext::getDoc()
 {
@@ -47,10 +49,11 @@ ScDocument& StartListeningContext::getDoc()
 
 ColumnBlockPosition* StartListeningContext::getBlockPosition(SCTAB nTab, SCCOL nCol)
 {
-    return maSet.getBlockPosition(nTab, nCol);
+    return mpSet->getBlockPosition(nTab, nCol);
 }
 
-EndListeningContext::EndListeningContext(ScDocument& rDoc) : mrDoc(rDoc), maPosSet(rDoc) {}
+EndListeningContext::EndListeningContext(ScDocument& rDoc) :
+    mrDoc(rDoc), mpPosSet(new ColumnBlockPositionSet(rDoc)) {}
 
 ScDocument& EndListeningContext::getDoc()
 {
@@ -59,7 +62,7 @@ ScDocument& EndListeningContext::getDoc()
 
 ColumnBlockPosition* EndListeningContext::getBlockPosition(SCTAB nTab, SCCOL nCol)
 {
-    return maPosSet.getBlockPosition(nTab, nCol);
+    return mpPosSet->getBlockPosition(nTab, nCol);
 }
 
 void EndListeningContext::addEmptyBroadcasterPosition(SCTAB nTab, SCCOL nCol, SCROW nRow)


More information about the Libreoffice-commits mailing list