summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDimitri van Heesch <doxygen@gmail.com>2021-05-02 10:52:50 (GMT)
committerDimitri van Heesch <doxygen@gmail.com>2021-05-02 10:52:50 (GMT)
commitffd705f8a9f2ea154853a3a9c20bdc7181c42c02 (patch)
tree5d082c0887111e38d7fb753532a84e1fc71c08dd
parent77c1e773565b2e464cc19d5e897ff7ba3bfb93fc (diff)
parentc371558a5d31b4f0fa24db33732cf0fe390d3a08 (diff)
downloadDoxygen-ffd705f8a9f2ea154853a3a9c20bdc7181c42c02.zip
Doxygen-ffd705f8a9f2ea154853a3a9c20bdc7181c42c02.tar.gz
Doxygen-ffd705f8a9f2ea154853a3a9c20bdc7181c42c02.tar.bz2
Merge branch 'vertical_alignment_table' of https://github.com/DuyDang007/doxygen into DuyDang007-vertical_alignment_table
-rw-r--r--src/docparser.cpp17
-rw-r--r--src/docparser.h2
-rw-r--r--src/latexdocvisitor.cpp17
3 files changed, 35 insertions, 1 deletions
diff --git a/src/docparser.cpp b/src/docparser.cpp
index a812406..7fdaf6b 100644
--- a/src/docparser.cpp
+++ b/src/docparser.cpp
@@ -3403,6 +3403,23 @@ DocHtmlCell::Alignment DocHtmlCell::alignment() const
return Left;
}
+DocHtmlCell::Valignment DocHtmlCell::valignment() const
+{
+ for (const auto &attr : attribs())
+ {
+ if (attr.name.lower()=="valign")
+ {
+ if (attr.value.lower()=="top")
+ return Top;
+ else if (attr.value.lower()=="bottom")
+ return Bottom;
+ else if (attr.value.lower()=="middle")
+ return Middle;
+ else return Middle;
+ }
+ }
+ return Middle;
+}
//---------------------------------------------------------------------------
diff --git a/src/docparser.h b/src/docparser.h
index 44cd8dc..40fdc0c 100644
--- a/src/docparser.h
+++ b/src/docparser.h
@@ -1288,6 +1288,7 @@ class DocHtmlCell : public CompAccept<DocHtmlCell>
friend class DocHtmlTable;
public:
enum Alignment { Left, Right, Center };
+ enum Valignment {Top, Middle, Bottom};
DocHtmlCell(DocNode *parent,const HtmlAttribList &attribs,bool isHeading) :
m_isHeading(isHeading), m_attribs(attribs) { m_parent = parent; }
bool isHeading() const { return m_isHeading; }
@@ -1304,6 +1305,7 @@ class DocHtmlCell : public CompAccept<DocHtmlCell>
uint rowSpan() const;
uint colSpan() const;
Alignment alignment() const;
+ Valignment valignment() const;
private:
void setRowIndex(uint idx) { m_rowIdx = idx; }
diff --git a/src/latexdocvisitor.cpp b/src/latexdocvisitor.cpp
index 3e48dc5..e793f50 100644
--- a/src/latexdocvisitor.cpp
+++ b/src/latexdocvisitor.cpp
@@ -1320,14 +1320,29 @@ void LatexDocVisitor::visitPre(DocHtmlCell *c)
}
}
int rs = c->rowSpan();
+ int va = c->valignment();
if (rs>0)
{
setInRowSpan(TRUE);
+ m_t << "\\multirow";
+ switch(va)
+ {
+ case DocHtmlCell::Top:
+ m_t << "[t]";
+ break;
+ case DocHtmlCell::Bottom:
+ m_t << "[b]";
+ break;
+ case DocHtmlCell::Middle:
+ break; // No alignment option needed
+ default:
+ break;
+ }
//printf("adding row span: cell={r=%d c=%d rs=%d cs=%d} curCol=%d\n",
// c->rowIndex(),c->columnIndex(),c->rowSpan(),c->colSpan(),
// currentColumn());
addRowSpan(ActiveRowSpan(c,rs,cs,currentColumn()));
- m_t << "\\multirow{" << rs << "}{*}{";
+ m_t << "{" << rs << "}{*}{";
}
if (a==DocHtmlCell::Center)
{