summaryrefslogtreecommitdiffstats
path: root/pytquic3/form.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'pytquic3/form.cpp')
-rw-r--r--pytquic3/form.cpp58
1 files changed, 0 insertions, 58 deletions
diff --git a/pytquic3/form.cpp b/pytquic3/form.cpp
index e5912f1..0d1255a 100644
--- a/pytquic3/form.cpp
+++ b/pytquic3/form.cpp
@@ -30,13 +30,8 @@
#define NO_STATIC_COLORS
#include <globaldefs.h>
-#if TQT_VERSION < 0x030100
-#include <zlib.h>
-#endif
-
static TQByteArray unzipXPM( TQString data, ulong& length )
{
-#if TQT_VERSION >= 0x030100
const int lengthOffset = 4;
int baSize = data.length() / 2 + lengthOffset;
uchar *ba = new uchar[ baSize ];
@@ -64,41 +59,6 @@ static TQByteArray unzipXPM( TQString data, ulong& length )
TQByteArray baunzip = tqUncompress( ba, baSize );
delete[] ba;
return baunzip;
-#else
- uchar *ba = new uchar[ data.length() / 2 ];
- for ( int i = 0; i < (int)data.length() / 2; ++i ) {
- char h = data[ 2 * i ].latin1();
- char l = data[ 2 * i + 1 ].latin1();
- uchar r = 0;
- if ( h <= '9' )
- r += h - '0';
- else
- r += h - 'a' + 10;
- r = r << 4;
- if ( l <= '9' )
- r += l - '0';
- else
- r += l - 'a' + 10;
- ba[ i ] = r;
- }
- // I'm not sure this makes sense. Why couldn't the compressed data be
- // less than 20% of the original data? Maybe it's enough to trust the
- // `length' passed as an argument. Quoting the zlib header:
- // Upon entry, destLen is the total size of the destination
- // buffer, which must be large enough to hold the entire
- // uncompressed data. (The size of the uncompressed data must
- // have been saved previously by the compressor and transmitted
- // to the decompressor by some mechanism outside the scope of
- // this compression library.)
- // Which is the role of `length'. On the other hand this could prevent
- // crashes in some cases of slightly corrupt UIC files.
- if ( length < data.length() * 5 )
- length = data.length() * 5;
- TQByteArray baunzip( length );
- ::uncompress( (uchar*) baunzip.data(), &length, ba, data.length()/2 );
- delete[] ba;
- return baunzip;
-#endif
}
@@ -395,25 +355,7 @@ void Uic::createFormImpl( const TQDomElement &e )
}
out << endl;
} else if ( externPixmaps ) {
-#if TQT_VERSION >= 0x030100
pixmapLoaderFunction = "TQPixmap.fromMimeSource";
-#else
- out << indent << "def uic_load_pixmap_" << objName << "(name):" << endl;
- ++indent;
- out << indent << "pix = TQPixmap()" << endl;
- out << indent << "m = TQMimeSourceFactory.defaultFactory().data(name)" << endl;
- out << endl;
- out << indent << "if m:" << endl;
- ++indent;
- out << indent << "TQImageDrag.decode(m,pix)" << endl;
- --indent;
- out << endl;
- out << indent << "return pix" << endl;
- --indent;
- out << endl;
- out << endl;
- pixmapLoaderFunction = "uic_load_pixmap_" + objName;
-#endif
}