[Libreoffice-commits] core.git: sd/source
Katarina Behrens
Katarina.Behrens at cib.de
Tue Jun 14 12:38:20 UTC 2016
sd/source/ui/sidebar/SlideBackground.cxx | 32 +++++++++++++++++++++++++++++++
sd/source/ui/sidebar/SlideBackground.hxx | 4 +++
2 files changed, 36 insertions(+)
New commits:
commit c63125f88bf90d33f6fd48964422c3b0633d027d
Author: Katarina Behrens <Katarina.Behrens at cib.de>
Date: Tue Jun 14 10:28:01 2016 +0200
Function to change sidebar panel title, via UNO API
Change-Id: I147da965d71746220958852bf796197c30f219a3
Reviewed-on: https://gerrit.libreoffice.org/26243
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Katarina Behrens <Katarina.Behrens at cib.de>
diff --git a/sd/source/ui/sidebar/SlideBackground.cxx b/sd/source/ui/sidebar/SlideBackground.cxx
index f0a6bb8..24068ac 100644
--- a/sd/source/ui/sidebar/SlideBackground.cxx
+++ b/sd/source/ui/sidebar/SlideBackground.cxx
@@ -18,6 +18,8 @@
*/
#include <com/sun/star/animations/XAnimationNode.hpp>
+#include <com/sun/star/ui/XDeck.hpp>
+#include <com/sun/star/ui/XPanel.hpp>
#include "SlideBackground.hxx"
#include "TransitionPreset.hxx"
#include "sdresid.hxx"
@@ -90,6 +92,7 @@ SlideBackground::SlideBackground(
mpGradientItem(),
mpHatchItem(),
mpBitmapItem(),
+ mxFrame(rxFrame),
mpBindings(pBindings)
{
get(mpPaperSizeBox,"paperformat");
@@ -240,6 +243,35 @@ void SlideBackground::Update()
}
}
+void SlideBackground::SetPanelTitle( const OUString& rTitle )
+{
+ Reference<frame::XController2> xController( mxFrame->getController(), uno::UNO_QUERY);
+ if ( !xController.is() )
+ return;
+
+ Reference<ui::XSidebarProvider> xSidebarProvider( xController->getSidebar(), uno::UNO_QUERY );
+ if ( !xSidebarProvider.is() )
+ return;
+
+ Reference<ui::XDecks> xDecks ( xSidebarProvider->getDecks(), uno::UNO_QUERY);
+ if ( !xDecks.is() )
+ return;
+
+ Reference<ui::XDeck> xDeck ( xDecks->getByName("PropertyDeck"), uno::UNO_QUERY);
+ if ( !xDeck.is() )
+ return;
+
+ Reference<ui::XPanels> xPanels ( xDeck->getPanels(), uno::UNO_QUERY);
+ if ( !xPanels.is() )
+ return;
+
+ Reference<ui::XPanel> xPanel ( xPanels->getByName("SlideBackgroundPanel"), uno::UNO_QUERY);
+ if ( !xPanels.is() )
+ return;
+
+ xPanel->setTitle( rTitle );
+}
+
void SlideBackground::addListener()
{
Link<tools::EventMultiplexerEvent&,void> aLink( LINK(this, SlideBackground, EventMultiplexerListener) );
diff --git a/sd/source/ui/sidebar/SlideBackground.hxx b/sd/source/ui/sidebar/SlideBackground.hxx
index 5cfc955..b5b892e 100644
--- a/sd/source/ui/sidebar/SlideBackground.hxx
+++ b/sd/source/ui/sidebar/SlideBackground.hxx
@@ -99,6 +99,7 @@ private:
std::unique_ptr< XFillHatchItem > mpHatchItem;
std::unique_ptr< XFillBitmapItem > mpBitmapItem;
+ css::uno::Reference<css::frame::XFrame> mxFrame;
SfxBindings* mpBindings;
SfxMapUnit meUnit;
@@ -114,6 +115,9 @@ private:
void Initialize();
void Update();
+ //DO NOT REMOVE, will be used in follow-up commits
+ void SetPanelTitle(const OUString& rTitle);
+
Color GetColorSetOrDefault();
XGradient GetGradientSetOrDefault();
const OUString GetHatchingSetOrDefault();
More information about the Libreoffice-commits
mailing list