Inset patch from Angus.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1095 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jürgen Vigna 2000-10-10 11:50:43 +00:00
parent 58392ef907
commit 71f8ac34a9
63 changed files with 152 additions and 118 deletions

View File

@ -1,3 +1,33 @@
2000-10-10 Angus Leeming <a.leeming@ic.ac.uk>
* src/BufferView_pimpl.C (buffer): cleaned up a little.
* src/insets/figinset.[Ch]:
* src/insets/insetinclude.[Ch]:
* src/insets/insetinclude.[Ch]:
* src/insets/insetparent.[Ch]:
* src/insets/insetref.[Ch]:
* src/insets/insettabular.[Ch] (c-tor): Buffer passed as const &.
* src/insets/*.[Ch]:
* src/mathed/formula.[Ch]:
* src/mathed/formulamacro.C (Clone): passed Buffer const &.
* src/buffer.C (parseSingleLyXformat2Token, readInset):
* src/lyx_cb.C (FigureApplyCB):
* src/lyxfunc.C (getStatus, Dispatch):
* src/frontends/xforms/FormTabular.C: use modified c-tors to some
insets.
* src/lyxfunc.C (Dispatch): string "ref" not used. Removed.
* src/converter.[Ch] (Formats::View):
* src/lyx_cb.[Ch] (ShowMessage): constify Buffer * parameter.
* src/paragraph.C (CopyIntoMinibuffer, Clone): Insets::Clone() passed
*current_view->buffer(). This will change later, but this patch is way
big enough already!
2000-10-09 Juergen Vigna <jug@sad.it>
* src/text.C (GetRow): small fix.

View File

@ -161,12 +161,17 @@ void BufferView::Pimpl::buffer(Buffer * b)
bv_->text->first = screen_->TopCursorVisible(bv_->text);
owner_->updateMenubar();
owner_->updateToolbar();
// Similarly, buffer-dependent dialogs should be updated or
// hidden. This should go here because some dialogs (eg ToC)
// require bv_->text.
owner_->getDialogs()->updateBufferDependent();
redraw();
bv_->insetWakeup();
} else {
lyxerr[Debug::INFO] << " No Buffer!" << endl;
owner_->updateMenubar();
owner_->updateToolbar();
owner_->getDialogs()->hideBufferDependent();
updateScrollbar();
workarea_->redraw();
@ -181,15 +186,6 @@ void BufferView::Pimpl::buffer(Buffer * b)
owner_->updateLayoutChoice();
owner_->getMiniBuffer()->Init();
owner_->updateWindowTitle();
// Similarly, buffer-dependent dialogs should be updated or hidden.
// This should go here because some dialogs (ToC) require bv_->text.
if (buffer_) owner_->getDialogs()->updateBufferDependent();
#ifdef WITH_WARNINGS
#warning Is this the right place for this?
// What was wrong with where it used to be in the previous if(buffer_) above?
// There also used to be a hideBufferDependent somewhere here but I haven't
// time at present to check. This should at least fix the segfault.
#endif
}

View File

@ -882,7 +882,7 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, LyXParagraph *& par,
par->InsertChar(pos, LyXParagraph::META_NEWLINE, font);
++pos;
} else if (token == "\\LyXTable") {
Inset * inset = new InsetTabular(this);
Inset * inset = new InsetTabular(*this);
inset->Read(this, lex);
par->InsertInset(pos, inset, font);
++pos;
@ -960,7 +960,7 @@ void Buffer::readInset(LyXLex & lex, LyXParagraph *& par,
} else if (inscmd.getCmdName() == "index") {
inset = new InsetIndex(inscmd);
} else if (inscmd.getCmdName() == "include") {
inset = new InsetInclude(inscmd, this);
inset = new InsetInclude(inscmd, *this);
} else if (inscmd.getCmdName() == "label") {
inset = new InsetLabel(inscmd);
} else if (inscmd.getCmdName() == "url"
@ -973,7 +973,7 @@ void Buffer::readInset(LyXLex & lex, LyXParagraph *& par,
|| inscmd.getCmdName() == "prettyref") {
if (!inscmd.getOptions().empty()
|| !inscmd.getContents().empty()) {
inset = new InsetRef(inscmd);
inset = new InsetRef(inscmd, *this);
}
} else if (inscmd.getCmdName() == "tableofcontents"
|| inscmd.getCmdName() == "listofalgorithms"
@ -983,7 +983,7 @@ void Buffer::readInset(LyXLex & lex, LyXParagraph *& par,
} else if (inscmd.getCmdName() == "printindex") {
inset = new InsetPrintIndex(inscmd);
} else if (inscmd.getCmdName() == "lyxparent") {
inset = new InsetParent(inscmd, this);
inset = new InsetParent(inscmd, *this);
}
} else {
if (tmptok == "Quotes") {
@ -995,16 +995,16 @@ void Buffer::readInset(LyXLex & lex, LyXParagraph *& par,
} else if (tmptok == "Formula") {
inset = new InsetFormula;
} else if (tmptok == "Figure") {
inset = new InsetFig(100, 100, this);
inset = new InsetFig(100, 100, *this);
} else if (tmptok == "Info") {
inset = new InsetInfo;
} else if (tmptok == "Include") {
InsetCommandParams p( "Include" );
inset = new InsetInclude(p, this);
inset = new InsetInclude(p, *this);
} else if (tmptok == "ERT") {
inset = new InsetERT;
} else if (tmptok == "Tabular") {
inset = new InsetTabular(this);
inset = new InsetTabular(*this);
} else if (tmptok == "Text") {
inset = new InsetText;
} else if (tmptok == "Foot") {

View File

@ -98,7 +98,7 @@ void Formats::SetViewer(string const & name, string const & command)
}
bool Formats::View(Buffer * buffer, string const & filename)
bool Formats::View(Buffer const * buffer, string const & filename)
{
if (filename.empty())
return false;

View File

@ -81,7 +81,7 @@ public:
void SetViewer(string const & name, string const & command);
///
static
bool View(Buffer * buffer, string const & filename);
bool View(Buffer const * buffer, string const & filename);
///
static
Format * GetFormat(string const & name);

View File

@ -707,7 +707,7 @@ void FormTabular::apply_create()
// comm->setMinibuffer(_("Inserting tabular inset..."));
ysize = int(fl_get_slider_value(create_tabular_->slider_columns) + 0.5);
xsize = int(fl_get_slider_value(create_tabular_->slider_rows) + 0.5);
InsetTabular * in = new InsetTabular(lv_->buffer(),xsize,ysize);
InsetTabular * in = new InsetTabular(*lv_->buffer(),xsize,ysize);
if (!lv_->view()->open_new_inset(in)) {
delete in;
}

View File

@ -926,8 +926,8 @@ void UnregisterFigure(InsetFig * fi)
}
InsetFig::InsetFig(int tmpx, int tmpy, Buffer * o)
: owner(o)
InsetFig::InsetFig(int tmpx, int tmpy, Buffer const & o)
: owner(&o)
{
wid = tmpx;
hgh = tmpy;
@ -1220,13 +1220,13 @@ void InsetFig::Edit(BufferView * bv, int, int, unsigned int)
}
Inset * InsetFig::Clone() const
Inset * InsetFig::Clone(Buffer const & buffer) const
{
InsetFig * tmp = new InsetFig(100, 100, owner);
InsetFig * tmp = new InsetFig(100, 100, buffer);
if (lyxerr.debugging()) {
lyxerr << "Clone Figure: buffer:["
<< current_view->buffer()
<< &buffer
<< "], cbuffer:[xx]" << endl;
}

View File

@ -20,7 +20,7 @@ struct Figref;
class InsetFig: public Inset {
public:
///
InsetFig(int tmpx, int tmpy, Buffer *);
InsetFig(int tmpx, int tmpy, Buffer const &);
///
~InsetFig();
///
@ -58,7 +58,7 @@ public:
///
Inset::Code LyxCode() const;
///
Inset * Clone() const;
Inset * Clone(Buffer const &) const;
///
void CallbackFig(long arg);
///
@ -134,7 +134,7 @@ public:
private:
///
Buffer * owner;
Buffer const * owner;
/// restore values on the form
void RestoreForm();
/// recompute screen params

View File

@ -87,7 +87,7 @@ InsetBibKey::~InsetBibKey()
}
Inset * InsetBibKey::Clone() const
Inset * InsetBibKey::Clone(Buffer const &) const
{
InsetBibKey * b = new InsetBibKey(params());
b->setCounter(counter);

View File

@ -34,7 +34,7 @@ public:
///
~InsetBibKey();
///
Inset * Clone() const;
Inset * Clone(Buffer const &) const;
/** Currently \bibitem is used as a LyX2.x command,
so we need this method.
*/
@ -82,7 +82,9 @@ public:
///
~InsetBibtex();
///
Inset * Clone() const { return new InsetBibtex(params()); }
Inset * Clone(Buffer const &) const {
return new InsetBibtex(params());
}
///
string const getScreenLabel() const;
///

