]> git.lyx.org Git - features.git/commitdiff
more changes to get insetfloat working + some other things. Read the ChangeLog
authorLars Gullik Bjønnes <larsbj@gullik.org>
Tue, 18 Jul 2000 17:45:27 +0000 (17:45 +0000)
committerLars Gullik Bjønnes <larsbj@gullik.org>
Tue, 18 Jul 2000 17:45:27 +0000 (17:45 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@897 a592a061-630c-0410-9148-cb99ea01b6c8

16 files changed:
ChangeLog
src/FloatList.C
src/LyXAction.C
src/Variables.C
src/Variables.h
src/buffer.C
src/commandtags.h
src/insets/insetcaption.C
src/insets/insetcaption.h
src/insets/insetfloat.C
src/insets/insetfloat.h
src/insets/insettext.C
src/insets/insettext.h
src/insets/lyxinset.h
src/lyxfunc.C
src/text2.C

index 108fdc6d2945a37cb9669059f1ef20875c22942e..ce40cad40074fe6ed38cbec0934b7d8f2bde779f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,29 @@
+2000-07-18  Lars Gullik Bjønnes  <larsbj@lyx.org>
+
+       * src/insets/lyxinset.h: add caption code
+
+       * src/insets/insetfloat.C (type): new method
+
+       * src/insets/insetcaption.C (Write): new method
+       (Read): new method
+       (LyxCode): new method
+
+       * src/text2.C (SetCounter): revert Jürgens code, but use his idea
+       to get it right together with using the FloatList.
+
+       * src/commandtags.h: add LFUN_INSET_CAPTION
+       * src/lyxfunc.C (Dispatch): handle it
+
+       * src/buffer.C (parseSingleLyXformat2Token): add code to read a
+       caption inset.
+
+       * src/Variables.[Ch]: make expand take a const reference, remove
+       the destructor, some whitespace changes.
+
+       * src/LyXAction.C (init): add caption-inset-insert
+
+       * src/FloatList.C (FloatList): update the default floats a bit.
+
 2000-07-17  Jean-Marc Lasgouttes  <Jean-Marc.Lasgouttes@inria.fr>
 
        * src/Variables.[Ch]: new files. Intended to be used for language
index 61ac278a5dd067a6b62cd874c4c1baf9d29ca350..fbbfa370a0caf7a0db3223272e3cfa40a3033da6 100644 (file)
@@ -11,20 +11,20 @@ FloatList::FloatList()
        // Insert the latex builtin float-types
        Floating table;
        table.type = "table";
-       table.placement = "";
+       table.placement = "htbp";
        table.ext = "lot";
        table.within = "";
-       table.style = "";
-       table.name = "";
+       table.style = "plain";
+       table.name = "Table";
        table.builtin = true;
        list[table.type] = table;
        Floating figure;
        figure.type = "figure";
-       figure.placement = "";
+       figure.placement = "htbp";
        figure.ext = "lof";
        figure.within = "";
-       figure.style = "";
-       figure.name = "";
+       figure.style = "plain";
+       figure.name = "Figure";
        figure.builtin = true;
        list[figure.type] = figure;
        // And we add algorithm too since LyX has
index e80964dae06087131d2363e558b1262b89e2f06e..5edf46727c07c46ae7db2f66ebb443ca70de5717 100644 (file)
@@ -400,6 +400,7 @@ void LyXAction::init()
                { LFUN_INSET_FLOAT, "float-inset-insert", "", Noop },
                { LFUN_INSET_LIST, "list-inset-insert", "", Noop },
                { LFUN_INSET_THEOREM, "theorem-inset-insert", "", Noop },
+               { LFUN_INSET_CAPTION, "caption-inset-insert", "", Noop },
                { LFUN_NOACTION, "", "", Noop }
        };
 
index 128f5538b5c12d0024c50604bbad1600b232ecec..9f4a516e3829a372d77bd8fbb833849281c8030c 100644 (file)
@@ -17,7 +17,8 @@
 #include "Variables.h"
 #include "support/LRegex.h"
 
-void Variables::set(string const &var, string const &val)
+
+void Variables::set(string const & var, string const & val)
 {
   Vars::const_iterator cit = vars_.find(var);
   if (cit != vars_.end()) 
@@ -26,7 +27,7 @@ void Variables::set(string const &var, string const &val)
 }
 
 
-string Variables::get(string const &var) const
+string Variables::get(string const & var) const
 {
   Vars::const_iterator cit = vars_.find(var);
   if (cit != vars_.end()) 
@@ -35,14 +36,17 @@ string Variables::get(string const &var) const
     return string();
 }
 
+
 bool Variables::isset(string const & var) const
 {
    Vars::const_iterator cit = vars_.find(var);
    return  (cit != vars_.end()); 
 }
 
-string Variables::expand(string str) const
+
+string Variables::expand(string const & s) const
 {
+  string str(s);
   LRegex reg("\\$\\{\\(.*\\)\\}");
 
   if (!reg.exact_match(str))
index 5ffce6057a179d710094f773c7f37b301f031895..617a740785f33ae3b4e7c140573c3861cff78cfe 100644 (file)
 #include <map>
 
 
+///
 class Variables {
 public:
-  virtual ~Variables() { };
-  // 
+  /// 
   void set(string const &, string const &);
-  // 
+  /// 
   virtual string get(string const &) const;
-  //
+  ///
   bool isset(string const & var) const;
-  // 
-  string expand(string) const;
+  /// 
+  string expand(string const &) const;
 private:
-  //
-  typedef std::map<string,string> Vars;
-  //
+  ///
+  typedef std::map<string, string> Vars;
+  ///
   Vars vars_;
 };
 
index 40889f032dd2086ed8d3f5b0e36c92c72712537a..48c62c5263a6b819517829969ab5f7b0813b34df 100644 (file)
@@ -72,6 +72,7 @@
 #include "insets/insetlist.h"
 #include "insets/insettabular.h"
 #include "insets/insettheorem.h"
+#include "insets/insetcaption.h"
 #include "support/filetools.h"
 #include "support/path.h"
 #include "LaTeX.h"
@@ -896,6 +897,11 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, LyXParagraph *& par,
                        inset->Read(this, lex);
                        par->InsertInset(pos, inset, font);
                        ++pos;
+               } else if (tmptok == "Caption") {
+                       Inset * inset = new InsetCaption;
+                       inset->Read(this, lex);
+                       par->InsertInset(pos, inset, font);
+                       ++pos;
                } else if (tmptok == "GRAPHICS") {
                        Inset * inset = new InsetGraphics;
                                //inset->Read(this, lex);
index e857e4fef498368c3d51538a6e775443e835bff5..0be43d8e752f17507117f9354e074e6588054985 100644 (file)
@@ -261,6 +261,7 @@ enum kb_action {
        LFUN_INSET_LIST,                // Lgb 20000627
        LFUN_INSET_THEOREM,             // Lgb 20000630
        LFUN_CREATE_CITATION,           // Angus 20000705
+       LFUN_INSET_CAPTION,            // Lgb 20000718
        LFUN_LASTACTION  /* this marks the end of the table */
 };
 
index 8d89efaad5cc3acc71b824c5df66c76e8adb7501..cdc24d9faefb3acee65897926340518d6a65ef6f 100644 (file)
 #endif
 
 #include "insetcaption.h"
+#include "debug.h"
+
+void InsetCaption::Write(Buffer const * buf, ostream & os) const
+{
+       os << "Caption\n";
+       WriteParagraphData(buf, os);
+}
+
+
+
+void InsetCaption::Read(Buffer const * buf, LyXLex & lex)
+{
+       string token = lex.GetString();
+       if (token != "Caption") {
+               lyxerr << "InsetCaption::Read: consistency check failed."
+                      << endl;
+       }
+       InsetText::Read(buf, lex);
+}
index 328c7aa6c17278e97cb4ef36b232ba574f435309..f122fc427092e8ba5c7efb9d9c7fd55b083ef302 100644 (file)
 */
 class InsetCaption : public InsetText {
 public:
+       ///
+       void Write(Buffer const * buf, std::ostream & os) const;
+       ///
+       void Read(Buffer const * buf, LyXLex & lex);
+       ///
+       Inset::Code LyxCode() const {
+               return CAPTION_CODE;
+       }
 protected:
 private:
 };
index b4792cf16dd737cc7b6fcae86020775f9af4e548..827e73ad2f75651414f02ad2ebc3d157ade5475f 100644 (file)
@@ -194,6 +194,12 @@ void InsetFloat::InsetButtonRelease(BufferView * bv, int x, int y, int button)
 }
 
 
