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

Nigel Hawkins nhawkins at kemper.freedesktop.org
Wed Jul 6 00:58:24 PDT 2011


 sw/source/core/layout/laycache.cxx |   18 +++++++++---------
 sw/source/core/layout/layhelp.hxx  |    7 +++----
 sw/source/filter/html/htmlplug.cxx |    6 +++---
 sw/source/filter/ww8/escher.hxx    |    2 +-
 sw/source/filter/ww8/wrtw8esh.cxx  |    5 ++---
 5 files changed, 18 insertions(+), 20 deletions(-)

New commits:
commit a9ec35b6629e86fd58dc65295a1a95e9401a4425
Author: Nigel Hawkins <n.hawkins at gmx.com>
Date:   Fri Jun 17 15:28:40 2011 +0100

    Replace SvULongs with vector in escher.hxx
    
    Also cascaded change in wrt8esh.cxx. LGPL3+/MPL1.1

diff --git a/sw/source/filter/ww8/escher.hxx b/sw/source/filter/ww8/escher.hxx
index 076fd3b..550e22f 100644
--- a/sw/source/filter/ww8/escher.hxx
+++ b/sw/source/filter/ww8/escher.hxx
@@ -139,7 +139,7 @@ private:
 class SwEscherEx : public SwBasicEscherEx
 {
 private:
-    SvULongs aFollowShpIds;
+    std::vector<sal_uLong> aFollowShpIds;
     EscherExHostAppData aHostData;
     WinwordAnchoring aWinwordAnchoring;
     WW8_WrPlcTxtBoxes *pTxtBxs;
diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx
index 2023d7f..7f5648f 100644
--- a/sw/source/filter/ww8/wrtw8esh.cxx
+++ b/sw/source/filter/ww8/wrtw8esh.cxx
@@ -2717,8 +2717,7 @@ void SwEscherEx::MakeZOrderArrAndFollowIds(
     ::lcl_makeZOrderArray(rWrt, rSrcArr, rDstArr);
 
     //Now set up the follow IDs
-    if (aFollowShpIds.Count())
-        aFollowShpIds.Remove(0, aFollowShpIds.Count());
+    aFollowShpIds.clear();
 
     for (size_t n = 0; n < rDstArr.size(); ++n)
     {
@@ -2734,7 +2733,7 @@ void SwEscherEx::MakeZOrderArrAndFollowIds(
 
         sal_uLong nShapeId = bNeedsShapeId ? GenerateShapeId() : 0;
 
-        aFollowShpIds.Insert(nShapeId, n);
+        aFollowShpIds.push_back(nShapeId);
     }
 }
 
commit 9ddf56a34ba170c4ef600084584420814cf80b07
Author: Nigel Hawkins <n.hawkins at gmx.com>
Date:   Fri Jun 17 15:20:07 2011 +0100

    Replace SvULongs with vector in laycache.cxx and layhelp.hxx. LGPL3+/MPL1.1

diff --git a/sw/source/core/layout/laycache.cxx b/sw/source/core/layout/laycache.cxx
index 71abd96..9b07744 100644
--- a/sw/source/core/layout/laycache.cxx
+++ b/sw/source/core/layout/laycache.cxx
@@ -103,7 +103,7 @@ void SwLayoutCache::Read( SvStream &rStream )
 void SwLayCacheImpl::Insert( sal_uInt16 nType, sal_uLong nIndex, xub_StrLen nOffset )
 {
     aType.Insert( nType, aType.Count() );
-    SvULongs::Insert( nIndex, SvULongs::Count() );
+    std::vector<sal_uLong>::push_back( nIndex );
     aOffset.push_back( nOffset );
 }
 
@@ -525,9 +525,9 @@ SwLayHelper::SwLayHelper( SwDoc *pD, SwFrm* &rpF, SwFrm* &rpP, SwPageFrm* &rpPg,
         nNodeIndex -= nStartOfContent;
         nIndex = 0;
         nFlyIdx = 0;
-        while( nIndex < pImpl->Count() && (*pImpl)[ nIndex ] < nNodeIndex )
+        while( nIndex < pImpl->size() && (*pImpl)[ nIndex ] < nNodeIndex )
             ++nIndex;
-        if( nIndex >= pImpl->Count() )
+        if( nIndex >= pImpl->size() )
         {
             pDoc->GetLayoutCache()->UnlockImpl();
             pImpl = NULL;
@@ -562,7 +562,7 @@ sal_uLong SwLayHelper::CalcPageCount()
                              pDoc->GetLayoutCache()->LockImpl() : NULL;
     if( pCache )
     {
-        nPgCount = pCache->Count() + 1;
+        nPgCount = pCache->size() + 1;
         pDoc->GetLayoutCache()->UnlockImpl();
     }
     else
@@ -804,10 +804,10 @@ sal_Bool SwLayHelper::CheckInsert( sal_uLong nNodeIndex )
     }
     else
         ++nParagraphCnt;
-    if( bFirst && pImpl && nIndex < pImpl->Count() &&
+    if( bFirst && pImpl && nIndex < pImpl->size() &&
         pImpl->GetBreakIndex( nIndex ) == nNodeIndex &&
         ( pImpl->GetBreakOfst( nIndex ) < STRING_LEN ||
-          ( ++nIndex < pImpl->Count() &&
+          ( ++nIndex < pImpl->size() &&
           pImpl->GetBreakIndex( nIndex ) == nNodeIndex ) ) )
         bFirst = sal_False;
 #if OSL_DEBUG_LEVEL > 1
@@ -839,10 +839,10 @@ sal_Bool SwLayHelper::CheckInsert( sal_uLong nNodeIndex )
                 }
                 else
                 {
-                    while( nIndex < pImpl->Count() &&
+                    while( nIndex < pImpl->size() &&
                            pImpl->GetBreakIndex(nIndex) < nNodeIndex)
                         ++nIndex;
-                    if( nIndex < pImpl->Count() &&
+                    if( nIndex < pImpl->size() &&
                         pImpl->GetBreakIndex(nIndex) == nNodeIndex )
                     {
                         nType = pImpl->GetBreakType( nIndex );
@@ -982,7 +982,7 @@ sal_Bool SwLayHelper::CheckInsert( sal_uLong nNodeIndex )
                         rpLay = rpLay->GetNextLayoutLeaf();
                 }
             }
-        } while( bLongTab || ( pImpl && nIndex < pImpl->Count() &&
+        } while( bLongTab || ( pImpl && nIndex < pImpl->size() &&
                  (*pImpl)[ nIndex ] == nNodeIndex ) );
     }
     bFirst = sal_False;
diff --git a/sw/source/core/layout/layhelp.hxx b/sw/source/core/layout/layhelp.hxx
index 10195f6..8825736 100644
--- a/sw/source/core/layout/layhelp.hxx
+++ b/sw/source/core/layout/layhelp.hxx
@@ -29,7 +29,6 @@
 #define _LAYHELP_HXX
 #ifndef _SVSTDARR_HXX
 #define _SVSTDARR_USHORTS
-#define _SVSTDARR_ULONGS
 #define _SVSTDARR_XUB_STRLEN
 #include <svl/svstdarr.hxx>
 #endif
@@ -63,7 +62,7 @@ class SwFlyCache;
 typedef SwFlyCache* SwFlyCachePtr;
 SV_DECL_PTRARR_DEL( SwPageFlyCache, SwFlyCachePtr, 0, 4 )
 
-class SwLayCacheImpl : public SvULongs
+class SwLayCacheImpl : public std::vector<sal_uLong>
 {
     SvXub_StrLens aOffset;
     SvUShorts aType;
@@ -72,10 +71,10 @@ class SwLayCacheImpl : public SvULongs
     void Insert( sal_uInt16 nType, sal_uLong nIndex, xub_StrLen nOffset );
 
 public:
-    SwLayCacheImpl() : SvULongs( 20, 10 ), aType( 20, 10 ) {}
+    SwLayCacheImpl() : aType( 20, 10 ) {}
     sal_Bool Read( SvStream& rStream );
 
-    sal_uLong GetBreakIndex( sal_uInt16 nIdx ) const { return GetObject( nIdx ); }
+    sal_uLong GetBreakIndex( sal_uInt16 nIdx ) const { return std::vector<sal_uLong>::operator[]( nIdx ); }
     xub_StrLen GetBreakOfst( size_t nIdx ) const { return aOffset[ nIdx ]; }
     sal_uInt16 GetBreakType( sal_uInt16 nIdx ) const { return aType[ nIdx ]; }
 
commit 7a4607b29ba874124bf57384b389caf96de3c236
Author: Nigel Hawkins <n.hawkins at gmx.com>
Date:   Fri Jun 17 10:35:14 2011 +0100

    Replace SvULongs with std::vector in htmlplug.cxx. LGPLv3+/MPL.

diff --git a/sw/source/filter/html/htmlplug.cxx b/sw/source/filter/html/htmlplug.cxx
index e8253ff..b572691 100644
--- a/sw/source/filter/html/htmlplug.cxx
+++ b/sw/source/filter/html/htmlplug.cxx
@@ -1171,7 +1171,7 @@ Writer& OutHTML_FrmFmtOLENode( Writer& rWrt, const SwFrmFmt& rFrmFmt,
 
         SvCommandList aCommands;
         aCommands.FillFromSequence( aProps );
-        SvULongs aParams;
+        std::vector<sal_uLong> aParams;
         size_t i = aCommands.size();
         while( i > 0 )
         {
@@ -1188,7 +1188,7 @@ Writer& OutHTML_FrmFmtOLENode( Writer& rWrt, const SwFrmFmt& rFrmFmt,
             }
             else if( SWHTML_OPTTYPE_PARAM == nType )
             {
-                aParams.Insert( i, aParams.Count() );
+                aParams.push_back( i );
             }
         }
 
@@ -1196,7 +1196,7 @@ Writer& OutHTML_FrmFmtOLENode( Writer& rWrt, const SwFrmFmt& rFrmFmt,
 
         rHTMLWrt.IncIndentLevel(); // Inhalt von Applet einruecken
 
-        sal_uInt16 ii = aParams.Count();
+        sal_uInt16 ii = aParams.size();
         while( ii > 0  )
         {
             const SvCommand& rCommand = aCommands[ aParams[--ii] ];


More information about the Libreoffice-commits mailing list