sc/source/ui/docshell/externalrefmgr.cxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit fac78d1d350184319d91d4f7d15bb3f22dccf0da
Author: Eike Rathke <er...@redhat.com>
Date:   Thu Oct 27 00:28:44 2016 +0200

    trust the size ... tdf#79442 follow-up
    
    ... and don't unnecessarily loop over the whole range.
    Actually a max/min typo.
    
    Change-Id: I3dbda3a7388baa337c3922ad992fd3946074c3b7
    (cherry picked from commit 329ecb67808767d677383e5fd6089feaab4cd9e4)
    Reviewed-on: https://gerrit.libreoffice.org/30312
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: Markus Mohrhard <markus.mohrh...@googlemail.com>

diff --git a/sc/source/ui/docshell/externalrefmgr.cxx 
b/sc/source/ui/docshell/externalrefmgr.cxx
index 59863f6..546f102 100644
--- a/sc/source/ui/docshell/externalrefmgr.cxx
+++ b/sc/source/ui/docshell/externalrefmgr.cxx
@@ -2652,7 +2652,7 @@ void ScExternalRefManager::addFilesToLinkManager()
 
     SAL_WARN_IF( maSrcFiles.size() >= SAL_MAX_UINT16,
             "sc.ui", "ScExternalRefManager::addFilesToLinkManager: files 
overflow");
-    const sal_uInt16 nSize = static_cast<sal_uInt16>( std::max<size_t>( 
maSrcFiles.size(), SAL_MAX_UINT16));
+    const sal_uInt16 nSize = static_cast<sal_uInt16>( std::min<size_t>( 
maSrcFiles.size(), SAL_MAX_UINT16));
     for (sal_uInt16 nFileId = 0; nFileId < nSize; ++nFileId)
         maybeLinkExternalFile( nFileId);
 }
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to