]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/docview.cpp
Add markup support to wxOSX/Cocoa wxStaticText and wxButton.
[wxWidgets.git] / src / common / docview.cpp
index 86d1783490db08f66d384bde644ce2ca7aae9da0..162a1755174e2c0c2a7eef88487244e7db2ccf1a 100644 (file)
@@ -1976,8 +1976,27 @@ bool wxDocChildFrameAnyBase::CloseView(wxCloseEvent& event)
 
 #if wxUSE_PRINTING_ARCHITECTURE
 
+namespace
+{
+
+wxString GetAppropriateTitle(const wxView *view, const wxString& titleGiven)
+{
+    wxString title(titleGiven);
+    if ( title.empty() )
+    {
+        if ( view && view->GetDocument() )
+            title = view->GetDocument()->GetUserReadableName();
+        else
+            title = _("Printout");
+    }
+
+    return title;
+}
+
+} // anonymous namespace
+
 wxDocPrintout::wxDocPrintout(wxView *view, const wxString& title)
-             : wxPrintout(title)
+             : wxPrintout(GetAppropriateTitle(view, title))
 {
     m_printoutView = view;
 }