Re: Patch: Fix for Bug 1164, 2nd try


Subject: Re: Patch: Fix for Bug 1164, 2nd try
From: Vlad Harchev (hvv@hippo.ru)
Date: Tue May 22 2001 - 04:49:19 CDT


On Tue, 22 May 2001, ha shao wrote:

> On Tue, May 22, 2001 at 12:52:30PM +0500, hvv@hippo.ru wrote:
> > On Tue, 22 May 2001, ha shao wrote:
> > The code in AW 0.7.14 is
> > if (no_convert==0 && ch<=0xff)
> > {
> > wchar_t wc;
> > if (m_mbtowc.mbtowc(wc,(UT_Byte)ch))
> > return AddChar(wc);
> > } else
> > return AddChar(ch);
> >
> > I don't see how 'else' can reset buffer (AddChar(ch) doesn't reset it
> > either). Or did RTF importer change there since 0.7.14?
> >
>
> Yes, the current cvs read:
> =================================================================
> if (no_convert==0 && ch<=0xff)
> {
> wchar_t wc;
> // TODO Doesn't handle multibyte encodings (
> CJK)
> if (m_mbtowc.mbtowc(wc,(UT_Byte)ch))
> return AddChar(wc);
> else
> m_mbtowc.initialize();
> } else
> return AddChar(ch);
> }
> ==================================================================

 Thanks for quoting it. Yes, "else m_mbtowc.initialize();" and the "//TODO"
should be removed (comment was also absent in 0.7.14).
 
> > > Beside, since the AddChar(ch) does not actually insert the
> > > character into the document (as suggested in its definition),
> > > can we just add the mb into a buffer and call m_mbtowc.mbtowc()
> > > at the beginning of FlushStoredChars?
> >
> > I think it would be troublesome. Is there are any reasons why the way you
> > propose may be better than current implementation (besides performance)?
> >
>
> yes, performance, and maybe safer. anyway, it is a mirror point.

 So it seems nothing needs to be changed..

> --
> Best regard
> hashao
>

 Best regards,
  -Vlad



This archive was generated by hypermail 2b25 : Sat May 26 2001 - 03:51:06 CDT