diff options
-rw-r--r-- | include/vcl/BitmapInfoAccess.hxx | 27 | ||||
-rw-r--r-- | vcl/source/bitmap/BitmapInfoAccess.cxx | 4 |
2 files changed, 21 insertions, 10 deletions
diff --git a/include/vcl/BitmapInfoAccess.hxx b/include/vcl/BitmapInfoAccess.hxx index 4c20e72e9c67..a6bca5627aa2 100644 --- a/include/vcl/BitmapInfoAccess.hxx +++ b/include/vcl/BitmapInfoAccess.hxx @@ -87,40 +87,49 @@ public: bool HasPalette() const { - assert(mpBuffer && "Access is not valid!"); + const BitmapBuffer* pBuffer = mpBuffer; + + assert(pBuffer && "Access is not valid!"); - return mpBuffer && !!mpBuffer->maPalette; + return pBuffer && !!pBuffer->maPalette; } const BitmapPalette& GetPalette() const { - assert(mpBuffer && "Access is not valid!"); + const BitmapBuffer* pBuffer = mpBuffer; + + assert(pBuffer && "Access is not valid!"); - return mpBuffer->maPalette; + return pBuffer->maPalette; } sal_uInt16 GetPaletteEntryCount() const { + const BitmapBuffer* pBuffer = mpBuffer; + assert(HasPalette() && "Bitmap has no palette!"); - return HasPalette() ? mpBuffer->maPalette.GetEntryCount() : 0; + return HasPalette() ? pBuffer->maPalette.GetEntryCount() : 0; } const BitmapColor& GetPaletteColor(sal_uInt16 nColor) const { - assert(mpBuffer && "Access is not valid!"); + const BitmapBuffer* pBuffer = mpBuffer; + assert(pBuffer && "Access is not valid!"); assert(HasPalette() && "Bitmap has no palette!"); - return mpBuffer->maPalette[nColor]; + return pBuffer->maPalette[nColor]; } sal_uInt16 GetBestPaletteIndex(const BitmapColor& rBitmapColor) const; const ColorMask& GetColorMask() const { - assert(mpBuffer && "Access is not valid!"); + const BitmapBuffer* pBuffer = mpBuffer; + + assert(pBuffer && "Access is not valid!"); - return mpBuffer->maColorMask; + return pBuffer->maColorMask; } private: diff --git a/vcl/source/bitmap/BitmapInfoAccess.cxx b/vcl/source/bitmap/BitmapInfoAccess.cxx index 595d5cbbbcc5..50607e94dde3 100644 --- a/vcl/source/bitmap/BitmapInfoAccess.cxx +++ b/vcl/source/bitmap/BitmapInfoAccess.cxx @@ -72,7 +72,9 @@ BitmapInfoAccess::~BitmapInfoAccess() sal_uInt16 BitmapInfoAccess::GetBestPaletteIndex(const BitmapColor& rBitmapColor) const { - return (HasPalette() ? mpBuffer->maPalette.GetBestIndex(rBitmapColor) : 0); + const BitmapBuffer* pBuffer = mpBuffer; + + return (HasPalette() ? pBuffer->maPalette.GetBestIndex(rBitmapColor) : 0); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |