From a7c203c2ece34c5dbac3e461d66b75217a5bb3a0 Mon Sep 17 00:00:00 2001 From: John Levon Date: Wed, 28 May 2003 16:36:55 +0000 Subject: [PATCH] fix bug 1055, bug 1143, bug 1144 git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7060 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/ChangeLog | 4 ++++ src/insets/ChangeLog | 10 ++++++++++ src/insets/insetcite.C | 2 +- src/insets/insetinclude.C | 2 +- src/insets/insetindex.C | 2 +- src/insets/insetminipage.C | 5 +++-- src/insets/insetparent.C | 2 +- src/insets/insetref.C | 2 +- src/insets/insettext.C | 2 +- src/insets/insettoc.C | 2 +- src/lyxfunc.C | 13 +++++++++++++ src/text.C | 2 +- 12 files changed, 38 insertions(+), 10 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index feac458abe..ed0d51c2b3 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2003-05-28 John Levon + + * lyxfunc.C: fix LFUN_ESCAPE (bug 1055) + 2003-05-28 André Pönitz * metricsinfo.[Ch]: remove 'fullredraw' member diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index 39f33a15e5..36f27bd28b 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -1,3 +1,13 @@ +2003-05-28 John Levon + + * insetcite.C: + * insetinclude.C: + * insetindex.C: + * insetparent.C: + * insettoc.C: fix dispatch of mouse release (bug 1143 and others) + + * insetminipage.C: fix metrics (bug 1144) + 2003-05-27 Lars Gullik Bjønnes * insettext.C (saveLyXTextState): adjust diff --git a/src/insets/insetcite.C b/src/insets/insetcite.C index 429beca5ca..e1f51e61d3 100644 --- a/src/insets/insetcite.C +++ b/src/insets/insetcite.C @@ -334,7 +334,7 @@ dispatch_result InsetCitation::localDispatch(FuncRequest const & cmd) break; default: - return UNDISPATCHED; + return InsetCommand::localDispatch(cmd); } return DISPATCHED; } diff --git a/src/insets/insetinclude.C b/src/insets/insetinclude.C index 7aba887207..75a1ca5b43 100644 --- a/src/insets/insetinclude.C +++ b/src/insets/insetinclude.C @@ -136,7 +136,7 @@ dispatch_result InsetInclude::localDispatch(FuncRequest const & cmd) return DISPATCHED; default: - return UNDISPATCHED; + return InsetButton::localDispatch(cmd); } } diff --git a/src/insets/insetindex.C b/src/insets/insetindex.C index bdfdea6786..47eb3810c9 100644 --- a/src/insets/insetindex.C +++ b/src/insets/insetindex.C @@ -52,7 +52,7 @@ dispatch_result InsetIndex::localDispatch(FuncRequest const & cmd) return DISPATCHED; default: - return UNDISPATCHED; + return InsetCommand::localDispatch(cmd); } } diff --git a/src/insets/insetminipage.C b/src/insets/insetminipage.C index e58e7ecaa2..1c108a2c63 100644 --- a/src/insets/insetminipage.C +++ b/src/insets/insetminipage.C @@ -236,14 +236,14 @@ void InsetMinipage::dimension(BufferView * bv, LyXFont const & font, dimension_collapsed(dim); else { Dimension d; - InsetCollapsable::dimension(bv, font, dim); + InsetCollapsable::dimension(bv, font, d); switch (params_.pos) { case top: dim.asc = d.asc; dim.des = d.des; break; case center: - dim.asc = d.height() / 2; + dim.asc = d.ascent() + d.descent() / 2; dim.des = dim.asc; break; case bottom: @@ -251,6 +251,7 @@ void InsetMinipage::dimension(BufferView * bv, LyXFont const & font, dim.des = d.asc; break; } + dim.wid = d.wid; } } diff --git a/src/insets/insetparent.C b/src/insets/insetparent.C index 9c87064fa4..cd056a988e 100644 --- a/src/insets/insetparent.C +++ b/src/insets/insetparent.C @@ -56,7 +56,7 @@ dispatch_result InsetParent::localDispatch(FuncRequest const & cmd) cmd.view()->owner()->dispatch(FuncRequest(LFUN_CHILDOPEN, getContents())); return DISPATCHED; default: - return UNDISPATCHED; + return InsetCommand::localDispatch(cmd); } } diff --git a/src/insets/insetref.C b/src/insets/insetref.C index f2d2c0dde2..651d9a3817 100644 --- a/src/insets/insetref.C +++ b/src/insets/insetref.C @@ -52,7 +52,7 @@ dispatch_result InsetRef::localDispatch(FuncRequest const & cmd) return DISPATCHED; default: - return UNDISPATCHED; + return InsetCommand::localDispatch(cmd); } } diff --git a/src/insets/insettext.C b/src/insets/insettext.C index 0c50c6c0c1..7e073ff945 100644 --- a/src/insets/insettext.C +++ b/src/insets/insettext.C @@ -362,7 +362,7 @@ int InsetText::textWidth(BufferView * bv, bool fordraw) const (int)getLyXText(bv)->width); if (w < 0) - return -1; + return -1; return w - 2 * TEXT_TO_INSET_OFFSET; } diff --git a/src/insets/insettoc.C b/src/insets/insettoc.C index ae53a76ee9..160a1322af 100644 --- a/src/insets/insettoc.C +++ b/src/insets/insettoc.C @@ -66,7 +66,7 @@ dispatch_result InsetTOC::localDispatch(FuncRequest const & cmd) InsetCommandMailer("toc", *this).showDialog(cmd.view()); return DISPATCHED; default: - return UNDISPATCHED; + return InsetCommand::localDispatch(cmd); } } diff --git a/src/lyxfunc.C b/src/lyxfunc.C index 62e7c80120..5a3fffc158 100644 --- a/src/lyxfunc.C +++ b/src/lyxfunc.C @@ -837,6 +837,19 @@ void LyXFunc::dispatch(FuncRequest const & ev, bool verbose) && argument.empty()) { argument = encoded_last_key; } + + // the insets can't try to handle this, + // a table cell in the dummy position will + // lock its insettext, the insettext will + // pass it the bufferview, and succeed, + // so it will stay not locked. Not good + // if we've just done LFUN_ESCAPE (which + // injects an LFUN_PARAGRAPH_UPDATE) + if (action == LFUN_PARAGRAPH_UPDATE) { + view()->dispatch(ev); + goto exit_with_message; + } + // Undo/Redo is a bit tricky for insets. if (action == LFUN_UNDO) { view()->undo(); diff --git a/src/text.C b/src/text.C index 2de8e85e18..bc95c353bd 100644 --- a/src/text.C +++ b/src/text.C @@ -87,7 +87,7 @@ void LyXText::updateRowPositions() int LyXText::top_y() const { - if (anchor_row_ == rowlist_.end() ) + if (anchor_row_ == rowlist_.end()) return 0; return anchor_row_->y() + anchor_row_offset_; -- 2.39.2