forked from qt-creator/qt-creator
Cleanup
This commit is contained in:
@@ -174,6 +174,36 @@ bool ChangeSet::insert(int pos, const QString &text)
|
|||||||
return !m_error;
|
return !m_error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ChangeSet::replace(const Range &range, const QString &replacement)
|
||||||
|
{ return replace(range.start, range.end, replacement); }
|
||||||
|
|
||||||
|
bool ChangeSet::remove(const Range &range)
|
||||||
|
{ return remove(range.start, range.end); }
|
||||||
|
|
||||||
|
bool ChangeSet::move(const Range &range, int to)
|
||||||
|
{ return move(range.start, range.end, to); }
|
||||||
|
|
||||||
|
bool ChangeSet::flip(const Range &range1, const Range &range2)
|
||||||
|
{ return flip(range1.start, range1.end, range2.start, range2.end); }
|
||||||
|
|
||||||
|
bool ChangeSet::copy(const Range &range, int to)
|
||||||
|
{ return copy(range.start, range.end, to); }
|
||||||
|
|
||||||
|
bool ChangeSet::replace(int start, int end, const QString &replacement)
|
||||||
|
{ return replace_helper(start, end - start, replacement); }
|
||||||
|
|
||||||
|
bool ChangeSet::remove(int start, int end)
|
||||||
|
{ return remove_helper(start, end - start); }
|
||||||
|
|
||||||
|
bool ChangeSet::move(int start, int end, int to)
|
||||||
|
{ return move_helper(start, end - start, to); }
|
||||||
|
|
||||||
|
bool ChangeSet::flip(int start1, int end1, int start2, int end2)
|
||||||
|
{ return flip_helper(start1, end1 - start1, start2, end2 - start2); }
|
||||||
|
|
||||||
|
bool ChangeSet::copy(int start, int end, int to)
|
||||||
|
{ return copy_helper(start, end - start, to); }
|
||||||
|
|
||||||
bool ChangeSet::remove_helper(int pos, int length)
|
bool ChangeSet::remove_helper(int pos, int length)
|
||||||
{
|
{
|
||||||
if (hasOverlap(pos, length))
|
if (hasOverlap(pos, length))
|
||||||
|
|||||||
@@ -97,37 +97,16 @@ public:
|
|||||||
|
|
||||||
void clear();
|
void clear();
|
||||||
|
|
||||||
bool replace(const Range &range, const QString &replacement)
|
bool replace(const Range &range, const QString &replacement);
|
||||||
{ return replace(range.start, range.end, replacement); }
|
bool remove(const Range &range);
|
||||||
|
bool move(const Range &range, int to);
|
||||||
bool remove(const Range &range)
|
bool flip(const Range &range1, const Range &range2);
|
||||||
{ return remove(range.start, range.end); }
|
bool copy(const Range &range, int to);
|
||||||
|
bool replace(int start, int end, const QString &replacement);
|
||||||
bool move(const Range &range, int to)
|
bool remove(int start, int end);
|
||||||
{ return move(range.start, range.end, to); }
|
bool move(int start, int end, int to);
|
||||||
|
bool flip(int start1, int end1, int start2, int end2);
|
||||||
bool flip(const Range &range1, const Range &range2)
|
bool copy(int start, int end, int to);
|
||||||
{ return flip(range1.start, range1.end, range2.start, range2.end); }
|
|
||||||
|
|
||||||
bool copy(const Range &range, int to)
|
|
||||||
{ return copy(range.start, range.end, to); }
|
|
||||||
|
|
||||||
|
|
||||||
bool replace(int start, int end, const QString &replacement)
|
|
||||||
{ return replace_helper(start, end - start, replacement); }
|
|
||||||
|
|
||||||
bool remove(int start, int end)
|
|
||||||
{ return remove_helper(start, end - start); }
|
|
||||||
|
|
||||||
bool move(int start, int end, int to)
|
|
||||||
{ return move_helper(start, end - start, to); }
|
|
||||||
|
|
||||||
bool flip(int start1, int end1, int start2, int end2)
|
|
||||||
{ return flip_helper(start1, end1 - start1, start2, end2 - start2); }
|
|
||||||
|
|
||||||
bool copy(int start, int end, int to)
|
|
||||||
{ return copy_helper(start, end - start, to); }
|
|
||||||
|
|
||||||
bool insert(int pos, const QString &text);
|
bool insert(int pos, const QString &text);
|
||||||
|
|
||||||
bool hadErrors();
|
bool hadErrors();
|
||||||
@@ -136,6 +115,7 @@ public:
|
|||||||
void apply(QTextCursor *textCursor);
|
void apply(QTextCursor *textCursor);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
// length-based API.
|
||||||
bool replace_helper(int pos, int length, const QString &replacement);
|
bool replace_helper(int pos, int length, const QString &replacement);
|
||||||
bool move_helper(int pos, int length, int to);
|
bool move_helper(int pos, int length, int to);
|
||||||
bool remove_helper(int pos, int length);
|
bool remove_helper(int pos, int length);
|
||||||
|
|||||||
Reference in New Issue
Block a user