]> git.lyx.org Git - features.git/commitdiff
remove NEW_WAY stuff
authorLars Gullik Bjønnes <larsbj@gullik.org>
Fri, 30 Jun 2000 14:58:05 +0000 (14:58 +0000)
committerLars Gullik Bjønnes <larsbj@gullik.org>
Fri, 30 Jun 2000 14:58:05 +0000 (14:58 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@850 a592a061-630c-0410-9148-cb99ea01b6c8

src/CutAndPaste.C
src/buffer.C
src/insets/insettext.C
src/layout.C
src/lyx_cb.C
src/lyxparagraph.h
src/paragraph.C
src/text.C
src/text2.C

index 70eb686b324d81f1eb5ba3f0c333a927b881aa79..3f3a0238a15895868df184251c19a3b1f6c64c18 100644 (file)
@@ -412,12 +412,7 @@ int CutAndPaste::SwitchLayoutsBetweenClasses(LyXTextClassList::size_type c1,
                    + textclasslist.NameOfClass(c1) + _(" to ")
                    + textclasslist.NameOfClass(c2);
            InsetError * new_inset = new InsetError(s);
-#ifdef NEW_WAY
            par->InsertInset(0, new_inset);
-#else
-           par->InsertChar(0, LyXParagraph::META_INSET);
-           par->InsertInset(0, new_inset);
-#endif
        }
        
        par = par->next;
index ce75dd2b105ce7953fbb4502ace833c043f1bd0c..1d4b8dc05957f693b41355f1ad2d8b479df05cd3 100644 (file)
@@ -308,24 +308,13 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, LyXParagraph *& par,
        if (token[0] != '\\') {
                for (string::const_iterator cit = token.begin();
                     cit != token.end(); ++cit) {
-#ifdef NEW_WAY
                        par->InsertChar(pos, (*cit), font);
-#else
-                       par->InsertChar(pos, (*cit));
-                       par->SetFont(pos, font);
-#endif
                        ++pos;
                }
        } else if (token == "\\i") {
                Inset * inset = new InsetLatexAccent;
                inset->Read(this, lex);
-#ifdef NEW_WAY
                par->InsertInset(pos, inset, font);
-#else
-               par->InsertChar(pos, LyXParagraph::META_INSET); 
-               par->SetFont(pos, font);
-               par->InsertInset(pos, inset);
-#endif
                ++pos;
        } else if (token == "\\layout") {
                if (!return_par) 
@@ -424,13 +413,7 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, LyXParagraph *& par,
                nylex.setStream(istr);
                
                inset->Read(this, nylex);
-#ifdef NEW_WAY
                par->InsertInset(pos, inset, font);
-#else
-               par->InsertChar(pos, LyXParagraph::META_INSET);
-               par->SetFont(pos, font);
-               par->InsertInset(pos, inset);
-#endif
                ++pos;
 #endif
        } else if (token == "\\begin_deeper") {
@@ -816,178 +799,82 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, LyXParagraph *& par,
                if (tmptok == "Quotes") {
                        Inset * inset = new InsetQuotes;
                        inset->Read(this, lex);
-#ifdef NEW_WAY
                        par->InsertInset(pos, inset, font);
-#else
-                       par->InsertChar(pos, LyXParagraph::META_INSET);
-                       par->SetFont(pos, font);
-                       par->InsertInset(pos, inset);
-#endif
                        ++pos;
                } else if (tmptok == "External") {
                        Inset * inset = new InsetExternal;
                        inset->Read(this, lex);
-#ifdef NEW_WAY
                        par->InsertInset(pos, inset, font);
-#else
-                       par->InsertChar(pos, LyXParagraph::META_INSET);
-                       par->SetFont(pos, font);
-                       par->InsertInset(pos, inset);
-#endif
                        ++pos;
                } else if (tmptok == "FormulaMacro") {
                        Inset * inset = new InsetFormulaMacro;
                        inset->Read(this, lex);
-#ifdef NEW_WAY
                        par->InsertInset(pos, inset, font);
-#else
-                       par->InsertChar(pos, LyXParagraph::META_INSET);
-                       par->SetFont(pos, font);
-                       par->InsertInset(pos, inset);
-#endif
                        ++pos;
                } else if (tmptok == "Formula") {
                        Inset * inset = new InsetFormula;
                        inset->Read(this, lex);
-#ifdef NEW_WAY
                        par->InsertInset(pos, inset, font);
-#else
-                       par->InsertChar(pos, LyXParagraph::META_INSET);
-                       par->SetFont(pos, font);
-                       par->InsertInset(pos, inset);
-#endif
                        ++pos;
                } else if (tmptok == "Figure") {
                        Inset * inset = new InsetFig(100, 100, this);
                        inset->Read(this, lex);
-#ifdef NEW_WAY
                        par->InsertInset(pos, inset, font);
-#else
-                       par->InsertChar(pos, LyXParagraph::META_INSET);
-                       par->SetFont(pos, font);
-                       par->InsertInset(pos, inset);
-#endif
                        ++pos;
                } else if (tmptok == "Info") {
                        Inset * inset = new InsetInfo;
                        inset->Read(this, lex);
-#ifdef NEW_WAY
                        par->InsertInset(pos, inset, font);
-#else
-                       par->InsertChar(pos, LyXParagraph::META_INSET);
-                       par->SetFont(pos, font);
-                       par->InsertInset(pos, inset);
-#endif
                        ++pos;
                } else if (tmptok == "Include") {
                        Inset * inset = new InsetInclude(string(), this);
                        inset->Read(this, lex);
-#ifdef NEW_WAY
                        par->InsertInset(pos, inset, font);
-#else
-                       par->InsertChar(pos, LyXParagraph::META_INSET);
-                       par->SetFont(pos, font);
-                       par->InsertInset(pos, inset);
-#endif
                        ++pos;
                } else if (tmptok == "ERT") {
                        Inset * inset = new InsetERT;
                        inset->Read(this, lex);
-#ifdef NEW_WAY
                        par->InsertInset(pos, inset, font);
-#else
-                       par->InsertChar(pos, LyXParagraph::META_INSET);
-                       par->SetFont(pos, font);
-                       par->InsertInset(pos, inset);
-#endif
                        ++pos;
                } else if (tmptok == "Tabular") {
                        Inset * inset = new InsetTabular(this);
                        inset->Read(this, lex);
-#ifdef NEW_WAY
                        par->InsertInset(pos, inset, font);
-#else
-                       par->InsertChar(pos, LyXParagraph::META_INSET);
-                       par->SetFont(pos, font);
-                       par->InsertInset(pos, inset);
-#endif
                        ++pos;
                } else if (tmptok == "Text") {
                        Inset * inset = new InsetText;
                        inset->Read(this, lex);
-#ifdef NEW_WAY
                        par->InsertInset(pos, inset, font);
-#else
-                       par->InsertChar(pos, LyXParagraph::META_INSET);
-                       par->SetFont(pos, font);
-                       par->InsertInset(pos, inset);
-#endif
                        ++pos;
                } else if (tmptok == "Foot") {
                        Inset * inset = new InsetFoot;
                        inset->Read(this, lex);
-#ifdef NEW_WAY
                        par->InsertInset(pos, inset, font);
-#else
-                       par->InsertChar(pos, LyXParagraph::META_INSET);
-                       par->SetFont(pos, font);
-                       par->InsertInset(pos, inset);
-#endif
                        ++pos;
                } else if (tmptok == "Marginal") {
                        Inset * inset = new InsetMarginal;
                        inset->Read(this, lex);
-#ifdef NEW_WAY
                        par->InsertInset(pos, inset, font);
-#else
-                       par->InsertChar(pos, LyXParagraph::META_INSET);
-                       par->SetFont(pos, font);
-                       par->InsertInset(pos, inset);
-#endif
                        ++pos;
                } else if (tmptok == "Minipage") {
                        Inset * inset = new InsetMinipage;
                        inset->Read(this, lex);
-#ifdef NEW_WAY
                        par->InsertInset(pos, inset, font);
-#else
-                       par->InsertChar(pos, LyXParagraph::META_INSET);
-                       par->SetFont(pos, font);
-                       par->InsertInset(pos, inset);
-#endif
                        ++pos;
                } else if (tmptok == "Float") {
                        Inset * inset = new InsetFloat;
                        inset->Read(this, lex);
-#ifdef NEW_WAY
                        par->InsertInset(pos, inset, font);
-#else
-                       par->InsertChar(pos, LyXParagraph::META_INSET);
-                       par->SetFont(pos, font);
-                       par->InsertInset(pos, inset);
-#endif
                        ++pos;
                } else if (tmptok == "List") {
                        Inset * inset = new InsetList;
                        inset->Read(this, lex);
-#ifdef NEW_WAY
                        par->InsertInset(pos, inset, font);
-#else
-                       par->InsertChar(pos, LyXParagraph::META_INSET);
-                       par->SetFont(pos, font);
-                       par->InsertInset(pos, inset);
-#endif
                        ++pos;
                } else if (tmptok == "GRAPHICS") {
                        Inset * inset = new InsetGraphics;
                                //inset->Read(this, lex);
-#ifdef NEW_WAY
                        par->InsertInset(pos, inset, font);
-#else
-                       par->InsertChar(pos, LyXParagraph::META_INSET);
-                       par->SetFont(pos, font);
-                       par->InsertInset(pos, inset);
-#endif
                } else if (tmptok == "LatexCommand") {
                        InsetCommand inscmd;
                        inscmd.Read(this, lex);
@@ -1031,13 +918,7 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, LyXParagraph *& par,
                        }
                               
                        if (inset) {
-#ifdef NEW_WAY
                                par->InsertInset(pos, inset, font);
-#else
-                               par->InsertChar(pos, LyXParagraph::META_INSET);
-                               par->SetFont(pos, font);
-                               par->InsertInset(pos, inset);
-#endif
                                ++pos;
                        }
                }
@@ -1053,20 +934,10 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, LyXParagraph *& par,
                                lex.next();
                                next_token = lex.GetString();
                                if (next_token == "\\-") {
-#ifdef NEW_WAY
                                        par->InsertChar(pos, '-', font);
-#else
-                                       par->InsertChar(pos, '-');
-                                       par->SetFont(pos, font);
-#endif
                                } else if (next_token == "\\protected_separator"
                                        || next_token == "~") {
-#ifdef NEW_WAY
                                        par->InsertChar(pos, ' ', font);
-#else
-                                       par->InsertChar(pos, ' ');
-                                       par->SetFont(pos, font);
-#endif
                                } else {
                                        lex.printError("Token `$$Token' "
                                                       "is in free space "
@@ -1077,45 +948,23 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, LyXParagraph *& par,
                } else {
                        Inset * inset = new InsetSpecialChar;
                        inset->Read(this, lex);
-#ifdef NEW_WAY
                        par->InsertInset(pos, inset, font);
-#else
-                       par->InsertChar(pos, LyXParagraph::META_INSET); 
-                       par->SetFont(pos, font);
-                       par->InsertInset(pos, inset);
-#endif
                }
                ++pos;
        } else if (token == "\\newline") {
-#ifdef NEW_WAY
                par->InsertChar(pos, LyXParagraph::META_NEWLINE, font);
-#else
-               par->InsertChar(pos, LyXParagraph::META_NEWLINE);
-               par->SetFont(pos, font);
-#endif
                ++pos;
        } else if (token == "\\LyXTable") {
 #ifdef USE_TABULAR_INSETS
                Inset * inset = new InsetTabular(this);
                inset->Read(this, lex);
-#ifdef NEW_WAY
                par->InsertInset(pos, inset, font);
-#else
-               par->InsertChar(pos, LyXParagraph::META_INSET);
-               par->SetFont(pos, font);
-               par->InsertInset(pos, inset);
-#endif
                ++pos;
 #else
                par->table = new LyXTable(lex);
 #endif
        } else if (token == "\\hfill") {
-#ifdef NEW_WAY
                par->InsertChar(pos, LyXParagraph::META_HFILL, font);
-#else
-               par->InsertChar(pos, LyXParagraph::META_HFILL);
-               par->SetFont(pos, font);
-#endif
                ++pos;
        } else if (token == "\\protected_separator") { // obsolete
                // This is a backward compability thingie. (Lgb)
@@ -1126,21 +975,10 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, LyXParagraph *& par,
                                            par->GetLayout());
 
                if (layout.free_spacing) {
-#ifdef NEW_WAY
                        par->InsertChar(pos, ' ', font);
-#else
-                       par->InsertChar(pos, ' ');
-                       par->SetFont(pos, font);
-#endif
                } else {
                        Inset * inset = new InsetSpecialChar(InsetSpecialChar::PROTECTED_SEPARATOR);
-#ifdef NEW_WAY
                        par->InsertInset(pos, inset, font);
-#else
-                       par->InsertChar(pos, LyXParagraph::META_INSET);
-                       par->SetFont(pos, font);
-                       par->InsertInset(pos, inset);
-#endif
                }
                ++pos;
        } else if (token == "\\bibitem") {  // ale970302
@@ -1148,12 +986,7 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, LyXParagraph *& par,
                        par->bibkey = new InsetBibKey;
                par->bibkey->Read(this, lex);                   
        }else if (token == "\\backslash") {
-#ifdef NEW_WAY
                par->InsertChar(pos, '\\', font);
-#else
-               par->InsertChar(pos, '\\');
-               par->SetFont(pos, font);
-#endif
                ++pos;
        }else if (token == "\\the_end") {
                the_end_read = true;
@@ -1163,12 +996,7 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, LyXParagraph *& par,
                               "Inserting as text.");
                for(string::const_iterator cit = token.begin();
                    cit != token.end(); ++cit) {
-#ifdef NEW_WAY
                        par->InsertChar(pos, (*cit), font);
-#else
-                       par->InsertChar(pos, (*cit));
-                       par->SetFont(pos, font);
-#endif
                        ++pos;
                }
        }
