diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2020-12-07 09:16:39 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2020-12-07 10:51:03 +0100 |
commit | 3ee2868a0a27d27daa3845ce979ff5f862ca7f66 (patch) | |
tree | fa9bad23b53142585f4c62478089c32eb5f39eb4 /winaccessibility | |
parent | 5cfac9be8a55348e7d3bc773aae5bff6b1739080 (diff) |
loplugin:stringviewparam (clang-cl)
Change-Id: Ie29f1a5a66dd53d1e1fc9332ca4b817fa4eb43de
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107332
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'winaccessibility')
-rw-r--r-- | winaccessibility/source/UAccCOM/AccEditableText.cxx | 44 | ||||
-rw-r--r-- | winaccessibility/source/UAccCOM/AccEditableText.h | 6 |
2 files changed, 27 insertions, 23 deletions
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<sal_Int32>::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<short>(ouValue.toInt32()); rAny.setValue(&nValue, cppu::UnoType<short>::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<float>::get()); } - else if(ouName == "CharFontName" ) + else if(ouName == u"CharFontName" ) { // Convert to string. rAny.setValue(&ouValue, cppu::UnoType<OUString>::get()); } - else if(ouName == "CharPosture" ) + else if(ouName == u"CharPosture" ) { // Convert to FontSlant. css::awt::FontSlant fontSlant = static_cast<css::awt::FontSlant>(ouValue.toInt32()); rAny.setValue(&fontSlant, cppu::UnoType<css::awt::FontSlant>::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<Sequence< css::style::TabStop >>::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 <sal/config.h> + +#include <string_view> + #include "Resource.h" #include <com/sun/star/uno/Reference.hxx> #include <com/sun/star/accessibility/XAccessibleEditableText.hpp> @@ -104,7 +108,7 @@ private: css::uno::Reference<css::accessibility::XAccessibleEditableText> 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() { |