summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sc/source/filter/excel/xicontent.cxx8
-rw-r--r--sc/source/filter/oox/worksheetsettings.cxx6
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);