summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--chart2/source/controller/sidebar/ChartAreaPanel.cxx15
1 files changed, 14 insertions, 1 deletions
diff --git a/chart2/source/controller/sidebar/ChartAreaPanel.cxx b/chart2/source/controller/sidebar/ChartAreaPanel.cxx
index de1c21af679a..c5db392cf34f 100644
--- a/chart2/source/controller/sidebar/ChartAreaPanel.cxx
+++ b/chart2/source/controller/sidebar/ChartAreaPanel.cxx
@@ -46,7 +46,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;