Kaydet (Commit) 9e9e08da authored tarafından Mike Kaganski's avatar Mike Kaganski

tdf#120703 PVS: this fix was wrong

This partially reverts commit 2a3f5d11
to reimplement the proper index check. Thanks to Svyatoslav Razmyslov.

Change-Id: If0928eed8ff137efbb2d7605135375d147e9accf
Reviewed-on: https://gerrit.libreoffice.org/62862
Tested-by: Jenkins
Reviewed-by: 's avatarMike Kaganski <mike.kaganski@collabora.com>
üst 655154e4
......@@ -148,10 +148,13 @@ void lcl_SeparateNameAndIndex( const OUString& rVName, OUString& rVar, OUString&
if ( nIndexStart != -1 )
{
sal_Int32 nIndexEnd = rVar.indexOf( ')', nIndexStart );
rIndex = rVar.copy(nIndexStart + 1, nIndexEnd - nIndexStart - 1);
rVar = rVar.copy(0, nIndexStart);
rVar = comphelper::string::stripEnd(rVar, ' ');
rIndex = comphelper::string::strip(rIndex, ' ');
if (nIndexEnd != -1)
{
rIndex = rVar.copy(nIndexStart + 1, nIndexEnd - nIndexStart - 1);
rVar = rVar.copy(0, nIndexStart);
rVar = comphelper::string::stripEnd(rVar, ' ');
rIndex = comphelper::string::strip(rIndex, ' ');
}
}
if ( !rVar.isEmpty() )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment