+/* This file is part of
+ * ======================================================
+ *
+ * LyX, The Document Processor
+ *
+ * Copyright 1995 Matthias Ettrich
+ * Copyright 1995-2000 The LyX Team.
+ *
+ * ====================================================== */
+
#include <config.h>
+#ifdef __GNUG__
+#pragma implementation
+#endif
#ifdef HAVE_SSTREAM
#include <sstream>
using std::istringstream;
+using std::ostringstream;
#else
#include <strstream>
#endif
os << cmd << spacing_string[getSpace()] << " \n";
}
}
+
+
+string Spacing::writeEnvirBegin() const
+{
+ switch(space) {
+ case Default: break; // do nothing
+ case Single:
+ return "\\begin{singlespace}";
+ case Onehalf:
+ return "\\begin{onehalfspace}";
+ case Double:
+ return "\\begin{doublespace}";
+ case Other:
+#ifdef HAVE_SSTREAM
+ ostringstream ost;
+ ost << "\\begin{spacing}{"
+ << getValue() << "}";
+ return ost.str().c_str();
+#else
+ {
+ char tmp[512];
+ ostrstream ost(tmp, 512);
+ ost << "\\begin{spacing}{"
+ << getValue() << "}";
+ return ost.str();
+ }
+#endif
+ }
+ return string();
+}
+
+
+string Spacing::writeEnvirEnd() const
+{
+ switch(space) {
+ case Default: break; // do nothing
+ case Single:
+ return "\\end{singlespace}";
+ case Onehalf:
+ return "\\end{onehalfspace}";
+ case Double:
+ return "\\end{doublespace}";
+ case Other:
+ return "\\end{spacing}";
+ }
+ return string();
+}