]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetlatexaccent.C
fix compilation pb ; update eu.po
[lyx.git] / src / insets / insetlatexaccent.C
index dbb81062054078bf8c3cc560541face95d4f9119..e5ef5cba393525238a57e0726dbb127a51888bf2 100644 (file)
@@ -21,6 +21,7 @@
 #include "BufferView.h"
 #include "Painter.h"
 #include "font.h"
+#include "language.h"
 
 using std::ostream;
 using std::endl;
@@ -191,7 +192,7 @@ void InsetLatexAccent::checkContents()
        // special clause for \i{}, \j{} \l{} and \L{}
        if ((modtype == DOT_LESS_I || modtype == DOT_LESS_J
             || modtype == lSLASH || modtype == LSLASH)
-           && contents[3] == '}' ) {
+           && contents[3] == '}') {
                switch (modtype) {
                case DOT_LESS_I: ic = 'i'; break;
                case DOT_LESS_J: ic = 'j'; break;
@@ -225,13 +226,13 @@ void InsetLatexAccent::checkContents()
                                remdot = true;
                        else
                                return;
-               } else if ( (ic == 'i'|| ic == 'j') && contents[4] == '}') {
+               } else if ((ic == 'i'|| ic == 'j') && contents[4] == '}') {
                        // Do a rewrite: \<foo>{i} --> \<foo>{\i}
                        string temp = contents;
                        temp.erase(3, string::npos);
                        temp += '\\';
                        temp += char(ic);
-                       for(string::size_type j = 4;
+                       for (string::size_type j = 4;
                            j < contents.length(); ++j)
                                temp+= contents[j];
                        contents= temp;
@@ -354,19 +355,23 @@ bool InsetLatexAccent::DisplayISO8859_9(BufferView * bv, LyXFont const & font,
 }
 
 
-void InsetLatexAccent::draw(BufferView * bv, LyXFont const & font,
+void InsetLatexAccent::draw(BufferView * bv, LyXFont const & font0,
                            int baseline, float & x, bool) const
 {
        Painter & pain = bv->painter();
 
-       if (lyxrc.font_norm == "iso8859-9")
-               if (DisplayISO8859_9(bv, font, baseline, x))    
+       if (lyxrc.font_norm_type == LyXRC::ISO_8859_9)
+               if (DisplayISO8859_9(bv, font0, baseline, x))   
                        return;
        
        /* draw it! */ 
        // All the manually drawn accents in this function could use an
        // overhaul. Different ways of drawing (what metrics to use)
        // should also be considered.
+
+       LyXFont font(font0);
+       if (lyxrc.font_norm_type == LyXRC::ISO_10646_1)
+               font.setLanguage(english_language);
        
        if (candisp) {
                int asc = ascent(bv, font);
@@ -629,7 +634,7 @@ int InsetLatexAccent::Latex(Buffer const *, ostream & os,
 }
 
 
-int InsetLatexAccent::Ascii(Buffer const *, ostream & os) const
+int InsetLatexAccent::Ascii(Buffer const *, ostream & os, int) const
 {
        os << contents;
        return 0;
@@ -662,7 +667,7 @@ bool InsetLatexAccent::DirectWrite() const
 }
 
 
-Inset * InsetLatexAccent::Clone() const
+Inset * InsetLatexAccent::Clone(Buffer const &) const
 {
        return new InsetLatexAccent(contents);
 }