]> git.lyx.org Git - features.git/commitdiff
fix crossref label list, some debug messages + various
authorLars Gullik Bjønnes <larsbj@gullik.org>
Tue, 25 Jan 2000 12:35:27 +0000 (12:35 +0000)
committerLars Gullik Bjønnes <larsbj@gullik.org>
Tue, 25 Jan 2000 12:35:27 +0000 (12:35 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@445 a592a061-630c-0410-9148-cb99ea01b6c8

22 files changed:
ChangeLog
src/BufferView.C
src/DepTable.C
src/LaTeX.C
src/buffer.C
src/credits.C
src/debug.C
src/debug.h
src/insets/insetlatexaccent.C
src/kbmap.C
src/kbmap.h
src/lyx_gui.C
src/lyx_main.C
src/lyxvc.C
src/mathed/math_defs.h
src/mathed/math_inset.C
src/mathed/math_iter.C
src/mathed/math_symbols.C
src/paragraph.C
src/spellchecker.C
src/support/DebugStream.C
src/table.C

index 364164c58674d4cf5d92b3d7f4765b92a11b6e51..b570a82629632fda6383f7ecceaf3d037b533554 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,20 @@
+2000-01-25  Lars Gullik Bjønnes  <larsbj@lyx.org>
+
+       * several files: marked several lines with "DEL LINE", this is
+       lines that can be deleted without changing anything.
+       if (<ptr>) // DEL LINE  /* this line is _never_ needed. Delete
+                                  checks this anyway */
+               delete <ptr>
+
+       * src/insets/insetlatexaccent.C: Changed some debugs to Debug::KEY
+
+       * src/DepTable.C (update): add a "+" at the end when the checksum
+       is different. (debugging string only)
+
+       * src/paragraph.C (ReturnNextInsetPointer): fix bug that caused
+       the next inset to not be displayed. This should also fix the list
+       of labels in the "Insert Crossreference" dialog.
+
 2000-01-24  Lars Gullik Bjønnes  <larsbj@lyx.org>
 
        * src/support/LSubstring.C (LSubstring): set pos to string::npos
index 6540e3c29efa5bd75c9bfbf53ff3bd7e75bdf61a..b89f9711c1e0375e0e60ec6384ccc1b745b8d7bf 100644 (file)
@@ -225,7 +225,7 @@ void BufferView::buffer(Buffer * b)
        
        // Nuke old image
        // screen is always deleted when the buffer is changed.
-       if (screen)
+       if (screen) // DEL LINE
                delete screen;
        screen = 0;
 
@@ -273,7 +273,7 @@ void BufferView::buffer(Buffer * b)
 void BufferView::updateScreen()
 {
        // Regenerate the screen.
-       if (screen)
+       if (screen) // DEL LINE
                delete screen;
        screen = new LyXScreen(FL_ObjWin(work_area),
                               work_area->w,
@@ -1520,13 +1520,17 @@ void BufferView::CursorToggleCB(FL_OBJECT * ob, long)
                Window tmpwin;
                int tmp;
                XGetInputFocus(fl_display, &tmpwin, &tmp);
-               if (lyxerr.debugging(Debug::INFO)) {
-                       lyxerr << "tmpwin: " << tmpwin
-                              << "\nwindow: " << view->owner_->getForm()->window
-                              << "\nwork_area_focus: " << view->work_area_focus
-                              << "\nlyx_focus      : " << view->lyx_focus
-                              << endl;
-               }
+               // Commenting this out, we have not had problems with this
+               // for a long time. We will probably work on this code later
+               // and we can reenable this debug code then. Now it only
+               // anoying when debugging. (Lgb)
+               //if (lyxerr.debugging(Debug::INFO)) {
+               //      lyxerr << "tmpwin: " << tmpwin
+               //             << "\nwindow: " << view->owner_->getForm()->window
+               //             << "\nwork_area_focus: " << view->work_area_focus
+               //             << "\nlyx_focus      : " << view->lyx_focus
+               //             << endl;
+               //}
                if (tmpwin != view->owner_->getForm()->window) {
                        view->lyx_focus = false;
                        goto skip_timer;
index 95978313517968c4332b5b4cb04a0186e66f57ea..16b5905e09319a91aeba27611e673b60693eddf7 100644 (file)
@@ -50,9 +50,12 @@ void DepTable::update()
                unsigned long one = (*itr).second.second;
                unsigned long two = lyx::sum((*itr).first.c_str());
                (*itr).second = make_pair(one, two);
-               if (lyxerr.debugging()) {
-                       lyxerr << "update: " << (*itr).first << " "
-                              << one << " " << two << endl;
+               if (lyxerr.debugging(Debug::DEPEND)) {
+                       lyxerr << "Update dep: " << (*itr).first << " "
+                              << one << " " << two;
+                       if (one != two)
+                               lyxerr << " +";
+                       lyxerr << endl;
                }
        }
 }
@@ -93,7 +96,6 @@ bool DepTable::extchanged(string const & ext) const
                                return true;
                }
        }
-                    
        return false;
 }
 
