| 28 | { |
| 29 | |
| 30 | CodeFormatter::CodeFormatter(Editor::CodeEditor *editor, const QString &lang, bool selectionOnly, bool logOnNoChange, |
| 31 | MessageLogger *log, QObject *parent) |
| 32 | : QObject(parent), m_editor(editor), m_lang(lang), m_selectionOnly(selectionOnly), m_logOnNoChange(logOnNoChange), |
| 33 | log(log) |
| 34 | { |
| 35 | LOG_INFO(INFO_OF(lang) << INFO_OF(selectionOnly) << INFO_OF(logOnNoChange)); |
| 36 | |
| 37 | auto cursor = editor->textCursor(); |
| 38 | m_cursorPos = cursor.position(); |
| 39 | m_cursorLine = cursor.blockNumber(); |
| 40 | m_cursorCol = cursor.columnNumber(); |
| 41 | m_anchorPos = cursor.anchor(); |
| 42 | cursor.setPosition(m_anchorPos); |
| 43 | m_anchorLine = cursor.blockNumber(); |
| 44 | m_anchorCol = cursor.columnNumber(); |
| 45 | |
| 46 | LOG_INFO(INFO_OF(m_cursorPos) << INFO_OF(m_cursorLine) << INFO_OF(m_anchorPos) << INFO_OF(m_anchorLine)); |
| 47 | } |
| 48 | |
| 49 | void CodeFormatter::format() const |
| 50 | { |
nothing calls this directly
no outgoing calls
no test coverage detected