Patch (partially back) so that images work in wxHTML.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11463 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -24,7 +24,7 @@
|
|||||||
#include "wx/module.h"
|
#include "wx/module.h"
|
||||||
#include "wx/filesys.h"
|
#include "wx/filesys.h"
|
||||||
#include "wx/mimetype.h"
|
#include "wx/mimetype.h"
|
||||||
|
#include "wx/filename.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -155,33 +155,24 @@ bool wxLocalFSHandler::CanOpen(const wxString& location)
|
|||||||
|
|
||||||
wxFSFile* wxLocalFSHandler::OpenFile(wxFileSystem& WXUNUSED(fs), const wxString& location)
|
wxFSFile* wxLocalFSHandler::OpenFile(wxFileSystem& WXUNUSED(fs), const wxString& location)
|
||||||
{
|
{
|
||||||
|
// location has Unix path separators
|
||||||
wxString right = GetRightLocation(location);
|
wxString right = GetRightLocation(location);
|
||||||
#ifdef __WXMAC__
|
wxFileName fn( right, wxPATH_UNIX );
|
||||||
if ( right[0] != '.' && right[0] != '/' && right.Find( '/' ) != wxNOT_FOUND ) {
|
|
||||||
right = "./" + right ;
|
if (!wxFileExists( fn.GetFullPath() ))
|
||||||
}
|
|
||||||
right = wxUnix2MacFilename( right ) ;
|
|
||||||
#endif
|
|
||||||
if (!wxFileExists(right))
|
|
||||||
return (wxFSFile*) NULL;
|
return (wxFSFile*) NULL;
|
||||||
|
|
||||||
return new wxFSFile(new wxFileInputStream(right),
|
return new wxFSFile(new wxFileInputStream( fn.GetFullPath() ),
|
||||||
right,
|
right,
|
||||||
GetMimeTypeFromExt(location),
|
GetMimeTypeFromExt(location),
|
||||||
GetAnchor(location),
|
GetAnchor(location),
|
||||||
wxDateTime(wxFileModificationTime(right)));
|
wxDateTime(wxFileModificationTime( fn.GetFullPath() )));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
wxString wxLocalFSHandler::FindFirst(const wxString& spec, int flags)
|
wxString wxLocalFSHandler::FindFirst(const wxString& spec, int flags)
|
||||||
{
|
{
|
||||||
wxString right = GetRightLocation(spec);
|
wxString right = GetRightLocation(spec);
|
||||||
#ifdef __WXMAC__
|
|
||||||
if ( right[0] != '.' && right[0] != '/' && right.Find( '/' ) != wxNOT_FOUND ) {
|
|
||||||
right = "./" + right ;
|
|
||||||
}
|
|
||||||
right = wxUnix2MacFilename( right ) ;
|
|
||||||
#endif
|
|
||||||
return wxFindFirstFile(right, flags);
|
return wxFindFirstFile(right, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user