summaryrefslogtreecommitdiffstats
path: root/src/gui/text
Commit message (Collapse)AuthorAgeFilesLines
* Fix QTextEngine::shapeText casing of surrogate pairsJüri Valdmann2019-05-071-1/+2
| | | | | | | | | The high part was not copied to output. Fixes: QTBUG-75559 Change-Id: I9350e52d256510f52b3fcc0015bf879d2c609532 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* Use "monospace" as fallback system FixedFont in KDE theme; loggingShawn Rutledge2019-05-071-32/+20
| | | | | | | | | | | | | | | Also de-duplicate the "monospace" string in qgenericunixthemes.cpp, and add tst_QFontDatabase::systemFixedFont() to verify that QFontDatabase::systemFont(QFontDatabase::FixedFont) really returns a monospace font across platforms. Replace commented-out qDebug()s with qt.text.font.match and qt.text.font.db logging categories to troubleshoot when the test fails (among other uses). Add qt.qpa.fonts logging category to unix themes to show default system and fixed fonts (font engines on other platforms are already using this category). Fixes: QTBUG-54623 Change-Id: I2aa62b8c783d9ddb591a5e06e8df85c4af5bcb0c Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* fix compilation with various -no-feature-* optionsNick Shaforostov2019-05-052-3/+5
| | | | | Change-Id: Ic1975db497613e3efe50be4246c167efe10d8e31 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Fix page breaking with large imagesLars Knoll2019-04-261-1/+4
| | | | | | | | | | | | Don't go into an infinite loop breaking pages, when an image is about as large as the page. Correctly take top and bottom margins into account when calculating whether the image could fit on one page. Amends change 416b4cf685030114837bd375664fd12047895a62. Fixes: QTBUG-73730 Change-Id: Id311ddf05510be3b1d131702f4e17025a9861e58 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Add a clarification about "characters" to QTextCursor docsEskil Abrahamsen Blomfeldt2019-04-021-0/+23
| | | | | | | | | | | | | | | | | | | | The function name QTextCursor::positionInBlock() may give users the idea that it can be displayed to the user as the visual position of the cursor in the current block. This becomes confusing with some writing systems, since e.g. a surrogate pair will count as two characters while only representing a single visual grapheme. Since it is an side effect of the encoding that will be unexpected to many, and since it also touches on some linguistic complexities, we add a note to the documentation to make users aware of the consideration needed. Task-number: QTBUG-74725 Change-Id: Iba28ba8a6ad07ee38dbb7e6a5a4b68c93d4da76a Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: René J.V. Bertin <rjvbertin@gmail.com> Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* macOS: Don't scale advances to 0 when stretch is AnyStretchEskil Abrahamsen Blomfeldt2019-03-251-1/+1
| | | | | | | | | | | | | | | | | | | If the stretch is set to AnyStretch, then this is taken to mean we should accept the font as it is. But on mac, there is a special code path to scale the advances since the shaper doesn't do it for us, and this neglected to check the stretch, thus it would scale the advances by 0%. This happened when loading a file directly in QRawFont and using this in a QTextLayout, since no part of the code path will attempt to calculate the stretch in that case. Reproducible in q3dsviewer in Qt 3D Runtime 2.3. Task-number: QT3DS-3132 Change-Id: I8f934f3fac41bf7a93c01cca0416d44003119907 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Replace LDEBUG with categorized logging in QTextDocumentLayout(Private)Shawn Rutledge2019-03-181-45/+36
| | | | | | | | | This adds four new logging categories: qt.text.drawing, qt.text.hittest, qt.text.layout and qt.text.layout.table Task-number: QTBUG-72457 Change-Id: Ifbfd6d16231c7f4ba664bc521699e44f98310f77 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QSyntaxHighlighter: Fix crash when parent is a nullptrDominik Haumann2019-02-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | QSyntaxHighlighter has the follwoing constructor taking a QObject QSyntaxHighlighter::QSyntaxHighlighter(QObject *parent) : QObject(*new QSyntaxHighlighterPrivate, parent) { if (parent->inherits("QTextEdit")) { // ... } } Typically, a 'parent' refers to the parent/child hierarchy in Qt and is allowed to be a nullptr. However, in this case, passing a nullptr will lead to a crash, as reported in https://bugs.kde.org/show_bug.cgi?id=404820 This patch makes the QSyntaxHighlighter constructor nullptr safe by checking if parent is a valid pointer. Change-Id: Ia4e9b46b94fd37e6ceb2cd0538594353fdc1e349 Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io> Reviewed-by: Christoph Cullmann <cullmann@kde.org>
* QTextDocument: Do respect white-space:nowrapKai Koehne2019-02-131-1/+2
| | | | | | | | | | Prevent automatic insertion of line-breaks in blocks formatted with 'white-space:nowrap'. This follows the example of white-space:pre. Fixes: QTBUG-54787 Change-Id: If26f6a54106a02fe0e388947f6368ae4e86acf63 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix two smaller bugs in the BiDi engineLars Knoll2019-02-091-18/+16
| | | | | | | | | | | | | | | | | | Remove wrong code changing the Bido level of line separators. This lead to wrong ordering of the string in case the line separator was meant to be ignored and the string should be rendered in one line. Line breaks are anyways already reset to the paragraph level by the algorithm and reordering is done on a line by line basis, so this will work correctly when doing proper line breaking. Secondly fix a small bug found while testing the above change, where we wouldn't set the correct levels for boundary neutrals and explicit embedding chars because we did that processing before we were fully done with the BiDi algorithm. Change-Id: Id88f91cd58d2ab29be864aef34ca1727c1586611 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Fix an assertion in the BiDi algorithmLars Knoll2019-02-091-14/+28
| | | | | | | | | | | | | The algorithm has been treating DirB inconsistently so far. initScriptAnalysisAndIsolatePairs was treating it differently than generateDireationalRuns leading to assertions. It wasn't visible in our test data, as DirB is in almost all cases the paragraph separator, where we split strings anyway. Change-Id: I7dc0e7bbcf30ee84d8781ea06097da023e371f05 Fixes: QTBUG-73238 Reviewed-by: Robert Loehning <robert.loehning@qt.io> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Fix QTextTable:insertRows() for tables with spanning cellsLars Knoll2019-02-091-4/+8
| | | | | | | | | Don't resize the height of cells spanning several columns multiple times. Fixes: QTBUG-36713 Change-Id: I5eb45892f2008e6a4f85745b56efd04323e25673 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Fix default font properties when using raw fonts for text layoutsEskil Abrahamsen Blomfeldt2019-01-291-4/+5
| | | | | | | | | | | | | | When a QRawFont is set explicitly on the layout, we would get certain font properties from the QTextCharFormat instead. But when the properties had not been set on the QTextCharFormat, we would get the default values which were always 0/false, not the actual default values used in QFont. Instead, we calculate a QFont query based on the format and use the properties from this. This will give us the correct default values in the cases where they are not overridden. Change-Id: I53e5103739164c3d9eafaf76fcb4e8bda57bd12a Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QtGui: Unify license headersKai Koehne2019-01-295-5/+5
| | | | | Change-Id: I0a2553b95b099fdfa83d42e71bdf9a192a6588c7 Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
* Merge remote-tracking branch 'origin/5.12.1' into 5.12Qt Forward Merge Bot2019-01-231-4/+8
|\ | | | | | | Change-Id: Icebd151eae0cf9d400319a42573290d1a911ce26
| * Fix a crash in QTextEngine when a paragraph only contains a tabLars Knoll2019-01-081-4/+8
| | | | | | | | | | | | | | | | | | | | This fixes a regression introduced by change c3d2d83fcb0f88de7d08cb7d088db8942e2e0f64. Change-Id: Idf840804c68cd6b1751e122b45e9dd2775af56f5 Fixes: QTBUG-72900 Fixes: QTBUG-72754 Reviewed-by: David Faure <david.faure@kdab.com>
* | QSyntaxHighlighter: cancel delayed highlight if done manuallyMårten Nordheim2019-01-161-0/+1
| | | | | | | | | | | | | | | | | | | | It was an implicit effect before which stopped working after dec7961709c90f6977d2447f7fa6c6625af41cb2. Reintroduce it as some projects used this side-effect as a way to abort the initial highlighting. Change-Id: I5340ee9882a242bc8b5f7f843f1cfe793a65d357 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
* | Documentation: Add \nullptr macro and use where applicableFriedemann Kleint2019-01-102-4/+4
|/ | | | | | | | | | | | | | | | Qt for Python users reading the documentation assume that int(0) can be passed for pointer parameters. Use the newly introduced \nullptr to disambiguate this. In a follow-up step, the \nullptr macro can be defined as None when generating the Qt for Python documentation. Task-number: PYSIDE-903 Change-Id: I3a45f87175a0668ab5f3f95f0aff409f7e3ef027 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Draw ShowTabsAndSpaces symbols with the correct fontEskil Abrahamsen Blomfeldt2019-01-031-0/+4
| | | | | | | | | | | | | We would draw the tab and space symbols without setting the correct font on the painter first. [ChangeLog][QtGui][Text] Fixed so ShowTabsAndSpaces will use the correct font. Fixes: QTBUG-62540 Change-Id: I3b7d6d317473e7aab722dafe1a128c57a830f634 Reviewed-by: Andy Shaw <andy.shaw@qt.io> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* Fix text shifting vertically when elidedEskil Abrahamsen Blomfeldt2018-12-211-0/+10
| | | | | | | | | | | | | | | | | | | | When eliding text we would check for the existence of the ellipsis character and fall back to using the dot if it was not available. However, when font merging was in use, we would also use ellipsis from a fallback font if available. This could cause the metrics of the text to increase if the fallback font had larger metrics, and the result was that text could shift when elided. It is better to prefer the dot from the current font than to use the ellipsis from a fallback, so we only use the ellipsis if it is in the main font. [ChangeLog][QtGui][Text] Fixed a bug where eliding text could change the height of its bounding rectangle for certain fonts. Fixes: QTBUG-72553 Change-Id: Ib27fc65302465ddce661801bcc5ae32e55f1aeb9 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Set point size, not just pixel size, when creating HarfBuzz fonts for shapingTor Arne Vestbø2018-12-161-0/+2
| | | | | | | | | | | | | | | | Otherwise HarfBuzz will fall back to using default font sizes, e.g. 12.0 in the CoreText backend. hb_coretext_font_create() already does the right thing, but we're not using that function, we create the hb_font_t ourselves in _hb_qt_font_create(). The mismatch didn't matter for vector-based fonts as the metrics (presumably) scale linearly, but for bitmap-based font such as Emojis they don't, and we ended up with advances that were way too large (increasingly so the larger the font point size). Change-Id: I4781dda965c745853732026da91590d8506ec3f5 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* macOS: Reset font glyph caches when application theme changesTor Arne Vestbø2018-12-091-1/+1
| | | | | | | | | | Our glyph caches on 10.14 are based on the application appearance, so when the application goes from dark to light or light to dark, we need to reset and re-populate the glyph-caches to account for the new appearance. Change-Id: If019d8cfa33ffb2b14747444b2ff74b288992f55 Fixes: QTBUG-71018 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Set correct vertical position for text following a very large imageLars Knoll2018-12-031-2/+2
| | | | | | | | | | If the document is paged and contains an image spanning more than one page, correctly set the y position for everything following that image. Change-Id: I1c584c7a907c1728c2965f1dc3fdc56069ab3172 Fixes: QTBUG-59886 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* CoreText: Remove handling of QFontEngineMulti's highByteTor Arne Vestbø2018-11-302-1/+3
| | | | | | | | | | | It's a leftover from when the Cocoa plugin used QFontEngineMulti exclusively. Nowadays QFontEngineMulti will strip out the highByte before calling into the real engine. Left an assert just in case.. Change-Id: I6cb26d20a908d7c3aaf096297fca160805fdb85b Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Remove macOS specific path that causes reverse vertical advanceAllan Sandfeld Jensen2018-11-221-4/+0
| | | | | | | | | This special case of macOS appears to be outdated and now causes a bug. Change-Id: Ie9c074bb69eda7abfe3d123f807b517334cc2958 Fixes: QTBUG-69803 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* Don't start a new page when printing very large imagesLars Knoll2018-11-211-1/+2
| | | | | | | | | | | Don't start a new page to print a very high line of text if that line wouldn't fit on one page in any case. In that case we have to break the image up onto several pages anyway, so we might as well start it immediately. Change-Id: I823aa4961df179054476755c8f5df2e03874661f Fixes: QTBUG-59885 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Fix vertical alignment of inline imagesLars Knoll2018-11-192-15/+63
| | | | | | | | | | | | | | | | Inline images can have 4 different alignments. Unfortunately, AlignTop and AlignBottom can only be set once we have laid out the whole line and know the total height of the line, as one could otherwise end up with lines that are too high. To fix this, position the images for these cases in a second loop after we have calculated the length of the line and the maximal image height in that line. Task-number: QTBUG-59310 Change-Id: I1fd4cd39e43a13d1967b9f5c9ce8270a99269cd9 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Merge remote-tracking branch 'origin/5.12.0' into 5.12Liang Qi2018-11-163-3/+4
|\ | | | | | | Change-Id: Ic1dd39044e19f50e1068d4ac70dacaad6440e570
| * Doc: Qt GUI: Fix documentation warningsTopi Reinio2018-11-063-3/+4
| | | | | | | | | | | | | | | | | | These are minor typos or documentation warnings that snuck in with new features. Task-number: QTBUG-71502 Change-Id: I03669cfecc3c3d80168ff7b1ca8bca7571e06d25 Reviewed-by: Martin Smith <martin.smith@qt.io>
* | Correctly initialize the logClusters array for tabs and objectsLars Knoll2018-11-141-8/+13
| | | | | | | | | | | | | | | | | | The logclusters where never correctly initialized for tabs or inline objects. Change-Id: I376fd2dba19994eb5add24cdb8a93c38bde8cd1e Fixes: QTBUG-70946 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Fix a typo in the docsLars Knoll2018-11-121-1/+1
| | | | | | | | | | Change-Id: I0f1b015a34b8caffa3b60927cedbccf7db50b383 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into 5.12Liang Qi2018-11-098-18/+20
|\ \ | |/ |/| | | | | | | | | | | | | | | Conflicts: .qmake.conf qmake/Makefile.unix src/gui/text/qtextdocument.cpp src/gui/text/qtextdocument.h Change-Id: Iba26da0ecbf2aa4ff4b956391cfb373f977f88c9
| * QSyntaxHighlighter: Delay all highlights until first rehighlightMårten Nordheim2018-11-081-5/+5
| | | | | | | | | | | | | | | | | | | | | | When calling setDocument (directly or through the constructor) a delayed rehighlight is initiated. Previously, if any text was changed before this rehighlight could run it would cancel the rehighlight, even if the changed text only caused a new block of text to be highlighted. Fixes: QTBUG-71307 Change-Id: Ib09b664d90906f5b4427105f0e45469806f3a779 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
| * Modernize the "textcodec" featureLiang Qi2018-11-077-13/+15
| | | | | | | | | | | | | | | | | | Also clean up QTextCodec usage in qmake build and some includes of qtextcodec.h. Change-Id: I0475b82690024054add4e85a8724c8ea3adcf62a Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into 5.12Qt Forward Merge Bot2018-10-212-3/+3
|\| | | | | | | Change-Id: Iaf28977e7ecf566b28b9406dcb005d48621169c2
| * Fix enum passed to QFontDatabase::findFontAllan Sandfeld Jensen2018-10-162-3/+3
| | | | | | | | | | | | | | | | The script taken here is a QChar::Script, not a QFontDatabase::WritingSystem. This means it was passing QChar::Unknown. Change-Id: I919ae7187ba277346a7719116a94776dce24dd84 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* | QCss: properly parse functions which contains additional spacesChristian Ehrlicher2018-10-121-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | When there were additional spaces between the function definition and the first parameter, the parser failed to parse it when it contained another function (e.g. 'qlineargradient(... rgb() ...)'). The reason for this was that ::until() needs the function at index-1 so it can correctly count the opening parenthesis. Fixes: QTBUG-61795 Change-Id: I992f556e7f8cd45550f83bc90aa8de2b4e905574 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | Fix crash when detaching dangling QTextCursorEskil Abrahamsen Blomfeldt2018-09-271-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a QTextCursor survives its QTextDocument, the internal QTextDocumentPrivate pointer is set to null. There are checks for this in all the QTextCursor functions to skip out early if such a QTextCursor is used. However, when executing the "if (d->priv)" condition in setters, this will access the non-const operator->() of QSharedDataPointer and detach the QTextCursorPrivate, and in the copy constructor of this class, there was an unprotected call into priv->addCursor(). In theory, we could cast all the checks for d->priv to avoid detaching, but in practice this doesn't matter, since the setters will typically detach anyway later on. [ChangeLog][QtGui][Text] Fixed a crash that can happen when calling a setter on a QTextCursor after its QTextDocument has been deleted. Task-number: QTBUG-70293 Change-Id: I8f6dc5bb344d1d824f673c0c220b68b7fee237a8 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Silence warning in gcc 4.9 for AndroidEskil Abrahamsen Blomfeldt2018-08-301-1/+1
| | | | | | | | | | | | | | | | When building with warnings are errors for Android with gcc 4.9, it wrongfully fails on use of uninitialized variable. Change-Id: I39c5e8413c30567fba60cbba6a8b26d537c5836e Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* | Merge remote-tracking branch 'origin/5.11' into 5.12Liang Qi2018-08-221-9/+20
|\| | | | | | | | | | | | | | | | | Conflicts: src/gui/text/qtextengine.cpp tests/auto/corelib/itemmodels/qsortfilterproxymodel_common/tst_qsortfilterproxymodel.cpp tests/auto/corelib/itemmodels/qsortfilterproxymodel_common/tst_qsortfilterproxymodel.h Change-Id: Ib9f968edbb0f3387c89bc25e914321d0738bfadc
| * Don't reset the bidi level on spacesLars Knoll2018-08-171-1/+0
| | | | | | | | | | | | | | | | | | Fixes a regression introduced with the update to the bidi algorithm. Task-number: QTBUG-69633 Change-Id: I7eac45ed3ffb41f89ea3f793eedcfb6fcdace871 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
| * Only show the bidi cursor mark if we actually have bidirectional textLars Knoll2018-08-171-8/+20
| | | | | | | | | | | | | | | | | | Don't show the mark simply because we have unicode code points larger than 0x590. Task-number: QTBUG-69665 Change-Id: I9af97383f3bcd52277a5288e7ad06ec240c7e51c Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* | Improve Q_ASSERT readabilityJesus Fernandez2018-08-171-1/+7
| | | | | | | | | | | | | | Change-Id: I231ecafe1eb48d74f787083e86a85536a90ed69b Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | Modernize the "thread" featureUlf Hermann2018-08-171-13/+0
| | | | | | | | | | | | | | | | | | | | Add it to configure.json and replace all occurrences of QT_NO_THREAD with QT_CONFIG(thread). Add conditions for other features that depend on thread support. Remove conditions where we can use the QMutex and QThreadStorage stubs. Change-Id: I284e5d794fda9a4c6f4a1ab29e55aa686272a0eb Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devLiang Qi2018-08-161-1/+1
|\| | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qconfig-bootstrapped.h src/plugins/platforms/xcb/qxcbbackingstore.cpp Done-with: Gatis Paeglis <gatis.paeglis@qt.io> Change-Id: I4af138ffb2f5306373244523768209e8873b2798
| * Fix potential crash when showing line/paragraph separatorsEskil Abrahamsen Blomfeldt2018-08-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When showing line and paragraph separators at an offset from the start of the string, the end of string pointer would be incorrectly set, and we would read past the end of the string. If any part of this memory happened to match the line or paragraph separator, then we would overwrite it and have a crash. I couldn't find any reliable way to test this, since the crash depends on the contents of the memory after the string allocated by the algorithm. But with an overflow of 100 000 characters, I found that it crashed every time I ran the test. [ChangeLog][QtGui][Text] Fixed potential crash when using QTextOption::ShowLineAndParagraphSeparators. Task-number: QTBUG-69661 Change-Id: I17d1996b883560bacdc7ce114c8aeb2b0108faea Reviewed-by: JiDe Zhang <zccrs@live.com> Reviewed-by: Michal Lazo <xlazom00@gmail.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* | Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-08-071-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/corelib/doc/src/objectmodel/signalsandslots.qdoc src/plugins/platforms/cocoa/qcocoamenuloader.mm src/plugins/platforms/xcb/qxcbconnection.cpp src/plugins/platforms/xcb/qxcbconnection.h src/plugins/platforms/xcb/qxcbconnection_xi2.cpp src/plugins/platforms/xcb/qxcbwindow.cpp tests/auto/gui/image/qimage/tst_qimage.cpp Done-with: Gatis Paeglis <gatis.paeglis@qt.io> Change-Id: I9bd24ee9b00d4f26c8f344ce3970aa6e93935ff5
| * Doc: Fix wrong link in QFont documentationPaul Wicking2018-08-031-1/+1
| | | | | | | | | | | | Task-number: QTBUG-62072 Change-Id: I587534fc5723b3d198fe2065fbcf1bee4871a768 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Remove member function from CentralFileHeaderThiago Macieira2018-08-031-12/+11
| | | | | | | | | | | | | | | | | | I could have placed the class in an unnamed namespace. That would mark the member function as a local symbol too. But I preferred to move outside so I could make it static. Change-Id: Ie01831ddac5446fdbdeefffd154688c0883ed653 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | QTextDocumentFragment: Use logical cursor movement instead of visualSafa AlFulaij2018-07-311-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Using QTextCursor::Left and QTextCursor::Right moves the cursor visually to right or left, which does not work with Right to left text, where moving left means advancing to the next character, and vice versa. By using QTextCursor::PreviousCharacter and QTextCursor::NextCharacter we leave it up to the engine for deciding where to move depending on the context. Task-number: QTBUG-50619 Change-Id: Ibf0a886f3ff6bf9ca2c953aeff8c235612bbc01d Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>