toolkit/inc/controls/table/tablecontrolinterface.hxx | 2 - toolkit/source/controls/svtxgridcontrol.cxx | 1 toolkit/source/controls/table/defaultinputhandler.cxx | 34 +++++++++--------- toolkit/source/controls/table/tablecontrol_impl.cxx | 34 +++++++++--------- toolkit/source/controls/table/tabledatawindow.hxx | 1 5 files changed, 35 insertions(+), 37 deletions(-)
New commits: commit dc6d5c1fc6bd8700281f478f7df8f5bb594a85ca Author: Michael Weghorn <[email protected]> AuthorDate: Thu Jan 23 14:19:39 2025 +0100 Commit: Michael Weghorn <[email protected]> CommitDate: Fri Jan 24 07:37:36 2025 +0100 toolkit: Drop TableDataWindow's unnecessary friend class TableFunctionSet doesn't need access to any non-public members. Change-Id: I73acd3b1efd8ff326a08b3a2a404c047729f8ecd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180660 Reviewed-by: Michael Weghorn <[email protected]> Tested-by: Jenkins diff --git a/toolkit/source/controls/table/tabledatawindow.hxx b/toolkit/source/controls/table/tabledatawindow.hxx index e42a054939db..b0a39ad95dad 100644 --- a/toolkit/source/controls/table/tabledatawindow.hxx +++ b/toolkit/source/controls/table/tabledatawindow.hxx @@ -32,7 +32,6 @@ namespace svt::table */ class TableDataWindow : public vcl::Window { - friend class TableFunctionSet; private: TableControl_Impl& m_rTableControl; Link<LinkParamNone*,void> m_aSelectHdl; commit c2753661d74bb099560d23da189337827414f930 Author: Michael Weghorn <[email protected]> AuthorDate: Thu Jan 23 13:47:53 2025 +0100 Commit: Michael Weghorn <[email protected]> CommitDate: Fri Jan 24 07:37:29 2025 +0100 toolkit: Make TableControlAction an enum class Change-Id: I70197d55a95c3d87a2d0921aca4d05068d88d5b1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180659 Reviewed-by: Michael Weghorn <[email protected]> Tested-by: Jenkins diff --git a/toolkit/inc/controls/table/tablecontrolinterface.hxx b/toolkit/inc/controls/table/tablecontrolinterface.hxx index 8f5dca676375..ee9a52785471 100644 --- a/toolkit/inc/controls/table/tablecontrolinterface.hxx +++ b/toolkit/inc/controls/table/tablecontrolinterface.hxx @@ -29,7 +29,7 @@ namespace svt::table { //= TableControlAction - enum TableControlAction + enum class TableControlAction { /// moves the cursor in the table control one row up, if possible, by keeping the current column cursorUp, diff --git a/toolkit/source/controls/table/defaultinputhandler.cxx b/toolkit/source/controls/table/defaultinputhandler.cxx index 0164af385201..ef6e250547f8 100644 --- a/toolkit/source/controls/table/defaultinputhandler.cxx +++ b/toolkit/source/controls/table/defaultinputhandler.cxx @@ -129,23 +129,23 @@ namespace svt::table TableControlAction eAction; } static const aKnownActions[] = { - { KEY_DOWN, 0, cursorDown }, - { KEY_UP, 0, cursorUp }, - { KEY_LEFT, 0, cursorLeft }, - { KEY_RIGHT, 0, cursorRight }, - { KEY_HOME, 0, cursorToLineStart }, - { KEY_END, 0, cursorToLineEnd }, - { KEY_PAGEUP, 0, cursorPageUp }, - { KEY_PAGEDOWN, 0, cursorPageDown }, - { KEY_PAGEUP, KEY_MOD1, cursorToFirstLine }, - { KEY_PAGEDOWN, KEY_MOD1, cursorToLastLine }, - { KEY_HOME, KEY_MOD1, cursorTopLeft }, - { KEY_END, KEY_MOD1, cursorBottomRight }, - { KEY_SPACE, KEY_MOD1, cursorSelectRow }, - { KEY_UP, KEY_SHIFT, cursorSelectRowUp }, - { KEY_DOWN, KEY_SHIFT, cursorSelectRowDown }, - { KEY_END, KEY_SHIFT, cursorSelectRowAreaBottom }, - { KEY_HOME, KEY_SHIFT, cursorSelectRowAreaTop } + { KEY_DOWN, 0, TableControlAction::cursorDown }, + { KEY_UP, 0, TableControlAction::cursorUp }, + { KEY_LEFT, 0, TableControlAction::cursorLeft }, + { KEY_RIGHT, 0, TableControlAction::cursorRight }, + { KEY_HOME, 0, TableControlAction::cursorToLineStart }, + { KEY_END, 0, TableControlAction::cursorToLineEnd }, + { KEY_PAGEUP, 0, TableControlAction::cursorPageUp }, + { KEY_PAGEDOWN, 0, TableControlAction::cursorPageDown }, + { KEY_PAGEUP, KEY_MOD1, TableControlAction::cursorToFirstLine }, + { KEY_PAGEDOWN, KEY_MOD1, TableControlAction::cursorToLastLine }, + { KEY_HOME, KEY_MOD1, TableControlAction::cursorTopLeft }, + { KEY_END, KEY_MOD1, TableControlAction::cursorBottomRight }, + { KEY_SPACE, KEY_MOD1, TableControlAction::cursorSelectRow }, + { KEY_UP, KEY_SHIFT, TableControlAction::cursorSelectRowUp }, + { KEY_DOWN, KEY_SHIFT, TableControlAction::cursorSelectRowDown }, + { KEY_END, KEY_SHIFT, TableControlAction::cursorSelectRowAreaBottom }, + { KEY_HOME, KEY_SHIFT, TableControlAction::cursorSelectRowAreaTop } }; for (const ActionMapEntry& rAction : aKnownActions) { diff --git a/toolkit/source/controls/table/tablecontrol_impl.cxx b/toolkit/source/controls/table/tablecontrol_impl.cxx index 7d8e25d742c7..695f6b71832a 100644 --- a/toolkit/source/controls/table/tablecontrol_impl.cxx +++ b/toolkit/source/controls/table/tablecontrol_impl.cxx @@ -1286,7 +1286,7 @@ namespace svt::table switch ( _eAction ) { - case cursorDown: + case TableControlAction::cursorDown: if ( m_pSelEngine->GetSelectionMode() == SelectionMode::Single ) { //if other rows already selected, deselect them @@ -1314,7 +1314,7 @@ namespace svt::table } break; - case cursorUp: + case TableControlAction::cursorUp: if(m_pSelEngine->GetSelectionMode() == SelectionMode::Single) { if(!m_aSelectedRows.empty()) @@ -1343,7 +1343,7 @@ namespace svt::table bSuccess = goTo( m_nCurColumn, m_nCurRow - 1 ); } break; - case cursorLeft: + case TableControlAction::cursorLeft: if ( m_nCurColumn > 0 ) bSuccess = goTo( m_nCurColumn - 1, m_nCurRow ); else @@ -1351,7 +1351,7 @@ namespace svt::table bSuccess = goTo( m_nColumnCount - 1, m_nCurRow - 1 ); break; - case cursorRight: + case TableControlAction::cursorRight: if ( m_nCurColumn < m_nColumnCount - 1 ) bSuccess = goTo( m_nCurColumn + 1, m_nCurRow ); else @@ -1359,45 +1359,45 @@ namespace svt::table bSuccess = goTo( 0, m_nCurRow + 1 ); break; - case cursorToLineStart: + case TableControlAction::cursorToLineStart: bSuccess = goTo( 0, m_nCurRow ); break; - case cursorToLineEnd: + case TableControlAction::cursorToLineEnd: bSuccess = goTo( m_nColumnCount - 1, m_nCurRow ); break; - case cursorToFirstLine: + case TableControlAction::cursorToFirstLine: bSuccess = goTo( m_nCurColumn, 0 ); break; - case cursorToLastLine: + case TableControlAction::cursorToLastLine: bSuccess = goTo( m_nCurColumn, m_nRowCount - 1 ); break; - case cursorPageUp: + case TableControlAction::cursorPageUp: { RowPos nNewRow = ::std::max( RowPos(0), m_nCurRow - impl_getVisibleRows( false ) ); bSuccess = goTo( m_nCurColumn, nNewRow ); } break; - case cursorPageDown: + case TableControlAction::cursorPageDown: { RowPos nNewRow = ::std::min( m_nRowCount - 1, m_nCurRow + impl_getVisibleRows( false ) ); bSuccess = goTo( m_nCurColumn, nNewRow ); } break; - case cursorTopLeft: + case TableControlAction::cursorTopLeft: bSuccess = goTo( 0, 0 ); break; - case cursorBottomRight: + case TableControlAction::cursorBottomRight: bSuccess = goTo( m_nColumnCount - 1, m_nRowCount - 1 ); break; - case cursorSelectRow: + case TableControlAction::cursorSelectRow: { if(m_pSelEngine->GetSelectionMode() == SelectionMode::NONE) return false; @@ -1418,7 +1418,7 @@ namespace svt::table bSuccess = true; } break; - case cursorSelectRowUp: + case TableControlAction::cursorSelectRowUp: { if(m_pSelEngine->GetSelectionMode() == SelectionMode::NONE) return false; @@ -1503,7 +1503,7 @@ namespace svt::table } } break; - case cursorSelectRowDown: + case TableControlAction::cursorSelectRowDown: { if(m_pSelEngine->GetSelectionMode() == SelectionMode::NONE) bSuccess = false; @@ -1585,7 +1585,7 @@ namespace svt::table } break; - case cursorSelectRowAreaTop: + case TableControlAction::cursorSelectRowAreaTop: { if(m_pSelEngine->GetSelectionMode() == SelectionMode::NONE) bSuccess = false; @@ -1613,7 +1613,7 @@ namespace svt::table } break; - case cursorSelectRowAreaBottom: + case TableControlAction::cursorSelectRowAreaBottom: { if(m_pSelEngine->GetSelectionMode() == SelectionMode::NONE) return false; commit 8f22441d5eb06d134bc12a51da632880a998634e Author: Michael Weghorn <[email protected]> AuthorDate: Thu Jan 23 13:40:00 2025 +0100 Commit: Michael Weghorn <[email protected]> CommitDate: Fri Jan 24 07:37:22 2025 +0100 toolkit: Drop obsolete SVTXGridControl TODO commit e8f649b5ad64a2a3f07dfab1a52033d126da211b Author: Frank Schoenheit [fs] <[email protected]> Date: Wed Jan 19 11:11:29 2011 +0100 gridsort: render indicator for current column sort replaced the previous `pTable->Invalidate();` with pTable->getTableControlInterface().invalidate( TableAreaRowHeaders ); , which should have implemented what the TODO was suggesting (invalidate the header area only). Change-Id: Iae9f8cee75d25ce982597e0da654357ec8c03692 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180658 Tested-by: Jenkins Reviewed-by: Michael Weghorn <[email protected]> diff --git a/toolkit/source/controls/svtxgridcontrol.cxx b/toolkit/source/controls/svtxgridcontrol.cxx index f63151e0d472..6cd34bef8bca 100644 --- a/toolkit/source/controls/svtxgridcontrol.cxx +++ b/toolkit/source/controls/svtxgridcontrol.cxx @@ -631,7 +631,6 @@ void SAL_CALL SVTXGridControl::rowHeadingChanged( const GridDataEvent& ) VclPtr< TableControl > pTable = GetAsDynamic< TableControl >(); ENSURE_OR_RETURN_VOID( pTable, "SVTXGridControl::rowHeadingChanged: no control (anymore)!" ); - // TODO: we could do better than this - invalidate the header area only pTable->invalidate(TableArea::RowHeaders); }
