View Issue Details

IDProjectCategoryView StatusLast Update
0034804LazarusPackagespublic2019-01-11 09:30
ReporterPascal RiekenbergAssigned Towp 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Platformi386OSWindows 10 x64OS Version1803
Product Version2.1 (SVN)Product Build59978 
Target Version2.0Fixed in Version 
Summary0034804: Make VirtualTreeView compile again after fpc r40745
DescriptionMake VirtualTreeView compile again after fpc r40745
TagsNo tags attached.
Fixed in Revision60024
LazTarget2.0
WidgetsetWin32/Win64
Attached Files
  • virtualtreeview.patch (1,805 bytes)
    Index: components/virtualtreeview/include/intf/win32/vtvdragmanager.inc
    ===================================================================
    --- components/virtualtreeview/include/intf/win32/vtvdragmanager.inc	(revision 59933)
    +++ components/virtualtreeview/include/intf/win32/vtvdragmanager.inc	(working copy)
    @@ -481,7 +481,7 @@
     
     //----------------------------------------------------------------------------------------------------------------------
     
    -function TVTDataObject.SetData(const FormatEtc: TFormatEtc; const Medium: TStgMedium; DoRelease: BOOL): HResult;
    +function TVTDataObject.SetData(const FormatEtc: TFormatEtc; var Medium: TStgMedium; DoRelease: BOOL): HResult;
     
     // Allows dynamic adding to the IDataObject during its existance. Most noteably it is used to implement
     // IDropSourceHelper and allows to set a special format for optimized moves during a shell transfer.
    Index: components/virtualtreeview/VirtualTrees.pas
    ===================================================================
    --- components/virtualtreeview/VirtualTrees.pas	(revision 59933)
    +++ components/virtualtreeview/VirtualTrees.pas	(working copy)
    @@ -815,7 +815,7 @@
         function GetData(const FormatEtcIn: TFormatEtc; out Medium: TStgMedium): HResult; virtual; stdcall;
         function GetDataHere(const {%H-}FormatEtc: TFormatEtc; out {%H-}Medium: TStgMedium): HResult; virtual; stdcall;
         function QueryGetData(const FormatEtc: TFormatEtc): HResult; virtual; stdcall;
    -    function SetData(const FormatEtc: TFormatEtc; const Medium: TStgMedium; DoRelease: BOOL): HResult; virtual; stdcall;
    +    function SetData(const FormatEtc: TFormatEtc; var Medium: TStgMedium; DoRelease: BOOL): HResult; virtual; stdcall;
       end;
     
       // TVTDragManager is a class to manage drag and drop in a Virtual Treeview.
    
    virtualtreeview.patch (1,805 bytes)
  • virtualtreeview_2.patch (1,919 bytes)
    Index: components/virtualtreeview/include/intf/win32/vtvdragmanager.inc
    ===================================================================
    --- components/virtualtreeview/include/intf/win32/vtvdragmanager.inc	(revision 59933)
    +++ components/virtualtreeview/include/intf/win32/vtvdragmanager.inc	(working copy)
    @@ -481,7 +481,11 @@
     
     //----------------------------------------------------------------------------------------------------------------------
     
    +{$IF FPC_FULLVERSION < 30200}
     function TVTDataObject.SetData(const FormatEtc: TFormatEtc; const Medium: TStgMedium; DoRelease: BOOL): HResult;
    +{$ELSE}
    +function TVTDataObject.SetData(const FormatEtc: TFormatEtc; var Medium: TStgMedium; DoRelease: BOOL): HResult;
    +{$IFEND}
     
     // Allows dynamic adding to the IDataObject during its existance. Most noteably it is used to implement
     // IDropSourceHelper and allows to set a special format for optimized moves during a shell transfer.
    Index: components/virtualtreeview/VirtualTrees.pas
    ===================================================================
    --- components/virtualtreeview/VirtualTrees.pas	(revision 59933)
    +++ components/virtualtreeview/VirtualTrees.pas	(working copy)
    @@ -815,7 +815,11 @@
         function GetData(const FormatEtcIn: TFormatEtc; out Medium: TStgMedium): HResult; virtual; stdcall;
         function GetDataHere(const {%H-}FormatEtc: TFormatEtc; out {%H-}Medium: TStgMedium): HResult; virtual; stdcall;
         function QueryGetData(const FormatEtc: TFormatEtc): HResult; virtual; stdcall;
    +    {$IF FPC_FULLVERSION < 30200}
         function SetData(const FormatEtc: TFormatEtc; const Medium: TStgMedium; DoRelease: BOOL): HResult; virtual; stdcall;
    +    {$ELSE}
    +    function SetData(const FormatEtc: TFormatEtc; var Medium: TStgMedium; DoRelease: BOOL): HResult; virtual; stdcall;
    +    {$IFEND}
       end;
     
       // TVTDragManager is a class to manage drag and drop in a Virtual Treeview.
    
    virtualtreeview_2.patch (1,919 bytes)
  • virtualtreeview_3.patch (3,001 bytes)
    Index: components/virtualtreeview/include/intf/dummydragmanager.inc
    ===================================================================
    --- components/virtualtreeview/include/intf/dummydragmanager.inc	(revision 59933)
    +++ components/virtualtreeview/include/intf/dummydragmanager.inc	(working copy)
    @@ -533,7 +533,11 @@
     
     //----------------------------------------------------------------------------------------------------------------------
     
    -function TVTDataObject.SetData(const FormatEtc: TFormatEtc; {$ifdef VER2_0}var{$else}const{$endif} Medium: TStgMedium; DoRelease: BOOL): HResult;
    +{$IF FPC_FULLVERSION < 30200}
    +function TVTDataObject.SetData(const FormatEtc: TFormatEtc; const Medium: TStgMedium; DoRelease: BOOL): HResult;
    +{$ELSE}
    +function TVTDataObject.SetData(const FormatEtc: TFormatEtc; var Medium: TStgMedium; DoRelease: BOOL): HResult;
    +{$IFEND}
     
     // Allows dynamic adding to the IDataObject during its existance. Most noteably it is used to implement
     // IDropSourceHelper and allows to set a special format for optimized moves during a shell transfer.
    Index: components/virtualtreeview/include/intf/win32/vtvdragmanager.inc
    ===================================================================
    --- components/virtualtreeview/include/intf/win32/vtvdragmanager.inc	(revision 59933)
    +++ components/virtualtreeview/include/intf/win32/vtvdragmanager.inc	(working copy)
    @@ -481,7 +481,11 @@
     
     //----------------------------------------------------------------------------------------------------------------------
     
    +{$IF FPC_FULLVERSION < 30200}
     function TVTDataObject.SetData(const FormatEtc: TFormatEtc; const Medium: TStgMedium; DoRelease: BOOL): HResult;
    +{$ELSE}
    +function TVTDataObject.SetData(const FormatEtc: TFormatEtc; var Medium: TStgMedium; DoRelease: BOOL): HResult;
    +{$IFEND}
     
     // Allows dynamic adding to the IDataObject during its existance. Most noteably it is used to implement
     // IDropSourceHelper and allows to set a special format for optimized moves during a shell transfer.
    Index: components/virtualtreeview/VirtualTrees.pas
    ===================================================================
    --- components/virtualtreeview/VirtualTrees.pas	(revision 59933)
    +++ components/virtualtreeview/VirtualTrees.pas	(working copy)
    @@ -815,7 +815,11 @@
         function GetData(const FormatEtcIn: TFormatEtc; out Medium: TStgMedium): HResult; virtual; stdcall;
         function GetDataHere(const {%H-}FormatEtc: TFormatEtc; out {%H-}Medium: TStgMedium): HResult; virtual; stdcall;
         function QueryGetData(const FormatEtc: TFormatEtc): HResult; virtual; stdcall;
    +    {$IF FPC_FULLVERSION < 30200}
         function SetData(const FormatEtc: TFormatEtc; const Medium: TStgMedium; DoRelease: BOOL): HResult; virtual; stdcall;
    +    {$ELSE}
    +    function SetData(const FormatEtc: TFormatEtc; var Medium: TStgMedium; DoRelease: BOOL): HResult; virtual; stdcall;
    +    {$IFEND}
       end;
     
       // TVTDragManager is a class to manage drag and drop in a Virtual Treeview.
    
    virtualtreeview_3.patch (3,001 bytes)

