summaryrefslogtreecommitdiff
path: root/toolkit/source
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2023-10-05 12:21:51 +0200
committerJulien Nabet <serval2412@yahoo.fr>2023-10-05 13:57:11 +0200
commit3c162a7a312022716e0648f95662b33577b5993d (patch)
tree5daa94b2d9d297dc5be27356eb2971344669f469 /toolkit/source
parent07a06e40400f3713619cb456d62d4bb952e85436 (diff)
Replace 2 other lcl_throw* by throwing the right exception directly (toolkit)
Change-Id: Ib0347db6ad5690e0cba9326d7ec3fd85c2f93984 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157588 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Jenkins
Diffstat (limited to 'toolkit/source')
-rw-r--r--toolkit/source/controls/roadmapcontrol.cxx24
1 files changed, 6 insertions, 18 deletions
diff --git a/toolkit/source/controls/roadmapcontrol.cxx b/toolkit/source/controls/roadmapcontrol.cxx
index 1fdef79f28b7..6d73514e7bc4 100644
--- a/toolkit/source/controls/roadmapcontrol.cxx
+++ b/toolkit/source/controls/roadmapcontrol.cxx
@@ -39,18 +39,6 @@ namespace toolkit
// helper
-
-static void lcl_throwIllegalArgumentException( )
-{ // throwing is expensive (in terms of code size), thus we hope the compiler does not inline this...
- throw IllegalArgumentException();
-}
-
-static void lcl_throwIndexOutOfBoundsException( )
-{ // throwing is expensive (in terms of code size), thus we hope the compiler does not inline this...
- throw IndexOutOfBoundsException();
-}
-
-
// = UnoControlRoadmapModel
@@ -179,7 +167,7 @@ static void lcl_throwIndexOutOfBoundsException( )
Any SAL_CALL UnoControlRoadmapModel::getByIndex( sal_Int32 Index )
{
if ((Index < 0) || ( o3tl::make_unsigned(Index) >= maRoadmapItems.size()))
- lcl_throwIndexOutOfBoundsException( );
+ throw IndexOutOfBoundsException();
Any aAny( maRoadmapItems.at( Index ) );
return aAny;
}
@@ -188,13 +176,13 @@ static void lcl_throwIndexOutOfBoundsException( )
void UnoControlRoadmapModel::MakeRMItemValidation( sal_Int32 Index, const Reference< XInterface >& xRoadmapItem )
{
if (( Index < 0 ) || (o3tl::make_unsigned(Index) > maRoadmapItems.size()) )
- lcl_throwIndexOutOfBoundsException( );
+ throw IndexOutOfBoundsException();
if ( !xRoadmapItem.is() )
- lcl_throwIllegalArgumentException();
+ throw IllegalArgumentException();
Reference< XServiceInfo > xServiceInfo( xRoadmapItem, UNO_QUERY );
bool bIsRoadmapItem = xServiceInfo->supportsService("com.sun.star.awt.RoadmapItem");
if ( !bIsRoadmapItem )
- lcl_throwIllegalArgumentException();
+ throw IllegalArgumentException();
}
@@ -268,7 +256,7 @@ static void lcl_throwIndexOutOfBoundsException( )
void SAL_CALL UnoControlRoadmapModel::insertByIndex( const sal_Int32 Index, const Any& Element)
{
if ( ( Index >= ( static_cast<sal_Int32>(maRoadmapItems.size()) + 1 ) ) || (Index < 0))
- lcl_throwIndexOutOfBoundsException( );
+ throw IndexOutOfBoundsException();
Reference< XInterface > xRoadmapItem;
Element >>= xRoadmapItem;
MakeRMItemValidation( Index, xRoadmapItem);
@@ -289,7 +277,7 @@ static void lcl_throwIndexOutOfBoundsException( )
void SAL_CALL UnoControlRoadmapModel::removeByIndex( sal_Int32 Index)
{
if ((Index < 0) || ( o3tl::make_unsigned(Index) > maRoadmapItems.size()))
- lcl_throwIndexOutOfBoundsException( );
+ throw IndexOutOfBoundsException();
Reference< XInterface > xRoadmapItem;
maRoadmapItems.erase( maRoadmapItems.begin() + Index );
ContainerEvent aEvent = GetContainerEvent(Index, xRoadmapItem);