[Libreoffice-commits] .: 41 commits - sw/source

Michael Stahl mst at kemper.freedesktop.org
Wed May 9 00:29:01 PDT 2012


 sw/source/core/doc/doctxm.cxx                |   42 ++---
 sw/source/core/doc/tblrwcl.cxx               |   20 +-
 sw/source/core/fields/authfld.cxx            |   18 +-
 sw/source/core/fields/reffld.cxx             |   11 -
 sw/source/core/inc/UndoSort.hxx              |    5 
 sw/source/core/inc/doctxm.hxx                |    4 
 sw/source/core/inc/noteurl.hxx               |    8 -
 sw/source/core/inc/tblrwcl.hxx               |    2 
 sw/source/core/layout/laycache.cxx           |    4 
 sw/source/core/layout/layhelp.hxx            |    7 
 sw/source/core/text/noteurl.cxx              |    8 -
 sw/source/core/txtnode/ndtxt.cxx             |   43 ++---
 sw/source/core/undo/unnum.cxx                |    4 
 sw/source/core/undo/unsort.cxx               |   51 +++---
 sw/source/core/undo/untbl.cxx                |   88 +++++------
 sw/source/core/unocore/unofield.cxx          |   14 -
 sw/source/core/unocore/unosett.cxx           |   73 ++++-----
 sw/source/filter/html/htmlatr.cxx            |  171 +++++++--------------
 sw/source/filter/html/htmlcss1.cxx           |   16 +-
 sw/source/filter/html/htmlctxt.cxx           |   53 +++---
 sw/source/filter/html/htmlfld.cxx            |    2 
 sw/source/filter/html/htmlfly.cxx            |   10 -
 sw/source/filter/html/htmlftn.cxx            |   15 -
 sw/source/filter/html/htmlgrin.cxx           |   16 --
 sw/source/filter/html/htmlnum.cxx            |    4 
 sw/source/filter/html/htmlsect.cxx           |    8 -
 sw/source/filter/html/htmltab.cxx            |  214 ++++++++++++---------------
 sw/source/filter/html/htmltabw.cxx           |   10 -
 sw/source/filter/html/swhtml.cxx             |  208 ++++++++++++++------------
 sw/source/filter/html/swhtml.hxx             |   22 +-
 sw/source/filter/html/wrthtml.cxx            |    8 -
 sw/source/filter/html/wrthtml.hxx            |   56 ++++++-
 sw/source/filter/inc/wrtswtbl.hxx            |    4 
 sw/source/filter/rtf/rtftbl.cxx              |   21 +-
 sw/source/filter/writer/wrtswtbl.cxx         |    3 
 sw/source/filter/ww8/docxattributeoutput.cxx |    4 
 sw/source/filter/ww8/rtfattributeoutput.cxx  |   10 -
 sw/source/filter/ww8/wrtww8.cxx              |   33 +---
 sw/source/filter/ww8/wrtww8.hxx              |    4 
 sw/source/filter/xml/xmlfmt.cxx              |   13 -
 sw/source/filter/xml/xmltbli.cxx             |  124 ++++++++-------
 sw/source/filter/xml/xmltbli.hxx             |    7 
 42 files changed, 712 insertions(+), 726 deletions(-)

New commits:
commit fb5f61de5d770f4e34da6ac5d034f3a3fc9b4c24
Author: Noel Grandin <noel at peralex.com>
Date:   Thu Apr 26 18:27:44 2012 +0200

    Convert SV_DECL_PTRARR_DEL(_RefIdsMaps) to boost::ptr_vector

diff --git a/sw/source/core/fields/reffld.cxx b/sw/source/core/fields/reffld.cxx
index c110429..857bd2c 100644
--- a/sw/source/core/fields/reffld.cxx
+++ b/sw/source/core/fields/reffld.cxx
@@ -928,8 +928,7 @@ public:
     String GetName() { return aName; }
 };
 
-SV_DECL_PTRARR_DEL( _RefIdsMaps, _RefIdsMap*, 5 )
-SV_IMPL_PTRARR( _RefIdsMaps, _RefIdsMap* )
+typedef boost::ptr_vector<_RefIdsMap> _RefIdsMaps;
 
 /// Get a sorted list of the field IDs from a document.
 /// @param[in]     rDoc The document to search.
@@ -1091,18 +1090,18 @@ void SwGetRefFieldType::MergeWithOtherDoc( SwDoc& rDestDoc )
             case REF_SEQUENCEFLD:
                 {
                     _RefIdsMap* pMap = 0;
-                    for( sal_uInt16 n = aFldMap.Count(); n; )
+                    for( sal_uInt16 n = aFldMap.size(); n; )
                     {
-                        if( aFldMap[ --n ]->GetName().Equals(rRefFld.GetSetRefName()) )
+                        if( aFldMap[ --n ].GetName().Equals(rRefFld.GetSetRefName()) )
                         {
-                            pMap = aFldMap[ n ];
+                            pMap = &aFldMap[ n ];
                             break;
                         }
                     }
                     if( !pMap )
                     {
                         pMap = new _RefIdsMap( rRefFld.GetSetRefName() );
-                        aFldMap.C40_INSERT( _RefIdsMap, pMap, aFldMap.Count() );
+                        aFldMap.push_back( pMap );
                     }
 
                     pMap->Check( *pDoc, rDestDoc, rRefFld, sal_True );
commit 2d7e993f6a3acd01c5287497196565b8555416e6
Author: Michael Stahl <mstahl at redhat.com>
Date:   Tue May 8 19:32:50 2012 +0200

    fix std::vector::vector(size_t) in previous commit

diff --git a/sw/source/core/undo/unsort.cxx b/sw/source/core/undo/unsort.cxx
index 3d885d3..8712383 100644
--- a/sw/source/core/undo/unsort.cxx
+++ b/sw/source/core/undo/unsort.cxx
@@ -139,7 +139,7 @@ void SwUndoSort::UndoImpl(::sw::UndoRedoContext & rContext)
         // fuer die sorted Positions einen Index anlegen.
         // JP 25.11.97: Die IndexList muss aber nach SourcePosition
         //              aufsteigend sortiert aufgebaut werden
-        SwUndoSortList aIdxList( (sal_uInt8)aSortList.size() );
+        SwUndoSortList aIdxList;
         sal_uInt16 i;
 
         for( i = 0; i < aSortList.size(); ++i)
@@ -218,7 +218,7 @@ void SwUndoSort::RedoImpl(::sw::UndoRedoContext & rContext)
         SetPaM(rPam);
         RemoveIdxFromRange(rPam, true);
 
-        SwUndoSortList aIdxList( (sal_uInt8)aSortList.size() );
+        SwUndoSortList aIdxList;
         sal_uInt16 i;
 
         for( i = 0; i < aSortList.size(); ++i)
commit a56c8a0dc2ed44d76b1d9a0de6307cf968796b9f
Author: Noel Grandin <noel at peralex.com>
Date:   Thu Apr 26 18:02:23 2012 +0200

    Convert SV_DECL_PTRARR_DEL(SwSortList) to boost::ptr_vector

diff --git a/sw/source/core/inc/UndoSort.hxx b/sw/source/core/inc/UndoSort.hxx
index 9591db6..5ec6d19 100644
--- a/sw/source/core/inc/UndoSort.hxx
+++ b/sw/source/core/inc/UndoSort.hxx
@@ -30,6 +30,7 @@
 #define SW_UNDO_SORT_HXX
 
 #include <undobj.hxx>
+#include <boost/ptr_container/ptr_vector.hpp>
 
 
 struct SwSortOptions;
@@ -67,7 +68,7 @@ struct SwSortUndoElement
     ~SwSortUndoElement();
 };
 
-SV_DECL_PTRARR_DEL(SwSortList, SwSortUndoElement*, 10)
+typedef boost::ptr_vector<SwSortUndoElement> SwSortList;
 typedef std::vector<SwNodeIndex*> SwUndoSortList;
 
 class SwUndoSort : public SwUndo, private SwUndRng
diff --git a/sw/source/core/undo/unsort.cxx b/sw/source/core/undo/unsort.cxx
index 23bfa34..3d885d3 100644
--- a/sw/source/core/undo/unsort.cxx
+++ b/sw/source/core/undo/unsort.cxx
@@ -47,8 +47,6 @@
  --------------------------------------------------------------------*/
 
 
-SV_IMPL_PTRARR(SwSortList, SwSortUndoElement*)
-
 
 SwSortUndoElement::~SwSortUndoElement()
 {
@@ -111,12 +109,12 @@ void SwUndoSort::UndoImpl(::sw::UndoRedoContext & rContext)
         const SwTable& rTbl = pTblNd->GetTable();
 
         SwMovedBoxes aMovedList;
-        for( sal_uInt16 i=0; i < aSortList.Count(); i++)
+        for( sal_uInt16 i=0; i < aSortList.size(); i++)
         {
             const SwTableBox* pSource = rTbl.GetTblBox(
-                    *aSortList[i]->SORT_TXT_TBL.TBL.pSource );
+                    *aSortList[i].SORT_TXT_TBL.TBL.pSource );
             const SwTableBox* pTarget = rTbl.GetTblBox(
-                    *aSortList[i]->SORT_TXT_TBL.TBL.pTarget );
+                    *aSortList[i].SORT_TXT_TBL.TBL.pTarget );
 
             // zurueckverschieben
             MoveCell(&rDoc, pTarget, pSource,
@@ -141,20 +139,20 @@ void SwUndoSort::UndoImpl(::sw::UndoRedoContext & rContext)
         // fuer die sorted Positions einen Index anlegen.
         // JP 25.11.97: Die IndexList muss aber nach SourcePosition
         //              aufsteigend sortiert aufgebaut werden
-        SwUndoSortList aIdxList( (sal_uInt8)aSortList.Count() );
+        SwUndoSortList aIdxList( (sal_uInt8)aSortList.size() );
         sal_uInt16 i;
 
-        for( i = 0; i < aSortList.Count(); ++i)
-            for( sal_uInt16 ii=0; ii < aSortList.Count(); ++ii )
-                if( aSortList[ii]->SORT_TXT_TBL.TXT.nSource == nSttNode + i )
+        for( i = 0; i < aSortList.size(); ++i)
+            for( sal_uInt16 ii=0; ii < aSortList.size(); ++ii )
+                if( aSortList[ii].SORT_TXT_TBL.TXT.nSource == nSttNode + i )
                 {
                     SwNodeIndex* pIdx = new SwNodeIndex( rDoc.GetNodes(),
-                        aSortList[ii]->SORT_TXT_TBL.TXT.nTarget );
+                        aSortList[ii].SORT_TXT_TBL.TXT.nTarget );
                     aIdxList.insert( aIdxList.begin() + i, pIdx );
                     break;
                 }
 
-        for(i=0; i < aSortList.Count(); ++i)
+        for(i=0; i < aSortList.size(); ++i)
         {
             SwNodeIndex aIdx( rDoc.GetNodes(), nSttNode + i );
             SwNodeRange aRg( *aIdxList[i], 0, *aIdxList[i], 1 );
@@ -188,12 +186,12 @@ void SwUndoSort::RedoImpl(::sw::UndoRedoContext & rContext)
         const SwTable& rTbl = pTblNd->GetTable();
 
         SwMovedBoxes aMovedList;
-        for(sal_uInt16 i=0; i < aSortList.Count(); ++i)
+        for(sal_uInt16 i=0; i < aSortList.size(); ++i)
         {
             const SwTableBox* pSource = rTbl.GetTblBox(
-                    (const String&) *aSortList[i]->SORT_TXT_TBL.TBL.pSource );
+                    (const String&) *aSortList[i].SORT_TXT_TBL.TBL.pSource );
             const SwTableBox* pTarget = rTbl.GetTblBox(
-                    (const String&) *aSortList[i]->SORT_TXT_TBL.TBL.pTarget );
+                    (const String&) *aSortList[i].SORT_TXT_TBL.TBL.pTarget );
 
             // zurueckverschieben
             MoveCell(&rDoc, pSource, pTarget,
@@ -220,17 +218,17 @@ void SwUndoSort::RedoImpl(::sw::UndoRedoContext & rContext)
         SetPaM(rPam);
         RemoveIdxFromRange(rPam, true);
 
-        SwUndoSortList aIdxList( (sal_uInt8)aSortList.Count() );
+        SwUndoSortList aIdxList( (sal_uInt8)aSortList.size() );
         sal_uInt16 i;
 
-        for( i = 0; i < aSortList.Count(); ++i)
+        for( i = 0; i < aSortList.size(); ++i)
         {   // aktuelle Pos ist die Ausgangslage
             SwNodeIndex* pIdx = new SwNodeIndex( rDoc.GetNodes(),
-                    aSortList[i]->SORT_TXT_TBL.TXT.nSource);
+                    aSortList[i].SORT_TXT_TBL.TXT.nSource);
             aIdxList.insert( aIdxList.begin() + i, pIdx );
         }
 
-        for(i=0; i < aSortList.Count(); ++i)
+        for(i=0; i < aSortList.size(); ++i)
         {
             SwNodeIndex aIdx( rDoc.GetNodes(), nSttNode + i);
             SwNodeRange aRg( *aIdxList[i], 0, *aIdxList[i], 1 );
@@ -266,13 +264,13 @@ void SwUndoSort::RepeatImpl(::sw::RepeatContext & rContext)
 void SwUndoSort::Insert( const String& rOrgPos, const String& rNewPos)
 {
     SwSortUndoElement* pEle = new SwSortUndoElement(rOrgPos, rNewPos);
-    aSortList.C40_INSERT( SwSortUndoElement, pEle, aSortList.Count() );
+    aSortList.push_back( pEle );
 }
 
 void SwUndoSort::Insert( sal_uLong nOrgPos, sal_uLong nNewPos)
 {
     SwSortUndoElement* pEle = new SwSortUndoElement(nOrgPos, nNewPos);
-    aSortList.C40_INSERT( SwSortUndoElement, pEle, aSortList.Count() );
+    aSortList.push_back( pEle );
 }
 
 
commit 25d018c0382625c424b80b124c9a8c39c28c2afc
Author: Noel Grandin <noel at peralex.com>
Date:   Thu Apr 26 17:40:06 2012 +0200

    Convert SV_DECL_PTRARR(SwUndoSortList) to std::vector

diff --git a/sw/source/core/inc/UndoSort.hxx b/sw/source/core/inc/UndoSort.hxx
index 0340747..9591db6 100644
--- a/sw/source/core/inc/UndoSort.hxx
+++ b/sw/source/core/inc/UndoSort.hxx
@@ -68,7 +68,7 @@ struct SwSortUndoElement
 };
 
 SV_DECL_PTRARR_DEL(SwSortList, SwSortUndoElement*, 10)
-SV_DECL_PTRARR(SwUndoSortList, SwNodeIndex*, 10)
+typedef std::vector<SwNodeIndex*> SwUndoSortList;
 
 class SwUndoSort : public SwUndo, private SwUndRng
 {
diff --git a/sw/source/core/undo/unsort.cxx b/sw/source/core/undo/unsort.cxx
index b75b051..23bfa34 100644
--- a/sw/source/core/undo/unsort.cxx
+++ b/sw/source/core/undo/unsort.cxx
@@ -48,7 +48,6 @@
 
 
 SV_IMPL_PTRARR(SwSortList, SwSortUndoElement*)
-SV_IMPL_PTRARR(SwUndoSortList, SwNodeIndex*)
 
 
 SwSortUndoElement::~SwSortUndoElement()
@@ -151,7 +150,7 @@ void SwUndoSort::UndoImpl(::sw::UndoRedoContext & rContext)
                 {
                     SwNodeIndex* pIdx = new SwNodeIndex( rDoc.GetNodes(),
                         aSortList[ii]->SORT_TXT_TBL.TXT.nTarget );
-                    aIdxList.C40_INSERT(SwNodeIndex, pIdx, i );
+                    aIdxList.insert( aIdxList.begin() + i, pIdx );
                     break;
                 }
 
@@ -163,7 +162,9 @@ void SwUndoSort::UndoImpl(::sw::UndoRedoContext & rContext)
                 IDocumentContentOperations::DOC_MOVEDEFAULT);
         }
         // Indixes loeschen
-        aIdxList.DeleteAndDestroy(0, aIdxList.Count());
+        for(SwUndoSortList::const_iterator it = aIdxList.begin(); it != aIdxList.end(); ++it)
+            delete *it;
+        aIdxList.clear();
         SetPaM(rPam, true);
     }
 }
