From 886c25325e93397f7d523d8a0119069d29ead0e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?W=C5=82odzimierz=20Skiba?= Date: Fri, 23 Jul 2004 08:56:51 +0000 Subject: [PATCH] Simplified html reading because previous one caused conflicts in wxUSE_STL=1. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28415 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- demos/forty/forty.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/demos/forty/forty.cpp b/demos/forty/forty.cpp index 82f6e11ae4..0b4e23f8f3 100644 --- a/demos/forty/forty.cpp +++ b/demos/forty/forty.cpp @@ -33,7 +33,7 @@ #include "scoredg.h" #if wxUSE_HTML -#include "wx/file.h" +#include "wx/textfile.h" #include "wx/html/htmlwin.h" #endif @@ -331,15 +331,13 @@ bool FortyAboutDialog::AddControls(wxWindow* parent) // wxSetWorkingDirectory(wxGetApp().GetAppDir()); // wxString htmlFile(wxGetApp().GetFullAppPath(wxT("about.htm"))); - if (wxFileExists(htmlFile)) + wxTextFile file(htmlFile); + if (file.Exists()) { - wxFile file; - file.Open(htmlFile, wxFile::read); - long len = file.Length(); - wxChar* buf = htmlText.GetWriteBuf(len + 1); - file.Read(buf, len); - buf[len] = 0; - htmlText.UngetWriteBuf(); + file.Open(); + for ( htmlText = file.GetFirstLine(); + !file.Eof(); + htmlText << file.GetNextLine() << _T("\n") ) ; } }