[Libreoffice-commits] .: vcl/inc vcl/source

Joseph Powers jpowers at kemper.freedesktop.org
Fri Feb 18 18:21:19 PST 2011


 vcl/inc/vcl/status.hxx       |    6 
 vcl/source/window/status.cxx |  261 ++++++++++++++++++-------------------------
 2 files changed, 117 insertions(+), 150 deletions(-)

New commits:
commit 5d45f20e65069d3f48c0f3d194cfa83e3e746e27
Author: Joseph Powers <jpowers27 at cox.net>
Date:   Fri Feb 18 18:20:54 2011 -0800

    Remove DECLARE_LIST( ImplStatusItemList, ImplStatusItem* )

diff --git a/vcl/inc/vcl/status.hxx b/vcl/inc/vcl/status.hxx
index 6574b6a..e0b6c6b 100644
--- a/vcl/inc/vcl/status.hxx
+++ b/vcl/inc/vcl/status.hxx
@@ -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
@@ -32,8 +32,10 @@
 #include <vcl/sv.h>
 #include <vcl/dllapi.h>
 #include <vcl/window.hxx>
+#include <vector>
 
-class ImplStatusItemList;
+struct ImplStatusItem;
+typedef ::std::vector< ImplStatusItem* > ImplStatusItemList;
 
 // --------------------
 // - Progress-Ausgabe -
diff --git a/vcl/source/window/status.cxx b/vcl/source/window/status.cxx
index 9cfea5d..d3d5f27 100644
--- a/vcl/source/window/status.cxx
+++ b/vcl/source/window/status.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
@@ -28,7 +28,6 @@
 
 // MARKER(update_precomp.py): autogen include statement, do not remove
 #include "precompiled_vcl.hxx"
-#include <tools/list.hxx>
 #include <tools/debug.hxx>
 
 #include <tools/rc.h>
@@ -95,8 +94,6 @@ struct ImplStatusItem
     XubString           maCommand;
 };
 
-DECLARE_LIST( ImplStatusItemList, ImplStatusItem* )
-
 // =======================================================================
 
 inline long ImplCalcProgessWidth( USHORT nMax, long nSize )
