Author: af
Date: Thu Apr 11 13:04:57 2013
New Revision: 1466871
URL: http://svn.apache.org/r1466871
Log:
121420: Provide sidebar panels with XCanvas objects.
Modified:
openoffice/trunk/main/sfx2/source/sidebar/SidebarController.cxx
openoffice/trunk/main/sfx2/source/sidebar/SidebarController.hxx
Modified: openoffice/trunk/main/sfx2/source/sidebar/SidebarController.cxx
URL:
http://svn.apache.org/viewvc/openoffice/trunk/main/sfx2/source/sidebar/SidebarController.cxx?rev=1466871&r1=1466870&r2=1466871&view=diff
==============================================================================
--- openoffice/trunk/main/sfx2/source/sidebar/SidebarController.cxx (original)
+++ openoffice/trunk/main/sfx2/source/sidebar/SidebarController.cxx Thu Apr 11
13:04:57 2013
@@ -41,6 +41,8 @@
#include "splitwin.hxx"
#include <svl/smplhint.hxx>
#include <tools/link.hxx>
+#include <toolkit/helper/vclunohelper.hxx>
+
#include <comphelper/componentfactory.hxx>
#include <comphelper/processfactory.hxx>
#include <comphelper/componentcontext.hxx>
@@ -53,6 +55,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>
@@ -498,6 +501,7 @@ bool SidebarController::ArePanelSetsEqua
const SharedPanelContainer& rCurrentPanels,
const ResourceManager::PanelContextDescriptorContainer& rRequestedPanels)
{
+#ifdef DEBUG
OSL_TRACE("current panel list:");
for (SharedPanelContainer::const_iterator
iPanel(rCurrentPanels.begin()),
@@ -517,6 +521,7 @@ bool SidebarController::ArePanelSetsEqua
{
OSL_TRACE(" panel %s", S2A(iId->msId));
}
+#endif
if (rCurrentPanels.size() != rRequestedPanels.size())
return false;
@@ -560,7 +565,8 @@ SharedPanel SidebarController::CreatePan
// 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.
@@ -579,7 +585,8 @@ SharedPanel SidebarController::CreatePan
Reference<ui::XUIElement> SidebarController::CreateUIElement (
const Reference<awt::XWindowPeer>& rxWindow,
- const ::rtl::OUString& rsImplementationURL)
+ const ::rtl::OUString& rsImplementationURL,
+ const bool bWantsCanvas)
{
try
{
@@ -597,6 +604,11 @@ Reference<ui::XUIElement> SidebarControl
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(
Modified: openoffice/trunk/main/sfx2/source/sidebar/SidebarController.hxx
URL:
http://svn.apache.org/viewvc/openoffice/trunk/main/sfx2/source/sidebar/SidebarController.hxx?rev=1466871&r1=1466870&r2=1466871&view=diff
==============================================================================
--- openoffice/trunk/main/sfx2/source/sidebar/SidebarController.hxx (original)
+++ openoffice/trunk/main/sfx2/source/sidebar/SidebarController.hxx Thu Apr 11
13:04:57 2013
@@ -128,7 +128,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,