Source cleaning: whitespaces, tabs, -1/wxID_ANY/wxDefaultCoord/wxNOT_FOUND, TRUE/true, FALSE/false.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29462 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba
2004-09-27 19:15:07 +00:00
parent 6953da0088
commit d1da887276
21 changed files with 271 additions and 271 deletions

View File

@@ -137,7 +137,7 @@ void wxHtmlHelpController::CreateHelpWindow()
if (m_Config == NULL) if (m_Config == NULL)
{ {
m_Config = wxConfigBase::Get(FALSE); m_Config = wxConfigBase::Get(false);
if (m_Config != NULL) if (m_Config != NULL)
m_ConfigRoot = _T("wxWindows/wxHtmlHelpController"); m_ConfigRoot = _T("wxWindows/wxHtmlHelpController");
} }
@@ -151,7 +151,7 @@ void wxHtmlHelpController::CreateHelpWindow()
m_helpFrame->Create(NULL, wxID_HTML_HELPFRAME, wxEmptyString, m_FrameStyle); m_helpFrame->Create(NULL, wxID_HTML_HELPFRAME, wxEmptyString, m_FrameStyle);
m_helpFrame->SetTitleFormat(m_titleFormat); m_helpFrame->SetTitleFormat(m_titleFormat);
m_helpFrame->Show(TRUE); m_helpFrame->Show(true);
} }
void wxHtmlHelpController::ReadCustomization(wxConfigBase* cfg, const wxString& path) void wxHtmlHelpController::ReadCustomization(wxConfigBase* cfg, const wxString& path)
@@ -211,7 +211,7 @@ bool wxHtmlHelpController::Initialize(const wxString& file)
bool wxHtmlHelpController::LoadFile(const wxString& WXUNUSED(file)) bool wxHtmlHelpController::LoadFile(const wxString& WXUNUSED(file))
{ {
// Don't reload the file or we'll have it appear again, presumably. // Don't reload the file or we'll have it appear again, presumably.
return TRUE; return true;
} }
bool wxHtmlHelpController::DisplaySection(int sectionNo) bool wxHtmlHelpController::DisplaySection(int sectionNo)
@@ -237,11 +237,11 @@ bool wxHtmlHelpController::DisplayTextPopup(const wxString& text, const wxPoint&
{ {
s_tipWindow = new wxTipWindow(wxTheApp->GetTopWindow(), text, 100, & s_tipWindow); s_tipWindow = new wxTipWindow(wxTheApp->GetTopWindow(), text, 100, & s_tipWindow);
return TRUE; return true;
} }
#endif // wxUSE_TIPWINDOW #endif // wxUSE_TIPWINDOW
return FALSE; return false;
} }
void wxHtmlHelpController::SetFrameParameters(const wxString& title, void wxHtmlHelpController::SetFrameParameters(const wxString& title,
@@ -261,7 +261,7 @@ wxFrame* wxHtmlHelpController::GetFrameParameters(wxSize *size,
bool *newFrameEachTime) bool *newFrameEachTime)
{ {
if (newFrameEachTime) if (newFrameEachTime)
(* newFrameEachTime) = FALSE; (* newFrameEachTime) = false;
if (size && m_helpFrame) if (size && m_helpFrame)
(* size) = m_helpFrame->GetSize(); (* size) = m_helpFrame->GetSize();
if (pos && m_helpFrame) if (pos && m_helpFrame)
@@ -272,7 +272,7 @@ wxFrame* wxHtmlHelpController::GetFrameParameters(wxSize *size,
bool wxHtmlHelpController::Quit() bool wxHtmlHelpController::Quit()
{ {
DestroyHelpWindow(); DestroyHelpWindow();
return TRUE; return true;
} }
// Make the help controller's frame 'modal' if // Make the help controller's frame 'modal' if
@@ -281,7 +281,7 @@ void wxHtmlHelpController::AddGrabIfNeeded()
{ {
// So far, wxGTK only // So far, wxGTK only
#ifdef __WXGTK__ #ifdef __WXGTK__
bool needGrab = FALSE; bool needGrab = false;
// Check if there are any modal windows present, // Check if there are any modal windows present,
// in which case we need to add a grab. // in which case we need to add a grab.
@@ -293,7 +293,7 @@ void wxHtmlHelpController::AddGrabIfNeeded()
wxDialog *dialog = wxDynamicCast(win, wxDialog); wxDialog *dialog = wxDynamicCast(win, wxDialog);
if (dialog && dialog->IsModal()) if (dialog && dialog->IsModal())
needGrab = TRUE; needGrab = true;
} }
if (needGrab && m_helpFrame) if (needGrab && m_helpFrame)

View File

@@ -157,7 +157,7 @@ class HP_TagHandler : public wxHtmlTagHandler
m_book = b; m_book = b;
m_name = m_page = wxEmptyString; m_name = m_page = wxEmptyString;
m_level = 0; m_level = 0;
m_id = -1; m_id = wxID_ANY;
m_count = 0; m_count = 0;
m_parentItem = NULL; m_parentItem = NULL;
} }
@@ -320,7 +320,7 @@ bool wxHtmlHelpData::LoadMSProject(wxHtmlBookRecord *book, wxFileSystem& fsys,
{ {
wxLogError(_("Cannot open index file: %s"), indexfile.c_str()); wxLogError(_("Cannot open index file: %s"), indexfile.c_str());
} }
return TRUE; return true;
} }
inline static void CacheWriteInt32(wxOutputStream *f, wxInt32 value) inline static void CacheWriteInt32(wxOutputStream *f, wxInt32 value)
@@ -369,7 +369,7 @@ bool wxHtmlHelpData::LoadCachedBook(wxHtmlBookRecord *book, wxInputStream *f)
if (version != CURRENT_CACHED_BOOK_VERSION) if (version != CURRENT_CACHED_BOOK_VERSION)
{ {
// NB: We can just silently return FALSE here and don't worry about // NB: We can just silently return false here and don't worry about
// it anymore, because AddBookParam will load the MS project in // it anymore, because AddBookParam will load the MS project in
// absence of (properly versioned) .cached file and automatically // absence of (properly versioned) .cached file and automatically
// create new .cached file immediately afterward. // create new .cached file immediately afterward.
@@ -518,7 +518,7 @@ bool wxHtmlHelpData::AddBookParam(const wxFSFile& bookfile,
ContentsOld = m_contents.size(); ContentsOld = m_contents.size();
if (!path.IsEmpty()) if (!path.IsEmpty())
fsys.ChangePathTo(path, TRUE); fsys.ChangePathTo(path, true);
size_t booksCnt = m_bookRecords.GetCount(); size_t booksCnt = m_bookRecords.GetCount();
for (size_t i = 0; i < booksCnt; i++) for (size_t i = 0; i < booksCnt; i++)
@@ -633,7 +633,7 @@ bool wxHtmlHelpData::AddBook(const wxString& book)
{ {
wxFileSystem fsys; wxFileSystem fsys;
wxString s; wxString s;
bool rt = FALSE; bool rt = false;
#if wxUSE_LIBMSPACK #if wxUSE_LIBMSPACK
if (extension == wxT(".chm")) if (extension == wxT(".chm"))
@@ -644,7 +644,7 @@ bool wxHtmlHelpData::AddBook(const wxString& book)
while (!s.IsEmpty()) while (!s.IsEmpty())
{ {
if (AddBook(s)) rt = TRUE; if (AddBook(s)) rt = true;
s = fsys.FindNext(); s = fsys.FindNext();
} }
@@ -665,7 +665,7 @@ bool wxHtmlHelpData::AddBook(const wxString& book)
if (fi == NULL) if (fi == NULL)
{ {
wxLogError(_("Cannot open HTML help book: %s"), book.c_str()); wxLogError(_("Cannot open HTML help book: %s"), book.c_str());
return FALSE; return false;
} }
fsys.ChangePathTo(book); fsys.ChangePathTo(book);
@@ -778,7 +778,7 @@ wxString wxHtmlHelpData::FindPageById(int id)
#if WXWIN_COMPATIBILITY_2_4 #if WXWIN_COMPATIBILITY_2_4
wxHtmlContentsItem::wxHtmlContentsItem() wxHtmlContentsItem::wxHtmlContentsItem()
: m_Level(0), m_ID(-1), m_Name(NULL), m_Page(NULL), m_Book(NULL), : m_Level(0), m_ID(wxID_ANY), m_Name(NULL), m_Page(NULL), m_Book(NULL),
m_autofree(false) m_autofree(false)
{ {
} }
@@ -987,7 +987,7 @@ bool wxHtmlSearchEngine::Scan(const wxFSFile& file)
int i, j; int i, j;
int wrd = m_Keyword.Length(); int wrd = m_Keyword.Length();
bool found = FALSE; bool found = false;
wxHtmlFilterHTML filter; wxHtmlFilterHTML filter;
wxString tmp = filter.ReadFile(file); wxString tmp = filter.ReadFile(file);
int lng = tmp.length(); int lng = tmp.length();

View File

@@ -619,26 +619,26 @@ void wxHtmlHelpFrame::AddToolbarButtons(wxToolBar *toolBar, int style)
toolBar->AddTool(wxID_HTML_PANEL, wpanelBitmap, wxNullBitmap, toolBar->AddTool(wxID_HTML_PANEL, wpanelBitmap, wxNullBitmap,
false, -1, -1, (wxObject *) NULL, false, wxDefaultCoord, wxDefaultCoord, (wxObject *) NULL,
_("Show/hide navigation panel")); _("Show/hide navigation panel"));
toolBar->AddSeparator(); toolBar->AddSeparator();
toolBar->AddTool(wxID_HTML_BACK, wbackBitmap, wxNullBitmap, toolBar->AddTool(wxID_HTML_BACK, wbackBitmap, wxNullBitmap,
false, -1, -1, (wxObject *) NULL, false, wxDefaultCoord, wxDefaultCoord, (wxObject *) NULL,
_("Go back")); _("Go back"));
toolBar->AddTool(wxID_HTML_FORWARD, wforwardBitmap, wxNullBitmap, toolBar->AddTool(wxID_HTML_FORWARD, wforwardBitmap, wxNullBitmap,
false, -1, -1, (wxObject *) NULL, false, wxDefaultCoord, wxDefaultCoord, (wxObject *) NULL,
_("Go forward")); _("Go forward"));
toolBar->AddSeparator(); toolBar->AddSeparator();
toolBar->AddTool(wxID_HTML_UPNODE, wupnodeBitmap, wxNullBitmap, toolBar->AddTool(wxID_HTML_UPNODE, wupnodeBitmap, wxNullBitmap,
false, -1, -1, (wxObject *) NULL, false, wxDefaultCoord, wxDefaultCoord, (wxObject *) NULL,
_("Go one level up in document hierarchy")); _("Go one level up in document hierarchy"));
toolBar->AddTool(wxID_HTML_UP, wupBitmap, wxNullBitmap, toolBar->AddTool(wxID_HTML_UP, wupBitmap, wxNullBitmap,
false, -1, -1, (wxObject *) NULL, false, wxDefaultCoord, wxDefaultCoord, (wxObject *) NULL,
_("Previous page")); _("Previous page"));
toolBar->AddTool(wxID_HTML_DOWN, wdownBitmap, wxNullBitmap, toolBar->AddTool(wxID_HTML_DOWN, wdownBitmap, wxNullBitmap,
false, -1, -1, (wxObject *) NULL, false, wxDefaultCoord, wxDefaultCoord, (wxObject *) NULL,
_("Next page")); _("Next page"));
if ((style & wxHF_PRINT) || (style & wxHF_OPEN_FILES)) if ((style & wxHF_PRINT) || (style & wxHF_OPEN_FILES))
@@ -646,19 +646,19 @@ void wxHtmlHelpFrame::AddToolbarButtons(wxToolBar *toolBar, int style)
if (style & wxHF_OPEN_FILES) if (style & wxHF_OPEN_FILES)
toolBar->AddTool(wxID_HTML_OPENFILE, wopenBitmap, wxNullBitmap, toolBar->AddTool(wxID_HTML_OPENFILE, wopenBitmap, wxNullBitmap,
false, -1, -1, (wxObject *) NULL, false, wxDefaultCoord, wxDefaultCoord, (wxObject *) NULL,
_("Open HTML document")); _("Open HTML document"));
#if wxUSE_PRINTING_ARCHITECTURE #if wxUSE_PRINTING_ARCHITECTURE
if (style & wxHF_PRINT) if (style & wxHF_PRINT)
toolBar->AddTool(wxID_HTML_PRINT, wprintBitmap, wxNullBitmap, toolBar->AddTool(wxID_HTML_PRINT, wprintBitmap, wxNullBitmap,
false, -1, -1, (wxObject *) NULL, false, wxDefaultCoord, wxDefaultCoord, (wxObject *) NULL,
_("Print this page")); _("Print this page"));
#endif #endif
toolBar->AddSeparator(); toolBar->AddSeparator();
toolBar->AddTool(wxID_HTML_OPTIONS, woptionsBitmap, wxNullBitmap, toolBar->AddTool(wxID_HTML_OPTIONS, woptionsBitmap, wxNullBitmap,
false, -1, -1, (wxObject *) NULL, false, wxDefaultCoord, wxDefaultCoord, (wxObject *) NULL,
_("Display options dialog")); _("Display options dialog"));
} }
#endif //wxUSE_TOOLBAR #endif //wxUSE_TOOLBAR
@@ -1197,11 +1197,11 @@ public:
sizer->Add(new wxStaticText(this, wxID_ANY, _("Font size:"))); sizer->Add(new wxStaticText(this, wxID_ANY, _("Font size:")));
sizer->Add(NormalFont = new wxComboBox(this, wxID_ANY, wxEmptyString, wxDefaultPosition, sizer->Add(NormalFont = new wxComboBox(this, wxID_ANY, wxEmptyString, wxDefaultPosition,
wxSize(200, -1), wxSize(200, wxDefaultCoord),
0, NULL, wxCB_DROPDOWN | wxCB_READONLY)); 0, NULL, wxCB_DROPDOWN | wxCB_READONLY));
sizer->Add(FixedFont = new wxComboBox(this, wxID_ANY, wxEmptyString, wxDefaultPosition, sizer->Add(FixedFont = new wxComboBox(this, wxID_ANY, wxEmptyString, wxDefaultPosition,
wxSize(200, -1), wxSize(200, wxDefaultCoord),
0, NULL, wxCB_DROPDOWN | wxCB_READONLY)); 0, NULL, wxCB_DROPDOWN | wxCB_READONLY));
sizer->Add(FontSize = new wxSpinCtrl(this, wxID_ANY)); sizer->Add(FontSize = new wxSpinCtrl(this, wxID_ANY));

View File

@@ -77,7 +77,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxHtmlFilterPlainText, wxHtmlFilter)
bool wxHtmlFilterPlainText::CanRead(const wxFSFile& WXUNUSED(file)) const bool wxHtmlFilterPlainText::CanRead(const wxFSFile& WXUNUSED(file)) const
{ {
return TRUE; return true;
} }
@@ -90,9 +90,9 @@ wxString wxHtmlFilterPlainText::ReadFile(const wxFSFile& file) const
if (s == NULL) return wxEmptyString; if (s == NULL) return wxEmptyString;
ReadString(doc, s, wxConvISO8859_1); ReadString(doc, s, wxConvISO8859_1);
doc.Replace(wxT("&"), wxT("&amp;"), TRUE); doc.Replace(wxT("&"), wxT("&amp;"), true);
doc.Replace(wxT("<"), wxT("&lt;"), TRUE); doc.Replace(wxT("<"), wxT("&lt;"), true);
doc.Replace(wxT(">"), wxT("&gt;"), TRUE); doc.Replace(wxT(">"), wxT("&gt;"), true);
doc2 = wxT("<HTML><BODY><PRE>\n") + doc + wxT("\n</PRE></BODY></HTML>"); doc2 = wxT("<HTML><BODY><PRE>\n") + doc + wxT("\n</PRE></BODY></HTML>");
return doc2; return doc2;
} }
@@ -219,7 +219,7 @@ class wxHtmlFilterModule : public wxModule
{ {
wxHtmlWindow::AddFilter(new wxHtmlFilterHTML); wxHtmlWindow::AddFilter(new wxHtmlFilterHTML);
wxHtmlWindow::AddFilter(new wxHtmlFilterImage); wxHtmlWindow::AddFilter(new wxHtmlFilterImage);
return TRUE; return true;
} }
virtual void OnExit() {} virtual void OnExit() {}
}; };

