* src/Text3.cpp (doInsertInset):

- Improve the behaviour when inserting a collapsable inset 
	  over a multi-paragraph selection.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_5_X@23511 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jürgen Spitzmüller 2008-03-06 13:34:42 +00:00
parent 98b08ee76b
commit ba956235d1
2 changed files with 12 additions and 2 deletions

View File

@ -281,11 +281,18 @@ bool doInsertInset(Cursor & cur, Text * text,
// metrics might be invalid at this point (bug 4502)
cur.bv().updateMetrics();
lyx::dispatch(FuncRequest(LFUN_PASTE, "0"));
// reset first par to default
if (cur.lastpit() != 0 || cur.lastpos() != 0) {
if (cur.lastpit() == 0) {
// reset first par to default
Layout_ptr const layout =
cur.buffer().params().getTextClass().defaultLayout();
cur.text()->paragraphs().begin()->layout(layout);
} else {
// reset surrounding par to default
docstring const layoutname =
cur.buffer().params().getTextClass().defaultLayoutName();
cur.leaveInset(*inset);
text->setLayout(cur, layoutname);
}
}
return true;

View File

@ -77,6 +77,9 @@ What's new
- When cutting a selection do not leave a dangling paragraph (bug 3995).
- Improve the behaviour when inserting a collapsable inset over a multi-
paragraph selection.
* DOCUMENTATION