sw/source/filter/ww8/wrtww8.cxx |    2 +-
 sw/source/filter/ww8/ww8atr.cxx |   28 ++++++++++++++--------------
 2 files changed, 15 insertions(+), 15 deletions(-)

New commits:
commit bc77818fc726b1a475f9d06ae5d1374aa2ea4f99
Author:     Stephan Bergmann <stephan.bergm...@allotropia.de>
AuthorDate: Wed Mar 19 18:46:37 2025 +0100
Commit:     Stephan Bergmann <stephan.bergm...@allotropia.de>
CommitDate: Wed Mar 19 20:35:20 2025 +0100

    Remove some redundant uses of o3tl::narrowing
    
    ...that narrowed to exactly the parameter type taken by InsUInt16 and 
InsInt16,
    respectively
    
    Change-Id: I59ffd4543d7c40867714dd90786a4366711fa234
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183136
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <stephan.bergm...@allotropia.de>

diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index 60ac9e14a936..220e66367780 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -2218,7 +2218,7 @@ void WW8AttributeOutput::TableHeight(const 
ww8::WW8TableNodeInfoInner::Pointer_t
     if ( nHeight )
     {
         m_rWW8Export.InsUInt16( NS_sprm::TDyaRowHeight::val );
-        m_rWW8Export.InsUInt16( o3tl::narrowing<sal_uInt16>(nHeight) );
+        m_rWW8Export.InsUInt16( nHeight );
     }
 
 }
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index db29159a5c7e..856e8d039d19 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -1596,7 +1596,7 @@ void WW8AttributeOutput::CharFontSize( const 
SvxFontHeightItem& rHeight )
     {
         m_rWW8Export.InsUInt16( nId );
 
-        m_rWW8Export.InsUInt16( o3tl::narrowing<sal_uInt16>(( 
rHeight.GetHeight() + 5 ) / 10 ) );
+        m_rWW8Export.InsUInt16( ( rHeight.GetHeight() + 5 ) / 10 );
     }
 }
 
@@ -4019,7 +4019,7 @@ void WW8AttributeOutput::FormatFrameSize( const 
SwFormatFrameSize& rSize )
         {
             //"sprmPDxaWidth"
             m_rWW8Export.InsUInt16( NS_sprm::PDxaWidth::val );
-            m_rWW8Export.InsUInt16( 
o3tl::narrowing<sal_uInt16>(rSize.GetWidth()) );
+            m_rWW8Export.InsUInt16( rSize.GetWidth() );
         }
 
         if ( rSize.GetHeight() )
