vcl/generic/glyphs/scrptrun.cxx | 6 +++++- vcl/generic/glyphs/scrptrun.h | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-)
New commits: commit fd3e86eff5ee2535adc9caab5bcfd9a1e05b1f24 Author: Caolán McNamara <[email protected]> Date: Sat Nov 29 16:44:12 2014 +0000 give us a parenStack which can grow to fit any input Change-Id: Ic464184fe367da33bf8c4790b82656b140e3cbd0 (cherry picked from commit cced2f6b866877c39afe86f4af18622cb4022bef) Reviewed-on: https://gerrit.libreoffice.org/13218 Reviewed-by: Michael Stahl <[email protected]> Reviewed-by: Eike Rathke <[email protected]> Reviewed-by: Caolán McNamara <[email protected]> Tested-by: Caolán McNamara <[email protected]> diff --git a/vcl/generic/glyphs/scrptrun.cxx b/vcl/generic/glyphs/scrptrun.cxx index f72d296..6df7659 100644 --- a/vcl/generic/glyphs/scrptrun.cxx +++ b/vcl/generic/glyphs/scrptrun.cxx @@ -173,7 +173,11 @@ UBool ScriptRun::next() // characters above it on the stack will be poped. if (pairIndex >= 0) { if ((pairIndex & 1) == 0) { - parenStack[++parenSP].pairIndex = pairIndex; + ++parenSP; + int32_t nVecSize = parenStack.size(); + if (parenSP == nVecSize) + parenStack.resize(nVecSize + 128); + parenStack[parenSP].pairIndex = pairIndex; parenStack[parenSP].scriptCode = scriptCode; } else if (parenSP >= 0) { int32_t pi = pairIndex & ~1; diff --git a/vcl/generic/glyphs/scrptrun.h b/vcl/generic/glyphs/scrptrun.h index 6e9bbd6..1c4d0fa 100644 --- a/vcl/generic/glyphs/scrptrun.h +++ b/vcl/generic/glyphs/scrptrun.h @@ -43,6 +43,7 @@ #include "unicode/utypes.h" #include "unicode/uobject.h" #include "unicode/uscript.h" +#include <vector> struct ScriptRecord { @@ -110,7 +111,7 @@ private: int32_t scriptEnd; UScriptCode scriptCode; - ParenStackEntry parenStack[128]; + std::vector<ParenStackEntry> parenStack; int32_t parenSP; static int8_t highBit(int32_t value); @@ -164,6 +165,7 @@ inline void ScriptRun::reset() scriptEnd = charStart; scriptCode = USCRIPT_INVALID_CODE; parenSP = -1; + parenStack.resize(128); } inline void ScriptRun::reset(int32_t start, int32_t length)
_______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
