summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2019-05-22 13:49:30 +0200
committerStephan Bergmann <sbergman@redhat.com>2019-05-22 16:35:20 +0200
commitc18e2ea2a52fc171c50fcb22d431e94c6aececc5 (patch)
treea63721b18626947e5278a51feb7fd64604e80eee /vcl
parent7cf4bcef41448218f76fa1e974f541e13dc03023 (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 'vcl')
-rw-r--r--vcl/qt5/Qt5Widget.cxx2
-rw-r--r--vcl/source/filter/graphicfilter.cxx4
-rw-r--r--vcl/source/filter/png/pngread.cxx2
-rw-r--r--vcl/source/fontsubset/sft.cxx4
-rw-r--r--vcl/source/gdi/embeddedfontshelper.cxx2
-rw-r--r--vcl/unx/generic/app/i18n_cb.cxx2
-rw-r--r--vcl/unx/generic/app/i18n_ic.cxx2
-rw-r--r--vcl/unx/generic/print/genprnpsp.cxx4
-rw-r--r--vcl/unx/generic/print/glyphset.cxx2
9 files changed, 12 insertions, 12 deletions
diff --git a/vcl/qt5/Qt5Widget.cxx b/vcl/qt5/Qt5Widget.cxx
index a073ab67158d..a388bf941672 100644
--- a/vcl/qt5/Qt5Widget.cxx
+++ b/vcl/qt5/Qt5Widget.cxx
@@ -507,7 +507,7 @@ void Qt5Widget::inputMethodEvent(QInputMethodEvent* pEvent)
const QList<QInputMethodEvent::Attribute>& rAttrList = pEvent->attributes();
std::vector<ExtTextInputAttr> aTextAttrs(std::max(sal_Int32(1), nLength),
ExtTextInputAttr::NONE);
- aInputEvent.mpTextAttr = &aTextAttrs[0];
+ aInputEvent.mpTextAttr = aTextAttrs.data();
for (int i = 0; i < rAttrList.size(); ++i)
{
diff --git a/vcl/source/filter/graphicfilter.cxx b/vcl/source/filter/graphicfilter.cxx
index b5090fafecdc..1307f31817bf 100644
--- a/vcl/source/filter/graphicfilter.cxx
+++ b/vcl/source/filter/graphicfilter.cxx
@@ -1598,7 +1598,7 @@ ErrCode GraphicFilter::ImportGraphic( Graphic& rGraphic, const OUString& rPath,
if(nStreamLength > 0)
{
std::vector<sal_uInt8> aTwoBytes(2);
- rIStream.ReadBytes(&aTwoBytes[0], 2);
+ rIStream.ReadBytes(aTwoBytes.data(), 2);
rIStream.Seek(nStreamPosition);
if(aTwoBytes[0] == 0x1F && aTwoBytes[1] == 0x8B)
@@ -2082,7 +2082,7 @@ ErrCode GraphicFilter::ExportGraphic( const Graphic& rGraphic, const OUString& r
if ( nChunkLen )
{
aChunkData.aData.resize( nChunkLen );
- memcpy( &aChunkData.aData[ 0 ], aByteSeq.getConstArray(), nChunkLen );
+ memcpy( aChunkData.aData.data(), aByteSeq.getConstArray(), nChunkLen );
}
std::vector< vcl::PNGWriter::ChunkData >::iterator aIter = rChunkData.end() - 1;
rChunkData.insert( aIter, aChunkData );
diff --git a/vcl/source/filter/png/pngread.cxx b/vcl/source/filter/png/pngread.cxx
index 4107325bf7a9..302491edc064 100644
--- a/vcl/source/filter/png/pngread.cxx
+++ b/vcl/source/filter/png/pngread.cxx
@@ -301,7 +301,7 @@ bool PNGReaderImpl::ReadNextChunk()
nBytesRead += mrPNGStream.ReadBytes(&rPtr, mnChunkLen - nBytesRead);
} while (nBytesRead < mnChunkLen && mrPNGStream.good());
- nCRC32 = rtl_crc32( nCRC32, &rChunkData.aData[ 0 ], mnChunkLen );
+ nCRC32 = rtl_crc32( nCRC32, rChunkData.aData.data(), mnChunkLen );
maDataIter = rChunkData.aData.begin();
}
sal_uInt32 nCheck(0);
diff --git a/vcl/source/fontsubset/sft.cxx b/vcl/source/fontsubset/sft.cxx
index 7df64e41a227..613cf79f9734 100644
--- a/vcl/source/fontsubset/sft.cxx
+++ b/vcl/source/fontsubset/sft.cxx
@@ -640,7 +640,7 @@ static int GetCompoundTTOutline(TrueTypeFont *ttf, sal_uInt32 glyphID, ControlPo
pa = static_cast<ControlPoint*>(calloc(np, sizeof(ControlPoint)));
assert(pa != nullptr);
- memcpy(pa, &myPoints[0], np * sizeof(ControlPoint));
+ memcpy(pa, myPoints.data(), np * sizeof(ControlPoint));
*pointArray = pa;
}
@@ -813,7 +813,7 @@ static int BSplineToPSPath(ControlPoint const *srcA, int srcCount, PSPathElement
{
*path = static_cast<PSPathElement*>(calloc(nPathCount, sizeof(PSPathElement)));
assert(*path != nullptr);
- memcpy( *path, &aPathList[0], nPathCount * sizeof(PSPathElement) );
+ memcpy( *path, aPathList.data(), nPathCount * sizeof(PSPathElement) );
}
return nPathCount;
diff --git a/vcl/source/gdi/embeddedfontshelper.cxx b/vcl/source/gdi/embeddedfontshelper.cxx
index 2a64944d12bf..672e5d3c2fb8 100644
--- a/vcl/source/gdi/embeddedfontshelper.cxx
+++ b/vcl/source/gdi/embeddedfontshelper.cxx
@@ -113,7 +113,7 @@ bool EmbeddedFontsHelper::addEmbeddedFont( const uno::Reference< io::XInputStrea
unsigned char *nakedPointerToUncompressedFont = nullptr;
libeot::EOTMetadata eotMetadata;
libeot::EOTError uncompressError =
- libeot::EOT2ttf_buffer( reinterpret_cast<unsigned char *>(&fontData[0]), fontData.size(), &eotMetadata, &nakedPointerToUncompressedFont, &uncompressedFontSize );
+ libeot::EOT2ttf_buffer( reinterpret_cast<unsigned char *>(fontData.data()), fontData.size(), &eotMetadata, &nakedPointerToUncompressedFont, &uncompressedFontSize );
std::shared_ptr<unsigned char> uncompressedFont( nakedPointerToUncompressedFont, libeot::EOTfreeBuffer );
if( uncompressError != libeot::EOT_SUCCESS )
{
diff --git a/vcl/unx/generic/app/i18n_cb.cxx b/vcl/unx/generic/app/i18n_cb.cxx
index b683015fe5a5..3706df0b1a62 100644
--- a/vcl/unx/generic/app/i18n_cb.cxx
+++ b/vcl/unx/generic/app/i18n_cb.cxx
@@ -256,7 +256,7 @@ Preedit_FeedbackToSAL ( const XIMFeedback* pfeedback, int nlength, std::vector<E
if (nlength > 0 && nlength > sal::static_int_cast<int>(rSalAttr.size()) )
{
rSalAttr.reserve( nlength );
- psalattr = &rSalAttr[0];
+ psalattr = rSalAttr.data();
}
else
return nullptr;
diff --git a/vcl/unx/generic/app/i18n_ic.cxx b/vcl/unx/generic/app/i18n_ic.cxx
index ad7f408748b2..71f5ce6f604e 100644
--- a/vcl/unx/generic/app/i18n_ic.cxx
+++ b/vcl/unx/generic/app/i18n_ic.cxx
@@ -614,7 +614,7 @@ SalI18N_InputContext::EndExtTextInput()
if( ! aDel.isDeleted() )
{
// mark previous preedit state again (will e.g. be sent at focus gain)
- maClientData.aInputEv.mpTextAttr = &maClientData.aInputFlags[0];
+ maClientData.aInputEv.mpTextAttr = maClientData.aInputFlags.data();
if( static_cast<X11SalFrame*>(maClientData.pFrame)->hasFocus() )
{
// begin preedit again
diff --git a/vcl/unx/generic/print/genprnpsp.cxx b/vcl/unx/generic/print/genprnpsp.cxx
index baeaadc3541a..b1f73db275ea 100644
--- a/vcl/unx/generic/print/genprnpsp.cxx
+++ b/vcl/unx/generic/print/genprnpsp.cxx
@@ -1151,10 +1151,10 @@ bool PspSalPrinter::StartJob( const OUString* i_pFileName, const OUString& i_rJo
sal_uInt64 nBytesRead = 0;
do
{
- osl_readFile( pFile, &buffer[0], buffer.size(), &nBytesRead );
+ osl_readFile( pFile, buffer.data(), buffer.size(), &nBytesRead );
if( nBytesRead > 0 )
{
- size_t nBytesWritten = fwrite(&buffer[0], 1, nBytesRead, fp);
+ size_t nBytesWritten = fwrite(buffer.data(), 1, nBytesRead, fp);
OSL_ENSURE(nBytesRead == nBytesWritten, "short write");
if (nBytesRead != nBytesWritten)
break;
diff --git a/vcl/unx/generic/print/glyphset.cxx b/vcl/unx/generic/print/glyphset.cxx
index 522bb06f99c6..17555d7baf07 100644
--- a/vcl/unx/generic/print/glyphset.cxx
+++ b/vcl/unx/generic/print/glyphset.cxx
@@ -233,7 +233,7 @@ static void CreatePSUploadableFont( TrueTypeFont* pSrcFont, FILE* pTmpFile,
aInfo.LoadFont( pSrcFont );
aInfo.CreateFontSubset( nTargetMask, pTmpFile, pGlyphSetName,
- &aRequestedGlyphs[0], aEncoding.data(), nGlyphCount );
+ aRequestedGlyphs.data(), aEncoding.data(), nGlyphCount );
}
void