Fix crash with custom sized reports

Review Request #115314 - Created Jan. 25, 2014 and updated

Andrius da Costa Ribas
kossebau, piggz, staniek
This patch enables "Custom" sized reports which were not working before.
Tested using MSVC, with both Plan and Kexi reports.


  • 0
  • 12
  • 0
  • 12
Description From Last Updated
Andrius da Costa Ribas
Jarosław Staniek
Andrius da Costa Ribas
Review request changed

Change Summary:

* fixed the items pointed by @staniek
* fixed ::pageWidthPx method with custom size (width is always the correct width here, regardless the orientation chosen)
* use double instead of qreal to keep consistency across platforms.
* save width and height even when it's predefined
* don't add report:page-style/$TEXT="custom" for custom size


Revision 3 (+123 -17)

Show changes

Jarosław Staniek
Tested the patch, it looks much better, thanks. 

1. We have missed change in KoReportReportData::KoReportReportData() report:custom-page-* -> fo:custom-page-*. After this fix, setting size to A5, A6, etc. works again.
2. When I print custom sized reports to a PDF (but probably also to a real printer), it always prints A4. Don't we miss a QPrinter::setPaperSize ( const QSizeF & paperSize, Unit unit ) call or so? 
   Moreover  QPrinter::setPageSize ( PageSize newPageSize ) is obsolete method, QPrinter::setPaperSize ( PaperSize newPaperSize ) should be used.
3. Preview mode does not show realistic page geometry, eg when I set Custom 5x5cm page size. This could be fixed later if there's no time.
Jarosław Staniek
BTW, as this looks like an improvement that will take longer time than expected there are no chances to release it for 2.8.0. How about filing a "Add support for custom page sizes" wish in with 2.8.2 as an additional milestone? Today I moved quite a few fixes to this milestone.
  1. However, for 2.8.0 at least a crashfix can be added.
  2. Did that for 2.8.0:
    After the release it can be reverted.
Jarosław Staniek
Any news about making it dance for 2.9?
  1. Unfortunately I'll probably not be able to look at this until mid-July. I've tried to implement what you mentioned in your notes but both Samsung Printer and Fake PDF drivers I have on windows seem to ignore QPrinter::setPaperSize settings, I'd need to investigate more.
  2. Thanks for the update, very appreciated.
  3. Hi Adrius, any plans now to finish this task?

  4. @Adrius, any plans?

  5. I'm sorry, but unfortunately I'm currently unable to.