[Libreoffice-commits] core.git: sw/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Mon Feb 4 22:36:25 UTC 2019
sw/source/uibase/fldui/fldmgr.cxx | 21 +++++++++++----------
1 file changed, 11 insertions(+), 10 deletions(-)
New commits:
commit 0b21f6556b6fff76290d1095089da89532365215
Author: Matteo Casalin <matteo.casalin at yahoo.com>
AuthorDate: Sun Jan 27 19:45:51 2019 +0100
Commit: Matteo Casalin <matteo.casalin at yahoo.com>
CommitDate: Mon Feb 4 23:36:03 2019 +0100
Use indexed getToken()
Change-Id: Ie8e1a7fdc8c728c7e9e43a444f0d039b2d60b121
Reviewed-on: https://gerrit.libreoffice.org/67309
Tested-by: Jenkins
Reviewed-by: Matteo Casalin <matteo.casalin at yahoo.com>
diff --git a/sw/source/uibase/fldui/fldmgr.cxx b/sw/source/uibase/fldui/fldmgr.cxx
index e54397e9c3f5..92faf193d56f 100644
--- a/sw/source/uibase/fldui/fldmgr.cxx
+++ b/sw/source/uibase/fldui/fldmgr.cxx
@@ -1182,10 +1182,11 @@ bool SwFieldMgr::InsertField(
}
else
{
- aDBData.sDataSource = rData.m_sPar1.getToken(0, DB_DELIM);
- aDBData.sCommand = rData.m_sPar1.getToken(1, DB_DELIM);
- aDBData.nCommandType = rData.m_sPar1.getToken(2, DB_DELIM).toInt32();
- sPar1 = rData.m_sPar1.getToken(3, DB_DELIM);
+ sal_Int32 nIdx{ 0 };
+ aDBData.sDataSource = rData.m_sPar1.getToken(0, DB_DELIM, nIdx);
+ aDBData.sCommand = rData.m_sPar1.getToken(0, DB_DELIM, nIdx);
+ aDBData.nCommandType = rData.m_sPar1.getToken(0, DB_DELIM, nIdx).toInt32();
+ sPar1 = rData.m_sPar1.getToken(0, DB_DELIM, nIdx);
}
if(!aDBData.sDataSource.isEmpty() && pCurShell->GetDBData() != aDBData)
@@ -1469,8 +1470,8 @@ bool SwFieldMgr::InsertField(
const sal_Int32 nTokenCount = comphelper::string::getTokenCount(rData.m_sPar2, DB_DELIM);
Sequence<OUString> aEntries(nTokenCount);
OUString* pArray = aEntries.getArray();
- for(sal_Int32 nToken = 0; nToken < nTokenCount; nToken++)
- pArray[nToken] = rData.m_sPar2.getToken(nToken, DB_DELIM);
+ for(sal_Int32 nToken = 0, nIdx = 0; nToken < nTokenCount; nToken++)
+ pArray[nToken] = rData.m_sPar2.getToken(0, DB_DELIM, nIdx);
static_cast<SwDropDownField*>(pField.get())->SetItems(aEntries);
static_cast<SwDropDownField*>(pField.get())->SetName(rData.m_sPar1);
}
@@ -1641,8 +1642,8 @@ void SwFieldMgr::UpdateCurField(sal_uInt32 nFormat,
sal_Int32 nTokenCount = comphelper::string::getTokenCount(sPar2, DB_DELIM);
Sequence<OUString> aEntries(nTokenCount);
OUString* pArray = aEntries.getArray();
- for(sal_Int32 nToken = 0; nToken < nTokenCount; nToken++)
- pArray[nToken] = sPar2.getToken(nToken, DB_DELIM);
+ for(sal_Int32 nToken = 0, nIdx = 0; nToken < nTokenCount; nToken++)
+ pArray[nToken] = sPar2.getToken(0, DB_DELIM, nIdx);
static_cast<SwDropDownField*>(pTmpField.get())->SetItems(aEntries);
static_cast<SwDropDownField*>(pTmpField.get())->SetName(rPar1);
bSetPar1 = bSetPar2 = false;
@@ -1654,9 +1655,9 @@ void SwFieldMgr::UpdateCurField(sal_uInt32 nFormat,
SwAuthorityField* pAuthorityField = static_cast<SwAuthorityField*>(pTmpField.get());
SwAuthorityFieldType* pAuthorityType = static_cast<SwAuthorityFieldType*>(pType);
rtl::Reference<SwAuthEntry> xTempEntry(new SwAuthEntry);
- for( sal_uInt16 i = 0; i < AUTH_FIELD_END; ++i )
+ for( sal_Int32 i = 0, nIdx = 0; i < AUTH_FIELD_END; ++i )
xTempEntry->SetAuthorField( static_cast<ToxAuthorityField>(i),
- rPar1.getToken( i, TOX_STYLE_DELIMITER ));
+ rPar1.getToken( 0, TOX_STYLE_DELIMITER, nIdx ));
if( pAuthorityType->ChangeEntryContent( xTempEntry.get() ) )
{
pType->UpdateFields();
More information about the Libreoffice-commits
mailing list