[Libreoffice-commits] .: 5 commits - sot/inc sot/Package_inc.mk sot/source svtools/inc svtools/source tools/inc tools/Package_inc.mk vcl/inc vcl/source

Joseph Powers jpowers at kemper.freedesktop.org
Wed May 4 07:30:26 PDT 2011


 sot/Package_inc.mk                  |    1 
 sot/inc/sot/agg.hxx                 |   71 -----------------------
 sot/source/base/object.cxx          |    1 
 svtools/inc/svtools/ctrltool.hxx    |    9 +--
 svtools/source/control/ctrltool.cxx |   44 +++++++-------
 tools/Package_inc.mk                |    1 
 tools/inc/tools/queue.hxx           |  107 ------------------------------------
 vcl/inc/vcl/ilstbox.hxx             |   18 ++++--
 vcl/source/control/ilstbox.cxx      |   83 ++++++++++++++++-----------
 9 files changed, 87 insertions(+), 248 deletions(-)

New commits:
commit 63766f0ad49311ee8f106470f229356975174335
Author: Rafael Dominguez <venccsralph at gmail.com>
Date:   Tue May 3 09:39:25 2011 -0430

    Remove deprecated tools/queue.hxx

diff --git a/tools/Package_inc.mk b/tools/Package_inc.mk
index 5062bd0..adaa0c7 100644
--- a/tools/Package_inc.mk
+++ b/tools/Package_inc.mk
@@ -70,7 +70,6 @@ $(eval $(call gb_Package_add_file,tools_inc,inc/tools/postx.h,tools/postx.h))
 $(eval $(call gb_Package_add_file,tools_inc,inc/tools/presys.h,tools/presys.h))
 $(eval $(call gb_Package_add_file,tools_inc,inc/tools/prex.h,tools/prex.h))
 $(eval $(call gb_Package_add_file,tools_inc,inc/tools/pstm.hxx,tools/pstm.hxx))
-$(eval $(call gb_Package_add_file,tools_inc,inc/tools/queue.hxx,tools/queue.hxx))
 $(eval $(call gb_Package_add_file,tools_inc,inc/tools/rc.h,tools/rc.h))
 $(eval $(call gb_Package_add_file,tools_inc,inc/tools/rc.hxx,tools/rc.hxx))
 $(eval $(call gb_Package_add_file,tools_inc,inc/tools/rcid.h,tools/rcid.h))
