View Issue Details

IDProjectCategoryView StatusLast Update
0035173LazarusLCLpublic2019-11-01 20:50
ReporterSerge AnvarovAssigned ToJuha Manninen 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
PlatformWindowsOSOS Version
Product Version2.0Product Build 
Target VersionFixed in Version 
Summary0035173: Windows. OwnerData listview does not take into account the properties SubItemImages
DescriptionThe ImageIndex property is always used, even for subitems.
Steps To Reproducehttps://forum.lazarus.freepascal.org/index.php/topic,44498.msg312819.html#msg312819
Additional InformationPatch included
TagsNo tags attached.
Fixed in Revisionr61749
LazTarget-
Widgetset
Attached Files
  • ListviewOwnerdataSubitemimages.diff (890 bytes)
    Index: lcl/interfaces/win32/win32wscustomlistview.inc
    ===================================================================
    --- lcl/interfaces/win32/win32wscustomlistview.inc	(revision 60526)
    +++ lcl/interfaces/win32/win32wscustomlistview.inc	(working copy)
    @@ -129,7 +129,16 @@
         end;
         if (DataInfo^.item.mask and LVIF_IMAGE) <> 0 then
         begin
    -      DataInfo^.item.iImage := listitem.ImageIndex;
    +      if DataInfo^.item.iSubItem = 0 then
    +        DataInfo^.item.iImage := listitem.ImageIndex
    +      else
    +      begin
    +        idx := DataInfo^.item.iSubItem - 1;
    +        if idx < listitem.SubItems.Count then
    +          DataInfo^.item.iImage := listitem.SubItemImages[idx]
    +        else
    +          DataInfo^.item.iImage := -1;
    +      end;
           if Assigned(ALV.StateImages) then
           begin
             DataInfo^.item.state := IndexToStateImageMask(listitem.StateIndex + 1);
    

Activities

Serge Anvarov

2019-03-01 20:42

reporter  

ListviewOwnerdataSubitemimages.diff (890 bytes)
Index: lcl/interfaces/win32/win32wscustomlistview.inc
===================================================================
--- lcl/interfaces/win32/win32wscustomlistview.inc	(revision 60526)
+++ lcl/interfaces/win32/win32wscustomlistview.inc	(working copy)
@@ -129,7 +129,16 @@
     end;
     if (DataInfo^.item.mask and LVIF_IMAGE) <> 0 then
     begin
-      DataInfo^.item.iImage := listitem.ImageIndex;
+      if DataInfo^.item.iSubItem = 0 then
+        DataInfo^.item.iImage := listitem.ImageIndex
+      else
+      begin
+        idx := DataInfo^.item.iSubItem - 1;
+        if idx < listitem.SubItems.Count then
+          DataInfo^.item.iImage := listitem.SubItemImages[idx]
+        else
+          DataInfo^.item.iImage := -1;
+      end;
       if Assigned(ALV.StateImages) then
       begin
         DataInfo^.item.state := IndexToStateImageMask(listitem.StateIndex + 1);

Juha Manninen

2019-08-23 20:43

developer   ~0117811

Applied, thanks.

Serge Anvarov

2019-11-01 20:50

reporter   ~0118960

Not in release yet

Issue History

Date Modified Username Field Change
2019-03-01 20:42 Serge Anvarov New Issue
2019-03-01 20:42 Serge Anvarov File Added: ListviewOwnerdataSubitemimages.diff
2019-08-23 20:38 Juha Manninen Assigned To => Juha Manninen
2019-08-23 20:38 Juha Manninen Status new => assigned
2019-08-23 20:43 Juha Manninen Status assigned => resolved
2019-08-23 20:43 Juha Manninen Resolution open => fixed
2019-08-23 20:43 Juha Manninen Fixed in Revision => r61749
2019-08-23 20:43 Juha Manninen LazTarget => -
2019-08-23 20:43 Juha Manninen Note Added: 0117811
2019-11-01 20:50 Serge Anvarov Note Added: 0118960