Changeset 27581
- Timestamp:
- 11/16/08 20:54:09 (2 months ago)
- Files:
-
- lyx-devel/branches/BRANCH_1_6_X/src/Cursor.cpp (modified) (2 diffs)
- lyx-devel/branches/BRANCH_1_6_X/src/Cursor.h (modified) (1 diff)
- lyx-devel/branches/BRANCH_1_6_X/src/Text3.cpp (modified) (1 diff)
- lyx-devel/branches/BRANCH_1_6_X/status.16x (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
lyx-devel/branches/BRANCH_1_6_X/src/Cursor.cpp
r27225 r27581 1703 1703 1704 1704 1705 bool Cursor::atFirstOrLastRow(bool up) 1706 { 1707 TextMetrics const & tm = bv_->textMetrics(text()); 1708 ParagraphMetrics const & pm = tm.parMetrics(pit()); 1709 1710 int row; 1711 if (pos() && boundary()) 1712 row = pm.pos2row(pos() - 1); 1713 else 1714 row = pm.pos2row(pos()); 1715 1716 if (up) { 1717 if (pit() == 0 && row == 0) 1718 return true; 1719 } else { 1720 if (pit() + 1 >= int(text()->paragraphs().size()) && 1721 row + 1 >= int(pm.rows().size())) 1722 return true; 1723 } 1724 return false; 1725 } 1726 1705 1727 bool Cursor::upDownInText(bool up, bool & updateNeeded) 1706 1728 { … … 1756 1778 row = pm.pos2row(pos()); 1757 1779 1758 // are we not at the start or end? 1759 if (up) { 1760 if (pit() == 0 && row == 0) 1761 return false; 1762 } else { 1763 if (pit() + 1 >= int(text()->paragraphs().size()) && 1764 row + 1 >= int(pm.rows().size())) 1765 return false; 1766 } 1780 if (atFirstOrLastRow(up)) 1781 return false; 1767 1782 1768 1783 // with and without selection are handled differently lyx-devel/branches/BRANCH_1_6_X/src/Cursor.h
r26942 r27581 360 360 /// return true if fullscreen update is needed 361 361 bool down(); 362 /// whether the cursor is either at the first or last row 363 bool atFirstOrLastRow(bool up); 362 364 /// move up/down in a text inset, called for LFUN_UP/DOWN, 363 365 /// return true if successful, updateNeeded set to true if fullscreen lyx-devel/branches/BRANCH_1_6_X/src/Text3.cpp
r27214 r27581 616 616 bool select = cmd.action == LFUN_DOWN_SELECT || 617 617 cmd.action == LFUN_UP_SELECT; 618 cur.selHandle(select);619 618 620 619 // move cursor up/down 621 620 bool up = cmd.action == LFUN_UP_SELECT || cmd.action == LFUN_UP; 622 bool const successful = cur.upDownInText(up, needsUpdate); 623 if (successful) { 624 // redraw if you leave mathed (for the decorations) 621 bool const atFirstOrLastRow = cur.atFirstOrLastRow(up); 622 623 if (!atFirstOrLastRow) { 624 needsUpdate |= cur.selHandle(select); 625 cur.selHandle(select); 626 cur.upDownInText(up, needsUpdate); 625 627 needsUpdate |= cur.beforeDispatchCursor().inMathed(); 626 } else 628 } else { 629 // if the cursor cannot be moved up or down do not remove 630 // the selection right now, but wait for the next dispatch. 631 if (select) 632 needsUpdate |= cur.selHandle(select); 633 cur.upDownInText(up, needsUpdate); 627 634 cur.undispatched(); 635 } 628 636 629 637 break; lyx-devel/branches/BRANCH_1_6_X/status.16x
r27510 r27581 65 65 - Fix possible endless loop while running lyx2lyx. 66 66 67 - Fix painting update rules after LFUN_UP or LFUN_DOWN in an inset. 68 67 69 68 70 * USER INTERFACE
