On Fri, Aug 30, 2002 at 03:30:28AM +0900, R. Lahaye wrote:
> I did this, because we were continuously translating between the
> GUI-keywords, the LyX-keywords, and the LaTeX keywords. This complicated
> scheme is reduced to the commen GUI - LyX/LaTeX conversion, using a
> Translator for that.
> 
> Patch attached.

I like the idea but not really the implementation. I.e there are two or
three places of switches like that:

-       int const origin_pos = fl_get_choice(extra_->choice_origin);
-       igp.rotateOrigin = origins_[origin_pos-1];
+       switch (fl_get_choice(extra_->choice_origin)) {
+               case 11: igp.origin = frnt::RightBottom; break;
+               case 10: igp.origin = frnt::RightTop; break;
+               case  9: igp.origin = frnt::RightBaseline; break;
+               case  8: igp.origin = frnt::LeftBottom; break;
+               case  7: igp.origin = frnt::LeftTop; break;
+               case  6: igp.origin = frnt::LeftBaseline; break;
+               case  5: igp.origin = frnt::CenterBottom; break;
+               case  4: igp.origin = frnt::CenterTop; break;
+               case  3: igp.origin = frnt::CenterBaseline; break;
+               case  2: igp.origin = frnt::Center; break;
+               case  1:
+               default:  igp.origin = frnt::DefaultOrigin;
+       }

As enums could be explicitly converted to ints I don't think they are
necessary. 

Andre'

-- 
Those who desire to give up Freedom in order to gain Security,
will not have, nor do they deserve, either one. (T. Jefferson)

Reply via email to