[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - editeng/source include/vcl vcl/source

Tamás Zolnai tamas.zolnai at collabora.com
Mon Apr 24 18:01:26 UTC 2017


 editeng/source/editeng/impedit2.cxx |    4 +++-
 include/vcl/event.hxx               |    3 ++-
 vcl/source/window/keyevent.cxx      |   10 ++++++++++
 3 files changed, 15 insertions(+), 2 deletions(-)

New commits:
commit 777223a733d6118926f6800e5b13dd4ad7dd7a10
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
Date:   Sun Apr 23 14:55:52 2017 +0200

    Handle keyinput properly in case of BottomToTop vertical text
    
    Change-Id: I2b0f7cee9a4a7d7ad154c705f84a8b995b4f23a1
    Reviewed-on: https://gerrit.libreoffice.org/36830
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>
    (cherry picked from commit 8c46185bf28f61e674186694e4944c1f8b3a9c00)
    Reviewed-on: https://gerrit.libreoffice.org/36887
    Reviewed-by: Andras Timar <andras.timar at collabora.com>
    Tested-by: Andras Timar <andras.timar at collabora.com>

diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx
index b38db62f411a..c2126570be2b 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -739,8 +739,10 @@ EditSelection ImpEditEngine::MoveCursor( const KeyEvent& rKeyEvent, EditView* pE
     EditPaM aOldPaM( aPaM );
 
     TextDirectionality eTextDirection = TextDirectionality::LeftToRight_TopToBottom;
-    if ( IsVertical() )
+    if (IsVertical() && IsTopToBottom())
         eTextDirection = TextDirectionality::TopToBottom_RightToLeft;
+    else if (IsVertical() && !IsTopToBottom())
+        eTextDirection = TextDirectionality::BottomToTop_LeftToRight;
     else if ( IsRightToLeft( GetEditDoc().GetPos( aPaM.GetNode() ) ) )
         eTextDirection = TextDirectionality::RightToLeft_TopToBottom;
 
diff --git a/include/vcl/event.hxx b/include/vcl/event.hxx
index 9737bac576ec..d2a19435959e 100644
--- a/include/vcl/event.hxx
+++ b/include/vcl/event.hxx
@@ -41,7 +41,8 @@ namespace com { namespace sun { namespace star { namespace awt {
 enum class TextDirectionality {
     LeftToRight_TopToBottom,
     RightToLeft_TopToBottom,
-    TopToBottom_RightToLeft
+    TopToBottom_RightToLeft,
+    BottomToTop_LeftToRight
 };
 
 class VCL_DLLPUBLIC KeyEvent
diff --git a/vcl/source/window/keyevent.cxx b/vcl/source/window/keyevent.cxx
index d644bc3d19c9..f5a7c5b1abe8 100644
--- a/vcl/source/window/keyevent.cxx
+++ b/vcl/source/window/keyevent.cxx
@@ -55,6 +55,16 @@ KeyEvent KeyEvent::LogicalTextDirectionality (TextDirectionality eMode) const
             }
             break;
 
+        case TextDirectionality::BottomToTop_LeftToRight:
+            switch (nCode)
+            {
+                case KEY_DOWN:  aClone.maKeyCode = vcl::KeyCode(KEY_LEFT, nMod); break;
+                case KEY_UP:    aClone.maKeyCode = vcl::KeyCode(KEY_RIGHT, nMod); break;
+                case KEY_LEFT:  aClone.maKeyCode = vcl::KeyCode(KEY_UP, nMod); break;
+                case KEY_RIGHT: aClone.maKeyCode = vcl::KeyCode(KEY_DOWN, nMod); break;
+            }
+            break;
+
         case TextDirectionality::LeftToRight_TopToBottom:
             /* do nothing */
             break;


More information about the Libreoffice-commits mailing list