diff options
Diffstat (limited to 'fpicker')
-rw-r--r-- | fpicker/source/office/RemoteFilesDialog.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx index ca37b71c8c15..df8e1282e415 100644 --- a/fpicker/source/office/RemoteFilesDialog.cxx +++ b/fpicker/source/office/RemoteFilesDialog.cxx @@ -529,9 +529,10 @@ int RemoteFilesDialog::GetSelectedServicePos() if( m_aServices.empty() ) return -1; - while( nPos < ( int )m_aServices.size() ) + int nServices = static_cast<int>(m_aServices.size()); + while( nPos < nServices ) { - while( m_aServices[nPos]->IsLocal() ) + while( (nPos < nServices) && m_aServices[nPos]->IsLocal() ) nPos++; i++; if( i == nSelected ) |