summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2019-05-22 13:49:30 +0200
committerStephan Bergmann <sbergman@redhat.com>2019-05-22 16:35:20 +0200
commitc18e2ea2a52fc171c50fcb22d431e94c6aececc5 (patch)
treea63721b18626947e5278a51feb7fd64604e80eee /editeng
parent7cf4bcef41448218f76fa1e974f541e13dc03023 (diff)
New loplugin:data
...following up on 1453c2c8f13bac64ecd1981af7cebf1c421808ac "prefer vector::data to &vector[0]" Change-Id: I7c113747d92d144a521d49b89384dd8bf1215c01 Reviewed-on: https://gerrit.libreoffice.org/72765 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'editeng')
-rw-r--r--editeng/source/editeng/impedit2.cxx2
-rw-r--r--editeng/source/rtf/rtfitem.cxx2
-rw-r--r--editeng/source/rtf/svxrtf.cxx8
3 files changed, 6 insertions, 6 deletions
diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx
index dd151dd09383..8764b097e698 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -4029,7 +4029,7 @@ long ImpEditEngine::GetXPos(
if ( nType == AsianCompressionFlags::PunctuationRight && !pLine->GetCharPosArray().empty() )
{
sal_Int32 n = nIndex - nTextPortionStart;
- const long* pDXArray = &pLine->GetCharPosArray()[0]+( nTextPortionStart-pLine->GetStart() );
+ const long* pDXArray = pLine->GetCharPosArray().data()+( nTextPortionStart-pLine->GetStart() );
sal_Int32 nCharWidth = ( ( (n+1) < rPortion.GetLen() ) ? pDXArray[n] : rPortion.GetSize().Width() )
- ( n ? pDXArray[n-1] : 0 );
if ( (n+1) < rPortion.GetLen() )
diff --git a/editeng/source/rtf/rtfitem.cxx b/editeng/source/rtf/rtfitem.cxx
index 41880b4f35b2..78b185fb8ca7 100644
--- a/editeng/source/rtf/rtfitem.cxx
+++ b/editeng/source/rtf/rtfitem.cxx
@@ -1809,7 +1809,7 @@ void SvxRTFParser::SetDefault( int nToken, int nValue )
if( !bNewDoc )
return;
- SfxItemSet aTmp( *pAttrPool, &aWhichMap[0] );
+ SfxItemSet aTmp( *pAttrPool, aWhichMap.data() );
bool bOldFlag = bIsLeftToRightDef;
bIsLeftToRightDef = true;
switch( nToken )
diff --git a/editeng/source/rtf/svxrtf.cxx b/editeng/source/rtf/svxrtf.cxx
index 4da3c6841263..07e923c687cc 100644
--- a/editeng/source/rtf/svxrtf.cxx
+++ b/editeng/source/rtf/svxrtf.cxx
@@ -282,7 +282,7 @@ void SvxRTFParser::ReadStyleTable()
bool bHasStyleNo = false;
int _nOpenBrakets = 1; // the first was already detected earlier!!
std::unique_ptr<SvxRTFStyleType> pStyle(
- new SvxRTFStyleType( *pAttrPool, &aWhichMap[0] ));
+ new SvxRTFStyleType( *pAttrPool, aWhichMap.data() ));
pStyle->aAttrSet.Put( GetRTFDefaults() );
bIsInReadStyleTab = true;
@@ -340,7 +340,7 @@ void SvxRTFParser::ReadStyleTable()
}
// All data from the font is available, so off to the table
m_StyleTable.insert(std::make_pair(nStyleNo, std::move(pStyle)));
- pStyle.reset(new SvxRTFStyleType( *pAttrPool, &aWhichMap[0] ));
+ pStyle.reset(new SvxRTFStyleType( *pAttrPool, aWhichMap.data() ));
pStyle->aAttrSet.Put( GetRTFDefaults() );
nStyleNo = 0;
bHasStyleNo = false;
@@ -625,7 +625,7 @@ SvxRTFItemStackType* SvxRTFParser::GetAttrSet_()
if( pCurrent )
pNew.reset(new SvxRTFItemStackType( *pCurrent, *pInsPos, false/*bCopyAttr*/ ));
else
- pNew.reset(new SvxRTFItemStackType( *pAttrPool, &aWhichMap[0],
+ pNew.reset(new SvxRTFItemStackType( *pAttrPool, aWhichMap.data(),
*pInsPos ));
pNew->SetRTFDefaults( GetRTFDefaults() );
@@ -910,7 +910,7 @@ const SfxItemSet& SvxRTFParser::GetRTFDefaults()
{
if( !pRTFDefaults )
{
- pRTFDefaults.reset( new SfxItemSet( *pAttrPool, &aWhichMap[0] ) );
+ pRTFDefaults.reset( new SfxItemSet( *pAttrPool, aWhichMap.data() ) );
sal_uInt16 nId;
if( 0 != ( nId = aPardMap.nScriptSpace ))
{