From 5fc869912893826d615661fbd88bf9cdbd60690f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Fri, 2 Sep 2011 22:04:19 +0100 Subject: [PATCH] tell me *what* failed --- comphelper/source/misc/storagehelper.cxx | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/comphelper/source/misc/storagehelper.cxx b/comphelper/source/misc/storagehelper.cxx index 52b8e677f5ab..7e8bdec3a153 100644 --- a/comphelper/source/misc/storagehelper.cxx +++ b/comphelper/source/misc/storagehelper.cxx @@ -64,12 +64,17 @@ uno::Reference< lang::XSingleServiceFactory > OStorageHelper::GetStorageFactory( if ( !xFactory.is() ) throw uno::RuntimeException(); + rtl::OUString sService(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.embed.StorageFactory")); + uno::Reference < lang::XSingleServiceFactory > xStorageFactory( - xFactory->createInstance ( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.embed.StorageFactory" )) ), - uno::UNO_QUERY ); + xFactory->createInstance(sService), uno::UNO_QUERY); if ( !xStorageFactory.is() ) - throw uno::RuntimeException(); + { + throw uno::RuntimeException(rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM("Could not load: ")) + sService, + uno::Reference< uno::XInterface >()); + } return xStorageFactory; } @@ -83,12 +88,17 @@ uno::Reference< lang::XSingleServiceFactory > OStorageHelper::GetFileSystemStora if ( !xFactory.is() ) throw uno::RuntimeException(); + rtl::OUString sService(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.embed.FileSystemStorageFactory")); + uno::Reference < lang::XSingleServiceFactory > xStorageFactory( - xFactory->createInstance ( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.embed.FileSystemStorageFactory" )) ), - uno::UNO_QUERY ); + xFactory->createInstance(sService), uno::UNO_QUERY); if ( !xStorageFactory.is() ) - throw uno::RuntimeException(); + { + throw uno::RuntimeException(rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM("Could not load: ")) + sService, + uno::Reference< uno::XInterface >()); + } return xStorageFactory; }