Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2015-10

what can be wrong in this code? (qrobjects.pas)

5 messages · 4 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

FreeMan

fpc r32025 lazarus r50043 qtx64

/opt/lazarus/lcl/interfaces/qt/qtobjects.pas
line 3088

     //if vFont  nil then
     if Assigned(vFont)then
     begin
       if vFont.FHandle  nil then  <-- ?n orjinal code I get access

voilation , while debuging, move mouse on vFont its viewing "nil" but if condition work TRUE, I changed to Assigned then work normal?

/opt/lazarus/lcl/interfaces/qt/qtobjects.pas
line 3116
//if (AFont.FHandle  nil) and (Widget  nil)  then
if (AFont.FHandle  nil) and (Widget  nil) and Assigned(vFont) then

if this is normal I'll make pacth for this two changing

note:
after this error, in editor toolbar I have "Open packages of current unit" icon, its start blink.?

Reply by email

Ondrej Pokorny
to Mattias Gaertner
Mattias Gaertner wrote 10 lines
On Wed, 14 Oct 2015 13:41:30 +0300 FreeMan wrote: > [...] > note: > after this error, in editor toolbar I have "Open packages of current > unit" icon, its start blink.? I see this too under Linux/Gtk2. Juha?

Probably my problem.

Ondrej

Reply by email

Ondrej Pokorny
to Mattias Gaertner: On Wed, 14 Oct 2015 13:41:30 +0300 I see this too under Linux/Gtk2. Juha? Mattias
Mattias Gaertner wrote 8 lines
On Wed, 14 Oct 2015 13:41:30 +0300 FreeMan wrote: > >[...] > >note: > >after this error, in editor toolbar I have "Open packages of current > >unit" icon, its start blink.? I see this too under Linux/Gtk2.

Since freeman hasn't created a bug report and I am too lazy to write one myself, I sent the patch here.

Ondrej
-------------- next part --------------
Index: ide/main.pp
===================================================================
--- ide/main.pp	(revision 50059)
+++ ide/main.pp	(working copy)
@@ -3729,16 +3729,19 @@
   CanOpenPkgOfFile, CanAddCurFile: Boolean;
 begin
   GetCurrentUnit(ASrcEdit,AUnitInfo);
-  if Assigned(AUnitInfo) and (AUnitInfo.Filename  FLastUnitInfoFileName) then
+  if Assigned(AUnitInfo) then
   begin
-    PkgFile:=PackageGraph.FindFileInAllPackages(AUnitInfo.Filename,true,
-                                          not AUnitInfo.IsPartOfProject);
-    CanOpenPkgOfFile:=Assigned(PkgFile);
-    CanAddCurFile:=(not AUnitInfo.IsVirtual) and FileExistsUTF8(AUnitInfo.Filename)
-          and not AUnitInfo.IsPartOfProject;
-    MainIDEBar.itmPkgOpenPackageOfCurUnit.Enabled:=CanOpenPkgOfFile;
-    MainIDEBar.itmPkgAddCurFileToPkg.Enabled:=CanAddCurFile;
-    FLastUnitInfoFileName := AUnitInfo.Filename;
+    if (AUnitInfo.Filename  FLastUnitInfoFileName) then
+    begin
+      PkgFile:=PackageGraph.FindFileInAllPackages(AUnitInfo.Filename,true,
+                                            not AUnitInfo.IsPartOfProject);
+      CanOpenPkgOfFile:=Assigned(PkgFile);
+      CanAddCurFile:=(not AUnitInfo.IsVirtual) and FileExistsUTF8(AUnitInfo.Filename)
+            and not AUnitInfo.IsPartOfProject;
+      MainIDEBar.itmPkgOpenPackageOfCurUnit.Enabled:=CanOpenPkgOfFile;
+      MainIDEBar.itmPkgAddCurFileToPkg.Enabled:=CanAddCurFile;
+      FLastUnitInfoFileName := AUnitInfo.Filename;
+    end;
   end else
   begin
     MainIDEBar.itmPkgOpenPackageOfCurUnit.Enabled:=False;

Reply by email