From 0c33e80bd0091c928be4209ff6210844ee5465a7 Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Thu, 1 Nov 2018 07:29:50 +0100 Subject: Limit the unique_ptr scope to get rid of .reset() Change-Id: I5d852f4d7f5de24ff49eaada6f53cd197ee2d0f7 Reviewed-on: https://gerrit.libreoffice.org/62715 Tested-by: Jenkins Reviewed-by: Mike Kaganski --- sd/source/filter/ppt/pptin.cxx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'sd') diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx index 5f19b38cdd2b..0d7842a6db8c 100644 --- a/sd/source/filter/ppt/pptin.cxx +++ b/sd/source/filter/ppt/pptin.cxx @@ -137,11 +137,10 @@ SdPPTImport::SdPPTImport( SdDrawDocument* pDocument, SvStream& rDocStream, SotSt pSummaryInformation.reset(); #endif - std::unique_ptr pCurrentUserStream(rStorage.OpenSotStream( "Current User", StreamMode::STD_READ )); - if( pCurrentUserStream ) + if (auto pCurrentUserStream + = std::unique_ptr(rStorage.OpenSotStream("Current User", StreamMode::STD_READ))) { ReadPptCurrentUserAtom(*pCurrentUserStream, maParam.aCurrentUserAtom); - pCurrentUserStream.reset(); } if( pDocument ) -- cgit