@@ -196,18 +193,13 @@ StatusBar::StatusBar( Window* pParent, const ResId& rResId ) :
 StatusBar::~StatusBar()
 {
     // Alle Items loeschen
-    ImplStatusItem* pItem = mpItemList->First();
-    while ( pItem )
-    {
-        delete pItem;
-        pItem = mpItemList->Next();
+    for ( size_t i = 0, n = mpItemList->size(); i < n; ++i ) {
+        delete (*mpItemList)[ i ];
     }
-
     delete mpItemList;
 
     // VirtualDevice loeschen
     delete mpImplData->mpVirDev;
-
     delete mpImplData;
 }
 
@@ -255,7 +247,7 @@ void StatusBar::ImplInitSettings( BOOL bFont,
             aColor = rStyleSettings.GetWindowColor();
         SetBackground( aColor );
         mpImplData->mpVirDev->SetBackground( GetBackground() );
-        
+
         // NWF background
         if( ! IsControlBackground() &&
               IsNativeControlSupported( CTRL_WINDOW_BACKGROUND, PART_BACKGROUND_WINDOW ) )
@@ -279,19 +271,17 @@ void StatusBar::ImplFormat()
     // Breiten zusammenrechnen
     mnItemsWidth = STATUSBAR_OFFSET_X;
     long nOffset = 0;
-    pItem = mpItemList->First();
-    while ( pItem )
-    {
+    for ( size_t i = 0, n = mpItemList->size(); i < n; ++i ) {
+        pItem = (*mpItemList)[ i ];
         if ( pItem->mbVisible )
         {
-            if ( pItem->mnBits & SIB_AUTOSIZE )
+            if ( pItem->mnBits & SIB_AUTOSIZE ) {
                 nAutoSizeItems++;
+            }
 
             mnItemsWidth += pItem->mnWidth + nOffset;
             nOffset = pItem->mnOffset;
         }
-
-        pItem = mpItemList->Next();
     }
 
     if ( GetStyle() & WB_RIGHT )
@@ -321,28 +311,22 @@ void StatusBar::ImplFormat()
         nX = STATUSBAR_OFFSET_X;
     }
 
-    pItem = mpItemList->First();
-    while ( pItem )
-    {
-        if ( pItem->mbVisible )
-        {
-            if ( pItem->mnBits & SIB_AUTOSIZE )
-            {
+    for ( size_t i = 0, n = mpItemList->size(); i < n; ++i ) {
+        pItem = (*mpItemList)[ i ];
+        if ( pItem->mbVisible ) {
+            if ( pItem->mnBits & SIB_AUTOSIZE ) {
                 pItem->mnExtraWidth = nExtraWidth;
-                if ( nExtraWidth2 )
-                {
+                if ( nExtraWidth2 ) {
                     pItem->mnExtraWidth++;
                     nExtraWidth2--;
                 }
-            }
-            else
+            } else {
                 pItem->mnExtraWidth = 0;
+            }
 
             pItem->mnX = nX;
             nX += pItem->mnWidth + pItem->mnExtraWidth + pItem->mnOffset;
         }
-
-        pItem = mpItemList->Next();
     }
 
     mbFormat = FALSE;
@@ -354,7 +338,7 @@ Rectangle StatusBar::ImplGetItemRectPos( USHORT nPos ) const
 {
     Rectangle		aRect;
     ImplStatusItem* pItem;
-    pItem = mpItemList->GetObject( nPos );
+    pItem = ( nPos < mpItemList->size() ) ? (*mpItemList)[ nPos ] : NULL;
     if ( pItem )
     {
         if ( pItem->mbVisible )
@@ -376,17 +360,17 @@ Rectangle StatusBar::ImplGetItemRectPos( USHORT nPos ) const
 USHORT StatusBar::ImplGetFirstVisiblePos() const
 {
     ImplStatusItem* pItem;
-    
-    for( USHORT nPos = 0; nPos < mpItemList->Count(); nPos++ )
+
+    for( size_t nPos = 0; nPos < mpItemList->size(); nPos++ )
     {
-        pItem = mpItemList->GetObject( nPos );
+        pItem = (*mpItemList)[ nPos ];
         if ( pItem )
         {
             if ( pItem->mbVisible )
-                return nPos;
+                return USHORT(nPos);
         }
     }
-    
+
     return ~0;
 }
 
@@ -437,7 +421,7 @@ void StatusBar::ImplDrawItem( BOOL bOffScreen, USHORT nPos, BOOL bDrawText, BOOL
         return;
 
     // Ausgabebereich berechnen
-    ImplStatusItem* 	pItem = mpItemList->GetObject( nPos );
+    ImplStatusItem* 	pItem = (*mpItemList)[ nPos ];
     long nW = mpImplData->mnItemBorderWidth + 1;
     Rectangle			aTextRect( aRect.Left()+nW, aRect.Top()+nW,
                                    aRect.Right()-nW, aRect.Bottom()-nW );
@@ -498,12 +482,12 @@ void StatusBar::ImplDrawItem( BOOL bOffScreen, USHORT nPos, BOOL bDrawText, BOOL
             if( !(pItem->mnBits & SIB_FLAT) )
             {
                 USHORT nStyle;
-                
+
                 if ( pItem->mnBits & SIB_IN )
                     nStyle = FRAME_DRAW_IN;
                 else
                     nStyle = FRAME_DRAW_OUT;
-                
+
                 DecorationView aDecoView( this );
                 aDecoView.DrawFrame( aRect, nStyle );
             }
@@ -538,7 +522,7 @@ void DrawProgress( Window* pWindow, const Point& rPos,
     if( pWindow->IsNativeControlSupported( CTRL_PROGRESS, PART_ENTIRE_CONTROL ) )
     {
         bool bNeedErase = ImplGetSVData()->maNWFData.mbProgressNeedsErase;
-        
+
         long nFullWidth = (nPrgsWidth + nOffset) * (10000 / nPercentCount);
         long nPerc = (nPercent2 > 10000) ? 10000 : nPercent2;
         ImplControlValue aValue( nFullWidth * (long)nPerc / 10000 );
@@ -579,7 +563,7 @@ void DrawProgress( Window* pWindow, const Point& rPos,
             return;
         }
     }
-    
+
     // Werte vorberechnen
     USHORT nPerc1 = nPercent1 / nPercentCount;
     USHORT nPerc2 = nPercent2 / nPercentCount;
@@ -587,7 +571,7 @@ void DrawProgress( Window* pWindow, const Point& rPos,
     if ( nPerc1 > nPerc2 )
     {
         // Support progress that can also decrease
-        
+
         // Rechteck berechnen
         long		nDX = nPrgsWidth + nOffset;
         long		nLeft = rPos.X()+((nPerc1-1)*nDX);
@@ -603,7 +587,7 @@ void DrawProgress( Window* pWindow, const Point& rPos,
         while ( nPerc1 > nPerc2 );
 
         pWindow->Flush();
-    }	
+    }
     else if ( nPerc1 < nPerc2 )
     {
         // Percent-Rechtecke malen
@@ -681,7 +665,7 @@ void StatusBar::ImplCalcProgressRect()
     // calculate text size
     Size aPrgsTxtSize( GetTextWidth( maPrgsTxt ), GetTextHeight() );
     maPrgsTxtPos.X()	= STATUSBAR_OFFSET_X+1;
-    
+
     // calculate progress frame
     maPrgsFrameRect.Left()		= maPrgsTxtPos.X()+aPrgsTxtSize.Width()+STATUSBAR_OFFSET;
     maPrgsFrameRect.Top()		= mnItemY;
@@ -740,14 +724,13 @@ void StatusBar::MouseButtonDown( const MouseEvent& rMEvt )
         if ( mbVisibleItems )
         {
             Point  aMousePos = rMEvt.GetPosPixel();
-            USHORT i = 0;
 
             // Item suchen, das geklickt wurde
-            ImplStatusItem* pItem = mpItemList->First();
-            while ( pItem )
+            for ( size_t i = 0; i < mpItemList->size(); ++i )
             {
+                ImplStatusItem* pItem = (*mpItemList)[ i ];
                 // Ist es dieses Item
-                if ( ImplGetItemRectPos( i ).IsInside( aMousePos ) )
+                if ( ImplGetItemRectPos( USHORT(i) ).IsInside( aMousePos ) )
                 {
                     mnCurItemId = pItem->mnId;
                     if ( rMEvt.GetClicks() == 2 )
@@ -759,9 +742,6 @@ void StatusBar::MouseButtonDown( const MouseEvent& rMEvt )
                     // Item wurde gefunden
                     return;
                 }
-
-                i++;
-                pItem = mpItemList->Next();
             }
         }
 
@@ -780,7 +760,7 @@ void StatusBar::Paint( const Rectangle& )
     if ( mbFormat )
         ImplFormat();
 
-    USHORT nItemCount = (USHORT)mpItemList->Count();
+    USHORT nItemCount = USHORT( mpItemList->size() );
 
     if ( mbProgressMode )
         ImplDrawProgress( TRUE, 0, mnPercent );
@@ -959,22 +939,23 @@ void StatusBar::DataChanged( const DataChangedEvent& rDCEvt )
 {
     Window::DataChanged( rDCEvt );
 
-    if ( (rDCEvt.GetType() == DATACHANGED_DISPLAY) ||
-         (rDCEvt.GetType() == DATACHANGED_FONTS) ||
-         (rDCEvt.GetType() == DATACHANGED_FONTSUBSTITUTION) ||
-         ((rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
-          (rDCEvt.GetFlags() & SETTINGS_STYLE)) )
+    if (  (rDCEvt.GetType() == DATACHANGED_DISPLAY         )
+       || (rDCEvt.GetType() == DATACHANGED_FONTS           )
+       || (rDCEvt.GetType() == DATACHANGED_FONTSUBSTITUTION)
+       || (  (rDCEvt.GetType() == DATACHANGED_SETTINGS)
+          && (rDCEvt.GetFlags() & SETTINGS_STYLE )
+          )
+       )
     {
         mbFormat = TRUE;
         ImplInitSettings( TRUE, TRUE, TRUE );
-        ImplStatusItem* pItem = mpItemList->First();
         long nFudge = GetTextHeight() / 4;
-        while ( pItem )
+        for ( size_t i = 0, n = mpItemList->size(); i < n; ++i )
         {
+            ImplStatusItem* pItem = (*mpItemList)[ i ];
             long nWidth = GetTextWidth( pItem->maText ) + nFudge;
             if( nWidth > pItem->mnWidth + STATUSBAR_OFFSET )
                 pItem->mnWidth = nWidth + STATUSBAR_OFFSET;
-            pItem = mpItemList->Next();
         }
         Size aSize = GetSizePixel();
         // do not disturb current width, since
@@ -1035,7 +1016,11 @@ void StatusBar::InsertItem( USHORT nItemId, ULONG nWidth,
     pItem->mbVisible		= TRUE;
 
     // Item in die Liste einfuegen
-    mpItemList->Insert( pItem, nPos );
+    if ( nPos < mpItemList->size() ) {
+        mpItemList->insert( mpItemList->begin() + nPos, pItem );
+    } else {
+        mpItemList->push_back( pItem );
+    }
 
     mbFormat = TRUE;
     if ( ImplIsItemUpdate() )
@@ -1051,8 +1036,8 @@ void StatusBar::RemoveItem( USHORT nItemId )
     USHORT nPos = GetItemPos( nItemId );
     if ( nPos != STATUSBAR_ITEM_NOTFOUND )
     {
-        ImplStatusItem* pItem = mpItemList->Remove( nPos );
-        delete pItem;
+        delete (*mpItemList)[ nPos ];
+        mpItemList->erase( mpItemList->begin() + nPos );
 
         mbFormat = TRUE;
         if ( ImplIsItemUpdate() )
@@ -1070,7 +1055,7 @@ void StatusBar::ShowItem( USHORT nItemId )
 
     if ( nPos != STATUSBAR_ITEM_NOTFOUND )
     {
-        ImplStatusItem* pItem = mpItemList->GetObject( nPos );
+        ImplStatusItem* pItem = (*mpItemList)[ nPos ];
         if ( !pItem->mbVisible )
         {
             pItem->mbVisible = TRUE;
@@ -1092,7 +1077,7 @@ void StatusBar::HideItem( USHORT nItemId )
 
     if ( nPos != STATUSBAR_ITEM_NOTFOUND )
     {
-        ImplStatusItem* pItem = mpItemList->GetObject( nPos );
+        ImplStatusItem* pItem = (*mpItemList)[ nPos ];
         if ( pItem->mbVisible )
         {
             pItem->mbVisible = FALSE;
@@ -1113,7 +1098,7 @@ BOOL StatusBar::IsItemVisible( USHORT nItemId ) const
     USHORT nPos = GetItemPos( nItemId );
 
     if ( nPos != STATUSBAR_ITEM_NOTFOUND )
-        return mpItemList->GetObject( nPos )->mbVisible;
+        return (*mpItemList)[ nPos ]->mbVisible;
     else
         return FALSE;
 }
@@ -1151,24 +1136,14 @@ void StatusBar::HideItems()
 void StatusBar::CopyItems( const StatusBar& rStatusBar )
 {
     // Alle Items entfernen
-    ImplStatusItem* pItem = mpItemList->First();
-    while ( pItem )
-    {
-        delete pItem;
-        pItem = mpItemList->Next();
+    for ( size_t i = 0, n = mpItemList->size(); i < n; ++i ) {
+        delete (*mpItemList)[ i ];
     }
-
-    // Items aus der Liste loeschen
-    mpItemList->Clear();
+    mpItemList->clear();
 
     // Items kopieren
-    ULONG i = 0;
-    pItem = rStatusBar.mpItemList->GetObject( i );
-    while ( pItem )
-    {
-        mpItemList->Insert( new ImplStatusItem( *pItem ), LIST_APPEND );
-        i++;
-        pItem = rStatusBar.mpItemList->GetObject( i );
+    for ( size_t i = 0, n = rStatusBar.mpItemList->size(); i < n; ++i ) {
+        mpItemList->push_back( new ImplStatusItem( *(*rStatusBar.mpItemList)[ i ] ) );
     }
 
     mbFormat = TRUE;
@@ -1181,15 +1156,10 @@ void StatusBar::CopyItems( const StatusBar& rStatusBar )
 void StatusBar::Clear()
 {
     // Alle Item loeschen
-    ImplStatusItem* pItem = mpItemList->First();
-    while ( pItem )
-    {
-        delete pItem;
-        pItem = mpItemList->Next();
+    for ( size_t i = 0, n = mpItemList->size(); i < n; ++i ) {
+        delete (*mpItemList)[ i ];
     }
-
-    // Items aus der Liste loeschen
-    mpItemList->Clear();
+    mpItemList->clear();
 
     mbFormat = TRUE;
     if ( ImplIsItemUpdate() )
@@ -1202,31 +1172,26 @@ void StatusBar::Clear()
 
 USHORT StatusBar::GetItemCount() const
 {
-    return (USHORT)mpItemList->Count();
+    return (USHORT)mpItemList->size();
 }
 
 // -----------------------------------------------------------------------
 
 USHORT StatusBar::GetItemId( USHORT nPos ) const
 {
-    ImplStatusItem* pItem = mpItemList->GetObject( nPos );
-    if ( pItem )
-        return pItem->mnId;
-    else
-        return 0;
+    if ( nPos < mpItemList->size() )
+        return (*mpItemList)[ nPos ]->mnId;
+    return 0;
 }
 
 // -----------------------------------------------------------------------
 
 USHORT StatusBar::GetItemPos( USHORT nItemId ) const
 {
-    ImplStatusItem* pItem = mpItemList->First();
-    while ( pItem )
-    {
-        if ( pItem->mnId == nItemId )
-            return (USHORT)mpItemList->GetCurPos();
-
-        pItem = mpItemList->Next();
+    for ( size_t i = 0, n = mpItemList->size(); i < n; ++i ) {
+        if ( (*mpItemList)[ i ]->mnId == nItemId ) {
+            return USHORT( i );
+        }
     }
 
     return STATUSBAR_ITEM_NOTFOUND;
@@ -1245,7 +1210,7 @@ USHORT StatusBar::GetItemId( const Point& rPos ) const
             // Rechteck holen
             Rectangle aRect = ImplGetItemRectPos( nPos );
             if ( aRect.IsInside( rPos ) )
-                return mpItemList->GetObject( nPos )->mnId;
+                return (*mpItemList)[ nPos ]->mnId;
         }
     }
 
@@ -1287,7 +1252,7 @@ Point StatusBar::GetItemTextPos( USHORT nItemId ) const
         if ( nPos != STATUSBAR_ITEM_NOTFOUND )
         {
             // Rechteck holen
-            ImplStatusItem* pItem = mpItemList->GetObject( nPos );
+            ImplStatusItem* pItem = (*mpItemList)[ nPos ];
             Rectangle aRect = ImplGetItemRectPos( nPos );
             long nW = mpImplData->mnItemBorderWidth + 1;
             Rectangle			aTextRect( aRect.Left()+nW, aRect.Top()+nW,
@@ -1314,9 +1279,9 @@ ULONG StatusBar::GetItemWidth( USHORT nItemId ) const
     USHORT nPos = GetItemPos( nItemId );
 
     if ( nPos != STATUSBAR_ITEM_NOTFOUND )
-        return mpItemList->GetObject( nPos )->mnWidth;
-    else
-        return 0;
+        return (*mpItemList)[ nPos ]->mnWidth;
+
+    return 0;
 }
 
 // -----------------------------------------------------------------------
@@ -1326,9 +1291,9 @@ StatusBarItemBits StatusBar::GetItemBits( USHORT nItemId ) const
     USHORT nPos = GetItemPos( nItemId );
 
     if ( nPos != STATUSBAR_ITEM_NOTFOUND )
-        return mpItemList->GetObject( nPos )->mnBits;
-    else
-        return 0;
+        return (*mpItemList)[ nPos ]->mnBits;
+
+    return 0;
 }
 
 // -----------------------------------------------------------------------
@@ -1338,9 +1303,9 @@ long StatusBar::GetItemOffset( USHORT nItemId ) const
     USHORT nPos = GetItemPos( nItemId );
 
     if ( nPos != STATUSBAR_ITEM_NOTFOUND )
-        return mpItemList->GetObject( nPos )->mnOffset;
-    else
-        return 0;
+        return (*mpItemList)[ nPos ]->mnOffset;
+
+    return 0;
 }
 
 // -----------------------------------------------------------------------
@@ -1351,7 +1316,7 @@ void StatusBar::SetItemText( USHORT nItemId, const XubString& rText )
 
     if ( nPos != STATUSBAR_ITEM_NOTFOUND )
     {
-        ImplStatusItem* pItem = mpItemList->GetObject( nPos );
+        ImplStatusItem* pItem = (*mpItemList)[ nPos ];
 
         if ( pItem->maText != rText )
         {
@@ -1360,7 +1325,7 @@ void StatusBar::SetItemText( USHORT nItemId, const XubString& rText )
             // adjust item width - see also DataChanged()
             long nFudge = GetTextHeight()/4;
             long nWidth = GetTextWidth( pItem->maText ) + nFudge;
-            if( (nWidth > pItem->mnWidth + STATUSBAR_OFFSET) || 
+            if( (nWidth > pItem->mnWidth + STATUSBAR_OFFSET) ||
                 ((nWidth < pItem->mnWidth) && (mnDX - STATUSBAR_OFFSET) < mnItemsWidth  ))
             {
                 pItem->mnWidth = nWidth + STATUSBAR_OFFSET;
@@ -1387,9 +1352,9 @@ const XubString& StatusBar::GetItemText( USHORT nItemId ) const
     USHORT nPos = GetItemPos( nItemId );
 
     if ( nPos != STATUSBAR_ITEM_NOTFOUND )
-        return mpItemList->GetObject( nPos )->maText;
-    else
-        return ImplGetSVEmptyStr();
+        return (*mpItemList)[ nPos ]->maText;
+
+    return ImplGetSVEmptyStr();
 }
 
 // -----------------------------------------------------------------------
@@ -1400,7 +1365,7 @@ void StatusBar::SetItemCommand( USHORT nItemId, const XubString& rCommand )
 
     if ( nPos != STATUSBAR_ITEM_NOTFOUND )
     {
-        ImplStatusItem* pItem = mpItemList->GetObject( nPos );
+        ImplStatusItem* pItem = (*mpItemList)[ nPos ];
 
         if ( pItem->maCommand != rCommand )
             pItem->maCommand = rCommand;
@@ -1414,9 +1379,9 @@ const XubString& StatusBar::GetItemCommand( USHORT nItemId )
     USHORT nPos = GetItemPos( nItemId );
 
     if ( nPos != STATUSBAR_ITEM_NOTFOUND )
-        return mpItemList->GetObject( nPos )->maCommand;
-    else
-        return ImplGetSVEmptyStr();
+        return (*mpItemList)[ nPos ]->maCommand;
+
+    return ImplGetSVEmptyStr();
 }
 
 // -----------------------------------------------------------------------
@@ -1427,7 +1392,7 @@ void StatusBar::SetItemData( USHORT nItemId, void* pNewData )
 
     if ( nPos != STATUSBAR_ITEM_NOTFOUND )
     {
-        ImplStatusItem* pItem = mpItemList->GetObject( nPos );
+        ImplStatusItem* pItem = (*mpItemList)[ nPos ];
         pItem->mpUserData = pNewData;
 
         // Wenn es ein User-Item ist, DrawItem-Aufrufen
@@ -1448,9 +1413,9 @@ void* StatusBar::GetItemData( USHORT nItemId ) const
     USHORT nPos = GetItemPos( nItemId );
 
     if ( nPos != STATUSBAR_ITEM_NOTFOUND )
-        return mpItemList->GetObject( nPos )->mpUserData;
-    else
-        return NULL;
+        return (*mpItemList)[ nPos ]->mpUserData;
+
+    return NULL;
 }
 
 // -----------------------------------------------------------------------
@@ -1460,7 +1425,7 @@ void StatusBar::SetHelpText( USHORT nItemId, const XubString& rText )
     USHORT nPos = GetItemPos( nItemId );
 
     if ( nPos != STATUSBAR_ITEM_NOTFOUND )
-        mpItemList->GetObject( nPos )->maHelpText = rText;
+        (*mpItemList)[ nPos ]->maHelpText = rText;
 }
 
 // -----------------------------------------------------------------------
@@ -1471,7 +1436,7 @@ const XubString& StatusBar::GetHelpText( USHORT nItemId ) const
 
     if ( nPos != STATUSBAR_ITEM_NOTFOUND )
     {
-        ImplStatusItem* pItem = mpItemList->GetObject( nPos );
+        ImplStatusItem* pItem = (*mpItemList)[ nPos ];
         if ( !pItem->maHelpText.Len() && ( pItem->mnHelpId || pItem->maCommand.Len() ))
         {
             Help* pHelp = Application::GetHelp();
@@ -1497,7 +1462,7 @@ void StatusBar::SetQuickHelpText( USHORT nItemId, const XubString& rText )
     USHORT nPos = GetItemPos( nItemId );
 
     if ( nPos != STATUSBAR_ITEM_NOTFOUND )
-        mpItemList->GetObject( nPos )->maQuickHelpText = rText;
+        (*mpItemList)[ nPos ]->maQuickHelpText = rText;
 }
 
 // -----------------------------------------------------------------------
@@ -1508,11 +1473,11 @@ const XubString& StatusBar::GetQuickHelpText( USHORT nItemId ) const
 
     if ( nPos != STATUSBAR_ITEM_NOTFOUND )
     {
-        ImplStatusItem* pItem = mpItemList->GetObject( nPos );
+        ImplStatusItem* pItem = (*mpItemList)[ nPos ];
         return pItem->maQuickHelpText;
     }
-    else
-        return ImplGetSVEmptyStr();
+
+    return ImplGetSVEmptyStr();
 }
 
 // -----------------------------------------------------------------------
@@ -1522,7 +1487,7 @@ void StatusBar::SetHelpId( USHORT nItemId, ULONG nHelpId )
     USHORT nPos = GetItemPos( nItemId );
 
     if ( nPos != STATUSBAR_ITEM_NOTFOUND )
-        mpItemList->GetObject( nPos )->mnHelpId = nHelpId;
+        (*mpItemList)[ nPos ]->mnHelpId = nHelpId;
 }
 
 // -----------------------------------------------------------------------
@@ -1532,9 +1497,9 @@ ULONG StatusBar::GetHelpId( USHORT nItemId ) const
     USHORT nPos = GetItemPos( nItemId );
 
     if ( nPos != STATUSBAR_ITEM_NOTFOUND )
-        return mpItemList->GetObject( nPos )->mnHelpId;
-    else
-        return 0;
+        return (*mpItemList)[ nPos ]->mnHelpId;
+
+    return 0;
 }
 
 // -----------------------------------------------------------------------
@@ -1650,7 +1615,7 @@ void StatusBar::ResetProgressMode()
 {
     if ( mbProgressMode )
     {
-        mnPercent = 0;		
+        mnPercent = 0;
         maPrgsTxt.Erase();
         if ( IsReallyVisible() )
         {
@@ -1700,20 +1665,20 @@ void StatusBar::SetText( const XubString& rText )
 
 Size StatusBar::CalcWindowSizePixel() const
 {
-    ULONG	i = 0;
-    ULONG	nCount = mpItemList->Count();
+    size_t  i = 0;
+    size_t  nCount = mpItemList->size();
     long	nOffset = 0;
     long	nCalcWidth = (STATUSBAR_OFFSET_X*2);
     long	nCalcHeight;
 
     while ( i < nCount )
     {
-        ImplStatusItem* pItem = mpItemList->GetObject( i );
+        ImplStatusItem* pItem = (*mpItemList)[ i ];
         nCalcWidth += pItem->mnWidth + nOffset;
         nOffset = pItem->mnOffset;
         i++;
     }
-    
+
     long nMinHeight = GetTextHeight();
     const long nBarTextOffset = STATUSBAR_OFFSET_TEXTY*2;
     long nProgressHeight = nMinHeight + nBarTextOffset;
@@ -1731,7 +1696,7 @@ Size StatusBar::CalcWindowSizePixel() const
             nProgressHeight = aNativeControlRegion.GetHeight();
         }
     }
-    
+
     if( mpImplData->mbDrawItemFrames &&
         pThis->IsNativeControlSupported( CTRL_FRAME, PART_BORDER ) )
     {
@@ -1749,7 +1714,7 @@ Size StatusBar::CalcWindowSizePixel() const
     nCalcHeight = nMinHeight+nBarTextOffset + 2*mpImplData->mnItemBorderWidth;
     if( nCalcHeight < nProgressHeight+2 )
         nCalcHeight = nProgressHeight+2;
-    
+
     // add border
     if( IsTopBorder() )
         nCalcHeight += 2;
@@ -1768,7 +1733,7 @@ void StatusBar::SetAccessibleName( USHORT nItemId, const XubString& rName )
 
     if ( nPos != STATUSBAR_ITEM_NOTFOUND )
     {
-        ImplStatusItem* pItem = mpItemList->GetObject( nPos );
+        ImplStatusItem* pItem = (*mpItemList)[ nPos ];
 
         if ( pItem->maAccessibleName != rName )
         {
@@ -1785,9 +1750,9 @@ const XubString& StatusBar::GetAccessibleName( USHORT nItemId ) const
     USHORT nPos = GetItemPos( nItemId );
 
     if ( nPos != STATUSBAR_ITEM_NOTFOUND )
-        return mpItemList->GetObject( nPos )->maAccessibleName;
-    else
-        return ImplGetSVEmptyStr();
+        return (*mpItemList)[ nPos ]->maAccessibleName;
+
+    return ImplGetSVEmptyStr();
 }
 
 // -----------------------------------------------------------------------


More information about the Libreoffice-commits mailing list