On Tuesday 21 January 2003 9:52 am, [EMAIL PROTECTED] wrote:
> Sorry! I forgot to attach the two patches to the previous mail.

Looking through it...
I'm not sure that Lars will enjoy his change of name in so many places ;-)

You have a lot of code like:
+#ifdef I18N
+               wchar_t c = par.getUChar(params, i);
+#else
                char c = par.getUChar(params, i);
+#endif

Would it not be simpler to define a lyx::char_type in support/types.h and use 
that? Then you restrict the changes you have to make in future to one line of 
code only.

xforms/forms/form_preferences.fd:
+#ifdef I18N
+=============== FORM ===============
+Name: form_preferences_cjk_fonts
[snip]
+#endif

I take it that fdesign is happy with these #ifdefs and that the resulting 
xforms/forms/form_preferences.[Ch] that you also include in your patch are 
auto-generated?

graphics/PreviewLoader.C and other places too:
-       PreviewLoader::Status status(string const & latex_snippet) const;
+       PreviewLoader::Statue status(string const & latex_snippet) const;

WHY?

lyxcodeconv.C appears to depend on xforms only to access fl_display. We used 
to have a wrapper in frontends but it appears to have dissappeared.

lyxim.C requires fl_get_pixel also, but that's all. It would seem that it 
should be trivially easy to make these two files ignorant of the GUI although 
they are still extremely dependent upon X of course.

paragraph.C:
It looks like you're making life hard for yourself. Can you not define 
        value_type = wchar_type
in support/types.h
+#ifdef I18N
+               wchar_type const c = getChar(i);
+#else
                value_type const c = getChar(i);
+#endif

support/lyxstring.C
It looks to me that you should not be patching lyxstring.[Ch] like this but 
creating a templatised version that can be specialised to char or wchar_t. 
Alternatively, just copy lyxstring.[Ch] to lyxwstring.[Ch] and make the 
changes there. I do realise that you have managed to use std::string also.

support/textutils.h: use lyx::char_type and lyx_unsigned_char_type and this 
file would need almost no other modification.

Best regards,
Angus

Reply via email to