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

Nigel Hawkins nhawkins at kemper.freedesktop.org
Mon Jul 25 08:45:13 PDT 2011


 sw/source/core/layout/laycache.cxx |    2 +-
 sw/source/core/layout/layhelp.hxx  |    5 ++---
 sw/source/ui/envelp/envfmt.cxx     |    8 ++++----
 sw/source/ui/envelp/envfmt.hxx     |    7 +------
 4 files changed, 8 insertions(+), 14 deletions(-)

New commits:
commit d5eda4db050c7f823597ca89281251ea4217b60d
Author: Nigel Hawkins <n.hawkins at gmx.com>
Date:   Mon Jul 25 16:44:02 2011 +0100

    Replace SvUShorts with vector in layhelp.hxx and laycache.cxx

diff --git a/sw/source/core/layout/laycache.cxx b/sw/source/core/layout/laycache.cxx
index 5745fa8..03c6515 100644
--- a/sw/source/core/layout/laycache.cxx
+++ b/sw/source/core/layout/laycache.cxx
@@ -102,7 +102,7 @@ void SwLayoutCache::Read( SvStream &rStream )
 
 void SwLayCacheImpl::Insert( sal_uInt16 nType, sal_uLong nIndex, xub_StrLen nOffset )
 {
-    aType.Insert( nType, aType.Count() );
+    aType.push_back( nType );
     std::vector<sal_uLong>::push_back( nIndex );
     aOffset.push_back( nOffset );
 }
diff --git a/sw/source/core/layout/layhelp.hxx b/sw/source/core/layout/layhelp.hxx
index 8825736..ad0da71 100644
--- a/sw/source/core/layout/layhelp.hxx
+++ b/sw/source/core/layout/layhelp.hxx
@@ -28,7 +28,6 @@
 #ifndef _LAYHELP_HXX
 #define _LAYHELP_HXX
 #ifndef _SVSTDARR_HXX
-#define _SVSTDARR_USHORTS
 #define _SVSTDARR_XUB_STRLEN
 #include <svl/svstdarr.hxx>
 #endif
@@ -65,13 +64,13 @@ SV_DECL_PTRARR_DEL( SwPageFlyCache, SwFlyCachePtr, 0, 4 )
 class SwLayCacheImpl : public std::vector<sal_uLong>
 {
     SvXub_StrLens aOffset;
-    SvUShorts aType;
+    std::vector<sal_uInt16> aType;
     SwPageFlyCache aFlyCache;
     sal_Bool bUseFlyCache;
     void Insert( sal_uInt16 nType, sal_uLong nIndex, xub_StrLen nOffset );
 
 public:
-    SwLayCacheImpl() : aType( 20, 10 ) {}
+    SwLayCacheImpl() {}
     sal_Bool Read( SvStream& rStream );
 
     sal_uLong GetBreakIndex( sal_uInt16 nIdx ) const { return std::vector<sal_uLong>::operator[]( nIdx ); }
commit e93e5e29e919ace0a63df0f92c2afe765e467c31
Author: Nigel Hawkins <n.hawkins at gmx.com>
Date:   Mon Jul 25 14:43:52 2011 +0100

    Replace SvUShorts with vector in envfmt.[ch]xx

diff --git a/sw/source/ui/envelp/envfmt.cxx b/sw/source/ui/envelp/envfmt.cxx
index b6b44a1..b0377fa 100644
--- a/sw/source/ui/envelp/envfmt.cxx
+++ b/sw/source/ui/envelp/envfmt.cxx
@@ -233,11 +233,11 @@ SwEnvFmtPage::SwEnvFmtPage(Window* pParent, const SfxItemSet& rSet) :
                     bFound = sal_True;
             }
             aSizeFormatBox.InsertEntry(aPaperName, nPos);
-            aIDs.Insert((sal_uInt16) i, nPos);
+            aIDs.insert( aIDs.begin() + nPos, (sal_uInt16) i);
         }
     }
     aSizeFormatBox.InsertEntry(SvxPaperInfo::GetName(PAPER_USER));
-    aIDs.Insert((sal_uInt16) PAPER_USER, aIDs.Count());
+    aIDs.push_back( (sal_uInt16) PAPER_USER );
 
 }
 
@@ -260,7 +260,7 @@ IMPL_LINK_INLINE_START( SwEnvFmtPage, ModifyHdl, Edit *, pEdit )
     {
         Paper ePaper = SvxPaperInfo::GetSvxPaper(
             Size(lHeight, lWidth), MAP_TWIP, sal_True);
-        for (sal_uInt16 i = 0; i < aIDs.Count(); i++)
+        for (sal_uInt16 i = 0; i < (sal_uInt16)aIDs.size(); i++)
             if (aIDs[i] == (sal_uInt16)ePaper)
                 aSizeFormatBox.SelectEntryPos(i);
 
@@ -576,7 +576,7 @@ void SwEnvFmtPage::Reset(const SfxItemSet& rSet)
     Paper ePaper = SvxPaperInfo::GetSvxPaper(
         Size( Min(rItem.lWidth, rItem.lHeight),
         Max(rItem.lWidth, rItem.lHeight)), MAP_TWIP, sal_True);
-    for (sal_uInt16 i = 0; i < (sal_uInt16) aIDs.Count(); i++)
+    for (sal_uInt16 i = 0; i < (sal_uInt16) aIDs.size(); i++)
         if (aIDs[i] == (sal_uInt16)ePaper)
             aSizeFormatBox.SelectEntryPos(i);
 
diff --git a/sw/source/ui/envelp/envfmt.hxx b/sw/source/ui/envelp/envfmt.hxx
index de5845d..58f4920 100644
--- a/sw/source/ui/envelp/envfmt.hxx
+++ b/sw/source/ui/envelp/envfmt.hxx
@@ -28,11 +28,6 @@
 #ifndef _ENVFMT_HXX
 #define _ENVFMT_HXX
 
-
-#ifndef _SVSTDARR_HXX
-#define _SVSTDARR_USHORTS
-#include <svl/svstdarr.hxx>
-#endif
 #include <svtools/stdctrl.hxx>
 #include <vcl/field.hxx>
 #include <vcl/menubtn.hxx>
@@ -72,7 +67,7 @@ class SwEnvFmtPage : public SfxTabPage
     MetricField  aSizeHeightField;
     SwEnvPreview aPreview;
 
-    SvUShorts  aIDs;
+    std::vector<sal_uInt16>  aIDs;
 
      SwEnvFmtPage(Window* pParent, const SfxItemSet& rSet);
     ~SwEnvFmtPage();


More information about the Libreoffice-commits mailing list