summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/svtools/genericunodialog.hxx25
-rw-r--r--svtools/source/uno/genericunodialog.cxx25
2 files changed, 5 insertions, 45 deletions
diff --git a/include/svtools/genericunodialog.hxx b/include/svtools/genericunodialog.hxx
index bd091ee87ceb..4c8dc6ed768a 100644
--- a/include/svtools/genericunodialog.hxx
+++ b/include/svtools/genericunodialog.hxx
@@ -65,18 +65,12 @@ namespace svt
public:
struct Dialog
{
- VclPtr<::Dialog> m_xVclDialog;
std::unique_ptr<weld::DialogController> m_xWeldDialog;
Dialog()
{
}
- Dialog(const VclPtr<::Dialog>& rVclDialog)
- : m_xVclDialog(rVclDialog)
- {
- }
-
Dialog(std::unique_ptr<weld::DialogController> pWeldDialog)
: m_xWeldDialog(std::move(pWeldDialog))
{
@@ -84,32 +78,22 @@ namespace svt
explicit operator bool() const
{
- return m_xVclDialog || m_xWeldDialog;
+ return static_cast<bool>(m_xWeldDialog);
}
void set_title(const OUString& rTitle)
{
- if (m_xWeldDialog)
- m_xWeldDialog->set_title(rTitle);
- else if (m_xVclDialog)
- m_xVclDialog->SetText(rTitle);
+ m_xWeldDialog->set_title(rTitle);
}
OString get_help_id() const
{
- if (m_xWeldDialog)
- return m_xWeldDialog->get_help_id();
- else if (m_xVclDialog)
- return m_xVclDialog->GetHelpId();
- return OString();
+ return m_xWeldDialog->get_help_id();
}
void set_help_id(const OString& rHelpId)
{
- if (m_xWeldDialog)
- return m_xWeldDialog->set_help_id(rHelpId);
- else if (m_xVclDialog)
- return m_xVclDialog->SetHelpId(rHelpId);
+ return m_xWeldDialog->set_help_id(rHelpId);
}
};
protected:
@@ -178,7 +162,6 @@ namespace svt
virtual void implInitialize(const css::uno::Any& _rValue);
private:
- DECL_LINK( OnDialogDying, VclWindowEvent&, void );
/** ensures that m_pDialog is not <NULL/>
diff --git a/svtools/source/uno/genericunodialog.cxx b/svtools/source/uno/genericunodialog.cxx
index 308c1b2987c9..d99c2593531f 100644
--- a/svtools/source/uno/genericunodialog.cxx
+++ b/svtools/source/uno/genericunodialog.cxx
@@ -174,12 +174,6 @@ bool OGenericUnoDialog::impl_ensureDialog_lck()
if (!m_bTitleAmbiguous)
aDialog.set_title(sTitle);
- if (aDialog.m_xVclDialog)
- {
- // be notified when the dialog is killed by somebody else #i65958#
- aDialog.m_xVclDialog->AddEventListener(LINK(this, OGenericUnoDialog, OnDialogDying));
- }
-
m_aDialog = std::move(aDialog);
return true;
@@ -190,7 +184,6 @@ sal_Int16 SAL_CALL OGenericUnoDialog::execute()
// both creation and execution of the dialog must be guarded with the SolarMutex, so be generous here
SolarMutexGuard aSolarGuard;
- ::Dialog* pVclDialogToExecute = nullptr;
// create the dialog, if necessary
{
UnoDialogEntryGuard aGuard( *this );
@@ -205,15 +198,11 @@ sal_Int16 SAL_CALL OGenericUnoDialog::execute()
if ( !impl_ensureDialog_lck() )
return 0;
-
- pVclDialogToExecute = m_aDialog.m_xVclDialog;
}
// start execution
sal_Int16 nReturn(0);
- if (pVclDialogToExecute)
- nReturn = pVclDialogToExecute->Execute();
- else if (m_aDialog.m_xWeldDialog)
+ if (m_aDialog.m_xWeldDialog)
nReturn = m_aDialog.m_xWeldDialog->run();
{
@@ -250,7 +239,6 @@ void OGenericUnoDialog::implInitialize(const Any& _rValue)
}
}
-
void SAL_CALL OGenericUnoDialog::initialize( const Sequence< Any >& aArguments )
{
::osl::MutexGuard aGuard( m_aMutex );
@@ -263,23 +251,12 @@ void SAL_CALL OGenericUnoDialog::initialize( const Sequence< Any >& aArguments )
m_bInitialized = true;
}
-
void OGenericUnoDialog::destroyDialog()
{
SolarMutexGuard aSolarGuard;
- m_aDialog.m_xVclDialog.disposeAndClear();
m_aDialog.m_xWeldDialog.reset();
}
-
-IMPL_LINK( OGenericUnoDialog, OnDialogDying, VclWindowEvent&, _rEvent, void )
-{
- OSL_ENSURE( _rEvent.GetWindow() == m_aDialog.m_xVclDialog, "OGenericUnoDialog::OnDialogDying: where does this come from?" );
- if ( _rEvent.GetId() == VclEventId::ObjectDying )
- m_aDialog.m_xVclDialog = nullptr;
-}
-
-
} // namespace svt