+string const & InsetFloat::type() const 
+{
+       return floatType;
+}
+
+
 void InsetFloat::wide(bool w)
 {
        wide_ = w;
index 62e51aae9eed9e80d70e31ef877700f3159ad1c3..3fca507bb127cd284da788a7816ad327cc75c313 100644 (file)
@@ -46,6 +46,8 @@ public:
        ///
        void InsetButtonRelease(BufferView * bv, int x, int y, int button);
        ///
+       string const & type() const;
+       ///
        void wide(bool w);
        ///
        bool wide() const;
index d38d9da270f010c8fc9629beb07698b2fd2756cb..08bd8260d6c0105503502dbea094adf03eab4bc2 100644 (file)
@@ -599,7 +599,9 @@ void InsetText::InsetButtonRelease(BufferView * bv, int x, int y, int button)
     UpdatableInset * inset = 0;
 
     if (the_locking_inset) {
-           the_locking_inset->InsetButtonRelease(bv, x-inset_x, y-inset_y,button);
+           the_locking_inset->InsetButtonRelease(bv,
+                                                 x - inset_x, y - inset_y,
+                                                 button);
     } else {
        if (cpar(bv)->GetChar(cpos(bv)) == LyXParagraph::META_INSET) {
            inset = static_cast<UpdatableInset*>(cpar(bv)->GetInset(cpos(bv)));
index b5dab5d5f171fa10cfcf23bacd74fb8bcb7e2885..a848bc55d5fbbc3fa8d2ba73f73cbae6a459d8fb 100644 (file)
@@ -154,9 +154,11 @@ public:
 //    LyXFont GetDrawFont(BufferView *, LyXParagraph *, int pos) const;
     ///
     LyXText * getLyXText(BufferView *) const;
+    ///
     void deleteLyXText(BufferView *, bool recursive=true) const;
+    ///
     void resizeLyXText(BufferView *) const;
-
+    ///
     LyXParagraph * par;
     ///
     mutable UpdateCodes need_update;
@@ -164,11 +166,13 @@ public:
 protected:
     ///
     void UpdateLocal(BufferView *, UpdateCodes, bool mark_dirty);
-
+    ///
     mutable int drawTextXOffset;
+    ///
     mutable int drawTextYOffset;
     ///
     bool autoBreakRows;
+    ///
     DrawFrame drawFrame;
     ///
     LColor::color frame_color;
@@ -198,13 +202,18 @@ private:
     string getText(int);
     ///
     bool checkAndActivateInset(BufferView * bv, bool behind);
+    ///
     bool checkAndActivateInset(BufferView * bv, int x = 0, int y = 0,
                               int button = 0);
     ///
     int cx(BufferView *) const;
+    ///
     int cy(BufferView *) const;
+    ///
     int cpos(BufferView *) const;
+    ///
     LyXParagraph * cpar(BufferView *) const;
+    ///
     Row * crow(BufferView *) const;
 
     /// This instead of a macro
@@ -217,10 +226,15 @@ private:
     mutable bool locked;
     ///
     mutable int insetAscent;
+    ///
     mutable int insetDescent;
+    ///
     mutable int insetWidth;
+    ///
     mutable int last_width;
+    ///
     mutable int last_height;
+    ///
     mutable int top_y;
     ///
     LyXParagraph * inset_par;
index 792756a862f86c5b20c6475ef76ed77d35e7ae25..05a9b7586b0aeac1fb9120ba2046b2052f60eb44 100644 (file)
@@ -45,13 +45,13 @@ public:
                ///
                TOC_CODE,  // do these insets really need a code? (ale)
                ///
-               LOF_CODE,
+               LOF_CODE, // 2
                ///
                LOT_CODE,
                ///
                LOA_CODE,
                ///
-               QUOTE_CODE,
+               QUOTE_CODE, // 5
                ///
                MARK_CODE,
                ///
@@ -61,7 +61,7 @@ public:
                ///
                HTMLURL_CODE,
                ///
-               SEPARATOR_CODE,
+               SEPARATOR_CODE, // 10
                ///
                ENDING_CODE,
                ///
@@ -71,7 +71,7 @@ public:
                ///
                ACCENT_CODE,
                ///
-               MATH_CODE,
+               MATH_CODE, // 15
                ///
                INDEX_CODE,
                ///
@@ -81,7 +81,7 @@ public:
                ///
                PARENT_CODE,
                ///
-               BIBTEX_CODE,
+               BIBTEX_CODE, // 20
                ///
                TEXT_CODE,
                ///
@@ -91,7 +91,7 @@ public:
                ///
                MARGIN_CODE,
                ///
-               FLOAT_CODE,
+               FLOAT_CODE, // 25
                ///
                MINIPAGE_CODE,
                ///
@@ -101,7 +101,9 @@ public:
                ///
                EXTERNAL_CODE,
                ///
-               THEOREM_CODE
+               THEOREM_CODE, // 30
+               ///
+               CAPTION_CODE
        };
 
        ///
index 164a193fb89cb8d3fbd67091716f60439b8db878..f3972ac900956a5b7a6b3e7e08dbd7290381471a 100644 (file)
@@ -62,6 +62,7 @@ using std::istringstream;
 #include "insets/insetlist.h"
 #include "insets/insettabular.h"
 #include "insets/insettheorem.h"
+#include "insets/insetcaption.h"
 #include "mathed/formulamacro.h"
 #include "toolbar.h"
 #include "spellchecker.h" // RVDK_PATCH_5
@@ -2102,12 +2103,32 @@ string LyXFunc::Dispatch(int ac,
        }
        break;
 
+       case LFUN_INSET_CAPTION:
+       {
+               // Do we have a locking inset...
+               if (owner->view()->the_locking_inset) {
+                       lyxerr << "Locking inset code: "
+                              << owner->view()->the_locking_inset->LyxCode();
+                       InsetCaption * new_inset = new InsetCaption;
+                       new_inset->setOwner(owner->view()->the_locking_inset);
+                       new_inset->SetAutoBreakRows(true);
+                       new_inset->SetDrawFrame(0, InsetText::LOCKED);
+                       new_inset->SetFrameColor(0, LColor::footnoteframe);
+                       if (owner->view()->insertInset(new_inset))
+                               new_inset->Edit(owner->view(), 0, 0, 0);
+                       else
+                               delete new_inset;
+               }
+       }
+       break;
+       
        case LFUN_INSET_TABULAR:
        {
                int r = 2, c = 2;
                if (!argument.empty())
-                       sscanf(argument.c_str(),"%d%d",&r,&c);
-               InsetTabular * new_inset = new InsetTabular(owner->buffer(),r,c);
+                       sscanf(argument.c_str(),"%d%d", &r, &c);
+               InsetTabular * new_inset =
+                       new InsetTabular(owner->buffer(), r, c);
                if (owner->view()->insertInset(new_inset))
                        new_inset->Edit(owner->view(), 0, 0, 0);
                else
index 3e5d1479d8fc5924c57c12766dcf856c44179c51..d146c411912b2589b451aa594d8133e0e3455914 100644 (file)
@@ -23,6 +23,7 @@
 #include "insets/insetbib.h"
 #include "insets/insetspecialchar.h"
 #include "insets/insettext.h"
+#include "insets/insetfloat.h"
 #include "layout.h"
 #include "LyXView.h"
 #include "support/textutils.h"
@@ -41,6 +42,7 @@
 #include "font.h"
 #include "debug.h"
 #include "lyxrc.h"
+#include "FloatList.h"
 
 //#define USE_OLD_CUT_AND_PASTE 1
 
@@ -179,7 +181,11 @@ LyXFont LyXText::GetFont(Buffer const * buf, LyXParagraph * par,
 
        char par_depth = par->GetDepth();
        // We specialize the 95% common case:
-       if (par->footnoteflag == LyXParagraph::NO_FOOTNOTE && !par_depth) {
+       if (
+#ifndef NEW_INSETS
+               par->footnoteflag == LyXParagraph::NO_FOOTNOTE &&
+#endif
+               !par_depth) {
                if (pos >= 0){
                        // 95% goes here
                        if (layout.labeltype == LABEL_MANUAL
@@ -412,8 +418,7 @@ void LyXText::OpenStuff(BufferView * bview)
 {
        if (cursor.pos() == 0 && cursor.par()->bibkey){
                cursor.par()->bibkey->Edit(bview, 0, 0, 0);
-       }
-       else if (cursor.pos() < cursor.par()->Last() 
+       } else if (cursor.pos() < cursor.par()->Last() 
                 && cursor.par()->GetChar(cursor.pos()) == LyXParagraph::META_INSET
                 && cursor.par()->GetInset(cursor.pos())->Editable()) {
                bview->owner()->getMiniBuffer()
@@ -421,9 +426,12 @@ void LyXText::OpenStuff(BufferView * bview)
                if (cursor.par()->GetInset(cursor.pos())->Editable() != Inset::HIGHLY_EDITABLE)
                        SetCursorParUndo(bview->buffer());
                cursor.par()->GetInset(cursor.pos())->Edit(bview, 0, 0, 0);
-       } else {
+       }
+#ifndef NEW_INSETS
+       else {
                ToggleFootnote(bview);
        }
+#endif
 }
 
 
@@ -553,7 +561,9 @@ LyXParagraph * LyXText::SetLayout(BufferView * bview,
                textclasslist.Style(bview->buffer()->params.textclass, layout);
    
        while (cur.par() != send_cur.par()) {
+#ifndef NEW_INSETS
                if (cur.par()->footnoteflag == sstart_cur.par()->footnoteflag) {
+#endif
                        cur.par()->SetLayout(bview->buffer()->params, layout);
                        MakeFontEntriesLayoutSpecific(bview->buffer(), cur.par());
                        LyXParagraph * fppar = cur.par()->FirstPhysicalPar();
@@ -568,10 +578,14 @@ LyXParagraph * LyXText::SetLayout(BufferView * bview,
                                delete fppar->bibkey;
                                fppar->bibkey = 0;
                        }
+#ifndef NEW_INSETS
                }
+#endif
                cur.par(cur.par()->Next());
        }
+#ifndef NEW_INSETS
        if (cur.par()->footnoteflag == sstart_cur.par()->footnoteflag) {
+#endif
                cur.par()->SetLayout(bview->buffer()->params, layout);
                MakeFontEntriesLayoutSpecific(bview->buffer(), cur.par());
                LyXParagraph * fppar = cur.par()->FirstPhysicalPar();
@@ -586,7 +600,9 @@ LyXParagraph * LyXText::SetLayout(BufferView * bview,
                        delete fppar->bibkey;
                        fppar->bibkey = 0;
                }
+#ifndef NEW_INSETS
        }
+#endif
        return endpar;
 }
 
@@ -1545,6 +1561,7 @@ char loweralphaCounter(int n)
                return 'a' + n - 1;
 }
 
+
 char alphaCounter(int n)
 {
        if (n < 1 || n > 26)
@@ -1553,6 +1570,7 @@ char alphaCounter(int n)
                return 'A' + n - 1;
 }
 
+
 char hebrewCounter(int n)
 {
        static const char hebrew[22] = {
@@ -1566,7 +1584,9 @@ char hebrewCounter(int n)
                return hebrew[n-1];
 }
 
-static char const * romanCounter(int n)
+
+static
+char const * romanCounter(int n)
 {
        static char const * roman[20] = {
                "i",   "ii",  "iii", "iv", "v",
@@ -1580,12 +1600,13 @@ static char const * romanCounter(int n)
                return roman[n-1];
 }
 
+
 // set the counter of a paragraph. This includes the labels
 void LyXText::SetCounter(Buffer const * buf, LyXParagraph * par) const
 {
        // this is only relevant for the beginning of paragraph
        par = par->FirstPhysicalPar();
-
+       
        LyXLayout const & layout =
                textclasslist.Style(buf->params.textclass, 
                                    par->GetLayout());
@@ -1615,8 +1636,7 @@ void LyXText::SetCounter(Buffer const * buf, LyXParagraph * par) const
                }
                par->enumdepth = par->Previous()->FirstPhysicalPar()->enumdepth;
                par->itemdepth = par->Previous()->FirstPhysicalPar()->itemdepth;
-       }
-       else {
+       } else {
                for (int i = 0; i < 10; ++i) {
                        par->setCounter(i, 0);
                }  
@@ -1661,9 +1681,11 @@ void LyXText::SetCounter(Buffer const * buf, LyXParagraph * par) const
                              par->Previous()->GetLayout()
                             ).labeltype == LABEL_COUNTER_ENUMI
            && par->enumdepth < 3
+#ifndef NEW_INSETS
            && !(par->Previous()->footnoteflag == LyXParagraph::NO_FOOTNOTE 
                    && par->footnoteflag == LyXParagraph::OPEN_FOOTNOTE
                    && par->footnotekind == LyXParagraph::FOOTNOTE)
+#endif
            && layout.labeltype != LABEL_BIBLIO) {
                par->enumdepth++;
        }
@@ -1671,9 +1693,11 @@ void LyXText::SetCounter(Buffer const * buf, LyXParagraph * par) const
        /* Maybe we have to decrement the enumeration depth, see note above */
        if (par->Previous()
            && par->Previous()->GetDepth() > par->GetDepth()
+#ifndef NEW_INSETS
            && !(par->Previous()->footnoteflag == LyXParagraph::NO_FOOTNOTE
                    && par->footnoteflag == LyXParagraph::OPEN_FOOTNOTE
                    && par->footnotekind == LyXParagraph::FOOTNOTE)
+#endif
            && layout.labeltype != LABEL_BIBLIO) {
                par->enumdepth = par->DepthHook(par->GetDepth())->enumdepth;
                par->setCounter(6 + par->enumdepth,
@@ -1934,26 +1958,32 @@ void LyXText::SetCounter(Buffer const * buf, LyXParagraph * par) const
                
                // the caption hack:
                if (layout.labeltype == LABEL_SENSITIVE) {
-                   bool isOK = (par->InInset() && par->InInset()->owner() && 
-                                    (par->InInset()->owner()->LyxCode()==Inset::FLOAT_CODE));
-                       if ((isOK && (par->InInset()->owner()->getInsetName() == "figure")) ||
-                           (par->footnoteflag != LyXParagraph::NO_FOOTNOTE
+                       bool isOK (par->InInset() && par->InInset()->owner() &&
+                                  (par->InInset()->owner()->LyxCode() == Inset::FLOAT_CODE));
+#ifndef NEW_INSETS
+                       if (par->footnoteflag != LyXParagraph::NO_FOOTNOTE
                            && (par->footnotekind == LyXParagraph::FIG
-                               || par->footnotekind == LyXParagraph::WIDE_FIG)))
+                               || par->footnotekind == LyXParagraph::WIDE_FIG)) {
                                s = (par->getParLanguage(buf->params)->lang() == "hebrew")
                                        ? ":øåéà" : "Figure:";
-                       else if ((isOK && (par->InInset()->owner()->getInsetName() == "table")) ||
-                                (par->footnoteflag != LyXParagraph::NO_FOOTNOTE
+                       } else if (par->footnoteflag != LyXParagraph::NO_FOOTNOTE
                                 && (par->footnotekind == LyXParagraph::TAB
-                                    || par->footnotekind == LyXParagraph::WIDE_TAB)))
+                                    || par->footnotekind == LyXParagraph::WIDE_TAB)) {
                                s = (par->getParLanguage(buf->params)->lang() == "hebrew")
                                        ? ":äìáè" : "Table:";
-                       else if ((isOK && (par->InInset()->owner()->getInsetName() == "algorithm")) ||
-                                (par->footnoteflag != LyXParagraph::NO_FOOTNOTE
-                                 && par->footnotekind == LyXParagraph::ALGORITHM))
+                       } else if (par->footnoteflag != LyXParagraph::NO_FOOTNOTE
+                                  && par->footnotekind == LyXParagraph::ALGORITHM) {
                                s = (par->getParLanguage(buf->params)->lang() == "hebrew")
                                        ? ":íúéøåâìà" : "Algorithm:";
-                       else {
+                       }
+#endif
+                       else if (isOK) {
+                               InsetFloat * tmp = static_cast<InsetFloat*>(par->InInset()->owner());
+                               Floating const & fl
+                                       = floatList.getType(tmp->type());
+                               // We should get the correct number here too.
+                               s = fl.name + " #:";
+                       } else {
                                /* par->SetLayout(0); 
                                   s = layout->labelstring;  */
                                s = (par->getParLanguage(buf->params)->lang() == "hebrew")
@@ -1978,10 +2008,12 @@ void LyXText::UpdateCounters(BufferView * bview, Row * row) const
        if (!row) {
                row = firstrow;
                par = row->par();
-       }
-       else {
+       } else {
                if (row->par()->next
-                   && row->par()->next->footnoteflag != LyXParagraph::OPEN_FOOTNOTE) {
+#ifndef NEW_INSETS
+                   && row->par()->next->footnoteflag != LyXParagraph::OPEN_FOOTNOTE)
+#endif
+                       {
                        par = row->par()->LastPhysicalPar()->Next();
                } else {
                        par = row->par()->next;
@@ -2683,14 +2715,18 @@ bool LyXText::UpdateInset(BufferView * bview, Inset * inset)
   
        LyXParagraph * par = FirstParagraph();
        do {
+#ifndef NEW_INSETS
                // make sure the paragraph is open
                if (par->footnoteflag != LyXParagraph::CLOSED_FOOTNOTE){
+#endif
                        pos = par->GetPositionOfInset(inset);
                        if (pos != -1){
                                CheckParagraph(bview, par, pos);
                                return true;
                        }
+#ifndef NEW_INSETS
                }
+#endif
                par = par->Next();
        } while (par);
   
@@ -3341,8 +3377,7 @@ bool LyXText::TextHandleUndo(BufferView * bview, Undo * undo)
                        else
                                OwnerParagraph(tmppar3);
                        tmppar3->previous = before;
-               }
-               else {
+               } else {
                        if (!before)
                                OwnerParagraph(behind);
                }
@@ -3356,6 +3391,7 @@ bool LyXText::TextHandleUndo(BufferView * bview, Undo * undo)
                // Set the cursor for redoing
                if (before) {
                        SetCursorIntern(bview, before->FirstSelfrowPar(), 0);
+#ifndef NEW_INSETS
                        // check wether before points to a closed float and open it if necessary
                        if (before && before->footnoteflag == LyXParagraph::CLOSED_FOOTNOTE
                            && before->next && before->next->footnoteflag != LyXParagraph::NO_FOOTNOTE){
@@ -3368,8 +3404,10 @@ bool LyXText::TextHandleUndo(BufferView * bview, Undo * undo)
                                        tmppar4 = tmppar4->next;
                                }
                        }
+#endif
                }
-    
+
+#ifndef NEW_INSETS
                // open a cosed footnote at the end if necessary
                if (behind && behind->previous && 
                    behind->previous->footnoteflag != LyXParagraph::NO_FOOTNOTE &&
@@ -3379,13 +3417,18 @@ bool LyXText::TextHandleUndo(BufferView * bview, Undo * undo)
                                behind = behind->next;
                        }
                }
+#endif
     
                // calculate the endpar for redoing the paragraphs.
                if (behind) {
+#ifndef NEW_INSETS
                        if (behind->footnoteflag != LyXParagraph::CLOSED_FOOTNOTE)
+#endif
                                endpar = behind->LastPhysicalPar()->Next();
+#ifndef NEW_INSETS
                        else
                                endpar = behind->NextAfterFootnote()->LastPhysicalPar()->Next();
+#endif
                } else
                        endpar = behind;
     
@@ -3640,6 +3683,7 @@ void LyXText::toggleAppendix(BufferView * bview)
        SetCursor(bview, cursor.par(), cursor.pos());
 }
 
+
 LyXParagraph * LyXText::OwnerParagraph() const
 {
        if (inset_owner)