summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2015-07-23 01:20:45 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2015-07-26 00:26:55 +0200
commit0635208edf1cdee4235ea87666a473ac81007555 (patch)
tree164c60a651094636e11ef665019e3d47c6e8430b
parentcfac266d061c4fe83bebe203519b746538e47157 (diff)
handle more than one chart with chart sidebar
Change-Id: I4998904a9273f2c67114a246d7f234843602573c
-rw-r--r--chart2/source/controller/main/ChartController.cxx1
-rw-r--r--chart2/source/controller/sidebar/ChartAreaPanel.cxx12
-rw-r--r--chart2/source/controller/sidebar/ChartAreaPanel.hxx7
-rw-r--r--chart2/source/controller/sidebar/ChartAxisPanel.cxx12
-rw-r--r--chart2/source/controller/sidebar/ChartAxisPanel.hxx4
-rw-r--r--chart2/source/controller/sidebar/ChartElementsPanel.cxx12
-rw-r--r--chart2/source/controller/sidebar/ChartElementsPanel.hxx4
-rw-r--r--chart2/source/controller/sidebar/ChartErrorBarPanel.cxx12
-rw-r--r--chart2/source/controller/sidebar/ChartErrorBarPanel.hxx4
-rw-r--r--chart2/source/controller/sidebar/ChartSeriesPanel.cxx16
-rw-r--r--chart2/source/controller/sidebar/ChartSeriesPanel.hxx4
-rw-r--r--include/sfx2/sidebar/ResourceManager.hxx2
-rw-r--r--include/sfx2/sidebar/SidebarController.hxx2
-rw-r--r--include/sfx2/sidebar/SidebarModelUpdate.hxx30
-rw-r--r--include/sfx2/sidebar/SidebarPanelBase.hxx12
-rw-r--r--offapi/UnoApi_offapi.mk1
-rw-r--r--offapi/com/sun/star/ui/XUpdateModel.idl34
-rw-r--r--sfx2/Library_sfx.mk1
-rw-r--r--sfx2/source/sidebar/ResourceManager.cxx19
-rw-r--r--sfx2/source/sidebar/SidebarController.cxx5
-rw-r--r--sfx2/source/sidebar/SidebarModelUpdate.cxx20
-rw-r--r--sfx2/source/sidebar/SidebarPanelBase.cxx11
22 files changed, 220 insertions, 5 deletions
diff --git a/chart2/source/controller/main/ChartController.cxx b/chart2/source/controller/main/ChartController.cxx
index 9c51cf5a6bae..138fc65cdac5 100644
--- a/chart2/source/controller/main/ChartController.cxx
+++ b/chart2/source/controller/main/ChartController.cxx
@@ -421,6 +421,7 @@ void SAL_CALL ChartController::attachFrame(
{
sfx2::sidebar::SidebarController* pSidebar = dynamic_cast<sfx2::sidebar::SidebarController*>(xSidebar.get());
sfx2::sidebar::SidebarController::registerSidebarForFrame(pSidebar, this);
+ pSidebar->updateModel(getModel());
}
if(m_xFrame.is()) //what happens, if we do have a Frame already??
diff --git a/chart2/source/controller/sidebar/ChartAreaPanel.cxx b/chart2/source/controller/sidebar/ChartAreaPanel.cxx
index 945e5059cf18..897d8ad61cae 100644
--- a/chart2/source/controller/sidebar/ChartAreaPanel.cxx
+++ b/chart2/source/controller/sidebar/ChartAreaPanel.cxx
@@ -170,6 +170,18 @@ void ChartAreaPanel::modelInvalid()
{
}
+void ChartAreaPanel::updateModel(
+ css::uno::Reference<css::frame::XModel> xModel)
+{
+ css::uno::Reference<css::util::XModifyBroadcaster> xBroadcaster(mxModel, css::uno::UNO_QUERY_THROW);
+ xBroadcaster->removeModifyListener(mxListener);
+
+ mxModel = xModel;
+
+ css::uno::Reference<css::util::XModifyBroadcaster> xBroadcasterNew(mxModel, css::uno::UNO_QUERY_THROW);
+ xBroadcasterNew->addModifyListener(mxListener);
+}
+
} }
diff --git a/chart2/source/controller/sidebar/ChartAreaPanel.hxx b/chart2/source/controller/sidebar/ChartAreaPanel.hxx
index f5b45aed7e6e..7a0875b4b97c 100644
--- a/chart2/source/controller/sidebar/ChartAreaPanel.hxx
+++ b/chart2/source/controller/sidebar/ChartAreaPanel.hxx
@@ -12,6 +12,7 @@
#include <vcl/ctrl.hxx>
#include <sfx2/sidebar/ControllerItem.hxx>
+#include <sfx2/sidebar/SidebarModelUpdate.hxx>
#include <svx/xgrad.hxx>
#include <svx/itemwin.hxx>
#include <svx/xfillit0.hxx>
@@ -44,7 +45,9 @@ class ChartController;
namespace sidebar {
class ChartAreaPanel : public svx::sidebar::AreaPropertyPanelBase,
- public ChartSidebarModifyListenerParent
+ public sfx2::sidebar::SidebarModelUpdate,
+ public ChartSidebarModifyListenerParent,
+ public sfx2::sidebar::SidebarModelUpdate
{
public:
static VclPtr<vcl::Window> Create(
@@ -74,6 +77,8 @@ public:
virtual void dispose() SAL_OVERRIDE;
+ virtual void updateModel(css::uno::Reference<css::frame::XModel> xModel) SAL_OVERRIDE;
+
private:
css::uno::Reference<css::frame::XModel> mxModel;
diff --git a/chart2/source/controller/sidebar/ChartAxisPanel.cxx b/chart2/source/controller/sidebar/ChartAxisPanel.cxx
index e6fa2e322f26..ba1a5e7ec2aa 100644
--- a/chart2/source/controller/sidebar/ChartAxisPanel.cxx
+++ b/chart2/source/controller/sidebar/ChartAxisPanel.cxx
@@ -281,6 +281,18 @@ void ChartAxisPanel::modelInvalid()
{
}
+void ChartAxisPanel::updateModel(
+ css::uno::Reference<css::frame::XModel> xModel)
+{
+ css::uno::Reference<css::util::XModifyBroadcaster> xBroadcaster(mxModel, css::uno::UNO_QUERY_THROW);
+ xBroadcaster->removeModifyListener(mxListener);
+
+ mxModel = xModel;
+
+ css::uno::Reference<css::util::XModifyBroadcaster> xBroadcasterNew(mxModel, css::uno::UNO_QUERY_THROW);
+ xBroadcasterNew->addModifyListener(mxListener);
+}
+
IMPL_LINK(ChartAxisPanel, CheckBoxHdl, CheckBox*, pCheckbox)
{
OUString aCID = getCID(mxModel);
diff --git a/chart2/source/controller/sidebar/ChartAxisPanel.hxx b/chart2/source/controller/sidebar/ChartAxisPanel.hxx
index 8737ab4762d3..5c1177fed392 100644
--- a/chart2/source/controller/sidebar/ChartAxisPanel.hxx
+++ b/chart2/source/controller/sidebar/ChartAxisPanel.hxx
@@ -13,6 +13,7 @@
#include <sfx2/sidebar/ControllerItem.hxx>
#include <sfx2/sidebar/IContextChangeReceiver.hxx>
+#include <sfx2/sidebar/SidebarModelUpdate.hxx>
#include <svx/sidebar/PanelLayout.hxx>
#include "ChartSidebarModifyListener.hxx"
@@ -32,6 +33,7 @@ namespace sidebar {
class ChartAxisPanel : public PanelLayout,
public ::sfx2::sidebar::IContextChangeReceiver,
public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface,
+ public sfx2::sidebar::SidebarModelUpdate,
public ChartSidebarModifyListenerParent
{
public:
@@ -63,6 +65,8 @@ public:
virtual void updateData() SAL_OVERRIDE;
virtual void modelInvalid() SAL_OVERRIDE;
+ virtual void updateModel(css::uno::Reference<css::frame::XModel> xModel) SAL_OVERRIDE;
+
private:
//ui controls
VclPtr<CheckBox> mpCBShowLabel;
diff --git a/chart2/source/controller/sidebar/ChartElementsPanel.cxx b/chart2/source/controller/sidebar/ChartElementsPanel.cxx
index 1cbec9ec9b87..fd498ff25f46 100644
--- a/chart2/source/controller/sidebar/ChartElementsPanel.cxx
+++ b/chart2/source/controller/sidebar/ChartElementsPanel.cxx
@@ -451,6 +451,18 @@ void ChartElementsPanel::modelInvalid()
}
+void ChartElementsPanel::updateModel(
+ css::uno::Reference<css::frame::XModel> xModel)
+{
+ css::uno::Reference<css::util::XModifyBroadcaster> xBroadcaster(mxModel, css::uno::UNO_QUERY_THROW);
+ xBroadcaster->removeModifyListener(mxListener);
+
+ mxModel = xModel;
+
+ css::uno::Reference<css::util::XModifyBroadcaster> xBroadcasterNew(mxModel, css::uno::UNO_QUERY_THROW);
+ xBroadcasterNew->addModifyListener(mxListener);
+}
+
IMPL_LINK(ChartElementsPanel, CheckBoxHdl, CheckBox*, pCheckBox)
{
bool bChecked = pCheckBox->IsChecked();
diff --git a/chart2/source/controller/sidebar/ChartElementsPanel.hxx b/chart2/source/controller/sidebar/ChartElementsPanel.hxx
index 32ffb7d0f41f..766915c1e64e 100644
--- a/chart2/source/controller/sidebar/ChartElementsPanel.hxx
+++ b/chart2/source/controller/sidebar/ChartElementsPanel.hxx
@@ -21,6 +21,7 @@
#include <sfx2/sidebar/ControllerItem.hxx>
#include <sfx2/sidebar/IContextChangeReceiver.hxx>
+#include <sfx2/sidebar/SidebarModelUpdate.hxx>
#include <svx/sidebar/PanelLayout.hxx>
#include "ChartSidebarModifyListener.hxx"
@@ -39,6 +40,7 @@ namespace sidebar {
class ChartElementsPanel : public PanelLayout,
public ::sfx2::sidebar::IContextChangeReceiver,
public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface,
+ public sfx2::sidebar::SidebarModelUpdate,
public ChartSidebarModifyListenerParent
{
public:
@@ -70,6 +72,8 @@ public:
virtual void updateData() SAL_OVERRIDE;
virtual void modelInvalid() SAL_OVERRIDE;
+ virtual void updateModel(css::uno::Reference<css::frame::XModel> xModel) SAL_OVERRIDE;
+
private:
//ui controls
VclPtr<CheckBox> mpCBTitle;
diff --git a/chart2/source/controller/sidebar/ChartErrorBarPanel.cxx b/chart2/source/controller/sidebar/ChartErrorBarPanel.cxx
index b5a5075a9e99..3163f956e142 100644
--- a/chart2/source/controller/sidebar/ChartErrorBarPanel.cxx
+++ b/chart2/source/controller/sidebar/ChartErrorBarPanel.cxx
@@ -381,6 +381,18 @@ void ChartErrorBarPanel::modelInvalid()
{
}
+void ChartErrorBarPanel::updateModel(
+ css::uno::Reference<css::frame::XModel> xModel)
+{
+ css::uno::Reference<css::util::XModifyBroadcaster> xBroadcaster(mxModel, css::uno::UNO_QUERY_THROW);
+ xBroadcaster->removeModifyListener(mxListener);
+
+ mxModel = xModel;
+
+ css::uno::Reference<css::util::XModifyBroadcaster> xBroadcasterNew(mxModel, css::uno::UNO_QUERY_THROW);
+ xBroadcasterNew->addModifyListener(mxListener);
+}
+
IMPL_LINK_NOARG(ChartErrorBarPanel, RadioBtnHdl)
{
OUString aCID = getCID(mxModel);
diff --git a/chart2/source/controller/sidebar/ChartErrorBarPanel.hxx b/chart2/source/controller/sidebar/ChartErrorBarPanel.hxx
index 84d4b9ccd896..e9c102b4d5e0 100644
--- a/chart2/source/controller/sidebar/ChartErrorBarPanel.hxx
+++ b/chart2/source/controller/sidebar/ChartErrorBarPanel.hxx
@@ -13,6 +13,7 @@
#include <sfx2/sidebar/ControllerItem.hxx>
#include <sfx2/sidebar/IContextChangeReceiver.hxx>
+#include <sfx2/sidebar/SidebarModelUpdate.hxx>
#include <svx/sidebar/PanelLayout.hxx>
#include "ChartSidebarModifyListener.hxx"
@@ -33,6 +34,7 @@ namespace sidebar {
class ChartErrorBarPanel : public PanelLayout,
public ::sfx2::sidebar::IContextChangeReceiver,
public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface,
+ public sfx2::sidebar::SidebarModelUpdate,
public ChartSidebarModifyListenerParent
{
public:
@@ -64,6 +66,8 @@ public:
virtual void updateData() SAL_OVERRIDE;
virtual void modelInvalid() SAL_OVERRIDE;
+ virtual void updateModel(css::uno::Reference<css::frame::XModel> xModel) SAL_OVERRIDE;
+
private:
//ui controls
VclPtr<RadioButton> mpRBPosAndNeg;
diff --git a/chart2/source/controller/sidebar/ChartSeriesPanel.cxx b/chart2/source/controller/sidebar/ChartSeriesPanel.cxx
index 483ae91b4bbc..0cb9aeed2bf2 100644
--- a/chart2/source/controller/sidebar/ChartSeriesPanel.cxx
+++ b/chart2/source/controller/sidebar/ChartSeriesPanel.cxx
@@ -269,7 +269,9 @@ OUString getCID(css::uno::Reference<css::frame::XModel> xModel)
return OUString();
uno::Any aAny = xSelectionSupplier->getSelection();
- assert(aAny.hasValue());
+ if (!aAny.hasValue())
+ return OUString();
+
OUString aCID;
aAny >>= aCID;
#ifdef DBG_UTIL
@@ -410,6 +412,18 @@ void ChartSeriesPanel::modelInvalid()
}
+void ChartSeriesPanel::updateModel(
+ css::uno::Reference<css::frame::XModel> xModel)
+{
+ css::uno::Reference<css::util::XModifyBroadcaster> xBroadcaster(mxModel, css::uno::UNO_QUERY_THROW);
+ xBroadcaster->removeModifyListener(mxListener);
+
+ mxModel = xModel;
+
+ css::uno::Reference<css::util::XModifyBroadcaster> xBroadcasterNew(mxModel, css::uno::UNO_QUERY_THROW);
+ xBroadcasterNew->addModifyListener(mxListener);
+}
+
IMPL_LINK(ChartSeriesPanel, CheckBoxHdl, CheckBox*, pCheckBox)
{
bool bChecked = pCheckBox->IsChecked();
diff --git a/chart2/source/controller/sidebar/ChartSeriesPanel.hxx b/chart2/source/controller/sidebar/ChartSeriesPanel.hxx
index 7c951f636dff..10d73ee8e15e 100644
--- a/chart2/source/controller/sidebar/ChartSeriesPanel.hxx
+++ b/chart2/source/controller/sidebar/ChartSeriesPanel.hxx
@@ -21,6 +21,7 @@
#include <sfx2/sidebar/ControllerItem.hxx>
#include <sfx2/sidebar/IContextChangeReceiver.hxx>
+#include <sfx2/sidebar/SidebarModelUpdate.hxx>
#include <svx/sidebar/PanelLayout.hxx>
#include "ChartSidebarModifyListener.hxx"
@@ -40,6 +41,7 @@ namespace sidebar {
class ChartSeriesPanel : public PanelLayout,
public ::sfx2::sidebar::IContextChangeReceiver,
public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface,
+ public sfx2::sidebar::SidebarModelUpdate,
public ChartSidebarModifyListenerParent
{
public:
@@ -71,6 +73,8 @@ public:
virtual void updateData() SAL_OVERRIDE;
virtual void modelInvalid() SAL_OVERRIDE;
+ virtual void updateModel(css::uno::Reference<css::frame::XModel> xModel) SAL_OVERRIDE;
+
private:
//ui controls
VclPtr<CheckBox> mpCBLabel;
diff --git a/include/sfx2/sidebar/ResourceManager.hxx b/include/sfx2/sidebar/ResourceManager.hxx
index 568b7f87e593..8708707b7c01 100644
--- a/include/sfx2/sidebar/ResourceManager.hxx
+++ b/include/sfx2/sidebar/ResourceManager.hxx
@@ -66,6 +66,8 @@ public:
void SetPanelOrderIndex(const OUString& rsPanelId, const sal_Int32 orderIndex);
+ void UpdateModel(css::uno::Reference<css::frame::XModel> xModel);
+
class DeckContextDescriptor
{
diff --git a/include/sfx2/sidebar/SidebarController.hxx b/include/sfx2/sidebar/SidebarController.hxx
index db0a9a15bc7a..00a53b350457 100644
--- a/include/sfx2/sidebar/SidebarController.hxx
+++ b/include/sfx2/sidebar/SidebarController.hxx
@@ -156,6 +156,8 @@ public:
void notifyDeckTitle(const OUString& targetDeckId);
+ void updateModel(css::uno::Reference<css::frame::XModel> xModel);
+
private:
VclPtr<Deck> mpCurrentDeck;
diff --git a/include/sfx2/sidebar/SidebarModelUpdate.hxx b/include/sfx2/sidebar/SidebarModelUpdate.hxx
new file mode 100644
index 000000000000..981f7fa5ffd3
--- /dev/null
+++ b/include/sfx2/sidebar/SidebarModelUpdate.hxx
@@ -0,0 +1,30 @@
+/* -*- 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/.
+ */
+
+#ifndef INCLUDED_INCLUDE_SFX2_SIDEBAR_SIDEBARUPDATEMODEL_HXX
+#define INCLUDED_INCLUDE_SFX2_SIDEBAR_SIDEBARUPDATEMODEL_HXX
+
+#include <com/sun/star/frame/XModel.hpp>
+
+#include <sfx2/dllapi.h>
+
+namespace sfx2 { namespace sidebar {
+
+class SFX2_DLLPUBLIC SidebarModelUpdate
+{
+public:
+ virtual ~SidebarModelUpdate();
+ virtual void updateModel(css::uno::Reference<css::frame::XModel> xModel) = 0;
+};
+
+} }
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/sidebar/SidebarPanelBase.hxx b/include/sfx2/sidebar/SidebarPanelBase.hxx
index e08f3c34bb2c..75d155ee2ace 100644
--- a/include/sfx2/sidebar/SidebarPanelBase.hxx
+++ b/include/sfx2/sidebar/SidebarPanelBase.hxx
@@ -22,7 +22,7 @@
#include <sfx2/sidebar/EnumContext.hxx>
#include <sfx2/sidebar/IContextChangeReceiver.hxx>
-#include <cppuhelper/compbase4.hxx>
+#include <cppuhelper/compbase5.hxx>
#include <cppuhelper/basemutex.hxx>
#include <com/sun/star/frame/XController.hpp>
@@ -30,6 +30,7 @@
#include <com/sun/star/ui/XUIElement.hpp>
#include <com/sun/star/ui/XToolPanel.hpp>
#include <com/sun/star/ui/XSidebarPanel.hpp>
+#include <com/sun/star/ui/XUpdateModel.hpp>
#include <boost/noncopyable.hpp>
#include <boost/function.hpp>
@@ -43,10 +44,11 @@ namespace sfx2 { namespace sidebar {
namespace
{
-typedef cppu::WeakComponentImplHelper4<css::ui::XContextChangeEventListener,
+typedef cppu::WeakComponentImplHelper5<css::ui::XContextChangeEventListener,
css::ui::XUIElement,
css::ui::XToolPanel,
- css::ui::XSidebarPanel>
+ css::ui::XSidebarPanel,
+ css::ui::XUpdateModel>
SidebarPanelBaseInterfaceBase;
}
@@ -94,6 +96,10 @@ public:
virtual sal_Int32 SAL_CALL getMinimalWidth()
throw(css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+ // XUpdateModel
+ virtual void SAL_CALL updateModel(const css::uno::Reference<css::frame::XModel>& xModel)
+ throw(css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+
protected:
css::uno::Reference<css::frame::XFrame> mxFrame;
diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk
index fd1b03a58118..0a915f43c917 100644
--- a/offapi/UnoApi_offapi.mk
+++ b/offapi/UnoApi_offapi.mk
@@ -4039,6 +4039,7 @@ $(eval $(call gb_UnoApi_add_idlfiles,offapi,com/sun/star/ui,\
XUIElementFactoryManager \
XUIElementFactoryRegistration \
XUIElementSettings \
+ XUpdateModel \
XUIFunctionListener \
))
$(eval $(call gb_UnoApi_add_idlfiles,offapi,com/sun/star/ui/dialogs,\
diff --git a/offapi/com/sun/star/ui/XUpdateModel.idl b/offapi/com/sun/star/ui/XUpdateModel.idl
new file mode 100644
index 000000000000..59b1f68e29ae
--- /dev/null
+++ b/offapi/com/sun/star/ui/XUpdateModel.idl
@@ -0,0 +1,34 @@
+/* -*- 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/.
+ */
+
+#ifndef __com_sun_star_ui_XUpdateModel_idl__
+#define __com_sun_star_ui_XUpdateModel_idl__
+
+#include <com/sun/star/uno/XInterface.idl>
+#include <com/sun/star/frame/XModel.idl>
+
+
+module com { module sun { module star { module ui {
+
+
+/** Internal interface to update the used css::frame::XModel
+ </p>
+*/
+
+interface XUpdateModel : com::sun::star::uno::XInterface
+{
+ void updateModel( [in] com::sun::star::frame::XModel xModel);
+};
+
+}; }; }; };
+
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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: */