Andre Poenitz wrote:

> If it works...

Seems to work as expected. Ok to apply?

Regards, Alfredo

Index: BufferView.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/BufferView.C,v
retrieving revision 1.180
diff -u -p -u -r1.180 BufferView.C
--- BufferView.C        23 Aug 2003 00:16:02 -0000      1.180
+++ BufferView.C        27 Aug 2003 09:37:13 -0000
@@ -543,9 +543,9 @@ int BufferView::unlockInset(UpdatableIns
 }
 
 
-void BufferView::updateInset()
+void BufferView::updateInset(InsetOld const * inset)
 {
-       pimpl_->updateInset();
+       pimpl_->updateInset(inset);
 }
 
 
Index: BufferView.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/BufferView.h,v
retrieving revision 1.140
diff -u -p -u -r1.140 BufferView.h
--- BufferView.h        23 Aug 2003 00:16:02 -0000      1.140
+++ BufferView.h        27 Aug 2003 09:37:14 -0000
@@ -80,7 +80,7 @@ public:
        /// perform pending painting updates
        void update();
        /// update for a particular inset
-       void updateInset();
+       void updateInset(InsetOld const *);
        /// reset the scrollbar to reflect current view position
        void updateScrollbar();
        /// FIXME
Index: BufferView_pimpl.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/BufferView_pimpl.C,v
retrieving revision 1.421
diff -u -p -u -r1.421 BufferView_pimpl.C
--- BufferView_pimpl.C  27 Aug 2003 09:18:00 -0000      1.421
+++ BufferView_pimpl.C  27 Aug 2003 09:37:15 -0000
@@ -40,6 +40,7 @@
 #include "lyxrc.h"
 #include "lastfiles.h"
 #include "paragraph.h"
+#include "paragraph_funcs.h"
 #include "ParagraphParameters.h"
 #include "TextCache.h"
 #include "undo_funcs.h"
