[Libreoffice-commits] core.git: sw/inc sw/source

Juergen Funk juergen.funk_ml at cib.de
Mon Sep 22 01:02:36 PDT 2014


 sw/inc/crsrsh.hxx               |    4 ++--
 sw/source/core/crsr/crsrsh.cxx  |   14 +++++++++-----
 sw/source/core/crsr/crstrvl.cxx |    4 ++--
 3 files changed, 13 insertions(+), 9 deletions(-)

New commits:
commit d58bea0ffa2a2fe79103ab7aa743aea63e27a0fd
Author: Juergen Funk <juergen.funk_ml at cib.de>
Date:   Wed Sep 17 16:31:20 2014 +0200

    Fix fdo#38884 Improve Up/Down movement in writer
    
    
    - It was provided, but the X-Position was reset after the cursor Up/Down
    
    - But in the Table is the X-Position not right -> other bug
    
    Change-Id: I2d70b7dc4ffa1e2612330d9b30ea5d916f5a9439
    Reviewed-on: https://gerrit.libreoffice.org/11500
    Reviewed-by: Samuel Mehrbrodt <s.mehrbrodt at gmail.com>
    Tested-by: Samuel Mehrbrodt <s.mehrbrodt at gmail.com>

diff --git a/sw/inc/crsrsh.hxx b/sw/inc/crsrsh.hxx
index 9308300..2fd9841 100644
--- a/sw/inc/crsrsh.hxx
+++ b/sw/inc/crsrsh.hxx
@@ -352,7 +352,7 @@ public:
     // start parenthesing, hide SV-Cursor and selected areas
     void StartAction();
     // end parenthesing, show SV-Cursor and selected areas
-    void EndAction( const bool bIdleEnd = false );
+    void EndAction( const bool bIdleEnd = false, const bool DoSetPosX = false );
 
     // basic cursor travelling
     long GetUpDownX() const             { return m_nUpDownX; }
@@ -453,7 +453,7 @@ public:
 #else
     void SttCrsrMove() { ++m_nCrsrMove; StartAction(); }
     void EndCrsrMove( const bool bIdleEnd = false )
-            { EndAction( bIdleEnd ); --m_nCrsrMove; }
+            { EndAction( bIdleEnd, true ); --m_nCrsrMove; }
 #endif
 
     /*
diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index 9a7fa97..608aff0 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -229,11 +229,16 @@ void SwCrsrShell::StartAction()
     SwViewShell::StartAction(); // to the SwViewShell
 }
 
-void SwCrsrShell::EndAction( const bool bIdleEnd )
+void SwCrsrShell::EndAction( const bool bIdleEnd, const bool DoSetPosX )
 {
     comphelper::FlagRestorationGuard g(mbSelectAll, StartsWithTable() && ExtendedSelectedAll(/*bFootnotes =*/ false));
     bool bVis = m_bSVCrsrVis;
 
+    sal_uInt16 eFlags = SwCrsrShell::CHKRANGE;
+    if ( !DoSetPosX )
+        eFlags |= SwCrsrShell::UPDOWN;
+
+
     // Idle-formatting?
     if( bIdleEnd && Imp()->GetRegion() )
     {
@@ -267,7 +272,7 @@ void SwCrsrShell::EndAction( const bool bIdleEnd )
             // Within a Basic action, one needs to update the cursor,
             // to e.g. create the table cursor. This is being done in
             // UpdateCrsr.
-            UpdateCrsr( SwCrsrShell::CHKRANGE, bIdleEnd );
+            UpdateCrsr( eFlags, bIdleEnd );
 
             {
                 // watch Crsr-Moves, call Link if needed, the DTOR is key here!
@@ -284,11 +289,10 @@ void SwCrsrShell::EndAction( const bool bIdleEnd )
         return;
     }
 
-    sal_uInt16 nParm = SwCrsrShell::CHKRANGE;
     if ( !bIdleEnd )
-        nParm |= SwCrsrShell::SCROLLWIN;
+        eFlags |= SwCrsrShell::SCROLLWIN;
 
-    UpdateCrsr( nParm, bIdleEnd );      // Show Cursor changes
+    UpdateCrsr( eFlags, bIdleEnd );      // Show Cursor changes
 
     {
         SwCallLink aLk( *this );        // watch Crsr-Moves
diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx
index 1860842..c956ece 100644
--- a/sw/source/core/crsr/crstrvl.cxx
+++ b/sw/source/core/crsr/crstrvl.cxx
@@ -87,12 +87,12 @@ void SwCrsrShell::MoveCrsrToNum()
     if( pFrm->IsVertical() )
     {
         aPt.setX(m_aCharRect.Center().getX());
-        aPt.setY(pFrm->Frm().Top() + m_nUpDownX);
+        aPt.setY(pFrm->Frm().Top() + GetUpDownX());
     }
     else
     {
         aPt.setY(m_aCharRect.Center().getY());
-        aPt.setX(pFrm->Frm().Left() + m_nUpDownX);
+        aPt.setX(pFrm->Frm().Left() + GetUpDownX());
     }
     pFrm->GetCrsrOfst( m_pCurCrsr->GetPoint(), aPt );
     if ( !m_pCurCrsr->IsSelOvr( nsSwCursorSelOverFlags::SELOVER_TOGGLE |


More information about the Libreoffice-commits mailing list