diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-08-13 14:49:37 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-08-15 08:40:38 +0200 |
commit | 3deaeb9380d43d35cba82e1427492ca6ad0ea01f (patch) | |
tree | 39bbf725b963512d6cf9e451ec5e6e06f67ada0f /sfx2 | |
parent | 9467f10de690c622a210120e1963b2d755875a6b (diff) |
pass IMapObject around by std::unique_ptr
and avoid some unnecessary copying
Change-Id: Ieb9b1fe169a7d56197bf1e054e9af5dca7804301
Reviewed-on: https://gerrit.libreoffice.org/59019
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/bastyp/sfxhtml.cxx | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/sfx2/source/bastyp/sfxhtml.cxx b/sfx2/source/bastyp/sfxhtml.cxx index e64dd7ed714e..40095fdbb7fb 100644 --- a/sfx2/source/bastyp/sfxhtml.cxx +++ b/sfx2/source/bastyp/sfxhtml.cxx @@ -182,22 +182,22 @@ IMAPOBJ_SETEVENT: { tools::Rectangle aRect( aCoords[0], aCoords[1], aCoords[2], aCoords[3] ); - IMapRectangleObject aMapRObj( aRect, aHRef, aAlt, OUString(), aTarget, aName, - !bNoHRef ); + std::unique_ptr<IMapRectangleObject> pMapRObj( new IMapRectangleObject(aRect, aHRef, aAlt, OUString(), aTarget, aName, + !bNoHRef )); if( !aMacroTbl.empty() ) - aMapRObj.SetMacroTable( aMacroTbl ); - pImageMap->InsertIMapObject( aMapRObj ); + pMapRObj->SetMacroTable( aMacroTbl ); + pImageMap->InsertIMapObject( std::move(pMapRObj) ); } break; case IMAP_OBJ_CIRCLE: if( aCoords.size() >=3 ) { Point aPoint( aCoords[0], aCoords[1] ); - IMapCircleObject aMapCObj( aPoint, aCoords[2],aHRef, aAlt, OUString(), - aTarget, aName, !bNoHRef ); + std::unique_ptr<IMapCircleObject> pMapCObj(new IMapCircleObject(aPoint, aCoords[2],aHRef, aAlt, OUString(), + aTarget, aName, !bNoHRef )); if( !aMacroTbl.empty() ) - aMapCObj.SetMacroTable( aMacroTbl ); - pImageMap->InsertIMapObject( aMapCObj ); + pMapCObj->SetMacroTable( aMacroTbl ); + pImageMap->InsertIMapObject( std::move(pMapCObj) ); } break; case IMAP_OBJ_POLYGON: @@ -207,11 +207,11 @@ IMAPOBJ_SETEVENT: tools::Polygon aPoly( nCount ); for( sal_uInt16 i=0; i<nCount; i++ ) aPoly[i] = Point( aCoords[2*i], aCoords[2*i+1] ); - IMapPolygonObject aMapPObj( aPoly, aHRef, aAlt, OUString(), aTarget, aName, - !bNoHRef ); + std::unique_ptr<IMapPolygonObject> pMapPObj(new IMapPolygonObject( aPoly, aHRef, aAlt, OUString(), aTarget, aName, + !bNoHRef )); if( !aMacroTbl.empty() ) - aMapPObj.SetMacroTable( aMacroTbl ); - pImageMap->InsertIMapObject( aMapPObj ); + pMapPObj->SetMacroTable( aMacroTbl ); + pImageMap->InsertIMapObject( std::move(pMapPObj) ); } break; default: |