summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-03-28 16:26:07 +0100
committerCaolán McNamara <caolanm@redhat.com>2017-03-28 16:26:07 +0100
commit16b67b4bd394aee3b46a9d46ea7f919dfb35a855 (patch)
tree559663451b17fff9ee2f31782f5029fa3001d86a /svx
parent1a99e32f6fd6213981e9272c22f5019ed7444d1d (diff)
std::unique_ptr<sal_uInt16[]> -> std::vector
Change-Id: I708e1f24e14bc21f40cf4d5a2d3e6f849b6f7762
Diffstat (limited to 'svx')
-rw-r--r--svx/source/dialog/srchdlg.cxx27
1 files changed, 10 insertions, 17 deletions
diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx
index 2929c37769cc..1abd869cff8c 100644
--- a/svx/source/dialog/srchdlg.cxx
+++ b/svx/source/dialog/srchdlg.cxx
@@ -1974,30 +1974,23 @@ IMPL_LINK_NOARG(SvxSearchDialog, FormatHdl_Impl, Button*, void)
if ( !pSh || !pImpl->pRanges )
return;
- sal_sSize nCnt = 0;
- const sal_uInt16* pPtr = pImpl->pRanges.get();
- const sal_uInt16* pTmp = pPtr;
-
- while( *pTmp )
- pTmp++;
- nCnt = pTmp - pPtr + 7;
- std::unique_ptr<sal_uInt16[]> pWhRanges(new sal_uInt16[nCnt]);
- sal_uInt16 nPos = 0;
+ std::vector<sal_uInt16> aWhRanges;
- while( *pPtr )
+ const sal_uInt16* pPtr = pImpl->pRanges.get();
+ while (*pPtr)
{
- pWhRanges[nPos++] = *pPtr++;
+ aWhRanges.push_back(*pPtr++);
}
- pWhRanges[nPos++] = SID_ATTR_PARA_MODEL;
- pWhRanges[nPos++] = SID_ATTR_PARA_MODEL;
+ aWhRanges.push_back(SID_ATTR_PARA_MODEL);
+ aWhRanges.push_back(SID_ATTR_PARA_MODEL);
sal_uInt16 nBrushWhich = pSh->GetPool().GetWhich(SID_ATTR_BRUSH);
- pWhRanges[nPos++] = nBrushWhich;
- pWhRanges[nPos++] = nBrushWhich;
- pWhRanges[nPos] = 0;
+ aWhRanges.push_back(nBrushWhich);
+ aWhRanges.push_back(nBrushWhich);
+ aWhRanges.push_back(0);
SfxItemPool& rPool = pSh->GetPool();
- SfxItemSet aSet( rPool, pWhRanges.get() );
+ SfxItemSet aSet(rPool, aWhRanges.data());
OUString aTxt;
aSet.InvalidateAllItems();