mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-19 05:53:35 +00:00
Backport 5626 fix.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_6_X@27951 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
07ad6b8d9d
commit
cf1205de05
@ -51,6 +51,7 @@
|
|||||||
|
|
||||||
#include "insets/InsetCollapsable.h"
|
#include "insets/InsetCollapsable.h"
|
||||||
#include "insets/InsetCommand.h"
|
#include "insets/InsetCommand.h"
|
||||||
|
#include "insets/InsetExternal.h"
|
||||||
#include "insets/InsetFloatList.h"
|
#include "insets/InsetFloatList.h"
|
||||||
#include "insets/InsetNewline.h"
|
#include "insets/InsetNewline.h"
|
||||||
#include "insets/InsetQuotes.h"
|
#include "insets/InsetQuotes.h"
|
||||||
@ -827,7 +828,14 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
|
|||||||
|
|
||||||
case LFUN_INSET_INSERT: {
|
case LFUN_INSET_INSERT: {
|
||||||
cur.recordUndo();
|
cur.recordUndo();
|
||||||
|
|
||||||
|
// We have to avoid triggering InstantPreview loading
|
||||||
|
// before inserting into the document. See bug #5626.
|
||||||
|
bool loaded = bv->buffer().isFullyLoaded();
|
||||||
|
bv->buffer().setFullyLoaded(false);
|
||||||
Inset * inset = createInset(bv->buffer(), cmd);
|
Inset * inset = createInset(bv->buffer(), cmd);
|
||||||
|
bv->buffer().setFullyLoaded(loaded);
|
||||||
|
|
||||||
if (inset) {
|
if (inset) {
|
||||||
// FIXME (Abdel 01/02/2006):
|
// FIXME (Abdel 01/02/2006):
|
||||||
// What follows would be a partial fix for bug 2154:
|
// What follows would be a partial fix for bug 2154:
|
||||||
@ -855,7 +863,15 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
|
|||||||
cutSelection(cur, true, false);
|
cutSelection(cur, true, false);
|
||||||
cur.insert(inset);
|
cur.insert(inset);
|
||||||
cur.posForward();
|
cur.posForward();
|
||||||
|
|
||||||
|
// trigger InstantPreview now
|
||||||
|
if (inset->lyxCode() == EXTERNAL_CODE) {
|
||||||
|
InsetExternal & ins =
|
||||||
|
static_cast<InsetExternal &>(*inset);
|
||||||
|
ins.updatePreview();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -539,6 +539,12 @@ InsetExternalParams const & InsetExternal::params() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void InsetExternal::updatePreview()
|
||||||
|
{
|
||||||
|
setParams(params_);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void InsetExternal::setParams(InsetExternalParams const & p)
|
void InsetExternal::setParams(InsetExternalParams const & p)
|
||||||
{
|
{
|
||||||
params_ = p;
|
params_ = p;
|
||||||
|
@ -107,6 +107,8 @@ public:
|
|||||||
InsetExternalParams const & params() const;
|
InsetExternalParams const & params() const;
|
||||||
///
|
///
|
||||||
void setParams(InsetExternalParams const &);
|
void setParams(InsetExternalParams const &);
|
||||||
|
/// Update not loaded previews
|
||||||
|
void updatePreview();
|
||||||
/// \returns the number of rows (\n's) of generated code.
|
/// \returns the number of rows (\n's) of generated code.
|
||||||
int latex(odocstream &, OutputParams const &) const;
|
int latex(odocstream &, OutputParams const &) const;
|
||||||
///
|
///
|
||||||
|
Loading…
x
Reference in New Issue
Block a user