View File

@@ -119,7 +119,7 @@ wxObject* wxHtmlParser::Parse(const wxString& source)
void wxHtmlParser::InitParser(const wxString& source) void wxHtmlParser::InitParser(const wxString& source)
{ {
SetSource(source); SetSource(source);
m_stopParsing = FALSE; m_stopParsing = false;
} }
void wxHtmlParser::DoneParser() void wxHtmlParser::DoneParser()
@@ -330,7 +330,7 @@ void wxHtmlParser::DoParsing(int begin_pos, int end_pos)
void wxHtmlParser::AddTag(const wxHtmlTag& tag) void wxHtmlParser::AddTag(const wxHtmlTag& tag)
{ {
wxHtmlTagHandler *h; wxHtmlTagHandler *h;
bool inner = FALSE; bool inner = false;
h = (wxHtmlTagHandler*) m_HandlersHash.Get(tag.GetName()); h = (wxHtmlTagHandler*) m_HandlersHash.Get(tag.GetName());
if (h) if (h)
@@ -424,7 +424,7 @@ void wxHtmlParser::SetSourceAndSaveState(const wxString& src)
bool wxHtmlParser::RestoreState() bool wxHtmlParser::RestoreState()
{ {
if (!m_SavedStates) return FALSE; if (!m_SavedStates) return false;
DestroyDOMTree(); DestroyDOMTree();
@@ -438,7 +438,7 @@ bool wxHtmlParser::RestoreState()
m_Source = s->m_source; m_Source = s->m_source;
delete s; delete s;
return TRUE; return true;
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@@ -900,7 +900,7 @@ bool wxMetaTagHandler::HandleTag(const wxHtmlTag& tag)
if (tag.GetName() == _T("BODY")) if (tag.GetName() == _T("BODY"))
{ {
m_Parser->StopParsing(); m_Parser->StopParsing();
return FALSE; return false;
} }
if (tag.HasParam(_T("HTTP-EQUIV")) && if (tag.HasParam(_T("HTTP-EQUIV")) &&
@@ -914,7 +914,7 @@ bool wxMetaTagHandler::HandleTag(const wxHtmlTag& tag)
m_Parser->StopParsing(); m_Parser->StopParsing();
} }
} }
return FALSE; return false;
} }

