summaryrefslogtreecommitdiffstats
path: root/src/latexdocvisitor.h
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2015-08-18 17:40:03 (GMT)
committerDimitri van Heesch <dimitri@stack.nl>2015-08-26 08:11:14 (GMT)
commit883989fced827524354297009fde396ca6264a31 (patch)
treec530cc74701278fec2324f13ade49247eb203ce8 /src/latexdocvisitor.h
parent5c2b6c294535a0dabe29b5ef311b4975eccb2357 (diff)
downloadDoxygen-883989fced827524354297009fde396ca6264a31.zip
Doxygen-883989fced827524354297009fde396ca6264a31.tar.gz
Doxygen-883989fced827524354297009fde396ca6264a31.tar.bz2
Fixes to support nested tables again
Diffstat (limited to 'src/latexdocvisitor.h')
-rw-r--r--src/latexdocvisitor.h84
1 files changed, 77 insertions, 7 deletions
diff --git a/src/latexdocvisitor.h b/src/latexdocvisitor.h
index de797ae..02df1ef 100644
--- a/src/latexdocvisitor.h
+++ b/src/latexdocvisitor.h
@@ -192,15 +192,85 @@ class LatexDocVisitor : public DocVisitor
bool m_hide;
bool m_hideCaption;
bool m_insideTabbing;
- bool m_insideTable;
- int m_numCols;
QStack<bool> m_enabled;
QCString m_langExt;
- RowSpanList m_rowSpans;
- int m_currentColumn;
- bool m_inRowspan;
- bool m_inColspan;
- bool m_firstRow;
+
+ struct TableState
+ {
+ TableState() : numCols(0), currentColumn(0), inRowSpan(FALSE),
+ inColSpan(FALSE), firstRow(FALSE)
+ { rowSpans.setAutoDelete(TRUE); }
+ RowSpanList rowSpans;
+ int numCols;
+ int currentColumn;
+ bool inRowSpan;
+ bool inColSpan;
+ bool firstRow;
+ };
+ QStack<TableState> m_tableStateStack; // needed for nested tables
+ RowSpanList m_emptyRowSpanList;
+
+ void pushTableState()
+ {
+ m_tableStateStack.push(new TableState);
+ }
+ void popTableState()
+ {
+ delete m_tableStateStack.pop();
+ }
+ int currentColumn() const
+ {
+ return !m_tableStateStack.isEmpty() ? m_tableStateStack.top()->currentColumn : 0;
+ }
+ void setCurrentColumn(int col)
+ {
+ if (!m_tableStateStack.isEmpty()) m_tableStateStack.top()->currentColumn = col;
+ }
+ int numCols() const
+ {
+ return !m_tableStateStack.isEmpty() ? m_tableStateStack.top()->numCols : 0;
+ }
+ void setNumCols(int num)
+ {
+ if (!m_tableStateStack.isEmpty()) m_tableStateStack.top()->numCols = num;
+ }
+ bool inRowSpan() const
+ {
+ return !m_tableStateStack.isEmpty() ? m_tableStateStack.top()->inRowSpan : FALSE;
+ }
+ void setInRowSpan(bool b)
+ {
+ if (!m_tableStateStack.isEmpty()) m_tableStateStack.top()->inRowSpan = b;
+ }
+ bool inColSpan() const
+ {
+ return !m_tableStateStack.isEmpty() ? m_tableStateStack.top()->inColSpan : FALSE;
+ }
+ void setInColSpan(bool b)
+ {
+ if (!m_tableStateStack.isEmpty()) m_tableStateStack.top()->inColSpan = b;
+ }
+ bool firstRow() const
+ {
+ return !m_tableStateStack.isEmpty() ? m_tableStateStack.top()->firstRow : FALSE;
+ }
+ void setFirstRow(bool b)
+ {
+ if (!m_tableStateStack.isEmpty()) m_tableStateStack.top()->firstRow = b;
+ }
+ const RowSpanList &rowSpans()
+ {
+ return !m_tableStateStack.isEmpty() ? m_tableStateStack.top()->rowSpans : m_emptyRowSpanList;
+ }
+ void addRowSpan(ActiveRowSpan *span)
+ {
+ if (!m_tableStateStack.isEmpty()) m_tableStateStack.top()->rowSpans.append(span);
+ }
+ bool insideTable() const
+ {
+ return !m_tableStateStack.isEmpty();
+ }
+
};
#endif