@@ -1182,7 +1183,7 @@ bool BufferView::Pimpl::dispatch(FuncReq
        case LFUN_INSET_INSERT: {
                InsetOld * inset = createInset(ev);
                if (inset && insertInset(inset)) {
-                       updateInset();
+                       updateInset(inset);
 
                        string const name = ev.getArg(0);
                        if (name == "bibitem") {
@@ -1371,14 +1372,16 @@ bool BufferView::Pimpl::insertInset(Inse
 }
 
 
-void BufferView::Pimpl::updateInset()
+void BufferView::Pimpl::updateInset(InsetOld const * inset)
 {
        if (!available())
                return;
 
+       bv_->text->redoParagraph(outerPar(*bv_->buffer(), inset));
+
        // this should not be needed, but it is...
-       bv_->text->redoParagraph(bv_->text->cursor.par());
-       //bv_->text->fullRebreak();
+       // bv_->text->redoParagraph(bv_->text->cursor.par());
+       // bv_->text->fullRebreak();
 
        update();
        updateScrollbar();
Index: BufferView_pimpl.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/BufferView_pimpl.h,v
retrieving revision 1.101
diff -u -p -u -r1.101 BufferView_pimpl.h
--- BufferView_pimpl.h  23 Aug 2003 00:16:04 -0000      1.101
+++ BufferView_pimpl.h  27 Aug 2003 09:37:15 -0000
@@ -101,7 +101,7 @@ struct BufferView::Pimpl : public boost:
        ///
        bool insertInset(InsetOld * inset, string const & lout = string());
        ///
-       void updateInset();
+       void updateInset(InsetOld const * inset);
        /// a function should be executed from the workarea
        bool workAreaDispatch(FuncRequest const & ev);
        /// a function should be executed
Index: bufferview_funcs.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/bufferview_funcs.C,v
retrieving revision 1.94
diff -u -p -u -r1.94 bufferview_funcs.C
--- bufferview_funcs.C  23 Aug 2003 00:16:08 -0000      1.94
+++ bufferview_funcs.C  27 Aug 2003 09:37:16 -0000
@@ -35,6 +35,7 @@
 #include "Lsstream.h"
 
 #include "insets/updatableinset.h"
+#include "insets/insettext.h"
 #include <boost/bind.hpp>
 #include <algorithm>
 
@@ -232,8 +233,7 @@ bool changeDepth(BufferView * bv, LyXTex
 
        bool const changed = text->changeDepth(type, false);
        if (text->inset_owner)
-               bv->updateInset();
-       bv->update();
+               bv->updateInset(text->inset_owner);
        return changed;
 }
 
Index: text2.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/text2.C,v
retrieving revision 1.448
diff -u -p -u -r1.448 text2.C
--- text2.C     26 Aug 2003 16:36:52 -0000      1.448
+++ text2.C     27 Aug 2003 09:37:19 -0000
@@ -282,7 +282,7 @@ void LyXText::toggleInset()
        else
                inset->open(bv());
 
-       bv()->updateInset();
+       bv()->updateInset(inset);
 }
 
 
@@ -848,7 +848,7 @@ void LyXText::setParagraph(bool line_top
        setSelection();
        setCursor(tmpcursor.par(), tmpcursor.pos());
        if (inset_owner)
-               bv()->updateInset();
+               bv()->updateInset(inset_owner);
 }
 
 
Index: text3.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/text3.C,v
retrieving revision 1.122
diff -u -p -u -r1.122 text3.C
--- text3.C     25 Aug 2003 10:24:26 -0000      1.122
+++ text3.C     27 Aug 2003 09:37:21 -0000
@@ -355,7 +355,7 @@ void specialChar(LyXText * lt, BufferVie
        if (!bv->insertInset(new_inset))
                delete new_inset;
        else
-               bv->updateInset();
+               bv->updateInset(new_inset);
 }
 
 
Index: graphics/PreviewedInset.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/graphics/PreviewedInset.C,v
retrieving revision 1.18
diff -u -p -u -r1.18 PreviewedInset.C
--- graphics/PreviewedInset.C   23 Aug 2003 00:16:49 -0000      1.18
+++ graphics/PreviewedInset.C   27 Aug 2003 09:37:23 -0000
@@ -124,7 +124,7 @@ void PreviewedInset::imageReady(PreviewI
        pimage_ = &pimage;
 
        if (view())
-               view()->updateInset();
+               view()->updateInset(inset());
 }
 
 } // namespace graphics
Index: insets/insetbibitem.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetbibitem.C,v
retrieving revision 1.24
diff -u -p -u -r1.24 insetbibitem.C
--- insets/insetbibitem.C       23 Aug 2003 00:16:49 -0000      1.24
+++ insets/insetbibitem.C       27 Aug 2003 09:37:23 -0000
@@ -66,7 +66,7 @@ dispatch_result InsetBibitem::localDispa
                if (p.getCmdName().empty())
                        return DISPATCHED;
                setParams(p);
-               cmd.view()->updateInset();
+               cmd.view()->updateInset(this);
                cmd.view()->fitCursor();
                return DISPATCHED;
        }
Index: insets/insetbranch.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetbranch.C,v
retrieving revision 1.4
diff -u -p -u -r1.4 insetbranch.C
--- insets/insetbranch.C        26 Aug 2003 15:27:31 -0000      1.4
+++ insets/insetbranch.C        27 Aug 2003 09:37:24 -0000
@@ -125,7 +125,7 @@ dispatch_result InsetBranch::localDispat
                InsetBranchMailer::string2params(cmd.argument, params);
                params_.branch = params.branch;
                setButtonLabel();
-               bv->updateInset();
+               bv->updateInset(this);
                return DISPATCHED;
                }
        case LFUN_INSET_EDIT:
Index: insets/insetcollapsable.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetcollapsable.C,v
retrieving revision 1.165
diff -u -p -u -r1.165 insetcollapsable.C
--- insets/insetcollapsable.C   23 Aug 2003 00:16:50 -0000      1.165
+++ insets/insetcollapsable.C   27 Aug 2003 09:37:24 -0000
@@ -210,7 +210,7 @@ void InsetCollapsable::insetUnlock(Buffe
        inset.insetUnlock(bv);
        if (scroll())
                scroll(bv, 0.0F);
-       bv->updateInset();
+       bv->updateInset(this);
 }
 
 
@@ -229,7 +229,7 @@ void InsetCollapsable::lfunMouseRelease(
 
        if (collapsed_ && cmd.button() != mouse_button::button3) {
                collapsed_ = false;
-               bv->updateInset();
+               bv->updateInset(this);
                bv->buffer()->markDirty();
                return;
        }
@@ -241,7 +241,7 @@ void InsetCollapsable::lfunMouseRelease(
                        collapsed_ = true;
                        bv->unlockInset(this);
                }
-               bv->updateInset();
+               bv->updateInset(this);
                bv->buffer()->markDirty();
                lyxerr << "InsetCollapsable::lfunMouseRelease\n";
        } else if (!collapsed_ && cmd.y > button_dim.y2) {
@@ -296,7 +296,7 @@ InsetOld::RESULT InsetCollapsable::local
                                        lyxerr << "branch collapsed_" << endl;
                                        collapsed_ = false;
                                        if (bv->lockInset(this)) {
-                                               bv->updateInset();
+                                               bv->updateInset(this);
                                                bv->buffer()->markDirty();
                                                inset.localDispatch(cmd);
                                                first_after_edit = true;
@@ -324,7 +324,7 @@ InsetOld::RESULT InsetCollapsable::local
                                first_after_edit = true;
                                if (!bv->lockInset(this))
                                        return DISPATCHED;
-                               bv->updateInset();
+                               bv->updateInset(this);
                                bv->buffer()->markDirty();
                                inset.localDispatch(cmd);
                        } else {
@@ -488,7 +488,7 @@ void InsetCollapsable::open(BufferView *
                return;
 
        collapsed_ = false;
-       bv->updateInset();
+       bv->updateInset(this);
 }
 
 
@@ -498,7 +498,7 @@ void InsetCollapsable::close(BufferView 
                return;
 
        collapsed_ = true;
-       bv->updateInset();
+       bv->updateInset(this);
 }
 
 
Index: insets/insetcommand.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetcommand.C,v
retrieving revision 1.82
diff -u -p -u -r1.82 insetcommand.C
--- insets/insetcommand.C       23 Aug 2003 00:16:50 -0000      1.82
+++ insets/insetcommand.C       27 Aug 2003 09:37:25 -0000
@@ -102,7 +102,7 @@ dispatch_result InsetCommand::localDispa
                        return UNDISPATCHED;
 
                setParams(p);
-               cmd.view()->updateInset();
+               cmd.view()->updateInset(this);
                return DISPATCHED;
        }
 
Index: insets/insetert.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetert.C,v
retrieving revision 1.149
diff -u -p -u -r1.149 insetert.C
--- insets/insetert.C   26 Aug 2003 10:33:58 -0000      1.149
+++ insets/insetert.C   27 Aug 2003 09:37:25 -0000
@@ -455,7 +455,7 @@ InsetOld::RESULT InsetERT::localDispatch
                 * taken by the text).
                 */
                inset.getLyXText(cmd.view())->fullRebreak();
-               bv->updateInset();
+               bv->updateInset(this);
                result = DISPATCHED;
        }
        break;
