X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fbfb8bcc3fa17e079d4219655b173f8ed2ccc65a..c00fed0ef4d70c9b45d9b8405f636d30eadb7ea6:/src/html/htmlwin.cpp diff --git a/src/html/htmlwin.cpp b/src/html/htmlwin.cpp index a1f8c33629..fc42f4cb5a 100644 --- a/src/html/htmlwin.cpp +++ b/src/html/htmlwin.cpp @@ -135,10 +135,10 @@ private: //----------------------------------------------------------------------------- WX_DECLARE_OBJARRAY(wxHtmlHistoryItem, wxHtmlHistoryArray); -WX_DEFINE_OBJARRAY(wxHtmlHistoryArray); +WX_DEFINE_OBJARRAY(wxHtmlHistoryArray) WX_DECLARE_LIST(wxHtmlProcessor, wxHtmlProcessorList); -WX_DEFINE_LIST(wxHtmlProcessorList); +WX_DEFINE_LIST(wxHtmlProcessorList) //----------------------------------------------------------------------------- // wxHtmlWindow @@ -237,30 +237,29 @@ void wxHtmlWindow::SetRelatedStatusBar(int bar) void wxHtmlWindow::SetFonts(const wxString& normal_face, const wxString& fixed_face, const int *sizes) { - wxString op = m_OpenedPage; - m_Parser->SetFonts(normal_face, fixed_face, sizes); - // fonts changed => contents invalid, so reload the page: - SetPage(wxT("")); - if (!op.empty()) - LoadPage(op); + + // re-layout the page after changing fonts: + DoSetPage(*(m_Parser->GetSource())); } void wxHtmlWindow::SetStandardFonts(int size, const wxString& normal_face, const wxString& fixed_face) { - wxString op = m_OpenedPage; - m_Parser->SetStandardFonts(size, normal_face, fixed_face); - // fonts changed => contents invalid, so reload the page: - SetPage(wxT("")); - if (!op.empty()) - LoadPage(op); -} + // re-layout the page after changing fonts: + DoSetPage(*(m_Parser->GetSource())); +} bool wxHtmlWindow::SetPage(const wxString& source) +{ + m_OpenedPage = m_OpenedAnchor = m_OpenedPageTitle = wxEmptyString; + return DoSetPage(source); +} + +bool wxHtmlWindow::DoSetPage(const wxString& source) { wxString newsrc(source); @@ -307,7 +306,7 @@ bool wxHtmlWindow::SetPage(const wxString& source) dc->SetMapMode(wxMM_TEXT); SetBackgroundColour(wxColour(0xFF, 0xFF, 0xFF)); SetBackgroundImage(wxNullBitmap); - m_OpenedPage = m_OpenedAnchor = m_OpenedPageTitle = wxEmptyString; + m_Parser->SetDC(dc); if (m_Cell) { @@ -326,7 +325,7 @@ bool wxHtmlWindow::SetPage(const wxString& source) bool wxHtmlWindow::AppendToPage(const wxString& source) { - return SetPage(*(GetParser()->GetSource()) + source); + return DoSetPage(*(GetParser()->GetSource()) + source); } bool wxHtmlWindow::LoadPage(const wxString& location) @@ -1306,8 +1305,7 @@ void wxHtmlWindow::OnMouseLeave(wxMouseEvent& event) void wxHtmlWindow::OnKeyUp(wxKeyEvent& event) { - if ( IsSelectionEnabled() && - event.GetKeyCode() == 'C' && event.ControlDown() ) + if ( IsSelectionEnabled() && event.GetKeyCode() == 'C' && event.CmdDown() ) { (void) CopySelection(); }