X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d1da887276915d7b83dc7beff43bbe0deea35939..94a2af76726bde98e76f4417d33e91f10aea1771:/src/html/m_pre.cpp diff --git a/src/html/m_pre.cpp b/src/html/m_pre.cpp index 9d84e28fa5..5afcbbc6b7 100644 --- a/src/html/m_pre.cpp +++ b/src/html/m_pre.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: m_pre.cpp +// Name: src/html/m_pre.cpp // Purpose: wxHtml module for
 ... 
tag (code citation) // Author: Vaclav Slavik // RCS-ID: $Id$ @@ -7,19 +7,15 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma implementation -#endif - #include "wx/wxprec.h" -#include "wx/defs.h" -#if wxUSE_HTML && wxUSE_STREAMS #ifdef __BORLANDC__ -#pragma hdrstop + #pragma hdrstop #endif -#ifndef WXPRECOMP +#if wxUSE_HTML && wxUSE_STREAMS + +#ifndef WX_PRECOMP #endif #include "wx/html/forcelnk.h" @@ -39,7 +35,7 @@ static wxString LINKAGEMODE HtmlizeWhitespaces(const wxString& str) size_t linepos = 0; for (size_t i = 0; i < len; i++) { - switch (str[i]) + switch ( str[i].GetValue() ) { case wxT('<'): while (i < len && str[i] != wxT('>')) @@ -108,14 +104,8 @@ TAG_HANDLER_BEGIN(PRE, "PRE") c->SetAlignHor(wxHTML_ALIGN_LEFT); c->SetIndent(m_WParser->GetCharHeight(), wxHTML_INDENT_TOP); - wxString srcMid = - m_WParser->GetSource()->Mid(tag.GetBeginPos(), - tag.GetEndPos1() - tag.GetBeginPos()); - // It is safe to temporarily change the source being parsed, - // provided we restore the state back after parsing - m_Parser->SetSourceAndSaveState(HtmlizeWhitespaces(srcMid)); - m_Parser->DoParsing(); - m_Parser->RestoreState(); + wxString srcMid = m_WParser->GetInnerSource(tag); + ParseInnerSource(HtmlizeWhitespaces(srcMid)); m_WParser->CloseContainer(); m_WParser->CloseContainer();