]> git.lyx.org Git - lyx.git/blobdiff - src/paragraph.C
More 'standard conformant blurb' nonsense.
[lyx.git] / src / paragraph.C
index f6982c75aad9fdb6094fc56b5939cb8f1b731831..b0d9098bd44af63cb7ab1760e79c3c5e2312f70b 100644 (file)
@@ -58,17 +58,6 @@ using std::upper_bound;
 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))
 {
@@ -105,7 +94,9 @@ void Paragraph::operator=(Paragraph const & lp)
        // 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);
 
@@ -156,7 +147,7 @@ void Paragraph::write(Buffer const * buf, ostream & os,
        }
 
        // First write the layout
-       os << "\n\\layout " << layout()->name() << '\n';
+       os << "\n\\begin_layout " << layout()->name() << '\n';
 
        params().write(os);
 
@@ -251,63 +242,6 @@ void Paragraph::validate(LaTeXFeatures & features) const
 }
 
 
-// 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);
@@ -353,7 +287,8 @@ void Paragraph::insertInset(pos_type pos, InsetOld * inset)
 }
 
 
-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);
 }
@@ -404,8 +339,7 @@ LyXFont const Paragraph::getFontSettings(BufferParams const & bparams,
 }
 
 
-lyx::pos_type
-Paragraph::getEndPosOfFontSpan(lyx::pos_type pos) const
+lyx::pos_type Paragraph::getEndPosOfFontSpan(lyx::pos_type pos) const
 {
        Assert(pos <= size());
 
@@ -416,7 +350,8 @@ Paragraph::getEndPosOfFontSpan(lyx::pos_type pos) const
                        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;
 }
 
@@ -1185,7 +1120,7 @@ bool Paragraph::isMultiLingual(BufferParams const & bparams)
        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;
 }
@@ -1258,12 +1193,6 @@ void Paragraph::deleteInsetsLyXText(BufferView * bv)
 }
 
 
-void Paragraph::resizeInsetsLyXText(BufferView * bv)
-{
-       insetlist.resizeInsetsLyXText(bv);
-}
-
-
 void Paragraph::setContentsFromPar(Paragraph const & par)
 {
        pimpl_->setContentsFromPar(par);
@@ -1421,9 +1350,9 @@ bool Paragraph::isFreeSpacing() const
                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;
 }
 
@@ -1433,13 +1362,6 @@ bool Paragraph::allowEmpty() const
        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;
-}