summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--codemaker/source/cppumaker/includes.cxx5
1 files changed, 4 insertions, 1 deletions
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) {