Skip to content

Commit f9b0cf3

Browse files
committed
remove unused code
1 parent 18d7e50 commit f9b0cf3

File tree

2 files changed

+0
-72
lines changed

2 files changed

+0
-72
lines changed

src/smallUsefulFunctions.cpp

Lines changed: 0 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -410,74 +410,6 @@ QString trimRight(const QString &s)
410410
if (s[j] != ' ' && s[j] != '\t' && s[j] != '\r' && s[j] != '\n') break;
411411
return s.left(j + 1);
412412
}
413-
/*!
414-
* \brief get argument after command 'token'
415-
*
416-
* handles latex comments correctly
417-
* \warning obsolete with lexer based token system
418-
* \param line text of one line
419-
* \param token latexcommand
420-
* \return text after token
421-
*/
422-
QString findToken(const QString &line, const QString &token)
423-
{
424-
int tagStart = line.indexOf(token);
425-
int commentStart = line.indexOf(QRegularExpression("(^|[^\\\\])%")); // find start of comment (if any)
426-
if (tagStart != -1 && (commentStart > tagStart || commentStart == -1)) {
427-
tagStart += token.length();
428-
int tagEnd = line.indexOf("}", tagStart);
429-
if (tagEnd != -1) return line.mid(tagStart, tagEnd - tagStart);
430-
else return line.mid(tagStart); //return everything after line if there is no }
431-
}
432-
return "";
433-
}
434-
/*!
435-
* \brief get argument after command 'token'
436-
*
437-
* handles latex comments correctly
438-
* \warning obsolete with lexer based token system
439-
* \param line text of one line
440-
* \param token latexcommand
441-
* \param start column number
442-
* \return text after token
443-
*/
444-
QString findToken(const QString &line, const QString &token, int &start)
445-
{
446-
int tagStart = line.indexOf(token, start);
447-
int commentStart = line.indexOf(QRegularExpression("(^|[^\\\\])%")); // find start of comment (if any)
448-
if (tagStart != -1 && (commentStart > tagStart || commentStart == -1)) {
449-
tagStart += token.length();
450-
int tagEnd = line.indexOf("}", tagStart);
451-
start = tagStart;
452-
if (tagEnd != -1) return line.mid(tagStart, tagEnd - tagStart);
453-
else return line.mid(tagStart); //return everything after line if there is no }
454-
}
455-
start = -2;
456-
return "";
457-
}
458-
/*!
459-
* \brief get argument after command 'token'
460-
*
461-
* handles latex comments correctly
462-
* \warning obsolete with lexer based token system
463-
* \param line text of one line
464-
* \param token regexp to search
465-
* \return text after token
466-
*/
467-
/*
468-
QString findToken(const QString &line, QRegularExpression &token)
469-
{
470-
//ATTENTION: token is not const because, you can't call cap on const qregexp in qt < 4.5
471-
int tagStart = 0;
472-
QString s = line;
473-
tagStart = token.indexIn(line);
474-
int commentStart = line.indexOf(QRegularExpression("(^|[^\\\\])%")); // find start of comment (if any)
475-
if (tagStart != -1 && (commentStart > tagStart || commentStart == -1)) {
476-
s = s.mid(tagStart + token.cap(0).length(), s.length());
477-
return s;
478-
}
479-
return "";
480-
}*/
481413

482414
bool findTokenWithArg(const QString &line, const QString &token, QString &outName, QString &outArg)
483415
{

src/smallUsefulFunctions.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,6 @@ QString getParamItem(const QString &line, int pos, bool stopAtWhiteSpace = false
8181
QString trimLeft(const QString &s);
8282
QString trimRight(const QString &s);
8383

84-
/// find token (e.g. \label \input \section and return content (\section{content})
85-
QString findToken(const QString &line, const QString &token);
86-
QString findToken(const QString &line, const QString &token, int &start);
87-
//QString findToken(const QString &line, QRegularExpression &token);
8884
/// find token (e.g. \label \input \section and return content (\newcommand{name}[arg]), returns true if outName!=""
8985
bool findTokenWithArg(const QString &line, const QString &token, QString &outName, QString &outArg);
9086

0 commit comments

Comments
 (0)