editeng/source/editeng/impedit4.cxx | 5 +++++ sw/source/uibase/shells/textsh.cxx | 9 ++++++--- 2 files changed, 11 insertions(+), 3 deletions(-)
New commits: commit ec5898cb245c68cf116a22b3714408e4a96ee15d Author: Oliver Specht <oliver.spe...@cib.de> AuthorDate: Tue Mar 19 09:19:38 2024 +0100 Commit: Thorsten Behrens <thorsten.behr...@allotropia.de> CommitDate: Thu Apr 4 17:27:02 2024 +0200 tdf#63259 cycle case on sentences Cycle case will be applied to the sentence if the cursor is at a sentence end. Writer now also keeps the word/sentence selection after case change. Change-Id: I9dd561775ac612689526bcb118533ba81b5722be Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165018 Tested-by: Jenkins Tested-by: Gabor Kelemen <gabor.kelemen.ext...@allotropia.de> Reviewed-by: Thorsten Behrens <thorsten.behr...@allotropia.de> diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx index b7e322b68ccd..b7d4be999016 100644 --- a/editeng/source/editeng/impedit4.cxx +++ b/editeng/source/editeng/impedit4.cxx @@ -2711,6 +2711,11 @@ EditSelection ImpEditEngine::TransliterateText( const EditSelection& rSelection, if ( !aSel.HasRange() ) { aSel = SelectWord( aSel, css::i18n::WordType::ANYWORD_IGNOREWHITESPACES, true, true ); + if (!aSel.HasRange() && aSel.Min().GetIndex() > 0 && + OUString(".!?").indexOf(aSel.Min().GetNode()->GetChar(aSel.Min().GetIndex() - 1)) > -1 ) + { + aSel = SelectSentence(aSel); + } } // tdf#107176: if there's still no range, just return aSel diff --git a/sw/source/uibase/shells/textsh.cxx b/sw/source/uibase/shells/textsh.cxx index 5c4713736081..1b1fb47fd1f3 100644 --- a/sw/source/uibase/shells/textsh.cxx +++ b/sw/source/uibase/shells/textsh.cxx @@ -885,10 +885,13 @@ void SwTextShell::ExecRotateTransliteration( SfxRequest const & rReq ) } else { - rSh.Push(); // save cur cursor - if ((rSh.IsEndWrd() || rSh.IsStartWord() || rSh.IsInWord()) && rSh.SelWrd()) + if (rSh.IsEndSentence()) + { + rSh.BwdSentence(true); + rSh.TransliterateText(m_aRotateCase.getNextMode()); + } + else if ((rSh.IsEndWrd() || rSh.IsStartWord() || rSh.IsInWord()) && rSh.SelWrd()) rSh.TransliterateText(m_aRotateCase.getNextMode()); - rSh.Pop(SwCursorShell::PopMode::DeleteCurrent); } } }