@@ -603,7 +603,7 @@ void InsetERT::status(BufferView * bv, E
                        break;
                }
                if (bv) {
-                       bv->updateInset();
+                       bv->updateInset(this);
                        bv->buffer()->markDirty();
                }
        }
Index: insets/insetexternal.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetexternal.C,v
retrieving revision 1.95
diff -u -p -u -r1.95 insetexternal.C
--- insets/insetexternal.C      23 Aug 2003 00:16:50 -0000      1.95
+++ insets/insetexternal.C      27 Aug 2003 09:37:26 -0000
@@ -127,7 +127,7 @@ void InsetExternal::statusChanged()
 {
        BufferView * bv = renderer_->view();
        if (bv)
-               bv->updateInset();
+               bv->updateInset(this);
 }
 
 
@@ -152,7 +152,7 @@ dispatch_result InsetExternal::localDisp
                InsetExternal::Params p;
                InsetExternalMailer::string2params(cmd.argument, *buffer, p);
                setParams(p, buffer);
-               cmd.view()->updateInset();
+               cmd.view()->updateInset(this);
                return DISPATCHED;
        }
 
Index: insets/insetfloat.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetfloat.C,v
retrieving revision 1.92
diff -u -p -u -r1.92 insetfloat.C
--- insets/insetfloat.C 23 Aug 2003 00:16:50 -0000      1.92
+++ insets/insetfloat.C 27 Aug 2003 09:37:27 -0000
@@ -172,7 +172,7 @@ dispatch_result InsetFloat::localDispatc
                params_.wide      = params.wide;
 
                wide(params_.wide, cmd.view()->buffer()->params);
-               cmd.view()->updateInset();
+               cmd.view()->updateInset(this);
                return DISPATCHED;
        }
 
Index: insets/insetgraphics.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetgraphics.C,v
retrieving revision 1.199
diff -u -p -u -r1.199 insetgraphics.C
--- insets/insetgraphics.C      26 Aug 2003 14:50:16 -0000      1.199
+++ insets/insetgraphics.C      27 Aug 2003 09:37:28 -0000
@@ -169,11 +169,7 @@ InsetGraphics::~InsetGraphics()
 
 void InsetGraphics::statusChanged()
 {
-       BufferView * bv = graphic_->view();
-       if (bv) {
-               bv->text->redoParagraph(outerPar(*bv->buffer(), this));
-               bv->updateInset();
-       }
+       graphic_->view()->updateInset(this);
 }
 
 
@@ -186,7 +182,7 @@ dispatch_result InsetGraphics::localDisp
                InsetGraphicsMailer::string2params(cmd.argument, buffer, p);
                if (!p.filename.empty()) {
                        setParams(p);
-                       cmd.view()->updateInset();
+                       cmd.view()->updateInset(this);
                }
                return DISPATCHED;
        }
Index: insets/insetinclude.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetinclude.C,v
retrieving revision 1.136
diff -u -p -u -r1.136 insetinclude.C
--- insets/insetinclude.C       26 Aug 2003 10:33:58 -0000      1.136
+++ insets/insetinclude.C       27 Aug 2003 09:37:28 -0000
@@ -138,7 +138,7 @@ dispatch_result InsetInclude::localDispa
                if (!p.cparams.getCmdName().empty()) {
                        set(p);
                        params_.masterFilename_ = cmd.view()->buffer()->fileName();
-                       cmd.view()->updateInset();
+                       cmd.view()->updateInset(this);
                }
                return DISPATCHED;
        }
@@ -600,7 +600,7 @@ void InsetInclude::PreviewImpl::restartL
        lyxerr << "restartLoading()" << std::endl;
        removePreview();
        if (view())
-               view()->updateInset();
+               view()->updateInset(&parent());
        generatePreview();
 }
 
Index: insets/insetlabel.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetlabel.C,v
retrieving revision 1.68
diff -u -p -u -r1.68 insetlabel.C
--- insets/insetlabel.C 23 Aug 2003 00:16:52 -0000      1.68
+++ insets/insetlabel.C 27 Aug 2003 09:37:28 -0000
@@ -68,7 +68,7 @@ dispatch_result InsetLabel::localDispatc
                }
 
                setParams(p);
-               cmd.view()->updateInset();
+               cmd.view()->updateInset(this);
                return DISPATCHED;
        }
 
Index: insets/insetminipage.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetminipage.C,v
retrieving revision 1.88
diff -u -p -u -r1.88 insetminipage.C
--- insets/insetminipage.C      23 Aug 2003 00:16:52 -0000      1.88
+++ insets/insetminipage.C      27 Aug 2003 09:37:29 -0000
@@ -111,7 +111,7 @@ dispatch_result InsetMinipage::localDisp
                /* FIXME: I refuse to believe we have to live
                 * with ugliness like this ... */
                inset.getLyXText(cmd.view())->fullRebreak();
-               cmd.view()->updateInset();
+               cmd.view()->updateInset(this);
                return DISPATCHED;
        }
 
Index: insets/insetnote.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetnote.C,v
retrieving revision 1.41
diff -u -p -u -r1.41 insetnote.C
--- insets/insetnote.C  26 Aug 2003 10:33:58 -0000      1.41
+++ insets/insetnote.C  27 Aug 2003 09:37:29 -0000
@@ -141,7 +141,7 @@ dispatch_result InsetNote::localDispatch
                InsetNoteMailer::string2params(cmd.argument, params);
                params_.type = params.type;
                setButtonLabel();
-               bv->updateInset();
+               bv->updateInset(this);
                return DISPATCHED;
        }
 
