From 071120c7678b927cbbddc43db3e8c7e6d96d817d Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=BCrgen=20Spitzm=C3=BCller?= Date: Fri, 2 Apr 2004 08:54:37 +0000 Subject: [PATCH] fix the float fix and apply the fixed float fix to insetwrap git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8589 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/insets/ChangeLog | 5 +++++ src/insets/insetfloat.C | 36 +++++++++--------------------- src/insets/insetwrap.C | 49 +++++++++++++++++++++++------------------ 3 files changed, 43 insertions(+), 47 deletions(-) diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index fbb54eb1bb..7d7e0e6d43 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -1,3 +1,8 @@ +2004-04-02 Jürgen Spitzmüller + + * insetfloat.C (read): fix yesterday's float fix. + * insetwrap.C (read): apply the fixed float fix. + 2004-04-01 Jürgen Spitzmüller * insetfloat.C (read): fix reading of float params diff --git a/src/insets/insetfloat.C b/src/insets/insetfloat.C index f23bed808e..b6f68d6de5 100644 --- a/src/insets/insetfloat.C +++ b/src/insets/insetfloat.C @@ -192,8 +192,7 @@ void InsetFloat::priv_dispatch(LCursor & cur, FuncRequest & cmd) void InsetFloatParams::write(ostream & os) const { - os << "Float " // getInsetName() - << type << '\n'; + os << "Float " << type << '\n'; if (!placement.empty()) os << "placement " << placement << "\n"; @@ -212,43 +211,26 @@ void InsetFloatParams::write(ostream & os) const void InsetFloatParams::read(LyXLex & lex) { - if (lex.isOK()) { - lex.next(); - type = lex.getString(); - } - if (!lex.isOK()) - return; - lex.next(); - string token = lex.getString(); + string token; + lex >> token; if (token == "placement") { - lex.next(); - placement = lex.getString(); + lex >> placement; } else { // take countermeasures lex.pushToken(token); } - if (!lex.isOK()) - return; - lex.next(); - token = lex.getString(); + lex >> token; if (token == "wide") { - lex.next(); - string const tmptoken = lex.getString(); - wide = (tmptoken == "true"); + lex >> wide; } else { lyxerr << "InsetFloat::Read:: Missing wide!" << endl; // take countermeasures lex.pushToken(token); } - if (!lex.isOK()) - return; - lex.next(); - token = lex.getString(); + lex >> token; if (token == "sideways") { - lex.next(); - string const tmptoken = lex.getString(); - sideways = (tmptoken == "true"); + lex >> sideways; } else { lyxerr << "InsetFloat::Read:: Missing sideways!" << endl; @@ -489,6 +471,8 @@ void InsetFloatMailer::string2params(string const & in, if (!lex || id != "Float") return print_mailer_error("InsetBoxMailer", in, 2, "Float"); + // We have to read the type here! + lex >> params.type; params.read(lex); } diff --git a/src/insets/insetwrap.C b/src/insets/insetwrap.C index 59e8f57aa6..2c07cf2a17 100644 --- a/src/insets/insetwrap.C +++ b/src/insets/insetwrap.C @@ -95,6 +95,15 @@ void InsetWrap::priv_dispatch(LCursor & cur, FuncRequest & cmd) case LFUN_INSET_DIALOG_UPDATE: InsetWrapMailer(*this).updateDialog(&cur.bv()); break; + + case LFUN_MOUSE_RELEASE: { + if (cmd.button() == mouse_button::button3 && hitButton(cmd)) { + InsetWrapMailer(*this).showDialog(&cur.bv()); + break; + } + InsetCollapsable::priv_dispatch(cur, cmd); + break; + } default: InsetCollapsable::priv_dispatch(cur, cmd); @@ -116,29 +125,25 @@ void InsetWrapParams::write(ostream & os) const void InsetWrapParams::read(LyXLex & lex) { - if (lex.isOK()) { - lex.next(); - string token = lex.getString(); - if (token == "placement") { - lex.next(); - placement = lex.getString(); - } else { - // take countermeasures - lex.pushToken(token); - } + string token; + lex >> token; + if (token == "placement") + lex >> placement; + else { + // take countermeasures + lex.pushToken(token); } - if (lex.isOK()) { + if (!lex) + return; + lex >> token; + if (token == "width") { lex.next(); - string token = lex.getString(); - if (token == "width") { - lex.next(); - width = LyXLength(lex.getString()); - } else { - lyxerr << "InsetWrap::Read:: Missing 'width'-tag!" - << endl; - // take countermeasures - lex.pushToken(token); - } + width = LyXLength(lex.getString()); + } else { + lyxerr << "InsetWrap::Read:: Missing 'width'-tag!" + << endl; + // take countermeasures + lex.pushToken(token); } } @@ -274,6 +279,8 @@ void InsetWrapMailer::string2params(string const & in, InsetWrapParams & params) if (!lex || id != "Wrap") return print_mailer_error("InsetBoxMailer", in, 2, "Wrap"); + // We have to read the type here! + lex >> params.type; params.read(lex); } -- 2.39.2