]> git.lyx.org Git - lyx.git/blobdiff - src/rowpainter.C
Fix bug 2485 and crash on middle mouse paste on math
[lyx.git] / src / rowpainter.C
index d7131d55cad93665ac4d250c2bc2cf5136fd78a4..5971b39d4603beb591bacfd7106137449e10d8fe 100644 (file)
@@ -42,6 +42,7 @@
 
 #include <boost/crc.hpp>
 
+using lyx::char_type;
 using lyx::pos_type;
 using lyx::pit_type;
 
@@ -186,7 +187,7 @@ void RowPainter::paintHebrewComposeChar(pos_type & vpos, LyXFont const & font)
        string str;
 
        // first char
-       char c = par_.getChar(pos);
+       char_type c = par_.getChar(pos);
        str += c;
        ++vpos;
 
@@ -195,7 +196,7 @@ void RowPainter::paintHebrewComposeChar(pos_type & vpos, LyXFont const & font)
 
        for (pos_type i = pos - 1; i >= 0; --i) {
                c = par_.getChar(i);
-               if (!Encodings::IsComposeChar_hebrew(c)) {
+               if (!Encodings::isComposeChar_hebrew(c)) {
                        if (isPrintableNonspace(c)) {
                                int const width2 =
                                        text_.singleWidth(par_, i, c, text_.getFont(par_, i));
@@ -219,7 +220,7 @@ void RowPainter::paintArabicComposeChar(pos_type & vpos, LyXFont const & font)
        string str;
 
        // first char
-       char c = par_.getChar(pos);
+       char_type c = par_.getChar(pos);
        c = par_.transformChar(c, pos);
        str += c;
        ++vpos;
@@ -229,7 +230,7 @@ void RowPainter::paintArabicComposeChar(pos_type & vpos, LyXFont const & font)
 
        for (pos_type i = pos - 1; i >= 0; --i) {
                c = par_.getChar(i);
-               if (!Encodings::IsComposeChar_arabic(c)) {
+               if (!Encodings::isComposeChar_arabic(c)) {
                        if (isPrintableNonspace(c)) {
                                int const width2 =
                                        text_.singleWidth(par_, i, c, text_.getFont(par_, i));
@@ -268,15 +269,15 @@ void RowPainter::paintChars(pos_type & vpos, LyXFont font,
                if (prev_change != par_.lookupChange(pos))
                        break;
 
-               char c = par_.getChar(pos);
+               char_type c = par_.getChar(pos);
 
                if (!isPrintableNonspace(c))
                        break;
 
-               if (arabic && Encodings::IsComposeChar_arabic(c))
+               if (arabic && Encodings::isComposeChar_arabic(c))
                        break;
 
-               if (hebrew && Encodings::IsComposeChar_hebrew(c))
+               if (hebrew && Encodings::isComposeChar_hebrew(c))
                        break;
 
                if (arabic)
@@ -327,7 +328,7 @@ void RowPainter::paintFromPos(pos_type & vpos)
        }
 
        // usual characters, no insets
-       char const c = par_.getChar(pos);
+       char_type const c = par_.getChar(pos);
 
        // special case languages
        std::string const & lang = orig_font.language()->lang();
@@ -338,8 +339,8 @@ void RowPainter::paintFromPos(pos_type & vpos)
 
        // draw as many chars as we can
        if ((!hebrew && !arabic)
-               || (hebrew && !Encodings::IsComposeChar_hebrew(c))
-               || (arabic && !Encodings::IsComposeChar_arabic(c))) {
+               || (hebrew && !Encodings::isComposeChar_hebrew(c))
+               || (arabic && !Encodings::isComposeChar_arabic(c))) {
                paintChars(vpos, orig_font, hebrew, arabic);
        } else if (hebrew) {
                paintHebrewComposeChar(vpos, orig_font);