@@ -2899,12 +2727,7 @@ void Buffer::LinuxDocError(LyXParagraph * par, int pos,
 {
        // insert an error marker in text
        InsetError * new_inset = new InsetError(message);
-#ifdef NEW_WAY
        par->InsertInset(pos, new_inset);
-#else
-       par->InsertChar(pos, LyXParagraph::META_INSET);
-       par->InsertInset(pos, new_inset);
-#endif
 }
 
 // This constant defines the maximum number of 
index b8157f7f9a549d1a780c3ceec43c6f5afabc62b8..735df9e4c1fb03131a7a23bdc525c43fc7acc99a 100644 (file)
@@ -959,12 +959,7 @@ bool InsetText::InsertInset(BufferView * bv, Inset * inset)
        UpdatableInset * i = static_cast<UpdatableInset *>(inset);
        i->setOwner(static_cast<UpdatableInset *>(this));
     }
-#ifdef NEW_WAY
     cpar(bv)->InsertInset(cpos(bv), inset);
-#else
-    cpar(bv)->InsertChar(cpos(bv), LyXParagraph::META_INSET);
-    cpar(bv)->InsertInset(cpos(bv), inset);
-#endif
     TEXT(bv)->selection = 0;
     UpdateLocal(bv, CURSOR_PAR, true);
     static_cast<UpdatableInset*>(inset)->Edit(bv, 0, 0, 0);
