Strange loop in SwDoc::GetExtTextInput

Matteo Casalin matteo.casalin at yahoo.com
Tue Aug 27 05:50:32 PDT 2013


Hi Michael

On Tue, 27 Aug 2013 14:15:38 +0200
Michael Stahl <mstahl at redhat.com> wrote:

> On 26/08/13 12:55, Matteo Casalin wrote:
> > Hi all,
> >       I stumbled upon the following loop [1] on a Ring, which seems 
> > wrong to me:
> > 
> > SwExtTextInput* pTmp = (SwExtTextInput*)mpExtInputRing;
> > do {
> >      //
> >      // do something that does not modify pTmp nor mpExtInputRing
> >      //
> > } while( mpExtInputRing != (pTmp = (SwExtTextInput*)mpExtInputRing ) );
> > 
> > from my understanding it processes just mpExtInputRing item and then 
> > exits. I think that it should be something like:
> > 
> > do {
> >      //
> >      // do something
> >      //
> >      pTmp = (SwExtTextInput*)pTmp->GetNext();
> > } while( pTmp!=mpExtInputRing );
> > 
> > Am I missing something, is the loop to to be fixed as suggested of to be 
> > removed completely?
> 
> i think you are completely right, although i don't know why that
> extended-input stuff would bother with rings in the first place - does
> anybody really use input methods in multiple places simultaneously, or
> what is the point of that?
> 

I will submit a patch for the loop, although it will take some days.
I don't know the details and, if I remember correctly, that code is quite old, so it can be something that is outdated.
Thanks!
Matteo

> 
> _______________________________________________
> LibreOffice mailing list
> LibreOffice at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/libreoffice


More information about the LibreOffice mailing list