diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2019-06-06 10:03:25 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2019-06-06 14:37:06 +0200 |
commit | a1a4787a4014f70b00f73fab56996e285e5ed1d0 (patch) | |
tree | c9490b0da77dcccc6cb0525cfaf22042faf62bfe /vcl/quartz | |
parent | a2f4bdb191d8d11824a0292880377dd4a20ac145 (diff) |
loplugin:data (macOS)
Change-Id: I404a8364a4c7f8d48533fb3c7757a5b7798de9d8
Reviewed-on: https://gerrit.libreoffice.org/73588
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'vcl/quartz')
-rw-r--r-- | vcl/quartz/salgdi.cxx | 38 | ||||
-rw-r--r-- | vcl/quartz/salgdicommon.cxx | 4 |
2 files changed, 21 insertions, 21 deletions
diff --git a/vcl/quartz/salgdi.cxx b/vcl/quartz/salgdi.cxx index 846b7abbbc49..9637966f9c63 100644 --- a/vcl/quartz/salgdi.cxx +++ b/vcl/quartz/salgdi.cxx @@ -132,7 +132,7 @@ const FontCharMapRef CoreTextFontFace::GetFontCharMap() const // get the CMAP raw data std::vector<unsigned char> aBuffer( nBufSize ); - const int nRawLength = GetFontTable( "cmap", &aBuffer[0] ); + const int nRawLength = GetFontTable( "cmap", aBuffer.data() ); SAL_WARN_IF( (nRawLength <= 0), "vcl", "CoreTextFontFace::GetFontCharMap : GetFontTable2 failed!"); if( nRawLength <= 0 ) return mxCharMap; @@ -141,7 +141,7 @@ const FontCharMapRef CoreTextFontFace::GetFontCharMap() const // parse the CMAP CmapResult aCmapResult; - if( ParseCMAP( &aBuffer[0], nRawLength, aCmapResult ) ) + if( ParseCMAP( aBuffer.data(), nRawLength, aCmapResult ) ) { FontCharMapRef xDefFontCharMap( new FontCharMap(aCmapResult) ); // create the matching charmap @@ -167,10 +167,10 @@ bool CoreTextFontFace::GetFontCapabilities(vcl::FontCapabilities &rFontCapabilit // allocate a buffer for the OS/2 raw data std::vector<unsigned char> aBuffer( nBufSize ); // get the OS/2 raw data - const int nRawLength = GetFontTable( "OS/2", &aBuffer[0] ); + const int nRawLength = GetFontTable( "OS/2", aBuffer.data() ); if( nRawLength > 0 ) { - const unsigned char* pOS2Table = &aBuffer[0]; + const unsigned char* pOS2Table = aBuffer.data(); vcl::getTTCoverage( maFontCapabilities.oUnicodeRange, maFontCapabilities.oCodePageRange, pOS2Table, nRawLength); @@ -575,7 +575,7 @@ bool AquaSalGraphics::GetRawFontData( const PhysicalFontFace* pFontData, if( *pJustCFF) { rBuffer.resize( nCffSize); - const int nCffRead = pMacFont->GetFontTable( "CFF ", &rBuffer[0]); + const int nCffRead = pMacFont->GetFontTable( "CFF ", rBuffer.data()); if( nCffRead != nCffSize) { return false; @@ -668,14 +668,14 @@ bool AquaSalGraphics::GetRawFontData( const PhysicalFontFace* pFontData, if( nCmapSize != pMacFont->GetFontTable( "cmap", &rBuffer[nOfs])) return false; - FakeDirEntry( "cmap", nOfs, nCmapSize, &rBuffer[0], pFakeEntry ); + FakeDirEntry( "cmap", nOfs, nCmapSize, rBuffer.data(), pFakeEntry ); nOfs += nCmapSize; if( nCvtSize ) { if( nCvtSize != pMacFont->GetFontTable( "cvt ", &rBuffer[nOfs])) return false; - FakeDirEntry( "cvt ", nOfs, nCvtSize, &rBuffer[0], pFakeEntry ); + FakeDirEntry( "cvt ", nOfs, nCvtSize, rBuffer.data(), pFakeEntry ); nOfs += nCvtSize; } if( nFpgmSize ) @@ -683,7 +683,7 @@ bool AquaSalGraphics::GetRawFontData( const PhysicalFontFace* pFontData, if( nFpgmSize != pMacFont->GetFontTable( "fpgm", &rBuffer[nOfs])) return false; - FakeDirEntry( "fpgm", nOfs, nFpgmSize, &rBuffer[0], pFakeEntry ); + FakeDirEntry( "fpgm", nOfs, nFpgmSize, rBuffer.data(), pFakeEntry ); nOfs += nFpgmSize; } if( nCffSize ) @@ -691,7 +691,7 @@ bool AquaSalGraphics::GetRawFontData( const PhysicalFontFace* pFontData, if( nCffSize != pMacFont->GetFontTable( "CFF ", &rBuffer[nOfs])) return false; - FakeDirEntry( "CFF ", nOfs, nCffSize, &rBuffer[0], pFakeEntry ); + FakeDirEntry( "CFF ", nOfs, nCffSize, rBuffer.data(), pFakeEntry ); nOfs += nGlyfSize; } else @@ -699,47 +699,47 @@ bool AquaSalGraphics::GetRawFontData( const PhysicalFontFace* pFontData, if( nGlyfSize != pMacFont->GetFontTable( "glyf", &rBuffer[nOfs])) return false; - FakeDirEntry( "glyf", nOfs, nGlyfSize, &rBuffer[0], pFakeEntry ); + FakeDirEntry( "glyf", nOfs, nGlyfSize, rBuffer.data(), pFakeEntry ); nOfs += nGlyfSize; if( nLocaSize != pMacFont->GetFontTable( "loca", &rBuffer[nOfs])) return false; - FakeDirEntry( "loca", nOfs, nLocaSize, &rBuffer[0], pFakeEntry ); + FakeDirEntry( "loca", nOfs, nLocaSize, rBuffer.data(), pFakeEntry ); nOfs += nLocaSize; } if( nHeadSize != pMacFont->GetFontTable( "head", &rBuffer[nOfs])) return false; - FakeDirEntry( "head", nOfs, nHeadSize, &rBuffer[0], pFakeEntry ); + FakeDirEntry( "head", nOfs, nHeadSize, rBuffer.data(), pFakeEntry ); nOfs += nHeadSize; if( nHheaSize != pMacFont->GetFontTable( "hhea", &rBuffer[nOfs])) return false; - FakeDirEntry( "hhea", nOfs, nHheaSize, &rBuffer[0], pFakeEntry ); + FakeDirEntry( "hhea", nOfs, nHheaSize, rBuffer.data(), pFakeEntry ); nOfs += nHheaSize; if( nHmtxSize != pMacFont->GetFontTable( "hmtx", &rBuffer[nOfs])) return false; - FakeDirEntry( "hmtx", nOfs, nHmtxSize, &rBuffer[0], pFakeEntry ); + FakeDirEntry( "hmtx", nOfs, nHmtxSize, rBuffer.data(), pFakeEntry ); nOfs += nHmtxSize; if( nMaxpSize != pMacFont->GetFontTable( "maxp", &rBuffer[nOfs])) return false; - FakeDirEntry( "maxp", nOfs, nMaxpSize, &rBuffer[0], pFakeEntry ); + FakeDirEntry( "maxp", nOfs, nMaxpSize, rBuffer.data(), pFakeEntry ); nOfs += nMaxpSize; if( nNameSize != pMacFont->GetFontTable( "name", &rBuffer[nOfs])) return false; - FakeDirEntry( "name", nOfs, nNameSize, &rBuffer[0], pFakeEntry ); + FakeDirEntry( "name", nOfs, nNameSize, rBuffer.data(), pFakeEntry ); nOfs += nNameSize; if( nPrepSize ) { if( nPrepSize != pMacFont->GetFontTable( "prep", &rBuffer[nOfs])) return false; - FakeDirEntry( "prep", nOfs, nPrepSize, &rBuffer[0], pFakeEntry ); + FakeDirEntry( "prep", nOfs, nPrepSize, rBuffer.data(), pFakeEntry ); nOfs += nPrepSize; } @@ -764,7 +764,7 @@ void AquaSalGraphics::GetGlyphWidths( const PhysicalFontFace* pFontData, bool bV // use the font subsetter to get the widths TrueTypeFont* pSftFont = nullptr; - SFErrCodes nRC = ::OpenTTFontBuffer( static_cast<void*>(&aBuffer[0]), aBuffer.size(), 0, &pSftFont); + SFErrCodes nRC = ::OpenTTFontBuffer( static_cast<void*>(aBuffer.data()), aBuffer.size(), 0, &pSftFont); if( nRC != SFErrCodes::Ok ) return; @@ -779,7 +779,7 @@ void AquaSalGraphics::GetGlyphWidths( const PhysicalFontFace* pFontData, bool bV aGlyphIds[i] = static_cast<sal_uInt16>(i); } - std::unique_ptr<sal_uInt16[]> pGlyphMetrics = ::GetTTSimpleGlyphMetrics( pSftFont, &aGlyphIds[0], + std::unique_ptr<sal_uInt16[]> pGlyphMetrics = ::GetTTSimpleGlyphMetrics( pSftFont, aGlyphIds.data(), nGlyphCount, bVertical ); if( pGlyphMetrics ) { diff --git a/vcl/quartz/salgdicommon.cxx b/vcl/quartz/salgdicommon.cxx index af70708eb0f2..4e98d231f96e 100644 --- a/vcl/quartz/salgdicommon.cxx +++ b/vcl/quartz/salgdicommon.cxx @@ -175,7 +175,7 @@ bool AquaSalGraphics::CreateFontSubset( const OUString& rToFile, { // provide the raw-CFF data to the subsetter ByteCount nCffLen = aBuffer.size(); - rInfo.LoadFont( FontType::CFF_FONT, &aBuffer[0], nCffLen ); + rInfo.LoadFont( FontType::CFF_FONT, aBuffer.data(), nCffLen ); // NOTE: assuming that all glyphids requested on Aqua are fully translated @@ -193,7 +193,7 @@ bool AquaSalGraphics::CreateFontSubset( const OUString& rToFile, // prepare data for psprint's font subsetter TrueTypeFont* pSftFont = nullptr; - SFErrCodes nRC = ::OpenTTFontBuffer( static_cast<void*>(&aBuffer[0]), aBuffer.size(), 0, &pSftFont); + SFErrCodes nRC = ::OpenTTFontBuffer( static_cast<void*>(aBuffer.data()), aBuffer.size(), 0, &pSftFont); if( nRC != SFErrCodes::Ok ) { return false; |