X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FExternalTransforms.cpp;h=76404738c10081e60a8557278aa3fbbce4c10e66;hb=2c357c1d23b7b83839a9beb8225d4f1ae4f793b4;hp=de25277845c926d345b8a7d0f8c2bdee88f3f90e;hpb=bcc90ce1c9cfaa7c93cb0610632d71b79c1bbf9d;p=lyx.git diff --git a/src/insets/ExternalTransforms.cpp b/src/insets/ExternalTransforms.cpp index de25277845..76404738c1 100644 --- a/src/insets/ExternalTransforms.cpp +++ b/src/insets/ExternalTransforms.cpp @@ -12,8 +12,7 @@ #include "ExternalTransforms.h" -#include "debug.h" - +#include "support/debug.h" #include "support/lstrings.h" #include "support/lyxlib.h" // float_equal #include "support/convert.h" @@ -21,20 +20,19 @@ #include -#include // std::abs +#include // abs #include +using namespace std; +using namespace lyx::support; 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); + map::const_iterator it = data_.find(id); return it == data_.end() ? string() : it->second; } @@ -59,7 +57,7 @@ bool ResizeData::usingScale() const bool RotationData::no_rotation() const { - return (angle.empty() || std::abs(convert(angle)) < 0.1); + return (angle.empty() || abs(convert(angle)) < 0.1); } @@ -67,7 +65,7 @@ string const RotationData::adjAngle() const { // Ensure that angle lies in the range -360 < angle < 360 double rotAngle = convert(angle); - if (std::abs(rotAngle) > 360.0) { + if (abs(rotAngle) > 360.0) { rotAngle -= 360.0 * floor(rotAngle / 360.0); return convert(rotAngle); } @@ -100,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(data.scale) / 100.0; os << "\\scalebox{" << scl << "}[" << scl << "]{"; @@ -138,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: @@ -193,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) @@ -218,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) @@ -232,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(data.scale); if (!float_equal(scl, 100.0, 0.05)) @@ -256,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) @@ -318,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 + "]";