Kaydet (Commit) 402fffb7 authored tarafından Caolán McNamara's avatar Caolán McNamara

coverity#1209935 Uncaught exception

and hopefully a million more

Change-Id: Ib1326cae3ec93855b311a8cf4e9e6f9def199d44
üst 1f289431
......@@ -63,7 +63,7 @@ UNOTOOLS_DLLPUBLIC bool MakeFolder(
UNOTOOLS_DLLPUBLIC bool ensureFolder(
com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > xCtx,
com::sun::star::uno::Reference< com::sun::star::ucb::XCommandEnvironment > xEnv,
const OUString& rFolder, ucbhelper::Content & result);
const OUString& rFolder, ucbhelper::Content & result) throw();
/// @return the value of the "Size" property of the given content, or zero if
/// obtaining the property yields a void value or raises a
......
......@@ -457,17 +457,23 @@ bool utl::UCBContentHelper::EqualURLs(
bool utl::UCBContentHelper::ensureFolder(
css::uno::Reference< css::uno::XComponentContext > xCtx,
css::uno::Reference< css::ucb::XCommandEnvironment > xEnv,
const OUString& rFolder, ucbhelper::Content & result)
const OUString& rFolder, ucbhelper::Content & result) throw()
{
INetURLObject aURL( rFolder );
OUString aTitle = aURL.getName( INetURLObject::LAST_SEGMENT, true, INetURLObject::DECODE_WITH_CHARSET );
aURL.removeSegment();
::ucbhelper::Content aParent;
try
{
INetURLObject aURL( rFolder );
OUString aTitle = aURL.getName( INetURLObject::LAST_SEGMENT, true, INetURLObject::DECODE_WITH_CHARSET );
aURL.removeSegment();
::ucbhelper::Content aParent;
if ( ::ucbhelper::Content::create( aURL.GetMainURL( INetURLObject::NO_DECODE ),
xEnv, xCtx, aParent ) )
if ( ::ucbhelper::Content::create( aURL.GetMainURL( INetURLObject::NO_DECODE ),
xEnv, xCtx, aParent ) )
{
return ::utl::UCBContentHelper::MakeFolder(aParent, aTitle, result);
}
}
catch (...)
{
return ::utl::UCBContentHelper::MakeFolder(aParent, aTitle, result);
}
return false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment