]> git.lyx.org Git - lyx.git/blobdiff - src/CutAndPaste.C
Fix bugs #32 and #52.
[lyx.git] / src / CutAndPaste.C
index 4990bb234d3d8bbe7e7e01e63fc93f1269efe5a3..da7a4ae9bd2a05b49eec365185033b6ef72085be 100644 (file)
@@ -9,19 +9,21 @@
 
 #include <config.h>
 
+#ifdef __GNUG__
+#pragma implementation
+#endif
+
 #include "CutAndPaste.h"
 #include "BufferView.h"
 #include "buffer.h"
 #include "paragraph.h"
-#include "insets/inseterror.h"
 #include "lyx_gui_misc.h"
 #include "lyxcursor.h"
 #include "gettext.h"
 #include "iterators.h"
+#include "lyxtextclasslist.h"
 
-#ifdef __GNUG__
-#pragma implementation
-#endif
+#include "insets/inseterror.h"
 
 using std::pair;
 using lyx::pos_type;
@@ -288,7 +290,8 @@ bool CutAndPaste::pasteSelection(Paragraph ** par, Paragraph ** endpar,
                }
                
                // make sure there is no class difference
-               SwitchLayoutsBetweenClasses(textclass, tc, buf);
+               SwitchLayoutsBetweenClasses(textclass, tc, buf,
+                                           current_view->buffer()->params);
                
                // make the buf exactly the same layout than
                // the cursor paragraph
@@ -362,7 +365,9 @@ int CutAndPaste::nrOfParagraphs()
 
 
 int CutAndPaste::SwitchLayoutsBetweenClasses(textclass_type c1,
-                                            textclass_type c2, Paragraph * par)
+                                            textclass_type c2,
+                                            Paragraph * par,
+                                            BufferParams const & bparams)
 {
        int ret = 0;
        if (!par || c1 == c2)
@@ -392,7 +397,9 @@ int CutAndPaste::SwitchLayoutsBetweenClasses(textclass_type c1,
                                + textclasslist.NameOfClass(c1) + _(" to ")
                                + textclasslist.NameOfClass(c2);
                        InsetError * new_inset = new InsetError(s);
-                       par->insertInset(0, new_inset);
+                       par->insertInset(0, new_inset,
+                                        LyXFont(LyXFont::ALL_INHERIT,
+                                                bparams.language));
                }
        }
        return ret;