index 0e8dfae7c0692278b8559213781584cbd0c38cfa..797f2855b1fa6aad79398705c2e38b448553a457 100644 (file)
@@ -6,7 +6,8 @@
  *          Copyright 1995 Matthias Ettrich
  *          Copyright 1995-2000 The LyX Team.
  *
- * ====================================================== */
+ * ======================================================
+ */
 
 #include <config.h>
 
index 51ea17a1d190d79529dc7fd85cf2327bb5a4f4c0..ebf9ceb8144c41f16f6f8cea1c8327de5067804c 100644 (file)
@@ -2643,13 +2643,8 @@ extern "C" void TableApplyCB(FL_OBJECT *, long)
                current_view->text->cursor.par()->getParLanguage(current_view->buffer()->params);
        LyXFont font(LyXFont::ALL_INHERIT, lang);
        for (int i = 0; i < xsize * ysize - 1; ++i) {
-#ifdef NEW_WAY
                current_view->text->cursor.par()
                        ->InsertChar(0, LyXParagraph::META_NEWLINE, font);
-#else
-               current_view->text->cursor.par()->InsertChar(0, LyXParagraph::META_NEWLINE);
-               current_view->text->cursor.par()->SetFont(0, font);
-#endif
        }
        current_view->text->RedoParagraph(current_view);
    
