On Wed, Oct 04, 2006 at 09:14:34PM +0200, Georg Baum wrote:
> Am Mittwoch, 4. Oktober 2006 16:54 schrieb Enrico Forestieri:
> 
> > Note that Qt3 works ok and that I am not able to set "Cursor follows
> > scrollbar" (I get "E2BIG  There is not sufficient room at *outbuf.").
> 
> If that happpens then expect all sort of breakage.

It only happens when trying to select "Cursor follows scrollbar" and
then pressing "Apply" or "Save". I checked that this is not a problem
on cygwin only, as it occurs on solaris, too.

> > I seem to remember that this setting was crucial(?)
> 
> No. The buffer is definitely too small, but Lars only wanted to increase it 
> if it is needed.

I was referring to "Cursor follows scrollbar" in Qt4. BTW I was able to
set it directly in the preferences file but it continues crashing.

> You have to increase the size in three places in 
> unicode.C.

I needed to bring the buffer size to nothing less than 25000 to avoid
the error. Something fishy is occurring here as normally no more than
a couple of hundreds bytes are used.

> Why don't we have a single constant BTW?

I think you mean like the attached.

-- 
Enrico
Index: src/support/unicode.C
===================================================================
--- src/support/unicode.C       (revision 15227)
+++ src/support/unicode.C       (working copy)
@@ -64,9 +64,10 @@ iconv_convert(iconv_t * cd,
 
        char ICONV_CONST * inbuf = const_cast<char ICONV_CONST 
*>(reinterpret_cast<char const *>(buf));
        size_t inbytesleft = buflen * sizeof(InType);
-       static char out[1000];
+       size_t const outsize = 25000;
+       static char out[outsize];
        char * outbuf = out;
-       size_t outbytesleft = 1000;
+       size_t outbytesleft = outsize;
 
        size_t res = iconv(*cd, &inbuf, &inbytesleft, &outbuf, &outbytesleft);
 
@@ -115,7 +116,7 @@ iconv_convert(iconv_t * cd,
        //lyxerr << std::dec;
        //lyxerr << "Inbytesleft: " << inbytesleft << endl;
        //lyxerr << "Outbytesleft: " << outbytesleft << endl;
-       int bytes = 1000 - outbytesleft;
+       int bytes = outsize - outbytesleft;
 
        RetType const * tmp = reinterpret_cast<RetType const *>(out);
        return std::vector<RetType>(tmp, tmp + bytes / sizeof(RetType));

Reply via email to