]> git.lyx.org Git - lyx.git/commitdiff
Cleanup
authorDekel Tsur <dekelts@tau.ac.il>
Tue, 13 Mar 2001 13:53:58 +0000 (13:53 +0000)
committerDekel Tsur <dekelts@tau.ac.il>
Tue, 13 Mar 2001 13:53:58 +0000 (13:53 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1752 a592a061-630c-0410-9148-cb99ea01b6c8

src/ChangeLog
src/buffer.C
src/buffer.h

index b05af8ac0df13e2cf88bddfdcf46d3a5aa2255a4..3e854ead793092b3e4f3de0d1a5afbc4e3cb5fc1 100644 (file)
@@ -1,3 +1,7 @@
+2001-03-13  Dekel Tsur  <dekelts@tau.ac.il>
+
+       * buffer.C (getLists): Cleanup.
+
 2001-03-13  Jean-Marc Lasgouttes  <Jean-Marc.Lasgouttes@inria.fr>
 
        * lyxfont.C (update): don't honor toggleall on font size.
index 4264360e02ea6ff8b7f51f5c3fa60ca7b02691f2..c87c2db1510ba05d4e8d9218bcac2bff01ba8f3f 100644 (file)
@@ -3636,11 +3636,9 @@ Buffer::Lists const Buffer::getLists() const
                                }
                                if (!type.empty()) {
                                        SingleList & item = l[type];
-                                       TocItem tmp;
-                                       tmp.par = par;
-                                       tmp.depth = 0;
-                                       tmp.str = tostr(item.size()+1) + ". " + par->String(this, false);
-                                       item.push_back(tmp);
+                                       string const str =
+                                               tostr(item.size()+1) + ". " + par->String(this, false);
+                                       item.push_back(TocItem(par, 0, str));
                                }
                        }
                } else if (!par->IsDummy()) {
@@ -3653,13 +3651,10 @@ Buffer::Lists const Buffer::getLists() const
                            && labeltype <= LABEL_COUNTER_CHAPTER + params.tocdepth) {
                                // insert this into the table of contents
                                SingleList & item = l["TOC"];
-                               TocItem tmp;
-                               tmp.par = par;
-                               tmp.depth = max(0,
+                               int depth = max(0,
                                                labeltype - 
                                                textclasslist.TextClass(params.textclass).maxcounter());
-                               tmp.str = par->String(this, true);
-                               item.push_back(tmp);
+                               item.push_back(TocItem(par, depth, par->String(this, true)));
                        }
 #ifdef NEW_INSETS
                        // For each paragrph, traverse its insets and look for
@@ -3685,11 +3680,9 @@ Buffer::Lists const Buffer::getLists() const
                                                while (tmp) {
                                                        if (tmp->layout == cap) {
                                                                SingleList & item = l[type];
-                                                               TocItem ti;
-                                                               ti.par = tmp;
-                                                               ti.depth = 0;
-                                                               ti.str = tostr(item.size()+1) + ". " + tmp->String(this, false);
-                                                               item.push_back(ti);
+                                                               string const str =
+                                                                       tostr(item.size()+1) + ". " + tmp->String(this, false);
+                                                               item.push_back(TocItem(tmp, 0 , str));
                                                        }
                                                        tmp = tmp->next();
                                                }
index 3e522952d5d9af4b5d834a2e2826989959254307..69fc7a3dc2f872ce39b2b3a36922e6f84b21af77 100644 (file)
@@ -265,6 +265,8 @@ public:
        std::vector<std::pair<string, string> > const getBibkeyList();
        ///
        struct TocItem {
+               TocItem(LyXParagraph * p, int d, string const & s)
+                       : par(p), depth(d), str(s) {}
                ///
                LyXParagraph * par;
                ///