}
-void BufferView::updateInset()
+void BufferView::updateInset(InsetOld const * inset)
{
- pimpl_->updateInset();
+ pimpl_->updateInset(inset);
}
bool fitCursor();
/// perform pending painting updates
void update();
- /// update for a particular inset
- void updateInset();
+ /** update for a particular inset. Gets a pointer and not a
+ * reference because we really need the pointer information
+ * to find it in the buffer.
+ */
+ void updateInset(InsetOld const *);
/// reset the scrollbar to reflect current view position
void updateScrollbar();
/// FIXME
#include "lyxrc.h"
#include "lastfiles.h"
#include "paragraph.h"
+#include "paragraph_funcs.h"
#include "ParagraphParameters.h"
#include "TextCache.h"
#include "undo_funcs.h"
case LFUN_INSET_INSERT: {
InsetOld * inset = createInset(ev);
if (inset && insertInset(inset)) {
- updateInset();
+ updateInset(inset);
string const name = ev.getArg(0);
if (name == "bibitem") {
}
-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();
///
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
+2003-08-27 Alfredo Braunstein <abraunst@libero.it>
+ * BufferView.[Ch]:
+ * BufferView_pimpl.[Ch] (updateInset): add an InsetOld * argument
+
2003-08-26 André Pönitz <poenitz@gmx.net>
* paragraph_func.[Ch] (outerPar): new function
#include "Lsstream.h"
#include "insets/updatableinset.h"
+#include "insets/insettext.h"
#include <boost/bind.hpp>
#include <algorithm>
bool const changed = text->changeDepth(type, false);
if (text->inset_owner)
- bv->updateInset();
- bv->update();
+ bv->updateInset(text->inset_owner);
return changed;
}
pimage_ = &pimage;
if (view())
- view()->updateInset();
+ view()->updateInset(inset());
}
} // namespace graphics
if (p.getCmdName().empty())
return DISPATCHED;
setParams(p);
- cmd.view()->updateInset();
+ cmd.view()->updateInset(this);
cmd.view()->fitCursor();
return DISPATCHED;
}
InsetBranchMailer::string2params(cmd.argument, params);
params_.branch = params.branch;
setButtonLabel();
- bv->updateInset();
+ bv->updateInset(this);
return DISPATCHED;
}
case LFUN_INSET_EDIT:
inset.insetUnlock(bv);
if (scroll())
scroll(bv, 0.0F);
- bv->updateInset();
+ bv->updateInset(this);
}
if (collapsed_ && cmd.button() != mouse_button::button3) {
collapsed_ = false;
- bv->updateInset();
+ bv->updateInset(this);
bv->buffer()->markDirty();
return;
}
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) {
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;
first_after_edit = true;
if (!bv->lockInset(this))
return DISPATCHED;
- bv->updateInset();
+ bv->updateInset(this);
bv->buffer()->markDirty();
inset.localDispatch(cmd);
} else {
return;
collapsed_ = false;
- bv->updateInset();
+ bv->updateInset(this);
}
return;
collapsed_ = true;
- bv->updateInset();
+ bv->updateInset(this);
}
return UNDISPATCHED;
setParams(p);
- cmd.view()->updateInset();
+ cmd.view()->updateInset(this);
return DISPATCHED;
}
* taken by the text).
*/
inset.getLyXText(cmd.view())->fullRebreak();
- bv->updateInset();
+ bv->updateInset(this);
result = DISPATCHED;
}
break;
break;
}
if (bv) {
- bv->updateInset();
+ bv->updateInset(this);
bv->buffer()->markDirty();
}
}
{
BufferView * bv = renderer_->view();
if (bv)
- bv->updateInset();
+ bv->updateInset(this);
}
InsetExternal::Params p;
InsetExternalMailer::string2params(cmd.argument, *buffer, p);
setParams(p, buffer);
- cmd.view()->updateInset();
+ cmd.view()->updateInset(this);
return DISPATCHED;
}
params_.wide = params.wide;
wide(params_.wide, cmd.view()->buffer()->params);
- cmd.view()->updateInset();
+ cmd.view()->updateInset(this);
return DISPATCHED;
}
void InsetGraphics::statusChanged()
{
BufferView * bv = graphic_->view();
- if (bv) {
- bv->text->redoParagraph(outerPar(*bv->buffer(), this));
- bv->updateInset();
- }
+ if (bv)
+ bv->updateInset(this);
}
InsetGraphicsMailer::string2params(cmd.argument, buffer, p);
if (!p.filename.empty()) {
setParams(p);
- cmd.view()->updateInset();
+ cmd.view()->updateInset(this);
}
return DISPATCHED;
}
if (!p.cparams.getCmdName().empty()) {
set(p);
params_.masterFilename_ = cmd.view()->buffer()->fileName();
- cmd.view()->updateInset();
+ cmd.view()->updateInset(this);
}
return DISPATCHED;
}
lyxerr << "restartLoading()" << std::endl;
removePreview();
if (view())
- view()->updateInset();
+ view()->updateInset(&parent());
generatePreview();
}
}
setParams(p);
- cmd.view()->updateInset();
+ cmd.view()->updateInset(this);
return DISPATCHED;
}
/* 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;
}
InsetNoteMailer::string2params(cmd.argument, params);
params_.type = params.type;
setButtonLabel();
- bv->updateInset();
+ bv->updateInset(this);
return DISPATCHED;
}
void InsetTabular::updateLocal(BufferView * bv) const
{
- bv->updateInset();
+ bv->updateInset(this);
if (locked)
resetPos(bv);
}
text_.selection.cursor = text_.cursor;
bv->fitCursor();
- bv->updateInset();
+ bv->updateInset(this);
bv->owner()->view_state_changed();
bv->owner()->updateMenubar();
bv->owner()->updateToolbar();
params_.placement = params.placement;
params_.width = params.width;
- cmd.view()->updateInset();
+ cmd.view()->updateInset(this);
return DISPATCHED;
}
int const xx = strToInt(ev.argument);
scroll(ev.view(), xx);
}
- ev.view()->updateInset();
+ ev.view()->updateInset(this);
return DISPATCHED;
}
if (mathcursor) {
if (mathcursor->inMacroMode()) {
mathcursor->macroModeClose();
- bv->updateInset();
+ bv->updateInset(this);
}
releaseMathCursor(bv);
}
generatePreview();
- bv->updateInset();
+ bv->updateInset(this);
}
void InsetFormulaBase::toggleInsetSelection(BufferView * bv)
{
if (mathcursor)
- bv->updateInset();
+ bv->updateInset(this);
}
return UNDISPATCHED;
BufferView * bv = cmd.view();
- bv->updateInset();
+ bv->updateInset(this);
//lyxerr << "lfunMouseRelease: buttons: " << cmd.button() << endl;
if (cmd.button() == mouse_button::button3) {
mathcursor->selClear();
mathcursor->setPos(cmd.x + xo_, cmd.y + yo_);
mathcursor->insert(ar);
- bv->updateInset();
+ bv->updateInset(this);
return DISPATCHED;
}
return DISPATCHED;
}
- bv->updateInset();
+ bv->updateInset(this);
return DISPATCHED;
}
BufferView * bv = cmd.view();
mathcursor->setPos(cmd.x + xo_, cmd.y + yo_);
- bv->updateInset();
+ bv->updateInset(this);
return DISPATCHED;
}
}
// 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:
}
if (result == DISPATCHED)
- bv->updateInset();
+ bv->updateInset(this);
mathcursor->normalize();
mathcursor->touch();
mathcursor->setSelection(it, ar.size());
current = it;
it.jump(ar.size());
- bv->updateInset();
+ bv->updateInset(this);
return true;
}
}
else
inset->open(bv());
- bv()->updateInset();
+ bv()->updateInset(inset);
}
setSelection();
setCursor(tmpcursor.par(), tmpcursor.pos());
if (inset_owner)
- bv()->updateInset();
+ bv()->updateInset(inset_owner);
}
if (!bv->insertInset(new_inset))
delete new_inset;
else
- bv->updateInset();
+ bv->updateInset(new_inset);
}