X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b4a980f4f57a4e7eea00c55cbb3d139f97d90c20..bb69632a56a827bed4cfae842bfffa88259ac1aa:/src/html/m_layout.cpp diff --git a/src/html/m_layout.cpp b/src/html/m_layout.cpp index 57316f71f6..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 @@ -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,9 +294,7 @@ 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 const wxFontEncoding enc = m_WParser->GetInputEncoding(); if ( enc != wxFONTENCODING_DEFAULT )