]> git.lyx.org Git - features.git/commitdiff
DocBook: restore index ranges.
authorThibaut Cuvelier <tcuvelier@lyx.org>
Mon, 26 Feb 2024 14:15:32 +0000 (15:15 +0100)
committerThibaut Cuvelier <tcuvelier@lyx.org>
Mon, 26 Feb 2024 14:15:32 +0000 (15:15 +0100)
src/insets/InsetIndex.cpp

index 54058b8ea72b407984964f1d565c48681b12168e..68669b0b7e1488b1c0be9227cf2f2f0e87bdea6e 100644 (file)
@@ -386,7 +386,10 @@ void InsetIndex::docbook(XMLStream & xs, OutputParams const & runparams) const
        }
 
        // Handle ranges. Happily, in the raw LaTeX mode, (| and |) can only be at the end of the string!
-       const bool hasInsetRange = params_.range != InsetIndexParams::PageRange::None;
+       // Handle both modern ranges (params_.range) and legacy ones (with a suffix |( or |) as in pure LaTeX).
+       const bool hasInsetRange = params_.range != InsetIndexParams::PageRange::None ||
+                       latexString.find(from_ascii("|(")) != lyx::docstring::npos ||
+                       latexString.find(from_ascii("|)")) != lyx::docstring::npos;
        const bool hasStartRange = params_.range == InsetIndexParams::PageRange::Start ||
                        latexString.find(from_ascii("|(")) != lyx::docstring::npos;
        const bool hasEndRange = params_.range == InsetIndexParams::PageRange::End ||