View Issue Details

IDProjectCategoryView StatusLast Update
0027135LazarusPatchpublic2015-03-03 10:43
ReporteroceanAssigned ToJesus Reyes 
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
Product Version1.2.7 (SVN)Product Build 
Target Version1.4Fixed in Version1.3 (SVN) 
Summary0027135: Postscript example doesn't compile in Windows
Descriptionusamplepostscriptcanvas.pas(385,71) Fatal: Syntax error, ";" expected but ")" found

Proposed fix..
- Try to open file based on extension ".ps", instead of hardcoded path.
- Remove unused variables.
TagsNo tags attached.
Fixed in Revision47113
LazTarget1.4
WidgetsetWin32/Win64
Attached Files
  • usamplepostscriptcanvas.patch (1,344 bytes)
    Index: examples/postscript/usamplepostscriptcanvas.pas
    ===================================================================
    --- examples/postscript/usamplepostscriptcanvas.pas	(revision 47070)
    +++ examples/postscript/usamplepostscriptcanvas.pas	(working copy)
    @@ -266,11 +266,10 @@
           ([],[fsUnderline],[fsBold],[fsBold,fsUnderline]);
       var
         sz: types.TSize;
    -    i, j, fontSize, x, y, dy: Integer;
    +    i, fontSize, x, y: Integer;
       begin
         y := Sy(aY);
         x := Sx(ax);
    -    dy := 0;
         fPsCanvas.Font.Name:=aFontName;
         fontSize := 16;
         while fontSize<(12*3) do begin
    @@ -318,7 +317,6 @@
     procedure TForm1.Button3Click(Sender: TObject);
     var
       png : TPortableNetworkGraphic;
    -  x,y,tmp : Integer;
     begin
       fPsCanvas := TPostscriptCanvas.Create;
       SelectPaper(72);
    @@ -373,17 +371,12 @@
     end;
     
     procedure TForm1.ShowFile(aFile: string);
    -{$IFDEF MSWINDOWS}
    -var
    -  FName: string;
    -{$ENDIF}
     begin
       aFile := ExpandFileNameUTF8('./'+aFile);
       if FileExistsUTF8(aFile) then
       begin
         {$IFDEF MSWINDOWS}
    -      FName := '"C:\Program Files\Ghostgum\gsview\gsview32" '  + aFile);
    -      ShellExecute(Handle, 'open', PChar(FName), nil, nil, SW_SHOWNORMAL)
    +      ShellExecute(Handle, 'open', PChar(afile), nil, nil, SW_SHOWNORMAL);
         {$ENDIF}
         {$IFDEF UNIX}
           FpExecL('/usr/bin/evince', [aFile]);
    

Activities

ocean

2014-12-04 19:47

reporter  

usamplepostscriptcanvas.patch (1,344 bytes)
Index: examples/postscript/usamplepostscriptcanvas.pas
===================================================================
--- examples/postscript/usamplepostscriptcanvas.pas	(revision 47070)
+++ examples/postscript/usamplepostscriptcanvas.pas	(working copy)
@@ -266,11 +266,10 @@
       ([],[fsUnderline],[fsBold],[fsBold,fsUnderline]);
   var
     sz: types.TSize;
-    i, j, fontSize, x, y, dy: Integer;
+    i, fontSize, x, y: Integer;
   begin
     y := Sy(aY);
     x := Sx(ax);
-    dy := 0;
     fPsCanvas.Font.Name:=aFontName;
     fontSize := 16;
     while fontSize<(12*3) do begin
@@ -318,7 +317,6 @@
 procedure TForm1.Button3Click(Sender: TObject);
 var
   png : TPortableNetworkGraphic;
-  x,y,tmp : Integer;
 begin
   fPsCanvas := TPostscriptCanvas.Create;
   SelectPaper(72);
@@ -373,17 +371,12 @@
 end;
 
 procedure TForm1.ShowFile(aFile: string);
-{$IFDEF MSWINDOWS}
-var
-  FName: string;
-{$ENDIF}
 begin
   aFile := ExpandFileNameUTF8('./'+aFile);
   if FileExistsUTF8(aFile) then
   begin
     {$IFDEF MSWINDOWS}
-      FName := '"C:\Program Files\Ghostgum\gsview\gsview32" '  + aFile);
-      ShellExecute(Handle, 'open', PChar(FName), nil, nil, SW_SHOWNORMAL)
+      ShellExecute(Handle, 'open', PChar(afile), nil, nil, SW_SHOWNORMAL);
     {$ENDIF}
     {$IFDEF UNIX}
       FpExecL('/usr/bin/evince', [aFile]);

Jesus Reyes

2014-12-05 02:10

developer   ~0079654

Applied, thank you.

Issue History

Date Modified Username Field Change
2014-12-04 19:47 ocean New Issue
2014-12-04 19:47 ocean File Added: usamplepostscriptcanvas.patch
2014-12-04 21:13 Jesus Reyes Assigned To => Jesus Reyes
2014-12-04 21:13 Jesus Reyes Status new => assigned
2014-12-05 02:10 Jesus Reyes Fixed in Revision => 47113
2014-12-05 02:10 Jesus Reyes LazTarget => 1.4
2014-12-05 02:10 Jesus Reyes Note Added: 0079654
2014-12-05 02:10 Jesus Reyes Status assigned => resolved
2014-12-05 02:10 Jesus Reyes Fixed in Version => 1.3 (SVN)
2014-12-05 02:10 Jesus Reyes Resolution open => fixed
2014-12-05 02:10 Jesus Reyes Target Version => 1.4
2015-03-03 10:43 ocean Status resolved => closed