summaryrefslogtreecommitdiff
path: root/svx/source
diff options
context:
space:
mode:
Diffstat (limited to 'svx/source')
-rw-r--r--svx/source/accessibility/ChildrenManagerImpl.cxx4
-rw-r--r--svx/source/accessibility/GraphCtlAccessibleContext.cxx3
-rw-r--r--svx/source/dialog/frmsel.cxx5
-rw-r--r--svx/source/form/filtnav.cxx7
-rw-r--r--svx/source/form/fmshimp.cxx4
-rw-r--r--svx/source/form/fmsrcimp.cxx8
-rw-r--r--svx/source/form/formcontroller.cxx7
-rw-r--r--svx/source/form/navigatortreemodel.cxx3
-rw-r--r--svx/source/items/numfmtsh.cxx12
-rw-r--r--svx/source/svdraw/svdotextpathdecomposition.cxx4
-rw-r--r--svx/source/svdraw/svdpage.cxx3
-rw-r--r--svx/source/tbxctrls/tbcontrl.cxx3
-rw-r--r--svx/source/unodraw/unopage.cxx3
-rw-r--r--svx/source/unodraw/unoshap2.cxx3
-rw-r--r--svx/source/unodraw/unoshap3.cxx3
-rw-r--r--svx/source/xoutdev/xtable.cxx3
16 files changed, 47 insertions, 28 deletions
diff --git a/svx/source/accessibility/ChildrenManagerImpl.cxx b/svx/source/accessibility/ChildrenManagerImpl.cxx
index 656db47ffc43..b24f70688b6f 100644
--- a/svx/source/accessibility/ChildrenManagerImpl.cxx
+++ b/svx/source/accessibility/ChildrenManagerImpl.cxx
@@ -37,7 +37,7 @@
#include <com/sun/star/view/XSelectionSupplier.hpp>
#include <com/sun/star/container/XChild.hpp>
#include <comphelper/types.hxx>
-
+#include <o3tl/safeint.hxx>
#include <rtl/ustring.hxx>
#include <tools/debug.hxx>
#include <svx/SvxShapeTypes.hxx>
@@ -132,7 +132,7 @@ uno::Reference<XAccessible>
ChildrenManagerImpl::GetChild (long nIndex)
{
// Check whether the given index is valid.
- if (nIndex < 0 || static_cast<unsigned long>(nIndex) >= maVisibleChildren.size())
+ if (nIndex < 0 || o3tl::make_unsigned(nIndex) >= maVisibleChildren.size())
throw lang::IndexOutOfBoundsException (
"no accessible child with index " + OUString::number(nIndex),
mxParent);
diff --git a/svx/source/accessibility/GraphCtlAccessibleContext.cxx b/svx/source/accessibility/GraphCtlAccessibleContext.cxx
index 3aff94540e9a..c5d2321b5519 100644
--- a/svx/source/accessibility/GraphCtlAccessibleContext.cxx
+++ b/svx/source/accessibility/GraphCtlAccessibleContext.cxx
@@ -27,6 +27,7 @@
#include <cppuhelper/supportsservice.hxx>
#include <vcl/svapp.hxx>
#include <vcl/settings.hxx>
+#include <o3tl/safeint.hxx>
#include <osl/mutex.hxx>
#include <tools/gen.hxx>
#include <svtools/colorcfg.hxx>
@@ -288,7 +289,7 @@ SdrObject* SvxGraphCtrlAccessibleContext::getSdrObject( sal_Int32 nIndex )
if( nullptr == mpPage )
throw DisposedException();
- if( (nIndex < 0) || ( static_cast<size_t>(nIndex) >= mpPage->GetObjCount() ) )
+ if( (nIndex < 0) || ( o3tl::make_unsigned(nIndex) >= mpPage->GetObjCount() ) )
throw lang::IndexOutOfBoundsException();
return mpPage->GetObj( nIndex );
diff --git a/svx/source/dialog/frmsel.cxx b/svx/source/dialog/frmsel.cxx
index 07cb2e0223bc..b4d80e2f759d 100644
--- a/svx/source/dialog/frmsel.cxx
+++ b/svx/source/dialog/frmsel.cxx
@@ -17,6 +17,9 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <sal/config.h>
+
+#include <o3tl/safeint.hxx>
#include <svx/frmsel.hxx>
#include <vcl/event.hxx>
#include <sal/log.hxx>
@@ -49,7 +52,7 @@ using namespace ::com::sun::star::accessibility;
FrameBorderType GetFrameBorderTypeFromIndex( size_t nIndex )
{
- DBG_ASSERT( nIndex < size_t(FRAMEBORDERTYPE_COUNT),
+ DBG_ASSERT( nIndex < o3tl::make_unsigned(FRAMEBORDERTYPE_COUNT),
"svx::GetFrameBorderTypeFromIndex - invalid index" );
return static_cast< FrameBorderType >( nIndex + 1 );
}
diff --git a/svx/source/form/filtnav.cxx b/svx/source/form/filtnav.cxx
index 9f9bf53d4e46..bf8f215f6404 100644
--- a/svx/source/form/filtnav.cxx
+++ b/svx/source/form/filtnav.cxx
@@ -40,6 +40,7 @@
#include <i18nlangtag/languagetag.hxx>
#include <fmservs.hxx>
#include <fmshimp.hxx>
+#include <o3tl/safeint.hxx>
#include <sfx2/dispatch.hxx>
#include <sfx2/objitem.hxx>
#include <sfx2/objsh.hxx>
@@ -420,7 +421,7 @@ void SAL_CALL FmFilterAdapter::disjunctiveTermRemoved( const FilterEvent& Event
return;
auto& rTermItems = pFormItem->GetChildren();
- const bool bValidIndex = ( Event.DisjunctiveTerm >= 0 ) && ( static_cast<size_t>(Event.DisjunctiveTerm) < rTermItems.size() );
+ const bool bValidIndex = ( Event.DisjunctiveTerm >= 0 ) && ( o3tl::make_unsigned(Event.DisjunctiveTerm) < rTermItems.size() );
OSL_ENSURE( bValidIndex, "FmFilterAdapter::disjunctiveTermRemoved: invalid term index!" );
if ( !bValidIndex )
return;
@@ -455,7 +456,7 @@ void SAL_CALL FmFilterAdapter::disjunctiveTermAdded( const FilterEvent& Event )
return;
const sal_Int32 nInsertPos = Event.DisjunctiveTerm;
- bool bValidIndex = ( nInsertPos >= 0 ) && ( static_cast<size_t>(nInsertPos) <= pFormItem->GetChildren().size() );
+ bool bValidIndex = ( nInsertPos >= 0 ) && ( o3tl::make_unsigned(nInsertPos) <= pFormItem->GetChildren().size() );
if ( !bValidIndex )
{
OSL_FAIL( "FmFilterAdapter::disjunctiveTermAdded: invalid index!" );
@@ -657,7 +658,7 @@ void FmFilterModel::SetCurrentController(const Reference< XFormController > & xC
{
Reference< XFilterController > xFilterController( m_xController, UNO_QUERY_THROW );
const sal_Int32 nActiveTerm( xFilterController->getActiveTerm() );
- if ( pItem->GetChildren().size() > static_cast<size_t>(nActiveTerm) )
+ if ( pItem->GetChildren().size() > o3tl::make_unsigned(nActiveTerm) )
{
SetCurrentItems( static_cast< FmFilterItems* >( pItem->GetChildren()[ nActiveTerm ].get() ) );
}
diff --git a/svx/source/form/fmshimp.cxx b/svx/source/form/fmshimp.cxx
index b2e2104db820..8a8cf4a97484 100644
--- a/svx/source/form/fmshimp.cxx
+++ b/svx/source/form/fmshimp.cxx
@@ -17,7 +17,9 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <sal/config.h>
+#include <o3tl/safeint.hxx>
#include <sal/macros.h>
#include <sal/log.hxx>
#include <fmobj.hxx>
@@ -2198,7 +2200,7 @@ IMPL_LINK(FmXFormShell, OnFoundData_Lock, FmFoundRecordInformation&, rfriWhere,
LoopGrids_Lock(LoopGridsSync::FORCE_SYNC);
// and to the field (for that, I collected the XVclComponent interfaces before the start of the search)
- SAL_WARN_IF(static_cast<size_t>(rfriWhere.nFieldPos) >=
+ SAL_WARN_IF(o3tl::make_unsigned(rfriWhere.nFieldPos) >=
m_arrSearchedControls.size(),
"svx.form", "FmXFormShell::OnFoundData : invalid index!");
SdrObject* pObject = m_arrSearchedControls.at(rfriWhere.nFieldPos);
diff --git a/svx/source/form/fmsrcimp.cxx b/svx/source/form/fmsrcimp.cxx
index ffec88e8706a..5031cf2a2fba 100644
--- a/svx/source/form/fmsrcimp.cxx
+++ b/svx/source/form/fmsrcimp.cxx
@@ -17,7 +17,9 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <sal/config.h>
+#include <o3tl/safeint.hxx>
#include <rtl/strbuf.hxx>
#include <sal/log.hxx>
#include <svx/fmtools.hxx>
@@ -281,7 +283,7 @@ void FmSearchEngine::BuildAndInsertFieldInfo(const Reference< css::container::XI
OUString FmSearchEngine::FormatField(sal_Int32 nWhich)
{
- DBG_ASSERT(static_cast<sal_uInt32>(nWhich) < m_aControlTexts.size(), "FmSearchEngine::FormatField(sal_Int32) : invalid position !");
+ DBG_ASSERT(o3tl::make_unsigned(nWhich) < m_aControlTexts.size(), "FmSearchEngine::FormatField(sal_Int32) : invalid position !");
DBG_ASSERT(m_aControlTexts[nWhich], "FmSearchEngine::FormatField(sal_Int32) : invalid object in array !");
DBG_ASSERT(m_aControlTexts[nWhich]->getControl().is(), "FmSearchEngine::FormatField : invalid control !");
@@ -292,7 +294,7 @@ OUString FmSearchEngine::FormatField(sal_Int32 nWhich)
nWhich = m_nCurrentFieldIndex;
}
- DBG_ASSERT((nWhich >= 0) && (static_cast<sal_uInt32>(nWhich) < m_aControlTexts.size()),
+ DBG_ASSERT((nWhich >= 0) && (o3tl::make_unsigned(nWhich) < m_aControlTexts.size()),
"FmSearchEngine::FormatField : invalid argument nWhich !");
return m_aControlTexts[m_nCurrentFieldIndex == -1 ? nWhich : m_nCurrentFieldIndex]->getCurrentText();
}
@@ -1038,7 +1040,7 @@ void FmSearchEngine::RebuildUsedFields(sal_Int32 nFieldIndex, bool bForce)
DBG_ASSERT((nFieldIndex == -1) ||
((nFieldIndex >= 0) &&
- (static_cast<size_t>(nFieldIndex) < m_arrFieldMapping.size())),
+ (o3tl::make_unsigned(nFieldIndex) < m_arrFieldMapping.size())),
"FmSearchEngine::RebuildUsedFields : nFieldIndex is invalid!");
// collect all fields I need to search through
m_arrUsedFields.clear();
diff --git a/svx/source/form/formcontroller.cxx b/svx/source/form/formcontroller.cxx
index 394377122286..891df87d305f 100644
--- a/svx/source/form/formcontroller.cxx
+++ b/svx/source/form/formcontroller.cxx
@@ -87,6 +87,7 @@
#include <vcl/svapp.hxx>
#include <vcl/settings.hxx>
#include <vcl/window.hxx>
+#include <o3tl/safeint.hxx>
#include <osl/mutex.hxx>
#include <sal/log.hxx>
@@ -745,10 +746,10 @@ void FormController::impl_setTextOnAllFilter_throw()
return;
// set the text for all filters
- OSL_ENSURE( m_aFilterRows.size() > static_cast<size_t>(m_nCurrentFilterPosition),
+ OSL_ENSURE( m_aFilterRows.size() > o3tl::make_unsigned(m_nCurrentFilterPosition),
"FormController::impl_setTextOnAllFilter_throw: m_nCurrentFilterPosition too big" );
- if ( static_cast<size_t>(m_nCurrentFilterPosition) < m_aFilterRows.size() )
+ if ( o3tl::make_unsigned(m_nCurrentFilterPosition) < m_aFilterRows.size() )
{
FmFilterRow& rRow = m_aFilterRows[ m_nCurrentFilterPosition ];
for (const auto& rEntry : rRow)
@@ -1437,7 +1438,7 @@ void SAL_CALL FormController::textChanged(const TextEvent& e)
appendEmptyDisjunctiveTerm();
// find the current row
- if ( ( static_cast<size_t>(m_nCurrentFilterPosition) >= m_aFilterRows.size() ) || ( m_nCurrentFilterPosition < 0 ) )
+ if ( ( m_nCurrentFilterPosition < 0 ) || ( o3tl::make_unsigned(m_nCurrentFilterPosition) >= m_aFilterRows.size() ) )
{
OSL_ENSURE( false, "FormController::textChanged: m_nCurrentFilterPosition is wrong!" );
return;
diff --git a/svx/source/form/navigatortreemodel.cxx b/svx/source/form/navigatortreemodel.cxx
index c58c79f1e3a3..12589592697e 100644
--- a/svx/source/form/navigatortreemodel.cxx
+++ b/svx/source/form/navigatortreemodel.cxx
@@ -33,6 +33,7 @@
#include <svx/strings.hrc>
#include <fmshimp.hxx>
#include <fmobj.hxx>
+#include <o3tl/safeint.hxx>
#include <sfx2/objsh.hxx>
#include <tools/diagnose_ex.h>
#include <com/sun/star/container/XContainer.hpp>
@@ -281,7 +282,7 @@ namespace svxform
m_pFormModel->BegUndo(aUndoStr);
}
- if (nRelPos >= static_cast<sal_uInt32>(xContainer->getCount()))
+ if (nRelPos >= o3tl::make_unsigned(xContainer->getCount()))
nRelPos = static_cast<sal_uInt32>(xContainer->getCount());
// UndoAction
diff --git a/svx/source/items/numfmtsh.cxx b/svx/source/items/numfmtsh.cxx
index f950eb0afd86..3a329b7181a4 100644
--- a/svx/source/items/numfmtsh.cxx
+++ b/svx/source/items/numfmtsh.cxx
@@ -21,7 +21,7 @@
#include <tools/debug.hxx>
#include <i18nlangtag/mslangid.hxx>
-
+#include <o3tl/safeint.hxx>
#include <svl/zforlist.hxx>
#include <svl/zformat.hxx>
#include <svl/currencytable.hxx>
@@ -1228,7 +1228,7 @@ OUString SvxNumberFormatShell::GetComment4Entry(short nEntry)
if (nEntry < 0)
return OUString();
- if (static_cast<size_t>(nEntry) < aCurEntryList.size())
+ if (o3tl::make_unsigned(nEntry) < aCurEntryList.size())
{
sal_uInt32 nMyNfEntry = aCurEntryList[nEntry];
const SvNumberformat* pNumEntry = pFormatter->GetEntry(nMyNfEntry);
@@ -1248,7 +1248,7 @@ short SvxNumberFormatShell::GetCategory4Entry(short nEntry) const
{
if (nEntry < 0)
return 0;
- if (static_cast<size_t>(nEntry) < aCurEntryList.size())
+ if (o3tl::make_unsigned(nEntry) < aCurEntryList.size())
{
sal_uInt32 nMyNfEntry = aCurEntryList[nEntry];
@@ -1282,7 +1282,7 @@ bool SvxNumberFormatShell::GetUserDefined4Entry(short nEntry)
{
if (nEntry < 0)
return false;
- if (static_cast<size_t>(nEntry) < aCurEntryList.size())
+ if (o3tl::make_unsigned(nEntry) < aCurEntryList.size())
{
sal_uInt32 nMyNfEntry = aCurEntryList[nEntry];
const SvNumberformat* pNumEntry = pFormatter->GetEntry(nMyNfEntry);
@@ -1310,7 +1310,7 @@ OUString SvxNumberFormatShell::GetFormat4Entry(short nEntry)
if (!aCurrencyFormatList.empty())
{
- if (aCurrencyFormatList.size() > static_cast<size_t>(nEntry))
+ if (aCurrencyFormatList.size() > o3tl::make_unsigned(nEntry))
return aCurrencyFormatList[nEntry];
}
else
@@ -1335,7 +1335,7 @@ short SvxNumberFormatShell::GetListPos4Entry( sal_uInt32 nIdx, const OUString& r
if (nIdx != NUMBERFORMAT_ENTRY_NEW_CURRENCY)
{
// Check list size against return type limit.
- if (aCurEntryList.size() <= static_cast<size_t>(::std::numeric_limits<short>::max()))
+ if (aCurEntryList.size() <= o3tl::make_unsigned(::std::numeric_limits<short>::max()))
{
for (size_t i = 0; i < aCurEntryList.size(); ++i)
{
diff --git a/svx/source/svdraw/svdotextpathdecomposition.cxx b/svx/source/svdraw/svdotextpathdecomposition.cxx
index 98836adc92e5..9b1cce14f361 100644
--- a/svx/source/svdraw/svdotextpathdecomposition.cxx
+++ b/svx/source/svdraw/svdotextpathdecomposition.cxx
@@ -17,7 +17,9 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <sal/config.h>
+#include <o3tl/safeint.hxx>
#include <svx/svdotext.hxx>
#include <svx/svdoutl.hxx>
#include <basegfx/vector/b2dvector.hxx>
@@ -695,7 +697,7 @@ void SdrTextObj::impDecomposePathTextPrimitive(
// get loop count
sal_uInt32 nLoopCount(rPathPolyPolygon.count());
- if(static_cast<sal_uInt32>(rOutliner.GetParagraphCount()) < nLoopCount)
+ if(o3tl::make_unsigned(rOutliner.GetParagraphCount()) < nLoopCount)
{
nLoopCount = rOutliner.GetParagraphCount();
}
diff --git a/svx/source/svdraw/svdpage.cxx b/svx/source/svdraw/svdpage.cxx
index 8012cf7258d2..5ffb31cf0d13 100644
--- a/svx/source/svdraw/svdpage.cxx
+++ b/svx/source/svdraw/svdpage.cxx
@@ -23,6 +23,7 @@
#include <svx/svdpage.hxx>
+#include <o3tl/safeint.hxx>
#include <sot/storage.hxx>
#include <comphelper/classids.hxx>
#include <svx/svdview.hxx>
@@ -589,7 +590,7 @@ void SdrObjList::sort( std::vector<sal_Int32>& sortOrder)
{
// no negative indexes and indexes larger than maList size are allowed
auto it = std::find_if( sortOrder.begin(), sortOrder.end(), [this](const sal_Int32& rIt)
- { return ( rIt < 0 || static_cast<size_t>(rIt) >= maList.size() ); } );
+ { return ( rIt < 0 || o3tl::make_unsigned(rIt) >= maList.size() ); } );
if ( it != sortOrder.end())
throw css::lang::IllegalArgumentException("negative index of shape", nullptr, 1);
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index 7aee71bb5d81..4421e0f7d3b8 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -112,6 +112,7 @@
#include <cppu/unotype.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <officecfg/Office/Common.hxx>
+#include <o3tl/safeint.hxx>
#include <o3tl/typed_flags_set.hxx>
#include <bitmaps.hlst>
#include <sal/log.hxx>
@@ -534,7 +535,7 @@ private:
SvxBorderLineStyle LineListBox::GetEntryStyle( sal_Int32 nPos ) const
{
- ImpLineListData* pData = (0 <= nPos && static_cast<size_t>(nPos) < m_vLineList.size()) ? m_vLineList[ nPos ].get() : nullptr;
+ ImpLineListData* pData = (0 <= nPos && o3tl::make_unsigned(nPos) < m_vLineList.size()) ? m_vLineList[ nPos ].get() : nullptr;
return pData ? pData->GetStyle() : SvxBorderLineStyle::NONE;
}
diff --git a/svx/source/unodraw/unopage.cxx b/svx/source/unodraw/unopage.cxx
index 28082f35e75f..75522fc5e27a 100644
--- a/svx/source/unodraw/unopage.cxx
+++ b/svx/source/unodraw/unopage.cxx
@@ -24,6 +24,7 @@
#include <com/sun/star/embed/XEmbeddedObject.hpp>
#include <com/sun/star/lang/DisposedException.hpp>
#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
+#include <o3tl/safeint.hxx>
#include <osl/mutex.hxx>
#include <sfx2/dispatch.hxx>
#include <comphelper/classids.hxx>
@@ -355,7 +356,7 @@ uno::Any SAL_CALL SvxDrawPage::getByIndex( sal_Int32 Index )
if( (mpModel == nullptr) || (mpPage == nullptr) )
throw lang::DisposedException("Model or Page was already disposed!");
- if ( Index < 0 || static_cast<size_t>(Index) >= mpPage->GetObjCount() )
+ if ( Index < 0 || o3tl::make_unsigned(Index) >= mpPage->GetObjCount() )
throw lang::IndexOutOfBoundsException("Index (" + OUString::number(Index)
+ ") needs to be a positive integer smaller than the shape count ("
+ OUString::number(mpPage->GetObjCount()) + ")!");
diff --git a/svx/source/unodraw/unoshap2.cxx b/svx/source/unodraw/unoshap2.cxx
index 4c3a1bcbd963..d7dbfd9a0a69 100644
--- a/svx/source/unodraw/unoshap2.cxx
+++ b/svx/source/unodraw/unoshap2.cxx
@@ -33,6 +33,7 @@
#include <com/sun/star/graphic/XGraphic.hpp>
#include <com/sun/star/drawing/QRCode.hpp>
#include <o3tl/any.hxx>
+#include <o3tl/safeint.hxx>
#include <tools/urlobj.hxx>
#include <vcl/svapp.hxx>
#include <osl/file.hxx>
@@ -324,7 +325,7 @@ uno::Any SAL_CALL SvxShapeGroup::getByIndex( sal_Int32 Index )
if( !HasSdrObject() || GetSdrObject()->GetSubList() == nullptr )
throw uno::RuntimeException();
- if( Index<0 || GetSdrObject()->GetSubList()->GetObjCount() <= static_cast<size_t>(Index) )
+ if( Index<0 || GetSdrObject()->GetSubList()->GetObjCount() <= o3tl::make_unsigned(Index) )
throw lang::IndexOutOfBoundsException();
SdrObject* pDestObj = GetSdrObject()->GetSubList()->GetObj( Index );
diff --git a/svx/source/unodraw/unoshap3.cxx b/svx/source/unodraw/unoshap3.cxx
index aaa66de99511..8c29b05755b2 100644
--- a/svx/source/unodraw/unoshap3.cxx
+++ b/svx/source/unodraw/unoshap3.cxx
@@ -27,6 +27,7 @@
#include <com/sun/star/drawing/DoubleSequence.hpp>
#include <com/sun/star/drawing/CameraGeometry.hpp>
#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
+#include <o3tl/safeint.hxx>
#include <vcl/svapp.hxx>
#include <comphelper/sequence.hxx>
#include <sal/log.hxx>
@@ -199,7 +200,7 @@ uno::Any SAL_CALL Svx3DSceneObject::getByIndex( sal_Int32 Index )
if( !HasSdrObject() || GetSdrObject()->GetSubList() == nullptr )
throw uno::RuntimeException();
- if( Index<0 || GetSdrObject()->GetSubList()->GetObjCount() <= static_cast<size_t>(Index) )
+ if( Index<0 || GetSdrObject()->GetSubList()->GetObjCount() <= o3tl::make_unsigned(Index) )
throw lang::IndexOutOfBoundsException();
SdrObject* pDestObj = GetSdrObject()->GetSubList()->GetObj( Index );
diff --git a/svx/source/xoutdev/xtable.cxx b/svx/source/xoutdev/xtable.cxx
index a4ae1c9a368b..f9dad9e532c5 100644
--- a/svx/source/xoutdev/xtable.cxx
+++ b/svx/source/xoutdev/xtable.cxx
@@ -21,6 +21,7 @@
#include <svx/XPropertyTable.hxx>
#include <xmlxtexp.hxx>
#include <xmlxtimp.hxx>
+#include <o3tl/safeint.hxx>
#include <tools/urlobj.hxx>
#include <svx/xtable.hxx>
#include <svx/xpool.hxx>
@@ -113,7 +114,7 @@ XPropertyList::XPropertyList(
bool XPropertyList::isValidIdx(long nIndex) const
{
- return (static_cast<size_t>(nIndex) < maList.size() && nIndex >= 0);
+ return (nIndex >= 0 && o3tl::make_unsigned(nIndex) < maList.size());
}