View File

@@ -153,7 +153,7 @@ WX_DEFINE_LIST(wxHtmlProcessorList);
void wxHtmlWindow::Init() void wxHtmlWindow::Init()
{ {
m_tmpMouseMoved = FALSE; m_tmpMouseMoved = false;
m_tmpLastLink = NULL; m_tmpLastLink = NULL;
m_tmpLastCell = NULL; m_tmpLastCell = NULL;
m_tmpCanDrawLocks = 0; m_tmpCanDrawLocks = 0;
@@ -168,7 +168,7 @@ void wxHtmlWindow::Init()
m_Parser = new wxHtmlWinParser(this); m_Parser = new wxHtmlWinParser(this);
m_Parser->SetFS(m_FS); m_Parser->SetFS(m_FS);
m_HistoryPos = -1; m_HistoryPos = -1;
m_HistoryOn = TRUE; m_HistoryOn = true;
m_History = new wxHtmlHistoryArray; m_History = new wxHtmlHistoryArray;
m_Processors = NULL; m_Processors = NULL;
m_Style = 0; m_Style = 0;
@@ -189,11 +189,11 @@ bool wxHtmlWindow::Create(wxWindow *parent, wxWindowID id,
if (!wxScrolledWindow::Create(parent, id, pos, size, if (!wxScrolledWindow::Create(parent, id, pos, size,
style | wxVSCROLL | wxHSCROLL, style | wxVSCROLL | wxHSCROLL,
name)) name))
return FALSE; return false;
m_Style = style; m_Style = style;
SetPage(wxT("<html><body></body></html>")); SetPage(wxT("<html><body></body></html>"));
return TRUE; return true;
} }
@@ -321,7 +321,7 @@ bool wxHtmlWindow::SetPage(const wxString& source)
CreateLayout(); CreateLayout();
if (m_tmpCanDrawLocks == 0) if (m_tmpCanDrawLocks == 0)
Refresh(); Refresh();
return TRUE; return true;
} }
bool wxHtmlWindow::AppendToPage(const wxString& source) bool wxHtmlWindow::AppendToPage(const wxString& source)
@@ -335,7 +335,7 @@ bool wxHtmlWindow::LoadPage(const wxString& location)
wxFSFile *f; wxFSFile *f;
bool rt_val; bool rt_val;
bool needs_refresh = FALSE; bool needs_refresh = false;
m_tmpCanDrawLocks++; m_tmpCanDrawLocks++;
if (m_HistoryOn && (m_HistoryPos != -1)) if (m_HistoryOn && (m_HistoryPos != -1))
@@ -490,7 +490,7 @@ bool wxHtmlWindow::ScrollToAnchor(const wxString& anchor)
if (!c) if (!c)
{ {
wxLogWarning(_("HTML anchor %s does not exist."), anchor.c_str()); wxLogWarning(_("HTML anchor %s does not exist."), anchor.c_str());
return FALSE; return false;
} }
else else
{ {
@@ -499,7 +499,7 @@ bool wxHtmlWindow::ScrollToAnchor(const wxString& anchor)
for (y = 0; c != NULL; c = c->GetParent()) y += c->GetPosY(); for (y = 0; c != NULL; c = c->GetParent()) y += c->GetPosY();
Scroll(-1, y / wxHTML_SCROLL_STEP); Scroll(-1, y / wxHTML_SCROLL_STEP);
m_OpenedAnchor = anchor; m_OpenedAnchor = anchor;
return TRUE; return true;
} }
} }
@@ -613,7 +613,7 @@ bool wxHtmlWindow::HistoryBack()
{ {
wxString a, l; wxString a, l;
if (m_HistoryPos < 1) return FALSE; if (m_HistoryPos < 1) return false;
// store scroll position into history item: // store scroll position into history item:
int x, y; int x, y;
@@ -625,21 +625,21 @@ bool wxHtmlWindow::HistoryBack()
l = (*m_History)[m_HistoryPos].GetPage(); l = (*m_History)[m_HistoryPos].GetPage();
a = (*m_History)[m_HistoryPos].GetAnchor(); a = (*m_History)[m_HistoryPos].GetAnchor();
m_HistoryOn = FALSE; m_HistoryOn = false;
m_tmpCanDrawLocks++; m_tmpCanDrawLocks++;
if (a == wxEmptyString) LoadPage(l); if (a == wxEmptyString) LoadPage(l);
else LoadPage(l + wxT("#") + a); else LoadPage(l + wxT("#") + a);
m_HistoryOn = TRUE; m_HistoryOn = true;
m_tmpCanDrawLocks--; m_tmpCanDrawLocks--;
Scroll(0, (*m_History)[m_HistoryPos].GetPos()); Scroll(0, (*m_History)[m_HistoryPos].GetPos());
Refresh(); Refresh();
return TRUE; return true;
} }
bool wxHtmlWindow::HistoryCanBack() bool wxHtmlWindow::HistoryCanBack()
{ {
if (m_HistoryPos < 1) return FALSE; if (m_HistoryPos < 1) return false;
return TRUE ; return true ;
} }
@@ -647,30 +647,30 @@ bool wxHtmlWindow::HistoryForward()
{ {
wxString a, l; wxString a, l;
if (m_HistoryPos == -1) return FALSE; if (m_HistoryPos == -1) return false;
if (m_HistoryPos >= (int)m_History->GetCount() - 1)return FALSE; if (m_HistoryPos >= (int)m_History->GetCount() - 1)return false;
m_OpenedPage = wxEmptyString; // this will disable adding new entry into history in LoadPage() m_OpenedPage = wxEmptyString; // this will disable adding new entry into history in LoadPage()
m_HistoryPos++; m_HistoryPos++;
l = (*m_History)[m_HistoryPos].GetPage(); l = (*m_History)[m_HistoryPos].GetPage();
a = (*m_History)[m_HistoryPos].GetAnchor(); a = (*m_History)[m_HistoryPos].GetAnchor();
m_HistoryOn = FALSE; m_HistoryOn = false;
m_tmpCanDrawLocks++; m_tmpCanDrawLocks++;
if (a == wxEmptyString) LoadPage(l); if (a == wxEmptyString) LoadPage(l);
else LoadPage(l + wxT("#") + a); else LoadPage(l + wxT("#") + a);
m_HistoryOn = TRUE; m_HistoryOn = true;
m_tmpCanDrawLocks--; m_tmpCanDrawLocks--;
Scroll(0, (*m_History)[m_HistoryPos].GetPos()); Scroll(0, (*m_History)[m_HistoryPos].GetPos());
Refresh(); Refresh();
return TRUE; return true;
} }
bool wxHtmlWindow::HistoryCanForward() bool wxHtmlWindow::HistoryCanForward()
{ {
if (m_HistoryPos == -1) return FALSE; if (m_HistoryPos == -1) return false;
if (m_HistoryPos >= (int)m_History->GetCount() - 1)return FALSE; if (m_HistoryPos >= (int)m_History->GetCount() - 1)return false;
return TRUE ; return true ;
} }
@@ -1167,7 +1167,7 @@ void wxHtmlWindow::OnInternalIdle()
OnCellMouseHover(cell, x, y); OnCellMouseHover(cell, x, y);
} }
m_tmpMouseMoved = FALSE; m_tmpMouseMoved = false;
} }
} }
@@ -1420,7 +1420,7 @@ class wxHtmlWinModule: public wxModule
DECLARE_DYNAMIC_CLASS(wxHtmlWinModule) DECLARE_DYNAMIC_CLASS(wxHtmlWinModule)
public: public:
wxHtmlWinModule() : wxModule() {} wxHtmlWinModule() : wxModule() {}
bool OnInit() { return TRUE; } bool OnInit() { return true; }
void OnExit() { wxHtmlWindow::CleanUpStatics(); } void OnExit() { wxHtmlWindow::CleanUpStatics(); }
}; };

View File

