diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2012-08-22 09:11:23 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-08-22 09:11:23 +0200 |
commit | 27c7682e5e5859eb353443d6091143694a56bee8 (patch) | |
tree | 1c53739aaf3eec6d658603bd95ee619a5ceeb390 /unotools/source/ucbhelper | |
parent | b6e1a001df60cc3f606d3f7fc361367feb13edaf (diff) |
fdo#46249: UCBContentHelper::GetTitle must not fail for void property
This was a regression introduced with 2af9040d38af7c7353855415dbea0134585058f3
"Cleaned up utl::UCBContentHelper." GetSize exhibited the same problem and has
also been fixed. IsYounger exhibits a similar problem, but has not been
addressed, as it is unclear what to return in case no dates can be compared; it
is only used in one place (handling SID_EDITDOC in
SfxViewFrame::ExecReload_Impl, sfx2/source/view/viewfrm.cxx) where, it appears,
only contents for which DateModified /does/ yield a non-void value are relevant.
Change-Id: Iff9f5e1ed6f45eede117713d64a265b98f6862b1
Diffstat (limited to 'unotools/source/ucbhelper')
-rw-r--r-- | unotools/source/ucbhelper/ucbhelper.cxx | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/unotools/source/ucbhelper/ucbhelper.cxx b/unotools/source/ucbhelper/ucbhelper.cxx index 408e51f145c4..0709caa115e6 100644 --- a/unotools/source/ucbhelper/ucbhelper.cxx +++ b/unotools/source/ucbhelper/ucbhelper.cxx @@ -191,11 +191,7 @@ bool utl::UCBContentHelper::GetTitle( { assert(title != 0); try { - *title = content(url). - getPropertyValue( - rtl::OUString("Title")). - get<rtl::OUString>(); - return true; + return content(url).getPropertyValue(rtl::OUString("Title")) >>= *title; } catch (css::uno::RuntimeException const &) { throw; } catch (css::ucb::CommandAbortedException const &) { @@ -300,10 +296,13 @@ bool utl::UCBContentHelper::MakeFolder( sal_Int64 utl::UCBContentHelper::GetSize(rtl::OUString const & url) { try { - return - content(url).getPropertyValue( - rtl::OUString("Size")). - get<sal_Int64>(); + sal_Int64 n = 0; + bool ok = (content(url).getPropertyValue(rtl::OUString("Size")) >>= n); + SAL_INFO_IF( + !ok, "unotools", + "UCBContentHelper::GetSize(" << url + << "): Size cannot be determined"); + return n; } catch (css::uno::RuntimeException const &) { throw; } catch (css::ucb::CommandAbortedException const &) { |