summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 e787ce40fca8..d96e6d7e87ac 100644
--- a/include/vcl/print.hxx
+++ b/include/vcl/print.hxx
@@ -387,7 +387,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
{
@@ -516,6 +516,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 0007daf4a2f8..1be88db77133 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 fbbde7b5d770..d4518bba4889 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;