* src/insets/insetcharstyle.C

(InsetCharStyle::doDispatch): prevent non-standard paragraph layout
	from being pasted into charstyle inset

	* src/insets/insetcharstyle.h: disable non-standard layouts



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_4_X@13523 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Martin Vermeer 2006-03-29 08:48:59 +00:00
parent d0872f2ce5
commit 0389d82117
3 changed files with 19 additions and 2 deletions

View File

@ -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 @@ void InsetCharStyle::doDispatch(LCursor & cur, FuncRequest & cmd)
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;

View File

@ -69,6 +69,8 @@ public:
///
void getDrawFont(LyXFont &) const;
///
bool forceDefaultParagraphs(idx_type) const { return true; }
///
int latex(Buffer const &, std::ostream &,
OutputParams const &) const;
///

View File

@ -68,7 +68,7 @@ What's new
- More sensible default label in table and figure captions (bug 1999).
- Do not skip change in "Merge changes..." dialog (bug 2212).
- Do not skip first change in "Merge changes..." dialog (bug 2212).
- Improve handling of the labeling environment in KOMA letters (bug 2246).
@ -115,6 +115,8 @@ What's new
- Fix bug 2380: Pasting external material into table causes seg fault
- Prevent non-standard paragraph layouts in charstyle insets
* Configuration/Installation:
- Don't use the -mms-bitfields compiler switch on mingw and cygwin, since