Kaydet (Commit) 1d86bad1 authored tarafından Matteo Casalin's avatar Matteo Casalin

Simplify by using indexed getToken()

Change-Id: Ie3c890be9ec3ec01bb72977ab2934bda62b2edea
Reviewed-on: https://gerrit.libreoffice.org/69248
Tested-by: Jenkins
Reviewed-by: 's avatarMatteo Casalin <matteo.casalin@yahoo.com>
üst c5db5deb
......@@ -35,22 +35,14 @@ QueryTokenizer::QueryTokenizer(const OUString& sQuery)
OUString sToken = sQuery.getToken(0, ':', token);
if (!sToken.isEmpty())
{
sal_Int32 equal = sToken.indexOf('=');
sal_Int32 nIdx{ 0 };
const OUString sKey{ sToken.getToken(0, '=', nIdx) };
const OUString sVal{ sToken.getToken(0, ':', nIdx) };
if (equal == 0)
if (sKey.isEmpty())
m_bValid = false;
OSL_ENSURE(m_bValid, "QueryTokenizer::QueryTokenizer() Found non boolean query parameter ... but its key is empty. Will be ignored!");
OUString sKey;
OUString sVal;
sKey = sToken;
if (equal > 0)
{
sKey = sToken.copy(0 , equal );
sVal = sToken.copy(equal+1);
}
if (find(sKey) != end())
m_bValid = false;
OSL_ENSURE(m_bValid, "QueryTokenizer::QueryTokenizer() Query contains same param more than once. Last one wins :-)");
......
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