diff options
Diffstat (limited to 'sd/source')
-rw-r--r-- | sd/source/core/drawdoc3.cxx | 4 | ||||
-rw-r--r-- | sd/source/filter/xml/sdxmlwrp.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/dlg/navigatr.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/docshell/docshel4.cxx | 6 | ||||
-rw-r--r-- | sd/source/ui/func/fuinsfil.cxx | 10 | ||||
-rw-r--r-- | sd/source/ui/unoidl/sddetect.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/view/sdview4.cxx | 4 |
7 files changed, 15 insertions, 17 deletions
diff --git a/sd/source/core/drawdoc3.cxx b/sd/source/core/drawdoc3.cxx index 7e11c55bf7cf..176cc3257584 100644 --- a/sd/source/core/drawdoc3.cxx +++ b/sd/source/core/drawdoc3.cxx @@ -202,11 +202,11 @@ SdDrawDocument* SdDrawDocument::OpenBookmarkDoc(SfxMedium& rMedium) bool bOK = true; SdDrawDocument* pBookmarkDoc = nullptr; OUString aBookmarkName = rMedium.GetName(); - const SfxFilter* pFilter = rMedium.GetFilter(); + std::shared_ptr<const SfxFilter> pFilter = rMedium.GetFilter(); if ( !pFilter ) { rMedium.UseInteractionHandler( true ); - SfxGetpApp()->GetFilterMatcher().GuessFilter( rMedium, &pFilter ); + SfxGetpApp()->GetFilterMatcher().GuessFilter( rMedium, pFilter ); } if ( !pFilter ) diff --git a/sd/source/filter/xml/sdxmlwrp.cxx b/sd/source/filter/xml/sdxmlwrp.cxx index 5829e61ad552..91ba7a6c7cb0 100644 --- a/sd/source/filter/xml/sdxmlwrp.cxx +++ b/sd/source/filter/xml/sdxmlwrp.cxx @@ -783,7 +783,7 @@ bool SdXMLFilter::Import( ErrCode& nError ) else { // check for binary formats - const SfxFilter * pFilter = mrMedium.GetFilter(); + std::shared_ptr<const SfxFilter> pFilter = mrMedium.GetFilter(); if( pFilter ) { OUString typeName(pFilter->GetRealTypeName()); diff --git a/sd/source/ui/dlg/navigatr.cxx b/sd/source/ui/dlg/navigatr.cxx index bbee98c57b1c..8003a4aec1ee 100644 --- a/sd/source/ui/dlg/navigatr.cxx +++ b/sd/source/ui/dlg/navigatr.cxx @@ -579,7 +579,7 @@ bool SdNavigatorWin::InsertFile(const OUString& rFileName) else { // show dragged-in document - const SfxFilter* pFilter = nullptr; + std::shared_ptr<const SfxFilter> pFilter; ErrCode nErr = 0; if (aFileName != maDropFileName) @@ -587,7 +587,7 @@ bool SdNavigatorWin::InsertFile(const OUString& rFileName) SfxMedium aMed(aFileName, (StreamMode::READ | StreamMode::SHARE_DENYNONE)); SfxFilterMatcher aMatch( OUString("simpress") ); aMed.UseInteractionHandler( true ); - nErr = aMatch.GuessFilter(aMed, &pFilter); + nErr = aMatch.GuessFilter(aMed, pFilter); } if ((pFilter && !nErr) || aFileName == maDropFileName) diff --git a/sd/source/ui/docshell/docshel4.cxx b/sd/source/ui/docshell/docshel4.cxx index ff5999d6d030..71ac8e4e45dd 100644 --- a/sd/source/ui/docshell/docshel4.cxx +++ b/sd/source/ui/docshell/docshel4.cxx @@ -572,7 +572,7 @@ bool DrawDocShell::ConvertTo( SfxMedium& rMedium ) if( mpDoc->GetPageCount() ) { - const SfxFilter* pMediumFilter = rMedium.GetFilter(); + std::shared_ptr<const SfxFilter> pMediumFilter = rMedium.GetFilter(); const OUString aTypeName( pMediumFilter->GetTypeName() ); SdFilter* pFilter = nullptr; @@ -613,8 +613,6 @@ bool DrawDocShell::ConvertTo( SfxMedium& rMedium ) bRet = pFilter->Export(); if( !bRet ) mpDoc->SetSwapGraphicsMode( nOldSwapMode ); - - delete pFilter; } } @@ -945,7 +943,7 @@ bool DrawDocShell::GetObjectIsmarked(const OUString& rBookmark, bool bRealizeMul bool DrawDocShell::SaveAsOwnFormat( SfxMedium& rMedium ) { - const SfxFilter* pFilter = rMedium.GetFilter(); + std::shared_ptr<const SfxFilter> pFilter = rMedium.GetFilter(); if (pFilter->IsOwnTemplateFormat()) { diff --git a/sd/source/ui/func/fuinsfil.cxx b/sd/source/ui/func/fuinsfil.cxx index e057342b7c26..04aba7188a9d 100644 --- a/sd/source/ui/func/fuinsfil.cxx +++ b/sd/source/ui/func/fuinsfil.cxx @@ -97,7 +97,7 @@ OUString lcl_GetExtensionsList ( ::std::vector< FilterDesc > const& rFilterDescL } void lcl_AddFilter ( ::std::vector< FilterDesc >& rFilterDescList, - const SfxFilter *pFilter ) + std::shared_ptr<const SfxFilter> pFilter ) { if (pFilter) rFilterDescList.push_back( ::std::make_pair( pFilter->GetUIName(), pFilter->GetDefaultExtension() ) ); @@ -165,7 +165,7 @@ void FuInsertFile::DoExecute( SfxRequest& rReq ) try { // Get main filter - const SfxFilter* pFilter = SfxFilter::GetDefaultFilterFromFactory( aOwnCont ); + std::shared_ptr<const SfxFilter> pFilter = SfxFilter::GetDefaultFilterFromFactory( aOwnCont ); lcl_AddFilter( aFilterVector, pFilter ); // get template filter @@ -259,9 +259,9 @@ void FuInsertFile::DoExecute( SfxRequest& rReq ) mpDocSh->SetWaitCursor( true ); std::unique_ptr<SfxMedium> xMedium(new SfxMedium(aFile, StreamMode::READ | StreamMode::NOCREATE)); - const SfxFilter* pFilter = nullptr; + std::shared_ptr<const SfxFilter> pFilter; - SfxGetpApp()->GetFilterMatcher().GuessFilter(*xMedium, &pFilter); + SfxGetpApp()->GetFilterMatcher().GuessFilter(*xMedium, pFilter); bool bDrawMode = mpViewShell && dynamic_cast< const DrawViewShell *>( mpViewShell ) != nullptr; bool bInserted = false; @@ -726,7 +726,7 @@ bool FuInsertFile::InsSDDinOlMode(SfxMedium* pMedium) void FuInsertFile::GetSupportedFilterVector( ::std::vector< OUString >& rFilterVector ) { SfxFilterMatcher& rMatcher = SfxGetpApp()->GetFilterMatcher(); - const SfxFilter* pSearchFilter = nullptr; + std::shared_ptr<const SfxFilter> pSearchFilter; rFilterVector.clear(); diff --git a/sd/source/ui/unoidl/sddetect.cxx b/sd/source/ui/unoidl/sddetect.cxx index 4eff4b14fb55..5ad76a4bbeb5 100644 --- a/sd/source/ui/unoidl/sddetect.cxx +++ b/sd/source/ui/unoidl/sddetect.cxx @@ -123,7 +123,7 @@ OUString SAL_CALL SdFilterDetect::detect( Sequence< beans::PropertyValue >& lDes } SfxFilterMatcher aMatch("sdraw"); - const SfxFilter* pFilter = aMatch.GetFilter4FilterName( aName ); + std::shared_ptr<const SfxFilter> pFilter = aMatch.GetFilter4FilterName( aName ); if ( pFilter ) return pFilter->GetRealTypeName(); } diff --git a/sd/source/ui/view/sdview4.cxx b/sd/source/ui/view/sdview4.cxx index ffda4fe52287..c13639fb8e16 100644 --- a/sd/source/ui/view/sdview4.cxx +++ b/sd/source/ui/view/sdview4.cxx @@ -446,9 +446,9 @@ IMPL_LINK_NOARG_TYPED(View, DropInsertFileHdl, Idle *, void) } if( !bOK ) { - const SfxFilter* pFoundFilter = nullptr; + std::shared_ptr<const SfxFilter> pFoundFilter; SfxMedium aSfxMedium( aCurrentDropFile, StreamMode::READ | StreamMode::SHARE_DENYNONE ); - ErrCode nErr = SfxGetpApp()->GetFilterMatcher().GuessFilter( aSfxMedium, &pFoundFilter ); + ErrCode nErr = SfxGetpApp()->GetFilterMatcher().GuessFilter( aSfxMedium, pFoundFilter ); if( pFoundFilter && !nErr ) { |