Changeset 846 for trunk/src/gui/text/qtextcursor.cpp
- Timestamp:
- May 5, 2011, 5:36:53 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.7.2 (added) merged: 845 /branches/vendor/nokia/qt/current merged: 844 /branches/vendor/nokia/qt/4.6.3 removed
- Property svn:mergeinfo changed
-
trunk/src/gui/text/qtextcursor.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 201 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation ([email protected]) … … 65 65 QTextCursorPrivate::QTextCursorPrivate(QTextDocumentPrivate *p) 66 66 : priv(p), x(0), position(0), anchor(0), adjusted_anchor(0), 67 currentCharFormat(-1), visualNavigation(false) 67 currentCharFormat(-1), visualNavigation(false), keepPositionOnInsert(false), 68 changed(false) 68 69 { 69 70 priv->addCursor(this); … … 80 81 currentCharFormat = rhs.currentCharFormat; 81 82 visualNavigation = rhs.visualNavigation; 83 84 82 85 priv->addCursor(this); 83 86 } … … 96 99 || (position == positionOfChange 97 100 && (op == QTextUndoCommand::KeepCursor 98 || anchor < position)101 || ) 99 102 ) 100 103 ) { … … 361 364 QTextBlock blockIt = block(); 362 365 366 367 368 363 369 if (op >= QTextCursor::Left && op <= QTextCursor::WordRight 364 && blockIt. blockFormat().layoutDirection() == Qt::RightToLeft) {370 && blockIt.tDirection() == Qt::RightToLeft) { 365 371 if (op == QTextCursor::Left) 366 372 op = QTextCursor::NextCharacter; … … 1146 1152 The cursor is positioned between characters. 1147 1153 1148 \sa setPosition() movePosition() anchor() 1154 \sa setPosition() movePosition() anchor() 1149 1155 */ 1150 1156 int QTextCursor::position() const … … 1153 1159 return -1; 1154 1160 return d->position; 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1155 1177 } 1156 1178 … … 1261 1283 } 1262 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1263 1359 /*! 1264 1360 Inserts \a text at the current position, using the current … … 1393 1489 if (!d || !d->priv) 1394 1490 return; 1395 1491 1396 1492 if (d->position != d->anchor) { 1397 1493 removeSelectedText(); 1398 1494 return; 1399 1495 } 1400 1496 1401 1497 if (d->anchor < 1 || !d->canDelete(d->anchor-1)) 1402 1498 return; 1403 1499 d->anchor--; 1404 1500 1405 1501 QTextDocumentPrivate::FragmentIterator fragIt = d->priv->find(d->anchor); 1406 1502 const QTextFragmentData * const frag = fragIt.value(); … … 1414 1510 --d->anchor; 1415 1511 } 1416 1512 1417 1513 d->adjusted_anchor = d->anchor; 1418 1514 d->remove(); … … 2347 2443 return; 2348 2444 2445 2446 2447 2349 2448 d->priv->beginEditBlock(); 2350 2449 } … … 2415 2514 } 2416 2515 2516 2417 2517 /*! 2418 2518 \since 4.2 2419 2519 Returns the position of the cursor within its containing line. 2520 2521 2522 2523 2524 2525 2526 2420 2527 */ 2421 2528 int QTextCursor::columnNumber() const
Note:
See TracChangeset
for help on using the changeset viewer.