summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-01-15 10:08:08 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-01-16 09:59:29 +0100
commit112d32a543f6431e3048d2744d80156db786e094 (patch)
treeee038c6e6f0ff88278e5871cfaee50db85a72cd5 /sc
parent649ee85cd0f96d7532220ca244dee7b85fa4065b (diff)
use unique_ptr in ScHTMLLayoutParser::Image
Change-Id: If580fda8445894cbf3ed174d86673851a98af73c Reviewed-on: https://gerrit.libreoffice.org/66421 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/filter/html/htmlpars.cxx9
1 files changed, 4 insertions, 5 deletions
diff --git a/sc/source/filter/html/htmlpars.cxx b/sc/source/filter/html/htmlpars.cxx
index bce592228825..a7d14a5fdb85 100644
--- a/sc/source/filter/html/htmlpars.cxx
+++ b/sc/source/filter/html/htmlpars.cxx
@@ -1327,12 +1327,11 @@ void ScHTMLLayoutParser::Image( HtmlImportInfo* pInfo )
}
sal_uInt16 nFormat;
- Graphic* pGraphic = new Graphic;
+ std::unique_ptr<Graphic> pGraphic(new Graphic);
GraphicFilter& rFilter = GraphicFilter::GetGraphicFilter();
if ( ERRCODE_NONE != GraphicFilter::LoadGraphic( pImage->aURL, pImage->aFilterName,
*pGraphic, &rFilter, &nFormat ) )
{
- delete pGraphic;
return ; // Bad luck
}
if (!mxActEntry->bHasGraphic)
@@ -1341,12 +1340,12 @@ void ScHTMLLayoutParser::Image( HtmlImportInfo* pInfo )
mxActEntry->aAltText.clear();
}
pImage->aFilterName = rFilter.GetImportFormatName( nFormat );
- pImage->pGraphic.reset( pGraphic );
+ pImage->pGraphic = std::move( pGraphic );
if ( !(pImage->aSize.Width() && pImage->aSize.Height()) )
{
OutputDevice* pDefaultDev = Application::GetDefaultDevice();
- pImage->aSize = pDefaultDev->LogicToPixel( pGraphic->GetPrefSize(),
- pGraphic->GetPrefMapMode() );
+ pImage->aSize = pDefaultDev->LogicToPixel( pImage->pGraphic->GetPrefSize(),
+ pImage->pGraphic->GetPrefMapMode() );
}
if (!mxActEntry->maImageList.empty())
{