comparison of wxBitmapType with -1 is useless as it can never be true; assume wxBITMAP_TYPE_INVALID was meant here

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56768 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2008-11-14 23:09:04 +00:00
parent a343fe63e8
commit 62891c875f

View File

@@ -7067,10 +7067,11 @@ bool wxRichTextImage::LoadFromBlock()
/// Make block from the wxImage /// Make block from the wxImage
bool wxRichTextImage::MakeBlock() bool wxRichTextImage::MakeBlock()
{ {
if (m_imageBlock.GetImageType() == wxBITMAP_TYPE_ANY || m_imageBlock.GetImageType() == -1) wxBitmapType type = m_imageBlock.GetImageType();
m_imageBlock.SetImageType(wxBITMAP_TYPE_PNG); if ( type == wxBITMAP_TYPE_ANY || type == wxBITMAP_TYPE_INVALID )
m_imageBlock.SetImageType(type = wxBITMAP_TYPE_PNG);
m_imageBlock.MakeImageBlock(m_image, m_imageBlock.GetImageType()); m_imageBlock.MakeImageBlock(m_image, type);
return m_imageBlock.Ok(); return m_imageBlock.Ok();
} }
@@ -7416,7 +7417,7 @@ bool wxRichTextImageBlock::MakeImageBlock(const wxString& filename, wxBitmapType
wxString filenameToRead(filename); wxString filenameToRead(filename);
bool removeFile = false; bool removeFile = false;
if (imageType == -1) if (imageType == wxBITMAP_TYPE_INVALID)
return false; // Could not determine image type return false; // Could not determine image type
if ((imageType != wxBITMAP_TYPE_JPEG) && convertToJPEG) if ((imageType != wxBITMAP_TYPE_JPEG) && convertToJPEG)
@@ -7458,7 +7459,7 @@ bool wxRichTextImageBlock::MakeImageBlock(wxImage& image, wxBitmapType imageType
m_imageType = imageType; m_imageType = imageType;
image.SetOption(wxT("quality"), quality); image.SetOption(wxT("quality"), quality);
if (imageType == -1) if (imageType == wxBITMAP_TYPE_INVALID)
return false; // Could not determine image type return false; // Could not determine image type
wxString tempFile; wxString tempFile;