summaryrefslogtreecommitdiff
path: root/sw/inc/tblsel.hxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-05-05 10:25:52 +0100
committerCaolán McNamara <caolanm@redhat.com>2012-05-05 10:27:47 +0100
commit567c1db25bd705faac44203e4a3d01d0f5e1385c (patch)
tree58a5f6246a8414e4f41eb2b94281409e8ac4353e /sw/inc/tblsel.hxx
parent4da69155054a661af5a405b3473affa2d44e6c90 (diff)
Resolves: fdo#49342 crash merging cells, revert conversion to std::map
3af0c948254751eade9bff772b849720747c5494 868bd3b778b6c7b970c67d1dacc469967f69e551 b2e84f9a40fda7821d4e658f9102bcbc783a1ba3 7264d2767095150944ff1e6999c71be1dbdc6f83 858b5b4f36a357fe7192e7c2ed9cc3cdfc81fd8f The problem is that a paragraph gets added to the document after the TableBox selection is created, which changes the node ids of the following paragraphs in the TableBox but the map has used cached SttNd value as its key, so it can't recognize nodes using the new index. This worked in the old implementation because that was effectively a sorted-vector, so probably the best conversion to stl is a sorted vector Change-Id: I1143d843b872eee15b016f82b68ecc020969f1b5
Diffstat (limited to 'sw/inc/tblsel.hxx')
-rw-r--r--sw/inc/tblsel.hxx40
1 files changed, 1 insertions, 39 deletions
diff --git a/sw/inc/tblsel.hxx b/sw/inc/tblsel.hxx
index d75a18daf8f9..a4b772883fa0 100644
--- a/sw/inc/tblsel.hxx
+++ b/sw/inc/tblsel.hxx
@@ -33,7 +33,6 @@
#include <swrect.hxx>
#include "swdllapi.h"
-#include <map>
#include <deque>
#include <boost/ptr_container/ptr_vector.hpp>
@@ -52,44 +51,7 @@ class SwUndoTblMerge;
class SwCellFrm;
typedef ::std::deque< SwCellFrm* > SwCellFrms;
-
-
-class SwSelBoxes : private std::map<sal_uLong, SwTableBox*>
-{
- typedef std::map<sal_uLong, SwTableBox*> Base;
-public:
- using Base::begin;
- using Base::clear;
- using Base::count;
- using Base::const_iterator;
- using Base::const_reverse_iterator;
- using Base::empty;
- using Base::end;
- using Base::erase;
- using Base::find;
- using Base::insert;
- using Base::iterator;
- using Base::rbegin;
- using Base::rend;
- using Base::reverse_iterator;
- using Base::size;
-
- std::pair<iterator, bool>
- insert(SwTableBox* pBox) { return Base::insert(std::make_pair(pBox->GetSttIdx(), pBox)); }
-
- iterator
- insert(iterator it, SwTableBox* pBox) { return Base::insert(it, std::make_pair(pBox->GetSttIdx(), pBox)); }
-
- size_type
- count(const SwTableBox* pBox) const { return Base::count(pBox->GetSttIdx()); }
-
- iterator
- find(const SwTableBox* pBox) { return Base::find(pBox->GetSttIdx()); }
-
- const_iterator
- find(const SwTableBox* pBox) const { return Base::find(pBox->GetSttIdx()); }
-};
-
+SV_DECL_PTRARR_SORT( SwSelBoxes, SwTableBoxPtr, 10 )
// Collects all boxes in table that are selected.
// Selection gets extended in given direction according to enum-parameter.