- if (tag.GetName() == "IMG")
- {
- if (tag.HasParam("SRC")) {
- int w = -1, h = -1;
- int al;
- wxFSFile *str;
- wxString tmp = tag.GetParam("SRC");
- wxString mn = wxEmptyString;
-
- str = m_WParser -> GetFS() -> OpenFile(tmp);
- if (tag.HasParam("WIDTH")) tag.ScanParam("WIDTH", "%i", &w);
- if (tag.HasParam("HEIGHT")) tag.ScanParam("HEIGHT", "%i", &h);
- al = HTML_ALIGN_BOTTOM;
- if (tag.HasParam("ALIGN")) {
- wxString alstr = tag.GetParam("ALIGN");
- alstr.MakeUpper(); // for the case alignment was in ".."
- if (alstr == "TEXTTOP") al = HTML_ALIGN_TOP;
- else if ((alstr == "CENTER") || (alstr == "ABSCENTER")) al = HTML_ALIGN_CENTER;
- }
- if (tag.HasParam("USEMAP"))
- {
- mn = tag.GetParam( "USEMAP" );
- if (mn[ 0 ] == '#')
- {
- mn = mn.Mid( 1 );
- }
- }
- wxHtmlImageCell *cel = NULL;
- if (str) {
- cel = new wxHtmlImageCell(str, w, h, al, mn);
- cel -> SetLink(m_WParser -> GetLink());
- m_WParser -> GetContainer() -> InsertCell(cel);
- delete str;
- }
- }
- }
- if (tag.GetName() == "MAP")
- {
- m_WParser->CloseContainer();
- m_WParser->OpenContainer();
- if (tag.HasParam("NAME"))
- {
- wxString tmp = tag.GetParam("NAME");
- wxHtmlImageMapCell *cel = new wxHtmlImageMapCell( tmp );
- m_WParser->GetContainer()->InsertCell( cel );
- }
- ParseInner( tag );
- m_WParser->CloseContainer();
- m_WParser->OpenContainer();
- }
- if (tag.GetName() == "AREA")
- {
- if (tag.HasParam("SHAPE"))
- {
- wxString tmp = tag.GetParam("SHAPE");
- wxString coords;
- tmp.MakeUpper();
- wxHtmlImageMapAreaCell *cel = NULL;
- if (tag.HasParam("COORDS"))
- {
- coords = tag.GetParam("COORDS");
- }
- if (tmp == "POLY")
- {
- cel = new wxHtmlImageMapAreaCell( wxHtmlImageMapAreaCell::POLY, coords );
- }
- else if (tmp == "CIRCLE")
- {
- cel = new wxHtmlImageMapAreaCell( wxHtmlImageMapAreaCell::CIRCLE, coords );
- }
- else if (tmp == "RECT")
- {
- cel = new wxHtmlImageMapAreaCell( wxHtmlImageMapAreaCell::RECT, coords );
- }
- if (cel != NULL && tag.HasParam("HREF"))
- {
- wxString tmp = tag.GetParam("HREF");
- cel->SetLink( tmp );
- }
- if (cel != NULL) m_WParser->GetContainer()->InsertCell( cel );
- }
- }
+ if (tag.GetName() == "IMG") {
+ if (tag.HasParam("SRC")) {
+ int w = -1, h = -1;
+ int al;
+ wxFSFile *str;
+ wxString tmp = tag.GetParam("SRC");
+ wxString mn = wxEmptyString;
+
+ str = m_WParser -> GetFS() -> OpenFile(tmp);
+ if (tag.HasParam(wxT("WIDTH"))) tag.ScanParam(wxT("WIDTH"), wxT("%i"), &w);
+ if (tag.HasParam(wxT("HEIGHT"))) tag.ScanParam(wxT("HEIGHT"), wxT("%i"), &h);
+ al = wxHTML_ALIGN_BOTTOM;
+ if (tag.HasParam("ALIGN")) {
+ wxString alstr = tag.GetParam("ALIGN");
+ alstr.MakeUpper(); // for the case alignment was in ".."
+ if (alstr == "TEXTTOP") al = wxHTML_ALIGN_TOP;
+ else if ((alstr == "CENTER") || (alstr == "ABSCENTER")) al = wxHTML_ALIGN_CENTER;
+ }
+ if (tag.HasParam("USEMAP")) {
+ mn = tag.GetParam( "USEMAP" );
+ if (mn[ (unsigned int) 0 ] == '#') {
+ mn = mn.Mid( 1 );
+ }
+ }
+ wxHtmlImageCell *cel = NULL;
+ if (str) {
+ cel = new wxHtmlImageCell(str, w, h, al, mn);
+ cel -> SetLink(m_WParser -> GetLink());
+ m_WParser -> GetContainer() -> InsertCell(cel);
+ delete str;
+ }
+ }
+ }
+ if (tag.GetName() == "MAP") {
+ m_WParser->CloseContainer();
+ m_WParser->OpenContainer();
+ if (tag.HasParam("NAME")) {
+ wxString tmp = tag.GetParam("NAME");
+ wxHtmlImageMapCell *cel = new wxHtmlImageMapCell( tmp );
+ m_WParser->GetContainer()->InsertCell( cel );
+ }
+ ParseInner( tag );
+ m_WParser->CloseContainer();
+ m_WParser->OpenContainer();
+ }
+ if (tag.GetName() == "AREA") {
+ if (tag.HasParam("SHAPE")) {
+ wxString tmp = tag.GetParam("SHAPE");
+ wxString coords;
+ tmp.MakeUpper();
+ wxHtmlImageMapAreaCell *cel = NULL;
+ if (tag.HasParam("COORDS")) {
+ coords = tag.GetParam("COORDS");
+ }
+ if (tmp == "POLY") {
+ cel = new wxHtmlImageMapAreaCell( wxHtmlImageMapAreaCell::POLY, coords );
+ } else if (tmp == "CIRCLE") {
+ cel = new wxHtmlImageMapAreaCell( wxHtmlImageMapAreaCell::CIRCLE, coords );
+ } else if (tmp == "RECT") {
+ cel = new wxHtmlImageMapAreaCell( wxHtmlImageMapAreaCell::RECT, coords );
+ }
+ if (cel != NULL && tag.HasParam("HREF")) {
+ wxString tmp = tag.GetParam("HREF");
+ cel->SetLink( tmp );
+ }
+ if (cel != NULL) m_WParser->GetContainer()->InsertCell( cel );
+ }
+ }