+ // Call ParseInner() preserving background colour and mode after any
+ // changes done by it.
+ void CallParseInnerWithBg(const wxHtmlTag& tag, const wxColour& colBg)
+ {
+ const wxColour oldbackclr = m_WParser->GetActualBackgroundColor();
+ const int oldbackmode = m_WParser->GetActualBackgroundMode();
+ if ( colBg.IsOk() )
+ {
+ m_WParser->SetActualBackgroundColor(colBg);
+ m_WParser->SetActualBackgroundMode(wxBRUSHSTYLE_SOLID);
+ m_WParser->GetContainer()->InsertCell(
+ new wxHtmlColourCell(colBg, wxHTML_CLR_BACKGROUND)
+ );
+ }
+
+ ParseInner(tag);
+
+ if ( oldbackmode != m_WParser->GetActualBackgroundMode() ||
+ oldbackclr != m_WParser->GetActualBackgroundColor() )
+ {
+ m_WParser->SetActualBackgroundMode(oldbackmode);
+ m_WParser->SetActualBackgroundColor(oldbackclr);
+ m_WParser->GetContainer()->InsertCell(
+ new wxHtmlColourCell(oldbackclr,
+ oldbackmode == wxBRUSHSTYLE_TRANSPARENT
+ ? wxHTML_CLR_TRANSPARENT_BACKGROUND
+ : wxHTML_CLR_BACKGROUND)
+ );
+ }
+ }
+