diff options
Diffstat (limited to 'plugins/Utils')
-rw-r--r-- | plugins/Utils/mir_dblists.cpp | 54 | ||||
-rw-r--r-- | plugins/Utils/mir_options.cpp | 21 |
2 files changed, 28 insertions, 47 deletions
diff --git a/plugins/Utils/mir_dblists.cpp b/plugins/Utils/mir_dblists.cpp index e866589b24..1c4df07696 100644 --- a/plugins/Utils/mir_dblists.cpp +++ b/plugins/Utils/mir_dblists.cpp @@ -27,32 +27,32 @@ Boston, MA 02111-1307, USA. #include <m_system.h>
-void List_DestroyFreeContents( SortedList* p_list ) -{ - if ( p_list == NULL ) - return; - - if ( p_list->items != NULL ) - { - int i; - for ( i = 0 ; i < p_list->realCount ; i++ ) - { - if ( p_list->items[i] != NULL ) - { - mir_free( p_list->items[i] ); - } - } - } - - List_Destroy( p_list ); -} - -
-int List_Append( SortedList* p_list, void* p_value ) -{ - return List_Insert( p_list, p_value, p_list->realCount ); -} - +void List_DestroyFreeContents( SortedList* p_list )
+{
+ if ( p_list == NULL )
+ return;
+
+ if ( p_list->items != NULL )
+ {
+ int i;
+ for ( i = 0 ; i < p_list->realCount ; i++ )
+ {
+ if ( p_list->items[i] != NULL )
+ {
+ mir_free( p_list->items[i] );
+ }
+ }
+ }
+
+ List_Destroy( p_list );
+}
+
+
+int List_Append( SortedList* p_list, void* p_value )
+{
+ return List_Insert( p_list, p_value, p_list->realCount );
+}
+
int List_InsertOrdered( SortedList* p_list, void* p_value )
{
@@ -80,7 +80,7 @@ int List_RemoveByValue( SortedList* p_list, void* p_value ) }
return ret;
-} +}
int List_RemoveByValueFreeContents( SortedList* p_list, void* p_value )
diff --git a/plugins/Utils/mir_options.cpp b/plugins/Utils/mir_options.cpp index 6f8a831e5d..c52995471e 100644 --- a/plugins/Utils/mir_options.cpp +++ b/plugins/Utils/mir_options.cpp @@ -48,26 +48,7 @@ static TCHAR* MyDBGetContactSettingTString(HANDLE hContact, char* module, char* if (!DBGetContactSettingTString(hContact, module, setting, &dbv))
{
-
- if (dbv.type == DBVT_ASCIIZ)
- {
- MultiByteToWideChar(CP_ACP, 0, dbv.pszVal, -1, out, (int)len);
- }
- else if (dbv.type == DBVT_UTF8)
- {
- MultiByteToWideChar(CP_UTF8, 0, dbv.pszVal, -1, out, (int)len);
- }
- else if (dbv.type == DBVT_WCHAR)
- {
- lstrcpyn(out, dbv.pwszVal, (int)len);
- }
-
- else
- {
- if (def != NULL)
- lstrcpyn(out, def, (int)len);
- }
-
+ lstrcpyn(out, dbv.ptszVal, (int)len);
DBFreeVariant(&dbv);
}
else
|