Relationships

related to 0034758 resolvedMarco van de Voort FPC activex.pp, IOleCache.setData( pmedium) 

Activities

Pascal Riekenberg

2019-01-03 07:34

reporter  

virtualtreeview.patch (1,805 bytes)
Index: components/virtualtreeview/include/intf/win32/vtvdragmanager.inc
===================================================================
--- components/virtualtreeview/include/intf/win32/vtvdragmanager.inc	(revision 59933)
+++ components/virtualtreeview/include/intf/win32/vtvdragmanager.inc	(working copy)
@@ -481,7 +481,7 @@
 
 //----------------------------------------------------------------------------------------------------------------------
 
-function TVTDataObject.SetData(const FormatEtc: TFormatEtc; const Medium: TStgMedium; DoRelease: BOOL): HResult;
+function TVTDataObject.SetData(const FormatEtc: TFormatEtc; var Medium: TStgMedium; DoRelease: BOOL): HResult;
 
 // Allows dynamic adding to the IDataObject during its existance. Most noteably it is used to implement
 // IDropSourceHelper and allows to set a special format for optimized moves during a shell transfer.
Index: components/virtualtreeview/VirtualTrees.pas
===================================================================
--- components/virtualtreeview/VirtualTrees.pas	(revision 59933)
+++ components/virtualtreeview/VirtualTrees.pas	(working copy)
@@ -815,7 +815,7 @@
     function GetData(const FormatEtcIn: TFormatEtc; out Medium: TStgMedium): HResult; virtual; stdcall;
     function GetDataHere(const {%H-}FormatEtc: TFormatEtc; out {%H-}Medium: TStgMedium): HResult; virtual; stdcall;
     function QueryGetData(const FormatEtc: TFormatEtc): HResult; virtual; stdcall;
