From b93a015f9bbed007a8800ef040ec2b6211d33858 Mon Sep 17 00:00:00 2001 From: Matteo Casalin Date: Thu, 16 Mar 2017 21:21:25 +0100 Subject: Use SfxObjectFactory::GetFactoryName/URL instead of OUString::createFromAscii( GetShortName() ), in one case manually added to factory URL prefix. Change-Id: I762fc1bcd6dcf7246531816faad2682caf9133fb Reviewed-on: https://gerrit.libreoffice.org/35371 Tested-by: Jenkins Reviewed-by: Matteo Casalin --- sfx2/source/doc/objserv.cxx | 5 ++--- sfx2/source/doc/objstor.cxx | 2 +- sfx2/source/view/viewfrm2.cxx | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) (limited to 'sfx2') diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx index 95048d118856..f354797da5a1 100644 --- a/sfx2/source/doc/objserv.cxx +++ b/sfx2/source/doc/objserv.cxx @@ -275,7 +275,7 @@ bool SfxObjectShell::APISaveAs_Impl(const OUString& aFileName, SfxItemSet& rItem const SfxStringItem* pContentTypeItem = rItemSet.GetItem(SID_CONTENTTYPE, false); if ( pContentTypeItem ) { - std::shared_ptr pFilter = SfxFilterMatcher( OUString::createFromAscii(GetFactory().GetShortName()) ).GetFilter4Mime( pContentTypeItem->GetValue(), SfxFilterFlags::EXPORT ); + std::shared_ptr pFilter = SfxFilterMatcher( GetFactory().GetFactoryName() ).GetFilter4Mime( pContentTypeItem->GetValue(), SfxFilterFlags::EXPORT ); if ( pFilter ) aFilterName = pFilter->GetName(); } @@ -457,8 +457,7 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq) } else { - aURL = "private:factory/" + OUString::createFromAscii( GetFactory().GetShortName() ); - + aURL = GetFactory().GetFactoryURL(); aTitle = GetTitle(); } diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx index 4f70a1db4068..420cb6ecd35c 100644 --- a/sfx2/source/doc/objstor.cxx +++ b/sfx2/source/doc/objstor.cxx @@ -2588,7 +2588,7 @@ bool SfxObjectShell::Save_Impl( const SfxItemSet* pSet ) OUString aFilterName; std::shared_ptr pFilter; if ( pFilterItem ) - pFilter = SfxFilterMatcher( OUString::createFromAscii( GetFactory().GetShortName()) ).GetFilter4FilterName( aFilterName ); + pFilter = SfxFilterMatcher( GetFactory().GetFactoryName() ).GetFilter4FilterName( aFilterName ); SfxMedium *pMed = new SfxMedium( pSalvageItem->GetValue(), StreamMode::READWRITE | StreamMode::SHARE_DENYWRITE | StreamMode::TRUNC, pFilter ); diff --git a/sfx2/source/view/viewfrm2.cxx b/sfx2/source/view/viewfrm2.cxx index 5fbe65757128..56afe2fcb781 100644 --- a/sfx2/source/view/viewfrm2.cxx +++ b/sfx2/source/view/viewfrm2.cxx @@ -116,7 +116,7 @@ void SfxViewFrame::UpdateTitle() { const SfxObjectFactory &rFact = GetObjectShell()->GetFactory(); - m_pImpl->aFactoryName = OUString::createFromAscii(rFact.GetShortName()); + m_pImpl->aFactoryName = rFact.GetFactoryName(); SfxObjectShell *pObjSh = GetObjectShell(); if ( !pObjSh ) -- cgit