src/CutAndPaste.C
src/debug.C
src/exporter.C
-src/ext_l10n.h
src/figure_form.C
src/figureForm.C
src/FontLoader.C
+2001-05-08 Lars Gullik Bjønnes <larsbj@birdstep.com>
+
+ * lyxparagraph.[Ch]: add copy constructor, remove Clone
+
+ * CutAndPaste.C (copySelection): use LyXParagraph copy constructor
+ (pasteSelection): likewise
+ * text2.C (CreateUndo): likewise
+
2001-05-04 Lars Gullik Bjønnes <larsbj@birdstep.com>
* minibuffer.C (peek_event): temporarily reduce the functionality
// copy more than one paragraph
// clone the paragraphs within the selection
LyXParagraph * tmppar = startpar;
+#if 0
buf = tmppar->Clone();
+#else
+ buf = new LyXParagraph(*tmppar);
+#endif
LyXParagraph * tmppar2 = buf;
while (tmppar != endpar
&& tmppar->next()) {
tmppar = tmppar->next();
+#if 0
tmppar2->next(tmppar->Clone());
+#else
+ tmppar2->next(new LyXParagraph(*tmppar));
+#endif
tmppar2->next()->previous(tmppar2);
tmppar2 = tmppar2->next();
}
if (pos > (*par)->size())
pos = (*par)->size();
- LyXParagraph * tmpbuf;
+ // LyXParagraph * tmpbuf;
LyXParagraph * tmppar = *par;
int tmppos = pos;
// There are two cases: cutbuffer only one paragraph or many
if (!buf->next()) {
// only within a paragraph
- tmpbuf = buf->Clone();
+#if 0
+ LyXParagraph * tmpbuf = buf->Clone();
+#else
+ LyXParagraph * tmpbuf = new LyXParagraph(*buf);
+#endif
// Some provisions should be done here for checking
// if we are inserting at the beginning of a
// paragraph. If there are a space at the beginning
// many paragraphs
// make a copy of the simple cut_buffer
- tmpbuf = buf;
+ LyXParagraph * tmpbuf = buf;
+#if 0
LyXParagraph * simple_cut_clone = tmpbuf->Clone();
+#else
+ LyXParagraph * simple_cut_clone = new LyXParagraph(*tmpbuf);
+#endif
LyXParagraph * tmpbuf2 = simple_cut_clone;
while (tmpbuf->next()) {
tmpbuf = tmpbuf->next();
+#if 0
tmpbuf2->next(tmpbuf->Clone());
+#else
+ tmpbuf2->next(new LyXParagraph(*tmpbuf));
+#endif
tmpbuf2->next()->previous(tmpbuf2);
tmpbuf2 = tmpbuf2->next();
}
+2001-05-08 Lars Gullik Bjønnes <larsbj@birdstep.com>
+
+ * insettext.C (Read): use clear
+ (SetParagraphData): use LyXParagraph copy constructor instead of clone
+
2001-05-04 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
* insetfloatlist.h: add a bunch of std:: qualifiers.
}
-#if 0
-Inset * InsetCollapsable::Clone(Buffer const &) const
-{
- InsetCollapsable * result = new InsetCollapsable;
- result->inset.init(&inset);
- result->inset.setOwner(result);
-
- result->collapsed = collapsed;
- return result;
-}
-#endif
-
-
bool InsetCollapsable::InsertInset(BufferView * bv, Inset * in)
{
if (!InsertInsetAllowed(in)) {
///
InsetCollapsable();
///
- //Inset * Clone(Buffer const &) const;
- ///
void Read(Buffer const *, LyXLex &);
///
void Write(Buffer const *, std::ostream &) const;
bool nodraw() const;
///
int scroll(bool recursive=true) const;
+ ///
void scroll(BufferView *bv, float sx) const {
UpdatableInset::scroll(bv, sx);
}
+ ///
void scroll(BufferView *bv, int offset) const {
UpdatableInset::scroll(bv, offset);
}
mutable int button_top_y;
///
mutable int button_bottom_y;
-
private:
///
string label;
: cacheHandle(0), imageLoaded(false)
{}
+
InsetGraphics::~InsetGraphics()
{
// Emits the hide signal to the dialog connected (if any)
hideDialog();
}
+
char const *
InsetGraphics::statusMessage() const
{
return msg;
}
+
int InsetGraphics::ascent(BufferView *, LyXFont const &) const
{
LyXImage * pixmap = 0;
}
}
+
void InsetGraphics::draw(BufferView * bv, LyXFont const & font,
int baseline, float & x, bool) const
{
}
-
string const
InsetGraphics::prepareFile(Buffer const *buf) const
{
return outfile;
}
+
int InsetGraphics::Latex(Buffer const *buf, ostream & os,
bool /*fragile*/, bool/*fs*/) const
{
return 0;
}
+
// For explanation on inserting graphics into DocBook checkout:
// http://linuxdoc.org/LDP/LDP-Author-Guide/inserting-pictures.html
// See also the docbook guide at http://www.docbook.org/
features.subfigure = true;
}
+
// Update the inset after parameters changed (read from file or changed in
// dialog.
void InsetGraphics::updateInset() const
cacheHandle = temp;
}
+
bool InsetGraphics::setParams(InsetGraphicsParams const & params)
{
// If nothing is changed, just return and say so.
return true;
}
+
InsetGraphicsParams InsetGraphics::getParams() const
{
return params;
}
+
Inset * InsetGraphics::Clone(Buffer const &) const
{
+#warning use the copy constructor instead. (Lgb)
InsetGraphics * newInset = new InsetGraphics;
newInset->cacheHandle = cacheHandle;
{
// delete all instances of LyXText before deleting the paragraps used
// by it.
- for (Cache::iterator cit = cache.begin(); cit != cache.end(); ++cit){
+ for (Cache::iterator cit = cache.begin(); cit != cache.end(); ++cit) {
delete (*cit).second;
(*cit).second = 0;
}
char depth = 0; // signed or unsigned?
LyXFont font(LyXFont::ALL_INHERIT);
+#if 0
// delete all instances of LyXText before deleting the paragraps used
// by it.
for (Cache::iterator cit = cache.begin(); cit != cache.end(); ++cit) {
}
par = new LyXParagraph;
+#else
+ clear();
+#endif
+
while (lex.IsOK()) {
lex.nextToken();
token = lex.GetString();
par = tmp;
}
+#if 0
par = p->Clone();
+#else
+ par = new LyXParagraph(*p);
+#endif
par->SetInsetOwner(this);
LyXParagraph * np = par;
while (p->next()) {
p = p->next();
+#if 0
np->next(p->Clone());
+#else
+ np->next(new LyXParagraph(*p));
+#endif
np->next()->previous(np);
np = np->next();
np->SetInsetOwner(this);
/// this constructor inserts the new paragraph in a list
explicit
LyXParagraph(LyXParagraph * par);
+ ///
+ LyXParagraph(LyXParagraph const &);
/// the destructor removes the new paragraph from the list
~LyXParagraph();
///
LyXParagraph * TeXEnvironment(Buffer const *, BufferParams const &,
std::ostream &, TexRow & texrow);
+#if 0
///
LyXParagraph * Clone() const;
-
+#endif
///
bool HasSameLayout(LyXParagraph const * par) const;
deep_copy();
}
+
void MathedArray::deep_copy()
{
MathedIter it(this);
}
}
+
void MathedArray::substitute(MathMacro * m)
{
if (m->nargs() == 0)
return *this;
}
+
void MathedArray::push_back(MathedInset * inset, int t)
{
MathedIter it(this);
it.insertInset(inset, t);
}
+
void MathedArray::push_back(byte b, MathedTextCodes c)
{
MathedIter it(this);
it.insert(b, c);
}
+
void MathedArray::clear()
{
last_ = 0;
bf_[0] = 0;
}
+
void MathedArray::swap(MathedArray & array)
{
if (this != &array) {
os << endl;
}
+
void MathedArray::dump(ostream & os) const
{
MathedIter it( const_cast<MathedArray*>(this) );
it.Next();
}
}
-
-
using std::endl;
+
MathMacroArgument::MathMacroArgument(int n)
: MathedInset(string(), LM_OT_MACRO_ARG, LM_ST_TEXT),
number_(n)
}
}
+
MathedInset * MathMacroArgument::Clone()
{
//return new MathMacroArgument(*this);
return this;
}
+
int MathMacroArgument::number() const
{
return number_;
}
+
void MathMacroArgument::substitute(MathMacro * /*m*/)
{
lyxerr << "Calling MathMacroArgument::substitute!\n";
return row_;
}
+
string MathParInset::label() const
{
if (row_.size() == 0) {
return new MathParInset(*this);
}
+
void MathParInset::substitute(MathMacro * m)
{
//lyxerr << "called: MathParInset::substitute, m: " << m << endl;
}
}
+
void MathSpaceInset::WriteNormal(ostream & os)
{
os << "[space " << space_ << "] ";
}
+LyXParagraph::LyXParagraph(LyXParagraph const & lp)
+{
+ for (int i = 0; i < 10; ++i) setCounter(i , 0);
+ enumdepth = 0;
+ itemdepth = 0;
+ next_ = 0;
+ previous_ = 0;
+ id_ = paragraph_id++;
+ Clear();
+
+ MakeSameLayout(&lp);
+
+ // this is because of the dummy layout of the paragraphs that
+ // follow footnotes
+ layout = lp.layout;
+
+ inset_owner = lp.inset_owner;
+
+ // ale970302
+ if (lp.bibkey)
+ bibkey = static_cast<InsetBibKey *>
+ (lp.bibkey->Clone(*current_view->buffer()));
+ else
+ bibkey = 0;
+
+ // copy everything behind the break-position to the new paragraph
+
+ text = lp.text;
+ fontlist = lp.fontlist;
+ insetlist = lp.insetlist;
+ for (InsetList::iterator it = insetlist.begin();
+ it != insetlist.end(); ++it)
+ it->inset = it->inset->Clone(*current_view->buffer());
+}
+
+
+// the destructor removes the new paragraph from the list
+LyXParagraph::~LyXParagraph()
+{
+ if (previous_)
+ previous_->next_ = next_;
+ if (next_)
+ next_->previous_ = previous_;
+
+ for (InsetList::iterator it = insetlist.begin();
+ it != insetlist.end(); ++it) {
+ delete (*it).inset;
+ }
+
+ // ale970302
+ delete bibkey;
+ //
+ //lyxerr << "LyXParagraph::paragraph_id = "
+ // << LyXParagraph::paragraph_id << endl;
+}
+
+
void LyXParagraph::writeFile(Buffer const * buf, ostream & os,
BufferParams const & bparams,
char footflag, char dth) const
}
-// the destructor removes the new paragraph from the list
-LyXParagraph::~LyXParagraph()
-{
- if (previous_)
- previous_->next_ = next_;
- if (next_)
- next_->previous_ = previous_;
-
- for (InsetList::iterator it = insetlist.begin();
- it != insetlist.end(); ++it) {
- delete (*it).inset;
- }
-
- // ale970302
- delete bibkey;
- //
- //lyxerr << "LyXParagraph::paragraph_id = "
- // << LyXParagraph::paragraph_id << endl;
-}
-
-
void LyXParagraph::Erase(LyXParagraph::size_type pos)
{
lyx::Assert(pos < size());
}
+#if 0
LyXParagraph * LyXParagraph::Clone() const
{
// create a new paragraph
(*it).inset = (*it).inset->Clone(*current_view->buffer());
return result;
}
+#endif
bool LyXParagraph::HasSameLayout(LyXParagraph const * par) const
LyXTabular & LyXTabular::operator=(LyXTabular const & lt)
{
+#if 0
+#warning This while method should look like this: (Lgb)
+
+ LyXTabular tmp(lt);
+ tmp.swap(*this);
+#else
// If this and lt is not of the same size we have a serious bug
// So then it is ok to throw an exception, or for now
// call abort()
rotate = lt.rotate;
Reinit();
-
+#endif
return *this;
}
}
// create a new Undo
LyXParagraph * undopar;
- LyXParagraph * tmppar;
- LyXParagraph * tmppar2;
LyXParagraph * start = 0;
LyXParagraph * end = 0;
}
if (start && end && (start != end->next()) &&
((before != behind) || (!before && !behind))) {
- tmppar = start;
- tmppar2 = tmppar->Clone();
+ LyXParagraph * tmppar = start;
+#if 0
+ LyXParagraph * tmppar2 = tmppar->Clone();
+#else
+ LyXParagraph * tmppar2 = new LyXParagraph(*tmppar);
+#endif
tmppar2->id(tmppar->id());
// a memory optimization: Just store the layout information
while (tmppar != end && tmppar->next()) {
tmppar = tmppar->next();
+#if 0
tmppar2->next(tmppar->Clone());
+#else
+ tmppar2->next(new LyXParagraph(*tmppar));
+#endif
tmppar2->next()->id(tmppar->id());
// a memory optimization: Just store the layout
// information when only edit