|
77 | 77 | </table> |
78 | 78 | </xsl:template> |
79 | 79 | <xsl:template name="add-inherited-method-summary"> |
80 | | - <xsl:variable name="extends"> |
81 | | - <xsl:value-of select="class/@qualified"/> |
82 | | - </xsl:variable> |
83 | 80 |
|
84 | | - <xsl:choose> |
85 | | - <xsl:when test="//package/class[@qualified=$extends]"> |
86 | | - <xsl:call-template name="inheritance-method-summary"> |
87 | | - <xsl:with-param name="extends" select = "//package/class[@qualified=$extends]/@qualified" /> |
88 | | - </xsl:call-template> |
89 | | - </xsl:when> |
90 | | - </xsl:choose> |
| 81 | + <xsl:variable name="current_id" select="@id"/> |
| 82 | + |
| 83 | + <xsl:for-each select="inheritancegraph/node"> |
| 84 | + <xsl:if test="childnode[@relation='public-inheritance']"> |
| 85 | + <xsl:variable name="extends"> |
| 86 | + <xsl:value-of select="link/@refid"/> |
| 87 | + </xsl:variable> |
| 88 | + <xsl:if test="link/@refid and $extends!=$current_id"> |
| 89 | + <xsl:call-template name="inheritance-method-summary"> |
| 90 | + <xsl:with-param name="extends" select = "//compounddef[@kind='class' and @id=$extends]" /> |
| 91 | + </xsl:call-template> |
| 92 | + </xsl:if> |
| 93 | + </xsl:if> |
| 94 | + </xsl:for-each> |
91 | 95 | </xsl:template> |
92 | 96 |
|
93 | 97 | <!-- |
94 | 98 | List methods from inherited classes |
95 | 99 | --> |
96 | 100 | <xsl:template name="inheritance-method-summary"> |
97 | 101 | <xsl:param name = "extends" /> |
98 | | - |
| 102 | + |
| 103 | + <xsl:variable name="inherited_id"> |
| 104 | + <xsl:value-of select="$extends/compoundname"/> |
| 105 | + </xsl:variable> |
| 106 | + |
| 107 | + |
99 | 108 | <xsl:variable name="inherited_methods"> |
100 | 109 | <xsl:text>Methods inherited from class </xsl:text> |
101 | | - <xsl:value-of select="replace(@qualified,'\..*$','.')"/> |
| 110 | + <xsl:value-of select="concat ('Class ',replace($inherited_id, '::\w*$','::'))"/> |
| 111 | + |
102 | 112 | <xsl:call-template name="add-link" > |
103 | 113 | <xsl:with-param name="type" select="'topic'" /> |
104 | | - <xsl:with-param name="href" select="concat('#', //package/class[@qualified=$extends]/@qualified)" /> |
105 | | - <xsl:with-param name="text" select="//package/class[@qualified=$extends]/@name" /> |
| 114 | + <xsl:with-param name="href" select="concat('#', dita-ot:name-to-id($inherited_id))" /> |
| 115 | + <xsl:with-param name="text" select="replace($inherited_id, '^.*::','')" /> |
106 | 116 | </xsl:call-template> |
107 | 117 | </xsl:variable> |
108 | 118 |
|
| 119 | + <!--xsl:variable name="inherited_methods_details" select="''" /--> |
| 120 | + |
109 | 121 | <xsl:variable name="inherited_methods_details"> |
110 | | - <xsl:for-each select="//package/class[@qualified=$extends]/method"> |
111 | | - <xsl:sort select="@name"/> |
112 | | - <xsl:variable name="method" select="@name"/> |
| 122 | + <xsl:for-each select="$extends/sectiondef[contains(@kind,'-func')]/memberdef[@kind='function' and not(type='') and @prot='public']"> |
| 123 | + <xsl:sort select="name"/> |
| 124 | + <xsl:variable name="method" select="name"/> |
113 | 125 | <codeph class=" pr-d/codeph "> |
114 | 126 | <xsl:attribute name="xtrc" select="concat('codeph:',generate-id(.),'14')"/> |
115 | 127 | <xsl:call-template name="add-link" > |
116 | 128 | <xsl:with-param name="type" select="'table'" /> |
117 | 129 | <xsl:with-param name="href"> |
118 | | - <xsl:value-of select="concat('#', $extends,'/methods_', $method)"/> |
119 | | - <xsl:if test="count(../method[@name=$method])>1"> |
120 | | - <xsl:value-of select="count(following-sibling::method[@name=$method])"/> |
| 130 | + <xsl:value-of select="concat('#', dita-ot:name-to-id($inherited_id),'/methods_', $method)"/> |
| 131 | + <xsl:if test="count(../memberdef[name=$method])>1"> |
| 132 | + <xsl:value-of select="count(following-sibling::memberdef[name=$method])"/> |
121 | 133 | </xsl:if> |
122 | 134 | </xsl:with-param> |
123 | 135 | <xsl:with-param name="text" select="$method" /> |
|
136 | 148 | <xsl:with-param name="body" select="$inherited_methods_details"/> |
137 | 149 | </xsl:call-template> |
138 | 150 | </table> |
139 | | - |
140 | | - <xsl:variable name="reextends"> |
141 | | - <xsl:value-of select="//package/class[@qualified=$extends]/class/@qualified"/> |
142 | | - </xsl:variable> |
143 | | - <xsl:choose> |
144 | | - <xsl:when test="//package/class[@qualified=$reextends]"> |
145 | | - <xsl:call-template name="inheritance-method-summary" > |
146 | | - <xsl:with-param name="extends" select = "//package/class[@qualified=$reextends]/@qualified" /> |
147 | | - </xsl:call-template> |
148 | | - </xsl:when> |
149 | | - </xsl:choose> |
150 | 151 | </xsl:template> |
151 | 152 |
|
152 | 153 | <!-- |
|
175 | 176 | <xsl:call-template name="add-signature"/> |
176 | 177 | </codeblock> |
177 | 178 | <xsl:call-template name="parse-brief-description"/> |
| 179 | + |
| 180 | + <xsl:if test="reimplements"> |
| 181 | + <p class="- topic/p "> |
| 182 | + <b class=" hi-d/b "> |
| 183 | + <xsl:text>Overrides:</xsl:text> |
| 184 | + </b> |
| 185 | + </p> |
| 186 | + <xsl:call-template name="add-overrides"> |
| 187 | + <xsl:with-param name="method" select="$method"/> |
| 188 | + <xsl:with-param name="refid" select="reimplements/@refid"/> |
| 189 | + </xsl:call-template> |
| 190 | + </xsl:if> |
| 191 | + |
| 192 | + |
| 193 | + |
178 | 194 | <xsl:call-template name="parameter-description"/> |
179 | 195 | <xsl:call-template name="return-description"/> |
180 | 196 | </xsl:variable> |
|
257 | 273 | </xsl:template> |
258 | 274 |
|
259 | 275 | <xsl:template name="add-overrides"> |
260 | | - <xsl:param name="method"/> |
261 | | - <xsl:param name="signature"/> |
262 | | - <xsl:param name="extends"/> |
263 | | - |
264 | | - |
| 276 | + <xsl:param name="method"/> |
| 277 | + <xsl:param name="refid"/> |
| 278 | + |
| 279 | + <xsl:variable name="extends" select="//member[@refid=$refid]/ancestor::compounddef"/> |
| 280 | + |
| 281 | + <xsl:for-each select="$extends/compoundname"> |
265 | 282 | <p class="- topic/p "> |
266 | 283 | <codeph class=" pr-d/codeph "> |
267 | 284 | <xsl:attribute name="xtrc" select="concat('codeph:',generate-id(.),'17')"/> |
268 | 285 | <xsl:call-template name="add-link" > |
269 | 286 | <xsl:with-param name="type" select="'table'" /> |
270 | 287 | <xsl:with-param name="href"> |
271 | | - <xsl:value-of select="concat('#', $extends, '/methods_', $method)" /> |
272 | | - <xsl:if test="count(//package/class[@qualified=$extends]/method[@name=$method])>1"> |
273 | | - <xsl:value-of select="count(//package/class[@qualified=$extends]/method[@name=$method and @signature=$signature]/following-sibling::method[@name=$method])"/> |
| 288 | + <xsl:value-of select="concat('#', dita-ot:name-to-id(.), '/methods_', $method)" /> |
| 289 | + <xsl:if test="count($extends/sectiondef/memberdef[name=$method])>1"> |
| 290 | + <xsl:value-of select="count($extends/sectiondef/memberdef[@id=$refid]/following-sibling::memberdef[name=$method])"/> |
274 | 291 | </xsl:if> |
275 | 292 | </xsl:with-param> |
276 | | - <xsl:with-param name="text" select="replace(@qualified,'^.*\.','')" /> |
| 293 | + <xsl:with-param name="text" select="$method" /> |
277 | 294 | </xsl:call-template> |
278 | 295 | </codeph> |
279 | 296 | <xsl:text> in class </xsl:text> |
280 | 297 | <codeph class=" pr-d/codeph "> |
281 | 298 | <xsl:attribute name="xtrc" select="concat('codeph:',generate-id(.),'18')"/> |
282 | 299 | <xsl:call-template name="add-link" > |
283 | 300 | <xsl:with-param name="type" select="'topic'" /> |
284 | | - <xsl:with-param name="href" select="concat('#', $extends)" /> |
285 | | - <xsl:with-param name="text" select="replace($extends,'^.*\.','')" /> |
| 301 | + <xsl:with-param name="href" select="concat('#', dita-ot:name-to-id(.))" /> |
| 302 | + <xsl:with-param name="text" select="replace(.,'^.*::','')" /> |
286 | 303 | </xsl:call-template> |
287 | 304 | </codeph> |
288 | 305 | </p> |
| 306 | + </xsl:for-each> |
289 | 307 | </xsl:template> |
290 | 308 | <!--- |
291 | 309 | --> |
|
0 commit comments