Use buffer language when inserting error insets.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3213 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Dekel Tsur 2001-12-15 14:34:17 +00:00
parent 63fa06783e
commit d4b53ea2c9
6 changed files with 22 additions and 9 deletions

View File

@ -1,3 +1,8 @@
2001-12-15 Dekel Tsur <dekelts@tau.ac.il>
* CutAndPaste.C (SwitchLayoutsBetweenClasses): Use buffer language
when inserting error insets.
2001-12-13 Juergen Vigna <jug@sad.it>
* undo_funcs.C (textRedo/Undo): fixed as the first paragraph was

View File

@ -288,7 +288,8 @@ bool CutAndPaste::pasteSelection(Paragraph ** par, Paragraph ** endpar,
}
// make sure there is no class difference
SwitchLayoutsBetweenClasses(textclass, tc, buf);
SwitchLayoutsBetweenClasses(textclass, tc, buf,
current_view->buffer()->params);
// make the buf exactly the same layout than
// the cursor paragraph
@ -362,7 +363,9 @@ int CutAndPaste::nrOfParagraphs()
int CutAndPaste::SwitchLayoutsBetweenClasses(textclass_type c1,
textclass_type c2, Paragraph * par)
textclass_type c2,
Paragraph * par,
BufferParams const & bparams)
{
int ret = 0;
if (!par || c1 == c2)
@ -392,7 +395,9 @@ int CutAndPaste::SwitchLayoutsBetweenClasses(textclass_type c1,
+ textclasslist.NameOfClass(c1) + _(" to ")
+ textclasslist.NameOfClass(c2);
InsetError * new_inset = new InsetError(s);
par->insertInset(0, new_inset);
par->insertInset(0, new_inset,
LyXFont(LyXFont::ALL_INHERIT,
bparams.language));
}
}
return ret;

View File

@ -45,7 +45,8 @@ public:
static
int SwitchLayoutsBetweenClasses(lyx::textclass_type class1,
lyx::textclass_type class2,
Paragraph * par);
Paragraph * par,
BufferParams const & bparams);
///
static
bool checkPastePossible(Paragraph *);

View File

@ -542,9 +542,9 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, Paragraph *& par,
+ layoutname + _(" to ")
+ textclasslist.NameOfLayout(params.textclass, par->layout);
InsetError * new_inset = new InsetError(s);
par->insertInset(0, new_inset);
par->setFont(0, LyXFont(LyXFont::ALL_INHERIT,
params.language));
par->insertInset(0, new_inset,
LyXFont(LyXFont::ALL_INHERIT,
params.language));
}
// Test whether the layout is obsolete.
LyXLayout const & layout =

View File

@ -353,7 +353,8 @@ bool QDocument::class_apply()
setMinibuffer(lv_, _("Converting document to new document class..."));
CutAndPaste cap;
int ret = cap.SwitchLayoutsBetweenClasses(params.textclass, new_class,
lv_->buffer()->paragraph);
lv_->buffer()->paragraph,
lv_->buffer()->params);
if (ret) {
string s;
if (ret==1) {

View File

@ -745,7 +745,8 @@ bool FormDocument::class_apply()
setMinibuffer(lv_, _("Converting document to new document class..."));
int ret = CutAndPaste::SwitchLayoutsBetweenClasses(
old_class, params.textclass,
lv_->buffer()->paragraph);
lv_->buffer()->paragraph,
lv_->buffer()->params);
if (ret) {
string s;
if (ret==1) {