]> git.lyx.org Git - lyx.git/blobdiff - src/insets/ExternalTransforms.C
* src/LyXAction.C: mark goto-clear-bookmark as working without buffer
[lyx.git] / src / insets / ExternalTransforms.C
index 19670f087f33bf92c599f5b2e47531739e5b16ef..16d6406881abb38747c5288a0c96f52a121e1794 100644 (file)
@@ -16,7 +16,7 @@
 
 #include "support/lstrings.h"
 #include "support/lyxlib.h" // float_equal
-#include "support/tostr.h"
+#include "support/convert.h"
 #include "support/translator.h"
 
 #include <boost/regex.hpp>
 #include <cmath> // std::abs
 #include <sstream>
 
-using lyx::support::float_equal;
-using lyx::support::strToDbl;
-
-using std::string;
-
 
 namespace lyx {
 namespace external {
 
+using support::float_equal;
+using std::string;
+
+
 string const ExtraData::get(string const & id) const
 {
        std::map<string, string>::const_iterator it = data_.find(id);
@@ -54,20 +53,20 @@ bool ResizeData::no_resize() const
 
 bool ResizeData::usingScale() const
 {
-       return (!scale.empty() && !float_equal(strToDbl(scale), 0.0, 0.05));
+       return (!scale.empty() && !float_equal(convert<double>(scale), 0.0, 0.05));
 }
 
 
 bool RotationData::no_rotation() const
 {
-       return (angle.empty() || std::abs(strToDbl(angle)) < 0.1);
+       return (angle.empty() || std::abs(convert<double>(angle)) < 0.1);
 }
 
 
 string const RotationData::adjAngle() const
 {
        // Ensure that angle lies in the range -360 < angle < 360
-       double rotAngle = strToDbl(angle);
+       double rotAngle = convert<double>(angle);
        if (std::abs(rotAngle) > 360.0) {
                rotAngle -= 360.0 * floor(rotAngle / 360.0);
                return convert<string>(rotAngle);
@@ -103,7 +102,7 @@ string const ResizeLatexCommand::front_impl() const
 
        std::ostringstream os;
        if (data.usingScale()) {
-               double const scl = strToDbl(data.scale) / 100.0;
+               double const scl = convert<double>(data.scale) / 100.0;
                os << "\\scalebox{" << scl << "}[" << scl << "]{";
        } else {
                string width  = "!";
@@ -235,7 +234,7 @@ string const ResizeLatexOption::option_impl() const
 
        std::ostringstream os;
        if (data.usingScale()) {
-               double scl = strToDbl(data.scale);
+               double const scl = convert<double>(data.scale);
                if (!float_equal(scl, 100.0, 0.05))
                        os << "scale=" << scl / 100.0 << ',';
                return os.str();
@@ -319,19 +318,13 @@ string const sanitizeLatexOption(string const & input)
        output = what.str(1);
 
        // Remove any surrounding whitespace
-       output = lyx::support::trim(output);
+       output = support::trim(output);
 
        // If the thing is empty, leave it so, else wrap it in square brackets.
        return output.empty() ? output : "[" + output + "]";
 }
 
 
-string const sanitizeLinuxDocOption(string const & input)
-{
-       return input;
-}
-
-
 namespace {
 
 template <typename Factory, typename Data, typename Transformer>