diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-08-04 00:16:03 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-08-04 01:41:27 +0200 |
commit | 750a6bddf16a2e85555ae3859bf5facfd8cff955 (patch) | |
tree | 2cb0e2444b3e6187970c47855e16d943fbec57dc /vcl/source/gdi/salgdilayout.cxx | |
parent | ce47b1a9c68a27fc37594148f6be2661f27120ea (diff) |
loplugin:flatten in vcl/gdi
Change-Id: Ief1736264e62acfac3a9a83c54dc564c03d6fba9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100034
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/source/gdi/salgdilayout.cxx')
-rw-r--r-- | vcl/source/gdi/salgdilayout.cxx | 74 |
1 files changed, 37 insertions, 37 deletions
diff --git a/vcl/source/gdi/salgdilayout.cxx b/vcl/source/gdi/salgdilayout.cxx index f477127874f8..68754194e70a 100644 --- a/vcl/source/gdi/salgdilayout.cxx +++ b/vcl/source/gdi/salgdilayout.cxx @@ -146,57 +146,57 @@ inline long SalGraphics::GetDeviceWidth(const OutputDevice* pOutDev) const void SalGraphics::mirror( long& x, const OutputDevice *pOutDev ) const { const long w = GetDeviceWidth(pOutDev); - if( w ) + if( !w ) + return; + + if( pOutDev && pOutDev->ImplIsAntiparallel() ) { - if( pOutDev && pOutDev->ImplIsAntiparallel() ) + OutputDevice *pOutDevRef = const_cast<OutputDevice*>(pOutDev); + // mirror this window back + if( m_nLayout & SalLayoutFlags::BiDiRtl ) { - OutputDevice *pOutDevRef = const_cast<OutputDevice*>(pOutDev); - // mirror this window back - if( m_nLayout & SalLayoutFlags::BiDiRtl ) - { - long devX = w-pOutDevRef->GetOutputWidthPixel()-pOutDevRef->GetOutOffXPixel(); // re-mirrored mnOutOffX - x = devX + (x - pOutDevRef->GetOutOffXPixel()); - } - else - { - long devX = pOutDevRef->GetOutOffXPixel(); // re-mirrored mnOutOffX - x = pOutDevRef->GetOutputWidthPixel() - (x - devX) + pOutDevRef->GetOutOffXPixel() - 1; - } + long devX = w-pOutDevRef->GetOutputWidthPixel()-pOutDevRef->GetOutOffXPixel(); // re-mirrored mnOutOffX + x = devX + (x - pOutDevRef->GetOutOffXPixel()); + } + else + { + long devX = pOutDevRef->GetOutOffXPixel(); // re-mirrored mnOutOffX + x = pOutDevRef->GetOutputWidthPixel() - (x - devX) + pOutDevRef->GetOutOffXPixel() - 1; } - else if( m_nLayout & SalLayoutFlags::BiDiRtl ) - x = w-1-x; } + else if( m_nLayout & SalLayoutFlags::BiDiRtl ) + x = w-1-x; } void SalGraphics::mirror( long& x, long nWidth, const OutputDevice *pOutDev, bool bBack ) const { const long w = GetDeviceWidth(pOutDev); - if( w ) + if( !w ) + return; + + if( pOutDev && pOutDev->ImplIsAntiparallel() ) { - if( pOutDev && pOutDev->ImplIsAntiparallel() ) + OutputDevice *pOutDevRef = const_cast<OutputDevice*>(pOutDev); + // mirror this window back + if( m_nLayout & SalLayoutFlags::BiDiRtl ) { - OutputDevice *pOutDevRef = const_cast<OutputDevice*>(pOutDev); - // mirror this window back - if( m_nLayout & SalLayoutFlags::BiDiRtl ) - { - long devX = w-pOutDevRef->GetOutputWidthPixel()-pOutDevRef->GetOutOffXPixel(); // re-mirrored mnOutOffX - if( bBack ) - x = x - devX + pOutDevRef->GetOutOffXPixel(); - else - x = devX + (x - pOutDevRef->GetOutOffXPixel()); - } + long devX = w-pOutDevRef->GetOutputWidthPixel()-pOutDevRef->GetOutOffXPixel(); // re-mirrored mnOutOffX + if( bBack ) + x = x - devX + pOutDevRef->GetOutOffXPixel(); else - { - long devX = pOutDevRef->GetOutOffXPixel(); // re-mirrored mnOutOffX - if( bBack ) - x = devX + (pOutDevRef->GetOutputWidthPixel() + devX) - (x + nWidth); - else - x = pOutDevRef->GetOutputWidthPixel() - (x - devX) + pOutDevRef->GetOutOffXPixel() - nWidth; - } + x = devX + (x - pOutDevRef->GetOutOffXPixel()); + } + else + { + long devX = pOutDevRef->GetOutOffXPixel(); // re-mirrored mnOutOffX + if( bBack ) + x = devX + (pOutDevRef->GetOutputWidthPixel() + devX) - (x + nWidth); + else + x = pOutDevRef->GetOutputWidthPixel() - (x - devX) + pOutDevRef->GetOutOffXPixel() - nWidth; } - else if( m_nLayout & SalLayoutFlags::BiDiRtl ) - x = w-nWidth-x; } + else if( m_nLayout & SalLayoutFlags::BiDiRtl ) + x = w-nWidth-x; } bool SalGraphics::mirror( sal_uInt32 nPoints, const SalPoint *pPtAry, SalPoint *pPtAry2, const OutputDevice *pOutDev ) const |