#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);
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);
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 = "!";
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();
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>