summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
0b6d76b)
class was used instead of Gnome printer class.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36493
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
- Fixed problem with choice editor in wxGrid whereby the editor
lost focus when the combobox menu was shown.
- Fixed problem with choice editor in wxGrid whereby the editor
lost focus when the combobox menu was shown.
+- Fixed problem trying to print from a preview, whereby wrong printer
+ class was used.
// it just crashes
#ifndef __WIN32__
wxPostScriptPrintNativeData *data =
// it just crashes
#ifndef __WIN32__
wxPostScriptPrintNativeData *data =
- (wxPostScriptPrintNativeData *) m_printData.GetNativeData();
+ wxDynamicCast(m_printData.GetNativeData(), wxPostScriptPrintNativeData);
- if (!data->GetFontMetricPath().empty())
+ if (data && !data->GetFontMetricPath().empty())
{
afmName = data->GetFontMetricPath();
afmName << wxFILE_SEP_PATH << name;
{
afmName = data->GetFontMetricPath();
afmName << wxFILE_SEP_PATH << name;
// set by the user
m_printDialogData.SetMinPage(minPage);
m_printDialogData.SetMaxPage(maxPage);
// set by the user
m_printDialogData.SetMinPage(minPage);
m_printDialogData.SetMaxPage(maxPage);
if (m_printDialogData.GetFromPage() < minPage)
m_printDialogData.SetFromPage( minPage );
if (m_printDialogData.GetToPage() > maxPage)
m_printDialogData.SetToPage( maxPage );
if (m_printDialogData.GetFromPage() < minPage)
m_printDialogData.SetFromPage( minPage );
if (m_printDialogData.GetToPage() > maxPage)
m_printDialogData.SetToPage( maxPage );
int
pagesPerCopy = m_printDialogData.GetToPage()-m_printDialogData.GetFromPage()+1,
totalPages = pagesPerCopy * m_printDialogData.GetNoCopies(),
int
pagesPerCopy = m_printDialogData.GetToPage()-m_printDialogData.GetFromPage()+1,
totalPages = pagesPerCopy * m_printDialogData.GetNoCopies(),
wxDC* wxPostScriptPrinter::PrintDialog(wxWindow *parent)
{
wxDC* dc = (wxDC*) NULL;
wxDC* wxPostScriptPrinter::PrintDialog(wxWindow *parent)
{
wxDC* dc = (wxDC*) NULL;
wxGenericPrintDialog dialog( parent, &m_printDialogData );
if (dialog.ShowModal() == wxID_OK)
{
dc = dialog.GetPrintDC();
m_printDialogData = dialog.GetPrintDialogData();
wxGenericPrintDialog dialog( parent, &m_printDialogData );
if (dialog.ShowModal() == wxID_OK)
{
dc = dialog.GetPrintDC();
m_printDialogData = dialog.GetPrintDialogData();
if (dc == NULL)
sm_lastError = wxPRINTER_ERROR;
else
if (dc == NULL)
sm_lastError = wxPRINTER_ERROR;
else
return (ret == wxID_OK);
#endif
return (ret == wxID_OK);
#endif
{
if (!m_printPrintout)
return false;
{
if (!m_printPrintout)
return false;
+
+ // Assume that on Unix, the preview may use the PostScript
+ // (generic) version, but printing using the native system is required.
+ // TODO: make a generic print preview class from which wxPostScriptPrintPreview
+ // is derived.
+#ifdef __UNIX__
+ wxPrinter printer(& m_printDialogData);
+#else
wxPostScriptPrinter printer(& m_printDialogData);
wxPostScriptPrinter printer(& m_printDialogData);
return printer.Print(m_previewFrame, m_printPrintout, interactive);
}
return printer.Print(m_previewFrame, m_printPrintout, interactive);
}