summaryrefslogtreecommitdiffstats
path: root/src/gui/text
Commit message (Collapse)AuthorAgeFilesLines
* Fix cursor truncate to include line positionJiang Jiang2012-07-031-2/+2
| | | | | | | | Since we could have moved the line position (QTextLine::setPosition), the truncating position should be adjusted with that. Change-Id: Ie1acd4a1b6a4adfbeeb9ce8ee2dfa19d992470e8 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
* Removing potential crashes from out-of-thread cleanup on SymbianMurray Read2012-06-211-2/+4
| | | | | | | | | | | | | | | | | | | | There have been some crashes seen on Symbian when its adoptedThreadMonitor attempts to clean up objects created in other, now dead, threads. Some of these objects simply can't be cleaned up properly outside of their original thread, so the thread has to be checked when they are cleaned up, and cleanup skipped in the wrong thread. For pthread created threads, we also have the ability to insert cleanup code during thread shutdown. This was used in the 4.7 implementation of QThread on Symbian, and is a better solution for pthread based adopted threads as it gives in-thread cleanup. So the appropriate pthread code is also used with changes to adoptedThreadMonitor so that it can run along side the pthread cleanup code. Change-Id: Iad8207879b1ece62e5cce85f26a616166aa22486 Reviewed-by: Juha Kukkonen <ext-juha.kukkonen@nokia.com> Reviewed-by: Pasi Pentikäinen <ext-pasi.a.pentikainen@nokia.com>
* Restored native behavior when moving cursor from selectionRobert Loehning2012-06-201-0/+8
| | | | | | | | | Reverting changes from 1b031759ddfdab9703dfecac13f1ed318da3dafe except for Mac Task-number: QTCREATORBUG-7215 Change-Id: I8570c4bd35daf8b5820507a9399d33d00f96d41b Reviewed-by: Alessandro Portale <alessandro.portale@nokia.com>
* Fix application font loading in basic font dbJiang Jiang2012-05-041-5/+15
| | | | | | | | | | | | | | | | | | | We need to reregister fonts in initializeDb because basic font db doesn't have an internal record like fontconfig does, so just repopulating the font database won't work. db->reregisterAppFonts is now used properly as intended (reregister application fonts after the system font database has been cleared). Also, static variable 'initialized' in initializeDb() is removed since we check privateDb()->count to see if it needs to be populated again. Task-number: QTBUG-22063 Change-Id: Ifc66392b56b72acbe08b99256c61421c204be5d7 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com> (cherry picked from commit 89cfe9eb01ad75c14121dbd6038b7c791226acf1) Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
* Fix memory leak when drawing text in non-common scriptEskil Abrahamsen Blomfeldt2012-04-121-3/+10
| | | | | | | | | When the fontEngine() cached was updated for new parameters, we would overwrite the cached engine, but not deref the old cached engine, thus it would never be deleted. Change-Id: I3b88698712e468ffa634bd98019a7871662cc363 Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
* Fix signed/unsigned warnings (QWS)Sergey Gusarov2012-04-051-1/+1
| | | | | Change-Id: I98ba87fa236b1a10ea2499e270e71a94f54c1c3b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix a crash in cursorToX() when new block is addedJiang Jiang2012-04-031-0/+4
| | | | | | | | | | When an empty new block is being added, the layoutData->memory data will be 0, thus QTextEngine::attributes() will return 0. We should only access the attributes pointer when some text actually exist. Task-number: QTBUG-24718 Change-Id: I9ce9f7b57bccf24099a02832ce30fb6cebfaad33 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
* Fixed compiler warnings about unused q and d pointers.Janne Anttila2012-03-151-1/+0
| | | | | | | | | | The q and d pointers were not used in these functions at all, or they were used only inside some #ifdef quard such as QT_NO_ACCESSIBILITY. Moved the Q_D and Q_Q macros inside the appropriate scope. Task-number: QTBUG-22512 Change-Id: I1624a1d800c7ce21cde4af1678d93e6f615edd45 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* Revert "Don't render glyph with FT with fetchMetricsOnly"Jiang Jiang2012-03-011-1/+1
| | | | | | | | | | | | Report https://bugs.webkit.org/show_bug.cgi?id=79561 shows that this commit will cause significant slow down in text handling operations. Though the exact reason is unknown we should revert it first and find out the reason later. This reverts commit 5ffac0cfc732b994e60af0b6b965b1780ca41f2e. Change-Id: I072bd817e20cf2f3455b6799d68079100e1a49dd Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Fix divide by zero when glyphWidth is 0Jiang Jiang2012-02-281-0/+2
| | | | | Change-Id: Ic0108b76b8d73cc977f8d64e036a65cb93db4684 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
* Fix for Thai characters with a below markMarko Kenttala2012-02-281-3/+9
| | | | | | | | | | | Some Thai characters with a mark below got drawn under fonts descent causing them to be clipped in some situations. Added checking for this and use of lower offset if needed. Task-Number: ou1cimx1#979179 Change-Id: If9fb643d4dee24342215a637c805d52b78584333 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Don't render glyph with FT with fetchMetricsOnlyJiang Jiang2012-02-151-1/+1
| | | | | | | | | Neither rendering with outline nor fetchMetricsOnly requires the rendering from FreeType so we don't need to render them or cache it. It should speed up recalcAdvances() quite a lot. Change-Id: Ic322507d54ab59020851e359088a4afa4e03c8db Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* QTextEngine - treat a fullstop (0x2E) as the same script as the preceeding ↵John Tapsell2012-02-101-1/+14
| | | | | | | | | | | text when dividing up strings Many languages use a fullstop to indicate an abbreviation, making the fullstop part of the word. For languages like thai, it is required to pass the fullstop along for correct word breaking. Change-Id: Ideded63432d06a1ab3b786a7bd13356f2cc1a090 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Fix Qt to use font with simplified chinese characters as default if neededMarko Kenttala2012-02-081-0/+8
| | | | | | | | | | | | Qt defaulted to use a font with traditional chinese characters even if system language was set as ELangPrcChinese. Fixed qfont_s60 to use a font with simplified chinese characters in this case. Task-Number: ou1cimx1#915614 Change-Id: I0258a95f6630b4fa07acc9340bb38fc67bea7b1d Reviewed-by: Sami Merilä <sami.merila@nokia.com> Reviewed-by: Murray Read <ext-murray.2.read@nokia.com> Reviewed-by: Pasi Pentikäinen <ext-pasi.a.pentikainen@nokia.com>
* Update accessibility selections in QTextControl.Frederik Gladhorn2012-02-081-2/+13
| | | | | | Change-Id: Iae0c2792b64b8ec2736a9ff621cf7c313a394093 Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
* QTextEdit cursor position fix when moving left/right with selectionPasi Matilainen2012-02-031-6/+20
| | | | | | | | | | | When text has been selected in a QTextEdit and the left or right arrow key is pressed, the cursor moves one character beyond the start or end of the selection, when it shouldn't move past the selection. Fixed by moving the cursor to the right place when a selection is active. Task-number: QTBUG-22853 Change-Id: I9ea1863436db98627a6fd041ce554cf10be26493 Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
* Cleaning logClusters for line separator layout shortcutJiang Jiang2012-01-181-1/+3
| | | | | | | | | | In some cases the logClusters are accessed, but we don't have actual glyphs generated for them. Task-number: QTBUG-23704 Change-Id: I719c183e17429941b32dd37bf8a4e5497edda6fe Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
* Update year in Nokia copyright messages.Jason McDonald2012-01-11117-117/+117
| | | | | | | | | Simple search and replace. This commit doesn't touch 3rd-party files, nor translations (where the change is not so simple and will be handled in a separate commit). Change-Id: I4e48513b8078a44a8cd272326685b25338890148 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Fix crash in positionInLigatureJiang Jiang2011-12-161-1/+1
| | | | | | | Check boundary of pos before accessing attributes. Task-number: QTBUG-23104 Reviewed-by: Eskil
* Fix stretched font positions in LionJiang Jiang2011-12-012-2/+9
| | | | | | | | | | In Mac OS X 10.7 and up, According to http://lists.apple.com/archives/Coretext-dev/2011/Nov/msg00006.html we need to manually apply transform matrix to advances if text matrix as been applied, CTRunGetPositions won't apply it. Task-number: QTBUG-22825 Reviewed-by: Eskil
* Backport writingSystems support code for Cocoa from Qt 5Jiang Jiang2011-12-011-2/+52
| | | | | | | Mark writingSystems support based on languages from Core Text. Task-number: QTBUG-20996 Reviewed-by: Morten Sorvig
* Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt-fire-staging into ↵Qt Continuous Integration System2011-11-143-25/+34
|\ | | | | | | | | | | | | | | | | | | master-integration * 'master' of scm.dev.nokia.troll.no:qt/qt-fire-staging: Remove font that may not exists in some OS X systems Fix regression in styleName searching Fix styleName listing with the same QtFontStyle::Key value Fix localized font family access in OS X
| * Fix regression in styleName searchingJiang Jiang2011-11-092-24/+10
| | | | | | | | | | | | | | | | | | 1. Faked styles should have styleNames as well otherwise we couldn't find them. 2. With a QtFontFoundry mixed with style keys and style names, there is no way to sort them in a manner than binary search will work, we have to use linear search instead.
| * Fix styleName listing with the same QtFontStyle::Key valueJiang Jiang2011-11-081-14/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | We should store fonts with different style names but the same QtFontStyle::Key value (italic, weight and stretch) separately, so that fonts like Osaka (Regular, Regular-Mono) can be listed correctly. dd0205e0fbacf340508686cc136d70eda7bf664d introduced this regression when moving styleName out of Key. Without a styleName specified, we will do binary search and insertion for styles by comparing QtFontStyle::Key. We should do the same but comparing styleName instead when it's available. Reviewed-by: Eskil
| * Fix localized font family access in OS XJiang Jiang2011-11-082-4/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Font family names listed in QFontDatabase::families() should be localized names rather than their default (English) names, to be consistent with behaviors in other Mac apps and previous Qt/Mac based on ATS. It should also be possible to verify if a font exists with any family name, regardless it's localized or not. Say we have font "Hiragino Mincho Pro", which has a Japanese name called "ヒラギ ノ明朝 Pro", then db.hasFamily(QString::fromUtf8("ヒラギノ明朝 Pro")) should return true. Task-number: QTBUG-22372 Reviewed-by: Morten Sorvig
* | Fix QPlainTextEdit when using Qt::TextSelectableByKeyboard flagjahonkon2011-11-111-5/+2
|/ | | | | | | | | It is not possible to select text with keyboard when specifying only Qt::TextSelectableByKeyboard flag. Task-number: QTBUG-18952 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Fix QFont related compilation errors on Mac OSX CarbonSamuli Piippo2011-11-012-3/+3
| | | | | | | Task-number: QTBUG-22318 Merge-request: 1434 Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
* Merge branch '4.8-upstream' into master-waterWater-Team2011-10-173-5/+5
|\
| * Merge remote-tracking branch 'qt/4.8'Sami Lempinen2011-10-141-1/+1
| |\
| * | Converting from double to qreal in guimread2011-10-103-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There were a number of places in QtGui where doubles were used in expressions due to the use of floating point constants in the code. Many of these constants are now constructed as qreal, removing the use of double operations where unneeded. These changes have been limited to constants that have exactly the same value whether double or float, to ensure that precision errors are not introduced. This should not affect any of the desktop platforms where qreal is double. On Symbian, where qreal is float, appropriate autotests have been run. Task-number: QTBUG-4894 Reviewed-by: Sami Merila
* | | fix possible race conditionsKonstantin Ritt2011-10-071-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | the initialization guard must be set after the initialization is done; for the code assumed to be only executed in a single thread, this change was done just for consistency - in order to avoid similar issues by copy-pasting in future Merge-request: 2655 Reviewed-by: Jan-Arve Saether <jan-arve.saether@nokia.com>
* | | QTBUG-21058: Fix for possible crashes in QTextControl::setCursorWidth()Mikko Knuutila2011-10-041-4/+4
| |/ |/| | | | | | | | | | | | | | | Cursor's width is now queried from the style only when the user calls cursorWidth(). Earlier it was queried already in the ctor, which caused crashes if the application was guiless. Merge-request: 2697 Reviewed-by: Jan-Arve Saether <jan-arve.saether@nokia.com>
* | Fix possible crash in QFontEngineFTEskil Abrahamsen Blomfeldt2011-09-261-1/+1
|/ | | | | | | Avoid crash if set pointer is null. Task-number: QTBUG-21647 Reviewed-by: Jiang Jiang
* Merge remote-tracking branch 'qt-mainline/4.8'aavit2011-09-221-6/+9
|\ | | | | | | | | Conflicts: dist/changes-4.8.0
| * Merge branch 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into ↵Qt Continuous Integration System2011-09-201-6/+9
| |\ | | | | | | | | | | | | | | | | | | | | | | | | master-integration * 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-1: Fixed automatic plugin path resolving for predefined Qt plugins. Resolve a number of compilation issues with INTEGRITY Fix compile issue when building with QT_NO_CONCURRENT and QT_NO_FUTURE
| | * Resolve a number of compilation issues with INTEGRITYRolland Dudemaine2011-09-191-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | First, #ifdef'ed out getpwuid_r() and getpwgid_r() usage since users/groups support is not in in single-process Posix mode. Also, correct a typo and add missing files to io.pri. Update documentation to disable libtiff which won't compile until ibtiff itself is updated, and add back -no-exceptions in the sample command line. And add a line to compile host tools. Add a dummy QT_OPEN_LARGEFILE definition in qplatformdefs.h since there is code that requires it. Move definition of getGlyph() after the definition of qHash(GlyphAndSubPixelPosition). Merge-request: 2686 Reviewed-by: ossi
* | | Only limit cursor position when line is wrappedJiang Jiang2011-09-211-1/+1
| | | | | | | | | | | | Reviewed-by: Eskil
* | | Make sure cursor position doesn't exceed line endJiang Jiang2011-09-191-0/+3
|/ / | | | | | | | | | | | | | | | | If we have trailing spaces at the end of a line, cursor will disappear because the position we returned exceeds line end, thus the widget border. By limiting it within line.width we can make sure it always visible, which is more consistent to the behavior in common platforms. Reviewed-by: Eskil
* | Merge remote branch 'qt-mainline/4.8'aavit2011-09-1714-93/+54
|\ \
| * \ Merge remote branch 'origin/4.8' into 4.8-from-4.7Rohan McGovern2011-09-1482-2332/+9603
| |\ \ | | |/ | | | | | | | | | | | | Conflicts: src/gui/text/qtextengine_p.h src/network/ssl/qsslsocket_openssl.cpp
| | * Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt-fire-staging into ↵Qt Continuous Integration System2011-09-1011-177/+135
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | master-integration * 'master' of scm.dev.nokia.troll.no:qt/qt-fire-staging: Disable autotest broken by the change to QCache in 7ab0bed Generate glyphs in un-transformed coordinate system. Use QT_MAX_CACHED_GLYPH_SIZE in QFontEngineFT Reset trailingSpaces in relayout Prevent QPixmapCache potentially growing indefinitely. Allocate 16-byte aligned memory independent of platform for raster pool. Fix trailing spaces problem by not adding it to QScriptLine.length Fix RTL layout for fonts when non-printable character has an advance Fix regression in tst_qrawfont Make it compile on mac Fixed compiling error in qvfb. micro optimizations fix "comparison between signed and unsigned" warnings on windows, don't resolve the gdi32's symbols for each QRawFont instance fix typo in the docs QRawFont: add missed operator != optimize QGlyphRun's operator == a bit QGlyphRun: make operator != inlined QGlyphRun: don't detach if the decoration wasn't actually changed QPA event loop: Set a timeout != 0 if there are no timers.
| | * \ Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt-qml-staging into ↵Qt Continuous Integration System2011-09-091-5/+2
| | |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | master-integration * 'master' of scm.dev.nokia.troll.no:qt/qt-qml-staging: Fix double click and drag not extending word selection.
| | | * | Fix double click and drag not extending word selection.Andrew den Exter2011-09-081-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mousePressed isn't set on the second press of a double click and so can't be used to determine if all selections should be skipped. Instead skip only the single click and drag selections if mousePressed is false. Change-Id: I5e7ba033f38b0f9b98fdca5c61a8548f92991601 Task-number: QTBUG-20925 Reviewed-by: Martin Jones
| | * | | Merge branch 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into ↵Qt Continuous Integration System2011-09-0813-88/+52
| | |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | master-integration * 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-1: Split CFLAGS from pkg-config properly Ensure that the proxystyle is used over the style's own functions runonphone: Add a missing space between a message and the file name Perl check for windows configure. QSettings: don't assume XDG_CONFIG_HOME is latin1-encoded QSettings: use the common appdata dir when bootstrapping qmake on win Replace explicit surrogate handlers by inline methods of QChar class
| | | * | | Replace explicit surrogate handlers by inline methods of QChar classsuzuki toshiya2011-09-0713-88/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Merge-request: 1284 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
| * | | | | Release font engine refcount when done using it in QTextEngineJiang Jiang2011-09-093-5/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 5f2b6dd2a50275bc05ae5d7e9dd8902d6d49d9df increased refcounts for font engines in QTextEngine cache, we need to decrease them when the QTextEngine is deallocated. Task-number: QTBUG-21222 Reviewed-by: Eskil
* | | | | | Release font engine refcount when done using it in QTextEngineJiang Jiang2011-09-163-5/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 5f2b6dd2a50275bc05ae5d7e9dd8902d6d49d9df increased refcounts for font engines in QTextEngine cache, we need to decrease them when the QTextEngine is deallocated. Task-number: QTBUG-21222 Reviewed-by: Eskil
* | | | | | Do not put cursor at non-stop character positionsJiang Jiang2011-09-141-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When moving cursors, non-stop positions are skipped, however certain input sequences can still lead us there. In such cases we should simply ignore those positions in cursorToX. Task-number: QTBUG-7076 Reviewed-by: Eskil
* | | | | | doc: Fix incorrect enum name in QRawFont::alphaMapForGlyph docsEskil Abrahamsen Blomfeldt2011-09-131-1/+2
| |_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | There's no QImage::Format_A8 format. This is a term used in the corresponding QFontEngineGlyphCache enum. Reviewed-by: Jiang Jiang
* | | | | Use QT_MAX_CACHED_GLYPH_SIZE in QFontEngineFTAleksandar Stojiljkovic2011-09-091-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-21162 - Letters get truncated when font size=72 and set to Italic Reviewed-by: Eskil