summaryrefslogtreecommitdiff
path: root/sw/inc
diff options
context:
space:
mode:
authorBjoern Michaelsen <bjoern.michaelsen@canonical.com>2016-05-19 16:15:53 +0200
committerBjörn Michaelsen <bjoern.michaelsen@canonical.com>2016-05-19 18:51:35 +0000
commita4ae9b147d0a83b811836757e9634a884260cee8 (patch)
tree1579924b8f2d4de9146f013dd77ab63ca9546e7c /sw/inc
parentad1a9797d15f7d9a78d9948963d57a91dc6c0935 (diff)
tdf#75757: remove inheritance on vector (SwTableBoxes)
- move SwTableBoxes::GetPos(..) up to SwTableLine::GetBoxPos(..) - SwTableBoxes is empty over plain vector then, make it an alias Change-Id: I72420d4fe1042a713d3e82f3df66f18ccbfca3f6 Reviewed-on: https://gerrit.libreoffice.org/25166 Reviewed-by: Björn Michaelsen <bjoern.michaelsen@canonical.com> Tested-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
Diffstat (limited to 'sw/inc')
-rw-r--r--sw/inc/swtable.hxx15
1 files changed, 6 insertions, 9 deletions
diff --git a/sw/inc/swtable.hxx b/sw/inc/swtable.hxx
index 37d488cc5b55..16c8fd41a35a 100644
--- a/sw/inc/swtable.hxx
+++ b/sw/inc/swtable.hxx
@@ -75,15 +75,7 @@ public:
}
};
-class SwTableBoxes : public std::vector<SwTableBox*> {
-public:
- // return USHRT_MAX if not found, else index of position
- sal_uInt16 GetPos(const SwTableBox* pBox) const
- {
- const_iterator it = std::find(begin(), end(), pBox);
- return it == end() ? USHRT_MAX : it - begin();
- }
-};
+using SwTableBoxes = std::vector<SwTableBox*>;
// Save content-bearing box-pointers additionally in a sorted array
// (for calculation in table).
@@ -355,6 +347,11 @@ public:
SwTableBoxes &GetTabBoxes() { return m_aBoxes; }
const SwTableBoxes &GetTabBoxes() const { return m_aBoxes; }
+ sal_uInt16 GetBoxPos(const SwTableBox* pBox) const
+ {
+ SwTableBoxes::const_iterator it = std::find(m_aBoxes.begin(), m_aBoxes.end(), pBox);
+ return it == m_aBoxes.end() ? USHRT_MAX : it - m_aBoxes.begin();
+ }
SwTableBox *GetUpper() { return m_pUpper; }
const SwTableBox *GetUpper() const { return m_pUpper; }