On Fri, Mar 24, 2006 at 10:47:11PM +0200, Martin Vermeer wrote:
> On Fri, Mar 24, 2006 at 08:44:46PM +0100, Georg Baum wrote:
> > Am Freitag, 24. März 2006 20:22 schrieb Martin Vermeer:
> > > That would be this patch.
> > > 
> > > Unless anyone sees a problem, this goes in soon.
> > 
> > I don't see why the deleted lines in ERT are no longer necessary. Could 
> > you please explain?
> 
> Hmmm, yes you're right. This only covers the case of inserting an inset,
> not manually pasting...
> 
> The thinking goes on.

It appears brute force is the only way here. See attached.

- Martin 
Index: insetcharstyle.C
===================================================================
--- insetcharstyle.C    (revision 13473)
+++ insetcharstyle.C    (working copy)
@@ -14,7 +14,9 @@
 
 #include "insetcharstyle.h"
 
+#include "buffer.h"
 #include "BufferView.h"
+#include "bufferparams.h"
 #include "dispatchresult.h"
 #include "funcrequest.h"
 #include "FuncStatus.h"
@@ -233,7 +235,18 @@
                        else
                                InsetText::doDispatch(cur, cmd);
                        break;
-
+       case LFUN_PASTE:
+       case LFUN_PASTESELECTION: {
+               InsetCollapsable::doDispatch(cur, cmd);
+               BufferParams const & bp = cur.buffer().params();
+               LyXLayout_ptr const layout =
+                       bp.getLyXTextClass().defaultLayout();
+               ParagraphList::iterator const end = paragraphs().end();
+               for (ParagraphList::iterator par = paragraphs().begin(); 
+                               par != end; ++par)
+                       par->layout(layout);
+               break;
+               }
                default:
                        InsetCollapsable::doDispatch(cur, cmd);
                        break;
Index: insetcharstyle.h
===================================================================
--- insetcharstyle.h    (revision 13473)
+++ insetcharstyle.h    (working copy)
@@ -69,6 +69,8 @@
        ///
        void getDrawFont(LyXFont &) const;
        ///
+       bool forceDefaultParagraphs(idx_type) const { return true; }
+       ///
        int latex(Buffer const &, std::ostream &,
                  OutputParams const &) const;
        ///

Attachment: pgpCLRX9595A8.pgp
Description: PGP signature

Reply via email to