summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-04-07 14:55:52 +0100
committerCaolán McNamara <caolanm@redhat.com>2015-04-07 14:58:49 +0100
commit75a3ade6f31c7a1b9b6e1d260eec7130845ed11f (patch)
tree30d326d238722e7d7fd0004644235ea7159ea74c
parent71fefe1dc2bcda3a4cc18d71e1acaf161cc059f2 (diff)
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
-rw-r--r--vcl/generic/glyphs/gcach_layout.cxx9
1 files changed, 4 insertions, 5 deletions
diff --git a/vcl/generic/glyphs/gcach_layout.cxx b/vcl/generic/glyphs/gcach_layout.cxx
index e42008e369ab..4f98620893e8 100644
--- a/vcl/generic/glyphs/gcach_layout.cxx
+++ b/vcl/generic/glyphs/gcach_layout.cxx
@@ -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();
}