[Libreoffice-commits] core.git: Branch 'libreoffice-7-2-2' - sw/source

Aron Budea (via logerrit) logerrit at kemper.freedesktop.org
Tue Oct 5 23:23:20 UTC 2021


 sw/source/core/text/frmcrsr.cxx  |    2 +-
 sw/source/core/text/inftxt.cxx   |    4 ++--
 sw/source/core/text/itrcrsr.cxx  |    4 ++--
 sw/source/core/text/itrform2.cxx |   24 ++++++++++++------------
 sw/source/core/text/porfld.cxx   |   12 ++++++------
 sw/source/core/text/porfly.cxx   |    6 +++---
 sw/source/core/text/porlin.cxx   |    4 ++--
 sw/source/core/text/pormulti.cxx |   10 +++++-----
 sw/source/core/text/porrst.cxx   |    4 ++--
 sw/source/core/text/txtdrop.cxx  |   12 ++++++------
 sw/source/core/text/txtfrm.cxx   |    8 ++++----
 11 files changed, 45 insertions(+), 45 deletions(-)

New commits:
commit 49b763f43a6a954af0c897042da70e9a7de8b4fa
Author:     Aron Budea <aron.budea at collabora.com>
AuthorDate: Mon Oct 4 23:22:47 2021 +0200
Commit:     Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
CommitDate: Wed Oct 6 01:22:46 2021 +0200

    Partially revert "sw: replace most static_cast<sal_uInt16>()...
    
    ... calls with o3tl::narrowing()"
    
    Only the changes that enable
    301278b656e76b6f42af5cf8a6f5c6c02acfffeb to be reverted easily
    in libreoffice-7-2.
    
    This reverts commit 2634bc59092b24217d984a5845365d703bdb08d2.
    
    Change-Id: Id43bcb8eb386d8aa49a6a0c3768abfc916cce717
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123093
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>
    Reviewed-by: Andras Timar <andras.timar at collabora.com>
    Tested-by: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>

