elide extracting vcl::Window from awt::XWindow
Change-Id: Ifb44471b996e20007ae49d09b212016ee77a4618 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112816 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
This commit is contained in:
@@ -38,7 +38,6 @@ enum class SfxCallMode : sal_uInt16;
|
||||
namespace com::sun::star::beans { struct PropertyValue; }
|
||||
namespace com::sun::star::frame { class XDispatchRecorder; }
|
||||
namespace com::sun::star::uno { template <class E> class Sequence; }
|
||||
namespace vcl { class Window; }
|
||||
namespace weld { class Window; }
|
||||
|
||||
class SFX2_DLLPUBLIC SfxRequest final : public SfxHint
|
||||
@@ -115,7 +114,6 @@ public:
|
||||
|
||||
/** Return the window that should be used as the parent for any dialogs this request creates
|
||||
*/
|
||||
vcl::Window* GetFrameWindow() const;
|
||||
weld::Window* GetFrameWeld() const;
|
||||
private:
|
||||
const SfxRequest& operator=(const SfxRequest &) = delete;
|
||||
|
||||
@@ -67,7 +67,6 @@
|
||||
|
||||
#include <unotools/moduleoptions.hxx>
|
||||
#include <svtools/helpopt.hxx>
|
||||
#include <toolkit/helper/vclunohelper.hxx>
|
||||
#include <rtl/bootstrap.hxx>
|
||||
|
||||
#include <com/sun/star/frame/ModuleManager.hpp>
|
||||
@@ -252,26 +251,6 @@ namespace
|
||||
return xFrame;
|
||||
}
|
||||
|
||||
vcl::Window* getFrameWindow(const Reference<XFrame>& rFrame)
|
||||
{
|
||||
if (rFrame.is())
|
||||
{
|
||||
try
|
||||
{
|
||||
Reference< awt::XWindow > xContainerWindow(rFrame->getContainerWindow(), UNO_SET_THROW);
|
||||
VclPtr<vcl::Window> pWindow = VCLUnoHelper::GetWindow(xContainerWindow);
|
||||
return pWindow;
|
||||
}
|
||||
catch (const Exception&)
|
||||
{
|
||||
DBG_UNHANDLED_EXCEPTION("sfx.appl");
|
||||
}
|
||||
}
|
||||
|
||||
SAL_WARN( "sfx.appl", "no parent for dialogs" );
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
class LicenseDialog : public weld::GenericDialogController
|
||||
{
|
||||
public:
|
||||
@@ -312,11 +291,6 @@ namespace
|
||||
};
|
||||
}
|
||||
|
||||
vcl::Window* SfxRequest::GetFrameWindow() const
|
||||
{
|
||||
return getFrameWindow(GetRequestFrame(*this));
|
||||
}
|
||||
|
||||
weld::Window* SfxRequest::GetFrameWeld() const
|
||||
{
|
||||
const SfxItemSet* pIntArgs = GetInternalArgs_Impl();
|
||||
@@ -330,8 +304,13 @@ weld::Window* SfxRequest::GetFrameWeld() const
|
||||
return Application::GetFrameWeld(xWindow);
|
||||
}
|
||||
|
||||
vcl::Window* pWin = GetFrameWindow();
|
||||
return pWin ? pWin->GetFrameWeld() : nullptr;
|
||||
Reference<XFrame> xFrame(GetRequestFrame(*this));
|
||||
if (!xFrame)
|
||||
{
|
||||
SAL_WARN("sfx.appl", "no parent for dialogs");
|
||||
return nullptr;
|
||||
}
|
||||
return Application::GetFrameWeld(xFrame->getContainerWindow());
|
||||
}
|
||||
|
||||
void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
|
||||
|
||||
Reference in New Issue
Block a user