wxExtHelpController::wxExtHelpController(void)
{
- m_MapList = NULL;
+ m_MapList = (wxList*) NULL;
m_BrowserName = WXEXTHELP_DEFAULTBROWSER;
m_BrowserIsNetscape = WXEXTHELP_DEFAULTBROWSER_IS_NETSCAPE;
m_NumOfEntries = 0;
node = m_MapList->First();
}
delete m_MapList;
- m_MapList = NULL;
+ m_MapList = (wxList*) NULL;
}
}
bool
-wxExtHelpController::LoadFile(const wxString& ifile = "")
+wxExtHelpController::LoadFile(const wxString& ifile)
{
wxString mapFile, file, url, doc;
int id,i,len;
file = ifile;
if(! wxIsAbsolutePath(file))
{
- file = wxGetWorkingDirectory();
+ char* f = wxGetWorkingDirectory();
+ file = f;
+ delete[] f; // wxGetWorkingDirectory returns new memory
file << WXEXTHELP_SEPARATOR << ifile;
}
else
file = ifile;
if(! wxDirExists(file))
- return false;
+ return FALSE;
mapFile << file << WXEXTHELP_SEPARATOR << WXEXTHELP_MAPFILE;
}
mapFile = m_MapFile;
if(! wxFileExists(mapFile))
- return false;
+ return FALSE;
DeleteList();
m_MapList = new wxList;
FILE *input = fopen(mapFile.c_str(),"rt");
if(! input)
- return false;
+ return FALSE;
do
{
if(fgets(buffer,WXEXTHELP_BUFLEN,input) && *buffer != WXEXTHELP_COMMENTCHAR)
fclose(input);
m_MapFile = file; // now it's valid
- return true;
+ return TRUE;
}
bool
<< WXEXTHELP_SEPARATOR << relativeURL << ")";
success = wxExecute(command);
if(success != 0 ) // returns PID on success
- return true;
+ return TRUE;
}
}
command = m_BrowserName;
wxExtHelpController::DisplayContents(void)
{
if(! m_NumOfEntries)
- return false;
+ return FALSE;
wxBusyCursor b; // display a busy cursor
return KeywordSearch("");
}
wxExtHelpController::DisplaySection(int sectionNo)
{
if(! m_NumOfEntries)
- return false;
+ return FALSE;
wxBusyCursor b; // display a busy cursor
wxNode *node = m_MapList->First();
return CallBrowser(entry->url);
node = node->Next();
}
- return false;
+ return FALSE;
}
bool
wxExtHelpController::KeywordSearch(const wxString& k)
{
if(! m_NumOfEntries)
- return false;
+ return FALSE;
wxBusyCursor b; // display a busy cursor
wxString *choices = new wxString[m_NumOfEntries];
else if(idx == 0)
{
wxMessageBox(_("No entries found."));
- rc = false;
+ rc = FALSE;
}
else
{
if(idx != -1)
rc = CallBrowser(urls[idx]);
else
- rc = false;
+ rc = FALSE;
}
delete[] urls;
delete[] choices;
bool
wxExtHelpController::Quit(void)
{
- return true;
+ return TRUE;
}
void