@@ -1187,9 +1187,9 @@ void LatexDocVisitor::operator()(const DocHtmlDescData &dd)
11871187 decIndentLevel ();
11881188}
11891189
1190- static bool tableIsNested (const DocNodeVariant *n)
1190+ static bool tableIsNested (const DocNodeVariant *n,LatexCodeGenerator &m_lcg )
11911191{
1192- bool isNested=FALSE ;
1192+ bool isNested=m_lcg. usedTableLevel ()> 0 ;
11931193 while (n && !isNested)
11941194 {
11951195 isNested = holds_one_of_alternatives<DocHtmlTable,DocParamSect>(*n);
@@ -1198,9 +1198,9 @@ static bool tableIsNested(const DocNodeVariant *n)
11981198 return isNested;
11991199}
12001200
1201- static void writeStartTableCommand (TextStream &t,const DocNodeVariant *n,size_t cols)
1201+ static void writeStartTableCommand (TextStream &t,const DocNodeVariant *n,size_t cols,LatexCodeGenerator &m_lcg )
12021202{
1203- if (tableIsNested (n))
1203+ if (tableIsNested (n,m_lcg ))
12041204 {
12051205 t << " {\\ begin{tabularx}{\\ linewidth}{|*{" << cols << " }{>{\\ raggedright\\ arraybackslash}X|}}" ;
12061206 }
@@ -1211,9 +1211,9 @@ static void writeStartTableCommand(TextStream &t,const DocNodeVariant *n,size_t
12111211 // return isNested ? "TabularNC" : "TabularC";
12121212}
12131213
1214- static void writeEndTableCommand (TextStream &t,const DocNodeVariant *n)
1214+ static void writeEndTableCommand (TextStream &t,const DocNodeVariant *n,LatexCodeGenerator &m_lcg )
12151215{
1216- if (tableIsNested (n))
1216+ if (tableIsNested (n,m_lcg ))
12171217 {
12181218 t << " \\ end{tabularx}}\n " ;
12191219 }
@@ -1240,7 +1240,7 @@ void LatexDocVisitor::operator()(const DocHtmlTable &t)
12401240 m_t << " \n " ;
12411241 }
12421242
1243- writeStartTableCommand (m_t ,t.parent (),t.numColumns ());
1243+ writeStartTableCommand (m_t ,t.parent (),t.numColumns (),m_lcg );
12441244
12451245 if (c)
12461246 {
@@ -1261,14 +1261,14 @@ void LatexDocVisitor::operator()(const DocHtmlTable &t)
12611261 if (firstRow && firstRow->isHeading ())
12621262 {
12631263 setFirstRow (TRUE );
1264- if (!tableIsNested (t.parent ()))
1264+ if (!tableIsNested (t.parent (),m_lcg ))
12651265 {
12661266 std::visit (*this ,*t.firstRow ());
12671267 }
12681268 setFirstRow (FALSE );
12691269 }
12701270 visitChildren (t);
1271- writeEndTableCommand (m_t ,t.parent ());
1271+ writeEndTableCommand (m_t ,t.parent (),m_lcg );
12721272 popTableState ();
12731273}
12741274
@@ -1340,7 +1340,7 @@ void LatexDocVisitor::operator()(const DocHtmlRow &row)
13401340 m_t << " \n " ;
13411341
13421342 const DocNodeVariant *n = ::parent (row.parent ());
1343- if (row.isHeading () && row.rowIndex ()==1 && !tableIsNested (n))
1343+ if (row.isHeading () && row.rowIndex ()==1 && !tableIsNested (n,m_lcg ))
13441344 {
13451345 if (firstRow ())
13461346 {
0 commit comments