mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-27 03:36:39 +00:00
More fixes for longtable options, still more to come.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3253 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
caf1ad7d8d
commit
ff36293942
@ -370,9 +370,28 @@ void FormTabular::update()
|
|||||||
|
|
||||||
if (enable) {
|
if (enable) {
|
||||||
LyXTabular::ltType ltt;
|
LyXTabular::ltType ltt;
|
||||||
fl_set_button(longtable_options_->radio_lt_firsthead,
|
bool use_empty;
|
||||||
tabular->GetRowOfLTFirstHead(row, ltt));
|
bool row_set = tabular->GetRowOfLTHead(row, ltt);
|
||||||
if (ltt.row && !ltt.empty) {
|
fl_set_button(longtable_options_->radio_lt_head, row_set);
|
||||||
|
if (row_set) {
|
||||||
|
fl_set_button(longtable_options_->check_head_2border_above,
|
||||||
|
ltt.topDL);
|
||||||
|
fl_set_button(longtable_options_->check_head_2border_above,
|
||||||
|
ltt.topDL);
|
||||||
|
use_empty = true;
|
||||||
|
} else {
|
||||||
|
setEnabled(longtable_options_->check_head_2border_above, 0);
|
||||||
|
setEnabled(longtable_options_->check_head_2border_below, 0);
|
||||||
|
fl_set_button(longtable_options_->check_head_2border_above,0);
|
||||||
|
fl_set_button(longtable_options_->check_head_2border_above,0);
|
||||||
|
fl_set_button(longtable_options_->check_1head_empty,0);
|
||||||
|
setEnabled(longtable_options_->check_1head_empty, 0);
|
||||||
|
use_empty = false;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
row_set = tabular->GetRowOfLTFirstHead(row, ltt);
|
||||||
|
fl_set_button(longtable_options_->radio_lt_firsthead, row_set);
|
||||||
|
if (row_set && (!ltt.empty || !use_empty)) {
|
||||||
fl_set_button(longtable_options_->check_1head_2border_above,
|
fl_set_button(longtable_options_->check_1head_2border_above,
|
||||||
ltt.topDL);
|
ltt.topDL);
|
||||||
fl_set_button(longtable_options_->check_1head_2border_above,
|
fl_set_button(longtable_options_->check_1head_2border_above,
|
||||||
@ -382,39 +401,34 @@ void FormTabular::update()
|
|||||||
setEnabled(longtable_options_->check_1head_2border_below, 0);
|
setEnabled(longtable_options_->check_1head_2border_below, 0);
|
||||||
fl_set_button(longtable_options_->check_1head_2border_above,0);
|
fl_set_button(longtable_options_->check_1head_2border_above,0);
|
||||||
fl_set_button(longtable_options_->check_1head_2border_above,0);
|
fl_set_button(longtable_options_->check_1head_2border_above,0);
|
||||||
|
if (use_empty) {
|
||||||
fl_set_button(longtable_options_->check_1head_empty,ltt.empty);
|
fl_set_button(longtable_options_->check_1head_empty,ltt.empty);
|
||||||
if (ltt.empty)
|
if (ltt.empty)
|
||||||
setEnabled(longtable_options_->radio_lt_firsthead, 0);
|
setEnabled(longtable_options_->radio_lt_firsthead, 0);
|
||||||
}
|
}
|
||||||
fl_set_button(longtable_options_->radio_lt_head,
|
|
||||||
tabular->GetRowOfLTHead(row, ltt));
|
|
||||||
if (ltt.row) {
|
|
||||||
fl_set_button(longtable_options_->check_head_2border_above,
|
|
||||||
ltt.topDL);
|
|
||||||
fl_set_button(longtable_options_->check_head_2border_above,
|
|
||||||
ltt.topDL);
|
|
||||||
} else {
|
|
||||||
setEnabled(longtable_options_->check_head_2border_above, 0);
|
|
||||||
setEnabled(longtable_options_->check_head_2border_below, 0);
|
|
||||||
fl_set_button(longtable_options_->check_head_2border_above,0);
|
|
||||||
fl_set_button(longtable_options_->check_head_2border_above,0);
|
|
||||||
}
|
}
|
||||||
fl_set_button(longtable_options_->radio_lt_foot,
|
//
|
||||||
tabular->GetRowOfLTFoot(row, ltt));
|
row_set = tabular->GetRowOfLTFoot(row, ltt);
|
||||||
if (ltt.row) {
|
fl_set_button(longtable_options_->radio_lt_foot, row_set);
|
||||||
|
if (row_set) {
|
||||||
fl_set_button(longtable_options_->check_foot_2border_above,
|
fl_set_button(longtable_options_->check_foot_2border_above,
|
||||||
ltt.topDL);
|
ltt.topDL);
|
||||||
fl_set_button(longtable_options_->check_foot_2border_above,
|
fl_set_button(longtable_options_->check_foot_2border_above,
|
||||||
ltt.topDL);
|
ltt.topDL);
|
||||||
|
use_empty = true;
|
||||||
} else {
|
} else {
|
||||||
setEnabled(longtable_options_->check_foot_2border_above, 0);
|
setEnabled(longtable_options_->check_foot_2border_above, 0);
|
||||||
setEnabled(longtable_options_->check_foot_2border_below, 0);
|
setEnabled(longtable_options_->check_foot_2border_below, 0);
|
||||||
fl_set_button(longtable_options_->check_foot_2border_above,0);
|
fl_set_button(longtable_options_->check_foot_2border_above,0);
|
||||||
fl_set_button(longtable_options_->check_foot_2border_above,0);
|
fl_set_button(longtable_options_->check_foot_2border_above,0);
|
||||||
|
fl_set_button(longtable_options_->check_lastfoot_empty, 0);
|
||||||
|
setEnabled(longtable_options_->check_lastfoot_empty, 0);
|
||||||
|
use_empty = false;
|
||||||
}
|
}
|
||||||
fl_set_button(longtable_options_->radio_lt_lastfoot,
|
//
|
||||||
tabular->GetRowOfLTLastFoot(row, ltt));
|
row_set = tabular->GetRowOfLTLastFoot(row, ltt);
|
||||||
if (ltt.row && !ltt.empty) {
|
fl_set_button(longtable_options_->radio_lt_lastfoot, row_set);
|
||||||
|
if (row_set && (!ltt.empty || !use_empty)) {
|
||||||
fl_set_button(longtable_options_->check_lastfoot_2border_above,
|
fl_set_button(longtable_options_->check_lastfoot_2border_above,
|
||||||
ltt.topDL);
|
ltt.topDL);
|
||||||
fl_set_button(longtable_options_->check_lastfoot_2border_above,
|
fl_set_button(longtable_options_->check_lastfoot_2border_above,
|
||||||
@ -424,10 +438,13 @@ void FormTabular::update()
|
|||||||
setEnabled(longtable_options_->check_lastfoot_2border_below,0);
|
setEnabled(longtable_options_->check_lastfoot_2border_below,0);
|
||||||
fl_set_button(longtable_options_->check_lastfoot_2border_above, 0);
|
fl_set_button(longtable_options_->check_lastfoot_2border_above, 0);
|
||||||
fl_set_button(longtable_options_->check_lastfoot_2border_above, 0);
|
fl_set_button(longtable_options_->check_lastfoot_2border_above, 0);
|
||||||
fl_set_button(longtable_options_->check_lastfoot_empty, ltt.empty);
|
if (use_empty) {
|
||||||
|
fl_set_button(longtable_options_->check_lastfoot_empty,
|
||||||
|
ltt.empty);
|
||||||
if (ltt.empty)
|
if (ltt.empty)
|
||||||
setEnabled(longtable_options_->radio_lt_lastfoot, 0);
|
setEnabled(longtable_options_->radio_lt_lastfoot, 0);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
fl_set_button(longtable_options_->radio_lt_newpage,
|
fl_set_button(longtable_options_->radio_lt_newpage,
|
||||||
tabular->GetLTNewPage(row));
|
tabular->GetLTNewPage(row));
|
||||||
} else {
|
} else {
|
||||||
|
@ -1670,20 +1670,19 @@ bool InsetTabular::tabularFeatures(BufferView * bv, string const & what)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void checkLongtableSpecial(LyXTabular::ltType & ltt,
|
static void checkLongtableSpecial(LyXTabular::ltType & ltt,
|
||||||
string const & special,
|
string const & special, bool & flag)
|
||||||
int const row, bool const flag)
|
|
||||||
{
|
{
|
||||||
if (special == "dl_above") {
|
if (special == "dl_above") {
|
||||||
ltt.topDL = flag;
|
ltt.topDL = flag;
|
||||||
|
flag = true;
|
||||||
} else if (special == "dl_below") {
|
} else if (special == "dl_below") {
|
||||||
ltt.bottomDL = flag;
|
ltt.bottomDL = flag;
|
||||||
|
flag = true;
|
||||||
} else if (special == "empty") {
|
} else if (special == "empty") {
|
||||||
ltt.empty = flag;
|
ltt.empty = flag;
|
||||||
} else {
|
flag = false;
|
||||||
if (flag)
|
} else if (flag) {
|
||||||
ltt.row = row;
|
ltt.empty = false;
|
||||||
else
|
|
||||||
ltt.row = 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1994,29 +1993,29 @@ void InsetTabular::tabularFeatures(BufferView * bv,
|
|||||||
flag = false;
|
flag = false;
|
||||||
case LyXTabular::SET_LTFIRSTHEAD:
|
case LyXTabular::SET_LTFIRSTHEAD:
|
||||||
(void)tabular->GetRowOfLTFirstHead(row, ltt);
|
(void)tabular->GetRowOfLTFirstHead(row, ltt);
|
||||||
checkLongtableSpecial(ltt, value, row + 1, flag);
|
checkLongtableSpecial(ltt, value, flag);
|
||||||
tabular->SetLTHead(ltt, true);
|
tabular->SetLTHead(row, flag, ltt, true);
|
||||||
break;
|
break;
|
||||||
case LyXTabular::UNSET_LTHEAD:
|
case LyXTabular::UNSET_LTHEAD:
|
||||||
flag = false;
|
flag = false;
|
||||||
case LyXTabular::SET_LTHEAD:
|
case LyXTabular::SET_LTHEAD:
|
||||||
(void)tabular->GetRowOfLTHead(row, ltt);
|
(void)tabular->GetRowOfLTHead(row, ltt);
|
||||||
checkLongtableSpecial(ltt, value, row + 1, flag);
|
checkLongtableSpecial(ltt, value, flag);
|
||||||
tabular->SetLTHead(ltt, false);
|
tabular->SetLTHead(row, flag, ltt, false);
|
||||||
break;
|
break;
|
||||||
case LyXTabular::UNSET_LTFOOT:
|
case LyXTabular::UNSET_LTFOOT:
|
||||||
flag = false;
|
flag = false;
|
||||||
case LyXTabular::SET_LTFOOT:
|
case LyXTabular::SET_LTFOOT:
|
||||||
(void)tabular->GetRowOfLTFoot(row, ltt);
|
(void)tabular->GetRowOfLTFoot(row, ltt);
|
||||||
checkLongtableSpecial(ltt, value, row + 1, flag);
|
checkLongtableSpecial(ltt, value, flag);
|
||||||
tabular->SetLTFoot(ltt, false);
|
tabular->SetLTFoot(row, flag, ltt, false);
|
||||||
break;
|
break;
|
||||||
case LyXTabular::UNSET_LTLASTFOOT:
|
case LyXTabular::UNSET_LTLASTFOOT:
|
||||||
flag = false;
|
flag = false;
|
||||||
case LyXTabular::SET_LTLASTFOOT:
|
case LyXTabular::SET_LTLASTFOOT:
|
||||||
(void)tabular->GetRowOfLTLastFoot(row, ltt);
|
(void)tabular->GetRowOfLTLastFoot(row, ltt);
|
||||||
checkLongtableSpecial(ltt, value, row + 1, flag);
|
checkLongtableSpecial(ltt, value, flag);
|
||||||
tabular->SetLTFoot(ltt, true);
|
tabular->SetLTFoot(row, flag, ltt, true);
|
||||||
break;
|
break;
|
||||||
case LyXTabular::SET_LTNEWPAGE:
|
case LyXTabular::SET_LTNEWPAGE:
|
||||||
{
|
{
|
||||||
|
@ -166,10 +166,23 @@ void LyXTabular::ReadOld(Buffer const * buf, istream & is,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
getTokenValue(line, "islongtable", is_long_tabular);
|
getTokenValue(line, "islongtable", is_long_tabular);
|
||||||
getTokenValue(line, "endhead", endhead.row);
|
int hrow;
|
||||||
getTokenValue(line, "endfirsthead", endfirsthead.row);
|
int fhrow;
|
||||||
getTokenValue(line, "endfoot", endfoot.row);
|
int frow;
|
||||||
getTokenValue(line, "endlastfoot", endlastfoot.row);
|
int lfrow;
|
||||||
|
|
||||||
|
getTokenValue(line, "endhead", hrow);
|
||||||
|
getTokenValue(line, "endfirsthead", fhrow);
|
||||||
|
getTokenValue(line, "endfoot", frow);
|
||||||
|
getTokenValue(line, "endlastfoot", lfrow);
|
||||||
|
if (abs(hrow) > 0)
|
||||||
|
row_info[abs(hrow)-1].endhead = true;
|
||||||
|
if (abs(fhrow))
|
||||||
|
row_info[abs(fhrow)-1].endfirsthead = true;
|
||||||
|
if (abs(frow))
|
||||||
|
row_info[abs(frow)-1].endfoot = true;
|
||||||
|
if (abs(lfrow))
|
||||||
|
row_info[abs(lfrow)-1].endlastfoot = true;
|
||||||
|
|
||||||
for (int i = 0; i < rows_; ++i) {
|
for (int i = 0; i < rows_; ++i) {
|
||||||
l_getline(is, line);
|
l_getline(is, line);
|
||||||
|
128
src/tabular.C
128
src/tabular.C
@ -79,6 +79,10 @@ LyXTabular::rowstruct::rowstruct()
|
|||||||
bottom_line = false;
|
bottom_line = false;
|
||||||
ascent_of_row = 0;
|
ascent_of_row = 0;
|
||||||
descent_of_row = 0;
|
descent_of_row = 0;
|
||||||
|
endhead = false;
|
||||||
|
endfirsthead = false;
|
||||||
|
endfoot = false;
|
||||||
|
endlastfoot = false;
|
||||||
newpage = false;
|
newpage = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -95,7 +99,6 @@ LyXTabular::columnstruct::columnstruct()
|
|||||||
|
|
||||||
LyXTabular::lttype::lttype()
|
LyXTabular::lttype::lttype()
|
||||||
{
|
{
|
||||||
row = 0;
|
|
||||||
topDL = false;
|
topDL = false;
|
||||||
bottomDL = false;
|
bottomDL = false;
|
||||||
empty = false;
|
empty = false;
|
||||||
@ -161,14 +164,7 @@ LyXTabular & LyXTabular::operator=(LyXTabular const & lt)
|
|||||||
cell_info = lt.cell_info;
|
cell_info = lt.cell_info;
|
||||||
row_info = lt.row_info;
|
row_info = lt.row_info;
|
||||||
column_info = lt.column_info;
|
column_info = lt.column_info;
|
||||||
|
|
||||||
// long tabular stuff
|
|
||||||
SetLongTabular(lt.is_long_tabular);
|
SetLongTabular(lt.is_long_tabular);
|
||||||
endhead = lt.endhead;
|
|
||||||
endfoot = lt.endfoot;
|
|
||||||
endfirsthead = lt.endfirsthead;
|
|
||||||
endlastfoot = lt.endlastfoot;
|
|
||||||
|
|
||||||
rotate = lt.rotate;
|
rotate = lt.rotate;
|
||||||
|
|
||||||
Reinit();
|
Reinit();
|
||||||
@ -232,10 +228,6 @@ void LyXTabular::Init(int rows_arg, int columns_arg, LyXTabular const * lt)
|
|||||||
set_row_column_number_info();
|
set_row_column_number_info();
|
||||||
is_long_tabular = false;
|
is_long_tabular = false;
|
||||||
rotate = false;
|
rotate = false;
|
||||||
endhead.row = 0;
|
|
||||||
endfirsthead.row = 0;
|
|
||||||
endfoot.row = 0;
|
|
||||||
endlastfoot.row = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1119,7 +1111,7 @@ void LyXTabular::Write(Buffer const * buf, ostream & os) const
|
|||||||
{
|
{
|
||||||
// header line
|
// header line
|
||||||
os << "<lyxtabular"
|
os << "<lyxtabular"
|
||||||
<< write_attribute("version", 2)
|
<< write_attribute("version", 3)
|
||||||
<< write_attribute("rows", rows_)
|
<< write_attribute("rows", rows_)
|
||||||
<< write_attribute("columns", columns_)
|
<< write_attribute("columns", columns_)
|
||||||
<< ">\n";
|
<< ">\n";
|
||||||
@ -1127,10 +1119,16 @@ void LyXTabular::Write(Buffer const * buf, ostream & os) const
|
|||||||
os << "<features"
|
os << "<features"
|
||||||
<< write_attribute("rotate", tostr(rotate))
|
<< write_attribute("rotate", tostr(rotate))
|
||||||
<< write_attribute("islongtable", tostr(is_long_tabular))
|
<< write_attribute("islongtable", tostr(is_long_tabular))
|
||||||
<< write_attribute("endhead", endhead.row)
|
<< write_attribute("firstHeadTopDL", tostr(endfirsthead.topDL))
|
||||||
<< write_attribute("endfirsthead", endfirsthead.row)
|
<< write_attribute("firstHeadBottomDL", tostr(endfirsthead.bottomDL))
|
||||||
<< write_attribute("endfoot", endfoot.row)
|
<< write_attribute("firstHeadEmpty", tostr(endfirsthead.empty))
|
||||||
<< write_attribute("endlastfoot", endlastfoot.row)
|
<< write_attribute("headTopDL", tostr(endhead.topDL))
|
||||||
|
<< write_attribute("headBottomDL", tostr(endhead.bottomDL))
|
||||||
|
<< write_attribute("footTopDL", tostr(endfoot.topDL))
|
||||||
|
<< write_attribute("footBottomDL", tostr(endfoot.bottomDL))
|
||||||
|
<< write_attribute("lastFootTopDL", tostr(endlastfoot.topDL))
|
||||||
|
<< write_attribute("lastFootBottomDL", tostr(endlastfoot.bottomDL))
|
||||||
|
<< write_attribute("lastFootEmpty", tostr(endlastfoot.empty))
|
||||||
<< ">\n";
|
<< ">\n";
|
||||||
for (int j = 0; j < columns_; ++j) {
|
for (int j = 0; j < columns_; ++j) {
|
||||||
os << "<column"
|
os << "<column"
|
||||||
@ -1146,6 +1144,10 @@ void LyXTabular::Write(Buffer const * buf, ostream & os) const
|
|||||||
os << "<row"
|
os << "<row"
|
||||||
<< write_attribute("topline", tostr(row_info[i].top_line))
|
<< write_attribute("topline", tostr(row_info[i].top_line))
|
||||||
<< write_attribute("bottomline", tostr(row_info[i].bottom_line))
|
<< write_attribute("bottomline", tostr(row_info[i].bottom_line))
|
||||||
|
<< write_attribute("endhead", tostr(row_info[i].endhead))
|
||||||
|
<< write_attribute("endfirsthead", tostr(row_info[i].endfirsthead))
|
||||||
|
<< write_attribute("endfoot", tostr(row_info[i].endfoot))
|
||||||
|
<< write_attribute("endlastfoot", tostr(row_info[i].endlastfoot))
|
||||||
<< write_attribute("newpage", tostr(row_info[i].newpage))
|
<< write_attribute("newpage", tostr(row_info[i].newpage))
|
||||||
<< ">\n";
|
<< ">\n";
|
||||||
for (int j = 0; j < columns_; ++j) {
|
for (int j = 0; j < columns_; ++j) {
|
||||||
@ -1349,13 +1351,13 @@ void LyXTabular::Read(Buffer const * buf, LyXLex & lex)
|
|||||||
return;
|
return;
|
||||||
if (version == 1)
|
if (version == 1)
|
||||||
ReadOld(buf, is, lex, line);
|
ReadOld(buf, is, lex, line);
|
||||||
else if (version == 2)
|
else if (version >= 2)
|
||||||
ReadNew(buf, is, lex, line);
|
ReadNew(buf, is, lex, line, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void LyXTabular::ReadNew(Buffer const * buf, istream & is,
|
void LyXTabular::ReadNew(Buffer const * buf, istream & is,
|
||||||
LyXLex & lex, string const & l)
|
LyXLex & lex, string const & l, int const version)
|
||||||
{
|
{
|
||||||
string line(l);
|
string line(l);
|
||||||
int rows_arg;
|
int rows_arg;
|
||||||
@ -1373,14 +1375,37 @@ void LyXTabular::ReadNew(Buffer const * buf, istream & is,
|
|||||||
}
|
}
|
||||||
getTokenValue(line, "rotate", rotate);
|
getTokenValue(line, "rotate", rotate);
|
||||||
getTokenValue(line, "islongtable", is_long_tabular);
|
getTokenValue(line, "islongtable", is_long_tabular);
|
||||||
getTokenValue(line, "endhead", endhead.row);
|
// compatibility read for old longtable options
|
||||||
getTokenValue(line, "endfirsthead", endfirsthead.row);
|
if (version < 3) {
|
||||||
getTokenValue(line, "endfoot", endfoot.row);
|
int hrow;
|
||||||
getTokenValue(line, "endlastfoot", endlastfoot.row);
|
int fhrow;
|
||||||
endhead.row = abs(endhead.row);
|
int frow;
|
||||||
endfirsthead.row = abs(endfirsthead.row);
|
int lfrow;
|
||||||
endfoot.row = abs(endfoot.row);
|
|
||||||
endlastfoot.row = abs(endlastfoot.row);
|
getTokenValue(line, "endhead", hrow);
|
||||||
|
getTokenValue(line, "endfirsthead", fhrow);
|
||||||
|
getTokenValue(line, "endfoot", frow);
|
||||||
|
getTokenValue(line, "endlastfoot", lfrow);
|
||||||
|
if (abs(hrow) > 0)
|
||||||
|
row_info[abs(hrow)-1].endhead = true;
|
||||||
|
if (abs(fhrow))
|
||||||
|
row_info[abs(fhrow)-1].endfirsthead = true;
|
||||||
|
if (abs(frow))
|
||||||
|
row_info[abs(frow)-1].endfoot = true;
|
||||||
|
if (abs(lfrow))
|
||||||
|
row_info[abs(lfrow)-1].endlastfoot = true;
|
||||||
|
} else {
|
||||||
|
getTokenValue(line, "firstHeadTopDL", endfirsthead.topDL);
|
||||||
|
getTokenValue(line, "firstHeadBottomDL", endfirsthead.bottomDL);
|
||||||
|
getTokenValue(line, "firstHeadEmpty", endfirsthead.empty);
|
||||||
|
getTokenValue(line, "headTopDL", endhead.topDL);
|
||||||
|
getTokenValue(line, "headBottomDL", endhead.bottomDL);
|
||||||
|
getTokenValue(line, "footTopDL", endfoot.topDL);
|
||||||
|
getTokenValue(line, "footBottomDL", endfoot.bottomDL);
|
||||||
|
getTokenValue(line, "lastFootTopDL", endlastfoot.topDL);
|
||||||
|
getTokenValue(line, "lastFootBottomDL", endlastfoot.bottomDL);
|
||||||
|
getTokenValue(line, "lastFootEmpty", endlastfoot.empty);
|
||||||
|
}
|
||||||
for (int j = 0; j < columns_; ++j) {
|
for (int j = 0; j < columns_; ++j) {
|
||||||
l_getline(is,line);
|
l_getline(is,line);
|
||||||
if (!prefixIs(line,"<column")) {
|
if (!prefixIs(line,"<column")) {
|
||||||
@ -1511,10 +1536,10 @@ void LyXTabular::OldFormatRead(LyXLex & lex, string const & fl)
|
|||||||
cont_row_info = vector<int>(rows_arg);
|
cont_row_info = vector<int>(rows_arg);
|
||||||
SetLongTabular(is_long_tabular_arg);
|
SetLongTabular(is_long_tabular_arg);
|
||||||
SetRotateTabular(rotate_arg);
|
SetRotateTabular(rotate_arg);
|
||||||
endhead.row = a + 1;
|
row_info[a].endhead = true;
|
||||||
endfirsthead.row = b + 1;
|
row_info[b].endfirsthead = true;
|
||||||
endfoot.row = c + 1;
|
row_info[c].endfoot = true;
|
||||||
endlastfoot.row = d + 1;
|
row_info[d].endlastfoot = true;
|
||||||
for (i = 0; i < rows_; ++i) {
|
for (i = 0; i < rows_; ++i) {
|
||||||
a = b = c = d = e = f = g = 0;
|
a = b = c = d = e = f = g = 0;
|
||||||
is >> a >> b >> c >> d;
|
is >> a >> b >> c >> d;
|
||||||
@ -1860,20 +1885,15 @@ LyXTabular::BoxType LyXTabular::GetUsebox(int cell) const
|
|||||||
return UseParbox(cell);
|
return UseParbox(cell);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool LyXTabular::checkLTType(int row, ltType const & ltt) const
|
|
||||||
{
|
|
||||||
if (!ltt.row || (ltt.row > rows_))
|
|
||||||
return false;
|
|
||||||
return (row == (ltt.row - 1));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
void LyXTabular::SetLTHead(int row, bool flag, ltType const & hd, bool first)
|
||||||
void LyXTabular::SetLTHead(ltType const & hd, bool first)
|
|
||||||
{
|
{
|
||||||
if (first) {
|
if (first) {
|
||||||
endfirsthead = hd;
|
endfirsthead = hd;
|
||||||
|
row_info[row].endfirsthead = flag;
|
||||||
} else {
|
} else {
|
||||||
endhead = hd;
|
endhead = hd;
|
||||||
|
row_info[row].endhead = flag;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1881,23 +1901,25 @@ void LyXTabular::SetLTHead(ltType const & hd, bool first)
|
|||||||
bool LyXTabular::GetRowOfLTHead(int row, ltType & hd) const
|
bool LyXTabular::GetRowOfLTHead(int row, ltType & hd) const
|
||||||
{
|
{
|
||||||
hd = endhead;
|
hd = endhead;
|
||||||
return checkLTType(row, hd);
|
return row_info[row].endhead;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool LyXTabular::GetRowOfLTFirstHead(int row, ltType & hd) const
|
bool LyXTabular::GetRowOfLTFirstHead(int row, ltType & hd) const
|
||||||
{
|
{
|
||||||
hd = endfirsthead;
|
hd = endfirsthead;
|
||||||
return checkLTType(row, hd);
|
return row_info[row].endfirsthead;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void LyXTabular::SetLTFoot(ltType const & fd, bool last)
|
void LyXTabular::SetLTFoot(int row, bool flag, ltType const & fd, bool last)
|
||||||
{
|
{
|
||||||
if (last) {
|
if (last) {
|
||||||
endlastfoot = fd;
|
endlastfoot = fd;
|
||||||
|
row_info[row].endlastfoot = flag;
|
||||||
} else {
|
} else {
|
||||||
endfoot = fd;
|
endfoot = fd;
|
||||||
|
row_info[row].endfoot = flag;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1905,14 +1927,14 @@ void LyXTabular::SetLTFoot(ltType const & fd, bool last)
|
|||||||
bool LyXTabular::GetRowOfLTFoot(int row, ltType & fd) const
|
bool LyXTabular::GetRowOfLTFoot(int row, ltType & fd) const
|
||||||
{
|
{
|
||||||
fd = endfoot;
|
fd = endfoot;
|
||||||
return checkLTType(row, fd);
|
return row_info[row].endfoot;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool LyXTabular::GetRowOfLTLastFoot(int row, ltType & fd) const
|
bool LyXTabular::GetRowOfLTLastFoot(int row, ltType & fd) const
|
||||||
{
|
{
|
||||||
fd = endlastfoot;
|
fd = endlastfoot;
|
||||||
return checkLTType(row, fd);
|
return row_info[row].endlastfoot;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -2255,25 +2277,25 @@ int LyXTabular::Latex(Buffer const * buf,
|
|||||||
++ret;
|
++ret;
|
||||||
ret += TeXBottomHLine(os, i);
|
ret += TeXBottomHLine(os, i);
|
||||||
if (IsLongTabular()) {
|
if (IsLongTabular()) {
|
||||||
if (i == (endhead.row - 1)) {
|
if (row_info[i].endhead) {
|
||||||
if (endhead.bottomDL)
|
if (endhead.bottomDL)
|
||||||
ret += TeXBottomHLine(os, i);
|
ret += TeXBottomHLine(os, i);
|
||||||
os << "\\endhead\n";
|
os << "\\endhead\n";
|
||||||
++ret;
|
++ret;
|
||||||
}
|
}
|
||||||
if (i == (endfirsthead.row - 1)) {
|
if (row_info[i].endfirsthead) {
|
||||||
if (endfirsthead.bottomDL)
|
if (endfirsthead.bottomDL)
|
||||||
ret += TeXBottomHLine(os, i);
|
ret += TeXBottomHLine(os, i);
|
||||||
os << "\\endfirsthead\n";
|
os << "\\endfirsthead\n";
|
||||||
++ret;
|
++ret;
|
||||||
}
|
}
|
||||||
if (i == (endfoot.row - 1)) {
|
if (row_info[i].endfoot) {
|
||||||
if (endfoot.bottomDL)
|
if (endfoot.bottomDL)
|
||||||
ret += TeXBottomHLine(os, i);
|
ret += TeXBottomHLine(os, i);
|
||||||
os << "\\endfoot\n";
|
os << "\\endfoot\n";
|
||||||
++ret;
|
++ret;
|
||||||
}
|
}
|
||||||
if (i == (endlastfoot.row - 1)) {
|
if (row_info[i].endlastfoot) {
|
||||||
if (endlastfoot.bottomDL)
|
if (endlastfoot.bottomDL)
|
||||||
ret += TeXBottomHLine(os, i);
|
ret += TeXBottomHLine(os, i);
|
||||||
os << "\\endlastfoot\n";
|
os << "\\endlastfoot\n";
|
||||||
@ -2386,6 +2408,9 @@ int LyXTabular::DocBook(Buffer const * buf, ostream & os) const
|
|||||||
//+ Long Tabular case +
|
//+ Long Tabular case +
|
||||||
//+---------------------------------------------------------------------
|
//+---------------------------------------------------------------------
|
||||||
|
|
||||||
|
#warning Jose please have a look here I changed the longtable header/footer
|
||||||
|
#warning ---- options so I had to disable the docbook code (Jug 20011219)
|
||||||
|
#if 0
|
||||||
if ( IsLongTabular() ) {
|
if ( IsLongTabular() ) {
|
||||||
// Header
|
// Header
|
||||||
if(endhead.row || endfirsthead.row ) {
|
if(endhead.row || endfirsthead.row ) {
|
||||||
@ -2411,6 +2436,7 @@ int LyXTabular::DocBook(Buffer const * buf, ostream & os) const
|
|||||||
os << "</tfoot>\n";
|
os << "</tfoot>\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
//+---------------------------------------------------------------------
|
//+---------------------------------------------------------------------
|
||||||
//+ the single row and columns (cells) +
|
//+ the single row and columns (cells) +
|
||||||
//+---------------------------------------------------------------------
|
//+---------------------------------------------------------------------
|
||||||
@ -2418,8 +2444,8 @@ int LyXTabular::DocBook(Buffer const * buf, ostream & os) const
|
|||||||
os << "<tbody>\n";
|
os << "<tbody>\n";
|
||||||
for (int i = 0; i < rows_; ++i) {
|
for (int i = 0; i < rows_; ++i) {
|
||||||
if(!IsLongTabular() || (
|
if(!IsLongTabular() || (
|
||||||
i != endhead.row - 1 && i != endfirsthead.row - 1 &&
|
!row_info[i].endhead && !row_info[i].endfirsthead &&
|
||||||
i != endfoot.row - 1 && i != endlastfoot.row - 1)) {
|
!row_info[i].endfoot && !row_info[i].endlastfoot)) {
|
||||||
docbookRow( buf, os, i);
|
docbookRow( buf, os, i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -161,8 +161,6 @@ public:
|
|||||||
struct lttype {
|
struct lttype {
|
||||||
// constructor
|
// constructor
|
||||||
lttype();
|
lttype();
|
||||||
// row of the header/footer type end definition
|
|
||||||
int row;
|
|
||||||
// double borders on top
|
// double borders on top
|
||||||
bool topDL;
|
bool topDL;
|
||||||
// double borders on bottom
|
// double borders on bottom
|
||||||
@ -368,13 +366,13 @@ public:
|
|||||||
///
|
///
|
||||||
bool checkLTType(int row, ltType const &) const;
|
bool checkLTType(int row, ltType const &) const;
|
||||||
///
|
///
|
||||||
void SetLTHead(ltType const &, bool first);
|
void SetLTHead(int row, bool flag, ltType const &, bool first);
|
||||||
///
|
///
|
||||||
bool GetRowOfLTHead(int row, ltType &) const;
|
bool GetRowOfLTHead(int row, ltType &) const;
|
||||||
///
|
///
|
||||||
bool GetRowOfLTFirstHead(int row, ltType &) const;
|
bool GetRowOfLTFirstHead(int row, ltType &) const;
|
||||||
///
|
///
|
||||||
void SetLTFoot(ltType const &, bool last);
|
void SetLTFoot(int row, bool flag, ltType const &, bool last);
|
||||||
///
|
///
|
||||||
bool GetRowOfLTFoot(int row, ltType &) const;
|
bool GetRowOfLTFoot(int row, ltType &) const;
|
||||||
///
|
///
|
||||||
@ -446,14 +444,23 @@ private:
|
|||||||
///
|
///
|
||||||
rowstruct();
|
rowstruct();
|
||||||
///
|
///
|
||||||
bool top_line;
|
|
||||||
///
|
|
||||||
bool bottom_line;
|
|
||||||
///
|
|
||||||
int ascent_of_row;
|
int ascent_of_row;
|
||||||
///
|
///
|
||||||
int descent_of_row;
|
int descent_of_row;
|
||||||
|
///
|
||||||
|
bool top_line;
|
||||||
|
///
|
||||||
|
bool bottom_line;
|
||||||
/// This are for longtabulars only
|
/// This are for longtabulars only
|
||||||
|
/// a row of endhead
|
||||||
|
bool endhead;
|
||||||
|
/// a row of endfirsthead
|
||||||
|
bool endfirsthead;
|
||||||
|
/// a row of endfoot
|
||||||
|
bool endfoot;
|
||||||
|
/// row of endlastfoot
|
||||||
|
bool endlastfoot;
|
||||||
|
/// row for a pagebreak
|
||||||
bool newpage;
|
bool newpage;
|
||||||
};
|
};
|
||||||
///
|
///
|
||||||
@ -483,7 +490,7 @@ private:
|
|||||||
|
|
||||||
///
|
///
|
||||||
void ReadNew(Buffer const * buf, std::istream & is,
|
void ReadNew(Buffer const * buf, std::istream & is,
|
||||||
LyXLex & lex, string const & l);
|
LyXLex & lex, string const & l, int const version);
|
||||||
///
|
///
|
||||||
void ReadOld(Buffer const * buf, std::istream & is,
|
void ReadOld(Buffer const * buf, std::istream & is,
|
||||||
LyXLex & lex, string const & l);
|
LyXLex & lex, string const & l);
|
||||||
@ -509,16 +516,17 @@ private:
|
|||||||
bool rotate;
|
bool rotate;
|
||||||
//
|
//
|
||||||
// for long tabulars
|
// for long tabulars
|
||||||
///
|
//
|
||||||
bool is_long_tabular;
|
bool is_long_tabular;
|
||||||
/// row of endhead
|
/// endhead data
|
||||||
ltType endhead;
|
ltType endhead;
|
||||||
/// row of endfirsthead
|
/// endfirsthead data
|
||||||
ltType endfirsthead;
|
ltType endfirsthead;
|
||||||
/// row of endfoot
|
/// endfoot data
|
||||||
ltType endfoot;
|
ltType endfoot;
|
||||||
/// row of endlastfoot
|
/// endlastfoot data
|
||||||
ltType endlastfoot;
|
ltType endlastfoot;
|
||||||
|
//
|
||||||
///
|
///
|
||||||
InsetTabular * owner_;
|
InsetTabular * owner_;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user