summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Fischer <af@apache.org>2013-04-11 12:04:57 +0000
committerMichael Meeks <michael.meeks@suse.com>2013-05-20 11:33:10 +0100
commit96331dc4d292cd28bab741ac3144868fa2111b89 (patch)
tree4d9d8197e8f91a34d0b7791b1c4952f4afe43f6a
parentd02f75a8c36705924ddd6a5921fe3012fafce812 (diff)
Related: #i121420# Provide sidebar panels with XCanvas objects.
(cherry picked from commit d179a612f5f9c01776ea52bfdcf27f1cb864f249) Conflicts: sfx2/source/sidebar/SidebarController.cxx Change-Id: I755d55ac0f5a97fdd11476ce11631afb362e83d8
-rw-r--r--sfx2/source/sidebar/SidebarController.cxx15
-rw-r--r--sfx2/source/sidebar/SidebarController.hxx3
2 files changed, 15 insertions, 3 deletions
diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx
index 08e1e6d420ff..55a384ef865a 100644
--- a/sfx2/source/sidebar/SidebarController.cxx
+++ b/sfx2/source/sidebar/SidebarController.cxx
@@ -35,6 +35,7 @@
#include "splitwin.hxx"
#include <svl/smplhint.hxx>
#include <tools/link.hxx>
+#include <toolkit/helper/vclunohelper.hxx>
#include <comphelper/processfactory.hxx>
#include <comphelper/componentcontext.hxx>
#include <comphelper/namedvaluecollection.hxx>
@@ -46,6 +47,7 @@
#include <com/sun/star/ui/XUIElementFactory.hpp>
#include <com/sun/star/util/XURLTransformer.hpp>
#include <com/sun/star/util/URL.hpp>
+#include <com/sun/star/rendering/XSpriteCanvas.hpp>
#include <boost/bind.hpp>
#include <boost/function.hpp>
@@ -491,6 +493,7 @@ bool SidebarController::ArePanelSetsEqual (
const SharedPanelContainer& rCurrentPanels,
const ResourceManager::PanelContextDescriptorContainer& rRequestedPanels)
{
+#ifdef DEBUG
OSL_TRACE("current panel list:");
for (SharedPanelContainer::const_iterator
iPanel(rCurrentPanels.begin()),
@@ -510,6 +513,7 @@ bool SidebarController::ArePanelSetsEqual (
{
OSL_TRACE(" panel %s", S2A(iId->msId));
}
+#endif
if (rCurrentPanels.size() != rRequestedPanels.size())
return false;
@@ -553,7 +557,8 @@ SharedPanel SidebarController::CreatePanel (
// Create the XUIElement.
Reference<ui::XUIElement> xUIElement (CreateUIElement(
pPanel->GetComponentInterface(),
- pPanelDescriptor->msImplementationURL));
+ pPanelDescriptor->msImplementationURL,
+ pPanelDescriptor->mbWantsCanvas));
if (xUIElement.is())
{
// Initialize the panel and add it to the active deck.
@@ -572,7 +577,8 @@ SharedPanel SidebarController::CreatePanel (
Reference<ui::XUIElement> SidebarController::CreateUIElement (
const Reference<awt::XWindowPeer>& rxWindow,
- const ::rtl::OUString& rsImplementationURL)
+ const ::rtl::OUString& rsImplementationURL,
+ const bool bWantsCanvas)
{
try
{
@@ -590,6 +596,11 @@ Reference<ui::XUIElement> SidebarController::CreateUIElement (
aCreationArguments.put("SfxBindings", makeAny(sal_uInt64(&pSfxDockingWindow->GetBindings())));
aCreationArguments.put("Theme", Theme::GetPropertySet());
aCreationArguments.put("Sidebar", makeAny(Reference<ui::XSidebar>(static_cast<ui::XSidebar*>(this))));
+ if (bWantsCanvas)
+ {
+ Reference<rendering::XSpriteCanvas> xCanvas (VCLUnoHelper::GetWindow(rxWindow)->GetSpriteCanvas());
+ aCreationArguments.put("Canvas", makeAny(xCanvas));
+ }
Reference<ui::XUIElement> xUIElement(
xUIElementFactory->createUIElement(
diff --git a/sfx2/source/sidebar/SidebarController.hxx b/sfx2/source/sidebar/SidebarController.hxx
index 8902a73dd883..38ce50b1a23c 100644
--- a/sfx2/source/sidebar/SidebarController.hxx
+++ b/sfx2/source/sidebar/SidebarController.hxx
@@ -124,7 +124,8 @@ private:
const ResourceManager::PanelContextDescriptorContainer& rRequestedPanels);
cssu::Reference<css::ui::XUIElement> CreateUIElement (
const cssu::Reference<css::awt::XWindowPeer>& rxWindow,
- const ::rtl::OUString& rsImplementationURL);
+ const ::rtl::OUString& rsImplementationURL,
+ const bool bWantsCanvas);
SharedPanel CreatePanel (
const ::rtl::OUString& rsPanelId,
::Window* pParentWindow,