summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatteo Casalin <matteo.casalin@yahoo.com>2019-02-18 00:07:40 +0100
committerMatteo Casalin <matteo.casalin@yahoo.com>2019-03-05 22:35:21 +0100
commit1e1559256bf64a8f782b6dcb70f191eec767d475 (patch)
treed4ed94585b94b2f8455132682b2832c397361dae
parentbb843223c2da5c562d189358184c11993f7b65cc (diff)
Use index only where getToken() needs it
Change-Id: I28da64c9ef9b36288f380300f6622d48483e6c0d Reviewed-on: https://gerrit.libreoffice.org/68125 Tested-by: Jenkins Reviewed-by: Matteo Casalin <matteo.casalin@yahoo.com>
-rw-r--r--reportdesign/source/filter/xml/xmlGroup.cxx18
1 files changed, 6 insertions, 12 deletions
diff --git a/reportdesign/source/filter/xml/xmlGroup.cxx b/reportdesign/source/filter/xml/xmlGroup.cxx
index 1c976c31a5e8..49f270760616 100644
--- a/reportdesign/source/filter/xml/xmlGroup.cxx
+++ b/reportdesign/source/filter/xml/xmlGroup.cxx
@@ -112,12 +112,10 @@ OXMLGroup::OXMLGroup( ORptFilter& _rImport
ORptFilter::TGroupFunctionMap::const_iterator aFind = aFunctions.find(sValue);
if ( aFind != aFunctions.end() )
{
- sal_Int32 nIndex = 0;
const OUString sCompleteFormula = aFind->second->getFormula();
- OUString sExpression = sCompleteFormula.getToken(1,'[',nIndex);
- nIndex = 0;
- sExpression = sExpression.getToken(0,']',nIndex);
- nIndex = 0;
+ OUString sExpression = sCompleteFormula.getToken(1,'[');
+ sExpression = sExpression.getToken(0,']');
+ sal_Int32 nIndex = 0;
const OUString sFormula = sCompleteFormula.getToken(0,'(',nIndex);
::sal_Int16 nGroupOn = report::GroupOn::DEFAULT;
@@ -125,8 +123,7 @@ OXMLGroup::OXMLGroup( ORptFilter& _rImport
{
nGroupOn = report::GroupOn::PREFIX_CHARACTERS;
OUString sInterval = sCompleteFormula.getToken(1,';',nIndex);
- nIndex = 0;
- sInterval = sInterval.getToken(0,')',nIndex);
+ sInterval = sInterval.getToken(0,')');
m_xGroup->setGroupInterval(sInterval.toInt32());
}
else if ( sFormula == "rpt:YEAR")
@@ -153,11 +150,8 @@ OXMLGroup::OXMLGroup( ORptFilter& _rImport
nGroupOn = report::GroupOn::INTERVAL;
_rImport.removeFunction(sExpression);
sExpression = sExpression.copy(OUString("INT_count_").getLength());
-
- nIndex = 0;
- OUString sInterval = sCompleteFormula.getToken(1,'/',nIndex);
- nIndex = 0;
- sInterval = sInterval.getToken(0,')',nIndex);
+ OUString sInterval = sCompleteFormula.getToken(1,'/');
+ sInterval = sInterval.getToken(0,')');
m_xGroup->setGroupInterval(sInterval.toInt32());
}