sc/source/filter/excel/excrecds.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
New commits: commit 644678e2accb3d06b541e91001682a7c1faedcaa Author: Stephan Bergmann <sberg...@redhat.com> Date: Thu Oct 23 15:34:41 2014 +0200 Avoid left shift of negative values (ubsan) Change-Id: If465c155c70ec068b6bd7adc05f188bbecc2824e diff --git a/sc/source/filter/excel/excrecds.cxx b/sc/source/filter/excel/excrecds.cxx index d911c19..2273c8f 100644 --- a/sc/source/filter/excel/excrecds.cxx +++ b/sc/source/filter/excel/excrecds.cxx @@ -469,13 +469,13 @@ void XclExpSheetProtection::SaveXml( XclExpXmlStream& rStrm ) if ( pTabProtect ) { Sequence<sal_Int8> aHash = pTabProtect->getPasswordHash(PASSHASH_XL); - sal_uInt16 nHash(0x0000); OString sHash; if (aHash.getLength() >= 2) { - nHash = ((aHash[0] << 8) & 0xFFFF); - nHash |= (aHash[1] & 0xFF); - sHash = OString::number( nHash, 16 ); + sHash = OString::number( + ( static_cast<sal_uInt8>(aHash[0]) << 8 + | static_cast<sal_uInt8>(aHash[1]) ), + 16 ); } sax_fastparser::FSHelperPtr& rWorksheet = rStrm.GetCurrentStream(); rWorksheet->singleElement( XML_sheetProtection, _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits