summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-02-24 14:09:52 +0000
committerCaolán McNamara <caolanm@redhat.com>2017-02-24 15:48:51 +0000
commit3a74745367a73ed9351379fc32bbe9253cdae697 (patch)
tree0fec3ca84576a0f51e4f48cdda82b67e7282c3ab /sc
parentc9126dfbabcde1bf8b157942a5f5134ad547b957 (diff)
vector::data seems more natural than &vector::front
Change-Id: I0ce48075ad186cf1f9bd3e13fa76269fa9819af1
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 a0fed54c1ab1..959b8b0e77a4 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 350324b98d89..b70b3b913ce5 100644
--- a/sc/source/filter/excel/xiescher.cxx
+++ b/sc/source/filter/excel/xiescher.cxx
@@ -2720,7 +2720,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 );
}
}
@@ -3669,7 +3669,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 6c350e412e57..a3dbf8a0693a 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 e98fea704942..684ce569be47 100644
--- a/sc/source/filter/excel/xlformula.cxx
+++ b/sc/source/filter/excel/xlformula.cxx
@@ -739,7 +739,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 )
@@ -756,9 +756,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 4cfb84e19e08..2f490f2ea2d5 100644
--- a/sc/source/filter/oox/biffcodec.cxx
+++ b/sc/source/filter/oox/biffcodec.cxx
@@ -127,8 +127,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();
}
@@ -144,7 +144,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;
}