diff options
author | Dimitri van Heesch <doxygen@gmail.com> | 2021-05-02 10:58:52 (GMT) |
---|---|---|
committer | Dimitri van Heesch <doxygen@gmail.com> | 2021-05-02 10:58:52 (GMT) |
commit | 6bce50a958860d1506daaf59f409bb27b93ec331 (patch) | |
tree | 1158a4529fde05c0597d3a34594b059efafb53e8 /src | |
parent | ffd705f8a9f2ea154853a3a9c20bdc7181c42c02 (diff) | |
download | Doxygen-6bce50a958860d1506daaf59f409bb27b93ec331.zip Doxygen-6bce50a958860d1506daaf59f409bb27b93ec331.tar.gz Doxygen-6bce50a958860d1506daaf59f409bb27b93ec331.tar.bz2 |
Minor performance/code duplication tweaks
Diffstat (limited to 'src')
-rw-r--r-- | src/docparser.cpp | 36 |
1 files changed, 20 insertions, 16 deletions
diff --git a/src/docparser.cpp b/src/docparser.cpp index 7fdaf6b..e3187a0 100644 --- a/src/docparser.cpp +++ b/src/docparser.cpp @@ -3371,31 +3371,33 @@ DocHtmlCell::Alignment DocHtmlCell::alignment() const { for (const auto &attr : attribs()) { - if (attr.name.lower()=="align") + QCString attrName = attr.name.lower(); + QCString attrValue = attr.value.lower(); + if (attrName=="align") { - if (attr.value.lower()=="center") + if (attrValue=="center") return Center; - else if (attr.value.lower()=="right") + else if (attrValue=="right") return Right; else return Left; } - else if (attr.name.lower()=="class") + else if (attrName=="class" && attrValue.startsWith("markdowntable")) { - if (attr.value.lower()=="markdowntableheadcenter") + if (attrValue=="markdowntableheadcenter") return Center; - else if (attr.value.lower()=="markdowntableheadright") + else if (attrValue=="markdowntableheadright") return Right; - else if (attr.value.lower()=="markdowntableheadleft") + else if (attrValue=="markdowntableheadleft") return Left; - else if (attr.value.lower()=="markdowntableheadnone") + else if (attrValue=="markdowntableheadnone") return Center; - else if (attr.value.lower()=="markdowntablebodycenter") + else if (attrValue=="markdowntablebodycenter") return Center; - else if (attr.value.lower()=="markdowntablebodyright") + else if (attrValue=="markdowntablebodyright") return Right; - else if (attr.value.lower()=="markdowntablebodyleft") + else if (attrValue=="markdowntablebodyleft") return Left; - else if (attr.value.lower()=="markdowntablebodynone") + else if (attrValue=="markdowntablebodynone") return Left; else return Left; } @@ -3407,13 +3409,15 @@ DocHtmlCell::Valignment DocHtmlCell::valignment() const { for (const auto &attr : attribs()) { - if (attr.name.lower()=="valign") + QCString attrName = attr.name.lower(); + QCString attrValue = attr.value.lower(); + if (attrName=="valign") { - if (attr.value.lower()=="top") + if (attrValue=="top") return Top; - else if (attr.value.lower()=="bottom") + else if (attrValue=="bottom") return Bottom; - else if (attr.value.lower()=="middle") + else if (attrValue=="middle") return Middle; else return Middle; } |