mirror of
https://github.com/leozide/leocad.git
synced 2026-09-15 11:03:55 +00:00
Insert placeholder pieces when loading files with pieces not in the library.
This commit is contained in:
+16
-1
@@ -22,10 +22,19 @@ PtrArray<T>::~PtrArray()
|
||||
free(m_pData);
|
||||
}
|
||||
|
||||
template <class T>
|
||||
void PtrArray<T>::SetSize(int Size)
|
||||
{
|
||||
if (Size > m_nLength)
|
||||
Expand(Size - m_nLength);
|
||||
|
||||
m_nLength = Size;
|
||||
}
|
||||
|
||||
template <class T>
|
||||
void PtrArray<T>::Expand(int nGrow)
|
||||
{
|
||||
if((m_nLength + nGrow) > m_nAlloc)
|
||||
if ((m_nLength + nGrow) > m_nAlloc)
|
||||
{
|
||||
m_pData =(T**)realloc(m_pData,(m_nLength + nGrow) * sizeof(T*));
|
||||
memset(m_pData + m_nLength, 0, nGrow * sizeof(T*));
|
||||
@@ -95,6 +104,12 @@ void PtrArray<T>::AddSorted(T* pObj, LC_PTRARRAY_COMPARE_FUNC pFunc, void* pData
|
||||
Add(pObj);
|
||||
}
|
||||
|
||||
template <class T>
|
||||
void PtrArray<T>::SetAt(int Index, T* Ptr)
|
||||
{
|
||||
m_pData[Index] = Ptr;
|
||||
}
|
||||
|
||||
template <class T>
|
||||
void PtrArray<T>::InsertAt(int nIndex, T* pObj)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user