diff options
author | Matteo Casalin <matteo.casalin@yahoo.com> | 2019-03-04 17:47:20 +0100 |
---|---|---|
committer | Matteo Casalin <matteo.casalin@yahoo.com> | 2019-03-14 22:43:08 +0100 |
commit | 48fc2fee15a7d9b43da430598e3acfa18e739250 (patch) | |
tree | c0a3b7088cc6d6213998f4f37ff66edacf8a86cf /fpicker | |
parent | b85b58feea3608f9a7c1456320eb13db6f16d942 (diff) |
getToken() ==> copy() since separator positions are known
Change-Id: Ib13f279fd764538deb77b3ee871e58baf8676be2
Reviewed-on: https://gerrit.libreoffice.org/69242
Tested-by: Jenkins
Reviewed-by: Matteo Casalin <matteo.casalin@yahoo.com>
Diffstat (limited to 'fpicker')
-rw-r--r-- | fpicker/source/office/RemoteFilesDialog.cxx | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx index 850490ae9041..f0491762dde8 100644 --- a/fpicker/source/office/RemoteFilesDialog.cxx +++ b/fpicker/source/office/RemoteFilesDialog.cxx @@ -462,19 +462,15 @@ void RemoteFilesDialog::InitSize() OUString sCfgStr; if( aUserData >>= sCfgStr ) { - int nPos = sCfgStr.indexOf( "|" ); - if( nPos != -1 ) - { - nPos = sCfgStr.indexOf( "|", nPos + 1 ); - if( nPos != -1 ) - { - sal_Int32 nIdx = 0; - m_nWidth = sCfgStr.getToken( 0, '|', nIdx ).toInt32(); - m_nHeight = sCfgStr.getToken( 0, '|', nIdx ).toInt32(); - - m_pFileView->SetConfigString( sCfgStr.copy( nPos + 1) ); - } - } + sal_Int32 nPos1{ sCfgStr.indexOf('|') }; + if (nPos1<0) + return; + sal_Int32 nPos2{ sCfgStr.indexOf('|', nPos1+1 ) }; + if (nPos2<0) + return; + m_nWidth = sCfgStr.copy(0, nPos1++).toInt32(); + m_nHeight = sCfgStr.copy(nPos1, nPos2-nPos1).toInt32(); + m_pFileView->SetConfigString( sCfgStr.copy(nPos2+1) ); } } else |