Kaydet (Commit) 9dea10a6 authored tarafından Caolán McNamara's avatar Caolán McNamara

can use simple vector here

Change-Id: Ia1565a946f9ac6d607fb6802b19e561fc9afc66d
Reviewed-on: https://gerrit.libreoffice.org/56466
Tested-by: Jenkins
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 7b9db1b3
...@@ -132,9 +132,9 @@ static bool lcl_CheckKashidaPositions( SwScriptInfo& rSI, SwTextSizeInfo& rInf, ...@@ -132,9 +132,9 @@ static bool lcl_CheckKashidaPositions( SwScriptInfo& rSI, SwTextSizeInfo& rInf,
// kashida positions found in SwScriptInfo are not necessarily valid in every font // kashida positions found in SwScriptInfo are not necessarily valid in every font
// if two characters are replaced by a ligature glyph, there will be no place for a kashida // if two characters are replaced by a ligature glyph, there will be no place for a kashida
std::unique_ptr<TextFrameIndex[]> pKashidaPos(new TextFrameIndex[rKashidas]); std::vector<TextFrameIndex> aKashidaPos(rKashidas);
std::unique_ptr<TextFrameIndex[]> pKashidaPosDropped(new TextFrameIndex[rKashidas]); std::vector<TextFrameIndex> aKashidaPosDropped(rKashidas);
rSI.GetKashidaPositions ( nIdx, rItr.GetLength(), pKashidaPos.get() ); rSI.GetKashidaPositions(nIdx, rItr.GetLength(), aKashidaPos.data());
sal_Int32 nKashidaIdx = 0; sal_Int32 nKashidaIdx = 0;
while ( rKashidas && nIdx < nEnd ) while ( rKashidas && nIdx < nEnd )
{ {
...@@ -165,12 +165,12 @@ static bool lcl_CheckKashidaPositions( SwScriptInfo& rSI, SwTextSizeInfo& rInf, ...@@ -165,12 +165,12 @@ static bool lcl_CheckKashidaPositions( SwScriptInfo& rSI, SwTextSizeInfo& rInf,
nKashidasDropped = rInf.GetOut()->ValidateKashidas( nKashidasDropped = rInf.GetOut()->ValidateKashidas(
rInf.GetText(), sal_Int32(nIdx), sal_Int32(nNext - nIdx), rInf.GetText(), sal_Int32(nIdx), sal_Int32(nNext - nIdx),
nKashidasInAttr, nKashidasInAttr,
reinterpret_cast<sal_Int32*>(pKashidaPos.get() + nKashidaIdx), reinterpret_cast<sal_Int32*>(aKashidaPos.data() + nKashidaIdx),
reinterpret_cast<sal_Int32*>(pKashidaPosDropped.get())); reinterpret_cast<sal_Int32*>(aKashidaPosDropped.data()));
rInf.GetOut()->SetLayoutMode ( nOldLayout ); rInf.GetOut()->SetLayoutMode ( nOldLayout );
if ( nKashidasDropped ) if ( nKashidasDropped )
{ {
rSI.MarkKashidasInvalid(nKashidasDropped, pKashidaPosDropped.get()); rSI.MarkKashidasInvalid(nKashidasDropped, aKashidaPosDropped.data());
rKashidas -= nKashidasDropped; rKashidas -= nKashidasDropped;
nGluePortion -= TextFrameIndex(nKashidasDropped); nGluePortion -= TextFrameIndex(nKashidasDropped);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment