summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2017-12-12 17:50:16 +0100
committerStephan Bergmann <sbergman@redhat.com>2017-12-12 23:30:44 +0100
commiteb002da913cd1745b039bbc7e519542d7990fb49 (patch)
tree6a035877c86301a8d2184ff3026d5dae740a6789
parentdcdaca599987ded1577bd04ed1e70f5bd02e943f (diff)
Remove obsolete "explicit operator bool" hack
...and fix the call sites that exploited the hack's internals being non- transparent. Change-Id: Ib3b06c3945e303d4088c4e1b65be5beed8613bac Reviewed-on: https://gerrit.libreoffice.org/46325 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
-rw-r--r--filter/source/graphicfilter/ipcx/ipcx.cxx2
-rw-r--r--filter/source/graphicfilter/iras/iras.cxx2
-rw-r--r--include/vcl/scopedbitmapaccess.hxx7
-rw-r--r--vcl/source/bitmap/BitmapScaleConvolution.cxx4
-rw-r--r--vcl/source/filter/igif/gifread.cxx6
5 files changed, 9 insertions, 12 deletions
diff --git a/filter/source/graphicfilter/ipcx/ipcx.cxx b/filter/source/graphicfilter/ipcx/ipcx.cxx
index 38c6d54664c2..4adfb3ec24f1 100644
--- a/filter/source/graphicfilter/ipcx/ipcx.cxx
+++ b/filter/source/graphicfilter/ipcx/ipcx.cxx
@@ -100,7 +100,7 @@ bool PCXReader::ReadPCX(Graphic & rGraphic)
{
aBmp = Bitmap( Size( nWidth, nHeight ), nDestBitsPerPixel );
Bitmap::ScopedWriteAccess pAcc(aBmp);
- if ( pAcc == nullptr )
+ if ( !pAcc )
return false;
if ( nDestBitsPerPixel <= 8 )
diff --git a/filter/source/graphicfilter/iras/iras.cxx b/filter/source/graphicfilter/iras/iras.cxx
index ac75b2a77bd3..232ac9807dc2 100644
--- a/filter/source/graphicfilter/iras/iras.cxx
+++ b/filter/source/graphicfilter/iras/iras.cxx
@@ -174,7 +174,7 @@ bool RASReader::ReadRAS(Graphic & rGraphic)
Bitmap aBmp(Size(mnWidth, mnHeight), mnDstBitsPerPix);
Bitmap::ScopedWriteAccess pAcc(aBmp);
- if (pAcc == nullptr)
+ if (!pAcc)
return false;
if (bPalette)
diff --git a/include/vcl/scopedbitmapaccess.hxx b/include/vcl/scopedbitmapaccess.hxx
index 05eb39587bac..bcdfa2b1bd20 100644
--- a/include/vcl/scopedbitmapaccess.hxx
+++ b/include/vcl/scopedbitmapaccess.hxx
@@ -45,9 +45,6 @@ namespace vcl
*/
template < class Access, class Bitmap, Access* (Bitmap::* Acquire)() > class ScopedBitmapAccess
{
- typedef ScopedBitmapAccess< Access, Bitmap, Acquire > self_type;
- typedef bool (self_type::* unspecified_bool_type)() const;
-
public:
explicit ScopedBitmapAccess( Bitmap& rBitmap ) :
mpAccess( nullptr ),
@@ -98,9 +95,9 @@ public:
}
bool operator!() const { return !mpAccess; }
- operator unspecified_bool_type() const
+ explicit operator bool() const
{
- return mpAccess ? &self_type::operator! : 0;
+ return mpAccess;
}
Access* get() { return mpAccess; }
diff --git a/vcl/source/bitmap/BitmapScaleConvolution.cxx b/vcl/source/bitmap/BitmapScaleConvolution.cxx
index 49aed5d5940b..498d1084ab73 100644
--- a/vcl/source/bitmap/BitmapScaleConvolution.cxx
+++ b/vcl/source/bitmap/BitmapScaleConvolution.cxx
@@ -109,7 +109,7 @@ bool ImplScaleConvolutionHor(Bitmap& rSource, Bitmap& rTarget, const double& rSc
ImplCalculateContributions(nWidth, nNewWidth, aNumberOfContributions, pWeights, pPixels, pCount, aKernel);
rTarget = Bitmap(Size(nNewWidth, nHeight), 24);
Bitmap::ScopedWriteAccess pWriteAcc(rTarget);
- bool bResult(nullptr != pWriteAcc);
+ bool bResult(pWriteAcc);
if(bResult)
{
@@ -195,7 +195,7 @@ bool ImplScaleConvolutionVer(Bitmap& rSource, Bitmap& rTarget, const double& rSc
ImplCalculateContributions(nHeight, nNewHeight, aNumberOfContributions, pWeights, pPixels, pCount, aKernel);
rTarget = Bitmap(Size(nWidth, nNewHeight), 24);
Bitmap::ScopedWriteAccess pWriteAcc(rTarget);
- bool bResult(nullptr != pWriteAcc);
+ bool bResult(pWriteAcc);
if(pWriteAcc)
{
diff --git a/vcl/source/filter/igif/gifread.cxx b/vcl/source/filter/igif/gifread.cxx
index 9695f09d8784..f35d2d398c19 100644
--- a/vcl/source/filter/igif/gifread.cxx
+++ b/vcl/source/filter/igif/gifread.cxx
@@ -222,7 +222,7 @@ void GIFReader::CreateBitmaps( long nWidth, long nHeight, BitmapPalette* pPal,
aBmp8.Erase( Color( COL_WHITE ) );
pAcc8 = Bitmap::ScopedWriteAccess(aBmp8);
- bStatus = ( pAcc8 != nullptr );
+ bStatus = bool(pAcc8);
}
}
@@ -685,13 +685,13 @@ Graphic GIFReader::GetIntermediateGraphic()
aImGraphic = BitmapEx( aBmp8, aBmp1 );
pAcc1 = Bitmap::ScopedWriteAccess(aBmp1);
- bStatus = bStatus && ( pAcc1 != nullptr );
+ bStatus = bStatus && pAcc1;
}
else
aImGraphic = aBmp8;
pAcc8 = Bitmap::ScopedWriteAccess(aBmp8);
- bStatus = bStatus && ( pAcc8 != nullptr );
+ bStatus = bStatus && pAcc8;
}
return aImGraphic;