#include <config.h>
-#ifdef __GNUG__
-#pragma implementation
-#endif
#include "insetgraphicsParams.h"
#include "lyxrc.h"
#include "debug.h"
#include "lyxlex.h"
+#include "frontends/lyx_gui.h"
using std::ostream;
+
InsetGraphicsParams::InsetGraphicsParams()
{
init();
}
+
InsetGraphicsParams::InsetGraphicsParams(InsetGraphicsParams const & igp)
{
// I decided to skip the initialization since the copy will overwrite
copy(igp);
}
+
InsetGraphicsParams &
InsetGraphicsParams::operator=(InsetGraphicsParams const & params)
{
return *this;
}
+
void InsetGraphicsParams::init()
{
filename.erase();
special.erase(); // additional userdefined stuff
}
+
void InsetGraphicsParams::copy(InsetGraphicsParams const & igp)
{
filename = igp.filename;
special = igp.special;
}
+
bool operator==(InsetGraphicsParams const & left,
InsetGraphicsParams const & right)
{
return false;
}
+
bool operator!=(InsetGraphicsParams const & left,
InsetGraphicsParams const & right)
{
return !(left == right);
}
+
void InsetGraphicsParams::Write(ostream & os) const
{
// Do not write the default values
bb.erase();
for (int i = 0; i < 4; ++i) {
if (i != 0)
- bb += " ";
+ bb += ' ';
lex.next();
bb += lex.getString();
}
} else if (token == "subcaption") {
subcaption = true;
} else if (token == "subcaptionText") {
- lex.next();
- subcaptionText = lex.getString();
+ lex.eatLine();
+ string sub = lex.getString();
+ // strip surrounding " "
+ subcaptionText = sub.substr(1, sub.length() - 2);
} else if (token == "special") {
lex.eatLine();
special = lex.getString();
unsigned int const bb_orig_xl = strToInt(token(tmp, ' ', 0));
unsigned int const bb_orig_yb = strToInt(token(tmp, ' ', 1));
- // new pars.bb values must be >= zero
+ // new pars.bb values must be >= zero
if (pars.bb.xl > bb_orig_xl)
pars.bb.xl -= bb_orig_xl;
else
pars.bb.xl = 0;
-
+
if (pars.bb.xr > bb_orig_xl)
pars.bb.xr -= bb_orig_xl;
else
pars.bb.xr = 0;
-
+
if (pars.bb.yb > bb_orig_yb)
pars.bb.yb -= bb_orig_yb;
else
pars.bb.yb = 0;
-
+
if (pars.bb.yt > bb_orig_yb)
pars.bb.yt -= bb_orig_yb;
else
pars.bb.yt = 0;
}
}
-
+
if (display == grfx::DefaultDisplay) {
pars.display = lyxrc.display_graphics;
} else {
pars.display = display;
}
-
+
// Override the above if we're not using a gui
- if (!lyxrc.use_gui) {
+ if (!lyx_gui::use_gui) {
pars.display = grfx::NoDisplay;
}