From 5f3ec26d90c239420d7865cba91e625283f08ba1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Mon, 19 May 2014 22:56:13 +0200 Subject: [PATCH 01/24] Add opt-out environment variable for @2x images MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There are cases where @2x images are in use but where you don't want the associated behavior: - You are implementing an image editor - You are inheriting a resource set which has @2x images, but don't want that behavior with Qt. Add support for disabling @2x behavior with QT_HIGHDPI_DISABLE_2X_IMAGE_LOADING. Change-Id: I206e050b6241f8935b4404c7a28b024a9e00d46c Task-id: QTBUG-38485 Reviewed-by: Jake Petroules Reviewed-by: Morten Johan Sørvig --- src/gui/image/qicon.cpp | 3 ++- src/gui/image/qimagereader.cpp | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/gui/image/qicon.cpp b/src/gui/image/qicon.cpp index 8172ecbb48d..681e7e3f796 100644 --- a/src/gui/image/qicon.cpp +++ b/src/gui/image/qicon.cpp @@ -1026,7 +1026,8 @@ void QIcon::addFile(const QString &fileName, const QSize &size, Mode mode, State d->engine->addFile(fileName, size, mode, state); // Check if a "@2x" file exists and add it. - if (qApp->devicePixelRatio() > 1.0) { + static bool disable2xImageLoading = !qgetenv("QT_HIGHDPI_DISABLE_2X_IMAGE_LOADING").isEmpty(); + if (!disable2xImageLoading && qApp->devicePixelRatio() > 1.0) { int dotIndex = fileName.lastIndexOf(QLatin1Char('.')); if (dotIndex != -1) { QString at2xfileName = fileName; diff --git a/src/gui/image/qimagereader.cpp b/src/gui/image/qimagereader.cpp index 091837b8b4b..a10198a0060 100644 --- a/src/gui/image/qimagereader.cpp +++ b/src/gui/image/qimagereader.cpp @@ -1247,8 +1247,9 @@ bool QImageReader::read(QImage *image) } // successful read; check for "@2x" file name suffix and set device pixel ratio. - if (QFileInfo(fileName()).baseName().endsWith(QLatin1String("@2x"))) { - image->setDevicePixelRatio(2.0); + static bool disable2xImageLoading = !qgetenv("QT_HIGHDPI_DISABLE_2X_IMAGE_LOADING").isEmpty(); + if (!disable2xImageLoading && QFileInfo(fileName()).baseName().endsWith(QLatin1String("@2x"))) { + image->setDevicePixelRatio(2.0); } return true; From e26fa6d2066d76b295a71956f67cccc7941c3f32 Mon Sep 17 00:00:00 2001 From: David Faure Date: Sun, 22 Jun 2014 13:51:24 +0200 Subject: [PATCH 02/24] Move QXmlReaderPrivate to private header. First step for making QXmlSimpleReader reentrant. Task-number: QTBUG-40015 Change-Id: I1666672b1759adb745b86ce58488142f3c66d3f5 Reviewed-by: Friedemann Kleint --- src/xml/sax/qxml.cpp | 242 +--------------------------------- src/xml/sax/qxml_p.h | 306 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 307 insertions(+), 241 deletions(-) create mode 100644 src/xml/sax/qxml_p.h diff --git a/src/xml/sax/qxml.cpp b/src/xml/sax/qxml.cpp index 9d91ce42a54..7db8d5f503e 100644 --- a/src/xml/sax/qxml.cpp +++ b/src/xml/sax/qxml.cpp @@ -40,6 +40,7 @@ ****************************************************************************/ #include "qxml.h" +#include "qxml_p.h" #include "qtextcodec.h" #include "qbuffer.h" #include "qregexp.h" @@ -271,247 +272,6 @@ class QXmlDefaultHandlerPrivate { }; -class QXmlSimpleReaderPrivate -{ -public: - ~QXmlSimpleReaderPrivate(); -private: - // functions - QXmlSimpleReaderPrivate(QXmlSimpleReader *reader); - void initIncrementalParsing(); - - // used to determine if elements are correctly nested - QStack tags; - - // used by parseReference() and parsePEReference() - enum EntityRecognitionContext { InContent, InAttributeValue, InEntityValue, InDTD }; - - // used for entity declarations - struct ExternParameterEntity - { - ExternParameterEntity() {} - ExternParameterEntity(const QString &p, const QString &s) - : publicId(p), systemId(s) {} - QString publicId; - QString systemId; - - Q_DUMMY_COMPARISON_OPERATOR(ExternParameterEntity) - }; - struct ExternEntity - { - ExternEntity() {} - ExternEntity(const QString &p, const QString &s, const QString &n) - : publicId(p), systemId(s), notation(n) {} - QString publicId; - QString systemId; - QString notation; - Q_DUMMY_COMPARISON_OPERATOR(ExternEntity) - }; - QMap externParameterEntities; - QMap parameterEntities; - QMap externEntities; - QMap entities; - - // used for parsing of entity references - struct XmlRef { - XmlRef() - : index(0) {} - XmlRef(const QString &_name, const QString &_value) - : name(_name), value(_value), index(0) {} - bool isEmpty() const { return index == value.length(); } - QChar next() { return value.at(index++); } - QString name; - QString value; - int index; - }; - QStack xmlRefStack; - - // used for standalone declaration - enum Standalone { Yes, No, Unknown }; - - QString doctype; // only used for the doctype - QString xmlVersion; // only used to store the version information - QString encoding; // only used to store the encoding - Standalone standalone; // used to store the value of the standalone declaration - - QString publicId; // used by parseExternalID() to store the public ID - QString systemId; // used by parseExternalID() to store the system ID - - // Since publicId/systemId is used as temporary variables by parseExternalID(), it - // might overwrite the PUBLIC/SYSTEM for the document we're parsing. In effect, we would - // possibly send off an QXmlParseException that has the PUBLIC/SYSTEM of a entity declaration - // instead of those of the current document. - // Hence we have these two variables for storing the document's data. - QString thisPublicId; - QString thisSystemId; - - QString attDeclEName; // use by parseAttlistDecl() - QString attDeclAName; // use by parseAttlistDecl() - - // flags for some features support - bool useNamespaces; - bool useNamespacePrefixes; - bool reportWhitespaceCharData; - bool reportEntities; - - // used to build the attribute list - QXmlAttributes attList; - - // used in QXmlSimpleReader::parseContent() to decide whether character - // data was read - bool contentCharDataRead; - - // helper classes - QScopedPointer locator; - QXmlNamespaceSupport namespaceSupport; - - // error string - QString error; - - // arguments for parse functions (this is needed to allow incremental - // parsing) - bool parsePI_xmldecl; - bool parseName_useRef; - bool parseReference_charDataRead; - EntityRecognitionContext parseReference_context; - bool parseExternalID_allowPublicID; - EntityRecognitionContext parsePEReference_context; - QString parseString_s; - - // for incremental parsing - struct ParseState { - typedef bool (QXmlSimpleReaderPrivate::*ParseFunction)(); - ParseFunction function; - int state; - }; - QStack *parseStack; - - // used in parseProlog() - bool xmldecl_possible; - bool doctype_read; - - // used in parseDoctype() - bool startDTDwasReported; - - // used in parseString() - signed char Done; - - - // variables - QXmlContentHandler *contentHnd; - QXmlErrorHandler *errorHnd; - QXmlDTDHandler *dtdHnd; - QXmlEntityResolver *entityRes; - QXmlLexicalHandler *lexicalHnd; - QXmlDeclHandler *declHnd; - - QXmlInputSource *inputSource; - - QChar c; // the character at reading position - int lineNr; // number of line - int columnNr; // position in line - - QChar nameArray[256]; // only used for names - QString nameValue; // only used for names - int nameArrayPos; - int nameValueLen; - QChar refArray[256]; // only used for references - QString refValue; // only used for references - int refArrayPos; - int refValueLen; - QChar stringArray[256]; // used for any other strings that are parsed - QString stringValue; // used for any other strings that are parsed - int stringArrayPos; - int stringValueLen; - QString emptyStr; - - QHash literalEntitySizes; - // The entity at (QMap) times. - QHash > referencesToOtherEntities; - QHash expandedSizes; - // The limit to the amount of times the DTD parsing functions can be called - // for the DTD currently being parsed. - static const int dtdRecursionLimit = 2; - // The maximum amount of characters an entity value may contain, after expansion. - static const int entityCharacterLimit = 1024; - - const QString &string(); - void stringClear(); - void stringAddC(QChar); - inline void stringAddC() { stringAddC(c); } - const QString &name(); - void nameClear(); - void nameAddC(QChar); - inline void nameAddC() { nameAddC(c); } - const QString &ref(); - void refClear(); - void refAddC(QChar); - inline void refAddC() { refAddC(c); } - - // private functions - bool eat_ws(); - bool next_eat_ws(); - - void QT_FASTCALL next(); - bool atEnd(); - - void init(const QXmlInputSource* i); - void initData(); - - bool entityExist(const QString&) const; - - bool parseBeginOrContinue(int state, bool incremental); - - bool parseProlog(); - bool parseElement(); - bool processElementEmptyTag(); - bool processElementETagBegin2(); - bool processElementAttribute(); - bool parseMisc(); - bool parseContent(); - - bool parsePI(); - bool parseDoctype(); - bool parseComment(); - - bool parseName(); - bool parseNmtoken(); - bool parseAttribute(); - bool parseReference(); - bool processReference(); - - bool parseExternalID(); - bool parsePEReference(); - bool parseMarkupdecl(); - bool parseAttlistDecl(); - bool parseAttType(); - bool parseAttValue(); - bool parseElementDecl(); - bool parseNotationDecl(); - bool parseChoiceSeq(); - bool parseEntityDecl(); - bool parseEntityValue(); - - bool parseString(); - - bool insertXmlRef(const QString&, const QString&, bool); - - bool reportEndEntities(); - void reportParseError(const QString& error); - - typedef bool (QXmlSimpleReaderPrivate::*ParseFunction) (); - void unexpectedEof(ParseFunction where, int state); - void parseFailed(ParseFunction where, int state); - void pushParseState(ParseFunction function, int state); - - bool isExpandedEntityValueTooLarge(QString *errorMessage); - - Q_DECLARE_PUBLIC(QXmlSimpleReader) - QXmlSimpleReader *q_ptr; - - friend class QXmlSimpleReaderLocator; -}; - /*! \class QXmlParseException \reentrant diff --git a/src/xml/sax/qxml_p.h b/src/xml/sax/qxml_p.h new file mode 100644 index 00000000000..5babd98d13d --- /dev/null +++ b/src/xml/sax/qxml_p.h @@ -0,0 +1,306 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the QtXml module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QXML_P_H +#define QXML_P_H + +#include +#include +#include + +QT_BEGIN_NAMESPACE + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists for the convenience of +// qxml.cpp and qdom.cpp. This header file may change from version to version without +// notice, or even be removed. +// +// We mean it. +// + +class QXmlSimpleReaderPrivate +{ +public: + ~QXmlSimpleReaderPrivate(); +private: + // functions + QXmlSimpleReaderPrivate(QXmlSimpleReader *reader); + void initIncrementalParsing(); + + // used to determine if elements are correctly nested + QStack tags; + + // used by parseReference() and parsePEReference() + enum EntityRecognitionContext { InContent, InAttributeValue, InEntityValue, InDTD }; + + // used for entity declarations + struct ExternParameterEntity + { + ExternParameterEntity() {} + ExternParameterEntity(const QString &p, const QString &s) + : publicId(p), systemId(s) {} + QString publicId; + QString systemId; + + Q_DUMMY_COMPARISON_OPERATOR(ExternParameterEntity) + }; + struct ExternEntity + { + ExternEntity() {} + ExternEntity(const QString &p, const QString &s, const QString &n) + : publicId(p), systemId(s), notation(n) {} + QString publicId; + QString systemId; + QString notation; + Q_DUMMY_COMPARISON_OPERATOR(ExternEntity) + }; + QMap externParameterEntities; + QMap parameterEntities; + QMap externEntities; + QMap entities; + + // used for parsing of entity references + struct XmlRef { + XmlRef() + : index(0) {} + XmlRef(const QString &_name, const QString &_value) + : name(_name), value(_value), index(0) {} + bool isEmpty() const { return index == value.length(); } + QChar next() { return value.at(index++); } + QString name; + QString value; + int index; + }; + QStack xmlRefStack; + + // used for standalone declaration + enum Standalone { Yes, No, Unknown }; + + QString doctype; // only used for the doctype + QString xmlVersion; // only used to store the version information + QString encoding; // only used to store the encoding + Standalone standalone; // used to store the value of the standalone declaration + + QString publicId; // used by parseExternalID() to store the public ID + QString systemId; // used by parseExternalID() to store the system ID + + // Since publicId/systemId is used as temporary variables by parseExternalID(), it + // might overwrite the PUBLIC/SYSTEM for the document we're parsing. In effect, we would + // possibly send off an QXmlParseException that has the PUBLIC/SYSTEM of a entity declaration + // instead of those of the current document. + // Hence we have these two variables for storing the document's data. + QString thisPublicId; + QString thisSystemId; + + QString attDeclEName; // use by parseAttlistDecl() + QString attDeclAName; // use by parseAttlistDecl() + + // flags for some features support + bool useNamespaces; + bool useNamespacePrefixes; + bool reportWhitespaceCharData; + bool reportEntities; + + // used to build the attribute list + QXmlAttributes attList; + + // used in QXmlSimpleReader::parseContent() to decide whether character + // data was read + bool contentCharDataRead; + + // helper classes + QScopedPointer locator; + QXmlNamespaceSupport namespaceSupport; + + // error string + QString error; + + // arguments for parse functions (this is needed to allow incremental + // parsing) + bool parsePI_xmldecl; + bool parseName_useRef; + bool parseReference_charDataRead; + EntityRecognitionContext parseReference_context; + bool parseExternalID_allowPublicID; + EntityRecognitionContext parsePEReference_context; + QString parseString_s; + + // for incremental parsing + struct ParseState { + typedef bool (QXmlSimpleReaderPrivate::*ParseFunction)(); + ParseFunction function; + int state; + }; + QStack *parseStack; + + // used in parseProlog() + bool xmldecl_possible; + bool doctype_read; + + // used in parseDoctype() + bool startDTDwasReported; + + // used in parseString() + signed char Done; + + + // variables + QXmlContentHandler *contentHnd; + QXmlErrorHandler *errorHnd; + QXmlDTDHandler *dtdHnd; + QXmlEntityResolver *entityRes; + QXmlLexicalHandler *lexicalHnd; + QXmlDeclHandler *declHnd; + + QXmlInputSource *inputSource; + + QChar c; // the character at reading position + int lineNr; // number of line + int columnNr; // position in line + + QChar nameArray[256]; // only used for names + QString nameValue; // only used for names + int nameArrayPos; + int nameValueLen; + QChar refArray[256]; // only used for references + QString refValue; // only used for references + int refArrayPos; + int refValueLen; + QChar stringArray[256]; // used for any other strings that are parsed + QString stringValue; // used for any other strings that are parsed + int stringArrayPos; + int stringValueLen; + QString emptyStr; + + QHash literalEntitySizes; + // The entity at (QMap) times. + QHash > referencesToOtherEntities; + QHash expandedSizes; + // The limit to the amount of times the DTD parsing functions can be called + // for the DTD currently being parsed. + static const int dtdRecursionLimit = 2; + // The maximum amount of characters an entity value may contain, after expansion. + static const int entityCharacterLimit = 1024; + + const QString &string(); + void stringClear(); + void stringAddC(QChar); + inline void stringAddC() { stringAddC(c); } + const QString &name(); + void nameClear(); + void nameAddC(QChar); + inline void nameAddC() { nameAddC(c); } + const QString &ref(); + void refClear(); + void refAddC(QChar); + inline void refAddC() { refAddC(c); } + + // private functions + bool eat_ws(); + bool next_eat_ws(); + + void QT_FASTCALL next(); + bool atEnd(); + + void init(const QXmlInputSource* i); + void initData(); + + bool entityExist(const QString&) const; + + bool parseBeginOrContinue(int state, bool incremental); + + bool parseProlog(); + bool parseElement(); + bool processElementEmptyTag(); + bool processElementETagBegin2(); + bool processElementAttribute(); + bool parseMisc(); + bool parseContent(); + + bool parsePI(); + bool parseDoctype(); + bool parseComment(); + + bool parseName(); + bool parseNmtoken(); + bool parseAttribute(); + bool parseReference(); + bool processReference(); + + bool parseExternalID(); + bool parsePEReference(); + bool parseMarkupdecl(); + bool parseAttlistDecl(); + bool parseAttType(); + bool parseAttValue(); + bool parseElementDecl(); + bool parseNotationDecl(); + bool parseChoiceSeq(); + bool parseEntityDecl(); + bool parseEntityValue(); + + bool parseString(); + + bool insertXmlRef(const QString&, const QString&, bool); + + bool reportEndEntities(); + void reportParseError(const QString& error); + + typedef bool (QXmlSimpleReaderPrivate::*ParseFunction) (); + void unexpectedEof(ParseFunction where, int state); + void parseFailed(ParseFunction where, int state); + void pushParseState(ParseFunction function, int state); + + bool isExpandedEntityValueTooLarge(QString *errorMessage); + + Q_DECLARE_PUBLIC(QXmlSimpleReader) + QXmlSimpleReader *q_ptr; + + friend class QXmlSimpleReaderLocator; + friend class QDomHandler; +}; + +QT_END_NAMESPACE + +#endif // QXML_P_H From aabe80ae2895a4d7f115486c1e5f0033f33b6959 Mon Sep 17 00:00:00 2001 From: David Faure Date: Sun, 22 Jun 2014 13:57:26 +0200 Subject: [PATCH 03/24] Make QDom/QXmlSimpleReader reentrant. I moved the evil static bool to QXmlSimpleReaderPrivate, and used it from QDom, when the reader instance is a QXmlSimpleReader (if it's not, nothing happens, like before). Task-number: QTBUG-40015 Change-Id: I54ba89db334d7b086379c4a6840cf0de23f77027 Reviewed-by: Thiago Macieira --- src/xml/dom/qdom.cpp | 23 ++++++++++++----------- src/xml/sax/qxml.cpp | 18 +++++++----------- src/xml/sax/qxml.h | 1 + src/xml/sax/qxml_p.h | 2 ++ 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/xml/dom/qdom.cpp b/src/xml/dom/qdom.cpp index 2383bda1c9a..5907a72bd64 100644 --- a/src/xml/dom/qdom.cpp +++ b/src/xml/dom/qdom.cpp @@ -54,6 +54,7 @@ #include #include #include +#include "private/qxml_p.h" #include #include #include @@ -502,7 +503,7 @@ public: ~QDomDocumentPrivate(); bool setContent(QXmlInputSource *source, bool namespaceProcessing, QString *errorMsg, int *errorLine, int *errorColumn); - bool setContent(QXmlInputSource *source, QXmlReader *reader, QString *errorMsg, int *errorLine, int *errorColumn); + bool setContent(QXmlInputSource *source, QXmlReader *reader, QXmlSimpleReader *simpleReader, QString *errorMsg, int *errorLine, int *errorColumn); // Attributes QDomDocumentTypePrivate* doctype() { return type.data(); } @@ -573,7 +574,7 @@ public: class QDomHandler : public QXmlDefaultHandler { public: - QDomHandler(QDomDocumentPrivate* d, bool namespaceProcessing); + QDomHandler(QDomDocumentPrivate* d, QXmlSimpleReader *reader, bool namespaceProcessing); ~QDomHandler(); // content handler @@ -615,6 +616,7 @@ private: bool cdata; bool nsProcessing; QXmlLocator *locator; + QXmlSimpleReader *reader; }; /************************************************************** @@ -6208,10 +6210,10 @@ bool QDomDocumentPrivate::setContent(QXmlInputSource *source, bool namespaceProc { QXmlSimpleReader reader; initializeReader(reader, namespaceProcessing); - return setContent(source, &reader, errorMsg, errorLine, errorColumn); + return setContent(source, &reader, &reader, errorMsg, errorLine, errorColumn); } -bool QDomDocumentPrivate::setContent(QXmlInputSource *source, QXmlReader *reader, QString *errorMsg, int *errorLine, int *errorColumn) +bool QDomDocumentPrivate::setContent(QXmlInputSource *source, QXmlReader *reader, QXmlSimpleReader *simpleReader, QString *errorMsg, int *errorLine, int *errorColumn) { clear(); impl = new QDomImplementationPrivate; @@ -6221,7 +6223,7 @@ bool QDomDocumentPrivate::setContent(QXmlInputSource *source, QXmlReader *reader bool namespaceProcessing = reader->feature(QLatin1String("http://xml.org/sax/features/namespaces")) && !reader->feature(QLatin1String("http://xml.org/sax/features/namespace-prefixes")); - QDomHandler hnd(this, namespaceProcessing); + QDomHandler hnd(this, simpleReader, namespaceProcessing); reader->setContentHandler(&hnd); reader->setErrorHandler(&hnd); reader->setLexicalHandler(&hnd); @@ -6758,7 +6760,7 @@ bool QDomDocument::setContent(QXmlInputSource *source, bool namespaceProcessing, impl = new QDomDocumentPrivate(); QXmlSimpleReader reader; initializeReader(reader, namespaceProcessing); - return IMPL->setContent(source, &reader, errorMsg, errorLine, errorColumn); + return IMPL->setContent(source, &reader, &reader, errorMsg, errorLine, errorColumn); } /*! @@ -6820,7 +6822,7 @@ bool QDomDocument::setContent(QXmlInputSource *source, QXmlReader *reader, QStri { if (!impl) impl = new QDomDocumentPrivate(); - return IMPL->setContent(source, reader, errorMsg, errorLine, errorColumn); + return IMPL->setContent(source, reader, 0, errorMsg, errorLine, errorColumn); } /*! @@ -7360,9 +7362,9 @@ QDomComment QDomNode::toComment() const * **************************************************************/ -QDomHandler::QDomHandler(QDomDocumentPrivate* adoc, bool namespaceProcessing) +QDomHandler::QDomHandler(QDomDocumentPrivate* adoc, QXmlSimpleReader* areader, bool namespaceProcessing) : errorLine(0), errorColumn(0), doc(adoc), node(adoc), cdata(false), - nsProcessing(namespaceProcessing), locator(0) + nsProcessing(namespaceProcessing), locator(0), reader(areader) { } @@ -7466,11 +7468,10 @@ bool QDomHandler::processingInstruction(const QString& target, const QString& da return false; } -extern bool qt_xml_skipped_entity_in_content; bool QDomHandler::skippedEntity(const QString& name) { // we can only handle inserting entity references into content - if (!qt_xml_skipped_entity_in_content) + if (reader && !reader->d_ptr->skipped_entity_in_content) return true; QDomNodePrivate *n = doc->createEntityReference(name); diff --git a/src/xml/sax/qxml.cpp b/src/xml/sax/qxml.cpp index 7db8d5f503e..50900c17f00 100644 --- a/src/xml/sax/qxml.cpp +++ b/src/xml/sax/qxml.cpp @@ -100,10 +100,6 @@ static const signed char cltDq = 12; // " static const signed char cltSq = 13; // ' static const signed char cltUnknown = 14; -// Hack for letting QDom know where the skipped entity occurred -// ### the use of this variable means the code isn't reentrant. -bool qt_xml_skipped_entity_in_content; - // character lookup table static const signed char charLookupTable[256]={ cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, // 0x00 - 0x07 @@ -3230,7 +3226,7 @@ bool QXmlSimpleReader::parse(const QXmlInputSource *input, bool incremental) return false; } } - qt_xml_skipped_entity_in_content = false; + d->skipped_entity_in_content = false; return d->parseBeginOrContinue(0, incremental); } @@ -7594,13 +7590,13 @@ bool QXmlSimpleReaderPrivate::processReference() } if (contentHnd) { - qt_xml_skipped_entity_in_content = parseReference_context == InContent; + skipped_entity_in_content = parseReference_context == InContent; if (!contentHnd->skippedEntity(reference)) { - qt_xml_skipped_entity_in_content = false; + skipped_entity_in_content = false; reportParseError(contentHnd->errorString()); return false; // error } - qt_xml_skipped_entity_in_content = false; + skipped_entity_in_content = false; } } } else if ((*itExtern).notation.isNull()) { @@ -7630,13 +7626,13 @@ bool QXmlSimpleReaderPrivate::processReference() } } if (skipIt && contentHnd) { - qt_xml_skipped_entity_in_content = true; + skipped_entity_in_content = true; if (!contentHnd->skippedEntity(reference)) { - qt_xml_skipped_entity_in_content = false; + skipped_entity_in_content = false; reportParseError(contentHnd->errorString()); return false; // error } - qt_xml_skipped_entity_in_content = false; + skipped_entity_in_content = false; } parseReference_charDataRead = false; } break; diff --git a/src/xml/sax/qxml.h b/src/xml/sax/qxml.h index 743f8702af2..2f276f75c6c 100644 --- a/src/xml/sax/qxml.h +++ b/src/xml/sax/qxml.h @@ -269,6 +269,7 @@ private: QScopedPointer d_ptr; friend class QXmlSimpleReaderLocator; + friend class QDomHandler; }; // diff --git a/src/xml/sax/qxml_p.h b/src/xml/sax/qxml_p.h index 5babd98d13d..1cb919a5541 100644 --- a/src/xml/sax/qxml_p.h +++ b/src/xml/sax/qxml_p.h @@ -148,6 +148,8 @@ private: // used in QXmlSimpleReader::parseContent() to decide whether character // data was read bool contentCharDataRead; + // Hack for letting QDom know where the skipped entity occurred + bool skipped_entity_in_content; // helper classes QScopedPointer locator; From 1a32cc0ae42a4a49f2d45b8ad8251ec40a30bf76 Mon Sep 17 00:00:00 2001 From: Martin Pley Date: Tue, 10 Jun 2014 12:53:59 +0200 Subject: [PATCH 04/24] QPdf::addImage(): avoid a QImage detach when it's in an acceptable Format Don't detach QImage, when it's in Format_Mono or Format_ARG32. Use QImage::constScanLine() instead of QImage::scanLine(). Change-Id: I30fcafb576aea3189637a40fd75f77c70017ba46 Reviewed-by: John Layt Reviewed-by: Gunnar Sletta --- src/gui/painting/qpdf.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/painting/qpdf.cpp b/src/gui/painting/qpdf.cpp index bda5df3d139..0c888d645d2 100644 --- a/src/gui/painting/qpdf.cpp +++ b/src/gui/painting/qpdf.cpp @@ -2362,7 +2362,7 @@ int QPdfEnginePrivate::addImage(const QImage &img, bool *bitmap, qint64 serial_n data.resize(bytesPerLine * h); char *rawdata = data.data(); for (int y = 0; y < h; ++y) { - memcpy(rawdata, image.scanLine(y), bytesPerLine); + memcpy(rawdata, image.constScanLine(y), bytesPerLine); rawdata += bytesPerLine; } object = writeImage(data, w, h, d, 0, 0); @@ -2384,7 +2384,7 @@ int QPdfEnginePrivate::addImage(const QImage &img, bool *bitmap, qint64 serial_n softMaskData.resize(w * h); uchar *sdata = (uchar *)softMaskData.data(); for (int y = 0; y < h; ++y) { - const QRgb *rgb = (const QRgb *)image.scanLine(y); + const QRgb *rgb = (const QRgb *)image.constScanLine(y); for (int x = 0; x < w; ++x) { uchar alpha = qAlpha(*rgb); *sdata++ = alpha; @@ -2400,7 +2400,7 @@ int QPdfEnginePrivate::addImage(const QImage &img, bool *bitmap, qint64 serial_n softMaskData.resize(w * h); uchar *sdata = (uchar *)softMaskData.data(); for (int y = 0; y < h; ++y) { - const QRgb *rgb = (const QRgb *)image.scanLine(y); + const QRgb *rgb = (const QRgb *)image.constScanLine(y); if (grayscale) { for (int x = 0; x < w; ++x) { *(data++) = qGray(*rgb); From 5b4c996f3643d3805080cd3eabba97295348ecb7 Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Thu, 3 Jul 2014 16:09:18 +0200 Subject: [PATCH 05/24] Accessibility Linux: Fix crashes when accessing invalid functions There is no way to prevent ATs from calling random functions on DBus. While these functions shouldn't exist when we don't advertise the interface, they should just fail gracefully. Task-number: QTBUG-40044 Change-Id: Ia29b49b16feabc0beb80007456e53497f230c7d4 Reviewed-by: Gabriel de Dietrich --- .../linuxaccessibility/atspiadaptor.cpp | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/platformsupport/linuxaccessibility/atspiadaptor.cpp b/src/platformsupport/linuxaccessibility/atspiadaptor.cpp index 0fa1d962422..84f82cdedac 100644 --- a/src/platformsupport/linuxaccessibility/atspiadaptor.cpp +++ b/src/platformsupport/linuxaccessibility/atspiadaptor.cpp @@ -2071,7 +2071,10 @@ bool AtSpiAdaptor::editableTextInterface(QAccessibleInterface *interface, const connection.send(message.createReply(true)); } else if (function == QLatin1String("SetTextContents")) { QString newContents = message.arguments().at(0).toString(); - interface->editableTextInterface()->replaceText(0, interface->textInterface()->characterCount(), newContents); + if (QAccessibleEditableTextInterface *editableTextIface = interface->editableTextInterface()) + editableTextIface->replaceText(0, interface->textInterface()->characterCount(), newContents); + else + replaceTextFallback(interface, 0, -1, newContents); connection.send(message.createReply(true)); } else if (function == QLatin1String("")) { connection.send(message.createReply()); @@ -2085,23 +2088,27 @@ bool AtSpiAdaptor::editableTextInterface(QAccessibleInterface *interface, const // Value interface bool AtSpiAdaptor::valueInterface(QAccessibleInterface *interface, const QString &function, const QDBusMessage &message, const QDBusConnection &connection) { + QAccessibleValueInterface *valueIface = interface->valueInterface(); + if (!valueIface) + return false; + if (function == QLatin1String("SetCurrentValue")) { QDBusVariant v = message.arguments().at(2).value(); double value = v.variant().toDouble(); //Temporary fix //See https://bugzilla.gnome.org/show_bug.cgi?id=652596 - interface->valueInterface()->setCurrentValue(value); + valueIface->setCurrentValue(value); connection.send(message.createReply()); // FIXME is the reply needed? } else { QVariant value; if (function == QLatin1String("GetCurrentValue")) - value = interface->valueInterface()->currentValue(); + value = valueIface->currentValue(); else if (function == QLatin1String("GetMaximumValue")) - value = interface->valueInterface()->maximumValue(); + value = valueIface->maximumValue(); else if (function == QLatin1String("GetMinimumIncrement")) - value = interface->valueInterface()->minimumStepSize(); + value = valueIface->minimumStepSize(); else if (function == QLatin1String("GetMinimumValue")) - value = interface->valueInterface()->minimumValue(); + value = valueIface->minimumValue(); else { qAtspiDebug() << "WARNING: AtSpiAdaptor::valueInterface does not implement " << function << message.path(); return false; From 88a47439d127fa31280542373f08fcb019331222 Mon Sep 17 00:00:00 2001 From: Liang Qi Date: Thu, 3 Jul 2014 09:07:23 +0200 Subject: [PATCH 06/24] Doc: fix a link in QAbstractOpenGLFunctions documentation Change-Id: Icc0109de22de756f7e4b3e888b0ee28a9b9c04d5 Reviewed-by: Sean Harmer --- src/gui/opengl/qopenglversionfunctions.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/opengl/qopenglversionfunctions.cpp b/src/gui/opengl/qopenglversionfunctions.cpp index 5df7463e8a0..5949eb6391e 100644 --- a/src/gui/opengl/qopenglversionfunctions.cpp +++ b/src/gui/opengl/qopenglversionfunctions.cpp @@ -160,7 +160,7 @@ void QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(QOpenGLContext *con A pointer to an object of the class corresponding to the version and profile of OpenGL in use can be obtained from - QOpenGLFunctions::versionFunctions(). If obtained in this way, note that + QOpenGLContext::versionFunctions(). If obtained in this way, note that the QOpenGLContext retains ownership of the object. This is so that only one instance need be created. From d7bb914ac8046d5799d73eec9a801b61e7d8695a Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 3 Jul 2014 13:48:22 +0200 Subject: [PATCH 07/24] Fix debug output of QTouchEvent. Return dbg.space(). Task-number: QTBUG-29946 Change-Id: Ia79b297ee3801ccba9f7b1c22ac7a8761cbe8b2e Reviewed-by: Shawn Rutledge --- src/gui/kernel/qevent.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp index bb7000a2664..d6741af1520 100644 --- a/src/gui/kernel/qevent.cpp +++ b/src/gui/kernel/qevent.cpp @@ -3541,7 +3541,7 @@ QDebug operator<<(QDebug dbg, const QEvent *e) { case QEvent::TouchEnd: n = n ? n : "TouchEnd"; formatTouchEvent(dbg.nospace(), n, *static_cast(e)); - return dbg.nospace(); + return dbg.space(); case QEvent::ChildAdded: n = n ? n : "ChildAdded"; case QEvent::ChildPolished: n = n ? n : "ChildPolished"; case QEvent::ChildRemoved: n = n ? n : "ChildRemoved"; From 76371c4d560c5a13f54f1ed9078fb68a393aa1bd Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Wed, 2 Jul 2014 21:08:54 +0200 Subject: [PATCH 08/24] Improve QListWidget documentation. Mention that removeItemWidget() isn't sufficient to remove a row. List related functions so that it's easy to see the relation between them. Change-Id: Ia1d467390f00976e2276d50df35dd555f7992a9a Reviewed-by: J-P Nurmi --- src/widgets/itemviews/qlistwidget.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/widgets/itemviews/qlistwidget.cpp b/src/widgets/itemviews/qlistwidget.cpp index 1f954d67dd3..f376583f555 100644 --- a/src/widgets/itemviews/qlistwidget.cpp +++ b/src/widgets/itemviews/qlistwidget.cpp @@ -1325,6 +1325,11 @@ void QListWidgetPrivate::_q_dataChanged(const QModelIndex &topLeft, \fn void QListWidget::removeItemWidget(QListWidgetItem *item) Removes the widget set on the given \a item. + + To remove an item (row) from the list entirely, either delete the item or + use takeItem(). + + \sa itemWidget(), setItemWidget() */ /*! @@ -1620,6 +1625,8 @@ void QListWidget::closePersistentEditor(QListWidgetItem *item) \since 4.1 Returns the widget displayed in the given \a item. + + \sa setItemWidget(), removeItemWidget() */ QWidget *QListWidget::itemWidget(QListWidgetItem *item) const { @@ -1638,7 +1645,7 @@ QWidget *QListWidget::itemWidget(QListWidgetItem *item) const implement a custom editor widget, use QListView and subclass QItemDelegate instead. - \sa {Delegate Classes} + \sa itemWidget(), removeItemWidget(), {Delegate Classes} */ void QListWidget::setItemWidget(QListWidgetItem *item, QWidget *widget) { From 16dccb24e4e7fb6332f672e1572e7ca359f794c5 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 20 Jun 2014 15:57:16 -0700 Subject: [PATCH 09/24] Attempt to work with Visual Studio in -Za (strict ANSI) mode Visual Studio always treats enum values as signed int, even when the value doesn't fit in a signed int (like 0x80000000 or larger than 32- the tags themselves are still signed. That causes ambiguity in creating a QFlag from an enum value. Visual C++ defines __STDC__ in C mode, but we have no macro in C++ mode. Also note that the Windows SDK headers don't compile in -Za mode. Task-number: QTBUG-39700 Change-Id: Ia943cef37ac1f539bd461c3c18200b0c365c72b3 Reviewed-by: Olivier Goffart --- src/corelib/global/qflags.h | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/src/corelib/global/qflags.h b/src/corelib/global/qflags.h index 9e97724fec6..bdfc453e081 100644 --- a/src/corelib/global/qflags.h +++ b/src/corelib/global/qflags.h @@ -53,16 +53,22 @@ class QFlag { int i; public: -#if !defined(__LP64__) && !defined(Q_QDOC) + Q_DECL_CONSTEXPR inline QFlag(int ai) : i(ai) {} + Q_DECL_CONSTEXPR inline operator int() const { return i; } + +#if !defined(Q_CC_MSVC) + // Microsoft Visual Studio has buggy behavior when it comes to + // unsigned enums: even if the enum is unsigned, the enum tags are + // always signed +# if !defined(__LP64__) && !defined(Q_QDOC) Q_DECL_CONSTEXPR inline QFlag(long ai) : i(int(ai)) {} Q_DECL_CONSTEXPR inline QFlag(ulong ai) : i(int(long(ai))) {} -#endif - Q_DECL_CONSTEXPR inline QFlag(int ai) : i(ai) {} +# endif Q_DECL_CONSTEXPR inline QFlag(uint ai) : i(int(ai)) {} Q_DECL_CONSTEXPR inline QFlag(short ai) : i(int(ai)) {} Q_DECL_CONSTEXPR inline QFlag(ushort ai) : i(int(uint(ai))) {} - Q_DECL_CONSTEXPR inline operator int() const { return i; } Q_DECL_CONSTEXPR inline operator uint() const { return uint(i); } +#endif }; Q_DECLARE_TYPEINFO(QFlag, Q_PRIMITIVE_TYPE); @@ -89,7 +95,11 @@ class QFlags struct Private; typedef int (Private::*Zero); public: -#ifndef Q_QDOC +#if defined(Q_CC_MSVC) || defined(Q_QDOC) + // see above for MSVC + // the definition below is too complex for qdoc + typedef int Int; +#else typedef typename QtPrivate::if_< QtPrivate::is_unsigned::value, unsigned int, @@ -99,7 +109,6 @@ public: typedef Enum enum_type; // compiler-generated copy/move ctor/assignment operators are fine! #ifdef Q_QDOC - typedef int Int; // the real typedef above is too complex for qdoc inline QFlags(const QFlags &other); inline QFlags &operator=(const QFlags &other); #endif From a6ec09d7ed8474e64589b1c8d149f953a9942b50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0smail=20D=C3=B6nmez?= Date: Sun, 6 Jul 2014 14:54:40 +0300 Subject: [PATCH 10/24] Fix QTimer with negative interval in QWidgetLineControl::setCursorBlinkPeriod When keyboard blink is disabled, msec will be negative (-2 in my case). In that case if (msec) will evaluate to true and create a QTimer with a negative interval. Fix is to check for msec > 0. Change-Id: I5c8d82c3cdaf26a961c986f4164805aacfe3ae37 Reviewed-by: J-P Nurmi --- src/widgets/widgets/qwidgetlinecontrol.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/widgets/widgets/qwidgetlinecontrol.cpp b/src/widgets/widgets/qwidgetlinecontrol.cpp index b16477246ff..75f30599be4 100644 --- a/src/widgets/widgets/qwidgetlinecontrol.cpp +++ b/src/widgets/widgets/qwidgetlinecontrol.cpp @@ -1472,7 +1472,7 @@ void QWidgetLineControl::setCursorBlinkPeriod(int msec) if (m_blinkTimer) { killTimer(m_blinkTimer); } - if (msec && !m_readOnly) { + if (msec > 0 && !m_readOnly) { m_blinkTimer = startTimer(msec / 2); m_blinkStatus = 1; } else { From a2948e1387ce1fb6d624d7387aa7769a5c5a4dad Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Sun, 6 Jul 2014 09:59:08 +0200 Subject: [PATCH 11/24] Fix typo in QGraphicsView documentation. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ib750a78e86b8af87d091705a1107ca1eccf32389 Reviewed-by: Topi Reiniö --- src/widgets/doc/src/graphicsview.qdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/widgets/doc/src/graphicsview.qdoc b/src/widgets/doc/src/graphicsview.qdoc index 148b4ea47de..d1d86309351 100644 --- a/src/widgets/doc/src/graphicsview.qdoc +++ b/src/widgets/doc/src/graphicsview.qdoc @@ -301,7 +301,7 @@ pass a QPainterPath to mapToScene(), and then pass the mapped path to QGraphicsScene::items(). - You can map coordinates and shapes to and from and item's scene by + You can map coordinates and shapes to and from an item's scene by calling QGraphicsItem::mapToScene() and QGraphicsItem::mapFromScene(). You can also map to an item's parent item by calling QGraphicsItem::mapToParent() and From f17494e9b829f079bf632eed7757c1a30f360b68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Str=C3=B8mme?= Date: Thu, 12 Jun 2014 14:49:37 +0200 Subject: [PATCH 12/24] Android: Refactor exception checking in qjni. In places where we call java/jni functions that can throw exceptions, we check and clear the exception, if necessary. This change moves the "checking" code into a single (private) function. Change-Id: Ic3de2be51305972b096e1ed0a477e341eb5d9404 Reviewed-by: Yoann Lopes --- src/corelib/kernel/qjni.cpp | 35 ++++++++++++++++------------------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/src/corelib/kernel/qjni.cpp b/src/corelib/kernel/qjni.cpp index 437205bf92a..aa9b196e622 100644 --- a/src/corelib/kernel/qjni.cpp +++ b/src/corelib/kernel/qjni.cpp @@ -67,6 +67,19 @@ static QString qt_convertJString(jstring string) return res; } +static inline bool exceptionCheckAndClear(JNIEnv *env) +{ + if (Q_UNLIKELY(env->ExceptionCheck())) { +#ifdef QT_DEBUG + env->ExceptionDescribe(); +#endif // QT_DEBUG + env->ExceptionClear(); + return true; + } + + return false; +} + typedef QHash JClassHash; Q_GLOBAL_STATIC(JClassHash, cachedClasses) @@ -85,14 +98,8 @@ static jclass getCachedClass(JNIEnv *env, const char *className) QJNIObjectPrivate classObject = classLoader.callObjectMethod("loadClass", "(Ljava/lang/String;)Ljava/lang/Class;", stringName.object()); - if (env->ExceptionCheck()) { -#ifdef QT_DEBUG - env->ExceptionDescribe(); -#endif // QT_DEBUG - env->ExceptionClear(); - } - if (classObject.isValid()) + if (!exceptionCheckAndClear(env) && classObject.isValid()) clazz = static_cast(env->NewGlobalRef(classObject.object())); cachedClasses->insert(key, clazz); @@ -121,13 +128,8 @@ static jmethodID getCachedMethodID(JNIEnv *env, else id = env->GetMethodID(clazz, name, sig); - if (env->ExceptionCheck()) { + if (exceptionCheckAndClear(env)) id = 0; -#ifdef QT_DEBUG - env->ExceptionDescribe(); -#endif // QT_DEBUG - env->ExceptionClear(); - } cachedMethodID->insert(key, id); } else { @@ -154,13 +156,8 @@ static jfieldID getCachedFieldID(JNIEnv *env, else id = env->GetFieldID(clazz, name, sig); - if (env->ExceptionCheck()) { + if (exceptionCheckAndClear(env)) id = 0; -#ifdef QT_DEBUG - env->ExceptionDescribe(); -#endif // QT_DEBUG - env->ExceptionClear(); - } cachedFieldID->insert(key, id); } else { From 637ac8a81e73e349ce898d7da12c279a43632882 Mon Sep 17 00:00:00 2001 From: Nico Vertriest Date: Fri, 4 Jul 2014 14:03:53 +0200 Subject: [PATCH 13/24] Doc: removed trolltech.com from namespace in manual qdocconf file Task-number: QTBUG-23270 Change-Id: Id65ded1adbbb4f15ef5634f9a984c6cfad5c18d5 Reviewed-by: Martin Smith --- src/tools/qdoc/doc/qdoc-manual-qdocconf.qdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/qdoc/doc/qdoc-manual-qdocconf.qdoc b/src/tools/qdoc/doc/qdoc-manual-qdocconf.qdoc index a28e65e9767..913f8fcc009 100644 --- a/src/tools/qdoc/doc/qdoc-manual-qdocconf.qdoc +++ b/src/tools/qdoc/doc/qdoc-manual-qdocconf.qdoc @@ -1072,7 +1072,7 @@ \code qhp.Qt.file = qt.qhp - qhp.Qt.namespace = com.trolltech.qt.440 + qhp.Qt.namespace = org.qt-project.qtcore.$QT_VERSION_TAG qhp.Qt.virtualFolder = qdoc qhp.Qt.indexTitle = Qt Reference Documentation qhp.Qt.indexRoot = From 81bd9633cc73eb710f144aabfa6d7f32a1d69660 Mon Sep 17 00:00:00 2001 From: Niels Weber Date: Mon, 7 Jul 2014 13:23:02 +0200 Subject: [PATCH 14/24] Fix for code snippet in commandlineparser documentation One line in the code snippet wasn't translated whlie the others were. Change-Id: Ie77a317833f800087b485609cd001dd26060a40f Reviewed-by: Leena Miettinen --- .../code/src_corelib_tools_qcommandlineparser_main.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/corelib/doc/snippets/code/src_corelib_tools_qcommandlineparser_main.cpp b/src/corelib/doc/snippets/code/src_corelib_tools_qcommandlineparser_main.cpp index 46b4274301c..257a138d0dd 100644 --- a/src/corelib/doc/snippets/code/src_corelib_tools_qcommandlineparser_main.cpp +++ b/src/corelib/doc/snippets/code/src_corelib_tools_qcommandlineparser_main.cpp @@ -59,7 +59,8 @@ int main(int argc, char *argv[]) parser.addOption(showProgressOption); // A boolean option with multiple names (-f, --force) - QCommandLineOption forceOption(QStringList() << "f" << "force", "Overwrite existing files."); + QCommandLineOption forceOption(QStringList() << "f" << "force", + QCoreApplication::translate("main", "Overwrite existing files.")); parser.addOption(forceOption); // An option with a value From 9569836668d4f92ee6664dc2074d9a863fa5cb9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0smail=20D=C3=B6nmez?= Date: Mon, 7 Jul 2014 19:02:11 +0300 Subject: [PATCH 15/24] Document QApplication::cursorFlashTime() can return -1 On Windows QApplication::cursorFlashTime() can return -1 if keyboard blinking is disabled. Add documentation for that case. Change-Id: I1e5d683573e55b045e2d9bd9804daf4be579fd02 Reviewed-by: J-P Nurmi Reviewed-by: Giuseppe D'Angelo --- src/widgets/kernel/qapplication.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp index 0b983e7a9d3..520fc2db67f 100644 --- a/src/widgets/kernel/qapplication.cpp +++ b/src/widgets/kernel/qapplication.cpp @@ -3648,6 +3648,9 @@ bool QApplication::keypadNavigationEnabled() We recommend that widgets do not cache this value as it may change at any time if the user changes the global desktop settings. + + \note This property may hold a negative value, for instance if cursor + blinking is disabled. */ void QApplication::setCursorFlashTime(int msecs) { From ac2b15bdd0fa960644b956fbc9a8bf9fe5ff68f5 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Tue, 1 Jul 2014 09:11:00 +0200 Subject: [PATCH 16/24] Android: [REG] Fix QScreen::physicalSize() The physical size should be set based on the screen size, not the available geometry. This used to work in Qt 5.3.0 because the screenSize and size of the available geometry was identical on startup, but in Qt 5.3.1 the available geometry is 0x0 until there the metrics are actually available to avoid flickering on startup, so this caused a regression. [ChangeLog][Android] Fixed regression where QScreen::physicalSize() would return 0x0. Change-Id: I6c2ee11205427a88764e129b05ece6d3fbbf4c99 Task-number: QTBUG-39978 Reviewed-by: Christian Stromme Reviewed-by: BogDan Vatra --- src/plugins/platforms/android/androidjnimain.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/platforms/android/androidjnimain.cpp b/src/plugins/platforms/android/androidjnimain.cpp index 09c56f398cb..d82487ae9ba 100644 --- a/src/plugins/platforms/android/androidjnimain.cpp +++ b/src/plugins/platforms/android/androidjnimain.cpp @@ -562,13 +562,13 @@ static void setDisplayMetrics(JNIEnv */*env*/, jclass /*clazz*/, if (!m_androidPlatformIntegration) { QAndroidPlatformIntegration::setDefaultDisplayMetrics(desktopWidthPixels, desktopHeightPixels, - qRound(double(desktopWidthPixels) / xdpi * 25.4), - qRound(double(desktopHeightPixels) / ydpi * 25.4), + qRound(double(widthPixels) / xdpi * 25.4), + qRound(double(heightPixels) / ydpi * 25.4), widthPixels, heightPixels); } else { - m_androidPlatformIntegration->setDisplayMetrics(qRound(double(desktopWidthPixels) / xdpi * 25.4), - qRound(double(desktopHeightPixels) / ydpi * 25.4)); + m_androidPlatformIntegration->setDisplayMetrics(qRound(double(widthPixels) / xdpi * 25.4), + qRound(double(heightPixels) / ydpi * 25.4)); m_androidPlatformIntegration->setDesktopSize(desktopWidthPixels, desktopHeightPixels); m_androidPlatformIntegration->setScreenSize(widthPixels, heightPixels); } From 1c08a41cb9b4a080b2465b1df70941e9c508bf1f Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Tue, 1 Jul 2014 13:11:03 +0200 Subject: [PATCH 17/24] Support getting test data from qrc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If none of the other locations work, we can fall back to bundling the test data in qrc to make it possible to include test data on platforms that do not have any good way of deploying files to the traditional file system, like Android. Change-Id: I7779ce6be2380d551697cecfb9f76652d1fd0a38 Reviewed-by: Tor Arne Vestbø --- src/testlib/qtestcase.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp index ffcc7abbfe9..5d2014b0c56 100644 --- a/src/testlib/qtestcase.cpp +++ b/src/testlib/qtestcase.cpp @@ -2708,6 +2708,13 @@ QString QTest::qFindTestData(const QString& base, const char *file, int line, co } } + // 4. Try resources + if (found.isEmpty()) { + QString candidate = QString::fromLatin1(":/%1").arg(base); + if (QFileInfo(candidate).exists()) + found = candidate; + } + if (found.isEmpty()) { QTest::qWarn(qPrintable( QString::fromLatin1("testdata %1 could not be located!").arg(base)), From b56a42be1476d7b3330968d81329a5e29b5fb819 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Tue, 24 Jun 2014 12:40:03 +0200 Subject: [PATCH 18/24] REG: Fix nbsp in QTextLayout At some point since Qt 4.8, the nbsp character has acquired the whitespace attribute, causing it to be treated exactly like an ordinary space. To account for this, we add an extra check in the layout code to avoid breaking on non-breaking spaces even if they have the whiteSpace flag set. This is a temporary fix for the regression. The line breaking algorithm needs to be refactored and support Unicode tr14 properly, which it currently doesn't. [ChangeLog][Text] Fixed lines breaking on non-breaking spaces. Task-number: QTBUG-39832 Change-Id: Ibd7e1a11ce4b82c611ecda1542c8638a67bf3cae Reviewed-by: Konstantin Ritt --- src/gui/text/qtextlayout.cpp | 11 ++++++++- .../gui/text/qtextlayout/tst_qtextlayout.cpp | 24 +++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp index 84ad9038d5d..ede7426ffc0 100644 --- a/src/gui/text/qtextlayout.cpp +++ b/src/gui/text/qtextlayout.cpp @@ -1842,8 +1842,17 @@ void QTextLine::layout_helper(int maxGlyphs) addNextCluster(lbh.currentPosition, end, lbh.tmpData, lbh.glyphCount, current, lbh.logClusters, lbh.glyphs); + // This is a hack to fix a regression caused by the introduction of the + // whitespace flag to non-breakable spaces and will cause the non-breakable + // spaces to behave as in previous Qt versions in the line breaking algorithm. + // The line breaks do not currently follow the Unicode specs, but fixing this would + // require refactoring the code and would cause behavioral regressions. + bool isBreakableSpace = lbh.currentPosition < eng->layoutData->string.length() + && attributes[lbh.currentPosition].whiteSpace + && eng->layoutData->string.at(lbh.currentPosition).decompositionTag() != QChar::NoBreak; + if (lbh.currentPosition >= eng->layoutData->string.length() - || attributes[lbh.currentPosition].whiteSpace + || isBreakableSpace || attributes[lbh.currentPosition].lineBreak) { sb_or_ws = true; break; diff --git a/tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp b/tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp index 26eaec0470a..ec698e5db43 100644 --- a/tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp +++ b/tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp @@ -139,6 +139,7 @@ private slots: void cursorInLigatureWithMultipleLines(); void xToCursorForLigatures(); void cursorInNonStopChars(); + void nbsp(); private: QFont testFont; @@ -2011,5 +2012,28 @@ void tst_QTextLayout::justifyTrailingSpaces() QVERIFY(qFuzzyIsNull(layout.lineAt(0).cursorToX(0))); } +void tst_QTextLayout::nbsp() +{ + QString s = QString() + QChar(' ') + QChar('a') + QString(10, QChar::Nbsp) + QChar('a') + QChar(' ') + QChar('A'); + QString text = s + s + s + s + s + s + s + s + s + s + s + s + s + s; + QTextLayout layout(text); + layout.setCacheEnabled(true); + layout.beginLayout(); + layout.createLine(); + layout.endLayout(); + + int naturalWidth = qCeil(layout.lineAt(0).naturalTextWidth()); + int lineWidth = naturalWidth; + + layout.beginLayout(); + QTextLine line = layout.createLine(); + while (lineWidth-- > naturalWidth / 2) { + line.setLineWidth(lineWidth); + QVERIFY(text.at(line.textLength()-1).unicode() != QChar::Nbsp); + } + + layout.endLayout(); +} + QTEST_MAIN(tst_QTextLayout) #include "tst_qtextlayout.moc" From df7ecb68022c1c24c962d2766ac8fc29846cf3e0 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Fri, 27 Jun 2014 15:19:02 +0200 Subject: [PATCH 19/24] Android: Fix compiling targets with space in name We have to escape the target name to avoid compilation errors. This fixes the compilation failure in the qprocess autotest. [ChangeLog][Android] Added support for building libraries with spaces in name. Change-Id: Ib98ba261fb3a4cc1e835d0cd2f93aac6855a7c21 Reviewed-by: BogDan Vatra --- mkspecs/features/android/android.prf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkspecs/features/android/android.prf b/mkspecs/features/android/android.prf index 9e86110da6a..f428f7db876 100644 --- a/mkspecs/features/android/android.prf +++ b/mkspecs/features/android/android.prf @@ -1,7 +1,7 @@ contains(TEMPLATE, ".*app") { !android_app { !contains(TARGET, ".so"): TARGET = lib$${TARGET}.so - QMAKE_LFLAGS += -Wl,-soname,$$TARGET + QMAKE_LFLAGS += -Wl,-soname,$$shell_quote($$TARGET) android_install: { target.path=/libs/$$ANDROID_TARGET_ARCH/ From e26660c004f8a68dbf6b262139f568d0b5efe663 Mon Sep 17 00:00:00 2001 From: Konstantin Ritt Date: Thu, 26 Jun 2014 22:47:34 +0300 Subject: [PATCH 20/24] Don't assert when HB-old is unable to deal with surrogates Since we have no interest in fixing HB-old to properly support surrogates, here is a simple workaround for the case when surrogate parts gets treated like two separate glyphs in log_clusters but a single character. And since it's a known issue that HB-old doesn't really support surrogates, it's better to draw some garbage/boxes rather than to assert, IMO. Task-number: QTBUG-39875 Change-Id: I95ff43e821ae989d7a6f792f71f157dcea92dd16 Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/gui/text/qtextengine.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp index 67dedca7607..a3059008beb 100644 --- a/src/gui/text/qtextengine.cpp +++ b/src/gui/text/qtextengine.cpp @@ -1298,8 +1298,12 @@ int QTextEngine::shapeTextWithHarfbuzz(const QScriptItem &si, const ushort *stri attrs.justification = hbAttrs.justification; } - for (quint32 i = 0; i < shaper_item.item.length; ++i) + for (quint32 i = 0; i < shaper_item.item.length; ++i) { + // Workaround wrong log_clusters for surrogates (i.e. QTBUG-39875) + if (shaper_item.log_clusters[i] >= shaper_item.num_glyphs) + shaper_item.log_clusters[i] = shaper_item.num_glyphs - 1; shaper_item.log_clusters[i] += glyph_pos; + } if (kerningEnabled && !shaper_item.kerning_applied) actualFontEngine->doKerning(&g, option.useDesignMetrics() ? QFontEngine::DesignMetrics : QFontEngine::ShaperFlags(0)); From 71e1976bccbe3809eed1b8d4a69b45963e29cb69 Mon Sep 17 00:00:00 2001 From: Nico Vertriest Date: Tue, 8 Jul 2014 13:54:21 +0200 Subject: [PATCH 21/24] Doc: moved streambookmarks example files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Moved to qtbase/examples/xml/streambookmarks. Files: qxmlstreambookmarks.qdoc and png files Change-Id: I6edf975f1e0666a4283e65c933d31923695f8b4c Reviewed-by: Topi Reiniö --- .../doc/images/xmlstreamexample-filemenu.png | Bin .../doc/images/xmlstreamexample-helpmenu.png | Bin .../doc/images/xmlstreamexample-screenshot.png | Bin .../doc/src/qxmlstreambookmarks.qdoc | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename examples/xml/{ => streambookmarks}/doc/images/xmlstreamexample-filemenu.png (100%) rename examples/xml/{ => streambookmarks}/doc/images/xmlstreamexample-helpmenu.png (100%) rename examples/xml/{ => streambookmarks}/doc/images/xmlstreamexample-screenshot.png (100%) rename examples/xml/{ => streambookmarks}/doc/src/qxmlstreambookmarks.qdoc (100%) diff --git a/examples/xml/doc/images/xmlstreamexample-filemenu.png b/examples/xml/streambookmarks/doc/images/xmlstreamexample-filemenu.png similarity index 100% rename from examples/xml/doc/images/xmlstreamexample-filemenu.png rename to examples/xml/streambookmarks/doc/images/xmlstreamexample-filemenu.png diff --git a/examples/xml/doc/images/xmlstreamexample-helpmenu.png b/examples/xml/streambookmarks/doc/images/xmlstreamexample-helpmenu.png similarity index 100% rename from examples/xml/doc/images/xmlstreamexample-helpmenu.png rename to examples/xml/streambookmarks/doc/images/xmlstreamexample-helpmenu.png diff --git a/examples/xml/doc/images/xmlstreamexample-screenshot.png b/examples/xml/streambookmarks/doc/images/xmlstreamexample-screenshot.png similarity index 100% rename from examples/xml/doc/images/xmlstreamexample-screenshot.png rename to examples/xml/streambookmarks/doc/images/xmlstreamexample-screenshot.png diff --git a/examples/xml/doc/src/qxmlstreambookmarks.qdoc b/examples/xml/streambookmarks/doc/src/qxmlstreambookmarks.qdoc similarity index 100% rename from examples/xml/doc/src/qxmlstreambookmarks.qdoc rename to examples/xml/streambookmarks/doc/src/qxmlstreambookmarks.qdoc From cdf9aed6302df57a8a1c56f03e6f82254ea87043 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 9 Jul 2014 08:56:27 +0200 Subject: [PATCH 22/24] tst_qdir: Move QFINDTESTDATA() from init() to constructor. Check result in initTestData(). Previously, QFINDTESTDATA() was repeatedly invoked in init(). The data-driven cd() test then failed when invoked stand-alone since cd_data(), which relies on the data path, is executed before init(). Task-number: QTBUG-40067 Change-Id: I91039247e8dcaedd92fa990f1b5f82bc54b17c60 Reviewed-by: Joerg Bornemann --- tests/auto/corelib/io/qdir/tst_qdir.cpp | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/tests/auto/corelib/io/qdir/tst_qdir.cpp b/tests/auto/corelib/io/qdir/tst_qdir.cpp index 2bac6f58348..cf7cdc874c1 100644 --- a/tests/auto/corelib/io/qdir/tst_qdir.cpp +++ b/tests/auto/corelib/io/qdir/tst_qdir.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the test suite of the Qt Toolkit. @@ -72,8 +72,12 @@ class tst_QDir : public QObject { Q_OBJECT +public: + tst_QDir(); + private slots: void init(); + void initTestCase(); void cleanupTestCase(); void getSetCheck(); @@ -198,19 +202,25 @@ private slots: void cdBelowRoot(); private: - QString m_dataPath; + const QString m_dataPath; }; +tst_QDir::tst_QDir() + : m_dataPath(QFileInfo(QFINDTESTDATA("testData")).absolutePath()) +{ +} + void tst_QDir::init() { - // Directory under which testdata can be found. - m_dataPath = QFileInfo(QFINDTESTDATA("testData")).absolutePath(); - QVERIFY2(!m_dataPath.isEmpty(), "test data not found"); - // Some tests want to use "." as relative path to data. QVERIFY2(QDir::setCurrent(m_dataPath), qPrintable("Could not chdir to " + m_dataPath)); } +void tst_QDir::initTestCase() +{ + QVERIFY2(!m_dataPath.isEmpty(), "test data not found"); +} + void tst_QDir::cleanupTestCase() { QDir(QDir::currentPath() + "/tmpdir").removeRecursively(); From 1b6bc6d34d3d997f1cadf18854da9e40ae5f9ac7 Mon Sep 17 00:00:00 2001 From: Nico Vertriest Date: Tue, 8 Jul 2014 13:38:01 +0200 Subject: [PATCH 23/24] Doc: moved saxbookmarks example files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Moved to qtbase/examples/xml/saxbookmarks Png and qdoc file. Updated qtxml.qdocconf accordingly. Change-Id: Iafe50a09aee22f518adf9ec2ebf289e766e24ff4 Reviewed-by: Topi Reiniö --- .../doc/images/saxbookmarks-example.png | Bin .../{ => saxbookmarks}/doc/src/saxbookmarks.qdoc | 0 src/xml/doc/qtxml.qdocconf | 4 +--- 3 files changed, 1 insertion(+), 3 deletions(-) rename examples/xml/{ => saxbookmarks}/doc/images/saxbookmarks-example.png (100%) rename examples/xml/{ => saxbookmarks}/doc/src/saxbookmarks.qdoc (100%) diff --git a/examples/xml/doc/images/saxbookmarks-example.png b/examples/xml/saxbookmarks/doc/images/saxbookmarks-example.png similarity index 100% rename from examples/xml/doc/images/saxbookmarks-example.png rename to examples/xml/saxbookmarks/doc/images/saxbookmarks-example.png diff --git a/examples/xml/doc/src/saxbookmarks.qdoc b/examples/xml/saxbookmarks/doc/src/saxbookmarks.qdoc similarity index 100% rename from examples/xml/doc/src/saxbookmarks.qdoc rename to examples/xml/saxbookmarks/doc/src/saxbookmarks.qdoc diff --git a/src/xml/doc/qtxml.qdocconf b/src/xml/doc/qtxml.qdocconf index 7f8fddfd11a..561d14e5281 100644 --- a/src/xml/doc/qtxml.qdocconf +++ b/src/xml/doc/qtxml.qdocconf @@ -31,11 +31,9 @@ depends += qtcore qtnetwork qtdoc headerdirs += .. -sourcedirs += .. \ - ../../../examples/xml/doc/src +sourcedirs += .. exampledirs += ../../../examples/xml \ - ../ \ snippets imagedirs += images \ From 916c9d469bd0df227dc3be97fcca27e3cf58144f Mon Sep 17 00:00:00 2001 From: Peter Hartmann Date: Wed, 9 Jul 2014 16:22:44 +0200 Subject: [PATCH 24/24] QSslCertificate: blacklist NIC certificates from India Those intermediate certificates were used to issue "unauthorized" certificates according to http://googleonlinesecurity.blogspot.de/2014/07/maintaining-digital-certificate-security.html , and are by default trusted on Windows, so to be safe we blacklist them here. Change-Id: I9891c5bee2dd82c22eb0f45e9b04abd25efeb596 Reviewed-by: Richard J. Moore --- src/network/ssl/qsslcertificate.cpp | 3 +++ .../blacklisted-nic-india-2007.pem | 25 ++++++++++++++++++ .../blacklisted-nic-india-2011.pem | 26 +++++++++++++++++++ .../blacklisted-nic-india-2014.pem | 26 +++++++++++++++++++ 4 files changed, 80 insertions(+) create mode 100644 tests/auto/network/ssl/qsslcertificate/more-certificates/blacklisted-nic-india-2007.pem create mode 100644 tests/auto/network/ssl/qsslcertificate/more-certificates/blacklisted-nic-india-2011.pem create mode 100644 tests/auto/network/ssl/qsslcertificate/more-certificates/blacklisted-nic-india-2014.pem diff --git a/src/network/ssl/qsslcertificate.cpp b/src/network/ssl/qsslcertificate.cpp index 3b7fa4da090..a113ec156b9 100644 --- a/src/network/ssl/qsslcertificate.cpp +++ b/src/network/ssl/qsslcertificate.cpp @@ -1219,6 +1219,9 @@ static const char *certificate_blacklist[] = { "08:64", "e-islem.kktcmerkezbankasi.org", // Turktrust mis-issued intermediate certificate "03:1d:a7", "AC DG Tr\xC3\xA9sor SSL", // intermediate certificate linking back to ANSSI French National Security Agency + "27:83", "NIC Certifying Authority", // intermediate certificate from NIC India (2007) + "27:92", "NIC CA 2011", // intermediate certificate from NIC India (2011) + "27:b1", "NIC CA 2014", // intermediate certificate from NIC India (2014) 0 }; diff --git a/tests/auto/network/ssl/qsslcertificate/more-certificates/blacklisted-nic-india-2007.pem b/tests/auto/network/ssl/qsslcertificate/more-certificates/blacklisted-nic-india-2007.pem new file mode 100644 index 00000000000..2106f663328 --- /dev/null +++ b/tests/auto/network/ssl/qsslcertificate/more-certificates/blacklisted-nic-india-2007.pem @@ -0,0 +1,25 @@ +-----BEGIN CERTIFICATE----- +MIIENjCCAx6gAwIBAgICJ4MwDQYJKoZIhvcNAQEFBQAwOjELMAkGA1UEBhMCSU4x +EjAQBgNVBAoTCUluZGlhIFBLSTEXMBUGA1UEAxMOQ0NBIEluZGlhIDIwMDcwHhcN +MDcwNzAyMDY0MTU5WhcNMTUwNzA0MDYzMDAwWjCBsDELMAkGA1UEBhMCSU4xJDAi +BgNVBAoTG05hdGlvbmFsIEluZm9ybWF0aWNzIENlbnRyZTEOMAwGA1UECxMFTklD +Q0ExITAfBgNVBAMTGE5JQyBDZXJ0aWZ5aW5nIEF1dGhvcml0eTESMBAGA1UEBxMJ +TmV3IERlbGhpMSQwIgYJKoZIhvcNAQkBFhVzdXBwb3J0QGNhbWFpbC5uaWMuaW4x +DjAMBgNVBAgTBURlbGhpMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA +wLRKDEWWC1iWcxpVgA7GJEjQVjGIMx9XPLoaMKXiEQdajHgmjKdOhlFkSWiHgiCS +Uo39U0/UoC4rAYzBCcfHWdAGjXNs7dt/cz+muK2aMoPoAgXWLF2A48CJMrTcyNFE +HryIYJeCiK8DTlEhBxL8II9VBx8qKSquizh4MQTmpqvfjHNqd6qCHF6q8W439io5 +kVIFnGNd/p0V5HFv0OpWeF/IpKJA1m1lb729FwfsVpqipf7DLVQUKtSjK/32RDtB +hnAmkDlW6IZRPs2F896A5COPSDjJlAeUX8JqDnBOr64bPRgUy0VDnW/soRB3knkn +5w5ueXj3DrgONtjGcBSwVwIDAQABo4HOMIHLMA8GA1UdEwEB/wQFMAMBAf8wEQYD +VR0OBAoECEwne24Nsv9UMBMGA1UdIwQMMAqACE8ewFgn2LjkMAsGA1UdDwQEAwIB +BjCBggYDVR0fBHsweTB3oHWgc4ZxbGRhcDovL25yZGMuY2NhLmdvdi5pbjozODkv +Y249Q0NBIEluZGlhIDIwMDcsb3U9Q0NBIEluZGlhIDIwMDcsbz1JbmRpYSBQS0ks +Yz1JTj9jZXJ0aWZpY2F0ZXJldm9jYXRpb25saXN0O2JpbmFyeT8wDQYJKoZIhvcN +AQEFBQADggEBAKx6RkVgMGQADgl4jTy3qBDq8nvkegDaDnviTUsGzsR6RpooT0xd +wuKiRU0I7p2gAo6uBTMEZtS+XWJz+7xlfo4fao5XIU4e1fxkQuxddM23/J7M4+Uz +3pL7ziK5RcVizhQqz3IjSH440/OoFhUBT5d5WWN0hliEcr7+6nLPAOcAX/qR509a +Djd/aonfyQFCMyfiPpYLx5ElTuqUZeHApJ58+Iprwbu3EIux+C+mfS8QCMY+WYje +aocCIwIutrmoxIXxGy9yV5OKIe2+4wsCT8aNin+6AV7qNTmFVhp+MF50v69ONTO7 +w2Sa+ire2N5FgklMW2WTCi8d8rwLzaWuse4= +-----END CERTIFICATE----- diff --git a/tests/auto/network/ssl/qsslcertificate/more-certificates/blacklisted-nic-india-2011.pem b/tests/auto/network/ssl/qsslcertificate/more-certificates/blacklisted-nic-india-2011.pem new file mode 100644 index 00000000000..d3a8c10502d --- /dev/null +++ b/tests/auto/network/ssl/qsslcertificate/more-certificates/blacklisted-nic-india-2011.pem @@ -0,0 +1,26 @@ +-----BEGIN CERTIFICATE----- +MIIEWzCCA0OgAwIBAgICJ5IwDQYJKoZIhvcNAQELBQAwOjELMAkGA1UEBhMCSU4x +EjAQBgNVBAoTCUluZGlhIFBLSTEXMBUGA1UEAxMOQ0NBIEluZGlhIDIwMTEwHhcN +MTEwMzExMDgxNTExWhcNMTYwMzExMDYzMDAwWjCByDELMAkGA1UEBhMCSU4xJDAi +BgNVBAoTG05hdGlvbmFsIEluZm9ybWF0aWNzIENlbnRyZTEdMBsGA1UECxMUQ2Vy +dGlmeWluZyBBdXRob3JpdHkxDzANBgNVBBETBjExMDAwMzEOMAwGA1UECBMFRGVs +aGkxHjAcBgNVBAkTFUxvZGhpIFJvYWQsIE5ldyBEZWxoaTEdMBsGA1UEMwwUQS1C +bG9jaywgQ0dPIENvbXBsZXgxFDASBgNVBAMTC05JQyBDQSAyMDExMIIBIjANBgkq +hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA7J/N88MoXcCHTz4A5DKF59+8kvSnriGr +TEowLSa5NCvH+o89+Mf7V260kKZJ/hQox5RG/F8/gY7u9ziLeypbedeG8EIl88HC +4x9hT0SNLsrj9qo90waDuGYB4/KQ8q5E6ivVxxV0epzQfFA5A5biKltPBbku/M4D +iZ+TqBbHxo6nRUEZoukJi0+JLykGI4VpJlQBzow04omxQUZHzvCffo6QvN6FdzZ0 +MopwqaggyfHDFu9o4elCR9Kd/obYlgXAHLYwJlN0pybbe2WpKj81/pxDhKgxrVN+ +OZaI5OMBBkjDRQG+ZyEnQb8XYMNPJbOgQGYgsRdPPjIn7poTzxe7SQIDAQABo4Hb +MIHYMBIGA1UdEwEB/wQIMAYBAf8CAQEwEQYDVR0OBAoECE5VT66z36FmMBIGA1Ud +IAQLMAkwBwYFYIJkZAIwEwYDVR0jBAwwCoAITQeoY/LbHN8wLgYIKwYBBQUHAQEE +IjAgMB4GCCsGAQUFBzABhhJodHRwOi8vb2N2cy5nb3YuaW4wDgYDVR0PAQH/BAQD +AgEGMEYGA1UdHwQ/MD0wO6A5oDeGNWh0dHA6Ly9jY2EuZ292LmluL3J3L3Jlc291 +cmNlcy9DQ0FJbmRpYTIwMTFMYXRlc3QuY3JsMA0GCSqGSIb3DQEBCwUAA4IBAQB5 +LCqtHbxfO72KRWJbW9dAHNh2xh8n7wstNgSPHLbjL5B0l7RZlCFauy4fjc2faMiB +xnOq5oEXeIZBrT2NkuEymQ8f0Pzm3pcXrMkFrj78SiA07/cPQShBKKpw39t6puJV +8ykiVZMZvSCjCzzZZlVO12b2ChADkf6wtseftx5O/zBsqP3Y2+3+KvEeDVtuseKu +FV2OxSsqSfffJq7IYTwpRPOVzHGJnjV3Igtj3zAzZm8CWxRM/yhnkGyVc+xz/T7o +WY0870eciR+bmLjZ9j0opudZR6e+lCsMHH2Lxc8C/0XRcCzcganxfWCb/fb0gx44 +iY0a+wWCVebjuyKU/BXk +-----END CERTIFICATE----- diff --git a/tests/auto/network/ssl/qsslcertificate/more-certificates/blacklisted-nic-india-2014.pem b/tests/auto/network/ssl/qsslcertificate/more-certificates/blacklisted-nic-india-2014.pem new file mode 100644 index 00000000000..54670866d50 --- /dev/null +++ b/tests/auto/network/ssl/qsslcertificate/more-certificates/blacklisted-nic-india-2014.pem @@ -0,0 +1,26 @@ +-----BEGIN CERTIFICATE----- +MIIEWzCCA0OgAwIBAgICJ7EwDQYJKoZIhvcNAQELBQAwOjELMAkGA1UEBhMCSU4x +EjAQBgNVBAoTCUluZGlhIFBLSTEXMBUGA1UEAxMOQ0NBIEluZGlhIDIwMTQwHhcN +MTQwMzA1MTExNTI0WhcNMjQwMzA1MDYzMDAwWjCByDELMAkGA1UEBhMCSU4xJDAi +BgNVBAoTG05hdGlvbmFsIEluZm9ybWF0aWNzIENlbnRyZTEdMBsGA1UECxMUQ2Vy +dGlmeWluZyBBdXRob3JpdHkxDzANBgNVBBETBjExMDAwMzEOMAwGA1UECBMFRGVs +aGkxHjAcBgNVBAkTFUxvZGhpIFJvYWQsIE5ldyBEZWxoaTEdMBsGA1UEMxMUQS1C +bG9jaywgQ0dPIENvbXBsZXgxFDASBgNVBAMTC05JQyBDQSAyMDE0MIIBIjANBgkq +hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA/OQ56Ge9MhJiBwtOlCJP4p5gjcCuqkQ2 +6BCSQgfAsxyNxAwtL1f0h3d5KNFIInIG2Y9PwBgUrgavOWy2cZICxgXIGaOzK5bI +TyGhxYMPUzkazGppfj0ScW7Ed/kjeDnic3WlYkPwtNaV1qwTElr8zqPUtT27ZDqd +6upor9MICngXAC1tHjhPuGrGtu4i6FMPrmkofwdh8dkuRzU/OPjf9lA+E9Qu0Nvq +soI9grJA0etgRfn9juR4X3KTG21qHnza50PpMYC4+vh8jAnIT7Kcz8Ggr4eghkvP ++iz2yEtIcV9M1xeo98XU/jxuYS7LeWtO79jkiqCIqgI8T3x7LHuCaQIDAQABo4Hb +MIHYMBIGA1UdEwEB/wQIMAYBAf8CAQEwEQYDVR0OBAoECEZwyi8lTsNHMBIGA1Ud +IAQLMAkwBwYFYIJkZAIwEwYDVR0jBAwwCoAIQrjFz22zV+EwLgYIKwYBBQUHAQEE +IjAgMB4GCCsGAQUFBzABhhJodHRwOi8vb2N2cy5nb3YuaW4wDgYDVR0PAQH/BAQD +AgEGMEYGA1UdHwQ/MD0wO6A5oDeGNWh0dHA6Ly9jY2EuZ292LmluL3J3L3Jlc291 +cmNlcy9DQ0FJbmRpYTIwMTRMYXRlc3QuY3JsMA0GCSqGSIb3DQEBCwUAA4IBAQCB +i3iJeUlkfjY96HgfBIUEsLi+knO3VUrxDmwps1YyhgRSt22NQLZ4jksSWLI2EQbn +9k5tH8rwSbsOWf+TZH7jpaKAVSYi1GhEbGR/C2ZeFiWATwtPWKoVGwx/ksUO9YPM +zf0wh6fDIuyBJIs/nuN93+L2ib+TS5viNky+HrR3XyqE0z43W5bbzMbido3lbwgr +drMWD6hCNSZs888L0Se4rn2ei0aPmHmxjDjbExF3NF6m2uYC/wAR4cVIzMvvptFY +n+SAdG/pwkKHaMVncB/cxxEWiKzOxVpjBsM4N19lpxp2RU/n+x7xRK3WTQvNAZdU +7pcAYmZIXPu/ES9qpK4f +-----END CERTIFICATE-----