diff options
Diffstat (limited to 'chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx')
-rw-r--r-- | chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx b/chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx index 973b8fa74027..3a1fa1386f7a 100644 --- a/chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx +++ b/chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx @@ -22,22 +22,25 @@ #include <ChartModel.hxx> #include <servicenames.hxx> #include <TimerTriggeredControllerLock.hxx> +#include <utility> #include <vcl/svapp.hxx> +#include <vcl/weldutils.hxx> #include <cppuhelper/supportsservice.hxx> #include <com/sun/star/awt/Point.hpp> #include <com/sun/star/awt/Size.hpp> #include <com/sun/star/beans/PropertyValue.hpp> #include <com/sun/star/frame/Desktop.hpp> -#include <tools/diagnose_ex.h> +#include <comphelper/diagnose_ex.hxx> #include <sfx2/viewsh.hxx> + namespace chart { using namespace ::com::sun::star; -CreationWizardUnoDlg::CreationWizardUnoDlg(const uno::Reference<uno::XComponentContext>& xContext) +CreationWizardUnoDlg::CreationWizardUnoDlg(uno::Reference<uno::XComponentContext> xContext) : OComponentHelper(m_aMutex) - , m_xCC(xContext) + , m_xCC(std::move(xContext)) , m_bUnlockControllersOnExecute(false) { uno::Reference< frame::XDesktop2 > xDesktop = frame::Desktop::create(m_xCC); @@ -166,10 +169,18 @@ void CreationWizardUnoDlg::createDialogOnDemand() m_xParentWindow = xFrame->getContainerWindow(); } } + + weld::Window* pParent(Application::GetFrameWeld(m_xParentWindow)); + if (!pParent) + { + if (weld::TransportAsXWindow* pTunnel = dynamic_cast<weld::TransportAsXWindow*>(m_xParentWindow.get())) + pParent = dynamic_cast<weld::Window*>(pTunnel->getWidget()); + } + uno::Reference< XComponent > xKeepAlive( this ); if( m_xChartModel.is() ) { - m_xDialog = std::make_shared<CreationWizard>(Application::GetFrameWeld(m_xParentWindow), m_xChartModel, m_xCC); + m_xDialog = std::make_shared<CreationWizard>(pParent, m_xChartModel, m_xCC); } } |