summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDuy Dang <duydang.spkt@gmail.com>2021-02-01 15:10:10 (GMT)
committerDuy Dang <duydang.spkt@gmail.com>2021-02-01 15:32:40 (GMT)
commit0aa101a847e4038aca15d51d53ce78b49caa533f (patch)
treee34a95763211202d3081830791698273fdb42b67 /src
parentcd3c39c11084a326baee2e81420fe13a5dacb8e2 (diff)
downloadDoxygen-0aa101a847e4038aca15d51d53ce78b49caa533f.zip
Doxygen-0aa101a847e4038aca15d51d53ce78b49caa533f.tar.gz
Doxygen-0aa101a847e4038aca15d51d53ce78b49caa533f.tar.bz2
Support vertical alignment in multirow table
Diffstat (limited to 'src')
-rw-r--r--src/docparser.cpp15
-rw-r--r--src/docparser.h2
-rw-r--r--src/latexdocvisitor.cpp15
3 files changed, 31 insertions, 1 deletions
diff --git a/src/docparser.cpp b/src/docparser.cpp
index a179904..809d692 100644
--- a/src/docparser.cpp
+++ b/src/docparser.cpp
@@ -3398,6 +3398,21 @@ 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 return Middle;
+ }
+ }
+ return Middle;
+}
//---------------------------------------------------------------------------
diff --git a/src/docparser.h b/src/docparser.h
index fa2b440..b309f66 100644
--- a/src/docparser.h
+++ b/src/docparser.h
@@ -1338,6 +1338,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; }
@@ -1354,6 +1355,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 019030d..965ec42 100644
--- a/src/latexdocvisitor.cpp
+++ b/src/latexdocvisitor.cpp
@@ -1270,14 +1270,27 @@ 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;
+ 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)
{