diff --git a/tools/inc/tools/queue.hxx b/tools/inc/tools/queue.hxx
deleted file mode 100644
index b2fb83f..0000000
--- a/tools/inc/tools/queue.hxx
+++ /dev/null
@@ -1,107 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * 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
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org.  If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _QUEUE_HXX
-#define _QUEUE_HXX
-
-#include <tools/solar.h>
-#include <tools/contnr.hxx>
-
-// ---------
-// - Queue -
-// ---------
-
-#define QUEUE_ENTRY_NOTFOUND   CONTAINER_ENTRY_NOTFOUND
-
-class Queue : private Container
-{
-public:
-            using Container::Clear;
-            using Container::Count;
-            using Container::GetObject;
-            using Container::GetPos;
-
-            Queue( sal_uInt16 _nInitSize = 16, sal_uInt16 _nReSize = 16 ) :
-                Container( _nReSize, _nInitSize, _nReSize ) {}
-            Queue( const Queue& rQueue ) : Container( rQueue ) {}
-
-    void    Put( void* p ) { Container::Insert( p, CONTAINER_APPEND ); }
-    void*   Get()          { return Container::Remove( (sal_uIntPtr)0 ); }
-
-    Queue&  operator =( const Queue& rQueue )
-                { Container::operator =( rQueue ); return *this; }
-
-    sal_Bool    operator ==( const Queue& rQueue ) const
-                { return Container::operator ==( rQueue ); }
-    sal_Bool    operator !=( const Queue& rQueue ) const
-                { return Container::operator !=( rQueue ); }
-};
-
-// -----------------
-// - DECLARE_QUEUE -
-// -----------------
-
-#define DECLARE_QUEUE( ClassName, Type )                            \
-class ClassName : private Queue                                     \
-{                                                                   \
-public:                                                             \
-                using Queue::Clear;                                 \
-                using Queue::Count;                                 \
-                                                                    \
-                ClassName( sal_uInt16 _nInitSize = 16,                  \
-                           sal_uInt16 _nReSize = 16 ) :                 \
-                    Queue( _nInitSize, _nReSize ) {}                \
-                ClassName( const ClassName& rClassName ) :          \
-                    Queue( rClassName ) {}                          \
-                                                                    \
-    void        Put( Type p ) { Queue::Put( (void*)p ); }           \
-    Type        Get()         { return (Type)Queue::Get(); }        \
-                                                                    \
-    Type        GetObject( sal_uIntPtr nIndex ) const                     \
-                    { return (Type)Queue::GetObject( nIndex ); }    \
-    sal_uIntPtr       GetPos( const Type p ) const                        \
-                    { return Queue::GetPos( (const void*)p ); }     \
-    sal_uIntPtr       GetPos( const Type p, sal_uIntPtr nStartIndex,            \
-                        sal_Bool bForward = sal_True ) const                \
-                    { return Queue::GetPos( (const void*)p,         \
-                                            nStartIndex,            \
-                                            bForward ); }           \
-                                                                    \
-    ClassName&  operator =( const ClassName& rClassName )           \
-                    { Queue::operator =( rClassName );              \
-                      return *this; }                               \
-                                                                    \
-    sal_Bool        operator ==( const Queue& rQueue ) const            \
-                    { return Queue::operator ==( rQueue ); }        \
-    sal_Bool        operator !=( const Queue& rQueue ) const            \
-                    { return Queue::operator !=( rQueue ); }        \
-};
-
-#endif // _QUEUE_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 790bb1022af948b471416a14244220f41e627624
Author: Rafael Dominguez <venccsralph at gmail.com>
Date:   Mon May 2 13:42:19 2011 -0430

    Remove deprecated List from ImplEntryList

diff --git a/vcl/inc/vcl/ilstbox.hxx b/vcl/inc/vcl/ilstbox.hxx
index 76c85c8..5e2ddc8 100644
--- a/vcl/inc/vcl/ilstbox.hxx
+++ b/vcl/inc/vcl/ilstbox.hxx
@@ -29,6 +29,8 @@
 #ifndef _SV_ILSTBOX_HXX
 #define _SV_ILSTBOX_HXX
 
+#include <boost/ptr_container/ptr_vector.hpp>
+
 #include <vcl/sv.h>
 #include <vcl/image.hxx>
 #include <vcl/ctrl.hxx>
@@ -104,7 +106,7 @@ struct ImplEntryType
 // - ImplEntryList -
 // -----------------
 
