sfx2/source/doc/objstor.cxx | 3 ++- sfx2/source/doc/sfxbasemodel.cxx | 39 +++++++++++++++++++++------------------ 2 files changed, 23 insertions(+), 19 deletions(-)
New commits: commit 8dccf51cabbc8e9e269ed97cece2d4808d28cd34 Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Thu Jan 30 14:33:39 2025 +0000 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Thu Jan 30 20:50:31 2025 +0100 ucbhelper::Content can do nothing with a "private:stream" so don't bother, and skip throwing exceptions in this case Change-Id: Ie5f4dc5fb24f117be7e671dc83766c7804a98005 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180962 Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> Tested-by: Jenkins diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx index 9e1861285ac8..74d209965f5d 100644 --- a/sfx2/source/doc/objstor.cxx +++ b/sfx2/source/doc/objstor.cxx @@ -2143,7 +2143,8 @@ bool SfxObjectShell::SaveTo_Impl aLockUIGuard.Unlock(); pImpl->bForbidReload = bOldStat; - if ( bOk ) + // ucbhelper::Content is unable to do anything useful with a private:stream + if (bOk && !rMedium.GetName().equalsIgnoreAsciiCase("private:stream")) { try { diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index 18dc4e87a1cb..34dc443bc242 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -4067,27 +4067,30 @@ OUString SAL_CALL SfxBaseModel::getTitle() SfxMedium* pMedium = m_pData->m_pObjectShell->GetMedium(); if ( pMedium ) { - try { - ::ucbhelper::Content aContent( pMedium->GetName(), - utl::UCBContentHelper::getDefaultCommandEnvironment(), - comphelper::getProcessComponentContext() ); - const Reference < beans::XPropertySetInfo > xProps - = aContent.getProperties(); - if ( xProps.is() ) - { - static constexpr OUString aServerTitle( u"TitleOnServer"_ustr ); - if ( xProps->hasPropertyByName( aServerTitle ) ) + if (!pMedium->GetName().equalsIgnoreAsciiCase("private:stream")) + { + try { + ::ucbhelper::Content aContent( pMedium->GetName(), + utl::UCBContentHelper::getDefaultCommandEnvironment(), + comphelper::getProcessComponentContext() ); + const Reference < beans::XPropertySetInfo > xProps + = aContent.getProperties(); + if ( xProps.is() ) { - Any aAny = aContent.getPropertyValue( aServerTitle ); - aAny >>= aResult; + static constexpr OUString aServerTitle( u"TitleOnServer"_ustr ); + if ( xProps->hasPropertyByName( aServerTitle ) ) + { + Any aAny = aContent.getPropertyValue( aServerTitle ); + aAny >>= aResult; + } } } - } - catch (const ucb::ContentCreationException &) - { - } - catch (const ucb::CommandAbortedException &) - { + catch (const ucb::ContentCreationException &) + { + } + catch (const ucb::CommandAbortedException &) + { + } } if (pMedium->IsRepairPackage()) aResult += SfxResId(STR_REPAIREDDOCUMENT);