diff options
author | Norbert Thiebaud <nthiebaud@gmail.com> | 2012-09-03 19:05:27 -0500 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2012-09-14 07:54:39 +0000 |
commit | c1c12bd160099bb4061aad814368192e396adc3d (patch) | |
tree | 90e4f8f4a84f6985e28b568c91d2414e73b92f48 /svtools/source/table | |
parent | a6754e5a09afd62ae431a279fa30be5e0506ad39 (diff) |
gridfixes: ensure removal of a column in grid control adjusts the cursor
Change-Id: I99be214bf12d340cc5e9330d1c21046dd366b07a
Reviewed-on: https://gerrit.libreoffice.org/554
Reviewed-by: Miklos Vajna <vmiklos@suse.cz>
Tested-by: Miklos Vajna <vmiklos@suse.cz>
Diffstat (limited to 'svtools/source/table')
-rw-r--r-- | svtools/source/table/tablecontrol.cxx | 6 | ||||
-rw-r--r-- | svtools/source/table/tablecontrol_impl.cxx | 10 |
2 files changed, 16 insertions, 0 deletions
diff --git a/svtools/source/table/tablecontrol.cxx b/svtools/source/table/tablecontrol.cxx index 1d1129f8957f..1726ea2b0753 100644 --- a/svtools/source/table/tablecontrol.cxx +++ b/svtools/source/table/tablecontrol.cxx @@ -189,6 +189,12 @@ namespace svt { namespace table } // ----------------------------------------------------------------------------------------------------------------- + bool TableControl::GoTo( ColPos _nColumn, RowPos _nRow ) + { + return m_pImpl->goTo( _nColumn, _nRow ); + } + + // ----------------------------------------------------------------------------------------------------------------- sal_Bool TableControl::GoToCell(sal_Int32 _nColPos, sal_Int32 _nRowPos) { return m_pImpl->goTo( _nColPos, _nRowPos ); diff --git a/svtools/source/table/tablecontrol_impl.cxx b/svtools/source/table/tablecontrol_impl.cxx index aca789e97ad1..17bf7716a64d 100644 --- a/svtools/source/table/tablecontrol_impl.cxx +++ b/svtools/source/table/tablecontrol_impl.cxx @@ -651,6 +651,16 @@ namespace svt { namespace table void TableControl_Impl::columnRemoved( ColPos const i_colIndex ) { m_nColumnCount = m_pModel->getColumnCount(); + + // adjust the current column, if it is larger than the column count now + if ( m_nCurColumn >= m_nColumnCount ) + { + if ( m_nColumnCount > 0 ) + goTo( m_nCurColumn - 1, m_nCurRow ); + else + m_nCurColumn = COL_INVALID; + } + impl_ni_relayout(); m_rAntiImpl.Invalidate(); |