diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2023-10-05 10:53:54 +0200 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2023-10-05 12:16:52 +0200 |
commit | c47038d1248340a4e0347a06707ab317da787b3b (patch) | |
tree | 96930fa3af9ac813dc580cc936fd9dc12e2d6254 /toolkit | |
parent | 5c52884611a0e8586ecfa8ccaf24c9e22ad5a872 (diff) |
Replace 3 lcl_throw* by throwing the right exception directly (toolkit)
Change-Id: Ia351741e46faa6463fac2124262da0153ebe19dc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157585
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'toolkit')
-rw-r--r-- | toolkit/source/controls/controlmodelcontainerbase.cxx | 30 |
1 files changed, 6 insertions, 24 deletions
diff --git a/toolkit/source/controls/controlmodelcontainerbase.cxx b/toolkit/source/controls/controlmodelcontainerbase.cxx index 14933e96affc..c82f1052eee3 100644 --- a/toolkit/source/controls/controlmodelcontainerbase.cxx +++ b/toolkit/source/controls/controlmodelcontainerbase.cxx @@ -134,24 +134,6 @@ public: }; -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_throwNoSuchElementException( ) -{ // throwing is expensive (in terms of code size), thus we hope the compiler does not inline this... - throw NoSuchElementException(); -} - - -static void lcl_throwElementExistException( ) -{ // throwing is expensive (in terms of code size), thus we hope the compiler does not inline this... - throw ElementExistException(); -} - - static OUString getTabIndexPropertyName( ) { return "TabIndex"; @@ -435,11 +417,11 @@ void ControlModelContainerBase::replaceByName( const OUString& aName, const Any& Reference< XControlModel > xNewModel; aElement >>= xNewModel; if ( !xNewModel.is() ) - lcl_throwIllegalArgumentException(); + throw IllegalArgumentException(); UnoControlModelHolderVector::iterator aElementPos = ImplFindElement( aName ); if ( maModels.end() == aElementPos ) - lcl_throwNoSuchElementException(); + throw NoSuchElementException(); // Dialog behaviour is to have all containee names unique (MSO Userform is the same) // With container controls you could have constructed an existing hierarchy and are now // add this to an existing container, in this case a name nested in the containment @@ -478,7 +460,7 @@ Any ControlModelContainerBase::getByName( const OUString& aName ) { UnoControlModelHolderVector::iterator aElementPos = ImplFindElement( aName ); if ( maModels.end() == aElementPos ) - lcl_throwNoSuchElementException(); + throw NoSuchElementException(); return Any( aElementPos->first ); } @@ -534,11 +516,11 @@ void ControlModelContainerBase::insertByName( const OUString& aName, const Any& if ( aName.isEmpty() || !xM.is() ) - lcl_throwIllegalArgumentException(); + throw IllegalArgumentException(); UnoControlModelHolderVector::iterator aElementPos = ImplFindElement( aName ); if ( maModels.end() != aElementPos ) - lcl_throwElementExistException(); + throw ElementExistException(); // Dialog behaviour is to have all containee names unique (MSO Userform is the same) // With container controls you could have constructed an existing hierarchy and are now @@ -571,7 +553,7 @@ void ControlModelContainerBase::removeByName( const OUString& aName ) UnoControlModelHolderVector::iterator aElementPos = ImplFindElement( aName ); if ( maModels.end() == aElementPos ) - lcl_throwNoSuchElementException(); + throw NoSuchElementException(); // Dialog behaviour is to have all containee names unique (MSO Userform is the same) // With container controls you could have constructed an existing hierarchy and are now |