@@ -226,7 +227,7 @@ void SwUndoSort::RedoImpl(::sw::UndoRedoContext & rContext)
         {   // aktuelle Pos ist die Ausgangslage
             SwNodeIndex* pIdx = new SwNodeIndex( rDoc.GetNodes(),
                     aSortList[i]->SORT_TXT_TBL.TXT.nSource);
-            aIdxList.C40_INSERT( SwNodeIndex, pIdx, i );
+            aIdxList.insert( aIdxList.begin() + i, pIdx );
         }
 
         for(i=0; i < aSortList.Count(); ++i)
@@ -237,7 +238,9 @@ void SwUndoSort::RedoImpl(::sw::UndoRedoContext & rContext)
                 IDocumentContentOperations::DOC_MOVEDEFAULT);
         }
         // Indixes loeschen
-        aIdxList.DeleteAndDestroy(0, aIdxList.Count());
+        for(SwUndoSortList::const_iterator it = aIdxList.begin(); it != aIdxList.end(); ++it)
+            delete *it;
+        aIdxList.clear();
         SetPaM(rPam, true);
         SwTxtNode const*const pTNd = rPam.GetNode()->GetTxtNode();
         if( pTNd )
commit de4d4eb650358f14022389dabe975deffed1b96b
Author: Noel Grandin <noel at peralex.com>
Date:   Thu Apr 26 15:05:20 2012 +0200

    Convert SV_DECL_PTRARR(SwTOXSortTabBases) to std::vector

diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx
index c8dd379..8244b2d 100644
--- a/sw/source/core/doc/doctxm.cxx
+++ b/sw/source/core/doc/doctxm.cxx
@@ -80,8 +80,6 @@ const sal_Unicode cNumRepl      = '@';
 const sal_Unicode cEndPageNum   = '~';
 const sal_Char sPageDeli[] = ", ";
 
-SV_IMPL_PTRARR(SwTOXSortTabBases, SwTOXSortTabBasePtr)
-
 TYPEINIT2( SwTOXBaseSection, SwTOXBase, SwSection );    // for RTTI
 
 struct LinkStruct
@@ -845,7 +843,9 @@ void SwTOXBaseSection::Update(const SfxItemSet* pAttr,
                                GetOptions() : 0,
                                GetSortAlgorithm() );
 
-    aSortArr.DeleteAndDestroy( 0, aSortArr.Count() );
+    for (SwTOXSortTabBases::const_iterator it = aSortArr.begin(); it != aSortArr.end(); ++it)
+        delete *it;
+    aSortArr.clear();
 
     // find the first layout node for this TOX, if it only find the content
     // in his own chapter
@@ -964,7 +964,7 @@ void SwTOXBaseSection::Update(const SfxItemSet* pAttr,
     }
 
     SwNodeIndex aInsPos( *pFirstEmptyNd, 1 );
