diff options
author | merttumer <mert.tumer@collabora.com> | 2021-04-15 11:25:00 +0300 |
---|---|---|
committer | Mert Tumer <mert.tumer@collabora.com> | 2021-04-19 07:52:22 +0200 |
commit | 4d0fb81ce3381011f7c9baf9cd6c416bd4c294a4 (patch) | |
tree | 96ee49d17e0d5b0370e430da86bf86da37d51a65 /svx/source/svdraw | |
parent | d7981dde529810c4e8f548f7bf2be7c3b005ce99 (diff) |
Implemented CTRL + A selects all the cells
When the table is selected, ctrl + a should select
all the cells unless text editing is enabled.
The previous behavior was deselecting the table and
marking all the objects. However, for table it should
select all the cells instead.
Change-Id: I9fb512618a61a96ff21daa74c5a4ae9b31e3906e
Signed-off-by: merttumer <mert.tumer@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114129
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Diffstat (limited to 'svx/source/svdraw')
-rw-r--r-- | svx/source/svdraw/selectioncontroller.cxx | 4 | ||||
-rw-r--r-- | svx/source/svdraw/svdview.cxx | 29 |
2 files changed, 32 insertions, 1 deletions
diff --git a/svx/source/svdraw/selectioncontroller.cxx b/svx/source/svdraw/selectioncontroller.cxx index 28dda4ed27a2..5f6f51312f4e 100644 --- a/svx/source/svdraw/selectioncontroller.cxx +++ b/svx/source/svdraw/selectioncontroller.cxx @@ -47,6 +47,10 @@ void SelectionController::onSelectionHasChanged() { } +void SelectionController::onSelectAll() +{ +} + void SelectionController::GetState( SfxItemSet& /*rSet*/ ) { } diff --git a/svx/source/svdraw/svdview.cxx b/svx/source/svdraw/svdview.cxx index 36fd070e1205..bb677b7707e6 100644 --- a/svx/source/svdraw/svdview.cxx +++ b/svx/source/svdraw/svdview.cxx @@ -35,6 +35,7 @@ #include <svdibrow.hxx> #endif +#include <svx/sdr/table/tablecontroller.hxx> #include <svx/svdoutl.hxx> #include <svx/svdview.hxx> #include <editeng/editview.hxx> @@ -1354,7 +1355,33 @@ void SdrView::MarkAll() #endif } else if (IsGluePointEditMode()) MarkAllGluePoints(); else if (HasMarkablePoints()) MarkAllPoints(); - else MarkAllObj(); + else { + // check for table + bool bMarkAll = true; + const SdrMarkList& rMarkList = GetMarkedObjectList(); + if (rMarkList.GetMarkCount() == 1) + { + const SdrObject* pObj(rMarkList.GetMark(0)->GetMarkedSdrObj()); + SdrView* pView(dynamic_cast<SdrView*>(this)); + if (pObj && pView && (pObj->GetObjInventor() == SdrInventor::Default) + && (pObj->GetObjIdentifier() == OBJ_TABLE)) + { + mxSelectionController.clear(); + mxSelectionController = sdr::table::CreateTableController( + *pView, static_cast<const sdr::table::SdrTableObj&>(*pObj), + mxLastSelectionController); + + if (mxSelectionController.is()) + { + mxLastSelectionController.clear(); + mxSelectionController->onSelectAll(); + bMarkAll = false; + } + } + } + if ( bMarkAll ) + MarkAllObj(); + } } void SdrView::UnmarkAll() |