[Libreoffice-commits] core.git: filter/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Mon Dec 17 21:06:31 UTC 2018
filter/source/xsltdialog/xmlfilterdialogcomponent.cxx | 26 ++++++++++--------
filter/source/xsltdialog/xmlfiltersettingsdialog.cxx | 4 --
filter/source/xsltdialog/xmlfiltersettingsdialog.hxx | 2 -
3 files changed, 17 insertions(+), 15 deletions(-)
New commits:
commit cabc14a343142e53ab1ef0085b023bb7fadcf449
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Mon Dec 17 16:53:35 2018 +0000
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Mon Dec 17 22:06:09 2018 +0100
Resolves: tdf#122153 keep Execute for modal dialogs
and not modeless ones
cause you get one main loop running inside another, and everything
is running inside the modeless dialog main loop until it exits.
Change-Id: I45e92380288727669e287b62e84b815d5dc1960c
Reviewed-on: https://gerrit.libreoffice.org/65281
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/filter/source/xsltdialog/xmlfilterdialogcomponent.cxx b/filter/source/xsltdialog/xmlfilterdialogcomponent.cxx
index ffa2eebdcf7b..9b5dd734002f 100644
--- a/filter/source/xsltdialog/xmlfilterdialogcomponent.cxx
+++ b/filter/source/xsltdialog/xmlfilterdialogcomponent.cxx
@@ -265,7 +265,6 @@ void SAL_CALL XMLFilterDialogComponent::queryTermination( const EventObject& /*
mpDialog->Close();
}
-
void SAL_CALL XMLFilterDialogComponent::notifyTermination( const EventObject& /* Event */ )
{
// we are going down, so dispose us!
@@ -276,35 +275,41 @@ void SAL_CALL XMLFilterDialogComponent::disposing( const EventObject& /* Source
{
}
-
void SAL_CALL XMLFilterDialogComponent::setTitle( const OUString& /* _rTitle */ )
{
}
-
-sal_Int16 SAL_CALL XMLFilterDialogComponent::execute( )
+sal_Int16 SAL_CALL XMLFilterDialogComponent::execute()
{
::SolarMutexGuard aGuard;
- if( nullptr == mpDialog )
+ bool bLaunch = false;
+ if (!mpDialog)
{
Reference< XComponent > xComp( this );
if (mxParent.is())
mpDialog = VclPtr<XMLFilterSettingsDialog>::Create(VCLUnoHelper::GetWindow(mxParent), mxContext);
else
mpDialog = VclPtr<XMLFilterSettingsDialog>::Create(nullptr, mxContext, Dialog::InitFlag::NoParent);
- mpDialog->Execute();
+ bLaunch = true;
}
- else if( !mpDialog->IsVisible() )
+
+ mpDialog->UpdateWindow();
+
+ if (!bLaunch)
{
- mpDialog->Execute();
+ mpDialog->ToTop();
+ return 0;
}
- mpDialog->ToTop();
+
+ mpDialog->StartExecuteAsync([this](sal_Int32)
+ {
+ mpDialog.reset();
+ });
return 0;
}
-
void SAL_CALL XMLFilterDialogComponent::initialize( const Sequence< Any >& aArguments )
{
for(const Any& rArgument : aArguments)
@@ -320,7 +325,6 @@ void SAL_CALL XMLFilterDialogComponent::initialize( const Sequence< Any >& aArgu
}
}
-
extern "C"
{
SAL_DLLPUBLIC_EXPORT void * xsltdlg_component_getFactory(
diff --git a/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx b/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx
index 1f7f769c39ac..5ae90948e75c 100644
--- a/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx
+++ b/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx
@@ -179,15 +179,13 @@ IMPL_LINK_NOARG(XMLFilterSettingsDialog, DoubleClickHdl_Impl, SvTreeListBox*, bo
return false;
}
-short XMLFilterSettingsDialog::Execute()
+void XMLFilterSettingsDialog::UpdateWindow()
{
m_pCtrlFilterList->GrabFocus();
disposeFilterList();
m_pFilterListBox->Clear();
initFilterList();
updateStates();
-
- return ModelessDialog::Execute();
}
void XMLFilterSettingsDialog::updateStates()
diff --git a/filter/source/xsltdialog/xmlfiltersettingsdialog.hxx b/filter/source/xsltdialog/xmlfiltersettingsdialog.hxx
index 816e75ac72bb..ff55a19f9b5a 100644
--- a/filter/source/xsltdialog/xmlfiltersettingsdialog.hxx
+++ b/filter/source/xsltdialog/xmlfiltersettingsdialog.hxx
@@ -92,7 +92,7 @@ public:
DECL_LINK(SelectionChangedHdl_Impl, SvTreeListBox*, void );
DECL_LINK(DoubleClickHdl_Impl, SvTreeListBox*, bool );
- virtual short Execute() override;
+ void UpdateWindow();
void onNew();
void onEdit();
More information about the Libreoffice-commits
mailing list