diff options
Diffstat (limited to 'sfx2/source')
-rw-r--r-- | sfx2/source/appl/appopen.cxx | 3 | ||||
-rw-r--r-- | sfx2/source/dialog/tabdlg.cxx | 9 | ||||
-rw-r--r-- | sfx2/source/doc/printhelper.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/view/printer.cxx | 10 | ||||
-rw-r--r-- | sfx2/source/view/viewprn.cxx | 8 |
5 files changed, 15 insertions, 17 deletions
diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx index 24bfc02def63..47ba55e34947 100644 --- a/sfx2/source/appl/appopen.cxx +++ b/sfx2/source/appl/appopen.cxx @@ -385,7 +385,7 @@ ErrCode SfxApplication::LoadTemplate( SfxObjectShellLock& xDoc, const OUString & css::uno::Reference< css::frame::XModel > xModel ( xDoc->GetModel(), css::uno::UNO_QUERY ); if ( xModel.is() ) { - SfxItemSet* pNew = xDoc->GetMedium()->GetItemSet()->Clone(); + std::unique_ptr<SfxItemSet> pNew = xDoc->GetMedium()->GetItemSet()->Clone(); pNew->ClearItem( SID_PROGRESS_STATUSBAR_CONTROL ); pNew->ClearItem( SID_FILTER_NAME ); css::uno::Sequence< css::beans::PropertyValue > aArgs; @@ -395,7 +395,6 @@ ErrCode SfxApplication::LoadTemplate( SfxObjectShellLock& xDoc, const OUString & aArgs[nLength].Name = "Title"; aArgs[nLength].Value <<= xDoc->GetTitle( SFX_TITLE_DETECT ); xModel->attachResource( OUString(), aArgs ); - delete pNew; } return xDoc->GetErrorCode(); diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx index d24668bd59e2..d4db8a054e4a 100644 --- a/sfx2/source/dialog/tabdlg.cxx +++ b/sfx2/source/dialog/tabdlg.cxx @@ -372,8 +372,7 @@ void SfxTabDialog::dispose() m_pImpl.reset(); delete m_pSet; m_pSet = nullptr; - delete m_pOutSet; - m_pOutSet = nullptr; + m_pOutSet.reset(); delete m_pExampleSet; m_pExampleSet = nullptr; delete [] m_pRanges; @@ -487,7 +486,7 @@ void SfxTabDialog::Init_Impl(bool bFmtFlag) if ( m_pSet ) { m_pExampleSet = new SfxItemSet( *m_pSet ); - m_pOutSet = new SfxItemSet( *m_pSet->GetPool(), m_pSet->GetRanges() ); + m_pOutSet.reset(new SfxItemSet( *m_pSet->GetPool(), m_pSet->GetRanges() )); } } @@ -776,7 +775,7 @@ short SfxTabDialog::Ok() if ( !m_pOutSet ) { if ( m_pExampleSet ) - m_pOutSet = new SfxItemSet( *m_pExampleSet ); + m_pOutSet.reset(new SfxItemSet( *m_pExampleSet )); else if ( m_pSet ) m_pOutSet = m_pSet->Clone( false ); // without Items } @@ -1338,7 +1337,7 @@ void SfxTabDialog::SetInputSet( const SfxItemSet* pInSet ) if (!bSet && !m_pExampleSet && !m_pOutSet && m_pSet) { m_pExampleSet = new SfxItemSet( *m_pSet ); - m_pOutSet = new SfxItemSet( *m_pSet->GetPool(), m_pSet->GetRanges() ); + m_pOutSet.reset(new SfxItemSet( *m_pSet->GetPool(), m_pSet->GetRanges() )); } } diff --git a/sfx2/source/doc/printhelper.cxx b/sfx2/source/doc/printhelper.cxx index 8c6a9a4f2e2a..41c2f547c99b 100644 --- a/sfx2/source/doc/printhelper.cxx +++ b/sfx2/source/doc/printhelper.cxx @@ -345,7 +345,7 @@ void SfxPrintHelper::impl_setPrinter(const uno::Sequence< beans::PropertyValue > if ( aPrinterName != pPrinter->GetName() ) { - pPrinter = VclPtr<SfxPrinter>::Create( std::unique_ptr<SfxItemSet>(pPrinter->GetOptions().Clone()), aPrinterName ); + pPrinter = VclPtr<SfxPrinter>::Create( pPrinter->GetOptions().Clone(), aPrinterName ); nChangeFlags = SfxPrinterChangeFlags::PRINTER; } break; diff --git a/sfx2/source/view/printer.cxx b/sfx2/source/view/printer.cxx index 1036f63f872d..312241f71e63 100644 --- a/sfx2/source/view/printer.cxx +++ b/sfx2/source/view/printer.cxx @@ -157,7 +157,7 @@ VclPtr<SfxPrinter> SfxPrinter::Clone() const { if ( IsDefPrinter() ) { - VclPtr<SfxPrinter> pNewPrinter = VclPtr<SfxPrinter>::Create( std::unique_ptr<SfxItemSet>(GetOptions().Clone()) ); + VclPtr<SfxPrinter> pNewPrinter = VclPtr<SfxPrinter>::Create( GetOptions().Clone() ); pNewPrinter->SetJobSetup( GetJobSetup() ); pNewPrinter->SetPrinterProps( this ); pNewPrinter->SetMapMode( GetMapMode() ); @@ -208,7 +208,7 @@ SfxPrintOptionsDialog::SfxPrintOptionsDialog(vcl::Window *pParent, DBG_ASSERT( pPage, "CreatePrintOptions != SFX_VIEW_HAS_PRINTOPTIONS" ); if( pPage ) { - pPage->Reset( pOptions ); + pPage->Reset( pOptions.get() ); SetHelpId( pPage->GetHelpId() ); pPage->Show(); } @@ -224,7 +224,7 @@ void SfxPrintOptionsDialog::dispose() { pDlgImpl.reset(); pPage.disposeAndClear(); - delete pOptions; + pOptions.reset(); ModalDialog::dispose(); } @@ -236,9 +236,9 @@ short SfxPrintOptionsDialog::Execute() short nRet = ModalDialog::Execute(); if ( nRet == RET_OK ) - pPage->FillItemSet( pOptions ); + pPage->FillItemSet( pOptions.get() ); else - pPage->Reset( pOptions ); + pPage->Reset( pOptions.get() ); return nRet; } diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx index 1d070d54e978..580a4b4295dd 100644 --- a/sfx2/source/view/viewprn.cxx +++ b/sfx2/source/view/viewprn.cxx @@ -380,7 +380,7 @@ void SfxPrinterController::jobFinished( css::view::PrintableState nState ) pDocPrt->SetJobSetup( getPrinter()->GetJobSetup() ); else { - VclPtr<SfxPrinter> pNewPrt = VclPtr<SfxPrinter>::Create( std::unique_ptr<SfxItemSet>(pDocPrt->GetOptions().Clone()), getPrinter()->GetName() ); + VclPtr<SfxPrinter> pNewPrt = VclPtr<SfxPrinter>::Create( pDocPrt->GetOptions().Clone(), getPrinter()->GetName() ); pNewPrt->SetJobSetup( getPrinter()->GetJobSetup() ); mpViewShell->SetPrinter( pNewPrt, SfxPrinterChangeFlags::PRINTER | SfxPrinterChangeFlags::JOBSETUP ); } @@ -438,7 +438,7 @@ IMPL_LINK_NOARG(SfxDialogExecutor_Impl, Execute, Button*, void) { DBG_ASSERT( _pSetupParent, "no dialog parent" ); if( _pSetupParent ) - _pOptions.reset( static_cast<SfxPrinter*>( _pSetupParent->GetPrinter() )->GetOptions().Clone() ); + _pOptions = static_cast<SfxPrinter*>( _pSetupParent->GetPrinter() )->GetOptions().Clone(); } assert(_pOptions); @@ -452,7 +452,7 @@ IMPL_LINK_NOARG(SfxDialogExecutor_Impl, Execute, Button*, void) pDlg->DisableHelp(); if ( pDlg->Execute() == RET_OK ) { - _pOptions.reset( pDlg->GetOptions().Clone() ); + _pOptions = pDlg->GetOptions().Clone(); } } @@ -765,7 +765,7 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq ) if ( pPrinterItem ) { // use PrinterName parameter to create a printer - pPrinter = VclPtr<SfxPrinter>::Create( std::unique_ptr<SfxItemSet>(pDocPrinter->GetOptions().Clone()), pPrinterItem->GetValue() ); + pPrinter = VclPtr<SfxPrinter>::Create( pDocPrinter->GetOptions().Clone(), pPrinterItem->GetValue() ); // if printer is unknown, it can't be used - now printer from document will be used if ( !pPrinter->IsKnown() ) |