src/CutAndPaste.C
src/debug.C
src/exporter.C
-src/ext_l10n.h
-src/figureForm.C
src/figure_form.C
+src/figureForm.C
src/FontLoader.C
src/frontends/controllers/ButtonController.h
src/frontends/controllers/character.C
src/frontends/qt2/tabularcreatedlgimpl.C
src/frontends/xforms/combox.C
src/frontends/xforms/FileDialog.C
-src/frontends/xforms/FormBibitem.C
src/frontends/xforms/form_bibitem.C
-src/frontends/xforms/FormBibtex.C
+src/frontends/xforms/FormBibitem.C
src/frontends/xforms/form_bibtex.C
+src/frontends/xforms/FormBibtex.C
src/frontends/xforms/form_browser.C
-src/frontends/xforms/FormCharacter.C
src/frontends/xforms/form_character.C
-src/frontends/xforms/FormCitation.C
+src/frontends/xforms/FormCharacter.C
src/frontends/xforms/form_citation.C
-src/frontends/xforms/FormCopyright.C
+src/frontends/xforms/FormCitation.C
src/frontends/xforms/form_copyright.C
-src/frontends/xforms/FormCredits.C
+src/frontends/xforms/FormCopyright.C
src/frontends/xforms/form_credits.C
-src/frontends/xforms/FormDocument.C
+src/frontends/xforms/FormCredits.C
src/frontends/xforms/form_document.C
-src/frontends/xforms/FormError.C
+src/frontends/xforms/FormDocument.C
src/frontends/xforms/form_error.C
-src/frontends/xforms/FormExternal.C
+src/frontends/xforms/FormError.C
src/frontends/xforms/form_external.C
-src/frontends/xforms/FormFiledialog.C
+src/frontends/xforms/FormExternal.C
src/frontends/xforms/form_filedialog.C
-src/frontends/xforms/FormGraphics.C
+src/frontends/xforms/FormFiledialog.C
src/frontends/xforms/form_graphics.C
-src/frontends/xforms/FormInclude.C
+src/frontends/xforms/FormGraphics.C
src/frontends/xforms/form_include.C
-src/frontends/xforms/FormIndex.C
+src/frontends/xforms/FormInclude.C
src/frontends/xforms/form_index.C
+src/frontends/xforms/FormIndex.C
src/frontends/xforms/FormLog.C
src/frontends/xforms/FormMathsBitmap.C
-src/frontends/xforms/FormMathsDeco.C
src/frontends/xforms/form_maths_deco.C
-src/frontends/xforms/FormMathsDelim.C
+src/frontends/xforms/FormMathsDeco.C
src/frontends/xforms/form_maths_delim.C
-src/frontends/xforms/FormMathsMatrix.C
+src/frontends/xforms/FormMathsDelim.C
src/frontends/xforms/form_maths_matrix.C
-src/frontends/xforms/FormMathsPanel.C
+src/frontends/xforms/FormMathsMatrix.C
src/frontends/xforms/form_maths_panel.C
-src/frontends/xforms/FormMathsSpace.C
+src/frontends/xforms/FormMathsPanel.C
src/frontends/xforms/form_maths_space.C
-src/frontends/xforms/FormMinipage.C
+src/frontends/xforms/FormMathsSpace.C
src/frontends/xforms/form_minipage.C
-src/frontends/xforms/FormParagraph.C
+src/frontends/xforms/FormMinipage.C
src/frontends/xforms/form_paragraph.C
-src/frontends/xforms/FormPreamble.C
+src/frontends/xforms/FormParagraph.C
src/frontends/xforms/form_preamble.C
-src/frontends/xforms/FormPreferences.C
+src/frontends/xforms/FormPreamble.C
src/frontends/xforms/form_preferences.C
-src/frontends/xforms/FormPrint.C
+src/frontends/xforms/FormPreferences.C
src/frontends/xforms/form_print.C
-src/frontends/xforms/FormRef.C
+src/frontends/xforms/FormPrint.C
src/frontends/xforms/form_ref.C
-src/frontends/xforms/FormSearch.C
+src/frontends/xforms/FormRef.C
src/frontends/xforms/form_search.C
-src/frontends/xforms/FormTabular.C
+src/frontends/xforms/FormSearch.C
src/frontends/xforms/form_tabular.C
-src/frontends/xforms/FormTabularCreate.C
+src/frontends/xforms/FormTabular.C
src/frontends/xforms/form_tabular_create.C
-src/frontends/xforms/FormToc.C
+src/frontends/xforms/FormTabularCreate.C
src/frontends/xforms/form_toc.C
-src/frontends/xforms/FormUrl.C
+src/frontends/xforms/FormToc.C
src/frontends/xforms/form_url.C
+src/frontends/xforms/FormUrl.C
src/frontends/xforms/FormVCLog.C
src/frontends/xforms/input_validators.C
src/frontends/xforms/Menubar_pimpl.C
+2001-07-10 Lars Gullik Bjønnes <larsbj@birdstep.com>
+
+ * buffer.C (readLyXformat2): initailize the ert comp. variables.
+ (readLyXformat2): rename return_par to first_par, use lyxlex's
+ pushToken and remove the manual push handling.
+ (parseSingleLyXformat2Token): add another ert comp. variable:
+ in_tabular, rename return_par to first_par. handle newlines better
+
2001-07-05 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
* kbsequence.C (getiso): redirect debug info to Debug::KBMAP.
}
+// We'll remove this later. (Lgb)
+namespace {
+
+string last_inset_read;
+string inset_ert_contents;
+bool ert_active = false;
+bool in_tabular = false;
+
+} // anon
+
+
+
// candidate for move to BufferView
// (at least some parts in the beginning of the func)
//
// Returns false if "\the_end" is not read for formats >= 2.13. (Asger)
bool Buffer::readLyXformat2(LyXLex & lex, Paragraph * par)
{
+#ifdef NO_LATEX
+ inset_ert_contents.erase();
+ ert_active = false;
+ in_tabular = false;
+#endif
+
int pos = 0;
Paragraph::depth_type depth = 0;
bool the_end_read = false;
- Paragraph * return_par = 0;
+ Paragraph * first_par = 0;
LyXFont font(LyXFont::ALL_INHERIT, params.language);
if (file_format < 216 && params.language->lang() == "hebrew")
font.setLanguage(default_language);
- // If we are inserting, we cheat and get a token in advance
- bool has_token = false;
- string pretoken;
if (!par) {
par = new Paragraph;
} else {
// We are inserting into an existing document
users->text->breakParagraph(users);
- return_par = users->text->firstParagraph();
+ first_par = users->text->firstParagraph();
pos = 0;
markDirty();
// We don't want to adopt the parameters from the
// document we insert, so we skip until the text begins:
while (lex.IsOK()) {
lex.nextToken();
- pretoken = lex.GetString();
+ string const pretoken = lex.GetString();
if (pretoken == "\\layout") {
- has_token = true;
+ lex.pushToken(pretoken);
break;
}
}
}
while (lex.IsOK()) {
- if (has_token) {
- has_token = false;
- } else {
- lex.nextToken();
- pretoken = lex.GetString();
- }
+ lex.nextToken();
+ string const token = lex.GetString();
+
+ if (token.empty()) continue;
- if (pretoken.empty()) continue;
+ lyxerr[Debug::PARSER] << "Handling token: `"
+ << token << "'" << endl;
the_end_read =
- parseSingleLyXformat2Token(lex, par, return_par,
- pretoken, pos, depth,
- font
- );
+ parseSingleLyXformat2Token(lex, par, first_par,
+ token, pos, depth,
+ font);
}
- if (!return_par)
- return_par = par;
+ if (!first_par)
+ first_par = par;
- paragraph = return_par;
+ paragraph = first_par;
return the_end_read;
}
-// We'll remove this later. (Lgb)
-namespace {
-
-string last_inset_read;
-string inset_ert_contents;
-bool ert_active = false;
-
-} // anon
-
-
void Buffer::insertErtContents(Paragraph * par, int & pos,
LyXFont const & font, bool set_inactive)
{
bool
Buffer::parseSingleLyXformat2Token(LyXLex & lex, Paragraph *& par,
- Paragraph *& return_par,
+ Paragraph *& first_par,
string const & token, int & pos,
Paragraph::depth_type & depth,
LyXFont & font
++pos;
} else if (token == "\\layout") {
#ifdef NO_LATEX
+ in_tabular = false;
// Do the insetert.
insertErtContents(par, pos, font);
#endif
++pos;
} else {
#endif
- if (!return_par)
- return_par = par;
+ if (!first_par)
+ first_par = par;
else {
par = new Paragraph(par);
}
}
// Small hack so that files written with klyx will be
// parsed correctly.
- if (return_par) {
+ if (first_par) {
par->params().spacing(Spacing(tmp_space, tmp_val));
} else {
params.spacing.set(tmp_space, tmp_val);
// But insets should read it, it is a part of
// the inset isn't it? Lgb.
} else if (token == "\\begin_inset") {
+#ifdef NO_LATEX
+ insertErtContents(par, pos, font);
+#endif
readInset(lex, par, pos, font);
} else if (token == "\\SpecialChar") {
LyXLayout const & layout =
++pos;
} else if (token == "\\newline") {
#ifdef NO_LATEX
- // Since we cannot know it this is only a regular newline or a
- // tabular cell delimter we have to handle the ERT here.
- insertErtContents(par, pos, font, false);
-#endif
+
+ if (!in_tabular && ert_active) {
+ inset_ert_contents += char(Paragraph::META_NEWLINE);
+ } else {
+ // Since we cannot know it this is only a regular
+ // newline or a tabular cell delimter we have to
+ // handle the ERT here.
+ insertErtContents(par, pos, font, false);
+
+ par->insertChar(pos, Paragraph::META_NEWLINE, font);
+ ++pos;
+ }
+#else
par->insertChar(pos, Paragraph::META_NEWLINE, font);
++pos;
+#endif
} else if (token == "\\LyXTable") {
+#ifdef NO_LATEX
+ in_tabular = true;
+#endif
Inset * inset = new InsetTabular(*this);
inset->read(this, lex);
par->insertInset(pos, inset, font);
par->previous(0);
parBeforeMinipage = p;
minipar = par;
- if (!return_par || (return_par == par))
- return_par = p;
+ if (!first_par || (first_par == par))
+ first_par = p;
InsetMinipage * mini = new InsetMinipage;
mini->pos(static_cast<InsetMinipage::Position>(minipar->params().pextraAlignment()));
+2001-07-10 Lars Gullik Bjønnes <larsbj@birdstep.com>
+
+ * insetert.C (latex): handle META_NEWLINE
+
2001-07-09 Juergen Vigna <jug@sad.it>
* insetert.h: a normal InsetText can insert insets, but we won't.
{
Paragraph::size_type siz = inset.paragraph()->size();
for (Paragraph::size_type i = 0; i != siz; ++i) {
- os << inset.paragraph()->getChar(i);
+ char c = inset.paragraph()->getChar(i);
+ switch (c) {
+ case Paragraph::META_NEWLINE:
+ os << '\n';
+ break;
+ default:
+ os << c;
+ break;
+ }
}
return 1;
}