X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FExternalTransforms.C;h=16d6406881abb38747c5288a0c96f52a121e1794;hb=e28331ed63062dea10d0a21b9ec12034b4b17b9a;hp=ffc66cfb12ccb733d2df30918465a5a438690953;hpb=9c2ba3c4ff17e15876a2ed6987ea44838a38d43b;p=lyx.git diff --git a/src/insets/ExternalTransforms.C b/src/insets/ExternalTransforms.C index ffc66cfb12..16d6406881 100644 --- a/src/insets/ExternalTransforms.C +++ b/src/insets/ExternalTransforms.C @@ -24,15 +24,14 @@ #include // std::abs #include -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::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(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(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(angle); if (std::abs(rotAngle) > 360.0) { rotAngle -= 360.0 * floor(rotAngle / 360.0); return convert(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(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(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