X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ftabular.C;h=68696aadd9d5457263079e8d33861969064b21eb;hb=29f01faa17495e3d80c08f234c8f049c7d699ac1;hp=7f05319dbdf454f72bca1bde9462e9287e1c771e;hpb=be1bd533f37a3eb73b915c83edd55a7afab1f144;p=lyx.git diff --git a/src/tabular.C b/src/tabular.C index 7f05319dbd..68696aadd9 100644 --- a/src/tabular.C +++ b/src/tabular.C @@ -25,7 +25,7 @@ #include "layout.h" #include "buffer.h" #include "BufferView.h" -#include "Painter.h" +#include "frontends/Painter.h" #include "LaTeXFeatures.h" #include "insets/insettabular.h" #include "insets/insettext.h" @@ -35,11 +35,12 @@ #include "frontends/Alert.h" #include "gettext.h" #include "tabular_funcs.h" -#include "lyxtextclasslist.h" +#include "lyxlex.h" #include #include +using std::abs; using std::ostream; using std::istream; using std::getline; @@ -471,7 +472,7 @@ bool LyXTabular::LeftLine(int cell, bool onlycolumn) const #ifdef SPECIAL_COLUM_HANDLING if (cellinfo_of_cell(cell)->align_special.empty()) return cellinfo_of_cell(cell)->left_line; - return prefixIs(frontStrip(cellinfo_of_cell(cell)->align_special), "|"); + return prefixIs(ltrim(cellinfo_of_cell(cell)->align_special), "|"); #else return cellinfo_of_cell(cell)->left_line; #endif @@ -479,7 +480,7 @@ bool LyXTabular::LeftLine(int cell, bool onlycolumn) const #ifdef SPECIAL_COLUM_HANDLING if (column_info[column_of_cell(cell)].align_special.empty()) return column_info[column_of_cell(cell)].left_line; - return prefixIs(frontStrip(column_info[column_of_cell(cell)].align_special), "|"); + return prefixIs(ltrim(column_info[column_of_cell(cell)].align_special), "|"); #else return column_info[column_of_cell(cell)].left_line; #endif @@ -494,7 +495,7 @@ bool LyXTabular::RightLine(int cell, bool onlycolumn) const #ifdef SPECIAL_COLUM_HANDLING if (cellinfo_of_cell(cell)->align_special.empty()) return cellinfo_of_cell(cell)->right_line; - return suffixIs(strip(cellinfo_of_cell(cell)->align_special), "|"); + return suffixIs(rtrim(cellinfo_of_cell(cell)->align_special), "|"); #else return cellinfo_of_cell(cell)->right_line; #endif @@ -502,7 +503,7 @@ bool LyXTabular::RightLine(int cell, bool onlycolumn) const #ifdef SPECIAL_COLUM_HANDLING if (column_info[column_of_cell(cell)].align_special.empty()) return column_info[right_column_of_cell(cell)].right_line; - return suffixIs(strip(column_info[column_of_cell(cell)].align_special), "|"); + return suffixIs(rtrim(column_info[column_of_cell(cell)].align_special), "|"); #else return column_info[right_column_of_cell(cell)].right_line; #endif @@ -1448,7 +1449,8 @@ void LyXTabular::OldFormatRead(BufferParams const & bp, Paragraph * par = new Paragraph; Paragraph * return_par = 0; - par->layout(textclasslist[bp.textclass].defaultLayoutName()); + par->layout(bp.getLyXTextClass().defaultLayout()); + string tmptok; int pos = 0; Paragraph::depth_type depth = 0; @@ -1461,23 +1463,13 @@ void LyXTabular::OldFormatRead(BufferParams const & bp, if (token.empty()) continue; if (token == "\\layout" - || token == "\\end_float" + || token == "\\end_float" // this should not exist anymore + || token == "\\end_inset" // as it is substituted by this || token == "\\end_deeper") { lex.pushToken(token); -#ifndef NO_COMPABILITY - // Here we need to insert the inset_ert_contents into the last - // cell of the tabular. - owner_->bufferOwner()->insertErtContents(par, pos); -#endif break; } -#ifndef NO_COMPABILITY - if (token == "\\newline") - // Here we need to insert the inset_ert_contents into the last - // cell of the tabular. - owner_->bufferOwner()->insertErtContents(par, pos, false); -#endif if (owner_->bufferOwner()->parseSingleLyXformat2Token(lex, par, return_par, token, pos, @@ -2205,7 +2197,7 @@ int LyXTabular::TeXRow(ostream & os, int const i, Buffer const * buf, InsetText * inset = GetCellInset(cell); bool rtl = inset->paragraph()->isRightToLeftPar(buf->params) && - inset->paragraph()->size() > 0 && GetPWidth(cell).zero(); + !inset->paragraph()->empty() && GetPWidth(cell).zero(); if (rtl) os << "\\R{"; @@ -2360,7 +2352,7 @@ int LyXTabular::docbookRow(Buffer const * buf, ostream & os, int row) const } os << ">"; - ret += GetCellInset(cell)->docbook(buf, os); + ret += GetCellInset(cell)->docbook(buf, os, true); os << "\n"; ++cell; } @@ -2369,7 +2361,8 @@ int LyXTabular::docbookRow(Buffer const * buf, ostream & os, int row) const } -int LyXTabular::docBook(Buffer const * buf, ostream & os) const +int LyXTabular::docbook(Buffer const * buf, ostream & os, + bool /*mixcont*/) const { int ret = 0; @@ -2410,7 +2403,7 @@ int LyXTabular::docBook(Buffer const * buf, ostream & os) const ret += docbookRow(buf, os, i); } } - os << "\n"; + os << "\n"; ++ret; } // output footer info