summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-10-20 20:19:33 +0100
committerCaolán McNamara <caolanm@redhat.com>2018-10-21 20:12:15 +0200
commit6e15a3e2e45c21d947d36f47bfcb66d9f02b8c63 (patch)
treeb595b4eb012eca9aa3deeebefdd780c2c70cbe3b
parentf222cec758f62537b96d7681671f60212cc62a89 (diff)
pvs-studio: A part of conditional expression is always true: !pIStm
Change-Id: I32af1d0041cebdb195e6433a0b44fa6ea271275c Reviewed-on: https://gerrit.libreoffice.org/62105 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--vcl/source/graphic/UnoGraphicProvider.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/vcl/source/graphic/UnoGraphicProvider.cxx b/vcl/source/graphic/UnoGraphicProvider.cxx
index ef0fd14c0149..09e911c7bc3a 100644
--- a/vcl/source/graphic/UnoGraphicProvider.cxx
+++ b/vcl/source/graphic/UnoGraphicProvider.cxx
@@ -297,7 +297,6 @@ uno::Reference< ::graphic::XGraphic > SAL_CALL GraphicProvider::queryGraphic( co
{
uno::Reference< ::graphic::XGraphic > xRet;
OUString aPath;
- std::unique_ptr<SvStream> pIStm;
uno::Reference< io::XInputStream > xIStm;
uno::Reference< awt::XBitmap >xBtm;
@@ -307,7 +306,7 @@ uno::Reference< ::graphic::XGraphic > SAL_CALL GraphicProvider::queryGraphic( co
bool bLazyRead = false;
bool bLoadAsLink = false;
- for( sal_Int32 i = 0; ( i < rMediaProperties.getLength() ) && !pIStm && !xRet.is(); ++i )
+ for (sal_Int32 i = 0; ( i < rMediaProperties.getLength() ) && !xRet.is(); ++i)
{
const OUString aName( rMediaProperties[ i ].Name );
const uno::Any aValue( rMediaProperties[ i ].Value );
@@ -365,6 +364,8 @@ uno::Reference< ::graphic::XGraphic > SAL_CALL GraphicProvider::queryGraphic( co
SolarMutexGuard g;
+ std::unique_ptr<SvStream> pIStm;
+
if( xIStm.is() )
{
pIStm = ::utl::UcbStreamHelper::CreateStream( xIStm );