]> git.lyx.org Git - lyx.git/blobdiff - src/buffer.C
Converter patch from Dekel, Preference patch from Angus, menu patch from Rob
[lyx.git] / src / buffer.C
index 152f7de180b9a29babbcf5eaaa0ab1dc60c33e76..1d7973a8ffaf92dc301684eecedea860244f5022 100644 (file)
@@ -1289,7 +1289,7 @@ void Buffer::writeFileAscii(string const & fname, int linelen)
                return;
        }
 
-       string const fname1 = TmpFileName();
+       string const fname1 = lyx::tempName(); //TmpFileName();
        LyXParagraph * par = paragraph;
        while (par) {
                int noparbreak = 0;
@@ -1647,7 +1647,7 @@ string const Buffer::asciiParagraph(LyXParagraph const * par,
                        if ((inset = par->GetInset(i))) {
                                if (!inset->Ascii(this, buffer)) {
                                        string dummy;
-                                       string s = rsplit(buffer.str(),
+                                       string s = rsplit(buffer.str().c_str(),
                                                          dummy, '\n');
                                        currlinelen += s.length();
                                } else {
@@ -1698,7 +1698,7 @@ string const Buffer::asciiParagraph(LyXParagraph const * par,
                        break;
                }
        }
-       return buffer.str();
+       return buffer.str().c_str();
 }
 
 
@@ -3547,6 +3547,9 @@ vector<string> const Buffer::getLabelList()
 
 vector<vector<Buffer::TocItem> > const Buffer::getTocList()
 {
+       int figs = 0;
+       int tables = 0;
+       int algs = 0;
        vector<vector<TocItem> > l(4);
        LyXParagraph * par = paragraph;
        while (par) {
@@ -3562,13 +3565,19 @@ vector<vector<Buffer::TocItem> > const Buffer::getTocList()
                                switch (par->footnotekind) {
                                case LyXParagraph::FIG:
                                case LyXParagraph::WIDE_FIG:
+                                       tmp.str = tostr(++figs) + ". "
+                                               + tmp.str;
                                        l[TOC_LOF].push_back(tmp);
                                        break;
                                case LyXParagraph::TAB:
                                case LyXParagraph::WIDE_TAB:
+                                       tmp.str = tostr(++tables) + ". "
+                                               + tmp.str;
                                        l[TOC_LOT].push_back(tmp);
                                        break;
                                case LyXParagraph::ALGORITHM:
+                                       tmp.str = tostr(++algs) + ". "
+                                               + tmp.str;
                                        l[TOC_LOA].push_back(tmp);
                                        break;
                                case LyXParagraph::FOOTNOTE: