Skip to content

Commit afd3256

Browse files
committed
Merge branch 'albert-github-feature/issue_11279'
2 parents d8e7438 + 6e3366a commit afd3256

File tree

2 files changed

+18
-14
lines changed

2 files changed

+18
-14
lines changed

src/latexdocvisitor.cpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1228,9 +1228,9 @@ void LatexDocVisitor::operator()(const DocHtmlDescData &dd)
12281228
decIndentLevel();
12291229
}
12301230

1231-
static bool tableIsNested(const DocNodeVariant *n)
1231+
bool LatexDocVisitor::isTableNested(const DocNodeVariant *n) const
12321232
{
1233-
bool isNested=FALSE;
1233+
bool isNested=m_lcg.usedTableLevel()>0;
12341234
while (n && !isNested)
12351235
{
12361236
isNested = holds_one_of_alternatives<DocHtmlTable,DocParamSect>(*n);
@@ -1239,28 +1239,28 @@ static bool tableIsNested(const DocNodeVariant *n)
12391239
return isNested;
12401240
}
12411241

1242-
static void writeStartTableCommand(TextStream &t,const DocNodeVariant *n,size_t cols)
1242+
void LatexDocVisitor::writeStartTableCommand(const DocNodeVariant *n,size_t cols)
12431243
{
1244-
if (tableIsNested(n))
1244+
if (isTableNested(n))
12451245
{
1246-
t << "{\\begin{tabularx}{\\linewidth}{|*{" << cols << "}{>{\\raggedright\\arraybackslash}X|}}";
1246+
m_t << "{\\begin{tabularx}{\\linewidth}{|*{" << cols << "}{>{\\raggedright\\arraybackslash}X|}}";
12471247
}
12481248
else
12491249
{
1250-
t << "\\tabulinesep=1mm\n\\begin{longtabu}spread 0pt [c]{*{" << cols << "}{|X[-1]}|}\n";
1250+
m_t << "\\tabulinesep=1mm\n\\begin{longtabu}spread 0pt [c]{*{" << cols << "}{|X[-1]}|}\n";
12511251
}
12521252
//return isNested ? "TabularNC" : "TabularC";
12531253
}
12541254

1255-
static void writeEndTableCommand(TextStream &t,const DocNodeVariant *n)
1255+
void LatexDocVisitor::writeEndTableCommand(const DocNodeVariant *n)
12561256
{
1257-
if (tableIsNested(n))
1257+
if (isTableNested(n))
12581258
{
1259-
t << "\\end{tabularx}}\n";
1259+
m_t << "\\end{tabularx}}\n";
12601260
}
12611261
else
12621262
{
1263-
t << "\\end{longtabu}\n";
1263+
m_t << "\\end{longtabu}\n";
12641264
}
12651265
//return isNested ? "TabularNC" : "TabularC";
12661266
}
@@ -1281,7 +1281,7 @@ void LatexDocVisitor::operator()(const DocHtmlTable &t)
12811281
m_t << "\n";
12821282
}
12831283

1284-
writeStartTableCommand(m_t,t.parent(),t.numColumns());
1284+
writeStartTableCommand(t.parent(),t.numColumns());
12851285

12861286
if (c)
12871287
{
@@ -1302,14 +1302,14 @@ void LatexDocVisitor::operator()(const DocHtmlTable &t)
13021302
if (firstRow && firstRow->isHeading())
13031303
{
13041304
setFirstRow(TRUE);
1305-
if (!tableIsNested(t.parent()))
1305+
if (!isTableNested(t.parent()))
13061306
{
13071307
std::visit(*this,*t.firstRow());
13081308
}
13091309
setFirstRow(FALSE);
13101310
}
13111311
visitChildren(t);
1312-
writeEndTableCommand(m_t,t.parent());
1312+
writeEndTableCommand(t.parent());
13131313
popTableState();
13141314
}
13151315

@@ -1381,7 +1381,7 @@ void LatexDocVisitor::operator()(const DocHtmlRow &row)
13811381
m_t << "\n";
13821382

13831383
const DocNodeVariant *n = ::parent(row.parent());
1384-
if (row.isHeading() && row.rowIndex()==1 && !tableIsNested(n))
1384+
if (row.isHeading() && row.rowIndex()==1 && !isTableNested(n))
13851385
{
13861386
if (firstRow())
13871387
{

src/latexdocvisitor.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,5 +266,9 @@ class LatexDocVisitor : public DocVisitor
266266
return !m_tableStateStack.empty();
267267
}
268268

269+
bool isTableNested(const DocNodeVariant *n) const;
270+
void writeStartTableCommand(const DocNodeVariant *n,size_t cols);
271+
void writeEndTableCommand(const DocNodeVariant *n);
272+
269273
};
270274
#endif

0 commit comments

Comments
 (0)