[Libreoffice-commits] core.git: include/svx svx/source
merttumer (via logerrit)
logerrit at kemper.freedesktop.org
Mon May 3 04:52:30 UTC 2021
include/svx/sdr/table/tablecontroller.hxx | 1 +
include/svx/selectioncontroller.hxx | 2 ++
svx/source/svdraw/selectioncontroller.cxx | 4 ++++
svx/source/svdraw/svdview.cxx | 29 ++++++++++++++++++++++++++++-
svx/source/table/tablecontroller.cxx | 8 ++++++++
5 files changed, 43 insertions(+), 1 deletion(-)
New commits:
commit 45602eb63bcea8e0fe084690144b6aba45f0a56a
Author: merttumer <mert.tumer at collabora.com>
AuthorDate: Thu Apr 15 11:25:00 2021 +0300
Commit: Mert Tumer <mert.tumer at collabora.com>
CommitDate: Mon May 3 06:51:36 2021 +0200
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 at collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114129
Reviewed-by: Jan Holesovsky <kendy at collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114644
Tested-by: Jenkins
diff --git a/include/svx/sdr/table/tablecontroller.hxx b/include/svx/sdr/table/tablecontroller.hxx
index 6b505ae4dfd3..e4b406b1f77a 100644
--- a/include/svx/sdr/table/tablecontroller.hxx
+++ b/include/svx/sdr/table/tablecontroller.hxx
@@ -58,6 +58,7 @@ public:
SVX_DLLPRIVATE virtual bool DeleteMarked() override;
SVX_DLLPRIVATE virtual void onSelectionHasChanged() override;
+ SVX_DLLPRIVATE virtual void onSelectAll() override;
SVX_DLLPRIVATE virtual void GetState( SfxItemSet& rSet ) override;
virtual void Execute( SfxRequest& rReq ) override;
diff --git a/include/svx/selectioncontroller.hxx b/include/svx/selectioncontroller.hxx
index c9e12c322a5d..57dec07b9fd6 100644
--- a/include/svx/selectioncontroller.hxx
+++ b/include/svx/selectioncontroller.hxx
@@ -49,6 +49,8 @@ public:
virtual void onSelectionHasChanged();
+ virtual void onSelectAll();
+
virtual void GetState( SfxItemSet& rSet );
virtual void Execute( SfxRequest& rReq );
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 )
More information about the Libreoffice-commits
mailing list