[Libreoffice-commits] core.git: 2 commits - sw/source
Michael Stahl (via logerrit)
logerrit at kemper.freedesktop.org
Thu Jan 30 13:20:28 UTC 2020
sw/source/core/text/inftxt.hxx | 6 ++----
sw/source/core/text/porlin.cxx | 41 ++++++++++++++++++++---------------------
2 files changed, 22 insertions(+), 25 deletions(-)
New commits:
commit ac443862c6b9599ae5776767c4a169c37e47477e
Author: Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Tue Jan 28 16:35:03 2020 +0100
Commit: Michael Stahl <michael.stahl at cib.de>
CommitDate: Thu Jan 30 14:20:06 2020 +0100
sw: reformat bit of SwLinePortion::PrePaint()
Change-Id: Id088e3f73e6bda3c6b11d421a52c59c67446f8a2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87706
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl at cib.de>
diff --git a/sw/source/core/text/porlin.cxx b/sw/source/core/text/porlin.cxx
index 9c3355448fc7..0c7ff0252075 100644
--- a/sw/source/core/text/porlin.cxx
+++ b/sw/source/core/text/porlin.cxx
@@ -103,32 +103,31 @@ void SwLinePortion::PrePaint( const SwTextPaintInfo& rInf,
1800 :
rInf.GetFont()->GetOrientation( rInf.GetTextFrame()->IsVertical() );
- switch ( nDir )
+ if (nLastWidth > nHalfView)
{
- case 0 :
- nPos = sal_uInt16( rInf.X() );
- if( nLastWidth > nHalfView )
+ switch (nDir)
+ {
+ case 0:
+ nPos = sal_uInt16( rInf.X() );
nPos += nLastWidth - nHalfView;
- aInf.X( nPos );
- break;
- case 900 :
- nPos = sal_uInt16( rInf.Y() );
- if( nLastWidth > nHalfView )
+ aInf.X( nPos );
+ break;
+ case 900:
+ nPos = sal_uInt16( rInf.Y() );
nPos -= nLastWidth + nHalfView;
- aInf.Y( nPos );
- break;
- case 1800 :
- nPos = sal_uInt16( rInf.X() );
- if( nLastWidth > nHalfView )
+ aInf.Y( nPos );
+ break;
+ case 1800:
+ nPos = sal_uInt16( rInf.X() );
nPos -= nLastWidth + nHalfView;
- aInf.X( nPos );
- break;
- case 2700 :
- nPos = sal_uInt16( rInf.Y() );
- if( nLastWidth > nHalfView )
+ aInf.X( nPos );
+ break;
+ case 2700:
+ nPos = sal_uInt16( rInf.Y() );
nPos += nLastWidth - nHalfView;
- aInf.Y( nPos );
- break;
+ aInf.Y( nPos );
+ break;
+ }
}
SwLinePortion *pThis = const_cast<SwLinePortion*>(this);
commit 47f9cb2930e5aa530e97f7600d8ef021db11c493
Author: Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Tue Jan 28 15:56:58 2020 +0100
Commit: Michael Stahl <michael.stahl at cib.de>
CommitDate: Thu Jan 30 14:19:55 2020 +0100
sw: these SAL_WARN_IF should be assert()
Change-Id: Ifddea3cd34f419d9b8b87a3f913be590ad4d5ce7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87705
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl at cib.de>
diff --git a/sw/source/core/text/inftxt.hxx b/sw/source/core/text/inftxt.hxx
index 94eb7de9f207..30888843626d 100644
--- a/sw/source/core/text/inftxt.hxx
+++ b/sw/source/core/text/inftxt.hxx
@@ -709,15 +709,13 @@ public:
inline sal_uInt16 SwTextSizeInfo::GetAscent() const
{
- SAL_WARN_IF( !GetOut(), "sw.core", "SwTextSizeInfo::GetAscent() without m_pOut" );
-
+ assert(GetOut());
return const_cast<SwFont*>(GetFont())->GetAscent( m_pVsh, *GetOut() );
}
inline sal_uInt16 SwTextSizeInfo::GetTextHeight() const
{
- SAL_WARN_IF( !GetOut(), "sw.core", "SwTextSizeInfo::GetTextHeight() without m_pOut" );
-
+ assert(GetOut());
return const_cast<SwFont*>(GetFont())->GetHeight( m_pVsh, *GetOut() );
}
More information about the Libreoffice-commits
mailing list