summaryrefslogtreecommitdiffstats
path: root/src/gui/text
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-07-16 03:35:55 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-07-16 03:35:55 (GMT)
commit8d8566d061e26f18e1bde1255fdc1375035c8eaa (patch)
tree7467b6c7742a3d3828b918ecec8a73e1f7998791 /src/gui/text
parent6986f382c8d7b49342f47fe00445685945157187 (diff)
parent17e7b024ba01aba0e525f7fd03b9c5c0ed34e7c8 (diff)
downloadQt-8d8566d061e26f18e1bde1255fdc1375035c8eaa.zip
Qt-8d8566d061e26f18e1bde1255fdc1375035c8eaa.tar.gz
Qt-8d8566d061e26f18e1bde1255fdc1375035c8eaa.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1: (104 commits) Fixed tst_maketestselftest::tests_pro_files failure remove nasty hack by using a stricter regexp (for language codes) cosmetics: quote the dot in the regexp remove dependency of ts targets on sub-tools add commit-ts target to commit ts files without line number info (re-)add 'untranslated' ts targets more fine-grained ts targets split qt_help out into an own ts target Unbreak the Maemo 5 build after the Symbian fix QNAM HTTP: Fix problem with cached files and metaDataChanged() Add a testcase for QTBUG-11213 to prevent future regressions. Autotest: reenable the NTLM proxy test on tst_QTcpSocket Autotest: add a small, boring test for QAuthenticator Add documentation for the QAuthenticator options. Expose the QAuthenticator map of options in the API. Add a QAuthenticatorPrivate parsing for the headers without QHttpResponseHeader Revert BIC change "Build Qt with option -Zc:wchar_t under MSVC" Fix for tst_qmdisubwindow::fixedMinMaxSize failure on Cocoa Add unit tests for QMimeData. fix qconfig.h reference for shadow builds ...
Diffstat (limited to 'src/gui/text')
-rw-r--r--src/gui/text/qtextcursor.cpp6
-rw-r--r--src/gui/text/qtextoption.cpp7
-rw-r--r--src/gui/text/qtexttable.cpp28
3 files changed, 33 insertions, 8 deletions
diff --git a/src/gui/text/qtextcursor.cpp b/src/gui/text/qtextcursor.cpp
index daa40a1..769ab2f 100644
--- a/src/gui/text/qtextcursor.cpp
+++ b/src/gui/text/qtextcursor.cpp
@@ -1283,7 +1283,7 @@ void QTextCursor::setVisualNavigation(bool b)
/*!
\since 4.7
- Sets the visual x position for vertical cursor movements.
+ Sets the visual x position for vertical cursor movements to \a x.
The vertical movement x position is cleared automatically when the cursor moves horizontally, and kept
unchanged when the cursor moves vertically. The mechanism allows the cursor to move up and down on a
@@ -1335,8 +1335,8 @@ bool QTextCursor::keepPositionOnInsert() const
Defines whether the cursor should keep its current position when text gets inserted at the current position of the
cursor.
- If \b is true, the cursor keeps its current position when text gets inserted at the positing of the cursor.
- If \b is false, the cursor moves along with the inserted text.
+ If \a b is true, the cursor keeps its current position when text gets inserted at the positing of the cursor.
+ If \a b is false, the cursor moves along with the inserted text.
The default is false.
diff --git a/src/gui/text/qtextoption.cpp b/src/gui/text/qtextoption.cpp
index 8f31e46..9eeec0b 100644
--- a/src/gui/text/qtextoption.cpp
+++ b/src/gui/text/qtextoption.cpp
@@ -392,7 +392,12 @@ QList<QTextOption::Tab> QTextOption::tabs() const
/*!
\fn Tab::Tab(qreal pos, TabType tabType, QChar delim = QChar())
- Creates a tab with the given position, tab type, and (for DelimiterTab) delimiter
+
+ Creates a tab with the given position, tab type, and delimiter
+ (\a pos, \a tabType, \a delim).
+
+ \note \a delim is only used when \a tabType is DelimiterTab.
+
\since 4.7
*/
diff --git a/src/gui/text/qtexttable.cpp b/src/gui/text/qtexttable.cpp
index 5100176..e3985ce 100644
--- a/src/gui/text/qtexttable.cpp
+++ b/src/gui/text/qtexttable.cpp
@@ -754,19 +754,39 @@ void QTextTable::insertColumns(int pos, int num)
QTextFormatCollection *c = p->formatCollection();
p->beginEditBlock();
+ QList<int> extendedSpans;
for (int i = 0; i < d->nRows; ++i) {
int cell;
if (i == d->nRows - 1 && pos == d->nCols)
cell = d->fragment_end;
else
cell = d->grid[i*d->nCols + pos];
- QTextDocumentPrivate::FragmentIterator it(&p->fragmentMap(), cell);
- QTextCharFormat fmt = c->charFormat(it->format);
if (pos > 0 && pos < d->nCols && cell == d->grid[i*d->nCols + pos - 1]) {
// cell spans the insertion place, extend it
- fmt.setTableCellColumnSpan(fmt.tableCellColumnSpan() + num);
- p->setCharFormat(it.position(), 1, fmt);
+ if (!extendedSpans.contains(cell)) {
+ QTextDocumentPrivate::FragmentIterator it(&p->fragmentMap(), cell);
+ QTextCharFormat fmt = c->charFormat(it->format);
+ fmt.setTableCellColumnSpan(fmt.tableCellColumnSpan() + num);
+ p->setCharFormat(it.position(), 1, fmt);
+ d->dirty = true;
+ extendedSpans << cell;
+ }
} else {
+ /* If the next cell is spanned from the row above, we need to find the right position
+ to insert to */
+ if (i > 0 && pos < d->nCols && cell == d->grid[(i-1) * d->nCols + pos]) {
+ int gridIndex = i*d->nCols + pos;
+ const int gridEnd = d->nRows * d->nCols - 1;
+ while (gridIndex < gridEnd && cell == d->grid[gridIndex]) {
+ ++gridIndex;
+ }
+ if (gridIndex == gridEnd)
+ cell = d->fragment_end;
+ else
+ cell = d->grid[gridIndex];
+ }
+ QTextDocumentPrivate::FragmentIterator it(&p->fragmentMap(), cell);
+ QTextCharFormat fmt = c->charFormat(it->format);
fmt.setTableCellRowSpan(1);
fmt.setTableCellColumnSpan(1);
Q_ASSERT(fmt.objectIndex() == objectIndex());