#include "wx/wxprec.h"
#include "wx/defs.h"
-#if wxUSE_HTML
+#if wxUSE_HTML && wxUSE_STREAMS
#ifdef __BORDLANDC__
#pragma hdrstop
wxString doc, doc2;
if (s == NULL) return wxEmptyString;
- src = new char[s -> GetSize()+1];
- src[s -> GetSize()] = 0;
- s -> Read(src, s -> GetSize());
+ src = new char[s->GetSize()+1];
+ src[s->GetSize()] = 0;
+ s->Read(src, s->GetSize());
doc = src;
delete [] src;
// This is true in most case but some page can return:
// "text/html; char-encoding=...."
// So we use Find instead
- return (file.GetMimeType().Find(_("text/html")) == 0);
+ return (file.GetMimeType().Find(wxT("text/html")) == 0);
}
char *src;
wxString doc;
- if (s == NULL) return wxEmptyString;
- src = new char[s -> GetSize() + 1];
- src[s -> GetSize()] = 0;
- s -> Read(src, s -> GetSize());
+ if (s == NULL)
+ {
+ wxLogError(_("Cannot open HTML document: %s"), file.GetLocation().c_str());
+ return wxEmptyString;
+ }
+ src = new char[s->GetSize() + 1];
+ src[s->GetSize()] = 0;
+ s->Read(src, s->GetSize());
doc = src;
delete[] src;
return s;
}
- else return doc;
+ return doc;
}