]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetquotes.C
removed a warning from screen and added CFLAGS in lyx.spec.in.
[lyx.git] / src / insets / insetquotes.C
index 7dfef058f2253d6e774df453bb70ec11bbdc57bd..408f6a1ca80781c07bec9e37ca2583600880b824 100644 (file)
@@ -16,7 +16,7 @@
 
 #include "insetquotes.h"
 #include "support/lyxlib.h"
-#include "error.h"
+#include "debug.h"
 #include "lyxfont.h"
 #include "lyxrc.h"
 #include "buffer.h"
@@ -92,8 +92,8 @@ void InsetQuotes::ParseString(string str)
 {
        int i;
        if (str.length() != 3) {
-               lyxerr.print("ERROR (InsetQuotes::InsetQuotes):"
-                             " bad string length.");
+               lyxerr << "ERROR (InsetQuotes::InsetQuotes):"
+                       " bad string length." << endl;
                str = "eld";
        }
 
@@ -104,8 +104,8 @@ void InsetQuotes::ParseString(string str)
                }
        }
        if (i>=6) {
-               lyxerr.print("ERROR (InsetQuotes::InsetQuotes):"
-                             " bad language specification.");
+               lyxerr << "ERROR (InsetQuotes::InsetQuotes):"
+                       " bad language specification." << endl;
                language = InsetQuotes::EnglishQ; 
        }
 
@@ -116,8 +116,8 @@ void InsetQuotes::ParseString(string str)
                }
        }
        if (i>=2) {
-               lyxerr.print("ERROR (InsetQuotes::InsetQuotes):"
-                             " bad side specification.");
+               lyxerr << "ERROR (InsetQuotes::InsetQuotes):"
+                       " bad side specification." << endl;
                side = InsetQuotes::LeftQ; 
        }
 
@@ -128,8 +128,8 @@ void InsetQuotes::ParseString(string str)
                }
        }
        if (i>=2) {
-               lyxerr.print("ERROR (InsetQuotes::InsetQuotes):"
-                             " bad times specification.");
+               lyxerr << "ERROR (InsetQuotes::InsetQuotes):"
+                       " bad times specification." << endl;
                times = InsetQuotes::DoubleQ; 
        }
 }
@@ -138,8 +138,7 @@ string InsetQuotes::DispString() const
 {
        string disp;
 
-       disp += quote_char[quote_index[side][language]];
-               
+       disp = quote_char[quote_index[side][language]];
        if (times == InsetQuotes::DoubleQ)
                disp += disp;
 
@@ -196,18 +195,8 @@ void InsetQuotes::Draw(LyXFont font, LyXScreen & scr,
 {
        string text = DispString();
 
-       for (string::size_type i = 0; i < text.length(); ++i) {
-               if (text[i] == ' ') 
-                       x += font.width('i');
-               else if (i == text.length()-1 || text[i] != text[i+1]) {
-                       scr.drawString(font, &text[i], baseline, int(x));
-                       x += font.width(text[i]);
-               } else {
-                       scr.drawString(font, &text[i+1], baseline, int(x));
-                       x += font.width(',');
-               }
-       }
-       
+       scr.drawString(font, text, baseline, int(x));
+       x += Width(font);
 }