[Libreoffice-commits] core.git: chart2/source

Szymon KÅ‚os (via logerrit) logerrit at kemper.freedesktop.org
Tue Oct 6 11:23:08 UTC 2020


 chart2/source/controller/sidebar/ChartAreaPanel.cxx |   15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

New commits:
commit 5e7518c980855c51049cf1ca5e8b77363bd1ec19
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Wed Sep 23 15:28:26 2020 +0200
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Tue Oct 6 13:22:25 2020 +0200

    Use default diagram page selection for charts
    
    Change-Id: I0bf0e5d2d1ef43a61c1bb723b25bafa30b5ad5c8
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103602
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Andras Timar <andras.timar at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104013
    Tested-by: Jenkins
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>

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;


More information about the Libreoffice-commits mailing list