[eog] Fix test selection handling in eog_image_has_data()



commit ffd057a0be9610b49f2dc718060c82c4ee1065be
Author: Felix Riemann <friemann gnome org>
Date:   Tue Aug 2 22:02:17 2011 +0200

    Fix test selection handling in eog_image_has_data()
    
    Due to a wrong value negation the function was only checking one of the
    selected data types and skipping the following tests.
    Spotted by Fabian Sturm.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=655794

 src/eog-image.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/src/eog-image.c b/src/eog-image.c
index 7c4e896..75b38b6 100644
--- a/src/eog-image.c
+++ b/src/eog-image.c
@@ -1257,17 +1257,17 @@ eog_image_has_data (EogImage *img, EogImageData req_data)
 	priv = img->priv;
 
 	if ((req_data & EOG_IMAGE_DATA_IMAGE) > 0) {
-		req_data = (req_data & !EOG_IMAGE_DATA_IMAGE);
+		req_data = (req_data & ~EOG_IMAGE_DATA_IMAGE);
 		has_data = has_data && (priv->image != NULL);
 	}
 
 	if ((req_data & EOG_IMAGE_DATA_DIMENSION) > 0 ) {
-		req_data = (req_data & !EOG_IMAGE_DATA_DIMENSION);
+		req_data = (req_data & ~EOG_IMAGE_DATA_DIMENSION);
 		has_data = has_data && (priv->width >= 0) && (priv->height >= 0);
 	}
 
 	if ((req_data & EOG_IMAGE_DATA_EXIF) > 0) {
-		req_data = (req_data & !EOG_IMAGE_DATA_EXIF);
+		req_data = (req_data & ~EOG_IMAGE_DATA_EXIF);
 #ifdef HAVE_EXIF
 		has_data = has_data && (priv->exif != NULL);
 #else
@@ -1276,7 +1276,7 @@ eog_image_has_data (EogImage *img, EogImageData req_data)
 	}
 
 	if ((req_data & EOG_IMAGE_DATA_XMP) > 0) {
-		req_data = (req_data & !EOG_IMAGE_DATA_XMP);
+		req_data = (req_data & ~EOG_IMAGE_DATA_XMP);
 #ifdef HAVE_EXEMPI
 		has_data = has_data && (priv->xmp != NULL);
 #endif



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]