@@ -163,7 +163,7 @@ wxHtmlPrintout::wxHtmlPrintout(const wxString& title) : wxPrintout(title)
m_Renderer = new wxHtmlDCRenderer; m_Renderer = new wxHtmlDCRenderer;
m_RendererHdr = new wxHtmlDCRenderer; m_RendererHdr = new wxHtmlDCRenderer;
m_NumPages = wxHTML_PRINT_MAX_PAGES; m_NumPages = wxHTML_PRINT_MAX_PAGES;
m_Document = m_BasePath = wxEmptyString; m_BasePathIsDir = TRUE; m_Document = m_BasePath = wxEmptyString; m_BasePathIsDir = true;
m_Headers[0] = m_Headers[1] = wxEmptyString; m_Headers[0] = m_Headers[1] = wxEmptyString;
m_Footers[0] = m_Footers[1] = wxEmptyString; m_Footers[0] = m_Footers[1] = wxEmptyString;
m_HeaderHeight = m_FooterHeight = 0; m_HeaderHeight = m_FooterHeight = 0;
@@ -249,9 +249,9 @@ void wxHtmlPrintout::OnPreparePrinting()
bool wxHtmlPrintout::OnBeginDocument(int startPage, int endPage) bool wxHtmlPrintout::OnBeginDocument(int startPage, int endPage)
{ {
if (!wxPrintout::OnBeginDocument(startPage, endPage)) return FALSE; if (!wxPrintout::OnBeginDocument(startPage, endPage)) return false;
return TRUE; return true;
} }
@@ -262,9 +262,9 @@ bool wxHtmlPrintout::OnPrintPage(int page)
{ {
if (HasPage(page)) if (HasPage(page))
RenderPage(dc, page); RenderPage(dc, page);
return TRUE; return true;
} }
else return FALSE; else return false;
} }
@@ -308,7 +308,7 @@ void wxHtmlPrintout::SetHtmlFile(const wxString& htmlfile)
return; return;
} }
bool done = FALSE; bool done = false;
wxHtmlFilterHTML defaultFilter; wxHtmlFilterHTML defaultFilter;
wxString doc; wxString doc;
@@ -319,7 +319,7 @@ void wxHtmlPrintout::SetHtmlFile(const wxString& htmlfile)
if (h->CanRead(*ff)) if (h->CanRead(*ff))
{ {
doc = h->ReadFile(*ff); doc = h->ReadFile(*ff);
done = TRUE; done = true;
break; break;
} }
node = node->GetNext(); node = node->GetNext();
@@ -328,7 +328,7 @@ void wxHtmlPrintout::SetHtmlFile(const wxString& htmlfile)
if (!done) if (!done)
doc = defaultFilter.ReadFile(*ff); doc = defaultFilter.ReadFile(*ff);
SetHtmlText(doc, htmlfile, FALSE); SetHtmlText(doc, htmlfile, false);
delete ff; delete ff;
} }
@@ -374,7 +374,7 @@ void wxHtmlPrintout::CountPages()
{ {
pos = m_Renderer->Render((int)( ppmm_h * m_MarginLeft), pos = m_Renderer->Render((int)( ppmm_h * m_MarginLeft),
(int) (ppmm_v * (m_MarginTop + (m_HeaderHeight == 0 ? 0 : m_MarginSpace)) + m_HeaderHeight), (int) (ppmm_v * (m_MarginTop + (m_HeaderHeight == 0 ? 0 : m_MarginSpace)) + m_HeaderHeight),
pos, TRUE, INT_MAX, m_PageBreaks, m_NumPages); pos, true, INT_MAX, m_PageBreaks, m_NumPages);
m_PageBreaks[++m_NumPages] = pos; m_PageBreaks[++m_NumPages] = pos;
} while (pos < m_Renderer->GetTotalHeight()); } while (pos < m_Renderer->GetTotalHeight());
} }
@@ -410,7 +410,7 @@ void wxHtmlPrintout::RenderPage(wxDC *dc, int page)
m_Renderer->Render((int) (ppmm_h * m_MarginLeft), m_Renderer->Render((int) (ppmm_h * m_MarginLeft),
(int) (ppmm_v * (m_MarginTop + (m_HeaderHeight == 0 ? 0 : m_MarginSpace)) + m_HeaderHeight), (int) (ppmm_v * (m_MarginTop + (m_HeaderHeight == 0 ? 0 : m_MarginSpace)) + m_HeaderHeight),
m_PageBreaks[page-1], FALSE, m_PageBreaks[page]-m_PageBreaks[page-1]); m_PageBreaks[page-1], false, m_PageBreaks[page]-m_PageBreaks[page-1]);
m_RendererHdr->SetDC(dc, (double)ppiPrinterY / (double)ppiScreenY); m_RendererHdr->SetDC(dc, (double)ppiPrinterY / (double)ppiScreenY);
if (m_Headers[page % 2] != wxEmptyString) if (m_Headers[page % 2] != wxEmptyString)
@@ -485,7 +485,7 @@ wxHtmlEasyPrinting::wxHtmlEasyPrinting(const wxString& name, wxWindow *parentWin
m_PageSetupData = new wxPageSetupDialogData; m_PageSetupData = new wxPageSetupDialogData;
m_Headers[0] = m_Headers[1] = m_Footers[0] = m_Footers[1] = wxEmptyString; m_Headers[0] = m_Headers[1] = m_Footers[0] = m_Footers[1] = wxEmptyString;
m_PageSetupData->EnableMargins(TRUE); m_PageSetupData->EnableMargins(true);
m_PageSetupData->SetMarginTopLeft(wxPoint(25, 25)); m_PageSetupData->SetMarginTopLeft(wxPoint(25, 25));
m_PageSetupData->SetMarginBottomRight(wxPoint(25, 25)); m_PageSetupData->SetMarginBottomRight(wxPoint(25, 25));
@@ -523,9 +523,9 @@ bool wxHtmlEasyPrinting::PreviewFile(const wxString &htmlfile)
bool wxHtmlEasyPrinting::PreviewText(const wxString &htmltext, const wxString &basepath) bool wxHtmlEasyPrinting::PreviewText(const wxString &htmltext, const wxString &basepath)
{ {
wxHtmlPrintout *p1 = CreatePrintout(); wxHtmlPrintout *p1 = CreatePrintout();
p1->SetHtmlText(htmltext, basepath, TRUE); p1->SetHtmlText(htmltext, basepath, true);
wxHtmlPrintout *p2 = CreatePrintout(); wxHtmlPrintout *p2 = CreatePrintout();
p2->SetHtmlText(htmltext, basepath, TRUE); p2->SetHtmlText(htmltext, basepath, true);
return DoPreview(p1, p2); return DoPreview(p1, p2);
} }
@@ -545,7 +545,7 @@ bool wxHtmlEasyPrinting::PrintFile(const wxString &htmlfile)
bool wxHtmlEasyPrinting::PrintText(const wxString &htmltext, const wxString &basepath) bool wxHtmlEasyPrinting::PrintText(const wxString &htmltext, const wxString &basepath)
{ {
wxHtmlPrintout *p = CreatePrintout(); wxHtmlPrintout *p = CreatePrintout();
p->SetHtmlText(htmltext, basepath, TRUE); p->SetHtmlText(htmltext, basepath, true);
bool ret = DoPrint(p); bool ret = DoPrint(p);
delete p; delete p;
return ret; return ret;
@@ -561,7 +561,7 @@ bool wxHtmlEasyPrinting::DoPreview(wxHtmlPrintout *printout1, wxHtmlPrintout *pr
if (!preview->Ok()) if (!preview->Ok())
{ {
delete preview; delete preview;
return FALSE; return false;
} }
wxPreviewFrame *frame = new wxPreviewFrame(preview, m_ParentWindow, wxPreviewFrame *frame = new wxPreviewFrame(preview, m_ParentWindow,
@@ -569,8 +569,8 @@ bool wxHtmlEasyPrinting::DoPreview(wxHtmlPrintout *printout1, wxHtmlPrintout *pr
wxPoint(100, 100), wxSize(650, 500)); wxPoint(100, 100), wxSize(650, 500));
frame->Centre(wxBOTH); frame->Centre(wxBOTH);
frame->Initialize(); frame->Initialize();
frame->Show(TRUE); frame->Show(true);
return TRUE; return true;
} }
@@ -580,13 +580,13 @@ bool wxHtmlEasyPrinting::DoPrint(wxHtmlPrintout *printout)
wxPrintDialogData printDialogData(*GetPrintData()); wxPrintDialogData printDialogData(*GetPrintData());
wxPrinter printer(&printDialogData); wxPrinter printer(&printDialogData);
if (!printer.Print(m_ParentWindow, printout, TRUE)) if (!printer.Print(m_ParentWindow, printout, true))
{ {
return FALSE; return false;
} }
(*GetPrintData()) = printer.GetPrintDialogData().GetPrintData(); (*GetPrintData()) = printer.GetPrintDialogData().GetPrintData();
return TRUE; return true;
} }
@@ -596,7 +596,7 @@ void wxHtmlEasyPrinting::PrinterSetup()
wxPrintDialogData printDialogData(*GetPrintData()); wxPrintDialogData printDialogData(*GetPrintData());
wxPrintDialog printerDialog(m_ParentWindow, &printDialogData); wxPrintDialog printerDialog(m_ParentWindow, &printDialogData);
printerDialog.GetPrintDialogData().SetSetupDialog(TRUE); printerDialog.GetPrintDialogData().SetSetupDialog(true);
if (printerDialog.ShowModal() == wxID_OK) if (printerDialog.ShowModal() == wxID_OK)
(*GetPrintData()) = printerDialog.GetPrintDialogData().GetPrintData(); (*GetPrintData()) = printerDialog.GetPrintDialogData().GetPrintData();
@@ -706,7 +706,7 @@ class wxHtmlPrintingModule: public wxModule
DECLARE_DYNAMIC_CLASS(wxHtmlPrintingModule) DECLARE_DYNAMIC_CLASS(wxHtmlPrintingModule)
public: public:
wxHtmlPrintingModule() : wxModule() {} wxHtmlPrintingModule() : wxModule() {}
bool OnInit() { return TRUE; } bool OnInit() { return true; }
void OnExit() { wxHtmlPrintout::CleanUpStatics(); } void OnExit() { wxHtmlPrintout::CleanUpStatics(); }
}; };

