Kaydet (Commit) 5b42e9d7 authored tarafından Joseph Powers's avatar Joseph Powers

Remove DECLARE_LIST( ImplFontList, ImplFontNameListData* )

üst 1b82bcb4
...@@ -38,13 +38,14 @@ ...@@ -38,13 +38,14 @@
#include <vcl/metric.hxx> #include <vcl/metric.hxx>
#include <vcl/field.hxx> #include <vcl/field.hxx>
class ImplFontList;
class FontList; class FontList;
class ImplColorListData; class ImplColorListData;
class ImpLineListData; class ImpLineListData;
class ImplFontNameListData;
typedef ::std::vector< ImplColorListData* > ImpColorList; typedef ::std::vector< ImplColorListData* > ImpColorList;
typedef ::std::vector< ImpLineListData* > ImpLineList; typedef ::std::vector< ImpLineListData* > ImpLineList;
typedef ::std::vector< ImplFontNameListData* > ImplFontList;
#define STYLE_SOLID ( ( USHORT ) 0 ) #define STYLE_SOLID ( ( USHORT ) 0 )
#define STYLE_DOTTED ( ( USHORT ) 1 ) #define STYLE_DOTTED ( ( USHORT ) 1 )
......
...@@ -745,8 +745,6 @@ struct ImplFontNameListData ...@@ -745,8 +745,6 @@ struct ImplFontNameListData
{} {}
}; };
DECLARE_LIST( ImplFontList, ImplFontNameListData* )
// ------------------------------------------------------------------- // -------------------------------------------------------------------
FontNameBox::FontNameBox( Window* pParent, WinBits nWinStyle ) : FontNameBox::FontNameBox( Window* pParent, WinBits nWinStyle ) :
...@@ -801,12 +799,10 @@ void FontNameBox::ImplDestroyFontList() ...@@ -801,12 +799,10 @@ void FontNameBox::ImplDestroyFontList()
{ {
if ( mpFontList ) if ( mpFontList )
{ {
ImplFontNameListData* pInfo = mpFontList->First(); for ( size_t i = 0, n = mpFontList->size(); i < n; ++i ) {
while ( pInfo ) delete (*mpFontList)[ i ];
{
delete pInfo;
pInfo = mpFontList->Next();
} }
mpFontList->clear();
delete mpFontList; delete mpFontList;
} }
} }
...@@ -832,7 +828,13 @@ void FontNameBox::Fill( const FontList* pList ) ...@@ -832,7 +828,13 @@ void FontNameBox::Fill( const FontList* pList )
{ {
USHORT nType = pList->GetFontNameType( i ); USHORT nType = pList->GetFontNameType( i );
ImplFontNameListData* pData = new ImplFontNameListData( rFontInfo, nType ); ImplFontNameListData* pData = new ImplFontNameListData( rFontInfo, nType );
mpFontList->Insert( pData, nIndex ); if ( nIndex < mpFontList->size() ) {
ImplFontList::iterator it = mpFontList->begin();
::std::advance( it, nIndex );
mpFontList->insert( it, pData );
} else {
mpFontList->push_back( pData );
}
} }
} }
...@@ -975,7 +977,7 @@ namespace ...@@ -975,7 +977,7 @@ namespace
void FontNameBox::UserDraw( const UserDrawEvent& rUDEvt ) void FontNameBox::UserDraw( const UserDrawEvent& rUDEvt )
{ {
ImplFontNameListData* pData = mpFontList->GetObject( rUDEvt.GetItemId() ); ImplFontNameListData* pData = (*mpFontList)[ rUDEvt.GetItemId() ];
const FontInfo& rInfo = pData->maInfo; const FontInfo& rInfo = pData->maInfo;
USHORT nType = pData->mnType; USHORT nType = pData->mnType;
Point aTopLeft = rUDEvt.GetRect().TopLeft(); Point aTopLeft = rUDEvt.GetRect().TopLeft();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment