diff options
author | Matteo Casalin <matteo.casalin@yahoo.com> | 2017-03-17 15:13:41 +0100 |
---|---|---|
committer | Matteo Casalin <matteo.casalin@yahoo.com> | 2017-03-17 22:12:48 +0000 |
commit | 2cdca5d32e0b2d1efb9241e4e03e15b20f28363b (patch) | |
tree | d4976ca852084f03b013410902f4ee2db5a6d415 /sfx2 | |
parent | 376ae93f488baab2957713f4fea72a42c91febf4 (diff) |
SfxObjectFactory: directly store factory name as OUString
Change-Id: I0779be1e4b344124514115c6645394d26ac09c36
Reviewed-on: https://gerrit.libreoffice.org/35375
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Matteo Casalin <matteo.casalin@yahoo.com>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/doc/docfac.cxx | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/sfx2/source/doc/docfac.cxx b/sfx2/source/doc/docfac.cxx index 20ebfbcfc0fa..cfe4e5fdac7b 100644 --- a/sfx2/source/doc/docfac.cxx +++ b/sfx2/source/doc/docfac.cxx @@ -85,15 +85,14 @@ SfxObjectFactory::SfxObjectFactory ( const SvGlobalName& rName, SfxObjectShellFlags nFlagsP, - const char* pName -) : pShortName( pName ), + const OUString& sName +) : m_sFactoryName( sName ), pImpl( new SfxObjectFactory_Impl ), nFlags( nFlagsP ) { - pImpl->pFilterContainer = new SfxFilterContainer( OUString::createFromAscii( pName ) ); + pImpl->pFilterContainer = new SfxFilterContainer( m_sFactoryName ); - OUString aShortName( OUString::createFromAscii( pShortName ) ); - aShortName = aShortName.toAsciiLowerCase(); + const OUString aShortName( m_sFactoryName.toAsciiLowerCase() ); pImpl->aClassName = rName; if ( aShortName == "swriter" ) pImpl->pNameResId = new SfxResId( STR_DOCTYPENAME_SW ); @@ -307,7 +306,7 @@ OUString SfxObjectFactory::GetStandardTemplate( const OUString& rServiceName ) std::shared_ptr<const SfxFilter> SfxObjectFactory::GetTemplateFilter() const { sal_uInt16 nVersion=0; - SfxFilterMatcher aMatcher ( OUString::createFromAscii( pShortName ) ); + SfxFilterMatcher aMatcher ( m_sFactoryName ); SfxFilterMatcherIter aIter( aMatcher ); std::shared_ptr<const SfxFilter> pFilter; std::shared_ptr<const SfxFilter> pTemp = aIter.First(); @@ -342,10 +341,7 @@ const SvGlobalName& SfxObjectFactory::GetClassId() const OUString SfxObjectFactory::GetFactoryURL() const { - OUStringBuffer aURLComposer; - aURLComposer.append("private:factory/"); - aURLComposer.appendAscii(pShortName); - return aURLComposer.makeStringAndClear(); + return "private:factory/" + m_sFactoryName; } OUString SfxObjectFactory::GetModuleName() const |