81be32b
From 42851fa1e6a0a9e117d73b53456f01c6ddf470b3 Mon Sep 17 00:00:00 2001
81be32b
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
81be32b
Date: Fri, 12 Apr 2019 15:59:02 +0100
81be32b
Subject: [PATCH] rhbz#1699347 __glibcxx_requires_subscript enabled in fedora
81be32b
 release builds
81be32b
81be32b
and so triggering a crash and exit on trying to get address of 0th element of a
81be32b
0 len vector
81be32b
81be32b
Change-Id: I205478b6c2878d3758d91812db46fe8ad58e37df
81be32b
---
81be32b
 sw/source/filter/ww8/rtfsdrexport.cxx       |  6 +++---
81be32b
 sw/source/filter/ww8/wrtww8.cxx             |  6 +++---
81be32b
 sw/source/filter/ww8/ww8par2.cxx            |  2 +-
81be32b
 sw/source/filter/ww8/ww8par3.cxx            |  2 +-
81be32b
 sw/source/filter/ww8/ww8scan.cxx            |  2 +-
81be32b
 sw/source/uibase/docvw/edtwin.cxx           |  2 +-
81be32b
 vcl/source/gdi/pdfwriter_impl.cxx           | 10 ++++-----
81be32b
 vcl/source/gdi/pdfwriter_impl2.cxx          | 24 ++++++++++-----------
81be32b
 vcl/source/opengl/OpenGLHelper.cxx          |  6 +++---
81be32b
 vcl/unx/generic/fontmanager/fontmanager.cxx |  2 +-
81be32b
 vcl/unx/generic/gdi/gdiimpl.cxx             |  6 +++---
81be32b
 vcl/unx/generic/print/glyphset.cxx          |  2 +-
81be32b
 vcl/unx/generic/window/salframe.cxx         |  2 +-
81be32b
 vcl/unx/gtk/gtksalframe.cxx                 |  4 ++--
81be32b
 vcl/unx/gtk3/gtk3gtkframe.cxx               |  4 ++--
81be32b
 15 files changed, 40 insertions(+), 40 deletions(-)
81be32b
81be32b
diff --git a/sw/source/filter/ww8/rtfsdrexport.cxx b/sw/source/filter/ww8/rtfsdrexport.cxx
81be32b
index e8ac4018c3a9..67136300fe9d 100644
81be32b
--- a/sw/source/filter/ww8/rtfsdrexport.cxx
81be32b
+++ b/sw/source/filter/ww8/rtfsdrexport.cxx
81be32b
@@ -274,9 +274,9 @@ void RtfSdrExport::Commit(EscherPropertyContainer& rProps, const tools::Rectangl
81be32b
                     && rProps.GetOpt(ESCHER_Prop_pSegmentInfo, aSegments)
81be32b
                     && aVertices.nProp.size() >= 6 && aSegments.nProp.size() >= 6)
