#include "lyxrc.h"
#include "layout.h"
#include "tex-strings.h"
+#include "buffer.h"
#include "bufferparams.h"
#include "support/FileInfo.h"
#include "support/LAssert.h"
BufferParams const & params,
char footflag, char dth) const
{
- if (
#ifndef NEW_INSETS
+ if (
footnoteflag != LyXParagraph::NO_FOOTNOTE ||
-#endif
!previous
-#ifndef NEW_INSETS
|| previous->footnoteflag == LyXParagraph::NO_FOOTNOTE
-#endif
) {
-
+#endif
+
#ifndef NEW_INSETS
// The beginning or the end of a footnote environment?
if (footflag != footnoteflag) {
}
os << '\n';
}
- } else {
#ifndef NEW_INSETS
+ } else {
// Dummy layout. This means that a footnote ended.
os << "\n\\end_float ";
footflag = LyXParagraph::NO_FOOTNOTE;
-#else
- lyxerr << "Why don't we have a previous?" << endl;
-#endif
}
-#ifndef NEW_TABULAR
+#endif
+#ifndef NEW_TABULAR
// It might be a table.
if (table){
os << "\\LyXTable\n";
break;
}
}
-
+
// now write the next paragraph
if (next)
next->writeFile(buf, os, params, footflag, dth);
(*cit).inset->Validate(features);
}
+#ifndef NEW_TABULAR
if (table && table->IsLongTable())
features.longtable = true;
+#endif
if (pextra_type == PEXTRA_INDENT)
features.LyXParagraphIndent = true;
if (pextra_type == PEXTRA_FLOATFLT)
if (params.paragraph_separation == BufferParams::PARSEP_INDENT
&& pextra_type == LyXParagraph::PEXTRA_MINIPAGE)
features.NeedLyXMinipageIndent = true;
+#ifndef NEW_TABULAR
if (table && table->NeedRotating())
features.rotating = true;
+#endif
#ifndef NEW_INSETS
if (footnoteflag != NO_FOOTNOTE && footnotekind == ALGORITHM)
features.algorithm = true;
void LyXParagraph::Erase(LyXParagraph::size_type pos)
{
+#ifndef NEW_INSETS
// > because last is the next unused position, and you can
// use it if you want
if (pos > size()) {
-#ifndef NEW_INSETS
if (next && next->footnoteflag == LyXParagraph::CLOSED_FOOTNOTE)
NextAfterFootnote()->Erase(pos - text.size() - 1);
else
-#endif
lyxerr.debug() << "ERROR (LyXParagraph::Erase): "
"position does not exist." << endl;
return;
}
+#else
+ Assert(pos < size());
+#endif
+#ifndef NEW_INSETS
if (pos < size()) { // last is free for insertation, but should be empty
+#endif
// if it is an inset, delete the inset entry
if (text[pos] == LyXParagraph::META_INSET) {
// find the entry
}
// Update all other entries.
- for (; it != fontlist.end(); ++it)
+ FontList::iterator fend = fontlist.end();
+ for (; it != fend; ++it)
--(*it).pos;
// Update the inset table.
InsetTable search_inset(pos, 0);
+ InsetList::iterator lend = insetlist.end();
for (InsetList::iterator it =
upper_bound(insetlist.begin(),
- insetlist.end(),
+ lend,
search_inset, matchIT());
- it != insetlist.end(); ++it)
+ it != lend; ++it)
--(*it).pos;
+#ifndef NEW_INSETS
} else {
lyxerr << "ERROR (LyXParagraph::Erase): "
"can't erase non-existant char." << endl;
}
+#endif
}
LyXParagraph::value_type c,
LyXFont const & font)
{
+#ifndef NEW_INSETS
// > because last is the next unused position, and you can
// use it if you want
if (pos > size()) {
-#ifndef NEW_INSETS
if (next
&& next->footnoteflag == LyXParagraph::CLOSED_FOOTNOTE)
NextAfterFootnote()->InsertChar(pos - text.size() - 1,
c);
else
-#endif
lyxerr.debug() << "ERROR (LyXParagraph::InsertChar): "
"position does not exist." << endl;
return;
}
+#else
+ Assert(pos <= size());
+#endif
text.insert(text.begin() + pos, c);
// Update the font table.
FontTable search_font(pos, LyXFont());
{
Assert(inset);
+#ifndef NEW_INSETS
// > because last is the next unused position, and you can
// use it if you want
if (pos > size()) {
-#ifndef NEW_INSETS
if (next
&& next->footnoteflag == LyXParagraph::CLOSED_FOOTNOTE)
NextAfterFootnote()
->InsertInset(pos - text.size() - 1,
inset, font);
else
-#endif
lyxerr << "ERROR (LyXParagraph::InsertInset): "
"position does not exist: " << pos << endl;
return;
}
+#else
+ Assert(pos <= size());
+#endif
InsertChar(pos, META_INSET, font);
Assert(text[pos] == META_INSET);
bool LyXParagraph::InsertInsetAllowed(Inset * inset)
{
- lyxerr << "LyXParagraph::InsertInsetAllowed" << endl;
+ //lyxerr << "LyXParagraph::InsertInsetAllowed" << endl;
if (inset_owner)
return inset_owner->InsertInsetAllowed(inset);
Inset * LyXParagraph::GetInset(LyXParagraph::size_type pos)
{
- if (pos >= size()) {
#ifndef NEW_INSETS
+ if (pos >= size()) {
if (next
&& next->footnoteflag == LyXParagraph::CLOSED_FOOTNOTE)
return NextAfterFootnote()
->GetInset(pos - text.size() - 1);
else
-#endif
lyxerr << "ERROR (LyXParagraph::GetInset): "
"position does not exist: "
<< pos << endl;
return 0;
}
+#else
+ Assert(pos < size());
+#endif
// Find the inset.
InsetTable search_inset(pos, 0);
InsetList::iterator it = lower_bound(insetlist.begin(),
Inset const * LyXParagraph::GetInset(LyXParagraph::size_type pos) const
{
- if (pos >= size()) {
#ifndef NEW_INSETS
+ if (pos >= size()) {
if (next
&& next->footnoteflag == LyXParagraph::CLOSED_FOOTNOTE)
return NextAfterFootnote()
->GetInset(pos - text.size() - 1);
else
-#endif
lyxerr << "ERROR (LyXParagraph::GetInset): "
"position does not exist: "
<< pos << endl;
return 0;
}
+#else
+ Assert(pos < size());
+#endif
// Find the inset.
InsetTable search_inset(pos, 0);
InsetList::const_iterator cit = lower_bound(insetlist.begin(),
LyXFont LyXParagraph::GetFontSettings(BufferParams const & bparams,
LyXParagraph::size_type pos) const
{
+#ifdef NEW_INSETS
+ Assert(pos <= size());
+#endif
+#ifndef NEW_INSETS
if (pos < size()) {
+#endif
FontTable search_font(pos, LyXFont());
FontList::const_iterator cit = lower_bound(fontlist.begin(),
fontlist.end(),
search_font, matchFT());
if (cit != fontlist.end())
return (*cit).font;
+#ifndef NEW_INSETS
}
+#endif
+#ifndef NEW_INSETS
// > because last is the next unused position, and you can
// use it if you want
else if (pos > size()) {
-#ifndef NEW_INSETS
if (next
&& next->footnoteflag == LyXParagraph::CLOSED_FOOTNOTE)
return NextAfterFootnote()
->GetFontSettings(bparams,
pos - text.size() - 1);
else
-#endif
// Why is it an error to ask for the font of a
// position that does not exist? Would it be
// enough for this to be enabled on debug?
"position does not exist. "
<< pos << " (" << static_cast<int>(pos)
<< ")" << endl;
- } else if (pos > 0) {
+ }
+ else if (pos > 0) {
+ return GetFontSettings(bparams, pos - 1);
+ }
+#else
+ if (pos == size() && size())
return GetFontSettings(bparams, pos - 1);
- } else // pos = size() = 0
- return LyXFont(LyXFont::ALL_INHERIT, getParLanguage(bparams));
+#endif
+ //else
+ // pos = size() = 0
+ return LyXFont(LyXFont::ALL_INHERIT, getParLanguage(bparams));
- return LyXFont(LyXFont::ALL_INHERIT);
+ //return LyXFont(LyXFont::ALL_INHERIT);
}
// Gets uninstantiated font setting at position 0
LyXParagraph::value_type
-LyXParagraph::GetChar(LyXParagraph::size_type pos)
+LyXParagraph::GetChar(LyXParagraph::size_type pos) const
{
- Assert(pos >= 0);
-
- if (pos < size()) {
- return text[pos];
- }
- // > because last is the next unused position, and you can
- // use it if you want
- else if (pos > size()) {
-#ifndef NEW_INSETS
- if (next && next->footnoteflag != LyXParagraph::NO_FOOTNOTE)
- return NextAfterFootnote()
- ->GetChar(pos - text.size() - 1);
- else
-#endif
- {
- lyxerr << "ERROR (LyXParagraph::GetChar): "
- "position does not exist."
- << pos << " (" << static_cast<int>(pos)
- << ")\n";
- // Assert(false); // This triggers sometimes...
- // Why?
- }
-
- return '\0';
- }
-
#ifndef NEW_INSETS
- else {
- // We should have a footnote environment.
- if (!next || next->footnoteflag == LyXParagraph::NO_FOOTNOTE) {
- // Notice that LyX does request the
- // last char from time to time. (Asger)
- //lyxerr << "ERROR (LyXParagraph::GetChar): "
- // "expected footnote." << endl;
- return '\0';
- }
- switch (next->footnotekind) {
- case LyXParagraph::FOOTNOTE:
- return LyXParagraph::META_FOOTNOTE;
- case LyXParagraph::MARGIN:
- return LyXParagraph::META_MARGIN;
- case LyXParagraph::FIG:
- case LyXParagraph::WIDE_FIG:
- return LyXParagraph::META_FIG;
- case LyXParagraph::TAB:
- case LyXParagraph::WIDE_TAB:
- return LyXParagraph::META_TAB;
- case LyXParagraph::ALGORITHM:
- return LyXParagraph::META_ALGORITHM;
- }
- return '\0'; // to shut up gcc
- }
+ Assert(pos >= 0);
#else
- return '\0'; // to shut up gcc
+ Assert(pos <= size());
+ if (!size() || pos == size()) return '\0';
#endif
-}
-
-
-LyXParagraph::value_type
-LyXParagraph::GetChar(LyXParagraph::size_type pos) const
-{
- Assert(pos >= 0);
+#ifndef NEW_INSETS
if (pos < size()) {
+#endif
return text[pos];
+#ifndef NEW_INSETS
}
+#endif
+#ifndef NEW_INSETS
// > because last is the next unused position, and you can
// use it if you want
else if (pos > size()) {
-#ifndef NEW_INSETS
if (next && next->footnoteflag != LyXParagraph::NO_FOOTNOTE)
return NextAfterFootnote()
->GetChar(pos - text.size() - 1);
else
-#endif
{
lyxerr << "ERROR (LyXParagraph::GetChar const): "
"position does not exist."
Assert(false);
}
return '\0';
- }
-#ifndef NEW_INSETS
- else {
+ } else {
// We should have a footnote environment.
if (!next || next->footnoteflag == LyXParagraph::NO_FOOTNOTE) {
// Notice that LyX does request the
}
return '\0'; // to shut up gcc
}
-#else
- return '\0'; // to shut up gcc
-
#endif
}
// return an string of the current word, and the end of the word in lastpos.
string LyXParagraph::GetWord(LyXParagraph::size_type & lastpos) const
{
- Assert(lastpos>=0);
+ Assert(lastpos >= 0);
// the current word is defined as starting at the first character
// from the immediate left of lastpospos which meets the definition
}
-
+
+#ifdef NEW_INSETS
+#warning Remember to get rid of this one. (Lgb)
+#endif
LyXParagraph::size_type LyXParagraph::Last() const
{
#ifndef NEW_INSETS
}
+#ifndef NEW_INSETS
LyXParagraph * LyXParagraph::ParFromPos(LyXParagraph::size_type pos)
{
// > because last is the next unused position, and you can
// use it if you want
if (pos > size()) {
-#ifndef NEW_INSETS
if (next
&& next->footnoteflag == LyXParagraph::CLOSED_FOOTNOTE)
return NextAfterFootnote()
->ParFromPos(pos - text.size() - 1);
else
-#endif
lyxerr << "ERROR (LyXParagraph::ParFromPos): "
"position does not exist." << endl;
return this;
} else
return this;
}
+#endif
+#ifndef NEW_INSETS
int LyXParagraph::PositionInParFromPos(LyXParagraph::size_type pos) const
{
// > because last is the next unused position, and you can
// use it if you want
if (pos > size()) {
-#ifndef NEW_INSETS
if (next
&& next->footnoteflag == LyXParagraph::CLOSED_FOOTNOTE)
return NextAfterFootnote()
->PositionInParFromPos(pos - text.size() - 1);
else
-#endif
lyxerr <<
"ERROR (LyXParagraph::PositionInParFromPos): "
"position does not exist." << endl;
else
return pos;
}
+#endif
void LyXParagraph::SetFont(LyXParagraph::size_type pos,
LyXFont const & font)
{
+#ifndef NEW_INSETS
// > because last is the next unused position, and you can
// use it if you want
if (pos > size()) {
-#ifndef NEW_INSETS
if (next &&
next->footnoteflag == LyXParagraph::CLOSED_FOOTNOTE) {
NextAfterFootnote()->SetFont(pos - text.size() - 1,
font);
} else
-#endif
lyxerr << "ERROR (LyXParagraph::SetFont): "
"position does not exist." << endl;
return;
}
+#else
+ Assert(pos <= size());
+#endif
// First, reduce font against layout/label font
// Update: The SetCharFont() routine in text2.C already
LyXParagraph::size_type pos,
int flag)
{
- size_type i, j, pos_end, pos_first;
+ size_type i;
+ size_type j;
// create a new paragraph
- LyXParagraph * par = ParFromPos(pos);
#ifndef NEW_INSETS
+ size_type pos_end;
+ size_type pos_first;
+ LyXParagraph * par = ParFromPos(pos);
LyXParagraph * firstpar = FirstPhysicalPar();
-#else
- LyXParagraph * firstpar = this;
-#endif
LyXParagraph * tmp = new LyXParagraph(par);
+#else
+ //LyXParagraph * par = this;
+ //LyXParagraph * firstpar = this;
+ LyXParagraph * tmp = new LyXParagraph(this);
+#endif
#ifndef NEW_INSETS
tmp->footnoteflag = footnoteflag;
#endif
// this is an idea for a more userfriendly layout handling, I will
// see what the users say
-
+
+#ifndef NEW_INSETS
// layout stays the same with latex-environments
if (flag) {
tmp->SetOnlyLayout(bparams, firstpar->layout);
tmp->SetLabelWidthString(firstpar->labelwidthstring);
}
-
+#else
+ // layout stays the same with latex-environments
+ if (flag) {
+ tmp->SetOnlyLayout(bparams, layout);
+ tmp->SetLabelWidthString(labelwidthstring);
+ }
+#endif
+#ifndef NEW_INSETS
if (Last() > pos || !Last() || flag == 2) {
tmp->SetOnlyLayout(bparams, firstpar->layout);
tmp->align = firstpar->align;
tmp->depth = firstpar->depth;
tmp->noindent = firstpar->noindent;
-
+#else
+ if (Last() > pos || !Last() || flag == 2) {
+ tmp->SetOnlyLayout(bparams, layout);
+ tmp->align = align;
+ tmp->SetLabelWidthString(labelwidthstring);
+
+ tmp->line_bottom = line_bottom;
+ line_bottom = false;
+ tmp->pagebreak_bottom = pagebreak_bottom;
+ pagebreak_bottom = false;
+ tmp->added_space_bottom = added_space_bottom;
+ added_space_bottom = VSpace(VSpace::NONE);
+
+ tmp->depth = depth;
+ tmp->noindent = noindent;
+#endif
// copy everything behind the break-position
// to the new paragraph
+#ifndef NEW_INSETS
pos_first = 0;
while (ParFromPos(pos_first) != par)
++pos_first;
-
pos_end = pos_first + par->text.size() - 1;
+
for (i = j = pos; i <= pos_end; ++i) {
par->CutIntoMinibuffer(bparams, i - pos_first);
if (tmp->InsertFromMinibuffer(j - pos))
par->Erase(i - pos_first);
par->text.resize(par->text.size());
+#else
+ size_type pos_end = text.size() - 1;
+
+ for (i = j = pos; i <= pos_end; ++i) {
+ CutIntoMinibuffer(bparams, i);
+ if (tmp->InsertFromMinibuffer(j - pos))
+ ++j;
+ }
+ tmp->fitToSize();
+ for (i = pos_end; i >= pos; --i)
+ Erase(i);
+
+ fitToSize();
+#endif
}
+#ifndef NEW_INSETS
// just an idea of me
if (!pos) {
tmp->line_top = firstpar->line_top;
firstpar->depth = tmp->depth;
}
}
+#else
+ // just an idea of me
+ if (!pos) {
+ tmp->line_top = line_top;
+ tmp->pagebreak_top = pagebreak_top;
+ tmp->added_space_top = added_space_top;
+ tmp->bibkey = bibkey;
+ Clear();
+ // layout stays the same with latex-environments
+ if (flag) {
+ SetOnlyLayout(bparams, tmp->layout);
+ SetLabelWidthString(tmp->labelwidthstring);
+ depth = tmp->depth;
+ }
+ }
+#endif
}
#ifndef NEW_INSETS
!IsDummy() &&
#endif
- !table){
+#ifndef NEW_TABULAR
+ !table
+#else
+ true
+#endif
+ ){
while (Last()
&& (IsNewline(0) || IsLineSeparator(0))){
Erase(0);
result->inset_owner = inset_owner;
// ale970302
- result->bibkey = (bibkey) ? new InsetBibKey(bibkey): 0;
-
+ if (bibkey)
+ result->bibkey = static_cast<InsetBibKey *>(bibkey->Clone());
+ else
+ result->bibkey = 0;
// copy everything behind the break-position to the new paragraph
void LyXParagraph::BreakParagraphConservative(BufferParams const & bparams,
LyXParagraph::size_type pos)
{
+#ifndef NEW_INSETS
// create a new paragraph
LyXParagraph * par = ParFromPos(pos);
par->text.resize(par->text.size());
}
+#else
+ // create a new paragraph
+ LyXParagraph * tmp = new LyXParagraph(this);
+ tmp->MakeSameLayout(this);
+
+ // When can pos > Last()?
+ // I guess pos == Last() is possible.
+ if (Last() > pos) {
+ // copy everything behind the break-position to the new
+ // paragraph
+ size_type pos_end = text.size() - 1;
+
+ size_type i, j;
+ for (i = j = pos; i <= pos_end; ++i) {
+ CutIntoMinibuffer(bparams, i);
+ if (tmp->InsertFromMinibuffer(j - pos))
+ ++j;
+ }
+
+ tmp->fitToSize();
+
+ for (size_type i = pos_end; i >= pos; --i)
+ Erase(i);
+
+ fitToSize();
+ }
+#endif
}
// Be carefull, this does not make any check at all.
+// This method has wrong name, it combined this par with the next par.
+// In that sense it is the reverse of break paragraph. (Lgb)
void LyXParagraph::PasteParagraph(BufferParams const & bparams)
{
// copy the next paragraph to this one
LyXParagraph * the_next = Next();
#ifndef NEW_INSETS
LyXParagraph * firstpar = FirstPhysicalPar();
-#else
- LyXParagraph * firstpar = this;
#endif
// first the DTP-stuff
+#ifndef NEW_INSETS
firstpar->line_bottom = the_next->line_bottom;
firstpar->added_space_bottom = the_next->added_space_bottom;
firstpar->pagebreak_bottom = the_next->pagebreak_bottom;
+#else
+ line_bottom = the_next->line_bottom;
+ added_space_bottom = the_next->added_space_bottom;
+ pagebreak_bottom = the_next->pagebreak_bottom;
+#endif
size_type pos_end = the_next->text.size() - 1;
size_type pos_insert = Last();
int LyXParagraph::GetPositionOfInset(Inset * inset) const
{
// Find the entry.
- // We could use lower_bound here too, we just need to add
- // the approp. operator() to matchIT (and change the name
- // of that struct). Code would then be:
- // InsetList::const_iterator cit = lower_bound(insetlist.begin(),
- // insetlist.end(),
- // inset, matchIT());
- // if ((*cit).inset == inset) {
- // return (*cit).pos;
- // }
for (InsetList::const_iterator cit = insetlist.begin();
cit != insetlist.end(); ++cit) {
if ((*cit).inset == inset) {
default:
// we don't need it for the last paragraph!!!
if (next
- && !(
#ifndef NEW_INSETS
- footnoteflag != LyXParagraph::NO_FOOTNOTE
+ && !( footnoteflag != LyXParagraph::NO_FOOTNOTE
&& footnotekind != LyXParagraph::FOOTNOTE
- && footnotekind != LyXParagraph::MARGIN &&
+ && footnotekind != LyXParagraph::MARGIN)
#endif
- (table
+#ifndef NEW_TABULAR
+ && !(table
|| (par
- && par->table)))) {
+ && par->table))
+#endif
+ ) {
// don't insert this if we would be adding it
// before or after a table in a float. This
// little trick is needed in order to allow
// Fully instantiated font
LyXFont font = getFont(bparams, i);
+#ifndef NEW_INSETS
LyXParagraph * p = 0;
if (i == 0
-#ifndef NEW_INSETS
&& previous &&
previous->footnoteflag != LyXParagraph::NO_FOOTNOTE &&
(p = PreviousBeforeFootnote()) != 0)
-#else
- && (p = previous))
-#endif
last_font = p->getFont(bparams, p->size() - 1);
else
+#endif
last_font = running_font;
// Spaces at end of font change are simulated to be
}
+#ifndef NEW_TABULAR
// This one spits out the text of a table paragraph
bool LyXParagraph::SimpleTeXOneTablePar(Buffer const * buf,
BufferParams const & bparams,
lyxerr[Debug::LATEX] << "SimpleTeXOneTablePar...done " << this << endl;
return return_value;
}
+#endif
+#ifndef NEW_TABULAR
// This one spits out the text off ContRows in tables
bool LyXParagraph::TeXContTableRows(Buffer const * buf,
BufferParams const & bparams,
lyxerr[Debug::LATEX] << "TeXContTableRows...done " << this << endl;
return return_value;
}
+#endif
bool LyXParagraph::linuxDocConvertChar(char c, string & sgml_string)
}
+#ifndef NEW_TABULAR
void LyXParagraph::SimpleDocBookOneTablePar(Buffer const * buffer,
ostream & os, string & extra,
int & desc_on, int depth)
lyxerr[Debug::LATEX] << "SimpleDocbookOneTablePar...done "
<< this << endl;
}
+#endif
+#ifndef NEW_TABULAR
void LyXParagraph::DocBookContTableRows(Buffer const * buffer,
ostream & os, string & extra,
int & desc_on,
}
lyxerr[Debug::LATEX] << "DocBookContTableRows...done " << this << endl;
}
+#endif
void LyXParagraph::SimpleTeXBlanks(ostream & os, TexRow & texrow,
LyXParagraph * LyXParagraph::TeXDeeper(Buffer const * buf,
BufferParams const & bparams,
- ostream & os, TexRow & texrow,
- ostream & foot,
+ ostream & os, TexRow & texrow
+#ifndef NEW_INSETS
+ ,ostream & foot,
TexRow & foot_texrow,
- int & foot_count)
+ int & foot_count
+#endif
+ )
{
lyxerr[Debug::LATEX] << "TeXDeeper... " << this << endl;
LyXParagraph * par = this;
par->layout).isEnvironment()
|| par->pextra_type != PEXTRA_NONE) {
par = par->TeXEnvironment(buf, bparams,
- os, texrow,
- foot, foot_texrow,
- foot_count);
+ os, texrow
+#ifndef NEW_INSETS
+ ,foot, foot_texrow,
+ foot_count
+#endif
+ );
} else {
par = par->TeXOnePar(buf, bparams,
os, texrow, false
LyXParagraph * LyXParagraph::TeXEnvironment(Buffer const * buf,
BufferParams const & bparams,
- ostream & os, TexRow & texrow,
- ostream & foot,
+ ostream & os, TexRow & texrow
+#ifndef NEW_INSETS
+ ,ostream & foot,
TexRow & foot_texrow,
- int & foot_count)
+ int & foot_count
+#endif
+ )
{
bool eindent_open = false;
+#ifndef NEW_INSETS
bool foot_this_level = false;
+#endif
// flags when footnotetext should be appended to file.
static bool minipage_open = false;
static int minipage_open_depth = 0;
if (par && par->depth > depth) {
if (textclasslist.Style(bparams.textclass,
par->layout).isParagraph()
+#ifndef NEW_TABULAR
&& !par->table
+#endif
// Thinko!
// How to handle this? (Lgb)
//&& !suffixIs(os, "\n\n")
os << '\n';
texrow.newline();
}
- par = par->TeXDeeper(buf, bparams, os, texrow,
- foot, foot_texrow, foot_count);
+ par = par->TeXDeeper(buf, bparams, os, texrow
+#ifndef NEW_INSETS
+ ,foot, foot_texrow, foot_count
+#endif
+ );
}
if (par && par->layout == layout && par->depth == depth &&
(par->pextra_type == PEXTRA_MINIPAGE) && !minipage_open) {
if (style.isEnvironment()) {
os << "\\end{" << style.latexname() << '}';
+#ifndef NEW_INSETS
// maybe this should go after the minipage closes?
if (foot_this_level) {
if (foot_count >= 1) {
foot_count = 0;
}
}
+#endif
}
if (minipage_open && (minipage_open_depth == depth) &&
(!par || par->pextra_start_minipage ||
if (textclasslist.Style(bparams.textclass,
layout).isEnvironment()) {
- LyXParagraph
- * par = this,
- * ppar = par;
+ LyXParagraph * par = this;
+ LyXParagraph * ppar = par;
while (par && (par->layout == layout)
&& (par->depth == depth)) {
if (textclasslist.Style(bparams.textclass,
layout).isEnvironment()) {
- LyXParagraph
- * par = this,
- * ppar = par;
+ LyXParagraph * par = this;
+ LyXParagraph * ppar = par;
while (par && (par->layout == layout)
&& (par->depth == depth)) {
return false;
// We want to pass the ' and escape chars to ispell
string extra = lyxrc.isp_esc_chars + '\'';
- char ch[2];
- ch[0] = c;
- ch[1] = 0;
+ char ch[2] = { c, 0 };
return contains(extra, ch);
}
#endif
else if (previous)
return previous->getParLanguage(bparams);
- else
+ //else
return bparams.language_info;
}
bool LyXParagraph::isRightToLeftPar(BufferParams const & bparams) const
{
- return lyxrc.rtl_support && !table
+ return lyxrc.rtl_support
+#ifndef NEW_TABULAR
+ && !table
+#endif
&& getParLanguage(bparams)->RightToLeft();
}
bool LyXParagraph::isMultiLingual(BufferParams const & bparams)
{
- Language const * doc_language =
- bparams.language_info;
- for(size_type i = 0; i < size(); ++i) {
- LyXFont font = GetFontSettings(bparams, i);
- if (font.language() != doc_language)
+ Language const * doc_language = bparams.language_info;
+ for (FontList::const_iterator cit = fontlist.begin();
+ cit != fontlist.end(); ++cit)
+ if ((*cit).font.language() != doc_language)
return true;
- }
return false;
}
LyXParagraph::size_type end)
{
string s;
+#ifndef NEW_TABULAR
int actcell = 0;
int cell = 1;
-#ifndef NEW_TABULAR
if (table)
for (LyXParagraph::size_type i = 0; i < beg; ++i)
if (IsNewline(i)) {
ost << '\0';
#endif
s += ost.str();
- } else if (table && IsNewlineChar(c)) {
+ }
+#ifndef NEW_TABULAR
+ else if (table && IsNewlineChar(c)) {
if (cell >= table->NumberOfCellsInRow(actcell)) {
s += '\n';
cell = 1;
}
++actcell;
}
+#endif
}
return s;