View File

@ -24,7 +24,9 @@ public:
///
InsetCitation(InsetCommandParams const &);
///
Inset * Clone() const { return new InsetCitation(params()); }
Inset * Clone(Buffer const &) const {
return new InsetCitation(params());
}
///
string const getScreenLabel() const;
///

View File

@ -49,7 +49,7 @@ InsetCollapsable::InsetCollapsable()
}
Inset * InsetCollapsable::Clone() const
Inset * InsetCollapsable::Clone(Buffer const &) const
{
InsetCollapsable * result = new InsetCollapsable();
result->inset->init(inset);

View File

@ -43,7 +43,7 @@ public:
///
InsetCollapsable();
///
Inset * Clone() const;
Inset * Clone(Buffer const &) const;
///
void Read(Buffer const *, LyXLex &);
///

View File

@ -65,7 +65,7 @@ public:
///
EDITABLE Editable() const { return IS_EDITABLE; }
///
Inset * Clone() const { return new InsetError(contents); }
Inset * Clone(Buffer const &) const { return new InsetError(contents); }
///
Inset::Code LyxCode() const { return Inset::NO_CODE; }
/// We don't want "begin" and "end inset" in lyx-file

View File

@ -44,7 +44,7 @@ void InsetERT::Write(Buffer const * buf, ostream & os) const
}
Inset * InsetERT::Clone() const
Inset * InsetERT::Clone(Buffer const &) const
{
InsetERT * result = new InsetERT;
result->inset->init(inset);

View File

@ -32,7 +32,7 @@ public:
///
void Write(Buffer const * buf, std::ostream & os) const;
///
Inset * Clone() const;
Inset * Clone(Buffer const &) const;
///
string const EditMessage() const;
///

View File

@ -392,7 +392,7 @@ void InsetExternal::Validate(LaTeXFeatures & features) const
}
Inset * InsetExternal::Clone() const
Inset * InsetExternal::Clone(Buffer const &) const
{
InsetExternal * inset = new InsetExternal();
inset->templatename = templatename;

View File

@ -59,7 +59,7 @@ public:
virtual Inset::Code LyxCode() const { return EXTERNAL_CODE; }
///
virtual Inset * Clone() const;
virtual Inset * Clone(Buffer const &) const;
/// returns the text of the button
virtual string const getScreenLabel() const;

View File

@ -135,7 +135,7 @@ void InsetFloat::Validate(LaTeXFeatures & features) const
}
Inset * InsetFloat::Clone() const
Inset * InsetFloat::Clone(Buffer const &) const
{
InsetFloat * result = new InsetFloat(floatType);
result->inset->init(inset);

View File

@ -34,7 +34,7 @@ public:
///
void Validate(LaTeXFeatures & features) const;
///
Inset * Clone() const;
Inset * Clone(Buffer const &) const;
///
Inset::Code LyxCode() const { return Inset::FLOAT_CODE; }
///

View File

@ -34,7 +34,7 @@ InsetFoot::InsetFoot()
}
Inset * InsetFoot::Clone() const
Inset * InsetFoot::Clone(Buffer const &) const
{
InsetFoot * result = new InsetFoot;
result->inset->init(inset);

View File

@ -28,7 +28,7 @@ public:
///
InsetFoot();
///
Inset * Clone() const;
Inset * Clone(Buffer const &) const;
///
Inset::Code LyxCode() const { return Inset::FOOT_CODE; }
///

View File

@ -663,7 +663,7 @@ InsetGraphicsParams InsetGraphics::getParams() const
return params;
}
Inset * InsetGraphics::Clone() const
Inset * InsetGraphics::Clone(Buffer const &) const
{
InsetGraphics * newInset = new InsetGraphics;

View File

@ -86,7 +86,7 @@ public:
Inset::Code LyxCode() const { return Inset::GRAPHICS_CODE; }
///
Inset * Clone() const;
Inset * Clone(Buffer const &) const;
/** Set the inset parameters, used by the GUIndependent dialog.
Return true of new params are different from what was so far.

View File

@ -203,8 +203,8 @@ string unique_id() {
}
InsetInclude::InsetInclude(InsetCommandParams const & p, Buffer * bf)
: InsetCommand(p), master(bf)
InsetInclude::InsetInclude(InsetCommandParams const & p, Buffer const & bf)
: InsetCommand(p), master(&bf)
{
flag = InsetInclude::INCLUDE;
noload = false;
@ -229,9 +229,9 @@ InsetInclude::~InsetInclude()
}
Inset * InsetInclude::Clone() const
Inset * InsetInclude::Clone(Buffer const & buffer) const
{
InsetInclude * ii = new InsetInclude (params(), master);
InsetInclude * ii = new InsetInclude (params(), buffer);
ii->setNoLoad(isNoLoad());
// By default, the newly created inset is of `include' type,
// so we do not test this case.

View File

@ -27,11 +27,11 @@ struct LaTeXFeatures;
class InsetInclude: public InsetCommand {
public:
///
InsetInclude(InsetCommandParams const &, Buffer *);
InsetInclude(InsetCommandParams const &, Buffer const &);
///
~InsetInclude();
///
Inset * Clone() const;
Inset * Clone(Buffer const &) const;
///
Inset::Code LyxCode() const { return Inset::INCLUDE_CODE; }
/// This returns the list of labels on the child buffer
@ -114,7 +114,7 @@ private:
///
int flag;
///
Buffer * master;
Buffer const * master;
///
string include_label;
};

View File

@ -27,7 +27,9 @@ public:
///
InsetIndex(InsetCommandParams const &);
///
Inset * Clone() const { return new InsetIndex(params());}
Inset * Clone(Buffer const &) const {
return new InsetIndex(params());
}
///
string const getScreenLabel() const;
///
@ -42,7 +44,9 @@ public:
///
InsetPrintIndex(InsetCommandParams const &);
///
Inset * Clone() const { return new InsetPrintIndex(params());}
Inset * Clone(Buffer const &) const {
return new InsetPrintIndex(params());
}
/// Updates needed features for this inset.
void Validate(LaTeXFeatures & features) const;
///

View File

@ -237,7 +237,7 @@ void InsetInfo::Edit(BufferView *bv, int, int, unsigned int)
}
Inset * InsetInfo::Clone() const
Inset * InsetInfo::Clone(Buffer const &) const
{
return new InsetInfo(contents);
}

View File

@ -67,7 +67,7 @@ public:
///
Inset::Code LyxCode() const;
///
Inset * Clone() const;
Inset * Clone(Buffer const &) const;
///
static void CloseInfoCB(FL_OBJECT *, long data);
private:

View File

@ -23,7 +23,7 @@ public:
///
InsetLabel(InsetCommandParams const &);
///
Inset * Clone() const { return new InsetLabel(params()); }
Inset * Clone(Buffer const &) const { return new InsetLabel(params()); }
///
string const getScreenLabel() const { return getContents(); }
///

View File

@ -662,7 +662,7 @@ bool InsetLatexAccent::DirectWrite() const
}
Inset * InsetLatexAccent::Clone() const
Inset * InsetLatexAccent::Clone(Buffer const &) const
{
return new InsetLatexAccent(contents);
}

View File

@ -67,7 +67,7 @@ public:
///
bool DirectWrite() const;
///
Inset * Clone() const;
Inset * Clone(Buffer const &) const;
///
Inset::Code LyxCode()const;
///

View File

@ -57,7 +57,7 @@ void InsetList::Write(Buffer const * buf, ostream & os) const
}
Inset * InsetList::Clone() const
Inset * InsetList::Clone(Buffer const &) const
{
InsetList * result = new InsetList;
result->inset->init(inset);

View File

@ -28,7 +28,7 @@ public:
///
void Write(Buffer const * buf, std::ostream & os) const;
///
Inset * Clone() const;
Inset * Clone(Buffer const &) const;
///
Inset::Code LyxCode() const { return Inset::FOOT_CODE; }
///

View File

@ -35,7 +35,7 @@ InsetMarginal::InsetMarginal()
}
Inset * InsetMarginal::Clone() const
Inset * InsetMarginal::Clone(Buffer const &) const
{
InsetMarginal * result = new InsetMarginal;
result->inset->init(inset);

View File

@ -26,7 +26,7 @@ public:
///
InsetMarginal();
///
Inset * Clone() const;
Inset * Clone(Buffer const &) const;
///
Inset::Code LyxCode() const { return Inset::MARGIN_CODE; }
///

View File

@ -75,7 +75,7 @@ void InsetMinipage::Write(Buffer const * buf, ostream & os) const
}
Inset * InsetMinipage::Clone() const
Inset * InsetMinipage::Clone(Buffer const &) const
{
InsetMinipage * result = new InsetMinipage;
result->inset->init(inset);

View File

@ -28,7 +28,7 @@ public:
///
void Write(Buffer const * buf, std::ostream & os) const;
///
Inset * Clone() const;
Inset * Clone(Buffer const &) const;
///
Inset::Code LyxCode() const { return Inset::MINIPAGE_CODE; }
///

View File

@ -29,14 +29,11 @@
using std::ostream;
InsetParent::InsetParent(InsetCommandParams const & p, Buffer * bf)
InsetParent::InsetParent(InsetCommandParams const & p, Buffer const & bf)
: InsetCommand(p)
{
string fn = p.getContents();
if (bf)
setContents(MakeAbsPath(fn, OnlyPath(bf->fileName())));
else
setContents(fn);
setContents(MakeAbsPath(fn, OnlyPath(bf.fileName())));
}

View File

@ -27,9 +27,11 @@ class Buffer;
class InsetParent : public InsetCommand {
public:
///
InsetParent(InsetCommandParams const &, Buffer * owner = 0);
InsetParent(InsetCommandParams const &, Buffer const &);
///
Inset * Clone() const { return new InsetParent(params()); }
Inset * Clone(Buffer const & buffer) const {
return new InsetParent(params(), buffer);
}
///
string const getScreenLabel() const;
///

View File

@ -311,7 +311,7 @@ void InsetQuotes::Validate(LaTeXFeatures & features) const
}
Inset * InsetQuotes::Clone() const
Inset * InsetQuotes::Clone(Buffer const &) const
{
return new InsetQuotes(language, side, times);
}

View File

@ -97,7 +97,7 @@ public:
///
void Validate(LaTeXFeatures &) const;
///
Inset * Clone() const;
Inset * Clone(Buffer const &) const;
///
Inset::Code LyxCode() const;
private:

View File

@ -16,11 +16,8 @@
using std::ostream;
extern BufferView * current_view;
InsetRef::InsetRef(InsetCommandParams const & p)
: InsetCommand(p)
InsetRef::InsetRef(InsetCommandParams const & p, Buffer const & buf)
: InsetCommand(p), isLatex(buf.isLatex())
{}
void InsetRef::Edit(BufferView * bv, int, int, unsigned int button)
@ -50,7 +47,7 @@ string const InsetRef::getScreenLabel() const
temp += getContents();
if(!current_view->buffer()->isLatex()
if(!isLatex
&& !getOptions().empty()) {
temp += "||";
temp += getOptions();

View File

@ -24,9 +24,11 @@ struct LaTeXFeatures;
class InsetRef : public InsetCommand {
public:
///
InsetRef(InsetCommandParams const &);
InsetRef(InsetCommandParams const &, Buffer const &);
///
Inset * Clone() const { return new InsetRef(params()); }
Inset * Clone(Buffer const & buffer) const {
return new InsetRef(params(), buffer);
}
///
string const getScreenLabel() const;
///
@ -51,5 +53,7 @@ public:
private:
/// This function escapes 8-bit characters
string const escape(string const &) const;
///
bool isLatex;
};
#endif

View File

@ -221,7 +221,7 @@ int InsetSpecialChar::DocBook(Buffer const * buf, ostream & os) const
}
Inset * InsetSpecialChar::Clone() const
Inset * InsetSpecialChar::Clone(Buffer const &) const
{
return new InsetSpecialChar(kind);
}

View File

@ -65,7 +65,7 @@ public:
///
int DocBook(Buffer const *, std::ostream &) const;
///
Inset * Clone() const;
Inset * Clone(Buffer const &) const;
///
Inset::Code LyxCode() const
{

View File

@ -115,8 +115,8 @@ bool cellstart(LyXParagraph::size_type p)
}
InsetTabular::InsetTabular(Buffer * buf, int rows, int columns)
: buffer(buf)
InsetTabular::InsetTabular(Buffer const & buf, int rows, int columns)
: buffer(&buf)
{
if (rows <= 0)
rows = 1;
@ -137,8 +137,8 @@ InsetTabular::InsetTabular(Buffer * buf, int rows, int columns)
}
InsetTabular::InsetTabular(InsetTabular const & tab, Buffer * buf)
: buffer(buf)
InsetTabular::InsetTabular(InsetTabular const & tab, Buffer const & buf)
: buffer(&buf)
{
tabular = new LyXTabular(this, *(tab.tabular));
the_locking_inset = 0;
@ -161,9 +161,9 @@ InsetTabular::~InsetTabular()
}
Inset * InsetTabular::Clone() const
Inset * InsetTabular::Clone(Buffer const & buf) const
{
InsetTabular * t = new InsetTabular(*this, buffer);
InsetTabular * t = new InsetTabular(*this, buf);
delete t->tabular;
t->tabular = tabular->Clone(t);
return t;

View File

@ -73,13 +73,13 @@ public:
SELECTION
};
///
InsetTabular(Buffer *, int rows = 1, int columns = 1);
InsetTabular(Buffer const &, int rows = 1, int columns = 1);
///
InsetTabular(InsetTabular const &, Buffer *);
InsetTabular(InsetTabular const &, Buffer const &);
///
~InsetTabular();
///
Inset * Clone() const;
Inset * Clone(Buffer const &) const;
///
void Read(Buffer const *, LyXLex &);
///
@ -160,7 +160,7 @@ public:
///
int getMaxWidth(Painter & pain, UpdatableInset const *) const;
///
Buffer * BufferOwner() const { return buffer; }
Buffer * BufferOwner() const { return const_cast<Buffer *>(buffer); }
///
LyXText * getLyXText(BufferView *) const;
///
@ -235,7 +235,7 @@ private:
///
InsetText * the_locking_inset;
///
Buffer * buffer;
Buffer const * buffer;
///
mutable LyXCursor cursor;
///

View File

@ -138,7 +138,7 @@ void InsetText::clear()
}
Inset * InsetText::Clone() const
Inset * InsetText::Clone(Buffer const &) const
{
InsetText * t = new InsetText(*this);
return t;

View File

@ -75,7 +75,7 @@ public:
///
~InsetText();
///
Inset * Clone() const;
Inset * Clone(Buffer const &) const;
///
InsetText & operator=(InsetText const & it);
///

View File

@ -54,7 +54,7 @@ void InsetTheorem::Write(Buffer const * buf, ostream & os) const
}
Inset * InsetTheorem::Clone() const
Inset * InsetTheorem::Clone(Buffer const &) const
{
InsetTheorem * result = new InsetTheorem;

View File

@ -28,7 +28,7 @@ public:
///
void Write(Buffer const * buf, std::ostream & os) const;
///
Inset * Clone() const;
Inset * Clone(Buffer const &) const;
///
Inset::Code LyxCode() const { return Inset::THEOREM_CODE; }
///

View File

@ -25,7 +25,7 @@ public:
///
InsetTOC(InsetCommandParams const & p) : InsetCommand(p) {}
///
Inset * Clone() const { return new InsetTOC(params()); }
Inset * Clone(Buffer const &) const { return new InsetTOC(params()); }
///
string const getScreenLabel() const;
///

View File

@ -27,7 +27,7 @@ public:
explicit
InsetUrl(InsetCommandParams const &);
///
Inset * Clone() const { return new InsetUrl(params()); }
Inset * Clone(Buffer const &) const { return new InsetUrl(params()); }
///
Inset::Code LyxCode() const { return Inset::URL_CODE; }
///

View File

@ -190,7 +190,7 @@ public:
}
///
virtual Inset * Clone() const = 0;
virtual Inset * Clone(Buffer const &) const = 0;
/// returns true to override begin and end inset in file
virtual bool DirectWrite() const;

View File

@ -154,7 +154,7 @@ void MenuReload(Buffer * buf);
void MenuLayoutSave();
void ShowMessage(Buffer * buf,
void ShowMessage(Buffer const * buf,
string const & msg1,
string const & msg2,
string const & msg3, int delay)
@ -836,7 +836,7 @@ void FigureApplyCB(FL_OBJECT *, long)
current_view->owner()->getMiniBuffer()->Set(_("Inserting figure..."));
if (fl_get_button(fd_form_figure->radio_inline)) {
InsetFig * new_inset = new InsetFig(100, 20, buffer);
InsetFig * new_inset = new InsetFig(100, 20, *buffer);
current_view->insertInset(new_inset);
current_view->owner()->getMiniBuffer()->Set(_("Figure inserted"));
new_inset->Edit(current_view, 0, 0, 0);
@ -890,7 +890,7 @@ void FigureApplyCB(FL_OBJECT *, long)
current_view->update(BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE);
Inset * new_inset = new InsetFig(100, 100, buffer);
Inset * new_inset = new InsetFig(100, 100, *buffer);
current_view->insertInset(new_inset);
new_inset->Edit(current_view, 0, 0, 0);
current_view->update(BufferView::SELECT|BufferView::FITCUR);

View File

@ -19,7 +19,7 @@ extern bool BindFileSet;
///
extern LyXFont const UserFreeFont(BufferParams const & params);
///
void ShowMessage(Buffer * buf,
void ShowMessage(Buffer const * buf,
string const & msg1,
string const & msg2 = string(),
string const & msg3 = string(), int delay = 6);

View File

@ -523,7 +523,7 @@ LyXFunc::func_status LyXFunc::getStatus(int ac) const
flag |= ret;
disable = false;
} else {
static InsetTabular inset(owner->buffer(), 1, 1);
static InsetTabular inset(*owner->buffer(), 1, 1);
func_status ret;
disable = true;
@ -855,7 +855,6 @@ string const LyXFunc::Dispatch(int ac,
meta_fake_bit = Mod1Mask;
string buf;
keyseq.print(buf, true);
string res = string("M-") + buf;
setMessage(buf); // RVDK_PATCH_5
}
break;
@ -1495,7 +1494,7 @@ string const LyXFunc::Dispatch(int ac,
InsetCommandParams p;
p.setFromString(argument);
InsetRef * inset = new InsetRef(p);
InsetRef * inset = new InsetRef(p, *owner->buffer());
if (!owner->view()->insertInset(inset))
delete inset;
else
@ -2347,7 +2346,7 @@ string const LyXFunc::Dispatch(int ac,
if (!argument.empty())
::sscanf(argument.c_str(),"%d%d", &r, &c);
InsetTabular * new_inset =
new InsetTabular(owner->buffer(), r, c);
new InsetTabular(*owner->buffer(), r, c);
if (owner->view()->insertInset(new_inset))
new_inset->Edit(owner->view(), 0, 0, 0);
else
@ -2796,7 +2795,7 @@ string const LyXFunc::Dispatch(int ac,
{
lyxerr << "arg " << argument << endl;
InsetCommandParams p( "lyxparent", argument );
Inset * inset = new InsetParent(p, owner->buffer());
Inset * inset = new InsetParent(p, *owner->buffer());
if (!owner->view()->insertInset(inset, "Standard", true))
delete inset;
}
@ -2805,7 +2804,7 @@ string const LyXFunc::Dispatch(int ac,
case LFUN_CHILDINSERT:
{
InsetCommandParams p( "Include", argument );
Inset * inset = new InsetInclude(p, owner->buffer());
Inset * inset = new InsetInclude(p, *owner->buffer());
if (owner->view()->insertInset(inset, "Standard", true))
inset->Edit(owner->view(), 0, 0, 0);
else

View File

@ -301,7 +301,7 @@ InsetFormula::~InsetFormula()
}
Inset * InsetFormula::Clone() const
Inset * InsetFormula::Clone(Buffer const &) const
{
InsetFormula * f = new InsetFormula(par);
f->label = label;

View File

@ -64,7 +64,7 @@ public:
///
void Validate(LaTeXFeatures &) const;
///
Inset * Clone() const;
Inset * Clone(Buffer const &) const;
///
Inset::Code LyxCode() const { return Inset::MATH_CODE; }
///

View File

@ -61,7 +61,7 @@ InsetFormulaMacro::~InsetFormulaMacro()
}
Inset * InsetFormulaMacro::Clone() const
Inset * InsetFormulaMacro::Clone(Buffer const &) const
{
return new InsetFormulaMacro(name);
}

View File

@ -56,7 +56,7 @@ public:
///
int DocBook(Buffer const *, std::ostream &) const;
///
Inset * Clone() const;
Inset * Clone(Buffer const &) const;
/// what appears in the minibuffer when opening
string const EditMessage() const;

View File

@ -410,7 +410,7 @@ void LyXParagraph::CopyIntoMinibuffer(BufferParams const & bparams,
minibuffer_inset = 0;
if (minibuffer_char == LyXParagraph::META_INSET) {
if (GetInset(pos)) {
minibuffer_inset = GetInset(pos)->Clone();
minibuffer_inset = GetInset(pos)->Clone(*current_view->buffer());
} else {
minibuffer_inset = 0;
minibuffer_char = ' ';
@ -1610,7 +1610,8 @@ LyXParagraph * LyXParagraph::Clone() const
// ale970302
if (bibkey)
result->bibkey = static_cast<InsetBibKey *>(bibkey->Clone());
result->bibkey = static_cast<InsetBibKey *>
(bibkey->Clone(*current_view->buffer()));
else
result->bibkey = 0;
@ -1621,7 +1622,7 @@ LyXParagraph * LyXParagraph::Clone() const
result->insetlist = insetlist;
for (InsetList::iterator it = result->insetlist.begin();
it != result->insetlist.end(); ++it)
(*it).inset = (*it).inset->Clone();
(*it).inset = (*it).inset->Clone(*current_view->buffer());
return result;
}