]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetBox.cpp
pimpl not needed here
[lyx.git] / src / insets / InsetBox.cpp
index 4d52aec2e98ec674395e1b355bc019eb19aac32a..c88866d3d3c849a925ee19e7bb9df9ccc6015ac1 100644 (file)
@@ -14,6 +14,7 @@
 
 #include "InsetBox.h"
 
+#include "Buffer.h"
 #include "BufferView.h"
 #include "Cursor.h"
 #include "DispatchResult.h"
@@ -22,7 +23,6 @@
 #include "FuncRequest.h"
 #include "gettext.h"
 #include "LaTeXFeatures.h"
-#include "Color.h"
 #include "Lexer.h"
 #include "MetricsInfo.h"
 
@@ -140,10 +140,6 @@ void InsetBox::read(Buffer const & buf, Lexer & lex)
 
 void InsetBox::setButtonLabel()
 {
-       Font font(Font::ALL_SANE);
-       font.decSize();
-       font.decSize();
-
        BoxType btype = boxtranslator().find(params_.type);
 
        docstring label;
@@ -159,9 +155,6 @@ void InsetBox::setButtonLabel()
        label += ")";
 
        setLabel(label);
-
-       font.setColor(Color::foreground);
-       setLabelFont(font);
 }
 
 
@@ -203,7 +196,7 @@ void InsetBox::doDispatch(Cursor & cur, FuncRequest & cmd)
        case LFUN_INSET_MODIFY: {
                //lyxerr << "InsetBox::dispatch MODIFY" << endl;
                InsetBoxMailer::string2params(to_utf8(cmd.argument()), params_);
-               setButtonLabel();
+               setLayout(cur.buffer().params());
                break;
        }
 
@@ -338,7 +331,11 @@ int InsetBox::latex(Buffer const & buf, odocstream & os,
                        // Special heights
                        // set no optional argument when the value is the default "1\height"
                        // (special units like \height are handled as "in")
-                       if (params_.height != Length("1in")) {
+                       // but when the user has chosen a non-default inner_pos, the height
+                       // must be given: \minipage[pos][height][inner-pos]{width}
+                       if ((params_.height != Length("1in") ||
+                                params_.height_special != "totalheight") ||
+                               params_.inner_pos != params_.pos) {
                                // FIXME UNICODE
                                os << "[" << params_.height.value()
                                        << "\\" << from_utf8(params_.height_special) << "]";