diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-02-19 16:33:35 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-02-20 00:19:35 +0100 |
commit | 60ae5f530c3123341a8c2d49793693c2cd4521c2 (patch) | |
tree | d8cba0d2489a3e6ebcdc4559c797405217d3c179 /vcl/source | |
parent | 26b51c9550ef300e7685fc41eb9cde4dbbc11265 (diff) |
make it possible to set parent window for printer error messages
Change-Id: I0effa3645454ef9d03393ae8b256cd624ca04f03
Reviewed-on: https://gerrit.libreoffice.org/50008
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/gdi/oldprintadaptor.cxx | 6 | ||||
-rw-r--r-- | vcl/source/gdi/print3.cxx | 13 |
2 files changed, 13 insertions, 6 deletions
diff --git a/vcl/source/gdi/oldprintadaptor.cxx b/vcl/source/gdi/oldprintadaptor.cxx index a823a1be897c..8636034c6fbd 100644 --- a/vcl/source/gdi/oldprintadaptor.cxx +++ b/vcl/source/gdi/oldprintadaptor.cxx @@ -44,9 +44,9 @@ namespace vcl }; } -OldStylePrintAdaptor::OldStylePrintAdaptor( const VclPtr< Printer >& i_xPrinter ) - : PrinterController( i_xPrinter ) - , mpData( new ImplOldStyleAdaptorData ) +OldStylePrintAdaptor::OldStylePrintAdaptor(const VclPtr<Printer>& i_xPrinter, const VclPtr<vcl::Window>& i_xWindow) + : PrinterController(i_xPrinter, i_xWindow) + , mpData(new ImplOldStyleAdaptorData) { } diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx index 8659de290fb7..22edd1734de9 100644 --- a/vcl/source/gdi/print3.cxx +++ b/vcl/source/gdi/print3.cxx @@ -140,6 +140,7 @@ public: typedef std::unordered_map< OUString, css::uno::Sequence< sal_Bool > > ChoiceDisableMap; VclPtr< Printer > mxPrinter; + VclPtr<vcl::Window> mxWindow; css::uno::Sequence< css::beans::PropertyValue > maUIOptions; std::vector< css::beans::PropertyValue > maUIProperties; std::vector< bool > maUIPropertyEnabled; @@ -207,10 +208,11 @@ public: void resetPaperToLastConfigured(); }; -PrinterController::PrinterController( const VclPtr<Printer>& i_xPrinter ) +PrinterController::PrinterController(const VclPtr<Printer>& i_xPrinter, const VclPtr<vcl::Window>& i_xWindow) : mpImplData( new ImplPrinterControllerData ) { mpImplData->mxPrinter = i_xPrinter; + mpImplData->mxWindow = i_xWindow; } static OUString queryFile( Printer const * pPrinter ) @@ -304,7 +306,7 @@ bool Printer::PreparePrintJob(std::shared_ptr<PrinterController> xController, if (xController->isShowDialogs()) { ScopedVclPtrInstance<MessageDialog> aBox( - nullptr, "ErrorNoPrinterDialog", + xController->getWindow(), "ErrorNoPrinterDialog", "vcl/ui/errornoprinterdialog.ui"); aBox->Execute(); } @@ -455,7 +457,7 @@ bool Printer::PreparePrintJob(std::shared_ptr<PrinterController> xController, if( xController->getFilteredPageCount() == 0 ) { ScopedVclPtrInstance<MessageDialog> aBox( - nullptr, "ErrorNoContentDialog", + xController->getWindow(), "ErrorNoContentDialog", "vcl/ui/errornocontentdialog.ui"); aBox->Execute(); return false; @@ -768,6 +770,11 @@ const VclPtr<Printer>& PrinterController::getPrinter() const return mpImplData->mxPrinter; } +const VclPtr<vcl::Window>& PrinterController::getWindow() const +{ + return mpImplData->mxWindow; +} + void PrinterController::setPrinter( const VclPtr<Printer>& i_rPrinter ) { mpImplData->mxPrinter = i_rPrinter; |