summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2023-02-27 10:05:48 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2023-02-27 08:09:02 +0000
commit81d0b3569fc49525feba61fb2f81c90e152cbb30 (patch)
treed223ac8bb196b21b9913444dd3cab3902c05f546 /sfx2
parent0d2a962c363632a890a994e7e143099c53ac4283 (diff)
Simplify a bit
Change-Id: I78f5dd63a70d52e7e0b257eed1c668bead2039d6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147856 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/doc/docfile.cxx25
1 files changed, 12 insertions, 13 deletions
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;
}