summaryrefslogtreecommitdiff
path: root/avmedia
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2022-09-09 20:30:53 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-09-10 12:19:13 +0200
commit16987d2aae9e0ed052de8a8f7155070c4b05cf4a (patch)
tree19a8216f86c3b263165a8152d24a75b0bd946678 /avmedia
parent9e67902277421aa3fae3bf10eb7bb8b70259c78e (diff)
unique_ptr->optional for Graphic
Graphic is just a wrapper around shared_ptr, so no need to allocate this separately Change-Id: Ie657dea1c021e66a6876e814090a44cb6f995b91 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139739 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'avmedia')
-rw-r--r--avmedia/source/viewer/mediawindow.cxx14
1 files changed, 7 insertions, 7 deletions
diff --git a/avmedia/source/viewer/mediawindow.cxx b/avmedia/source/viewer/mediawindow.cxx
index df8110f54e0d..27397fcbcf7a 100644
--- a/avmedia/source/viewer/mediawindow.cxx
+++ b/avmedia/source/viewer/mediawindow.cxx
@@ -369,7 +369,7 @@ MediaWindow::grabFrame(const uno::Reference<media::XPlayer>& xPlayer,
const uno::Reference<graphic::XGraphic>& rGraphic)
{
uno::Reference< graphic::XGraphic > xRet;
- std::unique_ptr< Graphic > xGraphic;
+ std::optional< Graphic > oGraphic;
if( xPlayer.is() )
{
@@ -392,22 +392,22 @@ MediaWindow::grabFrame(const uno::Reference<media::XPlayer>& xPlayer,
if( !aPrefSize.Width && !aPrefSize.Height )
{
const BitmapEx aBmpEx(AVMEDIA_BMP_AUDIOLOGO);
- xGraphic.reset( new Graphic( aBmpEx ) );
+ oGraphic.emplace( aBmpEx );
}
}
}
- if (!xRet.is() && !xGraphic)
+ if (!xRet.is() && !oGraphic)
{
const BitmapEx aBmpEx(AVMEDIA_BMP_EMPTYLOGO);
- xGraphic.reset( new Graphic( aBmpEx ) );
+ oGraphic.emplace( aBmpEx );
}
- if (xGraphic)
+ if (oGraphic)
{
if (rGraphic)
- xGraphic.reset(new Graphic(rGraphic));
- xRet = xGraphic->GetXGraphic();
+ oGraphic.emplace(rGraphic);
+ xRet = oGraphic->GetXGraphic();
}
return xRet;