diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-12-20 18:02:32 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-12-21 06:44:59 +0000 |
commit | 6f43f00279252265fe4892b46fe0b4686ff721ed (patch) | |
tree | e27a0a74ce8ec7dda10eae8ff53223bf8e1e6851 /vcl | |
parent | f9785ea595fd8e911f6370e836fa579225b9e571 (diff) |
No need for bool return value here
all of the implementations of this method return true.
Change-Id: I6dc02499af1809110edd482a48d9f6d5d42ead19
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144620
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/headless/SvpGraphicsBackend.cxx | 3 | ||||
-rw-r--r-- | vcl/inc/headless/SvpGraphicsBackend.hxx | 2 | ||||
-rw-r--r-- | vcl/inc/qt5/QtGraphics.hxx | 2 | ||||
-rw-r--r-- | vcl/inc/quartz/salgdi.h | 2 | ||||
-rw-r--r-- | vcl/inc/salgdi.hxx | 8 | ||||
-rw-r--r-- | vcl/inc/salgdiimpl.hxx | 2 | ||||
-rw-r--r-- | vcl/inc/skia/gdiimpl.hxx | 2 | ||||
-rw-r--r-- | vcl/inc/unx/GenPspGfxBackend.hxx | 2 | ||||
-rw-r--r-- | vcl/inc/win/salgdi.h | 2 | ||||
-rw-r--r-- | vcl/qt5/QtGraphics_GDI.cxx | 3 | ||||
-rw-r--r-- | vcl/quartz/AquaGraphicsBackend.cxx | 4 | ||||
-rw-r--r-- | vcl/skia/gdiimpl.cxx | 5 | ||||
-rw-r--r-- | vcl/source/gdi/salgdilayout.cxx | 6 | ||||
-rw-r--r-- | vcl/source/outdev/clipping.cxx | 5 | ||||
-rw-r--r-- | vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.hxx | 4 | ||||
-rw-r--r-- | vcl/unx/generic/gdi/gdiimpl.cxx | 3 | ||||
-rw-r--r-- | vcl/unx/generic/gdi/gdiimpl.hxx | 2 | ||||
-rw-r--r-- | vcl/unx/generic/print/GenPspGfxBackend.cxx | 4 | ||||
-rw-r--r-- | vcl/win/gdi/gdiimpl.cxx | 5 | ||||
-rw-r--r-- | vcl/win/gdi/gdiimpl.hxx | 2 | ||||
-rw-r--r-- | vcl/win/gdi/salgdi.cxx | 4 |
21 files changed, 30 insertions, 42 deletions
diff --git a/vcl/headless/SvpGraphicsBackend.cxx b/vcl/headless/SvpGraphicsBackend.cxx index cd5487031a63..10667e53e4dd 100644 --- a/vcl/headless/SvpGraphicsBackend.cxx +++ b/vcl/headless/SvpGraphicsBackend.cxx @@ -34,10 +34,9 @@ void SvpGraphicsBackend::Init() {} void SvpGraphicsBackend::freeResources() {} -bool SvpGraphicsBackend::setClipRegion(const vcl::Region& i_rClip) +void SvpGraphicsBackend::setClipRegion(const vcl::Region& i_rClip) { m_rCairoCommon.m_aClipRegion = i_rClip; - return true; } void SvpGraphicsBackend::ResetClipRegion() { m_rCairoCommon.m_aClipRegion.SetNull(); } diff --git a/vcl/inc/headless/SvpGraphicsBackend.hxx b/vcl/inc/headless/SvpGraphicsBackend.hxx index 997f1bc84e9d..7bd78118f6f4 100644 --- a/vcl/inc/headless/SvpGraphicsBackend.hxx +++ b/vcl/inc/headless/SvpGraphicsBackend.hxx @@ -40,7 +40,7 @@ public: OUString getRenderBackendName() const override { return "svp"; } - bool setClipRegion(vcl::Region const& rRegion) override; + void setClipRegion(vcl::Region const& rRegion) override; void ResetClipRegion() override; sal_uInt16 GetBitCount() const override; diff --git a/vcl/inc/qt5/QtGraphics.hxx b/vcl/inc/qt5/QtGraphics.hxx index b8a168d1a3cf..b87e6d80b648 100644 --- a/vcl/inc/qt5/QtGraphics.hxx +++ b/vcl/inc/qt5/QtGraphics.hxx @@ -68,7 +68,7 @@ public: OUString getRenderBackendName() const override { return "qt5"; } - bool setClipRegion(vcl::Region const& rRegion) override; + void setClipRegion(vcl::Region const& rRegion) override; void ResetClipRegion() override; sal_uInt16 GetBitCount() const override; diff --git a/vcl/inc/quartz/salgdi.h b/vcl/inc/quartz/salgdi.h index 9e070c4215ce..8886d19700a7 100644 --- a/vcl/inc/quartz/salgdi.h +++ b/vcl/inc/quartz/salgdi.h @@ -340,7 +340,7 @@ public: return "aqua"; } - bool setClipRegion(vcl::Region const& rRegion) override; + void setClipRegion(vcl::Region const& rRegion) override; void ResetClipRegion() override; sal_uInt16 GetBitCount() const override; diff --git a/vcl/inc/salgdi.hxx b/vcl/inc/salgdi.hxx index 0b8952b74123..a7fbe287fc48 100644 --- a/vcl/inc/salgdi.hxx +++ b/vcl/inc/salgdi.hxx @@ -183,7 +183,7 @@ public: // non virtual methods; these do possible coordinate mirroring and // then delegate to protected virtual methods - bool SetClipRegion( const vcl::Region&, const OutputDevice& rOutDev ); + void SetClipRegion( const vcl::Region&, const OutputDevice& rOutDev ); // draw --> LineColor and FillColor and RasterOp and ClipRegion void DrawPixel( tools::Long nX, tools::Long nY, const OutputDevice& rOutDev ); @@ -426,7 +426,7 @@ protected: friend class vcl::FileDefinitionWidgetDraw; - virtual bool setClipRegion( const vcl::Region& ) = 0; + virtual void setClipRegion( const vcl::Region& ) = 0; // draw --> LineColor and FillColor and RasterOp and ClipRegion virtual void drawPixel( tools::Long nX, tools::Long nY ) = 0; @@ -661,9 +661,9 @@ public: GetImpl()->ResetClipRegion(); } - bool setClipRegion( const vcl::Region& i_rClip ) override + void setClipRegion( const vcl::Region& i_rClip ) override { - return GetImpl()->setClipRegion(i_rClip); + GetImpl()->setClipRegion(i_rClip); } void SetLineColor() override diff --git a/vcl/inc/salgdiimpl.hxx b/vcl/inc/salgdiimpl.hxx index 55f7544587ed..5cdd4bd7f50a 100644 --- a/vcl/inc/salgdiimpl.hxx +++ b/vcl/inc/salgdiimpl.hxx @@ -80,7 +80,7 @@ public: virtual OUString getRenderBackendName() const = 0; - virtual bool setClipRegion( const vcl::Region& ) = 0; + virtual void setClipRegion( const vcl::Region& ) = 0; virtual sal_uInt16 GetBitCount() const = 0; diff --git a/vcl/inc/skia/gdiimpl.hxx b/vcl/inc/skia/gdiimpl.hxx index b2814b2a6463..b2bac2c9702c 100644 --- a/vcl/inc/skia/gdiimpl.hxx +++ b/vcl/inc/skia/gdiimpl.hxx @@ -47,7 +47,7 @@ public: virtual OUString getRenderBackendName() const override { return "skia"; } const vcl::Region& getClipRegion() const; - virtual bool setClipRegion(const vcl::Region&) override; + virtual void setClipRegion(const vcl::Region&) override; // // get the depth of the device diff --git a/vcl/inc/unx/GenPspGfxBackend.hxx b/vcl/inc/unx/GenPspGfxBackend.hxx index a37ee433e6eb..31d85290361c 100644 --- a/vcl/inc/unx/GenPspGfxBackend.hxx +++ b/vcl/inc/unx/GenPspGfxBackend.hxx @@ -30,7 +30,7 @@ public: void freeResources() override; OUString getRenderBackendName() const override { return "genpsp"; } - bool setClipRegion(vcl::Region const& rRegion) override; + void setClipRegion(vcl::Region const& rRegion) override; void ResetClipRegion() override; sal_uInt16 GetBitCount() const override; diff --git a/vcl/inc/win/salgdi.h b/vcl/inc/win/salgdi.h index eb41d0304d1c..3cf0b791460d 100644 --- a/vcl/inc/win/salgdi.h +++ b/vcl/inc/win/salgdi.h @@ -221,7 +221,7 @@ public: void Flush(); protected: - virtual bool setClipRegion( const vcl::Region& ) override; + virtual void setClipRegion( const vcl::Region& ) override; // draw --> LineColor and FillColor and RasterOp and ClipRegion virtual void drawPixel( tools::Long nX, tools::Long nY ) override; virtual void drawPixel( tools::Long nX, tools::Long nY, Color nColor ) override; diff --git a/vcl/qt5/QtGraphics_GDI.cxx b/vcl/qt5/QtGraphics_GDI.cxx index 6849a3bc7bde..832f8a09eb2f 100644 --- a/vcl/qt5/QtGraphics_GDI.cxx +++ b/vcl/qt5/QtGraphics_GDI.cxx @@ -125,7 +125,7 @@ static bool AddPolyPolygonToPath(QPainterPath& rPath, const basegfx::B2DPolyPoly return true; } -bool QtGraphicsBackend::setClipRegion(const vcl::Region& rRegion) +void QtGraphicsBackend::setClipRegion(const vcl::Region& rRegion) { if (rRegion.IsRectangle()) { @@ -162,7 +162,6 @@ bool QtGraphicsBackend::setClipRegion(const vcl::Region& rRegion) m_aClipRegion.swap(aRegion); } } - return true; } void QtGraphicsBackend::ResetClipRegion() diff --git a/vcl/quartz/AquaGraphicsBackend.cxx b/vcl/quartz/AquaGraphicsBackend.cxx index 7482986dd58a..2dd1acc8d221 100644 --- a/vcl/quartz/AquaGraphicsBackend.cxx +++ b/vcl/quartz/AquaGraphicsBackend.cxx @@ -246,7 +246,7 @@ AquaGraphicsBackend::~AquaGraphicsBackend() {} void AquaGraphicsBackend::Init() {} void AquaGraphicsBackend::freeResources() {} -bool AquaGraphicsBackend::setClipRegion(vcl::Region const& rRegion) +void AquaGraphicsBackend::setClipRegion(vcl::Region const& rRegion) { // release old clip path mrShared.unsetClipPath(); @@ -274,8 +274,6 @@ bool AquaGraphicsBackend::setClipRegion(vcl::Region const& rRegion) // set the current path as clip region if (mrShared.checkContext()) mrShared.setState(); - - return true; } void AquaGraphicsBackend::ResetClipRegion() diff --git a/vcl/skia/gdiimpl.cxx b/vcl/skia/gdiimpl.cxx index 896849baefa3..c2c22430dd5a 100644 --- a/vcl/skia/gdiimpl.cxx +++ b/vcl/skia/gdiimpl.cxx @@ -566,10 +566,10 @@ void SkiaSalGraphicsImpl::resetCanvasScalingAndClipping() canvas->restore(); // undo scaling } -bool SkiaSalGraphicsImpl::setClipRegion(const vcl::Region& region) +void SkiaSalGraphicsImpl::setClipRegion(const vcl::Region& region) { if (mClipRegion == region) - return true; + return; SkiaZone zone; checkPendingDrawing(); checkSurface(); @@ -580,7 +580,6 @@ bool SkiaSalGraphicsImpl::setClipRegion(const vcl::Region& region) canvas->restore(); // undo previous clip state, see setCanvasScalingAndClipping() canvas->save(); setCanvasClipRegion(canvas, region); - return true; } void SkiaSalGraphicsImpl::setCanvasClipRegion(SkCanvas* canvas, const vcl::Region& region) diff --git a/vcl/source/gdi/salgdilayout.cxx b/vcl/source/gdi/salgdilayout.cxx index 91419779d871..4e8afedcf574 100644 --- a/vcl/source/gdi/salgdilayout.cxx +++ b/vcl/source/gdi/salgdilayout.cxx @@ -373,15 +373,15 @@ const basegfx::B2DHomMatrix& SalGraphics::getMirror( const OutputDevice& i_rOutD return m_aLastMirror; } -bool SalGraphics::SetClipRegion( const vcl::Region& i_rClip, const OutputDevice& rOutDev ) +void SalGraphics::SetClipRegion( const vcl::Region& i_rClip, const OutputDevice& rOutDev ) { if( (m_nLayout & SalLayoutFlags::BiDiRtl) || rOutDev.IsRTLEnabled() ) { vcl::Region aMirror( i_rClip ); mirror( aMirror, rOutDev ); - return setClipRegion( aMirror ); + setClipRegion( aMirror ); } - return setClipRegion( i_rClip ); + setClipRegion( i_rClip ); } void SalGraphics::DrawPixel( tools::Long nX, tools::Long nY, const OutputDevice& rOutDev ) diff --git a/vcl/source/outdev/clipping.cxx b/vcl/source/outdev/clipping.cxx index ad45b08e1f87..6efc9df9d052 100644 --- a/vcl/source/outdev/clipping.cxx +++ b/vcl/source/outdev/clipping.cxx @@ -82,9 +82,8 @@ bool OutputDevice::SelectClipRegion( const vcl::Region& rRegion, SalGraphics* pG pGraphics = mpGraphics; } - bool bClipRegion = pGraphics->SetClipRegion( rRegion, *this ); - OSL_ENSURE( bClipRegion, "OutputDevice::SelectClipRegion() - can't create region" ); - return bClipRegion; + pGraphics->SetClipRegion( rRegion, *this ); + return true; } void OutputDevice::MoveClipRegion( tools::Long nHorzMove, tools::Long nVertMove ) diff --git a/vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.hxx b/vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.hxx index beb07e3ffc30..41a3d945f607 100644 --- a/vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.hxx +++ b/vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.hxx @@ -49,10 +49,10 @@ public: X11SalGraphicsImpl::ResetClipRegion(); } - bool setClipRegion(const vcl::Region& i_rClip) override + void setClipRegion(const vcl::Region& i_rClip) override { maClipRegion = i_rClip; - return X11SalGraphicsImpl::setClipRegion(i_rClip); + X11SalGraphicsImpl::setClipRegion(i_rClip); } void SetLineColor() override diff --git a/vcl/unx/generic/gdi/gdiimpl.cxx b/vcl/unx/generic/gdi/gdiimpl.cxx index ad28e0fb39a9..cc7ba7052fb2 100644 --- a/vcl/unx/generic/gdi/gdiimpl.cxx +++ b/vcl/unx/generic/gdi/gdiimpl.cxx @@ -946,7 +946,7 @@ void X11SalGraphicsImpl::ResetClipRegion() mrParent.mpClipRegion = nullptr; } -bool X11SalGraphicsImpl::setClipRegion( const vcl::Region& i_rClip ) +void X11SalGraphicsImpl::setClipRegion( const vcl::Region& i_rClip ) { if( mrParent.mpClipRegion ) XDestroyRegion( mrParent.mpClipRegion ); @@ -1008,7 +1008,6 @@ bool X11SalGraphicsImpl::setClipRegion( const vcl::Region& i_rClip ) XDestroyRegion( mrParent.mpClipRegion ); mrParent.mpClipRegion= nullptr; } - return true; } void X11SalGraphicsImpl::SetLineColor() diff --git a/vcl/unx/generic/gdi/gdiimpl.hxx b/vcl/unx/generic/gdi/gdiimpl.hxx index 48211b13d472..d62011506a14 100644 --- a/vcl/unx/generic/gdi/gdiimpl.hxx +++ b/vcl/unx/generic/gdi/gdiimpl.hxx @@ -113,7 +113,7 @@ public: virtual OUString getRenderBackendName() const override { return "gen"; } - virtual bool setClipRegion( const vcl::Region& ) override; + virtual void setClipRegion( const vcl::Region& ) override; // // get the depth of the device virtual sal_uInt16 GetBitCount() const override; diff --git a/vcl/unx/generic/print/GenPspGfxBackend.cxx b/vcl/unx/generic/print/GenPspGfxBackend.cxx index 7b461ff4f5c6..7b99553b64d6 100644 --- a/vcl/unx/generic/print/GenPspGfxBackend.cxx +++ b/vcl/unx/generic/print/GenPspGfxBackend.cxx @@ -146,7 +146,7 @@ GenPspGfxBackend::~GenPspGfxBackend() {} void GenPspGfxBackend::Init() {} void GenPspGfxBackend::freeResources() {} -bool GenPspGfxBackend::setClipRegion(vcl::Region const& rRegion) +void GenPspGfxBackend::setClipRegion(vcl::Region const& rRegion) { // TODO: support polygonal clipregions here RectangleVector aRectangles; @@ -165,8 +165,6 @@ bool GenPspGfxBackend::setClipRegion(vcl::Region const& rRegion) } m_pPrinterGfx->EndSetClipRegion(); - - return true; } void GenPspGfxBackend::ResetClipRegion() { m_pPrinterGfx->ResetClipRegion(); } diff --git a/vcl/win/gdi/gdiimpl.cxx b/vcl/win/gdi/gdiimpl.cxx index 81d41cf41d33..708f9e7ac51a 100644 --- a/vcl/win/gdi/gdiimpl.cxx +++ b/vcl/win/gdi/gdiimpl.cxx @@ -1032,7 +1032,7 @@ static bool containsOnlyHorizontalAndVerticalEdges(const basegfx::B2DPolyPolygon return true; } -bool WinSalGraphicsImpl::setClipRegion( const vcl::Region& i_rClip ) +void WinSalGraphicsImpl::setClipRegion( const vcl::Region& i_rClip ) { if ( mrParent.mhRegion ) { @@ -1275,9 +1275,6 @@ bool WinSalGraphicsImpl::setClipRegion( const vcl::Region& i_rClip ) // #i123585# See above, this is a valid case, execute it SelectClipRgn( mrParent.getHDC(), nullptr ); } - - // #i123585# retval no longer dependent of mrParent.mhRegion, see TaskId comments above - return true; } void WinSalGraphicsImpl::SetLineColor() diff --git a/vcl/win/gdi/gdiimpl.hxx b/vcl/win/gdi/gdiimpl.hxx index 86342533fc6c..667268619ac2 100644 --- a/vcl/win/gdi/gdiimpl.hxx +++ b/vcl/win/gdi/gdiimpl.hxx @@ -72,7 +72,7 @@ public: virtual OUString getRenderBackendName() const override { return "gdi"; } - virtual bool setClipRegion( const vcl::Region& ) override; + virtual void setClipRegion( const vcl::Region& ) override; // // get the depth of the device virtual sal_uInt16 GetBitCount() const override; diff --git a/vcl/win/gdi/salgdi.cxx b/vcl/win/gdi/salgdi.cxx index 48ba63e0b192..630933192687 100644 --- a/vcl/win/gdi/salgdi.cxx +++ b/vcl/win/gdi/salgdi.cxx @@ -814,9 +814,9 @@ void WinSalGraphics::ResetClipRegion() mpImpl->ResetClipRegion(); } -bool WinSalGraphics::setClipRegion( const vcl::Region& i_rClip ) +void WinSalGraphics::setClipRegion( const vcl::Region& i_rClip ) { - return mpImpl->setClipRegion( i_rClip ); + mpImpl->setClipRegion( i_rClip ); } void WinSalGraphics::SetLineColor() |