]> git.lyx.org Git - lyx.git/blobdiff - src/insets/ExternalTransforms.cpp
move the validation code from InsetFlex to InsetCollapsable
[lyx.git] / src / insets / ExternalTransforms.cpp
index bad7b38d6b4236c5193890a82ca68ecef3cefd24..270a7c83b0f9deb387387ec84d074b9c66bca1ef 100644 (file)
 
 #include "ExternalTransforms.h"
 
+#include "support/convert.h"
 #include "support/debug.h"
-
 #include "support/lstrings.h"
 #include "support/lyxlib.h" // float_equal
-#include "support/convert.h"
 #include "support/Translator.h"
 
 #include <boost/regex.hpp>
 
-#include <cmath> // std::abs
+#include <cmath> // abs
 #include <sstream>
 
 using namespace std;
@@ -33,7 +32,7 @@ namespace external {
 
 string const ExtraData::get(string const & id) const
 {
-       std::map<string, string>::const_iterator it = data_.find(id);
+       map<string, string>::const_iterator it = data_.find(id);
        return it == data_.end() ? string() : it->second;
 }
 
@@ -58,7 +57,7 @@ bool ResizeData::usingScale() const
 
 bool RotationData::no_rotation() const
 {
-       return (angle.empty() || std::abs(convert<double>(angle)) < 0.1);
+       return (angle.empty() || abs(convert<double>(angle)) < 0.1);
 }
 
 
@@ -66,7 +65,7 @@ string const RotationData::adjAngle() const
 {
        // Ensure that angle lies in the range -360 < angle < 360
        double rotAngle = convert<double>(angle);
-       if (std::abs(rotAngle) > 360.0) {
+       if (abs(rotAngle) > 360.0) {
                rotAngle -= 360.0 * floor(rotAngle / 360.0);
                return convert<string>(rotAngle);
        }
@@ -99,7 +98,7 @@ string const ResizeLatexCommand::front_impl() const
        if (data.no_resize())
                return string();
 
-       std::ostringstream os;
+       ostringstream os;
        if (data.usingScale()) {
                double const scl = convert<double>(data.scale) / 100.0;
                os << "\\scalebox{" << scl << "}[" << scl << "]{";
@@ -137,7 +136,7 @@ string const ResizeLatexCommand::back_impl() const
 
 namespace {
 
-std::ostream & operator<<(std::ostream & os, RotationData::OriginType type)
+ostream & operator<<(ostream & os, RotationData::OriginType type)
 {
        switch (type) {
        case RotationData::DEFAULT:
@@ -192,7 +191,7 @@ string const RotationLatexCommand::front_impl() const
        if (data.no_rotation())
                return string();
 
-       std::ostringstream os;
+       ostringstream os;
        os << "\\rotatebox";
 
        if (data.origin() != RotationData::DEFAULT)
@@ -217,7 +216,7 @@ string const  ClipLatexOption::option_impl() const
        if (!data.clip || data.bbox.empty())
                return string();
 
-       std::ostringstream os;
+       ostringstream os;
        if (!data.bbox.empty())
                os << "bb=" << data.bbox << ',';
        if (data.clip)
@@ -231,7 +230,7 @@ string const ResizeLatexOption::option_impl() const
        if (data.no_resize())
                return string();
 
-       std::ostringstream os;
+       ostringstream os;
        if (data.usingScale()) {
                double const scl = convert<double>(data.scale);
                if (!float_equal(scl, 100.0, 0.05))
@@ -255,7 +254,7 @@ string const RotationLatexOption ::option_impl() const
        if (data.no_rotation())
                return string();
 
-       std::ostringstream os;
+       ostringstream os;
        os << "angle=" << data.angle << ',';
 
        if (data.origin() != RotationData::DEFAULT)
@@ -317,7 +316,7 @@ string const sanitizeLatexOption(string const & input)
        output = what.str(1);
 
        // Remove any surrounding whitespace
-       output = support::trim(output);
+       output = trim(output);
 
        // If the thing is empty, leave it so, else wrap it in square brackets.
        return output.empty() ? output : "[" + output + "]";