#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;
// new environment and set also another font if that is required
tmpbuf = buf;
while(tmpbuf) {
+ // set the inset owner of this paragraph
+ tmpbuf->setInsetOwner((*par)->inInset());
for(pos_type i = 0; i < tmpbuf->size(); ++i) {
if (tmpbuf->getChar(i) == Paragraph::META_INSET) {
if (!(*par)->insetAllowed(tmpbuf->getInset(i)->lyxCode()))