]> git.saurik.com Git - wxWidgets.git/blobdiff - src/html/htmprint.cpp
fixed array tests compilation and a bug in obj array test
[wxWidgets.git] / src / html / htmprint.cpp
index 3dd7639e7b7380dac3df8e8708016d23b6d5b158..5fe427ea148f26fa6784c445b0d1b4d3b53939c1 100644 (file)
@@ -269,7 +269,8 @@ void wxHtmlPrintout::SetHtmlText(const wxString& html, const wxString &basepath,
     m_BasePathIsDir = isdir;
 }
 
-
+// defined in htmlfilt.cpp
+void wxPrivate_ReadString(wxString& str, wxInputStream* s);
 
 void wxHtmlPrintout::SetHtmlFile(const wxString& htmlfile)
 {
@@ -283,12 +284,9 @@ void wxHtmlPrintout::SetHtmlFile(const wxString& htmlfile)
     }
 
     wxInputStream *st = ff->GetStream();
-    char *t = new char[st->GetSize() + 1];
-    st->Read(t, st->GetSize());
-    t[st->GetSize()] = 0;
+    wxString doc;
+    wxPrivate_ReadString(doc, st);
 
-    wxString doc = wxString(t);
-    delete t;
     delete ff;
 
     SetHtmlText(doc, htmlfile, FALSE);