From 78fe0ac3d844a2d29ecd271c6549fdf30b6ed2b2 Mon Sep 17 00:00:00 2001 From: JulianSmart Date: Sun, 29 Nov 2015 19:29:04 +0000 Subject: [PATCH] Fix for breakage with multiple books --- include/wx/uri.h | 1 + src/common/uri.cpp | 11 +++++++++++ src/html/winpars.cpp | 2 +- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/include/wx/uri.h b/include/wx/uri.h index 7653fdaca4..11bbd770f6 100644 --- a/include/wx/uri.h +++ b/include/wx/uri.h @@ -107,6 +107,7 @@ public: void Resolve(const wxURI& base, int flags = wxURI_STRICT); bool IsReference() const; + bool IsRelative() const; protected: void Clear(); diff --git a/src/common/uri.cpp b/src/common/uri.cpp index c237c1dd6a..f5011f737c 100644 --- a/src/common/uri.cpp +++ b/src/common/uri.cpp @@ -313,6 +313,17 @@ bool wxURI::IsReference() const return !HasScheme() || !HasServer(); } +// --------------------------------------------------------------------------- +// IsRelative +// +// FIXME: may need refinement +// --------------------------------------------------------------------------- + +bool wxURI::IsRelative() const +{ + return !HasScheme() && !HasServer(); +} + // --------------------------------------------------------------------------- // Parse // diff --git a/src/html/winpars.cpp b/src/html/winpars.cpp index c862b9cd60..b085fdce4d 100644 --- a/src/html/winpars.cpp +++ b/src/html/winpars.cpp @@ -296,7 +296,7 @@ wxFSFile *wxHtmlWinParser::OpenURL(wxHtmlURLType type, myfullurl = current.BuildURI(); // if not absolute then ... - if( current.IsReference() ) + if( current.IsRelative() ) { wxString basepath = GetFS()->GetPath(); wxURI base(basepath);