index 00a76906f69bca326043ffe1bd81f721726ea24a..ae3d2ca36666f608826c9e9fbc7bc415ddc2f2c6 100644 (file)
@@ -26,8 +26,6 @@
 #include "support/block.h"
 #include "language.h"
 
-#define NEW_WAY 1
-
 class BufferParams;
 class LyXBuffer;
 class TexRow;
@@ -424,16 +422,12 @@ public:
                                              size_type endpos) const;
        ///
        void InsertChar(size_type pos, char c);
-#ifdef NEW_WAY
        ///
        void InsertChar(size_type pos, char c, LyXFont const &);
-#endif
        ///
        void InsertInset(size_type pos, Inset * inset);
-#ifdef NEW_WAY
        ///
        void InsertInset(size_type pos, Inset * inset, LyXFont const &);
-#endif
        ///
        bool InsertInsetAllowed(Inset * inset);
        ///
index 6e432b619c8e3eb8bf5bb2b78a54514b1161e825..5cf057ce9c92d502711d328ccb577871dde3ec0f 100644 (file)
@@ -464,17 +464,10 @@ bool LyXParagraph::InsertFromMinibuffer(LyXParagraph::size_type pos)
        if ((minibuffer_char == LyXParagraph::META_INSET) &&
            !InsertInsetAllowed(minibuffer_inset))
                return false;
