]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetquotes.C
fix the resize bug, make some more inset funcs const, cleanup in lyxscreen, painter...
[lyx.git] / src / insets / insetquotes.C
index b7a4da1c63dc23011b76043e757aeb7c3c33ac8d..de2790db471288ad13ea977a94d9585fe1bb50c4 100644 (file)
@@ -156,33 +156,18 @@ string InsetQuotes::DispString() const
 }
 
 
-#ifdef USE_PAINTER
 int InsetQuotes::ascent(Painter &, LyXFont const & font) const
 {
        return font.maxAscent();
 }
-#else
-int InsetQuotes::Ascent(LyXFont const & font) const
-{
-       return font.maxAscent();
-}
-#endif
 
 
-#ifdef USE_PAINTER
 int InsetQuotes::descent(Painter &, LyXFont const & font) const
 {
        return font.maxDescent();
 }
-#else
-int InsetQuotes::Descent(LyXFont const & font) const
-{
-       return font.maxDescent();
-}
-#endif
 
 
-#ifdef USE_PAINTER
 int InsetQuotes::width(Painter &, LyXFont const & font) const
 {
        string text = DispString();
@@ -199,24 +184,6 @@ int InsetQuotes::width(Painter &, LyXFont const & font) const
 
        return w;
 }
-#else
-int InsetQuotes::Width(LyXFont const & font) const
-{
-       string text = DispString();
-       int w = 0;
-
-       for (string::size_type i = 0; i < text.length(); ++i) {
-               if (text[i] == ' ')
-                       w += font.width('i');
-               else if (i == 0 || text[i] != text[i-1])
-                       w += font.width(text[i]);
-               else
-                       w += font.width(',');
-       }
-
-       return w;
-}
-#endif
 
 
 LyXFont InsetQuotes::ConvertFont(LyXFont font)
@@ -227,7 +194,6 @@ LyXFont InsetQuotes::ConvertFont(LyXFont font)
 }
 
 
-#ifdef USE_PAINTER
 void InsetQuotes::draw(Painter & pain, LyXFont const & font,
                       int baseline, float & x) const
 {
@@ -236,19 +202,9 @@ void InsetQuotes::draw(Painter & pain, LyXFont const & font,
        pain.text(int(x), baseline, text, font);
        x += width(pain, font);
 }
-#else
-void InsetQuotes::Draw(LyXFont font, LyXScreen & scr,
-                      int baseline, float & x)
-{
-       string text = DispString();
-
-       scr.drawString(font, text, baseline, int(x));
-       x += Width(font);
-}
-#endif
 
 
-void InsetQuotes::Write(ostream & os)
+void InsetQuotes::Write(ostream & os) const
 {
        string text;
        text += language_char[language];
@@ -265,7 +221,7 @@ void InsetQuotes::Read(LyXLex & lex)
 }
 
 
-int InsetQuotes::Latex(ostream & os, signed char /*fragile*/)
+int InsetQuotes::Latex(ostream & os, signed char /*fragile*/) const
 {
        string quote;
        int res = Latex(quote, 0);
@@ -274,7 +230,7 @@ int InsetQuotes::Latex(ostream & os, signed char /*fragile*/)
 }
 
 
-int InsetQuotes::Latex(string & file, signed char /*fragile*/)
+int InsetQuotes::Latex(string & file, signed char /*fragile*/) const
 {
        string doclang = 
                current_view->buffer()->GetLanguage();
@@ -308,7 +264,7 @@ int InsetQuotes::Latex(string & file, signed char /*fragile*/)
 }
 
 
-int InsetQuotes::Linuxdoc(string & file)
+int InsetQuotes::Linuxdoc(string & file) const
 {
        file += "\"";
 
@@ -316,7 +272,7 @@ int InsetQuotes::Linuxdoc(string & file)
 }
 
 
-int InsetQuotes::DocBook(string & file)
+int InsetQuotes::DocBook(string & file) const
 {
        if(times == InsetQuotes::DoubleQ) {
                if (side == InsetQuotes::LeftQ)