summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorOliver Specht <oliver.specht@cib.de>2024-01-18 15:48:04 +0100
committerThorsten Behrens <thorsten.behrens@allotropia.de>2024-02-14 00:52:53 +0100
commit125fc2ce861c82592b261f2992c893b414396e56 (patch)
treed97f18d066f9ddc00a3df52abc5f3095d3d9322f /sw
parent5ae5728350e7b7b0392df2b3e27f55c6611f842e (diff)
tdf#63259 rotate case also at start/end of a word
Rotate either rotates the selection or the word the cursor is directly before, inside or directly after Change-Id: Ia21e3120d2b00978b9f4ce06738b42e90d2ada62 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162256 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/uibase/shells/textsh.cxx15
1 files changed, 14 insertions, 1 deletions
diff --git a/sw/source/uibase/shells/textsh.cxx b/sw/source/uibase/shells/textsh.cxx
index c2d1d44068d9..c743ee3ffed7 100644
--- a/sw/source/uibase/shells/textsh.cxx
+++ b/sw/source/uibase/shells/textsh.cxx
@@ -877,7 +877,20 @@ void SwTextShell::ExecTransliteration( SfxRequest const & rReq )
void SwTextShell::ExecRotateTransliteration( SfxRequest const & rReq )
{
if( rReq.GetSlot() == SID_TRANSLITERATE_ROTATE_CASE )
- GetShell().TransliterateText( m_aRotateCase.getNextMode() );
+ {
+ SwWrtShell& rSh = GetShell();
+ if (rSh.HasSelection())
+ {
+ rSh.TransliterateText(m_aRotateCase.getNextMode());
+ }
+ else
+ {
+ rSh.Push(); // save cur cursor
+ if ((rSh.IsEndWrd() || rSh.IsStartWord() || rSh.IsInWord()) && rSh.SelWrd())
+ rSh.TransliterateText(m_aRotateCase.getNextMode());
+ rSh.Pop(SwCursorShell::PopMode::DeleteCurrent);
+ }
+ }
}
SwTextShell::SwTextShell(SwView &_rView) :