? src/newfile1.lyx
? src/frontends/xforms/lyx_forms.h
? src/frontends/xforms/lyx_xpm.h
Index: po/POTFILES.in
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/po/POTFILES.in,v
retrieving revision 1.329
diff -u -p -r1.329 POTFILES.in
--- po/POTFILES.in 21 May 2003 10:03:58 -0000 1.329
+++ po/POTFILES.in 2 Jun 2003 23:17:20 -0000
@@ -53,7 +53,6 @@ src/frontends/qt2/QExternal.C
src/frontends/qt2/QExternalDialog.C
src/frontends/qt2/QFloat.C
src/frontends/qt2/QGraphics.C
-src/frontends/qt2/QGraphicsDialog.C
src/frontends/qt2/QInclude.C
src/frontends/qt2/QLPrintDialog.C
src/frontends/qt2/QLog.C
@@ -151,7 +150,6 @@ src/insets/insetmarginal.C
src/insets/insetminipage.C
src/insets/insetnote.C
src/insets/insetoptarg.C
-src/insets/insetparent.C
src/insets/insetref.C
src/insets/insettabular.C
src/insets/insettext.C
Index: src/CutAndPaste.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/CutAndPaste.C,v
retrieving revision 1.99
diff -u -p -r1.99 CutAndPaste.C
--- src/CutAndPaste.C 21 May 2003 21:20:48 -0000 1.99
+++ src/CutAndPaste.C 2 Jun 2003 23:17:20 -0000
@@ -25,7 +25,8 @@
#include "paragraph_funcs.h"
#include "debug.h"
-#include "insets/inseterror.h"
+#include "insets/insetinclude.h"
+#include "insets/insettabular.h"
#include "support/LAssert.h"
#include "support/lstrings.h"
@@ -273,6 +274,39 @@ CutAndPaste::pasteSelection(ParagraphLis
// the cursor paragraph.
simple_cut_clone.begin()->makeSameLayout(*pit);
+ // Prepare the paragraphs and insets for insertion
+ ParagraphList::iterator fpit = simple_cut_clone.begin();
+ ParagraphList::iterator epit = simple_cut_clone.end();
+ for (; fpit != epit; ++fpit) {
+ InsetList::iterator lit = fpit->insetlist.begin();
+ InsetList::iterator eit = fpit->insetlist.end();
+ for (; lit != eit; ++lit) {
+ Inset::Code code = lit->inset->lyxCode();
+ switch (code) {
+ case Inset::INCLUDE_CODE: {
+ InsetInclude * ii = static_cast<InsetInclude*>(lit->inset);
+ InsetInclude::Params ip = ii->params();
+ ip.masterFilename_ = current_view->buffer()->fileName();
+ ii->set(ip);
+
+ break;
+ }
+
+ case Inset::TABULAR_CODE: {
+ // This will probably need more work.
+ // Sub-paragraphs are not fixed.
+ InsetTabular * it = static_cast<InsetTabular*>(lit->inset);
+ it->buffer(current_view->buffer());
+
+ break;
+ }
+
+ default:
+ break; // nothing
+ }
+ }
+ }
+
bool paste_the_end = false;
// Open the paragraph for inserting the buf
Index: src/buffer.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/buffer.C,v
retrieving revision 1.476
diff -u -p -r1.476 buffer.C
--- src/buffer.C 2 Jun 2003 14:02:58 -0000 1.476
+++ src/buffer.C 2 Jun 2003 23:17:21 -0000
@@ -369,7 +369,6 @@ int Buffer::readParagraph(LyXLex & lex,
lex.pushToken(token);
Paragraph par;
- par.owningBuffer(*this);
par.params().depth(depth);
if (params.tracking_changes)
par.trackChanges();
Index: src/factory.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/factory.C,v
retrieving revision 1.31
diff -u -p -r1.31 factory.C
--- src/factory.C 2 Jun 2003 14:19:29 -0000 1.31
+++ src/factory.C 2 Jun 2003 23:17:21 -0000
@@ -206,8 +206,7 @@ Inset * createInset(FuncRequest const &
InsetGraphicsParams igp;
InsetGraphicsMailer::string2params(cmd.argument, igp);
InsetGraphics * inset = new InsetGraphics;
- string const fpath = cmd.view()->buffer()->filePath();
- inset->setParams(igp, fpath);
+ inset->setParams(igp);
return inset;
} else if (name == "include") {
Index: src/paragraph.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/paragraph.C,v
retrieving revision 1.279
diff -u -p -r1.279 paragraph.C
--- src/paragraph.C 29 May 2003 11:19:50 -0000 1.279
+++ src/paragraph.C 2 Jun 2003 23:17:21 -0000
@@ -84,14 +84,13 @@ Paragraph::Paragraph(Paragraph const & l
// this is because of the dummy layout of the paragraphs that
// follow footnotes
layout_ = lp.layout();
- buffer_ = lp.buffer_;
// copy everything behind the break-position to the new paragraph
insetlist = lp.insetlist;
InsetList::iterator it = insetlist.begin();
InsetList::iterator end = insetlist.end();
for (; it != end; ++it) {
- it->inset = it->inset->clone(**buffer_);
+ it->inset = it->inset->clone();
// tell the new inset who is the boss now
it->inset->parOwner(this);
}
@@ -231,7 +230,7 @@ void Paragraph::copyIntoMinibuffer(Buffe
minibuffer_inset = 0;
if (minibuffer_char == Paragraph::META_INSET) {
if (getInset(pos)) {
- minibuffer_inset = getInset(pos)->clone(buffer);
+ minibuffer_inset = getInset(pos)->clone();
} else {
minibuffer_inset = 0;
minibuffer_char = ' ';
Index: src/paragraph.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/paragraph.h,v
retrieving revision 1.85
diff -u -p -r1.85 paragraph.h
--- src/paragraph.h 29 May 2003 11:19:51 -0000 1.85
+++ src/paragraph.h 2 Jun 2003 23:17:21 -0000
@@ -20,8 +20,6 @@
#include "LString.h"
-#include <boost/optional.hpp>
-
class Buffer;
class BufferParams;
class BufferView;
@@ -293,15 +291,10 @@ public:
ParagraphParameters const & params() const;
///
InsetList insetlist;
- ///
- void owningBuffer(Buffer const & b) {
- buffer_.reset(&b);
- }
+
private:
///
LyXLayout_ptr layout_;
- ///
- boost::optional<Buffer const *> buffer_;
struct Pimpl;
///
Index: src/insets/inset.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/inset.h,v
retrieving revision 1.98
diff -u -p -r1.98 inset.h
--- src/insets/inset.h 2 Jun 2003 16:14:33 -0000 1.98
+++ src/insets/inset.h 2 Jun 2003 23:17:22 -0000
@@ -198,7 +198,7 @@ public:
}
///
- virtual Inset * clone(Buffer const &) const = 0;
+ virtual Inset * clone() const = 0;
/// returns true to override begin and end inset in file
virtual bool directWrite() const;
Index: src/insets/insetbibitem.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetbibitem.C,v
retrieving revision 1.14
diff -u -p -r1.14 insetbibitem.C
--- src/insets/insetbibitem.C 28 May 2003 06:47:15 -0000 1.14
+++ src/insets/insetbibitem.C 2 Jun 2003 23:17:22 -0000
@@ -43,20 +43,12 @@ InsetBibitem::~InsetBibitem()
}
-Inset * InsetBibitem::clone(Buffer const &) const
+Inset * InsetBibitem::clone() const
{
InsetBibitem * b = new InsetBibitem(params());
b->setCounter(counter);
return b;
}
-
-
-// Inset * InsetBibitem::clone(Buffer const &, bool) const
-// {
-// InsetBibitem * b = new InsetBibitem(params());
-// b->setCounter(counter);
-// return b;
-// }
dispatch_result InsetBibitem::localDispatch(FuncRequest const & cmd)
Index: src/insets/insetbibitem.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetbibitem.h,v
retrieving revision 1.7
diff -u -p -r1.7 insetbibitem.h
--- src/insets/insetbibitem.h 28 May 2003 23:09:14 -0000 1.7
+++ src/insets/insetbibitem.h 2 Jun 2003 23:17:22 -0000
@@ -29,7 +29,7 @@ public:
///
~InsetBibitem();
///
- Inset * clone(Buffer const &) const;
+ Inset * clone() const;
///
virtual dispatch_result localDispatch(FuncRequest const & cmd);
/** Currently \bibitem is used as a LyX2.x command,
Index: src/insets/insetbibtex.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetbibtex.h,v
retrieving revision 1.9
diff -u -p -r1.9 insetbibtex.h
--- src/insets/insetbibtex.h 28 May 2003 23:09:14 -0000 1.9
+++ src/insets/insetbibtex.h 2 Jun 2003 23:17:22 -0000
@@ -27,7 +27,7 @@ public:
///
~InsetBibtex();
///
- Inset * clone(Buffer const &) const {
+ Inset * clone() const {
return new InsetBibtex(params());
}
/// small wrapper for the time being
Index: src/insets/insetcite.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetcite.h,v
retrieving revision 1.33
diff -u -p -r1.33 insetcite.h
--- src/insets/insetcite.h 28 May 2003 23:09:14 -0000 1.33
+++ src/insets/insetcite.h 2 Jun 2003 23:17:22 -0000
@@ -25,7 +25,7 @@ public:
///
~InsetCitation();
///
- Inset * clone(Buffer const &) const {
+ Inset * clone() const {
return new InsetCitation(params());
}
///
Index: src/insets/insetcommand.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetcommand.C,v
retrieving revision 1.75
diff -u -p -r1.75 insetcommand.C
--- src/insets/insetcommand.C 26 May 2003 09:13:53 -0000 1.75
+++ src/insets/insetcommand.C 2 Jun 2003 23:17:22 -0000
@@ -31,9 +31,10 @@ InsetCommand::InsetCommand(InsetCommandP
{}
-// InsetCommand::InsetCommand(InsetCommandParams const & p, bool)
-// : p_(p.getCmdName(), p.getContents(), p.getOptions())
-// {}
+InsetCommand::InsetCommand(InsetCommand const & ic)
+ : p_(ic.p_)
+{
+}
void InsetCommand::setParams(InsetCommandParams const & p)
Index: src/insets/insetcommand.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetcommand.h,v
retrieving revision 1.63
diff -u -p -r1.63 insetcommand.h
--- src/insets/insetcommand.h 28 May 2003 23:09:14 -0000 1.63
+++ src/insets/insetcommand.h 2 Jun 2003 23:17:22 -0000
@@ -33,6 +33,8 @@ public:
explicit
InsetCommand(InsetCommandParams const &);
///
+ InsetCommand(InsetCommand const &);
+ ///
void write(Buffer const *, std::ostream & os) const
{ p_.write(os); }
///
Index: src/insets/insetenv.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetenv.C,v
retrieving revision 1.10
diff -u -p -r1.10 insetenv.C
--- src/insets/insetenv.C 28 May 2003 23:09:14 -0000 1.10
+++ src/insets/insetenv.C 2 Jun 2003 23:17:22 -0000
@@ -40,7 +40,7 @@ InsetEnvironment::InsetEnvironment(Inset
{}
-Inset * InsetEnvironment::clone(Buffer const &) const
+Inset * InsetEnvironment::clone() const
{
return new InsetEnvironment(*this);
}
Index: src/insets/insetenv.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetenv.h,v
retrieving revision 1.8
diff -u -p -r1.8 insetenv.h
--- src/insets/insetenv.h 28 May 2003 23:09:14 -0000 1.8
+++ src/insets/insetenv.h 2 Jun 2003 23:17:22 -0000
@@ -26,7 +26,7 @@ public:
///
void read(Buffer const * buf, LyXLex & lex);
///
- Inset * clone(Buffer const &) const;
+ Inset * clone() const;
///
Inset::Code lyxCode() const { return Inset::ENVIRONMENT_CODE; }
///
Index: src/insets/inseterror.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/inseterror.h,v
retrieving revision 1.60
diff -u -p -r1.60 inseterror.h
--- src/insets/inseterror.h 2 Jun 2003 10:03:22 -0000 1.60
+++ src/insets/inseterror.h 2 Jun 2003 23:17:22 -0000
@@ -54,7 +54,7 @@ public:
///
EDITABLE editable() const { return IS_EDITABLE; }
///
- Inset * clone(Buffer const &) const {
+ Inset * clone() const {
return new InsetError(contents);
}
///
Index: src/insets/insetert.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetert.C,v
retrieving revision 1.128
diff -u -p -r1.128 insetert.C
--- src/insets/insetert.C 2 Jun 2003 10:03:22 -0000 1.128
+++ src/insets/insetert.C 2 Jun 2003 23:17:22 -0000
@@ -70,7 +70,7 @@ InsetERT::InsetERT(InsetERT const & in)
}
-Inset * InsetERT::clone(Buffer const &) const
+Inset * InsetERT::clone() const
{
return new InsetERT(*this);
}
Index: src/insets/insetert.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetert.h,v
retrieving revision 1.74
diff -u -p -r1.74 insetert.h
--- src/insets/insetert.h 2 Jun 2003 10:03:22 -0000 1.74
+++ src/insets/insetert.h 2 Jun 2003 23:17:22 -0000
@@ -40,7 +40,7 @@ public:
///
InsetERT(InsetERT const &);
///
- Inset * clone(Buffer const &) const;
+ Inset * clone() const;
///
InsetERT(BufferParams const &,
Language const *, string const & contents, bool collapsed);
Index: src/insets/insetexternal.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetexternal.C,v
retrieving revision 1.73
diff -u -p -r1.73 insetexternal.C
--- src/insets/insetexternal.C 28 May 2003 23:09:14 -0000 1.73
+++ src/insets/insetexternal.C 2 Jun 2003 23:17:22 -0000
@@ -223,7 +223,7 @@ void InsetExternal::validate(LaTeXFeatur
}
-Inset * InsetExternal::clone(Buffer const &) const
+Inset * InsetExternal::clone() const
{
InsetExternal * inset = new InsetExternal;
inset->params_ = params_;
Index: src/insets/insetexternal.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetexternal.h,v
retrieving revision 1.35
diff -u -p -r1.35 insetexternal.h
--- src/insets/insetexternal.h 28 May 2003 23:09:14 -0000 1.35
+++ src/insets/insetexternal.h 2 Jun 2003 23:17:22 -0000
@@ -69,7 +69,7 @@ public:
virtual Inset::Code lyxCode() const { return EXTERNAL_CODE; }
///
- virtual Inset * clone(Buffer const &) const;
+ virtual Inset * clone() const;
/// returns the text of the button
virtual string const getScreenLabel(Buffer const *) const;
Index: src/insets/insetfloat.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetfloat.C,v
retrieving revision 1.81
diff -u -p -r1.81 insetfloat.C
--- src/insets/insetfloat.C 28 May 2003 23:09:14 -0000 1.81
+++ src/insets/insetfloat.C 2 Jun 2003 23:17:22 -0000
@@ -259,7 +259,7 @@ void InsetFloat::validate(LaTeXFeatures
}
-Inset * InsetFloat::clone(Buffer const &) const
+Inset * InsetFloat::clone() const
{
return new InsetFloat(*this);
}
Index: src/insets/insetfloat.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetfloat.h,v
retrieving revision 1.43
diff -u -p -r1.43 insetfloat.h
--- src/insets/insetfloat.h 28 May 2003 23:09:14 -0000 1.43
+++ src/insets/insetfloat.h 2 Jun 2003 23:17:22 -0000
@@ -53,7 +53,7 @@ public:
///
void validate(LaTeXFeatures & features) const;
///
- Inset * clone(Buffer const &) const;
+ Inset * clone() const;
///
Inset::Code lyxCode() const { return Inset::FLOAT_CODE; }
///
Index: src/insets/insetfloatlist.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetfloatlist.h,v
retrieving revision 1.22
diff -u -p -r1.22 insetfloatlist.h
--- src/insets/insetfloatlist.h 26 May 2003 09:13:53 -0000 1.22
+++ src/insets/insetfloatlist.h 2 Jun 2003 23:17:22 -0000
@@ -26,13 +26,9 @@ public:
///
~InsetFloatList();
///
- Inset * clone(Buffer const &) const {
+ Inset * clone() const {
return new InsetFloatList(getCmdName());
}
- ///
- //Inset * clone(Buffer const &, bool = false) const {
- // return new InsetFloatList(getCmdName());
- //}
///
dispatch_result localDispatch(FuncRequest const & cmd);
///
Index: src/insets/insetfoot.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetfoot.C,v
retrieving revision 1.58
diff -u -p -r1.58 insetfoot.C
--- src/insets/insetfoot.C 28 May 2003 23:09:14 -0000 1.58
+++ src/insets/insetfoot.C 2 Jun 2003 23:17:23 -0000
@@ -46,7 +46,7 @@ InsetFoot::InsetFoot(InsetFoot const & i
}
-Inset * InsetFoot::clone(Buffer const &) const
+Inset * InsetFoot::clone() const
{
return new InsetFoot(*this);
}
Index: src/insets/insetfoot.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetfoot.h,v
retrieving revision 1.40
diff -u -p -r1.40 insetfoot.h
--- src/insets/insetfoot.h 28 May 2003 23:09:14 -0000 1.40
+++ src/insets/insetfoot.h 2 Jun 2003 23:17:23 -0000
@@ -27,7 +27,7 @@ public:
///
InsetFoot(InsetFoot const &);
///
- Inset * clone(Buffer const &) const;
+ Inset * clone() const;
///
Inset::Code lyxCode() const { return Inset::FOOT_CODE; }
///
Index: src/insets/insetgraphics.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetgraphics.C,v
retrieving revision 1.180
diff -u -p -r1.180 insetgraphics.C
--- src/insets/insetgraphics.C 2 Jun 2003 17:58:19 -0000 1.180
+++ src/insets/insetgraphics.C 2 Jun 2003 23:17:23 -0000
@@ -182,7 +182,7 @@ void InsetGraphics::Cache::update(string
lyx::Assert(!file_with_path.empty());
string const path = OnlyPath(file_with_path);
- loader.reset(file_with_path, parent_.params().as_grfxParams(path));
+ loader.reset(file_with_path, parent_.params().as_grfxParams());
}
@@ -192,19 +192,20 @@ InsetGraphics::InsetGraphics()
{}
-InsetGraphics::InsetGraphics(InsetGraphics const & ig,
- string const & filepath)
+#warning I have zero idea about the trackable()
+InsetGraphics::InsetGraphics(InsetGraphics const & ig)
: Inset(ig),
+ boost::signals::trackable(ig),
graphic_label(uniqueID()),
cache_(new Cache(*this))
{
- setParams(ig.params(), filepath);
+ setParams(ig.params());
}
-Inset * InsetGraphics::clone(Buffer const & buffer) const
+Inset * InsetGraphics::clone() const
{
- return new InsetGraphics(*this, buffer.filePath());
+ return new InsetGraphics(*this);
}
@@ -222,8 +223,7 @@ dispatch_result InsetGraphics::localDisp
InsetGraphicsParams p;
InsetGraphicsMailer::string2params(cmd.argument, p);
if (!p.filename.empty()) {
- string const filepath = cmd.view()->buffer()->filePath();
- setParams(p, filepath);
+ setParams(p);
cmd.view()->updateInset(this);
}
return DISPATCHED;
@@ -327,18 +327,6 @@ BufferView * InsetGraphics::view() const
void InsetGraphics::draw(PainterInfo & pi, int x, int y) const
{
BufferView * bv = pi.base.bv;
- // MakeAbsPath returns params().filename unchanged if it absolute
- // already.
- string const file_with_path =
- MakeAbsPath(params().filename, bv->buffer()->filePath());
-
- // A 'paste' operation creates a new inset with the correct filepath,
- // but then the 'old' inset stored in the 'copy' operation is actually
- // added to the buffer.
- // Thus, we should ensure that the filepath is correct.
- if (file_with_path != cache_->loader.filename())
- cache_->update(file_with_path);
-
cache_->view = bv->owner()->view();
int oasc = cache_->old_ascent;
@@ -400,10 +388,10 @@ Inset::EDITABLE InsetGraphics::editable(
}
-void InsetGraphics::write(Buffer const *, ostream & os) const
+void InsetGraphics::write(Buffer const * buf, ostream & os) const
{
os << "Graphics\n";
- params().Write(os);
+ params().Write(os, buf->filePath());
}
@@ -412,15 +400,15 @@ void InsetGraphics::read(Buffer const *
string const token = lex.getString();
if (token == "Graphics")
- readInsetGraphics(lex);
+ readInsetGraphics(lex, buf->filePath());
else
lyxerr[Debug::GRAPHICS] << "Not a Graphics inset!\n";
- cache_->update(MakeAbsPath(params().filename, buf->filePath()));
+ cache_->update(params().filename);
}
-void InsetGraphics::readInsetGraphics(LyXLex & lex)
+void InsetGraphics::readInsetGraphics(LyXLex & lex, string const & bufpath)
{
bool finished = false;
@@ -447,7 +435,7 @@ void InsetGraphics::readInsetGraphics(Ly
// TODO: Possibly open up a dialog?
}
else {
- if (! params_.Read(lex, token))
+ if (!params_.Read(lex, token, bufpath))
lyxerr << "Unknown token, " << token << ", skipping."
<< std::endl;
}
@@ -510,17 +498,13 @@ string const InsetGraphics::prepareFile(
{
// LaTeX can cope if the graphics file doesn't exist, so just return the
// filename.
- string const orig_file = params().filename;
- string orig_file_with_path =
- MakeAbsPath(orig_file, buf->filePath());
- lyxerr[Debug::GRAPHICS] << "[InsetGraphics::prepareFile] orig_file = "
- << orig_file << "\n\twith path: "
- << orig_file_with_path << endl;
+ string orig_file = params().filename;
+ string const rel_file = MakeRelPath(orig_file, buf->filePath());
- if (!IsFileReadable(orig_file_with_path))
- return orig_file;
+ if (!IsFileReadable(rel_file))
+ return rel_file;
- bool const zipped = zippedFile(orig_file_with_path);
+ bool const zipped = zippedFile(orig_file);
// If the file is compressed and we have specified that it
// should not be uncompressed, then just return its name and
@@ -528,9 +512,9 @@ string const InsetGraphics::prepareFile(
if (zipped && params().noUnzip) {
lyxerr[Debug::GRAPHICS]
<< "\tpass zipped file to LaTeX but with full path.\n";
- // LaTeX needs an absolue path, otherwise the
+ // LaTeX needs an absolute path, otherwise the
// coresponding *.eps.bb file isn't found
- return orig_file_with_path;
+ return orig_file;
}
// Ascertain whether the file has changed.
@@ -551,22 +535,21 @@ string const InsetGraphics::prepareFile(
lyxerr[Debug::GRAPHICS]
<< "\ttemp_file: " << temp_file << endl;
if (file_has_changed || !IsFileReadable(temp_file)) {
- bool const success = lyx::copy(orig_file_with_path,
- temp_file);
+ bool const success = lyx::copy(orig_file, temp_file);
lyxerr[Debug::GRAPHICS]
<< "\tCopying zipped file from "
- << orig_file_with_path << " to " << temp_file
+ << orig_file << " to " << temp_file
<< (success ? " succeeded\n" : " failed\n");
} else
lyxerr[Debug::GRAPHICS]
<< "\tzipped file " << temp_file
<< " exists! Maybe no tempdir ...\n";
- orig_file_with_path = unzipFile(temp_file);
+ orig_file = unzipFile(temp_file);
lyxerr[Debug::GRAPHICS]
- << "\tunzipped to " << orig_file_with_path << endl;
+ << "\tunzipped to " << orig_file << endl;
}
- string const from = getExtFromContents(orig_file_with_path);
+ string const from = getExtFromContents(orig_file);
string const to = findTargetFormat(from, runparams);
lyxerr[Debug::GRAPHICS]
<< "\t we have: from " << from << " to " << to << '\n';
@@ -576,8 +559,8 @@ string const InsetGraphics::prepareFile(
// graphic file as is.
// This is true even if the orig_file is compressed.
if (formats.getFormat(to)->extension() == GetExtension(orig_file))
- return RemoveExtension(orig_file_with_path);
- return orig_file_with_path;
+ return RemoveExtension(orig_file);
+ return orig_file;
}
// We're going to be running the exported buffer through the LaTeX
@@ -592,13 +575,13 @@ string const InsetGraphics::prepareFile(
// to "any_dir_file.ext"! changing the dots in the
// dirname is important for the use of ChangeExtension
lyxerr[Debug::GRAPHICS]
- << "\tthe orig file is: " << orig_file_with_path << endl;
+ << "\tthe orig file is: " << orig_file << endl;
if (lyxrc.use_tempdir) {
- string const ext_tmp = GetExtension(orig_file_with_path);
+ string const ext_tmp = GetExtension(orig_file);
// without ext and /
temp_file = subst(
- ChangeExtension(orig_file_with_path, string()), "/", "_");
+ ChangeExtension(orig_file, string()), "/", "_");
// without dots and again with ext
temp_file = ChangeExtension(
subst(temp_file, ".", "_"), ext_tmp);
@@ -609,14 +592,14 @@ string const InsetGraphics::prepareFile(
// if the file doen't exists, copy it into the tempdir
if (file_has_changed || !IsFileReadable(temp_file)) {
- bool const success = lyx::copy(orig_file_with_path, temp_file);
+ bool const success = lyx::copy(orig_file, temp_file);
lyxerr[Debug::GRAPHICS]
- << "\tcopying from " << orig_file_with_path << " to "
+ << "\tcopying from " << orig_file << " to "
<< temp_file
<< (success ? " succeeded\n" : " failed\n");
if (!success) {
string str = bformat(_("Could not copy the file\n%1$s\n"
- "into the temporary directory."), orig_file_with_path);
+ "into the temporary directory."), orig_file);
Alert::error(_("Graphics display failed"), str);
return orig_file;
}
@@ -672,9 +655,12 @@ int InsetGraphics::latex(Buffer const *
<< "insetgraphics::latex: Filename = "
<< params().filename << endl;
+ string const relative_file = MakeRelPath(params().filename, buf->filePath());
+
// A missing (e)ps-extension is no problem for LaTeX, so
// we have to test three different cases
- string const file_ = MakeAbsPath(params().filename, buf->filePath());
+#warning uh, but can our cache handle it ? no.
+ string const file_ = params().filename;
bool const file_exists =
!file_.empty() &&
(IsFileReadable(file_) || // original
@@ -718,7 +704,7 @@ int InsetGraphics::latex(Buffer const *
// "nice" means that the buffer is exported to LaTeX format but not
// run through the LaTeX compiler.
if (runparams.nice) {
- os << before <<'{' << params().filename << '}' << after;
+ os << before <<'{' << relative_file << '}' << after;
return 1;
}
@@ -727,7 +713,7 @@ int InsetGraphics::latex(Buffer const *
// appropriate (when there are several versions in different formats)
string const latex_str = message.empty() ?
(before + '{' + os::external_path(prepareFile(buf, runparams)) + '}' + after) :
- (before + '{' + params().filename + " not found!}" + after);
+ (before + '{' + relative_file + " not found!}" + after);
os << latex_str;
// Return how many newlines we issued.
@@ -790,8 +776,7 @@ void InsetGraphics::statusChanged()
}
-bool InsetGraphics::setParams(InsetGraphicsParams const & p,
- string const & filepath)
+bool InsetGraphics::setParams(InsetGraphicsParams const & p)
{
// If nothing is changed, just return and say so.
if (params() == p && !p.filename.empty())
@@ -801,7 +786,7 @@ bool InsetGraphics::setParams(InsetGraph
params_ = p;
// Update the inset with the new parameters.
- cache_->update(MakeAbsPath(params().filename, filepath));
+ cache_->update(params().filename);
// We have changed data, report it.
return true;
@@ -848,7 +833,8 @@ void InsetGraphicsMailer::string2params(
if (lex.isOK()) {
InsetGraphics inset;
- inset.readInsetGraphics(lex);
+#warning FIXME not setting bufpath is dubious
+ inset.readInsetGraphics(lex, string());
params = inset.params();
}
}
@@ -859,7 +845,8 @@ InsetGraphicsMailer::params2string(Inset
{
ostringstream data;
data << name_ << ' ';
- params.Write(data);
+#warning FIXME not setting bufpath is dubious
+ params.Write(data, string());
data << "\\end_inset\n";
return STRCONV(data.str());
}
Index: src/insets/insetgraphics.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetgraphics.h,v
retrieving revision 1.70
diff -u -p -r1.70 insetgraphics.h
--- src/insets/insetgraphics.h 2 Jun 2003 10:03:22 -0000 1.70
+++ src/insets/insetgraphics.h 2 Jun 2003 23:17:23 -0000
@@ -29,7 +29,7 @@ public:
///
InsetGraphics();
///
- InsetGraphics(InsetGraphics const &, string const & filepath);
+ InsetGraphics(InsetGraphics const &);
///
~InsetGraphics();
///
@@ -67,13 +67,12 @@ public:
Inset::Code lyxCode() const { return Inset::GRAPHICS_CODE; }
///
- virtual Inset * clone(Buffer const &) const;
+ virtual Inset * clone() const;
/** Set the inset parameters, used by the GUIndependent dialog.
Return true of new params are different from what was so far.
*/
- bool setParams(InsetGraphicsParams const & params,
- string const & filepath);
+ bool setParams(InsetGraphicsParams const & params);
/// Get the inset parameters, used by the GUIndependent dialog.
InsetGraphicsParams const & params() const;
@@ -94,7 +93,7 @@ private:
void statusChanged();
/// Read the inset native format
- void readInsetGraphics(LyXLex & lex);
+ void readInsetGraphics(LyXLex & lex, string const & bufpath);
/// Get the status message, depends on the image loading status.
string const statusMessage() const;
Index: src/insets/insetgraphicsParams.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetgraphicsParams.C,v
retrieving revision 1.58
diff -u -p -r1.58 insetgraphicsParams.C
--- src/insets/insetgraphicsParams.C 19 May 2003 17:03:08 -0000 1.58
+++ src/insets/insetgraphicsParams.C 2 Jun 2003 23:17:23 -0000
@@ -49,7 +49,7 @@ InsetGraphicsParams::operator=(InsetGrap
{
// Are we assigning the object into itself?
if (this == ¶ms)
- return * this;
+ return *this;
copy(params);
return *this;
}
@@ -137,12 +137,12 @@ bool operator!=(InsetGraphicsParams cons
}
-void InsetGraphicsParams::Write(ostream & os) const
+void InsetGraphicsParams::Write(ostream & os, string const & bufpath) const
{
// Do not write the default values
if (!filename.empty()) {
- os << "\tfilename " << filename << '\n';
+ os << "\tfilename " << MakeRelPath(filename, bufpath) << '\n';
}
if (lyxscale != 100)
os << "\tlyxscale " << lyxscale << '\n';
@@ -183,11 +183,11 @@ void InsetGraphicsParams::Write(ostream
}
-bool InsetGraphicsParams::Read(LyXLex & lex, string const & token)
+bool InsetGraphicsParams::Read(LyXLex & lex, string const & token, string const & bufpath)
{
if (token == "filename") {
lex.eatLine();
- filename = lex.getString();
+ filename = MakeAbsPath(lex.getString(), bufpath);
} else if (token == "lyxscale") {
lex.next();
lyxscale = lex.getInteger();
@@ -254,15 +254,12 @@ bool InsetGraphicsParams::Read(LyXLex &
}
-grfx::Params InsetGraphicsParams::as_grfxParams(string const & filepath) const
+grfx::Params InsetGraphicsParams::as_grfxParams() const
{
grfx::Params pars;
pars.filename = filename;
pars.scale = lyxscale;
pars.angle = rotateAngle;
-
- if (!filepath.empty())
- pars.filename = MakeAbsPath(pars.filename, filepath);
if (clip) {
pars.bb = bb;
Index: src/insets/insetgraphicsParams.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetgraphicsParams.h,v
retrieving revision 1.31
diff -u -p -r1.31 insetgraphicsParams.h
--- src/insets/insetgraphicsParams.h 25 Feb 2003 12:32:48 -0000 1.31
+++ src/insets/insetgraphicsParams.h 2 Jun 2003 23:17:23 -0000
@@ -69,14 +69,14 @@ struct InsetGraphicsParams
///
InsetGraphicsParams & operator=(InsetGraphicsParams const &);
/// Save the parameters in the LyX format stream.
- void Write(std::ostream & os) const;
+ void Write(std::ostream & os, string const & bufpath) const;
/// If the token belongs to our parameters, read it.
- bool Read(LyXLex & lex, string const & token);
+ bool Read(LyXLex & lex, string const & token, string const & bufpath);
/// convert
// Only a subset of InsetGraphicsParams is needed for display purposes.
// This function also interrogates lyxrc to ascertain whether
// to display or not.
- grfx::Params as_grfxParams(string const & filepath = string()) const;
+ grfx::Params as_grfxParams() const;
private:
/// Initialize the object to a default status.
Index: src/insets/insethfill.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insethfill.h,v
retrieving revision 1.8
diff -u -p -r1.8 insethfill.h
--- src/insets/insethfill.h 28 May 2003 23:09:14 -0000 1.8
+++ src/insets/insethfill.h 2 Jun 2003 23:17:23 -0000
@@ -20,7 +20,7 @@ public:
///
InsetHFill();
///
- virtual Inset * clone(Buffer const &) const {
+ virtual Inset * clone() const {
return new InsetHFill;
}
///
Index: src/insets/insetinclude.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetinclude.C,v
retrieving revision 1.120
diff -u -p -r1.120 insetinclude.C
--- src/insets/insetinclude.C 2 Jun 2003 10:03:22 -0000 1.120
+++ src/insets/insetinclude.C 2 Jun 2003 23:17:23 -0000
@@ -192,22 +192,14 @@ void InsetInclude::set(Params const & p)
}
-Inset * InsetInclude::clone(Buffer const & buffer) const
+Inset * InsetInclude::clone() const
{
- Params p(params_);
- p.masterFilename_ = buffer.fileName();
+ //Params p(params_);
+ //p.masterFilename_ = buffer.fileName();
+#warning FIXME: broken cross-doc copy/paste - must fix
- return new InsetInclude(p);
+ return new InsetInclude(params_);
}
-
-
-// Inset * InsetInclude::clone(Buffer const & buffer, bool) const
-// {
-// Params p(params_);
-// p.masterFilename_ = buffer.fileName();
-
-// return new InsetInclude(p);
-// }
void InsetInclude::write(Buffer const *, ostream & os) const
Index: src/insets/insetinclude.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetinclude.h,v
retrieving revision 1.68
diff -u -p -r1.68 insetinclude.h
--- src/insets/insetinclude.h 2 Jun 2003 10:03:22 -0000 1.68
+++ src/insets/insetinclude.h 2 Jun 2003 23:17:23 -0000
@@ -66,12 +66,12 @@ public:
void draw(PainterInfo & pi, int x, int y) const;
/// get the parameters
- Params const & params(void) const;
+ Params const & params() const;
/// set the parameters
void set(Params const & params);
///
- virtual Inset * clone(Buffer const &) const;
+ virtual Inset * clone() const;
///
Inset::Code lyxCode() const { return Inset::INCLUDE_CODE; }
/// This returns the list of labels on the child buffer
Index: src/insets/insetindex.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetindex.h,v
retrieving revision 1.36
diff -u -p -r1.36 insetindex.h
--- src/insets/insetindex.h 28 May 2003 23:09:14 -0000 1.36
+++ src/insets/insetindex.h 2 Jun 2003 23:17:23 -0000
@@ -26,7 +26,7 @@ public:
///
~InsetIndex();
///
- virtual Inset * clone(Buffer const &) const {
+ virtual Inset * clone() const {
return new InsetIndex(params());
}
///
@@ -49,7 +49,7 @@ public:
///
~InsetPrintIndex();
///
- Inset * clone(Buffer const &) const {
+ Inset * clone() const {
return new InsetPrintIndex(params());
}
///
Index: src/insets/insetlabel.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetlabel.h,v
retrieving revision 1.45
diff -u -p -r1.45 insetlabel.h
--- src/insets/insetlabel.h 28 May 2003 23:09:14 -0000 1.45
+++ src/insets/insetlabel.h 2 Jun 2003 23:17:23 -0000
@@ -22,7 +22,7 @@ public:
///
~InsetLabel();
///
- virtual Inset * clone(Buffer const &) const {
+ virtual Inset * clone() const {
return new InsetLabel(params());
}
///
Index: src/insets/insetlatexaccent.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetlatexaccent.C,v
retrieving revision 1.71
diff -u -p -r1.71 insetlatexaccent.C
--- src/insets/insetlatexaccent.C 2 Jun 2003 17:58:19 -0000 1.71
+++ src/insets/insetlatexaccent.C 2 Jun 2003 23:17:23 -0000
@@ -647,16 +647,10 @@ bool InsetLatexAccent::directWrite() con
}
-Inset * InsetLatexAccent::clone(Buffer const &) const
+Inset * InsetLatexAccent::clone() const
{
return new InsetLatexAccent(contents);
}
-
-
-// Inset * InsetLatexAccent::clone(Buffer const &, bool) const
-// {
-// return new InsetLatexAccent(contents);
-// }
Inset::Code InsetLatexAccent::lyxCode() const
Index: src/insets/insetlatexaccent.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetlatexaccent.h,v
retrieving revision 1.51
diff -u -p -r1.51 insetlatexaccent.h
--- src/insets/insetlatexaccent.h 2 Jun 2003 10:03:22 -0000 1.51
+++ src/insets/insetlatexaccent.h 2 Jun 2003 23:17:23 -0000
@@ -57,7 +57,7 @@ public:
///
bool directWrite() const;
///
- virtual Inset * clone(Buffer const &) const;
+ virtual Inset * clone() const;
///
Inset::Code lyxCode()const;
///
Index: src/insets/insetmarginal.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetmarginal.C,v
retrieving revision 1.27
diff -u -p -r1.27 insetmarginal.C
--- src/insets/insetmarginal.C 28 May 2003 23:09:14 -0000 1.27
+++ src/insets/insetmarginal.C 2 Jun 2003 23:17:23 -0000
@@ -41,7 +41,7 @@ InsetMarginal::InsetMarginal(InsetMargin
}
-Inset * InsetMarginal::clone(Buffer const &) const
+Inset * InsetMarginal::clone() const
{
return new InsetMarginal(*this);
}
Index: src/insets/insetmarginal.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetmarginal.h,v
retrieving revision 1.22
diff -u -p -r1.22 insetmarginal.h
--- src/insets/insetmarginal.h 28 May 2003 23:09:14 -0000 1.22
+++ src/insets/insetmarginal.h 2 Jun 2003 23:17:23 -0000
@@ -26,7 +26,7 @@ public:
///
InsetMarginal(InsetMarginal const &);
///
- Inset * clone(Buffer const &) const;
+ Inset * clone() const;
///
Inset::Code lyxCode() const { return Inset::MARGIN_CODE; }
///
Index: src/insets/insetminipage.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetminipage.C,v
retrieving revision 1.76
diff -u -p -r1.76 insetminipage.C
--- src/insets/insetminipage.C 2 Jun 2003 10:03:22 -0000 1.76
+++ src/insets/insetminipage.C 2 Jun 2003 23:17:23 -0000
@@ -93,7 +93,7 @@ InsetMinipage::InsetMinipage(InsetMinipa
{}
-Inset * InsetMinipage::clone(Buffer const &) const
+Inset * InsetMinipage::clone() const
{
return new InsetMinipage(*this);
}
Index: src/insets/insetminipage.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetminipage.h,v
retrieving revision 1.44
diff -u -p -r1.44 insetminipage.h
--- src/insets/insetminipage.h 2 Jun 2003 10:03:22 -0000 1.44
+++ src/insets/insetminipage.h 2 Jun 2003 23:17:23 -0000
@@ -66,7 +66,7 @@ public:
///
void read(Buffer const * buf, LyXLex & lex);
///
- Inset * clone(Buffer const &) const;
+ Inset * clone() const;
///
void metrics(MetricsInfo &, Dimension &) const;
///
Index: src/insets/insetnewline.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetnewline.h,v
retrieving revision 1.10
diff -u -p -r1.10 insetnewline.h
--- src/insets/insetnewline.h 2 Jun 2003 10:03:22 -0000 1.10
+++ src/insets/insetnewline.h 2 Jun 2003 23:17:23 -0000
@@ -20,7 +20,7 @@ public:
InsetNewline() {}
- virtual Inset * clone(Buffer const &) const {
+ virtual Inset * clone() const {
return new InsetNewline;
}
Index: src/insets/insetnote.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetnote.C,v
retrieving revision 1.24
diff -u -p -r1.24 insetnote.C
--- src/insets/insetnote.C 28 May 2003 23:09:14 -0000 1.24
+++ src/insets/insetnote.C 2 Jun 2003 23:17:23 -0000
@@ -53,7 +53,7 @@ InsetNote::InsetNote(InsetNote const & i
}
-Inset * InsetNote::clone(Buffer const &) const
+Inset * InsetNote::clone() const
{
return new InsetNote(*this);
}
Index: src/insets/insetnote.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetnote.h,v
retrieving revision 1.20
diff -u -p -r1.20 insetnote.h
--- src/insets/insetnote.h 28 May 2003 23:09:14 -0000 1.20
+++ src/insets/insetnote.h 2 Jun 2003 23:17:23 -0000
@@ -25,7 +25,7 @@ public:
///
InsetNote(InsetNote const &);
///
- Inset * clone(Buffer const &) const;
+ Inset * clone() const;
///
string const editMessage() const;
///
Index: src/insets/insetoptarg.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetoptarg.C,v
retrieving revision 1.10
diff -u -p -r1.10 insetoptarg.C
--- src/insets/insetoptarg.C 28 May 2003 23:09:14 -0000 1.10
+++ src/insets/insetoptarg.C 2 Jun 2003 23:17:23 -0000
@@ -47,7 +47,7 @@ InsetOptArg::InsetOptArg(InsetOptArg con
}
-Inset * InsetOptArg::clone(Buffer const &) const
+Inset * InsetOptArg::clone() const
{
return new InsetOptArg(*this);
}
Index: src/insets/insetoptarg.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetoptarg.h,v
retrieving revision 1.11
diff -u -p -r1.11 insetoptarg.h
--- src/insets/insetoptarg.h 28 May 2003 23:09:14 -0000 1.11
+++ src/insets/insetoptarg.h 2 Jun 2003 23:17:24 -0000
@@ -27,7 +27,7 @@ public:
InsetOptArg(InsetOptArg const &);
/// make a duplicate of this inset
- Inset * clone(Buffer const &) const;
+ Inset * clone() const;
/// this inset is editable
EDITABLE editable() const { return IS_EDITABLE; }
/// code of the inset
Index: src/insets/insetquotes.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetquotes.C,v
retrieving revision 1.92
diff -u -p -r1.92 insetquotes.C
--- src/insets/insetquotes.C 2 Jun 2003 10:03:22 -0000 1.92
+++ src/insets/insetquotes.C 2 Jun 2003 23:17:24 -0000
@@ -351,16 +351,10 @@ void InsetQuotes::validate(LaTeXFeatures
}
-Inset * InsetQuotes::clone(Buffer const &) const
+Inset * InsetQuotes::clone() const
{
return new InsetQuotes(language_, side_, times_);
}
-
-
-// Inset * InsetQuotes::clone(Buffer const &, bool) const
-// {
-// return new InsetQuotes(language_, side_, times_);
-// }
Inset::Code InsetQuotes::lyxCode() const
Index: src/insets/insetquotes.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetquotes.h,v
retrieving revision 1.50
diff -u -p -r1.50 insetquotes.h
--- src/insets/insetquotes.h 2 Jun 2003 10:03:22 -0000 1.50
+++ src/insets/insetquotes.h 2 Jun 2003 23:17:24 -0000
@@ -68,7 +68,7 @@ public:
/// Create the right quote inset after character c
InsetQuotes(char c, BufferParams const & params);
///
- Inset * clone(Buffer const &) const;
+ Inset * clone() const;
///
void metrics(MetricsInfo &, Dimension &) const;
Index: src/insets/insetref.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetref.C,v
retrieving revision 1.65
diff -u -p -r1.65 insetref.C
--- src/insets/insetref.C 28 May 2003 16:36:54 -0000 1.65
+++ src/insets/insetref.C 2 Jun 2003 23:17:24 -0000
@@ -28,9 +28,10 @@ InsetRef::InsetRef(InsetCommandParams co
{}
-// InsetRef::InsetRef(InsetCommandParams const & p, Buffer const & buf, bool)
-// : InsetCommand(p, false), isLatex(buf.isLatex())
-// {}
+InsetRef::InsetRef(InsetRef const & ir)
+ : InsetCommand(ir), isLatex(ir.isLatex)
+{
+}
InsetRef::~InsetRef()
Index: src/insets/insetref.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetref.h,v
retrieving revision 1.48
diff -u -p -r1.48 insetref.h
--- src/insets/insetref.h 28 May 2003 23:09:14 -0000 1.48
+++ src/insets/insetref.h 2 Jun 2003 23:17:24 -0000
@@ -35,13 +35,15 @@ public:
///
static string const & getName(int type);
- ///
+
InsetRef(InsetCommandParams const &, Buffer const &);
- ///
+
+ InsetRef(InsetRef const &);
+
~InsetRef();
///
- virtual Inset * clone(Buffer const & buffer) const {
- return new InsetRef(params(), buffer);
+ virtual Inset * clone() const {
+ return new InsetRef(*this);
}
///
dispatch_result localDispatch(FuncRequest const & cmd);
Index: src/insets/insetspace.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetspace.C,v
retrieving revision 1.9
diff -u -p -r1.9 insetspace.C
--- src/insets/insetspace.C 2 Jun 2003 10:03:22 -0000 1.9
+++ src/insets/insetspace.C 2 Jun 2003 23:17:24 -0000
@@ -252,16 +252,10 @@ int InsetSpace::docbook(Buffer const *,
}
-Inset * InsetSpace::clone(Buffer const &) const
+Inset * InsetSpace::clone() const
{
return new InsetSpace(kind_);
}
-
-
-// Inset * InsetSpace::clone(Buffer const &, bool) const
-// {
-// return new InsetSpace(kind_);
-// }
bool InsetSpace::isChar() const
Index: src/insets/insetspace.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetspace.h,v
retrieving revision 1.9
diff -u -p -r1.9 insetspace.h
--- src/insets/insetspace.h 2 Jun 2003 10:03:22 -0000 1.9
+++ src/insets/insetspace.h 2 Jun 2003 23:17:24 -0000
@@ -71,7 +71,7 @@ public:
///
int docbook(Buffer const *, std::ostream &, bool mixcont) const;
///
- virtual Inset * clone(Buffer const &) const;
+ virtual Inset * clone() const;
///
Inset::Code lyxCode() const { return Inset::SPACE_CODE; }
/// We don't need \begin_inset and \end_inset
Index: src/insets/insetspecialchar.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetspecialchar.C,v
retrieving revision 1.69
diff -u -p -r1.69 insetspecialchar.C
--- src/insets/insetspecialchar.C 2 Jun 2003 10:03:22 -0000 1.69
+++ src/insets/insetspecialchar.C 2 Jun 2003 23:17:24 -0000
@@ -238,16 +238,10 @@ int InsetSpecialChar::docbook(Buffer con
}
-Inset * InsetSpecialChar::clone(Buffer const &) const
+Inset * InsetSpecialChar::clone() const
{
return new InsetSpecialChar(kind_);
}
-
-
-// Inset * InsetSpecialChar::clone(Buffer const &, bool) const
-// {
-// return new InsetSpecialChar(kind_);
-// }
void InsetSpecialChar::validate(LaTeXFeatures & features) const
Index: src/insets/insetspecialchar.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetspecialchar.h,v
retrieving revision 1.53
diff -u -p -r1.53 insetspecialchar.h
--- src/insets/insetspecialchar.h 2 Jun 2003 10:03:22 -0000 1.53
+++ src/insets/insetspecialchar.h 2 Jun 2003 23:17:24 -0000
@@ -63,7 +63,7 @@ public:
///
int docbook(Buffer const *, std::ostream &, bool mixcont) const;
///
- virtual Inset * clone(Buffer const &) const;
+ virtual Inset * clone() const;
///
Inset::Code lyxCode() const { return Inset::SPECIALCHAR_CODE; }
/// We don't need \begin_inset and \end_inset
Index: src/insets/insettabular.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insettabular.C,v
retrieving revision 1.284
diff -u -p -r1.284 insettabular.C
--- src/insets/insettabular.C 2 Jun 2003 16:40:38 -0000 1.284
+++ src/insets/insettabular.C 2 Jun 2003 23:17:24 -0000
@@ -151,7 +151,7 @@ bool InsetTabular::hasPasteBuffer() cons
InsetTabular::InsetTabular(Buffer const & buf, int rows, int columns)
- : buffer(&buf)
+ : buffer_(&buf)
{
if (rows <= 0)
rows = 1;
@@ -174,10 +174,10 @@ InsetTabular::InsetTabular(Buffer const
}
-InsetTabular::InsetTabular(InsetTabular const & tab, Buffer const & buf)
- : UpdatableInset(tab), buffer(&buf)
+InsetTabular::InsetTabular(InsetTabular const & tab)
+ : UpdatableInset(tab), buffer_(tab.buffer_)
{
- tabular.reset(new LyXTabular(buf.params,
+ tabular.reset(new LyXTabular(buffer_->params,
this, *(tab.tabular)));
the_locking_inset = 0;
old_locking_inset = 0;
@@ -200,15 +200,21 @@ InsetTabular::~InsetTabular()
}
-Inset * InsetTabular::clone(Buffer const & buf) const
+Inset * InsetTabular::clone() const
{
- return new InsetTabular(*this, buf);
+ return new InsetTabular(*this);
+}
+
+
+void InsetTabular::buffer(Buffer const * b)
+{
+ buffer_ = b;
}
BufferView * InsetTabular::view() const
{
- return buffer->getUser();
+ return buffer_->getUser();
}
@@ -2891,6 +2897,7 @@ int InsetTabularMailer::string2params(st
if (!lex.isOK())
return -1;
+ // FIXME: even current_view would be better than this.
BufferView * const bv = inset.view();
Buffer const * const buffer = bv ? bv->buffer() : 0;
if (buffer)
@@ -2904,6 +2911,7 @@ int InsetTabularMailer::string2params(st
string const InsetTabularMailer::params2string(InsetTabular const & inset)
{
+ // FIXME: even current_view would be better than this.
BufferView * const bv = inset.view();
Buffer const * const buffer = bv ? bv->buffer() : 0;
if (!buffer)
Index: src/insets/insettabular.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insettabular.h,v
retrieving revision 1.122
diff -u -p -r1.122 insettabular.h
--- src/insets/insettabular.h 2 Jun 2003 10:03:23 -0000 1.122
+++ src/insets/insettabular.h 2 Jun 2003 23:17:24 -0000
@@ -76,11 +76,13 @@ public:
///
InsetTabular(Buffer const &, int rows = 1, int columns = 1);
///
- InsetTabular(InsetTabular const &, Buffer const &);
+ InsetTabular(InsetTabular const &);
///
~InsetTabular();
///
- Inset * clone(Buffer const &) const;
+ Inset * clone() const;
+ ///
+ void buffer(Buffer const *);
///
void read(Buffer const *, LyXLex &);
///
@@ -315,7 +317,7 @@ private:
///
InsetText * old_locking_inset;
///
- Buffer const * buffer;
+ Buffer const * buffer_;
///
mutable LyXCursor cursor_;
///
Index: src/insets/insettext.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insettext.C,v
retrieving revision 1.404
diff -u -p -r1.404 insettext.C
--- src/insets/insettext.C 2 Jun 2003 10:03:23 -0000 1.404
+++ src/insets/insettext.C 2 Jun 2003 23:17:25 -0000
@@ -224,7 +224,7 @@ void InsetText::clear(bool just_mark_era
}
-Inset * InsetText::clone(Buffer const &) const
+Inset * InsetText::clone() const
{
return new InsetText(*this);
}
Index: src/insets/insettext.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insettext.h,v
retrieving revision 1.166
diff -u -p -r1.166 insettext.h
--- src/insets/insettext.h 2 Jun 2003 10:03:23 -0000 1.166
+++ src/insets/insettext.h 2 Jun 2003 23:17:25 -0000
@@ -77,7 +77,7 @@ public:
///
~InsetText();
///
- Inset * clone(Buffer const &) const;
+ Inset * clone() const;
///
InsetText & operator=(InsetText const & it);
/// empty inset to empty par, or just mark as erased
Index: src/insets/insettheorem.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insettheorem.C,v
retrieving revision 1.16
diff -u -p -r1.16 insettheorem.C
--- src/insets/insettheorem.C 23 May 2003 08:59:47 -0000 1.16
+++ src/insets/insettheorem.C 2 Jun 2003 23:17:25 -0000
@@ -53,7 +53,7 @@ void InsetTheorem::write(Buffer const *
}
-Inset * InsetTheorem::clone(Buffer const &, bool) const
+Inset * InsetTheorem::clone() const
{
#ifdef WITH_WARNINGS
#warning Is this inset used? If YES this is WRONG!!! (Jug)
Index: src/insets/insettheorem.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insettheorem.h,v
retrieving revision 1.15
diff -u -p -r1.15 insettheorem.h
--- src/insets/insettheorem.h 28 May 2003 23:09:16 -0000 1.15
+++ src/insets/insettheorem.h 2 Jun 2003 23:17:25 -0000
@@ -25,7 +25,7 @@ public:
///
void write(Buffer const * buf, std::ostream & os) const;
///
- virtual Inset * clone(Buffer const &) const;
+ virtual Inset * clone() const;
///
Inset::Code lyxCode() const { return Inset::THEOREM_CODE; }
///
Index: src/insets/insettoc.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insettoc.h,v
retrieving revision 1.40
diff -u -p -r1.40 insettoc.h
--- src/insets/insettoc.h 28 May 2003 23:09:16 -0000 1.40
+++ src/insets/insettoc.h 2 Jun 2003 23:17:25 -0000
@@ -24,7 +24,7 @@ public:
///
~InsetTOC();
///
- virtual Inset * clone(Buffer const &) const {
+ virtual Inset * clone() const {
return new InsetTOC(params());
}
///
Index: src/insets/inseturl.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/inseturl.h,v
retrieving revision 1.54
diff -u -p -r1.54 inseturl.h
--- src/insets/inseturl.h 28 May 2003 23:09:16 -0000 1.54
+++ src/insets/inseturl.h 2 Jun 2003 23:17:25 -0000
@@ -27,7 +27,7 @@ public:
///
~InsetUrl();
///
- virtual Inset * clone(Buffer const &) const {
+ virtual Inset * clone() const {
return new InsetUrl(params());
}
///
Index: src/insets/insetwrap.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetwrap.C,v
retrieving revision 1.25
diff -u -p -r1.25 insetwrap.C
--- src/insets/insetwrap.C 28 May 2003 23:09:16 -0000 1.25
+++ src/insets/insetwrap.C 2 Jun 2003 23:17:25 -0000
@@ -180,7 +180,7 @@ void InsetWrap::validate(LaTeXFeatures &
}
-Inset * InsetWrap::clone(Buffer const &) const
+Inset * InsetWrap::clone() const
{
return new InsetWrap(*this);
}
Index: src/insets/insetwrap.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetwrap.h,v
retrieving revision 1.13
diff -u -p -r1.13 insetwrap.h
--- src/insets/insetwrap.h 28 May 2003 23:09:16 -0000 1.13
+++ src/insets/insetwrap.h 2 Jun 2003 23:17:25 -0000
@@ -51,7 +51,7 @@ public:
///
void validate(LaTeXFeatures & features) const;
///
- Inset * clone(Buffer const &) const;
+ Inset * clone() const;
///
Inset::Code lyxCode() const { return Inset::WRAP_CODE; }
///
Index: src/mathed/formula.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/formula.C,v
retrieving revision 1.268
diff -u -p -r1.268 formula.C
--- src/mathed/formula.C 2 Jun 2003 17:58:19 -0000 1.268
+++ src/mathed/formula.C 2 Jun 2003 23:17:25 -0000
@@ -113,16 +113,10 @@ InsetFormula::~InsetFormula()
{}
-Inset * InsetFormula::clone(Buffer const &) const
+Inset * InsetFormula::clone() const
{
return new InsetFormula(*this);
}
-
-
-// Inset * InsetFormula::clone(Buffer const &, bool) const
-// {
-// return new InsetFormula(*this);
-// }
void InsetFormula::write(Buffer const *, ostream & os) const
Index: src/mathed/formula.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/formula.h,v
retrieving revision 1.88
diff -u -p -r1.88 formula.h
--- src/mathed/formula.h 2 Jun 2003 10:03:24 -0000 1.88
+++ src/mathed/formula.h 2 Jun 2003 23:17:25 -0000
@@ -54,7 +54,7 @@ public:
int docbook(Buffer const *, std::ostream &, bool mixcont) const;
///
- Inset * clone(Buffer const &) const;
+ Inset * clone() const;
///
void validate(LaTeXFeatures & features) const;
///
Index: src/mathed/formulabase.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/formulabase.h,v
retrieving revision 1.70
diff -u -p -r1.70 formulabase.h
--- src/mathed/formulabase.h 2 Jun 2003 10:03:24 -0000 1.70
+++ src/mathed/formulabase.h 2 Jun 2003 23:17:25 -0000
@@ -30,7 +30,7 @@ public:
///
InsetFormulaBase();
///
- Inset * clone(Buffer const &) const = 0;
+ Inset * clone() const = 0;
/// lowest x coordinate
virtual int xlow() const;
/// highest x coordinate
Index: src/mathed/formulamacro.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/formulamacro.C,v
retrieving revision 1.127
diff -u -p -r1.127 formulamacro.C
--- src/mathed/formulamacro.C 2 Jun 2003 17:58:19 -0000 1.127
+++ src/mathed/formulamacro.C 2 Jun 2003 23:17:26 -0000
@@ -62,16 +62,10 @@ InsetFormulaMacro::InsetFormulaMacro(str
}
-Inset * InsetFormulaMacro::clone(Buffer const &) const
+Inset * InsetFormulaMacro::clone() const
{
return new InsetFormulaMacro(*this);
}
-
-
-// Inset * InsetFormulaMacro::clone(Buffer const &, bool) const
-// {
-// return new InsetFormulaMacro(*this);
-// }
void InsetFormulaMacro::write(Buffer const *, ostream & os) const
Index: src/mathed/formulamacro.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/formulamacro.h,v
retrieving revision 1.66
diff -u -p -r1.66 formulamacro.h
--- src/mathed/formulamacro.h 2 Jun 2003 10:03:24 -0000 1.66
+++ src/mathed/formulamacro.h 2 Jun 2003 23:17:26 -0000
@@ -52,7 +52,7 @@ public:
int docbook(Buffer const *, std::ostream &, bool mixcont) const;
///
- Inset * clone(Buffer const &) const;
+ Inset * clone() const;
///
Inset::Code lyxCode() const;
///
--
Lgb