]> git.lyx.org Git - features.git/commit
XML: overhaul the tag-comparison operators.
authorThibaut Cuvelier <tcuvelier@lyx.org>
Tue, 27 Dec 2022 15:52:51 +0000 (16:52 +0100)
committerThibaut Cuvelier <tcuvelier@lyx.org>
Tue, 27 Dec 2022 15:52:51 +0000 (16:52 +0100)
commitfebd1855eba8cd73f7e37790ead78a66378326ab
tree7d951470b97476ecadd3b3ec37ac5687a1c8b17d
parent7f5c917c71b97c880d333c6de5ed0af555586ff6
XML: overhaul the tag-comparison operators.

First and foremost, this patch implements the latest best practices in C++ (i.e. comparison operators are not member functions).

The main objective of this rewrite is to have these operators callable in slightly more general contexts (*this->asFontTag() == *rhs.asFontTag() yielded an error because no member function could be called). This feature is no more required.

The rewrite took place in the context of https://www.lyx.org/trac/ticket/12585. The first iteration was using more complex code to circumvent XMLStream in DocBook (see details in the bug above and in the mailing list), while this one uses XMLStream fully. The bug was due to font tags being considered equal when they were not, due to the comparison done only on the XML tag and not on the actual font change (XML attributes can complement the tag for various font changes).
src/xml.cpp
src/xml.h