Writer document Type 'appeltaart' (or something else) Hit Ctrl+Backspace > a remains in the text (Ctrl+Del to erase the word after the cursor, works fine)
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?
If we just want to stick to 4.2 behavior, it seems only the spaces at the end of the word must be removed. eg: if spaces are represented with - and cursor with <> Here is the behaviour of Ctrl Delete in 4.2 in these different cases: 1) --abcde----fgh--<> => --abcde---- 2) --abcde----fgh<>-- => --abcde------ I'll submit for review a patch doing the same thing.
https://gerrit.libreoffice.org/#/c/9245/
Hi Julien, Thanks for looking at this! (In reply to comment #2) > If we just want to stick to 4.2 behavior, it seems only the spaces at the > end of the word must be removed. Seems that this change was unintended too? If so, something to ask on UX? Cheers, Cor
Indeed! I've just tested with LO 4.1.5.3 Debian package and I've got this: 1) --abcde----fgh--<> => --abcde 2) --abcde----fgh<>-- => --abcde--
Cor: I found this patch http://cgit.freedesktop.org/libreoffice/core/commit/?id=083114bb132b879cfb899361ece375c8580ae505 Stefan/Michael: what's the expected behavior here? 1) To remove all the spaces before the word just deleted 2) To remove all the spaces but 1 before the word just deleted 3) To remove no spaces before the word just deleted - https://gerrit.libreoffice.org/#/c/9245/ does 3) - LO 4.1.5.3 does 1) - LO 4.2 sources updated some days ago does 3) (master sources is currently broken since it lets the first character of the delete word) From https://help.libreoffice.org/Writer/Shortcut_Keys_for_Writer: "(Ctrl+Backspace) Delete text to beginning of word In a list: delete an empty paragraph in front of the current paragraph" So should be 3)?
(In reply to comment #6) > > So should be 3)? Sounds clear and convincing. Thanks.
Julien Nabet committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=6651a2493d72f2bd0613b96ee5276a1270709630 Resolves: fdo#78150 Ctrl+Backspace does not erase first character The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Oups, had forgot it. Thank you Michael for having noticed and for your review.
shubham656 committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/a72b6d2df5978c0f43e04432581f4bc62c2c6d8f tdf#78150 Add UnitTest It will be available in 7.3.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.