Fix doxygen2boostbook when 2 files have the same name.

Refs #1192. Patch by Steven Watanabe, updated by me. If it goes wrong,
it's my fault.

[SVN r62477]
This commit is contained in:
Daniel James 2010-06-06 09:38:51 +00:00
parent 43fed417bc
commit ff74c39518

View File

@ -204,8 +204,7 @@
<xsl:param name="in-file"/> <xsl:param name="in-file"/>
<xsl:param name="with-namespace-refs"/> <xsl:param name="with-namespace-refs"/>
<xsl:if test="contains(string(location/attribute::file), <xsl:if test="string(location/attribute::file)=$in-file">
concat('/', $in-file)) ">
<!-- The short name of this class --> <!-- The short name of this class -->
<xsl:variable name="name-with-spec"> <xsl:variable name="name-with-spec">
@ -261,7 +260,9 @@
<xsl:apply-templates select="briefdescription" mode="passthrough"/> <xsl:apply-templates select="briefdescription" mode="passthrough"/>
<xsl:apply-templates select="detaileddescription" mode="passthrough"/> <xsl:apply-templates select="detaileddescription" mode="passthrough"/>
<xsl:apply-templates select="inbodydescription" mode="passthrough"/> <xsl:apply-templates select="inbodydescription" mode="passthrough"/>
<xsl:apply-templates/> <xsl:apply-templates>
<xsl:with-param name="in-file" select="$in-file"/>
</xsl:apply-templates>
</xsl:element> </xsl:element>
</xsl:if> </xsl:if>
</xsl:template> </xsl:template>
@ -269,8 +270,7 @@
<xsl:template name="enum"> <xsl:template name="enum">
<xsl:param name="in-file"/> <xsl:param name="in-file"/>
<xsl:if test="contains(string(location/attribute::file), <xsl:if test="string(location/attribute::file)=$in-file">
concat('/', $in-file))">
<xsl:variable name="name"> <xsl:variable name="name">
<xsl:call-template name="strip-qualifiers"> <xsl:call-template name="strip-qualifiers">
<xsl:with-param name="name" select="name"/> <xsl:with-param name="name" select="name"/>
@ -384,7 +384,7 @@
<xsl:apply-templates mode="toplevel"> <xsl:apply-templates mode="toplevel">
<xsl:with-param name="with-namespace-refs" <xsl:with-param name="with-namespace-refs"
select="innernamespace"/> select="innernamespace"/>
<xsl:with-param name="in-file" select="string(compoundname)"/> <xsl:with-param name="in-file" select="location/attribute::file"/>
</xsl:apply-templates> </xsl:apply-templates>
</header> </header>
</xsl:if> </xsl:if>
@ -498,11 +498,15 @@
</xsl:when> </xsl:when>
<xsl:when test="@kind='function'"> <xsl:when test="@kind='function'">
<xsl:call-template name="function" /> <xsl:call-template name="function">
<xsl:with-param name="in-file" select="$in-file"/>
</xsl:call-template>
</xsl:when> </xsl:when>
<xsl:when test="@kind='typedef'"> <xsl:when test="@kind='typedef'">
<xsl:call-template name="typedef" /> <xsl:call-template name="typedef">
<xsl:with-param name="in-file" select="$in-file"/>
</xsl:call-template>
</xsl:when> </xsl:when>
<xsl:when test="@kind='variable'"> <xsl:when test="@kind='variable'">
@ -664,6 +668,7 @@
<method-group name="public static functions"> <method-group name="public static functions">
<xsl:apply-templates> <xsl:apply-templates>
<xsl:with-param name="in-section" select="true()"/> <xsl:with-param name="in-section" select="true()"/>
<xsl:with-param name="in-file" select="$in-file"/>
</xsl:apply-templates> </xsl:apply-templates>
</method-group> </method-group>
</xsl:when> </xsl:when>
@ -672,6 +677,7 @@
<method-group name="protected static functions"> <method-group name="protected static functions">
<xsl:apply-templates> <xsl:apply-templates>
<xsl:with-param name="in-section" select="true()"/> <xsl:with-param name="in-section" select="true()"/>
<xsl:with-param name="in-file" select="$in-file"/>
</xsl:apply-templates> </xsl:apply-templates>
</method-group> </method-group>
</xsl:when> </xsl:when>
@ -680,6 +686,7 @@
<method-group name="private static functions"> <method-group name="private static functions">
<xsl:apply-templates> <xsl:apply-templates>
<xsl:with-param name="in-section" select="true()"/> <xsl:with-param name="in-section" select="true()"/>
<xsl:with-param name="in-file" select="$in-file"/>
</xsl:apply-templates> </xsl:apply-templates>
</method-group> </method-group>
</xsl:when> </xsl:when>
@ -694,6 +701,7 @@
<method-group name="public member functions"> <method-group name="public member functions">
<xsl:apply-templates> <xsl:apply-templates>
<xsl:with-param name="in-section" select="true()"/> <xsl:with-param name="in-section" select="true()"/>
<xsl:with-param name="in-file" select="$in-file"/>
</xsl:apply-templates> </xsl:apply-templates>
</method-group> </method-group>
<xsl:apply-templates/> <xsl:apply-templates/>
@ -703,6 +711,7 @@
<method-group name="protected member functions"> <method-group name="protected member functions">
<xsl:apply-templates> <xsl:apply-templates>
<xsl:with-param name="in-section" select="true()"/> <xsl:with-param name="in-section" select="true()"/>
<xsl:with-param name="in-file" select="$in-file"/>
</xsl:apply-templates> </xsl:apply-templates>
</method-group> </method-group>
<xsl:apply-templates/> <xsl:apply-templates/>
@ -718,6 +727,7 @@
<method-group name="private member functions"> <method-group name="private member functions">
<xsl:apply-templates> <xsl:apply-templates>
<xsl:with-param name="in-section" select="true()"/> <xsl:with-param name="in-section" select="true()"/>
<xsl:with-param name="in-file" select="$in-file"/>
</xsl:apply-templates> </xsl:apply-templates>
</method-group> </method-group>
</xsl:if> </xsl:if>
@ -728,15 +738,20 @@
<method-group name="friend functions"> <method-group name="friend functions">
<xsl:apply-templates> <xsl:apply-templates>
<xsl:with-param name="in-section" select="true()"/> <xsl:with-param name="in-section" select="true()"/>
<xsl:with-param name="in-file" select="$in-file"/>
</xsl:apply-templates> </xsl:apply-templates>
</method-group> </method-group>
</xsl:if> </xsl:if>
</xsl:when> </xsl:when>
<xsl:when test="@kind='public-static-attrib' or @kind='public-attrib'"> <xsl:when test="@kind='public-static-attrib' or @kind='public-attrib'">
<xsl:apply-templates/> <xsl:apply-templates>
<xsl:with-param name="in-file" select="$in-file"/>
</xsl:apply-templates>
</xsl:when> </xsl:when>
<xsl:when test="@kind='public-type'"> <xsl:when test="@kind='public-type'">
<xsl:apply-templates/> <xsl:apply-templates>
<xsl:with-param name="in-file" select="$in-file"/>
</xsl:apply-templates>
</xsl:when> </xsl:when>
<xsl:when test="@kind='private-type'"> <xsl:when test="@kind='private-type'">
<!--skip private members--> <!--skip private members-->
@ -765,7 +780,9 @@
</xsl:apply-templates> </xsl:apply-templates>
</xsl:when> </xsl:when>
<xsl:when test="@kind='user-defined'"> <xsl:when test="@kind='user-defined'">
<xsl:apply-templates/> <xsl:apply-templates>
<xsl:with-param name="in-file" select="$in-file"/>
</xsl:apply-templates>
</xsl:when> </xsl:when>
<xsl:when test="@kind=''"> <xsl:when test="@kind=''">
<xsl:apply-templates select="memberdef[generate-id() = <xsl:apply-templates select="memberdef[generate-id() =
@ -875,8 +892,7 @@
<xsl:template name="typedef"> <xsl:template name="typedef">
<xsl:param name="in-file" select="''"/> <xsl:param name="in-file" select="''"/>
<xsl:if test="contains(string(location/attribute::file), <xsl:if test="string(location/attribute::file)=$in-file">
concat('/', $in-file))">
<!-- TBD: Handle public/protected/private --> <!-- TBD: Handle public/protected/private -->
<typedef> <typedef>
<!-- Name of the type --> <!-- Name of the type -->
@ -1007,8 +1023,7 @@
<xsl:variable name="firstpara" <xsl:variable name="firstpara"
select="normalize-space(detaileddescription/para[1])"/> select="normalize-space(detaileddescription/para[1])"/>
<xsl:if test="contains(string(location/attribute::file), <xsl:if test="string(location/attribute::file)=$in-file
concat('/', $in-file))
and and
not($firstpara=normalize-space($boost.doxygen.overload))"> not($firstpara=normalize-space($boost.doxygen.overload))">
@ -1182,8 +1197,7 @@
<!-- Handle member variables --> <!-- Handle member variables -->
<xsl:template name="variable"> <xsl:template name="variable">
<xsl:param name="in-file"/> <xsl:param name="in-file"/>
<xsl:if test="contains(string(location/attribute::file), <xsl:if test="string(location/attribute::file)=$in-file">
concat('/', $in-file))">
<data-member> <data-member>
<xsl:attribute name="name"> <xsl:attribute name="name">
<xsl:value-of select="name/text()"/> <xsl:value-of select="name/text()"/>