View File

@@ -61,7 +61,7 @@ TAG_HANDLER_BEGIN(DEFLIST, "DL,DT,DD" )
} }
m_WParser->GetContainer()->SetIndent(m_WParser->GetCharHeight(), wxHTML_INDENT_TOP); m_WParser->GetContainer()->SetIndent(m_WParser->GetCharHeight(), wxHTML_INDENT_TOP);
return TRUE; return true;
} }
else if (tag.GetName() == wxT("DT")) else if (tag.GetName() == wxT("DT"))
{ {
@@ -69,14 +69,14 @@ TAG_HANDLER_BEGIN(DEFLIST, "DL,DT,DD" )
c = m_WParser->OpenContainer(); c = m_WParser->OpenContainer();
c->SetAlignHor(wxHTML_ALIGN_LEFT); c->SetAlignHor(wxHTML_ALIGN_LEFT);
c->SetMinHeight(m_WParser->GetCharHeight()); c->SetMinHeight(m_WParser->GetCharHeight());
return FALSE; return false;
} }
else // "DD" else // "DD"
{ {
m_WParser->CloseContainer(); m_WParser->CloseContainer();
c = m_WParser->OpenContainer(); c = m_WParser->OpenContainer();
c->SetIndent(5 * m_WParser->GetCharWidth(), wxHTML_INDENT_LEFT); c->SetIndent(5 * m_WParser->GetCharWidth(), wxHTML_INDENT_LEFT);
return FALSE; return false;
} }
} }

View File

@@ -84,7 +84,7 @@ TAG_HANDLER_BEGIN(FONT, "FONT" )
while (tk.HasMoreTokens()) while (tk.HasMoreTokens())
{ {
if ((index = m_Faces.Index(tk.GetNextToken(), FALSE)) != wxNOT_FOUND) if ((index = m_Faces.Index(tk.GetNextToken(), false)) != wxNOT_FOUND)
{ {
m_WParser->SetFontFace(m_Faces[index]); m_WParser->SetFontFace(m_Faces[index]);
m_WParser->GetContainer()->InsertCell(new wxHtmlFontCell(m_WParser->CreateCurrentFont())); m_WParser->GetContainer()->InsertCell(new wxHtmlFontCell(m_WParser->CreateCurrentFont()));
@@ -110,7 +110,7 @@ TAG_HANDLER_BEGIN(FONT, "FONT" )
m_WParser->SetActualColor(oldclr); m_WParser->SetActualColor(oldclr);
m_WParser->GetContainer()->InsertCell(new wxHtmlColourCell(oldclr)); m_WParser->GetContainer()->InsertCell(new wxHtmlColourCell(oldclr));
} }
return TRUE; return true;
} }
TAG_HANDLER_END(FONT) TAG_HANDLER_END(FONT)
@@ -124,7 +124,7 @@ TAG_HANDLER_BEGIN(FACES_U, "U,STRIKE")
{ {
int underlined = m_WParser->GetFontUnderlined(); int underlined = m_WParser->GetFontUnderlined();
m_WParser->SetFontUnderlined(TRUE); m_WParser->SetFontUnderlined(true);
m_WParser->GetContainer()->InsertCell( m_WParser->GetContainer()->InsertCell(
new wxHtmlFontCell(m_WParser->CreateCurrentFont())); new wxHtmlFontCell(m_WParser->CreateCurrentFont()));
@@ -133,7 +133,7 @@ TAG_HANDLER_BEGIN(FACES_U, "U,STRIKE")
m_WParser->SetFontUnderlined(underlined); m_WParser->SetFontUnderlined(underlined);
m_WParser->GetContainer()->InsertCell( m_WParser->GetContainer()->InsertCell(
new wxHtmlFontCell(m_WParser->CreateCurrentFont())); new wxHtmlFontCell(m_WParser->CreateCurrentFont()));
return TRUE; return true;
} }
TAG_HANDLER_END(FACES_U) TAG_HANDLER_END(FACES_U)
@@ -148,7 +148,7 @@ TAG_HANDLER_BEGIN(FACES_B, "B,STRONG")
{ {
int bold = m_WParser->GetFontBold(); int bold = m_WParser->GetFontBold();
m_WParser->SetFontBold(TRUE); m_WParser->SetFontBold(true);
m_WParser->GetContainer()->InsertCell( m_WParser->GetContainer()->InsertCell(
new wxHtmlFontCell(m_WParser->CreateCurrentFont())); new wxHtmlFontCell(m_WParser->CreateCurrentFont()));
@@ -157,7 +157,7 @@ TAG_HANDLER_BEGIN(FACES_B, "B,STRONG")
m_WParser->SetFontBold(bold); m_WParser->SetFontBold(bold);
m_WParser->GetContainer()->InsertCell( m_WParser->GetContainer()->InsertCell(
new wxHtmlFontCell(m_WParser->CreateCurrentFont())); new wxHtmlFontCell(m_WParser->CreateCurrentFont()));
return TRUE; return true;
} }
TAG_HANDLER_END(FACES_B) TAG_HANDLER_END(FACES_B)
@@ -172,7 +172,7 @@ TAG_HANDLER_BEGIN(FACES_I, "I,EM,CITE,ADDRESS")
{ {
int italic = m_WParser->GetFontItalic(); int italic = m_WParser->GetFontItalic();
m_WParser->SetFontItalic(TRUE); m_WParser->SetFontItalic(true);
m_WParser->GetContainer()->InsertCell( m_WParser->GetContainer()->InsertCell(
new wxHtmlFontCell(m_WParser->CreateCurrentFont())); new wxHtmlFontCell(m_WParser->CreateCurrentFont()));
@@ -181,7 +181,7 @@ TAG_HANDLER_BEGIN(FACES_I, "I,EM,CITE,ADDRESS")
m_WParser->SetFontItalic(italic); m_WParser->SetFontItalic(italic);
m_WParser->GetContainer()->InsertCell( m_WParser->GetContainer()->InsertCell(
new wxHtmlFontCell(m_WParser->CreateCurrentFont())); new wxHtmlFontCell(m_WParser->CreateCurrentFont()));
return TRUE; return true;
} }
TAG_HANDLER_END(FACES_I) TAG_HANDLER_END(FACES_I)
@@ -196,7 +196,7 @@ TAG_HANDLER_BEGIN(FACES_TT, "TT,CODE,KBD,SAMP")
{ {
int fixed = m_WParser->GetFontFixed(); int fixed = m_WParser->GetFontFixed();
m_WParser->SetFontFixed(TRUE); m_WParser->SetFontFixed(true);
m_WParser->GetContainer()->InsertCell( m_WParser->GetContainer()->InsertCell(
new wxHtmlFontCell(m_WParser->CreateCurrentFont())); new wxHtmlFontCell(m_WParser->CreateCurrentFont()));
@@ -205,7 +205,7 @@ TAG_HANDLER_BEGIN(FACES_TT, "TT,CODE,KBD,SAMP")
m_WParser->SetFontFixed(fixed); m_WParser->SetFontFixed(fixed);
m_WParser->GetContainer()->InsertCell( m_WParser->GetContainer()->InsertCell(
new wxHtmlFontCell(m_WParser->CreateCurrentFont())); new wxHtmlFontCell(m_WParser->CreateCurrentFont()));
return TRUE; return true;
} }
TAG_HANDLER_END(FACES_TT) TAG_HANDLER_END(FACES_TT)
@@ -229,10 +229,10 @@ TAG_HANDLER_BEGIN(Hx, "H1,H2,H3,H4,H5,H6")
old_f = m_WParser->GetFontFixed(); old_f = m_WParser->GetFontFixed();
old_al = m_WParser->GetAlign(); old_al = m_WParser->GetAlign();
m_WParser->SetFontBold(TRUE); m_WParser->SetFontBold(true);
m_WParser->SetFontItalic(FALSE); m_WParser->SetFontItalic(false);
m_WParser->SetFontUnderlined(FALSE); m_WParser->SetFontUnderlined(false);
m_WParser->SetFontFixed(FALSE); m_WParser->SetFontFixed(false);
if (tag.GetName() == wxT("H1")) if (tag.GetName() == wxT("H1"))
m_WParser->SetFontSize(7); m_WParser->SetFontSize(7);
@@ -243,16 +243,16 @@ TAG_HANDLER_BEGIN(Hx, "H1,H2,H3,H4,H5,H6")
else if (tag.GetName() == wxT("H4")) else if (tag.GetName() == wxT("H4"))
{ {
m_WParser->SetFontSize(5); m_WParser->SetFontSize(5);
m_WParser->SetFontItalic(TRUE); m_WParser->SetFontItalic(true);
m_WParser->SetFontBold(FALSE); m_WParser->SetFontBold(false);
} }
else if (tag.GetName() == wxT("H5")) else if (tag.GetName() == wxT("H5"))
m_WParser->SetFontSize(4); m_WParser->SetFontSize(4);
else if (tag.GetName() == wxT("H6")) else if (tag.GetName() == wxT("H6"))
{ {
m_WParser->SetFontSize(4); m_WParser->SetFontSize(4);
m_WParser->SetFontItalic(TRUE); m_WParser->SetFontItalic(true);
m_WParser->SetFontBold(FALSE); m_WParser->SetFontBold(false);
} }
c = m_WParser->GetContainer(); c = m_WParser->GetContainer();
@@ -285,7 +285,7 @@ TAG_HANDLER_BEGIN(Hx, "H1,H2,H3,H4,H5,H6")
c = m_WParser->GetContainer(); c = m_WParser->GetContainer();
c->SetIndent(m_WParser->GetCharHeight(), wxHTML_INDENT_TOP); c->SetIndent(m_WParser->GetCharHeight(), wxHTML_INDENT_TOP);
return TRUE; return true;
} }
TAG_HANDLER_END(Hx) TAG_HANDLER_END(Hx)
@@ -308,7 +308,7 @@ TAG_HANDLER_BEGIN(BIGSMALL, "BIG,SMALL")
m_WParser->SetFontSize(oldsize); m_WParser->SetFontSize(oldsize);
m_WParser->GetContainer()->InsertCell( m_WParser->GetContainer()->InsertCell(
new wxHtmlFontCell(m_WParser->CreateCurrentFont())); new wxHtmlFontCell(m_WParser->CreateCurrentFont()));
return TRUE; return true;
} }
TAG_HANDLER_END(BIGSMALL) TAG_HANDLER_END(BIGSMALL)