diff --git a/sw/source/core/text/frmcrsr.cxx b/sw/source/core/text/frmcrsr.cxx
index 9ea484912cff..8be43264f192 100644
--- a/sw/source/core/text/frmcrsr.cxx
+++ b/sw/source/core/text/frmcrsr.cxx
@@ -1418,7 +1418,7 @@ void SwTextFrame::FillCursorPos( SwFillData& rFill ) const
         if( nDiff > 0 )
         {
             nDiff /= nDist;
-            rFill.Fill().nParaCnt = o3tl::narrowing<sal_uInt16>(nDiff + 1);
+            rFill.Fill().nParaCnt = static_cast<sal_uInt16>(nDiff + 1);
             rFill.nLineWidth = 0;
             rFill.bInner = false;
             rFill.bEmpty = true;
diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx
index ddfc54bc6fc3..3e3b5d78af23 100644
--- a/sw/source/core/text/inftxt.cxx
+++ b/sw/source/core/text/inftxt.cxx
@@ -426,7 +426,7 @@ void SwTextSizeInfo::GetTextSize( const SwScriptInfo* pSI, const TextFrameIndex
     aDrawInf.SetSnapToGrid( SnapToGrid() );
     aDrawInf.SetKanaComp( nComp );
     SwPosSize aSize( m_pFnt->GetTextSize_( aDrawInf ) );
-    nMaxSizeDiff = o3tl::narrowing<sal_uInt16>(aDrawInf.GetKanaDiff());
+    nMaxSizeDiff = static_cast<sal_uInt16>(aDrawInf.GetKanaDiff());
     nMinSize = aSize.Width();
 }
 
@@ -955,7 +955,7 @@ static void lcl_DrawSpecial( const SwTextPaintInfo& rTextPaintInfo, const SwLine
     Point aTmpPos( nX, nY );
     rNonConstTextPaintInfo.SetPos( aTmpPos );
     sal_uInt16 nOldWidth = rPor.Width();
-    const_cast<SwLinePortion&>(rPor).Width( o3tl::narrowing<sal_uInt16>(aFontSize.Width()) );
+    const_cast<SwLinePortion&>(rPor).Width( static_cast<sal_uInt16>(aFontSize.Width()) );
     rTextPaintInfo.DrawText( aTmp, rPor );
     const_cast<SwLinePortion&>(rPor).Width( nOldWidth );
     rNonConstTextPaintInfo.SetFont( const_cast<SwFont*>(pOldFnt) );
diff --git a/sw/source/core/text/itrcrsr.cxx b/sw/source/core/text/itrcrsr.cxx
index 138359e68c41..64792666e80e 100644
--- a/sw/source/core/text/itrcrsr.cxx
+++ b/sw/source/core/text/itrcrsr.cxx
@@ -142,7 +142,7 @@ namespace {
                 nListLevel = MAXLEVEL - 1;
 
             const SwNumFormat& rNumFormat =
-                    rTextNode.GetNumRule()->Get( o3tl::narrowing<sal_uInt16>(nListLevel) );
+                    rTextNode.GetNumRule()->Get( static_cast<sal_uInt16>(nListLevel) );
             if ( rNumFormat.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT )
             {
                 bRet = true;
@@ -1627,7 +1627,7 @@ TextFrameIndex SwTextCursor::GetModelPositionForViewPoint( SwPosition *pPos, con
                     nTmpY = pPor->Height() - nTmpY;
                 if( nTmpY < 0 )
                     nTmpY = 0;
-                nX = o3tl::narrowing<sal_uInt16>(nTmpY);
+                nX = static_cast<sal_uInt16>(nTmpY);
             }
 
             if( static_cast<SwMultiPortion*>(pPor)->HasBrackets() )
diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx
index 8e5a2b403e42..289905bc6f50 100644
--- a/sw/source/core/text/itrform2.cxx
+++ b/sw/source/core/text/itrform2.cxx
@@ -242,7 +242,7 @@ SwLinePortion *SwTextFormatter::Underflow( SwTextFormatInfo &rInf )
 
     // line width is adjusted, so that pPor does not fit to current
     // line anymore
-    rInf.Width( o3tl::narrowing<sal_uInt16>(rInf.X() + (pPor->Width() ? pPor->Width() - 1 : 0)) );
+    rInf.Width( static_cast<sal_uInt16>(rInf.X() + (pPor->Width() ? pPor->Width() - 1 : 0)) );
     rInf.SetLen( pPor->GetLen() );
     rInf.SetFull( false );
     if( pFly )
@@ -431,7 +431,7 @@ void SwTextFormatter::BuildPortions( SwTextFormatInfo &rInf )
         {
             SwFontScript nNxtActual = rInf.GetFont()->GetActual();
             SwFontScript nLstActual = nNxtActual;
-            sal_uInt16 nLstHeight = o3tl::narrowing<sal_uInt16>(rInf.GetFont()->GetHeight());
+            sal_uInt16 nLstHeight = static_cast<sal_uInt16>(rInf.GetFont()->GetHeight());
             bool bAllowBehind = false;
             const CharClass& rCC = GetAppCharClass();
 
@@ -474,7 +474,7 @@ void SwTextFormatter::BuildPortions( SwTextFormatInfo &rInf )
                         if ( pTmpFnt )
                         {
                             nLstActual = pTmpFnt->GetActual();
-                            nLstHeight = o3tl::narrowing<sal_uInt16>(pTmpFnt->GetHeight());
+                            nLstHeight = static_cast<sal_uInt16>(pTmpFnt->GetHeight());
                         }
                     }
                 }
@@ -535,7 +535,7 @@ void SwTextFormatter::BuildPortions( SwTextFormatInfo &rInf )
                 const SwTwips nRestWidth = rInf.Width() - rInf.X();
 
                 if ( nKernWidth <= nRestWidth )
-                    pGridKernPortion->Width( o3tl::narrowing<sal_uInt16>(nKernWidth) );
+                    pGridKernPortion->Width( static_cast<sal_uInt16>(nKernWidth) );
             }
 
             if ( pGridKernPortion != pPor )
@@ -622,7 +622,7 @@ void SwTextFormatter::BuildPortions( SwTextFormatInfo &rInf )
                     (m_pScriptInfo->ScriptType(nTmp - TextFrameIndex(1)) == css::i18n::ScriptType::ASIAN ||
                      m_pScriptInfo->ScriptType(nTmp) == css::i18n::ScriptType::ASIAN) )
                 {
-                    const sal_uInt16 nDist = o3tl::narrowing<sal_uInt16>(rInf.GetFont()->GetHeight()/5);
+                    const sal_uInt16 nDist = static_cast<sal_uInt16>(rInf.GetFont()->GetHeight()/5);
 
                     if( nDist )
                     {
@@ -677,7 +677,7 @@ void SwTextFormatter::BuildPortions( SwTextFormatInfo &rInf )
                                  0;
                 const SwTwips nTmpWidth = i * nGridWidth;
                 const SwTwips nKernWidth = std::min(nTmpWidth - nSumWidth, nRestWidth);
-                const sal_uInt16 nKernWidth_1 = o3tl::narrowing<sal_uInt16>(nKernWidth / 2);
+                const sal_uInt16 nKernWidth_1 = static_cast<sal_uInt16>(nKernWidth / 2);
 
                 OSL_ENSURE( nKernWidth <= nRestWidth,
                         "Not enough space left for adjusting non-asian text in grid mode" );
@@ -1488,7 +1488,7 @@ SwLinePortion *SwTextFormatter::NewPortion( SwTextFormatInfo &rInf )
                              PortionType::TabDecimal == pLastTabPortion->GetWhichPor() )
                         {
                             OSL_ENSURE( rInf.X() >= pLastTabPortion->GetFix(), "Decimal tab stop position cannot be calculated" );
-                            const sal_uInt16 nWidthOfPortionsUpToDecimalPosition = o3tl::narrowing<sal_uInt16>(rInf.X() - pLastTabPortion->GetFix() );
+                            const sal_uInt16 nWidthOfPortionsUpToDecimalPosition = static_cast<sal_uInt16>(rInf.X() - pLastTabPortion->GetFix() );
                             static_cast<SwTabDecimalPortion*>(pLastTabPortion)->SetWidthOfPortionsUpToDecimalPosition( nWidthOfPortionsUpToDecimalPosition );
                             rInf.SetTabDecimal( 0 );
                         }
@@ -1863,7 +1863,7 @@ void SwTextFormatter::CalcRealHeight( bool bNewLine )
                 nTmp = 100;
 
             nTmp *= nLineHeight;
-            nLineHeight = o3tl::narrowing<sal_uInt16>(nTmp / 100);
+            nLineHeight = static_cast<sal_uInt16>(nTmp / 100);
         }
 
         m_pCurr->SetRealHeight( nLineHeight );
@@ -1898,7 +1898,7 @@ void SwTextFormatter::CalcRealHeight( bool bNewLine )
                             nTmp /= 100;
                             if( !nTmp )
                                 ++nTmp;
-                            nLineHeight = o3tl::narrowing<sal_uInt16>(nTmp);
+                            nLineHeight = static_cast<sal_uInt16>(nTmp);
                             sal_uInt16 nAsc = ( 4 * nLineHeight ) / 5;  // 80%
 #if 0
                             // could do clipping here (like Word does)
@@ -1956,7 +1956,7 @@ void SwTextFormatter::CalcRealHeight( bool bNewLine )
                         nTmp += nLineHeight;
                         if (nTmp < 1)
                             nTmp = 1;
-                        nLineHeight = o3tl::narrowing<sal_uInt16>(nTmp);
+                        nLineHeight = static_cast<sal_uInt16>(nTmp);
                         break;
                     }
                     case SvxInterLineSpaceRule::Fix:
