diff options
author | Michael Stahl <mstahl@redhat.com> | 2012-07-26 00:50:06 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2012-07-26 14:30:09 +0200 |
commit | db9274645596be84d449fdc6e224ddd0959b8ea4 (patch) | |
tree | 1d73c7e7dba4f9b46bb3c118a74bfcba69710c2f /sw | |
parent | deaa69b1558ef76f5338a714fdedaeccf9394096 (diff) |
fix previous STL conversion commit:
SwSelBoxes_SAR is not sorted, so it should be converted to a plain
vector; at least for WW8SelBoxInfo this makes a real difference as the
first element is treated specially.
Change-Id: I57a448d72b2f3757da5bcebaebd4294e9d283d99
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/docnode/ndtbl.cxx | 6 | ||||
-rw-r--r-- | sw/source/core/inc/tblrwcl.hxx | 8 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par2.cxx | 10 |
3 files changed, 12 insertions, 12 deletions
diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx index 604e4c4ccd86..5a09a63462e7 100644 --- a/sw/source/core/docnode/ndtbl.cxx +++ b/sw/source/core/docnode/ndtbl.cxx @@ -2947,7 +2947,7 @@ void SwCollectTblLineBoxes::AddBox( const SwTableBox& rBox ) { aPosArr.push_back(nWidth); SwTableBox* p = (SwTableBox*)&rBox; - aBoxes.insert( p ); + m_Boxes.push_back(p); nWidth = nWidth + (sal_uInt16)rBox.GetFrmFmt()->GetFrmSize().GetWidth(); } @@ -2972,7 +2972,7 @@ const SwTableBox* SwCollectTblLineBoxes::GetBoxOfPos( const SwTableBox& rBox ) --n; nWidth = nWidth + (sal_uInt16)rBox.GetFrmFmt()->GetFrmSize().GetWidth(); - pRet = aBoxes[ n ]; + pRet = m_Boxes[ n ]; } return pRet; } @@ -2996,7 +2996,7 @@ sal_Bool SwCollectTblLineBoxes::Resize( sal_uInt16 nOffset, sal_uInt16 nOldWidth } aPosArr.erase( aPosArr.begin(), aPosArr.begin() + n ); - aBoxes.erase( aBoxes.begin(), aBoxes.begin() + n ); + m_Boxes.erase(m_Boxes.begin(), m_Boxes.begin() + n); // dann die Positionen der neuen Size anpassen for( n = 0; n < aPosArr.size(); ++n ) diff --git a/sw/source/core/inc/tblrwcl.hxx b/sw/source/core/inc/tblrwcl.hxx index 56195d8a9239..3832901536ac 100644 --- a/sw/source/core/inc/tblrwcl.hxx +++ b/sw/source/core/inc/tblrwcl.hxx @@ -71,7 +71,7 @@ SW_DLLPUBLIC void _DeleteBox( SwTable& rTbl, SwTableBox* pBox, SwUndo* pUndo = 0 class SwCollectTblLineBoxes { std::vector<sal_uInt16> aPosArr; - SwSelBoxes aBoxes; + std::vector<SwTableBox*> m_Boxes; SwHistory* pHst; sal_uInt16 nMode, nWidth; sal_Bool bGetFromTop : 1; @@ -79,7 +79,7 @@ class SwCollectTblLineBoxes public: SwCollectTblLineBoxes( sal_Bool bTop, sal_uInt16 nMd = 0, SwHistory* pHist=0 ) - : aBoxes(), + : pHst( pHist ), nMode( nMd ), nWidth( 0 ), bGetFromTop( bTop ), bGetValues( sal_True ) @@ -89,14 +89,14 @@ public: const SwTableBox* GetBoxOfPos( const SwTableBox& rBox ); void AddToUndoHistory( const SwCntntNode& rNd ); - sal_uInt16 Count() const { return aBoxes.size(); } + size_t Count() const { return m_Boxes.size(); } const SwTableBox& GetBox( std::size_t nPos, sal_uInt16* pWidth = 0 ) const { // hier wird die EndPos der Spalte benoetigt! if( pWidth ) *pWidth = (nPos+1 == aPosArr.size()) ? nWidth : aPosArr[ nPos+1 ]; - return *aBoxes[ nPos ]; + return *m_Boxes[ nPos ]; } sal_Bool IsGetFromTop() const { return bGetFromTop; } diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx index 15889c0911e4..2eb6cd75decf 100644 --- a/sw/source/filter/ww8/ww8par2.cxx +++ b/sw/source/filter/ww8/ww8par2.cxx @@ -80,7 +80,8 @@ using namespace ::com::sun::star; -class WW8SelBoxInfo: public SwSelBoxes +class WW8SelBoxInfo + : public std::vector<SwTableBox*> { private: WW8SelBoxInfo(const WW8SelBoxInfo&); @@ -3330,10 +3331,9 @@ SwTableBox* WW8TabDesc::UpdateTableMergeGroup( WW8_TCell& rCell, } if( pTheMergeGroup ) { - // aktuelle Box der Merge-Gruppe hinzufuegen - pTheMergeGroup->insert( pActBox ); - - // Target-Box zurueckmelden + // add current box to merge group + pTheMergeGroup->push_back(pActBox); + // return target box pResult = (*pTheMergeGroup)[ 0 ]; } } |