]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetFloat.cpp
This should be the last of the commits refactoring the InsetLayout code.
[lyx.git] / src / insets / InsetFloat.cpp
index edd2da65ad05755ae78fa3861e519aa9e1eed2de..e966bb5d6c7b9a0c1f2720cc7e163a1d19e2cdda 100644 (file)
 #include "BufferView.h"
 #include "Counters.h"
 #include "Cursor.h"
-#include "debug.h"
 #include "DispatchResult.h"
 #include "Floating.h"
 #include "FloatList.h"
 #include "FuncRequest.h"
 #include "FuncStatus.h"
-#include "gettext.h"
 #include "LaTeXFeatures.h"
 #include "Lexer.h"
 #include "OutputParams.h"
 #include "TextClass.h"
 
+#include "support/debug.h"
+#include "support/gettext.h"
 #include "support/lstrings.h"
 #include "support/docstream.h"
 #include "support/convert.h"
 
+using namespace std;
 
 namespace lyx {
 
-using std::endl;
-using std::string;
-using std::istringstream;
-using std::ostream;
-using std::ostringstream;
-
 
 // With this inset it will be possible to support the latex package
 // float.sty, and I am sure that with this and some additional support
@@ -266,7 +261,7 @@ void InsetFloat::validate(LaTeXFeatures & features) const
        }
 
        if (params_.sideways)
-               features.require("rotating");
+               features.require("rotfloat");
 
        features.useFloat(params_.type);
        InsetCollapsable::validate(features);
@@ -289,13 +284,13 @@ int InsetFloat::latex(Buffer const & buf, odocstream & os,
                      OutputParams const & runparams) const
 {
        FloatList const & floats = buf.params().getTextClass().floats();
-       string tmptype = (params_.wide ? params_.type + "*" : params_.type);
-       if (params_.sideways) {
-               if (params_.type == "table")
-                       tmptype = "sidewaystable";
-               else if (params_.type == "figure")
-                       tmptype = "sidewaysfigure";
-       }
+       string tmptype = params_.type;
+       if (params_.sideways)
+               tmptype = "sideways" + params_.type;
+       if (params_.wide && (!params_.sideways ||
+                            params_.type == "figure" ||
+                            params_.type == "table"))
+               tmptype += "*";
        // Figure out the float placement to use.
        // From lowest to highest:
        // - float default placement