diff --git a/src/configuration/FormatsList.h b/src/configuration/FormatsList.h index c43f08f0..0058c8a2 100644 --- a/src/configuration/FormatsList.h +++ b/src/configuration/FormatsList.h @@ -63,6 +63,18 @@ public: { m_Formats.AddTail(format); } + void InsertBefore(CFormat &format, int nIndex) + { + POSITION pos = m_Formats.FindIndex(nIndex); + if (pos != NULL) + m_Formats.InsertBefore(pos, format); + } + void InsertAfter(CFormat &format, int nIndex) + { + POSITION pos = m_Formats.FindIndex(nIndex); + if (pos != NULL) + m_Formats.InsertAfter(pos, format); + } public: void RemoveNode(int pstn = -1) { diff --git a/src/configuration/ItemsList.h b/src/configuration/ItemsList.h index 3f075ebd..83f2466f 100644 --- a/src/configuration/ItemsList.h +++ b/src/configuration/ItemsList.h @@ -62,6 +62,18 @@ public: { m_Items.AddTail(item); } + void InsertBefore(CItem& item, int nIndex) + { + POSITION pos = m_Items.FindIndex(nIndex); + if (pos != NULL) + m_Items.InsertBefore(pos, item); + } + void InsertAfter(CItem& item, int nIndex) + { + POSITION pos = m_Items.FindIndex(nIndex); + if (pos != NULL) + m_Items.InsertAfter(pos, item); + } public: void RemoveNode(int pstn = -1) { diff --git a/src/configuration/LanguagesList.h b/src/configuration/LanguagesList.h index f2208b8e..672645e6 100644 --- a/src/configuration/LanguagesList.h +++ b/src/configuration/LanguagesList.h @@ -63,6 +63,18 @@ public: { m_Languages.AddTail(language); } + void InsertBefore(CLanguage &language, int nIndex) + { + POSITION pos = m_Languages.FindIndex(nIndex); + if (pos != NULL) + m_Languages.InsertBefore(pos, language); + } + void InsertAfter(CLanguage &language, int nIndex) + { + POSITION pos = m_Languages.FindIndex(nIndex); + if (pos != NULL) + m_Languages.InsertAfter(pos, language); + } public: void RemoveNode(int pstn = -1) { diff --git a/src/configuration/PresetsList.h b/src/configuration/PresetsList.h index 6d193d91..ec57908f 100644 --- a/src/configuration/PresetsList.h +++ b/src/configuration/PresetsList.h @@ -63,6 +63,18 @@ public: { m_Presets.AddTail(preset); } + void InsertBefore(CPreset &preset, int nIndex) + { + POSITION pos = m_Presets.FindIndex(nIndex); + if (pos != NULL) + m_Presets.InsertBefore(pos, preset); + } + void InsertAfter(CPreset &preset, int nIndex) + { + POSITION pos = m_Presets.FindIndex(nIndex); + if (pos != NULL) + m_Presets.InsertAfter(pos, preset); + } void InsertNode(CString szName) { CPreset preset;