X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a1b806b98241ab649c169aaa1f134df85e80fb8b..7d6a4d96961eac84d05db8bb24c64d39003f6e54:/src/gtk/gnome/gprint.cpp diff --git a/src/gtk/gnome/gprint.cpp b/src/gtk/gnome/gprint.cpp index 5902314417..b3800c1dd5 100644 --- a/src/gtk/gnome/gprint.cpp +++ b/src/gtk/gnome/gprint.cpp @@ -609,7 +609,9 @@ int wxGnomePrintDialog::ShowModal() m_printDialogData.SetNoCopies( copies ); m_printDialogData.SetCollate( collate ); - switch (gs_libGnomePrint->gnome_print_dialog_get_range( (GnomePrintDialog*) m_widget )) + // Cast needed to avoid warnings because the gnome_print_dialog_get_range() + // is declared as returning a wrong enum type. + switch ( static_cast( gs_libGnomePrint->gnome_print_dialog_get_range( (GnomePrintDialog*) m_widget ))) { case GNOME_PRINT_RANGE_SELECTION: m_printDialogData.SetSelection( true ); @@ -1592,23 +1594,10 @@ void wxGnomePrinterDCImpl::DoDrawRotatedText(const wxString& text, wxCoord x, wx double xx = XLOG2DEV(x); double yy = YLOG2DEV(y); - bool underlined = m_font.IsOk() && m_font.GetUnderlined(); - const wxScopedCharBuffer data(text.utf8_str()); - size_t datalen = strlen(data); - pango_layout_set_text( m_layout, data, datalen); - - if (underlined) - { - PangoAttrList *attrs = pango_attr_list_new(); - PangoAttribute *a = pango_attr_underline_new(PANGO_UNDERLINE_SINGLE); - a->start_index = 0; - a->end_index = datalen; - pango_attr_list_insert(attrs, a); - pango_layout_set_attributes(m_layout, attrs); - pango_attr_list_unref(attrs); - } + pango_layout_set_text(m_layout, data, data.length()); + const bool setAttrs = m_font.GTKSetPangoAttrs(m_layout); if (m_textForegroundColour.IsOk()) { @@ -1656,7 +1645,7 @@ void wxGnomePrinterDCImpl::DoDrawRotatedText(const wxString& text, wxCoord x, wx gs_libGnomePrint->gnome_print_grestore( m_gpc ); - if (underlined) + if (setAttrs) { // undo underline attributes setting: pango_layout_set_attributes(m_layout, NULL);