[Libreoffice-commits] core.git: sc/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Mar 6 19:55:05 UTC 2019


 sc/source/filter/excel/xicontent.cxx       |    8 ++------
 sc/source/filter/oox/worksheetsettings.cxx |    6 +++---
 2 files changed, 5 insertions(+), 9 deletions(-)

New commits:
commit 7200b461e311ec16c683ac9e9f3ff9e444e8593b
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Wed Mar 6 16:36:04 2019 +0100
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Wed Mar 6 20:54:34 2019 +0100

    Simplify Sequence construction
    
    Change-Id: I52ea31734f7765176e20514c5d02cb3ee5928cdb
    Reviewed-on: https://gerrit.libreoffice.org/68812
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

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);


More information about the Libreoffice-commits mailing list