remove some unused code

QPaintDeviceRedirection is not being used any more.
Remove all code related to it.
This commit is contained in:
Lars Knoll 2011-05-04 14:54:22 +02:00
parent 100e074126
commit fd84bc720a
3 changed files with 0 additions and 57 deletions

View File

@ -43,8 +43,6 @@
QT_BEGIN_NAMESPACE
extern void qt_painter_removePaintDevice(QPaintDevice *); //qpainter.cpp
QPaintDevice::QPaintDevice()
{
painters = 0;
@ -55,7 +53,6 @@ QPaintDevice::~QPaintDevice()
if (paintingActive())
qWarning("QPaintDevice: Cannot destroy paint device that is being "
"painted");
qt_painter_removePaintDevice(this);
}

View File

@ -41,14 +41,11 @@
#include "qpaintdevice.h"
#include "qpainter.h"
#include "qwidget.h"
#include "qbitmap.h"
#include "qapplication.h"
QT_BEGIN_NAMESPACE
extern void qt_painter_removePaintDevice(QPaintDevice *); //qpainter.cpp
int QPaintDevice::metric(PaintDeviceMetric m) const
{
qWarning("QPaintDevice::metrics: Device has no metric information");

View File

@ -7370,27 +7370,6 @@ void QPainter::setViewTransformEnabled(bool enable)
d->updateMatrix();
}
struct QPaintDeviceRedirection
{
QPaintDeviceRedirection() : device(0), replacement(0), internalWidgetRedirectionIndex(-1) {}
QPaintDeviceRedirection(const QPaintDevice *device, QPaintDevice *replacement,
const QPoint& offset, int internalWidgetRedirectionIndex)
: device(device), replacement(replacement), offset(offset),
internalWidgetRedirectionIndex(internalWidgetRedirectionIndex) { }
const QPaintDevice *device;
QPaintDevice *replacement;
QPoint offset;
int internalWidgetRedirectionIndex;
bool operator==(const QPaintDevice *pdev) const { return device == pdev; }
Q_DUMMY_COMPARISON_OPERATOR(QPaintDeviceRedirection)
};
typedef QList<QPaintDeviceRedirection> QPaintDeviceRedirectionList;
Q_GLOBAL_STATIC(QPaintDeviceRedirectionList, globalRedirections)
Q_GLOBAL_STATIC(QMutex, globalRedirectionsMutex)
Q_GLOBAL_STATIC(QAtomicInt, globalRedirectionAtomic)
/*!
\threadsafe
@ -7467,36 +7446,6 @@ QPaintDevice *QPainter::redirected(const QPaintDevice *device, QPoint *offset)
return 0;
}
void qt_painter_removePaintDevice(QPaintDevice *dev)
{
if (!globalRedirectionAtomic() || *globalRedirectionAtomic() == 0)
return;
QMutex *mutex = 0;
QT_TRY {
mutex = globalRedirectionsMutex();
} QT_CATCH(...) {
// ignore the missing mutex, since we could be called from
// a destructor, and destructors shall not throw
}
QMutexLocker locker(mutex);
QPaintDeviceRedirectionList *redirections = 0;
QT_TRY {
redirections = globalRedirections();
} QT_CATCH(...) {
// do nothing - code below is safe with redirections being 0.
}
if (redirections) {
for (int i = 0; i < redirections->size(); ) {
if(redirections->at(i) == dev || redirections->at(i).replacement == dev)
redirections->removeAt(i);
else
++i;
}
}
}
void qt_format_text(const QFont &fnt, const QRectF &_r,
int tf, const QString& str, QRectF *brect,
int tabstops, int *ta, int tabarraylen,