summaryrefslogtreecommitdiffstats
path: root/framework/source/uifactory/uielementfactorymanager.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'framework/source/uifactory/uielementfactorymanager.cxx')
-rw-r--r--framework/source/uifactory/uielementfactorymanager.cxx13
1 files changed, 7 insertions, 6 deletions
diff --git a/framework/source/uifactory/uielementfactorymanager.cxx b/framework/source/uifactory/uielementfactorymanager.cxx
index 39b34246651f..b8a8ea46ed9b 100644
--- a/framework/source/uifactory/uielementfactorymanager.cxx
+++ b/framework/source/uifactory/uielementfactorymanager.cxx
@@ -44,6 +44,7 @@
#include <comphelper/propertyvalue.hxx>
#include <comphelper/compbase.hxx>
#include <cppuhelper/supportsservice.hxx>
+#include <utility>
using namespace com::sun::star::uno;
using namespace com::sun::star::lang;
@@ -63,12 +64,12 @@ static OUString getHashKeyFromStrings( std::u16string_view aType, std::u16string
return OUString::Concat(aType) + "^" + aName + "^" + aModuleName;
}
-ConfigurationAccess_FactoryManager::ConfigurationAccess_FactoryManager( const Reference< XComponentContext >& rxContext, const OUString& _sRoot ) :
+ConfigurationAccess_FactoryManager::ConfigurationAccess_FactoryManager( const Reference< XComponentContext >& rxContext, OUString _sRoot ) :
m_aPropType( "Type" ),
m_aPropName( "Name" ),
m_aPropModule( "Module" ),
m_aPropFactory( "FactoryImplementation" ),
- m_sRoot(_sRoot),
+ m_sRoot(std::move(_sRoot)),
m_bConfigAccessInitialized( false )
{
m_xConfigProvider = theDefaultProvider::get( rxContext );
@@ -84,7 +85,7 @@ ConfigurationAccess_FactoryManager::~ConfigurationAccess_FactoryManager()
xContainer->removeContainerListener(m_xConfigListener);
}
-OUString ConfigurationAccess_FactoryManager::getFactorySpecifierFromTypeNameModule( std::u16string_view rType, const OUString& rName, std::u16string_view rModule ) const
+OUString ConfigurationAccess_FactoryManager::getFactorySpecifierFromTypeNameModule( std::u16string_view rType, std::u16string_view rName, std::u16string_view rModule ) const
{
// SAFE
std::unique_lock g(m_aMutex);
@@ -102,10 +103,10 @@ OUString ConfigurationAccess_FactoryManager::getFactorySpecifierFromTypeNameModu
else
{
// Support factories which uses a defined prefix before the ui name.
- sal_Int32 nIndex = rName.indexOf( '_' );
- if ( nIndex > 0 )
+ size_t nIndex = rName.find( '_' );
+ if ( nIndex > 0 && nIndex != std::u16string_view::npos)
{
- OUString aName = rName.copy( 0, nIndex+1 );
+ std::u16string_view aName = rName.substr( 0, nIndex+1 );
pIter = m_aFactoryManagerMap.find( getHashKeyFromStrings( rType, aName, std::u16string_view() ));
if ( pIter != m_aFactoryManagerMap.end() )
return pIter->second;