summaryrefslogtreecommitdiff
path: root/vcl/generic/glyphs/gcach_layout.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-11-28 15:52:06 +0000
committerCaolán McNamara <caolanm@redhat.com>2014-11-28 15:52:37 +0000
commitacdf54c4142b7a51b99eacacee470ac31d6ff0ae (patch)
tree11c58a8c78286911ab6374fa7063fe132b485b16 /vcl/generic/glyphs/gcach_layout.cxx
parent8cc05ee2e31fd94624cfbe78729c8a4eefff62a6 (diff)
Related: deb#766788 alloc on heap instead of stack
Change-Id: I0f103f535b99f185cfdd019a76709d5deaef1d13
Diffstat (limited to 'vcl/generic/glyphs/gcach_layout.cxx')
-rw-r--r--vcl/generic/glyphs/gcach_layout.cxx15
1 files changed, 8 insertions, 7 deletions
diff --git a/vcl/generic/glyphs/gcach_layout.cxx b/vcl/generic/glyphs/gcach_layout.cxx
index abd04baf41cf..0285b276d46b 100644
--- a/vcl/generic/glyphs/gcach_layout.cxx
+++ b/vcl/generic/glyphs/gcach_layout.cxx
@@ -372,7 +372,7 @@ bool HbLayoutEngine::layout(ServerFontLayout& rLayout, ImplLayoutArgs& rArgs)
rLayout.Reserve(nGlyphCapacity);
- vcl::ScriptRun aScriptRun(reinterpret_cast<const UChar *>(rArgs.mpStr), rArgs.mnLength);
+ std::unique_ptr<vcl::ScriptRun> xScriptRun(new vcl::ScriptRun(reinterpret_cast<const UChar *>(rArgs.mpStr), rArgs.mnLength));
Point aCurrPos(0, 0);
while (true)
@@ -385,21 +385,21 @@ bool HbLayoutEngine::layout(ServerFontLayout& rLayout, ImplLayoutArgs& rArgs)
// Find script subruns.
int nCurrentPos = nBidiMinRunPos;
HbScriptRuns aScriptSubRuns;
- while (aScriptRun.next())
+ while (xScriptRun->next())
{
- if (aScriptRun.getScriptStart() <= nCurrentPos && aScriptRun.getScriptEnd() > nCurrentPos)
+ if (xScriptRun->getScriptStart() <= nCurrentPos && xScriptRun->getScriptEnd() > nCurrentPos)
break;
}
while (nCurrentPos < nBidiEndRunPos)
{
int32_t nMinRunPos = nCurrentPos;
- int32_t nEndRunPos = std::min(aScriptRun.getScriptEnd(), nBidiEndRunPos);
- HbScriptRun aRun(nMinRunPos, nEndRunPos, aScriptRun.getScriptCode());
+ int32_t nEndRunPos = std::min(xScriptRun->getScriptEnd(), nBidiEndRunPos);
+ HbScriptRun aRun(nMinRunPos, nEndRunPos, xScriptRun->getScriptCode());
aScriptSubRuns.push_back(aRun);
nCurrentPos = nEndRunPos;
- aScriptRun.next();
+ xScriptRun->next();
}
// RTL subruns should be reversed to ensure that final glyph order is
@@ -407,7 +407,8 @@ bool HbLayoutEngine::layout(ServerFontLayout& rLayout, ImplLayoutArgs& rArgs)
if (bRightToLeft)
std::reverse(aScriptSubRuns.begin(), aScriptSubRuns.end());
- aScriptRun.reset();
+ xScriptRun->reset();
+ xScriptRun.reset();
for (HbScriptRuns::iterator it = aScriptSubRuns.begin(); it != aScriptSubRuns.end(); ++it)
{