-#ifdef NEW_WAY
        if (minibuffer_char == LyXParagraph::META_INSET)
                InsertInset(pos, minibuffer_inset, minibuffer_font);
        else
                InsertChar(pos, minibuffer_char, minibuffer_font);
-#else
-       InsertChar(pos, minibuffer_char);
-       SetFont(pos, minibuffer_font);
-       if (minibuffer_char == LyXParagraph::META_INSET)
-               InsertInset(pos, minibuffer_inset);
-#endif
        return true;
 }
 
@@ -608,43 +601,11 @@ void LyXParagraph::Erase(LyXParagraph::size_type pos)
 
 void LyXParagraph::InsertChar(LyXParagraph::size_type pos, char c)
 {
-#ifndef NEW_WAY
-       // > because last is the next unused position, and you can 
-       // use it if you want
-       if (pos > size()) {
-#ifndef NEW_INSETS
-               if (next
-                   && next->footnoteflag == LyXParagraph::CLOSED_FOOTNOTE) 
-                       NextAfterFootnote()->InsertChar(pos - text.size() - 1,
-                                                       c);
-               else 
-#endif
-                       lyxerr.debug() << "ERROR (LyXParagraph::InsertChar): "
-                               "position does not exist." << endl;
-               return;
-       }
-       text.insert(text.begin() + pos, c);
-       // Update the font table.
-       for (FontList::iterator it = lower_bound(fontlist.begin(),
-                                                fontlist.end(),
-                                                pos, matchFT());
-            it != fontlist.end(); ++it)
-               ++(*it).pos;
-   
-       // Update the inset table.
-       for (InsetList::iterator it = lower_bound(insetlist.begin(),
-                                                 insetlist.end(),
-                                                 pos, matchIT());
-            it != insetlist.end(); ++it)
-               ++(*it).pos;
-#else
        LyXFont f(LyXFont::ALL_INHERIT);
        InsertChar(pos, c, f);
-#endif
 }
 
 
