From 5a0026acd0f273a4aad92dd45e9f7a9938322171 Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Wed, 25 Dec 2019 10:31:55 +0100 Subject: Minor tweaks --- src/docparser.cpp | 7 ++++--- src/docparser.h | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/docparser.cpp b/src/docparser.cpp index a41fad6..bfac491 100644 --- a/src/docparser.cpp +++ b/src/docparser.cpp @@ -882,7 +882,7 @@ static int handleStyleArgument(DocNode *parent,QList &children, * encountered. */ static void handleStyleEnter(DocNode *parent,QList &children, - DocStyleChange::Style s,const QCString tagName,const HtmlAttribList *attribs) + DocStyleChange::Style s,const QCString &tagName,const HtmlAttribList *attribs) { DBG(("HandleStyleEnter\n")); DocStyleChange *sc= new DocStyleChange(parent,g_nodeStack.count(),s,tagName,TRUE,attribs); @@ -897,9 +897,10 @@ static void handleStyleLeave(DocNode *parent,QList &children, DocStyleChange::Style s,const char *tagName) { DBG(("HandleStyleLeave\n")); + QCString tagNameLower = QCString(tagName).lower(); if (g_styleStack.isEmpty() || // no style change g_styleStack.top()->style()!=s || // wrong style change - g_styleStack.top()->tagName()!=QCString(tagName).lower() || // wrong style change + g_styleStack.top()->tagName()!=tagNameLower || // wrong style change g_styleStack.top()->position()!=g_nodeStack.count() // wrong position ) { @@ -908,7 +909,7 @@ static void handleStyleLeave(DocNode *parent,QList &children, warn_doc_error(g_fileName,doctokenizerYYlineno,"found tag without matching <%s>", qPrint(tagName),qPrint(tagName)); } - else if (g_styleStack.top()->tagName()!=QCString(tagName).lower()) + else if (g_styleStack.top()->tagName()!=tagNameLower) { warn_doc_error(g_fileName,doctokenizerYYlineno,"found tag while expecting ", qPrint(tagName),qPrint(g_styleStack.top()->tagName())); diff --git a/src/docparser.h b/src/docparser.h index 9b437e8..35b2285 100644 --- a/src/docparser.h +++ b/src/docparser.h @@ -388,8 +388,8 @@ class DocStyleChange : public DocNode Ins = (1<<13) }; - DocStyleChange(DocNode *parent,uint position,Style s,QCString tagName,bool enable, - const HtmlAttribList *attribs=0) : + DocStyleChange(DocNode *parent,uint position,Style s,const QCString &tagName,bool enable, + const HtmlAttribList *attribs=0) : m_position(position), m_style(s), m_enable(enable) { m_parent = parent; if (attribs) m_attribs=*attribs; m_tagName = tagName.lower();} Kind kind() const { return Kind_StyleChange; } -- cgit v0.12