81be32b
                 {
81be32b
-                    const sal_uInt8* pVerticesIt = &aVertices.nProp[0] + 6;
81be32b
+                    const sal_uInt8* pVerticesIt = aVertices.nProp.data() + 6;
81be32b
                     std::size_t nVerticesPos = 6;
81be32b
-                    const sal_uInt8* pSegmentIt = &aSegments.nProp[0];
81be32b
+                    const sal_uInt8* pSegmentIt = aSegments.nProp.data();
81be32b
 
81be32b
                     OStringBuffer aSegmentInfo(512);
81be32b
                     OStringBuffer aVerticies(512);
81be32b
@@ -434,7 +434,7 @@ void RtfSdrExport::Commit(EscherPropertyContainer& rProps, const tools::Rectangl
81be32b
                     .append(SAL_NEWLINE_STRING);
81be32b
                 int nHeaderSize
81be32b
                     = 25; // The first bytes are WW8-specific, we're only interested in the PNG
81be32b
-                aBuf.append(msfilter::rtfutil::WriteHex(&rOpt.nProp[0] + nHeaderSize,
81be32b
+                aBuf.append(msfilter::rtfutil::WriteHex(rOpt.nProp.data() + nHeaderSize,
81be32b
                                                         rOpt.nProp.size() - nHeaderSize));
81be32b
                 aBuf.append('}');
81be32b
                 m_aShapeProps.insert(
81be32b
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
81be32b
index fe326ab9c822..0caff45e32da 100644
81be32b
--- a/sw/source/filter/ww8/wrtww8.cxx
81be32b
+++ b/sw/source/filter/ww8/wrtww8.cxx
81be32b
@@ -1775,7 +1775,7 @@ void SwWW8Writer::WriteString16(SvStream& rStrm, const OUString& rStr,
81be32b
     //vectors are guaranteed to have contiguous memory, so we can do
81be32b
     //this while migrating away from WW8Bytes. Meyers Effective STL, item 16
81be32b
     if (!aBytes.empty())
81be32b
-        rStrm.WriteBytes(&aBytes[0], aBytes.size());
81be32b
+        rStrm.WriteBytes(aBytes.data(), aBytes.size());
81be32b
 }
81be32b
 
81be32b
 void SwWW8Writer::WriteString_xstz(SvStream& rStrm, const OUString& rStr, bool bAddZero)
81be32b
@@ -1785,7 +1785,7 @@ void SwWW8Writer::WriteString_xstz(SvStream& rStrm, const OUString& rStr, bool b
81be32b
     SwWW8Writer::InsAsString16(aBytes, rStr);
81be32b
     if (bAddZero)
81be32b
         SwWW8Writer::InsUInt16(aBytes, 0);
81be32b
-    rStrm.WriteBytes(&aBytes[0], aBytes.size());
81be32b
+    rStrm.WriteBytes(aBytes.data(), aBytes.size());
81be32b
 }
81be32b
 
81be32b
 void SwWW8Writer::WriteString8(SvStream& rStrm, const OUString& rStr,
81be32b
@@ -1798,7 +1798,7 @@ void SwWW8Writer::WriteString8(SvStream& rStrm, const OUString& rStr,
81be32b
     //vectors are guaranteed to have contiguous memory, so we can do
81be32b
     ////this while migrating away from WW8Bytes. Meyers Effective STL, item 16
81be32b
     if (!aBytes.empty())
81be32b
-        rStrm.WriteBytes(&aBytes[0], aBytes.size());
81be32b
+        rStrm.WriteBytes(aBytes.data(), aBytes.size());
81be32b
 }
81be32b
 
81be32b
 void WW8Export::WriteStringAsPara( const OUString& rText )
81be32b
diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx
81be32b
index f123fb2d207f..0ee79ab2a7d4 100644
81be32b
--- a/sw/source/filter/ww8/ww8par2.cxx
81be32b
+++ b/sw/source/filter/ww8/ww8par2.cxx
81be32b
@@ -4474,7 +4474,7 @@ void WW8RStyle::ImportOldFormatStyles()
81be32b
             true);
81be32b
 
81be32b
         if (!aConvertedChpx[stcp].empty())
81be32b
-            ImportSprms(&(aConvertedChpx[stcp][0]),
81be32b
+            ImportSprms(aConvertedChpx[stcp].data(),
81be32b
                         static_cast< short >(aConvertedChpx[stcp].size()),
81be32b
                         false);
81be32b
 
81be32b
diff --git a/sw/source/filter/ww8/ww8par3.cxx b/sw/source/filter/ww8/ww8par3.cxx
81be32b
index 012755119be2..23309ff5f208 100644
81be32b
--- a/sw/source/filter/ww8/ww8par3.cxx
81be32b
+++ b/sw/source/filter/ww8/ww8par3.cxx
81be32b
@@ -1877,7 +1877,7 @@ void SwWW8ImplReader::RegisterNumFormatOnTextNode(sal_uInt16 nCurrentLFO,
81be32b
                 {
81be32b
                     std::unique_ptr<SfxItemSet> xOldCurrentItemSet(SetCurrentItemSet(std::move(xListIndent)));
81be32b
 
81be32b
-                    sal_uInt8* pSprms1  = &aParaSprms[0];
81be32b
+                    sal_uInt8* pSprms1  = aParaSprms.data();
81be32b
                     while (0 < nLen)
81be32b
                     {
81be32b
                         sal_uInt16 nL1 = ImportSprm(pSprms1, nLen);
81be32b
diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx
81be32b
index 643601e144e3..e65d8a920a1f 100644
81be32b
--- a/sw/source/filter/ww8/ww8scan.cxx
81be32b
+++ b/sw/source/filter/ww8/ww8scan.cxx
81be32b
@@ -2679,7 +2679,7 @@ WW8PLCFx_Fc_FKP::WW8Fkp::WW8Fkp(const WW8Fib& rFib, SvStream* pSt,
81be32b
                         if (aEntry.mnLen)
81be32b
                         {
81be32b
                             aEntry.mpData = new sal_uInt8[aEntry.mnLen];
81be32b
-                            memcpy(aEntry.mpData, &(aSprms[0]), aEntry.mnLen);
81be32b
+                            memcpy(aEntry.mpData, aSprms.data(), aEntry.mnLen);
81be32b
                             aEntry.mbMustDelete = true;
81be32b
                         }
81be32b
                     }
81be32b
diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx
81be32b
index 2e9f77b1a063..4ccbd77d9c1c 100644
81be32b
--- a/sw/source/uibase/docvw/edtwin.cxx
81be32b
+++ b/sw/source/uibase/docvw/edtwin.cxx
81be32b
@@ -5870,7 +5870,7 @@ void QuickHelpData::Start( SwWrtShell& rSh, sal_uInt16 nWrdLen )
81be32b
         const ExtTextInputAttr nVal = ExtTextInputAttr::DottedUnderline |
81be32b
                                 ExtTextInputAttr::Highlight;
81be32b
         const std::vector<ExtTextInputAttr> aAttrs( nL, nVal );
81be32b
-        CommandExtTextInputData aCETID( sStr, &aAttrs[0], nL,
81be32b
+        CommandExtTextInputData aCETID( sStr, aAttrs.data(), nL,
81be32b
                                         0, false );
81be32b
 
81be32b
         //fdo#33092. If the current input language is the default
81be32b
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
81be32b
index ed542157340b..9eab07cc0fb6 100644
81be32b
--- a/vcl/source/gdi/pdfwriter_impl.cxx
81be32b
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
81be32b
@@ -3324,7 +3324,7 @@ bool PDFWriterImpl::emitFonts()
81be32b
                 sal_Int32 nFontDescriptor = emitFontDescriptor( subset.first, aSubsetInfo, s_subset.m_nFontID, nFontStream );
81be32b
 
81be32b
                 if( nToUnicodeStream )
81be32b
-                    nToUnicodeStream = createToUnicodeCMap( pEncoding, &aCodeUnits[0], pCodeUnitsPerGlyph, pEncToUnicodeIndex, nGlyphs );
81be32b
+                    nToUnicodeStream = createToUnicodeCMap( pEncoding, aCodeUnits.data(), pCodeUnitsPerGlyph, pEncToUnicodeIndex, nGlyphs );
81be32b
 
81be32b
                 sal_Int32 nFontObject = createObject();
81be32b
                 if ( !updateObject( nFontObject ) ) return false;
81be32b
@@ -5529,9 +5529,9 @@ sal_Int32 PDFWriterImpl::emitOutputIntent()
81be32b
     if (!nBytesNeeded)
81be32b
       return 0;
81be32b
     std::vector<unsigned char> aBuffer(nBytesNeeded);
81be32b
-    cmsSaveProfileToMem(hProfile, &aBuffer[0], &nBytesNeeded);
81be32b
+    cmsSaveProfileToMem(hProfile, aBuffer.data(), &nBytesNeeded);
81be32b
     cmsCloseProfile(hProfile);
81be32b
-    bool written = writeBuffer( &aBuffer[0], static_cast<sal_Int32>(aBuffer.size()) );
81be32b
+    bool written = writeBuffer( aBuffer.data(), static_cast<sal_Int32>(aBuffer.size()) );
81be32b
     disableStreamEncryption();
81be32b
     endCompression();
81be32b
     sal_uInt64 nEndStreamPos = 0;
81be32b
@@ -5781,9 +5781,9 @@ bool PDFWriterImpl::emitTrailer()
81be32b
 
81be32b
             // emit the owner password, must not be encrypted
81be32b
             aLineS.append( "/O(" );
81be32b
-            appendLiteralString( reinterpret_cast<char*>(&m_aContext.Encryption.OValue[0]), sal_Int32(m_aContext.Encryption.OValue.size()), aLineS );
81be32b
+            appendLiteralString( reinterpret_cast<char*>(m_aContext.Encryption.OValue.data()), sal_Int32(m_aContext.Encryption.OValue.size()), aLineS );
81be32b
             aLineS.append( ")/U(" );
81be32b
-            appendLiteralString( reinterpret_cast<char*>(&m_aContext.Encryption.UValue[0]), sal_Int32(m_aContext.Encryption.UValue.size()), aLineS );
81be32b
+            appendLiteralString( reinterpret_cast<char*>(m_aContext.Encryption.UValue.data()), sal_Int32(m_aContext.Encryption.UValue.size()), aLineS );
81be32b
             aLineS.append( ")/P " );// the permission set
81be32b
             aLineS.append( m_nAccessPermissions );
81be32b
             aLineS.append( ">>\nendobj\n\n" );
81be32b
diff --git a/vcl/source/gdi/pdfwriter_impl2.cxx b/vcl/source/gdi/pdfwriter_impl2.cxx
81be32b
index 82f99a33cd00..2cf35ba666a6 100644
81be32b
--- a/vcl/source/gdi/pdfwriter_impl2.cxx
81be32b
+++ b/vcl/source/gdi/pdfwriter_impl2.cxx
81be32b
@@ -1161,7 +1161,7 @@ void PDFWriterImpl::checkAndEnableStreamEncryption( sal_Int32 nObject )
81be32b
         // the other location of m_nEncryptionKey is already set to 0, our fixed generation number
81be32b
         // do the MD5 hash
81be32b
         ::std::vector<unsigned char> const nMD5Sum(::comphelper::Hash::calculateHash(
81be32b
-            &m_aContext.Encryption.EncryptionKey[0], i+2, ::comphelper::HashType::MD5));
81be32b
+            m_aContext.Encryption.EncryptionKey.data(), i+2, ::comphelper::HashType::MD5));
81be32b
         // the i+2 to take into account the generation number, always zero
81be32b
         // initialize the RC4 with the key
81be32b
         // key length: see algorithm 3.1, step 4: (N+5) max 16
81be32b
@@ -1181,7 +1181,7 @@ void PDFWriterImpl::enableStringEncryption( sal_Int32 nObject )
81be32b
         // do the MD5 hash
81be32b
         // the i+2 to take into account the generation number, always zero
81be32b
         ::std::vector<unsigned char> const nMD5Sum(::comphelper::Hash::calculateHash(
81be32b
-            &m_aContext.Encryption.EncryptionKey[0], i+2, ::comphelper::HashType::MD5));
81be32b
+            m_aContext.Encryption.EncryptionKey.data(), i+2, ::comphelper::HashType::MD5));
81be32b
         // initialize the RC4 with the key
81be32b
         // key length: see algorithm 3.1, step 4: (N+5) max 16
81be32b
         rtl_cipher_initARCFOUR( m_aCipher, rtl_Cipher_DirectionEncode, nMD5Sum.data(), m_nRC4KeyLength, nullptr, 0 );
81be32b
@@ -1312,7 +1312,7 @@ bool PDFWriterImpl::computeEncryptionKey( EncHashTransporter* i_pTransporter, vc
81be32b
     {
81be32b
         //step 3
81be32b
         if( ! io_rProperties.OValue.empty() )
81be32b
-            pDigest->update(&io_rProperties.OValue[0], io_rProperties.OValue.size());
81be32b
+            pDigest->update(io_rProperties.OValue.data(), io_rProperties.OValue.size());
81be32b
         else
81be32b
             bSuccess = false;
81be32b
         //Step 4
81be32b
@@ -1326,7 +1326,7 @@ bool PDFWriterImpl::computeEncryptionKey( EncHashTransporter* i_pTransporter, vc
81be32b
         pDigest->update(nPerm, sizeof(nPerm));
81be32b
 
81be32b
         //step 5, get the document ID, binary form
81be32b
-        pDigest->update(&io_rProperties.DocumentIdentifier[0], io_rProperties.DocumentIdentifier.size());
81be32b
+        pDigest->update(io_rProperties.DocumentIdentifier.data(), io_rProperties.DocumentIdentifier.size());
81be32b
         //get the digest
81be32b
         nMD5Sum = pDigest->finalize();
81be32b
 
81be32b
@@ -1394,7 +1394,7 @@ bool PDFWriterImpl::computeODictionaryValue( const sal_uInt8* i_pPaddedOwnerPass
81be32b
         {
81be32b
             // encrypt the user password using the key set above
81be32b
             rtl_cipher_encodeARCFOUR( aCipher, i_pPaddedUserPassword, ENCRYPTED_PWD_SIZE, // the data to be encrypted
81be32b
-                                      &io_rOValue[0], sal_Int32(io_rOValue.size()) ); //encrypted data
81be32b
+                                      io_rOValue.data(), sal_Int32(io_rOValue.size()) ); //encrypted data
81be32b
             //Step 7, only if 128 bit
81be32b
             if( i_nKeyLength == SECUR_128BIT_KEY )
81be32b
             {
81be32b
@@ -1414,8 +1414,8 @@ bool PDFWriterImpl::computeODictionaryValue( const sal_uInt8* i_pPaddedOwnerPass
81be32b
                         bSuccess = false;
81be32b
                         break;
81be32b
                     }
81be32b
-                    rtl_cipher_encodeARCFOUR( aCipher, &io_rOValue[0], sal_Int32(io_rOValue.size()), // the data to be encrypted
81be32b
-                                              &io_rOValue[0], sal_Int32(io_rOValue.size()) ); // encrypted data, can be the same as the input, encrypt "in place"
81be32b
+                    rtl_cipher_encodeARCFOUR( aCipher, io_rOValue.data(), sal_Int32(io_rOValue.size()), // the data to be encrypted
81be32b
+                                              io_rOValue.data(), sal_Int32(io_rOValue.size()) ); // encrypted data, can be the same as the input, encrypt "in place"
81be32b
                     //step 8, store in class data member
81be32b
                 }
81be32b
             }
81be32b
@@ -1464,14 +1464,14 @@ bool PDFWriterImpl::computeUDictionaryValue( EncHashTransporter* i_pTransporter,
81be32b
                 io_rProperties.UValue[i] = 0;
81be32b
             //steps 2 and 3
81be32b
             aDigest.update(s_nPadString, sizeof(s_nPadString));
81be32b
-            aDigest.update(&io_rProperties.DocumentIdentifier[0], io_rProperties.DocumentIdentifier.size());
81be32b
+            aDigest.update(io_rProperties.DocumentIdentifier.data(), io_rProperties.DocumentIdentifier.size());
81be32b
 
81be32b
             ::std::vector<unsigned char> const nMD5Sum(aDigest.finalize());
81be32b
             //Step 4
81be32b
             rtl_cipher_initARCFOUR( aCipher, rtl_Cipher_DirectionEncode,
81be32b
-                                    &io_rProperties.EncryptionKey[0], SECUR_128BIT_KEY, nullptr, 0 ); //destination data area
81be32b
+                                    io_rProperties.EncryptionKey.data(), SECUR_128BIT_KEY, nullptr, 0 ); //destination data area
81be32b
             rtl_cipher_encodeARCFOUR( aCipher, nMD5Sum.data(), nMD5Sum.size(), // the data to be encrypted
81be32b
-                                      &io_rProperties.UValue[0], SECUR_128BIT_KEY ); //encrypted data, stored in class data member
81be32b
+                                      io_rProperties.UValue.data(), SECUR_128BIT_KEY ); //encrypted data, stored in class data member
81be32b
             //step 5
81be32b
             sal_uInt32 i;
81be32b
             size_t y;
81be32b
@@ -1485,8 +1485,8 @@ bool PDFWriterImpl::computeUDictionaryValue( EncHashTransporter* i_pTransporter,
81be32b
                 rtl_cipher_initARCFOUR( aCipher, rtl_Cipher_DirectionEncode,
81be32b
                                         nLocalKey, SECUR_128BIT_KEY, // key and key length
81be32b
                                         nullptr, 0 ); //destination data area, on init can be NULL
81be32b
-                rtl_cipher_encodeARCFOUR( aCipher, &io_rProperties.UValue[0], SECUR_128BIT_KEY, // the data to be encrypted
81be32b
-                                          &io_rProperties.UValue[0], SECUR_128BIT_KEY ); // encrypted data, can be the same as the input, encrypt "in place"
81be32b
+                rtl_cipher_encodeARCFOUR( aCipher, io_rProperties.UValue.data(), SECUR_128BIT_KEY, // the data to be encrypted
81be32b
+                                          io_rProperties.UValue.data(), SECUR_128BIT_KEY ); // encrypted data, can be the same as the input, encrypt "in place"
81be32b
             }
81be32b
         }
81be32b
         else
81be32b
diff --git a/vcl/source/opengl/OpenGLHelper.cxx b/vcl/source/opengl/OpenGLHelper.cxx
81be32b
index 6ae47184ae2e..a3579b579502 100644
81be32b
--- a/vcl/source/opengl/OpenGLHelper.cxx
81be32b
+++ b/vcl/source/opengl/OpenGLHelper.cxx
81be32b
@@ -124,13 +124,13 @@ namespace {
81be32b
         {
81be32b
             std::vector<char> ErrorMessage(InfoLogLength+1);
81be32b
             if (bShaderNotProgram)
81be32b
-                glGetShaderInfoLog (nId, InfoLogLength, nullptr, &ErrorMessage[0]);
81be32b
+                glGetShaderInfoLog (nId, InfoLogLength, nullptr, ErrorMessage.data());
81be32b
             else
81be32b
-                glGetProgramInfoLog(nId, InfoLogLength, nullptr, &ErrorMessage[0]);
81be32b
+                glGetProgramInfoLog(nId, InfoLogLength, nullptr, ErrorMessage.data());
81be32b
             CHECK_GL_ERROR();
81be32b
 
81be32b
             ErrorMessage.push_back('\0');
81be32b
-            SAL_WARN("vcl.opengl", rDetail << " shader " << nId << " compile for " << rName << " failed : " << &ErrorMessage[0]);
81be32b
+            SAL_WARN("vcl.opengl", rDetail << " shader " << nId << " compile for " << rName << " failed : " << ErrorMessage.data());
81be32b
         }
81be32b
         else
81be32b
             SAL_WARN("vcl.opengl", rDetail << " shader: " << rName << " compile " << nId << " failed without error log");
81be32b
diff --git a/vcl/unx/generic/fontmanager/fontmanager.cxx b/vcl/unx/generic/fontmanager/fontmanager.cxx
81be32b
index 394c5484a5bd..0a093b641270 100644
81be32b
--- a/vcl/unx/generic/fontmanager/fontmanager.cxx
81be32b
+++ b/vcl/unx/generic/fontmanager/fontmanager.cxx
81be32b
@@ -1108,7 +1108,7 @@ void PrintFontManager::getGlyphWidths( fontID nFont,
81be32b
         for (int i = 0; i < nGlyphs; i++)
81be32b
             aGlyphIds[i] = sal_uInt16(i);
81be32b
         std::unique_ptr<sal_uInt16[]> pMetrics = GetTTSimpleGlyphMetrics(pTTFont,
81be32b
-                                                                 &aGlyphIds[0],
81be32b
+                                                                 aGlyphIds.data(),
81be32b
                                                                  nGlyphs,
81be32b
                                                                  bVertical);
81be32b
         if (pMetrics)
81be32b
diff --git a/vcl/unx/generic/gdi/gdiimpl.cxx b/vcl/unx/generic/gdi/gdiimpl.cxx
81be32b
index e0a4879ff6fb..2ff75dba8f3a 100644
81be32b
--- a/vcl/unx/generic/gdi/gdiimpl.cxx
81be32b
+++ b/vcl/unx/generic/gdi/gdiimpl.cxx
81be32b
@@ -1489,7 +1489,7 @@ bool X11SalGraphicsImpl::drawPolyPolygon(
81be32b
     const int nTrapCount = aB2DTrapVector.size();
81be32b
     if( !nTrapCount )
81be32b
         return true;
81be32b
-    const bool bDrawn = drawFilledTrapezoids( &aB2DTrapVector[0], nTrapCount, fTransparency );
81be32b
+    const bool bDrawn = drawFilledTrapezoids( aB2DTrapVector.data(), nTrapCount, fTransparency );
81be32b
     return bDrawn;
81be32b
 }
81be32b
 
81be32b
@@ -1565,7 +1565,7 @@ bool X11SalGraphicsImpl::drawFilledTrapezoids( const basegfx::B2DTrapezoid* pB2D
81be32b
     // render the trapezoids
81be32b
     const XRenderPictFormat* pMaskFormat = rRenderPeer.GetStandardFormatA8();
81be32b
     rRenderPeer.CompositeTrapezoids( PictOpOver,
81be32b
-        rEntry.m_aPicture, aDstPic, pMaskFormat, 0, 0, &aTrapVector[0], aTrapVector.size() );
81be32b
+        rEntry.m_aPicture, aDstPic, pMaskFormat, 0, 0, aTrapVector.data(), aTrapVector.size() );
81be32b
 
81be32b
     return true;
81be32b
 }
81be32b
@@ -1639,7 +1639,7 @@ bool X11SalGraphicsImpl::drawFilledTriangles(
81be32b
     // render the trapezoids
81be32b
     const XRenderPictFormat* pMaskFormat = rRenderPeer.GetStandardFormatA8();
81be32b
     rRenderPeer.CompositeTriangles( PictOpOver,
81be32b
-        rEntry.m_aPicture, aDstPic, pMaskFormat, 0, 0, &aTriVector[0], aTriVector.size() );
81be32b
+        rEntry.m_aPicture, aDstPic, pMaskFormat, 0, 0, aTriVector.data(), aTriVector.size() );
81be32b
 
81be32b
     return true;
81be32b
 }
81be32b
diff --git a/vcl/unx/generic/print/glyphset.cxx b/vcl/unx/generic/print/glyphset.cxx
81be32b
index 0f259ab5b669..522bb06f99c6 100644
81be32b
--- a/vcl/unx/generic/print/glyphset.cxx
81be32b
+++ b/vcl/unx/generic/print/glyphset.cxx
81be32b
@@ -233,7 +233,7 @@ static void CreatePSUploadableFont( TrueTypeFont* pSrcFont, FILE* pTmpFile,
81be32b
     aInfo.LoadFont( pSrcFont );
81be32b
 
81be32b
     aInfo.CreateFontSubset( nTargetMask, pTmpFile, pGlyphSetName,
81be32b
-        &aRequestedGlyphs[0], &aEncoding[0], nGlyphCount );
81be32b
+        &aRequestedGlyphs[0], aEncoding.data(), nGlyphCount );
81be32b
 }
81be32b
 
81be32b
 void
81be32b
diff --git a/vcl/unx/generic/window/salframe.cxx b/vcl/unx/generic/window/salframe.cxx
81be32b
index ab0700e948e2..f961d04545c3 100644
81be32b
--- a/vcl/unx/generic/window/salframe.cxx
81be32b
+++ b/vcl/unx/generic/window/salframe.cxx
81be32b
@@ -2929,7 +2929,7 @@ bool X11SalFrame::appendUnicodeSequence( sal_Unicode c )
81be32b
 
81be32b
             SalExtTextInputEvent aEv;
81be32b
             aEv.maText          = rSeq;
81be32b
-            aEv.mpTextAttr      = &attribs[0];
81be32b
+            aEv.mpTextAttr      = attribs.data();
81be32b
             aEv.mnCursorPos     = 0;
81be32b
             aEv.mnCursorFlags   = 0;
81be32b
 
81be32b
diff --git a/vcl/unx/gtk/gtksalframe.cxx b/vcl/unx/gtk/gtksalframe.cxx
81be32b
index 1499af92ee70..ed3cce166980 100644
81be32b
--- a/vcl/unx/gtk/gtksalframe.cxx
81be32b
+++ b/vcl/unx/gtk/gtksalframe.cxx
81be32b
@@ -3292,7 +3292,7 @@ void GtkSalFrame::IMHandler::endExtTextInput( EndExtTextInputFlags /*nFlags*/ )
81be32b
         if( ! aDel.isDeleted() )
81be32b
         {
81be32b
             // mark previous preedit state again (will e.g. be sent at focus gain)
81be32b
-            m_aInputEvent.mpTextAttr = &m_aInputFlags[0];
81be32b
+            m_aInputEvent.mpTextAttr = m_aInputFlags.data();
81be32b
             if( m_bFocused )
81be32b
             {
81be32b
                 // begin preedit again
81be32b
@@ -3608,7 +3608,7 @@ void GtkSalFrame::IMHandler::signalIMPreeditChanged( GtkIMContext*, gpointer im_
81be32b
     } while (pango_attr_iterator_next (iter));
81be32b
     pango_attr_iterator_destroy(iter);
81be32b
 
81be32b
-    pThis->m_aInputEvent.mpTextAttr = &pThis->m_aInputFlags[0];
81be32b
+    pThis->m_aInputEvent.mpTextAttr = pThis->m_aInputFlags.data();
81be32b
 
81be32b
     g_free( pText );
81be32b
     pango_attr_list_unref( pAttrs );
81be32b
diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx
81be32b
index 184102e74b17..d1af70f75775 100644
81be32b
--- a/vcl/unx/gtk3/gtk3gtkframe.cxx
81be32b
+++ b/vcl/unx/gtk3/gtk3gtkframe.cxx
81be32b
@@ -3852,7 +3852,7 @@ void GtkSalFrame::IMHandler::endExtTextInput( EndExtTextInputFlags /*nFlags*/ )
81be32b
         if( ! aDel.isDeleted() )
81be32b
         {
81be32b
             // mark previous preedit state again (will e.g. be sent at focus gain)
81be32b
-            m_aInputEvent.mpTextAttr = &m_aInputFlags[0];
81be32b
+            m_aInputEvent.mpTextAttr = m_aInputFlags.data();
81be32b
             if( m_bFocused )
81be32b
             {
81be32b
                 // begin preedit again
81be32b
@@ -4159,7 +4159,7 @@ void GtkSalFrame::IMHandler::signalIMPreeditChanged( GtkIMContext*, gpointer im_
81be32b
     } while (pango_attr_iterator_next (iter));
81be32b
     pango_attr_iterator_destroy(iter);
81be32b
 
81be32b
-    pThis->m_aInputEvent.mpTextAttr = &pThis->m_aInputFlags[0];
81be32b
+    pThis->m_aInputEvent.mpTextAttr = pThis->m_aInputFlags.data();
81be32b
 
81be32b
     g_free( pText );
81be32b
     pango_attr_list_unref( pAttrs );
81be32b
-- 
81be32b
2.21.0
81be32b