X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FSpacing.C;h=1bbb945f9f48e51ad0f743c3d2c349c9ca4f1f3b;hb=98c966c64594611e469313314abd1e59524adb4a;hp=103eb91fdcb0689cac04f3719037859f50b54a8f;hpb=83acbbd5237373926c629855379e1df9a04209b2;p=lyx.git diff --git a/src/Spacing.C b/src/Spacing.C index 103eb91fdc..1bbb945f9f 100644 --- a/src/Spacing.C +++ b/src/Spacing.C @@ -1,8 +1,8 @@ /* This file is part of - * ====================================================== - * + * ====================================================== + * * LyX, The Document Processor - * + * * Copyright 1995 Matthias Ettrich * Copyright 1995-2001 The LyX Team. * @@ -21,15 +21,10 @@ using std::ios; using std::ostream; -/// how can I put this inside of Spacing (class) -namespace { - -char const * const spacing_string[] = {"single", "onehalf", "double", "other"}; - -} // namespace anon +string const Spacing::spacing_string[] + = {"single", "onehalf", "double", "other"}; - -float Spacing::getValue() const +float Spacing::getValue() const { switch (space) { case Default: // nothing special should happen with this... @@ -58,7 +53,7 @@ void Spacing::set(Spacing::Space sp, float val) void Spacing::set(Spacing::Space sp, string const & val) { - float fval; + float fval = 0.0; istringstream istr(val.c_str()); istr >> fval; set(sp, fval); @@ -68,9 +63,9 @@ void Spacing::set(Spacing::Space sp, string const & val) 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); @@ -78,7 +73,7 @@ void Spacing::writeFile(ostream & os, bool para) const << " " << getValue() << " \n"; } else { os << cmd << spacing_string[getSpace()] << " \n"; - } + } }