diff options
author | Ivan Donchevskii <ivan.donchevskii@qt.io> | 2019-02-19 14:30:52 +0100 |
---|---|---|
committer | Ivan Donchevskii <ivan.donchevskii@qt.io> | 2019-02-20 06:49:47 +0000 |
commit | 118c126f984debd3a39ea034179622da4d33fe7a (patch) | |
tree | ad65963f909984334a5180c24fb3fd241f799668 /src/plugins/clangformat/clangformatbaseindenter.h | |
parent | 064f43fecf99c30666256764f7a9d61162f74f48 (diff) |
ClangFormat: Refactor code
Reorder some functions, remove code duplication.
Change-Id: I33e118e567dee7db622bbc99e6a7c500db54e5c5
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Diffstat (limited to 'src/plugins/clangformat/clangformatbaseindenter.h')
-rw-r--r-- | src/plugins/clangformat/clangformatbaseindenter.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/plugins/clangformat/clangformatbaseindenter.h b/src/plugins/clangformat/clangformatbaseindenter.h index 360f27fbedc..ed63ff6efa3 100644 --- a/src/plugins/clangformat/clangformatbaseindenter.h +++ b/src/plugins/clangformat/clangformatbaseindenter.h @@ -75,14 +75,16 @@ protected: private: void indent(const QTextCursor &cursor, const QChar &typedChar, int cursorPositionInEditor); - void indentBlocks(QTextBlock startBlock, + void indentBlocks(const QTextBlock &startBlock, const QTextBlock &endBlock, const QChar &typedChar, int cursorPositionInEditor); - int indentFor(const QTextBlock &block, int cursorPositionInEditor); + TextEditor::Replacements indentsFor(QTextBlock startBlock, + const QTextBlock &endBlock, + const QByteArray &buffer, + const QChar &typedChar, + int cursorPositionInEditor); TextEditor::Replacements replacements(QByteArray buffer, - int utf8Offset, - int utf8Length, const QTextBlock &startBlock, const QTextBlock &endBlock, ReplacementsToKeep replacementsToKeep, |