@@ -4355,7 +4355,7 @@ void 
WW8AttributeOutput::FormatFirstLineIndent(SvxFirstLineIndentItem const& rFi
     {
         // sprmPDxcLeft1
         m_rWW8Export.InsUInt16(0x4457);
-        m_rWW8Export.InsInt16(o3tl::narrowing<sal_Int16>(stOffset.m_dValue * 
100.0));
+        m_rWW8Export.InsInt16(stOffset.m_dValue * 100.0);
     }
     else
     {
@@ -4386,13 +4386,13 @@ void 
WW8AttributeOutput::FormatTextLeftMargin(SvxTextLeftMarginItem const& rText
 
         // sprmPDxcLeft
         m_rWW8Export.InsUInt16(0x4456);
-        m_rWW8Export.InsInt16(o3tl::narrowing<sal_Int16>(stOffset.m_dValue * 
100.0));
+        m_rWW8Export.InsInt16(stOffset.m_dValue * 100.0);
     }
     else
     {
         // sprmPDxaLeft
         m_rWW8Export.InsUInt16(0x845E);
-        
m_rWW8Export.InsUInt16(o3tl::narrowing<sal_uInt16>(rTextLeftMargin.ResolveTextLeft({})));
+        m_rWW8Export.InsUInt16(rTextLeftMargin.ResolveTextLeft({}));
     }
 }
 
@@ -4403,13 +4403,13 @@ void 
WW8AttributeOutput::FormatRightMargin(SvxRightMarginItem const& rRightMargi
     {
         // sprmPDxcRight
         m_rWW8Export.InsUInt16(0x4455);
-        m_rWW8Export.InsInt16(o3tl::narrowing<sal_Int16>(stOffset.m_dValue * 
100.0));
+        m_rWW8Export.InsInt16(stOffset.m_dValue * 100.0);
     }
     else
     {
         // sprmPDxaRight
         m_rWW8Export.InsUInt16(0x845D);
-        
m_rWW8Export.InsUInt16(o3tl::narrowing<sal_uInt16>(rRightMargin.ResolveRight({})));
+        m_rWW8Export.InsUInt16(rRightMargin.ResolveRight({}));
     }
 }
 
@@ -4423,7 +4423,7 @@ void WW8AttributeOutput::FormatLRSpace( const 
SvxLRSpaceItem& rLR )
         m_rWW8Export.InsUInt16( NS_sprm::LN_PDxaFromText10 );
         // use average, since WW only knows one value
         m_rWW8Export.InsUInt16(
-            o3tl::narrowing<sal_uInt16>((rLR.ResolveLeft({}) + 
rLR.ResolveRight({})) / 2));
+            (rLR.ResolveLeft({}) + rLR.ResolveRight({})) / 2);
     }
     else if ( m_rWW8Export.m_bOutPageDescs )                // PageDescs
     {
@@ -4461,26 +4461,26 @@ void WW8AttributeOutput::FormatLRSpace( const 
SvxLRSpaceItem& rLR )
         {
             // sprmPDxcLeft
             m_rWW8Export.InsUInt16(0x4456);
-            
m_rWW8Export.InsUInt16(o3tl::narrowing<sal_uInt16>(rLR.GetTextLeft().m_dValue * 
100.0));
+            m_rWW8Export.InsUInt16(rLR.GetTextLeft().m_dValue * 100.0);
         }
         else
         {
             // sprmPDxaLeft
             m_rWW8Export.InsUInt16(0x845E);
-            
m_rWW8Export.InsUInt16(o3tl::narrowing<sal_uInt16>(rLR.ResolveTextLeft({})));
+            m_rWW8Export.InsUInt16(rLR.ResolveTextLeft({}));
         }
 
         if (rLR.GetRight().m_nUnit == css::util::MeasureUnit::FONT_CJK_ADVANCE)
         {
             // sprmPDxcRight
             m_rWW8Export.InsUInt16(0x4455);
-            
m_rWW8Export.InsUInt16(o3tl::narrowing<sal_uInt16>(rLR.GetRight().m_dValue * 
100.0));
+            m_rWW8Export.InsUInt16(rLR.GetRight().m_dValue * 100.0);
         }
         else
         {
             // sprmPDxaRight
             m_rWW8Export.InsUInt16(0x845D);
-            
m_rWW8Export.InsUInt16(o3tl::narrowing<sal_uInt16>(rLR.ResolveRight({})));
+            m_rWW8Export.InsUInt16(rLR.ResolveRight({}));
         }
 
         if (rLR.GetTextFirstLineOffset().m_nUnit == 
css::util::MeasureUnit::FONT_CJK_ADVANCE)
@@ -4488,7 +4488,7 @@ void WW8AttributeOutput::FormatLRSpace( const 
SvxLRSpaceItem& rLR )
             // sprmPDxcLeft1
             m_rWW8Export.InsUInt16(0x4457);
             m_rWW8Export.InsUInt16(
-                
o3tl::narrowing<sal_uInt16>(rLR.GetTextFirstLineOffset().m_dValue * 100.0));
+                rLR.GetTextFirstLineOffset().m_dValue * 100.0);
         }
         else
         {
@@ -4530,7 +4530,7 @@ void WW8AttributeOutput::FormatULSpace( const 
SvxULSpaceItem& rUL )
         // sprmPDyaFromText
         m_rWW8Export.InsUInt16( NS_sprm::PDyaFromText::val );
         // use average, since WW only knows one value
-        m_rWW8Export.InsUInt16( o3tl::narrowing<sal_uInt16>( ( rUL.GetUpper() 
+ rUL.GetLower() ) / 2 ) );
+        m_rWW8Export.InsUInt16( ( rUL.GetUpper() + rUL.GetLower() ) / 2 );
     }
     else if ( m_rWW8Export.m_bOutPageDescs )            // Page-UL
     {

Reply via email to