]> git.lyx.org Git - features.git/blobdiff - src/insets/InsetIndex.cpp
* InsetIndex (latex):
[features.git] / src / insets / InsetIndex.cpp
index 4940c24f2c147ac0ef4abdabb484d41bad29fc09..f5a1e4d306ddc0c29b3c9c5775e3c7dfad08fb5d 100644 (file)
@@ -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;
 }