View File

@@ -98,7 +98,7 @@ TAG_HANDLER_BEGIN(HR, "HR")
m_WParser->CloseContainer(); m_WParser->CloseContainer();
m_WParser->OpenContainer(); m_WParser->OpenContainer();
return FALSE; return false;
} }
TAG_HANDLER_END(HR) TAG_HANDLER_END(HR)

View File

@@ -86,7 +86,7 @@ wxHtmlImageMapAreaCell::wxHtmlImageMapAreaCell( wxHtmlImageMapAreaCell::celltype
wxString x = incoords, y; wxString x = incoords, y;
type = t; type = t;
while ((i = x.Find( ',' )) != -1) while ((i = x.Find( ',' )) != wxNOT_FOUND)
{ {
coords.Add( (int)(pixel_scale * (double)wxAtoi( x.Left( i ).c_str())) ); coords.Add( (int)(pixel_scale * (double)wxAtoi( x.Left( i ).c_str())) );
x = x.Mid( i + 1 ); x = x.Mid( i + 1 );
@@ -291,7 +291,7 @@ class wxHtmlImageCell : public wxHtmlCell
{ {
public: public:
wxHtmlImageCell(wxWindow *window, wxHtmlImageCell(wxWindow *window,
wxFSFile *input, int w = -1, int h = -1, wxFSFile *input, int w = wxDefaultCoord, int h = wxDefaultCoord,
double scale = 1.0, int align = wxHTML_ALIGN_BOTTOM, double scale = 1.0, int align = wxHTML_ALIGN_BOTTOM,
const wxString& mapname = wxEmptyString); const wxString& mapname = wxEmptyString);
~wxHtmlImageCell(); ~wxHtmlImageCell();
@@ -351,17 +351,17 @@ wxHtmlImageCell::wxHtmlImageCell(wxWindow *window, wxFSFile *input,
{ {
m_window = window ? wxStaticCast(window, wxScrolledWindow) : NULL; m_window = window ? wxStaticCast(window, wxScrolledWindow) : NULL;
m_scale = scale; m_scale = scale;
m_showFrame = FALSE; m_showFrame = false;
m_bitmap = NULL; m_bitmap = NULL;
m_bmpW = w; m_bmpW = w;
m_bmpH = h; m_bmpH = h;
m_imageMap = NULL; m_imageMap = NULL;
m_mapName = mapname; m_mapName = mapname;
SetCanLiveOnPagebreak(FALSE); SetCanLiveOnPagebreak(false);
#if wxUSE_GIF && wxUSE_TIMER #if wxUSE_GIF && wxUSE_TIMER
m_gifDecoder = NULL; m_gifDecoder = NULL;
m_gifTimer = NULL; m_gifTimer = NULL;
m_physX = m_physY = -1; m_physX = m_physY = wxDefaultCoord;
#endif #endif
if ( m_bmpW && m_bmpH ) if ( m_bmpW && m_bmpH )
@@ -372,25 +372,25 @@ wxHtmlImageCell::wxHtmlImageCell(wxWindow *window, wxFSFile *input,
if ( s ) if ( s )
{ {
bool readImg = TRUE; bool readImg = true;
#if wxUSE_GIF && wxUSE_TIMER #if wxUSE_GIF && wxUSE_TIMER
if ( (input->GetLocation().Matches(wxT("*.gif")) || if ( (input->GetLocation().Matches(wxT("*.gif")) ||
input->GetLocation().Matches(wxT("*.GIF"))) && m_window ) input->GetLocation().Matches(wxT("*.GIF"))) && m_window )
{ {
m_gifDecoder = new wxGIFDecoder(s, TRUE); m_gifDecoder = new wxGIFDecoder(s, true);
if ( m_gifDecoder->ReadGIF() == wxGIF_OK ) if ( m_gifDecoder->ReadGIF() == wxGIF_OK )
{ {
wxImage img; wxImage img;
if ( m_gifDecoder->ConvertToImage(&img) ) if ( m_gifDecoder->ConvertToImage(&img) )
SetImage(img); SetImage(img);
readImg = FALSE; readImg = false;
if ( m_gifDecoder->IsAnimation() ) if ( m_gifDecoder->IsAnimation() )
{ {
m_gifTimer = new wxGIFTimer(this); m_gifTimer = new wxGIFTimer(this);
m_gifTimer->Start(m_gifDecoder->GetDelay(), TRUE); m_gifTimer->Start(m_gifDecoder->GetDelay(), true);
} }
else else
{ {
@@ -414,16 +414,16 @@ wxHtmlImageCell::wxHtmlImageCell(wxWindow *window, wxFSFile *input,
} }
else // input==NULL, use "broken image" bitmap else // input==NULL, use "broken image" bitmap
{ {
if ( m_bmpW == -1 && m_bmpH == -1 ) if ( m_bmpW == wxDefaultCoord && m_bmpH == wxDefaultCoord )
{ {
m_bmpW = 29; m_bmpW = 29;
m_bmpH = 31; m_bmpH = 31;
} }
else else
{ {
m_showFrame = TRUE; m_showFrame = true;
if ( m_bmpW == -1 ) m_bmpW = 31; if ( m_bmpW == wxDefaultCoord ) m_bmpW = 31;
if ( m_bmpH == -1 ) m_bmpH = 33; if ( m_bmpH == wxDefaultCoord ) m_bmpH = 33;
} }
m_bitmap = m_bitmap =
new wxBitmap(wxArtProvider::GetBitmap(wxART_MISSING_IMAGE)); new wxBitmap(wxArtProvider::GetBitmap(wxART_MISSING_IMAGE));
@@ -459,9 +459,9 @@ void wxHtmlImageCell::SetImage(const wxImage& img)
ww = img.GetWidth(); ww = img.GetWidth();
hh = img.GetHeight(); hh = img.GetHeight();
if ( m_bmpW == -1 ) if ( m_bmpW == wxDefaultCoord )
m_bmpW = ww; m_bmpW = ww;
if ( m_bmpH == -1 ) if ( m_bmpH == wxDefaultCoord )
m_bmpH = hh; m_bmpH = hh;
// Only scale the bitmap at the rendering stage, // Only scale the bitmap at the rendering stage,
@@ -483,9 +483,9 @@ void wxHtmlImageCell::AdvanceAnimation(wxTimer *timer)
{ {
wxImage img; wxImage img;
m_gifDecoder->GoNextFrame(TRUE); m_gifDecoder->GoNextFrame(true);
if ( m_physX == -1 ) if ( m_physX == wxDefaultCoord )
{ {
m_physX = m_physY = 0; m_physX = m_physY = 0;
for (wxHtmlCell *cell = this; cell; cell = cell->GetParent()) for (wxHtmlCell *cell = this; cell; cell = cell->GetParent())
@@ -510,20 +510,20 @@ void wxHtmlImageCell::AdvanceAnimation(wxTimer *timer)
wxMemoryDC dc; wxMemoryDC dc;
dc.SelectObject(*m_bitmap); dc.SelectObject(*m_bitmap);
dc.DrawBitmap(bmp, m_gifDecoder->GetLeft(), m_gifDecoder->GetTop(), dc.DrawBitmap(bmp, m_gifDecoder->GetLeft(), m_gifDecoder->GetTop(),
TRUE /* use mask */); true /* use mask */);
} }
else else
SetImage(img); SetImage(img);
m_window->Refresh(img.HasMask(), &rect); m_window->Refresh(img.HasMask(), &rect);
} }
timer->Start(m_gifDecoder->GetDelay(), TRUE); timer->Start(m_gifDecoder->GetDelay(), true);
} }
void wxHtmlImageCell::Layout(int w) void wxHtmlImageCell::Layout(int w)
{ {
wxHtmlCell::Layout(w); wxHtmlCell::Layout(w);
m_physX = m_physY = -1; m_physX = m_physY = wxDefaultCoord;
} }
#endif #endif
@@ -565,7 +565,7 @@ void wxHtmlImageCell::Draw(wxDC& dc, int x, int y,
dc.SetUserScale(us_x * m_scale * imageScaleX, us_y * m_scale * imageScaleY); dc.SetUserScale(us_x * m_scale * imageScaleX, us_y * m_scale * imageScaleY);
dc.DrawBitmap(*m_bitmap, (int) ((x + m_PosX) / (m_scale*imageScaleX)), dc.DrawBitmap(*m_bitmap, (int) ((x + m_PosX) / (m_scale*imageScaleX)),
(int) ((y + m_PosY) / (m_scale*imageScaleY)), TRUE); (int) ((y + m_PosY) / (m_scale*imageScaleY)), true);
dc.SetUserScale(us_x, us_y); dc.SetUserScale(us_x, us_y);
} }
} }
@@ -615,7 +615,7 @@ TAG_HANDLER_BEGIN(IMG, "IMG,MAP,AREA")
{ {
if (tag.HasParam(wxT("SRC"))) if (tag.HasParam(wxT("SRC")))
{ {
int w = -1, h = -1; int w = wxDefaultCoord, h = wxDefaultCoord;
int al; int al;
wxFSFile *str; wxFSFile *str;
wxString tmp = tag.GetParam(wxT("SRC")); wxString tmp = tag.GetParam(wxT("SRC"));
@@ -706,7 +706,7 @@ TAG_HANDLER_BEGIN(IMG, "IMG,MAP,AREA")
} }
} }
return FALSE; return false;
} }
TAG_HANDLER_END(IMG) TAG_HANDLER_END(IMG)

View File

@@ -97,16 +97,16 @@ bool wxHtmlPageBreakCell::AdjustPagebreak(int* pagebreak, int* known_pagebreaks,
// When we are counting pages, 'known_pagebreaks' is non-NULL. // When we are counting pages, 'known_pagebreaks' is non-NULL.
// That's the only time we change 'pagebreak'. Otherwise, pages // That's the only time we change 'pagebreak'. Otherwise, pages
// were already counted, 'known_pagebreaks' is NULL, and we don't // were already counted, 'known_pagebreaks' is NULL, and we don't
// do anything except return FALSE. // do anything except return false.
// //
// We also simply return FALSE if the 'pagebreak' argument is // We also simply return false if the 'pagebreak' argument is
// less than (vertically above) or the same as the current // less than (vertically above) or the same as the current
// vertical position. Otherwise we'd be setting a pagebreak above // vertical position. Otherwise we'd be setting a pagebreak above
// the current cell, which is incorrect, or duplicating a // the current cell, which is incorrect, or duplicating a
// pagebreak that has already been set. // pagebreak that has already been set.
if(NULL == known_pagebreaks || *pagebreak <= m_PosY) if(NULL == known_pagebreaks || *pagebreak <= m_PosY)
{ {
return FALSE; return false;
} }
// m_PosY is only the vertical offset from the parent. The pagebreak // m_PosY is only the vertical offset from the parent. The pagebreak
@@ -126,12 +126,12 @@ bool wxHtmlPageBreakCell::AdjustPagebreak(int* pagebreak, int* known_pagebreaks,
// Add a pagebreak only if there isn't one already set here. // Add a pagebreak only if there isn't one already set here.
if(NULL != where) if(NULL != where)
{ {
return FALSE; return false;
} }
else else
{ {
*pagebreak = m_PosY; *pagebreak = m_PosY;
return TRUE; return true;
} }
} }
@@ -147,7 +147,7 @@ TAG_HANDLER_BEGIN(P, "P")
} }
m_WParser->GetContainer()->SetIndent(m_WParser->GetCharHeight(), wxHTML_INDENT_TOP); m_WParser->GetContainer()->SetIndent(m_WParser->GetCharHeight(), wxHTML_INDENT_TOP);
m_WParser->GetContainer()->SetAlign(tag); m_WParser->GetContainer()->SetAlign(tag);
return FALSE; return false;
} }
TAG_HANDLER_END(P) TAG_HANDLER_END(P)
@@ -167,7 +167,7 @@ TAG_HANDLER_BEGIN(BR, "BR")
c->SetAlignHor(al); c->SetAlignHor(al);
c->SetAlign(tag); c->SetAlign(tag);
c->SetMinHeight(m_WParser->GetCharHeight()); c->SetMinHeight(m_WParser->GetCharHeight());
return FALSE; return false;
} }
TAG_HANDLER_END(BR) TAG_HANDLER_END(BR)
@@ -204,9 +204,9 @@ TAG_HANDLER_BEGIN(CENTER, "CENTER")
else else
c->SetAlignHor(old); c->SetAlignHor(old);
return TRUE; return true;
} }
else return FALSE; else return false;
} }
TAG_HANDLER_END(CENTER) TAG_HANDLER_END(CENTER)
@@ -220,18 +220,18 @@ TAG_HANDLER_BEGIN(DIV, "DIV")
{ {
if(tag.HasParam(wxT("STYLE"))) if(tag.HasParam(wxT("STYLE")))
{ {
if(tag.GetParam(wxT("STYLE")).IsSameAs(wxT("PAGE-BREAK-BEFORE:ALWAYS"), FALSE)) if(tag.GetParam(wxT("STYLE")).IsSameAs(wxT("PAGE-BREAK-BEFORE:ALWAYS"), false))
{ {
m_WParser->CloseContainer(); m_WParser->CloseContainer();
m_WParser->OpenContainer()->InsertCell(new wxHtmlPageBreakCell); m_WParser->OpenContainer()->InsertCell(new wxHtmlPageBreakCell);
m_WParser->CloseContainer(); m_WParser->CloseContainer();
m_WParser->OpenContainer(); m_WParser->OpenContainer();
return FALSE; return false;
} }
else else
{ {
// Treat other STYLE parameters here when they're supported. // Treat other STYLE parameters here when they're supported.
return FALSE; return false;
} }
} }
else if(tag.HasParam(wxT("ALIGN"))) else if(tag.HasParam(wxT("ALIGN")))
@@ -306,7 +306,7 @@ TAG_HANDLER_BEGIN(TITLE, "TITLE")
wfr->OnSetTitle(title); wfr->OnSetTitle(title);
} }
} }
return TRUE; return true;
} }
TAG_HANDLER_END(TITLE) TAG_HANDLER_END(TITLE)
@@ -337,7 +337,7 @@ TAG_HANDLER_BEGIN(BODY, "BODY")
if (m_WParser->GetWindow() != NULL) if (m_WParser->GetWindow() != NULL)
m_WParser->GetWindow()->SetBackgroundColour(clr); m_WParser->GetWindow()->SetBackgroundColour(clr);
} }
return FALSE; return false;
} }
TAG_HANDLER_END(BODY) TAG_HANDLER_END(BODY)
@@ -366,7 +366,7 @@ TAG_HANDLER_BEGIN(BLOCKQUOTE, "BLOCKQUOTE")
c->SetIndent(m_WParser->GetCharHeight(), wxHTML_INDENT_BOTTOM); c->SetIndent(m_WParser->GetCharHeight(), wxHTML_INDENT_BOTTOM);
m_WParser->CloseContainer(); m_WParser->CloseContainer();
m_WParser->OpenContainer(); m_WParser->OpenContainer();
return TRUE; return true;
} }
TAG_HANDLER_END(BLOCKQUOTE) TAG_HANDLER_END(BLOCKQUOTE)