-    function SetData(const FormatEtc: TFormatEtc; const Medium: TStgMedium; DoRelease: BOOL): HResult; virtual; stdcall;
+    function SetData(const FormatEtc: TFormatEtc; var Medium: TStgMedium; DoRelease: BOOL): HResult; virtual; stdcall;
   end;
 
   // TVTDragManager is a class to manage drag and drop in a Virtual Treeview.
virtualtreeview.patch (1,805 bytes)

wp

2019-01-03 20:49

developer   ~0113136

This patch will break compilation of VTV with FPC 3.0.4 and possibly also other widgetsets.

The reason for the issue seems to be fpc r40745, "bug 34758 iolecache.setdata 2nd param now var" by marco.

I am assigning the issue to marco to have a look.

Pascal Riekenberg

2019-01-04 05:55

reporter  

virtualtreeview_2.patch (1,919 bytes)
Index: components/virtualtreeview/include/intf/win32/vtvdragmanager.inc
===================================================================
--- components/virtualtreeview/include/intf/win32/vtvdragmanager.inc	(revision 59933)
+++ components/virtualtreeview/include/intf/win32/vtvdragmanager.inc	(working copy)
@@ -481,7 +481,11 @@
 
 //----------------------------------------------------------------------------------------------------------------------
 
+{$IF FPC_FULLVERSION < 30200}
 function TVTDataObject.SetData(const FormatEtc: TFormatEtc; const Medium: TStgMedium; DoRelease: BOOL): HResult;
+{$ELSE}
+function TVTDataObject.SetData(const FormatEtc: TFormatEtc; var Medium: TStgMedium; DoRelease: BOOL): HResult;
+{$IFEND}
 
 // Allows dynamic adding to the IDataObject during its existance. Most noteably it is used to implement
 // IDropSourceHelper and allows to set a special format for optimized moves during a shell transfer.
Index: components/virtualtreeview/VirtualTrees.pas
===================================================================
--- components/virtualtreeview/VirtualTrees.pas	(revision 59933)
+++ components/virtualtreeview/VirtualTrees.pas	(working copy)
@@ -815,7 +815,11 @@
     function GetData(const FormatEtcIn: TFormatEtc; out Medium: TStgMedium): HResult; virtual; stdcall;
     function GetDataHere(const {%H-}FormatEtc: TFormatEtc; out {%H-}Medium: TStgMedium): HResult; virtual; stdcall;
     function QueryGetData(const FormatEtc: TFormatEtc): HResult; virtual; stdcall;
