diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/tools/qlist.h | 31 | ||||
-rw-r--r-- | src/gui/image/qpnghandler.cpp | 6 | ||||
-rw-r--r-- | src/gui/text/qfontengine_p.h | 3 | ||||
-rw-r--r-- | src/gui/text/qrawfont_ft.cpp | 2 | ||||
-rw-r--r-- | src/plugins/platforms/directfb/qdirectfbglcontext.cpp | 2 |
5 files changed, 27 insertions, 17 deletions
diff --git a/src/corelib/tools/qlist.h b/src/corelib/tools/qlist.h index 4eb05d6..9f7b23f 100644 --- a/src/corelib/tools/qlist.h +++ b/src/corelib/tools/qlist.h @@ -769,25 +769,32 @@ Q_OUTOFLINE_TEMPLATE void QList<T>::clear() template <typename T> Q_OUTOFLINE_TEMPLATE int QList<T>::removeAll(const T &_t) { - detachShared(); + int index = indexOf(_t); + if (index == -1) + return 0; + const T t = _t; - int removedCount=0, i=0; - Node *n; - while (i < p.size()) - if ((n = reinterpret_cast<Node *>(p.at(i)))->t() == t) { - node_destruct(n); - p.remove(i); - ++removedCount; - } else { - ++i; - } + detach(); + + Node *i = reinterpret_cast<Node *>(p.at(index)); + Node *e = reinterpret_cast<Node *>(p.end()); + Node *n = i; + node_destruct(i); + while (++i != e) { + if (i->t() == t) + node_destruct(i); + else + *n++ = *i; + } + + int removedCount = e - n; + d->end -= removedCount; return removedCount; } template <typename T> Q_OUTOFLINE_TEMPLATE bool QList<T>::removeOne(const T &_t) { - detachShared(); int index = indexOf(_t); if (index != -1) { removeAt(index); diff --git a/src/gui/image/qpnghandler.cpp b/src/gui/image/qpnghandler.cpp index f7d07a5..812c450 100644 --- a/src/gui/image/qpnghandler.cpp +++ b/src/gui/image/qpnghandler.cpp @@ -420,7 +420,7 @@ bool Q_INTERNAL_WIN_NO_THROW QPngHandlerPrivate::readPngHeader() return false; } - if (setjmp(png_jmpbuf(png_ptr))) { + if (setjmp((*png_set_longjmp_fn((png_ptr), (png_longjmp_ptr)longjmp, sizeof(jmp_buf))))) { png_destroy_read_struct(&png_ptr, &info_ptr, &end_info); png_ptr = 0; return false; @@ -449,7 +449,7 @@ bool Q_INTERNAL_WIN_NO_THROW QPngHandlerPrivate::readPngImage(QImage *outImage) } row_pointers = 0; - if (setjmp(png_jmpbuf(png_ptr))) { + if (setjmp((*png_set_longjmp_fn((png_ptr), (png_longjmp_ptr)longjmp, sizeof(jmp_buf))))) { png_destroy_read_struct(&png_ptr, &info_ptr, &end_info); delete [] row_pointers; png_ptr = 0; @@ -723,7 +723,7 @@ bool Q_INTERNAL_WIN_NO_THROW QPNGImageWriter::writeImage(const QImage& image, in return false; } - if (setjmp(png_jmpbuf(png_ptr))) { + if (setjmp((*png_set_longjmp_fn((png_ptr), (png_longjmp_ptr)longjmp, sizeof(jmp_buf))))) { png_destroy_write_struct(&png_ptr, &info_ptr); return false; } diff --git a/src/gui/text/qfontengine_p.h b/src/gui/text/qfontengine_p.h index a70aec1..8d81acb 100644 --- a/src/gui/text/qfontengine_p.h +++ b/src/gui/text/qfontengine_p.h @@ -155,6 +155,7 @@ public: struct FaceId { FaceId() : index(0), encoding(0) {} QByteArray filename; + QByteArray uuid; int index; int encoding; }; @@ -295,7 +296,7 @@ inline bool operator ==(const QFontEngine::FaceId &f1, const QFontEngine::FaceId inline uint qHash(const QFontEngine::FaceId &f) { - return qHash((f.index << 16) + f.encoding) + qHash(f.filename); + return qHash((f.index << 16) + f.encoding) + qHash(f.filename + f.uuid); } diff --git a/src/gui/text/qrawfont_ft.cpp b/src/gui/text/qrawfont_ft.cpp index 5bba221..1666df3 100644 --- a/src/gui/text/qrawfont_ft.cpp +++ b/src/gui/text/qrawfont_ft.cpp @@ -45,6 +45,7 @@ #include "qrawfont_p.h" #include "qfontengine_ft_p.h" +#include "quuid.h" #if defined(Q_WS_X11) && !defined(QT_NO_FONTCONFIG) # include "qfontengine_x11_p.h" @@ -87,6 +88,7 @@ public: FaceId faceId; faceId.filename = ""; faceId.index = 0; + faceId.uuid = QUuid::createUuid().toByteArray(); return init(faceId, true, Format_None, fontData); } diff --git a/src/plugins/platforms/directfb/qdirectfbglcontext.cpp b/src/plugins/platforms/directfb/qdirectfbglcontext.cpp index 8a40b24..aca28f1 100644 --- a/src/plugins/platforms/directfb/qdirectfbglcontext.cpp +++ b/src/plugins/platforms/directfb/qdirectfbglcontext.cpp @@ -41,7 +41,7 @@ #include "qdirectfbglcontext.h" -#include <directfb/directfbgl.h> +#include <directfbgl.h> #include <QDebug> |