diff options
author | Jørgen Lind <jorgen.lind@nokia.com> | 2011-06-27 12:27:54 +0200 |
---|---|---|
committer | Jørgen Lind <jorgen.lind@nokia.com> | 2011-06-27 12:27:54 +0200 |
commit | 18a3f6169bb8a763366003d92b8013950578c79f (patch) | |
tree | e39fa00a9511410fea9be35a6130007e43719ad8 /src/gui/text | |
parent | 371d398f70e10408e0eaba7b5f05e638a0048599 (diff) | |
parent | a06c8405d053b16327d65415f3335eceb37abd3b (diff) |
Merge remote-tracking branch 'base/master' into refactor
Conflicts:
demos/demos.pro
demos/embedded/digiflip/digiflip.pro
examples/examples.pro
examples/graphicsview/embeddeddialogs/embeddeddialogs.pro
src/gui/kernel/qplatformglcontext_qpa.cpp
src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglcontext.cpp
src/plugins/platforms/wayland/gl_integration/xcomposite_glx/qwaylandxcompositeglxcontext.cpp
src/plugins/platforms/wayland/qwaylanddisplay.cpp
src/plugins/platforms/wayland/qwaylandwindow.cpp
Change-Id: I2a4ec9e2ca9c9aa9d57b55f98985e810b77bb745
Diffstat (limited to 'src/gui/text')
-rw-r--r-- | src/gui/text/qfont.cpp | 1 | ||||
-rw-r--r-- | src/gui/text/qfont_p.h | 3 | ||||
-rw-r--r-- | src/gui/text/qfontdatabase.cpp | 2 | ||||
-rw-r--r-- | src/gui/text/qharfbuzz_copy_p.h | 8 | ||||
-rw-r--r-- | src/gui/text/qtextdocument.cpp | 2 | ||||
-rw-r--r-- | src/gui/text/qtextdocumentfragment.cpp | 9 | ||||
-rw-r--r-- | src/gui/text/qtextdocumentfragment_p.h | 2 | ||||
-rw-r--r-- | src/gui/text/qtextlayout.cpp | 4 |
8 files changed, 21 insertions, 10 deletions
diff --git a/src/gui/text/qfont.cpp b/src/gui/text/qfont.cpp index 8b78b52c08..846d5a3814 100644 --- a/src/gui/text/qfont.cpp +++ b/src/gui/text/qfont.cpp @@ -140,6 +140,7 @@ bool QFontDef::exactMatch(const QFontDef &other) const && weight == other.weight && style == other.style && this_family == other_family + && styleName == other.styleName && (this_foundry.isEmpty() || other_foundry.isEmpty() || this_foundry == other_foundry) diff --git a/src/gui/text/qfont_p.h b/src/gui/text/qfont_p.h index 8eeae6ffc1..4ae31c38d6 100644 --- a/src/gui/text/qfont_p.h +++ b/src/gui/text/qfont_p.h @@ -113,6 +113,7 @@ struct QFontDef && styleStrategy == other.styleStrategy && ignorePitch == other.ignorePitch && fixedPitch == other.fixedPitch && family == other.family + && styleName == other.styleName && hintingPreference == other.hintingPreference #ifdef Q_WS_X11 && addStyle == other.addStyle @@ -128,6 +129,8 @@ struct QFontDef if (styleHint != other.styleHint) return styleHint < other.styleHint; if (styleStrategy != other.styleStrategy) return styleStrategy < other.styleStrategy; if (family != other.family) return family < other.family; + if (!styleName.isEmpty() && !other.styleName.isEmpty() && styleName != other.styleName) + return styleName < other.styleName; if (hintingPreference != other.hintingPreference) return hintingPreference < other.hintingPreference; #ifdef Q_WS_X11 diff --git a/src/gui/text/qfontdatabase.cpp b/src/gui/text/qfontdatabase.cpp index ad8c6c9ab5..5369ac52f3 100644 --- a/src/gui/text/qfontdatabase.cpp +++ b/src/gui/text/qfontdatabase.cpp @@ -1123,13 +1123,13 @@ QT_BEGIN_INCLUDE_NAMESPACE #elif defined(Q_OS_SYMBIAN) # include "qfontdatabase_s60.cpp" #endif +QT_END_INCLUDE_NAMESPACE #if !defined(Q_WS_X11) QString QFontDatabase::resolveFontFamilyAlias(const QString &family) { return family; } #endif -QT_END_INCLUDE_NAMESPACE static QtFontStyle *bestStyle(QtFontFoundry *foundry, const QtFontStyle::Key &styleKey) { diff --git a/src/gui/text/qharfbuzz_copy_p.h b/src/gui/text/qharfbuzz_copy_p.h index 74b824ab35..835d8fb1a6 100644 --- a/src/gui/text/qharfbuzz_copy_p.h +++ b/src/gui/text/qharfbuzz_copy_p.h @@ -43,7 +43,7 @@ extern "C" { #ifdef __xlC__ typedef unsigned hb_bitfield; #else -typedef quint8 hb_bitfield; +typedef QT_PREPEND_NAMESPACE(quint8) hb_bitfield; #endif typedef enum { @@ -66,12 +66,12 @@ typedef enum { HB_Err_Out_Of_Memory = 0xDEAD } HB_Error; -typedef quint32 HB_Glyph; +typedef QT_PREPEND_NAMESPACE(quint32) HB_Glyph; typedef void * HB_Font; typedef void * HB_Face; typedef void * HB_FontRec; -typedef quint32 hb_uint32; -typedef qint32 HB_Fixed; +typedef QT_PREPEND_NAMESPACE(quint32) hb_uint32; +typedef QT_PREPEND_NAMESPACE(qint32) HB_Fixed; typedef struct { HB_Fixed x; diff --git a/src/gui/text/qtextdocument.cpp b/src/gui/text/qtextdocument.cpp index 3ca72bf14e..a488c13156 100644 --- a/src/gui/text/qtextdocument.cpp +++ b/src/gui/text/qtextdocument.cpp @@ -2710,6 +2710,8 @@ void QTextHtmlExporter::emitBlock(const QTextBlock &block) emitBlockAttributes(block); html += QLatin1Char('>'); + if (block.begin().atEnd()) + html += "<br />"; QTextBlock::Iterator it = block.begin(); if (fragmentMarkers && !it.atEnd() && block == doc->begin()) diff --git a/src/gui/text/qtextdocumentfragment.cpp b/src/gui/text/qtextdocumentfragment.cpp index 042b1d01c2..0c8860e98e 100644 --- a/src/gui/text/qtextdocumentfragment.cpp +++ b/src/gui/text/qtextdocumentfragment.cpp @@ -545,8 +545,13 @@ void QTextHtmlImporter::import() } if (currentNode->isBlock()) { - if (processBlockNode() == ContinueWithNextNode) + QTextHtmlImporter::ProcessNodeResult result = processBlockNode(); + if (result == ContinueWithNextNode) { continue; + } else if (result == ContinueWithNextSibling) { + currentNodeIdx += currentNode->children.size(); + continue; + } } if (currentNode->charFormat.isAnchor() && !currentNode->charFormat.anchorName().isEmpty()) { @@ -1157,7 +1162,7 @@ QTextHtmlImporter::ProcessNodeResult QTextHtmlImporter::processBlockNode() if (currentNode->isEmptyParagraph) { hasBlock = false; - return ContinueWithNextNode; + return ContinueWithNextSibling; } hasBlock = true; diff --git a/src/gui/text/qtextdocumentfragment_p.h b/src/gui/text/qtextdocumentfragment_p.h index bfbec3075c..227123ed80 100644 --- a/src/gui/text/qtextdocumentfragment_p.h +++ b/src/gui/text/qtextdocumentfragment_p.h @@ -135,7 +135,7 @@ private: Table scanTable(int tableNodeIdx); - enum ProcessNodeResult { ContinueWithNextNode, ContinueWithCurrentNode }; + enum ProcessNodeResult { ContinueWithNextNode, ContinueWithCurrentNode, ContinueWithNextSibling }; void appendBlock(const QTextBlockFormat &format, QTextCharFormat charFmt = QTextCharFormat()); bool appendNodeText(); diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp index e386b5eb1f..03e00ed0df 100644 --- a/src/gui/text/qtextlayout.cpp +++ b/src/gui/text/qtextlayout.cpp @@ -2149,7 +2149,7 @@ QList<QGlyphRun> QTextLine::glyphRuns(int from, int length) const } int relativeFrom = qMax(iterator.itemStart, from) - si.position; - int relativeTo = qMin(iterator.itemEnd, from + length - 1) - si.position; + int relativeTo = qMin(iterator.itemEnd - 1, from + length - 1) - si.position; unsigned short *logClusters = eng->logClusters(&si); int glyphsStart = logClusters[relativeFrom]; @@ -2168,7 +2168,7 @@ QList<QGlyphRun> QTextLine::glyphRuns(int from, int length) const pos += QPointF((glyphLayout.advances_x[i] + justification).toReal(), glyphLayout.advances_y[i].toReal()); } - } else if (relativeTo != (iterator.itemEnd - si.position) && rtl) { + } else if (relativeTo != (iterator.itemEnd - si.position - 1) && rtl) { for (int i=glyphLayout.numGlyphs - 1; i>glyphsEnd; --i) { QFixed justification = QFixed::fromFixed(glyphLayout.justifications[i].space_18d6); pos += QPointF((glyphLayout.advances_x[i] + justification).toReal(), |