diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2018-01-31 09:03:33 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2018-01-31 13:14:29 +0100 |
commit | 149bb368fc4911d3303095c7e06d87f564942783 (patch) | |
tree | aa105b0dc1c9cb530f4f91260a6df8180106f658 /sw/source | |
parent | f941cd78a0f805b968bac65fc7c3ef4efffe10fc (diff) |
SvxNumberFormat::SetAbsLSpace takes a short
...and none of the places that call SvxNumberFormat::GetAbsLSpace (also
returning short) look like they deliberately cast back to sal_uInt16 (i.e., to
tunnel a genuinely unsigned value through SvxNumberFormat), so it looks more
plausible to restrict values here to short and SHRT_MAX, instead of sal_uInt16
and USHRT_MAX.
Change-Id: I6807c1b29d30c3f9bfe1ad8b98d0b3ef64dd6a5a
Reviewed-on: https://gerrit.libreoffice.org/48957
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/filter/html/htmlnumreader.cxx | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/sw/source/filter/html/htmlnumreader.cxx b/sw/source/filter/html/htmlnumreader.cxx index 27045823103b..c6585fd2d434 100644 --- a/sw/source/filter/html/htmlnumreader.cxx +++ b/sw/source/filter/html/htmlnumreader.cxx @@ -104,7 +104,7 @@ void SwHTMLParser::NewNumBulList( HtmlTokenId nToken ) nChrFormatPoolId = RES_POOLCHR_BUL_LEVEL; } - sal_uInt16 nAbsLSpace = HTML_NUMBUL_MARGINLEFT; + short nAbsLSpace = HTML_NUMBUL_MARGINLEFT; short nFirstLineIndent = HTML_NUMBUL_INDENT; if( nLevel > 0 ) @@ -265,17 +265,16 @@ void SwHTMLParser::NewNumBulList( HtmlTokenId nToken ) if( aPropInfo.m_bLeftMargin ) { // Default indent has already been added - sal_uInt16 nAbsLSpace = + long nAbsLSpace = aNumFormat.GetAbsLSpace() - HTML_NUMBUL_MARGINLEFT; if( aPropInfo.m_nLeftMargin < 0 && nAbsLSpace < -aPropInfo.m_nLeftMargin ) nAbsLSpace = 0U; - else if( aPropInfo.m_nLeftMargin > USHRT_MAX || - static_cast<long>(nAbsLSpace) + - aPropInfo.m_nLeftMargin > USHRT_MAX ) - nAbsLSpace = USHRT_MAX; + else if( aPropInfo.m_nLeftMargin > SHRT_MAX || + nAbsLSpace + aPropInfo.m_nLeftMargin > SHRT_MAX ) + nAbsLSpace = SHRT_MAX; else - nAbsLSpace = nAbsLSpace + static_cast<sal_uInt16>(aPropInfo.m_nLeftMargin); + nAbsLSpace = nAbsLSpace + aPropInfo.m_nLeftMargin; aNumFormat.SetAbsLSpace( nAbsLSpace ); bChangeNumFormat = true; |