summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolan.mcnamara@collabora.com>2024-04-07 14:33:08 +0100
committerCaolán McNamara <caolan.mcnamara@collabora.com>2024-04-07 17:10:15 +0200
commitb5f5bc90d0eb736c413070a7622d7bde4a161c89 (patch)
tree5f1dd3238afeb461e981acd8158014d9ffbf4078 /vcl
parentfead9c3ea98eb5e6bc01b1dde2a8ab2fa755209d (diff)
cid#1596238 clarify Explicit null dereferenced
hopefully make coverity see this warning is bogus Change-Id: I1bf5fb9183058b18f10c5ebe34c6a887a957f578 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165870 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/treelist/transfer.cxx16
1 files changed, 6 insertions, 10 deletions
diff --git a/vcl/source/treelist/transfer.cxx b/vcl/source/treelist/transfer.cxx
index 489d7d3d0230..1a1c4781ed22 100644
--- a/vcl/source/treelist/transfer.cxx
+++ b/vcl/source/treelist/transfer.cxx
@@ -2087,26 +2087,22 @@ Sequence<sal_Int8> TransferableDataHelper::GetSequence( const DataFlavor& rFlavo
return aSeq;
}
-
bool TransferableDataHelper::GetSotStorageStream( SotClipboardFormatId nFormat, std::unique_ptr<SvStream>& rxStream ) const
{
DataFlavor aFlavor;
return( SotExchange::GetFormatDataFlavor( nFormat, aFlavor ) && GetSotStorageStream( aFlavor, rxStream ) );
}
-
bool TransferableDataHelper::GetSotStorageStream( const DataFlavor& rFlavor, std::unique_ptr<SvStream>& rxStream ) const
{
Sequence<sal_Int8> aSeq = GetSequence(rFlavor, OUString());
+ if (!aSeq.hasElements())
+ return false;
- if (aSeq.hasElements())
- {
- rxStream = SotTempStream::Create( "" );
- rxStream->WriteBytes( aSeq.getConstArray(), aSeq.getLength() );
- rxStream->Seek( 0 );
- }
-
- return aSeq.hasElements();
+ rxStream = SotTempStream::Create( "" );
+ rxStream->WriteBytes( aSeq.getConstArray(), aSeq.getLength() );
+ rxStream->Seek(0);
+ return true;
}
Reference<XInputStream> TransferableDataHelper::GetInputStream( SotClipboardFormatId nFormat, const OUString& rDestDoc ) const