-class ImplEntryList : private List
+class ImplEntryList
 {
 private:
     Window*         mpWindow;   // For getting the current locale when matching strings
@@ -117,8 +119,14 @@ private:
 
     Link			maSelectionChangedHdl;
     sal_Bool			mbCallSelectionChangedHdl;
+    boost::ptr_vector<ImplEntryType> maEntries;
 
-    ImplEntryType*	GetEntry( sal_uInt16 nPos )	const { return (ImplEntryType*)List::GetObject( nPos ); }
+    ImplEntryType*	GetEntry( sal_uInt16 nPos )	const
+    {
+        if (nPos >= maEntries.size())
+            return NULL;
+        return const_cast<ImplEntryType*>(&maEntries[nPos]);
+    }
 
 public:
                     ImplEntryList( Window* pWindow );
@@ -126,8 +134,8 @@ public:
 
     sal_uInt16					InsertEntry( sal_uInt16 nPos, ImplEntryType* pNewEntry, sal_Bool bSort );
     void					RemoveEntry( sal_uInt16 nPos );
-    const ImplEntryType* 	GetEntryPtr( sal_uInt16 nPos ) const { return (const ImplEntryType*) GetObject( nPos ); }
-    ImplEntryType* 	        GetMutableEntryPtr( sal_uInt16 nPos ) const { return (ImplEntryType*) GetObject( nPos ); }
+    const ImplEntryType* 	GetEntryPtr( sal_uInt16 nPos ) const { return (const ImplEntryType*) GetEntry( nPos ); }
+    ImplEntryType* 	        GetMutableEntryPtr( sal_uInt16 nPos ) const { return GetEntry( nPos ); }
     void					Clear();
 
     sal_uInt16			FindMatchingEntry( const XubString& rStr, sal_uInt16 nStart = 0, sal_Bool bForward = sal_True, sal_Bool bLazy = sal_True ) const;
@@ -141,7 +149,7 @@ public:
     long            GetAddedHeight( sal_uInt16 nEndIndex, sal_uInt16 nBeginIndex = 0, long nBeginHeight = 0 ) const;
     long            GetEntryHeight( sal_uInt16 nPos ) const;
 
-    sal_uInt16			GetEntryCount() const { return (sal_uInt16)List::Count(); }
+    sal_uInt16			GetEntryCount() const { return (sal_uInt16)maEntries.size(); }
     sal_Bool			HasImages() const { return mnImages ? sal_True : sal_False; }
 
     XubString		GetEntryText( sal_uInt16 nPos ) const;
diff --git a/vcl/source/control/ilstbox.cxx b/vcl/source/control/ilstbox.cxx
index 63a6bb2..8af9fe5 100644
--- a/vcl/source/control/ilstbox.cxx
+++ b/vcl/source/control/ilstbox.cxx
@@ -124,26 +124,24 @@ ImplEntryList::~ImplEntryList()
 void ImplEntryList::Clear()
 {
     mnImages = 0;
-    for ( sal_uInt16 n = GetEntryCount(); n; )
-    {
-        ImplEntryType* pImplEntry = GetEntry( --n );
-        delete pImplEntry;
-    }
-    List::Clear();
+    maEntries.clear();
 }
 
 // -----------------------------------------------------------------------
 
 void ImplEntryList::SelectEntry( sal_uInt16 nPos, sal_Bool bSelect )
 {
-    ImplEntryType* pImplEntry = GetEntry( nPos );
-    if ( pImplEntry &&
-       ( pImplEntry->mbIsSelected != bSelect ) &&
-       ( (pImplEntry->mnFlags & LISTBOX_ENTRY_FLAG_DISABLE_SELECTION) == 0  ) )
+    if (nPos < maEntries.size())
     {
-        pImplEntry->mbIsSelected = bSelect;
-        if ( mbCallSelectionChangedHdl )
-            maSelectionChangedHdl.Call( (void*)sal_IntPtr(nPos) );
+        boost::ptr_vector<ImplEntryType>::iterator iter = maEntries.begin()+nPos;
+
+        if ( ( iter->mbIsSelected != bSelect ) &&
+           ( (iter->mnFlags & LISTBOX_ENTRY_FLAG_DISABLE_SELECTION) == 0  ) )
+        {
+            iter->mbIsSelected = bSelect;
+            if ( mbCallSelectionChangedHdl )
+                maSelectionChangedHdl.Call( (void*)sal_IntPtr(nPos) );
+        }
     }
 }
 
@@ -177,9 +175,20 @@ sal_uInt16 ImplEntryList::InsertEntry( sal_uInt16 nPos, ImplEntryType* pNewEntry
     if ( !!pNewEntry->maImage )
         mnImages++;
 
-    if ( !bSort || !Count() )
+    sal_uInt16 insPos = 0;
+
+    if ( !bSort || maEntries.empty())
     {
-        Insert( pNewEntry, nPos );
+        if (nPos < maEntries.size())
+        {
+            insPos = nPos;
+            maEntries.insert( maEntries.begin() + nPos, pNewEntry );
+        }
+        else
+        {
+            maEntries.push_back(pNewEntry);
+            insPos = maEntries.size();
+        }
     }
     else
     {
@@ -188,7 +197,7 @@ sal_uInt16 ImplEntryList::InsertEntry( sal_uInt16 nPos, ImplEntryType* pNewEntry
         const XubString& rStr = pNewEntry->maStr;
         sal_uLong nLow, nHigh, nMid;
 
-        nHigh = Count();
+        nHigh = maEntries.size();
 
         ImplEntryType* pTemp = GetEntry( (sal_uInt16)(nHigh-1) );
 
@@ -201,7 +210,8 @@ sal_uInt16 ImplEntryList::InsertEntry( sal_uInt16 nPos, ImplEntryType* pNewEntry
             // Schnelles Einfuegen bei sortierten Daten
             if ( eComp != COMPARE_LESS )
             {
-                Insert( pNewEntry, LIST_APPEND );
+                insPos = maEntries.size();
+                maEntries.push_back(pNewEntry);
             }
             else
             {
@@ -211,7 +221,8 @@ sal_uInt16 ImplEntryList::InsertEntry( sal_uInt16 nPos, ImplEntryType* pNewEntry
                 eComp = (StringCompare)rSorter.compare(rStr, pTemp->maStr);
                 if ( eComp != COMPARE_GREATER )
                 {
-                    Insert( pNewEntry, (sal_uLong)0 );
+                    insPos = 0;
+                    maEntries.insert(maEntries.begin(),pNewEntry);
                 }
                 else
                 {
@@ -220,7 +231,7 @@ sal_uInt16 ImplEntryList::InsertEntry( sal_uInt16 nPos, ImplEntryType* pNewEntry
                     do
                     {
                         nMid = (nLow + nHigh) / 2;
-                        pTemp = (ImplEntryType*)GetObject( nMid );
+                        pTemp = (ImplEntryType*)GetEntry( nMid );
 
                         eComp = (StringCompare)rSorter.compare(rStr, pTemp->maStr);
 
@@ -239,7 +250,8 @@ sal_uInt16 ImplEntryList::InsertEntry( sal_uInt16 nPos, ImplEntryType* pNewEntry
                     if ( eComp != COMPARE_LESS )
                         nMid++;
 
-                    Insert( pNewEntry, nMid );
+                    insPos = nMid;
+                    maEntries.insert(maEntries.begin()+nMid,pNewEntry);
                 }
             }
         }
@@ -249,25 +261,27 @@ sal_uInt16 ImplEntryList::InsertEntry( sal_uInt16 nPos, ImplEntryType* pNewEntry
             // garbage you wouldn't insert it. If the exception occurred because the
             // Collator implementation is garbage then give the user a chance to see
             // his stuff
-            Insert( pNewEntry, (sal_uLong)0 );
+            insPos = 0;
+            maEntries.insert(maEntries.begin(),pNewEntry);
         }
 
     }
 
-    return (sal_uInt16)GetPos( pNewEntry );
+    return insPos;
 }
 
 // -----------------------------------------------------------------------
 
 void ImplEntryList::RemoveEntry( sal_uInt16 nPos )
 {
-    ImplEntryType* pImplEntry = (ImplEntryType*)List::Remove( nPos );
-    if ( pImplEntry )
+    boost::ptr_vector<ImplEntryType>::iterator iter = maEntries.begin()+ nPos;
+
+    if (iter != maEntries.end())
     {
-        if ( !!pImplEntry->maImage )
+        if ( !!iter->maImage )
             mnImages--;
 
-        delete pImplEntry;
+        maEntries.erase(iter);
     }
 }
 
@@ -275,11 +289,10 @@ void ImplEntryList::RemoveEntry( sal_uInt16 nPos )
 
 sal_uInt16 ImplEntryList::FindEntry( const XubString& rString, sal_Bool bSearchMRUArea ) const
 {
-    sal_uInt16 nEntries = GetEntryCount();
+    sal_uInt16 nEntries = maEntries.size();
     for ( sal_uInt16 n = bSearchMRUArea ? 0 : GetMRUCount(); n < nEntries; n++ )
     {
-        ImplEntryType* pImplEntry = GetEntry( n );
-        String aComp( vcl::I18nHelper::filterFormattingChars( pImplEntry->maStr ) );
+        String aComp( vcl::I18nHelper::filterFormattingChars( maEntries[n].maStr ) );
         if ( aComp == rString )
             return n;
     }
@@ -385,7 +398,7 @@ XubString ImplEntryList::GetEntryText( sal_uInt16 nPos ) const
 sal_Bool ImplEntryList::HasEntryImage( sal_uInt16 nPos ) const
 {
     sal_Bool bImage = sal_False;
-    ImplEntryType* pImplEntry = (ImplEntryType*)List::GetObject( nPos );
+    ImplEntryType* pImplEntry = GetEntry( nPos );
     if ( pImplEntry )
         bImage = !!pImplEntry->maImage;
     return bImage;
@@ -396,7 +409,7 @@ sal_Bool ImplEntryList::HasEntryImage( sal_uInt16 nPos ) const
 Image ImplEntryList::GetEntryImage( sal_uInt16 nPos ) const
 {
     Image aImage;
-    ImplEntryType* pImplEntry = (ImplEntryType*)List::GetObject( nPos );
+    ImplEntryType* pImplEntry = GetEntry( nPos );
     if ( pImplEntry )
         aImage = pImplEntry->maImage;
     return aImage;
@@ -406,7 +419,7 @@ Image ImplEntryList::GetEntryImage( sal_uInt16 nPos ) const
 
 void ImplEntryList::SetEntryData( sal_uInt16 nPos, void* pNewData )
 {
-    ImplEntryType* pImplEntry = (ImplEntryType*)List::GetObject( nPos );
+    ImplEntryType* pImplEntry = GetEntry( nPos );
     if ( pImplEntry )
         pImplEntry->mpUserData = pNewData;
 }
@@ -415,7 +428,7 @@ void ImplEntryList::SetEntryData( sal_uInt16 nPos, void* pNewData )
 
 void* ImplEntryList::GetEntryData( sal_uInt16 nPos ) const
 {
-    ImplEntryType* pImplEntry = (ImplEntryType*)List::GetObject( nPos );
+    ImplEntryType* pImplEntry = GetEntry( nPos );
     return pImplEntry ? pImplEntry->mpUserData : NULL;
 }
 
@@ -423,7 +436,7 @@ void* ImplEntryList::GetEntryData( sal_uInt16 nPos ) const
 
 void ImplEntryList::SetEntryFlags( sal_uInt16 nPos, long nFlags )
 {
-    ImplEntryType* pImplEntry = (ImplEntryType*)List::GetObject( nPos );
+    ImplEntryType* pImplEntry = GetEntry( nPos );
     if ( pImplEntry )
         pImplEntry->mnFlags = nFlags;
 }
@@ -432,7 +445,7 @@ void ImplEntryList::SetEntryFlags( sal_uInt16 nPos, long nFlags )
 
 long ImplEntryList::GetEntryFlags( sal_uInt16 nPos ) const
 {
-    ImplEntryType* pImplEntry = (ImplEntryType*)List::GetObject( nPos );
+    ImplEntryType* pImplEntry = GetEntry( nPos );
     return pImplEntry ? pImplEntry->mnFlags : 0;
 }
 
commit fbd693106a83fa9a3c1caadb1d520a5ece83333e
Author: Rafael Dominguez <venccsralph at gmail.com>
Date:   Mon May 2 12:29:34 2011 -0430

    Remove List usage in FontList

diff --git a/svtools/inc/svtools/ctrltool.hxx b/svtools/inc/svtools/ctrltool.hxx
index e6ccbe9..5375d75 100644
--- a/svtools/inc/svtools/ctrltool.hxx
+++ b/svtools/inc/svtools/ctrltool.hxx
@@ -29,8 +29,9 @@
 #ifndef _CTRLTOOL_HXX
 #define _CTRLTOOL_HXX
 
+#include <boost/ptr_container/ptr_vector.hpp>
+
 #include "svtools/svtdllapi.h"
-#include <tools/list.hxx>
 
 #include <sal/types.h>
 #include <vcl/metric.hxx>
@@ -150,7 +151,7 @@ von der FontList, sollte deshalb das Array nicht mehr referenziert werden.
 #define FONTLIST_FONTNAMETYPE_SCREEN			((sal_uInt16)0x0002)
 #define FONTLIST_FONTNAMETYPE_SCALABLE			((sal_uInt16)0x0004)
 
-class SVT_DLLPUBLIC FontList : private List
+class SVT_DLLPUBLIC FontList
 {
 private:
     XubString				maMapBoth;
@@ -170,7 +171,7 @@ private:
     long*					mpSizeAry;
     OutputDevice*			mpDev;
     OutputDevice*			mpDev2;
-
+    boost::ptr_vector<ImplFontListNameInfo> maEntries;
 #ifdef CTRLTOOL_CXX
     SVT_DLLPRIVATE ImplFontListNameInfo*	ImplFind( const XubString& rSearchName, sal_uLong* pIndex ) const;
     SVT_DLLPRIVATE ImplFontListNameInfo*	ImplFindByName( const XubString& rStr ) const;
@@ -206,7 +207,7 @@ public:
 
     sal_Bool					IsAvailable( const XubString& rName ) const;
     sal_uInt16					GetFontNameCount() const
-                                { return (sal_uInt16)List::Count(); }
+                                { return (sal_uInt16)maEntries.size(); }
     const FontInfo& 		GetFontName( sal_uInt16 nFont ) const;
     sal_uInt16					GetFontNameType( sal_uInt16 nFont ) const;
     sal_Handle				GetFirstFontInfo( const XubString& rName ) const;
diff --git a/svtools/source/control/ctrltool.cxx b/svtools/source/control/ctrltool.cxx
index 4e020e2..b5cfc98 100644
--- a/svtools/source/control/ctrltool.cxx
+++ b/svtools/source/control/ctrltool.cxx
@@ -171,30 +171,30 @@ ImplFontListNameInfo* FontList::ImplFind( const XubString& rSearchName, sal_uLon
     // und somit die Wahrscheinlichkeit das hinten angehaengt werden muss
     // sehr gross ist.
     StringCompare eComp;
-    sal_uLong nCnt = Count();
+    sal_uLong nCnt = maEntries.size();
     if ( !nCnt )
     {
         if ( pIndex )
-            *pIndex = LIST_APPEND;
+            *pIndex = ULONG_MAX;
         return NULL;
     }
     else
     {
-        ImplFontListNameInfo* pCmpData = (ImplFontListNameInfo*)List::GetObject( nCnt-1 );
+        const ImplFontListNameInfo* pCmpData = &maEntries[nCnt-1];
         eComp = rSearchName.CompareTo( pCmpData->maSearchName );
         if ( eComp == COMPARE_GREATER )
         {
             if ( pIndex )
-                *pIndex = LIST_APPEND;
+                *pIndex = ULONG_MAX;
             return NULL;
         }
         else if ( eComp == COMPARE_EQUAL )
-            return pCmpData;
+            return const_cast<ImplFontListNameInfo*>(pCmpData);
     }
 
     // Fonts in der Liste suchen
-    ImplFontListNameInfo*	pCompareData;
-    ImplFontListNameInfo*	pFoundData = NULL;
+    const ImplFontListNameInfo*	pCompareData;
+    const ImplFontListNameInfo*	pFoundData = NULL;
     sal_uLong					nLow = 0;
     sal_uLong					nHigh = nCnt-1;
     sal_uLong					nMid;
@@ -202,7 +202,7 @@ ImplFontListNameInfo* FontList::ImplFind( const XubString& rSearchName, sal_uLon
     do
     {
         nMid = (nLow + nHigh) / 2;
-        pCompareData = (ImplFontListNameInfo*)List::GetObject( nMid );
+        pCompareData = &maEntries[nMid];
         eComp = rSearchName.CompareTo( pCompareData->maSearchName );
         if ( eComp == COMPARE_LESS )
         {
@@ -232,7 +232,7 @@ ImplFontListNameInfo* FontList::ImplFind( const XubString& rSearchName, sal_uLon
             *pIndex = nMid;
     }
 
-    return pFoundData;
+    return const_cast<ImplFontListNameInfo*>(pFoundData);
 }
 
 // -----------------------------------------------------------------------
@@ -284,7 +284,11 @@ void FontList::ImplInsertFonts( OutputDevice* pDevice, sal_Bool bAll,
                 pData->mpFirst		= pNewInfo;
                 pNewInfo->mpNext	= NULL;
                 pData->mnType		= 0;
-                Insert( (void*)pData, nIndex );
+
+                if (nIndex < maEntries.size())
+                    maEntries.insert(maEntries.begin()+nIndex,pData);
+                else
+                    maEntries.push_back(pData);
             }
         }
         else
@@ -344,8 +348,7 @@ void FontList::ImplInsertFonts( OutputDevice* pDevice, sal_Bool bAll,
 
 // =======================================================================
 
-FontList::FontList( OutputDevice* pDevice, OutputDevice* pDevice2, sal_Bool bAll ) :
-    List( 4096, sal::static_int_cast< sal_uInt16 >(pDevice->GetDevFontCount()), 32 )
+FontList::FontList( OutputDevice* pDevice, OutputDevice* pDevice2, sal_Bool bAll )
 {
     // Variablen initialisieren
     mpDev = pDevice;
@@ -387,20 +390,17 @@ FontList::~FontList()
         delete[] mpSizeAry;
 
     // FontInfos loeschen
-    ImplFontListNameInfo* pData = (ImplFontListNameInfo*)First();
-    while ( pData )
+    ImplFontListFontInfo *pTemp, *pInfo;
+    boost::ptr_vector<ImplFontListNameInfo>::iterator it;
+    for (it = maEntries.begin(); it != maEntries.end(); ++it)
     {
-        ImplFontListFontInfo* pTemp;
-        ImplFontListFontInfo* pInfo = pData->mpFirst;
+        pInfo = it->mpFirst;
         while ( pInfo )
         {
             pTemp = pInfo->mpNext;
             delete pInfo;
             pInfo = pTemp;
         }
-        ImplFontListNameInfo* pNext = (ImplFontListNameInfo*)Next();
-        delete pData;
-        pData = pNext;
     }
 }
 // -----------------------------------------------------------------------
@@ -757,8 +757,7 @@ const FontInfo& FontList::GetFontName( sal_uInt16 nFont ) const
 {
     DBG_ASSERT( nFont < GetFontNameCount(), "FontList::GetFontName(): nFont >= Count" );
 
-    ImplFontListNameInfo* pData = (ImplFontListNameInfo*)List::GetObject( nFont );
-    return *(pData->mpFirst);
+    return *(maEntries[nFont].mpFirst);
 }
 
 // -----------------------------------------------------------------------
@@ -767,8 +766,7 @@ sal_uInt16 FontList::GetFontNameType( sal_uInt16 nFont ) const
 {
     DBG_ASSERT( nFont < GetFontNameCount(), "FontList::GetFontNameType(): nFont >= Count" );
 
-    ImplFontListNameInfo* pData = (ImplFontListNameInfo*)List::GetObject( nFont );
-    return pData->mnType;
+    return maEntries[nFont].mnType;
 }
 
 // -----------------------------------------------------------------------
commit aa13497c88aeae61fdcccf982b6b93f1d4b9bdf6
Author: Rafael Dominguez <venccsralph at gmail.com>
Date:   Sun May 1 20:02:24 2011 -0430

    Remove unused sot/agg.hxx

diff --git a/sot/inc/sot/agg.hxx b/sot/inc/sot/agg.hxx
deleted file mode 100644
index 74ab8ec..0000000
--- a/sot/inc/sot/agg.hxx
+++ /dev/null
@@ -1,71 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * 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
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org.  If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _SOT_AGG_HXX
-#define _SOT_AGG_HXX
-
-#include <tools/ownlist.hxx>
-
-/************** class SvAggregate ***************************************/
-/************************************************************************/
-class SotFactory;
-class SotObject;
-struct SvAggregate
-{
-    union
-    {
-        SotFactory * pFact;
-        SotObject *	pObj;
-    };
-    sal_Bool	bFactory;
-    sal_Bool	bMainObj; // sal_True, das Objekt, welches das casting steuert
-
-    SvAggregate()
-        : pFact( NULL )
-        , bFactory( sal_False )
-        , bMainObj( sal_False ) {}
-    SvAggregate( SotObject * pObjP, sal_Bool bMainP )
-        : pObj( pObjP )
-        , bFactory( sal_False )
-        , bMainObj( bMainP ) {}
-    SvAggregate( SotFactory * pFactP )
-        : pFact( pFactP )
-        , bFactory( sal_True )
-        , bMainObj( sal_False ) {}
-};
-
-/************** class SvAggregateMemberList *****************************/
-/************************************************************************/
-class SvAggregateMemberList
-{
-     PRV_SV_DECL_OWNER_LIST(SvAggregateMemberList,SvAggregate)
-};
-
-#endif // _AGG_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 08bf7412aef7769f1d7111119b016d2cada6ef70
Author: Rafael Dominguez <venccsralph at gmail.com>
Date:   Sun May 1 20:01:47 2011 -0430

    Remove sot/agg.hxx include

diff --git a/sot/Package_inc.mk b/sot/Package_inc.mk
index 1b664c2..f1f71cf 100644
--- a/sot/Package_inc.mk
+++ b/sot/Package_inc.mk
@@ -27,7 +27,6 @@
 
 $(eval $(call gb_Package_Package,sot_inc,$(SRCDIR)/sot/inc))
 $(eval $(call gb_Package_add_file,sot_inc,inc/sot/absdev.hxx,sot/absdev.hxx))
-$(eval $(call gb_Package_add_file,sot_inc,inc/sot/agg.hxx,sot/agg.hxx))
 $(eval $(call gb_Package_add_file,sot_inc,inc/sot/clsids.hxx,sot/clsids.hxx))
 $(eval $(call gb_Package_add_file,sot_inc,inc/sot/exchange.hxx,sot/exchange.hxx))
 $(eval $(call gb_Package_add_file,sot_inc,inc/sot/factory.hxx,sot/factory.hxx))
diff --git a/sot/source/base/object.cxx b/sot/source/base/object.cxx
index 7c5c13c..97bd2d6 100644
--- a/sot/source/base/object.cxx
+++ b/sot/source/base/object.cxx
@@ -34,7 +34,6 @@
 #include <tools/debug.hxx>
 #include <sot/object.hxx>
 #include <sot/factory.hxx>
-#include <sot/agg.hxx>
 
 /************** class SotObject ******************************************/
 class SotObjectFactory : public SotFactory


More information about the Libreoffice-commits mailing list