]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetfloat.C
Make buffer's member variables private; use accessor functions.
[lyx.git] / src / insets / insetfloat.C
index 197de9e4106c1d37bce6c0a46b31ce73738cf675..4640c0578417fc48b5ae48b0cdcb0061c08fae58 100644 (file)
@@ -12,7 +12,6 @@
 #include <config.h>
 
 #include "insetfloat.h"
-#include "insettext.h"
 
 #include "buffer.h"
 #include "BufferView.h"
 #include "gettext.h"
 #include "iterators.h"
 #include "LaTeXFeatures.h"
-#include "Lsstream.h"
-#include "lyxfont.h"
 #include "lyxlex.h"
-#include "lyxtext.h"
-#include "Lsstream.h"
+#include "paragraph.h"
 
-#include "support/LOstream.h"
 #include "support/lstrings.h"
 #include "support/tostr.h"
 
-#include "frontends/LyXView.h"
-#include "frontends/Dialogs.h"
+#include "support/std_sstream.h"
 
 using namespace lyx::support;
 
-using std::ostream;
 using std::endl;
 using std::auto_ptr;
+using std::istringstream;
+using std::ostream;
+using std::ostringstream;
 
 
 // With this inset it will be possible to support the latex package
@@ -171,7 +167,7 @@ dispatch_result InsetFloat::localDispatch(FuncRequest const & cmd)
                params_.placement = params.placement;
                params_.wide      = params.wide;
 
-               wide(params_.wide, cmd.view()->buffer()->params);
+               wide(params_.wide, cmd.view()->buffer()->params());
                cmd.view()->updateInset(this);
                return DISPATCHED;
        }
@@ -240,7 +236,7 @@ void InsetFloat::write(Buffer const & buf, ostream & os) const
 void InsetFloat::read(Buffer const & buf, LyXLex & lex)
 {
        params_.read(lex);
-       wide(params_.wide, buf.params);
+       wide(params_.wide, buf.params());
        InsetCollapsable::read(buf, lex);
 }
 
@@ -271,7 +267,7 @@ string const InsetFloat::editMessage() const
 int InsetFloat::latex(Buffer const & buf, ostream & os,
                      LatexRunParams const & runparams) const
 {
-       FloatList const & floats = buf.params.getLyXTextClass().floats();
+       FloatList const & floats = buf.params().getLyXTextClass().floats();
        string const tmptype = (params_.wide ? params_.type + "*" : params_.type);
        // Figure out the float placement to use.
        // From lowest to highest:
@@ -279,7 +275,7 @@ int InsetFloat::latex(Buffer const & buf, ostream & os,
        // - document wide default placement
        // - specific float placement
        string placement;
-       string const buf_placement = buf.params.float_placement;
+       string const buf_placement = buf.params().float_placement;
        string const def_placement = floats.defaultPlacement(params_.type);
        if (!params_.placement.empty()
            && params_.placement != def_placement) {
@@ -312,7 +308,7 @@ int InsetFloat::latex(Buffer const & buf, ostream & os,
 
 int InsetFloat::linuxdoc(Buffer const & buf, ostream & os) const
 {
-       FloatList const & floats = buf.params.getLyXTextClass().floats();
+       FloatList const & floats = buf.params().getLyXTextClass().floats();
        string const tmptype =  params_.type;
        // Figure out the float placement to use.
        // From lowest to highest:
@@ -322,7 +318,7 @@ int InsetFloat::linuxdoc(Buffer const & buf, ostream & os) const
        // This is the same as latex, as linuxdoc is modeled after latex.
 
        string placement;
-       string const buf_placement = buf.params.float_placement;
+       string const buf_placement = buf.params().float_placement;
        string const def_placement = floats.defaultPlacement(params_.type);
        if (!params_.placement.empty()
            && params_.placement != def_placement) {
@@ -402,7 +398,7 @@ void InsetFloat::addToToc(lyx::toc::TocList & toclist, Buffer const & buf) const
        // Find a caption layout in one of the (child inset's) pars
        for (; pit != end; ++pit) {
                if (pit->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)
                                + ". " + pit->asString(buf, false);