Index: insets/insettabular.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insettabular.C,v
retrieving revision 1.329
diff -u -p -u -r1.329 insettabular.C
--- insets/insettabular.C       26 Aug 2003 16:36:53 -0000      1.329
+++ insets/insettabular.C       27 Aug 2003 09:37:33 -0000
@@ -422,7 +422,7 @@ void InsetTabular::insetUnlock(BufferVie
 
 void InsetTabular::updateLocal(BufferView * bv) const
 {
-       bv->updateInset();
+       bv->updateInset(this);
        if (locked)
                resetPos(bv);
 }
Index: insets/insettext.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insettext.C,v
retrieving revision 1.485
diff -u -p -u -r1.485 insettext.C
--- insets/insettext.C  26 Aug 2003 14:50:16 -0000      1.485
+++ insets/insettext.C  27 Aug 2003 09:37:35 -0000
@@ -317,7 +317,7 @@ void InsetText::updateLocal(BufferView *
                text_.selection.cursor = text_.cursor;
 
        bv->fitCursor();
-       bv->updateInset();
+       bv->updateInset(this);
        bv->owner()->view_state_changed();
        bv->owner()->updateMenubar();
        bv->owner()->updateToolbar();
Index: insets/insetwrap.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetwrap.C,v
retrieving revision 1.35
diff -u -p -u -r1.35 insetwrap.C
--- insets/insetwrap.C  23 Aug 2003 00:16:56 -0000      1.35
+++ insets/insetwrap.C  27 Aug 2003 09:37:35 -0000
@@ -91,7 +91,7 @@ dispatch_result InsetWrap::localDispatch
                params_.placement = params.placement;
                params_.width     = params.width;
 
-               cmd.view()->updateInset();
+               cmd.view()->updateInset(this);
                return DISPATCHED;
        }
 
Index: insets/updatableinset.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/updatableinset.C,v
retrieving revision 1.21
diff -u -p -u -r1.21 updatableinset.C
--- insets/updatableinset.C     23 Aug 2003 00:16:56 -0000      1.21
+++ insets/updatableinset.C     27 Aug 2003 09:37:36 -0000
@@ -125,7 +125,7 @@ InsetOld::RESULT UpdatableInset::localDi
                        int const xx = strToInt(ev.argument);
                        scroll(ev.view(), xx);
                }
-               ev.view()->updateInset();
+               ev.view()->updateInset(this);
 
                return DISPATCHED;
        }
Index: mathed/formulabase.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/formulabase.C,v
retrieving revision 1.280
diff -u -p -u -r1.280 formulabase.C
--- mathed/formulabase.C        19 Aug 2003 13:00:54 -0000      1.280
+++ mathed/formulabase.C        27 Aug 2003 09:37:37 -0000
@@ -153,12 +153,12 @@ void InsetFormulaBase::insetUnlock(Buffe
        if (mathcursor) {
                if (mathcursor->inMacroMode()) {
                        mathcursor->macroModeClose();
-                       bv->updateInset();
+                       bv->updateInset(this);
                }
                releaseMathCursor(bv);
        }
        generatePreview();
-       bv->updateInset();
+       bv->updateInset(this);
 }
 
 
@@ -204,7 +204,7 @@ void InsetFormulaBase::fitInsetCursor(Bu
 void InsetFormulaBase::toggleInsetSelection(BufferView * bv)
 {
        if (mathcursor)
-               bv->updateInset();
+               bv->updateInset(this);
 }
 
 
@@ -214,7 +214,7 @@ dispatch_result InsetFormulaBase::lfunMo
                return UNDISPATCHED;
 
        BufferView * bv = cmd.view();
-       bv->updateInset();
+       bv->updateInset(this);
        //lyxerr << "lfunMouseRelease: buttons: " << cmd.button() << endl;
 
        if (cmd.button() == mouse_button::button3) {
@@ -233,7 +233,7 @@ dispatch_result InsetFormulaBase::lfunMo
                mathcursor->selClear();
                mathcursor->setPos(cmd.x + xo_, cmd.y + yo_);
                mathcursor->insert(ar);
-               bv->updateInset();
+               bv->updateInset(this);
                return DISPATCHED;
        }
 
@@ -280,7 +280,7 @@ dispatch_result InsetFormulaBase::lfunMo
                return DISPATCHED;
        }
 
-       bv->updateInset();
+       bv->updateInset(this);
        return DISPATCHED;
 }
 
@@ -308,7 +308,7 @@ dispatch_result InsetFormulaBase::lfunMo
 
        BufferView * bv = cmd.view();
        mathcursor->setPos(cmd.x + xo_, cmd.y + yo_);
-       bv->updateInset();
+       bv->updateInset(this);
        return DISPATCHED;
 }
 
@@ -342,7 +342,7 @@ dispatch_result InsetFormulaBase::localD
                        }
                        // if that is removed, we won't get the magenta box when 
entering an
                        // inset for the first time
-                       bv->updateInset();
+                       bv->updateInset(this);
                        return DISPATCHED;
 
                case LFUN_MOUSE_PRESS:
@@ -720,7 +720,7 @@ dispatch_result InsetFormulaBase::localD
        }
 
        if (result == DISPATCHED)
-               bv->updateInset();
+               bv->updateInset(this);
 
        mathcursor->normalize();
        mathcursor->touch();
@@ -850,7 +850,7 @@ bool InsetFormulaBase::searchForward(Buf
                        mathcursor->setSelection(it, ar.size());
                        current = it;
                        it.jump(ar.size());
-                       bv->updateInset();
+                       bv->updateInset(this);
                        return true;
                }
        }

Reply via email to