From fd84bc720aa8101a12b185e3bb291ff0f5732281 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Wed, 4 May 2011 14:54:22 +0200 Subject: remove some unused code QPaintDeviceRedirection is not being used any more. Remove all code related to it. --- src/gui/painting/qpainter.cpp | 51 ------------------------------------------- 1 file changed, 51 deletions(-) (limited to 'src/gui/painting/qpainter.cpp') diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index 929685db53..f974186f58 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -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 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, -- cgit v1.2.3