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

Stephan Bergmann sbergman at redhat.com
Wed Jan 24 09:50:44 UTC 2018


 sw/source/core/unocore/unocoll.cxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 1438c84a86e2101bd048adede737079ea37c53d0
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Jan 23 22:39:20 2018 +0100

    This presumably always wanted to check for SAL_MAX_UINT16, not USHRT_MAX
    
    ...ever since 84a3db80b4fd66c6854b3135b5f69b61fd828e62 "initial import", where
    the code read
    
    +    if( nIndex < USHRT_MAX)
    +    {
    +        const SwFmtRefMark* pMark = GetDoc()->GetRefMark( (sal_uInt16) nIndex );
    +        if(pMark)
    +        {
    +            xRef = SwXReferenceMarks::GetObject( GetDoc(), pMark );
    +            aRet.setValue(&xRef, ::getCppuType((uno::Reference<XTextContent>*)0));
    +        }
    +    }
    
    and already contained the cast to sal_uInt16 in the call to GetRefMark
    
    Change-Id: Ifd4c3ca0bd89a521c3eecda22435705396f61e16
    Reviewed-on: https://gerrit.libreoffice.org/48464
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Michael Stahl <mstahl at redhat.com>

diff --git a/sw/source/core/unocore/unocoll.cxx b/sw/source/core/unocore/unocoll.cxx
index a74c3710b1e4..c1d8e417eb40 100644
--- a/sw/source/core/unocore/unocoll.cxx
+++ b/sw/source/core/unocore/unocoll.cxx
@@ -1872,7 +1872,7 @@ uno::Any SwXReferenceMarks::getByIndex(sal_Int32 nIndex)
     if(!IsValid())
         throw uno::RuntimeException();
     uno::Reference< XTextContent >  xRef;
-    if(0 <= nIndex && nIndex < USHRT_MAX)
+    if(0 <= nIndex && nIndex < SAL_MAX_UINT16)
     {
         SwFormatRefMark *const pMark = const_cast<SwFormatRefMark*>(
                 GetDoc()->GetRefMark(static_cast<sal_uInt16>(nIndex)));


More information about the Libreoffice-commits mailing list