diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-02-11 10:58:51 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-02-11 10:59:35 +0200 |
commit | 8c0bb7692a5ae3f1c0d1966903baef013b50a7e6 (patch) | |
tree | 72588cf5792881615de82f3631f37a087936fdc8 /compilerplugins | |
parent | 7d80c9a89c0db40e6d836af3f8f2d5b0dd171422 (diff) |
loplugin:indentation workaround qt macros
Change-Id: I17bb0b462bb4ce7e8128c9ad33491aa8b691e566
Diffstat (limited to 'compilerplugins')
-rw-r--r-- | compilerplugins/clang/indentation.cxx | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/compilerplugins/clang/indentation.cxx b/compilerplugins/clang/indentation.cxx index c63bc58c06d9..3a8667c97f29 100644 --- a/compilerplugins/clang/indentation.cxx +++ b/compilerplugins/clang/indentation.cxx @@ -25,6 +25,11 @@ TODO else should line up with if namespace { +static bool startswith(const std::string& rStr, const char* pSubStr) +{ + return rStr.compare(0, strlen(pSubStr), pSubStr) == 0; +} + class Indentation : public loplugin::FilteringPlugin<Indentation> { public: @@ -49,6 +54,9 @@ public: // TODO need to learn to handle attributes like "[[maybe_unused]]" if (fn == SRCDIR "/binaryurp/source/bridge.cxx") return; + // the QEMIT macros + if (startswith(fn, SRCDIR "/vcl/qt5/")) + return; TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); } @@ -161,6 +169,7 @@ bool Indentation::VisitCompoundStmt(CompoundStmt const* compoundStmt) compat::getBeginLoc(firstStmt)); //getParentStmt(compoundStmt)->dump(); //stmt->dump(); + compoundStmt->dump(); } } return true; |