summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/webkit/JavaScriptCore/API/JSStringRefCF.cpp
blob: d1f6fe33032a11a25284da3351cbdb292dfbd169 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/*
 * Copyright (C) 2006, 2007 Apple Computer, Inc.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
 */

#include "config.h"
#include "JSStringRefCF.h"

#include "APICast.h"
#include "InitializeThreading.h"
#include "JSStringRef.h"
#include "OpaqueJSString.h"
#include <runtime/UString.h>
#include <runtime/JSValue.h>
#include <wtf/OwnArrayPtr.h>

JSStringRef JSStringCreateWithCFString(CFStringRef string)
{
    JSC::initializeThreading();

    // We cannot use CFIndex here since CFStringGetLength can return values larger than
    // it can hold.  (<rdar://problem/6806478>)
    size_t length = CFStringGetLength(string);
    if (length) {
        OwnArrayPtr<UniChar> buffer(new UniChar[length]);
        CFStringGetCharacters(string, CFRangeMake(0, length), buffer.get());
        COMPILE_ASSERT(sizeof(UniChar) == sizeof(UChar), unichar_and_uchar_must_be_same_size);
        return OpaqueJSString::create(reinterpret_cast<UChar*>(buffer.get()), length).releaseRef();
    } else {
        return OpaqueJSString::create(0, 0).releaseRef();
    }
}

