Abdelrazak Younes wrote:

> Georg Baum wrote:
>> Yes. You store now the data twice, and it is not synchronised.
> 
> If you mean data_ and QLyXKeySym, it was like this before, I am just
> mapping functionalities with the old code. Port first, cleanup second.
> If you mean argument and data_, then no, nothing is stored in arument
> anymore.

Yes, I mean argument and data_. Maybe nothing is stored for that particular
lfun in argument anymore, but others do still use argument.
You did not change getArg(), and you also forgot to adjust operator==. Adhoc
changes like that are calling for bugs.

>> Wait a bit, I am currently compiling an alternative.

Here is the patch. The interesting bit is at the beginning: I added
conversion functions from and to utf8 to docstring.h, and some comparison
operators for ASCII strings.
Then I changed the type of FuncRequest::argument to docstring, made it
private (as it always should have been) and added an accessor.
Then I added a lot of lyx::to_utf8() to fix the compile errors. Of course we
do now have a lot more conversions than before, but these will either go
away when more strings are converted to docstring, or can be changed to
lyx::to_ascii() when we know that only ascii contents is stored.

The plan is to use lyx::to_utf8() and lyx::from_utf8() only during the
transition period and remove them afterwards, but for now we definitely
need something like that because juggling with vectors all over the place
is too cumbersome.

I will put this in tomorrow unless I get objections.


Georg

Log:

convert lfun arguments to docstring
        * src/support/docstring.[Ch]
        (from_ascii): new conversion function
        (from_utf8): new conversion function
        (to_utf8): new conversion function
        (operator==) new, compare docstring and ASCII C string
        (operator!=) new, compare docstring and ASCII C string

        * src/support/Makefile.am: add new file docstring.C

        * development/scons/scons_manifest.py: ditto

        * src/funcrequest.[Ch]
        (argument): change name to argument_ and type to docstring,
        add an accessor
        (FuncRequest): Add two new constructors taking a docstring argument

        * all other files: adjust to the FuncRequest changes above

Attachment: x.diff.bz2
Description: BZip2 compressed data

Reply via email to