| Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/gui/image/qxbmhandler.cpp | 
| Switch to Source code | Preprocessed file | 
| Line | Source | Count | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||||||||||||||
| 2 | - | |||||||||||||||||||||||||
| 3 | - | |||||||||||||||||||||||||
| 4 | - | |||||||||||||||||||||||||
| 5 | - | |||||||||||||||||||||||||
| 6 | - | |||||||||||||||||||||||||
| 7 | - | |||||||||||||||||||||||||
| 8 | - | |||||||||||||||||||||||||
| 9 | - | |||||||||||||||||||||||||
| 10 | - | |||||||||||||||||||||||||
| 11 | - | |||||||||||||||||||||||||
| 12 | - | |||||||||||||||||||||||||
| 13 | - | |||||||||||||||||||||||||
| 14 | static inline int hex2byte(char *p) | - | ||||||||||||||||||||||||
| 15 | { | - | ||||||||||||||||||||||||
| 16 |     return never executed:   ((isdigit((uchar) *p)return ((isdigit((uchar) *p) ? *p - '0' : toupper((uchar) *p) - 'A' + 10) << 4) | (isdigit((uchar) *(p+1)) ? *(p+1) - '0' : toupper((uchar) *(p+1)) - 'A' + 10);
 never executed:  return ((isdigit((uchar) *p) ? *p - '0' : toupper((uchar) *p) - 'A' + 10) << 4) | (isdigit((uchar) *(p+1)) ? *(p+1) - '0' : toupper((uchar) *(p+1)) - 'A' + 10); | 0 | ||||||||||||||||||||||||
| 17 |            (isdigit((uchar) *(p+1)) ? *(p+1) - '0' : toupper((uchar) *(p+1)) - 'A' + 10); never executed:  return ((isdigit((uchar) *p) ? *p - '0' : toupper((uchar) *p) - 'A' + 10) << 4) | (isdigit((uchar) *(p+1)) ? *(p+1) - '0' : toupper((uchar) *(p+1)) - 'A' + 10); | 0 | ||||||||||||||||||||||||
| 18 | } | - | ||||||||||||||||||||||||
| 19 | - | |||||||||||||||||||||||||
| 20 | static bool read_xbm_header(QIODevice *device, int& w, int& h) | - | ||||||||||||||||||||||||
| 21 | { | - | ||||||||||||||||||||||||
| 22 | const int buflen = 300; | - | ||||||||||||||||||||||||
| 23 | const int maxlen = 4096; | - | ||||||||||||||||||||||||
| 24 | char buf[buflen + 1]; | - | ||||||||||||||||||||||||
| 25 | QRegExp r1(QLatin1String("^#define[ \t]+[a-zA-Z0-9._]+[ \t]+")); | - | ||||||||||||||||||||||||
| 26 | QRegExp r2(QLatin1String("[0-9]+")); | - | ||||||||||||||||||||||||
| 27 | - | |||||||||||||||||||||||||
| 28 | qint64 readBytes = 0; | - | ||||||||||||||||||||||||
| 29 | qint64 totalReadBytes = 0; | - | ||||||||||||||||||||||||
| 30 | - | |||||||||||||||||||||||||
| 31 | buf[0] = '\0'; | - | ||||||||||||||||||||||||
| 32 | - | |||||||||||||||||||||||||
| 33 | - | |||||||||||||||||||||||||
| 34 |     while (buf[0] != '#'
  | 0 | ||||||||||||||||||||||||
| 35 | readBytes = device->readLine(buf, buflen); | - | ||||||||||||||||||||||||
| 36 | - | |||||||||||||||||||||||||
| 37 | - | |||||||||||||||||||||||||
| 38 |         if (readBytes <= 0
 
  | 0 | ||||||||||||||||||||||||
| 39 |             return never executed:   false;return false;never executed:  return false; | 0 | ||||||||||||||||||||||||
| 40 | - | |||||||||||||||||||||||||
| 41 | - | |||||||||||||||||||||||||
| 42 | - | |||||||||||||||||||||||||
| 43 | totalReadBytes += readBytes; | - | ||||||||||||||||||||||||
| 44 |         if (totalReadBytes >= maxlen
  | 0 | ||||||||||||||||||||||||
| 45 |             return never executed:   false;return false;never executed:  return false; | 0 | ||||||||||||||||||||||||
| 46 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||
| 47 | - | |||||||||||||||||||||||||
| 48 | buf[readBytes - 1] = '\0'; | - | ||||||||||||||||||||||||
| 49 | QString sbuf; | - | ||||||||||||||||||||||||
| 50 | sbuf = QString::fromLatin1(buf); | - | ||||||||||||||||||||||||
| 51 | - | |||||||||||||||||||||||||
| 52 | - | |||||||||||||||||||||||||
| 53 |     if (r1.indexIn(sbuf) == 0
  | 0 | ||||||||||||||||||||||||
| 54 |          r2.indexIn(sbuf, r1.matchedLength()) == r1.matchedLength()
  | 0 | ||||||||||||||||||||||||
| 55 |         w = QByteArray(&buf[r1.matchedLength()]).trimmed().toInt(); never executed:  w = QByteArray(&buf[r1.matchedLength()]).trimmed().toInt(); | 0 | ||||||||||||||||||||||||
| 56 | - | |||||||||||||||||||||||||
| 57 | - | |||||||||||||||||||||||||
| 58 | readBytes = device->readLine(buf, buflen); | - | ||||||||||||||||||||||||
| 59 |     if (readBytes <= 0
  | 0 | ||||||||||||||||||||||||
| 60 |         return never executed:   false;return false;never executed:  return false; | 0 | ||||||||||||||||||||||||
| 61 | buf[readBytes - 1] = '\0'; | - | ||||||||||||||||||||||||
| 62 | - | |||||||||||||||||||||||||
| 63 | sbuf = QString::fromLatin1(buf); | - | ||||||||||||||||||||||||
| 64 | - | |||||||||||||||||||||||||
| 65 |     if (r1.indexIn(sbuf) == 0
  | 0 | ||||||||||||||||||||||||
| 66 |          r2.indexIn(sbuf, r1.matchedLength()) == r1.matchedLength()
  | 0 | ||||||||||||||||||||||||
| 67 |         h = QByteArray(&buf[r1.matchedLength()]).trimmed().toInt(); never executed:  h = QByteArray(&buf[r1.matchedLength()]).trimmed().toInt(); | 0 | ||||||||||||||||||||||||
| 68 | - | |||||||||||||||||||||||||
| 69 | - | |||||||||||||||||||||||||
| 70 |     if (w <= 0
 
 
 
  | 0 | ||||||||||||||||||||||||
| 71 |         return never executed:   false;return false;never executed:  return false; | 0 | ||||||||||||||||||||||||
| 72 | - | |||||||||||||||||||||||||
| 73 |     return never executed:   true;return true;never executed:  return true; | 0 | ||||||||||||||||||||||||
| 74 | } | - | ||||||||||||||||||||||||
| 75 | - | |||||||||||||||||||||||||
| 76 | static bool read_xbm_body(QIODevice *device, int w, int h, QImage *outImage) | - | ||||||||||||||||||||||||
| 77 | { | - | ||||||||||||||||||||||||
| 78 | const int buflen = 300; | - | ||||||||||||||||||||||||
| 79 | char buf[buflen + 1]; | - | ||||||||||||||||||||||||
| 80 | - | |||||||||||||||||||||||||
| 81 | qint64 readBytes = 0; | - | ||||||||||||||||||||||||
| 82 | - | |||||||||||||||||||||||||
| 83 | char *p; | - | ||||||||||||||||||||||||
| 84 | - | |||||||||||||||||||||||||
| 85 | - | |||||||||||||||||||||||||
| 86 | do { | - | ||||||||||||||||||||||||
| 87 |         if ((
 
  | 0 | ||||||||||||||||||||||||
| 88 | - | |||||||||||||||||||||||||
| 89 |             return never executed:   false;return false;never executed:  return false; | 0 | ||||||||||||||||||||||||
| 90 | } | - | ||||||||||||||||||||||||
| 91 | - | |||||||||||||||||||||||||
| 92 | buf[readBytes] = '\0'; | - | ||||||||||||||||||||||||
| 93 | p = strstr(buf, "0x"); | - | ||||||||||||||||||||||||
| 94 |     } never executed:   while (!pend of block
  | 0 | ||||||||||||||||||||||||
| 95 | - | |||||||||||||||||||||||||
| 96 |     if (outImage->size() != QSize(w, h)
 
  | 0 | ||||||||||||||||||||||||
| 97 | *outImage = QImage(w, h, QImage::Format_MonoLSB); | - | ||||||||||||||||||||||||
| 98 |         if (outImage->isNull()
  | 0 | ||||||||||||||||||||||||
| 99 |             return never executed:   false;return false;never executed:  return false; | 0 | ||||||||||||||||||||||||
| 100 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||
| 101 | - | |||||||||||||||||||||||||
| 102 | outImage->setColorCount(2); | - | ||||||||||||||||||||||||
| 103 | outImage->setColor(0, qRgb(255,255,255)); | - | ||||||||||||||||||||||||
| 104 | outImage->setColor(1, qRgb(0,0,0)); | - | ||||||||||||||||||||||||
| 105 | - | |||||||||||||||||||||||||
| 106 | int x = 0, y = 0; | - | ||||||||||||||||||||||||
| 107 | uchar *b = outImage->scanLine(0); | - | ||||||||||||||||||||||||
| 108 | w = (w+7)/8; | - | ||||||||||||||||||||||||
| 109 | - | |||||||||||||||||||||||||
| 110 |     while (y < h
  | 0 | ||||||||||||||||||||||||
| 111 |         if (p
  | 0 | ||||||||||||||||||||||||
| 112 | *b++ = hex2byte(p+2); | - | ||||||||||||||||||||||||
| 113 | p += 2; | - | ||||||||||||||||||||||||
| 114 |             if (++
 
 
 
  | 0 | ||||||||||||||||||||||||
| 115 | b = outImage->scanLine(y); | - | ||||||||||||||||||||||||
| 116 | x = 0; | - | ||||||||||||||||||||||||
| 117 |             } never executed:  end of block | 0 | ||||||||||||||||||||||||
| 118 | p = strstr(p, "0x"); | - | ||||||||||||||||||||||||
| 119 |         } never executed:   else {end of block | 0 | ||||||||||||||||||||||||
| 120 |             if ((
 
  | 0 | ||||||||||||||||||||||||
| 121 |                 break; never executed:  break; | 0 | ||||||||||||||||||||||||
| 122 | buf[readBytes] = '\0'; | - | ||||||||||||||||||||||||
| 123 | p = strstr(buf, "0x"); | - | ||||||||||||||||||||||||
| 124 |         } never executed:  end of block | 0 | ||||||||||||||||||||||||
| 125 | } | - | ||||||||||||||||||||||||
| 126 | - | |||||||||||||||||||||||||
| 127 |     return never executed:   true;return true;never executed:  return true; | 0 | ||||||||||||||||||||||||
| 128 | } | - | ||||||||||||||||||||||||
| 129 | - | |||||||||||||||||||||||||
| 130 | static bool read_xbm_image(QIODevice *device, QImage *outImage) | - | ||||||||||||||||||||||||
| 131 | { | - | ||||||||||||||||||||||||
| 132 | int w = 0, h = 0; | - | ||||||||||||||||||||||||
| 133 |     if (!read_xbm_header(device, w, h)
  | 0 | ||||||||||||||||||||||||
| 134 |         return never executed:   false;return false;never executed:  return false; | 0 | ||||||||||||||||||||||||
| 135 |     return never executed:   read_xbm_body(device, w, h, outImage);return read_xbm_body(device, w, h, outImage);never executed:  return read_xbm_body(device, w, h, outImage); | 0 | ||||||||||||||||||||||||
| 136 | } | - | ||||||||||||||||||||||||
| 137 | - | |||||||||||||||||||||||||
| 138 | static bool write_xbm_image(const QImage &sourceImage, QIODevice *device, const QString &fileName) | - | ||||||||||||||||||||||||
| 139 | { | - | ||||||||||||||||||||||||
| 140 | QImage image = sourceImage; | - | ||||||||||||||||||||||||
| 141 | int w = image.width(); | - | ||||||||||||||||||||||||
| 142 | int h = image.height(); | - | ||||||||||||||||||||||||
| 143 | int i; | - | ||||||||||||||||||||||||
| 144 | QString s = fileName; | - | ||||||||||||||||||||||||
| 145 | int msize = s.length() + 100; | - | ||||||||||||||||||||||||
| 146 | char *buf = new char[msize]; | - | ||||||||||||||||||||||||
| 147 | - | |||||||||||||||||||||||||
| 148 | qsnprintf(buf, msize, "#define %s_width %d\n", s.toUtf8().data(), w); | - | ||||||||||||||||||||||||
| 149 | device->write(buf, qstrlen(buf)); | - | ||||||||||||||||||||||||
| 150 | qsnprintf(buf, msize, "#define %s_height %d\n", s.toUtf8().data(), h); | - | ||||||||||||||||||||||||
| 151 | device->write(buf, qstrlen(buf)); | - | ||||||||||||||||||||||||
| 152 | qsnprintf(buf, msize, "static char %s_bits[] = {\n ", s.toUtf8().data()); | - | ||||||||||||||||||||||||
| 153 | device->write(buf, qstrlen(buf)); | - | ||||||||||||||||||||||||
| 154 | - | |||||||||||||||||||||||||
| 155 |     if (image.format() != QImage::Format_MonoLSB
  | 0 | ||||||||||||||||||||||||
| 156 |         image = image.convertToFormat(QImage::Format_MonoLSB); never executed:  image = image.convertToFormat(QImage::Format_MonoLSB); | 0 | ||||||||||||||||||||||||
| 157 | - | |||||||||||||||||||||||||
| 158 | bool invert = qGray(image.color(0)) < qGray(image.color(1)); | - | ||||||||||||||||||||||||
| 159 | char hexrep[16]; | - | ||||||||||||||||||||||||
| 160 |     for (i=0; i<10
  | 0 | ||||||||||||||||||||||||
| 161 |         hexrep[i] = '0' + i; never executed:  hexrep[i] = '0' + i; | 0 | ||||||||||||||||||||||||
| 162 |     for (i=10; i<16
  | 0 | ||||||||||||||||||||||||
| 163 |         hexrep[i] = 'a' -10 + i; never executed:  hexrep[i] = 'a' -10 + i; | 0 | ||||||||||||||||||||||||
| 164 |     if (invert
  | 0 | ||||||||||||||||||||||||
| 165 | char t; | - | ||||||||||||||||||||||||
| 166 |         for (i=0; i<8
  | 0 | ||||||||||||||||||||||||
| 167 | t = hexrep[15-i]; | - | ||||||||||||||||||||||||
| 168 | hexrep[15-i] = hexrep[i]; | - | ||||||||||||||||||||||||
| 169 | hexrep[i] = t; | - | ||||||||||||||||||||||||
| 170 |         } never executed:  end of block | 0 | ||||||||||||||||||||||||
| 171 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||
| 172 | int bcnt = 0; | - | ||||||||||||||||||||||||
| 173 | char *p = buf; | - | ||||||||||||||||||||||||
| 174 | int bpl = (w+7)/8; | - | ||||||||||||||||||||||||
| 175 |     for (int y = 0; y < h
  | 0 | ||||||||||||||||||||||||
| 176 | const uchar *b = image.constScanLine(y); | - | ||||||||||||||||||||||||
| 177 |         for (i = 0; i < bpl
  | 0 | ||||||||||||||||||||||||
| 178 | *p++ = '0'; *p++ = 'x'; | - | ||||||||||||||||||||||||
| 179 | *p++ = hexrep[*b >> 4]; | - | ||||||||||||||||||||||||
| 180 | *p++ = hexrep[*b++ & 0xf]; | - | ||||||||||||||||||||||||
| 181 | - | |||||||||||||||||||||||||
| 182 |             if (i < bpl - 1
 
  | 0 | ||||||||||||||||||||||||
| 183 | *p++ = ','; | - | ||||||||||||||||||||||||
| 184 |                 if (++
 
  | 0 | ||||||||||||||||||||||||
| 185 | *p++ = '\n'; | - | ||||||||||||||||||||||||
| 186 | *p++ = ' '; | - | ||||||||||||||||||||||||
| 187 | *p = '\0'; | - | ||||||||||||||||||||||||
| 188 |                     if ((
 
  | 0 | ||||||||||||||||||||||||
| 189 | delete [] buf; | - | ||||||||||||||||||||||||
| 190 |                         return never executed:   false;return false;never executed:  return false; | 0 | ||||||||||||||||||||||||
| 191 | } | - | ||||||||||||||||||||||||
| 192 | p = buf; | - | ||||||||||||||||||||||||
| 193 | bcnt = 0; | - | ||||||||||||||||||||||||
| 194 |                 } never executed:  end of block | 0 | ||||||||||||||||||||||||
| 195 |             } never executed:  end of block | 0 | ||||||||||||||||||||||||
| 196 |         } never executed:  end of block | 0 | ||||||||||||||||||||||||
| 197 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||
| 198 | - | |||||||||||||||||||||||||
| 199 | - | |||||||||||||||||||||||||
| 200 | - | |||||||||||||||||||||||||
| 201 | strcpy(p, " };\n"); | - | ||||||||||||||||||||||||
| 202 | - | |||||||||||||||||||||||||
| 203 |     if ((
 
  | 0 | ||||||||||||||||||||||||
| 204 | delete [] buf; | - | ||||||||||||||||||||||||
| 205 |         return never executed:   false;return false;never executed:  return false; | 0 | ||||||||||||||||||||||||
| 206 | } | - | ||||||||||||||||||||||||
| 207 | - | |||||||||||||||||||||||||
| 208 | delete [] buf; | - | ||||||||||||||||||||||||
| 209 |     return never executed:   true;return true;never executed:  return true; | 0 | ||||||||||||||||||||||||
| 210 | } | - | ||||||||||||||||||||||||
| 211 | - | |||||||||||||||||||||||||
| 212 | QXbmHandler::QXbmHandler() | - | ||||||||||||||||||||||||
| 213 | : state(Ready) | - | ||||||||||||||||||||||||
| 214 | { | - | ||||||||||||||||||||||||
| 215 | } never executed:  end of block | 0 | ||||||||||||||||||||||||
| 216 | - | |||||||||||||||||||||||||
| 217 | bool QXbmHandler::readHeader() | - | ||||||||||||||||||||||||
| 218 | { | - | ||||||||||||||||||||||||
| 219 | state = Error; | - | ||||||||||||||||||||||||
| 220 |     if (!read_xbm_header(device(), width, height)
  | 0 | ||||||||||||||||||||||||
| 221 |         return never executed:   false;return false;never executed:  return false; | 0 | ||||||||||||||||||||||||
| 222 | state = ReadHeader; | - | ||||||||||||||||||||||||
| 223 |     return never executed:   true;return true;never executed:  return true; | 0 | ||||||||||||||||||||||||
| 224 | } | - | ||||||||||||||||||||||||
| 225 | - | |||||||||||||||||||||||||
| 226 | bool QXbmHandler::canRead() const | - | ||||||||||||||||||||||||
| 227 | { | - | ||||||||||||||||||||||||
| 228 |     if (state == Ready
 
  | 0 | ||||||||||||||||||||||||
| 229 |         return never executed:   false;return false;never executed:  return false; | 0 | ||||||||||||||||||||||||
| 230 | - | |||||||||||||||||||||||||
| 231 |     if (state != Error
  | 0 | ||||||||||||||||||||||||
| 232 | setFormat("xbm"); | - | ||||||||||||||||||||||||
| 233 |         return never executed:   true;return true;never executed:  return true; | 0 | ||||||||||||||||||||||||
| 234 | } | - | ||||||||||||||||||||||||
| 235 | - | |||||||||||||||||||||||||
| 236 |     return never executed:   false;return false;never executed:  return false; | 0 | ||||||||||||||||||||||||
| 237 | } | - | ||||||||||||||||||||||||
| 238 | - | |||||||||||||||||||||||||
| 239 | bool QXbmHandler::canRead(QIODevice *device) | - | ||||||||||||||||||||||||
| 240 | { | - | ||||||||||||||||||||||||
| 241 | QImage image; | - | ||||||||||||||||||||||||
| 242 | - | |||||||||||||||||||||||||
| 243 | - | |||||||||||||||||||||||||
| 244 | - | |||||||||||||||||||||||||
| 245 | - | |||||||||||||||||||||||||
| 246 |     if (device->isSequential()
  | 0 | ||||||||||||||||||||||||
| 247 |         return never executed:   false;return false;never executed:  return false; | 0 | ||||||||||||||||||||||||
| 248 | - | |||||||||||||||||||||||||
| 249 | qint64 oldPos = device->pos(); | - | ||||||||||||||||||||||||
| 250 | bool success = read_xbm_image(device, &image); | - | ||||||||||||||||||||||||
| 251 | device->seek(oldPos); | - | ||||||||||||||||||||||||
| 252 | - | |||||||||||||||||||||||||
| 253 |     return never executed:   success;return success;never executed:  return success; | 0 | ||||||||||||||||||||||||
| 254 | } | - | ||||||||||||||||||||||||
| 255 | - | |||||||||||||||||||||||||
| 256 | bool QXbmHandler::read(QImage *image) | - | ||||||||||||||||||||||||
| 257 | { | - | ||||||||||||||||||||||||
| 258 |     if (state == Error
  | 0 | ||||||||||||||||||||||||
| 259 |         return never executed:   false;return false;never executed:  return false; | 0 | ||||||||||||||||||||||||
| 260 | - | |||||||||||||||||||||||||
| 261 |     if (state == Ready
 
  | 0 | ||||||||||||||||||||||||
| 262 | state = Error; | - | ||||||||||||||||||||||||
| 263 |         return never executed:   false;return false;never executed:  return false; | 0 | ||||||||||||||||||||||||
| 264 | } | - | ||||||||||||||||||||||||
| 265 | - | |||||||||||||||||||||||||
| 266 |     if (!read_xbm_body(device(), width, height, image)
  | 0 | ||||||||||||||||||||||||
| 267 | state = Error; | - | ||||||||||||||||||||||||
| 268 |         return never executed:   false;return false;never executed:  return false; | 0 | ||||||||||||||||||||||||
| 269 | } | - | ||||||||||||||||||||||||
| 270 | - | |||||||||||||||||||||||||
| 271 | state = Ready; | - | ||||||||||||||||||||||||
| 272 |     return never executed:   true;return true;never executed:  return true; | 0 | ||||||||||||||||||||||||
| 273 | } | - | ||||||||||||||||||||||||
| 274 | - | |||||||||||||||||||||||||
| 275 | bool QXbmHandler::write(const QImage &image) | - | ||||||||||||||||||||||||
| 276 | { | - | ||||||||||||||||||||||||
| 277 |     return never executed:   write_xbm_image(image, device(), fileName);return write_xbm_image(image, device(), fileName);never executed:  return write_xbm_image(image, device(), fileName); | 0 | ||||||||||||||||||||||||
| 278 | } | - | ||||||||||||||||||||||||
| 279 | - | |||||||||||||||||||||||||
| 280 | bool QXbmHandler::supportsOption(ImageOption option) const | - | ||||||||||||||||||||||||
| 281 | { | - | ||||||||||||||||||||||||
| 282 |     return never executed:   option == Namereturn option == Name || option == Size || option == ImageFormat;
 never executed:  return option == Name || option == Size || option == ImageFormat; | 0 | ||||||||||||||||||||||||
| 283 |         || option == Size
 never executed:  return option == Name || option == Size || option == ImageFormat; | 0 | ||||||||||||||||||||||||
| 284 |         || option == ImageFormat
 never executed:  return option == Name || option == Size || option == ImageFormat; | 0 | ||||||||||||||||||||||||
| 285 | } | - | ||||||||||||||||||||||||
| 286 | - | |||||||||||||||||||||||||
| 287 | QVariant QXbmHandler::option(ImageOption option) const | - | ||||||||||||||||||||||||
| 288 | { | - | ||||||||||||||||||||||||
| 289 |     if (option == Name
  | 0 | ||||||||||||||||||||||||
| 290 |         return never executed:   fileName;return fileName;never executed:  return fileName; | 0 | ||||||||||||||||||||||||
| 291 |     } else if (option == Size
  | 0 | ||||||||||||||||||||||||
| 292 |         if (state == Error
  | 0 | ||||||||||||||||||||||||
| 293 |             return never executed:   QVariant();return QVariant();never executed:  return QVariant(); | 0 | ||||||||||||||||||||||||
| 294 |         if (state == Ready
 
  | 0 | ||||||||||||||||||||||||
| 295 |             return never executed:   QVariant();return QVariant();never executed:  return QVariant(); | 0 | ||||||||||||||||||||||||
| 296 |         return never executed:   QSize(width, height);return QSize(width, height);never executed:  return QSize(width, height); | 0 | ||||||||||||||||||||||||
| 297 |     } else if (option == ImageFormat
  | 0 | ||||||||||||||||||||||||
| 298 |         return never executed:   QImage::Format_MonoLSB;return QImage::Format_MonoLSB;never executed:  return QImage::Format_MonoLSB; | 0 | ||||||||||||||||||||||||
| 299 | } | - | ||||||||||||||||||||||||
| 300 |     return never executed:   QVariant();return QVariant();never executed:  return QVariant(); | 0 | ||||||||||||||||||||||||
| 301 | } | - | ||||||||||||||||||||||||
| 302 | - | |||||||||||||||||||||||||
| 303 | void QXbmHandler::setOption(ImageOption option, const QVariant &value) | - | ||||||||||||||||||||||||
| 304 | { | - | ||||||||||||||||||||||||
| 305 |     if (option == Name
  | 0 | ||||||||||||||||||||||||
| 306 |         fileName = value.toString(); never executed:  fileName = value.toString(); | 0 | ||||||||||||||||||||||||
| 307 | } never executed:  end of block | 0 | ||||||||||||||||||||||||
| 308 | - | |||||||||||||||||||||||||
| 309 | QByteArray QXbmHandler::name() const | - | ||||||||||||||||||||||||
| 310 | { | - | ||||||||||||||||||||||||
| 311 |     return never executed:   "xbm";return "xbm";never executed:  return "xbm"; | 0 | ||||||||||||||||||||||||
| 312 | } | - | ||||||||||||||||||||||||
| 313 | - | |||||||||||||||||||||||||
| 314 | - | |||||||||||||||||||||||||
| Switch to Source code | Preprocessed file |