]> git.lyx.org Git - features.git/commitdiff
Use buffer language when inserting error insets.
authorDekel Tsur <dekelts@tau.ac.il>
Sat, 15 Dec 2001 14:34:17 +0000 (14:34 +0000)
committerDekel Tsur <dekelts@tau.ac.il>
Sat, 15 Dec 2001 14:34:17 +0000 (14:34 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3213 a592a061-630c-0410-9148-cb99ea01b6c8

src/ChangeLog
src/CutAndPaste.C
src/CutAndPaste.h
src/buffer.C
src/frontends/qt2/QDocument.C
src/frontends/xforms/FormDocument.C

index ff14ac48ab688c58702d2c7f70262c4e63066f7f..ff2ef23b1d4457534589047173f35b78b2e34f92 100644 (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
index 4990bb234d3d8bbe7e7e01e63fc93f1269efe5a3..40650a530b2ecdf2d5dd5d0f63aa1f4f0f6e333d 100644 (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;
index 0eaceb16edc45a020cc7a03adeb5a3c9a90906af..a139c5970e759ed198eda1dcd3d0cc453cd2dcbf 100644 (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 *);
index 95de936940f74141e3899f667d8c0874de543dca..b63565f0d34f6965b5f06226898eb3e07b75ae02 100644 (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 =
index 88906d724ff143b888d2c3a7cfdba3752b6d043a..0f1885d8b5cc9dc1055f08c6b4cf850ac8776701 100644 (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) {
index 8d40168dd60bb29005aceeb36cdf6d1bfa0b0f4a..3b33c2d22afefe6866f7cfe6ff02a80f4d409238 100644 (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) {