View Issue Details

IDProjectCategoryView StatusLast Update
0002071SkyChart1-Softwarepublic19-03-03 21:11
ReporterSasa Assigned To 
PrioritynormalSeverityminorReproducibilityhave not tried
Status resolvedResolutionfixed 
PlatformLinuxOSUbuntu 64-bitOS Version18.10
Product Version4.1 SVN 
Summary0002071: Printing issue - AV if printer do not exists
DescriptionI have implemented as well printing for "Objects list" form while working on VTV and due test I have found an old bug, I believed it was fixed for another icassion...

The problem is in unit u_util.pas and procedure PrintStrings. If there is no printer. It will raise an AV instead a message that printer in not available and continue work.
TagsNo tags attached.

Activities

Sasa

19-02-03 23:20

reporter  

Patrick Chevalley

19-02-04 10:50

administrator   ~0005320

Fixed by:
https://github.com/pchev/skychart/commit/eb63d09926971fb22d214cde50702a9e148027b3

Sasa

19-02-08 12:19

reporter   ~0005365

Last edited: 19-02-08 12:55

Unfortunately, this does not solve the problem and AV is present again.
I do not have any printer installed, but Printer is not nil.

Perhaps to check Printer is not nil and then Printer index?

And where printing is not available, to set Enabled property instead Visible, or to show message that printer is not installed, in order to be clear for user.

  //btnPrint.Visible := (Printer.PrinterIndex >= 0);
  btnPrint.Enabled := (Printer.PrinterIndex >= 0);

Patrick Chevalley

19-02-09 10:46

administrator   ~0005373

How can you get this error? , I tested in a virtual machine without printer but I cannot reproduce the problem because there is no Print button in this case.
This is done in the FormShow event:
  Button6.Visible := (Printer.PrinterIndex >= 0);

Visible or Enabled I am not sure what is the best for a user without printer, it just not care. With enabled:=false I risk to receive bug report "Why is printing not working"

Sasa

19-02-09 12:36

reporter   ~0005376

With btnPrint.Enabled := (Printer.PrinterIndex >= 0) button is shown in disabled mode. I personally prefer to let button enabled always and when press it, to show message that printer is not installed - no confusion

Patrick Chevalley

19-03-03 21:11

administrator   ~0005451

OK to use Enabled.
I make the change with ButtonPrint.Enabled := (Printer.PrinterIndex >= 0);
I also change the test in the print function to ensure Printer.PrinterIndex >= 0

https://github.com/pchev/skychart/commit/d40624b9d832bd2c749d25a383c9ceca0f41b92c

Issue History

Date Modified Username Field Change
19-02-03 23:20 Sasa New Issue
19-02-03 23:20 Sasa File Added: Screenshot from 2019-02-03 23-10-13.png
19-02-04 10:50 Patrick Chevalley Status new => resolved
19-02-04 10:50 Patrick Chevalley Resolution open => fixed
19-02-04 10:50 Patrick Chevalley Note Added: 0005320
19-02-08 12:19 Sasa Status resolved => new
19-02-08 12:19 Sasa Resolution fixed => reopened
19-02-08 12:19 Sasa Note Added: 0005365
19-02-08 12:19 Sasa Note Edited: 0005365
19-02-08 12:22 Sasa Note Edited: 0005365
19-02-08 12:55 Sasa Note Edited: 0005365
19-02-09 10:46 Patrick Chevalley Note Added: 0005373
19-02-09 12:36 Sasa Note Added: 0005376
19-03-03 21:11 Patrick Chevalley Status new => resolved
19-03-03 21:11 Patrick Chevalley Resolution reopened => fixed
19-03-03 21:11 Patrick Chevalley Note Added: 0005451