filter/source/svg/svgwriter.cxx | 78 ++++++++++++++++----------------- filter/source/svg/svgwriter.hxx | 2 include/xmloff/xmlexp.hxx | 4 - linguistic/source/convdicxml.cxx | 2 xmloff/source/core/xmlexp.cxx | 35 +------------- xmloff/source/forms/elementexport.cxx | 8 +-- xmloff/source/forms/formattributes.cxx | 12 ++--- xmloff/source/forms/formattributes.hxx | 12 ++--- xmloff/source/forms/layerimport.cxx | 4 - xmloff/source/forms/propertyexport.cxx | 22 ++------- xmloff/source/forms/propertyexport.hxx | 19 +++----- 11 files changed, 78 insertions(+), 120 deletions(-)
New commits: commit 4d82c1d8a3160719f694df98a4db6b9b8c7664bd Author: Mike Kaganski <mike.kagan...@collabora.com> AuthorDate: Thu Oct 7 08:46:27 2021 +0200 Commit: Mike Kaganski <mike.kagan...@collabora.com> CommitDate: Sat Oct 9 07:08:24 2021 +0200 Simplify SvXMLExport::AddAttribute overloads Remove overloads taking const char* which were not needed, because every their use eventually took a string literal convertible to OUString directly. Many other literals were converted to OUStringLiterals. Change-Id: Ia1e742a8087776cd20bf5094dc415dafd9a8834a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123155 Tested-by: Mike Kaganski <mike.kagan...@collabora.com> Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com> diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx index 9d4e885ef269..a386ad935fb4 100644 --- a/filter/source/svg/svgwriter.cxx +++ b/filter/source/svg/svgwriter.cxx @@ -49,43 +49,43 @@ #include <memory> -const char aPrefixClipPathId[] = "clip_path_"; - -const char aXMLElemG[] = "g"; -const char aXMLElemDefs[] = "defs"; -const char aXMLElemText[] = "text"; -const char aXMLElemTspan[] = "tspan"; -const char aXMLElemLinearGradient[] = "linearGradient"; -const char aXMLElemStop[] = "stop"; - -const char aXMLAttrTransform[] = "transform"; -const char aXMLAttrStyle[] = "style"; -const char aXMLAttrId[] = "id"; -const char aXMLAttrX[] = "x"; -const char aXMLAttrY[] = "y"; -const char aXMLAttrX1[] = "x1"; -const char aXMLAttrY1[] = "y1"; -const char aXMLAttrX2[] = "x2"; -const char aXMLAttrY2[] = "y2"; -const char aXMLAttrCX[] = "cx"; -const char aXMLAttrCY[] = "cy"; -const char aXMLAttrRX[] = "rx"; -const char aXMLAttrRY[] = "ry"; -const char aXMLAttrWidth[] = "width"; -const char aXMLAttrHeight[] = "height"; -const char aXMLAttrStrokeWidth[] = "stroke-width"; -const char aXMLAttrFill[] = "fill"; -const char aXMLAttrFontFamily[] = "font-family"; -const char aXMLAttrFontSize[] = "font-size"; -const char aXMLAttrFontStyle[] = "font-style"; -const char aXMLAttrFontWeight[] = "font-weight"; -const char aXMLAttrTextDecoration[] = "text-decoration"; -const char aXMLAttrXLinkHRef[] = "xlink:href"; -const char aXMLAttrGradientUnits[] = "gradientUnits"; -const char aXMLAttrOffset[] = "offset"; -const char aXMLAttrStopColor[] = "stop-color"; -const char aXMLAttrStrokeLinejoin[] = "stroke-linejoin"; -const char aXMLAttrStrokeLinecap[] = "stroke-linecap"; +constexpr OUStringLiteral aPrefixClipPathId = u"clip_path_"; + +constexpr OUStringLiteral aXMLElemG = u"g"; +constexpr OUStringLiteral aXMLElemDefs = u"defs"; +constexpr OUStringLiteral aXMLElemText = u"text"; +constexpr OUStringLiteral aXMLElemTspan = u"tspan"; +constexpr OUStringLiteral aXMLElemLinearGradient = u"linearGradient"; +constexpr OUStringLiteral aXMLElemStop = u"stop"; + +constexpr OUStringLiteral aXMLAttrTransform = u"transform"; +constexpr OUStringLiteral aXMLAttrStyle = u"style"; +constexpr OUStringLiteral aXMLAttrId = u"id"; +constexpr OUStringLiteral aXMLAttrX = u"x"; +constexpr OUStringLiteral aXMLAttrY = u"y"; +constexpr OUStringLiteral aXMLAttrX1 = u"x1"; +constexpr OUStringLiteral aXMLAttrY1 = u"y1"; +constexpr OUStringLiteral aXMLAttrX2 = u"x2"; +constexpr OUStringLiteral aXMLAttrY2 = u"y2"; +constexpr OUStringLiteral aXMLAttrCX = u"cx"; +constexpr OUStringLiteral aXMLAttrCY = u"cy"; +constexpr OUStringLiteral aXMLAttrRX = u"rx"; +constexpr OUStringLiteral aXMLAttrRY = u"ry"; +constexpr OUStringLiteral aXMLAttrWidth = u"width"; +constexpr OUStringLiteral aXMLAttrHeight = u"height"; +constexpr OUStringLiteral aXMLAttrStrokeWidth = u"stroke-width"; +constexpr OUStringLiteral aXMLAttrFill = u"fill"; +constexpr OUStringLiteral aXMLAttrFontFamily = u"font-family"; +constexpr OUStringLiteral aXMLAttrFontSize = u"font-size"; +constexpr OUStringLiteral aXMLAttrFontStyle = u"font-style"; +constexpr OUStringLiteral aXMLAttrFontWeight = u"font-weight"; +constexpr OUStringLiteral aXMLAttrTextDecoration = u"text-decoration"; +constexpr OUStringLiteral aXMLAttrXLinkHRef = u"xlink:href"; +constexpr OUStringLiteral aXMLAttrGradientUnits = u"gradientUnits"; +constexpr OUStringLiteral aXMLAttrOffset = u"offset"; +constexpr OUStringLiteral aXMLAttrStopColor = u"stop-color"; +constexpr OUStringLiteral aXMLAttrStrokeLinejoin = u"stroke-linejoin"; +constexpr OUStringLiteral aXMLAttrStrokeLinecap = u"stroke-linecap"; vcl::PushFlags SVGContextHandler::getPushFlags() const @@ -172,8 +172,8 @@ void SVGAttributeWriter::ImplGetColorStr( const Color& rColor, OUString& rColorS } -void SVGAttributeWriter::AddColorAttr( const char* pColorAttrName, - const char* pColorOpacityAttrName, +void SVGAttributeWriter::AddColorAttr( const OUString& pColorAttrName, + const OUString& pColorOpacityAttrName, const Color& rColor ) { OUString aColor, aColorOpacity; diff --git a/filter/source/svg/svgwriter.hxx b/filter/source/svg/svgwriter.hxx index e3fd2558498b..f37246bf2edb 100644 --- a/filter/source/svg/svgwriter.hxx +++ b/filter/source/svg/svgwriter.hxx @@ -144,7 +144,7 @@ public: SVGAttributeWriter( SVGExport& rExport, SVGFontExport& rFontExport, SVGState& rCurState ); ~SVGAttributeWriter(); - void AddColorAttr( const char* pColorAttrName, const char* pColorOpacityAttrName, const Color& rColor ); + void AddColorAttr( const OUString& pColorAttrName, const OUString& pColorOpacityAttrName, const Color& rColor ); void AddGradientDef( const tools::Rectangle& rObjRect,const Gradient& rGradient, OUString& rGradientId ); void AddPaintAttr( const Color& rLineColor, const Color& rFillColor, const tools::Rectangle* pObjBoundRect = nullptr, const Gradient* pFillGradient = nullptr ); diff --git a/include/xmloff/xmlexp.hxx b/include/xmloff/xmlexp.hxx index 5b72788313ef..e9dcd2bfebdf 100644 --- a/include/xmloff/xmlexp.hxx +++ b/include/xmloff/xmlexp.hxx @@ -337,10 +337,6 @@ public: void ClearAttrList(); // Add an attribute to the common attribute list. - void AddAttributeASCII( sal_uInt16 nPrefix, const char *pName, - const char *pValue ); - void AddAttribute( sal_uInt16 nPrefix, const char *pName, - const OUString& rValue ); void AddAttribute( sal_uInt16 nPrefix, const OUString& rName, const OUString& rValue ); void AddAttribute( sal_uInt16 nPrefix, diff --git a/linguistic/source/convdicxml.cxx b/linguistic/source/convdicxml.cxx index 8b23e93981af..46b5ec69d320 100644 --- a/linguistic/source/convdicxml.cxx +++ b/linguistic/source/convdicxml.cxx @@ -265,7 +265,7 @@ ErrCode ConvDicXMLExport::exportDoc( enum ::xmloff::token::XMLTokenEnum /*eClass // Add xmlns line and some other arguments AddAttribute( GetNamespaceMap_().GetAttrNameByKey( XML_NAMESPACE_TCD ), GetNamespaceMap_().GetNameByKey( XML_NAMESPACE_TCD ) ); - AddAttributeASCII( XML_NAMESPACE_TCD, "package", "org.openoffice.Office" ); + AddAttribute( XML_NAMESPACE_TCD, "package", "org.openoffice.Office" ); OUString aIsoLang( LanguageTag::convertToBcp47( rDic.nLanguage ) ); AddAttribute( XML_NAMESPACE_TCD, "lang", aIsoLang ); diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx index c64fb6052d45..0a29e8bf9449 100644 --- a/xmloff/source/core/xmlexp.cxx +++ b/xmloff/source/core/xmlexp.cxx @@ -924,49 +924,24 @@ SvXMLExport::EnsureNamespace(OUString const & i_rNamespace) return sPrefix; } -void SvXMLExport::AddAttributeASCII( sal_uInt16 nPrefixKey, - const char *pName, - const char *pValue ) -{ - OUString sName( OUString::createFromAscii( pName ) ); - OUString sValue( OUString::createFromAscii( pValue ) ); - - mxAttrList->AddAttribute( - GetNamespaceMap_().GetQNameByKey( nPrefixKey, sName ), sValue ); -} - -void SvXMLExport::AddAttribute( sal_uInt16 nPrefixKey, const char *pName, - const OUString& rValue ) -{ - OUString sName( OUString::createFromAscii( pName ) ); - - mxAttrList->AddAttribute( - GetNamespaceMap_().GetQNameByKey( nPrefixKey, sName ), rValue ); -} - void SvXMLExport::AddAttribute( sal_uInt16 nPrefixKey, const OUString& rName, const OUString& rValue ) { - mxAttrList->AddAttribute( - GetNamespaceMap_().GetQNameByKey( nPrefixKey, rName ), rValue ); + AddAttribute(GetNamespaceMap_().GetQNameByKey(nPrefixKey, rName), rValue); } void SvXMLExport::AddAttribute( sal_uInt16 nPrefixKey, enum XMLTokenEnum eName, const OUString& rValue ) { - mxAttrList->AddAttribute( - GetNamespaceMap_().GetQNameByKey( nPrefixKey, GetXMLToken(eName) ), - rValue ); + AddAttribute(nPrefixKey, GetXMLToken(eName), rValue); } void SvXMLExport::AddAttribute( sal_uInt16 nPrefixKey, enum XMLTokenEnum eName, enum XMLTokenEnum eValue) { - mxAttrList->AddAttribute( - GetNamespaceMap_().GetQNameByKey( nPrefixKey, GetXMLToken(eName) ), - GetXMLToken(eValue) ); + AddAttribute(nPrefixKey, eName, GetXMLToken(eValue)); } void SvXMLExport::AddAttribute( const OUString& rQName, @@ -980,9 +955,7 @@ void SvXMLExport::AddAttribute( const OUString& rQName, void SvXMLExport::AddAttribute( const OUString& rQName, enum ::xmloff::token::XMLTokenEnum eValue ) { - mxAttrList->AddAttribute( - rQName, - GetXMLToken(eValue) ); + AddAttribute(rQName, GetXMLToken(eValue)); } void SvXMLExport::AddLanguageTagAttributes( sal_uInt16 nPrefix, sal_uInt16 nPrefixRfc, diff --git a/xmloff/source/forms/elementexport.cxx b/xmloff/source/forms/elementexport.cxx index 02632fa08c8b..72cb6e0ef35c 100644 --- a/xmloff/source/forms/elementexport.cxx +++ b/xmloff/source/forms/elementexport.cxx @@ -742,7 +742,7 @@ namespace xmloff // add the attributes if necessary and possible if (pCurrentValuePropertyName && (CCAFlags::CurrentValue & m_nIncludeCommon)) { - static const char* pCurrentValueAttributeName = OAttributeMetaData::getCommonControlAttributeName(CCAFlags::CurrentValue); + static const OUString pCurrentValueAttributeName = OAttributeMetaData::getCommonControlAttributeName(CCAFlags::CurrentValue); // don't export the current-value if this value originates from a data binding // #i26944# if ( controlHasActiveDataBinding() ) @@ -760,7 +760,7 @@ namespace xmloff if (pValuePropertyName && (CCAFlags::Value & m_nIncludeCommon)) { - static const char* pValueAttributeName = OAttributeMetaData::getCommonControlAttributeName(CCAFlags::Value); + static const OUString pValueAttributeName = OAttributeMetaData::getCommonControlAttributeName(CCAFlags::Value); static const sal_uInt16 nValueAttributeNamespaceKey = OAttributeMetaData::getCommonControlAttributeNamespace(CCAFlags::Value); exportGenericPropertyAttribute( nValueAttributeNamespaceKey, @@ -1164,8 +1164,8 @@ namespace xmloff "OControlExport::exportCommonControlAttributes: no property found for the max value attribute!"); // add the two attributes - static const char* pMinValueAttributeName = OAttributeMetaData::getSpecialAttributeName(SCAFlags::MinValue); - static const char* pMaxValueAttributeName = OAttributeMetaData::getSpecialAttributeName(SCAFlags::MaxValue); + static const OUString pMinValueAttributeName = OAttributeMetaData::getSpecialAttributeName(SCAFlags::MinValue); + static const OUString pMaxValueAttributeName = OAttributeMetaData::getSpecialAttributeName(SCAFlags::MaxValue); static const sal_uInt16 nMinValueNamespaceKey = OAttributeMetaData::getSpecialAttributeNamespace(SCAFlags::MinValue); static const sal_uInt16 nMaxValueNamespaceKey = OAttributeMetaData::getSpecialAttributeNamespace(SCAFlags::MaxValue); diff --git a/xmloff/source/forms/formattributes.cxx b/xmloff/source/forms/formattributes.cxx index c8cccb55b3cb..6b7b3fb9f099 100644 --- a/xmloff/source/forms/formattributes.cxx +++ b/xmloff/source/forms/formattributes.cxx @@ -34,7 +34,7 @@ namespace xmloff using namespace ::com::sun::star::beans; //= OAttributeMetaData - const char* OAttributeMetaData::getCommonControlAttributeName(CCAFlags _nId) + OUString OAttributeMetaData::getCommonControlAttributeName(CCAFlags _nId) { switch (_nId) { @@ -115,7 +115,7 @@ namespace xmloff return XML_NAMESPACE_FORM; } - const char* OAttributeMetaData::getFormAttributeName(FormAttributes _eAttrib) + OUString OAttributeMetaData::getFormAttributeName(FormAttributes _eAttrib) { switch (_eAttrib) { @@ -181,7 +181,7 @@ namespace xmloff return XML_NAMESPACE_FORM; } - const char* OAttributeMetaData::getDatabaseAttributeName(DAFlags _nId) + OUString OAttributeMetaData::getDatabaseAttributeName(DAFlags _nId) { switch (_nId) { @@ -213,7 +213,7 @@ namespace xmloff return XML_NONE; } - const char* OAttributeMetaData::getBindingAttributeName(BAFlags _nId) + OUString OAttributeMetaData::getBindingAttributeName(BAFlags _nId) { switch (_nId) { @@ -239,7 +239,7 @@ namespace xmloff return XML_UNKNOWN; } - const char* OAttributeMetaData::getSpecialAttributeName(SCAFlags _nId) + OUString OAttributeMetaData::getSpecialAttributeName(SCAFlags _nId) { switch (_nId) { @@ -305,7 +305,7 @@ namespace xmloff return XML_NAMESPACE_FORM; } - const char* OAttributeMetaData::getOfficeFormsAttributeName(OfficeFormsAttributes _eAttrib) + OUString OAttributeMetaData::getOfficeFormsAttributeName(OfficeFormsAttributes _eAttrib) { switch (_eAttrib) { diff --git a/xmloff/source/forms/formattributes.hxx b/xmloff/source/forms/formattributes.hxx index 19a71132f0aa..ae36fd65dcd6 100644 --- a/xmloff/source/forms/formattributes.hxx +++ b/xmloff/source/forms/formattributes.hxx @@ -182,7 +182,7 @@ namespace xmloff @param _nId the id of the attribute. Has to be one of the CCA_* constants. */ - static const char* getCommonControlAttributeName(CCAFlags _nId); + static OUString getCommonControlAttributeName(CCAFlags _nId); /** calculates the xml attribute representation of a common control attribute. @param _nId @@ -200,7 +200,7 @@ namespace xmloff @param _eAttrib enum value specifying the attribute */ - static const char* getFormAttributeName(FormAttributes _eAttrib); + static OUString getFormAttributeName(FormAttributes _eAttrib); /** retrieves the name of an attribute of a form xml representation @param _eAttrib @@ -218,7 +218,7 @@ namespace xmloff @param _nId the id of the attribute. Has to be one of the DA_* constants. */ - static const char* getDatabaseAttributeName(DAFlags _nId); + static OUString getDatabaseAttributeName(DAFlags _nId); /** calculates the xml attribute representation of a database attribute. @param _nId @@ -240,7 +240,7 @@ namespace xmloff @param _nId the id of the attribute. Has to be one of the SCA_* constants. */ - static const char* getSpecialAttributeName(SCAFlags _nId); + static OUString getSpecialAttributeName(SCAFlags _nId); /** calculates the xml attribute representation of a special attribute. @param _nId @@ -252,7 +252,7 @@ namespace xmloff @param _nId the id of the attribute. Has to be one of the BA_* constants. */ - static const char* getBindingAttributeName(BAFlags _nId); + static OUString getBindingAttributeName(BAFlags _nId); /** calculates the xml attribute representation of a binding attribute. @param _nId @@ -280,7 +280,7 @@ namespace xmloff @param _nId the id of the attribute */ - static const char* getOfficeFormsAttributeName(OfficeFormsAttributes _eAttrib); + static OUString getOfficeFormsAttributeName(OfficeFormsAttributes _eAttrib); static xmloff::token::XMLTokenEnum getOfficeFormsAttributeToken(OfficeFormsAttributes _eAttrib); /** calculates the xml namedspace key of an attribute of the office:forms element diff --git a/xmloff/source/forms/layerimport.cxx b/xmloff/source/forms/layerimport.cxx index 40845d735a64..b879ed8518e3 100644 --- a/xmloff/source/forms/layerimport.cxx +++ b/xmloff/source/forms/layerimport.cxx @@ -91,7 +91,7 @@ OFormLayerXMLImport_Impl::OFormLayerXMLImport_Impl(SvXMLImport& _rImporter) // properties not added because they're already present in another form OSL_ENSURE( - OUString::createFromAscii(OAttributeMetaData::getCommonControlAttributeName(CCAFlags::TargetLocation)).equalsAscii( + OAttributeMetaData::getCommonControlAttributeName(CCAFlags::TargetLocation).equals( OAttributeMetaData::getFormAttributeName(faAction)), "OFormLayerXMLImport_Impl::OFormLayerXMLImport_Impl: invalid attribute names (1)!"); // if this fails, we would have to add a translation from faAction->PROPERTY_TARGETURL @@ -99,7 +99,7 @@ OFormLayerXMLImport_Impl::OFormLayerXMLImport_Impl(SvXMLImport& _rImporter) // and CCAFlags::TargetLocation and faAction should be represented by the same attribute OSL_ENSURE( - OUString::createFromAscii(OAttributeMetaData::getCommonControlAttributeName(CCAFlags::Name)).equalsAscii( + OAttributeMetaData::getCommonControlAttributeName(CCAFlags::Name).equals( OAttributeMetaData::getFormAttributeName(faName)), "OFormLayerXMLImport_Impl::OFormLayerXMLImport_Impl: invalid attribute names (2)!"); // the same for faName, CCAFlags::Name and PROPERTY_NAME diff --git a/xmloff/source/forms/propertyexport.cxx b/xmloff/source/forms/propertyexport.cxx index de9ee4ec27a4..91bf65072359 100644 --- a/xmloff/source/forms/propertyexport.cxx +++ b/xmloff/source/forms/propertyexport.cxx @@ -235,7 +235,7 @@ namespace xmloff } } - void OPropertyExport::exportStringPropertyAttribute( const sal_uInt16 _nNamespaceKey, const char* _pAttributeName, + void OPropertyExport::exportStringPropertyAttribute( const sal_uInt16 _nNamespaceKey, const OUString& _pAttributeName, const OUString& _rPropertyName ) { DBG_CHECK_PROPERTY( _rPropertyName, OUString ); @@ -257,7 +257,7 @@ namespace xmloff exportedProperty( _rPropertyName ); } - void OPropertyExport::exportBooleanPropertyAttribute(const sal_uInt16 _nNamespaceKey, const char* _pAttributeName, + void OPropertyExport::exportBooleanPropertyAttribute(const sal_uInt16 _nNamespaceKey, const OUString& _pAttributeName, const OUString& _rPropertyName, const BoolAttrFlags _nBooleanAttributeFlags) { DBG_CHECK_PROPERTY_NO_TYPE( _rPropertyName ); @@ -295,7 +295,7 @@ namespace xmloff exportedProperty( _rPropertyName ); } - void OPropertyExport::exportInt16PropertyAttribute(const sal_uInt16 _nNamespaceKey, const char* _pAttributeName, + void OPropertyExport::exportInt16PropertyAttribute(const sal_uInt16 _nNamespaceKey, const OUString& _pAttributeName, const OUString& _rPropertyName, const sal_Int16 _nDefault, bool force) { DBG_CHECK_PROPERTY( _rPropertyName, sal_Int16 ); @@ -315,7 +315,7 @@ namespace xmloff exportedProperty( _rPropertyName ); } - void OPropertyExport::exportInt32PropertyAttribute( const sal_uInt16 _nNamespaceKey, const char* _pAttributeName, + void OPropertyExport::exportInt32PropertyAttribute( const sal_uInt16 _nNamespaceKey, const OUString& _pAttributeName, const OUString& _rPropertyName, const sal_Int32 _nDefault ) { DBG_CHECK_PROPERTY( _rPropertyName, sal_Int32 ); @@ -336,7 +336,7 @@ namespace xmloff } void OPropertyExport::exportEnumPropertyAttributeImpl( - const sal_uInt16 _nNamespaceKey, const char* _pAttributeName, + const sal_uInt16 _nNamespaceKey, const OUString& _pAttributeName, const OUString &rPropertyName, const SvXMLEnumMapEntry<sal_uInt16>* _pValueMap, const sal_uInt16 _nDefault, const bool _bVoidDefault) { @@ -444,7 +444,7 @@ namespace xmloff } void OPropertyExport::exportGenericPropertyAttribute( - const sal_uInt16 _nAttributeNamespaceKey, const char* _pAttributeName, const char* _pPropertyName) + const sal_uInt16 _nAttributeNamespaceKey, const OUString& _pAttributeName, const char* _pPropertyName) { DBG_CHECK_PROPERTY_ASCII_NO_TYPE( _pPropertyName ); @@ -471,7 +471,7 @@ namespace xmloff AddAttribute(_nAttributeNamespaceKey, _pAttributeName, sValue); } - void OPropertyExport::exportStringSequenceAttribute(const sal_uInt16 _nAttributeNamespaceKey, const char* _pAttributeName, + void OPropertyExport::exportStringSequenceAttribute(const sal_uInt16 _nAttributeNamespaceKey, const OUString& _pAttributeName, const OUString& _rPropertyName) { const sal_Unicode _aListSeparator = ','; @@ -628,14 +628,6 @@ namespace xmloff } #ifdef DBG_UTIL - void OPropertyExport::AddAttribute(sal_uInt16 _nPrefix, const char* _pName, const OUString& _rValue) - { - OSL_ENSURE(m_rContext.getGlobalContext().GetXAttrList()->getValueByName(OUString::createFromAscii(_pName)).isEmpty(), - "OPropertyExport::AddAttribute: already have such an attribute"); - - m_rContext.getGlobalContext().AddAttribute(_nPrefix, _pName, _rValue); - } - void OPropertyExport::AddAttribute( sal_uInt16 _nPrefix, const OUString& _rName, const OUString& _rValue ) { OSL_ENSURE(m_rContext.getGlobalContext().GetXAttrList()->getValueByName( _rName ).isEmpty(), diff --git a/xmloff/source/forms/propertyexport.hxx b/xmloff/source/forms/propertyexport.hxx index 6a972fefe818..b848ab6e47bc 100644 --- a/xmloff/source/forms/propertyexport.hxx +++ b/xmloff/source/forms/propertyexport.hxx @@ -129,7 +129,7 @@ namespace xmloff */ void exportStringPropertyAttribute( const sal_uInt16 _nNamespaceKey, - const char* _pAttributeName, + const OUString& _pAttributeName, const OUString& _rPropertyName ); @@ -147,7 +147,7 @@ namespace xmloff */ void exportBooleanPropertyAttribute( const sal_uInt16 _nNamespaceKey, - const char* _pAttributeName, + const OUString& _pAttributeName, const OUString& _rPropertyName, const BoolAttrFlags _nBooleanAttributeFlags); @@ -170,7 +170,7 @@ namespace xmloff */ void exportInt16PropertyAttribute( const sal_uInt16 _nNamespaceKey, - const char* _pAttributeName, + const OUString& _pAttributeName, const OUString& _rPropertyName, const sal_Int16 _nDefault, const bool force = false); @@ -190,7 +190,7 @@ namespace xmloff */ void exportInt32PropertyAttribute( const sal_uInt16 _nNamespaceKey, - const char* _pAttributeName, + const OUString& _pAttributeName, const OUString& _rPropertyName, const sal_Int32 _nDefault); @@ -212,7 +212,7 @@ namespace xmloff template<typename EnumT> void exportEnumPropertyAttribute( const sal_uInt16 _nNamespaceKey, - const char* _pAttributeName, + const OUString& _pAttributeName, const OUString& _rPropertyName, const SvXMLEnumMapEntry<EnumT>* _pValueMap, const EnumT _nDefault, @@ -224,7 +224,7 @@ namespace xmloff } void exportEnumPropertyAttributeImpl( const sal_uInt16 _nNamespaceKey, - const char* _pAttributeName, + const OUString& _pAttributeName, const OUString& _rPropertyName, const SvXMLEnumMapEntry<sal_uInt16>* _pValueMap, const sal_uInt16 _nDefault, @@ -291,7 +291,7 @@ namespace xmloff */ void exportGenericPropertyAttribute( const sal_uInt16 _nAttributeNamespaceKey, - const char* _pAttributeName, + const OUString& _pAttributeName, const char* _pPropertyName); /** exports a property value, which is a string sequence, as attribute @@ -315,7 +315,7 @@ namespace xmloff */ void exportStringSequenceAttribute( const sal_uInt16 _nAttributeNamespaceKey, - const char* _pAttributeName, + const OUString& _pAttributeName, const OUString& _rPropertyName); /** determines whether the given property is to be exported @@ -354,14 +354,11 @@ namespace xmloff static ::xmloff::token::XMLTokenEnum implGetPropertyXMLType(const css::uno::Type& _rType); #ifdef DBG_UTIL - void AddAttribute(sal_uInt16 _nPrefix, const char* _pName, const OUString& _rValue); void AddAttribute( sal_uInt16 _nPrefix, const OUString& _rName, const OUString& _rValue ); void AddAttribute(sal_uInt16 _nPrefix, ::xmloff::token::XMLTokenEnum _eName, const OUString& _rValue); void AddAttribute(sal_uInt16 _nPrefix, ::xmloff::token::XMLTokenEnum _eName, ::xmloff::token::XMLTokenEnum _eValue ); #else // in the product version, inline this, so it does not cost us extra time calling into our method - void AddAttribute(sal_uInt16 _nPrefix, const char* _pName, const OUString& _rValue) - { m_rContext.getGlobalContext().AddAttribute(_nPrefix, _pName, _rValue); } void AddAttribute( sal_uInt16 _nPrefix, const OUString& _rName, const OUString& _rValue ) { m_rContext.getGlobalContext().AddAttribute( _nPrefix, _rName, _rValue ); } void AddAttribute(sal_uInt16 _nPrefix, ::xmloff::token::XMLTokenEnum _eName, const OUString& _rValue)