]> git.lyx.org Git - features.git/blobdiff - src/paragraph.C
Replace LString.h with support/std_string.h,
[features.git] / src / paragraph.C
index c5d0fa4a919a87273f716ad1a629584da24b1197..0a6c8bd34d0fdf917434156efd20dbea781e4e87 100644 (file)
@@ -1,12 +1,19 @@
-/* This file is part of
- * ======================================================
+/**
+ * \file paragraph.C
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
  *
- *           LyX, The Document Processor
+ * \author Asger Alstrup
+ * \author Lars Gullik Bjønnes
+ * \author Jean-Marc Lasgouttes
+ * \author Angus Leeming
+ * \author John Levon
+ * \author André Pönitz
+ * \author Dekel Tsur
+ * \author Jürgen Vigna
  *
- *           Copyright 1995 Matthias Ettrich
- *           Copyright 1995-2001 The LyX Team.
- *
- * ====================================================== */
+ * Full author contact details are available in file CREDITS.
+ */
 
 #include <config.h>
 
 #include "paragraph_pimpl.h"
 
 #include "buffer.h"
-#include "bufferparams.h"
-#include "BufferView.h"
-#include "changes.h"
 #include "encoding.h"
 #include "debug.h"
 #include "gettext.h"
 #include "language.h"
 #include "latexrunparams.h"
-#include "layout.h"
-#include "lyxrc.h"
-#include "paragraph_funcs.h"
-#include "ParameterStruct.h"
-#include "texrow.h"
 
-#include "Lsstream.h"
+#include "support/std_sstream.h"
 
 #include "insets/insetbibitem.h"
 #include "insets/insetoptarg.h"
-#include "insets/insetenv.h"
 
-#include "support/filetools.h"
 #include "support/lstrings.h"
-#include "support/lyxmanip.h"
-#include "support/FileInfo.h"
 #include "support/LAssert.h"
 #include "support/textutils.h"
 
-#include <algorithm>
-#include <fstream>
-#include <csignal>
-#include <ctime>
 
 using namespace lyx::support;
 
@@ -59,7 +50,7 @@ using lyx::pos_type;
 
 
 Paragraph::Paragraph()
-       : pimpl_(new Paragraph::Pimpl(this))
+       : y(0), pimpl_(new Paragraph::Pimpl(this))
 {
        enumdepth = 0;
        itemdepth = 0;
@@ -68,7 +59,7 @@ Paragraph::Paragraph()
 
 
 Paragraph::Paragraph(Paragraph const & lp)
-       : pimpl_(new Paragraph::Pimpl(*lp.pimpl_, this))
+       : y(0), pimpl_(new Paragraph::Pimpl(*lp.pimpl_, this))
 {
        enumdepth = 0;
        itemdepth = 0;
@@ -83,8 +74,6 @@ Paragraph::Paragraph(Paragraph const & lp)
        for (; it != end; ++it) {
                // currently we hold Inset*, not InsetBase*
                it->inset = static_cast<InsetOld*>(it->inset->clone().release());
-               // tell the new inset who is the boss now
-               it->inset->parOwner(this);
        }
 }
 
@@ -112,8 +101,6 @@ void Paragraph::operator=(Paragraph const & lp)
        InsetList::iterator end = insetlist.end();
        for (; it != end; ++it) {
                it->inset = static_cast<InsetOld*>(it->inset->clone().release());
-               // tell the new inset who is the boss now
-               it->inset->parOwner(this);
        }
 }
 
@@ -127,7 +114,7 @@ Paragraph::~Paragraph()
 }
 
 
-void Paragraph::write(Buffer const * buf, ostream & os,
+void Paragraph::write(Buffer const & buf, ostream & os,
                          BufferParams const & bparams,
                          depth_type & dth) const
 {
@@ -287,7 +274,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);
 }
@@ -349,8 +337,8 @@ lyx::pos_type 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!"
-              << endl;
+       //lyxerr << "Paragraph::getEndPosOfFontSpan: This should not happen!"
+       //      << endl;
        return pos;
 }
 
@@ -814,7 +802,7 @@ int Paragraph::endTeXParParams(BufferParams const & bparams,
 
 
 // This one spits out the text of the paragraph
-bool Paragraph::simpleTeXOnePar(Buffer const * buf,
+bool Paragraph::simpleTeXOnePar(Buffer const & buf,
                                BufferParams const & bparams,
                                LyXFont const & outerfont,
                                ostream & os, TexRow & texrow,
@@ -1127,7 +1115,7 @@ bool Paragraph::isMultiLingual(BufferParams const & bparams)
 
 // Convert the paragraph to a string.
 // Used for building the table of contents
-string const Paragraph::asString(Buffer const * buffer, bool label) const
+string const Paragraph::asString(Buffer const & buffer, bool label) const
 {
 #if 0
        string s;
@@ -1155,7 +1143,7 @@ string const Paragraph::asString(Buffer const * buffer, bool label) const
 }
 
 
-string const Paragraph::asString(Buffer const * buffer,
+string const Paragraph::asString(Buffer const & buffer,
                                 pos_type beg, pos_type end, bool label) const
 {
        ostringstream os;
@@ -1164,7 +1152,7 @@ string const Paragraph::asString(Buffer const * buffer,
                os << params().labelString() << ' ';
 
        for (pos_type i = beg; i < end; ++i) {
-               value_type const c = getUChar(buffer->params, i);
+               value_type const c = getUChar(buffer.params, i);
                if (IsPrintable(c))
                        os << c;
                else if (c == META_INSET)
@@ -1192,12 +1180,6 @@ void Paragraph::deleteInsetsLyXText(BufferView * bv)
 }
 
 
-void Paragraph::resizeInsetsLyXText(BufferView * bv)
-{
-       insetlist.resizeInsetsLyXText(bv);
-}
-
-
 void Paragraph::setContentsFromPar(Paragraph const & par)
 {
        pimpl_->setContentsFromPar(par);
@@ -1355,7 +1337,7 @@ 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 false;