[Libreoffice-commits] core.git: fpicker/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Thu Mar 14 21:43:38 UTC 2019
fpicker/source/office/RemoteFilesDialog.cxx | 22 +++++++++-------------
1 file changed, 9 insertions(+), 13 deletions(-)
New commits:
commit 48fc2fee15a7d9b43da430598e3acfa18e739250
Author: Matteo Casalin <matteo.casalin at yahoo.com>
AuthorDate: Mon Mar 4 17:47:20 2019 +0100
Commit: Matteo Casalin <matteo.casalin at yahoo.com>
CommitDate: Thu Mar 14 22:43:08 2019 +0100
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 at yahoo.com>
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
More information about the Libreoffice-commits
mailing list