using lyx::pos_type;
-// this is a minibuffer
-
-namespace {
-
-char minibuffer_char;
-LyXFont minibuffer_font;
-InsetOld * minibuffer_inset;
-
-} // namespace anon
-
-
Paragraph::Paragraph()
: pimpl_(new Paragraph::Pimpl(this))
{
// needed as we will destroy the pimpl_ before copying it
if (&lp != this)
return;
- lyxerr << "Paragraph::operator=()\n";
+
+ lyxerr << "Paragraph::operator=()" << endl;
+
delete pimpl_;
pimpl_ = new Pimpl(*lp.pimpl_, this);
}
// First write the layout
- os << "\n\\layout " << layout()->name() << '\n';
+ os << "\n\\begin_layout " << layout()->name() << '\n';
params().write(os);
}
-// First few functions needed for cut and paste and paragraph breaking.
-void Paragraph::copyIntoMinibuffer(Buffer const & buffer, pos_type pos) const
-{
- BufferParams bparams = buffer.params;
-
- minibuffer_char = getChar(pos);
- minibuffer_font = getFontSettings(bparams, pos);
- minibuffer_inset = 0;
- if (minibuffer_char == Paragraph::META_INSET) {
- if (getInset(pos)) {
- minibuffer_inset = static_cast<InsetOld *>(getInset(pos)->clone().release());
- } else {
- minibuffer_inset = 0;
- minibuffer_char = ' ';
- // This reflects what GetInset() does (ARRae)
- }
- }
-}
-
-
-void Paragraph::cutIntoMinibuffer(BufferParams const & bparams, pos_type pos)
-{
- minibuffer_char = getChar(pos);
- minibuffer_font = getFontSettings(bparams, pos);
- minibuffer_inset = 0;
- if (minibuffer_char == Paragraph::META_INSET) {
- if (getInset(pos)) {
- // the inset is not in a paragraph anymore
- minibuffer_inset = insetlist.release(pos);
- minibuffer_inset->parOwner(0);
- } else {
- minibuffer_inset = 0;
- minibuffer_char = ' ';
- // This reflects what GetInset() does (ARRae)
- }
- }
-}
-
-
-bool Paragraph::insertFromMinibuffer(pos_type pos)
-{
- if (minibuffer_char == Paragraph::META_INSET) {
- if (!insetAllowed(minibuffer_inset->lyxCode()))
- return false;
- insertInset(pos, minibuffer_inset, minibuffer_font);
- } else {
- LyXFont f = minibuffer_font;
- if (!checkInsertChar(f))
- return false;
- insertChar(pos, minibuffer_char, f);
- }
- return true;
-}
-
-// end of minibuffer
-
-
void Paragraph::eraseIntern(lyx::pos_type pos)
{
pimpl_->eraseIntern(pos);
}
-void Paragraph::insertInset(pos_type pos, InsetOld * inset, LyXFont const & font, Change change)
+void Paragraph::insertInset(pos_type pos, InsetOld * inset,
+ LyXFont const & font, Change change)
{
pimpl_->insertInset(pos, inset, font, change);
}
}
-lyx::pos_type
-Paragraph::getEndPosOfFontSpan(lyx::pos_type pos) const
+lyx::pos_type Paragraph::getEndPosOfFontSpan(lyx::pos_type pos) const
{
Assert(pos <= size());
return cit->pos();
// This should not happen, but if so, we take no chances.
- lyxerr << "Pararaph::getEndPosOfFontSpan: This should not happen!\n";
+ //lyxerr << "Paragraph::getEndPosOfFontSpan: This should not happen!"
+ // << endl;
return pos;
}
for (; cit != end; ++cit)
if (cit->font().language() != ignore_language &&
cit->font().language() != latex_language &&
- cit->font().language() != doc_language)
+ cit->font().language() != doc_language)
return true;
return false;
}
}
-void Paragraph::resizeInsetsLyXText(BufferView * bv)
-{
- insetlist.resizeInsetsLyXText(bv);
-}
-
-
void Paragraph::setContentsFromPar(Paragraph const & par)
{
pimpl_->setContentsFromPar(par);
return true;
// for now we just need this, later should we need this in some
- // other way we can always add a function to InsetOld::() too.
+ // other way we can always add a function to InsetOld too.
if (pimpl_->inset_owner && pimpl_->inset_owner->owner())
- return (pimpl_->inset_owner->owner()->lyxCode() == InsetOld::ERT_CODE);
+ return pimpl_->inset_owner->owner()->lyxCode() == InsetOld::ERT_CODE;
return false;
}
if (layout()->keepempty)
return true;
if (pimpl_->inset_owner && pimpl_->inset_owner->owner())
- return (pimpl_->inset_owner->owner()->lyxCode() == InsetOld::ERT_CODE);
+ return pimpl_->inset_owner->owner()->lyxCode() == InsetOld::ERT_CODE;
return false;
}
-
-
-bool operator==(Paragraph const & lhs, Paragraph const & rhs)
-{
-#warning FIXME this implementatoin must be completely wrong...
- return &lhs == &rhs;
-}