From 49a1c4c649d062160765520f0a1c82925030a644 Mon Sep 17 00:00:00 2001 From: Szymon Kłos Date: Wed, 23 Sep 2020 15:28:26 +0200 Subject: Use default diagram page selection for charts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I0bf0e5d2d1ef43a61c1bb723b25bafa30b5ad5c8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103602 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104016 Reviewed-by: Szymon Kłos --- chart2/source/controller/sidebar/ChartAreaPanel.cxx | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'chart2') 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& 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(xController.get()); + if (pController) + { + pController->select( css::uno::Any( ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_PAGE, OUString() ) ) ); + xSelectionSupplier = css::uno::Reference(xController, css::uno::UNO_QUERY); + if (xSelectionSupplier.is()) + aAny = xSelectionSupplier->getSelection(); + } + + if (!aAny.hasValue()) + return OUString(); + } OUString aCID; aAny >>= aCID; -- cgit v1.2.3