From f952918390ea59ae5ed277c1908bac6ba4b60b4e Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Thu, 2 Feb 2023 12:02:46 +0100 Subject: [PATCH] CppEditor: Add missing include and ifdefs Change-Id: I34b1d0f4fb10c7fcba6e6b7bc1b3d964e154db3a Reviewed-by: Christian Kandeler Reviewed-by: Christian Stenger --- src/plugins/cppeditor/cpphighlighter.cpp | 5 ++++- src/plugins/cppeditor/cpphighlighter.h | 6 +++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/plugins/cppeditor/cpphighlighter.cpp b/src/plugins/cppeditor/cpphighlighter.cpp index 42982c43083..f09331efae6 100644 --- a/src/plugins/cppeditor/cpphighlighter.cpp +++ b/src/plugins/cppeditor/cpphighlighter.cpp @@ -13,6 +13,7 @@ #include #include +#include #include #include @@ -460,6 +461,7 @@ void CppHighlighter::highlightDoxygenComment(const QString &text, int position, setFormatWithSpaces(text, initial, it - uc - initial, format); } +#ifdef WITH_TESTS namespace Internal { CppHighlighterTest::CppHighlighterTest() { @@ -541,6 +543,7 @@ void CppHighlighterTest::test() QCOMPARE(actualFormat, expectedFormat); } } - } // namespace Internal +#endif // WITH_TESTS + } // namespace CppEditor diff --git a/src/plugins/cppeditor/cpphighlighter.h b/src/plugins/cppeditor/cpphighlighter.h index ee1f8251a87..358fcb2760e 100644 --- a/src/plugins/cppeditor/cpphighlighter.h +++ b/src/plugins/cppeditor/cpphighlighter.h @@ -9,7 +9,9 @@ #include -#include +#ifdef WITH_TESTS +#include +#endif namespace CppEditor { @@ -37,6 +39,7 @@ private: CPlusPlus::LanguageFeatures m_languageFeatures = CPlusPlus::LanguageFeatures::defaultFeatures(); }; +#ifdef WITH_TESTS namespace Internal { class CppHighlighterTest : public CppHighlighter { @@ -53,5 +56,6 @@ private: QTextDocument m_doc; }; } // namespace Internal +#endif // WITH_TESTS } // namespace CppEditor