vcl: no need to cast away rImage constness
Image::Draw() is a const function, but wasn't marked as such. I have now made it const, so this means I can remove the const_cast. Change-Id: Ie2a8746affd56e0d80e50d3f9edd372cdb3ff491 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189419 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
committed by
Noel Grandin
parent
89f6382266
commit
26ab75625a
@@ -63,7 +63,7 @@ public:
|
||||
|
||||
const OUString & GetStock() const;
|
||||
|
||||
void Draw(OutputDevice* pOutDev, const Point& rPos, DrawImageFlags nStyle, const Size* pSize = nullptr);
|
||||
void Draw(OutputDevice* pOutDev, const Point& rPos, DrawImageFlags nStyle, const Size* pSize = nullptr) const;
|
||||
|
||||
private:
|
||||
|
||||
|
||||
@@ -128,7 +128,7 @@ bool Image::operator==(const Image& rImage) const
|
||||
return bRet;
|
||||
}
|
||||
|
||||
void Image::Draw(OutputDevice* pOutDev, const Point& rPos, DrawImageFlags nStyle, const Size* pSize)
|
||||
void Image::Draw(OutputDevice* pOutDev, const Point& rPos, DrawImageFlags nStyle, const Size* pSize) const
|
||||
{
|
||||
if (!mpImplData || (!pOutDev->IsDeviceOutputNecessary() && pOutDev->GetConnectMetaFile() == nullptr))
|
||||
return;
|
||||
|
||||
@@ -572,11 +572,10 @@ void OutputDevice::DrawImage( const Point& rPos, const Size& rSize,
|
||||
|
||||
if (!ImplIsRecordLayout())
|
||||
{
|
||||
Image& rNonConstImage = const_cast<Image&>(rImage);
|
||||
if (bIsSizeValid)
|
||||
rNonConstImage.Draw(this, rPos, nStyle, &rSize);
|
||||
rImage.Draw(this, rPos, nStyle, &rSize);
|
||||
else
|
||||
rNonConstImage.Draw(this, rPos, nStyle);
|
||||
rImage.Draw(this, rPos, nStyle);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user