/* This file is part of
* =================================================
- *
+ *
* LyX, The Document Processor
* Copyright 1995 Matthias Ettrich.
* Copyright 1995-2001 The LyX Team.
*
* ================================================= */
-#include <config.h>
+#include <config.h>
#ifdef __GNUG__
#pragma implementation
-#endif
+#endif
#include "insetgraphicsParams.h"
// it is obselete until 1.3
LyXLength convertResizeValue(string const token, LyXLex & lex) {
lex.next();
- string value = lex.getString(); // "width" or "height"
+ string value = lex.getString(); // "width" or "height"
lex.next(); // anyway not interesting
value = lex.getString();
if (token == "default")
else if (token == "inch")
return (LyXLength(value+"in"));
else if (token == "percentOfColumn")
- return (LyXLength(value+"c%"));
+ return (LyXLength(value+"col%"));
else if (token == "percentOfPage")
- return (LyXLength(value+"p%"));
+ return (LyXLength(value+"page%"));
else return LyXLength("0pt"); // nothing with figinset
}
size_type = DEFAULT_SIZE; // do nothing
lyxsize_type = DEFAULT_SIZE; // do nothing
keepAspectRatio = false; // only for latex
- rotate = false; // Rotating
+ rotate = false; // Rotating
rotateOrigin = "center"; // Origin
rotateAngle = 0.0; // in degrees
special = string(); // userdefined stuff
}
bool operator==(InsetGraphicsParams const & left,
- InsetGraphicsParams const & right)
+ InsetGraphicsParams const & right)
{
if (left.filename == right.filename &&
- left.bb == right.bb &&
- left.draft == right.draft &&
- left.clip == right.clip &&
- left.display == right.display &&
- left.subcaption == right.subcaption &&
+ left.bb == right.bb &&
+ left.draft == right.draft &&
+ left.clip == right.clip &&
+ left.display == right.display &&
+ left.subcaption == right.subcaption &&
left.noUnzip == right.noUnzip &&
- left.subcaptionText == right.subcaptionText &&
- left.keepAspectRatio == right.keepAspectRatio &&
- left.width == right.width &&
- left.height == right.height &&
- left.scale == right.scale &&
- left.size_type == right.size_type &&
- left.lyxsize_type == right.lyxsize_type &&
- left.lyxwidth == right.lyxwidth &&
- left.lyxheight == right.lyxheight &&
- left.lyxscale == right.lyxscale &&
- left.rotate == right.rotate &&
- left.rotateOrigin == right.rotateOrigin &&
- lyx::float_equal(left.rotateAngle, right.rotateAngle, 0.001 &&
- left.special == right.special)
+ left.subcaptionText == right.subcaptionText &&
+ left.keepAspectRatio == right.keepAspectRatio &&
+ left.width == right.width &&
+ left.height == right.height &&
+ left.scale == right.scale &&
+ left.size_type == right.size_type &&
+ left.lyxsize_type == right.lyxsize_type &&
+ left.lyxwidth == right.lyxwidth &&
+ left.lyxheight == right.lyxheight &&
+ left.lyxscale == right.lyxscale &&
+ left.rotate == right.rotate &&
+ left.rotateOrigin == right.rotateOrigin &&
+ lyx::float_equal(left.rotateAngle, right.rotateAngle, 0.001 &&
+ left.special == right.special)
)
return true;
}
bool operator!=(InsetGraphicsParams const & left,
- InsetGraphicsParams const & right)
+ InsetGraphicsParams const & right)
{
- return !(left == right);
+ return !(left == right);
}
-void InsetGraphicsParams::Write(Buffer const * buf, ostream & os) const
+void InsetGraphicsParams::Write(ostream & os) const
{
// If there is no filename, write nothing for it.
- if (! filename.empty()) {
- os << "\tfilename "
- << MakeRelPath(filename, buf->filePath())
- << '\n';
+ if (!filename.empty()) {
+ os << "\tfilename " << filename << '\n';
}
if (!bb.empty()) // bounding box
os << "\tBoundingBox " << bb << '\n';
}
-bool InsetGraphicsParams::Read(Buffer const * buf, LyXLex & lex,
- string const& token)
+bool InsetGraphicsParams::Read(LyXLex & lex, string const& token)
{
if (token == "filename") {
lex.next();
filename = lex.getString();
- if (!filename.empty()) {
- // Make the filename with absolute directory.
- filename = MakeAbsPath(filename, buf->filePath());
- }
} else if (token == "BoundingBox") {
for (int i=0; i<4 ;i++) {
lex.next();