summaryrefslogtreecommitdiff
path: root/sc/inc/listenercontext.hxx
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2014-05-01 12:16:12 -0400
committerKohei Yoshida <kohei.yoshida@collabora.com>2014-05-01 12:17:45 -0400
commit7fbe0f56192f7e106c560646d37fbb93b69b0446 (patch)
tree2a4dec15c4ba3f69a1a7a757386135a6d921112c /sc/inc/listenercontext.hxx
parent6b431b1f0d397067504b5300d49e10e232936836 (diff)
fdo#77806: Use the common block position set for start and end listening.
Else an invalid iterator may result, which would eventually leads to a crash. Change-Id: Ie909de61244d661c72a3450cc69b29fbb218a248
Diffstat (limited to 'sc/inc/listenercontext.hxx')
-rw-r--r--sc/inc/listenercontext.hxx7
1 files changed, 5 insertions, 2 deletions
diff --git a/sc/inc/listenercontext.hxx b/sc/inc/listenercontext.hxx
index 0e63b8d11e20..7d66f9248ad6 100644
--- a/sc/inc/listenercontext.hxx
+++ b/sc/inc/listenercontext.hxx
@@ -15,6 +15,7 @@
#include <boost/noncopyable.hpp>
#include <boost/scoped_ptr.hpp>
+#include <boost/shared_ptr.hpp>
class ScDocument;
class ScTokenArray;
@@ -27,9 +28,10 @@ class ColumnBlockPositionSet;
class StartListeningContext : boost::noncopyable
{
ScDocument& mrDoc;
- boost::scoped_ptr<ColumnBlockPositionSet> mpSet;
+ boost::shared_ptr<ColumnBlockPositionSet> mpSet;
public:
StartListeningContext(ScDocument& rDoc);
+ StartListeningContext(ScDocument& rDoc, const boost::shared_ptr<ColumnBlockPositionSet>& pSet);
ScDocument& getDoc();
ColumnBlockPosition* getBlockPosition(SCTAB nTab, SCCOL nCol);
@@ -39,12 +41,13 @@ class EndListeningContext : boost::noncopyable
{
ScDocument& mrDoc;
ColumnSpanSet maSet;
- boost::scoped_ptr<ColumnBlockPositionSet> mpPosSet;
+ boost::shared_ptr<ColumnBlockPositionSet> mpPosSet;
ScTokenArray* mpOldCode;
ScAddress maPosDelta; // Add this to get the old position prior to the move.
public:
EndListeningContext(ScDocument& rDoc, ScTokenArray* pOldCode = NULL);
+ EndListeningContext(ScDocument& rDoc, const boost::shared_ptr<ColumnBlockPositionSet>& pSet, ScTokenArray* pOldCode = NULL);
void setPositionDelta( const ScAddress& rDelta );