[Libreoffice-commits] core.git: codemaker/source
Miklos Vajna
vmiklos at collabora.co.uk
Wed Jun 6 06:41:51 UTC 2018
codemaker/source/cppumaker/includes.cxx | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
New commits:
commit a96a260a5fd6303eeebb26aee4be24ddf88391d1
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Tue Jun 5 22:14:44 2018 +0200
tdf#117918 codemaker: avoid including ourselves in .hpp files
It's pointless, include guards will make sure it's a NOP, but it
confuses tools like IWYU.
Change-Id: Ic1f56ef267954cdf8bf3cb4f4a5e841d5e4bb82a
Reviewed-on: https://gerrit.libreoffice.org/55354
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
diff --git a/codemaker/source/cppumaker/includes.cxx b/codemaker/source/cppumaker/includes.cxx
index e33262ee7f6c..ddd541640671 100644
--- a/codemaker/source/cppumaker/includes.cxx
+++ b/codemaker/source/cppumaker/includes.cxx
@@ -161,7 +161,10 @@ void Includes::dump(
if (m_hpp || pair.second == Dependencies::KIND_BASE
|| !isInterfaceType(u2b(pair.first)))
{
- dumpInclude(out, u2b(pair.first), m_hpp);
+ // If we know our name, then avoid including ourselves.
+ if (!companionHdl || *companionHdl != pair.first) {
+ dumpInclude(out, u2b(pair.first), m_hpp);
+ }
} else {
bool ns = dumpNamespaceOpen(out, pair.first, false);
if (ns) {
More information about the Libreoffice-commits
mailing list