summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-09-15 20:41:25 +0100
committerCaolán McNamara <caolanm@redhat.com>2019-09-20 21:25:12 +0200
commit024a57017384a61b4a61056f1de275f44642bef3 (patch)
tree6d9896c34326c1ef79325dd6e8d8730a40df5c4a /svtools
parente0750697dcd30848411a162453813c5b0fafc44b (diff)
drop newly unnecessary OGenericUnoDialog::Dialog
Change-Id: If047d08cea93fdfacff9ee00c69cf57ba08c916c Reviewed-on: https://gerrit.libreoffice.org/78972 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svtools')
-rw-r--r--svtools/source/uno/addrtempuno.cxx13
-rw-r--r--svtools/source/uno/genericunodialog.cxx26
-rw-r--r--svtools/source/uno/wizard/unowizard.cxx44
3 files changed, 41 insertions, 42 deletions
diff --git a/svtools/source/uno/addrtempuno.cxx b/svtools/source/uno/addrtempuno.cxx
index 777883ae0615..7af43f88e95c 100644
--- a/svtools/source/uno/addrtempuno.cxx
+++ b/svtools/source/uno/addrtempuno.cxx
@@ -71,7 +71,7 @@ namespace {
protected:
// OGenericUnoDialog overridables
- virtual svt::OGenericUnoDialog::Dialog createDialog(const css::uno::Reference<css::awt::XWindow>& rParent) override;
+ virtual std::unique_ptr<weld::DialogController> createDialog(const css::uno::Reference<css::awt::XWindow>& rParent) override;
virtual void implInitialize(const css::uno::Any& _rValue) override;
@@ -128,8 +128,8 @@ namespace {
{
OGenericUnoDialog::executedDialog(_nExecutionResult);
- if ( _nExecutionResult && m_aDialog )
- static_cast<AddressBookSourceDialog*>(m_aDialog.m_xWeldDialog.get())->getFieldMapping(m_aAliases);
+ if ( _nExecutionResult && m_xDialog )
+ static_cast<AddressBookSourceDialog*>(m_xDialog.get())->getFieldMapping(m_aAliases);
}
void SAL_CALL OAddressBookSourceDialogUno::initialize(const Sequence< Any >& rArguments)
@@ -194,13 +194,12 @@ namespace {
OGenericUnoDialog::implInitialize( _rValue );
}
- svt::OGenericUnoDialog::Dialog OAddressBookSourceDialogUno::createDialog(const css::uno::Reference<css::awt::XWindow>& rParent)
+ std::unique_ptr<weld::DialogController> OAddressBookSourceDialogUno::createDialog(const css::uno::Reference<css::awt::XWindow>& rParent)
{
weld::Window* pParent = Application::GetFrameWeld(rParent);
if ( m_xDataSource.is() && !m_sTable.isEmpty() )
- return svt::OGenericUnoDialog::Dialog(std::make_unique<AddressBookSourceDialog>(pParent, m_aContext, m_xDataSource, m_sDataSourceName, m_sTable, m_aAliases));
- else
- return svt::OGenericUnoDialog::Dialog(std::make_unique<AddressBookSourceDialog>(pParent, m_aContext));
+ return std::make_unique<AddressBookSourceDialog>(pParent, m_aContext, m_xDataSource, m_sDataSourceName, m_sTable, m_aAliases);
+ return std::make_unique<AddressBookSourceDialog>(pParent, m_aContext);
}
}
diff --git a/svtools/source/uno/genericunodialog.cxx b/svtools/source/uno/genericunodialog.cxx
index d99c2593531f..e4e61c2d52cd 100644
--- a/svtools/source/uno/genericunodialog.cxx
+++ b/svtools/source/uno/genericunodialog.cxx
@@ -58,11 +58,11 @@ OGenericUnoDialog::OGenericUnoDialog(const Reference< XComponentContext >& _rxCo
OGenericUnoDialog::~OGenericUnoDialog()
{
- if (m_aDialog)
+ if (m_xDialog)
{
SolarMutexGuard aSolarGuard;
::osl::MutexGuard aGuard( m_aMutex );
- if (m_aDialog)
+ if (m_xDialog)
destroyDialog();
}
}
@@ -108,8 +108,8 @@ void OGenericUnoDialog::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, con
// from now on m_sTitle is valid
m_bTitleAmbiguous = false;
- if (m_aDialog)
- m_aDialog.set_title(m_sTitle);
+ if (m_xDialog)
+ m_xDialog->set_title(m_sTitle);
}
}
@@ -157,7 +157,7 @@ void SAL_CALL OGenericUnoDialog::setTitle( const OUString& _rTitle )
bool OGenericUnoDialog::impl_ensureDialog_lck()
{
- if (m_aDialog)
+ if (m_xDialog)
return true;
// get the parameters for the dialog from the current settings
@@ -165,16 +165,16 @@ bool OGenericUnoDialog::impl_ensureDialog_lck()
// the title
OUString sTitle = m_sTitle;
- OGenericUnoDialog::Dialog aDialog(createDialog(m_xParent));
- OSL_ENSURE(aDialog, "OGenericUnoDialog::impl_ensureDialog_lck: createDialog returned nonsense!");
- if (!aDialog)
+ auto xDialog(createDialog(m_xParent));
+ OSL_ENSURE(xDialog, "OGenericUnoDialog::impl_ensureDialog_lck: createDialog returned nonsense!");
+ if (!xDialog)
return false;
// do some initialisations
if (!m_bTitleAmbiguous)
- aDialog.set_title(sTitle);
+ xDialog->set_title(sTitle);
- m_aDialog = std::move(aDialog);
+ m_xDialog = std::move(xDialog);
return true;
}
@@ -202,8 +202,8 @@ sal_Int16 SAL_CALL OGenericUnoDialog::execute()
// start execution
sal_Int16 nReturn(0);
- if (m_aDialog.m_xWeldDialog)
- nReturn = m_aDialog.m_xWeldDialog->run();
+ if (m_xDialog)
+ nReturn = m_xDialog->run();
{
::osl::MutexGuard aGuard(m_aMutex);
@@ -254,7 +254,7 @@ void SAL_CALL OGenericUnoDialog::initialize( const Sequence< Any >& aArguments )
void OGenericUnoDialog::destroyDialog()
{
SolarMutexGuard aSolarGuard;
- m_aDialog.m_xWeldDialog.reset();
+ m_xDialog.reset();
}
} // namespace svt
diff --git a/svtools/source/uno/wizard/unowizard.cxx b/svtools/source/uno/wizard/unowizard.cxx
index 856d0ba3dafc..decbada6b887 100644
--- a/svtools/source/uno/wizard/unowizard.cxx
+++ b/svtools/source/uno/wizard/unowizard.cxx
@@ -130,7 +130,7 @@ namespace {
virtual ~Wizard() override;
protected:
- virtual OGenericUnoDialog::Dialog createDialog(const css::uno::Reference<css::awt::XWindow>& rParent) override;
+ virtual std::unique_ptr<weld::DialogController> createDialog(const css::uno::Reference<css::awt::XWindow>& rParent) override;
private:
css::uno::Sequence< css::uno::Sequence< sal_Int16 > > m_aWizardSteps;
@@ -157,12 +157,12 @@ namespace {
Wizard::~Wizard()
{
- if (m_aDialog)
+ if (m_xDialog)
{
::osl::MutexGuard aGuard( m_aMutex );
- if (m_aDialog)
+ if (m_xDialog)
{
- m_sHelpURL = lcl_getHelpURL(m_aDialog.get_help_id());
+ m_sHelpURL = lcl_getHelpURL(m_xDialog->get_help_id());
destroyDialog();
}
}
@@ -245,12 +245,12 @@ namespace {
return OUStringToOString( _rHelpURL, RTL_TEXTENCODING_UTF8 );
}
- svt::OGenericUnoDialog::Dialog Wizard::createDialog(const css::uno::Reference<css::awt::XWindow>& rParent)
+ std::unique_ptr<weld::DialogController> Wizard::createDialog(const css::uno::Reference<css::awt::XWindow>& rParent)
{
auto xDialog = std::make_unique<WizardShell>(Application::GetFrameWeld(rParent), m_xController, m_aWizardSteps);
xDialog->set_help_id(lcl_getHelpId(m_sHelpURL));
xDialog->setTitleBase( m_sTitle );
- return OGenericUnoDialog::Dialog(std::move(xDialog));
+ return xDialog;
}
OUString SAL_CALL Wizard::getImplementationName()
@@ -286,10 +286,10 @@ namespace {
SolarMutexGuard aSolarGuard;
::osl::MutexGuard aGuard( m_aMutex );
- if (!m_aDialog)
+ if (!m_xDialog)
return m_sHelpURL;
- return lcl_getHelpURL(m_aDialog.get_help_id());
+ return lcl_getHelpURL(m_xDialog->get_help_id());
}
void SAL_CALL Wizard::setHelpURL( const OUString& i_HelpURL )
@@ -297,10 +297,10 @@ namespace {
SolarMutexGuard aSolarGuard;
::osl::MutexGuard aGuard( m_aMutex );
- if (!m_aDialog)
+ if (!m_xDialog)
m_sHelpURL = i_HelpURL;
else
- m_aDialog.set_help_id(lcl_getHelpId(i_HelpURL));
+ m_xDialog->set_help_id(lcl_getHelpId(i_HelpURL));
}
Reference< XWindow > SAL_CALL Wizard::getDialogWindow()
@@ -308,8 +308,8 @@ namespace {
SolarMutexGuard aSolarGuard;
::osl::MutexGuard aGuard( m_aMutex );
- ENSURE_OR_RETURN( m_aDialog.m_xWeldDialog, "Wizard::getDialogWindow: illegal call (execution did not start, yet)!", nullptr );
- return m_aDialog.m_xWeldDialog->getDialog()->GetXWindow();
+ ENSURE_OR_RETURN( m_xDialog, "Wizard::getDialogWindow: illegal call (execution did not start, yet)!", nullptr );
+ return m_xDialog->getDialog()->GetXWindow();
}
void SAL_CALL Wizard::enableButton( ::sal_Int16 i_WizardButton, sal_Bool i_Enable )
@@ -317,7 +317,7 @@ namespace {
SolarMutexGuard aSolarGuard;
::osl::MutexGuard aGuard( m_aMutex );
- WizardShell* pWizardImpl = dynamic_cast< WizardShell* >( m_aDialog.m_xWeldDialog.get() );
+ WizardShell* pWizardImpl = dynamic_cast<WizardShell*>(m_xDialog.get());
ENSURE_OR_RETURN_VOID( pWizardImpl, "Wizard::enableButtons: invalid dialog implementation!" );
pWizardImpl->enableButtons( lcl_convertWizardButtonToWZB( i_WizardButton ), i_Enable );
@@ -328,7 +328,7 @@ namespace {
SolarMutexGuard aSolarGuard;
::osl::MutexGuard aGuard( m_aMutex );
- WizardShell* pWizardImpl = dynamic_cast< WizardShell* >( m_aDialog.m_xWeldDialog.get() );
+ WizardShell* pWizardImpl = dynamic_cast<WizardShell*>(m_xDialog.get());
ENSURE_OR_RETURN_VOID( pWizardImpl, "Wizard::setDefaultButton: invalid dialog implementation!" );
pWizardImpl->defaultButton( lcl_convertWizardButtonToWZB( i_WizardButton ) );
@@ -339,7 +339,7 @@ namespace {
SolarMutexGuard aSolarGuard;
::osl::MutexGuard aGuard( m_aMutex );
- WizardShell* pWizardImpl = dynamic_cast< WizardShell* >( m_aDialog.m_xWeldDialog.get() );
+ WizardShell* pWizardImpl = dynamic_cast<WizardShell*>(m_xDialog.get());
ENSURE_OR_RETURN_FALSE( pWizardImpl, "Wizard::travelNext: invalid dialog implementation!" );
return pWizardImpl->travelNext();
@@ -350,7 +350,7 @@ namespace {
SolarMutexGuard aSolarGuard;
::osl::MutexGuard aGuard( m_aMutex );
- WizardShell* pWizardImpl = dynamic_cast< WizardShell* >( m_aDialog.m_xWeldDialog.get() );
+ WizardShell* pWizardImpl = dynamic_cast<WizardShell*>(m_xDialog.get());
ENSURE_OR_RETURN_FALSE( pWizardImpl, "Wizard::travelPrevious: invalid dialog implementation!" );
return pWizardImpl->travelPrevious();
@@ -361,7 +361,7 @@ namespace {
SolarMutexGuard aSolarGuard;
::osl::MutexGuard aGuard( m_aMutex );
- WizardShell* pWizardImpl = dynamic_cast< WizardShell* >( m_aDialog.m_xWeldDialog.get() );
+ WizardShell* pWizardImpl = dynamic_cast<WizardShell*>(m_xDialog.get());
ENSURE_OR_RETURN_VOID( pWizardImpl, "Wizard::enablePage: invalid dialog implementation!" );
if ( !pWizardImpl->knowsPage( i_PageID ) )
@@ -378,7 +378,7 @@ namespace {
SolarMutexGuard aSolarGuard;
::osl::MutexGuard aGuard( m_aMutex );
- WizardShell* pWizardImpl = dynamic_cast< WizardShell* >( m_aDialog.m_xWeldDialog.get() );
+ WizardShell* pWizardImpl = dynamic_cast<WizardShell*>(m_xDialog.get());
ENSURE_OR_RETURN_VOID( pWizardImpl, "Wizard::updateTravelUI: invalid dialog implementation!" );
pWizardImpl->updateTravelUI();
@@ -389,7 +389,7 @@ namespace {
SolarMutexGuard aSolarGuard;
::osl::MutexGuard aGuard( m_aMutex );
- WizardShell* pWizardImpl = dynamic_cast< WizardShell* >( m_aDialog.m_xWeldDialog.get() );
+ WizardShell* pWizardImpl = dynamic_cast<WizardShell*>(m_xDialog.get());
ENSURE_OR_RETURN_FALSE( pWizardImpl, "Wizard::advanceTo: invalid dialog implementation!" );
return pWizardImpl->advanceTo( i_PageId );
@@ -400,7 +400,7 @@ namespace {
SolarMutexGuard aSolarGuard;
::osl::MutexGuard aGuard( m_aMutex );
- WizardShell* pWizardImpl = dynamic_cast< WizardShell* >( m_aDialog.m_xWeldDialog.get() );
+ WizardShell* pWizardImpl = dynamic_cast<WizardShell*>(m_xDialog.get());
ENSURE_OR_RETURN_FALSE( pWizardImpl, "Wizard::goBackTo: invalid dialog implementation!" );
return pWizardImpl->goBackTo( i_PageId );
@@ -411,7 +411,7 @@ namespace {
SolarMutexGuard aSolarGuard;
::osl::MutexGuard aGuard( m_aMutex );
- WizardShell* pWizardImpl = dynamic_cast< WizardShell* >( m_aDialog.m_xWeldDialog.get() );
+ WizardShell* pWizardImpl = dynamic_cast<WizardShell*>(m_xDialog.get());
ENSURE_OR_RETURN( pWizardImpl, "Wizard::getCurrentPage: invalid dialog implementation!", Reference< XWizardPage >() );
return pWizardImpl->getCurrentWizardPage();
@@ -425,7 +425,7 @@ namespace {
if ( ( i_PathIndex < 0 ) || ( i_PathIndex >= m_aWizardSteps.getLength() ) )
throw NoSuchElementException( OUString(), *this );
- WizardShell* pWizardImpl = dynamic_cast< WizardShell* >( m_aDialog.m_xWeldDialog.get() );
+ WizardShell* pWizardImpl = dynamic_cast<WizardShell*>(m_xDialog.get());
ENSURE_OR_RETURN_VOID( pWizardImpl, "Wizard::activatePath: invalid dialog implementation!" );
pWizardImpl->activatePath( i_PathIndex, i_Final );