From: Georg Baum Date: Thu, 1 Mar 2012 20:37:34 +0000 (+0000) Subject: Fix parsing of \sindex{stuff} and \sindex[]{stuff} X-Git-Tag: 2.1.0beta1~2008 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=c2748157bb44e245f4f6b0def055d7baf5c75cbb;p=features.git Fix parsing of \sindex{stuff} and \sindex[]{stuff} git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40826 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/tex2lyx/text.cpp b/src/tex2lyx/text.cpp index 2b5656c618..99db3eab11 100644 --- a/src/tex2lyx/text.cpp +++ b/src/tex2lyx/text.cpp @@ -3205,12 +3205,14 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer, else if (t.cs() == "index" || (t.cs() == "sindex" && preamble.use_indices() == "true")) { context.check_layout(os); - string const kind = (t.cs() == "index") ? "idx" : p.getArg('[', ']'); + string const arg = (t.cs() == "sindex" && p.hasOpt()) ? + p.getArg('[', ']') : ""; + string const kind = arg.empty() ? "idx" : arg; begin_inset(os, "Index "); os << kind << "\nstatus collapsed\n"; parse_text_in_inset(p, os, FLAG_ITEM, false, context, "Index"); end_inset(os); - if (t.cs() == "sindex") + if (kind != "idx") preamble.registerAutomaticallyLoadedPackage("splitidx"); }