summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2024-04-07 20:23:26 +0100
committerNoel Grandin <noel.grandin@collabora.co.uk>2024-04-08 23:16:25 +0200
commite7bb3a52067c426eedffddf86e7d5f0903562da2 (patch)
treea655ee4aed8ceedc61dde01f68619f7202344045 /svx
parentc16f7ca43bb338f23895733ee499505ee6a6e72e (diff)
cid#1596254 Null pointer dereferences in GetSotStorageStream
Re-arrange the calling convention to make it obvious that a valid stream is the same as a good (true) result. Change-Id: I974b023a8e7231e70ab649628fdbe43c33001e5b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165874 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/gallery2/galtheme.cxx4
1 files changed, 1 insertions, 3 deletions
diff --git a/svx/source/gallery2/galtheme.cxx b/svx/source/gallery2/galtheme.cxx
index 857de6ecd413..2194fdd4d4a6 100644
--- a/svx/source/gallery2/galtheme.cxx
+++ b/svx/source/gallery2/galtheme.cxx
@@ -542,9 +542,7 @@ bool GalleryTheme::InsertTransferable(const uno::Reference< datatransfer::XTrans
if( aDataHelper.HasFormat( SotClipboardFormatId::DRAWING ) )
{
- std::unique_ptr<SvStream> xModelStm;
-
- if( aDataHelper.GetSotStorageStream( SotClipboardFormatId::DRAWING, xModelStm ) )
+ if (std::unique_ptr<SvStream> xModelStm = aDataHelper.GetSotStorageStream( SotClipboardFormatId::DRAWING ) )
bRet = InsertModelStream( *xModelStm, nInsertPos );
}
else if( aDataHelper.HasFormat( SotClipboardFormatId::FILE_LIST ) ||