From 719c8f44780c2c9c4096c5ea3582fd4b55b095ef Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 3 May 2024 10:15:17 +0200 Subject: replace createFromAscii with OUString literals in OElementImport Change-Id: Ic6e93f47b903b69f1d8a15fc62be138c13b7b01a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167156 Reviewed-by: Noel Grandin Tested-by: Jenkins --- xmloff/source/forms/elementimport.cxx | 14 +++++++------- xmloff/source/forms/elementimport.hxx | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'xmloff') diff --git a/xmloff/source/forms/elementimport.cxx b/xmloff/source/forms/elementimport.cxx index 7b7609107560..a135d7e1795a 100644 --- a/xmloff/source/forms/elementimport.cxx +++ b/xmloff/source/forms/elementimport.cxx @@ -580,14 +580,14 @@ namespace xmloff m_rEventManager.registerEvents(m_xElement, _rEvents); } - void OElementImport::simulateDefaultedAttribute(sal_Int32 nElement, const OUString& _rPropertyName, const char* _pAttributeDefault) + void OElementImport::simulateDefaultedAttribute(sal_Int32 nElement, const OUString& _rPropertyName, const OUString& _pAttributeDefault) { OSL_ENSURE( m_xInfo.is(), "OPropertyImport::simulateDefaultedAttribute: the component should be more gossipy about it's properties!" ); if ( !m_xInfo.is() || m_xInfo->hasPropertyByName( _rPropertyName ) ) { if ( !encounteredAttribute( nElement ) ) - OSL_VERIFY( handleAttribute( XML_ELEMENT(FORM, (nElement & TOKEN_MASK)), OUString::createFromAscii( _pAttributeDefault ) ) ); + OSL_VERIFY( handleAttribute( XML_ELEMENT(FORM, (nElement & TOKEN_MASK)), _pAttributeDefault ) ); } } @@ -1258,7 +1258,7 @@ namespace xmloff OURLReferenceImport::startFastElement(nElement, _rxAttrList); // handle the target-frame attribute - simulateDefaultedAttribute(OAttributeMetaData::getCommonControlAttributeToken(CCAFlags::TargetFrame), PROPERTY_TARGETFRAME, "_blank"); + simulateDefaultedAttribute(OAttributeMetaData::getCommonControlAttributeToken(CCAFlags::TargetFrame), PROPERTY_TARGETFRAME, u"_blank"_ustr); } //= OValueRangeImport @@ -1353,7 +1353,7 @@ namespace xmloff // same XML element), though not all of them know this property. // So we have to do a check ... if (m_xElement.is() && m_xInfo.is() && m_xInfo->hasPropertyByName(PROPERTY_EMPTY_IS_NULL) ) - simulateDefaultedAttribute(OAttributeMetaData::getDatabaseAttributeToken(DAFlags::ConvertEmpty), PROPERTY_EMPTY_IS_NULL, "false"); + simulateDefaultedAttribute(OAttributeMetaData::getDatabaseAttributeToken(DAFlags::ConvertEmpty), PROPERTY_EMPTY_IS_NULL, u"false"_ustr); } namespace { @@ -1514,10 +1514,10 @@ namespace xmloff // for the auto-completion // the attribute default does not equal the property default, so in case we did not read this attribute, // we have to simulate it - simulateDefaultedAttribute( OAttributeMetaData::getSpecialAttributeToken( SCAFlags::AutoCompletion ), PROPERTY_AUTOCOMPLETE, "false"); + simulateDefaultedAttribute( OAttributeMetaData::getSpecialAttributeToken( SCAFlags::AutoCompletion ), PROPERTY_AUTOCOMPLETE, u"false"_ustr); // same for the convert-empty-to-null attribute, which's default is different from the property default - simulateDefaultedAttribute( OAttributeMetaData::getDatabaseAttributeToken( DAFlags::ConvertEmpty ), PROPERTY_EMPTY_IS_NULL, "false"); + simulateDefaultedAttribute( OAttributeMetaData::getDatabaseAttributeToken( DAFlags::ConvertEmpty ), PROPERTY_EMPTY_IS_NULL, u"false"_ustr); } } @@ -1925,7 +1925,7 @@ namespace xmloff OElementImport::startFastElement(nElement, _rxAttrList); // handle the target-frame attribute - simulateDefaultedAttribute(OAttributeMetaData::getCommonControlAttributeToken(CCAFlags::TargetFrame), PROPERTY_TARGETFRAME, "_blank"); + simulateDefaultedAttribute(OAttributeMetaData::getCommonControlAttributeToken(CCAFlags::TargetFrame), PROPERTY_TARGETFRAME, u"_blank"_ustr); } void OFormImport::endFastElement(sal_Int32 nElement) diff --git a/xmloff/source/forms/elementimport.hxx b/xmloff/source/forms/elementimport.hxx index 01de34976024..44aa4c7dba94 100644 --- a/xmloff/source/forms/elementimport.hxx +++ b/xmloff/source/forms/elementimport.hxx @@ -136,7 +136,7 @@ namespace xmloff property value as if the attribute was encountered.

@see encounteredAttribute */ - void simulateDefaultedAttribute(sal_Int32 nElement, const OUString& _rPropertyName, const char* _pAttributeDefault); + void simulateDefaultedAttribute(sal_Int32 nElement, const OUString& _rPropertyName, const OUString& _pAttributeDefault); /** to be called from within handleAttribute, checks whether the given attribute is covered by our generic attribute handler mechanisms -- cgit abora/lov-4.4'>distro/collabora/lov-4.4 LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
AgeCommit message (Expand)Author