]> git.lyx.org Git - features.git/commitdiff
Crash fix from Angus
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 7 Dec 2000 15:30:53 +0000 (15:30 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 7 Dec 2000 15:30:53 +0000 (15:30 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1269 a592a061-630c-0410-9148-cb99ea01b6c8

ChangeLog
src/CutAndPaste.C
src/lyxparagraph.h
src/paragraph.C
src/tabular.C

index 2241fe98c62caf914de742226456334224f27c80..dac8695a656199af2c690a97674a04d05b338704 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2000-12-07  Angus Leeming <a.leeming@ic.ac.uk>
+
+       * src/lyxparagraph.h, src/paragraph.C (CopyIntoMinibuffer): pass a
+       (Buffer const &), not a (BufferParams const &) and so fix a crash
+       caused by using current_view before it had been initialised. Not
+       the best way to do this, but much easier than changing
+       Inset::Clone(Buffer const &) to Inset::Clone().
+
+       * src/CutAndPaste.C:
+       * src/tabular.C: changed call to CopyIntoMinibuffer().
+
 2000-12-07  Jean-Marc Lasgouttes  <Jean-Marc.Lasgouttes@inria.fr>
 
        * lib/ui/default.ui: put TOC at the beginning of the TOC menu.
@@ -7,8 +18,8 @@
 
 2000-12-06  Angus Leeming <a.leeming@ic.ac.uk>
 
-       * src/frontends/xforms/FormPreferences.C (ScreenFonts::build): changed
-       filter for screen fonts input filter from int to float
+       * src/frontends/xforms/FormPreferences.C (ScreenFonts::build):
+       changed filter for screen fonts input filter from int to float
 
        * src/frontends/xforms/input_validators.c: removed.
        * src/frontends/xforms/input_validators.C: new file. Can now call C++
@@ -17,9 +28,9 @@
        * src/frontends/xforms/input_validators.[Ch]
        (fl_unsigned_float_filter): new filter function.
 
-       * src/frontends/xforms/forms/fdfixc.sed: I defy gettext to get confused
-       now! And if you think I'm going to do this in ./forms/fdfix.sh with
-       its "sed -e" declarations, then think again!
+       * src/frontends/xforms/forms/fdfixc.sed: I defy gettext to get
+       confused now! And if you think I'm going to do this in
+       ./forms/fdfix.sh with its "sed -e" declarations, then think again!
                           
 2000-12-06  Lars Gullik Bjønnes  <larsbj@lyx.org>
 
index da51fb0ac635f2a91b89d5ae871284dd0ec30857..ef04824c567c1f18cbef1033357dc16deb3ee103 100644 (file)
@@ -92,8 +92,7 @@ bool CutAndPaste::cutSelection(LyXParagraph * startpar, LyXParagraph ** endpar,
        if (end > startpar->Last())
            end = startpar->Last();
        for (; i < end; ++i) {
-           startpar->CopyIntoMinibuffer(current_view->buffer()->params,
-                                        start);
+           startpar->CopyIntoMinibuffer(*current_view->buffer(), start);
            startpar->Erase(start);
 
            buf->InsertFromMinibuffer(buf->Last());
@@ -188,7 +187,7 @@ bool CutAndPaste::copySelection(LyXParagraph * startpar, LyXParagraph * endpar,
        if (end > startpar->Last())
            end = startpar->Last();
        for (; i < end; ++i) {
-           startpar->CopyIntoMinibuffer(current_view->buffer()->params, i);
+           startpar->CopyIntoMinibuffer(*current_view->buffer(), i);
            buf->InsertFromMinibuffer(buf->Last());
        }
     } else {
index 6d8d6129109aa9241555ef4440b7b4c563d3ef41..98e73a11ecef9a592dcf5b4209913ff512747709 100644 (file)
@@ -477,8 +477,10 @@ public:
        ///
        void CloseFootnote(size_type pos);
 #endif
-       /// important for cut and paste
-       void CopyIntoMinibuffer(BufferParams const &, size_type pos) const;
+       /** important for cut and paste
+           Temporary change from BufferParams to Buffer. Will revert when we
+           get rid of the argument to Inset::Clone(Buffer const &) */
+       void CopyIntoMinibuffer(Buffer const &, size_type pos) const;
        ///
        void CutIntoMinibuffer(BufferParams const &, size_type pos);
        ///
index bb4373347ac4c2127eb3fb1904ecf694f06fe3af..0360feceb7f6bf21bc1b6c5918e1f4e6d8ca9f56 100644 (file)
@@ -407,15 +407,17 @@ void LyXParagraph::validate(LaTeXFeatures & features) const
 
 
 // First few functions needed for cut and paste and paragraph breaking.
-void LyXParagraph::CopyIntoMinibuffer(BufferParams const & bparams,
+void LyXParagraph::CopyIntoMinibuffer(Buffer const & buffer,
                                      LyXParagraph::size_type pos) const
 {
+       BufferParams bparams = buffer.params;
+
        minibuffer_char = GetChar(pos);
        minibuffer_font = GetFontSettings(bparams, pos);
        minibuffer_inset = 0;
        if (minibuffer_char == LyXParagraph::META_INSET) {
                if (GetInset(pos)) {
-                       minibuffer_inset = GetInset(pos)->Clone(*current_view->buffer());
+                       minibuffer_inset = GetInset(pos)->Clone(buffer);
                } else {
                        minibuffer_inset = 0;
                        minibuffer_char = ' ';
index e417847a0272f4614d4c6d4dbcf482c5576eae62..546ab310efca947fa66d4001b413253e10958bab 100644 (file)
@@ -1463,7 +1463,7 @@ void LyXTabular::OldFormatRead(LyXLex & lex, string const & fl)
                par->InsertChar(i, ' ');
            }
        }
-       par->CopyIntoMinibuffer(owner_->BufferOwner()->params, i);
+       par->CopyIntoMinibuffer(*owner_->BufferOwner(), i);
        inset->par->InsertFromMinibuffer(inset->par->Last());
     }
     delete par;