projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix for unicode build
[wxWidgets.git]
/
src
/
html
/
htmlpars.cpp
diff --git
a/src/html/htmlpars.cpp
b/src/html/htmlpars.cpp
index efd6d9349e45b4fcbb96126adc62fc7428fcef41..ae752eafbad4a181c2c048f2f9bddd78fe31d845 100644
(file)
--- a/
src/html/htmlpars.cpp
+++ b/
src/html/htmlpars.cpp
@@
-8,7
+8,7
@@
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
-#if
def __GNUG__
+#if
defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma implementation "htmlpars.h"
#endif
#pragma implementation "htmlpars.h"
#endif
@@
-35,6
+35,11
@@
#include "wx/dynarray.h"
#include "wx/arrimpl.cpp"
#include "wx/dynarray.h"
#include "wx/arrimpl.cpp"
+
+// DLL options compatibility check:
+#include "wx/app.h"
+WX_CHECK_BUILD_OPTIONS("wxHTML")
+
//-----------------------------------------------------------------------------
// wxHtmlParser helpers
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// wxHtmlParser helpers
//-----------------------------------------------------------------------------
@@
-82,11
+87,18
@@
wxHtmlParser::~wxHtmlParser()
{
while (RestoreState()) {}
DestroyDOMTree();
{
while (RestoreState()) {}
DestroyDOMTree();
-
+
+ if (m_HandlersStack)
+ {
+ wxList& tmp = *m_HandlersStack;
+ wxList::iterator it, en;
+ for( it = tmp.begin(), en = tmp.end(); it != en; ++it )
+ delete (wxHashTable*)*it;
+ tmp.clear();
+ }
delete m_HandlersStack;
m_HandlersHash.Clear();
delete m_HandlersStack;
m_HandlersHash.Clear();
- m_HandlersList.DeleteContents(TRUE);
- m_HandlersList.Clear();
+ WX_CLEAR_LIST(wxList, m_HandlersList);
delete m_entitiesParser;
}
delete m_entitiesParser;
}
@@
-351,10
+363,9
@@
void wxHtmlParser::PushTagHandler(wxHtmlTagHandler *handler, wxString tags)
if (m_HandlersStack == NULL)
{
m_HandlersStack = new wxList;
if (m_HandlersStack == NULL)
{
m_HandlersStack = new wxList;
- m_HandlersStack->DeleteContents(TRUE);
}
}
- m_HandlersStack->Insert(new wxHashTable(m_HandlersHash));
+ m_HandlersStack->Insert(
(wxObject*)
new wxHashTable(m_HandlersHash));
while (tokenizer.HasMoreTokens())
{
while (tokenizer.HasMoreTokens())
{
@@
-366,16
+377,22
@@
void wxHtmlParser::PushTagHandler(wxHtmlTagHandler *handler, wxString tags)
void wxHtmlParser::PopTagHandler()
{
void wxHtmlParser::PopTagHandler()
{
- wx
Node *
first;
+ wx
List::compatibility_iterator
first;
- if (m_HandlersStack == NULL ||
- (first = m_HandlersStack->GetFirst()) == NULL)
+ if ( !m_HandlersStack ||
+#if wxUSE_STL
+ !(first = m_HandlersStack->GetFirst())
+#else // !wxUSE_STL
+ ((first = m_HandlersStack->GetFirst()) == NULL)
+#endif // wxUSE_STL/!wxUSE_STL
+ )
{
wxLogWarning(_("Warning: attempt to remove HTML tag handler from empty stack."));
return;
}
m_HandlersHash = *((wxHashTable*) first->GetData());
{
wxLogWarning(_("Warning: attempt to remove HTML tag handler from empty stack."));
return;
}
m_HandlersHash = *((wxHashTable*) first->GetData());
- m_HandlersStack->DeleteNode(first);
+ delete (wxHashTable*) first->GetData();
+ m_HandlersStack->Erase(first);
}
void wxHtmlParser::SetSourceAndSaveState(const wxString& src)
}
void wxHtmlParser::SetSourceAndSaveState(const wxString& src)
@@
-847,9
+864,14
@@
wxFSFile *wxHtmlParser::OpenURL(wxHtmlURLType WXUNUSED(type),
class wxMetaTagParser : public wxHtmlParser
{
public:
class wxMetaTagParser : public wxHtmlParser
{
public:
+ wxMetaTagParser() { }
+
wxObject* GetProduct() { return NULL; }
wxObject* GetProduct() { return NULL; }
+
protected:
virtual void AddText(const wxChar* WXUNUSED(txt)) {}
protected:
virtual void AddText(const wxChar* WXUNUSED(txt)) {}
+
+ DECLARE_NO_COPY_CLASS(wxMetaTagParser)
};
class wxMetaTagHandler : public wxHtmlTagHandler
};
class wxMetaTagHandler : public wxHtmlTagHandler
@@
-861,6
+883,8
@@
public:
private:
wxString *m_retval;
private:
wxString *m_retval;
+
+ DECLARE_NO_COPY_CLASS(wxMetaTagHandler)
};
bool wxMetaTagHandler::HandleTag(const wxHtmlTag& tag)
};
bool wxMetaTagHandler::HandleTag(const wxHtmlTag& tag)
@@
-875,7
+899,7
@@
bool wxMetaTagHandler::HandleTag(const wxHtmlTag& tag)
tag.GetParam(_T("HTTP-EQUIV")).IsSameAs(_T("Content-Type"), false) &&
tag.HasParam(_T("CONTENT")))
{
tag.GetParam(_T("HTTP-EQUIV")).IsSameAs(_T("Content-Type"), false) &&
tag.HasParam(_T("CONTENT")))
{
- wxString content = tag.GetParam(_T("CONTENT"));
+ wxString content = tag.GetParam(_T("CONTENT"))
.Lower()
;
if (content.Left(19) == _T("text/html; charset="))
{
*m_retval = content.Mid(19);
if (content.Left(19) == _T("text/html; charset="))
{
*m_retval = content.Mid(19);
@@
-896,5
+920,4
@@
wxString wxHtmlParser::ExtractCharsetInformation(const wxString& markup)
return charset;
}
return charset;
}
-
#endif
#endif