diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-11-20 09:25:11 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-11-21 11:32:43 +0100 |
commit | a60ffa6985dec32cc73032a7774f58694a6ee9a7 (patch) | |
tree | e94b9c586e6db1dde0a69aeddbe067bf8be2a47d /sw/source/core/text/inftxt.cxx | |
parent | 466c3564058aae4946cdd21eab9dfef529554d90 (diff) |
loplugin:flatten in sw
Change-Id: I64176f48d90303f078e326c8838da9eb2daf8126
Reviewed-on: https://gerrit.libreoffice.org/44937
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/core/text/inftxt.cxx')
-rw-r--r-- | sw/source/core/text/inftxt.cxx | 75 |
1 files changed, 38 insertions, 37 deletions
diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx index 105c3871c4ce..de131470c958 100644 --- a/sw/source/core/text/inftxt.cxx +++ b/sw/source/core/text/inftxt.cxx @@ -1003,49 +1003,50 @@ void SwTextPaintInfo::DrawRedArrow( const SwLinePortion &rPor ) const void SwTextPaintInfo::DrawPostIts( bool bScript ) const { - if( OnWin() && m_pOpt->IsPostIts() ) - { - Size aSize; - Point aTmp; + if( !OnWin() || !m_pOpt->IsPostIts() ) + return; - const sal_uInt16 nPostItsWidth = SwViewOption::GetPostItsWidth( GetOut() ); - const sal_uInt16 nFontHeight = m_pFnt->GetHeight( m_pVsh, *GetOut() ); - const sal_uInt16 nFontAscent = m_pFnt->GetAscent( m_pVsh, *GetOut() ); + Size aSize; + Point aTmp; - switch ( m_pFnt->GetOrientation( GetTextFrame()->IsVertical() ) ) - { - case 0 : - aSize.Width() = nPostItsWidth; - aSize.Height() = nFontHeight; - aTmp.X() = aPos.X(); - aTmp.Y() = aPos.Y() - nFontAscent; - break; - case 900 : - aSize.Height() = nPostItsWidth; - aSize.Width() = nFontHeight; - aTmp.X() = aPos.X() - nFontAscent; - aTmp.Y() = aPos.Y(); - break; - case 2700 : - aSize.Height() = nPostItsWidth; - aSize.Width() = nFontHeight; - aTmp.X() = aPos.X() - nFontHeight + - nFontAscent; - aTmp.Y() = aPos.Y(); - break; - } + const sal_uInt16 nPostItsWidth = SwViewOption::GetPostItsWidth( GetOut() ); + const sal_uInt16 nFontHeight = m_pFnt->GetHeight( m_pVsh, *GetOut() ); + const sal_uInt16 nFontAscent = m_pFnt->GetAscent( m_pVsh, *GetOut() ); - SwRect aTmpRect( aTmp, aSize ); + switch ( m_pFnt->GetOrientation( GetTextFrame()->IsVertical() ) ) + { + case 0 : + aSize.Width() = nPostItsWidth; + aSize.Height() = nFontHeight; + aTmp.X() = aPos.X(); + aTmp.Y() = aPos.Y() - nFontAscent; + break; + case 900 : + aSize.Height() = nPostItsWidth; + aSize.Width() = nFontHeight; + aTmp.X() = aPos.X() - nFontAscent; + aTmp.Y() = aPos.Y(); + break; + case 2700 : + aSize.Height() = nPostItsWidth; + aSize.Width() = nFontHeight; + aTmp.X() = aPos.X() - nFontHeight + + nFontAscent; + aTmp.Y() = aPos.Y(); + break; + } - if ( GetTextFrame()->IsRightToLeft() ) - GetTextFrame()->SwitchLTRtoRTL( aTmpRect ); + SwRect aTmpRect( aTmp, aSize ); - if ( GetTextFrame()->IsVertical() ) - GetTextFrame()->SwitchHorizontalToVertical( aTmpRect ); + if ( GetTextFrame()->IsRightToLeft() ) + GetTextFrame()->SwitchLTRtoRTL( aTmpRect ); + + if ( GetTextFrame()->IsVertical() ) + GetTextFrame()->SwitchHorizontalToVertical( aTmpRect ); + + const tools::Rectangle aRect( aTmpRect.SVRect() ); + SwViewOption::PaintPostIts( const_cast<OutputDevice*>(GetOut()), aRect, bScript ); - const tools::Rectangle aRect( aTmpRect.SVRect() ); - SwViewOption::PaintPostIts( const_cast<OutputDevice*>(GetOut()), aRect, bScript ); - } } void SwTextPaintInfo::DrawCheckBox(const SwFieldFormCheckboxPortion &rPor, bool bChecked) const |