https://bugs.freedesktop.org/show_bug.cgi?id=78150

Julien Nabet <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]

--- Comment #1 from Julien Nabet <[email protected]> ---
It seems it was working before thanks to a bug.
Here is why:
- function called by Ctrl backspace is SwWrtShell::DelPrvWord in 
Indeed:sw/source/core/uibase/wrtsh/delete.cxx
(see
http://opengrok.libreoffice.org/xref/core/sw/source/core/uibase/wrtsh/delete.cxx#508)
- it calls SwCrsrShell::ExtendSelection from sw/source/core/crsr/crsrsh.cxx
    528                 if( ++n )
    529                     ExtendSelection( false, -n );
Goal and params of this function:
/** extend current SSelection by n characters

    @param bEnd   Start counting from the end? From start otherwise.
    @param nCount Number of characters.
*/
but in 4.2, this function is defined like this:
sal_Bool SwCrsrShell::ExtendSelection( sal_Bool bEnd, xub_StrLen nCount )
whereas in master sources:
2296 bool SwCrsrShell::ExtendSelection( bool bEnd, sal_Int32 nCount )
(see
http://opengrok.libreoffice.org/xref/core/sw/source/core/crsr/crsrsh.cxx#2296)

but xub_StrLen was unsigned so -1 for example was converted in 65535

I'm not sure but it seems ExtendSelection expects the second parameter to be
not negative since we have this:
   2306     if( bEnd )
   2307     {
   2308         if ((nPos + nCount) <= pTxtNd->GetTxt().getLength())
   2309             nPos = nPos + nCount;
   2310         else
   2311             return false; // not possible
   2312     }
   2313     else if( nPos >= nCount )
   2314         nPos = nPos - nCount;

So it seems DelPrvWord should be changed.

I must keep on investigation cause "// skip over all spaces" means here" is not
very clear. Which spaces? Those before or those after the word to delete?

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to