summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authormerttumer <mert.tumer@collabora.com>2021-04-15 11:25:00 +0300
committerMert Tumer <mert.tumer@collabora.com>2021-05-03 06:51:36 +0200
commit45602eb63bcea8e0fe084690144b6aba45f0a56a (patch)
treeea360a1dbfd0c2f961f1123e39389f09f1af8562 /svx
parent3ba86ee82a2d0c2d8cac3c7ee83e2c5f0a3c291e (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> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114644 Tested-by: Jenkins
Diffstat (limited to 'svx')
-rw-r--r--svx/source/svdraw/selectioncontroller.cxx4
-rw-r--r--svx/source/svdraw/svdview.cxx29
-rw-r--r--svx/source/table/tablecontroller.cxx8
3 files changed, 40 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 2cbed57bb1c2..f819deba699f 100644
--- a/svx/source/svdraw/svdview.cxx
+++ b/svx/source/svdraw/svdview.cxx
@@ -30,6 +30,7 @@
#include <svx/svdomedia.hxx>
#include <svx/svdetc.hxx>
+#include <svx/sdr/table/tablecontroller.hxx>
#include <svx/svdoutl.hxx>
#include <svx/svdview.hxx>
#include <editeng/flditem.hxx>
@@ -1338,7 +1339,33 @@ void SdrView::MarkAll()
GetTextEditOutlinerView()->SetSelection(ESelection(0,0,EE_PARA_ALL,EE_TEXTPOS_ALL));
} 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 = 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()
diff --git a/svx/source/table/tablecontroller.cxx b/svx/source/table/tablecontroller.cxx
index 438ffbcb9392..a81756c0ffdc 100644
--- a/svx/source/table/tablecontroller.cxx
+++ b/svx/source/table/tablecontroller.cxx
@@ -418,6 +418,14 @@ void SvxTableController::onSelectionHasChanged()
destroySelectionOverlay();
}
}
+void SvxTableController::onSelectAll()
+{
+ sdr::table::SdrTableObj* pTableObj = mxTableObj.get();
+ if ( pTableObj && !pTableObj->IsTextEditActive())
+ {
+ selectAll();
+ }
+}
void SvxTableController::GetState( SfxItemSet& rSet )