From 23b74fa1122bcd0e502aab4b7b042b8576de0099 Mon Sep 17 00:00:00 2001 From: Martin Vermeer Date: Sat, 25 Mar 2006 16:23:06 +0000 Subject: [PATCH] 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 --- src/insets/insetcharstyle.C | 15 ++++++++++++++- src/insets/insetcharstyle.h | 2 ++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/insets/insetcharstyle.C b/src/insets/insetcharstyle.C index 0077b56228..ba4a13c208 100644 --- a/src/insets/insetcharstyle.C +++ b/src/insets/insetcharstyle.C @@ -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; diff --git a/src/insets/insetcharstyle.h b/src/insets/insetcharstyle.h index c1e59d9e3f..375a5c84a0 100644 --- a/src/insets/insetcharstyle.h +++ b/src/insets/insetcharstyle.h @@ -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; ///