summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-04-12 16:38:26 +0100
committerCaolán McNamara <caolanm@redhat.com>2019-04-12 20:33:06 +0200
commit1453c2c8f13bac64ecd1981af7cebf1c421808ac (patch)
tree7246d310899dea0c499cfe04addcb57e4776a4d0 /sw
parentf7d8e3318044bb70647424a1eea354bc59e4ced5 (diff)
prefer vector::data to &vector[0]
probably missed loads more Change-Id: I53c9fe188055ef925fed54500e64b837cd56a1e7 Reviewed-on: https://gerrit.libreoffice.org/70676 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/filter/ww8/rtfsdrexport.cxx6
-rw-r--r--sw/source/filter/ww8/wrtww8.cxx6
-rw-r--r--sw/source/filter/ww8/ww8par2.cxx2
-rw-r--r--sw/source/filter/ww8/ww8par3.cxx2
-rw-r--r--sw/source/filter/ww8/ww8scan.cxx2
5 files changed, 9 insertions, 9 deletions
diff --git a/sw/source/filter/ww8/rtfsdrexport.cxx b/sw/source/filter/ww8/rtfsdrexport.cxx
index 4a22b3ca99b3..418164485566 100644
--- a/sw/source/filter/ww8/rtfsdrexport.cxx
+++ b/sw/source/filter/ww8/rtfsdrexport.cxx
@@ -281,9 +281,9 @@ void RtfSdrExport::Commit(EscherPropertyContainer& rProps, const tools::Rectangl
&& rProps.GetOpt(ESCHER_Prop_pSegmentInfo, aSegments)
&& aVertices.nProp.size() >= 6 && aSegments.nProp.size() >= 6)
{
- const sal_uInt8* pVerticesIt = &aVertices.nProp[0] + 6;
+ const sal_uInt8* pVerticesIt = aVertices.nProp.data() + 6;
std::size_t nVerticesPos = 6;
- const sal_uInt8* pSegmentIt = &aSegments.nProp[0];
+ const sal_uInt8* pSegmentIt = aSegments.nProp.data();
OStringBuffer aSegmentInfo(512);
OStringBuffer aVerticies(512);
@@ -441,7 +441,7 @@ void RtfSdrExport::Commit(EscherPropertyContainer& rProps, const tools::Rectangl
.append(SAL_NEWLINE_STRING);
int nHeaderSize
= 25; // The first bytes are WW8-specific, we're only interested in the PNG
- aBuf.append(msfilter::rtfutil::WriteHex(&rOpt.nProp[0] + nHeaderSize,
+ aBuf.append(msfilter::rtfutil::WriteHex(rOpt.nProp.data() + nHeaderSize,
rOpt.nProp.size() - nHeaderSize));
aBuf.append('}');
m_aShapeProps.insert(
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index c737156568d9..094e6b3ec68c 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -1774,7 +1774,7 @@ void SwWW8Writer::WriteString16(SvStream& rStrm, const OUString& rStr,
//vectors are guaranteed to have contiguous memory, so we can do
//this while migrating away from WW8Bytes. Meyers Effective STL, item 16
if (!aBytes.empty())
- rStrm.WriteBytes(&aBytes[0], aBytes.size());
+ rStrm.WriteBytes(aBytes.data(), aBytes.size());
}
void SwWW8Writer::WriteString_xstz(SvStream& rStrm, const OUString& rStr, bool bAddZero)
@@ -1784,7 +1784,7 @@ void SwWW8Writer::WriteString_xstz(SvStream& rStrm, const OUString& rStr, bool b
SwWW8Writer::InsAsString16(aBytes, rStr);
if (bAddZero)
SwWW8Writer::InsUInt16(aBytes, 0);
- rStrm.WriteBytes(&aBytes[0], aBytes.size());
+ rStrm.WriteBytes(aBytes.data(), aBytes.size());
}
void SwWW8Writer::WriteString8(SvStream& rStrm, const OUString& rStr,
@@ -1797,7 +1797,7 @@ void SwWW8Writer::WriteString8(SvStream& rStrm, const OUString& rStr,
//vectors are guaranteed to have contiguous memory, so we can do
////this while migrating away from WW8Bytes. Meyers Effective STL, item 16
if (!aBytes.empty())
- rStrm.WriteBytes(&aBytes[0], aBytes.size());
+ rStrm.WriteBytes(aBytes.data(), aBytes.size());
}
void WW8Export::WriteStringAsPara( const OUString& rText )
diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx
index 3f02c4c7ba49..65c116c672eb 100644
--- a/sw/source/filter/ww8/ww8par2.cxx
+++ b/sw/source/filter/ww8/ww8par2.cxx
@@ -4456,7 +4456,7 @@ void WW8RStyle::ImportOldFormatStyles()
true);
if (!aConvertedChpx[stcp].empty())
- ImportSprms(&(aConvertedChpx[stcp][0]),
+ ImportSprms(aConvertedChpx[stcp].data(),
static_cast< short >(aConvertedChpx[stcp].size()),
false);
diff --git a/sw/source/filter/ww8/ww8par3.cxx b/sw/source/filter/ww8/ww8par3.cxx
index 5b79f9860d01..b970f29ac677 100644
--- a/sw/source/filter/ww8/ww8par3.cxx
+++ b/sw/source/filter/ww8/ww8par3.cxx
@@ -1867,7 +1867,7 @@ void SwWW8ImplReader::RegisterNumFormatOnTextNode(sal_uInt16 nCurrentLFO,
{
std::unique_ptr<SfxItemSet> xOldCurrentItemSet(SetCurrentItemSet(std::move(xListIndent)));
- sal_uInt8* pSprms1 = &aParaSprms[0];
+ sal_uInt8* pSprms1 = aParaSprms.data();
while (0 < nLen)
{
sal_uInt16 nL1 = ImportSprm(pSprms1, nLen);
diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx
index c2a43bab3d5e..cfbbd03b3401 100644
--- a/sw/source/filter/ww8/ww8scan.cxx
+++ b/sw/source/filter/ww8/ww8scan.cxx
@@ -2682,7 +2682,7 @@ WW8PLCFx_Fc_FKP::WW8Fkp::WW8Fkp(const WW8Fib& rFib, SvStream* pSt,
if (aEntry.mnLen)
{
aEntry.mpData = new sal_uInt8[aEntry.mnLen];
- memcpy(aEntry.mpData, &(aSprms[0]), aEntry.mnLen);
+ memcpy(aEntry.mpData, aSprms.data(), aEntry.mnLen);
aEntry.mbMustDelete = true;
}
}