<html>
    <head>
      <base href="https://bugs.documentfoundation.org/">
    </head>
    <body><span class="vcard"><a class="email" href="mailto:mikekaganski@hotmail.com" title="Mike Kaganski <mikekaganski@hotmail.com>"> <span class="fn">Mike Kaganski</span></a>
</span> changed
          <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - !!br0ken!! mysteriously appears in Spellcheck after some steps"
   href="https://bugs.documentfoundation.org/show_bug.cgi?id=116725">bug 116725</a>
          <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">Status</td>
           <td>UNCONFIRMED
           </td>
           <td>NEW
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">CC</td>
           <td>
                
           </td>
           <td>michael.stahl@cib.de
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">Ever confirmed</td>
           <td>
                
           </td>
           <td>1
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - !!br0ken!! mysteriously appears in Spellcheck after some steps"
   href="https://bugs.documentfoundation.org/show_bug.cgi?id=116725#c7">Comment # 7</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - !!br0ken!! mysteriously appears in Spellcheck after some steps"
   href="https://bugs.documentfoundation.org/show_bug.cgi?id=116725">bug 116725</a>
              from <span class="vcard"><a class="email" href="mailto:mikekaganski@hotmail.com" title="Mike Kaganski <mikekaganski@hotmail.com>"> <span class="fn">Mike Kaganski</span></a>
</span></b>
        <pre>Wanted to debug this, and it feels like there's some race condition here.

First, I was able to repro the steps from <a href="show_bug.cgi?id=116725#c0">comment 0</a> (here I reproduce them with
clarification required between original steps 2 and 3):

1. Type 'jarn jarn' on a new sentence.
2. Go on Spellcheck, and in the top box, not the suggestions, replace the
highlighted word 'jarn' to 'jam', so the end result is 'jam jarn'. (The first
jarn might had beed sentence-cased to Jarn; that doesn't matter, and I
reproduced with Jarn->Jam as well).
2.1. Click 'Correct'.
3. For the second 'jarn', change it, in the top box, to 'jam', so that end
result is 'jam jam'.
4. I didn't need the step "Click the greyed-out box 'Always Correct'".
5. Click 'Correct'.

I had the assertion in void SAL_CALL IMPL_RTL_STRINGNAME( newFromSubString )
(sal/rtl/strtmpl.cxx) for condition "beginIndex + count > pFrom->length",
called from TextEngine::GetText( const TextSelection& rSel, LineEnd aSeparator
), called from SentenceEditWindow_Impl::MarkNextError, where the m_nErrorEnd
for some reason stayed 8, when it needed to be 7 already (and that should have
been corrected inside if(pNextError) check).

But after a couple of "successful" (=failing assertions) tests, I now cannot
repro it again. So, my suspicion is that the previous change might not yet
reflect itself in the nodes contents, so that the old length was used for the
end pos...

A simple "fix" (like the one I mentioned in <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - Pasting single FORMCHECKBOX and undoing then redoing gives !!br0ken!! in release builds, asserts in debug builds"
   href="show_bug.cgi?id=104032">bug 104032</a>) would be to simply
change TextEngine::GetText to use something like

<span class="quote">>        if ( nNode == nEndPara ) // may also be == nStart!
>            nEndPos = std::min(nEndPos, aSel.GetEnd().GetIndex());</span >

... because the nEndPos is already equal to length of the string; but I feel
like it's just a workaround trying to fix symptoms rather than the problem.

Maybe Michael Stahl could have some insight here?</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>