diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2017-06-13 18:03:18 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2017-06-13 18:03:18 +0200 |
commit | cbdd3c32703fd21b6911b5a6fc5803faeed9befb (patch) | |
tree | 34d88820a086096e8f36c00c0c68dad1269ffc41 /sc/source/ui/unoobj/confuno.cxx | |
parent | 423dacde87cbb3cba466c9701ed10dadc2b8b4e0 (diff) |
Use unique_ptr for SfxPrinter::pOptions
Change-Id: I46be77225c0323f8b7f293de9c022f0de6f425b7
Diffstat (limited to 'sc/source/ui/unoobj/confuno.cxx')
-rw-r--r-- | sc/source/ui/unoobj/confuno.cxx | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/sc/source/ui/unoobj/confuno.cxx b/sc/source/ui/unoobj/confuno.cxx index ea4fa66be20e..1cbab301bb6d 100644 --- a/sc/source/ui/unoobj/confuno.cxx +++ b/sc/source/ui/unoobj/confuno.cxx @@ -17,6 +17,10 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <sal/config.h> + +#include <utility> + #include <config_features.h> #include "confuno.hxx" @@ -33,6 +37,7 @@ #include <com/sun/star/document/LinkUpdateModes.hpp> #include <cppuhelper/supportsservice.hxx> #include <formula/grammar.hxx> +#include <o3tl/make_unique.hxx> #include <sfx2/printer.hxx> #include <xmloff/xmluconv.hxx> #include <rtl/ustrbuf.hxx> @@ -207,7 +212,7 @@ void SAL_CALL ScDocumentConfiguration::setPropertyValue( { if (pPrinter->GetName() != sPrinterName) { - VclPtrInstance<SfxPrinter> pNewPrinter( pPrinter->GetOptions().Clone(), sPrinterName ); + VclPtrInstance<SfxPrinter> pNewPrinter( std::unique_ptr<SfxItemSet>(pPrinter->GetOptions().Clone()), sPrinterName ); if (pNewPrinter->IsKnown()) pDocShell->SetPrinter( pNewPrinter, SfxPrinterChangeFlags::PRINTER ); else @@ -232,13 +237,13 @@ void SAL_CALL ScDocumentConfiguration::setPropertyValue( { SvMemoryStream aStream (aSequence.getArray(), nSize, StreamMode::READ ); aStream.Seek ( STREAM_SEEK_TO_BEGIN ); - SfxItemSet* pSet = new SfxItemSet( *rDoc.GetPool(), + auto pSet = o3tl::make_unique<SfxItemSet>( *rDoc.GetPool(), SID_PRINTER_NOTFOUND_WARN, SID_PRINTER_NOTFOUND_WARN, SID_PRINTER_CHANGESTODOC, SID_PRINTER_CHANGESTODOC, SID_PRINT_SELECTEDSHEET, SID_PRINT_SELECTEDSHEET, SID_SCPRINTOPTIONS, SID_SCPRINTOPTIONS, nullptr ); - pDocShell->SetPrinter( SfxPrinter::Create( aStream, pSet ) ); + pDocShell->SetPrinter( SfxPrinter::Create( aStream, std::move(pSet) ) ); } } } |