summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sc/source/ui/docshell/externalrefmgr.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/sc/source/ui/docshell/externalrefmgr.cxx b/sc/source/ui/docshell/externalrefmgr.cxx
index 59863f68efbd..546f10226306 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);
}