get rid of QT_NO_IMAGE_TEXT switcher

Change-Id: Ie72f907ffb959f629af6a414959348a992c4c941
Reviewed-by: aavit <qt_aavit@ovi.com>
bb10
Konstantin Ritt 2012-04-24 18:38:57 +03:00 committed by Qt by Nokia
parent 82fcbe9d7d
commit 17ebedf5fc
10 changed files with 7 additions and 60 deletions

View File

@ -74,9 +74,6 @@
#ifndef QT_NO_IMAGEFORMAT_PPM
# define QT_NO_IMAGEFORMAT_PPM
#endif
#ifndef QT_NO_IMAGE_TEXT
# define QT_NO_IMAGE_TEXT
#endif
#ifndef QT_NO_MOVIE
# define QT_NO_MOVIE
#endif

View File

@ -141,9 +141,6 @@
#ifndef QT_NO_IMAGE_HEURISTIC_MASK
# define QT_NO_IMAGE_HEURISTIC_MASK
#endif
#ifndef QT_NO_IMAGE_TEXT
# define QT_NO_IMAGE_TEXT
#endif
#ifndef QT_NO_MOVIE
# define QT_NO_MOVIE
#endif

View File

@ -105,9 +105,6 @@
#ifndef QT_NO_IMAGE_HEURISTIC_MASK
# define QT_NO_IMAGE_HEURISTIC_MASK
#endif
#ifndef QT_NO_IMAGE_TEXT
# define QT_NO_IMAGE_TEXT
#endif
#ifndef QT_NO_MOVIE
# define QT_NO_MOVIE
#endif

View File

@ -105,9 +105,6 @@
#ifndef QT_NO_IMAGEFORMAT_XPM
# define QT_NO_IMAGEFORMAT_XPM
#endif
#ifndef QT_NO_IMAGE_TEXT
# define QT_NO_IMAGE_TEXT
#endif
#ifndef QT_NO_MOVIE
# define QT_NO_MOVIE
#endif

View File

@ -118,9 +118,6 @@
// QImage::createHeuristicMask()
//#define QT_NO_IMAGE_HEURISTIC_MASK
// Image Text
//#define QT_NO_IMAGE_TEXT
// QLCDNumber
//#define QT_NO_LCDNUMBER

View File

