From 3ee2868a0a27d27daa3845ce979ff5f862ca7f66 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Mon, 7 Dec 2020 09:16:39 +0100 Subject: loplugin:stringviewparam (clang-cl) Change-Id: Ie29f1a5a66dd53d1e1fc9332ca4b817fa4eb43de Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107332 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- .../source/UAccCOM/AccEditableText.cxx | 44 +++++++++++----------- winaccessibility/source/UAccCOM/AccEditableText.h | 6 ++- 2 files changed, 27 insertions(+), 23 deletions(-) (limited to 'winaccessibility') diff --git a/winaccessibility/source/UAccCOM/AccEditableText.cxx b/winaccessibility/source/UAccCOM/AccEditableText.cxx index aa3e8f904a14..c290098d33dc 100644 --- a/winaccessibility/source/UAccCOM/AccEditableText.cxx +++ b/winaccessibility/source/UAccCOM/AccEditableText.cxx @@ -261,57 +261,57 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CAccEditableText::setAttributes(long startOffs * @param ouValue the string of attribute value. * @param rAny the Any object to be returned. */ -void CAccEditableText::get_AnyFromOLECHAR(const OUString &ouName, const OUString &ouValue, Any &rAny) +void CAccEditableText::get_AnyFromOLECHAR(std::u16string_view ouName, const OUString &ouValue, Any &rAny) { - if(ouName == "CharBackColor" || - ouName == "CharColor" || - ouName == "ParaAdjust" || - ouName == "ParaFirstLineIndent" || - ouName == "ParaLeftMargin" || - ouName == "ParaRightMargin" || - ouName == "ParaTopMargin" || - ouName == "ParaBottomMargin" || - ouName == "CharFontPitch" ) + if(ouName == u"CharBackColor" || + ouName == u"CharColor" || + ouName == u"ParaAdjust" || + ouName == u"ParaFirstLineIndent" || + ouName == u"ParaLeftMargin" || + ouName == u"ParaRightMargin" || + ouName == u"ParaTopMargin" || + ouName == u"ParaBottomMargin" || + ouName == u"CharFontPitch" ) { // Convert to int. // NOTE: CharFontPitch is not implemented in java file. sal_Int32 nValue = ouValue.toInt32(); rAny.setValue(&nValue, cppu::UnoType::get()); } - else if(ouName == "CharShadowed" || - ouName == "CharContoured" ) + else if(ouName == u"CharShadowed" || + ouName == u"CharContoured" ) { // Convert to boolean. rAny <<= ouValue.toBoolean(); } - else if(ouName == "CharEscapement" || - ouName == "CharStrikeout" || - ouName == "CharUnderline" || - ouName == "CharFontPitch" ) + else if(ouName == u"CharEscapement" || + ouName == u"CharStrikeout" || + ouName == u"CharUnderline" || + ouName == u"CharFontPitch" ) { // Convert to short. short nValue = static_cast(ouValue.toInt32()); rAny.setValue(&nValue, cppu::UnoType::get()); } - else if(ouName == "CharHeight" || - ouName == "CharWeight" ) + else if(ouName == u"CharHeight" || + ouName == u"CharWeight" ) { // Convert to float. float fValue = ouValue.toFloat(); rAny.setValue(&fValue, cppu::UnoType::get()); } - else if(ouName == "CharFontName" ) + else if(ouName == u"CharFontName" ) { // Convert to string. rAny.setValue(&ouValue, cppu::UnoType::get()); } - else if(ouName == "CharPosture" ) + else if(ouName == u"CharPosture" ) { // Convert to FontSlant. css::awt::FontSlant fontSlant = static_cast(ouValue.toInt32()); rAny.setValue(&fontSlant, cppu::UnoType::get()); } - else if(ouName == "ParaTabStops" ) + else if(ouName == u"ParaTabStops" ) { // Convert to the Sequence with TabStop element. @@ -420,7 +420,7 @@ void CAccEditableText::get_AnyFromOLECHAR(const OUString &ouName, const OUString // Assign to Any object. rAny.setValue(&seqTabStop, cppu::UnoType>::get()); } - else if(ouName == "ParaLineSpacing" ) + else if(ouName == u"ParaLineSpacing" ) { // Parse value string. css::style::LineSpacing lineSpacing; diff --git a/winaccessibility/source/UAccCOM/AccEditableText.h b/winaccessibility/source/UAccCOM/AccEditableText.h index 62bfc662d3b4..3925fc060024 100644 --- a/winaccessibility/source/UAccCOM/AccEditableText.h +++ b/winaccessibility/source/UAccCOM/AccEditableText.h @@ -20,6 +20,10 @@ #ifndef INCLUDED_WINACCESSIBILITY_SOURCE_UACCCOM_ACCEDITABLETEXT_H #define INCLUDED_WINACCESSIBILITY_SOURCE_UACCCOM_ACCEDITABLETEXT_H +#include + +#include + #include "Resource.h" #include #include @@ -104,7 +108,7 @@ private: css::uno::Reference pRXEdtTxt; - static void get_AnyFromOLECHAR(const OUString &ouName, const OUString &ouValue, css::uno::Any &rAny); + static void get_AnyFromOLECHAR(std::u16string_view ouName, const OUString &ouValue, css::uno::Any &rAny); css::accessibility::XAccessibleEditableText* GetXInterface() { -- cgit