diff options
Diffstat (limited to 'reportdesign')
-rw-r--r-- | reportdesign/source/filter/xml/xmlTable.cxx | 7 | ||||
-rw-r--r-- | reportdesign/source/ui/dlg/CondFormat.cxx | 4 | ||||
-rw-r--r-- | reportdesign/source/ui/inspection/GeometryHandler.cxx | 3 | ||||
-rw-r--r-- | reportdesign/source/ui/misc/FunctionHelper.cxx | 7 |
4 files changed, 12 insertions, 9 deletions
diff --git a/reportdesign/source/filter/xml/xmlTable.cxx b/reportdesign/source/filter/xml/xmlTable.cxx index 5c400a33512d..a960beaf442e 100644 --- a/reportdesign/source/filter/xml/xmlTable.cxx +++ b/reportdesign/source/filter/xml/xmlTable.cxx @@ -18,6 +18,7 @@ */ #include "xmlTable.hxx" #include "xmlfilter.hxx" +#include <o3tl/safeint.hxx> #include <xmloff/xmltoken.hxx> #include <xmloff/xmlnmspe.hxx> #include <xmloff/nmspmap.hxx> @@ -223,7 +224,7 @@ void OXMLTable::endFastElement(sal_Int32 ) { if ( xFixedLine->getOrientation() == 1 ) // vertical { - OSL_ENSURE(static_cast<sal_uInt32>(j+1) < m_aWidth.size(),"Illegal pos of col iter. There should be an empty cell for the next line part."); + OSL_ENSURE(o3tl::make_unsigned(j+1) < m_aWidth.size(),"Illegal pos of col iter. There should be an empty cell for the next line part."); nWidth += m_aWidth[j+1]; if ( nWidth < MIN_WIDTH ) nWidth = MIN_WIDTH; @@ -258,9 +259,9 @@ void OXMLTable::endFastElement(sal_Int32 ) void OXMLTable::addCell(const Reference<XReportComponent>& _xElement) { uno::Reference<report::XShape> xShape(_xElement,uno::UNO_QUERY); - OSL_ENSURE(static_cast<sal_uInt32>(m_nRowIndex-1 ) < m_aGrid.size() && static_cast<sal_uInt32>( m_nColumnIndex-1 ) < m_aGrid[m_nRowIndex-1].size(), + OSL_ENSURE(o3tl::make_unsigned(m_nRowIndex-1 ) < m_aGrid.size() && o3tl::make_unsigned( m_nColumnIndex-1 ) < m_aGrid[m_nRowIndex-1].size(), "OXMLTable::addCell: Invalid column and row index"); - if ( static_cast<sal_uInt32>(m_nRowIndex-1 ) < m_aGrid.size() && static_cast<sal_uInt32>( m_nColumnIndex-1 ) < m_aGrid[m_nRowIndex-1].size() ) + if ( o3tl::make_unsigned(m_nRowIndex-1 ) < m_aGrid.size() && o3tl::make_unsigned( m_nColumnIndex-1 ) < m_aGrid[m_nRowIndex-1].size() ) { TCell& rCell = m_aGrid[m_nRowIndex-1][m_nColumnIndex-1]; if ( _xElement.is() ) diff --git a/reportdesign/source/ui/dlg/CondFormat.cxx b/reportdesign/source/ui/dlg/CondFormat.cxx index 016aa868cbae..c7a64b297d46 100644 --- a/reportdesign/source/ui/dlg/CondFormat.cxx +++ b/reportdesign/source/ui/dlg/CondFormat.cxx @@ -29,7 +29,7 @@ #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/lang/IllegalArgumentException.hpp> - +#include <o3tl/safeint.hxx> #include <toolkit/helper/vclunohelper.hxx> #include <vcl/settings.hxx> @@ -145,7 +145,7 @@ namespace rptui { try { - if ( _nNewCondIndex > static_cast<size_t>(m_xCopy->getCount()) ) + if ( _nNewCondIndex > o3tl::make_unsigned(m_xCopy->getCount()) ) throw IllegalArgumentException(); Reference< XFormatCondition > xCond = m_xCopy->createFormatCondition(); diff --git a/reportdesign/source/ui/inspection/GeometryHandler.cxx b/reportdesign/source/ui/inspection/GeometryHandler.cxx index fb7bdb9e503c..34458e378756 100644 --- a/reportdesign/source/ui/inspection/GeometryHandler.cxx +++ b/reportdesign/source/ui/inspection/GeometryHandler.cxx @@ -106,6 +106,7 @@ #include <helpids.h> #include <toolkit/helper/convert.hxx> #include <o3tl/functional.hxx> +#include <o3tl/safeint.hxx> #define DATA_OR_FORMULA 0 #define FUNCTION 1 @@ -1257,7 +1258,7 @@ uno::Any SAL_CALL GeometryHandler::convertToControlValue(const OUString & Proper { sal_Int16 nParagraphAdjust = sal_Int16(style::ParagraphAdjust_LEFT); aPropertyValue >>= nParagraphAdjust; - if (static_cast<sal_uInt32>(nParagraphAdjust) < SAL_N_ELEMENTS(RID_STR_PARAADJUST_CONST) - 1) + if (o3tl::make_unsigned(nParagraphAdjust) < SAL_N_ELEMENTS(RID_STR_PARAADJUST_CONST) - 1) aControlValue <<= RptResId(RID_STR_PARAADJUST_CONST[nParagraphAdjust]); } break; diff --git a/reportdesign/source/ui/misc/FunctionHelper.cxx b/reportdesign/source/ui/misc/FunctionHelper.cxx index f42e65cc204b..00043d4a94fd 100644 --- a/reportdesign/source/ui/misc/FunctionHelper.cxx +++ b/reportdesign/source/ui/misc/FunctionHelper.cxx @@ -19,6 +19,7 @@ #include <FunctionHelper.hxx> +#include <o3tl/safeint.hxx> #include <osl/diagnose.h> #include <formula/funcvarargs.h> @@ -236,21 +237,21 @@ sal_uInt32 FunctionDescription::getVarArgsStart() const OUString FunctionDescription::getParameterName(sal_uInt32 _nPos) const { - if ( _nPos < static_cast<sal_uInt32>(m_aParameter.getLength()) ) + if ( _nPos < o3tl::make_unsigned(m_aParameter.getLength()) ) return m_aParameter[_nPos].Name; return OUString(); } OUString FunctionDescription::getParameterDescription(sal_uInt32 _nPos) const { - if ( _nPos < static_cast<sal_uInt32>(m_aParameter.getLength()) ) + if ( _nPos < o3tl::make_unsigned(m_aParameter.getLength()) ) return m_aParameter[_nPos].Description; return OUString(); } bool FunctionDescription::isParameterOptional(sal_uInt32 _nPos) const { - if ( _nPos < static_cast<sal_uInt32>(m_aParameter.getLength()) ) + if ( _nPos < o3tl::make_unsigned(m_aParameter.getLength()) ) return m_aParameter[_nPos].IsOptional; return false; } |