X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/efba2b89f15ba8757a722fc56c67f434cf960482..84e4a8257d13231b4a5b225364f2c8722fc4f11e:/src/html/htmlcell.cpp diff --git a/src/html/htmlcell.cpp b/src/html/htmlcell.cpp index 6979805f45..b9139ae9e8 100644 --- a/src/html/htmlcell.cpp +++ b/src/html/htmlcell.cpp @@ -13,6 +13,7 @@ #include "wx/wxprec.h" +#include "wx/defs.h" #if wxUSE_HTML #ifdef __BORDLANDC__ @@ -72,11 +73,19 @@ bool wxHtmlCell::AdjustPagebreak(int *pagebreak) wxHtmlWordCell::wxHtmlWordCell(const wxString& word, wxDC& dc) : wxHtmlCell() { m_Word = word; - m_Word.Replace(" ", " ", TRUE); - m_Word.Replace(""", "\"", TRUE); - m_Word.Replace("<", "<", TRUE); - m_Word.Replace(">", ">", TRUE); - m_Word.Replace("&", "&", TRUE); + + m_Word.Replace(wxT(" "), wxT(" "), TRUE); + m_Word.Replace(wxT("""), wxT("\""), TRUE); + m_Word.Replace(wxT("<"), wxT("<"), TRUE); + m_Word.Replace(wxT(">"), wxT(">"), TRUE); + m_Word.Replace(wxT("&"), wxT("&"), TRUE); + + m_Word.Replace(wxT("  "), wxT(" "), TRUE); + m_Word.Replace(wxT("" "), wxT("\""), TRUE); + m_Word.Replace(wxT("< "), wxT("<"), TRUE); + m_Word.Replace(wxT("> "), wxT(">"), TRUE); + m_Word.Replace(wxT("& "), wxT("&"), TRUE); + dc.GetTextExtent(m_Word, &m_Width, &m_Height, &m_Descent); SetCanLiveOnPagebreak(FALSE); } @@ -380,11 +389,11 @@ void wxHtmlContainerCell::SetWidthFloat(const wxHtmlTag& tag) wxString wd = tag.GetParam("WIDTH"); if (wd[wd.Length()-1] == '%') { - sscanf(wd.c_str(), "%i%%", &wdi); + wxSscanf(wd.c_str(), wxT("%i%%"), &wdi); SetWidthFloat(wdi, wxHTML_UNITS_PERCENT); } else { - sscanf(wd.c_str(), "%i", &wdi); + wxSscanf(wd.c_str(), wxT("%i"), &wdi); SetWidthFloat(wdi, wxHTML_UNITS_PIXELS); } }