sw/source/uibase/shells/textsh.cxx |   15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

New commits:
commit f5c3296eca92e8dd6b3bdf7410dd5a636a197d10
Author:     Oliver Specht <oliver.spe...@cib.de>
AuthorDate: Thu Jan 18 15:48:04 2024 +0100
Commit:     Thorsten Behrens <thorsten.behr...@allotropia.de>
CommitDate: Wed Feb 14 09:26:09 2024 +0100

    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.st...@allotropia.de>
    (cherry picked from commit 3d01c4ee56e0435815977b1717c84b1a2c233bfc)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163338
    Reviewed-by: Thorsten Behrens <thorsten.behr...@allotropia.de>

diff --git a/sw/source/uibase/shells/textsh.cxx 
b/sw/source/uibase/shells/textsh.cxx
index 0924935b3d7e..97de98540151 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) :

Reply via email to