summaryrefslogtreecommitdiffstats
path: root/sc/source/filter/oox/formulabuffer.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/filter/oox/formulabuffer.cxx')
-rw-r--r--sc/source/filter/oox/formulabuffer.cxx13
1 files changed, 7 insertions, 6 deletions
diff --git a/sc/source/filter/oox/formulabuffer.cxx b/sc/source/filter/oox/formulabuffer.cxx
index 26aec23827db..0d1855468bf1 100644
--- a/sc/source/filter/oox/formulabuffer.cxx
+++ b/sc/source/filter/oox/formulabuffer.cxx
@@ -18,6 +18,7 @@
#include <sharedformulagroups.hxx>
#include <externalrefmgr.hxx>
#include <tokenstringcontext.hxx>
+#include <o3tl/safeint.hxx>
#include <oox/token/tokens.hxx>
#include <oox/helper/progressbar.hxx>
#include <svl/sharedstringpool.hxx>
@@ -399,7 +400,7 @@ FormulaBuffer::SheetItem FormulaBuffer::getSheetItem( SCTAB nTab )
SheetItem aItem;
- if( static_cast<size_t>(nTab) >= maCellFormulas.size() )
+ if( o3tl::make_unsigned(nTab) >= maCellFormulas.size() )
{
SAL_WARN( "sc", "Tab " << nTab << " out of bounds " << maCellFormulas.size() );
return aItem;
@@ -423,7 +424,7 @@ void FormulaBuffer::createSharedFormulaMapEntry(
const ScAddress& rAddress,
sal_Int32 nSharedId, const OUString& rTokens )
{
- assert( rAddress.Tab() >= 0 && static_cast<size_t>(rAddress.Tab()) < maSharedFormulas.size() );
+ assert( rAddress.Tab() >= 0 && o3tl::make_unsigned(rAddress.Tab()) < maSharedFormulas.size() );
std::vector<SharedFormulaEntry>& rSharedFormulas = maSharedFormulas[ rAddress.Tab() ];
SharedFormulaEntry aEntry(rAddress, rTokens, nSharedId);
rSharedFormulas.push_back( aEntry );
@@ -431,14 +432,14 @@ void FormulaBuffer::createSharedFormulaMapEntry(
void FormulaBuffer::setCellFormula( const ScAddress& rAddress, const OUString& rTokenStr )
{
- assert( rAddress.Tab() >= 0 && static_cast<size_t>(rAddress.Tab()) < maCellFormulas.size() );
+ assert( rAddress.Tab() >= 0 && o3tl::make_unsigned(rAddress.Tab()) < maCellFormulas.size() );
maCellFormulas[ rAddress.Tab() ].emplace_back( rTokenStr, rAddress );
}
void FormulaBuffer::setCellFormula(
const ScAddress& rAddress, sal_Int32 nSharedId, const OUString& rCellValue, sal_Int32 nValueType )
{
- assert( rAddress.Tab() >= 0 && static_cast<size_t>(rAddress.Tab()) < maSharedFormulaIds.size() );
+ assert( rAddress.Tab() >= 0 && o3tl::make_unsigned(rAddress.Tab()) < maSharedFormulaIds.size() );
maSharedFormulaIds[rAddress.Tab()].emplace_back(rAddress, nSharedId, rCellValue, nValueType);
}
@@ -446,14 +447,14 @@ void FormulaBuffer::setCellArrayFormula( const ScRange& rRangeAddress, const ScA
{
TokenAddressItem tokenPair( rTokenStr, rTokenAddress );
- assert( rRangeAddress.aStart.Tab() >= 0 && static_cast<size_t>(rRangeAddress.aStart.Tab()) < maCellArrayFormulas.size() );
+ assert( rRangeAddress.aStart.Tab() >= 0 && o3tl::make_unsigned(rRangeAddress.aStart.Tab()) < maCellArrayFormulas.size() );
maCellArrayFormulas[ rRangeAddress.aStart.Tab() ].emplace_back( tokenPair, rRangeAddress );
}
void FormulaBuffer::setCellFormulaValue(
const ScAddress& rAddress, const OUString& rValueStr, sal_Int32 nCellType )
{
- assert( rAddress.Tab() >= 0 && static_cast<size_t>(rAddress.Tab()) < maCellFormulaValues.size() );
+ assert( rAddress.Tab() >= 0 && o3tl::make_unsigned(rAddress.Tab()) < maCellFormulaValues.size() );
FormulaValue aVal;
aVal.maAddress = rAddress;
aVal.maValueStr = rValueStr;