summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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)
{