summaryrefslogtreecommitdiff
path: root/sfx2/source/sidebar/Panel.cxx
diff options
context:
space:
mode:
authorLaurent Godard <lgodard.libre@laposte.net>2015-04-30 16:56:14 +0200
committerTomaž Vajngerl <quikee@gmail.com>2015-06-22 04:59:07 +0000
commita64999511ae654131d997eec9a3d78478cfc1c75 (patch)
treee2a06cde98747c7f8b1eb409f9c7b1918582c897 /sfx2/source/sidebar/Panel.cxx
parentd16e154c627ecc0cb21aaf4b28f7f5ae48ebbde1 (diff)
new uno sidebar api tdf#91806
the entry point is SfxBaseController::getSidebar() the Decks and panels are now per SidebarController and not global anymore ' macro example Sub testSidebarApi controller = thisComponent.currentcontroller frameIni = thisComponent.currentcontroller.frame sidebar = thisComponent.currentcontroller.getSidebar() sidebar.setVisible(true) frame = sidebar.getFrame() decks = sidebar.getdecks() c = decks.count h = decks.hasElements() e = decks.getElementNames() a = decks.hasByName("MyDeck") deck = decks.getByName("MyDeck") deck.activate(true) t = deck.getTitle() deck.setTitle("new deck title") deck.moveFirst() deck.moveLast() deck.moveUp() deck.moveDown() index = deck.getOrderIndex() panels = deck.getPanels() ep = panels.getElementnames() ap = panels.hasByName("aPanelName") panel = panels.getByName("aPanelName") panel.setTitle("new panel title") panel.collapse() panel.expand(true) ' expand and collapse other index = panel.getOrderIndex() panel.moveLast() panel.moveFirst() panel.moveDown() panel.moveUp() End Sub Change-Id: I7a4b953f2277dea483bb296ba6ead35de7205ace Reviewed-on: https://gerrit.libreoffice.org/15856 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Tested-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'sfx2/source/sidebar/Panel.cxx')
-rw-r--r--sfx2/source/sidebar/Panel.cxx24
1 files changed, 16 insertions, 8 deletions
diff --git a/sfx2/source/sidebar/Panel.cxx b/sfx2/source/sidebar/Panel.cxx
index 7ea2689bb205..e67d9d901ebf 100644
--- a/sfx2/source/sidebar/Panel.cxx
+++ b/sfx2/source/sidebar/Panel.cxx
@@ -17,16 +17,19 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include "Panel.hxx"
-#include "PanelTitleBar.hxx"
-#include "PanelDescriptor.hxx"
+#include <sfx2/sidebar/Panel.hxx>
+#include <sfx2/sidebar/PanelTitleBar.hxx>
+#include <sfx2/sidebar/PanelDescriptor.hxx>
#include <sfx2/sidebar/Theme.hxx>
-#include "Paint.hxx"
-#include "ResourceManager.hxx"
+#include <sfx2/sidebar/Paint.hxx>
+#include <sfx2/sidebar/ResourceManager.hxx>
+
+#include <sfx2/sidebar/SidebarController.hxx>
+
#ifdef DEBUG
#include <sfx2/sidebar/Tools.hxx>
-#include "Deck.hxx"
+#include <sfx2/sidebar/Deck.hxx>
#endif
#include <tools/svborder.hxx>
@@ -47,7 +50,9 @@ Panel::Panel(const PanelDescriptor& rPanelDescriptor,
vcl::Window* pParentWindow,
const bool bIsInitiallyExpanded,
const std::function<void()>& rDeckLayoutTrigger,
- const std::function<Context()>& rContextAccess)
+ const std::function<Context()>& rContextAccess,
+ const css::uno::Reference<css::frame::XFrame>& rxFrame
+ )
: Window(pParentWindow)
, msPanelId(rPanelDescriptor.msId)
, mpTitleBar(VclPtr<PanelTitleBar>::Create(rPanelDescriptor.msTitle, pParentWindow, this))
@@ -57,6 +62,7 @@ Panel::Panel(const PanelDescriptor& rPanelDescriptor,
, mbIsExpanded(bIsInitiallyExpanded)
, maDeckLayoutTrigger(rDeckLayoutTrigger)
, maContextAccess(rContextAccess)
+ , mxFrame(rxFrame)
{
#ifdef DEBUG
SetText(OUString("Panel"));
@@ -111,6 +117,8 @@ void Panel::SetUIElement (const Reference<ui::XUIElement>& rxElement)
void Panel::SetExpanded (const bool bIsExpanded)
{
+ SidebarController* pSidebarController= SidebarController::GetSidebarControllerForFrame(mxFrame);
+
if (mbIsExpanded != bIsExpanded)
{
mbIsExpanded = bIsExpanded;
@@ -118,7 +126,7 @@ void Panel::SetExpanded (const bool bIsExpanded)
if (maContextAccess)
{
- ResourceManager::Instance().StorePanelExpansionState(
+ pSidebarController->GetResourceManager()->StorePanelExpansionState(
msPanelId,
bIsExpanded,
maContextAccess());