>>>>> "Peter" == Peter Suetterlin <[EMAIL PROTECTED]> writes:

Peter>   Hi all,

Peter> a really funny thing: If you have a paragraph with a footnote
Peter> somewhere in the paragraph, after the footnote the function
Peter> "word-capitalize" does no longer work.  Neither via shortcut,
Peter> nor when called in the mini-buffer.  Same for -lowcase and
Peter> -upcase.  Other font-functions (as underline) do work without
Peter> problems.

Peter> In the next paragraph, everuthing is fine again.

Peter> Ah, and I just checked: When you open the footnote, the
Peter> functions do work even behind the footnote.

Purify says: LyX is writing outside of the array par->text[] :(

I guess this comes from the fact that cursor.pos is a global par
position, while cursor.par is the physical paragraph (i.e. the third
sub-paragraph if we have a footnote).

Anyway, here is the relevant code from text.C:

/* -------> Upcase characters from cursor to end of word. */
void LyXText::UpcaseWord() 
{
  SetUndo(Undo::FINISH, 
          cursor.par->ParFromPos(cursor.pos)->previous,
          cursor.par->ParFromPos(cursor.pos)->next); 

        while (cursor.pos < cursor.par->Last()
        && !cursor.par->IsSeparator(cursor.pos) 
        && !cursor.par->IsKomma(cursor.pos) ) {
                 if (cursor.par->GetChar(cursor.pos) != LYX_META_INSET)
                    cursor.par->text[cursor.pos] =
                            toupper((unsigned char) cursor.par->text[cursor.pos]);
                CursorRight();
        }
        CheckParagraph(cursor.par, cursor.pos);
        CursorRightOneWord();
}

And appended is the relevant purify log. I really thing we should fix
this, since it can potentially do much harm to the data structure. I
did half the work, now somebody should finish it :)

JMarc

------------------------------------------------------------------
****  Purify instrumented ./lyx_pur (pid 3762 at Wed Dec 16 18:14:42 1998)
  * Purify 4.0.1 Solaris 2, Copyright (C) 1992-1996 Pure Atria Corp. All rights 
reserved. 
  * For contact information type: "purify -help"
  * For TTY output, use the option "-windows=no"
  * Command-line: ./lyx_pur 
  * Options settings: -g++=yes -purify \
    -purify-home=/usr/local/pure/purify-4.0.1 
  * Purify licensed to INRIA
  * Purify checking enabled.

****  Purify instrumented ./lyx_pur (pid 3762)  ****
[snip]

****  Purify instrumented ./lyx_pur (pid 3762)  ****
ABR: Array bounds read (6 times):
  * This is occurring while in:
        LyXText::UpcaseWord() [text.C:2878]
        LyXFunc::Dispatch(int,const char*) [lyxfunc.C:1178]
        LyXFunc::processKeyEvent(_XEvent*) [lyxfunc.C:319]
        LyXView::KeyPressMask_raw_callback(forms_*,void*) [LyXView.C:337]
        do_interaction_step [forms.c]
        fl_treat_interaction_events [libforms.a]
  * Reading 1 byte from 0x4b13c3 in the heap.
  * Address 0x4b13c3 is 2 bytes past end of a malloc'd block at 0x4b13b8 of 10 bytes.
  * This block was allocated from:
        malloc         [rtlib.o]
        __bUiLtIn_nEw  [libgcc.a]
        __builtin_new  [rtlib.o]
        __bUiLtIn_vEc_nEw [libgcc.a]
        __builtin_vec_new [rtlib.o]
        LyXParagraph::LyXParagraph() [paragraph.C:65]

****  Purify instrumented ./lyx_pur (pid 3762)  ****
ABW: Array bounds write (6 times):
  * This is occurring while in:
        LyXText::UpcaseWord() [text.C:2878]
        LyXFunc::Dispatch(int,const char*) [lyxfunc.C:1178]
        LyXFunc::processKeyEvent(_XEvent*) [lyxfunc.C:319]
        LyXView::KeyPressMask_raw_callback(forms_*,void*) [LyXView.C:337]
        do_interaction_step [forms.c]
        fl_treat_interaction_events [libforms.a]
  * Writing 1 byte to 0x4b13c3 in the heap.
  * Address 0x4b13c3 is 2 bytes past end of a malloc'd block at 0x4b13b8 of 10 bytes.
  * This block was allocated from:
        malloc         [rtlib.o]
        __bUiLtIn_nEw  [libgcc.a]
        __builtin_new  [rtlib.o]
        __bUiLtIn_vEc_nEw [libgcc.a]
        __builtin_vec_new [rtlib.o]
        LyXParagraph::LyXParagraph() [paragraph.C:65]

Reply via email to