get rid of Paragraph::clear

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3672 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Lars Gullik Bjønnes 2002-03-05 23:02:37 +00:00
parent 8bfda1f950
commit 26f07a39bc
7 changed files with 38 additions and 24 deletions

View File

@ -1,3 +1,19 @@
2002-03-06 Lars Gullik Bjønnes <larsbj@birdstep.com>
* paragraph.C (breakParagraph): dont call clear do the work manually
* paragraph.[Ch] (clear): remove function
2002-03-05 Lars Gullik Bjønnes <larsbj@birdstep.com>
* paragraph.C (Paragraph): dont call clear, the work has already
been done.
* lyxtextclass.C (operator): assert if n is empty
* CutAndPaste.C (cutSelection): dont call Paragraph::clear, do the
work manually instead.
2002-03-01 John Levon <moz@compsoc.man.ac.uk>
* BufferView_pimpl.C: protect selectionLost against text == 0

View File

@ -131,9 +131,12 @@ bool CutAndPaste::cutSelection(Paragraph * startpar, Paragraph ** endpar,
(*endpar)->previous(startpar);
// the cut selection should begin with standard layout
if (realcut)
buf->clear();
if (realcut) {
buf->params().clear();
buf->bibkey = 0;
buf->layout(textclasslist[current_view->buffer()->params.textclass].defaultLayoutName());
}
// paste the paragraphs again, if possible
if (doclear)
startpar->next()->stripLeadingSpaces(textclass);

View File

@ -1,3 +1,7 @@
2002-03-06 Lars Gullik Bjønnes <larsbj@birdstep.com>
* insetert.C (getMaxWidth): make w unsigned int.
2002-03-05 Juergen Vigna <jug@sad.it>
* insetert.C (status): change behaviour of Inlined.

View File

@ -693,7 +693,7 @@ void InsetERT::getDrawFont(LyXFont & font) const
int InsetERT::getMaxWidth(BufferView * bv, UpdatableInset const * in) const
{
int w = InsetCollapsable::getMaxWidth(bv, in);
unsigned int w = InsetCollapsable::getMaxWidth(bv, in);
if (status_ != Inlined || w < 0)
return w;
LyXText * text = inset.getLyXText(bv);

View File

@ -505,6 +505,8 @@ bool LyXTextClass::hasLayout(string const & n) const
LyXLayout const & LyXTextClass::operator[](string const & n) const
{
lyx::Assert(!n.empty());
if (n.empty())
lyxerr << "Operator[] called with empty n" << endl;
@ -530,6 +532,8 @@ LyXLayout const & LyXTextClass::operator[](string const & n) const
LyXLayout & LyXTextClass::operator[](string const & n)
{
lyx::Assert(!n.empty());
if (n.empty())
lyxerr << "Operator[] called with empty n" << endl;

View File

@ -86,7 +86,6 @@ Paragraph::Paragraph()
enumdepth = 0;
itemdepth = 0;
bibkey = 0; // ale970302
clear();
}
@ -108,8 +107,6 @@ Paragraph::Paragraph(Paragraph * par)
// end
bibkey = 0; // ale970302
clear();
}
@ -472,17 +469,6 @@ bool Paragraph::insertFromMinibuffer(pos_type pos)
// end of minibuffer
void Paragraph::clear()
{
params().clear();
layout_.erase();
bibkey = 0;
}
void Paragraph::erase(pos_type pos)
{
pimpl_->erase(pos);
@ -909,7 +895,11 @@ void Paragraph::breakParagraph(BufferParams const & bparams,
tmp->params().pagebreakTop(params().pagebreakTop());
tmp->params().spaceTop(params().spaceTop());
tmp->bibkey = bibkey;
clear();
bibkey = 0;
params().clear();
layout(textclasslist[bparams.textclass].defaultLayoutName());
// layout stays the same with latex-environments
if (flag) {
layout(tmp->layout());
@ -2124,6 +2114,8 @@ string const & Paragraph::layout() const
void Paragraph::layout(string const & new_layout)
{
lyx::Assert(!new_layout.empty());
layout_ = new_layout;
}

View File

@ -309,11 +309,6 @@ public:
///
bool isWord(lyx::pos_type pos) const;
/** This one resets all layout and dtp switches but not the font
of the single characters
*/
void clear();
/** paste this paragraph with the next one
be carefull, this doesent make any check at all
*/