diff options
-rw-r--r-- | include/sfx2/docfac.hxx | 6 | ||||
-rw-r--r-- | sfx2/source/doc/docfac.cxx | 16 |
2 files changed, 9 insertions, 13 deletions
diff --git a/include/sfx2/docfac.hxx b/include/sfx2/docfac.hxx index 2658eaa07e6c..f1b73f424281 100644 --- a/include/sfx2/docfac.hxx +++ b/include/sfx2/docfac.hxx @@ -43,18 +43,18 @@ typedef void (*SfxVoidFunc)(); class SFX2_DLLPUBLIC SfxObjectFactory { private: - const char* pShortName; + const OUString m_sFactoryName; std::unique_ptr<SfxObjectFactory_Impl> pImpl; // Additional Data SfxObjectShellFlags nFlags; public: - SfxObjectFactory( const SvGlobalName &rName, SfxObjectShellFlags nFlags, const char* pShortName ); + SfxObjectFactory( const SvGlobalName &rName, SfxObjectShellFlags nFlags, const OUString& sFactoryName ); ~SfxObjectFactory(); const SvGlobalName& GetClassId() const; SfxObjectShellFlags GetFlags() { return nFlags; } OUString GetFactoryURL() const; // shortcut for "private:factory/GetShortName()" - OUString GetFactoryName() const { return OUString::createFromAscii(pShortName); } + OUString GetFactoryName() const { return m_sFactoryName; } OUString GetModuleName() const; SfxFilterContainer *GetFilterContainer() const; 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 |