filter/source/graphicfilter/icgm/class1.cxx | 2 +- filter/source/graphicfilter/icgm/class4.cxx | 6 +++--- sfx2/source/doc/oleprops.cxx | 8 ++++---- sfx2/source/view/viewfrm.cxx | 4 ++-- svx/source/dialog/_bmpmask.cxx | 6 +++--- 5 files changed, 13 insertions(+), 13 deletions(-)
New commits: commit d66ddcffe61d90cb1472e74a040963086032bf9c Author: Yusuf Keten <[email protected]> AuthorDate: Tue Jan 7 00:05:15 2020 +0300 Commit: Michael Stahl <[email protected]> CommitDate: Wed Jan 8 16:24:12 2020 +0100 tdf#75280 Convert inappropriate use of sal_uIntPtr to better integer types Change-Id: Idf73b768671c0daa0d815b75ce71740fc0e5f5c6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86310 Tested-by: Jenkins Reviewed-by: Michael Stahl <[email protected]> diff --git a/filter/source/graphicfilter/icgm/class1.cxx b/filter/source/graphicfilter/icgm/class1.cxx index cf9e7ed9885f..2661931d7df2 100644 --- a/filter/source/graphicfilter/icgm/class1.cxx +++ b/filter/source/graphicfilter/icgm/class1.cxx @@ -169,7 +169,7 @@ void CGM::ImplDoClass1() { sal_uInt32 nSize = ImplGetUI(1); - if (static_cast<sal_uIntPtr>(mpEndValidSource - (mpSource + mnParaSize)) < nSize) + if (static_cast<sal_uInt32>(mpEndValidSource - (mpSource + mnParaSize)) < nSize) throw css::uno::Exception("attempt to read past end of input", nullptr); pElement->aFontList.InsertName( mpSource + mnParaSize, nSize ); diff --git a/filter/source/graphicfilter/icgm/class4.cxx b/filter/source/graphicfilter/icgm/class4.cxx index 0213e89542e3..4760215ebe18 100644 --- a/filter/source/graphicfilter/icgm/class4.cxx +++ b/filter/source/graphicfilter/icgm/class4.cxx @@ -186,7 +186,7 @@ void CGM::ImplDoClass4() sal_uInt32 nType = ImplGetUI16(); sal_uInt32 nSize = ImplGetUI( 1 ); - if (static_cast<sal_uIntPtr>(mpEndValidSource - (mpSource + mnParaSize)) < nSize) + if (static_cast<sal_uInt32>(mpEndValidSource - (mpSource + mnParaSize)) < nSize) throw css::uno::Exception("attempt to read past end of input", nullptr); OUString aStr(reinterpret_cast<char*>(mpSource) + mnParaSize, nSize, RTL_TEXTENCODING_ASCII_US); @@ -223,7 +223,7 @@ void CGM::ImplDoClass4() sal_uInt32 nType = ImplGetUI16(); sal_uInt32 nSize = ImplGetUI(1); - if (static_cast<sal_uIntPtr>(mpEndValidSource - (mpSource + mnParaSize)) < nSize) + if (static_cast<sal_uInt32>(mpEndValidSource - (mpSource + mnParaSize)) < nSize) throw css::uno::Exception("attempt to read past end of input", nullptr); OUString aStr(reinterpret_cast<char*>(mpSource) + mnParaSize, nSize, RTL_TEXTENCODING_ASCII_US); @@ -240,7 +240,7 @@ void CGM::ImplDoClass4() (void)ImplGetUI16(); // nType sal_uInt32 nSize = ImplGetUI( 1 ); - if (static_cast<sal_uIntPtr>(mpEndValidSource - (mpSource + mnParaSize)) <= nSize) + if (static_cast<sal_uInt32>(mpEndValidSource - (mpSource + mnParaSize)) <= nSize) throw css::uno::Exception("attempt to read past end of input", nullptr); mpSource[ mnParaSize + nSize ] = 0; diff --git a/sfx2/source/doc/oleprops.cxx b/sfx2/source/doc/oleprops.cxx index 6ff78214d802..e194db7d2671 100644 --- a/sfx2/source/doc/oleprops.cxx +++ b/sfx2/source/doc/oleprops.cxx @@ -538,10 +538,10 @@ void SfxOleFileTimeProperty::ImplSave( SvStream& rStrm ) static_cast< sal_uInt16 >( maDateTime.Month ), static_cast< sal_uInt16 >( maDateTime.Year ) ), tools::Time( - static_cast< sal_uIntPtr >( maDateTime.Hours ), - static_cast< sal_uIntPtr >( maDateTime.Minutes ), - static_cast< sal_uIntPtr >( maDateTime.Seconds ), - static_cast< sal_uIntPtr >( maDateTime.NanoSeconds ) ) ); + static_cast< sal_uInt16 >( maDateTime.Hours ), + static_cast< sal_uInt16 >( maDateTime.Minutes ), + static_cast< sal_uInt16 >( maDateTime.Seconds ), + static_cast< sal_uInt32 >( maDateTime.NanoSeconds ) ) ); // invalid time stamp is not converted to UTC // heuristic to detect editing durations (which we assume to be < 1 year): // check only the year, not the entire date diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index e7f0bbd1c3a4..94964af0ca92 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -2694,8 +2694,8 @@ void SfxViewFrame::AddDispatchMacroToBasic_Impl( const OUString& sMacro ) aOUSource = pModule->GetSource32(); sal_uInt16 nStart, nEnd; pMethod->GetLineRange( nStart, nEnd ); - sal_uIntPtr nlStart = nStart; - sal_uIntPtr nlEnd = nEnd; + sal_uInt16 nlStart = nStart; + sal_uInt16 nlEnd = nEnd; CutLines( aOUSource, nlStart-1, nlEnd-nlStart+1 ); } } diff --git a/svx/source/dialog/_bmpmask.cxx b/svx/source/dialog/_bmpmask.cxx index b978311b0b7f..eb1a27674ed6 100644 --- a/svx/source/dialog/_bmpmask.cxx +++ b/svx/source/dialog/_bmpmask.cxx @@ -580,21 +580,21 @@ sal_uInt16 SvxBmpMask::InitColorArrays( Color* pSrcCols, Color* pDstCols, sal_uI { pSrcCols[nCount] = m_pQSet1->GetItemColor( 1 ); pDstCols[nCount] = m_pLbColor1->GetSelectEntryColor(); - pTols[nCount++] = static_cast<sal_uIntPtr>(m_pSp1->GetValue()); + pTols[nCount++] = static_cast<sal_uInt8>(m_pSp1->GetValue()); } if ( m_pCbx2->IsChecked() ) { pSrcCols[nCount] = m_pQSet2->GetItemColor( 1 ); pDstCols[nCount] = m_pLbColor2->GetSelectEntryColor(); - pTols[nCount++] = static_cast<sal_uIntPtr>(m_pSp2->GetValue()); + pTols[nCount++] = static_cast<sal_uInt8>(m_pSp2->GetValue()); } if ( m_pCbx3->IsChecked() ) { pSrcCols[nCount] = m_pQSet3->GetItemColor( 1 ); pDstCols[nCount] = m_pLbColor3->GetSelectEntryColor(); - pTols[nCount++] = static_cast<sal_uIntPtr>(m_pSp3->GetValue()); + pTols[nCount++] = static_cast<sal_uInt8>(m_pSp3->GetValue()); } if ( m_pCbx4->IsChecked() ) _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
