summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/sfx2/sidebar/Panel.hxx4
-rw-r--r--include/sfx2/sidebar/SidebarController.hxx4
-rw-r--r--sfx2/source/sidebar/Panel.cxx16
-rw-r--r--sfx2/source/sidebar/SidebarController.cxx5
4 files changed, 19 insertions, 10 deletions
diff --git a/include/sfx2/sidebar/Panel.hxx b/include/sfx2/sidebar/Panel.hxx
index cd820ff937b2..92e57abc13fd 100644
--- a/include/sfx2/sidebar/Panel.hxx
+++ b/include/sfx2/sidebar/Panel.hxx
@@ -70,7 +70,7 @@ public:
{
return mxPanelComponent;
}
- css::uno::Reference<css::awt::XWindow> GetElementParentWindow() const { return mxXWindow; }
+ css::uno::Reference<css::awt::XWindow> GetElementParentWindow();
css::uno::Reference<css::awt::XWindow> GetElementWindow();
void SetExpanded(const bool bIsExpanded);
bool IsExpanded() const { return mbIsExpanded; }
@@ -98,7 +98,7 @@ private:
const css::uno::Reference<css::frame::XFrame>& mxFrame;
std::unique_ptr<PanelTitleBar> mxTitleBar;
std::unique_ptr<weld::Container> mxContents;
- css::uno::Reference<css::awt::XWindow> mxXWindow;
+ css::uno::Reference<css::awt::XWindow> mxAwtXWindow;
};
typedef std::vector<VclPtr<Panel>> SharedPanelContainer;
diff --git a/include/sfx2/sidebar/SidebarController.hxx b/include/sfx2/sidebar/SidebarController.hxx
index 1c38211d11c1..8bcaa858ff1c 100644
--- a/include/sfx2/sidebar/SidebarController.hxx
+++ b/include/sfx2/sidebar/SidebarController.hxx
@@ -39,7 +39,7 @@
#include <cppuhelper/compbase.hxx>
#include <cppuhelper/basemutex.hxx>
-namespace com::sun::star::awt { class XWindowPeer; }
+namespace com::sun::star::awt { class XWindow; }
namespace com::sun::star::frame { class XDispatch; }
namespace com::sun::star::ui { class XUIElement; }
@@ -231,7 +231,7 @@ private:
void UpdateConfigurations();
css::uno::Reference<css::ui::XUIElement> CreateUIElement (
- const css::uno::Reference<css::awt::XWindowPeer>& rxWindow,
+ const css::uno::Reference<css::awt::XWindow>& rxWindow,
const OUString& rsImplementationURL,
const bool bWantsCanvas,
const Context& rContext);
diff --git a/sfx2/source/sidebar/Panel.cxx b/sfx2/source/sidebar/Panel.cxx
index 7c66838b2d8e..41cfbc096abb 100644
--- a/sfx2/source/sidebar/Panel.cxx
+++ b/sfx2/source/sidebar/Panel.cxx
@@ -60,7 +60,7 @@ Panel::Panel(const PanelDescriptor& rPanelDescriptor,
, mxFrame(rxFrame)
, mxTitleBar(new PanelTitleBar(rPanelDescriptor.msTitle, *m_xBuilder, this))
, mxContents(m_xBuilder->weld_container("contents"))
- , mxXWindow(mxContents->CreateChildFrame())
+ , mxAwtXWindow(mxContents->CreateChildFrame())
{
SetText(rPanelDescriptor.msTitle);
mxContents->set_visible(mbIsExpanded);
@@ -111,8 +111,11 @@ void Panel::dispose()
mxTitleBar.reset();
- mxXWindow->dispose();
- mxXWindow.clear();
+ if (mxAwtXWindow)
+ {
+ mxAwtXWindow->dispose();
+ mxAwtXWindow.clear();
+ }
mxContents.reset();
InterimItemWindow::dispose();
@@ -181,6 +184,13 @@ Reference<awt::XWindow> Panel::GetElementWindow()
return nullptr;
}
+Reference<awt::XWindow> Panel::GetElementParentWindow()
+{
+ if (!mxAwtXWindow)
+ mxAwtXWindow = mxContents->CreateChildFrame();
+ return mxAwtXWindow;
+}
+
} // 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 e6a24e3b632a..dce668892c16 100644
--- a/sfx2/source/sidebar/SidebarController.cxx
+++ b/sfx2/source/sidebar/SidebarController.cxx
@@ -954,9 +954,8 @@ VclPtr<Panel> SidebarController::CreatePanel (
mxFrame);
// Create the XUIElement.
- Reference<awt::XWindowPeer> xPeer(pPanel->GetElementParentWindow(), UNO_QUERY);
Reference<ui::XUIElement> xUIElement (CreateUIElement(
- xPeer,
+ pPanel->GetElementParentWindow(),
xPanelDescriptor->msImplementationURL,
xPanelDescriptor->mbWantsCanvas,
rContext));
@@ -974,7 +973,7 @@ VclPtr<Panel> SidebarController::CreatePanel (
}
Reference<ui::XUIElement> SidebarController::CreateUIElement (
- const Reference<awt::XWindowPeer>& rxWindow,
+ const Reference<awt::XWindow>& rxWindow,
const OUString& rsImplementationURL,
const bool bWantsCanvas,
const Context& rContext)