View File

@@ -81,7 +81,7 @@ TAG_HANDLER_BEGIN(A, "A")
if (tag.HasParam( wxT("TARGET") )) target = tag.GetParam( wxT("TARGET") ); if (tag.HasParam( wxT("TARGET") )) target = tag.GetParam( wxT("TARGET") );
m_WParser->SetActualColor(m_WParser->GetLinkColor()); m_WParser->SetActualColor(m_WParser->GetLinkColor());
m_WParser->GetContainer()->InsertCell(new wxHtmlColourCell(m_WParser->GetLinkColor())); m_WParser->GetContainer()->InsertCell(new wxHtmlColourCell(m_WParser->GetLinkColor()));
m_WParser->SetFontUnderlined(TRUE); m_WParser->SetFontUnderlined(true);
m_WParser->GetContainer()->InsertCell(new wxHtmlFontCell(m_WParser->CreateCurrentFont())); m_WParser->GetContainer()->InsertCell(new wxHtmlFontCell(m_WParser->CreateCurrentFont()));
m_WParser->SetLink(wxHtmlLinkInfo(name, target)); m_WParser->SetLink(wxHtmlLinkInfo(name, target));
@@ -93,9 +93,9 @@ TAG_HANDLER_BEGIN(A, "A")
m_WParser->SetActualColor(oldclr); m_WParser->SetActualColor(oldclr);
m_WParser->GetContainer()->InsertCell(new wxHtmlColourCell(oldclr)); m_WParser->GetContainer()->InsertCell(new wxHtmlColourCell(oldclr));
return TRUE; return true;
} }
else return FALSE; else return false;
} }
TAG_HANDLER_END(A) TAG_HANDLER_END(A)

View File