-    for( nCnt = 0; nCnt < aSortArr.Count(); ++nCnt )
+    for( nCnt = 0; nCnt < aSortArr.size(); ++nCnt )
     {
         ::SetProgressState( 0, pDoc->GetDocShell() );
 
@@ -995,7 +995,7 @@ void SwTOXBaseSection::Update(const SfxItemSet* pAttr,
             const String sPrimKey = rMark.GetPrimaryKey();
             const String sSecKey = rMark.GetSecondaryKey();
             const SwTOXMark* pNextMark = 0;
-            while(aSortArr.Count() > (nCnt + nRange)&&
+            while(aSortArr.size() > (nCnt + nRange)&&
                     aSortArr[nCnt + nRange]->GetType() == TOX_SORT_INDEX &&
                     0 != (pNextMark = &(aSortArr[nCnt + nRange]->pTxtMark->GetTOXMark())) &&
                     pNextMark->GetPrimaryKey() == sPrimKey &&
@@ -1055,7 +1055,7 @@ void SwTOXBaseSection::InsertAlphaDelimitter( const SwTOXInternational& rIntl )
     SwDoc* pDoc = (SwDoc*)GetFmt()->GetDoc();
     String sDeli, sLastDeli;
     sal_uInt16  i = 0;
-    while( i < aSortArr.Count() )
+    while( i < aSortArr.size() )
     {
         ::SetProgressState( 0, pDoc->GetDocShell() );
 
@@ -1079,7 +1079,8 @@ void SwTOXBaseSection::InsertAlphaDelimitter( const SwTOXInternational& rIntl )
             {
                 SwTOXCustom* pCst = new SwTOXCustom( sDeli, aEmptyStr, FORM_ALPHA_DELIMITTER,
                                                      rIntl, aSortArr[i]->GetLocale() );
-                aSortArr.Insert( pCst, i++ );
+                aSortArr.insert( aSortArr.begin() + i, pCst);
+                i++;
             }
             sLastDeli = sDeli;
         }
@@ -1087,7 +1088,7 @@ void SwTOXBaseSection::InsertAlphaDelimitter( const SwTOXInternational& rIntl )
         // Skip until we get to the same or a lower Level
         do {
             i++;
-        } while (i < aSortArr.Count() && aSortArr[i]->GetLevel() > nLevel);
+        } while (i < aSortArr.size() && aSortArr[i]->GetLevel() > nLevel);
     }
 }
 
@@ -1864,7 +1865,7 @@ void SwTOXBaseSection::GenerateText( sal_uInt16 nArrayIdx,
  --------------------------------------------------------------------*/
 void SwTOXBaseSection::UpdatePageNum()
 {
-    if( !aSortArr.Count() )
+    if( aSortArr.empty() )
         return ;
 
     // Insert the current PageNumber into the TOC
@@ -1877,7 +1878,7 @@ void SwTOXBaseSection::UpdatePageNum()
                               GetOptions() : 0,
                               GetSortAlgorithm() );
 
-    for( sal_uInt16 nCnt = 0; nCnt < aSortArr.Count(); ++nCnt )
+    for( sal_uInt16 nCnt = 0; nCnt < aSortArr.size(); ++nCnt )
     {
         // Loop over all SourceNodes
         std::vector<sal_uInt16> aNums; // the PageNumber
@@ -1893,7 +1894,7 @@ void SwTOXBaseSection::UpdatePageNum()
             const String sPrimKey = rMark.GetPrimaryKey();
             const String sSecKey = rMark.GetSecondaryKey();
             const SwTOXMark* pNextMark = 0;
-            while(aSortArr.Count() > (nCnt + nRange)&&
+            while(aSortArr.size() > (nCnt + nRange)&&
                     aSortArr[nCnt + nRange]->GetType() == TOX_SORT_INDEX &&
                     0 != (pNextMark = &(aSortArr[nCnt + nRange]->pTxtMark->GetTOXMark())) &&
                     pNextMark->GetPrimaryKey() == sPrimKey &&
@@ -1969,7 +1970,9 @@ void SwTOXBaseSection::UpdatePageNum()
         }
     }
     // Delete the mapping array after setting the right PageNumber
-    aSortArr.DeleteAndDestroy( 0, aSortArr.Count() );
+    for (SwTOXSortTabBases::const_iterator it = aSortArr.begin(); it != aSortArr.end(); ++it)
+        delete *it;
+    aSortArr.clear();
 }
 
 /*--------------------------------------------------------------------
@@ -2156,7 +2159,7 @@ void SwTOXBaseSection::_UpdatePageNum( SwTxtNode* pNd,
  --------------------------------------------------------------------*/
 void SwTOXBaseSection::InsertSorted(SwTOXSortTabBase* pNew)
 {
-    Range aRange(0, aSortArr.Count());
+    Range aRange(0, aSortArr.size());
     if( TOX_INDEX == SwTOXBase::GetType() && pNew->pTxtMark )
     {
         const SwTOXMark& rMark = pNew->pTxtMark->GetTOXMark();
@@ -2191,7 +2194,8 @@ void SwTOXBaseSection::InsertSorted(SwTOXSortTabBase* pNew)
                 else
                 {
                     // remove the old content
-                    aSortArr.DeleteAndDestroy( i, 1 );
+                    delete aSortArr[i];
+                    aSortArr.erase( aSortArr.begin() + i );
                     aRange.Max()--;
                     break;
                 }
@@ -2216,7 +2220,7 @@ void SwTOXBaseSection::InsertSorted(SwTOXSortTabBase* pNew)
 
                 if(!(pNew->GetOptions() & nsSwTOIOptions::TOI_SAME_ENTRY))
                 {   // Own entry
-                    aSortArr.Insert(pNew, i );
+                    aSortArr.insert(aSortArr.begin() + i, pNew);
                     return;
                 }
                 // If the own entry is already present, add it to the references list
@@ -2239,7 +2243,7 @@ void SwTOXBaseSection::InsertSorted(SwTOXSortTabBase* pNew)
         i++;
 
     // Insert at position i
-    aSortArr.Insert(pNew, i );
+    aSortArr.insert(aSortArr.begin()+i, pNew);
 }
 
 /*--------------------------------------------------------------------
@@ -2287,13 +2291,13 @@ Range SwTOXBaseSection::GetKeyRange(const String& rStr, const String& rStrReadin
             if(nLevel == aSortArr[i]->GetLevel() &&  *pKey < *(aSortArr[i]))
                 break;
         }
-        aSortArr.Insert(pKey, i );
+        aSortArr.insert(aSortArr.begin() + i, pKey);
     }
     sal_uInt16 nStart = i+1;
-    sal_uInt16 nEnd   = aSortArr.Count();
+    sal_uInt16 nEnd   = aSortArr.size();
 
     // Find end of range
-    for(i = nStart; i < aSortArr.Count(); ++i)
+    for(i = nStart; i < aSortArr.size(); ++i)
     {
         if(aSortArr[i]->GetLevel() <= nLevel)
         {   nEnd = i;
diff --git a/sw/source/core/fields/authfld.cxx b/sw/source/core/fields/authfld.cxx
index 7c06cff..c85759d 100644
--- a/sw/source/core/fields/authfld.cxx
+++ b/sw/source/core/fields/authfld.cxx
@@ -339,7 +339,7 @@ sal_uInt16  SwAuthorityFieldType::GetSequencePos(long nHandle)
                 SwTOXAuthority* pNew = new SwTOXAuthority( *pTxtNode,
                                                             *pFmtFld, aIntl );
 
-                for(short i = 0; i < aSortArr.Count(); ++i)
+                for(short i = 0; i < (short)aSortArr.size(); ++i)
                 {
                     SwTOXSortTabBase* pOld = aSortArr[i];
                     if(*pOld == *pNew)
@@ -349,7 +349,11 @@ sal_uInt16  SwAuthorityFieldType::GetSequencePos(long nHandle)
                         if(*pOld < *pNew)
                             DELETEZ(pNew);
                         else // remove the old content
-                            aSortArr.DeleteAndDestroy( i, 1 );
+                        {
+                            for (SwTOXSortTabBases::const_iterator it = aSortArr.begin(); it != aSortArr.end(); ++it)
+                                delete *it;
+                            aSortArr.clear();
+                        }
                         break;
                     }
                 }
@@ -358,25 +362,27 @@ sal_uInt16  SwAuthorityFieldType::GetSequencePos(long nHandle)
                 {
                     short j;
 
-                    for( j = 0; j < aSortArr.Count(); ++j)
+                    for( j = 0; j < (short)aSortArr.size(); ++j)
                     {
                         SwTOXSortTabBase* pOld = aSortArr[j];
                         if(*pNew < *pOld)
                             break;
                     }
-                    aSortArr.Insert(pNew, j );
+                    aSortArr.insert(aSortArr.begin() + j, pNew);
                 }
             }
         }
 
-        for(sal_uInt16 i = 0; i < aSortArr.Count(); i++)
+        for(sal_uInt16 i = 0; i < aSortArr.size(); i++)
         {
             const SwTOXSortTabBase& rBase = *aSortArr[i];
             SwFmtFld& rFmtFld = ((SwTOXAuthority&)rBase).GetFldFmt();
             SwAuthorityField* pAFld = (SwAuthorityField*)rFmtFld.GetFld();
             m_SequArr.push_back(pAFld->GetHandle());
         }
-        aSortArr.DeleteAndDestroy(0, aSortArr.Count());
+        for (SwTOXSortTabBases::const_iterator it = aSortArr.begin(); it != aSortArr.end(); ++it)
+            delete *it;
+        aSortArr.clear();
     }
     //find nHandle
     sal_uInt16 nRet = 0;
diff --git a/sw/source/core/inc/doctxm.hxx b/sw/source/core/inc/doctxm.hxx
index 5b57925..0308de7 100644
--- a/sw/source/core/inc/doctxm.hxx
+++ b/sw/source/core/inc/doctxm.hxx
@@ -41,9 +41,7 @@ class  SwTxtFmtColl;
 struct SwPosition;
 struct SwTOXSortTabBase;
 
-typedef SwTOXSortTabBase* SwTOXSortTabBasePtr;
-
-SV_DECL_PTRARR(SwTOXSortTabBases, SwTOXSortTabBasePtr, 0)
+typedef std::vector<SwTOXSortTabBase*> SwTOXSortTabBases;
 
 /*--------------------------------------------------------------------
      Beschreibung: Ring der speziellen Verzeichnisse
commit b9d7b38ff260b227a70b8298c8c4956d48b8fa11
Author: Noel Grandin <noel at peralex.com>
Date:   Thu Apr 26 14:04:59 2012 +0200

    Convert SV_DECL_PTRARR_DEL(SwURLNoteList) to boost::ptr_vector

diff --git a/sw/source/core/inc/noteurl.hxx b/sw/source/core/inc/noteurl.hxx
index 095c63e..00fbaaa 100644
--- a/sw/source/core/inc/noteurl.hxx
+++ b/sw/source/core/inc/noteurl.hxx
@@ -33,6 +33,7 @@
 #include <svl/svarray.hxx>
 #include <tools/string.hxx>
 #include "swrect.hxx"
+#include <boost/ptr_container/ptr_vector.hpp>
 
 class ImageMap;
 class MapMode;
@@ -53,19 +54,18 @@ public:
     { return aRect == rSwURLNote.aRect; }
 };
 
-typedef SwURLNote* SwURLNotePtr;
-SV_DECL_PTRARR_DEL(SwURLNoteList, SwURLNotePtr, 0)
+typedef boost::ptr_vector<SwURLNote> SwURLNoteList;
 
 class SwNoteURL
 {
     SwURLNoteList aList;
 public:
     SwNoteURL() {}
-    sal_uInt16 Count() const { return aList.Count(); }
+    sal_uInt16 Count() const { return aList.size(); }
     void InsertURLNote( const String& rURL, const String& rTarget,
                  const SwRect& rRect );
     const SwURLNote& GetURLNote( sal_uInt16 nPos ) const
-        { return *aList.GetObject( nPos ); }
+        { return aList[ nPos ]; }
     void FillImageMap( ImageMap* pMap, const Point& rPos, const MapMode& rMap );
 };
 
diff --git a/sw/source/core/text/noteurl.cxx b/sw/source/core/text/noteurl.cxx
index 8a08e09..12d1ea0 100644
--- a/sw/source/core/text/noteurl.cxx
+++ b/sw/source/core/text/noteurl.cxx
@@ -40,21 +40,19 @@
 // Global variable
 SwNoteURL *pNoteURL = NULL;
 
-SV_IMPL_PTRARR( SwURLNoteList, SwURLNotePtr )
-
 
 void SwNoteURL::InsertURLNote( const XubString& rURL, const XubString& rTarget,
     const SwRect& rRect )
 {
     MSHORT i;
-    MSHORT nCount = aList.Count();
+    MSHORT nCount = aList.size();
     for( i = 0; i < nCount; i++ )
-        if( rRect == aList.GetObject(i)->GetRect() )
+        if( rRect == aList[i].GetRect() )
             break;
     if( i == nCount )
     {
         SwURLNote *pNew = new SwURLNote( rURL, rTarget, rRect );
-        aList.Insert( pNew, nCount );
+        aList.push_back( pNew );
     }
 }
 
commit 47c8927f37a682578861a22d8b40013c20544054
Author: Noel Grandin <noel at peralex.com>
Date:   Thu Apr 26 11:24:48 2012 +0200

    Convert SV_DECL_PTRARR_DEL(_SwShareBoxFmts) to boost::ptr_vector

diff --git a/sw/source/core/doc/tblrwcl.cxx b/sw/source/core/doc/tblrwcl.cxx
index 9e0bba6..dfad7a4 100644
--- a/sw/source/core/doc/tblrwcl.cxx
+++ b/sw/source/core/doc/tblrwcl.cxx
@@ -82,8 +82,6 @@ typedef SwTableLine* SwTableLinePtr;
 SV_DECL_PTRARR_SORT( SwSortTableLines, SwTableLinePtr, 16 )
 SV_IMPL_PTRARR_SORT( SwSortTableLines, SwTableLinePtr );
 
-SV_IMPL_PTRARR( _SwShareBoxFmts, SwShareBoxFmt* )
-
 // In order to set the Frame Formats for the Boxes, it's enough to look
 // up the current one in the array. If it's already there return the new one.
 struct _CpyTabFrm
@@ -4573,7 +4571,7 @@ SwFrmFmt* SwShareBoxFmts::GetFormat( const SwFrmFmt& rFmt, long nWidth ) const
 {
     sal_uInt16 nPos;
     return Seek_Entry( rFmt, &nPos )
-                    ? aShareArr[ nPos ]->GetFormat( nWidth )
+                    ? aShareArr[ nPos ].GetFormat( nWidth )
                     : 0;
 }
 SwFrmFmt* SwShareBoxFmts::GetFormat( const SwFrmFmt& rFmt,
@@ -4581,7 +4579,7 @@ SwFrmFmt* SwShareBoxFmts::GetFormat( const SwFrmFmt& rFmt,
 {
     sal_uInt16 nPos;
     return Seek_Entry( rFmt, &nPos )
-                    ? aShareArr[ nPos ]->GetFormat( rItem )
+                    ? aShareArr[ nPos ].GetFormat( rItem )
                     : 0;
 }
 
@@ -4593,10 +4591,10 @@ void SwShareBoxFmts::AddFormat( const SwFrmFmt& rOld, const SwFrmFmt& rNew )
         if( !Seek_Entry( rOld, &nPos ))
         {
             pEntry = new SwShareBoxFmt( rOld );
-            aShareArr.C40_INSERT( SwShareBoxFmt, pEntry, nPos );
+            aShareArr.insert( aShareArr.begin() + nPos, pEntry );
         }
         else
-            pEntry = aShareArr[ nPos ];
+            pEntry = &aShareArr[ nPos ];
 
         pEntry->AddFormat( rNew );
     }
@@ -4670,22 +4668,22 @@ void SwShareBoxFmts::SetAttr( SwTableLine& rLine, const SfxPoolItem& rItem )
 
 void SwShareBoxFmts::RemoveFormat( const SwFrmFmt& rFmt )
 {
-    for( sal_uInt16 i = aShareArr.Count(); i; )
-        if( aShareArr[ --i ]->RemoveFormat( rFmt ))
-            aShareArr.DeleteAndDestroy( i );
+    for( sal_uInt16 i = aShareArr.size(); i; )
+        if( aShareArr[ --i ].RemoveFormat( rFmt ))
+            aShareArr.erase( aShareArr.begin() + i );
 }
 
 sal_Bool SwShareBoxFmts::Seek_Entry( const SwFrmFmt& rFmt, sal_uInt16* pPos ) const
 {
     sal_uLong nIdx = (sal_uLong)&rFmt;
-    sal_uInt16 nO = aShareArr.Count(), nM, nU = 0;
+    sal_uInt16 nO = aShareArr.size(), nM, nU = 0;
     if( nO > 0 )
     {
         nO--;
         while( nU <= nO )
         {
             nM = nU + ( nO - nU ) / 2;
-            sal_uLong nFmt = (sal_uLong)&aShareArr[ nM ]->GetOldFormat();
+            sal_uLong nFmt = (sal_uLong)&aShareArr[ nM ].GetOldFormat();
             if( nFmt == nIdx )
             {
                 if( pPos )
diff --git a/sw/source/core/inc/tblrwcl.hxx b/sw/source/core/inc/tblrwcl.hxx
index 15ad2fb..5623e95 100644
--- a/sw/source/core/inc/tblrwcl.hxx
+++ b/sw/source/core/inc/tblrwcl.hxx
@@ -186,7 +186,7 @@ public:
 };
 
 
-SV_DECL_PTRARR_DEL( _SwShareBoxFmts, SwShareBoxFmt*, 8 )
+typedef boost::ptr_vector<SwShareBoxFmt> _SwShareBoxFmts;
 
 class SwShareBoxFmts
 {
commit ca5f56a571c79b254af7c1fcb2e8256fa98d521f
Author: Noel Grandin <noel at peralex.com>
Date:   Thu Apr 26 10:04:46 2012 +0200

    Convert SV_DECL_PTRARR_DEL(SwPageFlyCache) to boost::ptr_vector

diff --git a/sw/source/core/layout/laycache.cxx b/sw/source/core/layout/laycache.cxx
index 5cad47c..b924dac 100644
--- a/sw/source/core/layout/laycache.cxx
+++ b/sw/source/core/layout/laycache.cxx
@@ -70,8 +70,6 @@
 
 using namespace ::com::sun::star;
 
-SV_IMPL_PTRARR( SwPageFlyCache, SwFlyCachePtr )
-
 /*
  *  Reading and writing of the layout cache.
  *  The layout cache is not necessary, but it improves
@@ -158,7 +156,7 @@ sal_Bool SwLayCacheImpl::Read( SvStream& rStream )
             aIo.GetStream() >> nPgNum >> nIndex
                     >> nX >> nY >> nW >> nH;
             SwFlyCache* pFly = new SwFlyCache( nPgNum, nIndex, nX, nY, nW, nH );
-            aFlyCache.Insert( pFly, aFlyCache.Count() );
+            aFlyCache.push_back( pFly );
             aIo.CloseRec( SW_LAYCACHE_IO_REC_FLY );
             break;
         }
diff --git a/sw/source/core/layout/layhelp.hxx b/sw/source/core/layout/layhelp.hxx
index 1a6d4cb..afaf6fe 100644
--- a/sw/source/core/layout/layhelp.hxx
+++ b/sw/source/core/layout/layhelp.hxx
@@ -56,8 +56,7 @@ class SvStream;
  *************************************************************************/
 
 class SwFlyCache;
-typedef SwFlyCache* SwFlyCachePtr;
-SV_DECL_PTRARR_DEL( SwPageFlyCache, SwFlyCachePtr, 0 )
+typedef boost::ptr_vector<SwFlyCache> SwPageFlyCache;
 
 class SwLayCacheImpl : public std::vector<sal_uLong>
 {
@@ -75,8 +74,8 @@ public:
     xub_StrLen GetBreakOfst( size_t nIdx ) const { return aOffset[ nIdx ]; }
     sal_uInt16 GetBreakType( sal_uInt16 nIdx ) const { return aType[ nIdx ]; }
 
-    sal_uInt16 GetFlyCount() const { return aFlyCache.Count(); }
-    SwFlyCache *GetFlyCache( sal_uInt16 nIdx ) const { return aFlyCache[ nIdx ]; }
+    sal_uInt16 GetFlyCount() const { return aFlyCache.size(); }
+    SwFlyCache *GetFlyCache( sal_uInt16 nIdx ) { return &aFlyCache[ nIdx ]; }
 
     sal_Bool IsUseFlyCache() const { return bUseFlyCache; }
 };
commit 12a1e53de414f7e35e370372217d08ed7906a071
Author: Michael Stahl <mstahl at redhat.com>
Date:   Tue May 8 19:18:48 2012 +0200

    fix crash in CheckFields test from previous commit
    
    std::vector::vector(size_type n) creates a vector containing n default
    initialized elements, while boost::ptr_vector or SvArray constructors
    create a vector containing 0 elements and allocate space for n.

diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index f8d4ddd..e9e30a7 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -1579,7 +1579,7 @@ void SwTxtNode::CopyText( SwTxtNode *const pDest,
     // wird in sich selbst kopiert, dann kann beim Einfuegen ein
     // Attribut geloescht werden. Darum erst ins Tmp-Array kopieren und
     // dann erst ins eigene uebertragen.
-    SwpHts aArr( 5 );
+    SwpHts aArr;
 
     // Del-Array fuer alle RefMarks ohne Ausdehnung
     SwpHts aRefMrkArr;
@@ -1879,7 +1879,7 @@ void SwTxtNode::CutImpl( SwTxtNode * const pDest, const SwIndex & rDestStart,
         // dann suche mal alle Attribute zusammen, die im verschobenen
         // Bereich liegen. Diese werden in das extra Array verschoben,
         // damit sich die Indizies beim Updaten nicht veraendern !!!
-        SwpHts aArr( 5 );
+        SwpHts aArr;
 
         // 2. Attribute verschieben
         // durch das Attribute-Array, bis der Anfang des Geltungsbereiches
@@ -2119,7 +2119,7 @@ void SwTxtNode::CutImpl( SwTxtNode * const pDest, const SwIndex & rDestStart,
         // "uebergeplaettet".   (Bug: 6977)
         if( m_pSwpHints && nAttrCnt < m_pSwpHints->Count() )
         {
-            SwpHts aArr( 5 );
+            SwpHts aArr;
             while ( nAttrCnt < m_pSwpHints->Count() )
             {
                 SwTxtAttr * const pHt = m_pSwpHints->GetTextHint(nAttrCnt);
commit 0097f9fe819bedd359ee8516bba05aa02f526e95
Author: Noel Grandin <noel at peralex.com>
Date:   Thu Apr 26 09:55:15 2012 +0200

    Convert SV_DECL_PTRARR(SwpHts) to std::vector
    
    Delete the TmpHints declaration, because it's using
    the same data-structure as SwpHts.

diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index fa6f3b0..f8d4ddd 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -94,12 +94,10 @@
 using namespace ::com::sun::star;
 
 
-SV_DECL_PTRARR( TmpHints, SwTxtAttr*, 0 )
+typedef std::vector<SwTxtAttr*> SwpHts;
 
 TYPEINIT1( SwTxtNode, SwCntntNode )
 
-SV_DECL_PTRARR(SwpHts,SwTxtAttr*,1)
-
 // Leider ist das SwpHints nicht ganz wasserdicht:
 // Jeder darf an den Hints rumfummeln, ohne die Sortierreihenfolge
 // und Verkettung sicherstellen zu muessen.
@@ -847,7 +845,7 @@ void SwTxtNode::Update( SwIndex const & rPos, const xub_StrLen nChangeLen,
 {
     SetAutoCompleteWordDirty( sal_True );
 
-    ::std::auto_ptr<TmpHints> pCollector;
+    ::std::auto_ptr<SwpHts> pCollector;
     const xub_StrLen nChangePos = rPos.GetIndex();
 
     if ( HasHints() )
@@ -955,15 +953,14 @@ void SwTxtNode::Update( SwIndex const & rPos, const xub_StrLen nChangeLen,
                         {
                              if ( !pCollector.get() )
                              {
-                                pCollector.reset( new TmpHints );
+                                pCollector.reset( new SwpHts );
                              }
-                             sal_uInt16 nCollCnt = pCollector->Count();
-                             for( sal_uInt16 i = 0; i < nCollCnt; ++i )
+                             for(SwpHts::iterator it =  pCollector->begin(); it != pCollector->end(); ++it)
                              {
-                                SwTxtAttr *pTmp = (*pCollector)[ i ];
+                                SwTxtAttr *pTmp = *it;
                                 if( nWhich == pTmp->Which() )
                                 {
-                                    pCollector->Remove( i );
+                                    pCollector->erase( it );
                                     SwTxtAttr::Destroy( pTmp,
                                         GetDoc()->GetAttrPool() );
                                     break;
@@ -972,7 +969,7 @@ void SwTxtNode::Update( SwIndex const & rPos, const xub_StrLen nChangeLen,
                              SwTxtAttr * const pTmp = MakeTxtAttr( *GetDoc(),
                                  pHint->GetAttr(),
                                  nChangePos, nChangePos + nChangeLen);
-                             pCollector->C40_INSERT( SwTxtAttr, pTmp, pCollector->Count() );
+                             pCollector->push_back( pTmp );
                         }
                         else
                         {
@@ -1057,7 +1054,7 @@ void SwTxtNode::Update( SwIndex const & rPos, const xub_StrLen nChangeLen,
 
     if ( pCollector.get() )
     {
-        const sal_uInt16 nCount = pCollector->Count();
+        const sal_uInt16 nCount = pCollector->size();
         for ( sal_uInt16 i = 0; i < nCount; ++i )
         {
             m_pSwpHints->TryInsertHint( (*pCollector)[ i ], *this );
@@ -1660,7 +1657,7 @@ void SwTxtNode::CopyText( SwTxtNode *const pDest,
                     nAttrStt, nAttrEnd, COPY, pDest );
 
             lcl_CopyHint(nWhich, pHt, pNewHt, 0, pDest);
-            aArr.C40_INSERT( SwTxtAttr, pNewHt, aArr.Count() );
+            aArr.push_back( pNewHt );
         }
         else
         {
@@ -1683,20 +1680,20 @@ void SwTxtNode::CopyText( SwTxtNode *const pDest,
 
         if( RES_TXTATR_REFMARK == nWhich && !pEndIdx && !bCopyRefMark )
         {
-            aRefMrkArr.C40_INSERT( SwTxtAttr, pNewHt, aRefMrkArr.Count() );
+            aRefMrkArr.push_back( pNewHt );
         }
     }
 
     // nur falls im Array Attribute stehen (kann nur beim Kopieren
     // sich selbst passieren!!)
-    for ( sal_uInt16 i = 0; i < aArr.Count(); ++i )
+    for ( sal_uInt16 i = 0; i < aArr.size(); ++i )
     {
         InsertHint( aArr[ i ], nsSetAttrMode::SETATTR_NOTXTATRCHR );
     }
 
     if( pDest->GetpSwpHints() )
     {
-        for ( sal_uInt16 i = 0; i < aRefMrkArr.Count(); ++i )
+        for ( sal_uInt16 i = 0; i < aRefMrkArr.size(); ++i )
         {
             SwTxtAttr * const pNewHt = aRefMrkArr[i];
             if( pNewHt->GetEnd() )
@@ -1923,7 +1920,7 @@ void SwTxtNode::CutImpl( SwTxtNode * const pDest, const SwIndex & rDestStart,
                     *pHt->GetStart() = nAttrStartIdx - nTxtStartIdx;
                     if( pEndIdx )
                         *pHt->GetEnd() = *pEndIdx - nTxtStartIdx;
-                    aArr.C40_INSERT( SwTxtAttr, pHt, aArr.Count() );
+                    aArr.push_back( pHt );
                     continue;           // while-Schleife weiter, ohne ++ !
                 }
                     // das Ende liegt dahinter
@@ -1941,7 +1938,7 @@ void SwTxtNode::CutImpl( SwTxtNode * const pDest, const SwIndex & rDestStart,
             {
                 // die Daten kopieren
                 lcl_CopyHint( nWhich, pHt, pNewHt, 0, this );
-                aArr.C40_INSERT( SwTxtAttr, pNewHt, aArr.Count() );
+                aArr.push_back( pNewHt );
             }
             ++nAttrCnt;
         }
@@ -1968,7 +1965,7 @@ void SwTxtNode::CutImpl( SwTxtNode * const pDest, const SwIndex & rDestStart,
             nDestStart = nDestStart - nLen;
         }
 
-        for ( sal_uInt16 n = 0; n < aArr.Count(); ++n )
+        for ( sal_uInt16 n = 0; n < aArr.size(); ++n )
         {
             SwTxtAttr *const pNewHt = aArr[n];
             *pNewHt->GetStart() = nDestStart + *pNewHt->GetStart();
@@ -2131,7 +2128,7 @@ void SwTxtNode::CutImpl( SwTxtNode * const pDest, const SwIndex & rDestStart,
                 const xub_StrLen * const pEndIdx = pHt->GetEnd();
                 if ( pEndIdx && *pEndIdx == nEnd )
                 {
-                    aArr.C40_INSERT( SwTxtAttr, pHt, aArr.Count() );
+                    aArr.push_back( pHt );
                     m_pSwpHints->Delete( pHt );
                 }
                 else
@@ -2141,7 +2138,7 @@ void SwTxtNode::CutImpl( SwTxtNode * const pDest, const SwIndex & rDestStart,
             }
             Update( rStart, nLen, sal_True, sal_True );
 
-            for ( sal_uInt16 n = 0; n < aArr.Count(); ++n )
+            for ( sal_uInt16 n = 0; n < aArr.size(); ++n )
             {
                 SwTxtAttr * const pHt = aArr[ n ];
                 *pHt->GetStart() = *pHt->GetEnd() = rStart.GetIndex();
commit 3e26181e36d506ce6c3a0133b11a7e652aaa62e6
Author: Noel Grandin <noel at peralex.com>
Date:   Thu Apr 26 09:29:43 2012 +0200

    Remove unused SV_DECL_PTRARR

diff --git a/sw/source/core/undo/unnum.cxx b/sw/source/core/undo/unnum.cxx
index e9cce98..ac7c13f 100644
--- a/sw/source/core/undo/unnum.cxx
+++ b/sw/source/core/undo/unnum.cxx
@@ -40,10 +40,6 @@
 #include <rolbck.hxx>
 
 
-SV_DECL_PTRARR_DEL( _SfxPoolItems, SfxPoolItem*, 16 )
-SV_IMPL_PTRARR( _SfxPoolItems, SfxPoolItem* );
-
-
 SwUndoInsNum::SwUndoInsNum( const SwNumRule& rOldRule,
                             const SwNumRule& rNewRule,
                             SwUndoId nUndoId )
commit 2552420cdc7588e1b0da06fd6810dba855e9d43c
Author: Noel Grandin <noel at peralex.com>
Date:   Wed Apr 25 17:44:06 2012 +0200

    Convert SV_DECL_PTRARR_DEL(SfxItemSets) to boost::ptr_vector

diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx
index 314a5bb..6c7c08b 100644
--- a/sw/source/core/undo/untbl.cxx
+++ b/sw/source/core/undo/untbl.cxx
@@ -84,8 +84,7 @@
 
 extern void ClearFEShellTabCols();
 
-typedef SfxItemSet* SfxItemSetPtr;
-SV_DECL_PTRARR_DEL( SfxItemSets, SfxItemSetPtr, 10 )
+typedef boost::ptr_vector<SfxItemSet> SfxItemSets;
 
 class SwUndoSaveSections : public boost::ptr_vector<SwUndoSaveSection> {
 public:
@@ -221,8 +220,6 @@ struct SwTblToTxtSave
     ~SwTblToTxtSave() { delete m_pHstry; }
 };
 
-SV_IMPL_PTRARR( SfxItemSets, SfxItemSetPtr )
-
 sal_uInt16 aSave_BoxCntntSet[] = {
     RES_CHRATR_COLOR, RES_CHRATR_CROSSEDOUT,
     RES_CHRATR_FONT, RES_CHRATR_FONTSIZE,
@@ -952,7 +949,8 @@ sal_uInt16 _SaveTable::AddFmt( SwFrmFmt* pFmt, bool bIsLine )
                 ((SwTblBoxFormula*)pItem)->ChgDefinedIn( 0 );
             }
         }
-        aSets.Insert( pSet, (nRet = aSets.Count() ) );
+        nRet = aSets.size();
+        aSets.push_back( pSet );
         aFrmFmts.Insert( pFmt, nRet );
     }
     return nRet;
@@ -988,7 +986,7 @@ void _SaveTable::RestoreAttr( SwTable& rTbl, sal_Bool bMdfyBox )
 
     // FrmFmts mit Defaults (0) fuellen
     pFmt = 0;
-    for( n = aSets.Count(); n; --n )
+    for( n = aSets.size(); n; --n )
         aFrmFmts.Insert( pFmt, aFrmFmts.Count() );
 
     sal_uInt16 nLnCnt = nLineCount;
@@ -1045,7 +1043,7 @@ void _SaveTable::CreateNew( SwTable& rTbl, sal_Bool bCreateFrms,
 
     // FrmFmts mit Defaults (0) fuellen
     pFmt = 0;
-    for( n = aSets.Count(); n; --n )
+    for( n = aSets.size(); n; --n )
         aFrmFmts.Insert( pFmt, aFrmFmts.Count() );
 
     pLine->CreateNew( rTbl, aParent, *this );
@@ -1127,7 +1125,7 @@ void _SaveTable::NewFrmFmt( const SwTableLine* pTblLn, const SwTableBox* pTblBx,
             pFmt = pDoc->MakeTableLineFmt();
         else
             pFmt = pDoc->MakeTableBoxFmt();
-        pFmt->SetFmtAttr( *aSets[ nFmtPos ] );
+        pFmt->SetFmtAttr( aSets[ nFmtPos ] );
         aFrmFmts.Replace( pFmt, nFmtPos );
     }
 
@@ -1223,7 +1221,7 @@ void _SaveLine::CreateNew( SwTable& rTbl, SwTableBox& rParent, _SaveTable& rSTbl
     {
         SwDoc* pDoc = rTbl.GetFrmFmt()->GetDoc();
         pFmt = pDoc->MakeTableLineFmt();
-        pFmt->SetFmtAttr( *rSTbl.aSets[ nItemSet ] );
+        pFmt->SetFmtAttr( rSTbl.aSets[ nItemSet ] );
         rSTbl.aFrmFmts.Replace( pFmt, nItemSet );
     }
     SwTableLine* pNew = new SwTableLine( pFmt, 1, &rParent );
@@ -1318,7 +1316,7 @@ void _SaveBox::RestoreAttr( SwTableBox& rBox, _SaveTable& rSTbl )
                 SwCntntNode* pCNd = rNds[ n ]->GetCntntNode();
                 if( pCNd )
                 {
-                    SfxItemSet* pSet = (*Ptrs.pCntntAttrs)[ nSet++ ];
+                    SfxItemSet* pSet = &(*Ptrs.pCntntAttrs)[ nSet++ ];
                     if( pSet )
                     {
                         sal_uInt16 *pRstAttr = aSave_BoxCntntSet;
@@ -1366,7 +1364,7 @@ void _SaveBox::SaveCntntAttrs( SwDoc* pDoc )
                     pSet->Put( *pCNd->GetpSwAttrSet() );
                 }
 
-                Ptrs.pCntntAttrs->Insert( pSet, Ptrs.pCntntAttrs->Count() );
+                Ptrs.pCntntAttrs->push_back( pSet );
             }
         }
     }
@@ -1382,7 +1380,7 @@ void _SaveBox::CreateNew( SwTable& rTbl, SwTableLine& rParent, _SaveTable& rSTbl
     {
         SwDoc* pDoc = rTbl.GetFrmFmt()->GetDoc();
         pFmt = pDoc->MakeTableBoxFmt();
-        pFmt->SetFmtAttr( *rSTbl.aSets[ nItemSet ] );
+        pFmt->SetFmtAttr( rSTbl.aSets[ nItemSet ] );
         rSTbl.aFrmFmts.Replace( pFmt, nItemSet );
     }
 
commit b9f344eff6fd17f7d9b4d4585999cf18927707f3
Author: Noel Grandin <noel at peralex.com>
Date:   Wed Apr 25 17:28:43 2012 +0200

    Convert SV_DECL_PTRARR_DEL(SwUndoSaveSections) to boost::ptr_vector

diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx
index 9abcb40..314a5bb 100644
--- a/sw/source/core/undo/untbl.cxx
+++ b/sw/source/core/undo/untbl.cxx
@@ -87,8 +87,10 @@ extern void ClearFEShellTabCols();
 typedef SfxItemSet* SfxItemSetPtr;
 SV_DECL_PTRARR_DEL( SfxItemSets, SfxItemSetPtr, 10 )
 
-typedef SwUndoSaveSection* SwUndoSaveSectionPtr;
-SV_DECL_PTRARR_DEL( SwUndoSaveSections, SwUndoSaveSectionPtr, 0 )
+class SwUndoSaveSections : public boost::ptr_vector<SwUndoSaveSection> {
+public:
+    SwUndoSaveSections(size_type n) : boost::ptr_vector<SwUndoSaveSection>(n) {}
+};
 
 class SwUndoMoves : public boost::ptr_vector<SwUndoMove> {};
 
@@ -220,7 +222,6 @@ struct SwTblToTxtSave
 };
 
 SV_IMPL_PTRARR( SfxItemSets, SfxItemSetPtr )
-SV_IMPL_PTRARR( SwUndoSaveSections, SwUndoSaveSectionPtr )
 
 sal_uInt16 aSave_BoxCntntSet[] = {
     RES_CHRATR_COLOR, RES_CHRATR_CROSSEDOUT,
@@ -1736,7 +1737,7 @@ void SwUndoTblNdsChg::SaveSection( SwStartNode* pSttNd )
     SwUndoSaveSection* pSave = new SwUndoSaveSection;
     pSave->SaveSection( pSttNd->GetDoc(), SwNodeIndex( *pSttNd ));
 
-    pDelSects->Insert( pSave, pDelSects->Count() );
+    pDelSects->push_back( pSave );
     nSttNode = pTblNd->GetIndex();
 }
 
@@ -1768,9 +1769,9 @@ void SwUndoTblNdsChg::UndoImpl(::sw::UndoRedoContext & rContext)
         SwTableBoxes& rLnBoxes = pCpyBox->GetUpper()->GetTabBoxes();
 
         // die Sections wieder herstellen
-        for( sal_uInt16 n = pDelSects->Count(); n; )
+        for( sal_uInt16 n = pDelSects->size(); n; )
         {
-            SwUndoSaveSection* pSave = (*pDelSects)[ --n ];
+            SwUndoSaveSection* pSave = &(*pDelSects)[ --n ];
             pSave->RestoreSection( &rDoc, &aIdx, SwTableBoxStartNode );
             if( pSave->GetHistory() )
                 pSave->GetHistory()->Rollback( &rDoc );
@@ -1778,7 +1779,7 @@ void SwUndoTblNdsChg::UndoImpl(::sw::UndoRedoContext & rContext)
                                                 pCpyBox->GetUpper() );
             rLnBoxes.C40_INSERT( SwTableBox, pBox, rLnBoxes.Count() );
         }
-        pDelSects->DeleteAndDestroy( 0, pDelSects->Count() );
+        pDelSects->clear();
     }
     else if( !pNewSttNds->empty() )
     {
@@ -1955,9 +1956,7 @@ void SwUndoTblNdsChg::RedoImpl(::sw::UndoRedoContext & rContext)
 
             if( pUndo )
             {
-                pDelSects->Insert( pUndo->pDelSects.get(), 0 );
-                pUndo->pDelSects->Remove( 0, pUndo->pDelSects->Count() );
-
+                pDelSects->transfer( pDelSects->begin(), *pUndo->pDelSects.get() );
                 delete pUndo;
             }
             rDoc.GetIDocumentUndoRedo().DoUndo( false );
commit cd9283aca3af5cdce0660eaf80e477efbf2b1f12
Author: Noel Grandin <noel at peralex.com>
Date:   Wed Apr 25 16:55:39 2012 +0200

    Convert SV_DECL_PTRARR_DEL(SwUndoMoves) to boost::ptr_vector

diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx
index 5788cfa..9abcb40 100644
--- a/sw/source/core/undo/untbl.cxx
+++ b/sw/source/core/undo/untbl.cxx
@@ -90,8 +90,7 @@ SV_DECL_PTRARR_DEL( SfxItemSets, SfxItemSetPtr, 10 )
 typedef SwUndoSaveSection* SwUndoSaveSectionPtr;
 SV_DECL_PTRARR_DEL( SwUndoSaveSections, SwUndoSaveSectionPtr, 0 )
 
-typedef SwUndoMove* SwUndoMovePtr;
-SV_DECL_PTRARR_DEL( SwUndoMoves, SwUndoMovePtr, 0 )
+class SwUndoMoves : public boost::ptr_vector<SwUndoMove> {};
 
 struct SwTblToTxtSave;
 class SwTblToTxtSaves : public boost::ptr_vector<SwTblToTxtSave> {
@@ -222,7 +221,6 @@ struct SwTblToTxtSave
 
 SV_IMPL_PTRARR( SfxItemSets, SfxItemSetPtr )
 SV_IMPL_PTRARR( SwUndoSaveSections, SwUndoSaveSectionPtr )
-SV_IMPL_PTRARR( SwUndoMoves, SwUndoMovePtr )
 
 sal_uInt16 aSave_BoxCntntSet[] = {
     RES_CHRATR_COLOR, RES_CHRATR_CROSSEDOUT,
@@ -2058,11 +2056,11 @@ CHECKTABLE(pTblNd->GetTable())
                     *pBox->GetSttNd()->EndOfSectionNode() ), pColl );
 
             // das war der Trenner, -> die verschobenen herstellen
-            for( sal_uInt16 i = pMoves->Count(); i; )
+            for( sal_uInt16 i = pMoves->size(); i; )
             {
                 SwTxtNode* pTxtNd = 0;
                 sal_uInt16 nDelPos = 0;
-                SwUndoMove* pUndo = (*pMoves)[ --i ];
+                SwUndoMove* pUndo = &(*pMoves)[ --i ];
                 if( !pUndo->IsMoveRange() )
                 {
                     pTxtNd = rDoc.GetNodes()[ pUndo->GetDestSttNode() ]->GetTxtNode();
@@ -2166,7 +2164,7 @@ void SwUndoTblMerge::MoveBoxCntnt( SwDoc* pDoc, SwNodeRange& rRg, SwNodeIndex& r
     aTmp2++;
     pUndo->SetDestRange( aTmp2, rPos, aTmp );
 
-    pMoves->Insert( pUndo, pMoves->Count() );
+    pMoves->push_back( pUndo );
 }
 
 void SwUndoTblMerge::SetSelBoxes( const SwSelBoxes& rBoxes )
commit c9e146f0d00a31abf1cd17f19d3ed660756db9dd
Author: Noel Grandin <noel at peralex.com>
Date:   Wed Apr 25 16:50:14 2012 +0200

    Convert SV_DECL_PTRARR_DEL(SwTblToTxtSaves) to boost::ptr_vector

diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx
index b5df1e5..5788cfa 100644
--- a/sw/source/core/undo/untbl.cxx
+++ b/sw/source/core/undo/untbl.cxx
@@ -94,8 +94,10 @@ typedef SwUndoMove* SwUndoMovePtr;
 SV_DECL_PTRARR_DEL( SwUndoMoves, SwUndoMovePtr, 0 )
 
 struct SwTblToTxtSave;
-typedef SwTblToTxtSave* SwTblToTxtSavePtr;
-SV_DECL_PTRARR_DEL( SwTblToTxtSaves, SwTblToTxtSavePtr, 0 )
+class SwTblToTxtSaves : public boost::ptr_vector<SwTblToTxtSave> {
+public:
+    SwTblToTxtSaves(size_type n) : boost::ptr_vector<SwTblToTxtSave>(n) {}
+};
 
 struct _UndoTblCpyTbl_Entry
 {
@@ -221,7 +223,6 @@ struct SwTblToTxtSave
 SV_IMPL_PTRARR( SfxItemSets, SfxItemSetPtr )
 SV_IMPL_PTRARR( SwUndoSaveSections, SwUndoSaveSectionPtr )
 SV_IMPL_PTRARR( SwUndoMoves, SwUndoMovePtr )
-SV_IMPL_PTRARR( SwTblToTxtSaves, SwTblToTxtSavePtr )
 
 sal_uInt16 aSave_BoxCntntSet[] = {
     RES_CHRATR_COLOR, RES_CHRATR_CROSSEDOUT,
@@ -424,7 +425,7 @@ SwUndoTblToTxt::SwUndoTblToTxt( const SwTable& rTbl, sal_Unicode cCh )
     cTrenner( cCh ), nHdlnRpt( rTbl.GetRowsToRepeat() )
 {
     pTblSave = new _SaveTable( rTbl );
-    pBoxSaves = new SwTblToTxtSaves( (sal_uInt8)rTbl.GetTabSortBoxes().Count() );
+    pBoxSaves = new SwTblToTxtSaves( (SwTblToTxtSaves::size_type)rTbl.GetTabSortBoxes().Count() );
 
     if( rTbl.IsA( TYPE( SwDDETable ) ) )
         pDDEFldType = (SwDDEFieldType*)((SwDDETable&)rTbl).GetDDEFldType()->Copy();
@@ -561,13 +562,13 @@ SwTableNode* SwNodes::UndoTableToText( sal_uLong nSttNd, sal_uLong nEndNd,
     // SaveStruct
     SwTableBoxFmt* pBoxFmt = GetDoc()->MakeTableBoxFmt();
     SwTableLineFmt* pLineFmt = GetDoc()->MakeTableLineFmt();
-    SwTableLine* pLine = new SwTableLine( pLineFmt, rSavedData.Count(), 0 );
+    SwTableLine* pLine = new SwTableLine( pLineFmt, rSavedData.size(), 0 );
     pTblNd->GetTable().GetTabLines().C40_INSERT( SwTableLine, pLine, 0 );
 
     std::vector<sal_uLong> aBkmkArr;
-    for( sal_uInt16 n = rSavedData.Count(); n; )
+    for( sal_uInt16 n = rSavedData.size(); n; )
     {
-        SwTblToTxtSave* pSave = rSavedData[ --n ];
+        const SwTblToTxtSave* pSave = &rSavedData[ --n ];
         // if the start node was merged with last from prev. cell,
         // subtract 1 from index to get the merged paragraph, and split that
         aSttIdx = pSave->m_nSttNd - ( ( USHRT_MAX != pSave->m_nCntnt ) ? 1 : 0);
@@ -707,7 +708,7 @@ void SwUndoTblToTxt::SetRange( const SwNodeRange& rRg )
 void SwUndoTblToTxt::AddBoxPos( SwDoc& rDoc, sal_uLong nNdIdx, sal_uLong nEndIdx, xub_StrLen nCntntIdx )
 {
     SwTblToTxtSave* pNew = new SwTblToTxtSave( rDoc, nNdIdx, nEndIdx, nCntntIdx );
-    pBoxSaves->Insert( pNew, pBoxSaves->Count() );
+    pBoxSaves->push_back( pNew );
 }
 
 // -----------------------------------------------------
commit 62a0ec2c2b4143e88076a9b16f792169fece2482
Author: Noel Grandin <noel at peralex.com>
Date:   Wed Apr 25 15:00:10 2012 +0200

    Convert SV_DECL_PTRARR_DEL(_UndoTblCpyTbl_Entries) to ptr_vector

diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx
index eab0666..b5df1e5 100644
--- a/sw/source/core/undo/untbl.cxx
+++ b/sw/source/core/undo/untbl.cxx
@@ -109,8 +109,7 @@ struct _UndoTblCpyTbl_Entry
     _UndoTblCpyTbl_Entry( const SwTableBox& rBox );
     ~_UndoTblCpyTbl_Entry();
 };
-typedef _UndoTblCpyTbl_Entry* _UndoTblCpyTbl_EntryPtr;
-SV_DECL_PTRARR_DEL( _UndoTblCpyTbl_Entries, _UndoTblCpyTbl_EntryPtr, 0 )
+class _UndoTblCpyTbl_Entries : public boost::ptr_vector<_UndoTblCpyTbl_Entry> {};
 
 class _SaveBox;
 class _SaveLine;
@@ -223,7 +222,6 @@ SV_IMPL_PTRARR( SfxItemSets, SfxItemSetPtr )
 SV_IMPL_PTRARR( SwUndoSaveSections, SwUndoSaveSectionPtr )
 SV_IMPL_PTRARR( SwUndoMoves, SwUndoMovePtr )
 SV_IMPL_PTRARR( SwTblToTxtSaves, SwTblToTxtSavePtr )
-SV_IMPL_PTRARR( _UndoTblCpyTbl_Entries, _UndoTblCpyTbl_EntryPtr )
 
 sal_uInt16 aSave_BoxCntntSet[] = {
     RES_CHRATR_COLOR, RES_CHRATR_CROSSEDOUT,
@@ -2497,9 +2495,9 @@ void SwUndoTblCpyTbl::UndoImpl(::sw::UndoRedoContext & rContext)
     _DEBUG_REDLINE( &rDoc )
 
     SwTableNode* pTblNd = 0;
-    for( sal_uInt16 n = pArr->Count(); n; )
+    for( sal_uInt16 n = pArr->size(); n; )
     {
-        _UndoTblCpyTbl_Entry* pEntry = (*pArr)[ --n ];
+        _UndoTblCpyTbl_Entry* pEntry = &(*pArr)[ --n ];
         sal_uLong nSttPos = pEntry->nBoxIdx + pEntry->nOffset;
         SwStartNode* pSNd = rDoc.GetNodes()[ nSttPos ]->StartOfSectionNode();
         if( !pTblNd )
@@ -2648,9 +2646,9 @@ void SwUndoTblCpyTbl::RedoImpl(::sw::UndoRedoContext & rContext)
     }
 
     SwTableNode* pTblNd = 0;
-    for( sal_uInt16 n = 0; n < pArr->Count(); ++n )
+    for( sal_uInt16 n = 0; n < pArr->size(); ++n )
     {
-        _UndoTblCpyTbl_Entry* pEntry = (*pArr)[ n ];
+        _UndoTblCpyTbl_Entry* pEntry = &(*pArr)[ n ];
         sal_uLong nSttPos = pEntry->nBoxIdx + pEntry->nOffset;
         SwStartNode* pSNd = rDoc.GetNodes()[ nSttPos ]->StartOfSectionNode();
         if( !pTblNd )
@@ -2725,11 +2723,11 @@ void SwUndoTblCpyTbl::RedoImpl(::sw::UndoRedoContext & rContext)
 
 void SwUndoTblCpyTbl::AddBoxBefore( const SwTableBox& rBox, sal_Bool bDelCntnt )
 {
-    if( pArr->Count() && !bDelCntnt )
+    if( !pArr->empty() && !bDelCntnt )
         return;
 
     _UndoTblCpyTbl_Entry* pEntry = new _UndoTblCpyTbl_Entry( rBox );
-    pArr->Insert( pEntry, pArr->Count() );
+    pArr->push_back( pEntry );
 
     SwDoc* pDoc = rBox.GetFrmFmt()->GetDoc();
     _DEBUG_REDLINE( pDoc )
@@ -2754,7 +2752,7 @@ void SwUndoTblCpyTbl::AddBoxBefore( const SwTableBox& rBox, sal_Bool bDelCntnt )
 
 void SwUndoTblCpyTbl::AddBoxAfter( const SwTableBox& rBox, const SwNodeIndex& rIdx, sal_Bool bDelCntnt )
 {
-    _UndoTblCpyTbl_Entry* pEntry = (*pArr)[ pArr->Count() - 1 ];
+    _UndoTblCpyTbl_Entry* pEntry = &(*pArr).back();
 
     // wurde der Inhalt geloescht, so loesche jetzt auch noch den temp.
     // erzeugten Node
@@ -2876,7 +2874,7 @@ sal_Bool SwUndoTblCpyTbl::InsertRow( SwTable& rTbl, const SwSelBoxes& rBoxes,
 
 sal_Bool SwUndoTblCpyTbl::IsEmpty() const
 {
-    return !pInsRowUndo && !pArr->Count();
+    return !pInsRowUndo && pArr->empty();
 }
 
 
commit 5fca48a9706d40f15feb6c6a77bdd16739fd3446
Author: Noel Grandin <noel at peralex.com>
Date:   Wed Apr 25 14:06:26 2012 +0200

    Convert SV_DECL_PTRARR(SwDependentFields) to std::vector

diff --git a/sw/source/core/unocore/unofield.cxx b/sw/source/core/unocore/unofield.cxx
index 75253bd..e613e8b 100644
--- a/sw/source/core/unocore/unofield.cxx
+++ b/sw/source/core/unocore/unofield.cxx
@@ -729,9 +729,7 @@ SwFieldType* SwXFieldMaster::GetFldType(sal_Bool bDontCreate) const
         return (SwFieldType*)GetRegisteredIn();
 }
 
-typedef SwFmtFld* SwFmtFldPtr;
-SV_DECL_PTRARR(SwDependentFields, SwFmtFldPtr, 5)
-SV_IMPL_PTRARR(SwDependentFields, SwFmtFldPtr)
+typedef std::vector<SwFmtFld*> SwDependentFields;
 
 uno::Any SwXFieldMaster::getPropertyValue(const OUString& rPropertyName)
         throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
@@ -757,19 +755,19 @@ uno::Any SwXFieldMaster::getPropertyValue(const OUString& rPropertyName)
             //fill all text fields into a sequence
             SwDependentFields aFldArr;
             SwIterator<SwFmtFld,SwFieldType> aIter( *pType );
-            SwFmtFldPtr pFld = aIter.First();
+            SwFmtFld* pFld = aIter.First();
             while(pFld)
             {
                 if(pFld->IsFldInDoc())
-                    aFldArr.Insert(pFld, aFldArr.Count());
+                    aFldArr.push_back(pFld);
                 pFld = aIter.Next();
             }
 
-            uno::Sequence<uno::Reference <text::XDependentTextField> > aRetSeq(aFldArr.Count());
+            uno::Sequence<uno::Reference <text::XDependentTextField> > aRetSeq(aFldArr.size());
             uno::Reference<text::XDependentTextField>* pRetSeq = aRetSeq.getArray();
-            for(sal_uInt16 i = 0; i < aFldArr.Count(); i++)
+            for(sal_uInt16 i = 0; i < aFldArr.size(); i++)
             {
-                pFld = aFldArr.GetObject(i);
+                pFld = aFldArr[i];
                 SwXTextField * pInsert = SwXTextField::CreateSwXTextField(*GetDoc(), *pFld);
 
                 pRetSeq[i] = uno::Reference<text::XDependentTextField>(pInsert);
commit 1eca4ec29787f6780904bac7c642b1b125b7dd7c
Author: Noel Grandin <noel at peralex.com>
Date:   Wed Apr 25 13:53:08 2012 +0200

    Convert SV_DECL_PTRARR(PropValDataArr) to std::vector

diff --git a/sw/source/core/unocore/unosett.cxx b/sw/source/core/unocore/unosett.cxx
index ca9c4b4..255121b 100644
--- a/sw/source/core/unocore/unosett.cxx
+++ b/sw/source/core/unocore/unosett.cxx
@@ -106,10 +106,7 @@ struct PropValData
 #define API_COL_LINE_DOTTED             2
 #define API_COL_LINE_DASHED             3
 
-typedef PropValData* PropValDataPtr;
-SV_DECL_PTRARR(PropValDataArr, PropValDataPtr, 5)
-SV_IMPL_PTRARR(PropValDataArr, PropValDataPtr)
-
+typedef std::vector<PropValData*> PropValDataArr;
 
 #define WID_PREFIX                      0
 #define WID_SUFFIX                      1
@@ -1376,22 +1373,22 @@ uno::Sequence<beans::PropertyValue> SwXNumberingRules::GetNumberingRuleByIndex(
     SvxAdjust eAdj = rFmt.GetNumAdjust();
     sal_Int16 nINT16 = aSvxToUnoAdjust[(sal_uInt16)eAdj];
     PropValData* pData = new PropValData((void*)&nINT16, "Adjust", ::getCppuType((const sal_Int16*)0) );
-    aPropertyValues.Insert(pData, aPropertyValues.Count());
+    aPropertyValues.push_back(pData);
 
     //parentnumbering
     nINT16 = rFmt.GetIncludeUpperLevels();
     pData = new PropValData((void*)&nINT16, "ParentNumbering", ::getCppuType((const sal_Int16*)0));
-    aPropertyValues.Insert(pData, aPropertyValues.Count());
+    aPropertyValues.push_back(pData);
 
     //prefix
     OUString aUString = rFmt.GetPrefix();
     pData = new PropValData((void*)&aUString, "Prefix", ::getCppuType((const OUString*)0));
-    aPropertyValues.Insert(pData, aPropertyValues.Count());
+    aPropertyValues.push_back(pData);
 
     //suffix
     aUString = rFmt.GetSuffix();
     pData = new PropValData((void*)&aUString, "Suffix", ::getCppuType((const OUString*)0));
-    aPropertyValues.Insert(pData, aPropertyValues.Count());
+    aPropertyValues.push_back(pData);
 
     //char style name
     SwCharFmt* pCharFmt = rFmt.GetCharFmt();
@@ -1407,29 +1404,29 @@ uno::Sequence<beans::PropertyValue> SwXNumberingRules::GetNumberingRuleByIndex(
     SwStyleNameMapper::FillProgName( CharStyleName, aString, nsSwGetPoolIdFromName::GET_POOLID_CHRFMT, sal_True );
     aUString = aString;
     pData = new PropValData((void*)&aUString, "CharStyleName", ::getCppuType((const OUString*)0));
-    aPropertyValues.Insert(pData, aPropertyValues.Count());
+    aPropertyValues.push_back(pData);
 
     //startvalue
     nINT16 = rFmt.GetStart();
     pData = new PropValData((void*)&nINT16, "StartWith", ::getCppuType((const sal_Int16*)0));
-    aPropertyValues.Insert(pData, aPropertyValues.Count());
+    aPropertyValues.push_back(pData);
 
     if ( rFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
     {
         //leftmargin
         sal_Int32 nINT32 = TWIP_TO_MM100(rFmt.GetAbsLSpace());
         pData = new PropValData((void*)&nINT32, SW_PROP_NAME_STR(UNO_NAME_LEFT_MARGIN), ::getCppuType((const sal_Int32*)0));
-        aPropertyValues.Insert(pData, aPropertyValues.Count());
+        aPropertyValues.push_back(pData);
 
         //chartextoffset
         nINT32 = TWIP_TO_MM100(rFmt.GetCharTextDistance());
         pData = new PropValData((void*)&nINT32, SW_PROP_NAME_STR(UNO_NAME_SYMBOL_TEXT_DISTANCE), ::getCppuType((const sal_Int32*)0));
-        aPropertyValues.Insert(pData, aPropertyValues.Count());
+        aPropertyValues.push_back(pData);
 
         //firstlineoffset
         nINT32 = TWIP_TO_MM100(rFmt.GetFirstLineOffset());
         pData = new PropValData((void*)&nINT32, SW_PROP_NAME_STR(UNO_NAME_FIRST_LINE_OFFSET), ::getCppuType((const sal_Int32*)0));
-        aPropertyValues.Insert(pData, aPropertyValues.Count());
+        aPropertyValues.push_back(pData);
     }
 
     // PositionAndSpaceMode
@@ -1441,7 +1438,7 @@ uno::Sequence<beans::PropertyValue> SwXNumberingRules::GetNumberingRuleByIndex(
     pData = new PropValData( (void*)&nINT16,
                              SW_PROP_NAME_STR(UNO_NAME_POSITION_AND_SPACE_MODE),
                              ::getCppuType((const sal_Int16*)0) );
-    aPropertyValues.Insert(pData, aPropertyValues.Count());
+    aPropertyValues.push_back(pData);
 
     if ( rFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT )
     {
@@ -1458,34 +1455,34 @@ uno::Sequence<beans::PropertyValue> SwXNumberingRules::GetNumberingRuleByIndex(
         pData = new PropValData( (void*)&nINT16,
                                  SW_PROP_NAME_STR(UNO_NAME_LABEL_FOLLOWED_BY),
                                  ::getCppuType((const sal_Int16*)0) );
-        aPropertyValues.Insert(pData, aPropertyValues.Count());
+        aPropertyValues.push_back(pData);
 
         // ListtabStopPosition
         sal_Int32 nINT32 = TWIP_TO_MM100(rFmt.GetListtabPos());
         pData = new PropValData( (void*)&nINT32,
                                  SW_PROP_NAME_STR(UNO_NAME_LISTTAB_STOP_POSITION),
                                  ::getCppuType((const sal_Int32*)0));
-        aPropertyValues.Insert(pData, aPropertyValues.Count());
+        aPropertyValues.push_back(pData);
 
         // FirstLineIndent
         nINT32 = TWIP_TO_MM100(rFmt.GetFirstLineIndent());
         pData = new PropValData( (void*)&nINT32,
                                  SW_PROP_NAME_STR(UNO_NAME_FIRST_LINE_INDENT),
                                  ::getCppuType((const sal_Int32*)0));
-        aPropertyValues.Insert(pData, aPropertyValues.Count());
+        aPropertyValues.push_back(pData);
 
         // IndentAt
         nINT32 = TWIP_TO_MM100(rFmt.GetIndentAt());
         pData = new PropValData( (void*)&nINT32,
                                  SW_PROP_NAME_STR(UNO_NAME_INDENT_AT),
                                  ::getCppuType((const sal_Int32*)0));
-        aPropertyValues.Insert(pData, aPropertyValues.Count());
+        aPropertyValues.push_back(pData);
     }
 
     //numberingtype
     nINT16 = rFmt.GetNumberingType();
     pData = new PropValData((void*)&nINT16, "NumberingType", ::getCppuType((const sal_Int16*)0));
-    aPropertyValues.Insert(pData, aPropertyValues.Count());
+    aPropertyValues.push_back(pData);
 
     if(!bChapterNum)
     {
@@ -1494,14 +1491,14 @@ uno::Sequence<beans::PropertyValue> SwXNumberingRules::GetNumberingRuleByIndex(
             //BulletId
             nINT16 = rFmt.GetBulletChar();
             pData = new PropValData((void*)&nINT16, "BulletId", ::getCppuType((const sal_Int16*)0));
-            aPropertyValues.Insert(pData, aPropertyValues.Count());
+            aPropertyValues.push_back(pData);
 
             const Font* pFont = rFmt.GetBulletFont();
 
             //BulletChar
             aUString = OUString(rFmt.GetBulletChar());
             pData = new PropValData((void*)&aUString, "BulletChar", ::getCppuType((const OUString*)0));
-            aPropertyValues.Insert(pData, aPropertyValues.Count());
+            aPropertyValues.push_back(pData);
 
             //BulletFontName
             String sBulletFontName;
@@ -1509,7 +1506,7 @@ uno::Sequence<beans::PropertyValue> SwXNumberingRules::GetNumberingRuleByIndex(
                 sBulletFontName = pFont->GetStyleName();
             aUString = sBulletFontName;
             pData = new PropValData((void*)&aUString, "BulletFontName", ::getCppuType((const OUString*)0));
-            aPropertyValues.Insert(pData, aPropertyValues.Count());
+            aPropertyValues.push_back(pData);
 
             //BulletFont
             if(pFont)
@@ -1517,7 +1514,7 @@ uno::Sequence<beans::PropertyValue> SwXNumberingRules::GetNumberingRuleByIndex(
                  awt::FontDescriptor aDesc;
                 SvxUnoFontDescriptor::ConvertFromFont( *pFont, aDesc );
                 pData = new PropValData((void*)&aDesc, SW_PROP_NAME_STR(UNO_NAME_BULLET_FONT), ::getCppuType((const awt::FontDescriptor*)0));
-                aPropertyValues.Insert(pData, aPropertyValues.Count());
+                aPropertyValues.push_back(pData);
             }
         }
         if(SVX_NUM_BITMAP == rFmt.GetNumberingType())
@@ -1533,7 +1530,7 @@ uno::Sequence<beans::PropertyValue> SwXNumberingRules::GetNumberingRuleByIndex(
             else
                 aUString = aEmptyStr;
             pData = new PropValData((void*)&aUString, SW_PROP_NAME_STR(UNO_NAME_GRAPHIC_URL), ::getCppuType((const OUString*)0));
-            aPropertyValues.Insert(pData, aPropertyValues.Count());
+            aPropertyValues.push_back(pData);
 
             //graphicbitmap
             const Graphic* pGraphic = 0;
@@ -1544,21 +1541,21 @@ uno::Sequence<beans::PropertyValue> SwXNumberingRules::GetNumberingRuleByIndex(
                 uno::Reference<awt::XBitmap> xBmp = VCLUnoHelper::CreateBitmap( pGraphic->GetBitmapEx() );
                 pData = new PropValData((void*)&xBmp, SW_PROP_NAME_STR(UNO_NAME_GRAPHIC_BITMAP),
                                 ::getCppuType((const uno::Reference<awt::XBitmap>*)0));
-                aPropertyValues.Insert(pData, aPropertyValues.Count());
+                aPropertyValues.push_back(pData);
             }
              Size aSize = rFmt.GetGraphicSize();
             // #i101131#
             // adjust conversion due to type mismatch between <Size> and <awt::Size>
             awt::Size aAwtSize(TWIP_TO_MM100(aSize.Width()), TWIP_TO_MM100(aSize.Height()));
             pData = new PropValData((void*)&aAwtSize, SW_PROP_NAME_STR(UNO_NAME_GRAPHIC_SIZE), ::getCppuType((const awt::Size*)0));
-            aPropertyValues.Insert(pData, aPropertyValues.Count());
+            aPropertyValues.push_back(pData);
 
             const SwFmtVertOrient* pOrient = rFmt.GetGraphicOrientation();
             if(pOrient)
             {
                 pData = new PropValData((void*)0, SW_PROP_NAME_STR(UNO_NAME_VERT_ORIENT), ::getCppuType((const sal_Int16*)0));
                 ((const SfxPoolItem*)pOrient)->QueryValue(pData->aVal, MID_VERTORIENT_ORIENT);
-                aPropertyValues.Insert(pData, aPropertyValues.Count());
+                aPropertyValues.push_back(pData);
             }
         }
 
@@ -1596,29 +1593,31 @@ uno::Sequence<beans::PropertyValue> SwXNumberingRules::GetNumberingRuleByIndex(
         aUString = aName;
 
         pData = new PropValData((void*)&aUString, SW_PROP_NAME_STR(UNO_NAME_HEADING_STYLE_NAME), ::getCppuType((const OUString*)0));
-        aPropertyValues.Insert(pData, aPropertyValues.Count());
+        aPropertyValues.push_back(pData);
     }
 
-    uno::Sequence<beans::PropertyValue> aSeq(aPropertyValues.Count());
+    uno::Sequence<beans::PropertyValue> aSeq(aPropertyValues.size());
     beans::PropertyValue* pArray = aSeq.getArray();
 
-    for(sal_uInt16 i = 0; i < aPropertyValues.Count(); i++)
+    for(sal_uInt16 i = 0; i < aPropertyValues.size(); i++)
     {
-        pData = aPropertyValues.GetObject(i);
+        pData = aPropertyValues[i];
         pArray[i].Value = pData->aVal;
         pArray[i].Name = pData->sPropName;
         pArray[i].Handle = -1;
     }
-    aPropertyValues.DeleteAndDestroy(0, aPropertyValues.Count());
+    for (PropValDataArr::const_iterator it = aPropertyValues.begin(); it != aPropertyValues.end(); ++it)
+      delete *it;
+    aPropertyValues.clear();
     return aSeq;
 }
 
 PropValData* lcl_FindProperty(const char* cName, PropValDataArr&    rPropertyValues)
 {
     OUString sCmp = rtl::OUString::createFromAscii(cName);
-    for(sal_uInt16 i = 0; i < rPropertyValues.Count(); i++)
+    for(sal_uInt16 i = 0; i < rPropertyValues.size(); i++)
     {
-        PropValData* pTemp = rPropertyValues.GetObject(i);
+        PropValData* pTemp = rPropertyValues[i];
         if(sCmp == pTemp->sPropName)
             return pTemp;
     }
@@ -1697,7 +1696,7 @@ void SwXNumberingRules::SetNumberingRuleByIndex(
         }
         SAL_WARN_IF( bExcept, "sw.uno", "Unknown/incorrect property " << rProp.Name << ", failing" );
         PropValData* pData = new PropValData(rProp.Value, rProp.Name );
-        aPropertyValues.Insert(pData, aPropertyValues.Count());
+        aPropertyValues.push_back(pData);
     }
 
     SwNumFmt aFmt(rNumRule.Get( (sal_uInt16)nIndex ));
@@ -2142,7 +2141,9 @@ void SwXNumberingRules::SetNumberingRuleByIndex(
         delete pSetSize;
         delete pSetVOrient;
       }
-    aPropertyValues.DeleteAndDestroy(0, aPropertyValues.Count());
+    for (PropValDataArr::const_iterator it = aPropertyValues.begin(); it != aPropertyValues.end(); ++it)
+      delete *it;
+    aPropertyValues.clear();
 
     if(bWrongArg)
         throw lang::IllegalArgumentException();
commit 4a74e2fe7dda32af69ad7311de6f630b3191059f
Author: Michael Stahl <mstahl at redhat.com>
Date:   Tue May 8 18:13:31 2012 +0200

    also convert assertions in previous commit

diff --git a/sw/source/filter/html/htmlatr.cxx b/sw/source/filter/html/htmlatr.cxx
index 3128881..c72b588 100644
--- a/sw/source/filter/html/htmlatr.cxx
+++ b/sw/source/filter/html/htmlatr.cxx
@@ -1233,7 +1233,7 @@ sal_uInt16 HTMLEndPosLst::_FindStartPos( const HTMLSttEndPos *pPos ) const
     for( i = 0; i < aStartLst.size() && aStartLst[i] != pPos;  i++ )
         ;
 
-    OSL_ENSURE( i != aStartLst.Count(), "Item nicht in Start-Liste gefunden!" );
+    OSL_ENSURE(i != aStartLst.size(), "Item not found in Start List!" );
 
     return i==aStartLst.size() ? USHRT_MAX : i;
 }
@@ -1245,7 +1245,7 @@ sal_uInt16 HTMLEndPosLst::_FindEndPos( const HTMLSttEndPos *pPos ) const
     for( i = 0; i < aEndLst.size() && aEndLst[i] != pPos;  i++ )
         ;
 
-    OSL_ENSURE( i != aEndLst.size(), "Item nicht in Ende-Liste gefunden" );
+    OSL_ENSURE(i != aEndLst.size(), "Item not found in End List!" );
 
     return i==aEndLst.size() ? USHRT_MAX : i;
 }
@@ -1693,8 +1693,8 @@ HTMLEndPosLst::HTMLEndPosLst( SwDoc *pD, SwDoc* pTempl,
 
 HTMLEndPosLst::~HTMLEndPosLst()
 {
-    OSL_ENSURE( !aStartLst.Count(), "Start-Liste im Destruktor nicht leer" );
-    OSL_ENSURE( !aEndLst.Count(), "End-Liste im Destruktor nicht leer" );
+    OSL_ENSURE(aStartLst.empty(), "Start List not empty in destructor");
+    OSL_ENSURE(aEndLst.empty(), "End List not empty in destructor");
 }
 
 
commit 81af96ea703b441639c103ecb85c1a861742504b
Author: Noel Grandin <noel at peralex.com>
Date:   Wed Apr 25 11:09:13 2012 +0200

    Convert SV_DECL_PTRARR(_HTMLEndLst) to std::vector

diff --git a/sw/source/filter/html/htmlatr.cxx b/sw/source/filter/html/htmlatr.cxx
index 02b3469..3128881 100644
--- a/sw/source/filter/html/htmlatr.cxx
+++ b/sw/source/filter/html/htmlatr.cxx
@@ -1123,8 +1123,7 @@ HTMLSttEndPos::~HTMLSttEndPos()
     delete pItem;
 }
 
-typedef HTMLSttEndPos *HTMLSttEndPosPtr;
-SV_DECL_PTRARR( _HTMLEndLst, HTMLSttEndPosPtr, 5 )
+typedef std::vector<HTMLSttEndPos *> _HTMLEndLst;
 
 enum HTMLOnOffState { HTML_NOT_SUPPORTED,   // nicht unterst. Attribut
                       HTML_REAL_VALUE,      // Attribut mit Wert
@@ -1222,7 +1221,7 @@ public:
     void OutEndAttrs( SwHTMLWriter& rHWrt, xub_StrLen nPos,
                       HTMLOutContext *pContext = 0 );
 
-    sal_uInt16 Count() const { return aEndLst.Count(); }
+    sal_uInt16 Count() const { return aEndLst.size(); }
 
     sal_Bool IsHTMLMode( sal_uLong nMode ) const { return (nHTMLMode & nMode) != 0; }
 };
@@ -1231,24 +1230,24 @@ public:
 sal_uInt16 HTMLEndPosLst::_FindStartPos( const HTMLSttEndPos *pPos ) const
 {
     sal_uInt16 i;
-    for( i = 0; i < aStartLst.Count() && aStartLst[i] != pPos;  i++ )
+    for( i = 0; i < aStartLst.size() && aStartLst[i] != pPos;  i++ )
         ;
 
     OSL_ENSURE( i != aStartLst.Count(), "Item nicht in Start-Liste gefunden!" );
 
-    return i==aStartLst.Count() ? USHRT_MAX : i;
+    return i==aStartLst.size() ? USHRT_MAX : i;
 }
 
 sal_uInt16 HTMLEndPosLst::_FindEndPos( const HTMLSttEndPos *pPos ) const
 {
     sal_uInt16 i;
 
-    for( i = 0; i < aEndLst.Count() && aEndLst[i] != pPos;  i++ )
+    for( i = 0; i < aEndLst.size() && aEndLst[i] != pPos;  i++ )
         ;
 
-    OSL_ENSURE( i != aEndLst.Count(), "Item nicht in Ende-Liste gefunden" );
+    OSL_ENSURE( i != aEndLst.size(), "Item nicht in Ende-Liste gefunden" );
 
-    return i==aEndLst.Count() ? USHRT_MAX : i;
+    return i==aEndLst.size() ? USHRT_MAX : i;
 }
 
 
@@ -1259,13 +1258,13 @@ void HTMLEndPosLst::_InsertItem( HTMLSttEndPos *pPos, sal_uInt16 nEndPos )
     xub_StrLen nStart = pPos->GetStart();
     sal_uInt16 i;
 
-    for( i = 0; i < aStartLst.Count() &&
+    for( i = 0; i < aStartLst.size() &&
                      aStartLst[i]->GetStart() <= nStart; i++ )
         ;
-    aStartLst.Insert( pPos, i );
+    aStartLst.insert( aStartLst.begin() + i, pPos );
 
     // die Position in der Ende-Liste wurde uebergeben
-    aEndLst.Insert( pPos, nEndPos );
+    aEndLst.insert( aEndLst.begin() + nEndPos, pPos );
 }
 
 void HTMLEndPosLst::_RemoveItem( sal_uInt16 nEndPos )
@@ -1275,9 +1274,9 @@ void HTMLEndPosLst::_RemoveItem( sal_uInt16 nEndPos )
     // jetzt Suchen wir es in der Start-Liste
     sal_uInt16 nStartPos = _FindStartPos( pPos );
     if( nStartPos != USHRT_MAX )
-        aStartLst.Remove( nStartPos, 1 );
+        aStartLst.erase( aStartLst.begin() + nStartPos );
 
-    aEndLst.Remove( nEndPos, 1 );
+    aEndLst.erase( aEndLst.begin() + nEndPos );
 
     delete pPos;
 }
@@ -1429,7 +1428,7 @@ HTMLOnOffState HTMLEndPosLst::GetHTMLItemState( const SfxPoolItem& rItem )
 
 sal_Bool HTMLEndPosLst::ExistsOnTagItem( sal_uInt16 nWhich, xub_StrLen nPos )
 {
-    for( sal_uInt16 i=0; i<aStartLst.Count(); i++ )
+    for( sal_uInt16 i=0; i<aStartLst.size(); i++ )
     {
         HTMLSttEndPos *pTest = aStartLst[i];
 
@@ -1465,7 +1464,7 @@ sal_Bool HTMLEndPosLst::ExistsOffTagItem( sal_uInt16 nWhich, xub_StrLen nStartPo
         return sal_False;
     }
 
-    for( sal_uInt16 i=0; i<aStartLst.Count(); i++ )
+    for( sal_uInt16 i=0; i<aStartLst.size(); i++ )
     {
         HTMLSttEndPos *pTest = aStartLst[i];
 
@@ -1505,17 +1504,17 @@ void HTMLEndPosLst::FixSplittedItem( HTMLSttEndPos *pPos, xub_StrLen nNewEnd,
     // das Item aus der End-Liste entfernen
     sal_uInt16 nEndPos = _FindEndPos( pPos );
     if( nEndPos != USHRT_MAX )
-        aEndLst.Remove( nEndPos, 1 );
+        aEndLst.erase( aEndLst.begin() + nEndPos );
 
     // es wird von nun an als letztes an der entsprechenden Position
     // beendet
-    for( nEndPos=0; nEndPos < aEndLst.Count() &&
+    for( nEndPos=0; nEndPos < aEndLst.size() &&
                     aEndLst[nEndPos]->GetEnd() <= nNewEnd; nEndPos++ )
         ;
-    aEndLst.Insert( pPos, nEndPos );
+    aEndLst.insert( aEndLst.begin() + nEndPos, pPos );
 
     // jetzt noch die spaeter gestarteten Attribute anpassen
-    for( sal_uInt16 i=nStartPos+1; i<aStartLst.Count(); i++ )
+    for( sal_uInt16 i=nStartPos+1; i<aStartLst.size(); i++ )
     {
         HTMLSttEndPos *pTest = aStartLst[i];
         xub_StrLen nTestEnd = pTest->GetEnd();
@@ -1536,11 +1535,11 @@ void HTMLEndPosLst::FixSplittedItem( HTMLSttEndPos *pPos, xub_StrLen nNewEnd,
             // das Attribut aus der End-Liste entfernen
             sal_uInt16 nEPos = _FindEndPos( pTest );
             if( nEPos != USHRT_MAX )
-                aEndLst.Remove( nEPos, 1 );
+                aEndLst.erase( aEndLst.begin() + nEPos );
 
             // es endet jetzt als erstes Attribut an der entsprechenden
             // Position. Diese Position in der Ende-Liste kennen wir schon.
-            aEndLst.Insert(pTest, nEndPos );
+            aEndLst.insert( aEndLst.begin() + nEndPos, pTest );
 
             // den "Rest" des Attributs neu einfuegen
             InsertItem( *pTest->GetItem(), nNewEnd, nTestEnd );
@@ -1553,7 +1552,7 @@ void HTMLEndPosLst::InsertItem( const SfxPoolItem& rItem, xub_StrLen nStart,
                                                           xub_StrLen nEnd )
 {
     sal_uInt16 i;
-    for( i = 0; i < aEndLst.Count(); i++ )
+    for( i = 0; i < aEndLst.size(); i++ )
     {
         HTMLSttEndPos *pTest = aEndLst[i];
         xub_StrLen nTestEnd = pTest->GetEnd();
@@ -1591,7 +1590,7 @@ void HTMLEndPosLst::SplitItem( const SfxPoolItem& rItem, xub_StrLen nStart,
     // erstmal muessen wir die alten Items anhand der Startliste suchen
     // und die neuen Item-Bereiche festlegen
 
-    for( sal_uInt16 i=0; i<aStartLst.Count(); i++ )
+    for( sal_uInt16 i=0; i<aStartLst.size(); i++ )
     {
         HTMLSttEndPos *pTest = aStartLst[i];
         xub_StrLen nTestStart = pTest->GetStart();
@@ -1626,12 +1625,12 @@ void HTMLEndPosLst::SplitItem( const SfxPoolItem& rItem, xub_StrLen nStart,
                     // das Test-Item beginnt erst hinter dem neuen
                     // Ende des Attribts und kann deshalb komplett
                     // geloescht werden
-                    aStartLst.Remove( i, 1 );
+                    aStartLst.erase( aStartLst.begin() + i );
                     i--;
 
                     sal_uInt16 nEndPos = _FindEndPos( pTest );
                     if( nEndPos != USHRT_MAX )
-                        aEndLst.Remove( nEndPos, 1 );
+                        aEndLst.erase( aEndLst.begin() + nEndPos );
                 }
 
                 // ggf den zweiten Teil des gesplitteten Attribts einfuegen
@@ -1991,7 +1990,7 @@ void HTMLEndPosLst::OutStartAttrs( SwHTMLWriter& rHWrt, xub_StrLen nPos,
     rHWrt.bTagOn = sal_True;
 
     // die Attribute in der Start-Liste sind aufsteigend sortiert
-    for( sal_uInt16 i=0; i< aStartLst.Count(); i++ )
+    for( sal_uInt16 i=0; i< aStartLst.size(); i++ )
     {
         HTMLSttEndPos *pPos = aStartLst[i];
         xub_StrLen nStart = pPos->GetStart();
@@ -2029,7 +2028,7 @@ void HTMLEndPosLst::OutEndAttrs( SwHTMLWriter& rHWrt, xub_StrLen nPos,
 
     // die Attribute in der End-Liste sind aufsteigend sortiert
     sal_uInt16 i=0;
-    while( i < aEndLst.Count() )
+    while( i < aEndLst.size() )
     {
         HTMLSttEndPos *pPos = aEndLst[i];
         xub_StrLen nEnd = pPos->GetEnd();
commit 6cc15957de9688f92b66457adc22534a883d26dc
Author: Noel Grandin <noel at peralex.com>
Date:   Wed Apr 25 10:57:49 2012 +0200

    Convert SV_DECL_PTRARR(SwHTMLTxtFtns) to std::vector

diff --git a/sw/source/filter/html/htmlftn.cxx b/sw/source/filter/html/htmlftn.cxx
index 4ca1581..9b85c92 100644
--- a/sw/source/filter/html/htmlftn.cxx
+++ b/sw/source/filter/html/htmlftn.cxx
@@ -40,9 +40,6 @@
 #include "swhtml.hxx"
 #include "wrthtml.hxx"
 
-typedef SwTxtFtn *SwTxtFtnPtr;
-SV_DECL_PTRARR( SwHTMLTxtFtns, SwTxtFtnPtr, 1 )
-
 struct SwHTMLFootEndNote_Impl
 {
     SwHTMLTxtFtns aTxtFtns;
@@ -226,9 +223,7 @@ void SwHTMLParser::FinishFootEndNote()
     // In Kopf- und Fusszeilen duerfen keine Fussnoten eingefuegt werden.
     if( pTxtFtn )
     {
-        pFootEndNoteImpl->aTxtFtns.Insert( pTxtFtn,
-                                           pFootEndNoteImpl->aTxtFtns.Count() );
-
+        pFootEndNoteImpl->aTxtFtns.push_back( pTxtFtn );
         pFootEndNoteImpl->aNames.push_back(pFootEndNoteImpl->sName);
     }
     pFootEndNoteImpl->sName = aEmptyStr;
@@ -264,7 +259,7 @@ SwNodeIndex *SwHTMLParser::GetFootEndNoteSection( const String& rName )
             {
                 pStartNodeIdx = pFootEndNoteImpl->aTxtFtns[i]->GetStartNode();
                 pFootEndNoteImpl->aNames.erase(pFootEndNoteImpl->aNames.begin() + i);
-                pFootEndNoteImpl->aTxtFtns.Remove( i, 1 );
+                pFootEndNoteImpl->aTxtFtns.erase( pFootEndNoteImpl->aTxtFtns.begin() + i );
                 if(pFootEndNoteImpl->aNames.empty())
                 {
                     delete pFootEndNoteImpl;
@@ -292,7 +287,7 @@ Writer& OutHTML_SwFmtFtn( Writer& rWrt, const SfxPoolItem& rHt )
     sal_uInt16 nPos;
     if( rFmtFtn.IsEndNote() )
     {
-        nPos = rHTMLWrt.pFootEndNotes ? rHTMLWrt.pFootEndNotes->Count() : 0;
+        nPos = rHTMLWrt.pFootEndNotes ? rHTMLWrt.pFootEndNotes->size() : 0;
         OSL_ENSURE( nPos == rHTMLWrt.nFootNote + rHTMLWrt.nEndNote,
                 "OutHTML_SwFmtFtn: Position falsch" );
         sClass.AssignAscii( OOO_STRING_SVTOOLS_HTML_sdendnote_anc );
@@ -309,7 +304,7 @@ Writer& OutHTML_SwFmtFtn( Writer& rWrt, const SfxPoolItem& rHt )
 
     if( !rHTMLWrt.pFootEndNotes )
         rHTMLWrt.pFootEndNotes = new SwHTMLTxtFtns;
-    rHTMLWrt.pFootEndNotes->Insert( pTxtFtn, nPos );
+    rHTMLWrt.pFootEndNotes->insert( rHTMLWrt.pFootEndNotes->begin() + nPos, pTxtFtn );
 
     rtl::OStringBuffer sOut;
     sOut.append('<').append(OOO_STRING_SVTOOLS_HTML_anchor).append(' ')
@@ -350,7 +345,7 @@ void SwHTMLWriter::OutFootEndNotes()
 #endif
     nFootNote = 0, nEndNote = 0;
 
-    for( sal_uInt16 i=0; i<pFootEndNotes->Count(); i++ )
+    for( sal_uInt16 i=0; i<pFootEndNotes->size(); i++ )
     {
         SwTxtFtn *pTxtFtn = (*pFootEndNotes)[i];
         pFmtFtn = &pTxtFtn->GetFtn();
diff --git a/sw/source/filter/html/wrthtml.hxx b/sw/source/filter/html/wrthtml.hxx
index e659b8f..2b328e4 100644
--- a/sw/source/filter/html/wrthtml.hxx
+++ b/sw/source/filter/html/wrthtml.hxx
@@ -61,7 +61,9 @@ class SvxBrushItem;
 class SvxFontItem;
 class SwHTMLNumRuleInfo;
 class SwHTMLPosFlyFrms;
-class SwHTMLTxtFtns;
+class SwTxtFtn;
+
+typedef std::vector<SwTxtFtn *> SwHTMLTxtFtns;
 
 extern SwAttrFnTab aHTMLAttrFnTab;
 
commit e79a62e1be9a1c10ac84b10a23b5b10362732d0a
Author: Noel Grandin <noel at peralex.com>
Date:   Tue Apr 24 17:49:25 2012 +0200

    Convert SV_DECL_PTRARR_SORT_DEL(SwHTMLFmtInfos) to boost::ptr_set
    
    I had to move "struct SwHTMLFmtInfo" from htmlatr.cxx to
    wrthtml.hxx because there are clear() calls in wrthtml.cxx
    and ptr_set needs the full declaration to be visible.

diff --git a/sw/source/filter/html/htmlatr.cxx b/sw/source/filter/html/htmlatr.cxx
index 9affe00..02b3469 100644
--- a/sw/source/filter/html/htmlatr.cxx
+++ b/sw/source/filter/html/htmlatr.cxx
@@ -259,54 +259,6 @@ SwHTMLTxtCollOutputInfo::~SwHTMLTxtCollOutputInfo()
     delete pItemSet;
 }
 
-struct SwHTMLFmtInfo
-{
-    const SwFmt *pFmt;      // das Format selbst
-    const SwFmt *pRefFmt;   // das Vergleichs-Format
-
-    rtl::OString aToken;          // das auszugebende Token
-    String aClass;          // die auszugebende Klasse
-
-    SfxItemSet *pItemSet;   // der auszugebende Attribut-Set
-
-    sal_Int32 nLeftMargin;      // ein par default-Werte fuer
-    sal_Int32 nRightMargin; // Absatz-Vorlagen
-    short nFirstLineIndent;
-
-    sal_uInt16 nTopMargin;
-    sal_uInt16 nBottomMargin;
-
-    sal_Bool bScriptDependent;
-
-    // Konstruktor fuer einen Dummy zum Suchen
-    SwHTMLFmtInfo( const SwFmt *pF ) :
-        pFmt( pF ), pRefFmt(0), pItemSet( 0 ), nFirstLineIndent(0)
-    {}
-
-
-    // Konstruktor zum Erstellen der Format-Info
-    SwHTMLFmtInfo( const SwFmt *pFmt, SwDoc *pDoc, SwDoc *pTemlate,
-                   sal_Bool bOutStyles, LanguageType eDfltLang=LANGUAGE_DONTKNOW,
-                   sal_uInt16 nScript=CSS1_OUTMODE_ANY_SCRIPT,
-                   sal_Bool bHardDrop=sal_False );
-    ~SwHTMLFmtInfo();
-
-    friend sal_Bool operator==( const SwHTMLFmtInfo& rInfo1,
-                            const SwHTMLFmtInfo& rInfo2 )
-    {
-        return (long)rInfo1.pFmt == (long)rInfo2.pFmt;
-    }
-
-    friend sal_Bool operator<( const SwHTMLFmtInfo& rInfo1,
-                            const SwHTMLFmtInfo& rInfo2 )
-    {
-        return (long)rInfo1.pFmt < (long)rInfo2.pFmt;
-    }
-
-};
-
-SV_IMPL_OP_PTRARR_SORT( SwHTMLFmtInfos, SwHTMLFmtInfo* )
-
 SwHTMLFmtInfo::SwHTMLFmtInfo( const SwFmt *pF, SwDoc *pDoc, SwDoc *pTemplate,
                               sal_Bool bOutStyles,
                               LanguageType eDfltLang,
@@ -597,11 +549,11 @@ void OutHTML_SwFmt( Writer& rWrt, const SwFmt& rFmt,
 
     // Jetzt holen wir das Token und ggf. die Klasse
     SwHTMLFmtInfo aFmtInfo( &rFmt );
-    sal_uInt16 nArrayPos;
-    const SwHTMLFmtInfo *pFmtInfo;
-    if( rHWrt.aTxtCollInfos.Seek_Entry( &aFmtInfo, &nArrayPos ) )
+    SwHTMLFmtInfo *pFmtInfo;
+    SwHTMLFmtInfos::iterator it = rHWrt.aTxtCollInfos.find( aFmtInfo );
+    if( it != rHWrt.aTxtCollInfos.end() )
     {
-        pFmtInfo = rHWrt.aTxtCollInfos[nArrayPos];
+        pFmtInfo = &*it;
     }
     else
     {
@@ -609,7 +561,7 @@ void OutHTML_SwFmt( Writer& rWrt, const SwFmt& rFmt,
                                       rHWrt.bCfgOutStyles, rHWrt.eLang,
                                       rHWrt.nCSS1Script,
                                       false );
-        rHWrt.aTxtCollInfos.C40_PTR_INSERT( SwHTMLFmtInfo, pFmtInfo );
+        rHWrt.aTxtCollInfos.insert( pFmtInfo );
         String aName( rFmt.GetName() );
         if( 0 != rHWrt.aScriptParaStyles.count( aName ) )
             ((SwHTMLFmtInfo *)pFmtInfo)->bScriptDependent = sal_True;
@@ -1698,18 +1650,18 @@ void HTMLEndPosLst::SplitItem( const SfxPoolItem& rItem, xub_StrLen nStart,
 const SwHTMLFmtInfo *HTMLEndPosLst::GetFmtInfo( const SwFmt& rFmt,
                                                 SwHTMLFmtInfos& rFmtInfos )
 {
-    const SwHTMLFmtInfo *pFmtInfo;
-    SwHTMLFmtInfo aFmtInfo( &rFmt );
-    sal_uInt16 nPos;
-    if( rFmtInfos.Seek_Entry( &aFmtInfo, &nPos ) )
+    SwHTMLFmtInfo *pFmtInfo;
+    const SwHTMLFmtInfo aFmtInfo( &rFmt );
+    SwHTMLFmtInfos::iterator it = rFmtInfos.find( aFmtInfo );
+    if( it != rFmtInfos.end() )
     {
-        pFmtInfo = rFmtInfos[nPos];
+        pFmtInfo = &*it;
     }
     else
     {
         pFmtInfo = new SwHTMLFmtInfo( &rFmt, pDoc, pTemplate,
                                       bOutStyles );
-        rFmtInfos.C40_PTR_INSERT( SwHTMLFmtInfo, pFmtInfo );
+        rFmtInfos.insert( pFmtInfo );
         String aName( rFmt.GetName() );
         if( 0 != rScriptTxtStyles.count( aName ) )
             ((SwHTMLFmtInfo *)pFmtInfo)->bScriptDependent = sal_True;
@@ -3004,10 +2956,10 @@ Writer& OutHTML_INetFmt( Writer& rWrt, const SwFmtINetFmt& rINetFmt, sal_Bool bO
         const SwCharFmt* pFmt = rWrt.pDoc->GetCharFmtFromPool(
                  RES_POOLCHR_INET_NORMAL );
         SwHTMLFmtInfo aFmtInfo( pFmt );
-        sal_uInt16 nPos;
-        if( rHTMLWrt.aChrFmtInfos.Seek_Entry( &aFmtInfo, &nPos ) )
+        SwHTMLFmtInfos::const_iterator it = rHTMLWrt.aChrFmtInfos.find( aFmtInfo );
+        if( it != rHTMLWrt.aChrFmtInfos.end() )
         {
-            bScriptDependent = rHTMLWrt.aChrFmtInfos[nPos]->bScriptDependent;
+            bScriptDependent = it->bScriptDependent;
         }
     }
     if( !bScriptDependent )
@@ -3015,10 +2967,10 @@ Writer& OutHTML_INetFmt( Writer& rWrt, const SwFmtINetFmt& rINetFmt, sal_Bool bO
         const SwCharFmt* pFmt = rWrt.pDoc->GetCharFmtFromPool(
                  RES_POOLCHR_INET_VISIT );
         SwHTMLFmtInfo aFmtInfo( pFmt );
-        sal_uInt16 nPos;
-        if( rHTMLWrt.aChrFmtInfos.Seek_Entry( &aFmtInfo, &nPos ) )
+        SwHTMLFmtInfos::const_iterator it = rHTMLWrt.aChrFmtInfos.find( aFmtInfo );
+        if( it != rHTMLWrt.aChrFmtInfos.end() )
         {
-            bScriptDependent = rHTMLWrt.aChrFmtInfos[nPos]->bScriptDependent;
+            bScriptDependent = it->bScriptDependent;
         }
     }
 
@@ -3162,11 +3114,11 @@ static Writer& OutHTML_SwTxtCharFmt( Writer& rWrt, const SfxPoolItem& rHt )
     }
 
     SwHTMLFmtInfo aFmtInfo( pFmt );
-    sal_uInt16 nPos;
-    if( !rHTMLWrt.aChrFmtInfos.Seek_Entry( &aFmtInfo, &nPos ) )
+    SwHTMLFmtInfos::const_iterator it = rHTMLWrt.aChrFmtInfos.find( aFmtInfo );
+    if( it == rHTMLWrt.aChrFmtInfos.end())
         return rWrt;
 
-    const SwHTMLFmtInfo *pFmtInfo = rHTMLWrt.aChrFmtInfos[nPos];
+    const SwHTMLFmtInfo *pFmtInfo = &*it;
     OSL_ENSURE( pFmtInfo, "Wieso gint es keine Infos ueber die Zeichenvorlage?" );
 
     if( rHTMLWrt.bTagOn )
diff --git a/sw/source/filter/html/wrthtml.cxx b/sw/source/filter/html/wrthtml.cxx
index 346247f..0b24ee8 100644
--- a/sw/source/filter/html/wrthtml.cxx
+++ b/sw/source/filter/html/wrthtml.cxx
@@ -386,11 +386,11 @@ sal_uLong SwHTMLWriter::WriteStream()
     if( aHTMLControls.Count() )
         aHTMLControls.DeleteAndDestroy( sal_uInt16(0), aHTMLControls.Count() );
 
-    if( aChrFmtInfos.Count() )
-        aChrFmtInfos.DeleteAndDestroy( sal_uInt16(0), aChrFmtInfos.Count() );
+    if( !aChrFmtInfos.empty() )
+        aChrFmtInfos.clear();
 
-    if( aTxtCollInfos.Count() )
-        aTxtCollInfos.DeleteAndDestroy( sal_uInt16(0), aTxtCollInfos.Count() );
+    if( !aTxtCollInfos.empty() )
+        aTxtCollInfos.clear();
 
     if(!aImgMapNames.empty())
         aImgMapNames.clear();
diff --git a/sw/source/filter/html/wrthtml.hxx b/sw/source/filter/html/wrthtml.hxx
index 3b45a3c..e659b8f 100644
--- a/sw/source/filter/html/wrthtml.hxx
+++ b/sw/source/filter/html/wrthtml.hxx
@@ -29,6 +29,7 @@
 #define _WRTHTML_HXX
 
 #include <boost/ptr_container/ptr_vector.hpp>
+#include <boost/ptr_container/ptr_set.hpp>
 #include <vector>
 
 #include <com/sun/star/container/XIndexContainer.hpp>
@@ -192,8 +193,53 @@ struct HTMLControl;
 SV_DECL_PTRARR_SORT_DEL( HTMLControls, HTMLControl*, 1 )
 typedef std::vector<SwFmtINetFmt*> INetFmts;
 
-struct SwHTMLFmtInfo;
-SV_DECL_PTRARR_SORT_DEL( SwHTMLFmtInfos, SwHTMLFmtInfo*, 1 )
+struct SwHTMLFmtInfo
+{
+    const SwFmt *pFmt;      // das Format selbst
+    const SwFmt *pRefFmt;   // das Vergleichs-Format
+
+    rtl::OString aToken;          // das auszugebende Token
+    String aClass;          // die auszugebende Klasse
+
+    SfxItemSet *pItemSet;   // der auszugebende Attribut-Set
+
+    sal_Int32 nLeftMargin;      // ein par default-Werte fuer
+    sal_Int32 nRightMargin; // Absatz-Vorlagen
+    short nFirstLineIndent;
+
+    sal_uInt16 nTopMargin;
+    sal_uInt16 nBottomMargin;
+
+    sal_Bool bScriptDependent;
+
+    // Konstruktor fuer einen Dummy zum Suchen
+    SwHTMLFmtInfo( const SwFmt *pF ) :
+        pFmt( pF ), pRefFmt(0), pItemSet( 0 ), nFirstLineIndent(0)
+    {}
+
+
+    // Konstruktor zum Erstellen der Format-Info
+    SwHTMLFmtInfo( const SwFmt *pFmt, SwDoc *pDoc, SwDoc *pTemlate,
+                   sal_Bool bOutStyles, LanguageType eDfltLang=LANGUAGE_DONTKNOW,
+                   sal_uInt16 nScript=CSS1_OUTMODE_ANY_SCRIPT,
+                   sal_Bool bHardDrop=sal_False );
+    ~SwHTMLFmtInfo();
+
+    friend sal_Bool operator==( const SwHTMLFmtInfo& rInfo1,
+                            const SwHTMLFmtInfo& rInfo2 )
+    {
+        return (long)rInfo1.pFmt == (long)rInfo2.pFmt;
+    }
+
+    friend sal_Bool operator<( const SwHTMLFmtInfo& rInfo1,
+                            const SwHTMLFmtInfo& rInfo2 )
+    {
+        return (long)rInfo1.pFmt < (long)rInfo2.pFmt;
+    }
+
+};
+
+typedef boost::ptr_set<SwHTMLFmtInfo> SwHTMLFmtInfos;
 
 class IDocumentStylePoolAccess;
 
commit 420e3e21c57a5a49b3ff8fd9fe47cddbdcc4286e
Author: Michael Stahl <mstahl at redhat.com>
Date:   Tue May 8 17:42:53 2012 +0200

    fix debug code in previous 3 commits

diff --git a/sw/source/filter/html/htmltab.cxx b/sw/source/filter/html/htmltab.cxx
index 6024686..796406c 100644
--- a/sw/source/filter/html/htmltab.cxx
+++ b/sw/source/filter/html/htmltab.cxx
@@ -831,8 +831,8 @@ HTMLTableRow::HTMLTableRow( sal_uInt16 nCells ):
         pCells->push_back( new HTMLTableCell );
     }
 
-    OSL_ENSURE( nCells==pCells->Count(),
-            "Zellenzahl in neuer HTML-Tabellenzeile stimmt nicht" );
+    OSL_ENSURE(nCells == pCells->size(),
+            "wrong Cell count in new HTML table row");
 }
 
 HTMLTableRow::~HTMLTableRow()
@@ -871,16 +871,16 @@ void HTMLTableRow::Expand( sal_uInt16 nCells, sal_Bool bOneCell )
         nColSpan--;
     }
 
-    OSL_ENSURE( nCells==pCells->Count(),
-            "Zellenzahl in expandierter HTML-Tabellenzeile stimmt nicht" );
+    OSL_ENSURE(nCells == pCells->size(),
+            "wrong Cell count in expanded HTML table row");
 }
 
 void HTMLTableRow::Shrink( sal_uInt16 nCells )
 {
-    OSL_ENSURE( nCells < pCells->Count(), "Anzahl Zellen falsch" );
+    OSL_ENSURE(nCells < pCells->size(), "number of cells too large");
 
 #if OSL_DEBUG_LEVEL > 0
-     sal_uInt16 nEnd = pCells->Count();
+     sal_uInt16 nEnd = pCells->size();
 #endif
     // The colspan of empty cells at the end has to be fixed to the new
     // number of cells.
@@ -902,7 +902,7 @@ void HTMLTableRow::Shrink( sal_uInt16 nCells )
 #if OSL_DEBUG_LEVEL > 0
     for( i=nCells; i<nEnd; i++ )
     {
-        HTMLTableCell *pCell = (*pCells)[i];
+        HTMLTableCell *pCell = &(*pCells)[i];
         OSL_ENSURE( pCell->GetRowSpan() == 1,
                 "RowSpan von zu loesender Zelle ist falsch" );
         OSL_ENSURE( pCell->GetColSpan() == nEnd - i,
@@ -2084,13 +2084,11 @@ sal_uInt16 HTMLTable::GetBorderWidth( const SvxBorderLine& rBLine,
 inline HTMLTableCell *HTMLTable::GetCell( sal_uInt16 nRow,
                                           sal_uInt16 nCell ) const
 {
-    OSL_ENSURE( nRow<pRows->Count(),
-        "ungueltiger Zeilen-Index in HTML-Tabelle" );
+    OSL_ENSURE(nRow < pRows->size(), "invalid row index in HTML table");
     return (*pRows)[nRow].GetCell( nCell );
 }
 
 
-
 SvxAdjust HTMLTable::GetInheritedAdjust() const
 {
     SvxAdjust eAdjust = (nCurCol<nCols ? ((*pColumns)[nCurCol]).GetAdjust()
@@ -2141,8 +2139,8 @@ void HTMLTable::InsertCell( HTMLTableCnts *pCnts,
         for( i=0; i<nRows; i++ )
             (*pRows)[i].Expand( nColsReq, i<nCurRow );
         nCols = nColsReq;
-        OSL_ENSURE( pColumns->Count()==nCols,
-                "Anzahl der Spalten nach Expandieren stimmt nicht" );
+        OSL_ENSURE(pColumns->size() == nCols,
+                "wrong number of columns after expanding");
     }
     if( nColsReq > nFilledCols )
         nFilledCols = nColsReq;
@@ -2154,7 +2152,7 @@ void HTMLTable::InsertCell( HTMLTableCnts *pCnts,
         for( i=nRows; i<nRowsReq; i++ )
             pRows->push_back( new HTMLTableRow(nCols) );
         nRows = nRowsReq;
-        OSL_ENSURE( nRows==pRows->Count(), "Zeilenzahl in Insert stimmt nicht" );
+        OSL_ENSURE(nRows == pRows->size(), "wrong number of rows in Insert");
     }
 
     // Testen, ob eine Ueberschneidung vorliegt und diese
commit c2258ab6f47a04f0761d8a34bd1c6123d8ac306b
Author: Noel Grandin <noel at peralex.com>
Date:   Tue Apr 24 17:20:46 2012 +0200

    Convert SV_DECL_PTRARR_DEL(HTMLTableCells) boost::ptr_vector

diff --git a/sw/source/filter/html/htmltab.cxx b/sw/source/filter/html/htmltab.cxx
index b059384..6024686 100644
--- a/sw/source/filter/html/htmltab.cxx
+++ b/sw/source/filter/html/htmltab.cxx
@@ -280,8 +280,7 @@ public:
 
 
 // Row of a HTML table
-typedef HTMLTableCell* HTMLTableCellPtr;
-SV_DECL_PTRARR_DEL(HTMLTableCells,HTMLTableCellPtr,5)
+typedef boost::ptr_vector<HTMLTableCell> HTMLTableCells;
 
 class HTMLTableRow
 {
@@ -661,8 +660,6 @@ public:
     sal_Bool IsOverflowing() const { return nBoxes > 64000; }
 };
 
-SV_IMPL_PTRARR(HTMLTableCells,HTMLTableCellPtr)
-
 
 
 void HTMLTableCnts::InitCtor()
@@ -831,7 +828,7 @@ HTMLTableRow::HTMLTableRow( sal_uInt16 nCells ):
 {
     for( sal_uInt16 i=0; i<nCells; i++ )
     {
-        pCells->Insert( new HTMLTableCell, pCells->Count() );
+        pCells->push_back( new HTMLTableCell );
     }
 
     OSL_ENSURE( nCells==pCells->Count(),
@@ -852,9 +849,9 @@ inline void HTMLTableRow::SetHeight( sal_uInt16 nHght )
 
 inline HTMLTableCell *HTMLTableRow::GetCell( sal_uInt16 nCell ) const
 {
-    OSL_ENSURE( nCell<pCells->Count(),
+    OSL_ENSURE( nCell<pCells->size(),
         "ungueltiger Zellen-Index in HTML-Tabellenzeile" );
-    return (*pCells)[nCell];
+    return &(*pCells)[nCell];
 }
 
 void HTMLTableRow::Expand( sal_uInt16 nCells, sal_Bool bOneCell )
@@ -863,14 +860,14 @@ void HTMLTableRow::Expand( sal_uInt16 nCells, sal_Bool bOneCell )
     // bOneCell gesetzt ist. Das geht, nur fuer Zeilen, in die keine
     // Zellen mehr eingefuegt werden!
 
-    sal_uInt16 nColSpan = nCells-pCells->Count();
-    for( sal_uInt16 i=pCells->Count(); i<nCells; i++ )
+    sal_uInt16 nColSpan = nCells-pCells->size();
+    for( sal_uInt16 i=pCells->size(); i<nCells; i++ )
     {
         HTMLTableCell *pCell = new HTMLTableCell;
         if( bOneCell )
             pCell->SetColSpan( nColSpan );
 
-        pCells->Insert( pCell, pCells->Count() );
+        pCells->push_back( pCell );
         nColSpan--;
     }
 
@@ -890,7 +887,7 @@ void HTMLTableRow::Shrink( sal_uInt16 nCells )
     sal_uInt16 i=nCells;
     while( i )
     {
-        HTMLTableCell *pCell = (*pCells)[--i];
+        HTMLTableCell *pCell = &(*pCells)[--i];
         if( !pCell->GetContents() )
         {
 #if OSL_DEBUG_LEVEL > 0
@@ -914,7 +911,7 @@ void HTMLTableRow::Shrink( sal_uInt16 nCells )
     }
 #endif
 
-    pCells->DeleteAndDestroy( nCells, pCells->Count()-nCells );
+    pCells->erase( pCells->begin() + nCells, pCells->end() );
 }
 
 
commit 5046b3b68f95003f460d008e34829e52c7572e62
Author: Noel Grandin <noel at peralex.com>
Date:   Tue Apr 24 17:14:51 2012 +0200

    Convert SV_DECL_PTRARR_DEL(HTMLTableRows) to boost::ptr_vector

diff --git a/sw/source/filter/html/htmltab.cxx b/sw/source/filter/html/htmltab.cxx
index 91a968b..b059384 100644
--- a/sw/source/filter/html/htmltab.cxx
+++ b/sw/source/filter/html/htmltab.cxx
@@ -380,8 +380,7 @@ public:
 
 
 // HTML table
-typedef HTMLTableRow* HTMLTableRowPtr;
-SV_DECL_PTRARR_DEL(HTMLTableRows,HTMLTableRowPtr,5)
+typedef boost::ptr_vector<HTMLTableRow> HTMLTableRows;
 
 typedef boost::ptr_vector<HTMLTableColumn> HTMLTableColumns;
 
@@ -663,7 +662,6 @@ public:
 };
 
 SV_IMPL_PTRARR(HTMLTableCells,HTMLTableCellPtr)
-SV_IMPL_PTRARR(HTMLTableRows,HTMLTableRowPtr)
 
 
 
@@ -1175,7 +1173,7 @@ SwHTMLTableLayout *HTMLTable::CreateLayoutInfo()
     sal_uInt16 i;
     for( i=0; i<nRows; i++ )
     {
-        HTMLTableRow *pRow = (*pRows)[i];
+        HTMLTableRow *pRow = &(*pRows)[i];
         for( sal_uInt16 j=0; j<nCols; j++ )
         {
             SwHTMLTableLayoutCell *pLayoutCell =
@@ -1254,7 +1252,7 @@ const SwStartNode* HTMLTable::GetPrevBoxStartNode( sal_uInt16 nRow, sal_uInt16 n
     else
     {
         sal_uInt16 i;
-        HTMLTableRow *pPrevRow = (*pRows)[nRow-1];
+        HTMLTableRow *pPrevRow = &(*pRows)[nRow-1];
 
         // evtl. eine Zelle in der aktuellen Zeile
         i = nCol;
@@ -1326,7 +1324,7 @@ sal_uInt16 HTMLTable::GetTopCellSpace( sal_uInt16 nRow, sal_uInt16 nRowSpan,
                 nSpace = nTopBorderWidth;
         }
     }
-    else if( bSwBorders && ((*pRows)[nRow+nRowSpan-1])->bBottomBorder &&
+    else if( bSwBorders && (*pRows)[nRow+nRowSpan-1].bBottomBorder &&
              nSpace < MIN_BORDER_DIST )
     {
         OSL_ENSURE( !nCellPadding, "GetTopCellSpace: CELLPADDING!=0" );
@@ -1359,7 +1357,7 @@ sal_uInt16 HTMLTable::GetBottomCellSpace( sal_uInt16 nRow, sal_uInt16 nRowSpan,
     }
     else if( bSwBorders )
     {
-        if( ((*pRows)[nRow+nRowSpan+1])->bBottomBorder )
+        if( (*pRows)[nRow+nRowSpan+1].bBottomBorder )
         {
             sal_uInt16 nBorderWidth = GetBorderWidth( aBorderLine, sal_True );
             if( nSpace < nBorderWidth )
@@ -1417,7 +1415,7 @@ void HTMLTable::FixFrameFmt( SwTableBox *pBox,
             // die Line von der GC (zu Recht) wegoptimiert wird.
             if( nRowSpan > 1 || (this != pTopTable && nRowSpan==nRows) )
             {
-                pBGBrushItem = ((*pRows)[nRow])->GetBGBrush();
+                pBGBrushItem = (*pRows)[nRow].GetBGBrush();
                 if( !pBGBrushItem && this != pTopTable )
                 {
                     pBGBrushItem = GetBGBrush();
@@ -1428,9 +1426,9 @@ void HTMLTable::FixFrameFmt( SwTableBox *pBox,
         }
 
         bTopLine = 0==nRow && bTopBorder && bFirstPara;
-        if( ((*pRows)[nRow+nRowSpan-1])->bBottomBorder && bLastPara )
+        if( (*pRows)[nRow+nRowSpan-1].bBottomBorder && bLastPara )
         {
-            nEmptyRows = ((*pRows)[nRow+nRowSpan-1])->GetEmptyRows();
+            nEmptyRows = (*pRows)[nRow+nRowSpan-1].GetEmptyRows();
             if( nRow+nRowSpan == nRows )
                 bLastBottomLine = sal_True;
             else
@@ -1691,7 +1689,7 @@ SwTableLine *HTMLTable::MakeTableLine( SwTableBox *pUpper,
                                                      : pLineFmt,
                                  0, pUpper );
 
-    HTMLTableRow *pTopRow = (*pRows)[nTopRow];
+    HTMLTableRow *pTopRow = &(*pRows)[nTopRow];
     sal_uInt16 nRowHeight = pTopRow->GetHeight();
     const SvxBrushItem *pBGBrushItem = 0;

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list