On Wed, Feb 20, 2002 at 04:15:48PM +0100, Lars Gullik Bjønnes wrote: > Martin Vermeer <[EMAIL PROTECTED]> writes: > > | lyxlayout.C: In method `const class string & LyXLayout::name() const': > | lyxlayout.C:740: warning: returning reference to temporary > | lyxlayout.C: In method `const class string & LyXLayout::obsoleted_by() const': > | lyxlayout.C:752: warning: returning reference to temporary > > Fixing these fixed the problem. > > I have now a patch that apperars to be working, but I have not tested > switching layout<->layout, reading nonexistant layout etc. > > The pach has been cleaned up a bit and is closer to ready for > inclusion. > > People, please test (and be careful) > Report any and all problems to me...
Yes, sure... using a static works too. Not pretty... but what's a man to do ;-) Please put the following also in your local tree, or I suspect Bug 221 will still be alive. Martin
Index: CutAndPaste.C =================================================================== RCS file: /cvs/lyx/lyx-devel/src/CutAndPaste.C,v retrieving revision 1.46 diff -u -b -B -p -r1.46 CutAndPaste.C --- CutAndPaste.C 2002/01/17 10:54:30 1.46 +++ CutAndPaste.C 2002/02/20 15:17:48 @@ -223,37 +225,6 @@ bool CutAndPaste::pasteSelection(Paragra Paragraph * tmppar = *par; int tmppos = pos; - // There are two cases: cutbuffer only one paragraph or many - if (!buf->next()) { - // only within a paragraph - Paragraph * tmpbuf = new Paragraph(*buf, false); - - // Some provisions should be done here for checking - // if we are inserting at the beginning of a - // paragraph. If there are a space at the beginning - // of the text to insert and we are inserting at - // the beginning of the paragraph the space should - // be removed. - while (buf->size()) { - // This is an attempt to fix the - // "never insert a space at the - // beginning of a paragraph" problem. - if (!tmppos && buf->isLineSeparator(0)) { - buf->erase(0); - } else { - buf->cutIntoMinibuffer(current_view->buffer()->params, 0); - buf->erase(0); - if (tmppar->insertFromMinibuffer(tmppos)) - ++tmppos; - } - } - delete buf; - buf = tmpbuf; - *endpar = tmppar->next(); - pos = tmppos; - } else { - // many paragraphs - // make a copy of the simple cut_buffer Paragraph * tmpbuf = buf; Paragraph * simple_cut_clone = new Paragraph(*tmpbuf, false); @@ -345,7 +316,6 @@ bool CutAndPaste::pasteSelection(Paragra } // restore the simple cut buffer buf = simple_cut_clone; - } return true; }
msg33271/pgp00000.pgp
Description: PGP signature