diff options
author | Oliver Specht <oliver.specht@cib.de> | 2024-03-19 09:19:38 +0100 |
---|---|---|
committer | Thorsten Behrens <thorsten.behrens@allotropia.de> | 2024-04-04 18:36:23 +0200 |
commit | 3bfb3bf0e62ca5a5148009a80f0e1c9cc53446bc (patch) | |
tree | 71e422d0c69c16b4fe67f6ddda79f8b678692d2f | |
parent | Related: tdf#39052 - chart ooxml: export formatted chart titles (diff) | |
download | core-3bfb3bf0e62ca5a5148009a80f0e1c9cc53446bc.tar.gz core-3bfb3bf0e62ca5a5148009a80f0e1c9cc53446bc.zip |
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.extern@allotropia.de>
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
-rw-r--r-- | editeng/source/editeng/impedit4.cxx | 5 | ||||
-rw-r--r-- | sw/source/uibase/shells/textsh.cxx | 9 |
2 files changed, 11 insertions, 3 deletions
diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx index 0baa91957bce..9455d3882d1c 100644 --- a/editeng/source/editeng/impedit4.cxx +++ b/editeng/source/editeng/impedit4.cxx @@ -2683,6 +2683,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 b2d121847736..b3e32caab9d2 100644 --- a/sw/source/uibase/shells/textsh.cxx +++ b/sw/source/uibase/shells/textsh.cxx @@ -871,10 +871,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); } } } |