using std::endl;
using std::fstream;
using std::ios;
+using std::lower_bound;
+using std::upper_bound;
int tex_code_break_column = 72; // needs non-zero initialization. set later.
// this is a bad idea, but how can LyXParagraph find its buffer to get
os << "\n\\hfill \n";
column = 0;
break;
-#if 0
- case META_PROTECTED_SEPARATOR:
- os << "\n\\protected_separator \n";
- column = 0;
- break;
-#endif
case '\\':
os << "\n\\backslash \n";
column = 0;
noindent = false;
pextra_type = PEXTRA_NONE;
- pextra_width.clear();
- pextra_widthp.clear();
+ pextra_width.erase();
+ pextra_widthp.erase();
pextra_alignment = MINIPAGE_ALIGN_TOP;
pextra_hfill = false;
pextra_start_minipage = false;
- labelstring.clear();
- labelwidthstring.clear();
+ labelstring.erase();
+ labelwidthstring.erase();
layout = 0;
bibkey = 0;
"there is an inset in position: " << pos << endl;
else
insetlist.insert(it, InsetTable(pos,inset));
+ if (inset_owner)
+ inset->setOwner(inset_owner);
}
}
* npar = 0;
par->layout = new_layout;
- par->labelwidthstring.clear();
+ par->labelwidthstring.erase();
par->align = LYX_ALIGN_LAYOUT;
par->added_space_top = VSpace(VSpace::NONE);
par->added_space_bottom = VSpace(VSpace::NONE);
if (!spacing.isDefault()
&& (!Previous() || !Previous()->HasSameLayout(this))) {
- os << "\\begin{spacing}{"
- << spacing.getValue() << "}\n";
+ os << spacing.writeEnvirBegin() << "\n";
texrow.newline();
}
|| par->pextra_type != pextra_type))
break;
default:
- if (!(footnoteflag != LyXParagraph::NO_FOOTNOTE
+ // we don't need it for the last paragraph!!!
+ if (next && !(footnoteflag != LyXParagraph::NO_FOOTNOTE
&& footnotekind != LyXParagraph::FOOTNOTE
&& footnotekind != LyXParagraph::MARGIN
&& (table
if (!spacing.isDefault()
&& (!par || !par->HasSameLayout(this))) {
- os << "\\end{spacing}\n";
+ os << spacing.writeEnvirEnd() << "\n";
texrow.newline();
}
- if (!(footnoteflag != LyXParagraph::NO_FOOTNOTE && par &&
+ // we don't need it for the last paragraph!!!
+ if (next && !(footnoteflag != LyXParagraph::NO_FOOTNOTE && par &&
par->footnoteflag == LyXParagraph::NO_FOOTNOTE)) {
os << '\n';
texrow.newline();
bool retval = false;
switch (c) {
case LyXParagraph::META_HFILL:
- sgml_string.clear();
- break;
-#if 0
- case LyXParagraph::META_PROTECTED_SEPARATOR:
- sgml_string = ' ';
+ sgml_string.erase();
break;
-#endif
case LyXParagraph::META_NEWLINE:
sgml_string = '\n';
break;
sgml_string = ' ';
break;
case '\0': // Ignore :-)
- sgml_string.clear();
+ sgml_string.erase();
break;
default:
sgml_string = c;
&& running_font.isRightToLeft()) {
os << "\\L{";
close = true;
- } else if (inset->LyxCode() == Inset::NUMBER_CODE
- && running_font.isRightToLeft()) {
- os << "{\\beginL ";
- close = true;
}
int tmp = inset->Latex(os, style.isCommand(),
style.free_spacing);
if (close)
- if (inset->LyxCode() == Inset::NUMBER_CODE)
- os << "\\endL}";
- else
- os << "}";
+ os << "}";
if (tmp) {
column = 0;
// but I'll leave it as a switch statement
// so its simpler to extend. (ARRae)
switch (c) {
-#if 0
- case LyXParagraph::META_PROTECTED_SEPARATOR:
- os << ' ';
- break;
-#endif
default:
// make sure that we will not print
// error generating chars to the tex
} else {
// Plain mode (i.e. not LaTeX)
switch (c) {
-#if 0
- case LyXParagraph::META_PROTECTED_SEPARATOR:
- os << '~';
- break;
-#endif
case '\\':
os << "\\textbackslash{}";
column += 15;
switch (c) {
case LyXParagraph::META_INSET:
if ((inset = GetInset(i))) {
-#if 1
#ifdef HAVE_SSTREAM
stringstream ss(ios::in | ios::out);
- inset->Latex(ss, -1);
+ inset->Ascii(ss);
ss.seekp(0);
ss.get(c);
while (!ss) {
}
#else
strstream ss;
- inset->Latex(ss, -1);
+ inset->Ascii(ss);
ss.seekp(0);
ss.get(c);
while (!ss) {
ss.get(c);
}
delete [] ss.str();
-#endif
-#else
- fstream fs(fname2.c_str(),
- ios::in|ios::out);
- if (!fs) {
- WriteAlert(_("LYX_ERROR:"),
- _("Cannot open temporary file:"),
- fname2);
- return false;
- }
- inset->Latex(fs, -1);
- fs.seekp(0);
- fs.get(c);
- while (!fs) {
- if (c == '\\')
- os << "\\\\";
- else
- os << c;
- fs.get(c);
- }
- fs.close();
#endif
}
break;
break;
case LyXParagraph::META_HFILL:
break;
-#if 0
- case LyXParagraph::META_PROTECTED_SEPARATOR:
- break;
-#endif
case '\\':
os << "\\\\";
break;
lyxerr[Debug::LATEX] << "TeXDeeper... " << this << endl;
LyXParagraph * par = this;
- while (par && par->depth == depth) {
+ while (par &&
+ (par->depth == depth) &&
+ (par->footnoteflag == footnoteflag)) {
if (par->IsDummy())
lyxerr << "ERROR (LyXParagraph::TeXDeeper)" << endl;
if (textclasslist.Style(current_view->buffer()->params.textclass,
} while (par
&& par->layout == layout
&& par->depth == depth
- && par->pextra_type == pextra_type);
+ && par->pextra_type == pextra_type
+ && par->footnoteflag == footnoteflag);
if (style.isEnvironment()) {
os << "\\end{" << style.latexname() << '}';
return;
pextra_type = PEXTRA_NONE;
- pextra_width.clear();
- pextra_widthp.clear();
+ pextra_width.erase();
+ pextra_widthp.erase();
if (textclasslist.Style(current_view->buffer()->params.textclass,
layout).isEnvironment()) {
while (par && (par->layout == layout)
&& (par->depth == depth)) {
par->pextra_type = PEXTRA_NONE;
- par->pextra_width.clear();
- par->pextra_widthp.clear();
+ par->pextra_width.erase();
+ par->pextra_widthp.erase();
par = par->NextAfterFootnote();
if (par && (par->depth > depth))
par->UnsetPExtraType();
LyXFont font = GetFontSettings(i);
if (font.language() == from) {
font.setLanguage(to);
- SetFont(i,font);
+ SetFont(i, font);
}
}
}