@@ -266,7 +266,7 @@ TAG_HANDLER_BEGIN(OLULLI, "OL,UL,LI")
m_Numbering = oldnum; m_Numbering = oldnum;
m_List = oldList; m_List = oldList;
return TRUE; return true;
} }
return false; return false;

View File

@@ -94,10 +94,10 @@ TAG_HANDLER_BEGIN(PRE, "PRE")
fsize = m_WParser->GetFontSize(); fsize = m_WParser->GetFontSize();
c = m_WParser->GetContainer(); c = m_WParser->GetContainer();
m_WParser->SetFontUnderlined(FALSE); m_WParser->SetFontUnderlined(false);
m_WParser->SetFontBold(FALSE); m_WParser->SetFontBold(false);
m_WParser->SetFontItalic(FALSE); m_WParser->SetFontItalic(false);
m_WParser->SetFontFixed(TRUE); m_WParser->SetFontFixed(true);
m_WParser->SetFontSize(3); m_WParser->SetFontSize(3);
c->InsertCell(new wxHtmlFontCell(m_WParser->CreateCurrentFont())); c->InsertCell(new wxHtmlFontCell(m_WParser->CreateCurrentFont()));
@@ -128,7 +128,7 @@ TAG_HANDLER_BEGIN(PRE, "PRE")
m_WParser->SetFontSize(fsize); m_WParser->SetFontSize(fsize);
c->InsertCell(new wxHtmlFontCell(m_WParser->CreateCurrentFont())); c->InsertCell(new wxHtmlFontCell(m_WParser->CreateCurrentFont()));
return TRUE; return true;
} }
TAG_HANDLER_END(PRE) TAG_HANDLER_END(PRE)

View File

@@ -37,7 +37,7 @@ TAG_HANDLER_BEGIN(STYLE, "STYLE")
{ {
// VS: Ignore styles for now. We must have this handler present, // VS: Ignore styles for now. We must have this handler present,
// because CSS style text would be rendered verbatim otherwise // because CSS style text would be rendered verbatim otherwise
return TRUE; return true;
} }
TAG_HANDLER_END(STYLE) TAG_HANDLER_END(STYLE)

View File

@@ -350,7 +350,7 @@ void wxHtmlTableCell::AddCell(wxHtmlContainerCell *cell, const wxHtmlTag& tag)
void wxHtmlTableCell::ComputeMinMaxWidths() void wxHtmlTableCell::ComputeMinMaxWidths()
{ {
if (m_NumCols == 0 || m_ColsInfo[0].minWidth != -1) return; if (m_NumCols == 0 || m_ColsInfo[0].minWidth != wxDefaultCoord) return;
m_MaxTotalWidth = 0; m_MaxTotalWidth = 0;
int percentage = 0; int percentage = 0;
@@ -700,7 +700,7 @@ TAG_HANDLER_BEGIN(TABLE, "TABLE,TR,TD,TH")
m_WParser->CloseContainer(); m_WParser->CloseContainer();
m_Table = oldt; m_Table = oldt;
return TRUE; return true;
} }
@@ -744,7 +744,7 @@ TAG_HANDLER_BEGIN(TABLE, "TABLE,TR,TD,TH")
m_WParser->OpenContainer(); m_WParser->OpenContainer();
} }
} }
return FALSE; return false;
} }
TAG_HANDLER_END(TABLE) TAG_HANDLER_END(TABLE)

View File

@@ -50,7 +50,7 @@ wxHtmlWinParser::wxHtmlWinParser(wxHtmlWindow *wnd) : wxHtmlParser()
m_Container = NULL; m_Container = NULL;
m_DC = NULL; m_DC = NULL;
m_CharHeight = m_CharWidth = 0; m_CharHeight = m_CharWidth = 0;
m_UseLink = FALSE; m_UseLink = false;
#if !wxUSE_UNICODE #if !wxUSE_UNICODE
m_EncConv = NULL; m_EncConv = NULL;
m_InputEnc = wxFONTENCODING_ISO8859_1; m_InputEnc = wxFONTENCODING_ISO8859_1;
@@ -191,12 +191,12 @@ void wxHtmlWinParser::InitParser(const wxString& source)
of differences under X and win of differences under X and win
*/ */
m_UseLink = FALSE; m_UseLink = false;
m_Link = wxHtmlLinkInfo( wxT(""), wxT("") ); m_Link = wxHtmlLinkInfo( wxT(""), wxT("") );
m_LinkColor.Set(0, 0, 0xFF); m_LinkColor.Set(0, 0, 0xFF);
m_ActualColor.Set(0, 0, 0); m_ActualColor.Set(0, 0, 0);
m_Align = wxHTML_ALIGN_LEFT; m_Align = wxHTML_ALIGN_LEFT;
m_tmpLastWasSpace = FALSE; m_tmpLastWasSpace = false;
m_lastWordCell = NULL; m_lastWordCell = NULL;
OpenContainer(); OpenContainer();
@@ -329,7 +329,7 @@ void wxHtmlWinParser::AddText(const wxChar* txt)
m_Container->InsertCell(c); m_Container->InsertCell(c);
((wxHtmlWordCell*)c)->SetPreviousWord(m_lastWordCell); ((wxHtmlWordCell*)c)->SetPreviousWord(m_lastWordCell);
m_lastWordCell = (wxHtmlWordCell*)c; m_lastWordCell = (wxHtmlWordCell*)c;
m_tmpLastWasSpace = TRUE; m_tmpLastWasSpace = true;
} }
} }
@@ -350,7 +350,7 @@ void wxHtmlWinParser::AddText(const wxChar* txt)
m_Container->InsertCell(c); m_Container->InsertCell(c);
((wxHtmlWordCell*)c)->SetPreviousWord(m_lastWordCell); ((wxHtmlWordCell*)c)->SetPreviousWord(m_lastWordCell);
m_lastWordCell = (wxHtmlWordCell*)c; m_lastWordCell = (wxHtmlWordCell*)c;
m_tmpLastWasSpace = FALSE; m_tmpLastWasSpace = false;
} }
} }
@@ -360,7 +360,7 @@ wxHtmlContainerCell* wxHtmlWinParser::OpenContainer()
{ {
m_Container = new wxHtmlContainerCell(m_Container); m_Container = new wxHtmlContainerCell(m_Container);
m_Container->SetAlignHor(m_Align); m_Container->SetAlignHor(m_Align);
m_tmpLastWasSpace = TRUE; m_tmpLastWasSpace = true;
/* to avoid space being first character in paragraph */ /* to avoid space being first character in paragraph */
return m_Container; return m_Container;
} }
@@ -369,7 +369,7 @@ wxHtmlContainerCell* wxHtmlWinParser::OpenContainer()
wxHtmlContainerCell* wxHtmlWinParser::SetContainer(wxHtmlContainerCell *c) wxHtmlContainerCell* wxHtmlWinParser::SetContainer(wxHtmlContainerCell *c)
{ {
m_tmpLastWasSpace = TRUE; m_tmpLastWasSpace = true;
/* to avoid space being first character in paragraph */ /* to avoid space being first character in paragraph */
return m_Container = c; return m_Container = c;
} }
@@ -425,7 +425,7 @@ wxFont* wxHtmlWinParser::CreateCurrentFont()
ff ? wxMODERN : wxSWISS, ff ? wxMODERN : wxSWISS,
fi ? wxITALIC : wxNORMAL, fi ? wxITALIC : wxNORMAL,
fb ? wxBOLD : wxNORMAL, fb ? wxBOLD : wxNORMAL,
fu ? TRUE : FALSE, face fu ? true : false, face
#if wxUSE_UNICODE #if wxUSE_UNICODE
); );
#else #else
@@ -481,15 +481,15 @@ void wxHtmlWinParser::SetInputEncoding(wxFontEncoding enc)
m_OutputEnc = enc; m_OutputEnc = enc;
// alternatives? // alternatives?
else if (wxFontMapper::Get()->GetAltForEncoding(enc, &altnorm, m_FontFaceNormal, FALSE) && else if (wxFontMapper::Get()->GetAltForEncoding(enc, &altnorm, m_FontFaceNormal, false) &&
wxFontMapper::Get()->GetAltForEncoding(enc, &altfix, m_FontFaceFixed, FALSE) && wxFontMapper::Get()->GetAltForEncoding(enc, &altfix, m_FontFaceFixed, false) &&
altnorm == altfix) altnorm == altfix)
m_OutputEnc = altnorm; m_OutputEnc = altnorm;
// at least normal face? // at least normal face?
else if (availnorm) else if (availnorm)
m_OutputEnc = enc; m_OutputEnc = enc;
else if (wxFontMapper::Get()->GetAltForEncoding(enc, &altnorm, m_FontFaceNormal, FALSE)) else if (wxFontMapper::Get()->GetAltForEncoding(enc, &altnorm, m_FontFaceNormal, false))
m_OutputEnc = altnorm; m_OutputEnc = altnorm;
else else
@@ -550,7 +550,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxHtmlTagsModule, wxModule)
bool wxHtmlTagsModule::OnInit() bool wxHtmlTagsModule::OnInit()
{ {
wxHtmlWinParser::AddModule(this); wxHtmlWinParser::AddModule(this);
return TRUE; return true;
} }
void wxHtmlTagsModule::OnExit() void wxHtmlTagsModule::OnExit()