+    {$IF FPC_FULLVERSION < 30200}
     function SetData(const FormatEtc: TFormatEtc; const Medium: TStgMedium; DoRelease: BOOL): HResult; virtual; stdcall;
+    {$ELSE}
+    function SetData(const FormatEtc: TFormatEtc; var Medium: TStgMedium; DoRelease: BOOL): HResult; virtual; stdcall;
+    {$IFEND}
   end;
 
   // TVTDragManager is a class to manage drag and drop in a Virtual Treeview.
virtualtreeview_2.patch (1,919 bytes)

Pascal Riekenberg

2019-01-04 05:58

reporter   ~0113141

Sorry, forgot "IF FPC_FULLVERSION < 30200".
If r40745 will be merged to fixes_3_2 the new patch should be suitable othervide version should be changed to 30300.

Pascal Riekenberg

2019-01-04 06:09

reporter   ~0113142

All other widgetsets use include\intf\dummydragmanager.inc
which looks like this:

function TVTDataObject.SetData(const FormatEtc: TFormatEtc; {$ifdef VER2_0}var{$else}const{$endif} Medium: TStgMedium; DoRelease: BOOL): HResult;

So this should be broken since 2.0 or does VER2_0 not mean 2.0 and above?

Pascal Riekenberg

2019-01-04 06:39

reporter  

virtualtreeview_3.patch (3,001 bytes)
Index: components/virtualtreeview/include/intf/dummydragmanager.inc
===================================================================
--- components/virtualtreeview/include/intf/dummydragmanager.inc	(revision 59933)
+++ components/virtualtreeview/include/intf/dummydragmanager.inc	(working copy)
@@ -533,7 +533,11 @@
 
 //----------------------------------------------------------------------------------------------------------------------
 
-function TVTDataObject.SetData(const FormatEtc: TFormatEtc; {$ifdef VER2_0}var{$else}const{$endif} Medium: TStgMedium; DoRelease: BOOL): HResult;
+{$IF FPC_FULLVERSION < 30200}
+function TVTDataObject.SetData(const FormatEtc: TFormatEtc; const Medium: TStgMedium; DoRelease: BOOL): HResult;
+{$ELSE}
+function TVTDataObject.SetData(const FormatEtc: TFormatEtc; var Medium: TStgMedium; DoRelease: BOOL): HResult;
+{$IFEND}
 
 // Allows dynamic adding to the IDataObject during its existance. Most noteably it is used to implement
 // IDropSourceHelper and allows to set a special format for optimized moves during a shell transfer.
Index: components/virtualtreeview/include/intf/win32/vtvdragmanager.inc
===================================================================
--- components/virtualtreeview/include/intf/win32/vtvdragmanager.inc	(revision 59933)
+++ components/virtualtreeview/include/intf/win32/vtvdragmanager.inc	(working copy)
@@ -481,7 +481,11 @@
 
 //----------------------------------------------------------------------------------------------------------------------
 
+{$IF FPC_FULLVERSION < 30200}
 function TVTDataObject.SetData(const FormatEtc: TFormatEtc; const Medium: TStgMedium; DoRelease: BOOL): HResult;
+{$ELSE}
+function TVTDataObject.SetData(const FormatEtc: TFormatEtc; var Medium: TStgMedium; DoRelease: BOOL): HResult;
+{$IFEND}
 
 // Allows dynamic adding to the IDataObject during its existance. Most noteably it is used to implement
 // IDropSourceHelper and allows to set a special format for optimized moves during a shell transfer.
Index: components/virtualtreeview/VirtualTrees.pas
===================================================================
--- components/virtualtreeview/VirtualTrees.pas	(revision 59933)
+++ components/virtualtreeview/VirtualTrees.pas	(working copy)
@@ -815,7 +815,11 @@
     function GetData(const FormatEtcIn: TFormatEtc; out Medium: TStgMedium): HResult; virtual; stdcall;
     function GetDataHere(const {%H-}FormatEtc: TFormatEtc; out {%H-}Medium: TStgMedium): HResult; virtual; stdcall;
     function QueryGetData(const FormatEtc: TFormatEtc): HResult; virtual; stdcall;
