Kaydet (Commit) e346df21 authored tarafından Rafael Dominguez's avatar Rafael Dominguez Kaydeden (comit) Petr Mladek

Replace List for std::vector<ScRangeFindData>.

üst 8989823b
...@@ -204,8 +204,7 @@ handle_r1c1: ...@@ -204,8 +204,7 @@ handle_r1c1:
pRangeFindList = new ScRangeFindList( pDocSh->GetTitle() ); pRangeFindList = new ScRangeFindList( pDocSh->GetTitle() );
} }
ScRangeFindData* pNew = new ScRangeFindData( aRange, nFlags, nStart, nPos ); pRangeFindList->Insert( ScRangeFindData( aRange, nFlags, nStart, nPos ) );
pRangeFindList->Insert( pNew );
ESelection aSel( 0, nStart, 0, nPos ); ESelection aSel( 0, nStart, 0, nPos );
SfxItemSet aSet( pEngine->GetEmptyItemSet() ); SfxItemSet aSet( pEngine->GetEmptyItemSet() );
......
...@@ -49,16 +49,6 @@ ScRangeFindList::ScRangeFindList(const String& rName) : ...@@ -49,16 +49,6 @@ ScRangeFindList::ScRangeFindList(const String& rName) :
{ {
} }
ScRangeFindList::~ScRangeFindList()
{
void* pEntry = aEntries.First();
while ( pEntry )
{
delete (ScRangeFindData*) aEntries.Remove( pEntry );
pEntry = aEntries.Next();
}
}
ColorData ScRangeFindList::GetColorName( size_t nIndex ) ColorData ScRangeFindList::GetColorName( size_t nIndex )
{ {
return aColNames[nIndex % SC_RANGECOLORS]; return aColNames[nIndex % SC_RANGECOLORS];
......
...@@ -48,18 +48,17 @@ struct ScRangeFindData ...@@ -48,18 +48,17 @@ struct ScRangeFindData
class ScRangeFindList class ScRangeFindList
{ {
List aEntries; std::vector<ScRangeFindData> maEntries;
String aDocName; String aDocName;
bool bHidden; bool bHidden;
public: public:
ScRangeFindList(const String& rName); ScRangeFindList(const String& rName);
~ScRangeFindList();
sal_uLong Count() const { return aEntries.Count(); } sal_uLong Count() const { return maEntries.size(); }
void Insert( ScRangeFindData* pNew ) { aEntries.Insert(pNew, LIST_APPEND); } void Insert( const ScRangeFindData &rNew ) { maEntries.push_back(rNew); }
ScRangeFindData* GetObject( sal_uLong nIndex ) const
{ return (ScRangeFindData*)aEntries.GetObject(nIndex); } ScRangeFindData* GetObject( sal_uLong nIndex ) { return &(maEntries[nIndex]); }
void SetHidden( sal_Bool bSet ) { bHidden = bSet; } void SetHidden( sal_Bool bSet ) { bHidden = bSet; }
......
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