summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
Diffstat (limited to 'sfx2')
-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
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: */