mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-11 11:08:41 +00:00
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:
parent
63fa06783e
commit
d4b53ea2c9
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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 *);
|
||||
|
@ -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 =
|
||||
|
@ -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) {
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user