X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FSpacing.C;h=19f9d1fa65fd6ff084b859faed282a6ccc50f1e2;hb=fe4e2a84c664ab13a2cfbfcbdb953d72c77eb268;hp=f76154d361831c1f9366dff571223e75514105c2;hpb=3df345c9383480f68fad51feae8b9c64425c8729;p=lyx.git diff --git a/src/Spacing.C b/src/Spacing.C index f76154d361..19f9d1fa65 100644 --- a/src/Spacing.C +++ b/src/Spacing.C @@ -9,6 +9,7 @@ using std::istringstream; #endif #include "Spacing.h" +#include "LString.h" using std::ios; using std::ostream; @@ -21,6 +22,7 @@ char const * spacing_string[] = {"single", "onehalf", "double", "other"}; float Spacing::getValue() const { switch(space) { + case Default: // nothing special should happen with this... case Single: return 1.0; case Onehalf: return 1.25; case Double: return 1.667; @@ -57,14 +59,18 @@ void Spacing::set(Spacing::Space sp, char const * val) } -void Spacing::writeFile(ostream & os) const +void Spacing::writeFile(ostream & os, bool para) const { + if (space == Default) return; + + string cmd = para ? "\\paragraph_spacing " : "\\spacing "; + if (getSpace() == Spacing::Other) { os.setf(ios::showpoint|ios::fixed); os.precision(2); - os << "\\spacing " << spacing_string[getSpace()] + os << cmd << spacing_string[getSpace()] << " " << getValue() << " \n"; } else { - os << "\\spacing " << spacing_string[getSpace()] << " \n"; + os << cmd << spacing_string[getSpace()] << " \n"; } }