diff options
author | Erik Verbruggen <erik.verbruggen@nokia.com> | 2009-07-02 09:07:53 (GMT) |
---|---|---|
committer | Erik Verbruggen <erik.verbruggen@nokia.com> | 2009-07-02 09:07:53 (GMT) |
commit | f3499122c99ef31cd064559c32b3a7afda6ec5b0 (patch) | |
tree | 33f8f9f393753b46fc7297cba1026fc633bb2be6 /src/declarative/qml/rewriter | |
parent | 8491b0476a221cf136b412bda532662a69063045 (diff) | |
download | Qt-f3499122c99ef31cd064559c32b3a7afda6ec5b0.zip Qt-f3499122c99ef31cd064559c32b3a7afda6ec5b0.tar.gz Qt-f3499122c99ef31cd064559c32b3a7afda6ec5b0.tar.bz2 |
Small change to make move and replace methods overridable.
Diffstat (limited to 'src/declarative/qml/rewriter')
-rw-r--r-- | src/declarative/qml/rewriter/rewriter.cpp | 9 | ||||
-rw-r--r-- | src/declarative/qml/rewriter/rewriter_p.h | 3 |
2 files changed, 9 insertions, 3 deletions
diff --git a/src/declarative/qml/rewriter/rewriter.cpp b/src/declarative/qml/rewriter/rewriter.cpp index 2ce927c..ed45f16 100644 --- a/src/declarative/qml/rewriter/rewriter.cpp +++ b/src/declarative/qml/rewriter/rewriter.cpp @@ -83,14 +83,19 @@ void Rewriter::moveTextBefore(const AST::SourceLocation &firstLoc, const AST::SourceLocation &lastLoc, const AST::SourceLocation &loc) { - textWriter.move(firstLoc.offset, lastLoc.offset + lastLoc.length - firstLoc.offset, loc.offset); + move(firstLoc.offset, lastLoc.offset + lastLoc.length - firstLoc.offset, loc.offset); } void Rewriter::moveTextAfter(const AST::SourceLocation &firstLoc, const AST::SourceLocation &lastLoc, const AST::SourceLocation &loc) { - textWriter.move(firstLoc.offset, lastLoc.offset + lastLoc.length - firstLoc.offset, loc.offset + loc.length); + move(firstLoc.offset, lastLoc.offset + lastLoc.length - firstLoc.offset, loc.offset + loc.length); +} + +void Rewriter::move(int pos, int length, int to) +{ + textWriter.move(pos, length, to); } QT_END_NAMESPACE diff --git a/src/declarative/qml/rewriter/rewriter_p.h b/src/declarative/qml/rewriter/rewriter_p.h index fcb9ca5..44f3cce 100644 --- a/src/declarative/qml/rewriter/rewriter_p.h +++ b/src/declarative/qml/rewriter/rewriter_p.h @@ -121,7 +121,8 @@ public: // // low-level offset based API // - void replace(int offset, int length, const QString &text); + virtual void replace(int offset, int length, const QString &text); + virtual void move(int pos, int length, int to); void insertText(int offset, const QString &text); void removeText(int offset, int length); |