summaryrefslogtreecommitdiff
path: root/sw/inc
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2012-09-20 23:59:14 +0200
committerMichael Stahl <mstahl@redhat.com>2012-09-21 18:05:02 +0200
commit5f91f8a368343d8921a01edb7359cd300892f09d (patch)
tree09ad6c21fa35d743ef1a596400011ca2a88e19a2 /sw/inc
parent9cf615b68f815eb93b61cfd77232462496cdcf2a (diff)
fdo#48692: fix problems with large number of table cells:
The SwTableSortBoxes is now a STL container which can have more than 2^16 elements but unfortunately there are a lot of 16 bit integers used to index it all over the place, causing infinite loops and possibly worse problems; fix that to use size_t. Change-Id: I868ec9dd0629be4fbe4d6b8f294fb765e3d662ec
Diffstat (limited to 'sw/inc')
-rw-r--r--sw/inc/swtable.hxx10
-rw-r--r--sw/inc/unotbl.hxx5
2 files changed, 8 insertions, 7 deletions
diff --git a/sw/inc/swtable.hxx b/sw/inc/swtable.hxx
index 0a887c679918..709fce4bc861 100644
--- a/sw/inc/swtable.hxx
+++ b/sw/inc/swtable.hxx
@@ -106,13 +106,13 @@ class SW_DLLPUBLIC SwTable: public SwClient //Client of FrmFmt.
protected:
SwTableLines aLines;
- SwTableSortBoxes aSortCntBoxes;
+ SwTableSortBoxes m_TabSortContentBoxes;
SwServerObjectRef refObj; // In case DataServer -> pointer is set.
SwHTMLTableLayout *pHTMLLayout;
// Usually, the table node of a SwTable can be accessed by getting a box
- // out of aSortCntBoxes, which know their SwStartNode. But in some rare
+ // out of m_TabSortContentBoxes, which know their SwStartNode. But in some rare
// cases, we need to know the table node of a SwTable, before the table
// boxes have been build (SwTableNode::MakeCopy with tables in tables).
SwTableNode* pTableNode;
@@ -263,8 +263,8 @@ public:
{ _FindSuperfluousRows( rBoxes, 0, 0 ); }
void CheckRowSpan( SwTableLine* &rpLine, bool bUp ) const;
- SwTableSortBoxes& GetTabSortBoxes() { return aSortCntBoxes; }
- const SwTableSortBoxes& GetTabSortBoxes() const { return aSortCntBoxes; }
+ SwTableSortBoxes& GetTabSortBoxes() { return m_TabSortContentBoxes; }
+ const SwTableSortBoxes& GetTabSortBoxes() const { return m_TabSortContentBoxes; }
// Read 1st number and delete it from string (used by GetTblBox and SwTblFld).
@@ -321,7 +321,7 @@ public:
// Clean up structure a bit.
void GCLines();
- // Returns the table node via aSortCntBoxes or pTableNode.
+ // Returns the table node via m_TabSortContentBoxes or pTableNode.
SwTableNode* GetTableNode() const;
void SetTableNode( SwTableNode* pNode ) { pTableNode = pNode; }
diff --git a/sw/inc/unotbl.hxx b/sw/inc/unotbl.hxx
index 3191c0ce2690..7c7f166db0b0 100644
--- a/sw/inc/unotbl.hxx
+++ b/sw/inc/unotbl.hxx
@@ -97,7 +97,8 @@ class SwXCell : public SwXCellBaseClass,
const SwStartNode* pStartNode; // only set in XML import
// table position where pBox was found last
- sal_uInt16 nFndPos;
+ size_t nFndPos;
+ static size_t const NOTFOUND = ::std::numeric_limits<size_t>::max();
protected:
virtual const SwStartNode *GetStartNode() const;
@@ -115,7 +116,7 @@ protected:
virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
public:
- SwXCell(SwFrmFmt* pTblFmt, SwTableBox* pBox, sal_uInt16 nPos=USHRT_MAX );
+ SwXCell(SwFrmFmt* pTblFmt, SwTableBox* pBox, size_t nPos = NOTFOUND);
SwXCell(SwFrmFmt* pTblFmt, const SwStartNode& rStartNode); // XML import interface