Fix paragraph spacing

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2562 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Dekel Tsur 2001-08-20 19:08:46 +00:00
parent 7e7a107039
commit 32ef0d04c4
4 changed files with 32 additions and 20 deletions

View File

@ -1,3 +1,8 @@
2001-08-20 Dekel Tsur <dekelts@tau.ac.il>
* Spacing.h (Spacing): Set space to Default on in the default
constructor.
2001-08-19 Lars Gullik Bjønnes <larsbj@birdstep.com> 2001-08-19 Lars Gullik Bjønnes <larsbj@birdstep.com>
* vc-backend.h (RCS::versionString): add RCS to version * vc-backend.h (RCS::versionString): add RCS to version

View File

@ -37,7 +37,7 @@ public:
Default Default
}; };
/// ///
Spacing() : space(Single), value(1.0) {} Spacing() : space(Default), value(1.0) {}
/// ///
Spacing(Spacing::Space sp, float val = 1.0) { Spacing(Spacing::Space sp, float val = 1.0) {
set(sp, val); set(sp, val);

View File

@ -1,3 +1,8 @@
2001-08-20 Dekel Tsur <dekelts@tau.ac.il>
* FormParagraph.C (general_apply): Handle default spacing.
(general_update): Ditto.
2001-08-20 Angus Leeming <a.leeming@ic.ac.uk> 2001-08-20 Angus Leeming <a.leeming@ic.ac.uk>
* FormBibtex.C: * FormBibtex.C:

View File

@ -127,7 +127,7 @@ void FormParagraph::build()
"| Medskip | Bigskip | VFill | Length ")); "| Medskip | Bigskip | VFill | Length "));
fl_addto_choice(general_->choice_linespacing, fl_addto_choice(general_->choice_linespacing,
_(" Single | OneHalf | Double | Other ")); _(" Default | Single | OneHalf | Double | Other "));
fl_set_input_return(general_->input_space_above, FL_RETURN_CHANGED); fl_set_input_return(general_->input_space_above, FL_RETURN_CHANGED);
fl_set_input_return(general_->input_space_below, FL_RETURN_CHANGED); fl_set_input_return(general_->input_space_below, FL_RETURN_CHANGED);
@ -192,8 +192,6 @@ void FormParagraph::general_apply()
LyXAlignment align; LyXAlignment align;
string labelwidthstring; string labelwidthstring;
bool noindent; bool noindent;
Spacing::Space linespacing;
string other_linespacing;
// If a vspace kind is "Length" but there's no text in // If a vspace kind is "Length" but there's no text in
// the input field, reset the kind to "None". // the input field, reset the kind to "None".
@ -277,11 +275,14 @@ void FormParagraph::general_apply()
labelwidthstring = fl_get_input(general_->input_labelwidth); labelwidthstring = fl_get_input(general_->input_labelwidth);
noindent = fl_get_button(general_->check_noindent); noindent = fl_get_button(general_->check_noindent);
Spacing::Space linespacing;
string other_linespacing;
switch (fl_get_choice(general_->choice_linespacing)) { switch (fl_get_choice(general_->choice_linespacing)) {
case 1: linespacing = Spacing::Single; break; case 1: linespacing = Spacing::Default; break;
case 2: linespacing = Spacing::Onehalf; break; case 2: linespacing = Spacing::Single; break;
case 3: linespacing = Spacing::Double; break; case 3: linespacing = Spacing::Onehalf; break;
case 4: case 4: linespacing = Spacing::Double; break;
case 5:
linespacing = Spacing::Other; linespacing = Spacing::Other;
other_linespacing = fl_get_input(general_->input_linespacing); other_linespacing = fl_get_input(general_->input_linespacing);
break; break;
@ -358,22 +359,23 @@ void FormParagraph::general_update()
int linespacing; int linespacing;
Spacing space = par_->params().spacing(); Spacing space = par_->params().spacing();
/*
switch (lv_->buffer()->params.spacing.getSpace()) { switch (lv_->buffer()->params.spacing.getSpace()) {
case Spacing::Single: linespacing = 1; break; case Spacing::Default: linespacing = 1; break;
case Spacing::Onehalf: linespacing = 2; break; case Spacing::Single: linespacing = 2; break;
case Spacing::Double: linespacing = 3; break; case Spacing::Onehalf: linespacing = 3; break;
case Spacing::Other: linespacing = 4; break; case Spacing::Double: linespacing = 4; break;
case Spacing::Other: linespacing = 5; break;
} }
*/
switch (space.getSpace()) { switch (space.getSpace()) {
case Spacing::Single: linespacing = 1; break; case Spacing::Default: linespacing = 1; break;
case Spacing::Onehalf: linespacing = 2; break; case Spacing::Single: linespacing = 2; break;
case Spacing::Double: linespacing = 3; break; case Spacing::Onehalf: linespacing = 3; break;
case Spacing::Other: linespacing = 4; break; case Spacing::Double: linespacing = 4; break;
case Spacing::Default: case Spacing::Other: linespacing = 5; break;
space = lv_->buffer()->params.spacing;
break;
} }
fl_set_choice(general_->choice_linespacing, linespacing); fl_set_choice(general_->choice_linespacing, linespacing);
if (space.getSpace() == Spacing::Other) { if (space.getSpace() == Spacing::Other) {