+    {$IF FPC_FULLVERSION < 30200}
     function SetData(const FormatEtc: TFormatEtc; const Medium: TStgMedium; DoRelease: BOOL): HResult; virtual; stdcall;
+    {$ELSE}
+    function SetData(const FormatEtc: TFormatEtc; var Medium: TStgMedium; DoRelease: BOOL): HResult; virtual; stdcall;
+    {$IFEND}
   end;
 
   // TVTDragManager is a class to manage drag and drop in a Virtual Treeview.
virtualtreeview_3.patch (3,001 bytes)

Pascal Riekenberg

2019-01-04 06:40

reporter   ~0113144

patch 3 includes dummydragmanager.inc

wp

2019-01-04 09:51

developer   ~0113147

In my understanding "VER2_0" means "version 2.0 only". Therefore, these patches would break compilation of VTV with fpc 2.0. On the other hand, v2.0 is really very old, Lazarus trunk or 2.0 almost certainly will not compile with it, so I think this directive can safely be dropped in favor of the FPC_FULLVERSION.

On the other hand, there has been some discussion in issue 0034758, and therefore, I assigned the current issue to Marco for him to re-think his decision to redeclare the parameter as "var". If he says it was correct I can pick up the report and apply your patches. In the meantime, don't use fpc trunk - seems to be fairly fragile at the moment anyway.

Marco van de Voort

2019-01-07 12:11

manager   ~0113232

Last edited: 2019-01-07 12:12

View 2 revisions

Iolecachesetdata patch now merged to 3.2.

I switched to VAR because CONST (which delphi uses) is apparently not compatible with Delphi. Delphi does /not/ use their constref equivalent const [ref]

I really want to use just CONST, since that would make everything in all components compatible to delphi, not having to ifdef in any way.

wp

2019-01-07 16:43

developer   ~0113235

Last edited: 2019-01-11 09:29

View 2 revisions

Applied with minor modifications. Please test and close if OK.

Will not be backported to Laz 2.0 which comes with fpc 3.0.4 and thus is not affected.

[EDIT] Put it on the merge list nevertheless because this bug prevents users from having VTV in Laz 2.0 with fpc 3.2

Issue History

Date Modified Username Field Change
2019-01-03 07:34 Pascal Riekenberg New Issue
2019-01-03 07:34 Pascal Riekenberg File Added: virtualtreeview.patch
2019-01-03 20:49 wp Note Added: 0113136
2019-01-03 20:49 wp Assigned To => Marco van de Voort
2019-01-03 20:49 wp Status new => assigned
2019-01-04 05:55 Pascal Riekenberg File Added: virtualtreeview_2.patch
2019-01-04 05:58 Pascal Riekenberg Note Added: 0113141
2019-01-04 06:09 Pascal Riekenberg Note Added: 0113142
2019-01-04 06:39 Pascal Riekenberg File Added: virtualtreeview_3.patch
2019-01-04 06:40 Pascal Riekenberg Note Added: 0113144
2019-01-04 09:51 wp Note Added: 0113147
2019-01-04 17:22 wp Relationship added related to 0034758
2019-01-07 11:35 wp Assigned To Marco van de Voort => wp
2019-01-07 12:11 Marco van de Voort Note Added: 0113232
2019-01-07 12:12 Marco van de Voort Note Edited: 0113232 View Revisions
2019-01-07 16:43 wp Fixed in Revision => 60024
2019-01-07 16:43 wp LazTarget => 2.2
2019-01-07 16:43 wp Note Added: 0113235
2019-01-07 16:43 wp Status assigned => resolved
2019-01-07 16:43 wp Resolution open => fixed
2019-01-07 16:43 wp Target Version => 2.2
2019-01-07 22:02 Pascal Riekenberg Status resolved => closed
2019-01-11 09:28 wp Status closed => assigned
2019-01-11 09:28 wp Resolution fixed => reopened
2019-01-11 09:29 wp Note Edited: 0113235 View Revisions
2019-01-11 09:29 wp LazTarget 2.2 => 2.0
2019-01-11 09:29 wp Status assigned => resolved
2019-01-11 09:29 wp Resolution reopened => fixed
2019-01-11 09:29 wp Target Version 2.2 => 2.0
2019-01-11 09:30 wp Status resolved => closed