From 457cfb113a22d25b0f6961c0464b424b219d5153 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20Gullik=20Bj=C3=B8nnes?= Date: Thu, 7 Oct 1999 19:15:53 +0000 Subject: [PATCH] fix bug in drawing of quotes git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@181 a592a061-630c-0410-9148-cb99ea01b6c8 --- ChangeLog | 7 +++++++ src/insets/insetquotes.C | 17 +++-------------- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index 041cf84202..c842441198 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +1999-10-07 Lars Gullik Bjønnes + + * src/insets/insetquotes.C (Draw): Simplified a gread deal. This + also fixes a bug. It is not allowed to do tricks with std::strings + like: string a("hei"); &a[e]; this will not give what you + think... Any reason for the complexity in this func? + 1999-10-06 Asger Alstrup Nielsen * Updated README and INSTALL a bit, mostly to check that my diff --git a/src/insets/insetquotes.C b/src/insets/insetquotes.C index c4963ca2cf..408f6a1ca8 100644 --- a/src/insets/insetquotes.C +++ b/src/insets/insetquotes.C @@ -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); }