[Libreoffice-commits] .: 27 commits - RepositoryExternal.mk o3tl/inc o3tl/qa sfx2/inc sfx2/source sw/inc sw/source
Michael Stahl
mst at kemper.freedesktop.org
Tue Jul 17 06:36:30 PDT 2012
RepositoryExternal.mk | 2
o3tl/inc/o3tl/sorted_vector.hxx | 111 +++++++++++++++++++++++++----------
o3tl/qa/test-sorted_vector.cxx | 71 ++++++++++++++++++++++
sfx2/inc/orgmgr.hxx | 8 --
sfx2/source/doc/docvor.cxx | 5 -
sfx2/source/view/orgmgr.cxx | 27 ++++----
sw/inc/docary.hxx | 10 ++-
sw/inc/edglbldc.hxx | 10 +--
sw/inc/fmtcol.hxx | 5 -
sw/source/core/crsr/crstrvl.cxx | 40 ++++++++----
sw/source/core/crsr/findattr.cxx | 15 ++--
sw/source/core/crsr/unocrsr.cxx | 20 +++---
sw/source/core/doc/doc.cxx | 6 -
sw/source/core/doc/docbm.cxx | 18 ++---
sw/source/core/doc/doccorr.cxx | 12 +--
sw/source/core/doc/docfld.cxx | 98 +++++++++++++++---------------
sw/source/core/doc/docnew.cxx | 2
sw/source/core/doc/docsort.cxx | 4 -
sw/source/core/doc/fmtcol.cxx | 31 ++++-----
sw/source/core/edit/edglbldc.cxx | 41 +++++-------
sw/source/core/fields/docufld.cxx | 26 ++++----
sw/source/core/fields/fldlst.cxx | 12 +--
sw/source/core/inc/blink.hxx | 5 -
sw/source/core/inc/docfld.hxx | 14 ++--
sw/source/core/inc/docsort.hxx | 3
sw/source/core/inc/sectfrm.hxx | 4 -
sw/source/core/layout/newfrm.cxx | 21 +++---
sw/source/core/layout/sectfrm.cxx | 19 +----
sw/source/core/text/blink.cxx | 43 +++++--------
sw/source/filter/html/htmlfly.cxx | 17 ++---
sw/source/filter/html/htmlfly.hxx | 11 +--
sw/source/filter/html/htmlforw.cxx | 51 ++++------------
sw/source/filter/html/htmltabw.cxx | 24 +++----
sw/source/filter/html/wrthtml.cxx | 5 -
sw/source/filter/html/wrthtml.hxx | 33 +++++++++-
sw/source/filter/inc/wrtswtbl.hxx | 14 ++--
sw/source/filter/writer/wrtswtbl.cxx | 59 +++++++-----------
sw/source/filter/xml/xmlfmt.cxx | 4 -
sw/source/filter/xml/xmltble.cxx | 35 +++++------
sw/source/filter/xml/xmltexte.cxx | 4 -
sw/source/ui/dbui/dbinsdlg.cxx | 67 ++++++++++-----------
sw/source/ui/inc/dbinsdlg.hxx | 9 ++
sw/source/ui/inc/redlndlg.hxx | 4 -
sw/source/ui/misc/redlndlg.cxx | 30 +++++----
sw/source/ui/utlui/glbltree.cxx | 53 +++++++---------
45 files changed, 607 insertions(+), 496 deletions(-)
New commits:
commit 39ea1402d8be477a4d9645c368e9bbc680e91cc8
Author: Michael Stahl <mstahl at redhat.com>
Date: Tue Jul 17 15:20:52 2012 +0200
fix previous STL conversion commit:
Check that iterators are not end() before incrementing.
Change-Id: I9c29c707f165306261523e320099dfa6f0527f30
diff --git a/sw/source/core/doc/docfld.cxx b/sw/source/core/doc/docfld.cxx
index 435330f..4e4710c 100644
--- a/sw/source/core/doc/docfld.cxx
+++ b/sw/source/core/doc/docfld.cxx
@@ -1107,8 +1107,10 @@ void SwDoc::FldsToCalc( SwCalc& rCalc, const _SetGetExpFld& rToThisFld )
if( !pUpdtFlds->GetSortLst()->empty() )
{
_SetGetExpFlds::const_iterator itLast = pUpdtFlds->GetSortLst()->lower_bound( (_SetGetExpFld*)&rToThisFld );
- if( **itLast == rToThisFld )
+ if (pUpdtFlds->GetSortLst()->end() != itLast && **itLast == rToThisFld)
+ {
++itLast;
+ }
for( _SetGetExpFlds::const_iterator it = pUpdtFlds->GetSortLst()->begin(); it != itLast; ++it )
lcl_CalcFld( *this, rCalc, **it, pMgr );
@@ -1132,7 +1134,9 @@ void SwDoc::FldsToCalc( SwCalc& rCalc, sal_uLong nLastNd, sal_uInt16 nLastCnt )
( (*it)->GetNode() == nLastNd && (*it)->GetCntnt() <= nLastCnt )
);
++it )
+ {
lcl_CalcFld( *this, rCalc, **it, pMgr );
+ }
pMgr->CloseAll(sal_False);
}
@@ -1153,8 +1157,10 @@ void SwDoc::FldsToExpand( SwHash**& ppHashTbl, sal_uInt16& rTblSize,
_SetGetExpFlds::const_iterator itLast;
{
itLast = pUpdtFlds->GetSortLst()->lower_bound( (_SetGetExpFld*)&rToThisFld );
- if( **itLast == rToThisFld )
+ if (pUpdtFlds->GetSortLst()->end() != itLast && **itLast == rToThisFld)
+ {
++itLast;
+ }
}
for( _SetGetExpFlds::const_iterator it = pUpdtFlds->GetSortLst()->begin(); it != itLast; ++it )
commit 66c7b8fe56fd7aa518ba28986a4cfd773bf1319b
Author: Noel Grandin <noel at peralex.com>
Date: Fri Jul 13 15:42:51 2012 +0200
Convert SV_DECL_PTRARR_SORT_DEL(_SetGetExpFlds) to o3tl::sorted_vector
Change-Id: Ibdb223f0209a999028d5d63536a895a9d1f473f2
diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx
index 8c83389..dbe766b 100644
--- a/sw/source/core/crsr/crstrvl.cxx
+++ b/sw/source/core/crsr/crstrvl.cxx
@@ -623,7 +623,7 @@ void lcl_MakeFldLst( _SetGetExpFlds& rLst, const SwFieldType& rFldType,
_SetGetExpFld* pNew = new _SetGetExpFld(
SwNodeIndex( rTxtNode ), pTxtFld );
pNew->SetBodyPos( *pCFrm );
- rLst.Insert( pNew );
+ rLst.insert( pNew );
}
}
}
@@ -633,7 +633,7 @@ sal_Bool SwCrsrShell::MoveFldType( const SwFieldType* pFldType, sal_Bool bNext,
sal_uInt16 nSubType, sal_uInt16 nResType )
{
// sorted list of all fields
- _SetGetExpFlds aSrtLst( 64 );
+ _SetGetExpFlds aSrtLst;
if (pFldType)
{
@@ -669,10 +669,10 @@ sal_Bool SwCrsrShell::MoveFldType( const SwFieldType* pFldType, sal_Bool bNext,
}
// found no fields?
- if( !aSrtLst.Count() )
+ if( aSrtLst.empty() )
return sal_False;
- sal_uInt16 nPos;
+ _SetGetExpFlds::const_iterator it;
SwCursor* pCrsr = getShellCrsr( true );
{
// (1998): Always use field for search so that the right one is found as
@@ -705,27 +705,43 @@ sal_Bool SwCrsrShell::MoveFldType( const SwFieldType* pFldType, sal_Bool bNext,
aSrch.SetBodyPos( *pTNd->getLayoutFrm( GetLayout(), &aPt, &rPos, sal_False ) );
}
- sal_Bool bFound = aSrtLst.Seek_Entry( &aSrch, &nPos );
+ it = aSrtLst.lower_bound( &aSrch );
if( bDelFld )
{
delete (SwFmtFld*)&pTxtFld->GetAttr();
delete pTxtFld;
}
- if( bFound )
+ if( it != aSrtLst.end() && **it == aSrch ) // found
{
if( bNext )
{
- if( ++nPos >= aSrtLst.Count() )
+ if( ++it == aSrtLst.end() )
return sal_False; // already at the end
}
- else if( !nPos-- )
- return sal_False; // no more steps forward possible
+ else
+ {
+ if( it == aSrtLst.begin() )
+ return sal_False; // no more steps backward possible
+ it--;
+ }
+ }
+ else // not found
+ {
+ if( bNext )
+ {
+ if( it == aSrtLst.end() )
+ return sal_False;
+ }
+ else
+ {
+ if( it == aSrtLst.begin() )
+ return sal_False; // no more steps backward possible
+ it--;
+ }
}
- else if( bNext ? nPos >= aSrtLst.Count() : !nPos--)
- return sal_False;
}
- const _SetGetExpFld& rFnd = **( aSrtLst.GetData() + nPos );
+ const _SetGetExpFld& rFnd = **it;
SET_CURR_SHELL( this );
diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx
index 9d6a336..33a6af2 100644
--- a/sw/source/core/doc/doc.cxx
+++ b/sw/source/core/doc/doc.cxx
@@ -1221,7 +1221,7 @@ bool lcl_GetPostIts(
{
SwNodeIndex aIdx( pTxtFld->GetTxtNode() );
_PostItFld* pNew = new _PostItFld( aIdx, pTxtFld );
- pSrtLst->Insert( pNew );
+ pSrtLst->insert( pNew );
}
else
break; // we just wanted to check for the existence of postits ...
@@ -1396,7 +1396,7 @@ void SwDoc::UpdatePagesForPrintingWithPostItData(
sal_Int16 nPostItMode = (sal_Int16) rOptions.getIntValue( "PrintAnnotationMode", 0 );
OSL_ENSURE(nPostItMode == POSTITS_NONE || rData.HasPostItData(),
"print post-its without post-it data?" );
- const sal_uInt16 nPostItCount = rData.HasPostItData() ? rData.m_pPostItFields->Count() : 0;
+ const sal_uInt16 nPostItCount = rData.HasPostItData() ? rData.m_pPostItFields->size() : 0;
if (nPostItMode != POSTITS_NONE && nPostItCount > 0)
{
SET_CURR_SHELL( rData.m_pPostItShell.get() );
diff --git a/sw/source/core/doc/docfld.cxx b/sw/source/core/doc/docfld.cxx
index 559bac2..435330f 100644
--- a/sw/source/core/doc/docfld.cxx
+++ b/sw/source/core/doc/docfld.cxx
@@ -32,7 +32,6 @@
#include <float.h>
#include <comphelper/string.hxx>
#include <tools/datetime.hxx>
-#include <svl/svarray.hxx>
#include <vcl/svapp.hxx>
#include <unotools/charclass.hxx>
#include <unotools/transliterationwrapper.hxx>
@@ -74,8 +73,6 @@ using namespace ::com::sun::star::uno;
extern sal_Bool IsFrameBehind( const SwTxtNode& rMyNd, sal_uInt16 nMySttPos,
const SwTxtNode& rBehindNd, sal_uInt16 nSttPos );
-SV_IMPL_OP_PTRARR_SORT( _SetGetExpFlds, _SetGetExpFldPtr )
-
/*--------------------------------------------------------------------
Description: Insert field types
--------------------------------------------------------------------*/
@@ -890,19 +887,19 @@ void _SetGetExpFld::SetBodyPos( const SwCntntFrm& rFrm )
}
}
-sal_Bool _SetGetExpFld::operator<( const _SetGetExpFld& rFld ) const
+bool _SetGetExpFld::operator<( const _SetGetExpFld& rFld ) const
{
if( nNode < rFld.nNode || ( nNode == rFld.nNode && nCntnt < rFld.nCntnt ))
- return sal_True;
+ return true;
else if( nNode != rFld.nNode || nCntnt != rFld.nCntnt )
- return sal_False;
+ return false;
const SwNode *pFirst = GetNodeFromCntnt(),
*pNext = rFld.GetNodeFromCntnt();
// Position is the same: continue only if both field pointers are set!
if( !pFirst || !pNext )
- return sal_False;
+ return false;
// same Section?
if( pFirst->StartOfSectionNode() != pNext->StartOfSectionNode() )
@@ -1107,16 +1104,14 @@ void SwDoc::FldsToCalc( SwCalc& rCalc, const _SetGetExpFld& rToThisFld )
SwNewDBMgr* pMgr = GetNewDBMgr();
pMgr->CloseAll(sal_False);
- if( pUpdtFlds->GetSortLst()->Count() )
+ if( !pUpdtFlds->GetSortLst()->empty() )
{
- sal_uInt16 nLast;
- _SetGetExpFld* pFld = (_SetGetExpFld*)&rToThisFld;
- if( pUpdtFlds->GetSortLst()->Seek_Entry( pFld, &nLast ) )
- ++nLast;
+ _SetGetExpFlds::const_iterator itLast = pUpdtFlds->GetSortLst()->lower_bound( (_SetGetExpFld*)&rToThisFld );
+ if( **itLast == rToThisFld )
+ ++itLast;
- const _SetGetExpFldPtr* ppSortLst = pUpdtFlds->GetSortLst()->GetData();
- for( sal_uInt16 n = 0; n < nLast; ++n, ++ppSortLst )
- lcl_CalcFld( *this, rCalc, **ppSortLst, pMgr );
+ for( _SetGetExpFlds::const_iterator it = pUpdtFlds->GetSortLst()->begin(); it != itLast; ++it )
+ lcl_CalcFld( *this, rCalc, **it, pMgr );
}
pMgr->CloseAll(sal_False);
@@ -1131,15 +1126,13 @@ void SwDoc::FldsToCalc( SwCalc& rCalc, sal_uLong nLastNd, sal_uInt16 nLastCnt )
SwNewDBMgr* pMgr = GetNewDBMgr();
pMgr->CloseAll(sal_False);
- const _SetGetExpFldPtr* ppSortLst = pUpdtFlds->GetSortLst()->GetData();
-
- for( sal_uInt16 n = pUpdtFlds->GetSortLst()->Count();
- n &&
- ( (*ppSortLst)->GetNode() < nLastNd ||
- ( (*ppSortLst)->GetNode() == nLastNd && (*ppSortLst)->GetCntnt() <= nLastCnt )
+ for( _SetGetExpFlds::const_iterator it = pUpdtFlds->GetSortLst()->begin();
+ it != pUpdtFlds->GetSortLst()->end() &&
+ ( (*it)->GetNode() < nLastNd ||
+ ( (*it)->GetNode() == nLastNd && (*it)->GetCntnt() <= nLastCnt )
);
- --n, ++ppSortLst )
- lcl_CalcFld( *this, rCalc, **ppSortLst, pMgr );
+ ++it )
+ lcl_CalcFld( *this, rCalc, **it, pMgr );
pMgr->CloseAll(sal_False);
}
@@ -1153,24 +1146,20 @@ void SwDoc::FldsToExpand( SwHash**& ppHashTbl, sal_uInt16& rTblSize,
// Hash table for all string replacements is filled on-the-fly.
// Try to fabricate an uneven number.
- rTblSize = (( pUpdtFlds->GetSortLst()->Count() / 7 ) + 1 ) * 7;
+ rTblSize = (( pUpdtFlds->GetSortLst()->size() / 7 ) + 1 ) * 7;
ppHashTbl = new SwHash*[ rTblSize ];
memset( ppHashTbl, 0, sizeof( _HashStr* ) * rTblSize );
- sal_uInt16 nLast;
+ _SetGetExpFlds::const_iterator itLast;
{
- _SetGetExpFld* pTmp = (_SetGetExpFld*)&rToThisFld;
- if( pUpdtFlds->GetSortLst()->Seek_Entry( pTmp, &nLast ) )
- ++nLast;
+ itLast = pUpdtFlds->GetSortLst()->lower_bound( (_SetGetExpFld*)&rToThisFld );
+ if( **itLast == rToThisFld )
+ ++itLast;
}
- sal_uInt16 nPos;
- SwHash* pFnd;
- String aNew;
- const _SetGetExpFldPtr* ppSortLst = pUpdtFlds->GetSortLst()->GetData();
- for( ; nLast; --nLast, ++ppSortLst )
+ for( _SetGetExpFlds::const_iterator it = pUpdtFlds->GetSortLst()->begin(); it != itLast; ++it )
{
- const SwTxtFld* pTxtFld = (*ppSortLst)->GetFld();
+ const SwTxtFld* pTxtFld = (*it)->GetFld();
if( !pTxtFld )
continue;
@@ -1183,6 +1172,7 @@ void SwDoc::FldsToExpand( SwHash**& ppHashTbl, sal_uInt16& rTblSize,
// set the new value in the hash table
// is the formula a field?
SwSetExpField* pSFld = (SwSetExpField*)pFld;
+ String aNew;
LookString( ppHashTbl, rTblSize, pSFld->GetFormula(), aNew );
if( !aNew.Len() ) // nothing found, then the formula is
@@ -1195,7 +1185,8 @@ void SwDoc::FldsToExpand( SwHash**& ppHashTbl, sal_uInt16& rTblSize,
// look up the field's name
aNew = ((SwSetExpFieldType*)pSFld->GetTyp())->GetSetRefName();
// Entry present?
- pFnd = Find( aNew, ppHashTbl, rTblSize, &nPos );
+ sal_uInt16 nPos;
+ SwHash* pFnd = Find( aNew, ppHashTbl, rTblSize, &nPos );
if( pFnd )
// modify entry in the hash table
((_HashStr*)pFnd)->aSetStr = pSFld->GetExpStr();
@@ -1211,7 +1202,8 @@ void SwDoc::FldsToExpand( SwHash**& ppHashTbl, sal_uInt16& rTblSize,
// Insert entry in the hash table
// Entry present?
- pFnd = Find( rName, ppHashTbl, rTblSize, &nPos );
+ sal_uInt16 nPos;
+ SwHash* pFnd = Find( rName, ppHashTbl, rTblSize, &nPos );
String const value(pFld->ExpandField(IsClipBoard()));
if( pFnd )
{
@@ -1241,7 +1233,7 @@ void SwDoc::UpdateExpFlds( SwTxtFld* pUpdtFld, bool bUpdRefFlds )
pUpdtFlds->MakeFldList( *this, sal_True, GETFLD_ALL );
mbNewFldLst = sal_False;
- if( !pUpdtFlds->GetSortLst()->Count() )
+ if( pUpdtFlds->GetSortLst()->empty() )
{
if( bUpdRefFlds )
UpdateRefFlds(NULL);
@@ -1297,10 +1289,9 @@ void SwDoc::UpdateExpFlds( SwTxtFld* pUpdtFld, bool bUpdRefFlds )
pMgr->CloseAll(sal_False);
String aNew;
- const _SetGetExpFldPtr* ppSortLst = pUpdtFlds->GetSortLst()->GetData();
- for( n = pUpdtFlds->GetSortLst()->Count(); n; --n, ++ppSortLst )
+ for( _SetGetExpFlds::const_iterator it = pUpdtFlds->GetSortLst()->begin(); it != pUpdtFlds->GetSortLst()->end(); ++it )
{
- SwSection* pSect = (SwSection*)(*ppSortLst)->GetSection();
+ SwSection* pSect = (SwSection*)(*it)->GetSection();
if( pSect )
{
@@ -1311,7 +1302,7 @@ void SwDoc::UpdateExpFlds( SwTxtFld* pUpdtFld, bool bUpdRefFlds )
continue;
}
- SwTxtFld* pTxtFld = (SwTxtFld*)(*ppSortLst)->GetFld();
+ SwTxtFld* pTxtFld = (SwTxtFld*)(*it)->GetFld();
if( !pTxtFld )
{
OSL_ENSURE( !this, "what's wrong now'" );
@@ -1471,7 +1462,7 @@ void SwDoc::UpdateExpFlds( SwTxtFld* pUpdtFld, bool bUpdRefFlds )
if( MAXLEVEL > nLvl )
{
// test if the Number needs to be updated
- pSeqNd = GetNodes()[ (*ppSortLst)->GetNode() ];
+ pSeqNd = GetNodes()[ (*it)->GetNode() ];
const SwTxtNode* pOutlNd = pSeqNd->
FindOutlineNodeOfLevel( nLvl );
@@ -2181,7 +2172,7 @@ void SwDocUpdtFld::InsDelFldInFldLst( sal_Bool bIns, const SwTxtFld& rFld )
{
if( !bIns ) // if list is present and deleted
return; // don't do a thing
- pFldSortLst = new _SetGetExpFlds( 64 );
+ pFldSortLst = new _SetGetExpFlds;
}
if( bIns ) // insert anew:
@@ -2190,10 +2181,13 @@ void SwDocUpdtFld::InsDelFldInFldLst( sal_Bool bIns, const SwTxtFld& rFld )
{
// look up via the pTxtFld pointer. It is a sorted list, but it's sorted by node
// position. Until this is found, the search for the pointer is already done.
- for( sal_uInt16 n = 0; n < pFldSortLst->Count(); ++n )
+ for( sal_uInt16 n = 0; n < pFldSortLst->size(); ++n )
if( &rFld == (*pFldSortLst)[ n ]->GetPointer() )
- pFldSortLst->DeleteAndDestroy( n--, 1 );
- // one field can occur multiple times
+ {
+ delete (*pFldSortLst)[n];
+ pFldSortLst->erase( n );
+ n--; // one field can occur multiple times
+ }
}
}
@@ -2208,7 +2202,7 @@ void SwDocUpdtFld::_MakeFldList( SwDoc& rDoc, int eGetMode )
{
// new version: walk all fields of the attribute pool
delete pFldSortLst;
- pFldSortLst = new _SetGetExpFlds( 64 );
+ pFldSortLst = new _SetGetExpFlds;
/// consider and unhide sections
/// with hide condition, only in mode GETFLD_ALL (<eGetMode == GETFLD_ALL>)
@@ -2432,7 +2426,7 @@ void SwDocUpdtFld::GetBodyNode( const SwTxtFld& rTFld, sal_uInt16 nFldWhich )
}
if( pNew != NULL )
- if( !pFldSortLst->Insert( pNew ))
+ if( !pFldSortLst->insert( pNew ).second )
delete pNew;
}
@@ -2470,7 +2464,7 @@ void SwDocUpdtFld::GetBodyNode( const SwSectionNode& rSectNd )
if( !pNew )
pNew = new _SetGetExpFld( rSectNd );
- if( !pFldSortLst->Insert( pNew ))
+ if( !pFldSortLst->insert( pNew ).second )
delete pNew;
}
diff --git a/sw/source/core/fields/docufld.cxx b/sw/source/core/fields/docufld.cxx
index b13e3c7..7a22990 100644
--- a/sw/source/core/fields/docufld.cxx
+++ b/sw/source/core/fields/docufld.cxx
@@ -2168,7 +2168,7 @@ void SwRefPageGetFieldType::Modify( const SfxPoolItem* pOld, const SfxPoolItem*
if( !pNew && !pOld && GetDepends() )
{
// sammel erstmal alle SetPageRefFelder ein.
- _SetGetExpFlds aTmpLst( 10 );
+ _SetGetExpFlds aTmpLst;
if( MakeSetList( aTmpLst ) )
{
SwIterator<SwFmtFld,SwFieldType> aIter( *this );
@@ -2221,12 +2221,12 @@ sal_uInt16 SwRefPageGetFieldType::MakeSetList( _SetGetExpFlds& rTmpLst )
&aPos.nContent );
}
- if( !rTmpLst.Insert( pNew ))
+ if( !rTmpLst.insert( pNew ).second)
delete pNew;
}
}
- return rTmpLst.Count();
+ return rTmpLst.size();
}
void SwRefPageGetFieldType::UpdateField( SwTxtFld* pTxtFld,
@@ -2243,12 +2243,12 @@ void SwRefPageGetFieldType::UpdateField( SwTxtFld* pTxtFld,
SwNodeIndex aIdx( *pTxtNode );
_SetGetExpFld aEndFld( aIdx, pTxtFld );
- sal_uInt16 nLast;
- rSetList.Seek_Entry( &aEndFld, &nLast );
+ _SetGetExpFlds::const_iterator itLast = rSetList.lower_bound( &aEndFld );
- if( nLast-- )
+ if( itLast != rSetList.begin() )
{
- const SwTxtFld* pRefTxtFld = rSetList[ nLast ]->GetFld();
+ itLast--;
+ const SwTxtFld* pRefTxtFld = (*itLast)->GetFld();
const SwRefPageSetField* pSetFld =
(SwRefPageSetField*)pRefTxtFld->GetFld().GetFld();
if( pSetFld->IsOn() )
@@ -2316,7 +2316,7 @@ void SwRefPageGetField::ChangeExpansion( const SwFrm* pFrm,
OSL_ENSURE( !pFrm->IsInDocBody(), "Flag ist nicht richtig, Frame steht im DocBody" );
// sammel erstmal alle SetPageRefFelder ein.
- _SetGetExpFlds aTmpLst( 10 );
+ _SetGetExpFlds aTmpLst;
if( !pGetType->MakeSetList( aTmpLst ) )
return ;
@@ -2333,13 +2333,13 @@ void SwRefPageGetField::ChangeExpansion( const SwFrm* pFrm,
_SetGetExpFld aEndFld( aPos.nNode, pFld, &aPos.nContent );
- sal_uInt16 nLast;
- aTmpLst.Seek_Entry( &aEndFld, &nLast );
+ _SetGetExpFlds::const_iterator itLast = aTmpLst.lower_bound( &aEndFld );
- if( !nLast-- )
- return ; // es gibt kein entsprechendes Set - Feld vor mir
+ if( itLast == aTmpLst.begin() )
+ return; // es gibt kein entsprechendes Set - Feld vor mir
+ itLast--;
- const SwTxtFld* pRefTxtFld = aTmpLst[ nLast ]->GetFld();
+ const SwTxtFld* pRefTxtFld = (*itLast)->GetFld();
const SwRefPageSetField* pSetFld =
(SwRefPageSetField*)pRefTxtFld->GetFld().GetFld();
Point aPt;
diff --git a/sw/source/core/fields/fldlst.cxx b/sw/source/core/fields/fldlst.cxx
index 8b7aa5c..59c7094 100644
--- a/sw/source/core/fields/fldlst.cxx
+++ b/sw/source/core/fields/fldlst.cxx
@@ -84,7 +84,7 @@ SwInputFieldList::SwInputFieldList( SwEditShell* pShell, sal_Bool bBuildTmpLst )
{
SwNodeIndex aIdx( rTxtNode );
_SetGetExpFld* pNew = new _SetGetExpFld(aIdx, pTxtFld );
- pSrtLst->Insert( pNew );
+ pSrtLst->insert( pNew );
}
}
}
@@ -103,7 +103,7 @@ SwInputFieldList::~SwInputFieldList()
sal_uInt16 SwInputFieldList::Count() const
{
- return pSrtLst->Count();
+ return pSrtLst->size();
}
@@ -177,7 +177,7 @@ sal_uInt16 SwInputFieldList::BuildSortLst()
{
SwNodeIndex aIdx( rTxtNode );
_SetGetExpFld* pNew = new _SetGetExpFld(aIdx, pTxtFld );
- pSrtLst->Insert( pNew );
+ pSrtLst->insert( pNew );
}
else
aTmpLst.erase( it );
@@ -188,7 +188,7 @@ sal_uInt16 SwInputFieldList::BuildSortLst()
// die Pointer werden nicht mehr gebraucht
aTmpLst.clear();
- return pSrtLst->Count();
+ return pSrtLst->size();
}
/*--------------------------------------------------------------------
@@ -211,8 +211,8 @@ void SwInputFieldList::RemoveUnselectedFlds()
if (aPos >= *PCURCRSR->Start() && aPos < *PCURCRSR->End())
{
// Feld innerhalb der Selektion
- pNewLst->Insert( (*pSrtLst)[i] );
- pSrtLst->Remove(i, 1);
+ pNewLst->insert( (*pSrtLst)[i] );
+ pSrtLst->erase( i );
}
else
i++;
diff --git a/sw/source/core/inc/docfld.hxx b/sw/source/core/inc/docfld.hxx
index 850d461..212b648 100644
--- a/sw/source/core/inc/docfld.hxx
+++ b/sw/source/core/inc/docfld.hxx
@@ -30,6 +30,7 @@
#define _DOCFLD_HXX
#include <calc.hxx>
+#include <o3tl/sorted_vector.hxx>
class SwTxtFld;
class SwIndex;
@@ -86,11 +87,11 @@ public:
_SetGetExpFld( const SwFlyFrmFmt& rFlyFmt, const SwPosition* pPos = 0 );
- sal_Bool operator==( const _SetGetExpFld& rFld ) const
- { return nNode == rFld.nNode && nCntnt == rFld.nCntnt &&
+ bool operator==( const _SetGetExpFld& rFld ) const
+ { return nNode == rFld.nNode && nCntnt == rFld.nCntnt &&
( !CNTNT.pTxtFld || !rFld.CNTNT.pTxtFld ||
CNTNT.pTxtFld == rFld.CNTNT.pTxtFld ); }
- sal_Bool operator<( const _SetGetExpFld& rFld ) const;
+ bool operator<( const _SetGetExpFld& rFld ) const;
const SwTxtFld* GetFld() const
{ return TEXTFIELD == eSetGetExpFldType ? CNTNT.pTxtFld : 0; }
@@ -118,8 +119,11 @@ public:
void SetBodyPos( const SwCntntFrm& rFrm );
};
-typedef _SetGetExpFld* _SetGetExpFldPtr;
-SV_DECL_PTRARR_SORT_DEL( _SetGetExpFlds, _SetGetExpFldPtr, 0 )
+class _SetGetExpFlds : public o3tl::sorted_vector<_SetGetExpFld*, o3tl::less_ptr_to<_SetGetExpFld> >
+{
+public:
+ ~_SetGetExpFlds() { DeleteAndDestroyAll(); }
+};
// struct for saving strings from the SetExp's string fields
struct _HashStr : public SwHash
commit 4b41b87e52007897131088e61ffff41d22122acc
Author: Noel Grandin <noel at peralex.com>
Date: Fri Jul 13 15:37:18 2012 +0200
Convert SV_DECL_PTRARR_SORT(_SfxObjectList) to o3tl::sorted_vector
Change-Id: I663f03c2fdafe994b609572aa3a8b6bf2354b444
diff --git a/sfx2/inc/orgmgr.hxx b/sfx2/inc/orgmgr.hxx
index 2c8d989..48c3ae3 100644
--- a/sfx2/inc/orgmgr.hxx
+++ b/sfx2/inc/orgmgr.hxx
@@ -19,7 +19,7 @@
#ifndef _SFX_ORGMGR_HXX
#define _SFX_ORGMGR_HXX
-#include <svl/svarray.hxx>
+#include <o3tl/sorted_vector.hxx>
class SfxDocumentTemplates;
class SfxOrganizeListBox_Impl;
@@ -27,15 +27,13 @@ struct _FileListEntry;
//=========================================================================
-SV_DECL_PTRARR_SORT(_SfxObjectList, _FileListEntry*, 1)
-
-class SfxObjectList: public _SfxObjectList
+class SfxObjectList : public o3tl::sorted_vector<_FileListEntry*, o3tl::less_ptr_to<_FileListEntry> >
{
public:
SfxObjectList();
~SfxObjectList();
- const String& GetBaseName( sal_uInt16 nId ) const;
+ const String& GetBaseName( const _FileListEntry* p ) const;
};
class IntlWrapper;
diff --git a/sfx2/source/doc/docvor.cxx b/sfx2/source/doc/docvor.cxx
index b069f17..3c76146 100644
--- a/sfx2/source/doc/docvor.cxx
+++ b/sfx2/source/doc/docvor.cxx
@@ -1378,9 +1378,8 @@ void SfxOrganizeListBox_Impl::Reset()
else
{
const SfxObjectList& rList = pMgr->GetObjectList();
- const sal_uInt16 nCount = rList.Count();
- for ( sal_uInt16 i = 0; i < nCount; ++i )
- InsertEntryByBmpType( rList.GetBaseName(i), BMPTYPE_DOC, 0, sal_True );
+ for ( SfxObjectList::const_iterator it = rList.begin(); it != rList.end(); ++it )
+ InsertEntryByBmpType( rList.GetBaseName(*it), BMPTYPE_DOC, 0, sal_True );
}
SetUpdateMode(sal_True);
diff --git a/sfx2/source/view/orgmgr.cxx b/sfx2/source/view/orgmgr.cxx
index 563c345..db9937f 100644
--- a/sfx2/source/view/orgmgr.cxx
+++ b/sfx2/source/view/orgmgr.cxx
@@ -119,10 +119,6 @@ _FileListEntry::~_FileListEntry()
DeleteObjectShell();
}
-//-------------------------------------------------------------------------
-
-SV_IMPL_OP_PTRARR_SORT(_SfxObjectList, _FileListEntry*)
-
//=========================================================================
sal_Bool _FileListEntry::DeleteObjectShell()
@@ -191,14 +187,16 @@ SfxObjectList::SfxObjectList()
SfxObjectList::~SfxObjectList()
{
- DeleteAndDestroy(0, Count());
+ for( const_iterator it = begin(); it != end(); ++it )
+ delete *it;
+ clear();
}
//-------------------------------------------------------------------------
-const String &SfxObjectList::GetBaseName(sal_uInt16 i) const
+const String &SfxObjectList::GetBaseName(const _FileListEntry* p) const
{
- return (*this)[i]->aBaseName;
+ return p->aBaseName;
}
//-------------------------------------------------------------------------
@@ -230,7 +228,7 @@ SfxOrganizeMgr::SfxOrganizeMgr( SfxOrganizeListBox_Impl *pLeft,
String aTitle = pTmp->GetTitle( SFX_TITLE_TITLE );
pNewEntry = new _FileListEntry( pTmp->GetMedium()->GetName(), pCollator, &aTitle );
pNewEntry->aDocShell = pTmp;
- pImpl->pDocList->C40_PTR_INSERT( _FileListEntry, pNewEntry );
+ pImpl->pDocList->insert( pNewEntry );
}
}
@@ -679,14 +677,16 @@ sal_Bool SfxOrganizeMgr::InsertFile( SfxOrganizeListBox_Impl* pCaller, const Str
{
const CollatorWrapper* pCollator = pImpl->pIntlWrapper->getCaseCollator();
_FileListEntry* pEntry = new _FileListEntry( rFileName, pCollator );
- if ( pImpl->pDocList->C40_PTR_INSERT( _FileListEntry, pEntry ) )
+ std::pair<SfxObjectList::const_iterator, bool> aRes = pImpl->pDocList->insert( pEntry );
+ if ( aRes.second )
{
- sal_uInt16 nPos = 0;
- pImpl->pDocList->Seek_Entry( pEntry, &nPos );
+ sal_uInt16 nPos = aRes.first - pImpl->pDocList->begin();
pCaller->InsertEntry( pEntry->aBaseName, pCaller->GetOpenedBmp(1),
pCaller->GetClosedBmp(1), 0, sal_True, nPos );
return sal_True;
}
+ else
+ delete pEntry;
return sal_False;
}
@@ -753,10 +753,9 @@ void SfxOrganizeMgr::SaveAll(Window *pParent)
}
}
}
- nRangeCount = pImpl->pDocList->Count();
- for(i = 0; i < nRangeCount; ++i)
+ for( SfxObjectList::const_iterator it = pImpl->pDocList->begin(); it != pImpl->pDocList->end(); ++it )
{
- _FileListEntry *pEntry = (*pImpl->pDocList)[i];
+ _FileListEntry *pEntry = *it;
if(!pEntry->DeleteObjectShell())
{
String aText(SfxResId(STR_ERROR_SAVE_TEMPLATE).toString());
commit 5a4796f78f315d8518238f4194b553f671aeadf4
Author: Noel Grandin <noel at peralex.com>
Date: Fri Jul 13 15:35:23 2012 +0200
Convert SV_DECL_PTRARR_DEL(SwUnoCrsrTbl) to std::set
Change-Id: I0d79505e2d97b1f8608e6d6e72b317bfaa344b1d
diff --git a/sw/inc/docary.hxx b/sw/inc/docary.hxx
index 86b5bd8..8cedf2f 100644
--- a/sw/inc/docary.hxx
+++ b/sw/inc/docary.hxx
@@ -30,7 +30,9 @@
#include <com/sun/star/i18n/ForbiddenCharacters.hpp>
#include <vector>
+#include <set>
#include <algorithm>
+#include <svl/svarray.hxx>
class SwFieldType;
class SwFmt;
@@ -51,7 +53,6 @@ namespace com { namespace sun { namespace star { namespace i18n {
}}}}
#include <swtypes.hxx>
-#include <svl/svarray.hxx>
// provides some methods for generic operations on lists that contain
// SwFmt* subclasses.
@@ -174,8 +175,11 @@ public:
using _SwRedlineTbl::GetPos;
};
-typedef SwUnoCrsr* SwUnoCrsrPtr;
-SV_DECL_PTRARR_DEL( SwUnoCrsrTbl, SwUnoCrsrPtr, 0 )
+class SwUnoCrsrTbl : public std::set<SwUnoCrsr*> {
+public:
+ // the destructor will free all objects still in the set
+ ~SwUnoCrsrTbl();
+};
class SwOLENodes : public std::vector<SwOLENode*> {};
diff --git a/sw/source/core/crsr/unocrsr.cxx b/sw/source/core/crsr/unocrsr.cxx
index 10df370..a86caec 100644
--- a/sw/source/core/crsr/unocrsr.cxx
+++ b/sw/source/core/crsr/unocrsr.cxx
@@ -32,8 +32,6 @@
#include <docary.hxx>
#include <rootfrm.hxx>
-SV_IMPL_PTRARR( SwUnoCrsrTbl, SwUnoCrsrPtr )
-
IMPL_FIXEDMEMPOOL_NEWDEL( SwUnoCrsr )
SwUnoCrsr::SwUnoCrsr( const SwPosition &rPos, SwPaM* pRing )
@@ -51,12 +49,9 @@ SwUnoCrsr::~SwUnoCrsr()
{
// then remove cursor from array
SwUnoCrsrTbl& rTbl = (SwUnoCrsrTbl&)pDoc->GetUnoCrsrTbl();
- sal_uInt16 nDelPos = rTbl.GetPos( this );
-
- if( USHRT_MAX != nDelPos )
- rTbl.Remove( nDelPos );
- else {
- OSL_ENSURE( !this, "UNO cursor not anymore in array" );
+ if( !rTbl.erase( this ) )
+ {
+ OSL_ENSURE( !this, "UNO Cursor nicht mehr im Array" );
}
}
@@ -258,4 +253,13 @@ void SwUnoTableCrsr::MakeBoxSels()
}
}
+SwUnoCrsrTbl::~SwUnoCrsrTbl()
+{
+ while (!empty())
+ {
+ delete *begin();
+ erase( begin() );
+ }
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx
index ed3c4d1..9d6a336 100644
--- a/sw/source/core/doc/doc.cxx
+++ b/sw/source/core/doc/doc.cxx
@@ -2662,7 +2662,7 @@ SwUnoCrsr* SwDoc::CreateUnoCrsr( const SwPosition& rPos, sal_Bool bTblCrsr )
else
pNew = new SwUnoCrsr( rPos );
- pUnoCrsrTbl->Insert( pNew, pUnoCrsrTbl->Count() );
+ pUnoCrsrTbl->insert( pNew );
return pNew;
}
diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx
index 1937bc9..04074c7 100644
--- a/sw/source/core/doc/docbm.cxx
+++ b/sw/source/core/doc/docbm.cxx
@@ -1418,15 +1418,15 @@ void _SaveCntntIdx(SwDoc* pDoc,
{
aSave.SetTypeAndCount( 0x400, 0 );
const SwUnoCrsrTbl& rTbl = pDoc->GetUnoCrsrTbl();
- for( sal_uInt16 n = 0; n < rTbl.Count(); ++n )
+ for( SwUnoCrsrTbl::iterator it = rTbl.begin(); it != rTbl.end(); ++it )
{
- FOREACHPAM_START( rTbl[ n ] )
+ FOREACHPAM_START( *it )
lcl_ChkPaM( rSaveArr, nNode, nCntnt, *PCURCRSR, aSave, sal_False );
aSave.IncCount();
FOREACHPAM_END()
SwUnoTableCrsr* pUnoTblCrsr =
- dynamic_cast<SwUnoTableCrsr*>(rTbl[ n ]);
+ dynamic_cast<SwUnoTableCrsr*>(*it);
if( pUnoTblCrsr )
{
FOREACHPAM_START( &pUnoTblCrsr->GetSelRing() )
@@ -1558,9 +1558,9 @@ void _RestoreCntntIdx(SwDoc* pDoc,
{
sal_uInt16 nCnt = 0;
const SwUnoCrsrTbl& rTbl = pDoc->GetUnoCrsrTbl();
- for( sal_uInt16 i = 0; i < rTbl.Count(); ++i )
+ for( SwUnoCrsrTbl::iterator it = rTbl.begin(); it != rTbl.end(); ++it )
{
- FOREACHPAM_START( rTbl[ i ] )
+ FOREACHPAM_START( *it )
if( aSave.GetCount() == nCnt )
{
pPos = &PCURCRSR->GetBound( 0x0400 ==
@@ -1573,7 +1573,7 @@ void _RestoreCntntIdx(SwDoc* pDoc,
break;
SwUnoTableCrsr* pUnoTblCrsr =
- dynamic_cast<SwUnoTableCrsr*>(rTbl[ i ]);
+ dynamic_cast<SwUnoTableCrsr*>(*it);
if ( pUnoTblCrsr )
{
FOREACHPAM_START( &pUnoTblCrsr->GetSelRing() )
@@ -1718,9 +1718,9 @@ void _RestoreCntntIdx(std::vector<sal_uLong> &rSaveArr,
{
sal_uInt16 nCnt = 0;
const SwUnoCrsrTbl& rTbl = pDoc->GetUnoCrsrTbl();
- for( sal_uInt16 i = 0; i < rTbl.Count(); ++i )
+ for( SwUnoCrsrTbl::iterator it = rTbl.begin(); it != rTbl.end(); ++it )
{
- FOREACHPAM_START( rTbl[ i ] )
+ FOREACHPAM_START( *it )
if( aSave.GetCount() == nCnt )
{
pPos = &PCURCRSR->GetBound( 0x0400 ==
@@ -1733,7 +1733,7 @@ void _RestoreCntntIdx(std::vector<sal_uLong> &rSaveArr,
break;
SwUnoTableCrsr* pUnoTblCrsr =
- dynamic_cast<SwUnoTableCrsr*>(rTbl[ i ]);
+ dynamic_cast<SwUnoTableCrsr*>(*it);
if ( pUnoTblCrsr )
{
FOREACHPAM_START( &pUnoTblCrsr->GetSelRing() )
diff --git a/sw/source/core/doc/doccorr.cxx b/sw/source/core/doc/doccorr.cxx
index 8bcc8ae..b812046 100644
--- a/sw/source/core/doc/doccorr.cxx
+++ b/sw/source/core/doc/doccorr.cxx
@@ -153,9 +153,9 @@ void PaMCorrAbs( const SwPaM& rRange,
{
SwUnoCrsrTbl& rTbl = const_cast<SwUnoCrsrTbl&>(pDoc->GetUnoCrsrTbl());
- for( sal_uInt16 n = 0; n < rTbl.Count(); ++n )
+ for( SwUnoCrsrTbl::iterator it = rTbl.begin(); it != rTbl.end(); ++it )
{
- SwUnoCrsr *const pUnoCursor = rTbl[ n ];
+ SwUnoCrsr *const pUnoCursor = *it;
bool bChange = false; // has the UNO cursor been corrected?
@@ -172,7 +172,7 @@ void PaMCorrAbs( const SwPaM& rRange,
FOREACHPAM_END()
SwUnoTableCrsr *const pUnoTblCrsr =
- dynamic_cast<SwUnoTableCrsr *>(rTbl[ n ]);
+ dynamic_cast<SwUnoTableCrsr *>(*it);
if( pUnoTblCrsr )
{
FOREACHPAM_START( &pUnoTblCrsr->GetSelRing() )
@@ -298,14 +298,14 @@ void PaMCorrRel( const SwNodeIndex &rOldNode,
}
{
SwUnoCrsrTbl& rTbl = (SwUnoCrsrTbl&)pDoc->GetUnoCrsrTbl();
- for( sal_uInt16 n = 0; n < rTbl.Count(); ++n )
+ for( SwUnoCrsrTbl::iterator it = rTbl.begin(); it != rTbl.end(); ++it )
{
- FOREACHPAM_START( rTbl[ n ] )
+ FOREACHPAM_START( *it )
lcl_PaMCorrRel1( PCURCRSR, pOldNode, aNewPos, nCntIdx );
FOREACHPAM_END()
SwUnoTableCrsr* pUnoTblCrsr =
- dynamic_cast<SwUnoTableCrsr*>(rTbl[ n ]);
+ dynamic_cast<SwUnoTableCrsr*>(*it);
if( pUnoTblCrsr )
{
FOREACHPAM_START( &pUnoTblCrsr->GetSelRing() )
diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx
index 78cf03a..5b14784 100644
--- a/sw/source/core/doc/docnew.cxx
+++ b/sw/source/core/doc/docnew.cxx
@@ -249,7 +249,7 @@ SwDoc::SwDoc()
maListStyleLists(),
pRedlineTbl( new SwRedlineTbl ),
pAutoFmtRedlnComment( 0 ),
- pUnoCrsrTbl( new SwUnoCrsrTbl( 0 ) ),
+ pUnoCrsrTbl( new SwUnoCrsrTbl() ),
pPgPViewPrtData( 0 ),
pExtInputRing( 0 ),
pLayouter( 0 ),
commit 49f7814515c2dca4ef39e518906f8c802d6c888f
Author: Michael Stahl <mstahl at redhat.com>
Date: Tue Jul 17 13:32:06 2012 +0200
SwGlobalTree::InsertRegion: -Werror=sign-compare
Change-Id: Ib00a12ba38334a1233c2894606c097bfa2891813
diff --git a/sw/source/ui/utlui/glbltree.cxx b/sw/source/ui/utlui/glbltree.cxx
index 25df56e..c745671 100644
--- a/sw/source/ui/utlui/glbltree.cxx
+++ b/sw/source/ui/utlui/glbltree.cxx
@@ -1284,10 +1284,11 @@ void SwGlobalTree::InsertRegion( const SwGlblDocContent* _pContent, const Sequen
rSh.StartAction();
// after insertion of the first new content the 'pCont' parameter becomes invalid
// find the index of the 'anchor' content to always use a current anchor content
- sal_uInt16 nAnchorContent = pSwGlblDocContents->size() - 1;
+ size_t nAnchorContent = pSwGlblDocContents->size() - 1;
if ( !bMove )
{
- for( sal_uInt16 nContent = 0; nContent < pSwGlblDocContents->size(); ++nContent )
+ for (size_t nContent = 0; nContent < pSwGlblDocContents->size();
+ ++nContent)
{
if( *_pContent == *(*pSwGlblDocContents)[ nContent ] )
{
@@ -1304,7 +1305,7 @@ void SwGlobalTree::InsertRegion( const SwGlblDocContent* _pContent, const Sequen
SwGlblDocContent* pAnchorContent = 0;
OSL_ENSURE(aTempContents.size() > (nAnchorContent + nFile), "invalid anchor content -> last insertion failed");
if ( aTempContents.size() > (nAnchorContent + nFile) )
- pAnchorContent = aTempContents[nAnchorContent + (sal_uInt16)nFile];
+ pAnchorContent = aTempContents[nAnchorContent + nFile];
else
pAnchorContent = aTempContents.back();
String sFileName(pFileNames[nFile]);
commit 0d3b54b6d874eea33063fabcfe40538dd11aff64
Author: Noel Grandin <noel at peralex.com>
Date: Fri Jul 13 15:34:17 2012 +0200
Convert SV_DECL_PTRARR_SORT_DEL(SwGlblDocContents) to o3tl::sorted_vector
Change-Id: Id0ee0ae93d69641cf65d12c8f170d3c6b34dbeb9
diff --git a/sw/inc/edglbldc.hxx b/sw/inc/edglbldc.hxx
index 3ebf359..466b3b3 100644
--- a/sw/inc/edglbldc.hxx
+++ b/sw/inc/edglbldc.hxx
@@ -28,7 +28,7 @@
#ifndef _EDGLBLDC_HXX
#define _EDGLBLDC_HXX
-#include <svl/svarray.hxx>
+#include <o3tl/sorted_vector.hxx>
class SwSection;
class SwTOXBase;
@@ -70,10 +70,10 @@ public:
};
-typedef SwGlblDocContent* SwGlblDocContentPtr;
-SV_DECL_PTRARR_SORT_DEL( SwGlblDocContents, SwGlblDocContentPtr, 10 )
-
-
+class SwGlblDocContents : public o3tl::sorted_vector<SwGlblDocContent*, o3tl::less_ptr_to<SwGlblDocContent> > {
+public:
+ ~SwGlblDocContents() { DeleteAndDestroyAll(); }
+};
#endif
diff --git a/sw/source/core/edit/edglbldc.cxx b/sw/source/core/edit/edglbldc.cxx
index 8ebd932..57af9c8 100644
--- a/sw/source/core/edit/edglbldc.cxx
+++ b/sw/source/core/edit/edglbldc.cxx
@@ -40,8 +40,6 @@
#include <edglbldc.hxx>
-SV_IMPL_OP_PTRARR_SORT( SwGlblDocContents, SwGlblDocContentPtr )
-
sal_Bool SwEditShell::IsGlobalDoc() const
{
return getIDocumentSettingAccess()->get(IDocumentSettingAccess::GLOBAL_DOCUMENT);
@@ -64,8 +62,7 @@ sal_Bool SwEditShell::IsGlblDocSaveLinks() const
sal_uInt16 SwEditShell::GetGlobalDocContent( SwGlblDocContents& rArr ) const
{
- if( rArr.Count() )
- rArr.DeleteAndDestroy( 0, rArr.Count() );
+ rArr.DeleteAndDestroyAll();
if( !getIDocumentSettingAccess()->get(IDocumentSettingAccess::GLOBAL_DOCUMENT) )
return 0;
@@ -80,7 +77,7 @@ sal_uInt16 SwEditShell::GetGlobalDocContent( SwGlblDocContents& rArr ) const
const SwSection* pSect = rSectFmts[ --n ]->GetGlobalDocSection();
if( pSect )
{
- SwGlblDocContentPtr pNew;
+ SwGlblDocContent* pNew;
switch( pSect->GetType() )
{
case TOX_HEADER_SECTION: break; // ignore
@@ -93,7 +90,7 @@ sal_uInt16 SwEditShell::GetGlobalDocContent( SwGlblDocContents& rArr ) const
pNew = new SwGlblDocContent( pSect );
break;
}
- if( !rArr.Insert( pNew ) )
+ if( !rArr.insert( pNew ).second )
delete pNew;
}
}
@@ -101,7 +98,7 @@ sal_uInt16 SwEditShell::GetGlobalDocContent( SwGlblDocContents& rArr ) const
// und als letztes die Dummies (sonstiger Text) einfuegen
SwNode* pNd;
sal_uLong nSttIdx = pMyDoc->GetNodes().GetEndOfExtras().GetIndex() + 2;
- for( n = 0; n < rArr.Count(); ++n )
+ for( n = 0; n < rArr.size(); ++n )
{
const SwGlblDocContent& rNew = *rArr[ n ];
// suche von StartPos bis rNew.DocPos nach einem Content Node.
@@ -110,8 +107,8 @@ sal_uInt16 SwEditShell::GetGlobalDocContent( SwGlblDocContents& rArr ) const
if( ( pNd = pMyDoc->GetNodes()[ nSttIdx ])->IsCntntNode()
|| pNd->IsSectionNode() || pNd->IsTableNode() )
{
- SwGlblDocContentPtr pNew = new SwGlblDocContent( nSttIdx );
- if( !rArr.Insert( pNew ) )
+ SwGlblDocContent* pNew = new SwGlblDocContent( nSttIdx );
+ if( !rArr.insert( pNew ).second )
delete pNew;
else
++n; // auf die naechste Position
@@ -124,26 +121,26 @@ sal_uInt16 SwEditShell::GetGlobalDocContent( SwGlblDocContents& rArr ) const
}
// sollte man das Ende auch noch setzen??
- if( rArr.Count() )
+ if( !rArr.empty() )
{
sal_uLong nNdEnd = pMyDoc->GetNodes().GetEndOfContent().GetIndex();
for( ; nSttIdx < nNdEnd; ++nSttIdx )
if( ( pNd = pMyDoc->GetNodes()[ nSttIdx ])->IsCntntNode()
|| pNd->IsSectionNode() || pNd->IsTableNode() )
{
- SwGlblDocContentPtr pNew = new SwGlblDocContent( nSttIdx );
- if( !rArr.Insert( pNew ) )
+ SwGlblDocContent* pNew = new SwGlblDocContent( nSttIdx );
+ if( !rArr.insert( pNew ).second )
delete pNew;
break;
}
}
else
{
- SwGlblDocContentPtr pNew = new SwGlblDocContent(
+ SwGlblDocContent* pNew = new SwGlblDocContent(
pMyDoc->GetNodes().GetEndOfExtras().GetIndex() + 2 );
- rArr.Insert( pNew );
+ rArr.insert( pNew );
}
- return rArr.Count();
+ return rArr.size();
}
sal_Bool SwEditShell::InsertGlobalDocContent( const SwGlblDocContent& rInsPos,
@@ -269,7 +266,7 @@ sal_Bool SwEditShell::DeleteGlobalDocContent( const SwGlblDocContents& rArr ,
SwDoc* pMyDoc = GetDoc();
const SwGlblDocContent& rDelPos = *rArr[ nDelPos ];
sal_uLong nDelIdx = rDelPos.GetDocPos();
- if( 1 == rArr.Count() )
+ if( 1 == rArr.size() )
{
// ein Node muss aber da bleiben!
rPos.nNode = nDelIdx - 1;
@@ -285,7 +282,7 @@ sal_Bool SwEditShell::DeleteGlobalDocContent( const SwGlblDocContents& rArr ,
{
rPos.nNode = nDelIdx;
pCrsr->SetMark();
- if( ++nDelPos < rArr.Count() )
+ if( ++nDelPos < rArr.size() )
rPos.nNode = rArr[ nDelPos ]->GetDocPos();
else
rPos.nNode = pMyDoc->GetNodes().GetEndOfContent();
@@ -320,8 +317,8 @@ sal_Bool SwEditShell::MoveGlobalDocContent( const SwGlblDocContents& rArr ,
sal_uInt16 nInsPos )
{
if( !getIDocumentSettingAccess()->get(IDocumentSettingAccess::GLOBAL_DOCUMENT) ||
- nFromPos >= rArr.Count() || nToPos > rArr.Count() ||
- nInsPos > rArr.Count() || nFromPos >= nToPos ||
+ nFromPos >= rArr.size() || nToPos > rArr.size() ||
+ nInsPos > rArr.size() || nFromPos >= nToPos ||
( nFromPos <= nInsPos && nInsPos <= nToPos ) )
return sal_False;
@@ -334,13 +331,13 @@ sal_Bool SwEditShell::MoveGlobalDocContent( const SwGlblDocContents& rArr ,
SwDoc* pMyDoc = GetDoc();
SwNodeRange aRg( pMyDoc->GetNodes(), rArr[ nFromPos ]->GetDocPos() );
- if( nToPos < rArr.Count() )
+ if( nToPos < rArr.size() )
aRg.aEnd = rArr[ nToPos ]->GetDocPos();
else
aRg.aEnd = pMyDoc->GetNodes().GetEndOfContent();
SwNodeIndex aInsPos( pMyDoc->GetNodes() );
- if( nInsPos < rArr.Count() )
+ if( nInsPos < rArr.size() )
aInsPos = rArr[ nInsPos ]->GetDocPos();
else
aInsPos = pMyDoc->GetNodes().GetEndOfContent();
@@ -405,6 +402,4 @@ SwGlblDocContent::SwGlblDocContent( const SwSection* pSect )
nDocPos = pSectNd ? pSectNd->GetIndex() : 0;
}
-
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/utlui/glbltree.cxx b/sw/source/ui/utlui/glbltree.cxx
index 29814b0..25df56e 100644
--- a/sw/source/ui/utlui/glbltree.cxx
+++ b/sw/source/ui/utlui/glbltree.cxx
@@ -245,11 +245,11 @@ sal_Int8 SwGlobalTree::ExecuteDrop( const ExecuteDropEvent& rEvt )
pActiveShell->GetGlobalDocContent(*pTempContents);
// wenn das file erfolgreich eingefuegt wurde,
// dann muss auch der naechste Content geholt werden
- if(nEntryCount < pTempContents->Count())
+ if(nEntryCount < pTempContents->size())
{
nEntryCount++;
nAbsContPos++;
- pCnt = pTempContents->GetObject( static_cast< sal_uInt16 >(nAbsContPos) );
+ pCnt = (*pTempContents)[ nAbsContPos ];
}
}
}
@@ -553,7 +553,7 @@ sal_Bool SwGlobalTree::NotifyMoving( SvLBoxEntry* pTarget,
{
SvTreeList* _pModel = GetModel();
sal_uInt16 nSource = (sal_uInt16) _pModel->GetAbsPos(pSource);
- sal_uInt16 nDest = pTarget ? (sal_uInt16) _pModel->GetAbsPos(pTarget) : pSwGlblDocContents->Count();
+ sal_uInt16 nDest = pTarget ? (sal_uInt16) _pModel->GetAbsPos(pTarget) : pSwGlblDocContents->size();
if( pActiveShell->MoveGlobalDocContent(
*pSwGlblDocContents, nSource, nSource + 1, nDest ) &&
@@ -639,13 +639,13 @@ void SwGlobalTree::Display(sal_Bool bOnlyUpdateUserData)
aEntryImages = ImageList(SW_RES(IMG_NAVI_ENTRYBMP));
bIsImageListInitialized = sal_True;
}
- sal_uInt16 nCount = pSwGlblDocContents->Count();
- if(bOnlyUpdateUserData && GetEntryCount() == pSwGlblDocContents->Count())
+ sal_uInt16 nCount = pSwGlblDocContents->size();
+ if(bOnlyUpdateUserData && GetEntryCount() == pSwGlblDocContents->size())
{
SvLBoxEntry* pEntry = First();
for( sal_uInt16 i = 0; i < nCount; i++)
{
- SwGlblDocContentPtr pCont = pSwGlblDocContents->GetObject(i);
+ SwGlblDocContent* pCont = (*pSwGlblDocContents)[i];
pEntry->SetUserData(pCont);
pEntry = Next(pEntry);
}
@@ -668,7 +668,7 @@ void SwGlobalTree::Display(sal_Bool bOnlyUpdateUserData)
SvLBoxEntry* pSelEntry = 0;
for( sal_uInt16 i = 0; i < nCount; i++)
{
- SwGlblDocContentPtr pCont = pSwGlblDocContents->GetObject(i);
+ SwGlblDocContent* pCont = (*pSwGlblDocContents)[i];
String sEntry;
Image aImage;
switch( pCont->GetType() )
@@ -1117,18 +1117,18 @@ sal_Bool SwGlobalTree::Update(sal_Bool bHard)
sal_Bool bCopy = sal_False;
SwGlblDocContents* pTempContents = new SwGlblDocContents;
pActiveShell->GetGlobalDocContent(*pTempContents);
- if(pTempContents->Count() != pSwGlblDocContents->Count() ||
- pTempContents->Count() != GetEntryCount())
+ if(pTempContents->size() != pSwGlblDocContents->size() ||
+ pTempContents->size() != GetEntryCount())
{
bRet = sal_True;
bCopy = sal_True;
}
else
{
- for(sal_uInt16 i = 0; i < pTempContents->Count() && !bCopy; i++)
+ for(sal_uInt16 i = 0; i < pTempContents->size() && !bCopy; i++)
{
- SwGlblDocContent* pLeft = pTempContents->GetObject(i);
- SwGlblDocContent* pRight = pSwGlblDocContents->GetObject(i);
+ SwGlblDocContent* pLeft = (*pTempContents)[i];
+ SwGlblDocContent* pRight = (*pSwGlblDocContents)[i];
GlobalDocContentType eType = pLeft->GetType();
SvLBoxEntry* pEntry = GetEntry(i);
String sTemp = GetEntryText(pEntry);
@@ -1150,15 +1150,9 @@ sal_Bool SwGlobalTree::Update(sal_Bool bHard)
}
if(bCopy || bHard)
{
- sal_uInt16 i;
-
- pSwGlblDocContents->DeleteAndDestroy(0, pSwGlblDocContents->Count());
- for( i = 0; i < pTempContents->Count(); i++)
- {
- pSwGlblDocContents->Insert(pTempContents->GetObject(i));
- }
- for( i = pTempContents->Count(); i; i--)
- pTempContents->Remove(i - 1);
+ pSwGlblDocContents->DeleteAndDestroyAll();
+ pSwGlblDocContents->insert( *pTempContents );
+ pTempContents->clear();
}
delete pTempContents;
@@ -1169,7 +1163,7 @@ sal_Bool SwGlobalTree::Update(sal_Bool bHard)
{
Clear();
if(pSwGlblDocContents)
- pSwGlblDocContents->DeleteAndDestroy(0, pSwGlblDocContents->Count());
+ pSwGlblDocContents->DeleteAndDestroyAll();
}
// hier muss noch eine Veraenderungspruefung rein!
return bRet;
@@ -1290,12 +1284,12 @@ void SwGlobalTree::InsertRegion( const SwGlblDocContent* _pContent, const Sequen
rSh.StartAction();
// after insertion of the first new content the 'pCont' parameter becomes invalid
// find the index of the 'anchor' content to always use a current anchor content
- sal_uInt16 nAnchorContent = pSwGlblDocContents->Count() - 1;
+ sal_uInt16 nAnchorContent = pSwGlblDocContents->size() - 1;
if ( !bMove )
{
- for( sal_uInt16 nContent = 0; nContent < pSwGlblDocContents->Count(); ++nContent )
+ for( sal_uInt16 nContent = 0; nContent < pSwGlblDocContents->size(); ++nContent )
{
- if( *_pContent == *pSwGlblDocContents->GetObject( nContent ) )
+ if( *_pContent == *(*pSwGlblDocContents)[ nContent ] )
{
nAnchorContent = nContent;
break;
@@ -1308,11 +1302,11 @@ void SwGlobalTree::InsertRegion( const SwGlblDocContent* _pContent, const Sequen
//update the global document content after each inserted document
rSh.GetGlobalDocContent(aTempContents);
SwGlblDocContent* pAnchorContent = 0;
- OSL_ENSURE(aTempContents.Count() > (nAnchorContent + nFile), "invalid anchor content -> last insertion failed");
- if ( aTempContents.Count() > (nAnchorContent + nFile) )
- pAnchorContent = aTempContents.GetObject(nAnchorContent + (sal_uInt16)nFile);
+ OSL_ENSURE(aTempContents.size() > (nAnchorContent + nFile), "invalid anchor content -> last insertion failed");
+ if ( aTempContents.size() > (nAnchorContent + nFile) )
+ pAnchorContent = aTempContents[nAnchorContent + (sal_uInt16)nFile];
else
- pAnchorContent = aTempContents.GetObject(aTempContents.Count() - 1);
+ pAnchorContent = aTempContents.back();
String sFileName(pFileNames[nFile]);
INetURLObject aFileUrl;
aFileUrl.SetSmartURL( sFileName );
commit 7bef4fe2e22642d552cf3f431d6ee3ba456b9101
Author: Noel Grandin <noel at peralex.com>
Date: Fri Jul 13 15:28:03 2012 +0200
Convert SV_DECL_PTRARR_DEL( SwFmtCollConditions) to boost::ptr_vector
Change-Id: I45c66246de9d5608b630ceeb11535faf28f9c073
diff --git a/sw/inc/fmtcol.hxx b/sw/inc/fmtcol.hxx
index 80bfbf8..c54480e 100644
--- a/sw/inc/fmtcol.hxx
+++ b/sw/inc/fmtcol.hxx
@@ -28,10 +28,10 @@
#ifndef _FMTCOL_HXX
#define _FMTCOL_HXX
-#include <svl/svarray.hxx>
#include "swdllapi.h"
#include <format.hxx>
#include <swtypes.hxx> // For MAXLEVEL.
+#include <boost/ptr_container/ptr_vector.hpp>
class SwDoc; // For friend.
@@ -231,8 +231,7 @@ public:
void RegisterToFormat( SwFmt& );
};
-typedef SwCollCondition* SwCollConditionPtr;
-SV_DECL_PTRARR_DEL( SwFmtCollConditions, SwCollConditionPtr, 0 )
+class SwFmtCollConditions : public boost::ptr_vector<SwCollCondition> {};
class SW_DLLPUBLIC SwConditionTxtFmtColl : public SwTxtFmtColl
{
diff --git a/sw/source/core/doc/fmtcol.cxx b/sw/source/core/doc/fmtcol.cxx
index 3263a58..0e65267 100644
--- a/sw/source/core/doc/fmtcol.cxx
+++ b/sw/source/core/doc/fmtcol.cxx
@@ -48,8 +48,6 @@ TYPEINIT1( SwGrfFmtColl, SwFmtColl );
TYPEINIT1( SwConditionTxtFmtColl, SwTxtFmtColl );
TYPEINIT1( SwCollCondition, SwClient );
-SV_IMPL_PTRARR( SwFmtCollConditions, SwCollConditionPtr );
-
namespace TxtFmtCollFunc
{
@@ -576,36 +574,36 @@ const SwCollCondition* SwConditionTxtFmtColl::HasCondition(
const SwCollCondition* pFnd = 0;
sal_uInt16 n;
- for( n = 0; n < aCondColls.Count(); ++n )
- if( *( pFnd = aCondColls[ n ]) == rCond )
+ for( n = 0; n < aCondColls.size(); ++n )
+ if( *( pFnd = &aCondColls[ n ]) == rCond )
break;
- return n < aCondColls.Count() ? pFnd : 0;
+ return n < aCondColls.size() ? pFnd : 0;
}
void SwConditionTxtFmtColl::InsertCondition( const SwCollCondition& rCond )
{
- for( sal_uInt16 n = 0; n < aCondColls.Count(); ++n )
- if( *aCondColls[ n ] == rCond )
+ for( sal_uInt16 n = 0; n < aCondColls.size(); ++n )
+ if( aCondColls[ n ] == rCond )
{
- aCondColls.DeleteAndDestroy( n );
+ aCondColls.erase( aCondColls.begin() + n );
break;
}
// Not found -> so insert it
SwCollCondition* pNew = new SwCollCondition( rCond );
- aCondColls.Insert( pNew, aCondColls.Count() );
+ aCondColls.push_back( pNew );
}
sal_Bool SwConditionTxtFmtColl::RemoveCondition( const SwCollCondition& rCond )
{
sal_Bool bRet = sal_False;
- for( sal_uInt16 n = 0; n < aCondColls.Count(); ++n )
- if( *aCondColls[ n ] == rCond )
+ for( sal_uInt16 n = 0; n < aCondColls.size(); ++n )
+ if( aCondColls[ n ] == rCond )
{
- aCondColls.DeleteAndDestroy( n );
+ aCondColls.erase( aCondColls.begin() + n );
bRet = sal_True;
}
@@ -615,12 +613,11 @@ sal_Bool SwConditionTxtFmtColl::RemoveCondition( const SwCollCondition& rCond )
void SwConditionTxtFmtColl::SetConditions( const SwFmtCollConditions& rCndClls )
{
// Copy the Conditions, but first delete the old ones
- if( aCondColls.Count() )
- aCondColls.DeleteAndDestroy( 0, aCondColls.Count() );
+ aCondColls.clear();
SwDoc& rDoc = *GetDoc();
- for( sal_uInt16 n = 0; n < rCndClls.Count(); ++n )
+ for( sal_uInt16 n = 0; n < rCndClls.size(); ++n )
{
- SwCollCondition* pFnd = rCndClls[ n ];
+ const SwCollCondition* pFnd = &rCndClls[ n ];
SwTxtFmtColl* pTmpColl = pFnd->GetTxtFmtColl()
? rDoc.CopyTxtColl( *pFnd->GetTxtFmtColl() )
: 0;
@@ -631,7 +628,7 @@ void SwConditionTxtFmtColl::SetConditions( const SwFmtCollConditions& rCndClls )
else
pNew = new SwCollCondition( pTmpColl, pFnd->GetCondition(),
pFnd->GetSubCondition() );
- aCondColls.Insert( pNew, n );
+ aCondColls.push_back( pNew );
}
}
//#outline level, zhaojianwei
diff --git a/sw/source/filter/xml/xmlfmt.cxx b/sw/source/filter/xml/xmlfmt.cxx
index 1993146..30a44eb 100644
--- a/sw/source/filter/xml/xmlfmt.cxx
+++ b/sw/source/filter/xml/xmlfmt.cxx
@@ -1055,9 +1055,9 @@ void SwXMLImport::UpdateTxtCollConditions( SwDoc *pDoc )
const SwFmtCollConditions& rConditions =
((const SwConditionTxtFmtColl *)pColl)->GetCondColls();
sal_Bool bSendModify = sal_False;
- for( sal_uInt16 j=0; j < rConditions.Count() && !bSendModify; j++ )
+ for( sal_uInt16 j=0; j < rConditions.size() && !bSendModify; j++ )
{
- const SwCollCondition& rCond = *rConditions[j];
+ const SwCollCondition& rCond = rConditions[j];
switch( rCond.GetCondition() )
{
case PARA_IN_TABLEHEAD:
diff --git a/sw/source/filter/xml/xmltexte.cxx b/sw/source/filter/xml/xmltexte.cxx
index 5c89944..5098c0b 100644
--- a/sw/source/filter/xml/xmltexte.cxx
+++ b/sw/source/filter/xml/xmltexte.cxx
@@ -115,9 +115,9 @@ void SwXMLTextParagraphExport::exportStyleContent(
{
const SwFmtCollConditions& rConditions =
((const SwConditionTxtFmtColl *)pColl)->GetCondColls();
- for( sal_uInt16 i=0; i < rConditions.Count(); i++ )
+ for( sal_uInt16 i=0; i < rConditions.size(); i++ )
{
- const SwCollCondition& rCond = *rConditions[i];
+ const SwCollCondition& rCond = rConditions[i];
enum XMLTokenEnum eFunc = XML_TOKEN_INVALID;
OUStringBuffer sBuffer( 20 );
commit 22faf8438f01d67fe3381aa353e5187f36ce4098
Author: Noel Grandin <noel at peralex.com>
Date: Fri Jul 13 15:23:15 2012 +0200
Convert SV_DECL_PTRARR_SORT(SwpFmts) to std::set
Change-Id: Ia5bbf4960cae0b2e4a975ded067d46a85a0b3ab9
diff --git a/sw/source/core/crsr/findattr.cxx b/sw/source/core/crsr/findattr.cxx
index 26cd656..0081079 100644
--- a/sw/source/core/crsr/findattr.cxx
+++ b/sw/source/core/crsr/findattr.cxx
@@ -55,8 +55,7 @@ using namespace ::com::sun::star;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::util;
-SV_DECL_PTRARR_SORT( SwpFmts, SwFmt*, 0 )
-SV_IMPL_PTRARR_SORT( SwpFmts, SwFmt* )
+typedef std::set<SwFmt*> SwpFmts;
// Sonderbehandlung fuer SvxFontItem, nur den Namen vergleichen:
int CmpAttr( const SfxPoolItem& rItem1, const SfxPoolItem& rItem2 )
@@ -920,10 +919,10 @@ sal_Bool SwPaM::Find( const SfxPoolItem& rAttr, sal_Bool bValue, SwMoveFn fnMove
// no hard attribution, so check if node was asked for this attr before
if( !pNode->HasSwAttrSet() )
{
- const SwFmt* pTmpFmt = pNode->GetFmtColl();
- if( aFmtArr.Count() && aFmtArr.Seek_Entry( pTmpFmt ))
+ SwFmt* pTmpFmt = pNode->GetFmtColl();
+ if( aFmtArr.find( pTmpFmt ) != aFmtArr.end() )
continue; // collection was requested earlier
- aFmtArr.Insert( pTmpFmt );
+ aFmtArr.insert( pTmpFmt );
}
if( SFX_ITEM_SET == pNode->GetSwAttrSet().GetItemState( nWhich,
@@ -1016,10 +1015,10 @@ sal_Bool SwPaM::Find( const SfxItemSet& rSet, sal_Bool bNoColls, SwMoveFn fnMove
// no hard attribution, so check if node was asked for this attr before
if( !pNode->HasSwAttrSet() )
{
- const SwFmt* pTmpFmt = pNode->GetFmtColl();
- if( aFmtArr.Count() && aFmtArr.Seek_Entry( pTmpFmt ))
+ SwFmt* pTmpFmt = pNode->GetFmtColl();
+ if( aFmtArr.find( pTmpFmt ) != aFmtArr.end() )
continue; // collection was requested earlier
- aFmtArr.Insert( pTmpFmt );
+ aFmtArr.insert( pTmpFmt );
}
if( lcl_Search( *pNode, aOtherSet, bNoColls ))
commit c09d284eb17f1d95d5052e2c651063b99e387b48
Author: Michael Stahl <mstahl at redhat.com>
Date: Tue Jul 17 14:26:22 2012 +0200
fix previous STL conversion commit:
Change-Id: Iace6d47157ee7280c6940465ef6da0b066302e52
SwBlink::Insert: the delete was removed, introducing a memory leak.
diff --git a/sw/source/core/text/blink.cxx b/sw/source/core/text/blink.cxx
index 29474e4..c522d63 100644
--- a/sw/source/core/text/blink.cxx
+++ b/sw/source/core/text/blink.cxx
@@ -137,6 +137,7 @@ void SwBlink::Insert( const Point& rPoint, const SwLinePortion* pPor,
if( it != aList.end() )
{
(*it).SetPos( rPoint );
+ delete pBlinkPor;
}
else
{
commit 4c24b7e486fa7f0099d6be6f03e7299de3591dde
Author: Noel Grandin <noel at peralex.com>
Date: Fri Jul 13 15:22:29 2012 +0200
Convert SV_DECL_PTRARR_SORT_DEL(SwBlinkList) to boost::ptr_set
Change-Id: I14bd09a6a1209de45ee0a67f7f6e89aeb7412041
diff --git a/sw/source/core/inc/blink.hxx b/sw/source/core/inc/blink.hxx
index f89fa3c..a5d45aa 100644
--- a/sw/source/core/inc/blink.hxx
+++ b/sw/source/core/inc/blink.hxx
@@ -35,7 +35,7 @@ class SwTxtFrm;
#include <vcl/timer.hxx>
#include <tools/gen.hxx>
-#include <svl/svarray.hxx>
+#include <boost/ptr_container/ptr_set.hpp>
class SwBlinkPortion
{
@@ -61,8 +61,7 @@ public:
{ return (long)pPor == (long)rBlinkPortion.pPor; }
};
-typedef SwBlinkPortion* SwBlinkPortionPtr;
-SV_DECL_PTRARR_SORT_DEL(SwBlinkList, SwBlinkPortionPtr, 0)
+class SwBlinkList : public boost::ptr_set<SwBlinkPortion> {};
class SwBlink
{
diff --git a/sw/source/core/text/blink.cxx b/sw/source/core/text/blink.cxx
index 2e89069..29474e4 100644
--- a/sw/source/core/text/blink.cxx
+++ b/sw/source/core/text/blink.cxx
@@ -48,9 +48,6 @@
SwBlink *pBlink = NULL;
-// List of blinking portions
-SV_IMPL_OP_PTRARR_SORT( SwBlinkList, SwBlinkPortionPtr )
-
SwBlink::SwBlink()
{
bVisible = sal_True;
@@ -77,16 +74,16 @@ IMPL_LINK_NOARG(SwBlink, Blinker)
aTimer.SetTimeout( BLINK_ON_TIME );
else
aTimer.SetTimeout( BLINK_OFF_TIME );
- if( aList.Count() )
+ if( !aList.empty() )
{
- for( MSHORT nPos = 0; nPos < aList.Count(); )
+ for( SwBlinkList::iterator it = aList.begin(); it != aList.end(); )
{
- const SwBlinkPortion* pTmp = aList[ nPos ];
+ const SwBlinkPortion* pTmp = &*it;
if( pTmp->GetRootFrm() &&
((SwRootFrm*)pTmp->GetRootFrm())->GetCurrShell() )
{
- ++nPos;
+ ++it;
Point aPos = pTmp->GetPos();
long nWidth, nHeight;
@@ -123,7 +120,7 @@ IMPL_LINK_NOARG(SwBlink, Blinker)
->GetCurrShell()->InvalidateWindows( aRefresh );
}
else // Portions without a shell can be removed from the list
- aList.Remove( nPos );
+ aList.erase( it );
}
}
else // If the list is empty, the timer can be stopped
@@ -136,17 +133,16 @@ void SwBlink::Insert( const Point& rPoint, const SwLinePortion* pPor,
{
SwBlinkPortion *pBlinkPor = new SwBlinkPortion( pPor, nDir );
- MSHORT nPos;
- if( aList.Seek_Entry( pBlinkPor, &nPos ) )
+ SwBlinkList::iterator it = aList.find( *pBlinkPor );
+ if( it != aList.end() )
{
- aList[ nPos ]->SetPos( rPoint );
- delete pBlinkPor;
+ (*it).SetPos( rPoint );
}
else
{
pBlinkPor->SetPos( rPoint );
pBlinkPor->SetRootFrm( pTxtFrm->getRootFrm() );
- aList.Insert( pBlinkPor );
+ aList.insert( pBlinkPor );
pTxtFrm->SetBlinkPor();
if( pPor->IsLayPortion() || pPor->IsParaPortion() )
((SwLineLayout*)pPor)->SetBlinking( sal_True );
@@ -161,12 +157,12 @@ void SwBlink::Replace( const SwLinePortion* pOld, const SwLinePortion* pNew )
// setting direction to 0 because direction does not matter
// for this operation
SwBlinkPortion aBlink( pOld, 0 );
- MSHORT nPos;
- if( aList.Seek_Entry( &aBlink, &nPos ) )
+ SwBlinkList::iterator it = aList.find( aBlink );
+ if( it != aList.end() )
{
- SwBlinkPortion* pTmp = new SwBlinkPortion( aList[ nPos ], pNew );
- aList.Remove( nPos );
- aList.Insert( pTmp );
+ SwBlinkPortion* aTmp = new SwBlinkPortion( &*it, pNew );
+ aList.erase( it );
+ aList.insert( aTmp );
}
}
@@ -175,19 +171,17 @@ void SwBlink::Delete( const SwLinePortion* pPor )
// setting direction to 0 because direction does not matter
// for this operation
SwBlinkPortion aBlink( pPor, 0 );
- MSHORT nPos;
- if( aList.Seek_Entry( &aBlink, &nPos ) )
- aList.Remove( nPos );
+ aList.erase( aBlink );
}
void SwBlink::FrmDelete( const SwRootFrm* pRoot )
{
- for( MSHORT nPos = 0; nPos < aList.Count(); )
+ for( SwBlinkList::iterator it = aList.begin(); it != aList.end(); )
{
- if( pRoot == aList[ nPos ]->GetRootFrm() )
- aList.Remove( nPos );
+ if( pRoot == (*it).GetRootFrm() )
+ aList.erase( it );
else
- ++nPos;
+ ++it;
}
}
commit b6d0e8ab15086ec25bb4d42650024711ef4de2a8
Author: Noel Grandin <noel at peralex.com>
Date: Fri Jul 13 15:21:41 2012 +0200
Cleanup: remove _FndBoxPtr typedef
Change-Id: I6e794589b22698b411f5b74d56eeaabb760305d8
diff --git a/sw/source/core/doc/docsort.cxx b/sw/source/core/doc/docsort.cxx
index f9ce363..5f2ce44 100644
--- a/sw/source/core/doc/docsort.cxx
+++ b/sw/source/core/doc/docsort.cxx
@@ -777,9 +777,9 @@ FlatFndBox::FlatFndBox(SwDoc* pDocPtr, const _FndBox& rBox) :
nRows = GetRowCount(rBoxRef);
// Create linear array
- pArr = new _FndBoxPtr[ nRows * nCols ];
+ pArr = new const _FndBox*[ nRows * nCols ];
_FndBox** ppTmp = (_FndBox**)pArr;
- memset( ppTmp, 0, sizeof(_FndBoxPtr) * nRows * nCols );
+ memset( ppTmp, 0, sizeof(const _FndBox*) * nRows * nCols );
FillFlat( rBoxRef );
diff --git a/sw/source/core/inc/docsort.hxx b/sw/source/core/inc/docsort.hxx
index 678ebee..4254f62 100644
--- a/sw/source/core/inc/docsort.hxx
+++ b/sw/source/core/inc/docsort.hxx
@@ -55,7 +55,6 @@ namespace com {
}
// List of all sorted elements
-typedef const _FndBox* _FndBoxPtr;
typedef SwSortElement* SwSortElementPtr;
SV_DECL_PTRARR_SORT(SwSortElements, SwSortElementPtr, 0)
@@ -148,7 +147,7 @@ private:
SwDoc* pDoc;
const _FndBox& rBoxRef;
- _FndBoxPtr* pArr;
+ const _FndBox** pArr;
SfxItemSet** ppItemSets;
sal_uInt16 nRows;
commit 21dd191b9fd5a75f7633ea27f745a347adb42ae3
Author: Noel Grandin <noel at peralex.com>
Date: Fri Jul 13 15:20:39 2012 +0200
Convert SV_DECL_PTRARR_SORT(SwDestroyList) to std::set
Change-Id: Ifbee6942045b26fc7df8fb96d910197f77729b4b
diff --git a/sw/source/core/inc/sectfrm.hxx b/sw/source/core/inc/sectfrm.hxx
index 9bbe9f9..bf4d44a 100644
--- a/sw/source/core/inc/sectfrm.hxx
+++ b/sw/source/core/inc/sectfrm.hxx
@@ -31,6 +31,7 @@
#include "layfrm.hxx"
#include "flowfrm.hxx"
+#include <set>
class SwSection;
class SwSectionFmt;
@@ -153,8 +154,7 @@ public:
DECL_FIXEDMEMPOOL_NEWDEL(SwSectionFrm)
};
-typedef SwSectionFrm* SwSectionFrmPtr;
-SV_DECL_PTRARR_SORT( SwDestroyList, SwSectionFrmPtr, 1 )
+class SwDestroyList : public std::set<SwSectionFrm*> {};
inline const SwSectionFrm *SwSectionFrm::GetFollow() const
{
diff --git a/sw/source/core/layout/sectfrm.cxx b/sw/source/core/layout/sectfrm.cxx
index 63f2bbd..8c92c2a 100644
--- a/sw/source/core/layout/sectfrm.cxx
+++ b/sw/source/core/layout/sectfrm.cxx
@@ -64,8 +64,6 @@
#include <flyfrms.hxx>
#include <sortedobjs.hxx>
-SV_IMPL_PTRARR_SORT( SwDestroyList, SwSectionFrmPtr )
-
/*************************************************************************
|*
|* SwSectionFrm::SwSectionFrm(), ~SwSectionFrm()
@@ -2689,18 +2687,16 @@ void SwRootFrm::InsertEmptySct( SwSectionFrm* pDel )
{
if( !pDestroy )
pDestroy = new SwDestroyList;
- sal_uInt16 nPos;
- if( !pDestroy->Seek_Entry( pDel, &nPos ) )
- pDestroy->Insert( pDel );
+ pDestroy->insert( pDel );
}
void SwRootFrm::_DeleteEmptySct()
{
OSL_ENSURE( pDestroy, "Keine Liste, keine Kekse" );
- while( pDestroy->Count() )
+ while( !pDestroy->empty() )
{
- SwSectionFrm* pSect = (*pDestroy)[0];
- pDestroy->Remove( sal_uInt16(0) );
+ SwSectionFrm* pSect = *pDestroy->begin();
+ pDestroy->erase( pDestroy->begin() );
OSL_ENSURE( !pSect->IsColLocked() && !pSect->IsJoinLocked(),
"DeleteEmptySct: Locked SectionFrm" );
if( !pSect->Frm().HasArea() && !pSect->ContainsCntnt() )
@@ -2729,16 +2725,13 @@ void SwRootFrm::_DeleteEmptySct()
void SwRootFrm::_RemoveFromList( SwSectionFrm* pSct )
{
OSL_ENSURE( pDestroy, "Where's my list?" );
- sal_uInt16 nPos;
- if( pDestroy->Seek_Entry( pSct, &nPos ) )
- pDestroy->Remove( nPos );
+ pDestroy->erase( pSct );
}
#ifdef DBG_UTIL
bool SwRootFrm::IsInDelList( SwSectionFrm* pSct ) const
{
- sal_uInt16 nPos;
- return ( pDestroy && pDestroy->Seek_Entry( pSct, &nPos ) );
+ return pDestroy && pDestroy->find( pSct ) != pDestroy->end();
}
#endif
commit 76fedd4d9abaf7597cadf3cde94de4f329a03c1e
Author: Noel Grandin <noel at peralex.com>
Date: Fri Jul 13 15:19:48 2012 +0200
Convert SV_DECL_PTRARR_SORT(SwCurrShells) to std::set
Change-Id: Ic8d230bb32fb071300868d0cdcf776ddf58506da
diff --git a/sw/source/core/layout/newfrm.cxx b/sw/source/core/layout/newfrm.cxx
index 96897ed..b1bfc86 100644
--- a/sw/source/core/layout/newfrm.cxx
+++ b/sw/source/core/layout/newfrm.cxx
@@ -54,6 +54,7 @@
#include "IDocumentDrawModelAccess.hxx"
#include <hints.hxx>
#include <viewopt.hxx>
+#include <set>
SwLayVout *SwRootFrm::pVout = 0;
sal_Bool SwRootFrm::bInPaint = sal_False;
@@ -394,9 +395,7 @@ void _FrmFinit()
|*
|*************************************************************************/
-typedef CurrShell* CurrShellPtr;
-SV_DECL_PTRARR_SORT(SwCurrShells,CurrShellPtr,4)
-SV_IMPL_PTRARR_SORT(SwCurrShells,CurrShellPtr)
+class SwCurrShells : public std::set<CurrShell*> {};
CurrShell::CurrShell( ViewShell *pNew )
{
@@ -406,7 +405,7 @@ CurrShell::CurrShell( ViewShell *pNew )
{
pPrev = pRoot->pCurrShell;
pRoot->pCurrShell = pNew;
- pRoot->pCurrShells->Insert( this );
+ pRoot->pCurrShells->insert( this );
}
else
pPrev = 0;
@@ -416,10 +415,10 @@ CurrShell::~CurrShell()
{
if ( pRoot )
{
- pRoot->pCurrShells->Remove( this );
+ pRoot->pCurrShells->erase( this );
if ( pPrev )
pRoot->pCurrShell = pPrev;
- if ( !pRoot->pCurrShells->Count() && pRoot->pWaitingCurrShell )
+ if ( pRoot->pCurrShells->empty() && pRoot->pWaitingCurrShell )
{
pRoot->pCurrShell = pRoot->pWaitingCurrShell;
pRoot->pWaitingCurrShell = 0;
@@ -430,7 +429,7 @@ CurrShell::~CurrShell()
void SetShell( ViewShell *pSh )
{
SwRootFrm *pRoot = pSh->GetLayout();
- if ( !pRoot->pCurrShells->Count() )
+ if ( pRoot->pCurrShells->empty() )
pRoot->pCurrShell = pSh;
else
pRoot->pWaitingCurrShell = pSh;
@@ -447,9 +446,9 @@ void SwRootFrm::DeRegisterShell( ViewShell *pSh )
pWaitingCurrShell = 0;
// Remove references
- for ( sal_uInt16 i = 0; i < pCurrShells->Count(); ++i )
+ for ( SwCurrShells::iterator it = pCurrShells->begin(); it != pCurrShells->end(); ++it )
{
- CurrShell *pC = (*pCurrShells)[i];
+ CurrShell *pC = *it;
if (pC->pPrev == pSh)
pC->pPrev = 0;
}
@@ -623,8 +622,8 @@ SwRootFrm::~SwRootFrm()
pDestroy = 0;
// Remove references
- for ( sal_uInt16 i = 0; i < pCurrShells->Count(); ++i )
- (*pCurrShells)[i]->pRoot = 0;
+ for ( SwCurrShells::iterator it = pCurrShells->begin(); it != pCurrShells->end(); ++it )
+ (*it)->pRoot = 0;
delete pCurrShells;
pCurrShells = 0;
commit fbabbcefd8f8575c7b08c7a7ac7fe0b665038214
Author: Noel Grandin <noel at peralex.com>
Date: Fri Jul 13 15:18:57 2012 +0200
Convert SV_DECL_PTRARR_SORT(SwHTMLPosFlyFrms) to o3tl::sorted_vector
Change-Id: If745de5e44ffffca27166f3ac6f35877189d50a7
diff --git a/sw/source/filter/html/htmlfly.cxx b/sw/source/filter/html/htmlfly.cxx
index 2a9bc94..bc3d069 100644
--- a/sw/source/filter/html/htmlfly.cxx
+++ b/sw/source/filter/html/htmlfly.cxx
@@ -174,8 +174,6 @@ static HTMLOutEvent aIMapEventTable[] =
-SV_IMPL_OP_PTRARR_SORT( SwHTMLPosFlyFrms, SwHTMLPosFlyFrmPtr )
-
sal_uInt16 SwHTMLWriter::GuessFrmType( const SwFrmFmt& rFrmFmt,
const SdrObject*& rpSdrObj )
{
@@ -266,7 +264,7 @@ sal_uInt16 SwHTMLWriter::GuessFrmType( const SwFrmFmt& rFrmFmt,
bEmpty = sal_True;
if( pHTMLPosFlyFrms )
{
- for( sal_uInt16 i=0; i<pHTMLPosFlyFrms->Count(); i++ )
+ for( sal_uInt16 i=0; i<pHTMLPosFlyFrms->size(); i++ )
{
sal_uLong nIdx = (*pHTMLPosFlyFrms)[i]
->GetNdIndex().GetIndex();
@@ -369,7 +367,7 @@ void SwHTMLWriter::CollectFlyFrms()
SwHTMLPosFlyFrm *pNew =
new SwHTMLPosFlyFrm( **it, pSdrObj, nMode );
- pHTMLPosFlyFrms->Insert( pNew );
+ pHTMLPosFlyFrms->insert( pNew );
}
}
@@ -389,10 +387,10 @@ sal_Bool SwHTMLWriter::OutFlyFrm( sal_uLong nNdIdx, xub_StrLen nCntntIdx, sal_uI
// suche nach dem Anfang der FlyFrames
sal_uInt16 i;
- for( i = 0; i < pHTMLPosFlyFrms->Count() &&
+ for( i = 0; i < pHTMLPosFlyFrms->size() &&
(*pHTMLPosFlyFrms)[i]->GetNdIndex().GetIndex() < nNdIdx; i++ )
;
- for( ; !bRestart && i < pHTMLPosFlyFrms->Count() &&
+ for( ; !bRestart && i < pHTMLPosFlyFrms->size() &&
(*pHTMLPosFlyFrms)[i]->GetNdIndex().GetIndex() == nNdIdx; i++ )
{
SwHTMLPosFlyFrm *pPosFly = (*pHTMLPosFlyFrms)[i];
@@ -403,9 +401,9 @@ sal_Bool SwHTMLWriter::OutFlyFrm( sal_uLong nNdIdx, xub_StrLen nCntntIdx, sal_uI
// Erst entfernen ist wichtig, weil in tieferen
// Rekursionen evtl. weitere Eintraege oder das
// ganze Array geloscht werden koennte.
- pHTMLPosFlyFrms->Remove( i, 1 );
+ pHTMLPosFlyFrms->erase( i );
i--;
- if( !pHTMLPosFlyFrms->Count() )
+ if( pHTMLPosFlyFrms->empty() )
{
delete pHTMLPosFlyFrms;
pHTMLPosFlyFrms = 0;
@@ -1929,7 +1927,7 @@ SwHTMLPosFlyFrm::SwHTMLPosFlyFrm( const SwPosFlyFrm& rPosFly,
}
}
-sal_Bool SwHTMLPosFlyFrm::operator<( const SwHTMLPosFlyFrm& rFrm ) const
+bool SwHTMLPosFlyFrm::operator<( const SwHTMLPosFlyFrm& rFrm ) const
{
if( pNdIdx->GetIndex() == rFrm.pNdIdx->GetIndex() )
{
@@ -1947,5 +1945,4 @@ sal_Bool SwHTMLPosFlyFrm::operator<( const SwHTMLPosFlyFrm& rFrm ) const
return pNdIdx->GetIndex() < rFrm.pNdIdx->GetIndex();
}
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/filter/html/htmlfly.hxx b/sw/source/filter/html/htmlfly.hxx
index 5e0d945..81f3ced 100644
--- a/sw/source/filter/html/htmlfly.hxx
+++ b/sw/source/filter/html/htmlfly.hxx
@@ -30,8 +30,7 @@
#define _HTMLFLY_HXX
#include <tools/solar.h>
-
-#include <svl/svarray.hxx>
+#include <o3tl/sorted_vector.hxx>
class SdrObject;
class SwFrmFmt;
@@ -107,8 +106,8 @@ public:
SwHTMLPosFlyFrm( const SwPosFlyFrm& rPosFly,
const SdrObject *pSdrObj, sal_uInt8 nOutMode );
- sal_Bool operator==( const SwHTMLPosFlyFrm& ) const { return sal_False; }
- sal_Bool operator<( const SwHTMLPosFlyFrm& ) const;
+ bool operator==( const SwHTMLPosFlyFrm& ) const { return false; }
+ bool operator<( const SwHTMLPosFlyFrm& ) const;
const SwFrmFmt& GetFmt() const { return *pFrmFmt; }
const SdrObject *GetSdrObject() const { return pSdrObject; }
@@ -128,9 +127,7 @@ public:
sal_uInt8 GetOutCntnr() const { return nOutputMode & HTML_CNTNR_MASK; }
};
-typedef SwHTMLPosFlyFrm *SwHTMLPosFlyFrmPtr;
-SV_DECL_PTRARR_SORT( SwHTMLPosFlyFrms, SwHTMLPosFlyFrmPtr, 10 )
-
+class SwHTMLPosFlyFrms : public o3tl::sorted_vector<SwHTMLPosFlyFrm*, o3tl::less_ptr_to<SwHTMLPosFlyFrm> > {};
#endif
diff --git a/sw/source/filter/html/htmlforw.cxx b/sw/source/filter/html/htmlforw.cxx
index 7d1ea03..c42e4b6 100644
--- a/sw/source/filter/html/htmlforw.cxx
+++ b/sw/source/filter/html/htmlforw.cxx
@@ -1392,9 +1392,9 @@ void SwHTMLWriter::GetControls()
if( pHTMLPosFlyFrms )
{
// die absatz-gebundenen Controls einsammeln
- for( i=0; i<pHTMLPosFlyFrms->Count(); i++ )
+ for( i=0; i<pHTMLPosFlyFrms->size(); i++ )
{
- const SwHTMLPosFlyFrm* pPosFlyFrm = pHTMLPosFlyFrms->GetObject( i );
+ const SwHTMLPosFlyFrm* pPosFlyFrm = (*pHTMLPosFlyFrms)[ i ];
if( HTML_OUT_CONTROL != pPosFlyFrm->GetOutFn() )
continue;
diff --git a/sw/source/filter/html/wrthtml.cxx b/sw/source/filter/html/wrthtml.cxx
index 44e3c8e..131c04e 100644
--- a/sw/source/filter/html/wrthtml.cxx
+++ b/sw/source/filter/html/wrthtml.cxx
@@ -376,7 +376,7 @@ sal_uLong SwHTMLWriter::WriteStream()
OSL_ENSURE( !pHTMLPosFlyFrms, "Wurden nicht alle Rahmen ausgegeben" );
if( pHTMLPosFlyFrms )
{
- pHTMLPosFlyFrms->DeleteAndDestroy( 0, pHTMLPosFlyFrms->Count() );
+ pHTMLPosFlyFrms->DeleteAndDestroyAll();
delete pHTMLPosFlyFrms;
pHTMLPosFlyFrms = 0;
}
commit 22461ae3712fa77a18be99fe76d6f0531058e388
Author: Noel Grandin <noel at peralex.com>
Date: Fri Jul 13 14:56:23 2012 +0200
Convert SV_DECL_PTRARR_SORT_DEL(HTMLControls) to o3tl::sorted_vector
I had to move the HTMLControl struct to the header file to avoid
warnings about delete not being called.
Change-Id: I822afba210d34f5855ae052fb34e117a16578970
diff --git a/sw/source/filter/html/htmlforw.cxx b/sw/source/filter/html/htmlforw.cxx
index 7057aed..7d1ea03 100644
--- a/sw/source/filter/html/htmlforw.cxx
+++ b/sw/source/filter/html/htmlforw.cxx
@@ -90,31 +90,6 @@ const sal_uInt32 HTML_FRMOPTS_IMG_CONTROL_CSS1 =
-struct HTMLControl
-{
- // die Form, zu der das Control gehoert
- uno::Reference< container::XIndexContainer > xFormComps;
- sal_uLong nNdIdx; // der Node, in dem es verankert ist
- xub_StrLen nCount; // wie viele Controls sind in dem Node
-
- HTMLControl( const uno::Reference< container::XIndexContainer > & rForm,
- sal_uInt32 nIdx );
- ~HTMLControl();
-
- // operatoren fuer das Sort-Array
- sal_Bool operator==( const HTMLControl& rCtrl )
- {
- return nNdIdx == rCtrl.nNdIdx;
- }
- sal_Bool operator<( const HTMLControl& rCtrl )
- {
- return nNdIdx < rCtrl.nNdIdx;
- }
-};
-
-SV_IMPL_OP_PTRARR_SORT( HTMLControls, HTMLControl* )
-
-
void lcl_html_outEvents( SvStream& rStrm,
const uno::Reference< form::XFormComponent > rFormComp,
sal_Bool bCfgStarBasic,
@@ -261,11 +236,11 @@ sal_Bool SwHTMLWriter::HasControls() const
sal_uInt16 i;
// Skip all controls in front of the current paragraph
- for( i = 0; i < aHTMLControls.Count() &&
+ for( i = 0; i < aHTMLControls.size() &&
aHTMLControls[i]->nNdIdx < nStartIdx; i++ )
;
- return i < aHTMLControls.Count() && aHTMLControls[i]->nNdIdx == nStartIdx;
+ return i < aHTMLControls.size() && aHTMLControls[i]->nNdIdx == nStartIdx;
}
void SwHTMLWriter::OutForm( sal_Bool bTag_On, const SwStartNode *pStartNd )
@@ -291,7 +266,7 @@ void SwHTMLWriter::OutForm( sal_Bool bTag_On, const SwStartNode *pStartNd )
// Ueberspringen von Controls vor dem interesanten Bereich
sal_uInt16 i;
- for( i = 0; i < aHTMLControls.Count() &&
+ for( i = 0; i < aHTMLControls.size() &&
aHTMLControls[i]->nNdIdx < nStartIdx; i++ )
;
@@ -299,7 +274,7 @@ void SwHTMLWriter::OutForm( sal_Bool bTag_On, const SwStartNode *pStartNd )
{
// Check fuer einen einzelnen Node: da ist nur interessant, ob
// es zu dem Node ein Control gibt und zu welcher Form es gehoert
- if( i < aHTMLControls.Count() &&
+ if( i < aHTMLControls.size() &&
aHTMLControls[i]->nNdIdx == nStartIdx )
xNewFormComps = aHTMLControls[i]->xFormComps;
}
@@ -314,7 +289,7 @@ void SwHTMLWriter::OutForm( sal_Bool bTag_On, const SwStartNode *pStartNd )
const SwStartNode *pCurrentStNd = 0; // und der Start-Node eines Ctrls
xub_StrLen nCurrentCtrls = 0; // und die in ihr gefundenen Controls
sal_uInt32 nEndIdx = pStartNd->EndOfSectionIndex();
- for( ; i < aHTMLControls.Count() &&
+ for( ; i < aHTMLControls.size() &&
aHTMLControls[i]->nNdIdx <= nEndIdx; i++ )
{
const SwStartNode *pCntrlStNd =
@@ -1393,12 +1368,13 @@ static void AddControl( HTMLControls& rControls,
{
uno::Reference< container::XIndexContainer > xFormComps( xForm, uno::UNO_QUERY );
HTMLControl *pHCntrl = new HTMLControl( xFormComps, nNodeIdx );
- if( !rControls.C40_PTR_INSERT( HTMLControl, pHCntrl ) )
+ HTMLControls::const_iterator it = rControls.find( pHCntrl );
+ if( it == rControls.end() )
+ rControls.insert( pHCntrl );
+ else
{
- sal_uInt16 nPos = 0;
- if( rControls.Seek_Entry(pHCntrl,&nPos) &&
- rControls[nPos]->xFormComps==xFormComps )
- rControls[nPos]->nCount++;
+ if( (*it)->xFormComps==xFormComps )
+ (*it)->nCount++;
delete pHCntrl;
}
}
@@ -1465,5 +1441,4 @@ HTMLControl::HTMLControl(
HTMLControl::~HTMLControl()
{}
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/filter/html/wrthtml.cxx b/sw/source/filter/html/wrthtml.cxx
index fcdf097..44e3c8e 100644
--- a/sw/source/filter/html/wrthtml.cxx
+++ b/sw/source/filter/html/wrthtml.cxx
@@ -381,8 +381,7 @@ sal_uLong SwHTMLWriter::WriteStream()
pHTMLPosFlyFrms = 0;
}
- if( aHTMLControls.Count() )
- aHTMLControls.DeleteAndDestroy( sal_uInt16(0), aHTMLControls.Count() );
+ aHTMLControls.DeleteAndDestroyAll();
if( !aChrFmtInfos.empty() )
aChrFmtInfos.clear();
diff --git a/sw/source/filter/html/wrthtml.hxx b/sw/source/filter/html/wrthtml.hxx
index 2b328e4..a4f14c7 100644
--- a/sw/source/filter/html/wrthtml.hxx
+++ b/sw/source/filter/html/wrthtml.hxx
@@ -35,9 +35,9 @@
#include <com/sun/star/container/XIndexContainer.hpp>
#include <com/sun/star/form/XForm.hpp>
#include <vcl/field.hxx>
-#include <svl/svstdarr.hxx>
#include <i18npool/lang.h>
#include <tools/stream.hxx>
+#include <o3tl/sorted_vector.hxx>
#include "shellio.hxx"
#include "wrt_fn.hxx"
@@ -191,8 +191,35 @@ const sal_uInt32 HTML_FRMOPTS_GENIMG =
#define CSS1_OUTMODE_SCRIPT ((sal_uInt16)(0x0007U << 11))
// der HTML-Writer
-struct HTMLControl;
-SV_DECL_PTRARR_SORT_DEL( HTMLControls, HTMLControl*, 1 )
+struct HTMLControl
+{
+ // die Form, zu der das Control gehoert
+ ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer > xFormComps;
+ sal_uLong nNdIdx; // der Node, in dem es verankert ist
+ xub_StrLen nCount; // wie viele Controls sind in dem Node
+
+ HTMLControl( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer > & rForm,
+ sal_uInt32 nIdx );
+ ~HTMLControl();
+
+ // operatoren fuer das Sort-Array
+ bool operator==( const HTMLControl& rCtrl ) const
+ {
+ return nNdIdx == rCtrl.nNdIdx;
+ }
+ bool operator<( const HTMLControl& rCtrl ) const
+ {
+ return nNdIdx < rCtrl.nNdIdx;
+ }
+};
+
+class HTMLControls : public o3tl::sorted_vector<HTMLControl*, o3tl::less_ptr_to<HTMLControl> > {
+public:
+ // will free any items still in the vector
+ ~HTMLControls() { DeleteAndDestroyAll(); }
+};
+
+
typedef std::vector<SwFmtINetFmt*> INetFmts;
struct SwHTMLFmtInfo
commit 637b9d4f825b9a96b042effa55f462bae9a0491d
Author: Noel Grandin <noel at peralex.com>
Date: Fri Jul 13 14:54:58 2012 +0200
Convert SV_DECL_PTRARR_SORT_DEL(SwWriteTableRows) to o3tl::sorted_vector
Change-Id: I1731eae553e1bc47cbb01d47622b047693a6a194
diff --git a/sw/source/filter/html/htmltabw.cxx b/sw/source/filter/html/htmltabw.cxx
index 241bd19..3b96dfc 100644
--- a/sw/source/filter/html/htmltabw.cxx
+++ b/sw/source/filter/html/htmltabw.cxx
@@ -589,9 +589,9 @@ void SwHTMLWrtTable::Write( SwHTMLWriter& rWrt, sal_Int16 eAlign,
// Wert fuer FRAME bestimmen
sal_uInt16 nFrameMask = 15;
- if( !(aRows[0])->bTopBorder )
+ if( !(aRows.front())->bTopBorder )
nFrameMask &= ~1;
- if( !(aRows[aRows.Count()-1])->bBottomBorder )
+ if( !(aRows.back())->bBottomBorder )
nFrameMask &= ~2;
if( !(aCols.front())->bLeftBorder )
nFrameMask &= ~4;
@@ -602,7 +602,7 @@ void SwHTMLWrtTable::Write( SwHTMLWriter& rWrt, sal_Int16 eAlign,
sal_Bool bRowsHaveBorder = sal_False;
sal_Bool bRowsHaveBorderOnly = sal_True;
SwWriteTableRow *pRow = aRows[0];
- for( nRow=1; nRow < aRows.Count(); nRow++ )
+ for( nRow=1; nRow < aRows.size(); nRow++ )
{
SwWriteTableRow *pNextRow = aRows[nRow];
sal_Bool bBorder = ( pRow->bBottomBorder || pNextRow->bTopBorder );
@@ -841,7 +841,7 @@ void SwHTMLWrtTable::Write( SwHTMLWriter& rWrt, sal_Int16 eAlign,
// Zeile nur ausgegeben werden, wenn unter der Zeile eine Linie ist
if( bTHead &&
(bTSections || bColGroups) &&
- nHeadEndRow<aRows.Count()-1 && !aRows[nHeadEndRow]->bBottomBorder )
+ nHeadEndRow<aRows.size()-1 && !aRows[nHeadEndRow]->bBottomBorder )
bTHead = sal_False;
// <TBODY> aus ausgeben, wenn <THEAD> ausgegeben wird.
@@ -856,12 +856,12 @@ void SwHTMLWrtTable::Write( SwHTMLWriter& rWrt, sal_Int16 eAlign,
rWrt.IncIndentLevel(); // Inhalt von <THEAD>/<TDATA> einr.
}
- for( nRow = 0; nRow < aRows.Count(); nRow++ )
+ for( nRow = 0; nRow < aRows.size(); nRow++ )
{
const SwWriteTableRow *pRow2 = aRows[nRow];
OutTableCells( rWrt, pRow2->GetCells(), pRow2->GetBackground() );
- if( !nCellSpacing && nRow < aRows.Count()-1 && pRow2->bBottomBorder &&
+ if( !nCellSpacing && nRow < aRows.size()-1 && pRow2->bBottomBorder &&
pRow2->nBottomBorder > DEF_LINE_WIDTH_1 )
{
sal_uInt16 nCnt = (pRow2->nBottomBorder / DEF_LINE_WIDTH_1) - 1;
@@ -876,7 +876,7 @@ void SwHTMLWrtTable::Write( SwHTMLWriter& rWrt, sal_Int16 eAlign,
}
if( ( (bTHead && nRow==nHeadEndRow) ||
(bTBody && pRow2->bBottomBorder) ) &&
- nRow < aRows.Count()-1 )
+ nRow < aRows.size()-1 )
{
rWrt.DecIndentLevel(); // Inhalt von <THEAD>/<TDATA> einr.
rWrt.OutNewLine(); // </THEAD>/</TDATA> in neue Zeile
diff --git a/sw/source/filter/inc/wrtswtbl.hxx b/sw/source/filter/inc/wrtswtbl.hxx
index 80198fb..fbb62f5 100644
--- a/sw/source/filter/inc/wrtswtbl.hxx
+++ b/sw/source/filter/inc/wrtswtbl.hxx
@@ -30,7 +30,6 @@
#include <tools/solar.h>
#include <tools/color.hxx>
-#include <svl/svarray.hxx>
#include <boost/ptr_container/ptr_vector.hpp>
#include <o3tl/sorted_vector.hxx>
@@ -173,8 +172,10 @@ inline int SwWriteTableRow::operator<( const SwWriteTableRow& rRow ) const
return nPos < rRow.nPos - (mbUseLayoutHeights ? 0 : ROWFUZZY);
}
-typedef SwWriteTableRow *SwWriteTableRowPtr;
-SV_DECL_PTRARR_SORT_DEL( SwWriteTableRows, SwWriteTableRowPtr, 5 )
+class SwWriteTableRows : public o3tl::sorted_vector<SwWriteTableRow*, o3tl::less_ptr_to<SwWriteTableRow> > {
+public:
+ ~SwWriteTableRows() { DeleteAndDestroyAll(); }
+};
//-----------------------------------------------------------------------
diff --git a/sw/source/filter/writer/wrtswtbl.cxx b/sw/source/filter/writer/wrtswtbl.cxx
index 699570a..d52ff11 100644
--- a/sw/source/filter/writer/wrtswtbl.cxx
+++ b/sw/source/filter/writer/wrtswtbl.cxx
@@ -41,8 +41,6 @@
using ::editeng::SvxBorderLine;
using namespace ::com::sun::star;
-SV_IMPL_OP_PTRARR_SORT( SwWriteTableRows, SwWriteTableRowPtr )
-
//-----------------------------------------------------------------------
sal_Int16 SwWriteTableCell::GetVertOri() const
@@ -269,7 +267,7 @@ sal_uInt16 SwWriteTable::MergeBoxBorders( const SwTableBox *pBox,
if( rBoxItem.GetBottom() )
{
nBorderMask |= 2;
- MergeBorders( rBoxItem.GetBottom(), nRow+nRowSpan==aRows.Count() );
+ MergeBorders( rBoxItem.GetBottom(), nRow+nRowSpan==aRows.size() );
rBottomBorder = rBoxItem.GetBottom()->GetOutWidth();
}
@@ -396,7 +394,7 @@ long SwWriteTable::GetAbsHeight( long nRawHeight, sal_uInt16 nRow,
}
// In der letzten Zeile noch die Liniendicke abziehen
- if( nRow+nRowSpan==aRows.Count() )
+ if( nRow+nRowSpan==aRows.size() )
{
if( !pRow || nRowSpan > 1 )
pRow = aRows[nRow+nRowSpan-1];
@@ -452,11 +450,8 @@ void SwWriteTable::CollectTableRowsCols( long nStartRPos,
nRPos += nLineHeight;
}
SwWriteTableRow *pRow = new SwWriteTableRow( nRPos, bUseLayoutHeights);
- sal_uInt16 nRow;
- if( aRows.Seek_Entry( pRow, &nRow ) )
+ if( !aRows.insert( pRow ).second )
delete pRow;
- else
- aRows.Insert( pRow );
}
else
{
@@ -465,9 +460,8 @@ void SwWriteTable::CollectTableRowsCols( long nStartRPos,
#endif
nRPos = nStartRPos + nParentLineHeight;
#if OSL_DEBUG_LEVEL > 0
- SwWriteTableRow aRow( nStartRPos + nParentLineHeight, bUseLayoutHeights );
- OSL_ENSURE( aRows.Seek_Entry(&aRow),
- "Parent-Zeile nicht gefunden" );
+ SwWriteTableRow aSrchRow( nRPos, bUseLayoutHeights );
+ OSL_ENSURE( aRows.find( &aSrchRow ) != aRows.end(), "Parent-Zeile nicht gefunden" );
SwWriteTableRow aRowCheckPos(nCheckPos,bUseLayoutHeights);
SwWriteTableRow aRowRPos(nRPos,bUseLayoutHeights);
OSL_ENSURE( !bUseLayoutHeights ||
@@ -584,10 +578,10 @@ void SwWriteTable::FillTableRowsCols( long nStartRPos, sal_uInt16 nStartRow,
// Und ihren Index
sal_uInt16 nOldRow = nRow;
- SwWriteTableRow aRow( nRPos,bUseLayoutHeights );
- bool const bFound = aRows.Seek_Entry( &aRow, &nRow );
- OSL_ENSURE( bFound, "missing row" );
- (void) bFound; // unused in non-debug
+ SwWriteTableRow aSrchRow( nRPos,bUseLayoutHeights );
+ SwWriteTableRows::const_iterator it2 = aRows.find( &aSrchRow );
+ OSL_ENSURE( it2 != aRows.end(), "missing row" );
+ nRow = it2 - aRows.begin();
OSL_ENSURE( nOldRow <= nRow, "Don't look back!" );
if( nOldRow > nRow )
@@ -818,7 +812,7 @@ SwWriteTable::SwWriteTable( const SwHTMLTableLayout *pLayoutInfo )
new SwWriteTableRow( (nRow+1)*ROW_DFLT_HEIGHT, bUseLayoutHeights );
pRow->nTopBorder = 0;
pRow->nBottomBorder = 0;
- aRows.Insert( pRow );
+ aRows.insert( pRow );
}
// Und jetzt mit leben fuellen
commit 4991bd87045fd2e3861512d768eaed323db871dc
Author: Noel Grandin <noel at peralex.com>
Date: Fri Jul 13 14:53:01 2012 +0200
Convert SV_DECL_PTRARR_SORT_DEL(SwWriteTableCols) to o3tl::sorted_vector
Change-Id: Id410727331d6b9dc599814dce15dc3d02037bc7b
diff --git a/sw/source/filter/html/htmltabw.cxx b/sw/source/filter/html/htmltabw.cxx
index 16ad4f2..241bd19 100644
--- a/sw/source/filter/html/htmltabw.cxx
+++ b/sw/source/filter/html/htmltabw.cxx
@@ -593,9 +593,9 @@ void SwHTMLWrtTable::Write( SwHTMLWriter& rWrt, sal_Int16 eAlign,
nFrameMask &= ~1;
if( !(aRows[aRows.Count()-1])->bBottomBorder )
nFrameMask &= ~2;
- if( !(aCols[0])->bLeftBorder )
+ if( !(aCols.front())->bLeftBorder )
nFrameMask &= ~4;
- if( !(aCols[aCols.Count()-1])->bRightBorder )
+ if( !(aCols.back())->bRightBorder )
nFrameMask &= ~8;
// Wert fur RULES bestimmen
@@ -626,7 +626,7 @@ void SwHTMLWrtTable::Write( SwHTMLWriter& rWrt, sal_Int16 eAlign,
sal_Bool bColsHaveBorderOnly = sal_True;
SwWriteTableCol *pCol = aCols[0];
sal_uInt16 nCol;
- for( nCol=1; nCol<aCols.Count(); nCol++ )
+ for( nCol=1; nCol<aCols.size(); nCol++ )
{
SwWriteTableCol *pNextCol = aCols[nCol];
sal_Bool bBorder = ( pCol->bRightBorder || pNextCol->bLeftBorder );
@@ -660,7 +660,7 @@ void SwHTMLWrtTable::Write( SwHTMLWriter& rWrt, sal_Int16 eAlign,
if( bColsOption )
{
sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_cols).
- append('=').append(static_cast<sal_Int32>(aCols.Count()));
+ append('=').append(static_cast<sal_Int32>(aCols.size()));
}
// ALIGN= ausgeben
@@ -763,7 +763,7 @@ void SwHTMLWrtTable::Write( SwHTMLWriter& rWrt, sal_Int16 eAlign,
HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OOO_STRING_SVTOOLS_HTML_caption, sal_False );
}
- sal_uInt16 nCols = aCols.Count();
+ sal_uInt16 nCols = aCols.size();
// <COLGRP>/<COL> ausgeben: Bei Export ueber Layout nur wenn beim
// Import welche da waren, sonst immer.
diff --git a/sw/source/filter/inc/wrtswtbl.hxx b/sw/source/filter/inc/wrtswtbl.hxx
index 9bdd4e5..80198fb 100644
--- a/sw/source/filter/inc/wrtswtbl.hxx
+++ b/sw/source/filter/inc/wrtswtbl.hxx
@@ -32,6 +32,7 @@
#include <tools/color.hxx>
#include <svl/svarray.hxx>
#include <boost/ptr_container/ptr_vector.hpp>
+#include <o3tl/sorted_vector.hxx>
#include <swdllapi.h>
@@ -230,8 +231,10 @@ inline int SwWriteTableCol::operator<( const SwWriteTableCol& rCol ) const
}
-typedef SwWriteTableCol *SwWriteTableColPtr;
-SV_DECL_PTRARR_SORT_DEL( SwWriteTableCols, SwWriteTableColPtr, 5 )
+class SwWriteTableCols : public o3tl::sorted_vector<SwWriteTableCol*, o3tl::less_ptr_to<SwWriteTableCol> > {
+public:
+ ~SwWriteTableCols() { DeleteAndDestroyAll(); }
+};
//-----------------------------------------------------------------------
diff --git a/sw/source/filter/writer/wrtswtbl.cxx b/sw/source/filter/writer/wrtswtbl.cxx
index c82eb77..699570a 100644
--- a/sw/source/filter/writer/wrtswtbl.cxx
+++ b/sw/source/filter/writer/wrtswtbl.cxx
@@ -42,7 +42,6 @@ using ::editeng::SvxBorderLine;
using namespace ::com::sun::star;
SV_IMPL_OP_PTRARR_SORT( SwWriteTableRows, SwWriteTableRowPtr )
-SV_IMPL_OP_PTRARR_SORT( SwWriteTableCols, SwWriteTableColPtr )
//-----------------------------------------------------------------------
@@ -277,7 +276,7 @@ sal_uInt16 SwWriteTable::MergeBoxBorders( const SwTableBox *pBox,
if( rBoxItem.GetRight() )
{
nBorderMask |= 8;
- MergeBorders( rBoxItem.GetRight(), nCol+nColSpan==aCols.Count() );
+ MergeBorders( rBoxItem.GetRight(), nCol+nColSpan==aCols.size() );
}
// If any distance is set, the smallest one is used. This holds for
@@ -335,7 +334,7 @@ sal_uInt16 SwWriteTable::GetRightSpace( sal_uInt16 nCol, sal_uInt16 nColSpan ) c
// In der letzten Spalte noch einmal zusaetzlich CELLSPACING und
// und die Liniendicke abziehen
- if( nCol+nColSpan==aCols.Count() )
+ if( nCol+nColSpan==aCols.size() )
{
nSpace += (nCellSpacing + nRightSub);
@@ -493,11 +492,8 @@ void SwWriteTable::CollectTableRowsCols( long nStartRPos,
nCPos = nCPos + GetBoxWidth( pBox );
SwWriteTableCol *pCol = new SwWriteTableCol( nCPos );
- sal_uInt16 nCol;
- if( aCols.Seek_Entry( pCol, &nCol ) )
+ if( !aCols.insert( pCol ).second )
delete pCol;
- else
- aCols.Insert( pCol );
if( nBox==nBoxes-1 )
{
@@ -522,9 +518,10 @@ void SwWriteTable::CollectTableRowsCols( long nStartRPos,
}
#endif
nCPos = nStartCPos + nParentLineWidth;
+
#if OSL_DEBUG_LEVEL > 0
- SwWriteTableCol aCol( nStartCPos + nParentLineWidth );
- OSL_ENSURE( aCols.Seek_Entry(&aCol),
+ SwWriteTableCol aSrchCol( nCPos );
+ OSL_ENSURE( aCols.find( &aSrchCol ) != aCols.end(),
"Parent-Zelle nicht gefunden" );
OSL_ENSURE( SwWriteTableCol(nCheckPos) ==
SwWriteTableCol(nCPos),
@@ -629,10 +626,8 @@ void SwWriteTable::FillTableRowsCols( long nStartRPos, sal_uInt16 nStartRow,
sal_Bool bOutAtRow = !nParentLineWidth;
if( !bOutAtRow && nStartCPos==0 )
{
- sal_uInt16 nEndCol;
SwWriteTableCol aCol( nParentLineWidth );
- bOutAtRow = aCols.Seek_Entry(&aCol,&nEndCol) &&
- nEndCol == aCols.Count()-1;
+ bOutAtRow = aCols.find( &aCol ) == (aCols.end() - 1);
}
if( bOutAtRow )
{
@@ -669,10 +664,10 @@ void SwWriteTable::FillTableRowsCols( long nStartRPos, sal_uInt16 nStartRow,
// Und ihren Index
sal_uInt16 nOldCol = nCol;
- SwWriteTableCol aCol( nCPos );
- bool const bFound2 = aCols.Seek_Entry( &aCol, &nCol );
- OSL_ENSURE( bFound2, "missing column" );
- (void) bFound2; // unused in non-debug
+ SwWriteTableCol aSrchCol( nCPos );
+ SwWriteTableCols::const_iterator it = aCols.find( &aSrchCol );
+ OSL_ENSURE( it != aCols.end(), "missing column" );
+ nCol = it - aCols.begin();
if( !ShouldExpandSub( pBox, bSubExpanded, nDepth ) )
{
@@ -700,7 +695,7 @@ void SwWriteTable::FillTableRowsCols( long nStartRPos, sal_uInt16 nStartRow,
// #i30094# add a sanity check here to ensure that
// we don't access an invalid aCols[] as &nCol
// above can be changed.
- if (!(nBorderMask & 4) && nOldCol < aCols.Count())
+ if (!(nBorderMask & 4) && nOldCol < aCols.size())
{
SwWriteTableCol *pCol = aCols[nOldCol];
OSL_ENSURE(pCol, "No TableCol found, panic!");
@@ -766,7 +761,7 @@ SwWriteTable::SwWriteTable(const SwTableLines& rLines, long nWidth,
// Erstmal die Tabellen-Struktur festlegen. Hinter der Tabelle ist in
// jedem Fall eine Spalte zu Ende
SwWriteTableCol *pCol = new SwWriteTableCol( nParentWidth );
- aCols.Insert( pCol );
+ aCols.insert( pCol );
CollectTableRowsCols( 0, 0, 0, nParentWidth, rLines, nMaxDepth - 1 );
// Und jetzt mit leben fuellen
@@ -814,7 +809,7 @@ SwWriteTable::SwWriteTable( const SwHTMLTableLayout *pLayoutInfo )
pLayoutCol->IsRelWidthOption() );
}
- aCols.Insert( pCol );
+ aCols.insert( pCol );
}
for( nRow=0; nRow<nRows; nRow++ )
commit c516b333872adb08f45bc48fba2a2e97e22586e7
Author: Noel Grandin <noel at peralex.com>
Date: Fri Jul 13 14:50:52 2012 +0200
Convert SV_DECL_PTRARR_SORT_DEL(SwXMLTableColumns_Impl) to o3tl::sorted_vector
Change-Id: Idd06aaa1a01a1f3ca17e23ae703549105f2d9669
diff --git a/sw/source/filter/xml/xmltble.cxx b/sw/source/filter/xml/xmltble.cxx
index 2763c97..db5ff9c 100644
--- a/sw/source/filter/xml/xmltble.cxx
+++ b/sw/source/filter/xml/xmltble.cxx
@@ -60,6 +60,7 @@
#include "xmltexte.hxx"
#include "xmlexp.hxx"
#include <boost/foreach.hpp>
+#include <o3tl/sorted_vector.hxx>
using ::rtl::OUString;
using ::rtl::OUStringBuffer;
@@ -105,9 +106,10 @@ sal_Int32 SwXMLTableColumnCmpWidth_Impl( const SwXMLTableColumn_Impl& r1,
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list