@@ -2522,7 +2522,7 @@ void SwTextFormatter::CalcFlyWidth( SwTextFormatInfo &rInf )
     if( bForced )
     {
         m_pCurr->SetForcedLeftMargin();
-        rInf.ForcedLeftMargin( o3tl::narrowing<sal_uInt16>(aInter.Width()) );
+        rInf.ForcedLeftMargin( static_cast<sal_uInt16>(aInter.Width()) );
     }
 
     if( bFullLine )
@@ -2612,7 +2612,7 @@ void SwTextFormatter::CalcFlyWidth( SwTextFormatInfo &rInf )
 
     const tools::Long nNewWidth = ( i - 1 ) * nGridWidth - nOfst;
     if ( nNewWidth > 0 )
-        rInf.Width( o3tl::narrowing<sal_uInt16>(nNewWidth) );
+        rInf.Width( static_cast<sal_uInt16>(nNewWidth) );
     else
         rInf.Width( 0 );
 
diff --git a/sw/source/core/text/porfld.cxx b/sw/source/core/text/porfld.cxx
index 4d589427850c..26f3dcf56c98 100644
--- a/sw/source/core/text/porfld.cxx
+++ b/sw/source/core/text/porfld.cxx
@@ -785,7 +785,7 @@ SwGrfNumPortion::SwGrfNumPortion(
         m_nYPos = 0;
         m_eOrient = text::VertOrientation::TOP;
     }
