#include "wx/busyinfo.h"
#include "wx/encconv.h"
#include "wx/fontmap.h"
+#include "wx/log.h"
#include "wx/html/htmlpars.h"
#include "wx/html/htmldefs.h"
handler -> WriteOut(m_Contents, m_ContentsCnt);
delete[] buf;
}
+ else
+ wxLogError(_("Cannot open contents file: %s"), contentsfile.mb_str());
f = ( indexfile.IsEmpty() ? 0 : fsys.OpenFile(indexfile) );
if (f) {
handler -> WriteOut(m_Index, m_IndexCnt);
delete[] buf;
}
+ else
+ wxLogError(_("Cannot open index file: %s"), indexfile.mb_str());
return TRUE;
}
f -> Read(&x, sizeof(x));
version = wxINT32_SWAP_ON_BE(x);
- if (version != CURRENT_CACHED_BOOK_VERSION) return FALSE;
+ if (version != CURRENT_CACHED_BOOK_VERSION)
+ {
+ wxLogError(_("Incorrect version of HTML help book"));
+ return FALSE;
// NOTE: when adding new version, please ensure backward compatibility!
-
+ }
+
/* load contents : */
f -> Read(&x, sizeof(x));
else bookFull = wxGetCwd() + "/" + book;
fi = fsys.OpenFile(bookFull);
- if (fi == NULL) return FALSE;
+ if (fi == NULL)
+ {
+ wxLogError(_("Cannot open HTML help book: %s"), bookFull.mb_str());
+ return FALSE;
+ }
fsys.ChangePathTo(bookFull);
s = fi -> GetStream();
sz = s -> GetSize();
char *src;
wxString doc;
- if (s == NULL) return wxEmptyString;
+ if (s == NULL)
+ {
+ wxLogError(_("Cannot open HTML document: %s"), file.GetLocation().mb_str());
+ return wxEmptyString;
+ }
src = new char[s -> GetSize() + 1];
src[s -> GetSize()] = 0;
s -> Read(src, s -> GetSize());
{
wxNode *first;
- if (m_HandlersStack == NULL || (first = m_HandlersStack -> GetFirst()) == NULL) return;
+ if (m_HandlersStack == NULL ||
+ (first = m_HandlersStack -> GetFirst()) == NULL)
+ {
+ wxLogWarning(_("Warning: attempt to remove HTML tag handler from empty stack."));
+ return;
+ }
m_HandlersHash = *((wxHashTable*) first -> GetData());
m_HandlersStack -> DeleteNode(first);
}
#include "wx/html/htmlwin.h"
#include "wx/html/forcelnk.h"
+#include "wx/log.h"
//-----------------------------------------------------------------------------
if (f == NULL) {
wxString err;
- err.Printf(_("Unable to open requested location :\n\n%s"), WXSTRINGCAST location);
+ wxLogError(_("Unable to open requested HTML document: %s"), location.mb_str());
m_tmpCanDrawLocks--;
- Refresh();
- wxMessageBox(err, "Error");
SetCursor(*wxSTANDARD_CURSOR);
return FALSE;
bool wxHtmlWindow::ScrollToAnchor(const wxString& anchor)
{
const wxHtmlCell *c = m_Cell -> Find(wxHTML_COND_ISANCHOR, &anchor);
- if (!c) return FALSE;
+ if (!c)
+ {
+ wxLogWarning(_("HTML anchor %s does not exist."), anchor.mb_str());
+ return FALSE;
+ }
else {
int y;
switch (event.KeyCode()) {
case WXK_PAGEUP :
case WXK_PRIOR :
- Scroll(-1, sty - (2 * cliy / 3));
+ Scroll(-1, sty - (5 * cliy / 6));
break;
case WXK_PAGEDOWN :
case WXK_NEXT :
- Scroll(-1, sty + (2 * cliy / 3));
+ Scroll(-1, sty + (5 * cliy / 6));
break;
case WXK_HOME :
Scroll(-1, 0);
#include "wx/html/winpars.h"
#include "wx/html/htmlwin.h"
#include "wx/fontmap.h"
+#include "wx/log.h"
//-----------------------------------------------------------------------------
wxFONTENCODING_ISO8859_1 : m_OutputEnc,
wxCONVERT_SUBSTITUTE))
{ // total failture :-(
+ wxLogError(_("Failed to display HTML document in %s encoding"),
+ wxFontMapper::GetEncodingName(enc).mb_str());
m_InputEnc = m_OutputEnc = wxFONTENCODING_DEFAULT;
delete m_EncConv;
m_EncConv = NULL;