summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-02-24 14:09:52 +0000
committerAshod Nakashian <ashod.nakashian@collabora.co.uk>2017-11-28 00:13:06 -0500
commit3437713c11d60f99470fc1d0e2a8e5c56d5a6fe8 (patch)
treed765008fc7e312a4a93e2168fccde7ec207ea41f /sc
parent6a734daa02e7d816bf924465e53765b811a517d5 (diff)
vector::data seems more natural than &vector::front
Change-Id: I0ce48075ad186cf1f9bd3e13fa76269fa9819af1 (cherry picked from commit 3a74745367a73ed9351379fc32bbe9253cdae697)
Diffstat (limited to 'sc')
-rw-r--r--sc/source/filter/excel/excimp8.cxx2
-rw-r--r--sc/source/filter/excel/xiescher.cxx4
-rw-r--r--sc/source/filter/excel/xistream.cxx8
-rw-r--r--sc/source/filter/excel/xlformula.cxx6
-rw-r--r--sc/source/filter/inc/fapihelper.hxx2
-rw-r--r--sc/source/filter/inc/xlformula.hxx2
-rw-r--r--sc/source/filter/oox/biffcodec.cxx6
7 files changed, 15 insertions, 15 deletions
diff --git a/sc/source/filter/excel/excimp8.cxx b/sc/source/filter/excel/excimp8.cxx
index 4619146ea976..7b7717bebd67 100644
--- a/sc/source/filter/excel/excimp8.cxx
+++ b/sc/source/filter/excel/excimp8.cxx
@@ -352,7 +352,7 @@ void ImportExcel8::Feat()
sal_uInt32 nCbSD = aIn.ReaduInt32();
// TODO: could here be some sanity check applied to not allocate 4GB?
aProt.maSecurityDescriptor.resize( nCbSD);
- std::size_t nRead = aIn.Read( &aProt.maSecurityDescriptor.front(), nCbSD);
+ std::size_t nRead = aIn.Read(aProt.maSecurityDescriptor.data(), nCbSD);
if (nRead < nCbSD)
aProt.maSecurityDescriptor.resize( nRead);
}
diff --git a/sc/source/filter/excel/xiescher.cxx b/sc/source/filter/excel/xiescher.cxx
index 0506ed482bce..d6c19ecf0014 100644
--- a/sc/source/filter/excel/xiescher.cxx
+++ b/sc/source/filter/excel/xiescher.cxx
@@ -2721,7 +2721,7 @@ void XclImpListBoxObj::DoProcessControl( ScfPropertySet& rPropSet ) const
if( !aSelVec.empty() )
{
- Sequence< sal_Int16 > aSelSeq( &aSelVec.front(), static_cast< sal_Int32 >( aSelVec.size() ) );
+ Sequence<sal_Int16> aSelSeq(aSelVec.data(), static_cast<sal_Int32>(aSelVec.size()));
rPropSet.SetProperty( "DefaultSelection", aSelSeq );
}
}
@@ -3673,7 +3673,7 @@ OUString XclImpDffConverter::ReadHlinkProperty( SvStream& rDffStrm ) const
// copy from DFF stream to memory stream
::std::vector< sal_uInt8 > aBuffer( nBufferSize );
- sal_uInt8* pnData = &aBuffer.front();
+ sal_uInt8* pnData = aBuffer.data();
if (rDffStrm.ReadBytes(pnData, nBufferSize) == nBufferSize)
{
aMemStream.WriteBytes(pnData, nBufferSize);
diff --git a/sc/source/filter/excel/xistream.cxx b/sc/source/filter/excel/xistream.cxx
index c690970f4311..e9d49642ae06 100644
--- a/sc/source/filter/excel/xistream.cxx
+++ b/sc/source/filter/excel/xistream.cxx
@@ -151,7 +151,7 @@ uno::Sequence< beans::NamedValue > XclImpBiff5Decrypter::OnVerifyPassword( const
OSL_ENSURE( aDocId.getLength() == 16, "Unexpected length of the sequence!" );
::msfilter::MSCodec_Std97 aCodec97;
- aCodec97.InitKey( &aPassVect.front(), reinterpret_cast<sal_uInt8 const *>(aDocId.getConstArray()) );
+ aCodec97.InitKey(aPassVect.data(), reinterpret_cast<sal_uInt8 const *>(aDocId.getConstArray()));
// merge the EncryptionData, there should be no conflicts
::comphelper::SequenceAsHashMap aEncryptionHash( maEncryptionData );
@@ -254,8 +254,8 @@ uno::Sequence< beans::NamedValue > XclImpBiff8Decrypter::OnVerifyPassword( const
*aIt = static_cast< sal_uInt16 >( *pcChar );
// init codec
- mpCodec->InitKey( &aPassVect.front(), &maSalt.front() );
- if ( mpCodec->VerifyKey( &maVerifier.front(), &maVerifierHash.front() ) )
+ mpCodec->InitKey(aPassVect.data(), maSalt.data());
+ if (mpCodec->VerifyKey(maVerifier.data(), maVerifierHash.data()))
maEncryptionData = mpCodec->GetEncryptionData();
}
@@ -271,7 +271,7 @@ bool XclImpBiff8Decrypter::OnVerifyEncryptionData( const uno::Sequence< beans::N
// init codec
mpCodec->InitCodec( rEncryptionData );
- if ( mpCodec->VerifyKey( &maVerifier.front(), &maVerifierHash.front() ) )
+ if (mpCodec->VerifyKey(maVerifier.data(), maVerifierHash.data()))
maEncryptionData = rEncryptionData;
}
diff --git a/sc/source/filter/excel/xlformula.cxx b/sc/source/filter/excel/xlformula.cxx
index 7f83306dc659..62cc43463543 100644
--- a/sc/source/filter/excel/xlformula.cxx
+++ b/sc/source/filter/excel/xlformula.cxx
@@ -743,7 +743,7 @@ void XclTokenArray::ReadSize( XclImpStream& rStrm )
void XclTokenArray::ReadArray( XclImpStream& rStrm )
{
if( !maTokVec.empty() )
- rStrm.Read( &maTokVec.front(), GetSize() );
+ rStrm.Read(maTokVec.data(), GetSize());
}
void XclTokenArray::Read( XclImpStream& rStrm )
@@ -760,9 +760,9 @@ void XclTokenArray::WriteSize( XclExpStream& rStrm ) const
void XclTokenArray::WriteArray( XclExpStream& rStrm ) const
{
if( !maTokVec.empty() )
- rStrm.Write( &maTokVec.front(), GetSize() );
+ rStrm.Write(maTokVec.data(), GetSize());
if( !maExtDataVec.empty() )
- rStrm.Write( &maExtDataVec.front(), maExtDataVec.size() );
+ rStrm.Write(maExtDataVec.data(), maExtDataVec.size());
}
void XclTokenArray::Write( XclExpStream& rStrm ) const
diff --git a/sc/source/filter/inc/fapihelper.hxx b/sc/source/filter/inc/fapihelper.hxx
index edde1c4211cf..649c8ac45698 100644
--- a/sc/source/filter/inc/fapihelper.hxx
+++ b/sc/source/filter/inc/fapihelper.hxx
@@ -89,7 +89,7 @@ template< typename Type >
css::uno::Sequence< Type > ScfApiHelper::VectorToSequence( const ::std::vector< Type >& rVector )
{
OSL_ENSURE( !rVector.empty(), "ScfApiHelper::VectorToSequence - vector is empty" );
- return css::uno::Sequence< Type >( &rVector.front(), static_cast< sal_Int32 >( rVector.size() ) );
+ return css::uno::Sequence<Type>(rVector.data(), static_cast< sal_Int32 >(rVector.size()));
}
// Property sets ==============================================================
diff --git a/sc/source/filter/inc/xlformula.hxx b/sc/source/filter/inc/xlformula.hxx
index a5e9f9516b57..a0fcc25b35c6 100644
--- a/sc/source/filter/inc/xlformula.hxx
+++ b/sc/source/filter/inc/xlformula.hxx
@@ -387,7 +387,7 @@ public:
/** Returns the size of the token array in bytes. */
sal_uInt16 GetSize() const;
/** Returns read-only access to the byte vector storing token data. */
- inline const sal_uInt8* GetData() const { return maTokVec.empty() ? nullptr : &maTokVec.front(); }
+ inline const sal_uInt8* GetData() const { return maTokVec.empty() ? nullptr : maTokVec.data(); }
/** Returns true, if the formula contains a volatile function. */
inline bool IsVolatile() const { return mbVolatile; }
diff --git a/sc/source/filter/oox/biffcodec.cxx b/sc/source/filter/oox/biffcodec.cxx
index 89feebcd8444..fa17d1716a7d 100644
--- a/sc/source/filter/oox/biffcodec.cxx
+++ b/sc/source/filter/oox/biffcodec.cxx
@@ -160,8 +160,8 @@ Sequence< NamedValue > BiffDecoder_RCF::implVerifyPassword( const OUString& rPas
*aIt = static_cast< sal_uInt16 >( *pcChar );
// init codec
- maCodec.initKey( &aPassVect.front(), &maSalt.front() );
- if( maCodec.verifyKey( &maVerifier.front(), &maVerifierHash.front() ) )
+ maCodec.initKey(aPassVect.data(), maSalt.data());
+ if (maCodec.verifyKey(maVerifier.data(), maVerifierHash.data()))
maEncryptionData = maCodec.getEncryptionData();
}
@@ -177,7 +177,7 @@ bool BiffDecoder_RCF::implVerifyEncryptionData( const Sequence< NamedValue >& rE
// init codec
maCodec.initCodec( rEncryptionData );
- if( maCodec.verifyKey( &maVerifier.front(), &maVerifierHash.front() ) )
+ if (maCodec.verifyKey(maVerifier.data(), maVerifierHash.data()))
maEncryptionData = rEncryptionData;
}