diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2015-07-23 01:20:45 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2015-07-26 00:26:55 +0200 |
commit | 0635208edf1cdee4235ea87666a473ac81007555 (patch) | |
tree | 164c60a651094636e11ef665019e3d47c6e8430b /sfx2 | |
parent | cfac266d061c4fe83bebe203519b746538e47157 (diff) |
handle more than one chart with chart sidebar
Change-Id: I4998904a9273f2c67114a246d7f234843602573c
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/Library_sfx.mk | 1 | ||||
-rw-r--r-- | sfx2/source/sidebar/ResourceManager.cxx | 19 | ||||
-rw-r--r-- | sfx2/source/sidebar/SidebarController.cxx | 5 | ||||
-rw-r--r-- | sfx2/source/sidebar/SidebarModelUpdate.cxx | 20 | ||||
-rw-r--r-- | sfx2/source/sidebar/SidebarPanelBase.cxx | 11 |
5 files changed, 56 insertions, 0 deletions
diff --git a/sfx2/Library_sfx.mk b/sfx2/Library_sfx.mk index b56f7f5c7726..faba426f66c3 100644 --- a/sfx2/Library_sfx.mk +++ b/sfx2/Library_sfx.mk @@ -251,6 +251,7 @@ $(eval $(call gb_Library_add_exception_objects,sfx,\ sfx2/source/sidebar/SidebarChildWindow \ sfx2/source/sidebar/SidebarDockingWindow \ sfx2/source/sidebar/SidebarController \ + sfx2/source/sidebar/SidebarModelUpdate \ sfx2/source/sidebar/SidebarPanelBase \ sfx2/source/sidebar/SidebarToolBox \ sfx2/source/sidebar/Accessible \ diff --git a/sfx2/source/sidebar/ResourceManager.cxx b/sfx2/source/sidebar/ResourceManager.cxx index bce5bbc7321a..28f9e68ef286 100644 --- a/sfx2/source/sidebar/ResourceManager.cxx +++ b/sfx2/source/sidebar/ResourceManager.cxx @@ -29,6 +29,7 @@ #include <tools/diagnose_ex.h> #include <com/sun/star/frame/ModuleManager.hpp> +#include <com/sun/star/ui/XUpdateModel.hpp> #include <map> @@ -646,6 +647,24 @@ bool ResourceManager::IsDeckEnabled ( return false; } +void ResourceManager::UpdateModel(css::uno::Reference<css::frame::XModel> xModel) +{ + for (DeckContainer::iterator itr = maDecks.begin(); itr != maDecks.end(); ++itr) { + if (!itr->mpDeck) + continue; + + const SharedPanelContainer& rContainer = itr->mpDeck->GetPanels(); + + for (SharedPanelContainer::const_iterator it = rContainer.begin(); it != rContainer.end(); ++it) { + css::uno::Reference<css::ui::XUpdateModel> xPanel((*it)->GetPanelComponent(), css::uno::UNO_QUERY); + xPanel->updateModel(xModel); + } + + } + + +} + } } // end of namespace sfx2::sidebar /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx index 9bdd5e00369b..ed4cee0f15be 100644 --- a/sfx2/source/sidebar/SidebarController.cxx +++ b/sfx2/source/sidebar/SidebarController.cxx @@ -1252,6 +1252,11 @@ ResourceManager::PanelContextDescriptorContainer SidebarController::GetMatchingP return aPanels; } +void SidebarController::updateModel(css::uno::Reference<css::frame::XModel> xModel) +{ + mpResourceManager->UpdateModel(xModel); +} + } } // end of namespace sfx2::sidebar diff --git a/sfx2/source/sidebar/SidebarModelUpdate.cxx b/sfx2/source/sidebar/SidebarModelUpdate.cxx new file mode 100644 index 000000000000..91c423b1020f --- /dev/null +++ b/sfx2/source/sidebar/SidebarModelUpdate.cxx @@ -0,0 +1,20 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include <sfx2/sidebar/SidebarModelUpdate.hxx> + +namespace sfx2 { namespace sidebar { + +SidebarModelUpdate::~SidebarModelUpdate() +{ +} + +} } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/sidebar/SidebarPanelBase.cxx b/sfx2/source/sidebar/SidebarPanelBase.cxx index a7ec830687dd..c8d3992901e8 100644 --- a/sfx2/source/sidebar/SidebarPanelBase.cxx +++ b/sfx2/source/sidebar/SidebarPanelBase.cxx @@ -20,6 +20,7 @@ #include <sfx2/sidebar/Theme.hxx> #include <sfx2/sidebar/ILayoutableWindow.hxx> #include <sfx2/sidebar/IContextChangeReceiver.hxx> +#include <sfx2/sidebar/SidebarModelUpdate.hxx> #include <sfx2/imagemgr.hxx> #include <vcl/ctrl.hxx> #include <vcl/layout.hxx> @@ -203,6 +204,16 @@ sal_Int32 SAL_CALL SidebarPanelBase::getMinimalWidth () throw(css::uno::RuntimeE return 0; } +void SAL_CALL SidebarPanelBase::updateModel(const css::uno::Reference<css::frame::XModel>& xModel) + throw(css::uno::RuntimeException, std::exception) +{ + SidebarModelUpdate* pModelUpdate = dynamic_cast<SidebarModelUpdate*>(mpControl.get()); + if (!pModelUpdate) + return; + + pModelUpdate->updateModel(xModel); +} + } } // end of namespace sfx2::sidebar /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |