sfx2/source/doc/docfile.cxx |   25 ++++++++++++-------------
 1 file changed, 12 insertions(+), 13 deletions(-)

New commits:
commit 81d0b3569fc49525feba61fb2f81c90e152cbb30
Author:     Mike Kaganski <mike.kagan...@collabora.com>
AuthorDate: Mon Feb 27 10:05:48 2023 +0300
Commit:     Mike Kaganski <mike.kagan...@collabora.com>
CommitDate: Mon Feb 27 08:09:02 2023 +0000

    Simplify a bit
    
    Change-Id: I78f5dd63a70d52e7e0b257eed1c668bead2039d6
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147856
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>

diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index c81b79e8ec4e..6b33abb1c3ee 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -633,11 +633,19 @@ Reference < XContent > SfxMedium::GetContent() const
 
 OUString SfxMedium::GetBaseURL( bool bForSaving )
 {
+    if (bForSaving)
+    {
+        bool bIsRemote = IsRemote();
+        if ((bIsRemote && 
!officecfg::Office::Common::Save::URL::Internet::get())
+            || (!bIsRemote && 
!officecfg::Office::Common::Save::URL::FileSystem::get()))
+            return OUString();
+    }
+
+    if (const SfxStringItem* pBaseURLItem = 
GetItemSet()->GetItem<SfxStringItem>(SID_DOC_BASEURL))
+        return pBaseURLItem->GetValue();
+
     OUString aBaseURL;
-    const SfxStringItem* pBaseURLItem = 
GetItemSet()->GetItem<SfxStringItem>(SID_DOC_BASEURL);
-    if ( pBaseURLItem )
-        aBaseURL = pBaseURLItem->GetValue();
-    else if (!utl::ConfigManager::IsFuzzing() && GetContent().is())
+    if (!utl::ConfigManager::IsFuzzing() && GetContent().is())
     {
         try
         {
@@ -651,15 +659,6 @@ OUString SfxMedium::GetBaseURL( bool bForSaving )
         if ( aBaseURL.isEmpty() )
             aBaseURL = GetURLObject().GetMainURL( 
INetURLObject::DecodeMechanism::NONE );
     }
-
-    if ( bForSaving )
-    {
-        bool bIsRemote = IsRemote();
-        if( (bIsRemote && 
!officecfg::Office::Common::Save::URL::Internet::get())
-            || (!pImpl->m_bRemote && 
!officecfg::Office::Common::Save::URL::FileSystem::get()) )
-            return OUString();
-    }
-
     return aBaseURL;
 }
 

Reply via email to