Kaydet (Commit) 75a3ade6 authored tarafından Caolán McNamara's avatar Caolán McNamara

invalid index on load of ooo86460-1.xls

because TextLayoutCache took an OUString arg, passing reinterpret_cast<const
UChar *>(rArgs.mpStr) as an input created a temp string from mpStr, but ctor
stops at first NULL of course unless length arg is passed and input string
contains nulls. Just take a sal_Unicode* as input.

Change-Id: I452cf6fa61155456fbeceeda105e2e15557a21b3
üst 71fefe1d
......@@ -364,10 +364,10 @@ namespace vcl {
{
public:
std::vector<vcl::Run> runs;
TextLayoutCache(OUString const& rString, sal_Int32 const nEnd)
TextLayoutCache(sal_Unicode const* pStr, sal_Int32 const nEnd)
{
vcl::ScriptRun aScriptRun(
reinterpret_cast<const UChar *>(rString.getStr()),
reinterpret_cast<const UChar *>(pStr),
nEnd);
while (aScriptRun.next())
{
......@@ -381,7 +381,7 @@ namespace vcl {
std::shared_ptr<vcl::TextLayoutCache> ServerFontLayout::CreateTextLayoutCache(
OUString const& rString) const
{
return std::make_shared<vcl::TextLayoutCache>(rString, rString.getLength());
return std::make_shared<vcl::TextLayoutCache>(rString.getStr(), rString.getLength());
}
bool HbLayoutEngine::Layout(ServerFontLayout& rLayout, ImplLayoutArgs& rArgs)
......@@ -413,8 +413,7 @@ bool HbLayoutEngine::Layout(ServerFontLayout& rLayout, ImplLayoutArgs& rArgs)
}
else
{
pNewScriptRun.reset(new vcl::TextLayoutCache(
reinterpret_cast<const UChar *>(rArgs.mpStr), rArgs.mnEndCharPos));
pNewScriptRun.reset(new vcl::TextLayoutCache(rArgs.mpStr, rArgs.mnEndCharPos));
pTextLayout = pNewScriptRun.get();
}
......
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