type = t;
while ((i = x.Find( ',' )) != -1)
{
- coords.Add( atoi( x.Left( i ).c_str() ) );
+ coords.Add( wxAtoi( x.Left( i ).c_str() ) );
x = x.Mid( i + 1 );
}
- coords.Add( atoi( x.c_str() ) );
+ coords.Add( wxAtoi( x.c_str() ) );
}
wxString wxHtmlImageMapAreaCell::GetLink( int x, int y ) const
l = coords[ 0 ];
t = coords[ 1 ];
r = coords[ 2 ];
- d = sqrt( ((x - l) * (x - l)) + ((y - t) * (y - t)) );
+ d = sqrt( (double) (((x - l) * (x - l)) + ((y - t) * (y - t))) );
if (d < (double)r)
{
return m_Link;
// wxHtmlImageMapCell
// 0-width, 0-height cell that represents map from imagemaps
// it is always placed before wxHtmlImageMapAreaCells
-// It responds to Find(HTML_COND_ISIMAGEMAP)
+// It responds to Find(wxHTML_COND_ISIMAGEMAP)
//--------------------------------------------------------------------------------
const wxHtmlCell *wxHtmlImageMapCell::Find( int cond, const void *param ) const
{
- if (cond == HTML_COND_ISIMAGEMAP)
+ if (cond == wxHTML_COND_ISIMAGEMAP)
{
if (m_Name == *((wxString*)(param)))
return this;
wxHtmlImageMapCell *m_ImageMap;
wxString m_MapName;
- wxHtmlImageCell(wxFSFile *input, int w = -1, int h = -1, int align = HTML_ALIGN_BOTTOM, wxString mapname = wxEmptyString);
+ wxHtmlImageCell(wxFSFile *input, int w = -1, int h = -1, int align = wxHTML_ALIGN_BOTTOM, wxString mapname = wxEmptyString);
~wxHtmlImageCell() {if (m_Image) delete m_Image;}
void Draw(wxDC& dc, int x, int y, int view_y1, int view_y2);
virtual wxString GetLink( int x = 0, int y = 0 ) const;
delete img;
}
switch (align) {
- case HTML_ALIGN_TOP :
+ case wxHTML_ALIGN_TOP :
m_Descent = m_Height; break;
- case HTML_ALIGN_CENTER :
+ case wxHTML_ALIGN_CENTER :
m_Descent = m_Height / 2; break;
- case HTML_ALIGN_BOTTOM : default :
+ case wxHTML_ALIGN_BOTTOM : default :
m_Descent = 0; break;
}
m_ImageMap = NULL;
m_MapName = mapname;
+ SetCanLiveOnPagebreak(FALSE);
}
p = p->GetParent();
}
p = op;
- wxHtmlCell *cell = (wxHtmlCell*)p->Find( HTML_COND_ISIMAGEMAP, (const void*)(&m_MapName));
+ wxHtmlCell *cell = (wxHtmlCell*)p->Find( wxHTML_COND_ISIMAGEMAP, (const void*)(&m_MapName));
if (!cell)
{
((wxString&)m_MapName).Clear();
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(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 = HTML_ALIGN_TOP;
- else if ((alstr == "CENTER") || (alstr == "ABSCENTER")) al = HTML_ALIGN_CENTER;
+ if (alstr == "TEXTTOP") al = wxHTML_ALIGN_TOP;
+ else if ((alstr == "CENTER") || (alstr == "ABSCENTER")) al = wxHTML_ALIGN_CENTER;
}
if (tag.HasParam("USEMAP"))
{
{
cel = new wxHtmlImageMapAreaCell( wxHtmlImageMapAreaCell::RECT, coords );
}
- if (cel && tag.HasParam("HREF"))
+ if (cel != NULL && tag.HasParam("HREF"))
{
wxString tmp = tag.GetParam("HREF");
cel->SetLink( tmp );
}
- m_WParser->GetContainer()->InsertCell( cel );
+ if (cel != NULL) m_WParser->GetContainer()->InsertCell( cel );
}
}