diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2020-09-23 15:28:26 +0200 |
---|---|---|
committer | Szymon Kłos <szymon.klos@collabora.com> | 2020-10-06 13:21:59 +0200 |
commit | 49a1c4c649d062160765520f0a1c82925030a644 (patch) | |
tree | 298cd506da6d8313adbcde6309da8b4b09f5334a | |
parent | 6684a11703432da748f8a725b05d0e5edcc90568 (diff) |
Use default diagram page selection for charts
Change-Id: I0bf0e5d2d1ef43a61c1bb723b25bafa30b5ad5c8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103602
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104016
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
-rw-r--r-- | chart2/source/controller/sidebar/ChartAreaPanel.cxx | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/chart2/source/controller/sidebar/ChartAreaPanel.cxx b/chart2/source/controller/sidebar/ChartAreaPanel.cxx index 61e72318043c..64fce618760c 100644 --- a/chart2/source/controller/sidebar/ChartAreaPanel.cxx +++ b/chart2/source/controller/sidebar/ChartAreaPanel.cxx @@ -45,7 +45,20 @@ OUString getCID(const css::uno::Reference<css::frame::XModel>& xModel) css::uno::Any aAny = xSelectionSupplier->getSelection(); if (!aAny.hasValue()) - return OUString(); + { + // if no selection, default to diagram wall so sidebar can show some editable properties + ChartController* pController = dynamic_cast<ChartController*>(xController.get()); + if (pController) + { + pController->select( css::uno::Any( ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_PAGE, OUString() ) ) ); + xSelectionSupplier = css::uno::Reference<css::view::XSelectionSupplier>(xController, css::uno::UNO_QUERY); + if (xSelectionSupplier.is()) + aAny = xSelectionSupplier->getSelection(); + } + + if (!aAny.hasValue()) + return OUString(); + } OUString aCID; aAny >>= aCID; |