summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-11-21 10:14:59 +0000
committerCaolán McNamara <caolanm@redhat.com>2012-11-21 11:16:37 +0000
commite53da8804d00182cf83f67880e2799b15b70a46f (patch)
treea529648c9295ff3d8b220097f871710a3906e455
parente9be9ba808359d87675e20cc1c5c7e2c78e59c7d (diff)
xslt dialog is supposed to be a modeless dialog
and fix the lifecycle to die at the right time Change-Id: Ibe8f683ed162500a93e02a56d8607bd2ee431ded
-rw-r--r--desktop/source/deployment/gui/dp_gui_theextmgr.cxx17
-rw-r--r--filter/source/xsltdialog/xmlfilterdialogcomponent.cxx23
-rw-r--r--filter/source/xsltdialog/xmlfiltersettingsdialog.cxx6
-rw-r--r--filter/source/xsltdialog/xmlfiltersettingsdialog.hxx2
4 files changed, 24 insertions, 24 deletions
diff --git a/desktop/source/deployment/gui/dp_gui_theextmgr.cxx b/desktop/source/deployment/gui/dp_gui_theextmgr.cxx
index cfe9794f59a1..d8a80fdc612c 100644
--- a/desktop/source/deployment/gui/dp_gui_theextmgr.cxx
+++ b/desktop/source/deployment/gui/dp_gui_theextmgr.cxx
@@ -22,7 +22,7 @@
#include "osl/mutex.hxx"
-#include "toolkit/helper/vclunohelper.hxx"
+#include <toolkit/helper/vclunohelper.hxx>
#include "com/sun/star/beans/XPropertySet.hpp"
#include "com/sun/star/configuration/theDefaultProvider.hpp"
@@ -103,12 +103,9 @@ TheExtensionManager::TheExtensionManager( Window *pParent,
//------------------------------------------------------------------------------
TheExtensionManager::~TheExtensionManager()
{
- if ( m_pUpdReqDialog )
- delete m_pUpdReqDialog;
- if ( m_pExtMgrDialog )
- delete m_pExtMgrDialog;
- if ( m_pExecuteCmdQueue )
- delete m_pExecuteCmdQueue;
+ delete m_pUpdReqDialog;
+ delete m_pExtMgrDialog;
+ delete m_pExecuteCmdQueue;
}
//------------------------------------------------------------------------------
@@ -454,7 +451,7 @@ void TheExtensionManager::queryTermination( ::lang::EventObject const & )
{
ToTop( TOTOP_RESTOREWHENMIN );
throw frame::TerminationVetoException(
- OUSTR("The office cannot be closed while the Extension Manager is running"),
+ OUString("The office cannot be closed while the Extension Manager is running"),
uno::Reference<XInterface>(static_cast<frame::XTerminateListener*>(this), uno::UNO_QUERY));
}
else
@@ -496,8 +493,8 @@ void TheExtensionManager::modified( ::lang::EventObject const & /*rEvt*/ )
return s_ExtMgr;
}
- Window * pParent = DIALOG_NO_PARENT;
- if ( xParent.is() )
+ Window* pParent = DIALOG_NO_PARENT;
+ if (xParent.is())
pParent = VCLUnoHelper::GetWindow(xParent);
::rtl::Reference<TheExtensionManager> that( new TheExtensionManager( pParent, xContext ) );
diff --git a/filter/source/xsltdialog/xmlfilterdialogcomponent.cxx b/filter/source/xsltdialog/xmlfilterdialogcomponent.cxx
index 773219e2fc2f..bb6c6b682dfe 100644
--- a/filter/source/xsltdialog/xmlfilterdialogcomponent.cxx
+++ b/filter/source/xsltdialog/xmlfilterdialogcomponent.cxx
@@ -18,7 +18,7 @@
*/
#include <osl/mutex.hxx>
-#include <toolkit/awt/vclxwindow.hxx>
+#include <toolkit/helper/vclunohelper.hxx>
#include <osl/thread.h>
#include <cppuhelper/factory.hxx>
@@ -312,12 +312,19 @@ void SAL_CALL XMLFilterDialogComponent::queryTermination( const EventObject& /*
{
::SolarMutexGuard aGuard;
+ if (!mpDialog)
+ return;
+
// we will never give a veto here
- if( mpDialog && !mpDialog->isClosable() )
+ if (!mpDialog->isClosable())
{
mpDialog->ToTop();
- throw TerminationVetoException();
+ throw TerminationVetoException(
+ OUString("The office cannot be closed while the XMLFilterDialog is running"),
+ Reference<XInterface>(static_cast<XTerminateListener*>(this), UNO_QUERY));
}
+ else
+ mpDialog->Close();
}
//-------------------------------------------------------------------------
@@ -349,13 +356,9 @@ sal_Int16 SAL_CALL XMLFilterDialogComponent::execute( ) throw(RuntimeException)
if( NULL == mpDialog )
{
- Window* pParent = NULL;
- if( mxParent.is() )
- {
- VCLXWindow* pImplementation = VCLXWindow::GetImplementation(mxParent);
- if (pImplementation)
- pParent = pImplementation->GetWindow();
- }
+ Window* pParent = DIALOG_NO_PARENT;
+ if (mxParent.is())
+ pParent = VCLUnoHelper::GetWindow(mxParent);
Reference< XComponent > xComp( this );
mpDialog = new XMLFilterSettingsDialog(pParent, mxMSF);
diff --git a/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx b/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx
index fc04e65495e7..69b3e986dcb7 100644
--- a/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx
+++ b/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx
@@ -57,7 +57,7 @@ using ::rtl::Uri;
XMLFilterSettingsDialog::XMLFilterSettingsDialog(Window* pParent,
const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rxMSF)
- : Dialog(pParent, "XMLFilterSettingsDialog", "filter/ui/xmlfiltersettings.ui")
+ : ModelessDialog(pParent, "XMLFilterSettingsDialog", "filter/ui/xmlfiltersettings.ui")
, mxMSF( rxMSF )
, m_bIsClosable(true)
, m_sTemplatePath("$(user)/template/")
@@ -176,7 +176,7 @@ short XMLFilterSettingsDialog::Execute()
initFilterList();
updateStates();
- return Dialog::Execute();
+ return ModelessDialog::Execute();
}
// -----------------------------------------------------------------------
@@ -1016,7 +1016,7 @@ void XMLFilterSettingsDialog::onClose()
long XMLFilterSettingsDialog::Notify( NotifyEvent& rNEvt )
{
// Zuerst Basisklasse rufen wegen TabSteuerung
- long nRet = Dialog::Notify( rNEvt );
+ long nRet = ModelessDialog::Notify( rNEvt );
if ( !nRet )
{
if ( rNEvt.GetType() == EVENT_KEYINPUT )
diff --git a/filter/source/xsltdialog/xmlfiltersettingsdialog.hxx b/filter/source/xsltdialog/xmlfiltersettingsdialog.hxx
index 006d4e0544ec..0c0e4a7f8c3d 100644
--- a/filter/source/xsltdialog/xmlfiltersettingsdialog.hxx
+++ b/filter/source/xsltdialog/xmlfiltersettingsdialog.hxx
@@ -82,7 +82,7 @@ public:
// --------------------------------------------------------------------
-class XMLFilterSettingsDialog : public Dialog
+class XMLFilterSettingsDialog : public ModelessDialog
{
public:
XMLFilterSettingsDialog(Window* pParent,