diff options
Diffstat (limited to 'sw/source/core/doc')
-rw-r--r-- | sw/source/core/doc/DocumentDeviceManager.cxx | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/sw/source/core/doc/DocumentDeviceManager.cxx b/sw/source/core/doc/DocumentDeviceManager.cxx index e0c0b7d09be8..18da1249341c 100644 --- a/sw/source/core/doc/DocumentDeviceManager.cxx +++ b/sw/source/core/doc/DocumentDeviceManager.cxx @@ -34,6 +34,7 @@ #include <printdata.hxx> #include <vcl/mapmod.hxx> #include <svl/itemset.hxx> +#include <cfgitems.hxx> #include <cmdid.h> #include <drawdoc.hxx> #include <wdocsh.hxx> @@ -297,6 +298,14 @@ SfxPrinter& DocumentDeviceManager::CreatePrinter_() const FN_PARAM_ADDPRINTER, FN_PARAM_ADDPRINTER>{}); VclPtr<SfxPrinter> pNewPrt = VclPtr<SfxPrinter>::Create( std::move(pSet) ); + + // assign PrintData to newly created printer + const SwPrintData& rPrtData = getPrintData(); + SwAddPrinterItem aAddPrinterItem(rPrtData); + SfxItemSet aOptions(pNewPrt->GetOptions()); + aOptions.Put(aAddPrinterItem); + pNewPrt->SetOptions(aOptions); + const_cast<DocumentDeviceManager*>(this)->setPrinter( pNewPrt, true, true ); return *mpPrt; } |