Changeset View
Changeset View
Standalone View
Standalone View
src/document/katedocument.cpp
Show First 20 Lines • Show All 805 Lines • ▼ Show 20 Line(s) | |||||
806 | 806 | | |||
807 | bool KTextEditor::DocumentPrivate::insertText(const KTextEditor::Cursor &position, const QStringList &textLines, bool block) | 807 | bool KTextEditor::DocumentPrivate::insertText(const KTextEditor::Cursor &position, const QStringList &textLines, bool block) | ||
808 | { | 808 | { | ||
809 | if (!isReadWrite()) { | 809 | if (!isReadWrite()) { | ||
810 | return false; | 810 | return false; | ||
811 | } | 811 | } | ||
812 | 812 | | |||
813 | // just reuse normal function | 813 | // just reuse normal function | ||
814 | return insertText(position, textLines.join(QLatin1String("\n")), block); | 814 | return insertText(position, textLines.join(QLatin1Char('\n')), block); | ||
815 | } | 815 | } | ||
816 | 816 | | |||
817 | bool KTextEditor::DocumentPrivate::removeText(const KTextEditor::Range &_range, bool block) | 817 | bool KTextEditor::DocumentPrivate::removeText(const KTextEditor::Range &_range, bool block) | ||
818 | { | 818 | { | ||
819 | KTextEditor::Range range = _range; | 819 | KTextEditor::Range range = _range; | ||
820 | 820 | | |||
821 | if (!isReadWrite()) { | 821 | if (!isReadWrite()) { | ||
822 | return false; | 822 | return false; | ||
▲ Show 20 Lines • Show All 893 Lines • ▼ Show 20 Line(s) | 1715 | if (from > 0) { | |||
1716 | Kate::TextLine prevLine = plainKateTextLine(from - 1); | 1716 | Kate::TextLine prevLine = plainKateTextLine(from - 1); | ||
1717 | rangeRemoved.setStart(KTextEditor::Cursor(from - 1, prevLine->length())); | 1717 | rangeRemoved.setStart(KTextEditor::Cursor(from - 1, prevLine->length())); | ||
1718 | } | 1718 | } | ||
1719 | } | 1719 | } | ||
1720 | 1720 | | |||
1721 | // remember last change cursor | 1721 | // remember last change cursor | ||
1722 | m_editLastChangeStartCursor = rangeRemoved.start(); | 1722 | m_editLastChangeStartCursor = rangeRemoved.start(); | ||
1723 | 1723 | | |||
1724 | emit textRemoved(this, rangeRemoved, oldText.join(QLatin1String("\n")) + QLatin1Char('\n')); | 1724 | emit textRemoved(this, rangeRemoved, oldText.join(QLatin1Char('\n')) + QLatin1Char('\n')); | ||
1725 | 1725 | | |||
1726 | editEnd(); | 1726 | editEnd(); | ||
1727 | 1727 | | |||
1728 | return true; | 1728 | return true; | ||
1729 | } | 1729 | } | ||
1730 | //END | 1730 | //END | ||
1731 | 1731 | | |||
1732 | //BEGIN KTextEditor::UndoInterface stuff | 1732 | //BEGIN KTextEditor::UndoInterface stuff | ||
▲ Show 20 Lines • Show All 4353 Lines • Show Last 20 Lines |