X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FinsetgraphicsParams.C;h=c0cdd5fae8826669aa6d68d3e2c1ae08c78acc69;hb=e28331ed63062dea10d0a21b9ec12034b4b17b9a;hp=802531f059bc799f76046b015c2cb0e2db8060c5;hpb=c7e365365e74237149c960b9ecaa77bc7c93e608;p=lyx.git diff --git a/src/insets/insetgraphicsParams.C b/src/insets/insetgraphicsParams.C index 802531f059..c0cdd5fae8 100644 --- a/src/insets/insetgraphicsParams.C +++ b/src/insets/insetgraphicsParams.C @@ -14,7 +14,7 @@ #include "insetgraphicsParams.h" #include "debug.h" -#include "lyx_main.h" // for lyx::use_gui +#include "lyx_main.h" // for use_gui #include "lyxlex.h" #include "lyxrc.h" @@ -26,9 +26,12 @@ #include "support/lstrings.h" #include "support/translator.h" -using lyx::support::float_equal; -using lyx::support::readBB_from_PSFile; -using lyx::support::token; + +namespace lyx { + +using support::float_equal; +using support::readBB_from_PSFile; +using support::token; using std::string; using std::ostream; @@ -64,7 +67,7 @@ void InsetGraphicsParams::init() { filename.erase(); lyxscale = 100; // lyx scaling in percentage - display = lyx::graphics::DefaultDisplay; // display mode; see preferences + display = graphics::DefaultDisplay; // display mode; see preferences scale = string(); // output scaling in percentage width = LyXLength(); height = LyXLength(); @@ -151,8 +154,8 @@ void InsetGraphicsParams::Write(ostream & os, string const & bufpath) const } if (lyxscale != 100) os << "\tlyxscale " << lyxscale << '\n'; - if (display != lyx::graphics::DefaultDisplay) - os << "\tdisplay " << lyx::graphics::displayTranslator().find(display) << '\n'; + if (display != graphics::DefaultDisplay) + os << "\tdisplay " << graphics::displayTranslator().find(display) << '\n'; if (!scale.empty() && !float_equal(convert(scale), 0.0, 0.05)) { if (!float_equal(convert(scale), 100.0, 0.05)) os << "\tscale " << scale << '\n'; @@ -200,7 +203,7 @@ bool InsetGraphicsParams::Read(LyXLex & lex, string const & token, string const } else if (token == "display") { lex.next(); string const type = lex.getString(); - display = lyx::graphics::displayTranslator().find(type); + display = graphics::displayTranslator().find(type); } else if (token == "scale") { lex.next(); scale = lex.getString(); @@ -260,10 +263,10 @@ bool InsetGraphicsParams::Read(LyXLex & lex, string const & token, string const } -lyx::graphics::Params InsetGraphicsParams::as_grfxParams() const +graphics::Params InsetGraphicsParams::as_grfxParams() const { - lyx::graphics::Params pars; - pars.filename = filename.absFilename(); + graphics::Params pars; + pars.filename = filename; pars.scale = lyxscale; pars.angle = convert(rotateAngle); @@ -271,7 +274,7 @@ lyx::graphics::Params InsetGraphicsParams::as_grfxParams() const pars.bb = bb; // Get the original Bounding Box from the file - string const tmp = readBB_from_PSFile(filename.absFilename()); + string const tmp = readBB_from_PSFile(filename); lyxerr[Debug::GRAPHICS] << "BB_from_File: " << tmp << std::endl; if (!tmp.empty()) { #ifdef WITH_WARNINGS @@ -314,16 +317,19 @@ lyx::graphics::Params InsetGraphicsParams::as_grfxParams() const } } - if (display == lyx::graphics::DefaultDisplay) { + if (display == graphics::DefaultDisplay) { pars.display = lyxrc.display_graphics; } else { pars.display = display; } // Override the above if we're not using a gui - if (!lyx::use_gui) { - pars.display = lyx::graphics::NoDisplay; + if (!use_gui) { + pars.display = graphics::NoDisplay; } return pars; } + + +} // namespace lyx