mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
C++, skip adding already used old-style ids.
See michaeljones/breathe#266.
This commit is contained in:
parent
2d20e337b3
commit
c0df9205e6
@ -3738,7 +3738,7 @@ class CPPObject(ObjectDescription):
|
|||||||
id_v1 = None
|
id_v1 = None
|
||||||
id_v2 = ast.get_id_v2()
|
id_v2 = ast.get_id_v2()
|
||||||
# store them in reverse order, so the newest is first
|
# store them in reverse order, so the newest is first
|
||||||
ids = [id_v2, id_v1]
|
ids = [id_v2, id_v1]
|
||||||
|
|
||||||
newestId = ids[0]
|
newestId = ids[0]
|
||||||
assert newestId # shouldn't be None
|
assert newestId # shouldn't be None
|
||||||
@ -3759,8 +3759,14 @@ class CPPObject(ObjectDescription):
|
|||||||
else:
|
else:
|
||||||
# print("[CPP] non-unique name:", name)
|
# print("[CPP] non-unique name:", name)
|
||||||
pass
|
pass
|
||||||
for id in ids:
|
# always add the newest id
|
||||||
if id: # is None when the element didn't exist in that version
|
assert newestId
|
||||||
|
signode['ids'].append(newestId)
|
||||||
|
# only add compatibility ids when there are no conflicts
|
||||||
|
for id in ids[1:]:
|
||||||
|
if not id: # is None when the element didn't exist in that version
|
||||||
|
continue
|
||||||
|
if id not in self.state.document.ids:
|
||||||
signode['ids'].append(id)
|
signode['ids'].append(id)
|
||||||
signode['first'] = (not self.names) # hmm, what is this abound?
|
signode['first'] = (not self.names) # hmm, what is this abound?
|
||||||
self.state.document.note_explicit_target(signode)
|
self.state.document.note_explicit_target(signode)
|
||||||
|
Loading…
Reference in New Issue
Block a user