Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index


On 04/11/2012 09:20 PM, Abeer Sethi wrote:
I'm attaching the patch for namecont.cxx, I hope this is the correct way
to go about it. If yes, I have another patch ready for another file.

diff --git a/basic/source/uno/namecont.cxx b/basic/source/uno/namecont.cxx
index a9307d2..4142ef3 100644
--- a/basic/source/uno/namecont.cxx
+++ b/basic/source/uno/namecont.cxx
@@ -300,7 +300,7 @@ void SAL_CALL NameContainer::addContainerListener( const Reference< XContainerLi
     throw (RuntimeException)
 {
     if( !xListener.is() )
-        throw RuntimeException();
+        throw RuntimeException(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("XListener is not equal to 
1")), static_cast< cppu::OWeakObject * >(this));

"XListener is not equal to 1" is probably more confusing than no message at all. ;) Something like "addContainerListener called with null xListener" might be more useful.

(And, as Christina already pointed out, some very recent changes on master now make it possible to leave out the rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(...)) boilerplate.)

Stephan

     Reference< XInterface > xIface( xListener, UNO_QUERY );
     maContainerListeners.addInterface( xIface );
 }

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.