Kaydet (Commit) 20c4de49 authored tarafından Noel Grandin's avatar Noel Grandin

convert custom list implementation SortedIndividualInt32List

.. to std::vector

Change-Id: I882653fbe6e42bf2a4f79c5b7c353e6667c79879
üst 22b928d7
......@@ -1564,11 +1564,11 @@ void SortedIndividualInt32List::Insert( sal_Int32 nDay )
return;
else if( nDay > nRef )
{
MyList::Insert( (void*)(sal_IntPtr)nDay, nIndex + 1 );
maVector.insert( maVector.begin() + nIndex + 1, nDay );
return;
}
}
MyList::Insert( (void*)(sal_IntPtr)nDay, 0UL );
maVector.insert( maVector.begin(), nDay );
}
......
......@@ -286,10 +286,11 @@ public:
//-----------------------------------------------------------------------------
/// sorted list with unique sal_Int32 values
class SortedIndividualInt32List : private MyList
class SortedIndividualInt32List
{
private:
std::vector<sal_Int32> maVector;
protected:
using MyList::Insert;
void Insert( sal_Int32 nDay );
void Insert( sal_Int32 nDay, sal_Int32 nNullDate, sal_Bool bInsertOnWeekend );
void Insert( double fDay, sal_Int32 nNullDate, sal_Bool bInsertOnWeekend )
......@@ -307,11 +308,12 @@ public:
SortedIndividualInt32List();
virtual ~SortedIndividualInt32List();
using MyList::Count;
inline sal_uInt32 Count() const
{ return maVector.size(); }
/// @return element on position nIndex or 0 on invalid index
inline sal_Int32 Get( sal_uInt32 nIndex ) const
{ return (sal_Int32)(sal_IntPtr) MyList::GetObject( nIndex ); }
inline sal_Int32 Get( sal_uInt32 n ) const
{ return maVector[n]; }
/// @return sal_True if nVal (internal date representation) is contained
sal_Bool Find( sal_Int32 nVal ) const;
......
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