unroll code for early returns, no logic changed intended
Change-Id: Ic1cc63a5fe3ad2c949f91c395c00f5f99bd7602a
This commit is contained in:
parent
6aa482428e
commit
218179ddbf
@ -53,10 +53,11 @@ BitmapBuffer* ImplCreateDIB(
|
||||
|| nBitCount == 32)
|
||||
&& "Unsupported BitCount!");
|
||||
|
||||
if (!rSize.Width() || !rSize.Height())
|
||||
return nullptr;
|
||||
|
||||
BitmapBuffer* pDIB = nullptr;
|
||||
|
||||
if( rSize.Width() && rSize.Height() )
|
||||
{
|
||||
try
|
||||
{
|
||||
pDIB = new BitmapBuffer;
|
||||
@ -66,8 +67,9 @@ BitmapBuffer* ImplCreateDIB(
|
||||
pDIB = nullptr;
|
||||
}
|
||||
|
||||
if( pDIB )
|
||||
{
|
||||
if(!pDIB)
|
||||
return nullptr;
|
||||
|
||||
const sal_uInt16 nColors = ( nBitCount <= 8 ) ? ( 1 << nBitCount ) : 0;
|
||||
|
||||
switch (nBitCount)
|
||||
@ -140,10 +142,6 @@ BitmapBuffer* ImplCreateDIB(
|
||||
delete pDIB;
|
||||
pDIB = nullptr;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
pDIB = nullptr;
|
||||
|
||||
return pDIB;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user