diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2019-05-22 13:49:30 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2019-05-22 16:35:20 +0200 |
commit | c18e2ea2a52fc171c50fcb22d431e94c6aececc5 (patch) | |
tree | a63721b18626947e5278a51feb7fd64604e80eee /stoc | |
parent | 7cf4bcef41448218f76fa1e974f541e13dc03023 (diff) |
New loplugin:data
...following up on 1453c2c8f13bac64ecd1981af7cebf1c421808ac "prefer vector::data
to &vector[0]"
Change-Id: I7c113747d92d144a521d49b89384dd8bf1215c01
Reviewed-on: https://gerrit.libreoffice.org/72765
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'stoc')
-rw-r--r-- | stoc/source/invocation_adapterfactory/iafactory.cxx | 2 | ||||
-rw-r--r-- | stoc/source/simpleregistry/simpleregistry.cxx | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/stoc/source/invocation_adapterfactory/iafactory.cxx b/stoc/source/invocation_adapterfactory/iafactory.cxx index 855063ebc9c0..7248a22b1e35 100644 --- a/stoc/source/invocation_adapterfactory/iafactory.cxx +++ b/stoc/source/invocation_adapterfactory/iafactory.cxx @@ -838,7 +838,7 @@ Reference< XInterface > FactoryImpl::createAdapter( } } // map one interface to C++ - uno_Interface * pUnoI = &that->m_vInterfaces[ 0 ]; + uno_Interface * pUnoI = that->m_vInterfaces.data(); m_aUno2Cpp.mapInterface( reinterpret_cast<void **>(&xRet), pUnoI, cppu::UnoType<decltype(xRet)>::get() ); that->release(); diff --git a/stoc/source/simpleregistry/simpleregistry.cxx b/stoc/source/simpleregistry/simpleregistry.cxx index ced189a84ad1..9d2a6a1e9382 100644 --- a/stoc/source/simpleregistry/simpleregistry.cxx +++ b/stoc/source/simpleregistry/simpleregistry.cxx @@ -362,7 +362,7 @@ OUString Key::getAsciiValue() static_cast< OWeakObject * >(this)); } std::vector< char > list(size); - err = key_.getValue(OUString(), &list[0]); + err = key_.getValue(OUString(), list.data()); if (err != RegError::NO_ERROR) { throw css::registry::InvalidRegistryException( "com.sun.star.registry.SimpleRegistry key getAsciiValue:" @@ -378,7 +378,7 @@ OUString Key::getAsciiValue() } OUString value; if (!rtl_convertStringToUString( - &value.pData, &list[0], + &value.pData, list.data(), static_cast< sal_Int32 >(size - 1), RTL_TEXTENCODING_UTF8, (RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_ERROR | RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_ERROR | @@ -539,7 +539,7 @@ OUString Key::getStringValue() static_cast< OWeakObject * >(this)); } std::vector< sal_Unicode > list(size); - err = key_.getValue(OUString(), &list[0]); + err = key_.getValue(OUString(), list.data()); if (err != RegError::NO_ERROR) { throw css::registry::InvalidRegistryException( "com.sun.star.registry.SimpleRegistry key getStringValue:" @@ -553,7 +553,7 @@ OUString Key::getStringValue() " to design error", static_cast< OWeakObject * >(this)); } - return OUString(&list[0], static_cast< sal_Int32 >(size/2 - 1)); + return OUString(list.data(), static_cast< sal_Int32 >(size/2 - 1)); } void Key::setStringValue(OUString const & value) |