summaryrefslogtreecommitdiff
path: root/sw/source/core/table
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/source/core/table
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/source/core/table')
-rw-r--r--sw/source/core/table/swnewtable.cxx2
-rw-r--r--sw/source/core/table/swtable.cxx8
2 files changed, 4 insertions, 6 deletions
diff --git a/sw/source/core/table/swnewtable.cxx b/sw/source/core/table/swnewtable.cxx
index 2f4038e4a4e3..a456fdc93615 100644
--- a/sw/source/core/table/swnewtable.cxx
+++ b/sw/source/core/table/swnewtable.cxx
@@ -616,7 +616,7 @@ static long lcl_InsertPosition( SwTable &rTable, std::vector<sal_uInt16>& rInsPo
SwTableLine* pLine = pBox->GetUpper();
long nWidth = rBoxes[j]->GetFrameFormat()->GetFrameSize().GetWidth();
nAddWidth += nWidth;
- sal_uInt16 nCurrBox = pLine->GetTabBoxes().GetPos( pBox );
+ sal_uInt16 nCurrBox = pLine->GetBoxPos( pBox );
sal_uInt16 nCurrLine = rTable.GetTabLines().GetPos( pLine );
OSL_ENSURE( nCurrLine != USHRT_MAX, "Time to say Good-Bye.." );
if( rInsPos[ nCurrLine ] == USHRT_MAX )
diff --git a/sw/source/core/table/swtable.cxx b/sw/source/core/table/swtable.cxx
index 3f997d751ecf..336069254f1c 100644
--- a/sw/source/core/table/swtable.cxx
+++ b/sw/source/core/table/swtable.cxx
@@ -736,8 +736,8 @@ static void lcl_ProcessBoxSet( SwTableBox *pBox, Parm &rParm )
if( pBox->getRowSpan() == 1 )
{
+ const sal_uInt16 nPos = pBox->GetUpper()->GetBoxPos( pBox );
SwTableBoxes& rTableBoxes = pBox->GetUpper()->GetTabBoxes();
- const sal_uInt16 nPos = rTableBoxes.GetPos( pBox );
if( nPos && rTableBoxes[ nPos - 1 ]->getRowSpan() != 1 )
nLeftDiff = 0;
if( nPos + 1 < (sal_uInt16)rTableBoxes.size() &&
@@ -1827,14 +1827,13 @@ Point SwTableBox::GetCoordinates() const
sal_uInt16 nX, nY;
const SwTableBox* pBox = this;
do {
- const SwTableBoxes* pBoxes = &pBox->GetUpper()->GetTabBoxes();
const SwTableLine* pLine = pBox->GetUpper();
// at the first level?
const SwTableLines* pLines = pLine->GetUpper()
? &pLine->GetUpper()->GetTabLines() : &rTable.GetTabLines();
nY = pLines->GetPos( pLine ) + 1 ;
- nX = pBoxes->GetPos( pBox ) + 1 ;
+ nX = pBox->GetUpper()->GetBoxPos( pBox ) + 1;
pBox = pLine->GetUpper();
} while( pBox );
return Point( nX, nY );
@@ -1853,7 +1852,6 @@ OUString SwTableBox::GetName() const
OUString sNm, sTmp;
const SwTableBox* pBox = this;
do {
- const SwTableBoxes* pBoxes = &pBox->GetUpper()->GetTabBoxes();
const SwTableLine* pLine = pBox->GetUpper();
// at the first level?
const SwTableLines* pLines = pLine->GetUpper()
@@ -1865,7 +1863,7 @@ OUString SwTableBox::GetName() const
else
sNm = sTmp;
- sTmp = OUString::number(( nPos = pBoxes->GetPos( pBox )) + 1 );
+ sTmp = OUString::number(( nPos = pBox->GetUpper()->GetBoxPos( pBox )) + 1 );
if( nullptr != ( pBox = pLine->GetUpper()) )
sNm = sTmp + "." + sNm;
else