projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
separated modifier keys handling in order to distinct key/up down events
[wxWidgets.git]
/
src
/
common
/
imagiff.cpp
diff --git
a/src/common/imagiff.cpp
b/src/common/imagiff.cpp
index affbd43967ac48604f8c5baeacef30be75e06ebd..e852c4f645c3f1788995a6c3d9cd428fab297f4b 100644
(file)
--- a/
src/common/imagiff.cpp
+++ b/
src/common/imagiff.cpp
@@
-230,12
+230,14
@@
int wxIFFDecoder::GetTransparentColour() const { return m_image->transparent; }
//
bool wxIFFDecoder::CanRead()
{
//
bool wxIFFDecoder::CanRead()
{
- unsigned char buf[12]
= ""
;
+ unsigned char buf[12];
- m_f->Read(buf, 12);
- m_f->SeekI(-12, wxFromCurrent);
+ if ( !m_f->Read(buf, WXSIZEOF(buf)) )
+ return FALSE;
+
+ m_f->SeekI(-(off_t)WXSIZEOF(buf), wxFromCurrent);
- return (memcmp(buf, "FORM", 4) == 0
&&
memcmp(buf+8, "ILBM", 4) == 0);
+ return (memcmp(buf, "FORM", 4) == 0
) && (
memcmp(buf+8, "ILBM", 4) == 0);
}
}
@@
-783,14
+785,9
@@
bool wxIFFHandler::SaveFile(wxImage * WXUNUSED(image),
bool wxIFFHandler::DoCanRead(wxInputStream& stream)
{
bool wxIFFHandler::DoCanRead(wxInputStream& stream)
{
- wxIFFDecoder *decod;
- bool ok;
+ wxIFFDecoder decod(&stream);
- decod = new wxIFFDecoder(&stream);
- ok = decod->CanRead();
- delete decod;
-
- return ok;
+ return decod.CanRead();
}
#endif // wxUSE_STREAMS
}
#endif // wxUSE_STREAMS