diff options
24 files changed, 52 insertions, 50 deletions
diff --git a/UnoControls/source/controls/framecontrol.cxx b/UnoControls/source/controls/framecontrol.cxx index 8ecc73cf2d1a..ddfa693a654b 100644 --- a/UnoControls/source/controls/framecontrol.cxx +++ b/UnoControls/source/controls/framecontrol.cxx @@ -275,7 +275,7 @@ sal_Bool FrameControl::convertFastPropertyValue( Any& rConvertedVa if ( !bReturn ) { - throw IllegalArgumentException(); + throw IllegalArgumentException("unknown handle " + OUString::number(nHandle), static_cast<cppu::OWeakObject*>(this), 1); } return bReturn; diff --git a/animations/source/animcore/animcore.cxx b/animations/source/animcore/animcore.cxx index 2347dc08a231..ba1f6f7d4231 100644 --- a/animations/source/animcore/animcore.cxx +++ b/animations/source/animcore/animcore.cxx @@ -1875,7 +1875,7 @@ Reference< XAnimationNode > SAL_CALL AnimationNode::insertBefore( const Referenc Guard< Mutex > aGuard( maMutex ); if( !newChild.is() || !refChild.is() ) - throw IllegalArgumentException(); + throw IllegalArgumentException("no child", static_cast<cppu::OWeakObject*>(this), -1); if( std::find(maChildren.begin(), maChildren.end(), newChild) != maChildren.end() ) throw ElementExistException(); @@ -1899,7 +1899,7 @@ Reference< XAnimationNode > SAL_CALL AnimationNode::insertAfter( const Reference Guard< Mutex > aGuard( maMutex ); if( !newChild.is() || !refChild.is() ) - throw IllegalArgumentException(); + throw IllegalArgumentException("no child", static_cast<cppu::OWeakObject*>(this), -1); if( std::find(maChildren.begin(), maChildren.end(), newChild) != maChildren.end() ) throw ElementExistException(); @@ -1927,7 +1927,7 @@ Reference< XAnimationNode > SAL_CALL AnimationNode::replaceChild( const Referenc Guard< Mutex > aGuard( maMutex ); if( !newChild.is() || !oldChild.is() ) - throw IllegalArgumentException(); + throw IllegalArgumentException("no child", static_cast<cppu::OWeakObject*>(this), -1); if( std::find(maChildren.begin(), maChildren.end(), newChild) != maChildren.end() ) throw ElementExistException(); @@ -1953,7 +1953,7 @@ Reference< XAnimationNode > SAL_CALL AnimationNode::removeChild( const Reference Guard< Mutex > aGuard( maMutex ); if( !oldChild.is() ) - throw IllegalArgumentException(); + throw IllegalArgumentException("no child", static_cast<cppu::OWeakObject*>(this), 1); auto old = std::find(maChildren.begin(), maChildren.end(), oldChild); if( old == maChildren.end() ) @@ -1973,7 +1973,7 @@ Reference< XAnimationNode > SAL_CALL AnimationNode::appendChild( const Reference Guard< Mutex > aGuard( maMutex ); if( !newChild.is() ) - throw IllegalArgumentException(); + throw IllegalArgumentException("no child", static_cast<cppu::OWeakObject*>(this), 1); if( std::find(maChildren.begin(), maChildren.end(), newChild) != maChildren.end() ) throw ElementExistException(); @@ -1982,7 +1982,7 @@ Reference< XAnimationNode > SAL_CALL AnimationNode::appendChild( const Reference Reference< XInterface > xChild( newChild ); if( xThis == xChild ) - throw IllegalArgumentException(); + throw IllegalArgumentException("cannot append self", static_cast<cppu::OWeakObject*>(this), -1); maChildren.push_back( newChild ); diff --git a/basctl/source/basicide/basicrenderable.cxx b/basctl/source/basicide/basicrenderable.cxx index 8e4bab711ce8..12bb90610877 100644 --- a/basctl/source/basicide/basicrenderable.cxx +++ b/basctl/source/basicide/basicrenderable.cxx @@ -120,7 +120,7 @@ sal_Int32 SAL_CALL Renderable::getRendererCount ( { VclPtr<Printer> pPrinter = getPrinter(); if (!pPrinter) - throw lang::IllegalArgumentException(); + throw lang::IllegalArgumentException("no printer", static_cast<cppu::OWeakObject*>(this), -1); nCount = mpWindow->countPages( pPrinter ); @@ -192,7 +192,7 @@ void SAL_CALL Renderable::render ( VclPtr<Printer> pPrinter = getPrinter(); if (!pPrinter) - throw lang::IllegalArgumentException(); + throw lang::IllegalArgumentException("no printer", static_cast<cppu::OWeakObject*>(this), -1); sal_Int64 nContent = getIntValue( "PrintContent", -1 ); if( nContent == 1 ) diff --git a/basic/source/basmgr/basmgr.cxx b/basic/source/basmgr/basmgr.cxx index 03b951ffc02d..1254768a2b00 100644 --- a/basic/source/basmgr/basmgr.cxx +++ b/basic/source/basmgr/basmgr.cxx @@ -1753,7 +1753,7 @@ void ModuleContainer_Impl::insertByName( const OUString& aName, const uno::Any& const uno::Type& aAnyType = aElement.getValueType(); if( aModuleType != aAnyType ) { - throw lang::IllegalArgumentException(); + throw lang::IllegalArgumentException("types do not match", static_cast<cppu::OWeakObject*>(this), 2); } uno::Reference< script::XStarBasicModuleInfo > xMod; aElement >>= xMod; @@ -1917,7 +1917,7 @@ void DialogContainer_Impl::insertByName( const OUString&, const uno::Any& aEleme const uno::Type& aAnyType = aElement.getValueType(); if( aModuleType != aAnyType ) { - throw lang::IllegalArgumentException(); + throw lang::IllegalArgumentException("types do not match", static_cast<cppu::OWeakObject*>(this), 2); } uno::Reference< script::XStarBasicDialogInfo > xMod; aElement >>= xMod; diff --git a/basic/source/classes/propacc.cxx b/basic/source/classes/propacc.cxx index e4765fa2249c..287eda3882eb 100644 --- a/basic/source/classes/propacc.cxx +++ b/basic/source/classes/propacc.cxx @@ -136,7 +136,7 @@ Sequence< PropertyValue > SbPropertyValues::getPropertyValues() void SbPropertyValues::setPropertyValues(const Sequence< PropertyValue >& rPropertyValues ) { if (!m_aPropVals.empty()) - throw IllegalArgumentException(); + throw IllegalArgumentException("m_aPropVals not empty", static_cast<cppu::OWeakObject*>(this), -1); for (const PropertyValue& i : rPropertyValues) { diff --git a/basic/source/uno/namecont.cxx b/basic/source/uno/namecont.cxx index dc83ae5a3546..61b62632ef6f 100644 --- a/basic/source/uno/namecont.cxx +++ b/basic/source/uno/namecont.cxx @@ -141,7 +141,7 @@ void NameContainer::replaceByName( const OUString& aName, const Any& aElement ) const Type& aAnyType = aElement.getValueType(); if( mType != aAnyType ) { - throw IllegalArgumentException(); + throw IllegalArgumentException("types do not match", static_cast<cppu::OWeakObject*>(this), 2); } NameContainerNameMap::iterator aIt = mHashMap.find( aName ); if( aIt == mHashMap.end() ) @@ -195,7 +195,7 @@ void NameContainer::insertNoCheck(const OUString& aName, const Any& aElement) const Type& aAnyType = aElement.getValueType(); if( mType != aAnyType ) { - throw IllegalArgumentException(); + throw IllegalArgumentException("types do not match", static_cast<cppu::OWeakObject*>(this), 2); } sal_Int32 nCount = mNames.size(); @@ -435,7 +435,7 @@ void SAL_CALL SfxLibraryContainer::setRootStorage( const Reference< XStorage >& LibraryContainerMethodGuard aGuard( *this ); if ( !_rxRootStorage.is() ) { - throw IllegalArgumentException(); + throw IllegalArgumentException("no root storage", static_cast<cppu::OWeakObject*>(this), 1); } mxStorage = _rxRootStorage; onNewRootStorage(); @@ -446,7 +446,7 @@ void SAL_CALL SfxLibraryContainer::storeLibrariesToStorage( const Reference< XSt LibraryContainerMethodGuard aGuard( *this ); if ( !_rxRootStorage.is() ) { - throw IllegalArgumentException(); + throw IllegalArgumentException("no root storage", static_cast<cppu::OWeakObject*>(this), 1); } try { @@ -2221,7 +2221,7 @@ void SAL_CALL SfxLibraryContainer::removeLibrary( const OUString& Name ) SfxLibrary* pImplLib = static_cast< SfxLibrary* >( xNameAccess.get() ); if( pImplLib->mbReadOnly && !pImplLib->mbLink ) { - throw IllegalArgumentException(); + throw IllegalArgumentException("readonly && !link", static_cast<cppu::OWeakObject*>(this), 1); } // Remove from container maNameContainer->removeByName( Name ); @@ -2444,7 +2444,7 @@ OUString SAL_CALL SfxLibraryContainer::getLibraryLinkURL( const OUString& Name ) bool bLink = pImplLib->mbLink; if( !bLink ) { - throw IllegalArgumentException(); + throw IllegalArgumentException("!link", static_cast<cppu::OWeakObject*>(this), 1); } OUString aRetStr = pImplLib->maLibInfoFileURL; return aRetStr; @@ -2631,9 +2631,10 @@ void SAL_CALL SfxLibraryContainer::initialize( const Sequence< Any >& _rArgument initializeFromDocument( xDocument ); return; } + throw IllegalArgumentException("arg1 unknown type", static_cast<cppu::OWeakObject*>(this), 1); } - - throw IllegalArgumentException(); + else + throw IllegalArgumentException("too many args", static_cast<cppu::OWeakObject*>(this), -1); } void SfxLibraryContainer::initializeFromDocument( const Reference< XStorageBasedDocument >& _rxDocument ) @@ -2657,7 +2658,7 @@ void SfxLibraryContainer::initializeFromDocument( const Reference< XStorageBased if ( !xDocStorage.is() ) { - throw IllegalArgumentException(); + throw IllegalArgumentException("no doc storage", static_cast<cppu::OWeakObject*>(this), 1); } init( OUString(), xDocStorage ); } @@ -2783,7 +2784,7 @@ OUString SAL_CALL SfxLibraryContainer::getOriginalLibraryLinkURL( const OUString bool bLink = pImplLib->mbLink; if( !bLink ) { - throw IllegalArgumentException(); + throw IllegalArgumentException("!link", static_cast<cppu::OWeakObject*>(this), 1); } OUString aRetStr = pImplLib->maOriginalStorageURL; return aRetStr; diff --git a/basic/source/uno/scriptcont.cxx b/basic/source/uno/scriptcont.cxx index 652a7fbc3129..40c9c40ce6bc 100644 --- a/basic/source/uno/scriptcont.cxx +++ b/basic/source/uno/scriptcont.cxx @@ -350,7 +350,7 @@ sal_Bool SAL_CALL SfxScriptLibraryContainer::isLibraryPasswordVerified( const OU SfxLibrary* pImplLib = getImplLib( Name ); if( !pImplLib->mbPasswordProtected ) { - throw IllegalArgumentException(); + throw IllegalArgumentException("!passwordProtected", static_cast<cppu::OWeakObject*>(this), 1); } bool bRet = pImplLib->mbPasswordVerified; return bRet; @@ -363,7 +363,7 @@ sal_Bool SAL_CALL SfxScriptLibraryContainer::verifyLibraryPassword SfxLibrary* pImplLib = getImplLib( Name ); if( !pImplLib->mbPasswordProtected || pImplLib->mbPasswordVerified ) { - throw IllegalArgumentException(); + throw IllegalArgumentException("!PasswordProtected || PasswordVerified", static_cast<cppu::OWeakObject*>(this), 1); } // Test password bool bSuccess = false; diff --git a/canvas/source/cairo/cairo_textlayout.cxx b/canvas/source/cairo/cairo_textlayout.cxx index 6f5d114aa99c..4094bd605e47 100644 --- a/canvas/source/cairo/cairo_textlayout.cxx +++ b/canvas/source/cairo/cairo_textlayout.cxx @@ -129,7 +129,7 @@ namespace cairocanvas if( aAdvancements.getLength() != maText.Length ) { SAL_WARN("canvas.cairo", "TextLayout::applyLogicalAdvancements(): mismatching number of advancements" ); - throw lang::IllegalArgumentException(); + throw lang::IllegalArgumentException("mismatching number of advancements", static_cast<cppu::OWeakObject*>(this), 1); } maLogicalAdvancements = aAdvancements; diff --git a/chart2/source/model/main/BaseCoordinateSystem.cxx b/chart2/source/model/main/BaseCoordinateSystem.cxx index 7075f2ed6f26..f44f565fa86c 100644 --- a/chart2/source/model/main/BaseCoordinateSystem.cxx +++ b/chart2/source/model/main/BaseCoordinateSystem.cxx @@ -245,7 +245,7 @@ void SAL_CALL BaseCoordinateSystem::addChartType( const Reference< chart2::XChar { if( std::find( m_aChartTypes.begin(), m_aChartTypes.end(), aChartType ) != m_aChartTypes.end()) - throw lang::IllegalArgumentException(); + throw lang::IllegalArgumentException("type not found", static_cast<cppu::OWeakObject*>(this), 1); m_aChartTypes.push_back( aChartType ); ModifyListenerHelper::addListener( aChartType, m_xModifyEventForwarder ); diff --git a/chart2/source/model/main/DataSeries.cxx b/chart2/source/model/main/DataSeries.cxx index 5c0ded40cda7..a2f1247ad08e 100644 --- a/chart2/source/model/main/DataSeries.cxx +++ b/chart2/source/model/main/DataSeries.cxx @@ -421,7 +421,7 @@ void SAL_CALL DataSeries::addRegressionCurve( xModifyEventForwarder = m_xModifyEventForwarder; if( std::find( m_aRegressionCurves.begin(), m_aRegressionCurves.end(), xRegressionCurve ) != m_aRegressionCurves.end()) - throw lang::IllegalArgumentException(); + throw lang::IllegalArgumentException("curve not found", static_cast<cppu::OWeakObject*>(this), 1); m_aRegressionCurves.push_back( xRegressionCurve ); } ModifyListenerHelper::addListener( xRegressionCurve, xModifyEventForwarder ); diff --git a/chart2/source/model/main/Diagram.cxx b/chart2/source/model/main/Diagram.cxx index 0b9efc80f794..f5d8afc5b172 100644 --- a/chart2/source/model/main/Diagram.cxx +++ b/chart2/source/model/main/Diagram.cxx @@ -479,7 +479,7 @@ void SAL_CALL Diagram::addCoordinateSystem( MutexGuard aGuard( m_aMutex ); if( std::find( m_aCoordSystems.begin(), m_aCoordSystems.end(), aCoordSys ) != m_aCoordSystems.end()) - throw lang::IllegalArgumentException(); + throw lang::IllegalArgumentException("coordsys not found", static_cast<cppu::OWeakObject*>(this), 1); if( !m_aCoordSystems.empty() ) { diff --git a/chart2/source/model/template/ChartType.cxx b/chart2/source/model/template/ChartType.cxx index 999f7c1ede96..177eb4f1372d 100644 --- a/chart2/source/model/template/ChartType.cxx +++ b/chart2/source/model/template/ChartType.cxx @@ -124,7 +124,7 @@ void ChartType::impl_addDataSeriesWithoutNotification( { if( std::find( m_aDataSeries.begin(), m_aDataSeries.end(), xDataSeries ) != m_aDataSeries.end()) - throw lang::IllegalArgumentException(); + throw lang::IllegalArgumentException("dataseries not found", static_cast<cppu::OWeakObject*>(this), 1); m_aDataSeries.push_back( xDataSeries ); ModifyListenerHelper::addListener( xDataSeries, m_xModifyEventForwarder ); diff --git a/chart2/source/tools/RegressionCurveCalculator.cxx b/chart2/source/tools/RegressionCurveCalculator.cxx index 5b65375b0376..ba8a7423c01e 100644 --- a/chart2/source/tools/RegressionCurveCalculator.cxx +++ b/chart2/source/tools/RegressionCurveCalculator.cxx @@ -133,7 +133,7 @@ Sequence< geometry::RealPoint2D > SAL_CALL RegressionCurveCalculator::getCurveVa sal_Bool /* bMaySkipPointsInCalculation */ ) { if( nPointCount < 2 ) - throw lang::IllegalArgumentException(); + throw lang::IllegalArgumentException("too few points", static_cast<cppu::OWeakObject*>(this), 2); // determine if scaling and inverse scaling for x-values work bool bDoXScaling( xScalingX.is()); diff --git a/comphelper/source/container/IndexedPropertyValuesContainer.cxx b/comphelper/source/container/IndexedPropertyValuesContainer.cxx index fe4ba0cff91a..639fb625797e 100644 --- a/comphelper/source/container/IndexedPropertyValuesContainer.cxx +++ b/comphelper/source/container/IndexedPropertyValuesContainer.cxx @@ -80,7 +80,7 @@ void SAL_CALL IndexedPropertyValuesContainer::insertByIndex( sal_Int32 nIndex, c uno::Sequence<beans::PropertyValue> aProps; if (!(aElement >>= aProps)) - throw lang::IllegalArgumentException(); + throw lang::IllegalArgumentException("element is not beans::PropertyValue", static_cast<cppu::OWeakObject*>(this), 2); if (nSize == nIndex) maProperties.push_back(aProps); else @@ -104,7 +104,7 @@ void SAL_CALL IndexedPropertyValuesContainer::replaceByIndex( sal_Int32 nIndex, uno::Sequence<beans::PropertyValue> aProps; if (!(aElement >>= aProps)) - throw lang::IllegalArgumentException(); + throw lang::IllegalArgumentException("element is not beans::PropertyValue", static_cast<cppu::OWeakObject*>(this), 2); maProperties[nIndex] = aProps; } diff --git a/comphelper/source/container/NamedPropertyValuesContainer.cxx b/comphelper/source/container/NamedPropertyValuesContainer.cxx index 79a7d714b5e6..dbd0e422b5fb 100644 --- a/comphelper/source/container/NamedPropertyValuesContainer.cxx +++ b/comphelper/source/container/NamedPropertyValuesContainer.cxx @@ -78,7 +78,7 @@ void SAL_CALL NamedPropertyValuesContainer::insertByName( const OUString& aName, uno::Sequence<beans::PropertyValue> aProps; if( !(aElement >>= aProps ) ) - throw lang::IllegalArgumentException(); + throw lang::IllegalArgumentException("element is not beans::PropertyValue", static_cast<cppu::OWeakObject*>(this), 2); maProperties.emplace( aName, aProps ); } @@ -101,7 +101,7 @@ void SAL_CALL NamedPropertyValuesContainer::replaceByName( const OUString& aName uno::Sequence<beans::PropertyValue> aProps; if( !(aElement >>= aProps) ) - throw lang::IllegalArgumentException(); + throw lang::IllegalArgumentException("element is not beans::PropertyValue", static_cast<cppu::OWeakObject*>(this), 2); (*aIter).second = aProps; } diff --git a/comphelper/source/container/enumerablemap.cxx b/comphelper/source/container/enumerablemap.cxx index 1730d2dc2668..ae6053d7520c 100644 --- a/comphelper/source/container/enumerablemap.cxx +++ b/comphelper/source/container/enumerablemap.cxx @@ -326,7 +326,7 @@ namespace comphelper sal_Int32 nArgumentCount = _arguments.getLength(); if ( ( nArgumentCount != 2 ) && ( nArgumentCount != 3 ) ) - throw IllegalArgumentException(); + throw IllegalArgumentException("wrong number of args", static_cast<cppu::OWeakObject*>(this), 1); Type aKeyType, aValueType; if ( !( _arguments[0] >>= aKeyType ) ) diff --git a/comphelper/source/container/namecontainer.cxx b/comphelper/source/container/namecontainer.cxx index bed257ca50c7..fc43d871d7e4 100644 --- a/comphelper/source/container/namecontainer.cxx +++ b/comphelper/source/container/namecontainer.cxx @@ -85,7 +85,7 @@ void SAL_CALL NameContainer::insertByName( const OUString& aName, const Any& aEl throw ElementExistException(); if( aElement.getValueType() != maType ) - throw IllegalArgumentException(); + throw IllegalArgumentException("element is wrong type", static_cast<cppu::OWeakObject*>(this), 2); maProperties.emplace(aName,aElement); } @@ -112,7 +112,7 @@ void SAL_CALL NameContainer::replaceByName( const OUString& aName, const Any& aE throw NoSuchElementException(); if( aElement.getValueType() != maType ) - throw IllegalArgumentException(); + throw IllegalArgumentException("element is wrong type", static_cast<cppu::OWeakObject*>(this), 2); (*aIter).second = aElement; } diff --git a/comphelper/source/eventattachermgr/eventattachermgr.cxx b/comphelper/source/eventattachermgr/eventattachermgr.cxx index e92b7fc70e1a..4a36c0f1192f 100644 --- a/comphelper/source/eventattachermgr/eventattachermgr.cxx +++ b/comphelper/source/eventattachermgr/eventattachermgr.cxx @@ -379,7 +379,7 @@ Reference< XIdlReflection > ImplEventAttacherManager::getReflection() std::deque< AttacherIndex_Impl >::iterator ImplEventAttacherManager::implCheckIndex( sal_Int32 _nIndex ) { if ( (_nIndex < 0) || (o3tl::make_unsigned(_nIndex) >= aIndex.size()) ) - throw IllegalArgumentException(); + throw IllegalArgumentException("wrong index", static_cast<cppu::OWeakObject*>(this), 1); std::deque<AttacherIndex_Impl>::iterator aIt = aIndex.begin() + _nIndex; return aIt; @@ -497,7 +497,7 @@ void SAL_CALL ImplEventAttacherManager::insertEntry(sal_Int32 nIndex) { Guard< Mutex > aGuard( aLock ); if( nIndex < 0 ) - throw IllegalArgumentException(); + throw IllegalArgumentException("negative index", static_cast<cppu::OWeakObject*>(this), 1); if ( o3tl::make_unsigned(nIndex) >= aIndex.size() ) aIndex.resize(nIndex+1); @@ -532,7 +532,7 @@ void SAL_CALL ImplEventAttacherManager::attach(sal_Int32 nIndex, const Reference { Guard< Mutex > aGuard( aLock ); if( nIndex < 0 || !xObject.is() ) - throw IllegalArgumentException(); + throw IllegalArgumentException("negative index, or null object", static_cast<cppu::OWeakObject*>(this), -1); if( o3tl::make_unsigned(nIndex) >= aIndex.size() ) { @@ -589,7 +589,7 @@ void SAL_CALL ImplEventAttacherManager::detach(sal_Int32 nIndex, const Reference Guard< Mutex > aGuard( aLock ); //return; if( nIndex < 0 || o3tl::make_unsigned(nIndex) >= aIndex.size() || !xObject.is() ) - throw IllegalArgumentException(); + throw IllegalArgumentException("bad index or null object", static_cast<cppu::OWeakObject*>(this), 1); std::deque< AttacherIndex_Impl >::iterator aCurrentPosition = aIndex.begin() + nIndex; auto aObjIt = std::find_if(aCurrentPosition->aObjList.begin(), aCurrentPosition->aObjList.end(), diff --git a/comphelper/source/misc/anycompare.cxx b/comphelper/source/misc/anycompare.cxx index 72156024ccd0..106892400c7c 100644 --- a/comphelper/source/misc/anycompare.cxx +++ b/comphelper/source/misc/anycompare.cxx @@ -60,7 +60,7 @@ namespace comphelper if ( !( _lhs >>= lhs ) || !( _rhs >>= rhs ) ) - throw css::lang::IllegalArgumentException(); + throw css::lang::IllegalArgumentException("bad ordering", css::uno::Reference<css::uno::XInterface>(), -1); // FIXME Timezone? if ( lhs.Year < rhs.Year ) @@ -88,7 +88,7 @@ namespace comphelper if ( !( _lhs >>= lhs ) || !( _rhs >>= rhs ) ) - throw css::lang::IllegalArgumentException(); + throw css::lang::IllegalArgumentException("bad ordering", css::uno::Reference<css::uno::XInterface>(), -1); // FIXME Timezone? if ( lhs.Hours < rhs.Hours ) @@ -121,7 +121,7 @@ namespace comphelper if ( !( _lhs >>= lhs ) || !( _rhs >>= rhs ) ) - throw css::lang::IllegalArgumentException(); + throw css::lang::IllegalArgumentException("bad ordering", css::uno::Reference<css::uno::XInterface>(), -1); // FIXME Timezone? if ( lhs.Year < rhs.Year ) diff --git a/comphelper/source/misc/types.cxx b/comphelper/source/misc/types.cxx index 30981f3bd6c8..8887d5b5ac92 100644 --- a/comphelper/source/misc/types.cxx +++ b/comphelper/source/misc/types.cxx @@ -95,7 +95,8 @@ sal_Int32 getEnumAsINT32(const Any& _rAny) { sal_Int32 nReturn = 0; if (!::cppu::enum2int(nReturn, _rAny)) - throw IllegalArgumentException(); + throw IllegalArgumentException("enum2int failed", + css::uno::Reference<css::uno::XInterface>(), -1); return nReturn; } diff --git a/comphelper/source/property/ChainablePropertySet.cxx b/comphelper/source/property/ChainablePropertySet.cxx index c4f0d018641d..4694a89c527c 100644 --- a/comphelper/source/property/ChainablePropertySet.cxx +++ b/comphelper/source/property/ChainablePropertySet.cxx @@ -116,7 +116,7 @@ void SAL_CALL ChainablePropertySet::setPropertyValues(const Sequence< OUString > const sal_Int32 nCount = rPropertyNames.getLength(); if( nCount != rValues.getLength() ) - throw IllegalArgumentException(); + throw IllegalArgumentException("lengths do not match", static_cast<cppu::OWeakObject*>(this), -1); if( !nCount ) return; diff --git a/comphelper/source/property/opropertybag.cxx b/comphelper/source/property/opropertybag.cxx index f906374064af..62dd474c962f 100644 --- a/comphelper/source/property/opropertybag.cxx +++ b/comphelper/source/property/opropertybag.cxx @@ -197,7 +197,7 @@ namespace comphelper // If we ever have a smarter XPropertyContainer::addProperty interface, we can remove this, ehm, well, hack. Property aProperty; if ( !( _element >>= aProperty ) ) - throw IllegalArgumentException( OUString(), *this, 1 ); + throw IllegalArgumentException( "element is not Property", *this, 1 ); { osl::MutexGuard g(m_aMutex); @@ -206,7 +206,7 @@ namespace comphelper // by m_aDynamicProperties if (!m_aAllowedTypes.empty() && m_aAllowedTypes.find(aProperty.Type) == m_aAllowedTypes.end()) - throw IllegalArgumentException(OUString(), *this, 1); + throw IllegalArgumentException("not in list of allowed types", *this, 1); m_aDynamicProperties.addVoidProperty(aProperty.Name, aProperty.Type, findFreeHandle(), aProperty.Attributes); diff --git a/comphelper/source/property/propertysethelper.cxx b/comphelper/source/property/propertysethelper.cxx index 5f0f043987ee..de6e914cb859 100644 --- a/comphelper/source/property/propertysethelper.cxx +++ b/comphelper/source/property/propertysethelper.cxx @@ -111,7 +111,7 @@ void SAL_CALL PropertySetHelper::setPropertyValues( const Sequence< OUString >& const sal_Int32 nCount = rPropertyNames.getLength(); if( nCount != rValues.getLength() ) - throw IllegalArgumentException(); + throw IllegalArgumentException("lengths do not match", uno::Reference<uno::XInterface>(), -1); if( !nCount ) return; diff --git a/comphelper/source/streaming/seqstream.cxx b/comphelper/source/streaming/seqstream.cxx index 2837f27f5d35..7cffb774232f 100644 --- a/comphelper/source/streaming/seqstream.cxx +++ b/comphelper/source/streaming/seqstream.cxx @@ -117,7 +117,7 @@ void SAL_CALL SequenceInputStream::closeInput( ) void SAL_CALL SequenceInputStream::seek( sal_Int64 location ) { if ( location > m_aData.getLength() || location < 0 || location > SAL_MAX_INT32 ) - throw IllegalArgumentException(); + throw IllegalArgumentException("bad location", static_cast<cppu::OWeakObject*>(this), 1); m_nPos = static_cast<sal_Int32>(location); } |