From 66df14370e9e2d633369b446954d2a0bc0064ab6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Fri, 18 Oct 2019 16:47:23 +0100 Subject: [PATCH] drop unused ModalDialog class MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I3186b63d4c6c437ff0c0653a6b6c7fd61ae69304 Reviewed-on: https://gerrit.libreoffice.org/81069 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- include/vcl/dialog.hxx | 15 --------------- vcl/README.lifecycle | 4 ++-- vcl/qa/cppunit/lifecycle.cxx | 2 +- vcl/source/window/dialog.cxx | 5 ----- 4 files changed, 3 insertions(+), 23 deletions(-) diff --git a/include/vcl/dialog.hxx b/include/vcl/dialog.hxx index 5e4398546d04..15827443ba45 100644 --- a/include/vcl/dialog.hxx +++ b/include/vcl/dialog.hxx @@ -166,21 +166,6 @@ public: vcl::Window* get_widget_for_response(int nResponse); }; -class VCL_DLLPUBLIC ModalDialog : public Dialog -{ -public: - explicit ModalDialog( vcl::Window* pParent, const OUString& rID, const OUString& rUIXMLDescription ); - -protected: - using Window::Show; - using Window::Hide; - -private: - - SAL_DLLPRIVATE ModalDialog (const ModalDialog &) = delete; - SAL_DLLPRIVATE ModalDialog & operator= (const ModalDialog &) = delete; -}; - #endif // INCLUDED_VCL_DIALOG_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/README.lifecycle b/vcl/README.lifecycle index c7dc05812b03..a309b65ef9ea 100644 --- a/vcl/README.lifecycle +++ b/vcl/README.lifecycle @@ -308,11 +308,11 @@ ways and often both. Window that has already been destroyed. This can easily happen via this sort of pattern: - ModalDialog *pDlg = VclPtr(nullptr /* parent */); + Dialog *pDlg = VclPtr(nullptr /* parent */); // by here the pDlg quite probably points to free'd memory... It is necessary in these cases to ensure that the *pDlg is - a VclPtr instead. + a VclPtr instead. ** It crashes with some invalid memory #2... diff --git a/vcl/qa/cppunit/lifecycle.cxx b/vcl/qa/cppunit/lifecycle.cxx index 5b97c0114962..51d90776bb44 100644 --- a/vcl/qa/cppunit/lifecycle.cxx +++ b/vcl/qa/cppunit/lifecycle.cxx @@ -297,7 +297,7 @@ void LifecycleTest::testLeakage() aObjects.push_back(LeakTestObject::Create(xVBox)); } - aObjects.push_back(LeakTestObject::Create(xParent, "PrintProgressDialog", "vcl/ui/printprogressdialog.ui")); + aObjects.push_back(LeakTestObject::Create(xParent, "PrintProgressDialog", "vcl/ui/printprogressdialog.ui")); xParent.clear(); for (auto i = aObjects.rbegin(); i != aObjects.rend(); ++i) diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx index fcb40df71d7a..f0c54aef9b9c 100644 --- a/vcl/source/window/dialog.cxx +++ b/vcl/source/window/dialog.cxx @@ -1517,11 +1517,6 @@ VclBuilderContainer::~VclBuilderContainer() { } -ModalDialog::ModalDialog( vcl::Window* pParent, const OUString& rID, const OUString& rUIXMLDescription ) : - Dialog(pParent, rID, rUIXMLDescription, WindowType::MODALDIALOG, InitFlag::Default) -{ -} - void Dialog::Activate() { if (GetType() == WindowType::MODELESSDIALOG)