-    Width( o3tl::narrowing<sal_uInt16>(rGrfSize.Width() + 2 * GRFNUM_SECURE) );
+    Width( static_cast<sal_uInt16>(rGrfSize.Width() + 2 * GRFNUM_SECURE) );
     m_nFixWidth = Width();
     m_nGrfHeight = rGrfSize.Height() + 2 * GRFNUM_SECURE;
     Height( sal_uInt16(m_nGrfHeight) );
@@ -834,7 +834,7 @@ bool SwGrfNumPortion::Format( SwTextFormatInfo &rInf )
 
     if( bFull )
     {
-        Width( rInf.Width() - o3tl::narrowing<sal_uInt16>(rInf.X()) );
+        Width( rInf.Width() - static_cast<sal_uInt16>(rInf.X()) );
         if( bFly )
         {
             SetLen(TextFrameIndex(0));
@@ -1170,7 +1170,7 @@ bool SwCombinedPortion::Format( SwTextFormatInfo &rInf )
             {
                 rInf.GetOut()->SetFont( rInf.GetFont()->GetFnt( m_aScrType[i] ) );
                 m_aWidth[ m_aScrType[i] ] =
-                        o3tl::narrowing<sal_uInt16>(2 * rInf.GetOut()->GetFontMetric().GetFontSize().Width() / 3);
+                        static_cast<sal_uInt16>(2 * rInf.GetOut()->GetFontMetric().GetFontSize().Width() / 3);
             }
         }
     }
@@ -1217,7 +1217,7 @@ bool SwCombinedPortion::Format( SwTextFormatInfo &rInf )
             SwDrawTextInfo aDrawInf(pSh, *rInf.GetOut(), m_aExpand, i, 1);
             Size aSize = aTmpFont.GetTextSize_( aDrawInf );
             const sal_uInt16 nAsc = aTmpFont.GetAscent( pSh, *rInf.GetOut() );
-            m_aPos[ i ] = o3tl::narrowing<sal_uInt16>(aSize.Width());
+            m_aPos[ i ] = static_cast<sal_uInt16>(aSize.Width());
             if( i == nTop ) // enter the second line
             {
                 m_nLowPos = nMaxDescent;
@@ -1232,7 +1232,7 @@ bool SwCombinedPortion::Format( SwTextFormatInfo &rInf )
             if( nAsc > nMaxAscent )
                 nMaxAscent = nAsc;
             if( aSize.Height() - nAsc > nMaxDescent )
-                nMaxDescent = o3tl::narrowing<sal_uInt16>(aSize.Height() - nAsc);
+                nMaxDescent = static_cast<sal_uInt16>(aSize.Height() - nAsc);
         }
         // for one or two characters we double the width of the portion
         if( nCount < 3 )
