Commit 06c4d0e3 authored by Marcus Meissner's avatar Marcus Meissner Committed by Alexandre Julliard

Implemented LVM_INSERTCOLUMNW and LVM_INSERTITEMW by using the ascii

equivalents. (WinWord 97, File Open dialog)
parent 43806217
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
#include <string.h> #include <string.h>
#include "winbase.h" #include "winbase.h"
#include "heap.h"
#include "commctrl.h" #include "commctrl.h"
#include "listview.h" #include "listview.h"
#include "debugtools.h" #include "debugtools.h"
...@@ -4517,7 +4518,21 @@ static LRESULT LISTVIEW_InsertColumnA(HWND hwnd, INT nColumn, ...@@ -4517,7 +4518,21 @@ static LRESULT LISTVIEW_InsertColumnA(HWND hwnd, INT nColumn,
return nNewColumn; return nNewColumn;
} }
/* LISTVIEW_InsertColumnW */ static LRESULT LISTVIEW_InsertColumnW(HWND hwnd, INT nColumn,
LPLVCOLUMNW lpColumn)
{
LVCOLUMNA lvca;
LRESULT lres;
memcpy(&lvca,lpColumn,sizeof(lvca));
if (lpColumn->mask & LVCF_TEXT)
lvca.pszText = HEAP_strdupWtoA(GetProcessHeap(),0,lpColumn->pszText);
lres = LISTVIEW_InsertColumnA(hwnd,nColumn,&lvca);
if (lpColumn->mask & LVCF_TEXT)
HeapFree(GetProcessHeap(),0,lvca.pszText);
return lres;
}
/*** /***
* DESCRIPTION: * DESCRIPTION:
...@@ -4617,6 +4632,25 @@ static LRESULT LISTVIEW_InsertItemA(HWND hwnd, LPLVITEMA lpLVItem) ...@@ -4617,6 +4632,25 @@ static LRESULT LISTVIEW_InsertItemA(HWND hwnd, LPLVITEMA lpLVItem)
return nItem; return nItem;
} }
static LRESULT LISTVIEW_InsertItemW(HWND hwnd, LPLVITEMW lpLVItem) {
LVITEMA lvia;
LRESULT lres;
memcpy(&lvia,lpLVItem,sizeof(LVITEMA));
if (lvia.mask & LVIF_TEXT) {
if (lpLVItem->pszText == LPSTR_TEXTCALLBACKW)
lvia.pszText = LPSTR_TEXTCALLBACKA;
else
lvia.pszText = HEAP_strdupWtoA(GetProcessHeap(),0,lpLVItem->pszText);
}
lres = LISTVIEW_InsertItemA(hwnd, &lvia);
if (lvia.mask & LVIF_TEXT) {
if (lpLVItem->pszText != LPSTR_TEXTCALLBACKW)
HeapFree(GetProcessHeap(),0,lvia.pszText);
}
return lres;
}
/* LISTVIEW_InsertItemW */ /* LISTVIEW_InsertItemW */
/*** /***
...@@ -6747,15 +6781,16 @@ static LRESULT WINAPI LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, ...@@ -6747,15 +6781,16 @@ static LRESULT WINAPI LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam,
return LISTVIEW_HitTest(hwnd, (LPLVHITTESTINFO)lParam); return LISTVIEW_HitTest(hwnd, (LPLVHITTESTINFO)lParam);
case LVM_INSERTCOLUMNA: case LVM_INSERTCOLUMNA:
return LISTVIEW_InsertColumnA(hwnd, (INT)wParam, return LISTVIEW_InsertColumnA(hwnd, (INT)wParam, (LPLVCOLUMNA)lParam);
(LPLVCOLUMNA)lParam);
/* case LVM_INSERTCOLUMNW: */ case LVM_INSERTCOLUMNW:
return LISTVIEW_InsertColumnW(hwnd, (INT)wParam, (LPLVCOLUMNW)lParam);
case LVM_INSERTITEMA: case LVM_INSERTITEMA:
return LISTVIEW_InsertItemA(hwnd, (LPLVITEMA)lParam); return LISTVIEW_InsertItemA(hwnd, (LPLVITEMA)lParam);
/* case LVM_INSERTITEMW: */ case LVM_INSERTITEMW:
return LISTVIEW_InsertItemW(hwnd, (LPLVITEMW)lParam);
case LVM_REDRAWITEMS: case LVM_REDRAWITEMS:
return LISTVIEW_RedrawItems(hwnd, (INT)wParam, (INT)lParam); return LISTVIEW_RedrawItems(hwnd, (INT)wParam, (INT)lParam);
......
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