From 473e365a0764d9c7e139782e1a9d1804036bd204 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=BCrgen=20Spitzm=C3=BCller?= Date: Sun, 19 Oct 2008 11:28:23 +0000 Subject: [PATCH] * InsetIndex (latex): - latex is supposed to return the number of _rows_, so do not count the characters (fix bug 5378). git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26966 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/insets/InsetIndex.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/insets/InsetIndex.cpp b/src/insets/InsetIndex.cpp index 4940c24f2c..f5a1e4d306 100644 --- a/src/insets/InsetIndex.cpp +++ b/src/insets/InsetIndex.cpp @@ -52,7 +52,7 @@ int InsetIndex::latex(odocstream & os, { os << "\\index"; os << '{'; - int i = 7; + int i = 0; // get contents of InsetText as LaTeX and plaintext odocstringstream ourlatex; @@ -95,10 +95,9 @@ int InsetIndex::latex(odocstream & os, bool first = true; for (; it != end; ++it) { // write the separator except the first time - if (!first) { + if (!first) os << '!'; - i += 1; - } else + else first = false; // correctly sort macros and formatted strings @@ -136,21 +135,16 @@ int InsetIndex::latex(odocstream & os, subst(spart2, from_ascii("\\"), docstring()); os << ppart; os << '@'; - i += ppart.size() + 1; } docstring const tpart = *it; os << tpart; - i += tpart.size(); if (it2 < levels_plain.end()) ++it2; } // write the bit that followed "|" - if (!cmd.empty()) { + if (!cmd.empty()) os << "|" << cmd; - i += cmd.size() + 1; - } os << '}'; - i += 1; return i; } -- 2.39.2