View Issue Details

IDProjectCategoryView StatusLast Update
0038848PatchesWidgetsetpublic2021-05-07 11:24
ReporterZaher Dirkey Assigned ToJuha Manninen  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
PlatformWindowsOSWindows 8.1 64 bit 
Summary0038848: ListView, Empty subitem of column have no select background if RowSelect and OwnerData
DescriptionIn Windows only, With
TListView.OwnerData := True , RowSelect := True and ViewStyle := vsReport;
if we have subitem is empty string, it show no selected background for this cell

Example attached and patch to fix it.
TagsNo tags attached.
Fixed in Revisionr65092
LazTarget-
WidgetsetWin32/Win64
Attached Files

Activities

Zaher Dirkey

2021-05-03 19:17

reporter  

ListViewOwnerData.7z (1,032 bytes)
win32wscustomlistview.inc.patch (1,613 bytes)   
Index: lcl/interfaces/win32/win32wscustomlistview.inc
===================================================================
--- lcl/interfaces/win32/win32wscustomlistview.inc	(revision 64896)
+++ lcl/interfaces/win32/win32wscustomlistview.inc	(working copy)
@@ -115,23 +115,18 @@
         else
           txt := '';
       end;
-      if txt <> '' then
+      if DataInfo^.hdr.code = UInt(LVN_GETDISPINFOA) then
       begin
-        if DataInfo^.hdr.code = UInt(LVN_GETDISPINFOA) then
-        begin
-          LVInfo^.DispInfoTextA[LVInfo^.DispInfoIndex]:=Utf8ToAnsi(txt);
-          DataInfo^.item.pszText := @(LVInfo^.DispInfoTextA[LVInfo^.DispInfoIndex][1]);
-        end
-        else
-        begin
-          LVInfo^.DispInfoTextW[LVInfo^.DispInfoIndex]:=UTF8Decode(txt);
-          DataInfo^.item.pszText := @(LVInfo^.DispInfoTextW[LVInfo^.DispInfoIndex][1]);
-        end;
-        inc(LVInfo^.DispInfoIndex);
-        if LVInfo^.DispInfoIndex=LV_DISP_INFO_COUNT then LVInfo^.DispInfoIndex:=0;
+        LVInfo^.DispInfoTextA[LVInfo^.DispInfoIndex]:=Utf8ToAnsi(txt+#0);
+        DataInfo^.item.pszText := @(LVInfo^.DispInfoTextA[LVInfo^.DispInfoIndex][1]);
       end
       else
-        DataInfo^.item.pszText := nil;
+      begin
+        LVInfo^.DispInfoTextW[LVInfo^.DispInfoIndex]:=UTF8Decode(txt+#0);
+        DataInfo^.item.pszText := PChar(LVInfo^.DispInfoTextW[LVInfo^.DispInfoIndex]);
+      end;
+      inc(LVInfo^.DispInfoIndex);
+      if LVInfo^.DispInfoIndex=LV_DISP_INFO_COUNT then LVInfo^.DispInfoIndex:=0;
     end;
     if (DataInfo^.item.mask and LVIF_IMAGE) <> 0 then
     begin

Juha Manninen

2021-05-07 11:24

developer   ~0130785

Applied, thanks.

Issue History

Date Modified Username Field Change
2021-05-03 19:17 Zaher Dirkey New Issue
2021-05-03 19:17 Zaher Dirkey File Added: ownerdata_listview_rowselected.png
2021-05-03 19:17 Zaher Dirkey File Added: ListViewOwnerData.7z
2021-05-03 19:17 Zaher Dirkey File Added: win32wscustomlistview.inc.patch
2021-05-07 11:24 Juha Manninen Assigned To => Juha Manninen
2021-05-07 11:24 Juha Manninen Status new => resolved
2021-05-07 11:24 Juha Manninen Resolution open => fixed
2021-05-07 11:24 Juha Manninen Fixed in Revision => r65092
2021-05-07 11:24 Juha Manninen LazTarget => -
2021-05-07 11:24 Juha Manninen Widgetset Win32/Win64 => Win32/Win64
2021-05-07 11:24 Juha Manninen Note Added: 0130785