compilerplugins/clang/test/trivialconstructor.cxx | 4 +++- winaccessibility/source/UAccCOM/MAccessible.cxx | 4 ++-- winaccessibility/source/UAccCOM/MAccessible.h | 3 ++- 3 files changed, 7 insertions(+), 4 deletions(-)
New commits: commit d105539a79c68cb134f15518d27134767150d164 Author: Stephan Bergmann <sberg...@redhat.com> AuthorDate: Thu Mar 24 08:07:03 2022 +0100 Commit: Stephan Bergmann <sberg...@redhat.com> CommitDate: Thu Mar 24 09:28:29 2022 +0100 loplugin:stringviewparam Change-Id: If67d685eb930a299587a711eb5f77cbe9fd0ca09 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132020 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sberg...@redhat.com> diff --git a/winaccessibility/source/UAccCOM/MAccessible.cxx b/winaccessibility/source/UAccCOM/MAccessible.cxx index 11ad99d13542..4dda3bc6beee 100644 --- a/winaccessibility/source/UAccCOM/MAccessible.cxx +++ b/winaccessibility/source/UAccCOM/MAccessible.cxx @@ -2796,7 +2796,7 @@ OUString CMAccessible::get_StringFromAny(Any const & pAny) return OUString(); } -OUString CMAccessible::get_String4Numbering(const Any& pAny, sal_Int16 numberingLevel,const OUString& numberingPrefix) +OUString CMAccessible::get_String4Numbering(const Any& pAny, sal_Int16 numberingLevel,std::u16string_view numberingPrefix) { Reference< css::container::XIndexReplace > pXIndex; if((pAny>>=pXIndex) && (numberingLevel !=-1))//numbering level is -1,means invalid value @@ -2818,7 +2818,7 @@ OUString CMAccessible::get_String4Numbering(const Any& pAny, sal_Int16 numbering buf.append(pTemp); buf.append(','); - if (rProp.Name == "NumberingType" && !numberingPrefix.isEmpty()) + if (rProp.Name == "NumberingType" && !numberingPrefix.empty()) { buf.append("NumberingPrefix="); buf.append(numberingPrefix); diff --git a/winaccessibility/source/UAccCOM/MAccessible.h b/winaccessibility/source/UAccCOM/MAccessible.h index c265d9f7ce82..5d18d74abf84 100644 --- a/winaccessibility/source/UAccCOM/MAccessible.h +++ b/winaccessibility/source/UAccCOM/MAccessible.h @@ -22,6 +22,7 @@ #include "stdafx.h" #include "Resource.h" // main symbols #include <map> +#include <string_view> #include <com/sun/star/accessibility/XAccessible.hpp> #include <com/sun/star/accessibility/XAccessibleSelection.hpp> #include <com/sun/star/accessibility/XAccessibleAction.hpp> @@ -229,7 +230,7 @@ public: static OUString get_StringFromAny(css::uno::Any const & pAny); static OUString get_String4Numbering(const css::uno::Any& pAny, - sal_Int16 numberingLevel, const OUString& numberingPrefix); + sal_Int16 numberingLevel, std::u16string_view numberingPrefix); // Helper function for data conversion. static void ConvertAnyToVariant(const css::uno::Any &rAnyVal, commit 5ace52e6aef6f602ce8bf367b45ab2b740a85cd6 Author: Stephan Bergmann <sberg...@redhat.com> AuthorDate: Thu Mar 24 08:02:36 2022 +0100 Commit: Stephan Bergmann <sberg...@redhat.com> CommitDate: Thu Mar 24 09:28:15 2022 +0100 Adapt loplugin:trivialconsructor to clang-cl ...where the S4 template constructor may still have an unparsed null body, so if (!constructorDecl->hasTrivialBody()) return true; will suppress the expected warning. Lets just accept that clang-cl on Windows will find less instances of loplugin:trivialconstructor. (And moving the expected-error comment around on the line was demanded by clang-format. Oh my.) Change-Id: I3357fbd0fbf932f7f93c421c2f079a8cfc536eef Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132019 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sberg...@redhat.com> diff --git a/compilerplugins/clang/test/trivialconstructor.cxx b/compilerplugins/clang/test/trivialconstructor.cxx index 5b48c4cf4250..eed26f8bf305 100644 --- a/compilerplugins/clang/test/trivialconstructor.cxx +++ b/compilerplugins/clang/test/trivialconstructor.cxx @@ -27,7 +27,9 @@ struct S3 template <typename> struct S4 { - // expected-error@+1 {{no need for explicit constructor decl [loplugin:trivialconstructor]}} +#if !defined _MSC_VER +// expected-error@+2 {{no need for explicit constructor decl [loplugin:trivialconstructor]}} +#endif S4() {} };