summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-07-01 21:12:26 +0100
committerAdolfo Jayme Barrientos <fitojb@ubuntu.com>2021-07-03 08:05:21 +0200
commitd1f203ec75c2fb8a15e75f540f89309a49a6d395 (patch)
tree4cc3759c10086b1dbc52846c4ac3532673ea95e3
parenttdf#140431 XLSX export: fix double file:// prefix (diff)
downloadcore-d1f203ec75c2fb8a15e75f540f89309a49a6d395.tar.gz
core-d1f203ec75c2fb8a15e75f540f89309a49a6d395.zip
tdf#143149 fix crash if app exits while print progress is running
dismiss the dialog if its parent goes away, but leave the print job running Change-Id: Ic29ee0300a7d9476ad27a2594a555312e30c74f2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118254 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com> (cherry picked from commit bc51aec4209729ea91a79a82506d18461183f570) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118267 Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com> Tested-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
-rw-r--r--include/vcl/print.hxx4
-rw-r--r--sfx2/source/view/viewprn.cxx1
-rw-r--r--vcl/source/gdi/print3.cxx11
3 files changed, 15 insertions, 1 deletions
diff --git a/include/vcl/print.hxx b/include/vcl/print.hxx
index 631b2f5b83fe..3d50fd089a60 100644
--- a/include/vcl/print.hxx
+++ b/include/vcl/print.hxx
@@ -380,7 +380,7 @@ class VCL_DLLPUBLIC PrinterController
std::unique_ptr<ImplPrinterControllerData>
mpImplData;
protected:
- PrinterController(const VclPtr<Printer>&, weld::Window*);
+ PrinterController(const VclPtr<Printer>&, weld::Window* pDialogParent);
public:
struct MultiPageSetup
{
@@ -509,6 +509,8 @@ public:
bool isShowDialogs() const;
bool isDirectPrint() const;
+ void dialogsParentClosing();
+
// implementation details, not usable outside vcl
// don't use outside vcl. Some of these are exported for
// the benefit of vcl's plugins.
diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx
index 796a505ed8d4..7ec660c7aff6 100644
--- a/sfx2/source/view/viewprn.cxx
+++ b/sfx2/source/view/viewprn.cxx
@@ -174,6 +174,7 @@ void SfxPrinterController::Notify( SfxBroadcaster& , const SfxHint& rHint )
{
EndListening(*mpViewShell);
EndListening(*mpObjectShell);
+ dialogsParentClosing();
mpViewShell = nullptr;
mpObjectShell = nullptr;
}
diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx
index 1cc0ce8c1c93..8b00e2d9f85b 100644
--- a/vcl/source/gdi/print3.cxx
+++ b/vcl/source/gdi/print3.cxx
@@ -779,6 +779,17 @@ weld::Window* PrinterController::getWindow() const
return mpImplData->mpWindow;
}
+void PrinterController::dialogsParentClosing()
+{
+ mpImplData->mpWindow = nullptr;
+ if (mpImplData->mxProgress)
+ {
+ // close the dialog without doing anything, just get rid of it
+ mpImplData->mxProgress->response(RET_OK);
+ mpImplData->mxProgress.reset();
+ }
+}
+
void PrinterController::setPrinter( const VclPtr<Printer>& i_rPrinter )
{
VclPtr<Printer> xPrinter = mpImplData->mxPrinter;