View Issue Details

IDProjectCategoryView StatusLast Update
0032766LazarusIDEpublic2017-12-04 17:29
ReporterMarcelo B PaulaAssigned ToMichl 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Platformx86_64OSWindowsOS Version10
Product Version1.8RC5Product Build 
Target Version1.8.2Fixed in Version1.9 (SVN) 
Summary0032766: TMenu: Access violation on adding from menu templates
DescriptionTMenu raises access violation error when yo try to insert from conext menu templates
Steps To ReproduceDrop a tmenu in a form.
Right click on it and choose menu editor
Add a menu item clicking button
Right click on new menu item to open context submenu
Choose Templates, Add from template ...

Access violation.
TagsNo tags attached.
Fixed in Revisionr56956
LazTarget1.8.2
WidgetsetWin32/Win64
Attached Files
  • Menu1.png (42,077 bytes)
    Menu1.png (42,077 bytes)
  • Menu2.png (36,357 bytes)
    Menu2.png (36,357 bytes)
  • AddFromTemplate.diff (1,403 bytes)
    Index: designer/menueditor.pp
    ===================================================================
    --- designer/menueditor.pp	(revision 56595)
    +++ designer/menueditor.pp	(working copy)
    @@ -1375,7 +1375,7 @@
       if (FSelectedMenuItem <> nil) and (FSelectedMenuItem.Parent.Parent = nil) then
       begin
         HideFakes;
    -    newItem:=InsertMenuTemplateDlg;
    +    newItem:=InsertMenuTemplateDlg(FMenu);
         if (newItem <> nil) then
         begin
           FMenu.Items.Add(newItem);
    Index: designer/menutemplates.pas
    ===================================================================
    --- designer/menutemplates.pas	(revision 56595)
    +++ designer/menutemplates.pas	(working copy)
    @@ -142,7 +142,7 @@
     
     function SavedTemplatesExist: boolean;
     function GetSavedTemplatesCount: integer;
    -function InsertMenuTemplateDlg: TMenuItem;
    +function InsertMenuTemplateDlg(ParentMenuForInsert: TMenu): TMenuItem;
     function DeleteMenuTemplateDlg: boolean;
     function GetCfgPath: string;
     procedure InitMenuBaseSizes;
    @@ -239,11 +239,11 @@
       end;
     end;
     }
    -function InsertMenuTemplateDlg: TMenuItem;
    +function InsertMenuTemplateDlg(ParentMenuForInsert: TMenu): TMenuItem;
     var
       dlg: TMenuTemplateDialog;
     begin
    -  dlg:=TMenuTemplateDialog.CreateWithMode(nil, dmInsert);
    +  dlg:=TMenuTemplateDialog.CreateWithMode(ParentMenuForInsert, dmInsert);
       try
         if (dlg.ShowModal = mrOK) then
           Result:=dlg.MenuToInsert
    
    AddFromTemplate.diff (1,403 bytes)

Activities

Marcelo B Paula

2017-12-03 13:16

reporter  

Menu1.png (42,077 bytes)
Menu1.png (42,077 bytes)

Marcelo B Paula

2017-12-03 13:16

reporter  

Menu2.png (36,357 bytes)
Menu2.png (36,357 bytes)

Serge Anvarov

2017-12-03 16:10

reporter  

AddFromTemplate.diff (1,403 bytes)
Index: designer/menueditor.pp
===================================================================
--- designer/menueditor.pp	(revision 56595)
+++ designer/menueditor.pp	(working copy)
@@ -1375,7 +1375,7 @@
   if (FSelectedMenuItem <> nil) and (FSelectedMenuItem.Parent.Parent = nil) then
   begin
     HideFakes;
-    newItem:=InsertMenuTemplateDlg;
+    newItem:=InsertMenuTemplateDlg(FMenu);
     if (newItem <> nil) then
     begin
       FMenu.Items.Add(newItem);
Index: designer/menutemplates.pas
===================================================================
--- designer/menutemplates.pas	(revision 56595)
+++ designer/menutemplates.pas	(working copy)
@@ -142,7 +142,7 @@
 
 function SavedTemplatesExist: boolean;
 function GetSavedTemplatesCount: integer;
-function InsertMenuTemplateDlg: TMenuItem;
+function InsertMenuTemplateDlg(ParentMenuForInsert: TMenu): TMenuItem;
 function DeleteMenuTemplateDlg: boolean;
 function GetCfgPath: string;
 procedure InitMenuBaseSizes;
@@ -239,11 +239,11 @@
   end;
 end;
 }
-function InsertMenuTemplateDlg: TMenuItem;
+function InsertMenuTemplateDlg(ParentMenuForInsert: TMenu): TMenuItem;
 var
   dlg: TMenuTemplateDialog;
 begin
-  dlg:=TMenuTemplateDialog.CreateWithMode(nil, dmInsert);
+  dlg:=TMenuTemplateDialog.CreateWithMode(ParentMenuForInsert, dmInsert);
   try
     if (dlg.ShowModal = mrOK) then
       Result:=dlg.MenuToInsert
AddFromTemplate.diff (1,403 bytes)

Serge Anvarov

2017-12-03 16:11

reporter   ~0104396

Added a patch

Michl

2017-12-03 22:27

developer   ~0104408

@Serge Anvarov: Patch applied. Thank you!

@Marcelo B Paula: Fixed in trunk revision 56956. Please try and close if ok.

Marcelo B Paula

2017-12-04 16:08

reporter   ~0104424

You mentioned revision 56956, but i just checkout trunk in revision 56615.
Is that correct ?

This will be available in 1.8 release ?

Anyway test is ok.

Michl

2017-12-04 17:01

developer   ~0104427

> You mentioned revision 56956, but i just checkout trunk in revision 56615.
> Is that correct ?

Yes


> This will be available in 1.8 release ?

Not in upcomming 1.8.0 but in 1.8.2.


> Anyway test is ok.

Thats fine, then please close!

Issue History

Date Modified Username Field Change
2017-12-03 13:16 Marcelo B Paula New Issue
2017-12-03 13:16 Marcelo B Paula File Added: Menu1.png
2017-12-03 13:16 Marcelo B Paula File Added: Menu2.png
2017-12-03 16:10 Serge Anvarov File Added: AddFromTemplate.diff
2017-12-03 16:11 Serge Anvarov Note Added: 0104396
2017-12-03 22:15 Michl Assigned To => Michl
2017-12-03 22:15 Michl Status new => assigned
2017-12-03 22:27 Michl Fixed in Revision => r56956
2017-12-03 22:27 Michl LazTarget => 1.8.2
2017-12-03 22:27 Michl Note Added: 0104408
2017-12-03 22:27 Michl Status assigned => resolved
2017-12-03 22:27 Michl Fixed in Version => 1.9 (SVN)
2017-12-03 22:27 Michl Resolution open => fixed
2017-12-03 22:27 Michl Target Version => 1.8.2
2017-12-04 16:08 Marcelo B Paula Note Added: 0104424
2017-12-04 17:01 Michl Note Added: 0104427
2017-12-04 17:29 Marcelo B Paula Status resolved => closed