]> git.lyx.org Git - lyx.git/blobdiff - src/paragraph.C
citation patch from Angus
[lyx.git] / src / paragraph.C
index a64c5d1f873adedbf471f7f9ec7e55991487d4ad..2919ea2b7f6de58e3f0c78eadedd1ae160bb69e6 100644 (file)
@@ -609,16 +609,18 @@ void LyXParagraph::Erase(LyXParagraph::size_type pos)
                }
 
                // Update all other entries.
-               for (; it != fontlist.end(); ++it)
+               FontList::iterator fend = fontlist.end();
+               for (; it != fend; ++it)
                        --(*it).pos;
 
                // Update the inset table.
                InsetTable search_inset(pos, 0);
+               InsetList::iterator lend = insetlist.end();
                for (InsetList::iterator it =
                             upper_bound(insetlist.begin(),
-                                        insetlist.end(),
+                                        lend,
                                         search_inset, matchIT());
-                    it != insetlist.end(); ++it)
+                    it != lend; ++it)
                        --(*it).pos;
 #ifndef NEW_INSETS
        } else {
@@ -729,7 +731,7 @@ void LyXParagraph::InsertInset(LyXParagraph::size_type pos,
 
 bool LyXParagraph::InsertInsetAllowed(Inset * inset)
 {
-       lyxerr << "LyXParagraph::InsertInsetAllowed" << endl;
+       //lyxerr << "LyXParagraph::InsertInsetAllowed" << endl;
        
        if (inset_owner)
                return inset_owner->InsertInsetAllowed(inset);
@@ -1649,8 +1651,10 @@ LyXParagraph * LyXParagraph::Clone() const
        result->inset_owner = inset_owner;
    
         // ale970302
-        result->bibkey = (bibkey) ? new InsetBibKey(bibkey): 0;
-               
+       if (bibkey)
+               result->bibkey = static_cast<InsetBibKey *>(bibkey->Clone());
+       else
+               result->bibkey = 0;
     
        // copy everything behind the break-position to the new paragraph