-#ifdef NEW_WAY
 void LyXParagraph::InsertChar(LyXParagraph::size_type pos,
                              char c, LyXFont const & font)
 {
@@ -679,54 +640,16 @@ void LyXParagraph::InsertChar(LyXParagraph::size_type pos,
 
        SetFont(pos, font);
 }
-#endif
 
 
 void LyXParagraph::InsertInset(LyXParagraph::size_type pos,
                               Inset * inset)
 {
-#ifdef NEW_WAY
        LyXFont f(LyXFont::ALL_INHERIT);
        InsertInset(pos, inset, f);
-#else
-       // > because last is the next unused position, and you can 
-       // use it if you want
-       if (pos > size()) {
-#ifndef NEW_INSETS
-               if (next
-                   && next->footnoteflag == LyXParagraph::CLOSED_FOOTNOTE) 
-                       NextAfterFootnote()
-                               ->InsertInset(pos - text.size() - 1, inset);
-               else
-#endif
-                       lyxerr << "ERROR (LyXParagraph::InsertInset): " 
-                               "position does not exist: " << pos << endl;
-               return;
-       }
-       if (text[pos] != LyXParagraph::META_INSET) {
-               lyxerr << "ERROR (LyXParagraph::InsertInset): "
-                       "there is no LyXParagraph::META_INSET" << endl;
-               return;
-       }
-
-       if (inset) {
-               // Add a new entry in the inset table.
-               InsetList::iterator it = lower_bound(insetlist.begin(),
-                                                    insetlist.end(),
-                                                    pos, matchIT());
-               if (it != insetlist.end() && (*it).pos == pos)
-                       lyxerr << "ERROR (LyXParagraph::InsertInset): "
-                               "there is an inset in position: " << pos << endl;
-               else
-                       insetlist.insert(it, InsetTable(pos,inset));
-               if (inset_owner)
-                       inset->setOwner(inset_owner);
-       }
-#endif
 }
 
 
-#ifdef NEW_WAY
 void LyXParagraph::InsertInset(LyXParagraph::size_type pos,
                               Inset * inset, LyXFont const & font)
 {
@@ -763,7 +686,6 @@ void LyXParagraph::InsertInset(LyXParagraph::size_type pos,
        if (inset_owner)
                inset->setOwner(inset_owner);
 }
-#endif
 
 
 bool LyXParagraph::InsertInsetAllowed(Inset * inset)
index 24269e9d88cb216228ba9b4833eb2a3ee4065ac0..13ff3232f1cbefd0becf8247a6f3691801b5c189 100644 (file)
@@ -2095,12 +2095,7 @@ void LyXText::TableFeatures(BufferView * bview, int feature) const
          Language const * lang = cursor.par()->getParLanguage(bview->buffer()->params);
          LyXFont font(LyXFont::ALL_INHERIT,lang);
           for (int i = 0; i < number; ++i) {
-#ifdef NEW_WAY
               cursor.par()->InsertChar(pos, LyXParagraph::META_NEWLINE, font);
-#else
-              cursor.par()->InsertChar(pos, LyXParagraph::META_NEWLINE);
-             cursor.par()->SetFont(pos, font);
-#endif
          }
                
           /* append the row into the table */
@@ -2138,12 +2133,7 @@ void LyXText::TableFeatures(BufferView * bview, int feature) const
          Language const * lang = cursor.par()->getParLanguage(bview->buffer()->params);
          LyXFont font(LyXFont::ALL_INHERIT,lang);
           for (int i = 0; i < number; ++i) {
-#ifdef NEW_WAY
               cursor.par()->InsertChar(pos, LyXParagraph::META_NEWLINE, font);
-#else
-              cursor.par()->InsertChar(pos, LyXParagraph::META_NEWLINE);
-             cursor.par()->SetFont(pos, font);
-#endif
          }
 
           /* append the row into the table */
@@ -2160,14 +2150,9 @@ void LyXText::TableFeatures(BufferView * bview, int feature) const
           do{
               if (pos && (cursor.par()->IsNewline(pos-1))){
                   if (cursor.par()->table->AppendCellAfterCell(cell_org, cell)) {
-#ifdef NEW_WAY
                       cursor.par()->InsertChar(pos,
                                               LyXParagraph::META_NEWLINE,
                                               font);
-#else
-                      cursor.par()->InsertChar(pos, LyXParagraph::META_NEWLINE);
-                     cursor.par()->SetFont(pos, font);
-#endif
                       if (pos <= cursor.pos())
                           cursor.pos(cursor.pos() + 1);
                       ++pos;
@@ -2180,13 +2165,8 @@ void LyXText::TableFeatures(BufferView * bview, int feature) const
              This saves one byte memory per table ;-) */
           if (cursor.par()->table->AppendCellAfterCell(cell_org, cell)) {
                  LyXParagraph::size_type last = cursor.par()->Last();
-#ifdef NEW_WAY
                  cursor.par()->InsertChar(last,
                                           LyXParagraph::META_NEWLINE, font);
-#else
-                 cursor.par()->InsertChar(last, LyXParagraph::META_NEWLINE);
-                 cursor.par()->SetFont(last, font);
-#endif
          }
                
           /* append the column into the table */ 
index 81b2ed8e8b0b05207deb15a91a11a4834276698f..5eabab4c0f102cdac9e362ffdfb5310a29908711 100644 (file)
@@ -2028,12 +2028,7 @@ void LyXText::InsertInset(BufferView * bview, Inset * inset)
        SetUndo(bview->buffer(), Undo::INSERT, 
                cursor.par()->ParFromPos(cursor.pos())->previous, 
                cursor.par()->ParFromPos(cursor.pos())->next);
-#ifdef NEW_WAY
        cursor.par()->InsertInset(cursor.pos(), inset);
-#else
-       cursor.par()->InsertChar(cursor.pos(), LyXParagraph::META_INSET);
-       cursor.par()->InsertInset(cursor.pos(), inset);
-#endif
        InsertChar(bview, LyXParagraph::META_INSET);  /* just to rebreak and refresh correctly.
                                      * The character will not be inserted a
                                      * second time */
@@ -2307,12 +2302,7 @@ void LyXText::ReplaceSelectionWithString(BufferView * bview, char const * str)
 
        // Insert the new string
        for (int i = 0; str[i]; ++i) {
-#ifdef NEW_WAY
                sel_end_cursor.par()->InsertChar(pos, str[i], font);
-#else
-               sel_end_cursor.par()->InsertChar(pos, str[i]);
-               sel_end_cursor.par()->SetFont(pos, font);
-#endif
                ++pos;
        }
 
@@ -2396,12 +2386,7 @@ void LyXText::InsertStringA(BufferView * bview, string const & str)
                        if (str[i] == ' ' 
                            && i + 1 < str.length() && str[i + 1] != ' '
                            && pos && par->GetChar(pos - 1)!= ' ') {
-#ifdef NEW_WAY
                                par->InsertChar(pos, ' ', current_font);
-#else
-                               par->InsertChar(pos,' ');
-                               par->SetFont(pos, current_font);
-#endif
                                ++pos;
 #ifndef NEW_TABLAR
                        } else if (par->table) {
@@ -2415,13 +2400,8 @@ void LyXText::InsertStringA(BufferView * bview, string const & str)
                                                break;
                                } else if ((str[i] != 13) &&
                                           ((str[i] & 127) >= ' ')) {
-#ifdef NEW_WAY
                                        par->InsertChar(pos, str[i],
                                                        current_font);
-#else
-                                       par->InsertChar(pos, str[i]);
-                                       par->SetFont(pos, current_font);
-#endif
                                        ++pos;
                                }
 #endif
@@ -2429,14 +2409,8 @@ void LyXText::InsertStringA(BufferView * bview, string const & str)
                                InsetSpecialChar * new_inset =
                                        new InsetSpecialChar(InsetSpecialChar::PROTECTED_SEPARATOR);
                                if (par->InsertInsetAllowed(new_inset)) {
-#ifdef NEW_WAY
                                        par->InsertInset(pos, new_inset,
                                                         current_font);
-#else
-                                       par->InsertChar(pos, LyXParagraph::META_INSET);
-                                       par->SetFont(pos, current_font);
-                                       par->InsertInset(pos, new_inset);
-#endif
                                } else {
                                        delete new_inset;
                                }
@@ -2446,14 +2420,8 @@ void LyXText::InsertStringA(BufferView * bview, string const & str)
                                InsetSpecialChar * new_inset =
                                        new InsetSpecialChar(InsetSpecialChar::PROTECTED_SEPARATOR);
                                if (par->InsertInsetAllowed(new_inset)) {
-#ifdef NEW_WAY
                                        par->InsertInset(pos, new_inset,
                                                         current_font);
-#else
-                                       par->InsertChar(pos, LyXParagraph::META_INSET);
-                                       par->SetFont(pos, current_font);
-                                       par->InsertInset(pos, new_inset);
-#endif
                                } else {
                                        delete new_inset;
                                }
@@ -2462,12 +2430,7 @@ void LyXText::InsertStringA(BufferView * bview, string const & str)
                        } else if (str[i] != 13 && 
                                   // Ignore unprintables
                                   (str[i] & 127) >= ' ') {
-#ifdef NEW_WAY
                                par->InsertChar(pos, str[i], current_font);
-#else
-                               par->InsertChar(pos, str[i]);
-                               par->SetFont(pos, current_font);
-#endif
                                ++pos;
                        }
                } else {
@@ -2501,15 +2464,9 @@ void LyXText::InsertStringA(BufferView * bview, string const & str)
                                        InsetSpecialChar * new_inset =
                                                new InsetSpecialChar(InsetSpecialChar::PROTECTED_SEPARATOR);
                                        if (par->InsertInsetAllowed(new_inset)) {
-#ifdef NEW_WAY
                                                par->InsertInset(pos,
                                                                 new_inset,
                                                                 current_font);
-#else
-                                               par->InsertChar(pos, LyXParagraph::META_INSET);
-                                               par->SetFont(pos, current_font);
-                                               par->InsertInset(pos, new_inset);
-#endif
                                        } else {
                                                delete new_inset;
                                        }