X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/198d7c6cb9f892732037c017b448d3dd9e258a55..9e09664b7d3e7d484f86f602e0dbde456d1f20d1:/src/html/m_layout.cpp diff --git a/src/html/m_layout.cpp b/src/html/m_layout.cpp index f8f5c34931..9b9b8d25de 100644 --- a/src/html/m_layout.cpp +++ b/src/html/m_layout.cpp @@ -15,7 +15,7 @@ #if wxUSE_HTML && wxUSE_STREAMS -#ifndef WXPRECOMP +#ifndef WX_PRECOMP #include "wx/image.h" #endif @@ -100,7 +100,7 @@ bool wxHtmlPageBreakCell::AdjustPagebreak(int* pagebreak, wxArrayInt& known_page // vertical position. Otherwise we'd be setting a pagebreak above // the current cell, which is incorrect, or duplicating a // pagebreak that has already been set. - if( known_pagebreaks.Count() == 0 || *pagebreak <= m_PosY) + if( known_pagebreaks.GetCount() == 0 || *pagebreak <= m_PosY) { return false; } @@ -108,7 +108,12 @@ bool wxHtmlPageBreakCell::AdjustPagebreak(int* pagebreak, wxArrayInt& known_page // m_PosY is only the vertical offset from the parent. The pagebreak // required here is the total page offset, so m_PosY must be added // to the parent's offset and height. - int total_height = m_PosY + GetParent()->GetPosY() + GetParent()->GetHeight(); + int total_height = m_PosY; + for ( wxHtmlCell *parent = GetParent(); parent; parent = parent->GetParent() ) + { + total_height += parent->GetPosY(); + } + // Search the array of pagebreaks to see whether we've already set // a pagebreak here. The standard bsearch() function is appropriate @@ -289,13 +294,16 @@ TAG_HANDLER_BEGIN(TITLE, "TITLE") wxHtmlWindowInterface *winIface = m_WParser->GetWindowInterface(); if (winIface) { - wxString title = m_WParser->GetSource()->Mid( - tag.GetBeginPos(), - tag.GetEndPos1()-tag.GetBeginPos()); + wxString title(tag.GetBeginIter(), tag.GetEndIter1()); #if !wxUSE_UNICODE && wxUSE_WCHAR_T - wxCSConv conv(m_WParser->GetInputEncoding()); - title = wxString(title.wc_str(conv), wxConvLocal); -#endif + const wxFontEncoding enc = m_WParser->GetInputEncoding(); + if ( enc != wxFONTENCODING_DEFAULT ) + { + // need to convert to the current one + title = wxString(title.wc_str(wxCSConv(enc)), wxConvLocal); + } +#endif // !wxUSE_UNICODE + title = m_WParser->GetEntitiesParser()->Parse(title); winIface->SetHTMLWindowTitle(title); @@ -341,12 +349,12 @@ TAG_HANDLER_BEGIN(BODY, "BODY") wxInputStream *is = fileBgImage->GetStream(); if ( is ) { -#if !defined(__WXMSW__) || wxUSE_WXDIB wxImage image(*is); if ( image.Ok() ) winIface->SetHTMLBackgroundImage(image); -#endif } + + delete fileBgImage; } }