diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2019-03-06 16:36:04 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2019-03-06 20:54:34 +0100 |
commit | 7200b461e311ec16c683ac9e9f3ff9e444e8593b (patch) | |
tree | 1664d693b6194741684375d1a8e398ea35c621d8 /sc | |
parent | f7ea15720d4aaeb4c79c279da0f679d91c660a74 (diff) |
Simplify Sequence construction
Change-Id: I52ea31734f7765176e20514c5d02cb3ee5928cdb
Reviewed-on: https://gerrit.libreoffice.org/68812
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/filter/excel/xicontent.cxx | 8 | ||||
-rw-r--r-- | sc/source/filter/oox/worksheetsettings.cxx | 6 |
2 files changed, 5 insertions, 9 deletions
diff --git a/sc/source/filter/excel/xicontent.cxx b/sc/source/filter/excel/xicontent.cxx index b34c6b5071aa..9dec16f865c2 100644 --- a/sc/source/filter/excel/xicontent.cxx +++ b/sc/source/filter/excel/xicontent.cxx @@ -1299,9 +1299,7 @@ void XclImpDocProtectBuffer::Apply() const if (mnPassHash) { // 16-bit password hash. - Sequence<sal_Int8> aPass(2); - aPass[0] = (mnPassHash >> 8) & 0xFF; - aPass[1] = mnPassHash & 0xFF; + Sequence<sal_Int8> aPass{sal_Int8(mnPassHash >> 8), sal_Int8(mnPassHash & 0xFF)}; pProtect->setPasswordHash(aPass, PASSHASH_XL); } @@ -1395,9 +1393,7 @@ void XclImpSheetProtectBuffer::Apply() const const sal_uInt16 nHash = rSheet.mnPasswordHash; if (nHash) { - Sequence<sal_Int8> aPass(2); - aPass[0] = (nHash >> 8) & 0xFF; - aPass[1] = nHash & 0xFF; + Sequence<sal_Int8> aPass{sal_Int8(nHash >> 8), sal_Int8(nHash & 0xFF)}; pProtect->setPasswordHash(aPass, PASSHASH_XL); } diff --git a/sc/source/filter/oox/worksheetsettings.cxx b/sc/source/filter/oox/worksheetsettings.cxx index 1110eb55f415..93e340eb1c2c 100644 --- a/sc/source/filter/oox/worksheetsettings.cxx +++ b/sc/source/filter/oox/worksheetsettings.cxx @@ -251,9 +251,9 @@ void WorksheetSettings::finalizeImport() // document again. if (maSheetProt.mnPasswordHash) { - Sequence<sal_Int8> aPass(2); - aPass[0] = ( maSheetProt.mnPasswordHash>> 8) & 0xFF; - aPass[1] = maSheetProt.mnPasswordHash & 0xFF; + Sequence<sal_Int8> aPass{ + sal_Int8(maSheetProt.mnPasswordHash >> 8), + sal_Int8(maSheetProt.mnPasswordHash & 0xFF)}; aProtect.setPasswordHash(aPass, PASSHASH_XL); } aProtect.setOption( ScTableProtection::OBJECTS, !maSheetProt.mbObjects); |