QDoc: Preserve LinkAtom when copied into Text


`Text` has separate `operator<<` overloads for `Atom` and
`LinkAtom`. The latter preserves `LinkAtom`-specific state when making a
copy. This relies on the expression at the call site having static type
`LinkAtom`. Appending the same object through `Atom` instead selects the
generic overload and reconstructs it as a plain `Atom`.

`Text::operator<<(const Text&)` compensates for this by checking for
`LinkAtom` and downcasting before appending. `DocParser` similarly has a
`LinkAtom`-specific `appendAtom()` overload to retain the static type
required to select the correct `Text` overload.

This change moves the `LinkAtom` check into
`Text::operator<<(const Atom&)`. This makes `Text` preserve `LinkAtom`
regardless of the static type at the call site, and allows for the
removal of the compensating logic in `Text::operator<<(const Text&)`
and `DocParser`.

Task-number: QTBUG-150798
Change-Id: I720188bd8207f9b2dfc8c719f7eae7d44488c8b6
Reviewed-by: Topi Reinio <topi.reinio@qt.io>
commit3d8a80e352114e5802e83de6df79029ffeefa5e8
parent8e91c397dfe0ee03bc3e96718c1757782b104e23
authorPaul Wicking <paul.wicking@qt.io>
committerPaul Wicking <paul.wicking@qt.io>
commit timeFri, 25 Sep 2026 15:41:41 +0000