Opened 22 months ago

Last modified 21 months ago

#14847 reopened defect

Printing wxRichtextCtrl doesn't work correctly

Reported by: evstevemd Owned by:
Priority: normal Milestone:
Component: wxRichText Version: stable-latest
Keywords: Cc:
Blocked By: Blocking:
Patch: no

Description

To achieve this just try to print to a PDF file on wxGTK

Here is what reported on terminal by sample app

./richtext

(richtext:23333): Pango-CRITICAL : pango_layout_set_text: assertion `layout != NULL' failed

(richtext:23333): Pango-CRITICAL : pango_layout_get_iter: assertion `PANGO_IS_LAYOUT (layout)' failed
Segmentation fault (core dumped)

and hereby is attached full stack from debugger

Attachments (1)

debugger stack trace.txt download (5.4 KB) - added by evstevemd 22 months ago.
Debugger stack trace

Download all attachments as: .zip

Change History (6)

Changed 22 months ago by evstevemd

Debugger stack trace

comment:1 Changed 21 months ago by vadz

  • Status changed from new to confirmed

This is due to using wxTextMeasure::DoGetPartialTextExtents() without a valid Pango layout. I'm looking at this, thanks for reporting!

comment:2 Changed 21 months ago by VZ

  • Resolution set to fixed
  • Status changed from confirmed to closed

(In [73017]) Restore generic GetPartialTextExtents() version use in wxGTK and wxMSW.

Non-wxWindowDC-derived wxDC classes in wxGTK, such as wxGtkPrinterDCImpl, have
to fall back on the generic implementation of GetPartialTextExtents() as Pango
version can't be used with them.

This fixes a crash due to using NULL Pango layout when printing wxRichTextCtrl
in wxGTK.

Closes #14847.

comment:3 Changed 21 months ago by evstevemd

  • Resolution fixed deleted
  • Status changed from closed to reopened

The Segmentation fault issue is resolved but then printing to a file (I don't have printer to test on paper but I guess its the same) leaves out some part of the document. Print preview shows everything as it is supposed to be.

To understand what am saying, just print sample contents to file and see resulting PDF

comment:4 follow-up: Changed 21 months ago by vadz

  • Milestone 2.9.5 deleted
  • Summary changed from Printing with wxRichtextCtrl fails with Segmentation fault to Printing wxRichtextCtrl doesn't work correctly

Is this different from the behaviour in 2.9.4? I.e. is it really a regression due to wxTextMeasure changes or not? If not, I can't really do anything about it as I don't know this code at all.

comment:5 in reply to: ↑ 4 Changed 21 months ago by evstevemd

Replying to vadz:

Is this different from the behaviour in 2.9.4? I.e. is it really a regression due to wxTextMeasure changes or not? If not, I can't really do anything about it as I don't know this code at all.

I'm not sure if that is the case. I have to test it first and see if that is the case. Let me see!

Note: See TracTickets for help on using tickets.