Kaydet (Commit) 2993bb63 authored tarafından Michael Stahl's avatar Michael Stahl

tdf#100635 sw: fix crash in SwTOXMgr::UpdateOrInsertTOX()

GetAuthBrackets() returns an empty string if the user selects
[None], in that case apparently 0 bytes are used, multiple places
check for that.

Change-Id: I8375621fa553bc780db343ed8a0bd7ecb3c832dc
üst fa100e0a
......@@ -355,8 +355,16 @@ bool SwTOXMgr::UpdateOrInsertTOX(const SwTOXDescription& rDesc,
pFType = static_cast<SwAuthorityFieldType*>(
pSh->InsertFieldType(type));
}
pFType->SetPreSuffix(rDesc.GetAuthBrackets()[0],
rDesc.GetAuthBrackets()[1]);
OUString const& rBrackets(rDesc.GetAuthBrackets());
if (rBrackets.isEmpty())
{
pFType->SetPreSuffix('\0', '\0');
}
else
{
assert(rBrackets.getLength() == 2);
pFType->SetPreSuffix(rBrackets[0], rBrackets[1]);
}
pFType->SetSequence(rDesc.IsAuthSequence());
SwTOXSortKey rArr[3];
rArr[0] = rDesc.GetSortKey1();
......
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