sfx2/source/doc/objstor.cxx      |    3 ++-
 sfx2/source/doc/sfxbasemodel.cxx |   39 +++++++++++++++++++++------------------
 2 files changed, 23 insertions(+), 19 deletions(-)

New commits:
commit e8fe17a10aaccb3c73e4e3e9cc6883243af09fff
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Thu Jan 30 14:33:39 2025 +0000
Commit:     Miklos Vajna <vmik...@collabora.com>
CommitDate: Mon Feb 3 10:39:52 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/+/180950
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Miklos Vajna <vmik...@collabora.com>

diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 724c9cc31743..489221257dc0 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -1839,7 +1839,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 a42f9e6703b8..1b1bdff80c12 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -4033,27 +4033,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 &)
+                {
+                }
             }
             const SfxBoolItem* pRepairedDocItem = 
pMedium->GetItemSet().GetItem(SID_REPAIRPACKAGE, false);
             if ( pRepairedDocItem && pRepairedDocItem->GetValue() )

Reply via email to