diff options
Diffstat (limited to 'svl')
-rw-r--r-- | svl/source/misc/msodocumentlockfile.cxx | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/svl/source/misc/msodocumentlockfile.cxx b/svl/source/misc/msodocumentlockfile.cxx index 9650db03999f..0c857ffb53ec 100644 --- a/svl/source/misc/msodocumentlockfile.cxx +++ b/svl/source/misc/msodocumentlockfile.cxx @@ -228,8 +228,16 @@ LockFileEntry MSODocumentLockFile::GetLockData() nUTF16Len = *++pBuf; // use Excel/PowerPoint position if (nUTF16Len > 0 && nUTF16Len <= 52) // skip wrong format - aResult[LockFileComponent::OOOUSERNAME] - = OUString(reinterpret_cast<const sal_Unicode*>(pBuf + 2), nUTF16Len); + { + OUStringBuffer str(nUTF16Len); + sal_uInt8 const* p = reinterpret_cast<sal_uInt8 const*>(pBuf + 2); + for (int i = 0; i != nUTF16Len; ++i) + { + str.append(sal_Unicode(p[0] | (sal_uInt32(p[1]) << 8))); + p += 2; + } + aResult[LockFileComponent::OOOUSERNAME] = str.makeStringAndClear(); + } } } return aResult; |