+2001-01-11 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
+
+ * src/buffer.C (getTocList): make the method const, so that
+ InsetTOC::Ascii compiles.
+
+ * src/insets/insettoc.C (Ascii): return 0
+
+2001-01-11 Dekel Tsur <dekelts@tau.ac.il>
+
+ * src/insets/insettoc.C (Ascii): New method.
+
+ * src/lyx_main.C (init) Set first_start to false when running
+ without a GUI.
+
+2000-12-19 Dekel Tsur <dekelts@tau.ac.il>
+
+ * src/paragraph.C (TeXOnePar,SimpleTeXOnePar) Fix problem with
+ aligned paragraphs.
+
2001-01-11 Lars Gullik Bjønnes <larsbj@lyx.org>
* src/buffer.C (writeFile): add missing ' ' after lyxformat.
}
-vector<vector<Buffer::TocItem> > const Buffer::getTocList()
+vector<vector<Buffer::TocItem> > const Buffer::getTocList() const
{
int figs = 0;
int tables = 0;
TOC_LOA
};
///
- std::vector<std::vector<TocItem> > const getTocList();
+ std::vector<std::vector<TocItem> > const getTocList() const;
///
std::vector<string> const getLabelList();
#include "LyXView.h"
#include "frontends/Dialogs.h"
#include "debug.h"
+#include "buffer.h"
using std::ostream;
-
+using std::endl;
string const InsetTOC::getScreenLabel() const
{
bv->owner()->getDialogs()->showTOC( this );
}
+int InsetTOC::Ascii(Buffer const * buffer, ostream & os, int) const
+{
+ os << getScreenLabel() << endl << endl;
+
+ Buffer::TocType type;
+ string cmdname = getCmdName();
+ if (cmdname == "tableofcontents" )
+ type = Buffer::TOC_TOC;
+ else if (cmdname == "listofalgorithms" )
+ type = Buffer::TOC_LOA;
+ else if (cmdname == "listoffigures" )
+ type = Buffer::TOC_LOF;
+ else
+ type = Buffer::TOC_LOT;
+
+ vector<vector<Buffer::TocItem> > const toc_list =
+ buffer->getTocList();
+ vector<Buffer::TocItem> const & toc = toc_list[type];
+ for (vector<Buffer::TocItem>::const_iterator it = toc.begin();
+ it != toc.end(); ++it)
+ os << string(4 * it->depth, ' ') << it->str << endl;
+
+ os << endl;
+ return 0;
+}
+
int InsetTOC::Linuxdoc(Buffer const *, ostream & os) const
{
///
Inset::Code LyxCode() const;
///
+ int Ascii(Buffer const *, std::ostream &, int linelen) const;
+ ///
int Linuxdoc(Buffer const *, std::ostream &) const;
///
int DocBook(Buffer const *, std::ostream &) const;
// running in batch mode.
if (gui)
queryUserLyXDir(explicit_userdir);
+ else
+ first_start = false;
//
// Shine up lyxrc defaults
// This is necessary because LaTeX (and LyX on the screen)
// calculates the space between the baselines according
// to this font. (Matthias)
+ //
+ // Is this really needed ? (Dekel)
+ // We do not need to use to change the font for the last paragraph
+ // or for a command.
LyXFont font = getFont(bparams, Last() - 1);
- if (need_par && next) {
- if (style.resfont.size() != font.size()) {
- os << '\\'
- << font.latexSize()
- << ' ';
- }
+ bool is_command = textclasslist.Style(bparams.textclass,
+ GetLayout()).isCommand();
+ if (style.resfont.size() != font.size() && next && !is_command) {
+ if (!need_par)
+ os << "{";
+ os << "\\" << font.latexSize() << " \\par}";
+ } else if (need_par) {
os << "\\par}";
- } else if (textclasslist.Style(bparams.textclass,
- GetLayout()).isCommand()) {
- if (style.resfont.size() != font.size()) {
- os << '\\'
- << font.latexSize()
- << ' ';
- }
- os << '}';
- } else if ((style.resfont.size() != font.size()) && next){
- os << "{\\" << font.latexSize() << " \\par}";
- }
+ } else if (is_command)
+ os << "}";
if (language->babel() != doc_language->babel() &&
(!par
if (style.isCommand()) {
os << '{';
++column;
- } else if (align != LYX_ALIGN_LAYOUT) {
- os << "{\\par";
- column += 4;
+ } else if (align != LYX_ALIGN_LAYOUT && next) {
+ // We do not need \par here (Dekel)
+ // os << "{\\par";
+ os << "{";
+ ++column;
return_value = true;
}