]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiBox.cpp
Use <cstdint> instead of <boost/cstdint.hpp>
[lyx.git] / src / frontends / qt4 / GuiBox.cpp
index 0999039ddadb9fcea100b6c07aae1bd5f2709585..6a991b5df5063e4fc6a61827c70397038ed76466 100644 (file)
@@ -26,7 +26,6 @@
 #include "insets/InsetBox.h"
 
 #include "support/gettext.h"
-#include "support/foreach.h"
 #include "support/lstrings.h"
 
 #include <QComboBox>
@@ -103,16 +102,6 @@ static QList<ColorCode> colors()
 }
 
 
-namespace {
-
-bool ColorSorter(ColorCode lhs, ColorCode rhs)
-{
-       return support::compare_no_case(lcolor.getGUIName(lhs), lcolor.getGUIName(rhs)) < 0;
-}
-
-} // namespace anon
-
-
 GuiBox::GuiBox(QWidget * parent) : InsetParamsWidget(parent)
 {
        setupUi(this);
@@ -351,9 +340,9 @@ void GuiBox::paramsToDialog(Inset const * inset)
        // add the entry "Stretch" if the box is \makebox or \framebox and if not already there
        if ((inner_type == "makebox" || (type == "Boxed" && inner_type == "none"))
                && halignCO->count() < 4)
-               halignCO->addItem(toqstr("Stretch"));
+               halignCO->addItem(qt_("Stretch"));
        else if (inner_type != "makebox" && (type != "Boxed" && inner_type != "none"))
-               halignCO->removeItem(3); 
+               halignCO->removeItem(3);
        // pagebreak is only allowed for Boxed without inner box
        pagebreakCB->setEnabled(!ibox && type == "Boxed");
 
@@ -450,7 +439,7 @@ docstring GuiBox::dialogToParams() const
                if (ids_spec_.contains(unit) && !isValidLength(fromqstr(value))) {
                        params.special = fromqstr(unit);
                        // Note: the unit is simply ignored in this case
-                       params.width = Length(value.toDouble(), Length::IN);
+                       params.width = Length(widgetToDouble(widthED), Length::IN);
                } else {
                        params.special = "none";
                        // we must specify a valid length in this case
@@ -476,7 +465,7 @@ docstring GuiBox::dialogToParams() const
                if (ids_spec_.contains(unit) && !isValidLength(fromqstr(value))) {
                        params.height_special = fromqstr(unit);
                        // Note: the unit is simply ignored in this case
-                       params.height = Length(value.toDouble(), Length::IN);
+                       params.height = Length(widgetToDouble(heightED), Length::IN);
                } else {
                        params.height_special = "none";
                        params.height =
@@ -566,7 +555,7 @@ bool GuiBox::checkWidgets(bool readonly) const
                // add the entry "Stretch" if the box is \makebox or \framebox and if not already there
                if ((itype == "makebox" || (outer == "Boxed" && itype == "none"))
                        && halignCO->count() < 4)
-                       halignCO->addItem(toqstr("Stretch"));
+                       halignCO->addItem(qt_("Stretch"));
                else if (itype != "makebox" && (outer != "Boxed" && itype != "none"))
                        halignCO->removeItem(3);
                // pagebreak is only allowed for Boxed without inner box