From 3655600dce0b480884e7bebb7c215c8899fb59eb Mon Sep 17 00:00:00 2001 From: Georg Baum Date: Thu, 1 Mar 2012 20:39:46 +0000 Subject: [PATCH] backport r40826. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_2_0_X@40827 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/tex2lyx/text.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/tex2lyx/text.cpp b/src/tex2lyx/text.cpp index bdfc59624e..95ea75c9f1 100644 --- a/src/tex2lyx/text.cpp +++ b/src/tex2lyx/text.cpp @@ -3151,12 +3151,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"); } -- 2.39.5