sw/source/core/unocore/unosett.cxx |   16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

New commits:
commit 62e2288a9b0b7cef37af432f2f6671c0fded51f5
Author:     Stephan Bergmann <sberg...@redhat.com>
AuthorDate: Tue Jun 21 21:58:07 2022 +0200
Commit:     Stephan Bergmann <sberg...@redhat.com>
CommitDate: Tue Jun 21 23:07:17 2022 +0200

    Use proper type for aSvxToUnoAdjust
    
    ...following up on a comment in the commit message of
    37ec4442d70339dc8ec5fb8e4ec8984420b6e14d "o3tl: ensure that the initializer 
of
    enumarray contains enough elements":  "In sw/source/core/unocore/unosett.cxx
    with its odd mix of saL_Int16 and USHRT_MAX, lets keep things that way for 
now
    (probably awaiting later clean up) and use casts to avoid the implicit
    narrowing."  The USHRT_MAX values always mapped to -1 when the elements of
    aSvxToUnoAdjust are used to initialize sal_Int16 nINT16 later on, so make 
that
    explicit here (but an explicit cast from int to sal_Int16 is still needed 
for
    them, to avoid narrowing failures from within the enumarray ctor).
    
    Change-Id: Ib401ff94c429f8415199a5d35997d17266e04279
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136262
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sberg...@redhat.com>

diff --git a/sw/source/core/unocore/unosett.cxx 
b/sw/source/core/unocore/unosett.cxx
index e06e5fe42e50..a871d4f1c844 100644
--- a/sw/source/core/unocore/unosett.cxx
+++ b/sw/source/core/unocore/unosett.cxx
@@ -240,14 +240,14 @@ static SwPageDesc* lcl_GetPageDesc(SwDoc* pDoc, const 
uno::Any& aValue)
 }
 
 // Numbering
-const o3tl::enumarray<SvxAdjust, unsigned short> aSvxToUnoAdjust
-{
-    static_cast<unsigned short>(text::HoriOrientation::LEFT),   //3
-    static_cast<unsigned short>(text::HoriOrientation::RIGHT),  //1
-    static_cast<unsigned short>(USHRT_MAX),
-    static_cast<unsigned short>(text::HoriOrientation::CENTER), //2
-    static_cast<unsigned short>(USHRT_MAX),
-    static_cast<unsigned short>(USHRT_MAX)
+const o3tl::enumarray<SvxAdjust, sal_Int16> aSvxToUnoAdjust
+{
+    text::HoriOrientation::LEFT,   //3
+    text::HoriOrientation::RIGHT,  //1
+    sal_Int16(-1),
+    text::HoriOrientation::CENTER, //2
+    sal_Int16(-1),
+    sal_Int16(-1)
 };
 
 const unsigned short aUnoToSvxAdjust[] =

Reply via email to