@@ -1295,7 +1295,7 @@ bool SwCombinedPortion::Format( SwTextFormatInfo &rInf )
     {
         if( rInf.GetLineStart() == rInf.GetIdx() && (!rInf.GetLast()->InFieldGrp()
             || !static_cast<SwFieldPortion*>(rInf.GetLast())->IsFollow() ) )
-            Width( o3tl::narrowing<sal_uInt16>( rInf.Width() - rInf.X() ) );
+            Width( static_cast<sal_uInt16>( rInf.Width() - rInf.X() ) );
         else
         {
             Truncate();
diff --git a/sw/source/core/text/porfly.cxx b/sw/source/core/text/porfly.cxx
index b999e3d7c354..000acd4bb61d 100644
--- a/sw/source/core/text/porfly.cxx
+++ b/sw/source/core/text/porfly.cxx
@@ -58,7 +58,7 @@ bool SwFlyPortion::Format( SwTextFormatInfo &rInf )
         rInf.GetLastTab()->FormatEOL( rInf );
 
     rInf.GetLast()->FormatEOL( rInf );
-    PrtWidth( o3tl::narrowing<sal_uInt16>(GetFix() - rInf.X() + PrtWidth()) );
+    PrtWidth( static_cast<sal_uInt16>(GetFix() - rInf.X() + PrtWidth()) );
     if( !Width() )
     {
         OSL_ENSURE( Width(), "+SwFlyPortion::Format: a fly is a fly is a fly" );
@@ -82,7 +82,7 @@ bool SwFlyPortion::Format( SwTextFormatInfo &rInf )
         SetLen(TextFrameIndex(1));
     }
 
-    const sal_uInt16 nNewWidth = o3tl::narrowing<sal_uInt16>(rInf.X() + PrtWidth());
+    const sal_uInt16 nNewWidth = static_cast<sal_uInt16>(rInf.X() + PrtWidth());
     if( rInf.Width() <= nNewWidth )
     {
         Truncate();
@@ -431,7 +431,7 @@ void SwFlyCntPortion::SetBase( const SwTextFrame& rFrame, const Point &rBase,
         else
         {
             mnAscent = 0;
-            Height( Height() + o3tl::narrowing<sal_uInt16>(nRelPos) );
+            Height( Height() + static_cast<sal_uInt16>(nRelPos) );
         }
     }
     else
diff --git a/sw/source/core/text/porlin.cxx b/sw/source/core/text/porlin.cxx
index e0a157d9d579..035f670d464b 100644
--- a/sw/source/core/text/porlin.cxx
+++ b/sw/source/core/text/porlin.cxx
@@ -88,7 +88,7 @@ void SwLinePortion::PrePaint( const SwTextPaintInfo& rInf,
     sal_uInt16 nLastWidth = pLast->Width();
 
     if ( pLast->InSpaceGrp() && rInf.GetSpaceAdd() )
-        nLastWidth = nLastWidth + o3tl::narrowing<sal_uInt16>(pLast->CalcSpacing( rInf.GetSpaceAdd(), rInf ));
+        nLastWidth = nLastWidth + static_cast<sal_uInt16>(pLast->CalcSpacing( rInf.GetSpaceAdd(), rInf ));
 
     sal_uInt16 nPos;
     SwTextPaintInfo aInf( rInf );
@@ -246,7 +246,7 @@ bool SwLinePortion::Format( SwTextFormatInfo &rInf )
     const SwLinePortion *pLast = rInf.GetLast();
     Height( pLast->Height() );
     SetAscent( pLast->GetAscent() );
-    const sal_uInt16 nNewWidth = o3tl::narrowing<sal_uInt16>(rInf.X() + PrtWidth());
+    const sal_uInt16 nNewWidth = static_cast<sal_uInt16>(rInf.X() + PrtWidth());
     // Only portions with true width can return true
     // Notes for example never set bFull==true
     if( rInf.Width() <= nNewWidth && PrtWidth() && ! IsKernPortion() )
diff --git a/sw/source/core/text/pormulti.cxx b/sw/source/core/text/pormulti.cxx
index 55cb637e34ea..0667db603fae 100644
--- a/sw/source/core/text/pormulti.cxx
+++ b/sw/source/core/text/pormulti.cxx
@@ -654,9 +654,9 @@ void SwRubyPortion::Adjust_( SwTextFormatInfo &rInf )
     TextFrameIndex nSub(0);
     switch ( m_nAdjustment )
     {
-        case css::text::RubyAdjust_CENTER: nRight = o3tl::narrowing<sal_uInt16>(nLineDiff / 2);
+        case css::text::RubyAdjust_CENTER: nRight = static_cast<sal_uInt16>(nLineDiff / 2);
             [[fallthrough]];
-        case css::text::RubyAdjust_RIGHT: nLeft  = o3tl::narrowing<sal_uInt16>(nLineDiff - nRight); break;
+        case css::text::RubyAdjust_RIGHT: nLeft  = static_cast<sal_uInt16>(nLineDiff - nRight); break;
         case css::text::RubyAdjust_BLOCK: nSub   = TextFrameIndex(1);
             [[fallthrough]];
         case css::text::RubyAdjust_INDENT_BLOCK:
@@ -683,8 +683,8 @@ void SwRubyPortion::Adjust_( SwTextFormatInfo &rInf )
             }
             if( nLineDiff > 1 )
             {
-                nRight = o3tl::narrowing<sal_uInt16>(nLineDiff / 2);
-                nLeft  = o3tl::narrowing<sal_uInt16>(nLineDiff - nRight);
+                nRight = static_cast<sal_uInt16>(nLineDiff / 2);
+                nLeft  = static_cast<sal_uInt16>(nLineDiff - nRight);
             }
             break;
         }
@@ -2545,7 +2545,7 @@ SwTextCursorSave::SwTextCursorSave( SwTextCursor* pCursor,
         }
 
         if( nSpaceAdd > 0 && !pMulti->HasTabulator() )
-            pCursor->m_pCurr->Width( o3tl::narrowing<sal_uInt16>(nWidth + nSpaceAdd * sal_Int32(nSpaceCnt) / SPACING_PRECISION_FACTOR) );
+            pCursor->m_pCurr->Width( static_cast<sal_uInt16>(nWidth + nSpaceAdd * sal_Int32(nSpaceCnt) / SPACING_PRECISION_FACTOR) );
 
         // For a BidiPortion we have to calculate the offset from the
         // end of the portion
diff --git a/sw/source/core/text/porrst.cxx b/sw/source/core/text/porrst.cxx
index 23f837d63051..21a51e135b85 100644
--- a/sw/source/core/text/porrst.cxx
+++ b/sw/source/core/text/porrst.cxx
@@ -243,7 +243,7 @@ SwArrowPortion::SwArrowPortion( const SwLinePortion &rPortion ) :
 SwArrowPortion::SwArrowPortion( const SwTextPaintInfo &rInf )
     : m_bLeft( false )
 {
-    Height( o3tl::narrowing<sal_uInt16>(rInf.GetTextFrame()->getFramePrintArea().Height()) );
+    Height( static_cast<sal_uInt16>(rInf.GetTextFrame()->getFramePrintArea().Height()) );
     m_aPos.setX( rInf.GetTextFrame()->getFrameArea().Left() +
                rInf.GetTextFrame()->getFramePrintArea().Right() );
     m_aPos.setY( rInf.GetTextFrame()->getFrameArea().Top() +
@@ -493,7 +493,7 @@ bool SwTextFrame::FillRegister( SwTwips& rRegStart, sal_uInt16& rRegDiff )
                                     nTmp /= 100;
                                     if( !nTmp )
                                         ++nTmp;
-                                    rRegDiff = o3tl::narrowing<sal_uInt16>(nTmp);
+                                    rRegDiff = static_cast<sal_uInt16>(nTmp);
                                     nNetHeight = rRegDiff;
                                     break;
                                 }
diff --git a/sw/source/core/text/txtdrop.cxx b/sw/source/core/text/txtdrop.cxx
index ce39a3e9e1dc..e5ac47c692f7 100644
--- a/sw/source/core/text/txtdrop.cxx
+++ b/sw/source/core/text/txtdrop.cxx
@@ -775,7 +775,7 @@ void SwDropCapCache::CalcFontSize( SwDropPortion* pDrop, SwTextFormatInfo &rInf
             m_aText[ nTmpIdx ] = aStr;
             m_aWishedHeight[ nTmpIdx ] = sal_uInt16(nWishedHeight);
             // save initial scaling factor
-            m_aFactor[ nTmpIdx ] = o3tl::narrowing<sal_uInt16>(nFactor);
+            m_aFactor[ nTmpIdx ] = static_cast<sal_uInt16>(nFactor);
         }
 
         bool bGrow = (pDrop->GetLen() != TextFrameIndex(0));
@@ -925,7 +925,7 @@ void SwDropCapCache::CalcFontSize( SwDropPortion* pDrop, SwTextFormatInfo &rInf
                 else
                 {
                     if ( bUseCache )
-                        m_aFactor[ nTmpIdx ] = o3tl::narrowing<sal_uInt16>(nFactor);
+                        m_aFactor[ nTmpIdx ] = static_cast<sal_uInt16>(nFactor);
                     nMin = nFactor;
                 }
 
@@ -982,7 +982,7 @@ void SwDropCapCache::CalcFontSize( SwDropPortion* pDrop, SwTextFormatInfo &rInf
 bool SwDropPortion::Format( SwTextFormatInfo &rInf )
 {
     bool bFull = false;
-    m_nFix = o3tl::narrowing<sal_uInt16>(rInf.X());
+    m_nFix = static_cast<sal_uInt16>(rInf.X());
 
     SwLayoutModeModifier aLayoutModeModifier( *rInf.GetOut() );
     aLayoutModeModifier.SetAuto();
@@ -1020,7 +1020,7 @@ bool SwDropPortion::Format( SwTextFormatInfo &rInf )
                         Width();
 
                 // set values
-                pCurrPart->SetWidth( o3tl::narrowing<sal_uInt16>(nTmpWidth) );
+                pCurrPart->SetWidth( static_cast<sal_uInt16>(nTmpWidth) );
 
                 // Move
                 rInf.SetIdx( rInf.GetIdx() + pCurrPart->GetLen() );
@@ -1029,7 +1029,7 @@ bool SwDropPortion::Format( SwTextFormatInfo &rInf )
             }
             SetJoinBorderWithNext(false);
             SetJoinBorderWithPrev(false);
-            Width( o3tl::narrowing<sal_uInt16>(rInf.X() - nOldX) );
+            Width( static_cast<sal_uInt16>(rInf.X() - nOldX) );
         }
 
         // reset my length
@@ -1066,7 +1066,7 @@ bool SwDropPortion::Format( SwTextFormatInfo &rInf )
     else
     {
         const sal_uInt16 nWant = Width() + GetDistance();
-        const sal_uInt16 nRest = o3tl::narrowing<sal_uInt16>(rInf.Width() - rInf.X());
+        const sal_uInt16 nRest = static_cast<sal_uInt16>(rInf.Width() - rInf.X());
         if( ( nWant > nRest ) ||
             lcl_IsDropFlyInter( rInf, Width() + GetDistance(), m_nDropHeight ) )
             m_nDistance = 0;
diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx
index ce0d6cc99c2f..a85f2977a8d4 100644
--- a/sw/source/core/text/txtfrm.cxx
+++ b/sw/source/core/text/txtfrm.cxx
@@ -3330,11 +3330,11 @@ sal_uInt32 SwTextFrame::GetParHeight() const
     if( !HasPara() )
     {   // For non-empty paragraphs this is a special case
         // For UnderSized we can simply just ask 1 Twip more
-        sal_uInt16 nRet = o3tl::narrowing<sal_uInt16>(getFramePrintArea().SSize().Height());
+        sal_uInt16 nRet = static_cast<sal_uInt16>(getFramePrintArea().SSize().Height());
         if( IsUndersized() )
         {
             if( IsEmpty() || GetText().isEmpty() )
-                nRet = o3tl::narrowing<sal_uInt16>(EmptyHeight());
+                nRet = static_cast<sal_uInt16>(EmptyHeight());
             else
                 ++nRet;
         }
@@ -3485,7 +3485,7 @@ void SwTextFrame::CalcAdditionalFirstLineOffset()
         nListLevel = MAXLEVEL - 1;
 
     const SwNumFormat& rNumFormat =
-            pTextNode->GetNumRule()->Get( o3tl::narrowing<sal_uInt16>(nListLevel) );
+            pTextNode->GetNumRule()->Get( static_cast<sal_uInt16>(nListLevel) );
     if ( rNumFormat.GetPositionAndSpaceMode() != SvxNumberFormat::LABEL_ALIGNMENT )
         return;
 
@@ -3732,7 +3732,7 @@ sal_uInt16 SwTextFrame::FirstLineHeight() const
     if ( !HasPara() )
     {
         if( IsEmpty() && isFrameAreaDefinitionValid() )
-            return IsVertical() ? o3tl::narrowing<sal_uInt16>(getFramePrintArea().Width()) : o3tl::narrowing<sal_uInt16>(getFramePrintArea().Height());
+            return IsVertical() ? static_cast<sal_uInt16>(getFramePrintArea().Width()) : static_cast<sal_uInt16>(getFramePrintArea().Height());
         return USHRT_MAX;
     }
     const SwParaPortion *pPara = GetPara();


More information about the Libreoffice-commits mailing list