From 080389ee153981831ea36e14726b49f756e081bf Mon Sep 17 00:00:00 2001 From: albert-github Date: Thu, 30 Aug 2018 13:21:18 +0200 Subject: Sorting of index in case of LaTex In case of LaTeX the sorting was so that lowercase came after uppercase e.g.: `username` came after `useSsl`, although the index should be case insensitive. Te problem was that the sort key was filtered in such a way that a.o. uppercase symbols were preceded by `\+` for hyphenation. The key doesn't need this hyphenation (as there is a separate field for the display name). The `\+` has been filtered out now. --- src/util.cpp | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/src/util.cpp b/src/util.cpp index b387a84..b524863 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -6865,11 +6865,37 @@ void filterLatexString(FTextStream &t,const char *str, } } +static void reFilterLatexString(FTextStream &t,const char *str) +{ + if (str==0) return; + const unsigned char *p=(const unsigned char *)str; + unsigned char c; + unsigned char pc='\0'; + while (*p) + { + c=*p++; + + switch(c) + { + case '\\': + if (*p == '+') p++; + else t << '\\'; + break; + default: + t << (char)c; + break; + } + pc = c; + } +} + QCString latexEscapeLabelName(const char *s,bool insideTabbing) { QGString result; + QGString result1; QCString tmp(qstrlen(s)+1); FTextStream t(&result); + FTextStream t1(&result1); const char *p=s; char c; int i; @@ -6899,7 +6925,13 @@ QCString latexEscapeLabelName(const char *s,bool insideTabbing) break; } } - return result.data(); + if (!insideTabbing) + { + reFilterLatexString(t1,result.data()); + return result1.data(); + } + else + return result.data(); } QCString latexEscapeIndexChars(const char *s,bool insideTabbing) -- cgit v0.12