fixed enhanced metafiles loading from files

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29915 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2004-10-16 13:31:27 +00:00
parent 68e24a7b28
commit 7a295dfa5c
2 changed files with 16 additions and 1 deletions

View File

@ -61,7 +61,7 @@ public:
void SetHENHMETAFILE(WXHANDLE hMF) { Free(); m_hMF = hMF; }
protected:
void Init() { m_hMF = 0; }
void Init();
void Free();
void Assign(const wxEnhMetaFile& mf);

View File

@ -70,6 +70,21 @@ static inline const wxChar *GetMetaFileName(const wxString& fn)
// wxEnhMetaFile
// ----------------------------------------------------------------------------
void wxEnhMetaFile::Init()
{
if ( m_filename.empty() )
{
m_hMF = 0;
}
else // have valid file name, load metafile from it
{
m_hMF = GetEnhMetaFile(m_filename);
if ( !m_hMF )
wxLogSysError(_("Failed to load metafile from file \"%s\"."),
m_filename.c_str());
}
}
void wxEnhMetaFile::Assign(const wxEnhMetaFile& mf)
{
if ( &mf == this )