[Libreoffice-commits] .: sw/source

Joseph Powers jpowers at kemper.freedesktop.org
Sat Jan 1 11:00:06 PST 2011


 sw/source/ui/chrdlg/chardlg.cxx |   16 ++++++++--------
 sw/source/ui/frmdlg/frmpage.cxx |   13 ++++++-------
 sw/source/ui/shells/basesh.cxx  |   10 +++-------
 3 files changed, 17 insertions(+), 22 deletions(-)

New commits:
commit fc848fc4be7db733f95aeb54e1fce2a8bb08c1f7
Author: Joseph Powers <jpowers27 at cox.net>
Date:   Sat Jan 1 10:56:18 2011 -0800

    Remove DECLARE_LIST( TargetList, String* )

diff --git a/sw/source/ui/chrdlg/chardlg.cxx b/sw/source/ui/chrdlg/chardlg.cxx
index a719191..13bcbb9 100644
--- a/sw/source/ui/chrdlg/chardlg.cxx
+++ b/sw/source/ui/chrdlg/chardlg.cxx
@@ -2,7 +2,7 @@
 /*************************************************************************
  *
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- * 
+ *
  * Copyright 2000, 2010 Oracle and/or its affiliates.
  *
  * OpenOffice.org - a multi-platform office productivity suite
@@ -209,18 +209,18 @@ SwCharURLPage::SwCharURLPage( 	Window* pParent,
     TargetList* pList = new TargetList;
     const SfxFrame& rFrame = pView->GetViewFrame()->GetTopFrame();
     rFrame.GetTargetList(*pList);
-    USHORT nCount = (USHORT)pList->Count();
-    if( nCount )
+    if ( !pList->empty() )
     {
-        USHORT i;
+        size_t nCount = pList->size();
+        size_t i;
 
         for ( i = 0; i < nCount; i++ )
         {
-            aTargetFrmLB.InsertEntry(*pList->GetObject(i));
+            aTargetFrmLB.InsertEntry( *pList->at( i ) );
         }
-        for ( i = nCount; i; i-- )
+        for ( i = nCount; i; )
         {
-            delete pList->GetObject( i - 1 );
+            delete pList->at( --i );
         }
     }
     delete pList;
@@ -275,7 +275,7 @@ BOOL SwCharURLPage::FillItemSet(SfxItemSet& rSet)
    if(sURL.getLength())
     {
         sURL = URIHelper::SmartRel2Abs(INetURLObject(), sURL, Link(), false );
-        // #i100683# file URLs should be normalized in the UI 
+        // #i100683# file URLs should be normalized in the UI
         static const sal_Char* pFile = "file:";
        sal_Int32 nLength = ((sal_Int32)sizeof(pFile)-1);
        if( sURL.copy(0, nLength ).equalsAsciiL( pFile, nLength ))
diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx
index 59ac2de..7b6eafd 100644
--- a/sw/source/ui/frmdlg/frmpage.cxx
+++ b/sw/source/ui/frmdlg/frmpage.cxx
@@ -2554,17 +2554,16 @@ void SwFrmURLPage::Reset( const SfxItemSet &rSet )
     {
         TargetList* pList = new TargetList;
         ((const SfxFrameItem*)pItem)->GetFrame()->GetTargetList(*pList);
-        USHORT nCount = (USHORT)pList->Count();
-        if( nCount )
+        if( !pList->empty() )
         {
-            USHORT i;
-            for ( i = 0; i < nCount; i++ )
+            size_t nCount = pList->size();
+            for ( size_t i = 0; i < nCount; i++ )
             {
-                aFrameCB.InsertEntry(*pList->GetObject(i));
+                aFrameCB.InsertEntry( *pList->at( i ) );
             }
-            for ( i = nCount; i; i-- )
+            for ( size_t i = nCount; i; )
             {
-                delete pList->GetObject( i - 1 );
+                delete pList->at( --i );
             }
         }
         delete pList;
diff --git a/sw/source/ui/shells/basesh.cxx b/sw/source/ui/shells/basesh.cxx
index 3f8b26d..3bfc1d4 100644
--- a/sw/source/ui/shells/basesh.cxx
+++ b/sw/source/ui/shells/basesh.cxx
@@ -2,7 +2,7 @@
 /*************************************************************************
  *
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- * 
+ *
  * Copyright 2000, 2010 Oracle and/or its affiliates.
  *
  * OpenOffice.org - a multi-platform office productivity suite
@@ -181,12 +181,8 @@ void lcl_UpdateIMapDlg( SwWrtShell& rSh )
     SvxIMapDlgChildWindow::UpdateIMapDlg(
             aGrf, rURL.GetMap(), pList, pEditObj );
 
-    USHORT nCount = (USHORT)pList->Count();
-    if(nCount)
-        for( USHORT i = nCount; i; i--  )
-        {
-            delete pList->GetObject(i-1);
-        }
+    for ( size_t i = 0, n = pList->size(); i < n; ++i )
+        delete pList->at( i );
     delete pList;
 }
 


More information about the Libreoffice-commits mailing list