summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuergen Funk <juergen.funk_ml@cib.de>2014-09-17 16:31:20 +0200
committerSamuel Mehrbrodt <s.mehrbrodt@gmail.com>2014-09-22 08:01:57 +0000
commitd58bea0ffa2a2fe79103ab7aa743aea63e27a0fd (patch)
treec297c1cb8e539dd0c5724039c8ee416cbbf1304d
parent6528a6ab7bee98503be763bcae7c57a4d0129ca1 (diff)
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@gmail.com> Tested-by: Samuel Mehrbrodt <s.mehrbrodt@gmail.com>
-rw-r--r--sw/inc/crsrsh.hxx4
-rw-r--r--sw/source/core/crsr/crsrsh.cxx14
-rw-r--r--sw/source/core/crsr/crstrvl.cxx4
3 files changed, 13 insertions, 9 deletions
diff --git a/sw/inc/crsrsh.hxx b/sw/inc/crsrsh.hxx
index 93083005e06f..2fd984172ba1 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 9a7fa97ed6b2..608aff0291f0 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 18608424398a..c956ecee5869 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 |