summaryrefslogtreecommitdiffstats
path: root/src/gui/text
Commit message (Collapse)AuthorAgeFilesLines
* Fix Mac OS X Carbon build with Qt in a namespace.Danny Boelens2013-04-262-2/+8
| | | | | | Change-Id: I03a4fa4ab7517929c723483deaf1dcb42a8f9b17 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* Compile with clang when C++11 support is enabledBradley T. Hughes2013-04-081-1/+1
| | | | | | | | | | | | | text/qtextdocument_p.cpp:1070:43: error: non-constant-expression cannot be narrowed from type 'int' to 'quint32' (aka 'unsigned int') in initializer list [-Wc++11-narrowing] text/qtextdocument_p.cpp:1070:43: note: override this message by inserting an explicit cast Cherry-picked from qtbase/6deebc817080f9eb86d5d6fbe50444678eed4dfe. Change-Id: Id3faf59a8d30dc829b82508c4be50439db1d9722 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove the usage of undefined QFontDatabase::WritingSystemLiang Qi2013-03-161-8/+0
| | | | | | | | | There is no definition for Yi, Tagalog...Braille in QFontDatabase::WritingSystem, see the header file. (cherry picked from commit qtbase b7b858595e6e2d8dcc9debeb45eb8b9b294b9be6) Change-Id: I0d3625c58310d9af680799d20867f04b42845ca9 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* Fix path separators in archives created by QZipWriterPavel Mogilevskiy2013-02-211-6/+6
| | | | | | | | | | | | | | | | It was not possible to extract data from the archive on OSX which was created on the Windows platform because of wrong separators. Archive was created on Windows via QZipWriter and opened on OSX with QZipReader. It consisted of a lots directories and subdirectories with files. The solution is to use '/' separator for internal representation. Cherry picked from qtbase eff6dbb306956f099374e5a0c5942b9e91a81e71 Change-Id: I2180282d235dc998309fc4f7b67f5c0181b78dda Reviewed-by: Vasiliy Sorokin <sorokin.vasiliy@gmail.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* Fix text issue with Hiragana characters when stylesheet is applied.Mitch Curtis2013-02-211-0/+6
| | | | | | | | | | | | | | | | | | | When typing into a QTextEdit or QLineEdit with a Japanese IME on Windows, some characters have both a black foreground and background and hence cannot be seen. This patch fixes the issue by setting the appropriate colors for the text in these scenarios. The change also fixes a similar situation with QSyntaxHighlighter and Hiragana, where the background and foreground colors were the same. Now it will use underlining to highlight the text (like WordPad does, for example). Task-number: QTBUG-29442 Change-Id: I364d327a8f6573a73b227b79cc5f570cd02611c9 Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Titta Heikkala <titta.heikkala@digia.com> Reviewed-by: David Faure (KDE) <faure@kde.org> Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
* To support QT_NO_IM on Linux/Windows/MacJing Bai2013-01-211-0/+3
| | | | | | | | | | Fix compilation issue when QT_NO_IM is defined. Also fixed references in tests. But fixing plugins/examples seem not necessary at this point. Task-number: QTBUG-26109 Change-Id: I2067051951616012117efa6716640cbf198fdb2a Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-13117-117/+117
| | | | | | Change-Id: I52bf8ef0447b701b4ebf7d7d240013a72adb9425 Reviewed-by: Akseli Salovaara <akseli.salovaara@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Backport adjusting cursorToX for trailing spaces from Qt 5Eskil Abrahamsen Blomfeldt2012-12-192-15/+10
| | | | | | | | | | | This is a backport of d07982b104de5dc2b54bef09c071500ce22cf539 from Qt 5 which fixes cursorToX() in some cases, e.g. when a line filled with spaces is ended by a soft line break. Task-number: QTBUG-27354 Change-Id: Ia88873aeb3c0620044fefe24fc6bb1310e3aa339 Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Andrew den Exter <andrew.den.exter@qinetic.com.au>
* Mac: fix bugs for font selection in QFontDialogLiang Qi2012-12-141-1/+1
| | | | | | | | | | Use localized family name and style name when selecting font with non-English locale Task-number: QTBUG-27415 Change-Id: Ia10aaff50e1ffdb248c730fb46a8a66088ee64bb (cherry picked from qtbase/3c09f6bc9aee0c97427fe8da6efdc73b4ac473aa) Reviewed-by: Liang Qi <liang.qi@digia.com>
* Mac: Correct writingSystem check value for ChineseLiang Qi2012-11-011-2/+2
| | | | | | | | | | | | | For simplified and traditional Chinese. Based on the Apple doc: Internationalization Programming Topics - Language and Locale Designations. (backport of commit edfb24009cf22a0f0277be5d595b48ef9af9c3bf from qt5/qtbase) Task-number: QTBUG-27130 Change-Id: I08969bfba17b6a2589dca5da83b668bb2d8f3e31 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* Fixing font database memoryleakKarim Pinter2012-10-311-2/+2
| | | | | | | | | | | There is one case when the QFontEngine* fe is loaded, then FcPattern* match loaded from FcFontRenderPrepare is not deleted. Valgrind was showing this problem, after the fix there is no memoryleak in Valgrind. Change-Id: I8ef928fe8190a6d26f2e5275b85e08a7a8796a7b Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Jiang Jiang <gzjjgod@gmail.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Use the right properties when checking the frame's marginsAndy Shaw2012-10-221-4/+4
| | | | | | | | | | Changed it to check the Frame*Margin property instead of the Block*Margin property as this was incorrect for a QTextFrameFormat. Task-number: QTBUG-22173 Change-Id: I2c3066165fb592ed034874b1180593822859f933 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com> (cherry picked from qtbase/d060620e6cd3c94e7e0ff809b21593b9c0da0be2)
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-29117-2809/+2809
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: I280c0a575987d1770e354b4948f1d4d767d711ea Reviewed-by: Simo Fält <simo.falt@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Refactor coreservices -> ios & QT_NO_CORESERVICES -> Q_OS_IOSIan Dean2012-09-181-1/+1
| | | | | | | Similar work was done in Qt5 in Change Id3b02316 Change-Id: I392d2a5bfffb9a335f28d5dbc5ea27b800fc4487 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
* Fix regression in QTextDocument::toHtml() with font pixel sizeEskil Abrahamsen Blomfeldt2012-09-131-0/+1
| | | | | | | | | | | | | | Introduced by 2e0003eda4783f69a40fb4b31e7084c761d9640d. We were missing a attributesEmitted=true which caused the output from toHtml() to sometimes be invalid when using pixel sizes to specify the font size. This is a back-port of e640ebacb97f6eea9614925b1da3b97a0ff51409 from Qt 5. Task-number: QTBUG-25778 Change-Id: Ied61fcaef425a590d71c0b52292ac676cb88ba52 Reviewed-by: Jiang Jiang <gzjjgod@gmail.com>
* Revert "Speed up QTextEngine::resolveAdditionalFormats"v4.8.3Eskil Abrahamsen Blomfeldt2012-09-071-65/+2
| | | | | | | | | | | | | | | | This reverts commit 49fbb6e14af78f751fa114c3cf986aaa607d7408 which introduced crashes e.g. in Qt Creator. Since the original change was an optimization, it is reverted in the Qt 4.8 branch since stability is the main priority there. The crash has been fixed for the corresponding Qt 5 commit. It would be an option to recommit the optimization and the crash fix to a future minor release of Qt 4. Task-number: QTBUG-27140 Change-Id: I9dc959ea252fe55a22fd90f333ccb335b3ef1311 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Optimize QTextEngine::findItem by using a binary search.Milian Wolff2012-09-051-5/+12
| | | | | | | | | | | | | This is basically a backport from Qt5: - revert the revert: 22995948cd3f46780be5d8016708aeef0cd7b066 - backport from qtbase: 487583459ea7958f24cd579888a662bcce26caf3 this fixes the off-by-one error in the binary search Task-number: QTBUG-17209 Task-number: QTBUG-231 Change-Id: I7f62fb33cf919ecd7fb2246ae01bb23559e11bf4 Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
* Speed up QTextEngine::setBoundaryOlivier Goffart2012-08-311-6/+14
| | | | | | | | | | | | | | | Before, setBoundary was O(N), now it is O(log N) assuming the boundaries are added in order. (splitItem might still be linear because of the call to QVector::insert) This speeds up a lot QTextEngine::addRequiredBoundaries when there is a lot of addFormats. (For example if there is a very long line with syntax highlighting) Task-number: QTBUG-8389 Change-Id: I10c9fca72343f46db24b1d4f519f7747188d4009 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> (cherry picked from commit c13011829fd39661cc9e983256766c6edb88dead)
* Speed up QTextEngine::resolveAdditionalFormatsOlivier Goffart2012-08-311-2/+65
| | | | | | | | | | Don't call the linear QTextEngine::format in the loop. Instead, keep track of the current formats by indexing their start and end position. Task-number: QTBUG-8389 Change-Id: I89c18b804111edfab6254442cbee33da39d1a273 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> (cherry picked from commit 4f6efe16416f0222ae78ab16c0eb8085bf9c521b)
* Update contact information in license headers.Sergio Ahumada2012-08-01117-234/+234
| | | | | | | | | | | | | - Replace Nokia contact email address with Qt Project website. - Remove "All rights reserved" line from license headers. As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: Ie7ba62011752fcb149b99b26317c54f2a0cfa931 Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Fix crash when column is inserted before rowspanned cellEskil Abrahamsen Blomfeldt2012-07-131-3/+23
| | | | | | | | | | | | | | When you're inserting a column in front of a rowspanned cell and this cell is not the first in the rowspan, we would get the wrong logical index of the new cell (putting it in front of the initial cell with the rowspan). If the cell does not span all rows, the table will get into a broken state and trigger asserts in update(). To fix this, we search for the first cell after the insertion point which has a logical index higher than the cell directly before the insertion point. Change-Id: Ic6fb66bc25ad91f3534886f964173ead924429e2 Reviewed-by: Simon Hausmann <simon.hausmann@nokia.com>
* 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
| |\