include/tools/solar.h            |    1 +
 sw/source/filter/ww8/ww8par6.cxx |    4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

New commits:
commit bc3c181b81f931a931e822ab0fe51a22bdd433ba
Author:     Stephan Bergmann <[email protected]>
AuthorDate: Mon Mar 4 20:11:20 2019 +0100
Commit:     Stephan Bergmann <[email protected]>
CommitDate: Tue Mar 5 08:46:36 2019 +0100

    Introduce SVBT16ToInt16 for reading sal_Int16 instead of sal_uInt16
    
    This change does not change the actual results, but avoids Clang
    -fsanitize=implicit-signed-integer-truncation warnings
    
    Change-Id: If82193d7a6ad6bdadb4e8a8b3ed3bbdf3d88c4a3
    Reviewed-on: https://gerrit.libreoffice.org/68706
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <[email protected]>

diff --git a/include/tools/solar.h b/include/tools/solar.h
index 5d078763d3f7..3fd676acbc2a 100644
--- a/include/tools/solar.h
+++ b/include/tools/solar.h
@@ -49,6 +49,7 @@ typedef sal_uInt8   SVBT64[8];
 inline sal_uInt16 SVBT16ToUInt16( const SVBT16 p ) { return 
static_cast<sal_uInt16>
                                                      
(static_cast<sal_uInt16>(p[0])
                                                    + 
(static_cast<sal_uInt16>(p[1]) <<  8)); }
+inline sal_Int16 SVBT16ToInt16( const SVBT16 p ) { return 
sal_Int16(SVBT16ToUInt16(p)); }
 inline sal_uInt32 SVBT32ToUInt32 ( const SVBT32 p ) { return 
static_cast<sal_uInt32>
                                                      
(static_cast<sal_uInt32>(p[0])
                                                    + 
(static_cast<sal_uInt32>(p[1]) <<  8)
diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx
index 1aa9e0946763..f95859e553a5 100644
--- a/sw/source/filter/ww8/ww8par6.cxx
+++ b/sw/source/filter/ww8/ww8par6.cxx
@@ -144,7 +144,7 @@ static short ReadSprm( const WW8PLCFx_SEPX* pSep, 
sal_uInt16 nId, short nDefault
 {
     SprmResult aRes = pSep->HasSprm(nId);          // sprm here?
     const sal_uInt8* pS = aRes.pSprm;
-    short nVal = (pS && aRes.nRemainingData >= 2) ? SVBT16ToUInt16(pS) : 
nDefaultVal;
+    short nVal = (pS && aRes.nRemainingData >= 2) ? SVBT16ToInt16(pS) : 
nDefaultVal;
     return nVal;
 }
 
@@ -3439,7 +3439,7 @@ void SwWW8ImplReader::Read_SubSuperProp( sal_uInt16, 
const sal_uInt8* pData, sho
     }
 
     // font position in HalfPoints
-    short nPos = eVersion <= ww::eWW2 ? static_cast< sal_Int8 >( *pData ) : 
SVBT16ToUInt16( pData );
+    short nPos = eVersion <= ww::eWW2 ? static_cast< sal_Int8 >( *pData ) : 
SVBT16ToInt16( pData );
     sal_Int32 nPos2 = nPos * ( 10 * 100 );      // HalfPoints in 100 * tw
     const SvxFontHeightItem* pF
         = static_cast<const 
SvxFontHeightItem*>(GetFormatAttr(RES_CHRATR_FONTSIZE));
_______________________________________________
Libreoffice-commits mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to