- while (i < lng) {
- x = 0;
- d = temp[templen++] = txt[i];
- if ((d == '\n') || (d == '\r') || (d == ' ') || (d == '\t')) {
- i++, x++;
- while ((i < lng) && ((txt[i] == '\n') || (txt[i] == '\r') || (txt[i] == ' ') || (txt[i] == '\t'))) i++, x++;
+ if ( status == wxHTML_BLOCK )
+ return NULL;
+
+ int flags = wxFS_READ;
+ if (type == wxHTML_URL_IMAGE)
+ flags |= wxFS_SEEKABLE;
+
+ return GetFS()->OpenFile(myurl, flags);
+}
+
+#define NBSP_UNICODE_VALUE (wxChar(160))
+#if !wxUSE_UNICODE
+ #define CUR_NBSP_VALUE m_nbsp
+#else
+ #define CUR_NBSP_VALUE NBSP_UNICODE_VALUE
+#endif
+
+void wxHtmlWinParser::AddText(const wxString& txt)
+{
+#if !wxUSE_UNICODE
+ if ( m_nbsp == 0 )
+ m_nbsp = GetEntitiesParser()->GetCharForCode(NBSP_UNICODE_VALUE);
+#endif
+
+ if ( m_whitespaceMode == Whitespace_Normal )
+ {
+ int templen = 0;
+
+ size_t lng = txt.length();
+ if (lng+1 > m_tmpStrBufSize)
+ {
+ delete[] m_tmpStrBuf;
+ m_tmpStrBuf = new wxChar[lng+1];
+ m_tmpStrBufSize = lng+1;
+ }
+ wxChar *temp = m_tmpStrBuf;
+
+ wxString::const_iterator i = txt.begin();
+ const wxString::const_iterator end = txt.end();
+
+ if (m_tmpLastWasSpace)
+ {
+ while ( (i < end) &&
+ (*i == wxT('\n') || *i == wxT('\r') || *i == wxT(' ') ||
+ *i == wxT('\t')) )
+ {
+ ++i;
+ }
+ }
+
+ while (i < end)
+ {
+ size_t x = 0;
+ const wxChar d = temp[templen++] = *i;
+ if ((d == wxT('\n')) || (d == wxT('\r')) || (d == wxT(' ')) || (d == wxT('\t')))
+ {
+ ++i, ++x;
+ while ( (i < end) &&
+ (*i == wxT('\n') || *i == wxT('\r') ||
+ *i == wxT(' ') || *i == wxT('\t')) )
+ {
+ ++i;
+ ++x;
+ }
+ }
+ else
+ {
+ ++i;
+ }
+
+ if (x)
+ {
+ temp[templen-1] = wxT(' ');
+ FlushWordBuf(temp, templen);
+ m_tmpLastWasSpace = true;
+ }