Fix the bug reported by Markus Mayer, that paragraph styles like

itemize too readily enter into charstyle insets.

	* insetcharstyle.C
	(InsetCharStyle::doDispatch): force pasted paragraphs to document 
	default style 

	* insetcharstyle.h: add forceDefaultParagraphs to true



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13494 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Martin Vermeer 2006-03-25 16:23:06 +00:00
parent e46d6cfc53
commit 23b74fa112
2 changed files with 16 additions and 1 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;
///