@ -1127,9 +1127,7 @@ QImage QImage::copy(const QRect& r) const
image.d->dpmy = d->dpmy;
image.d->offset = d->offset;
image.d->has_alpha_clut = d->has_alpha_clut;
#ifndef QT_NO_IMAGE_TEXT
image.d->text = d->text;
#endif
return image;
}
@ -1219,9 +1217,7 @@ QImage QImage::copy(const QRect& r) const
image.d->dpmy = dotsPerMeterY();
image.d->offset = offset();
image.d->has_alpha_clut = d->has_alpha_clut;
#ifndef QT_NO_IMAGE_TEXT
image.d->text = d->text;
#endif
return image;
}
@ -3350,9 +3346,7 @@ QImage QImage::convertToFormat(Format format, Qt::ImageConversionFlags flags) co
image.setDotsPerMeterY(dotsPerMeterY());
image.setDotsPerMeterX(dotsPerMeterX());
#if !defined(QT_NO_IMAGE_TEXT)
image.d->text = d->text;
#endif // !QT_NO_IMAGE_TEXT
converter(image.d, d, flags);
return image;
@ -3399,14 +3393,12 @@ static QImage convertWithPalette(const QImage &src, QImage::Format format,
QImage dest(src.size(), format);
dest.setColorTable(clut);
#if !defined(QT_NO_IMAGE_TEXT)
QString textsKeys = src.text();
QStringList textKeyList = textsKeys.split(QLatin1Char('\n'), QString::SkipEmptyParts);
foreach (const QString &textKey, textKeyList) {
QStringList textKeySplitted = textKey.split(QLatin1String(": "));
dest.setText(textKeySplitted[0], textKeySplitted[1]);
}
#endif // !QT_NO_IMAGE_TEXT
int h = src.height();
int w = src.width();
@ -3474,9 +3466,7 @@ QImage QImage::convertToFormat(Format format, const QVector<QRgb> &colorTable, Q
QImage image(d->width, d->height, format);
QIMAGE_SANITYCHECK_MEMORY(image);
#if !defined(QT_NO_IMAGE_TEXT)
image.d->text = d->text;
#endif // !QT_NO_IMAGE_TEXT
image.d->text = d->text;
converter(image.d, d, flags);
return image;
@ -4756,7 +4746,6 @@ void QImage::setOffset(const QPoint& p)
if (d)
d->offset = p;
}
#ifndef QT_NO_IMAGE_TEXT
/*!
Returns the text keys for this image.
@ -4879,8 +4868,6 @@ void QImage::setText(const QString &key, const QString &value)
\endomit
*/
#endif // QT_NO_IMAGE_TEXT
/*
Sets the image bits to the \a pixmap contents and returns a
reference to the image.

View File

@ -68,7 +68,6 @@ template <class T> class QVector;
struct QImageData;
class QImageDataMisc; // internal
#ifndef QT_NO_IMAGE_TEXT
#if QT_DEPRECATED_SINCE(5, 0)
class QImageTextKeyLang {
public:
@ -86,7 +85,6 @@ public:
{ return !operator==(other); }
};
#endif
#endif //QT_NO_IMAGE_TEXT
typedef void (*QImageCleanupFunction)(void*);
@ -267,7 +265,7 @@ public:
void setDotsPerMeterY(int);
QPoint offset() const;
void setOffset(const QPoint&);
#ifndef QT_NO_IMAGE_TEXT
QStringList textKeys() const;
QString text(const QString &key = QString()) const;
void setText(const QString &key, const QString &value);
@ -279,7 +277,6 @@ public:
QT_DEPRECATED inline QString text(const QImageTextKeyLang&) const;
QT_DEPRECATED inline void setText(const char* key, const char* lang, const QString&);
#endif
#endif
#if QT_DEPRECATED_SINCE(5, 0)
QT_DEPRECATED inline int numColors() const;
@ -314,7 +311,6 @@ inline QRgb QImage::pixel(const QPoint &pt) const { return pixel(pt.x(), pt.y())
inline void QImage::setPixel(const QPoint &pt, uint index_or_rgb) { setPixel(pt.x(), pt.y(), index_or_rgb); }
#if QT_DEPRECATED_SINCE(5, 0)
#ifndef QT_NO_IMAGE_TEXT
#if defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 406)
# pragma GCC diagnostic push
@ -399,8 +395,6 @@ inline void QImage::setText(const char* key, const char* lang, const QString &s)
# pragma warning(default: 4996)
#endif
#endif
inline int QImage::numColors() const
{
return colorCount();

View File

@ -55,11 +55,8 @@
#include <QtCore/qglobal.h>
#include <QVector>
#ifndef QT_NO_IMAGE_TEXT
#include <QMap>
#endif
#include <QVector>
QT_BEGIN_NAMESPACE
@ -103,9 +100,8 @@ struct Q_GUI_EXPORT QImageData { // internal image data
// Return false if the conversion cannot be done in-place.
bool convertInPlace(QImage::Format newFormat, Qt::ImageConversionFlags);
#ifndef QT_NO_IMAGE_TEXT
QMap<QString, QString> text;
#endif
bool doImageIO(const QImage *image, QImageWriter* io, int quality) const;
QPaintEngine *paintEngine;
@ -152,4 +148,4 @@ inline int qt_depthForFormat(QImage::Format format)
QT_END_NAMESPACE
#endif
#endif // QIMAGE_P_H

View File

@ -390,7 +390,6 @@ static void CALLBACK_CALL_TYPE qt_png_warning(png_structp /*png_ptr*/, png_const
*/
void Q_INTERNAL_WIN_NO_THROW QPngHandlerPrivate::readPngTexts(png_info *info)
{
#ifndef QT_NO_IMAGE_TEXT
png_textp text_ptr;
int num_text=0;
png_get_text(png_ptr, info, &text_ptr, &num_text);
@ -413,7 +412,6 @@ void Q_INTERNAL_WIN_NO_THROW QPngHandlerPrivate::readPngTexts(png_info *info)
readTexts.append(value);
text_ptr++;
}
#endif
}
@ -530,11 +528,9 @@ bool Q_INTERNAL_WIN_NO_THROW QPngHandlerPrivate::readPngImage(QImage *outImage)
state = ReadingEnd;
png_read_end(png_ptr, end_info);
#ifndef QT_NO_IMAGE_TEXT
readPngTexts(end_info);
for (int i = 0; i < readTexts.size()-1; i+=2)
outImage->setText(readTexts.at(i), readTexts.at(i+1));
#endif
png_destroy_read_struct(&png_ptr, &info_ptr, &end_info);
delete [] row_pointers;
@ -638,7 +634,6 @@ void QPNGImageWriter::setGamma(float g)
}
#ifndef QT_NO_IMAGE_TEXT
static void set_text(const QImage &image, png_structp png_ptr, png_infop info_ptr,
const QString &description)
{
@ -712,7 +707,6 @@ static void set_text(const QImage &image, png_structp png_ptr, png_infop info_pt
}
delete [] text_ptr;
}
#endif
bool QPNGImageWriter::writeImage(const QImage& image, int off_x, int off_y)
{
@ -722,10 +716,6 @@ bool QPNGImageWriter::writeImage(const QImage& image, int off_x, int off_y)
bool Q_INTERNAL_WIN_NO_THROW QPNGImageWriter::writeImage(const QImage& image, int quality_in, const QString &description,
int off_x_in, int off_y_in)
{
#ifdef QT_NO_IMAGE_TEXT
Q_UNUSED(description);
#endif
QPoint offset = image.offset();
int off_x = off_x_in + offset.x();
int off_y = off_y_in + offset.y();
@ -837,9 +827,8 @@ bool Q_INTERNAL_WIN_NO_THROW QPNGImageWriter::writeImage(const QImage& image, in
PNG_RESOLUTION_METER);
}
#ifndef QT_NO_IMAGE_TEXT
set_text(image, png_ptr, info_ptr, description);
#endif
png_write_info(png_ptr, info_ptr);
if (image.depth() != 1)
@ -991,7 +980,7 @@ QVariant QPngHandler::option(ImageOption option) const
png_get_image_height(d->png_ptr, d->info_ptr));
else if (option == ImageFormat)
return d->readImageFormat();
return 0;
return QVariant();
}
void QPngHandler::setOption(ImageOption option, const QVariant &value)

View File

@ -88,9 +88,7 @@ private slots:
void dotsPerMeterZero();
void convertToFormatPreserveDotsPrMeter();
#ifndef QT_NO_IMAGE_TEXT
void convertToFormatPreserveText();
#endif
void rotate_data();
void rotate();
@ -1143,7 +1141,6 @@ void tst_QImage::convertToFormatPreserveDotsPrMeter()
QCOMPARE(img.dotsPerMeterY(), dpmy);
}
#ifndef QT_NO_IMAGE_TEXT
void tst_QImage::convertToFormatPreserveText()
{
QImage img(100, 100, QImage::Format_ARGB32_Premultiplied);
@ -1168,7 +1165,6 @@ void tst_QImage::convertToFormatPreserveText()
QCOMPARE(imgResult2.text(), result);
QCOMPARE(imgResult2.textKeys(), listResult);
}
#endif // QT_NO_IMAGE_TEXT
void tst_QImage::setColorCount()
{