+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
}
// 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
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)
+ 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;
static
int SwitchLayoutsBetweenClasses(lyx::textclass_type class1,
lyx::textclass_type class2,
- Paragraph * par);
+ Paragraph * par,
+ BufferParams const & bparams);
///
static
bool checkPastePossible(Paragraph *);
+ 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 =
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) {
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) {