@@ -125,7 +127,7 @@ void DepTable::write(string const & f) const
        for (DepList::const_iterator cit = deplist.begin();
             cit != deplist.end();
             ++cit) {
-               if (lyxerr.debugging()) {
+               if (lyxerr.debugging(Debug::DEPEND)) {
                        lyxerr << "Write dep: "
                               << (*cit).first << " "
                               << (*cit).second.first << " "
@@ -145,8 +147,8 @@ void DepTable::read(string const & f)
        unsigned long one = 0;
        unsigned long two = 0;
        while(ifs >> nome >> one >> two) {
-               if (lyxerr.debugging()) {
-                       lyxerr << "read dep: "
+               if (lyxerr.debugging(Debug::DEPEND)) {
+                       lyxerr << "Read dep: "
                               << nome << " "
                               << one << " "
                               << two << endl;
index 411519627e95491480c560e88ee241dd5a60f9e9..73bf70c380df874a15712dc88146af0e1f04c485 100644 (file)
@@ -51,7 +51,7 @@ extern BufferList bufferlist;
 
 struct texfile_struct {
        LaTeX::TEX_FILES file;
-       char const *extension;
+       char const * extension;
 };
 
 static
@@ -139,11 +139,12 @@ int LaTeX::run(TeXErrors & terr, MiniBuffer * minib)
                // Update the checksums
                head.update();
                
-               lyxerr[Debug::LATEX] << "Dependency file exists" << endl;
+               lyxerr[Debug::DEPEND] << "Dependency file exists" << endl;
                if (head.sumchange()) {
                        ++count;
+                       lyxerr[Debug::DEPEND]
+                               << "Dependency file has changed" << endl;
                        lyxerr[Debug::LATEX]
-                               << "Dependency file has changed\n"
                                << "Run #" << count << endl; 
                        minib->Set(string(_("LaTeX run number ")) + tostr(count));
                        minib->Store();
@@ -152,15 +153,18 @@ int LaTeX::run(TeXErrors & terr, MiniBuffer * minib)
                        if (scanres & LaTeX::ERRORS) return scanres; // return on error
                        run_bibtex = scanAux(head);
                        if (run_bibtex)
-                               lyxerr << "Bibtex demands rerun" << endl;
+                               lyxerr[Debug::DEPEND]
+                                       << "Bibtex demands rerun" << endl;
                } else {
-                       lyxerr[Debug::LATEX] << "return no_change" << endl;
+                       lyxerr[Debug::DEPEND] << "return no_change" << endl;
                        return LaTeX::NO_CHANGE;
                }
        } else {
                ++count;
-               lyxerr[Debug::LATEX] << "Dependency file does not exist\n"
-                                    << "Run #" << count << endl;
+               lyxerr[Debug::DEPEND]
+                       << "Dependency file does not exist" << endl;
+               lyxerr[Debug::LATEX]
+                       << "Run #" << count << endl;
                head.insert(file, true);
                minib->Set(string(_("LaTeX run number ")) + tostr(count));
                minib->Store();
@@ -219,8 +223,9 @@ int LaTeX::run(TeXErrors & terr, MiniBuffer * minib)
        if (rerun || head.sumchange()) {
                rerun = false;
                ++count;
+               lyxerr[Debug::DEPEND]
+                       << "Dep. file has changed or rerun requested" << endl;
                lyxerr[Debug::LATEX]
-                       << "Dep. file has changed or rerun requested\n"
                        << "Run #" << count << endl;
                minib->Set(string(_("LaTeX run number ")) + tostr(count));
                minib->Store();
@@ -231,7 +236,7 @@ int LaTeX::run(TeXErrors & terr, MiniBuffer * minib)
                deplog(head); // reads the latex log
                head.update();
        } else {
-               lyxerr[Debug::LATEX] << "Dep. file has NOT changed" << endl;
+               lyxerr[Debug::DEPEND] << "Dep. file has NOT changed" << endl;
        }
 
        // 1.5
@@ -570,7 +575,7 @@ void LaTeX::deplog(DepTable & head)
                                break;
                        foundfile += c;
                }
-               lyxerr[Debug::LATEX] << "Found file: " 
+               lyxerr[Debug::DEPEND] << "Found file: " 
                                     << foundfile << endl;
                
                // Ok now we found a file.
@@ -582,7 +587,7 @@ void LaTeX::deplog(DepTable & head)
                //     absolute path and should
                //     be inserted.
                if (AbsolutePath(foundfile)) {
-                       lyxerr[Debug::LATEX] << "AbsolutePath file: " 
+                       lyxerr[Debug::DEPEND] << "AbsolutePath file: " 
                                             << foundfile << endl;
                        // On inital insert we want to do the update at once
                        // since this file can not be a file generated by
@@ -595,7 +600,7 @@ void LaTeX::deplog(DepTable & head)
                //     insert it into head
                if (FileInfo(OnlyFilename(foundfile)).exist()) {
                        if (suffixIs(foundfile, ".aux")) {
-                               lyxerr[Debug::LATEX] << "We don't want "
+                               lyxerr[Debug::DEPEND] << "We don't want "
                                                     << OnlyFilename(foundfile)
                                                     << " in the dep file"
                                                     << endl;
@@ -603,19 +608,19 @@ void LaTeX::deplog(DepTable & head)
                                // This is a tex file generated by LyX
                                // and latex is not likely to change this
                                // during its runs.
-                               lyxerr[Debug::LATEX] << "Tmpdir TeX file: "
+                               lyxerr[Debug::DEPEND] << "Tmpdir TeX file: "
                                                     << OnlyFilename(foundfile)
                                                     << endl;
                                head.insert(foundfile, true);
                        } else {
-                               lyxerr[Debug::LATEX] << "In tmpdir file:"
+                               lyxerr[Debug::DEPEND] << "In tmpdir file:"
                                                     << OnlyFilename(foundfile)
                                                     << endl;
                                head.insert(OnlyFilename(foundfile));
                        }
                        continue;
                }
-               lyxerr[Debug::LATEX]
+               lyxerr[Debug::DEPEND]
                        << "Not a file or we are unable to find it."
                        << endl;
        }
@@ -632,10 +637,9 @@ void LaTeX::deptex(DepTable & head)
                        tmp = ChangeExtension(file,
                                              all_files[i].extension,
                                              true);
-                       lyxerr[Debug::LATEX] << "deptex: " << tmp << endl;
+                       lyxerr[Debug::DEPEND] << "deptex: " << tmp << endl;
                        if (fi.newFile(tmp).exist())
                                head.insert(tmp);
                }
        }
 }
-
index a19fffe26689cbd3f906c7cba237e55a7e886c8a..ffdcc8408143b36a2a90f1e012dc63b544313548 100644 (file)
@@ -3823,17 +3823,18 @@ string Buffer::getReferenceList(char delim)
 {
        /// if this is a child document and the parent is already loaded
        /// Use the parent's list instead  [ale990407]
-       if (!params.parentname.empty() && bufferlist.exists(params.parentname)) {
+       if (!params.parentname.empty()
+           && bufferlist.exists(params.parentname)) {
                Buffer * tmp = bufferlist.getBuffer(params.parentname);
                if (tmp)
-                 return tmp->getReferenceList(delim);
+                       return tmp->getReferenceList(delim);
        }
 
        LyXParagraph * par = paragraph;
        LyXParagraph::size_type pos;
        Inset * inset;
         string lst;
-       while (par){
+       while (par) {
                pos = -1;
                while ((inset = par->ReturnNextInsetPointer(pos))){     
                        for (int i = 0; i < inset->GetNumberOfLabels(); ++i) {
@@ -3842,7 +3843,7 @@ string Buffer::getReferenceList(char delim)
                                lst += inset->getLabel(i);
                        }
                        ++pos;
-               } 
+               }
                par = par->next;
        }
        lyxerr.debug() << "References(" <<  lst << ")" << endl;
index 72e14b6e3dded589d20e81fc256f3d4492d00bf7..78d837411796951d578ddcc58ea6d4654604761c 100644 (file)
@@ -4,7 +4,7 @@
  *           LyX, The Document Processor
  *      
  *          Copyright 1995 Matthias Ettrich
- *           Copyright 1995-1999 The LyX Team.
+ *           Copyright 1995-2000 The LyX Team.
  *
  * ====================================================== */
 
index abee30ac35f15c3bd7a8468c1cae1244ca92a038..f30249405fbba47217ec0e119e37c4730c3a1ec5 100644 (file)
@@ -32,6 +32,7 @@ static error_item errorTags[] = {
        { Debug::LYXRC,         "lyxrc",        "Configuration files reading"},
        { Debug::KBMAP,         "kbmap",        "Custom keyboard definition"},
        { Debug::LATEX,         "latex",        "LaTeX generation/execution"},
+       { Debug::DEPEND,        "depend",       "Dependency information"},
        { Debug::MATHED,        "mathed",       "Math editor"},
        { Debug::FONT,          "font",         "Font handling"},
        { Debug::TCLASS,        "tclass",       "Textclass files reading"},
@@ -55,7 +56,7 @@ Debug::type Debug::value(string const & val)
        while (!v.empty()) {
                string::size_type st = v.find(',');
                string tmp(lowercase(v.substr(0, st)));
-               if (tmp.empty()) 
+               if (tmp.empty())
                        break;
                // Is it a number?
                if (isStrInt(tmp)) 
index c7fcb43fa86c21d92b0dd929cd49f8ba68b7628f..bc396bd5437fc43141b10cf4b003717a270a65c9 100644 (file)
@@ -47,13 +47,16 @@ struct Debug {
                ///
                ACTION     = (1 << 14),   // 16384
                ///
-               LYXLEX     = (1 << 15)
+               LYXLEX     = (1 << 15),
+               ///
+               DEPEND     = (1 << 16)
        };
        ///
        static const type ANY = type(INFO | INIT | KEY | TOOLBAR |
                                     PARSER | LYXRC | KBMAP | LATEX |
                                     MATHED | FONT | TCLASS | LYXVC |
-                                    LYXSERVER | ROFF | ACTION | LYXLEX);
+                                    LYXSERVER | ROFF | ACTION | LYXLEX |
+                                    DEPEND);
        ///
        friend inline void operator|=(Debug::type & d1, Debug::type d2);
        
index 8df9c5746e8cfed6026c9848609ebd05e0c88c98..d3ca88d12e2a006c73ffa433bf3672df248ae45e 100644 (file)
@@ -4,7 +4,7 @@
  *           LyX, The Document Processor
  *      
  *         Copyright 1995 Matthias Ettrich
- *          Copyright 1995-1999 The LyX Team.
+ *          Copyright 1995-2000 The LyX Team.
  *
  * ====================================================== */
 
@@ -98,7 +98,7 @@ void InsetLatexAccent::checkContents()
        }
         if (contents[0] != '\\') return; // demand that first char is a '\\'
 
-       lyxerr.debug() << "Decode: " << contents << endl;
+       lyxerr[Debug::KEY] << "Decode: " << contents << endl;
 
         remdot = false; plusasc = false; plusdesc = false;
 
@@ -213,12 +213,12 @@ void InsetLatexAccent::checkContents()
                        break;
                }
                //ic = (modtype == DOT_LESS_J ? 'j' : 'i');
-               lyxerr.debug() << "Contents: [" << contents << "]"
-                              << ", ic: " << ic 
-                              << ", top: " << plusasc 
-                              << ", bot: " << plusdesc 
-                              << ", dot: " << remdot 
-                              << ", mod: " << modtype << endl;
+               lyxerr[Debug::KEY] << "Contents: [" << contents << "]"
+                                  << ", ic: " << ic 
+                                  << ", top: " << plusasc 
+                                  << ", bot: " << plusdesc 
+                                  << ", dot: " << remdot 
+                                  << ", mod: " << modtype << endl;
                // Special case for space
        } else if (contents[3] == '}') {
                ic = ' ';
@@ -253,12 +253,12 @@ void InsetLatexAccent::checkContents()
                if (contents[++i] != '}' && contents[++i]) return;
                                           
                // fine, the char is properly decoded now (hopefully)
-               lyxerr.debug() << "Contents: [" << contents << "]"
-                              << ", ic: " << ic
-                              << ", top: " << plusasc 
-                              << ", bot: " << plusdesc 
-                              << ", dot: " << remdot
-                              << ", mod: " << modtype << endl;
+               lyxerr[Debug::KEY] << "Contents: [" << contents << "]"
+                                  << ", ic: " << ic
+                                  << ", top: " << plusasc 
+                                  << ", bot: " << plusdesc 
+                                  << ", dot: " << remdot
+                                  << ", mod: " << modtype << endl;
        }
         candisp = true;
 }
@@ -413,7 +413,7 @@ void InsetLatexAccent::Draw(LyXFont font,
                        float tmpx = 0;
                        if (font.shape() == LyXFont::ITALIC_SHAPE)
                                tmpx += (8.0 * hg) / 10.0; // italic
-                       lyxerr.debug() << "Removing dot." << endl;
+                       lyxerr[Debug::KEY] << "Removing dot." << endl;
                        // remove the dot first
                        scr.fillRectangle(gc_clear, int(x + tmpx),
                                          tmpvar, wid,
index 03cf38538f74a4a937582e5c58ff26a93fec650f..6572f3df2007f4743526523fe26679cabc8c4062 100644 (file)
@@ -519,7 +519,7 @@ kb_keymap::~kb_keymap()
 {
        if(!table) return;
        for(kb_key * t = table; t->code != NoSymbol; ++t)
-               if(t->table)
+               if(t->table) // DEL LINE
                        delete t->table;
        delete table;
 }
index e2e15f228608cf9f9c8443457c8ad5dd93588dab..fd320bf97987e9fe28a254c05d5b101f1942160b 100644 (file)
@@ -89,13 +89,12 @@ public:
        
        
        ///
-       ~kb_sequence()
-               {
-                       if (sequence != staticseq) {
-                               delete sequence;
-                               delete modifiers;
-                       }
+       ~kb_sequence() {
+               if (sequence != staticseq) {
+                       delete sequence;
+                       delete modifiers;
                }
+       }
        
        /// Add a key to the key sequence and look it up in the curmap
        /** Add a key to the key sequence and look it up in the curmap
index e0d5ce68d338d02bd6bdf3423bb55c885ab654c4..4a3e3a61e39c4df694ff138c8d6acfb73322abb3 100644 (file)
@@ -202,10 +202,10 @@ LyXGUI::~LyXGUI()
 {
         // Lyxserver was created in this class so should be destroyed
         // here.  asierra-970604
-        if (lyxserver) {
+        if (lyxserver) { // DEL LINE
                delete lyxserver;
                lyxserver = 0;
-       }
+       } // DEL LINE
 
        CloseLyXLookup();
 }
index d63e27532b2c3b3849f1f8813e250ad1d0455560..e8cc0548b1ac826c9bd1e7ad39d83df4516a4c33 100644 (file)
@@ -133,10 +133,10 @@ LyX::LyX(int * argc, char * argv[])
 // A destructor is always necessary  (asierra-970604)
 LyX::~LyX()
 {
-       if (lastfiles)
+       if (lastfiles) // DEL LINE
                delete lastfiles;
 
-       if (lyxGUI)
+       if (lyxGUI) // DEL LINE
                delete lyxGUI;
 }
 
index 3097069d6652395bf4ad3c250e130d8188bdf171..e79b2ed07269f7ae79046a70f608e86b66ec11e9 100644 (file)
@@ -33,9 +33,9 @@ LyXVC::~LyXVC()
                        fl_hide_form(browser->LaTeXLog);
                fl_free_form(browser->LaTeXLog);
        }
-       if (vcs) {
+       if (vcs) { // DEL LINE
                delete vcs;
-       }
+       } // DEL LINE
 }
 
 
index b7de91e845fe53f9b0cbab65882352c1c1fdedb8..83618c024fd9684ee06713a1dc804f2d89dda470 100644 (file)
@@ -437,7 +437,8 @@ struct MathedRowSt {
     ///
     ~MathedRowSt() {
        delete[] w;
-       if (label) delete[] label;
+       if (label) // DEL LINE
+               delete[] label;
     }
     /// Should be const but...
     MathedRowSt * getNext() const  { return next; }
index ff35b90fff56640ce5d10d3ee3fb2f4e19af7946..b4340ad317edea706347d64829d9693f51ae93b7 100644 (file)
@@ -517,7 +517,7 @@ MathAccentInset::MathAccentInset(MathedInset *ins, int cd, short st)
 
 MathAccentInset::~MathAccentInset()
 {
-    if (inset)
+    if (inset) // DEL LINE
       delete inset;
 }
 
index 512965c316e6b87a6767d3cfa203a62f98f1f16a..f1f2f1c2ce8795a28d8284d82459d55aa5a0026e 100644 (file)
@@ -394,7 +394,7 @@ void MathedIter::Clear()
    Reset();  
    while (OK()) {
       if (IsInset()) {
-        MathedInset* inset = GetInset();
+        MathedInset * inset = GetInset();
          if (inset->GetType()!= LM_OT_MACRO_ARG)
            delete inset;
          Delete();
@@ -519,7 +519,7 @@ void MathedXIter::Merge(LyxArrayBase *a0)
                crow = r;
            } else {
                Delete();
-               pos2--;
+               --pos2;
            }
        }
         Next();    
index 77f47449fe925a255b10188c9d109ceb702ab5a0..58b5c563005c9c065e9483f9d932bbb06b36242d 100644 (file)
@@ -157,7 +157,8 @@ BitmapMenu::BitmapMenu(int n,  FL_OBJECT * bt, BitmapMenu * prevx): nb(n)
 
 BitmapMenu::~BitmapMenu()
 {
- if (next) delete next;
+ if (next) // DEL LINE
+        delete next;
  if (form->visible) Hide();
  fl_free_form(form);  
  delete[] bitmap;
index a0635fdd44dcd9f342c30b005375ae533a5be4e9..8207582b2e491f35cd40ca11d9a2380a94a93ba4 100644 (file)
@@ -142,8 +142,7 @@ void LyXParagraph::writeFile(ostream & os, BufferParams & params,
                                os << "\n\\begin_float "
                                   << string_footnotekinds[footnotekind]
                                   << " ";
-                       }
-                       else {
+                       } else {
                                os << "\n\\end_float ";
                        }
                }
@@ -155,8 +154,7 @@ void LyXParagraph::writeFile(ostream & os, BufferParams & params,
                                        os << "\n\\begin_deeper ";
                                        ++dth;
                                }
-                       }
-                       else {
+                       } else {
                                while (depth < dth) {
                                        os << "\n\\end_deeper ";
                                        --dth;
@@ -233,8 +231,7 @@ void LyXParagraph::writeFile(ostream & os, BufferParams & params,
                         }
                        os << '\n';
                 }
-       }
-       else {
+       } else {
                // Dummy layout. This means that a footnote ended.
                os << "\n\\end_float ";
                footflag = LyXParagraph::NO_FOOTNOTE;
@@ -553,14 +550,14 @@ LyXParagraph::~LyXParagraph()
        while (insettable) {
                tmpinset = insettable;
                insettable = insettable->next;
-               if (tmpinset->inset)
+               if (tmpinset->inset) // DEL LINE
                        delete tmpinset->inset;
                delete tmpinset;
                if (insettable && insettable->next == insettable) {
                        // somehow this recursion appears occasionally
                        // but I can't find where.  This bandaid
                        // helps but isn't the best fix. (ARRae)
-                       if (insettable->inset) {
+                       if (insettable->inset) { // DEL LINE
                                delete insettable->inset;
                        }
                        delete insettable;
@@ -578,12 +575,12 @@ LyXParagraph::~LyXParagraph()
 #endif
 
        /* table stuff -- begin*/ 
-       if (table)
+       if (table) // DEL LINE
                delete table;
        /* table stuff -- end*/ 
 
         // ale970302
-       if (bibkey)
+       if (bibkey) // DEL LINE
                delete bibkey;
 }
 
@@ -621,7 +618,7 @@ void LyXParagraph::Erase(LyXParagraph::size_type pos)
                                tmpi = tmpi->next;
                        }
                        if (tmpi) {     // this should always be true
-                               if (tmpi->inset) // delete the inset if it exists
+                               if (tmpi->inset) // delete the inset if it exists // DEL LINE
                                        delete tmpi->inset;
                                if (tmpi == insettable)
                                        insettable = tmpi->next;
@@ -2201,7 +2198,7 @@ Inset * LyXParagraph::ReturnNextInsetPointer(LyXParagraph::size_type & pos)
        for (InsetList::iterator it = insetlist.begin();
             it != insetlist.end(); ++it) {
                if ((*it).pos >= pos) {
-                       if (it2 != insetlist.end() || (*it).pos < (*it2).pos)
+                       if (it2 == insetlist.end() || (*it).pos < (*it2).pos)
                                it2 = it;
                }
        }
index f24a0af8858a2625a69542f4982b31efe02ccedb..b239790c9209227a667cbda3d6b2218809744bdf 100644 (file)
@@ -94,7 +94,8 @@ struct isp_result {
                misses = static_cast<char**>(0);
        }
        ~isp_result() {
-               if (misses) delete[] misses;
+               if (misses) // DEL LINE
+                       delete[] misses;
        }
 };
 
index ea6bbab2313ad67c778c725f2f32480ce4267cf7..286fbdc97509bfeec45843ff453499a15a7e05bc 100644 (file)
@@ -185,7 +185,7 @@ DebugStream::~DebugStream()
 {
        delete nullstream.rdbuf(0); // Without this we leak
        delete rdbuf(0);            // Without this we leak
-       if (internal)
+       if (internal) // DEL LINE
                delete internal;
 }
 
index b01cca4d3dfbfe26e9af3e318350d3dc53a82b03..04a75b81badf306e0dd21081591f055a35bdaac0 100644 (file)
@@ -292,10 +292,10 @@ void LyXTable::set_row_column_number_info()
        row = 0;
        column = 0;
 
-       if (rowofcell)
+       if (rowofcell) // DEL LINE
                delete [] rowofcell;
        rowofcell = new int[numberofcells];
-       if (columnofcell)
+       if (columnofcell) // DEL LINE
                delete [] columnofcell;
        columnofcell = new int[numberofcells];