|
|
@ -239,7 +239,7 @@ obsoletes KPixmapIO.
|
|
|
|
xi = XGetImage( x11Display(), hd, 0, 0, w, h, AllPlanes,
|
|
|
|
xi = XGetImage( x11Display(), hd, 0, 0, w, h, AllPlanes,
|
|
|
|
mono ? XYPixmap : ZPixmap );
|
|
|
|
mono ? XYPixmap : ZPixmap );
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
Q_CHECK_PTR( xi );
|
|
|
|
TQ_CHECK_PTR( xi );
|
|
|
|
if (!xi)
|
|
|
|
if (!xi)
|
|
|
|
return image; // null image
|
|
|
|
return image; // null image
|
|
|
|
@@ -640,15 +754,31 @@ QImage QPixmap::convertToImage() const
|
|
|
|
@@ -640,15 +754,31 @@ QImage QPixmap::convertToImage() const
|
|
|
@ -350,19 +350,19 @@ obsoletes KPixmapIO.
|
|
|
|
+ else
|
|
|
|
+ else
|
|
|
|
+#endif
|
|
|
|
+#endif
|
|
|
|
xi = XCreateImage( dpy, visual, dd, ZPixmap, 0, 0, w, h, 32, 0 );
|
|
|
|
xi = XCreateImage( dpy, visual, dd, ZPixmap, 0, 0, w, h, 32, 0 );
|
|
|
|
- Q_CHECK_PTR( xi );
|
|
|
|
- TQ_CHECK_PTR( xi );
|
|
|
|
if (!xi)
|
|
|
|
if (!xi)
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
+ if( newbits == NULL )
|
|
|
|
+ if( newbits == NULL )
|
|
|
|
newbits = (uchar *)malloc( xi->bytes_per_line*h );
|
|
|
|
newbits = (uchar *)malloc( xi->bytes_per_line*h );
|
|
|
|
Q_CHECK_PTR( newbits );
|
|
|
|
TQ_CHECK_PTR( newbits );
|
|
|
|
if ( !newbits ) // no memory
|
|
|
|
if ( !newbits ) // no memory
|
|
|
|
@@ -1323,6 +1489,7 @@ bool QPixmap::convertFromImage( const QI
|
|
|
|
@@ -1323,6 +1489,7 @@ bool QPixmap::convertFromImage( const QI
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
newbits = (uchar *)malloc( nbytes ); // copy image into newbits
|
|
|
|
newbits = (uchar *)malloc( nbytes ); // copy image into newbits
|
|
|
|
+ newbits_size = nbytes;
|
|
|
|
+ newbits_size = nbytes;
|
|
|
|
Q_CHECK_PTR( newbits );
|
|
|
|
TQ_CHECK_PTR( newbits );
|
|
|
|
if ( !newbits ) // no memory
|
|
|
|
if ( !newbits ) // no memory
|
|
|
|
return FALSE;
|
|
|
|
return FALSE;
|
|
|
|
@@ -1440,11 +1607,18 @@ bool QPixmap::convertFromImage( const QI
|
|
|
|
@@ -1440,11 +1607,18 @@ bool QPixmap::convertFromImage( const QI
|
|
|
@ -381,7 +381,7 @@ obsoletes KPixmapIO.
|
|
|
|
int p2inc = xi->bytes_per_line/sizeof(ushort);
|
|
|
|
int p2inc = xi->bytes_per_line/sizeof(ushort);
|
|
|
|
ushort *newerbits = (ushort *)malloc( xi->bytes_per_line * h );
|
|
|
|
ushort *newerbits = (ushort *)malloc( xi->bytes_per_line * h );
|
|
|
|
+ newbits_size = xi->bytes_per_line * h;
|
|
|
|
+ newbits_size = xi->bytes_per_line * h;
|
|
|
|
Q_CHECK_PTR( newerbits );
|
|
|
|
TQ_CHECK_PTR( newerbits );
|
|
|
|
if ( !newerbits ) // no memory
|
|
|
|
if ( !newerbits ) // no memory
|
|
|
|
return FALSE;
|
|
|
|
return FALSE;
|
|
|
|
@@ -1462,6 +1636,14 @@ bool QPixmap::convertFromImage( const QI
|
|
|
|
@@ -1462,6 +1636,14 @@ bool QPixmap::convertFromImage( const QI
|
|
|
@ -449,7 +449,7 @@ obsoletes KPixmapIO.
|
|
|
|
+ if( axi->data==NULL ) {
|
|
|
|
+ if( axi->data==NULL ) {
|
|
|
|
// the data is deleted by qSafeXDestroyImage
|
|
|
|
// the data is deleted by qSafeXDestroyImage
|
|
|
|
axi->data = (char *) malloc(h * axi->bytes_per_line);
|
|
|
|
axi->data = (char *) malloc(h * axi->bytes_per_line);
|
|
|
|
Q_CHECK_PTR( axi->data );
|
|
|
|
TQ_CHECK_PTR( axi->data );
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
char *aptr = axi->data;
|
|
|
|
char *aptr = axi->data;
|
|
|
|
|
|
|
|
|
|
|
|