]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetwrap.C
The std::string mammoth path.
[lyx.git] / src / insets / insetwrap.C
index a5c5d37639ce52c6797fd50941b5290282764e74..9be7eb2e91296ba127894a372e79ca1761346fa9 100644 (file)
@@ -5,36 +5,38 @@
  *
  * \author Dekel Tsur
  *
- * Full author contact details are available in file CREDITS
+ * Full author contact details are available in file CREDITS.
  */
 
 #include <config.h>
 
 #include "insetwrap.h"
-#include "insettext.h"
 
 #include "buffer.h"
+#include "bufferparams.h"
 #include "BufferView.h"
 #include "debug.h"
-#include "funcrequest.h"
+#include "Floating.h"
 #include "FloatList.h"
+#include "funcrequest.h"
 #include "gettext.h"
 #include "LaTeXFeatures.h"
-#include "Lsstream.h"
-#include "lyxfont.h"
+#include "LColor.h"
 #include "lyxlex.h"
-#include "lyxtext.h"
-#include "Lsstream.h"
-
-#include "frontends/LyXView.h"
-#include "frontends/Dialogs.h"
+#include "paragraph.h"
 
-#include "support/LOstream.h"
 #include "support/tostr.h"
 
-using std::ostream;
+#include "support/std_sstream.h"
+
+
+using std::string;
 using std::endl;
 using std::auto_ptr;
+using std::istringstream;
+using std::ostream;
+using std::ostringstream;
+
 
 namespace {
 
@@ -107,12 +109,11 @@ dispatch_result InsetWrap::localDispatch(FuncRequest const & cmd)
 
 void InsetWrapParams::write(ostream & os) const
 {
-       os << "Wrap " // getInsetName()
-          << type << '\n';
+       os << "Wrap " << type << '\n';
 
-       if (!placement.empty()) {
+       if (!placement.empty())
                os << "placement " << placement << "\n";
-       }
+
        os << "width \"" << width.asString() << "\"\n";
 }
 
@@ -146,14 +147,14 @@ void InsetWrapParams::read(LyXLex & lex)
 }
 
 
-void InsetWrap::write(Buffer const * buf, ostream & os) const
+void InsetWrap::write(Buffer const & buf, ostream & os) const
 {
        params_.write(os);
        InsetCollapsable::write(buf, os);
 }
 
 
-void InsetWrap::read(Buffer const * buf, LyXLex & lex)
+void InsetWrap::read(Buffer const & buf, LyXLex & lex)
 {
        params_.read(lex);
        InsetCollapsable::read(buf, lex);
@@ -179,7 +180,7 @@ string const InsetWrap::editMessage() const
 }
 
 
-int InsetWrap::latex(Buffer const * buf, ostream & os,
+int InsetWrap::latex(Buffer const & buf, ostream & os,
                     LatexRunParams const & runparams) const
 {
        os << "\\begin{floating" << params_.type << '}';
@@ -195,7 +196,7 @@ int InsetWrap::latex(Buffer const * buf, ostream & os,
 }
 
 
-int InsetWrap::docbook(Buffer const * buf, ostream & os, bool mixcont) const
+int InsetWrap::docbook(Buffer const & buf, ostream & os, bool mixcont) const
 {
        os << '<' << params_.type << '>';
        int const i = inset.docbook(buf, os, mixcont);
@@ -205,7 +206,7 @@ int InsetWrap::docbook(Buffer const * buf, ostream & os, bool mixcont) const
 }
 
 
-bool InsetWrap::insetAllowed(Inset::Code code) const
+bool InsetWrap::insetAllowed(InsetOld::Code code) const
 {
        switch(code) {
        case FLOAT_CODE:
@@ -234,7 +235,7 @@ bool InsetWrap::showInsetDialog(BufferView * bv) const
 }
 
 
-void InsetWrap::addToToc(toc::TocList & toclist, Buffer const * buf) const
+void InsetWrap::addToToc(lyx::toc::TocList & toclist, Buffer const & buf) const
 {
        // Now find the caption in the float...
        ParagraphList::iterator tmp = inset.paragraphs.begin();
@@ -242,11 +243,11 @@ void InsetWrap::addToToc(toc::TocList & toclist, Buffer const * buf) const
 
        for (; tmp != end; ++tmp) {
                if (tmp->layout()->name() == caplayout) {
-                       string const name = floatname(params_.type, buf->params);
+                       string const name = floatname(params_.type, buf.params());
                        string const str =
                                tostr(toclist[name].size() + 1)
                                + ". " + tmp->asString(buf, false);
-                       toc::TocItem const item(tmp->id(), 0 , str);
+                       lyx::toc::TocItem const item(tmp->id(), 0 , str);
                        toclist[name].push_back(item);
                }
        }
@@ -274,7 +275,7 @@ void InsetWrapMailer::string2params(string const & in,
        if (in.empty())
                return;
 
-       istringstream data(STRCONV(in));
+       istringstream data(in);
        LyXLex lex(0,0);
        lex.setStream(data);
 
@@ -305,5 +306,5 @@ string const InsetWrapMailer::params2string(InsetWrapParams const & params)
        ostringstream data;
        data << name_ << ' ';
        params.write(data);
-       return STRCONV(data.str());
+       return data.str();
 }