+2002-08-21 Lars Gullik Bjønnes <larsbj@birdstep.com>
+
+ * text.C (backspace): pasteParagraph now in global scipe
+
+ * CutAndPaste.C (cutSelection): pasteParagraph now in global scope
+ (pasteSelection): ditto
+
+ * paragraph.[Ch] (pasteParagraph): move function to global scope ...
+ * paragraph_funcs.C (pasteParagraph): ... here
2002-08-20 André Pönitz <poenitz@gmx.net>
2002-08-21 Lars Gullik Bjønnes <larsbj@gullik.net>
- * tabular.C:
+ * tabular.C:
* buffer.[Ch]: remove NO_COMPABILITY stuff
2002-08-20 Lars Gullik Bjønnes <larsbj@gullik.net>
startpar->next()->stripLeadingSpaces();
if (startpar->hasSameLayout(startpar->next()) ||
startpar->next()->empty()) {
- startpar->pasteParagraph(current_view->buffer()->params);
+ pasteParagraph(current_view->buffer()->params, startpar);
(*endpar) = startpar; // this because endpar gets deleted here!
}
// this paragraph's are of noone's owner!
if ((*par)->next() == lastbuffer)
lastbuffer = *par;
- (*par)->pasteParagraph(current_view->buffer()->params);
+ pasteParagraph(current_view->buffer()->params, *par);
// store the new cursor position
*par = lastbuffer;
pos = lastbuffer->size();
// maybe some pasting
if (lastbuffer->next() && paste_the_end) {
if (lastbuffer->next()->hasSameLayout(lastbuffer)) {
- lastbuffer->pasteParagraph(current_view->buffer()->params);
+ pasteParagraph(current_view->buffer()->params, lastbuffer);
} else if (lastbuffer->next()->empty()) {
lastbuffer->next()->makeSameLayout(lastbuffer);
- lastbuffer->pasteParagraph(current_view->buffer()->params);
+ pasteParagraph(current_view->buffer()->params, lastbuffer);
} else if (lastbuffer->empty()) {
lastbuffer->makeSameLayout(lastbuffer->next());
- lastbuffer->pasteParagraph(current_view->buffer()->params);
+ pasteParagraph(current_view->buffer()->params, lastbuffer);
} else
lastbuffer->next()->stripLeadingSpaces();
}
+2002-08-21 Lars Gullik Bjønnes <larsbj@birdstep.com>
+
+ * insettext.C (collapseParagraphs): pasteParagraph now in global
+ scope
+ (appendParagraphs): ditto
+
2002-08-21 Dekel Tsur <dekelts@tau.ac.il>
* insetcite.C (latex): Remove spaces only after commmas.
#include "trans_mgr.h"
#include "undo_funcs.h"
#include "WordLangTuple.h"
+#include "paragraph_funcs.h"
#include "frontends/Alert.h"
#include "frontends/Dialogs.h"
llt->selection.end.pos() + paragraphs.begin()->size());
}
}
- paragraphs.begin()->pasteParagraph(bparams);
+ pasteParagraph(bparams, &*paragraphs.begin());
}
reinitLyXText();
}
// paste it!
lastbuffer->next(buf);
buf->previous(lastbuffer);
- lastbuffer->pasteParagraph(bparams);
+ pasteParagraph(bparams, lastbuffer);
reinitLyXText();
}
}
-// Be carefull, this does not make any check at all.
-// This method has wrong name, it combined this par with the next par.
-// In that sense it is the reverse of break paragraph. (Lgb)
-void Paragraph::pasteParagraph(BufferParams const & bparams)
-{
- // copy the next paragraph to this one
- Paragraph * the_next = next();
-
- // first the DTP-stuff
- params().lineBottom(the_next->params().lineBottom());
- params().spaceBottom(the_next->params().spaceBottom());
- params().pagebreakBottom(the_next->params().pagebreakBottom());
-
- pos_type pos_end = the_next->pimpl_->size() - 1;
- pos_type pos_insert = size();
-
- // ok, now copy the paragraph
- for (pos_type i = 0, j = 0; i <= pos_end; ++i) {
- the_next->cutIntoMinibuffer(bparams, i);
- if (insertFromMinibuffer(pos_insert + j))
- ++j;
- }
-
- // delete the next paragraph
- Paragraph * ppar = the_next->previous_;
- Paragraph * npar = the_next->next_;
- delete the_next;
- ppar->next(npar);
-}
-
-
int Paragraph::getEndLabel() const
{
Paragraph const * par = this;
///
bool isWord(lyx::pos_type pos) const;
- /** paste this paragraph with the next one
- be carefull, this doesent make any check at all
- */
- void pasteParagraph(BufferParams const &);
-
/// returns -1 if inset not found
int getPositionOfInset(Inset const * inset) const;
/* This file is part of
- * ======================================================
- *
+ * ======================================================
+ *
* LyX, The Document Processor
- *
+ *
* Copyright 1995 Matthias Ettrich
- * Copyright 1995-2001 The LyX Team.
+ * Copyright 1995-2001 The LyX Team.
*
* ====================================================== */
tmp->layout(bparams.getLyXTextClass().defaultLayout());
// remember to set the inset_owner
tmp->setInsetOwner(par->inInset());
-
+
// this is an idea for a more userfriendly layout handling, I will
// see what the users say
-
+
// layout stays the same with latex-environments
if (flag) {
tmp->layout(par->layout());
}
bool isempty = (par->layout()->keepempty && par->empty());
-
+
if (!isempty && (par->size() > pos || par->empty() || flag == 2)) {
tmp->layout(par->layout());
tmp->params().align(par->params().align());
tmp->setLabelWidthString(par->params().labelWidthString());
-
+
tmp->params().lineBottom(par->params().lineBottom());
par->params().lineBottom(false);
tmp->params().pagebreakBottom(par->params().pagebreakBottom());
par->params().pagebreakBottom(false);
tmp->params().spaceBottom(par->params().spaceBottom());
par->params().spaceBottom(VSpace(VSpace::NONE));
-
+
tmp->params().depth(par->params().depth());
tmp->params().noindent(par->params().noindent());
-
+
// copy everything behind the break-position
// to the new paragraph
pos_type pos_end = par->size() - 1;
par->erase(i);
}
}
-
+
// just an idea of me
if (!pos) {
tmp->params().lineTop(par->params().lineTop());
par->params().clear();
par->layout(bparams.getLyXTextClass().defaultLayout());
-
+
// layout stays the same with latex-environments
if (flag) {
par->layout(tmp->layout());
if (tmp->insertFromMinibuffer(j - pos))
++j;
}
-
+
for (pos_type k = pos_end; k >= pos; --k) {
par->erase(k);
}
}
-#if 0
// Be carefull, this does not make any check at all.
// This method has wrong name, it combined this par with the next par.
// In that sense it is the reverse of break paragraph. (Lgb)
}
+#if 0
Paragraph * depthHook(Paragraph * par, Paragraph::depth_type depth)
{
Paragraph * newpar = par;
}
-Paragraph * outerHook(Paragraph * par)
+Paragraph * outerHook(Paragraph * par)
{
if (!par->getDepth())
return 0;
// -*- C++ -*-
/* This file is part of
- * ======================================================
- *
+ * ======================================================
+ *
* LyX, The Document Processor
- *
+ *
* Copyright 1995 Matthias Ettrich
- * Copyright 1995-2001 The LyX Team.
+ * Copyright 1995-2001 The LyX Team.
*
* ====================================================== */
Paragraph *,
lyx::pos_type pos);
-#if 0
/** Paste this paragraph with the next one.
Be carefull, this doesent make any check at all.
-*/
+*/
void pasteParagraph(BufferParams const & bparams,
Paragraph *);
+#if 0
/// for the environments
Paragraph * depthHook(Paragraph * par, Paragraph::depth_type depth);
&& cursor.par()->getAlign() == tmppar->getAlign()) {
removeParagraph(tmprow);
removeRow(tmprow);
- cursor.par()->pasteParagraph(bview->buffer()->params);
+ pasteParagraph(bview->buffer()->params, cursor.par());
if (!cursor.pos() || !cursor.par()->isSeparator(cursor.pos() - 1))
; //cursor.par()->insertChar(cursor.pos(), ' ');
void LyXText::insertParagraph(BufferView * bview, Paragraph * par,
Row * row) const
{
- // insert a new row, starting at position 0
- insertRow(row, par, 0);
+ // insert a new row, starting at position 0
+ insertRow(row, par, 0);
// set the counters
setCounter(bview->buffer(), par);
s = o.str();
} else {
// par->SetLayout(0);
- // s = layout->labelstring;
+ // s = layout->labelstring;
s = (par->getParLanguage(buf->params)->lang() == "hebrew")
? " :úåòîùî øñç" : "Senseless: ";
}
par->params().labelString(s);
// reset the enumeration counter. They are always resetted
- // when there is any other layout between
+ // when there is any other layout between
for (int i = par->enumdepth + 1; i < 4; i++) {
buf->counters().set(buf->counters().enums[i], 0);
}