CFStringRef JSStringCopyCFString(CFAllocatorRef alloc, JSStringRef string)
{
    return CFStringCreateWithCharacters(alloc, reinterpret_cast<const UniChar*>(string->characters()), string->length());
}
rved. ** -** This file is part of the QCLucene library and is distributable under -** the terms of the LGPL license as specified in the license.txt file. +** Portion Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** +** 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. ** ****************************************************************************/ diff --git a/tools/assistant/lib/fulltextsearch/qdocument_p.h b/tools/assistant/lib/fulltextsearch/qdocument_p.h index df207ca..e388cb7 100644 --- a/tools/assistant/lib/fulltextsearch/qdocument_p.h +++ b/tools/assistant/lib/fulltextsearch/qdocument_p.h @@ -1,10 +1,17 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) +** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. +** All rights reserved. ** -** This file is part of the QCLucene library and is distributable under -** the terms of the LGPL license as specified in the license.txt file. +** Portion Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** +** 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. ** ****************************************************************************/ diff --git a/tools/assistant/lib/fulltextsearch/qfield.cpp b/tools/assistant/lib/fulltextsearch/qfield.cpp index dc878f3..364ad7d 100644 --- a/tools/assistant/lib/fulltextsearch/qfield.cpp +++ b/tools/assistant/lib/fulltextsearch/qfield.cpp @@ -1,10 +1,17 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) +** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. +** All rights reserved. ** -** This file is part of the QCLucene library and is distributable under -** the terms of the LGPL license as specified in the license.txt file. +** Portion Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** +** 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. ** ****************************************************************************/ @@ -23,7 +30,7 @@ QCLuceneFieldPrivate::QCLuceneFieldPrivate() field = 0; deleteCLuceneField = true; } - + QCLuceneFieldPrivate::QCLuceneFieldPrivate(const QCLuceneFieldPrivate &other) : QSharedData() { @@ -51,7 +58,7 @@ QCLuceneField::QCLuceneField(const QString &name, const QString &value, int conf { TCHAR* fieldName = QStringToTChar(name); TCHAR* fieldValue = QStringToTChar(value); - + d->field = new lucene::document::Field(fieldName, fieldValue, configs); delete [] fieldName; @@ -67,7 +74,7 @@ QCLuceneField::QCLuceneField(const QString &name, QCLuceneReader *reader, reader->d->deleteCLuceneReader = false; // clucene takes ownership d->field = new lucene::document::Field(fieldName, reader->d->reader, configs); - + delete [] fieldName; } diff --git a/tools/assistant/lib/fulltextsearch/qfield_p.h b/tools/assistant/lib/fulltextsearch/qfield_p.h index b4e1afa..77f6c82 100644 --- a/tools/assistant/lib/fulltextsearch/qfield_p.h +++ b/tools/assistant/lib/fulltextsearch/qfield_p.h @@ -1,10 +1,17 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) +** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. +** All rights reserved. ** -** This file is part of the QCLucene library and is distributable under -** the terms of the LGPL license as specified in the license.txt file. +** Portion Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** +** 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. ** ****************************************************************************/ diff --git a/tools/assistant/lib/fulltextsearch/qfilter.cpp b/tools/assistant/lib/fulltextsearch/qfilter.cpp index 837f590..7514121 100644 --- a/tools/assistant/lib/fulltextsearch/qfilter.cpp +++ b/tools/assistant/lib/fulltextsearch/qfilter.cpp @@ -1,10 +1,17 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) +** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. +** All rights reserved. ** -** This file is part of the QCLucene library and is distributable under -** the terms of the LGPL license as specified in the license.txt file. +** Portion Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** +** 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. ** ****************************************************************************/ diff --git a/tools/assistant/lib/fulltextsearch/qfilter_p.h b/tools/assistant/lib/fulltextsearch/qfilter_p.h index 0438902..dc81972 100644 --- a/tools/assistant/lib/fulltextsearch/qfilter_p.h +++ b/tools/assistant/lib/fulltextsearch/qfilter_p.h @@ -1,10 +1,17 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) +** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. +** All rights reserved. ** -** This file is part of the QCLucene library and is distributable under -** the terms of the LGPL license as specified in the license.txt file. +** Portion Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** +** 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. ** ****************************************************************************/ diff --git a/tools/assistant/lib/fulltextsearch/qhits.cpp b/tools/assistant/lib/fulltextsearch/qhits.cpp index c2fbf1b..3dc380e 100644 --- a/tools/assistant/lib/fulltextsearch/qhits.cpp +++ b/tools/assistant/lib/fulltextsearch/qhits.cpp @@ -1,10 +1,17 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) +** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. +** All rights reserved. ** -** This file is part of the QCLucene library and is distributable under -** the terms of the LGPL license as specified in the license.txt file. +** Portion Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** +** 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. ** ****************************************************************************/ @@ -22,7 +29,7 @@ QCLuceneHitsPrivate::QCLuceneHitsPrivate() hits = 0; deleteCLuceneHits = true; } - + QCLuceneHitsPrivate::QCLuceneHitsPrivate(const QCLuceneHitsPrivate &other) : QSharedData() { @@ -37,7 +44,7 @@ QCLuceneHitsPrivate::~QCLuceneHitsPrivate() } -QCLuceneHits::QCLuceneHits(const QCLuceneSearcher &searcher, +QCLuceneHits::QCLuceneHits(const QCLuceneSearcher &searcher, const QCLuceneQuery &query, const QCLuceneFilter &filter) : d(new QCLuceneHitsPrivate()) { diff --git a/tools/assistant/lib/fulltextsearch/qhits_p.h b/tools/assistant/lib/fulltextsearch/qhits_p.h index ae7c61f..80a9c70 100644 --- a/tools/assistant/lib/fulltextsearch/qhits_p.h +++ b/tools/assistant/lib/fulltextsearch/qhits_p.h @@ -1,10 +1,17 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) +** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. +** All rights reserved. ** -** This file is part of the QCLucene library and is distributable under -** the terms of the LGPL license as specified in the license.txt file. +** Portion Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** +** 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. ** ****************************************************************************/ diff --git a/tools/assistant/lib/fulltextsearch/qindexreader.cpp b/tools/assistant/lib/fulltextsearch/qindexreader.cpp index fc1a3bb..56a1372 100644 --- a/tools/assistant/lib/fulltextsearch/qindexreader.cpp +++ b/tools/assistant/lib/fulltextsearch/qindexreader.cpp @@ -1,10 +1,17 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) +** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. +** All rights reserved. ** -** This file is part of the QCLucene library and is distributable under -** the terms of the LGPL license as specified in the license.txt file. +** Portion Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** +** 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. ** ****************************************************************************/ diff --git a/tools/assistant/lib/fulltextsearch/qindexreader_p.h b/tools/assistant/lib/fulltextsearch/qindexreader_p.h index a967b9d..2b62344 100644 --- a/tools/assistant/lib/fulltextsearch/qindexreader_p.h +++ b/tools/assistant/lib/fulltextsearch/qindexreader_p.h @@ -1,10 +1,17 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) +** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. +** All rights reserved. ** -** This file is part of the QCLucene library and is distributable under -** the terms of the LGPL license as specified in the license.txt file. +** Portion Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** +** 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. ** ****************************************************************************/ diff --git a/tools/assistant/lib/fulltextsearch/qindexwriter.cpp b/tools/assistant/lib/fulltextsearch/qindexwriter.cpp index 93e23e7..66ea6b3 100644 --- a/tools/assistant/lib/fulltextsearch/qindexwriter.cpp +++ b/tools/assistant/lib/fulltextsearch/qindexwriter.cpp @@ -1,10 +1,17 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) +** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. +** All rights reserved. ** -** This file is part of the QCLucene library and is distributable under -** the terms of the LGPL license as specified in the license.txt file. +** Portion Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** +** 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. ** ****************************************************************************/ diff --git a/tools/assistant/lib/fulltextsearch/qindexwriter_p.h b/tools/assistant/lib/fulltextsearch/qindexwriter_p.h index 5630520..8b31e9b 100644 --- a/tools/assistant/lib/fulltextsearch/qindexwriter_p.h +++ b/tools/assistant/lib/fulltextsearch/qindexwriter_p.h @@ -1,10 +1,17 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) +** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. +** All rights reserved. ** -** This file is part of the QCLucene library and is distributable under -** the terms of the LGPL license as specified in the license.txt file. +** Portion Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** +** 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. ** ****************************************************************************/ diff --git a/tools/assistant/lib/fulltextsearch/qquery.cpp b/tools/assistant/lib/fulltextsearch/qquery.cpp index 1760b05..39e2507 100644 --- a/tools/assistant/lib/fulltextsearch/qquery.cpp +++ b/tools/assistant/lib/fulltextsearch/qquery.cpp @@ -1,10 +1,17 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) +** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. +** All rights reserved. ** -** This file is part of the QCLucene library and is distributable under -** the terms of the LGPL license as specified in the license.txt file. +** Portion Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** +** 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. ** ****************************************************************************/ diff --git a/tools/assistant/lib/fulltextsearch/qquery_p.h b/tools/assistant/lib/fulltextsearch/qquery_p.h index b1d0931..53c42d3 100644 --- a/tools/assistant/lib/fulltextsearch/qquery_p.h +++ b/tools/assistant/lib/fulltextsearch/qquery_p.h @@ -1,10 +1,17 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) +** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. +** All rights reserved. ** -** This file is part of the QCLucene library and is distributable under -** the terms of the LGPL license as specified in the license.txt file. +** Portion Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** +** 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. ** ****************************************************************************/ diff --git a/tools/assistant/lib/fulltextsearch/qqueryparser.cpp b/tools/assistant/lib/fulltextsearch/qqueryparser.cpp index 6f546be..2a27bcc 100644 --- a/tools/assistant/lib/fulltextsearch/qqueryparser.cpp +++ b/tools/assistant/lib/fulltextsearch/qqueryparser.cpp @@ -1,10 +1,17 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) +** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. +** All rights reserved. ** -** This file is part of the QCLucene library and is distributable under -** the terms of the LGPL license as specified in the license.txt file. +** Portion Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** +** 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. ** ****************************************************************************/ @@ -38,15 +45,15 @@ QCLuceneQueryParserPrivate::~QCLuceneQueryParserPrivate() } -QCLuceneQueryParser::QCLuceneQueryParser(const QString &field, +QCLuceneQueryParser::QCLuceneQueryParser(const QString &field, QCLuceneAnalyzer &analyzer) : d(new QCLuceneQueryParserPrivate()) , field(field) , analyzer(analyzer) { TCHAR *fieldName = QStringToTChar(field); - - d->queryParser = new lucene::queryParser::QueryParser(fieldName, + + d->queryParser = new lucene::queryParser::QueryParser(fieldName, analyzer.d->analyzer); delete [] fieldName; @@ -114,7 +121,7 @@ QCLuceneMultiFieldQueryParser::~QCLuceneMultiFieldQueryParser() // nothing todo } -QCLuceneQuery* QCLuceneMultiFieldQueryParser::parse(const QString &query, +QCLuceneQuery* QCLuceneMultiFieldQueryParser::parse(const QString &query, const QStringList &fieldList, QCLuceneAnalyzer &analyzer) { @@ -144,7 +151,7 @@ QCLuceneQuery* QCLuceneMultiFieldQueryParser::parse(const QString &query, if (q) { qint32 flag = flags.at(i); switch (flag) { - case QCLuceneMultiFieldQueryParser::REQUIRED_FIELD: { + case QCLuceneMultiFieldQueryParser::REQUIRED_FIELD: { retValue->add(q, true, true, false); } break; diff --git a/tools/assistant/lib/fulltextsearch/qqueryparser_p.h b/tools/assistant/lib/fulltextsearch/qqueryparser_p.h index 5a79662..acb4a98 100644 --- a/tools/assistant/lib/fulltextsearch/qqueryparser_p.h +++ b/tools/assistant/lib/fulltextsearch/qqueryparser_p.h @@ -1,10 +1,17 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) +** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. +** All rights reserved. ** -** This file is part of the QCLucene library and is distributable under -** the terms of the LGPL license as specified in the license.txt file. +** Portion Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** +** 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. ** ****************************************************************************/ diff --git a/tools/assistant/lib/fulltextsearch/qreader.cpp b/tools/assistant/lib/fulltextsearch/qreader.cpp index 3b2d6f5..2d3f39a 100644 --- a/tools/assistant/lib/fulltextsearch/qreader.cpp +++ b/tools/assistant/lib/fulltextsearch/qreader.cpp @@ -1,10 +1,17 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) +** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. +** All rights reserved. ** -** This file is part of the QCLucene library and is distributable under -** the terms of the LGPL license as specified in the license.txt file. +** Portion Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** +** 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. ** ****************************************************************************/ @@ -16,26 +23,25 @@ QT_BEGIN_NAMESPACE -QCLuceneReaderPrivate::QCLuceneReaderPrivate() +QCLuceneReaderPrivate::QCLuceneReaderPrivate() : QSharedData() -{ - reader = 0; +{ + reader = 0; deleteCLuceneReader = true; } QCLuceneReaderPrivate::QCLuceneReaderPrivate(const QCLuceneReaderPrivate &other) : QSharedData() { - reader = _CL_POINTER(other.reader); + reader = _CL_POINTER(other.reader); deleteCLuceneReader = other.deleteCLuceneReader; } -QCLuceneReaderPrivate::~QCLuceneReaderPrivate() -{ +QCLuceneReaderPrivate::~QCLuceneReaderPrivate() +{ if (deleteCLuceneReader) _CLDECDELETE(reader); } - QCLuceneReader::QCLuceneReader() : d(new QCLuceneReaderPrivate()) @@ -63,7 +69,7 @@ QCLuceneStringReader::QCLuceneStringReader(const QString &value, qint32 length) d->reader = new lucene::util::StringReader(string, int32_t(length)); } -QCLuceneStringReader::QCLuceneStringReader(const QString &value, qint32 length, +QCLuceneStringReader::QCLuceneStringReader(const QString &value, qint32 length, bool copyData) : QCLuceneReader() , string(QStringToTChar(value)) diff --git a/tools/assistant/lib/fulltextsearch/qreader_p.h b/tools/assistant/lib/fulltextsearch/qreader_p.h index b870db1..53ba011 100644 --- a/tools/assistant/lib/fulltextsearch/qreader_p.h +++ b/tools/assistant/lib/fulltextsearch/qreader_p.h @@ -1,10 +1,17 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) +** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. +** All rights reserved. ** -** This file is part of the QCLucene library and is distributable under -** the terms of the LGPL license as specified in the license.txt file. +** Portion Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** +** 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. ** ****************************************************************************/ @@ -44,11 +51,11 @@ class QCLuceneStandardTokenizer; class QHELP_EXPORT QCLuceneReaderPrivate : public QSharedData { public: - QCLuceneReaderPrivate(); + QCLuceneReaderPrivate(); QCLuceneReaderPrivate(const QCLuceneReaderPrivate &other); - + ~QCLuceneReaderPrivate(); - + Reader* reader; bool deleteCLuceneReader; diff --git a/tools/assistant/lib/fulltextsearch/qsearchable.cpp b/tools/assistant/lib/fulltextsearch/qsearchable.cpp index 70cae91..40a9f1b 100644 --- a/tools/assistant/lib/fulltextsearch/qsearchable.cpp +++ b/tools/assistant/lib/fulltextsearch/qsearchable.cpp @@ -1,10 +1,17 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) +** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. +** All rights reserved. ** -** This file is part of the QCLucene library and is distributable under -** the terms of the LGPL license as specified in the license.txt file. +** Portion Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** +** 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. ** ****************************************************************************/ @@ -64,19 +71,19 @@ QCLuceneHits QCLuceneSearcher::search(const QCLuceneQuery &query) return search(query, QCLuceneFilter()); } -QCLuceneHits QCLuceneSearcher::search(const QCLuceneQuery &query, +QCLuceneHits QCLuceneSearcher::search(const QCLuceneQuery &query, const QCLuceneFilter &filter) { return QCLuceneHits(*this, query, filter); } -QCLuceneHits QCLuceneSearcher::search(const QCLuceneQuery &query, +QCLuceneHits QCLuceneSearcher::search(const QCLuceneQuery &query, const QCLuceneSort &sort) { return QCLuceneHits(*this, query, QCLuceneFilter(), sort); } -QCLuceneHits QCLuceneSearcher::search(const QCLuceneQuery &query, +QCLuceneHits QCLuceneSearcher::search(const QCLuceneQuery &query, const QCLuceneFilter &filter, const QCLuceneSort &sort) { @@ -87,7 +94,7 @@ QCLuceneHits QCLuceneSearcher::search(const QCLuceneQuery &query, QCLuceneIndexSearcher::QCLuceneIndexSearcher(const QString &path) : QCLuceneSearcher() { - lucene::search::IndexSearcher *searcher = + lucene::search::IndexSearcher *searcher = new lucene::search::IndexSearcher(path); reader.d->reader = searcher->getReader(); @@ -132,7 +139,7 @@ bool QCLuceneIndexSearcher::doc(qint32 i, QCLuceneDocument &document) QCLuceneMultiSearcher::QCLuceneMultiSearcher(const QList searchables) : QCLuceneSearcher() { - lucene::search::Searchable** list= + lucene::search::Searchable** list= _CL_NEWARRAY(lucene::search::Searchable*, searchables.count()); d->searchable = new lucene::search::MultiSearcher(list); @@ -162,7 +169,7 @@ qint32 QCLuceneMultiSearcher::subDoc(qint32 index) const if (searcher == 0) return 0; - + return qint32(searcher->subDoc(int32_t(index))); } @@ -173,7 +180,7 @@ qint32 QCLuceneMultiSearcher::subSearcher(qint32 index) const if (searcher == 0) return 0; - + return qint32(searcher->subSearcher(int32_t(index))); } @@ -184,7 +191,7 @@ qint32 QCLuceneMultiSearcher::searcherIndex(qint32 index) const if (searcher == 0) return 0; - + return qint32(searcher->searcherIndex(int32_t(index))); } diff --git a/tools/assistant/lib/fulltextsearch/qsearchable_p.h b/tools/assistant/lib/fulltextsearch/qsearchable_p.h index 0244b22..7cb8eaa 100644 --- a/tools/assistant/lib/fulltextsearch/qsearchable_p.h +++ b/tools/assistant/lib/fulltextsearch/qsearchable_p.h @@ -1,10 +1,17 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) +** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. +** All rights reserved. ** -** This file is part of the QCLucene library and is distributable under -** the terms of the LGPL license as specified in the license.txt file. +** Portion Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** +** 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. ** ****************************************************************************/ diff --git a/tools/assistant/lib/fulltextsearch/qsort.cpp b/tools/assistant/lib/fulltextsearch/qsort.cpp index 97ed128..276c3af 100644 --- a/tools/assistant/lib/fulltextsearch/qsort.cpp +++ b/tools/assistant/lib/fulltextsearch/qsort.cpp @@ -1,10 +1,17 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) +** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. +** All rights reserved. ** -** This file is part of the QCLucene library and is distributable under -** the terms of the LGPL license as specified in the license.txt file. +** Portion Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** +** 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. ** ****************************************************************************/ diff --git a/tools/assistant/lib/fulltextsearch/qsort_p.h b/tools/assistant/lib/fulltextsearch/qsort_p.h index 2eb67a7..455878e 100644 --- a/tools/assistant/lib/fulltextsearch/qsort_p.h +++ b/tools/assistant/lib/fulltextsearch/qsort_p.h @@ -1,10 +1,17 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) +** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. +** All rights reserved. ** -** This file is part of the QCLucene library and is distributable under -** the terms of the LGPL license as specified in the license.txt file. +** Portion Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** +** 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. ** ****************************************************************************/ diff --git a/tools/assistant/lib/fulltextsearch/qterm.cpp b/tools/assistant/lib/fulltextsearch/qterm.cpp index 10a2f3a..75b9649 100644 --- a/tools/assistant/lib/fulltextsearch/qterm.cpp +++ b/tools/assistant/lib/fulltextsearch/qterm.cpp @@ -1,10 +1,17 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) +** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. +** All rights reserved. ** -** This file is part of the QCLucene library and is distributable under -** the terms of the LGPL license as specified in the license.txt file. +** Portion Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** +** 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. ** ****************************************************************************/ diff --git a/tools/assistant/lib/fulltextsearch/qterm_p.h b/tools/assistant/lib/fulltextsearch/qterm_p.h index 8a5d691..a93ed44 100644 --- a/tools/assistant/lib/fulltextsearch/qterm_p.h +++ b/tools/assistant/lib/fulltextsearch/qterm_p.h @@ -1,10 +1,17 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) +** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. +** All rights reserved. ** -** This file is part of the QCLucene library and is distributable under -** the terms of the LGPL license as specified in the license.txt file. +** Portion Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** +** 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. ** ****************************************************************************/ diff --git a/tools/assistant/lib/fulltextsearch/qtoken.cpp b/tools/assistant/lib/fulltextsearch/qtoken.cpp index 9056a7c..d099e27 100644 --- a/tools/assistant/lib/fulltextsearch/qtoken.cpp +++ b/tools/assistant/lib/fulltextsearch/qtoken.cpp @@ -1,10 +1,17 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) +** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. +** All rights reserved. ** -** This file is part of the QCLucene library and is distributable under -** the terms of the LGPL license as specified in the license.txt file. +** Portion Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** +** 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. ** ****************************************************************************/ diff --git a/tools/assistant/lib/fulltextsearch/qtoken_p.h b/tools/assistant/lib/fulltextsearch/qtoken_p.h index 02979ec..8e8c687 100644 --- a/tools/assistant/lib/fulltextsearch/qtoken_p.h +++ b/tools/assistant/lib/fulltextsearch/qtoken_p.h @@ -1,10 +1,17 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) +** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. +** All rights reserved. ** -** This file is part of the QCLucene library and is distributable under -** the terms of the LGPL license as specified in the license.txt file. +** Portion Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** +** 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. ** ****************************************************************************/ diff --git a/tools/assistant/lib/fulltextsearch/qtokenizer.cpp b/tools/assistant/lib/fulltextsearch/qtokenizer.cpp index a52410e..ff7367b 100644 --- a/tools/assistant/lib/fulltextsearch/qtokenizer.cpp +++ b/tools/assistant/lib/fulltextsearch/qtokenizer.cpp @@ -1,10 +1,17 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) +** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. +** All rights reserved. ** -** This file is part of the QCLucene library and is distributable under -** the terms of the LGPL license as specified in the license.txt file. +** Portion Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** +** 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. ** ****************************************************************************/ diff --git a/tools/assistant/lib/fulltextsearch/qtokenizer_p.h b/tools/assistant/lib/fulltextsearch/qtokenizer_p.h index f327336..ab96ac6 100644 --- a/tools/assistant/lib/fulltextsearch/qtokenizer_p.h +++ b/tools/assistant/lib/fulltextsearch/qtokenizer_p.h @@ -1,10 +1,17 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) +** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. +** All rights reserved. ** -** This file is part of the QCLucene library and is distributable under -** the terms of the LGPL license as specified in the license.txt file. +** Portion Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** +** 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. ** ****************************************************************************/ diff --git a/tools/assistant/lib/fulltextsearch/qtokenstream.cpp b/tools/assistant/lib/fulltextsearch/qtokenstream.cpp index 0f4ab95..5304cff 100644 --- a/tools/assistant/lib/fulltextsearch/qtokenstream.cpp +++ b/tools/assistant/lib/fulltextsearch/qtokenstream.cpp @@ -1,10 +1,17 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) +** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. +** All rights reserved. ** -** This file is part of the QCLucene library and is distributable under -** the terms of the LGPL license as specified in the license.txt file. +** Portion Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** +** 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. ** ****************************************************************************/ @@ -57,4 +64,4 @@ bool QCLuceneTokenStream::next(QCLuceneToken &token) return d->tokenStream->next(token.d->token); } -QT_END_NAMESPACE \ No newline at end of file +QT_END_NAMESPACE diff --git a/tools/assistant/lib/fulltextsearch/qtokenstream_p.h b/tools/assistant/lib/fulltextsearch/qtokenstream_p.h index eff2338..5aab73f 100644 --- a/tools/assistant/lib/fulltextsearch/qtokenstream_p.h +++ b/tools/assistant/lib/fulltextsearch/qtokenstream_p.h @@ -1,10 +1,17 @@ /**************************************************************************** ** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Nokia Corporation (qt-info@nokia.com) +** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. +** All rights reserved. ** -** This file is part of the QCLucene library and is distributable under -** the terms of the LGPL license as specified in the license.txt file. +** Portion Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** +** 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. ** ****************************************************************************/ -- cgit v0.12 From 4feb4019cfc144cef4cd9177d52e52dee9ebdf32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Tue, 18 Aug 2009 17:00:34 +0200 Subject: Fixed bug in drawImage() when fall-back code path is used. We need to floor instead of round to prevent rectangles that are on the edge from being shifted one pixel down / right. Task-number: 258776 Reviewed-by: Kim --- src/gui/painting/qrasterizer.cpp | 14 +++++++------- tests/auto/qpainter/tst_qpainter.cpp | 26 ++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 7 deletions(-) diff --git a/src/gui/painting/qrasterizer.cpp b/src/gui/painting/qrasterizer.cpp index fe90221..d514e71 100644 --- a/src/gui/painting/qrasterizer.cpp +++ b/src/gui/painting/qrasterizer.cpp @@ -691,14 +691,14 @@ static inline bool q16Dot16Compare(qreal p1, qreal p2) return FloatToQ16Dot16(p2 - p1) == 0; } -static inline qreal qRoundF(qreal v) +static inline qreal qFloorF(qreal v) { #ifdef QT_USE_MATH_H_FLOATS if (sizeof(qreal) == sizeof(float)) - return floorf(v + 0.5); + return floorf(v); else #endif - return floor(v + 0.5); + return floor(v); } void QRasterizer::rasterizeLine(const QPointF &a, const QPointF &b, qreal width, bool squareCap) @@ -758,10 +758,10 @@ void QRasterizer::rasterizeLine(const QPointF &a, const QPointF &b, qreal width, const qreal reciprocal = 1 / gridResolution; // snap to grid to prevent large slopes - pa.rx() = qRoundF(pa.rx() * gridResolution) * reciprocal; - pa.ry() = qRoundF(pa.ry() * gridResolution) * reciprocal; - pb.rx() = qRoundF(pb.rx() * gridResolution) * reciprocal; - pb.ry() = qRoundF(pb.ry() * gridResolution) * reciprocal; + pa.rx() = qFloorF(pa.rx() * gridResolution) * reciprocal; + pa.ry() = qFloorF(pa.ry() * gridResolution) * reciprocal; + pb.rx() = qFloorF(pb.rx() * gridResolution) * reciprocal; + pb.ry() = qFloorF(pb.ry() * gridResolution) * reciprocal; // old delta const QPointF d0 = a - b; diff --git a/tests/auto/qpainter/tst_qpainter.cpp b/tests/auto/qpainter/tst_qpainter.cpp index a105bc5..e77d133 100644 --- a/tests/auto/qpainter/tst_qpainter.cpp +++ b/tests/auto/qpainter/tst_qpainter.cpp @@ -202,6 +202,7 @@ private slots: void drawImage_task217400_data(); void drawImage_task217400(); + void drawImage_task258776(); void drawRect_task215378(); void drawRect_task247505(); @@ -3507,6 +3508,31 @@ void t