summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2010-11-19 00:00:10 (GMT)
committerThierry Bastian <thierry.bastian@nokia.com>2010-11-19 00:00:10 (GMT)
commit2b417c9b7c878bbf49e685509b0e4b411f7b00ba (patch)
treec6ee5716f1ca5529ddbadbca6e0b92e25babd881
parent5ed8a8f0a6ff2dbb4d0836d58d3916a04cca8d4b (diff)
parentfdd3fca40a3fc31762b637952884903816b50786 (diff)
downloadQt-2b417c9b7c878bbf49e685509b0e4b411f7b00ba.zip
Qt-2b417c9b7c878bbf49e685509b0e4b411f7b00ba.tar.gz
Qt-2b417c9b7c878bbf49e685509b0e4b411f7b00ba.tar.bz2
Merge branch 'master-upstream' into master-water
-rw-r--r--mkspecs/features/symbian/qt_config.prf2
-rw-r--r--mkspecs/symbian-gcce/qmake.conf21
-rw-r--r--src/gui/text/qfontengine_mac.mm18
-rw-r--r--tests/auto/qcomplextext/tst_qcomplextext.cpp16
4 files changed, 44 insertions, 13 deletions
diff --git a/mkspecs/features/symbian/qt_config.prf b/mkspecs/features/symbian/qt_config.prf
index 2f446dc..82c1862 100644
--- a/mkspecs/features/symbian/qt_config.prf
+++ b/mkspecs/features/symbian/qt_config.prf
@@ -3,7 +3,7 @@ load(qt_config)
!contains(QMAKE_HOST.os, "Windows") {
# Test for the existence of lower cased headers, a sign of using Gnupoc.
# Note that the qmake "exists" test won't do because it is case insensitive.
- system("test -f $${EPOCROOT}/epoc32/include/akndoc.h") {
+ system("test -f $${EPOCROOT}epoc32/include/akndoc.h") {
CONFIG += is_using_gnupoc
}
}
diff --git a/mkspecs/symbian-gcce/qmake.conf b/mkspecs/symbian-gcce/qmake.conf
index 02ad626..a31e6e4 100644
--- a/mkspecs/symbian-gcce/qmake.conf
+++ b/mkspecs/symbian-gcce/qmake.conf
@@ -51,26 +51,25 @@ QMAKE_LFLAGS_SONAME =
QMAKE_LFLAGS_RPATH = --rpath=
DEFINES += __GCCE__ \
- UNICODE \
- _STLP_NO_EXCEPTION_HEADER
+ UNICODE
QMAKE_LFLAGS_APP += --entry=_E32Startup -u _E32Startup
QMAKE_LFLAGS_SHLIB += -shared --default-symver --entry _E32Dll
QMAKE_LFLAGS_PLUGIN += $$QMAKE_LFLAGS_SHLIB
-gcceExtraFlags = --include=${EPOCROOT}/epoc32/include/gcce/gcce.h -march=armv5t -mapcs -mthumb-interwork -nostdinc -c -msoft-float -T script
+gcceExtraFlags = --include=$${EPOCROOT}epoc32/include/gcce/gcce.h -march=armv5t -mapcs -mthumb-interwork -nostdinc -c -msoft-float -T script
QMAKE_CFLAGS += $${gcceExtraFlags}
QMAKE_CXXFLAGS += $${gcceExtraFlags} -x c++ -fexceptions -fno-unit-at-a-time -fvisibility-inlines-hidden
#If we are not going to link to Qt or qtmain.lib, we need to include this at least once.
isEmpty(QT):contains(TEMPLATE, app) {
- QMAKE_CXXFLAGS += --include=${EPOCROOT}/epoc32/include/stdapis/staticlibinit_gcce.h
+ QMAKE_CXXFLAGS += --include=$${EPOCROOT}epoc32/include/stdapis/staticlibinit_gcce.h
}
QMAKE_LFLAGS += --target1-abs \
--no-undefined \
--nostdlib
-QMAKE_LIBDIR += ${EPOCROOT}/epoc32/release/armv5/udeb/
+QMAKE_LIBDIR += $${EPOCROOT}epoc32/release/armv5/udeb/
# g++ knows the path to the gcc-shipped-libs, ld doesn't. So cache the full path in the generate Makefile
QMAKE_GCC_SEARCH_DIRS =$$system($$QMAKE_CXX -print-search-dirs)
@@ -84,13 +83,11 @@ for(line, QMAKE_GCC_SEARCH_DIRS) {
}
}
-QMAKE_LIBDIR += $${EPOCROOT}/epoc32/release/armv5/lib
+QMAKE_LIBDIR += $${EPOCROOT}epoc32/release/armv5/lib
-INCLUDEPATH = ${EPOCROOT}/epoc32/include/ \
- $${EPOCROOT}/epoc32/include/variant \
- $${EPOCROOT}/epoc32/include/stdapis \
- $${EPOCROOT}/epoc32/include/gcce \
- ${EPOCROOT}/epoc32/include/stdapis/sys \
- ${EPOCROOT}/epoc32/include/stdapis/stlport \
+INCLUDEPATH = $${EPOCROOT}epoc32/include/ \
+ $${EPOCROOT}epoc32/include/variant \
+ $${EPOCROOT}epoc32/include/stdapis \
+ $${EPOCROOT}epoc32/include/gcce \
$$INCLUDEPATH
diff --git a/src/gui/text/qfontengine_mac.mm b/src/gui/text/qfontengine_mac.mm
index 51e18ec..3c6f3b2 100644
--- a/src/gui/text/qfontengine_mac.mm
+++ b/src/gui/text/qfontengine_mac.mm
@@ -252,6 +252,11 @@ bool QCoreTextFontEngineMulti::stringToCMap(const QChar *str, int len, QGlyphLay
continue;
Q_ASSERT((CTRunGetStatus(run) & kCTRunStatusRightToLeft) == rtl);
+ CFRange stringRange = CTRunGetStringRange(run);
+ UniChar endGlyph = CFStringGetCharacterAtIndex(cfstring, stringRange.location + stringRange.length - 1);
+ bool endWithPDF = QChar::direction(endGlyph) == QChar::DirPDF;
+ if (endWithPDF)
+ glyphCount++;
if (!outOBounds && outGlyphs + glyphCount - initialGlyph > *nglyphs) {
outOBounds = true;
@@ -264,6 +269,9 @@ bool QCoreTextFontEngineMulti::stringToCMap(const QChar *str, int len, QGlyphLay
CTFontRef runFont = static_cast<CTFontRef>(CFDictionaryGetValue(runAttribs, NSFontAttributeName));
const uint fontIndex = (fontIndexForFont(runFont) << 24);
//NSLog(@"Run Font Name = %@", CTFontCopyFamilyName(runFont));
+ if (endWithPDF)
+ glyphCount--;
+
QVarLengthArray<CGGlyph, 512> cgglyphs(0);
const CGGlyph *tmpGlyphs = CTRunGetGlyphsPtr(run);
if (!tmpGlyphs) {
@@ -331,6 +339,16 @@ bool QCoreTextFontEngineMulti::stringToCMap(const QChar *str, int len, QGlyphLay
(fontDef.styleStrategy & QFont::ForceIntegerMetrics)
? QFixed::fromReal(lastGlyphAdvance.width).round()
: QFixed::fromReal(lastGlyphAdvance.width);
+
+ if (endWithPDF) {
+ logClusters[stringRange.location + stringRange.length - 1] = glyphCount;
+ outGlyphs[glyphCount] = 0xFFFF;
+ outAdvances_x[glyphCount] = 0;
+ outAdvances_y[glyphCount] = 0;
+ outAttributes[glyphCount].clusterStart = true;
+ outAttributes[glyphCount].dontPrint = true;
+ glyphCount++;
+ }
}
outGlyphs += glyphCount;
outAttributes += glyphCount;
diff --git a/tests/auto/qcomplextext/tst_qcomplextext.cpp b/tests/auto/qcomplextext/tst_qcomplextext.cpp
index fa8a2d1..c66d452 100644
--- a/tests/auto/qcomplextext/tst_qcomplextext.cpp
+++ b/tests/auto/qcomplextext/tst_qcomplextext.cpp
@@ -45,6 +45,7 @@
#if !defined(Q_WS_MAC)
#include <QtTest/QtTest>
+#include <QtGui/QtGui>
#include <private/qtextengine_p.h>
#include "bidireorderstring.h"
@@ -69,6 +70,7 @@ private slots:
void bidiReorderString_data();
void bidiReorderString();
void bidiCursor_qtbug2795();
+ void bidiCursor_PDF();
};
tst_QComplexText::tst_QComplexText()
@@ -183,6 +185,20 @@ void tst_QComplexText::bidiCursor_qtbug2795()
QVERIFY(x1 == x2);
}
+void tst_QComplexText::bidiCursor_PDF()
+{
+ QString str = QString::fromUtf8("\342\200\252hello\342\200\254");
+ QTextLayout layout(str);
+
+ layout.beginLayout();
+ QTextLine line = layout.createLine();
+ layout.endLayout();
+
+ int size = str.size();
+
+ QVERIFY(line.cursorToX(size) == line.cursorToX(size - 1));
+}
+
QTEST_MAIN(tst_QComplexText)
#include "tst_qcomplextext.moc"