diff options
author | Liang Qi <liang.qi@theqtcompany.com> | 2015-12-02 23:33:06 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@theqtcompany.com> | 2015-12-02 23:33:06 +0100 |
commit | 72f5867f144cec8fc7848cbcc772683fe845652d (patch) | |
tree | 7513af27b59332bf111f406d304977adc8c8612e /src/gui/text | |
parent | 13777097118c496391d4b9656b95097ac25e4a40 (diff) | |
parent | bf0af8b5a24de7e595929a64948a3548936aaaee (diff) |
Merge remote-tracking branch 'origin/5.6' into dev
Conflicts:
src/corelib/kernel/qcoreapplication.cpp
src/corelib/kernel/qeventdispatcher_blackberry.cpp
src/network/bearer/qnetworkconfiguration.cpp
src/plugins/bearer/blackberry/qbbengine.cpp
src/plugins/platforms/android/androidjnimain.cpp
src/plugins/platforms/android/qandroidplatformtheme.cpp
src/plugins/platforms/qnx/qqnxbpseventfilter.cpp
src/plugins/platforms/qnx/qqnxfiledialoghelper_bb10.cpp
src/plugins/platforms/qnx/qqnxinputcontext_imf.cpp
src/plugins/platforms/qnx/qqnxintegration.cpp
src/plugins/platforms/qnx/qqnxnavigatorbps.cpp
src/plugins/platforms/qnx/qqnxvirtualkeyboardbps.cpp
src/plugins/platforms/qnx/qqnxwindow.cpp
src/widgets/kernel/qwidgetwindow.cpp
src/widgets/styles/qwindowsvistastyle.cpp
src/widgets/styles/qwindowsxpstyle.cpp
src/widgets/widgets/qtoolbararealayout.cpp
tests/auto/corelib/global/qflags/qflags.pro
tests/auto/corelib/itemmodels/qitemmodel/modelstotest.cpp
tests/auto/corelib/tools/qversionnumber/qversionnumber.pro
tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp
Change-Id: I37be88c6c185bb85404823353e027a0a6acdbce4
Diffstat (limited to 'src/gui/text')
-rw-r--r-- | src/gui/text/qtextengine.cpp | 10 | ||||
-rw-r--r-- | src/gui/text/qtextodfwriter.cpp | 9 |
2 files changed, 14 insertions, 5 deletions
diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp index 746a51318e..2f755d0c25 100644 --- a/src/gui/text/qtextengine.cpp +++ b/src/gui/text/qtextengine.cpp @@ -1277,14 +1277,14 @@ int QTextEngine::shapeTextWithHarfbuzzNG(const QScriptItem &si, const ushort *st for (uint i = 0; i < num_glyphs; ++i) g.advances[i] *= stretch; } - - if (actualFontEngine->fontDef.styleStrategy & QFont::ForceIntegerMetrics) { - for (uint i = 0; i < num_glyphs; ++i) - g.advances[i] = g.advances[i].round(); - } } #endif + if (!actualFontEngine->supportsSubPixelPositions() || (actualFontEngine->fontDef.styleStrategy & QFont::ForceIntegerMetrics)) { + for (uint i = 0; i < num_glyphs; ++i) + g.advances[i] = g.advances[i].round(); + } + glyphs_shaped += num_glyphs; } diff --git a/src/gui/text/qtextodfwriter.cpp b/src/gui/text/qtextodfwriter.cpp index 429e910f18..1fd20cfbef 100644 --- a/src/gui/text/qtextodfwriter.cpp +++ b/src/gui/text/qtextodfwriter.cpp @@ -279,6 +279,12 @@ void QTextOdfWriter::writeBlock(QXmlStreamWriter &writer, const QTextBlock &bloc writer.writeAttribute(textNS, QString::fromLatin1("style-name"), QString::fromLatin1("p%1") .arg(block.blockFormatIndex())); for (QTextBlock::Iterator frag = block.begin(); !frag.atEnd(); ++frag) { + bool isHyperlink = frag.fragment().charFormat().hasProperty(QTextFormat::AnchorHref); + if (isHyperlink) { + QString value = frag.fragment().charFormat().property(QTextFormat::AnchorHref).toString(); + writer.writeStartElement(textNS, QString::fromLatin1("a")); + writer.writeAttribute(xlinkNS, QString::fromLatin1("href"), value); + } writer.writeCharacters(QString()); // Trick to make sure that the span gets no linefeed in front of it. writer.writeStartElement(textNS, QString::fromLatin1("span")); @@ -335,6 +341,9 @@ void QTextOdfWriter::writeBlock(QXmlStreamWriter &writer, const QTextBlock &bloc writer.writeCharacters(fragmentText.mid(exportedIndex)); writer.writeEndElement(); // span + writer.writeCharacters(QString()); // Trick to make sure that the span gets no linefeed behind it. + if (isHyperlink) + writer.writeEndElement(); // a } writer.writeCharacters(QString()); // Trick to make sure that the span gets no linefeed behind it. writer.writeEndElement(); // p |