summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2021-11-02 18:55:59 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2021-11-02 19:49:04 +0100
commitc9b100df77331ebe1f5e66b9dd248c8cc43a885f (patch)
tree5e22351a94f4ecfc468438ea28349ca9ec9c330f
parentb0e574a8be2a080f5039e968f4f32ce4b8fa2b26 (diff)
Drop char*-based API from NamedValueCollection
Change-Id: I87f339b348580e256a8d65470ad15cbdabf2c9dd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124609 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
-rw-r--r--connectivity/source/commontools/dbmetadata.cxx6
-rw-r--r--dbaccess/source/core/dataaccess/documentdefinition.cxx14
-rw-r--r--dbaccess/source/filter/xml/dbloader2.cxx6
-rw-r--r--dbaccess/source/ui/app/AppController.cxx12
-rw-r--r--dbaccess/source/ui/app/AppDetailPageHelper.cxx2
-rw-r--r--dbaccess/source/ui/misc/databaseobjectview.cxx26
-rw-r--r--dbaccess/source/ui/misc/dsmeta.cxx62
-rw-r--r--dbaccess/source/ui/misc/linkeddocuments.cxx4
-rw-r--r--dbaccess/source/ui/querydesign/querycontroller.cxx6
-rw-r--r--include/comphelper/namedvaluecollection.hxx57
-rw-r--r--reportdesign/source/ui/misc/UITools.cxx6
-rw-r--r--sfx2/source/view/frmload.cxx14
12 files changed, 75 insertions, 140 deletions
diff --git a/connectivity/source/commontools/dbmetadata.cxx b/connectivity/source/commontools/dbmetadata.cxx
index d4d75109f815..0a2123aaa782 100644
--- a/connectivity/source/commontools/dbmetadata.cxx
+++ b/connectivity/source/commontools/dbmetadata.cxx
@@ -107,7 +107,7 @@ namespace dbtools
}
- bool lcl_getDriverSetting( const char* _asciiName, const DatabaseMetaData_Impl& _metaData, Any& _out_setting )
+ bool lcl_getDriverSetting( const OUString& _asciiName, const DatabaseMetaData_Impl& _metaData, Any& _out_setting )
{
lcl_checkConnected( _metaData );
const ::comphelper::NamedValueCollection& rDriverMetaData = _metaData.aDriverConfig.getMetaData( _metaData.xConnectionMetaData->getURL() );
@@ -118,7 +118,7 @@ namespace dbtools
}
- bool lcl_getConnectionSetting( const char* _asciiName, const DatabaseMetaData_Impl& _metaData, Any& _out_setting )
+ bool lcl_getConnectionSetting(const OUString& _asciiName, const DatabaseMetaData_Impl& _metaData, Any& _out_setting )
{
try
{
@@ -130,7 +130,7 @@ namespace dbtools
xDataSource->getPropertyValue("Settings"),
UNO_QUERY_THROW );
- _out_setting = xDataSourceSettings->getPropertyValue( OUString::createFromAscii( _asciiName ) );
+ _out_setting = xDataSourceSettings->getPropertyValue( _asciiName );
}
else
{
diff --git a/dbaccess/source/core/dataaccess/documentdefinition.cxx b/dbaccess/source/core/dataaccess/documentdefinition.cxx
index 9a2944bb338d..7e6efc688a1e 100644
--- a/dbaccess/source/core/dataaccess/documentdefinition.cxx
+++ b/dbaccess/source/core/dataaccess/documentdefinition.cxx
@@ -1441,16 +1441,14 @@ void ODocumentDefinition::separateOpenCommandArguments( const Sequence< Property
{
::comphelper::NamedValueCollection aOpenCommandArguments( i_rOpenCommandArguments );
- const char* const pObjectDescriptorArgs[] =
+ static const std::u16string_view sObjectDescriptorArgs[] = { u"RecoveryStorage" };
+ for (const auto& rObjectDescriptorArg : sObjectDescriptorArgs)
{
- "RecoveryStorage"
- };
- for (const char* pObjectDescriptorArg : pObjectDescriptorArgs)
- {
- if ( aOpenCommandArguments.has( pObjectDescriptorArg ) )
+ const OUString sObjectDescriptorArg(rObjectDescriptorArg);
+ if ( aOpenCommandArguments.has( sObjectDescriptorArg ) )
{
- o_rEmbeddedObjectDescriptor.put( pObjectDescriptorArg, aOpenCommandArguments.get( pObjectDescriptorArg ) );
- aOpenCommandArguments.remove( pObjectDescriptorArg );
+ o_rEmbeddedObjectDescriptor.put( sObjectDescriptorArg, aOpenCommandArguments.get( sObjectDescriptorArg ) );
+ aOpenCommandArguments.remove( sObjectDescriptorArg );
}
}
diff --git a/dbaccess/source/filter/xml/dbloader2.cxx b/dbaccess/source/filter/xml/dbloader2.cxx
index 0f0674d2c038..30d613a56e4b 100644
--- a/dbaccess/source/filter/xml/dbloader2.cxx
+++ b/dbaccess/source/filter/xml/dbloader2.cxx
@@ -138,8 +138,8 @@ OUString SAL_CALL DBTypeDetection::detect( css::uno::Sequence< css::beans::Prope
{
// After fixing of the i88522 issue ( use the new file locking for database files ) the stream from the type detection can be used further
// for now the file should be reopened to have read/write access
- aMedia.remove( OUString( "InputStream" ) );
- aMedia.remove( OUString( "Stream" ) );
+ aMedia.remove( "InputStream" );
+ aMedia.remove( "Stream" );
aMedia >>= Descriptor;
try
{
@@ -374,7 +374,7 @@ void SAL_CALL DBContentLoader::load(const Reference< XFrame > & rFrame, const OU
else
{
::comphelper::NamedValueCollection aCreationArgs;
- aCreationArgs.put( OUString(INFO_POOLURL), sSalvagedURL );
+ aCreationArgs.put( INFO_POOLURL, sSalvagedURL );
xDocumentDataSource.set( xDatabaseContext->createInstanceWithArguments( aCreationArgs.getWrappedNamedValues() ), UNO_QUERY_THROW );
}
diff --git a/dbaccess/source/ui/app/AppController.cxx b/dbaccess/source/ui/app/AppController.cxx
index 7a329bc513f0..ed36971392b9 100644
--- a/dbaccess/source/ui/app/AppController.cxx
+++ b/dbaccess/source/ui/app/AppController.cxx
@@ -1170,7 +1170,7 @@ void OApplicationController::Execute(sal_uInt16 _nId, const Sequence< PropertyVa
eType = E_QUERY;
break;
case ID_NEW_QUERY_DESIGN:
- aCreationArgs.put( OUString(PROPERTY_GRAPHICAL_DESIGN), true );
+ aCreationArgs.put( PROPERTY_GRAPHICAL_DESIGN, true );
[[fallthrough]];
case ID_NEW_QUERY_SQL:
eType = E_QUERY;
@@ -1208,7 +1208,7 @@ void OApplicationController::Execute(sal_uInt16 _nId, const Sequence< PropertyVa
QueryDesigner aDesigner( getORB(), this, getFrame(), true );
::comphelper::NamedValueCollection aCreationArgs;
- aCreationArgs.put( OUString(PROPERTY_GRAPHICAL_DESIGN), ID_NEW_VIEW_DESIGN == _nId );
+ aCreationArgs.put( PROPERTY_GRAPHICAL_DESIGN, ID_NEW_VIEW_DESIGN == _nId );
const Reference< XDataSource > xDataSource( m_xDataSource, UNO_QUERY );
const Reference< XComponent > xComponent = aDesigner.createNew( xDataSource, aCreationArgs );
@@ -1821,7 +1821,7 @@ Reference< XComponent > OApplicationController::openElementWithArguments( const
if ( bAddViewTypeArg )
{
const bool bQueryGraphicalMode =( _nInstigatorCommand != SID_DB_APP_EDIT_SQL_VIEW );
- aArguments.put( OUString(PROPERTY_GRAPHICAL_DESIGN), bQueryGraphicalMode );
+ aArguments.put( PROPERTY_GRAPHICAL_DESIGN, bQueryGraphicalMode );
}
}
@@ -1829,8 +1829,8 @@ Reference< XComponent > OApplicationController::openElementWithArguments( const
{
pDesigner.reset( new ResultSetBrowser( getORB(), this, m_aCurrentFrame.getFrame(), _eType == E_TABLE ) );
- if ( !aArguments.has( OUString(PROPERTY_SHOWMENU) ) )
- aArguments.put( OUString(PROPERTY_SHOWMENU), makeAny( true ) );
+ if ( !aArguments.has( PROPERTY_SHOWMENU ) )
+ aArguments.put( PROPERTY_SHOWMENU, makeAny( true ) );
aDataSource <<= getDatabaseName();
}
@@ -2622,7 +2622,7 @@ sal_Bool SAL_CALL OApplicationController::attachModel(const Reference< XModel >
{
// to get the 'modified' for the data source
::comphelper::NamedValueCollection aLayoutInfo( m_xDataSource->getPropertyValue( PROPERTY_LAYOUTINFORMATION ) );
- if ( aLayoutInfo.has( OUString(INFO_PREVIEW) ) )
+ if ( aLayoutInfo.has( INFO_PREVIEW ) )
{
const sal_Int32 nPreviewMode( aLayoutInfo.getOrDefault( INFO_PREVIEW, sal_Int32(0) ) );
m_ePreviewMode = static_cast< PreviewMode >( nPreviewMode );
diff --git a/dbaccess/source/ui/app/AppDetailPageHelper.cxx b/dbaccess/source/ui/app/AppDetailPageHelper.cxx
index 18767cc46a51..e4b2b86f62bd 100644
--- a/dbaccess/source/ui/app/AppDetailPageHelper.cxx
+++ b/dbaccess/source/ui/app/AppDetailPageHelper.cxx
@@ -1043,7 +1043,7 @@ void OAppDetailPageHelper::showPreview( const OUString& _sDataSourceName,
aArgs.put( "Preview", true );
aArgs.put( "ReadOnly", true );
aArgs.put( "AsTemplate", false );
- aArgs.put( OUString(PROPERTY_SHOWMENU), false );
+ aArgs.put( PROPERTY_SHOWMENU, false );
Reference< XController > xPreview( pDispatcher->openExisting( makeAny( _sDataSourceName ), _sName, aArgs ), UNO_QUERY );
bool bClearPreview = !xPreview.is();
diff --git a/dbaccess/source/ui/misc/databaseobjectview.cxx b/dbaccess/source/ui/misc/databaseobjectview.cxx
index 4a58f085acb0..e59622276433 100644
--- a/dbaccess/source/ui/misc/databaseobjectview.cxx
+++ b/dbaccess/source/ui/misc/databaseobjectview.cxx
@@ -146,14 +146,14 @@ namespace dbaui
Reference<XDataSource> xDataSource;
if ( _aDataSource >>= sDataSource )
{
- i_rDispatchArgs.put( OUString(PROPERTY_DATASOURCENAME), sDataSource );
+ i_rDispatchArgs.put( PROPERTY_DATASOURCENAME, sDataSource );
}
else if ( _aDataSource >>= xDataSource )
{
- i_rDispatchArgs.put( OUString(PROPERTY_DATASOURCE), xDataSource );
+ i_rDispatchArgs.put( PROPERTY_DATASOURCE, xDataSource );
}
- i_rDispatchArgs.put( OUString(PROPERTY_ACTIVE_CONNECTION), getConnection() );
+ i_rDispatchArgs.put( PROPERTY_ACTIVE_CONNECTION, getConnection() );
}
// QueryDesigner
@@ -173,16 +173,16 @@ namespace dbaui
const bool bGraphicalDesign = i_rDispatchArgs.getOrDefault( PROPERTY_GRAPHICAL_DESIGN, true );
const bool bEditViewAsSQLCommand = ( m_nCommandType == CommandType::TABLE ) && !bGraphicalDesign;
- i_rDispatchArgs.put( OUString(PROPERTY_COMMAND_TYPE), m_nCommandType );
+ i_rDispatchArgs.put( PROPERTY_COMMAND_TYPE, m_nCommandType );
if ( bIncludeQueryName )
{
- i_rDispatchArgs.put( OUString(PROPERTY_COMMAND), _rObjectName );
+ i_rDispatchArgs.put( PROPERTY_COMMAND, _rObjectName );
}
if ( bEditViewAsSQLCommand )
{
- i_rDispatchArgs.put( OUString(PROPERTY_ESCAPE_PROCESSING), false );
+ i_rDispatchArgs.put( PROPERTY_ESCAPE_PROCESSING, false );
}
}
@@ -199,7 +199,7 @@ namespace dbaui
if ( !_rObjectName.isEmpty() )
{
- i_rDispatchArgs.put( OUString(PROPERTY_CURRENTTABLE), _rObjectName );
+ i_rDispatchArgs.put( PROPERTY_CURRENTTABLE, _rObjectName );
}
}
@@ -258,15 +258,15 @@ namespace dbaui
if ( m_bTable )
::dbtools::qualifiedNameComponents( getConnection()->getMetaData(), _rQualifiedName, sCatalog, sSchema, sTable, ::dbtools::EComposeRule::InDataManipulation );
- i_rDispatchArgs.put( OUString(PROPERTY_COMMAND_TYPE), (m_bTable ? CommandType::TABLE : CommandType::QUERY) );
- i_rDispatchArgs.put( OUString(PROPERTY_COMMAND), _rQualifiedName );
- i_rDispatchArgs.put( OUString(PROPERTY_ENABLE_BROWSER), false );
+ i_rDispatchArgs.put( PROPERTY_COMMAND_TYPE, (m_bTable ? CommandType::TABLE : CommandType::QUERY) );
+ i_rDispatchArgs.put( PROPERTY_COMMAND, _rQualifiedName );
+ i_rDispatchArgs.put( PROPERTY_ENABLE_BROWSER, false );
if ( m_bTable )
{
- i_rDispatchArgs.put( OUString(PROPERTY_UPDATE_CATALOGNAME), sCatalog );
- i_rDispatchArgs.put( OUString(PROPERTY_UPDATE_SCHEMANAME), sSchema );
- i_rDispatchArgs.put( OUString(PROPERTY_UPDATE_TABLENAME), sTable );
+ i_rDispatchArgs.put( PROPERTY_UPDATE_CATALOGNAME, sCatalog );
+ i_rDispatchArgs.put( PROPERTY_UPDATE_SCHEMANAME, sSchema );
+ i_rDispatchArgs.put( PROPERTY_UPDATE_TABLENAME, sTable );
}
}
diff --git a/dbaccess/source/ui/misc/dsmeta.cxx b/dbaccess/source/ui/misc/dsmeta.cxx
index f84c580ed4c4..286ce63aace2 100644
--- a/dbaccess/source/ui/misc/dsmeta.cxx
+++ b/dbaccess/source/ui/misc/dsmeta.cxx
@@ -53,39 +53,33 @@ namespace dbaui
{
/// one of the items from dsitems.hxx
ItemID nItemID;
- const char* pAsciiFeatureName;
+ OUString pAsciiFeatureName;
};
- }
-
// global tables
- static const FeatureMapping* lcl_getFeatureMappings()
- {
- static const FeatureMapping s_aMappings[] = {
- { DSID_AUTORETRIEVEENABLED, "GeneratedValues" },
- { DSID_AUTOINCREMENTVALUE, "GeneratedValues" },
- { DSID_AUTORETRIEVEVALUE, "GeneratedValues" },
- { DSID_SQL92CHECK, "UseSQL92NamingConstraints" },
- { DSID_APPEND_TABLE_ALIAS, "AppendTableAliasInSelect" },
- { DSID_AS_BEFORE_CORRNAME, "UseKeywordAsBeforeAlias" },
- { DSID_ENABLEOUTERJOIN, "UseBracketedOuterJoinSyntax" },
- { DSID_IGNOREDRIVER_PRIV, "IgnoreDriverPrivileges" },
- { DSID_PARAMETERNAMESUBST, "ParameterNameSubstitution" },
- { DSID_SUPPRESSVERSIONCL, "DisplayVersionColumns" },
- { DSID_CATALOG, "UseCatalogInSelect" },
- { DSID_SCHEMA, "UseSchemaInSelect" },
- { DSID_INDEXAPPENDIX, "UseIndexDirectionKeyword" },
- { DSID_DOSLINEENDS, "UseDOSLineEnds" },
- { DSID_BOOLEANCOMPARISON, "BooleanComparisonMode" },
- { DSID_CHECK_REQUIRED_FIELDS, "FormsCheckRequiredFields" },
- { DSID_IGNORECURRENCY, "IgnoreCurrency" },
- { DSID_ESCAPE_DATETIME, "EscapeDateTime" },
- { DSID_PRIMARY_KEY_SUPPORT, "PrimaryKeySupport" },
- { DSID_RESPECTRESULTSETTYPE, "RespectDriverResultSetType" },
- { DSID_MAX_ROW_SCAN, "MaxRowScan" },
- { 0, nullptr }
- };
- return s_aMappings;
+ const FeatureMapping s_aMappings[] = {
+ { DSID_AUTORETRIEVEENABLED, "GeneratedValues" },
+ { DSID_AUTOINCREMENTVALUE, "GeneratedValues" },
+ { DSID_AUTORETRIEVEVALUE, "GeneratedValues" },
+ { DSID_SQL92CHECK, "UseSQL92NamingConstraints" },
+ { DSID_APPEND_TABLE_ALIAS, "AppendTableAliasInSelect" },
+ { DSID_AS_BEFORE_CORRNAME, "UseKeywordAsBeforeAlias" },
+ { DSID_ENABLEOUTERJOIN, "UseBracketedOuterJoinSyntax" },
+ { DSID_IGNOREDRIVER_PRIV, "IgnoreDriverPrivileges" },
+ { DSID_PARAMETERNAMESUBST, "ParameterNameSubstitution" },
+ { DSID_SUPPRESSVERSIONCL, "DisplayVersionColumns" },
+ { DSID_CATALOG, "UseCatalogInSelect" },
+ { DSID_SCHEMA, "UseSchemaInSelect" },
+ { DSID_INDEXAPPENDIX, "UseIndexDirectionKeyword" },
+ { DSID_DOSLINEENDS, "UseDOSLineEnds" },
+ { DSID_BOOLEANCOMPARISON, "BooleanComparisonMode" },
+ { DSID_CHECK_REQUIRED_FIELDS, "FormsCheckRequiredFields" },
+ { DSID_IGNORECURRENCY, "IgnoreCurrency" },
+ { DSID_ESCAPE_DATETIME, "EscapeDateTime" },
+ { DSID_PRIMARY_KEY_SUPPORT, "PrimaryKeySupport" },
+ { DSID_RESPECTRESULTSETTYPE, "RespectDriverResultSetType" },
+ { DSID_MAX_ROW_SCAN, "MaxRowScan" },
+ };
}
static const FeatureSet& lcl_getFeatureSet( const OUString& _rURL )
@@ -101,12 +95,10 @@ namespace dbaui
FeatureSet aCurrentSet;
const ::comphelper::NamedValueCollection aCurrentFeatures( aDriverConfig.getFeatures( pattern ).getNamedValues() );
- const FeatureMapping* pFeatureMapping = lcl_getFeatureMappings();
- while ( pFeatureMapping->pAsciiFeatureName )
+ for ( const FeatureMapping& rFeatureMapping : s_aMappings )
{
- if ( aCurrentFeatures.has( pFeatureMapping->pAsciiFeatureName ) )
- aCurrentSet.put( pFeatureMapping->nItemID );
- ++pFeatureMapping;
+ if ( aCurrentFeatures.has( rFeatureMapping.pAsciiFeatureName ) )
+ aCurrentSet.put( rFeatureMapping.nItemID );
}
tmp[ pattern ] = aCurrentSet;
diff --git a/dbaccess/source/ui/misc/linkeddocuments.cxx b/dbaccess/source/ui/misc/linkeddocuments.cxx
index 15394133ed59..192331ced226 100644
--- a/dbaccess/source/ui/misc/linkeddocuments.cxx
+++ b/dbaccess/source/ui/misc/linkeddocuments.cxx
@@ -135,7 +135,7 @@ namespace dbaui
}
aArguments.put( "OpenMode", sOpenMode );
- aArguments.put( OUString(PROPERTY_ACTIVE_CONNECTION), m_xConnection );
+ aArguments.put( PROPERTY_ACTIVE_CONNECTION, m_xConnection );
Reference<XHierarchicalNameContainer> xHier(m_xDocumentContainer,UNO_QUERY);
if ( xHier.is() && xHier->hasByHierarchicalName(_rLinkName) )
@@ -251,7 +251,7 @@ namespace dbaui
::comphelper::NamedValueCollection aCreationArgs( i_rCreationArgs );
if ( aClassId.hasElements() )
aCreationArgs.put( "ClassID", aClassId );
- aCreationArgs.put( OUString(PROPERTY_ACTIVE_CONNECTION), m_xConnection );
+ aCreationArgs.put( PROPERTY_ACTIVE_CONNECTION, m_xConnection );
// separate values which are real creation args from args relevant for opening the doc
::comphelper::NamedValueCollection aCommandArgs;
diff --git a/dbaccess/source/ui/querydesign/querycontroller.cxx b/dbaccess/source/ui/querydesign/querycontroller.cxx
index 450a1ba416a8..360cd2821235 100644
--- a/dbaccess/source/ui/querydesign/querycontroller.cxx
+++ b/dbaccess/source/ui/querydesign/querycontroller.cxx
@@ -245,7 +245,7 @@ void SAL_CALL OQueryController::getFastPropertyValue( Any& o_rValue, sal_Int32 i
{
::comphelper::NamedValueCollection aCurrentDesign;
aCurrentDesign.put( "GraphicalDesign", isGraphicalDesign() );
- aCurrentDesign.put( OUString(PROPERTY_ESCAPE_PROCESSING), m_bEscapeProcessing );
+ aCurrentDesign.put( PROPERTY_ESCAPE_PROCESSING, m_bEscapeProcessing );
if ( isGraphicalDesign() )
{
@@ -735,11 +735,11 @@ void OQueryController::impl_initialize()
if ( aCurrentQueryDesignProps.hasElements() )
{
::comphelper::NamedValueCollection aCurrentQueryDesign( aCurrentQueryDesignProps );
- if ( aCurrentQueryDesign.has( OUString(PROPERTY_GRAPHICAL_DESIGN) ) )
+ if ( aCurrentQueryDesign.has( PROPERTY_GRAPHICAL_DESIGN ) )
{
aCurrentQueryDesign.get_ensureType( PROPERTY_GRAPHICAL_DESIGN, m_bGraphicalDesign );
}
- if ( aCurrentQueryDesign.has( OUString(PROPERTY_ESCAPE_PROCESSING) ) )
+ if ( aCurrentQueryDesign.has( PROPERTY_ESCAPE_PROCESSING ) )
{
aCurrentQueryDesign.get_ensureType( PROPERTY_ESCAPE_PROCESSING, m_bEscapeProcessing );
}
diff --git a/include/comphelper/namedvaluecollection.hxx b/include/comphelper/namedvaluecollection.hxx
index ee53c7f71d0b..21c4bef31d24 100644
--- a/include/comphelper/namedvaluecollection.hxx
+++ b/include/comphelper/namedvaluecollection.hxx
@@ -141,27 +141,15 @@ namespace comphelper
_out_rValue.
*/
template < typename VALUE_TYPE >
- bool get_ensureType( const char* _pAsciiValueName, VALUE_TYPE& _out_rValue ) const
+ bool get_ensureType( const OUString& _rValueName, VALUE_TYPE& _out_rValue ) const
{
- return get_ensureType( OUString::createFromAscii( _pAsciiValueName ), &_out_rValue, ::cppu::UnoType< VALUE_TYPE >::get() );
- }
-
- template < typename VALUE_TYPE >
- void get_ensureType( const OUString& _rValueName, VALUE_TYPE& _out_rValue ) const
- {
- get_ensureType( _rValueName, &_out_rValue, ::cppu::UnoType< VALUE_TYPE >::get() );
+ return get_ensureType( _rValueName, &_out_rValue, ::cppu::UnoType< VALUE_TYPE >::get() );
}
/** retrieves a value with a given name, or defaults it to a given value, if it's not present
in the collection
*/
template < typename VALUE_TYPE >
- VALUE_TYPE getOrDefault( const char* _pAsciiValueName, const VALUE_TYPE& _rDefault ) const
- {
- return getOrDefault( OUString::createFromAscii( _pAsciiValueName ), _rDefault );
- }
-
- template < typename VALUE_TYPE >
VALUE_TYPE getOrDefault( const OUString& _rValueName, const VALUE_TYPE& _rDefault ) const
{
VALUE_TYPE retVal( _rDefault );
@@ -174,28 +162,12 @@ namespace comphelper
If the collection does not contain a value with the given name, an empty
Any is returned.
*/
- const css::uno::Any& get( const char* _pAsciiValueName ) const
- {
- return get( OUString::createFromAscii( _pAsciiValueName ) );
- }
-
- /** retrieves a (untyped) value with a given name
-
- If the collection does not contain a value with the given name, an empty
- Any is returned.
- */
const css::uno::Any& get( const OUString& _rValueName ) const
{
return impl_get( _rValueName );
}
/// determines whether a value with a given name is present in the collection
- bool has( const char* _pAsciiValueName ) const
- {
- return impl_has( OUString::createFromAscii( _pAsciiValueName ) );
- }
-
- /// determines whether a value with a given name is present in the collection
bool has( const OUString& _rValueName ) const
{
return impl_has( _rValueName );
@@ -207,27 +179,11 @@ namespace comphelper
which case it has been overwritten.
*/
template < typename VALUE_TYPE >
- bool put( const char* _pAsciiValueName, const VALUE_TYPE& _rValue )
- {
- return impl_put( OUString::createFromAscii( _pAsciiValueName ), css::uno::makeAny( _rValue ) );
- }
-
- /** puts a value into the collection
-
- @return true if and only if a value was already present previously, in
- which case it has been overwritten.
- */
- template < typename VALUE_TYPE >
bool put( const OUString& _rValueName, const VALUE_TYPE& _rValue )
{
return impl_put( _rValueName, css::uno::makeAny( _rValue ) );
}
- bool put( const char* _pAsciiValueName, const css::uno::Any& _rValue )
- {
- return impl_put( OUString::createFromAscii( _pAsciiValueName ), _rValue );
- }
-
bool put( const OUString& _rValueName, const css::uno::Any& _rValue )
{
return impl_put( _rValueName, _rValue );
@@ -237,15 +193,6 @@ namespace comphelper
@return true if and only if a value with the given name existed in the collection.
*/
- bool remove( const char* _pAsciiValueName )
- {
- return impl_remove( OUString::createFromAscii( _pAsciiValueName ) );
- }
-
- /** removes the value with the given name from the collection
-
- @return true if and only if a value with the given name existed in the collection.
- */
bool remove( const OUString& _rValueName )
{
return impl_remove( _rValueName );
diff --git a/reportdesign/source/ui/misc/UITools.cxx b/reportdesign/source/ui/misc/UITools.cxx
index 60d3f8745574..d5f48ca60ad0 100644
--- a/reportdesign/source/ui/misc/UITools.cxx
+++ b/reportdesign/source/ui/misc/UITools.cxx
@@ -539,7 +539,7 @@ namespace
template< class ATTRIBUTE_TYPE >
- void lcl_applyFontAttribute( const ::comphelper::NamedValueCollection& _rAttrValues, const char* _pAttributeName,
+ void lcl_applyFontAttribute( const ::comphelper::NamedValueCollection& _rAttrValues, const OUString& _pAttributeName,
const uno::Reference<report::XReportControlFormat >& _rxReportControlFormat,
void (SAL_CALL report::XReportControlFormat::*pSetter)( ATTRIBUTE_TYPE ) )
{
@@ -549,7 +549,7 @@ namespace
}
- void lcl_applyFontAttribute( const ::comphelper::NamedValueCollection& _rAttrValues, const char* _pAttributeName,
+ void lcl_applyFontAttribute( const ::comphelper::NamedValueCollection& _rAttrValues, const OUString& _pAttributeName,
const uno::Reference<report::XReportControlFormat >& _rxReportControlFormat,
void (SAL_CALL report::XReportControlFormat::*pSetter)( const OUString& ) )
{
@@ -559,7 +559,7 @@ namespace
}
- void lcl_applyFontAttribute( const ::comphelper::NamedValueCollection& _rAttrValues, const char* _pAttributeName,
+ void lcl_applyFontAttribute( const ::comphelper::NamedValueCollection& _rAttrValues, const OUString& _pAttributeName,
const uno::Reference<report::XReportControlFormat >& _rxReportControlFormat,
void (SAL_CALL report::XReportControlFormat::*pSetter)( const lang::Locale& ) )
{
diff --git a/sfx2/source/view/frmload.cxx b/sfx2/source/view/frmload.cxx
index b18b76efdd7c..91b045b2f1a3 100644
--- a/sfx2/source/view/frmload.cxx
+++ b/sfx2/source/view/frmload.cxx
@@ -501,18 +501,16 @@ void SfxFrameLoader_Impl::impl_removeLoaderArguments( ::comphelper::NamedValueCo
::comphelper::NamedValueCollection SfxFrameLoader_Impl::impl_extractViewCreationArgs( ::comphelper::NamedValueCollection& io_rDescriptor )
{
- static const char* pKnownViewArgs[] = {
- "JumpMark",
- "PickListEntry"
- };
+ static const std::u16string_view sKnownViewArgs[] = { u"JumpMark", u"PickListEntry" };
::comphelper::NamedValueCollection aViewArgs;
- for (const char* pKnownViewArg : pKnownViewArgs)
+ for (const auto& rKnownViewArg : sKnownViewArgs)
{
- if ( io_rDescriptor.has( pKnownViewArg ) )
+ const OUString sKnownViewArg(rKnownViewArg);
+ if ( io_rDescriptor.has( sKnownViewArg ) )
{
- aViewArgs.put( pKnownViewArg, io_rDescriptor.get( pKnownViewArg ) );
- io_rDescriptor.remove( pKnownViewArg );
+ aViewArgs.put( sKnownViewArg, io_rDescriptor.get( sKnownViewArg ) );
+ io_rDescriptor.remove( sKnownViewArg );
}
}
return aViewArgs;