sw/source/core/unocore/unofield.cxx | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-)
New commits: commit a3d10e95d24d9199de60b05e2ce4207f57988021 Author: Matteo Casalin <matteo.casa...@yahoo.com> Date: Sun Aug 25 01:50:22 2013 +0200 vector<OUString*> to vector<OUString> as a temporary Change-Id: Ib615c88c0ca9c0a3d969860249e96cb71b75f6f7 Reviewed-on: https://gerrit.libreoffice.org/5623 Reviewed-by: Michael Stahl <mst...@redhat.com> Tested-by: Michael Stahl <mst...@redhat.com> diff --git a/sw/source/core/unocore/unofield.cxx b/sw/source/core/unocore/unofield.cxx index db9e2a3..57cb5bc 100644 --- a/sw/source/core/unocore/unofield.cxx +++ b/sw/source/core/unocore/unofield.cxx @@ -2700,29 +2700,25 @@ uno::Sequence< OUString > SwXTextFieldMasters::getElementNames(void) throw uno::RuntimeException(); const SwFldTypes* pFldTypes = GetDoc()->GetFldTypes(); - sal_uInt16 nCount = pFldTypes->size(); - - std::vector<OUString*> aFldNames; - OUString* pString = new OUString(); + const size_t nCount = pFldTypes->size(); - for( sal_uInt16 i = 0; i < nCount; i++) + std::vector<OUString> aFldNames; + for( size_t i = 0; i < nCount; ++i ) { SwFieldType& rFldType = *((*pFldTypes)[i]); - if (SwXTextFieldMasters::getInstanceName(rFldType, *pString)) + OUString sFldName; + if (SwXTextFieldMasters::getInstanceName(rFldType, sFldName)) { - aFldNames.push_back(pString); - pString = new OUString(); + aFldNames.push_back(sFldName); } } - delete pString; - uno::Sequence< OUString > aSeq( static_cast<sal_uInt16>(aFldNames.size()) ); + uno::Sequence< OUString > aSeq( static_cast<sal_Int32>(aFldNames.size()) ); OUString* pArray = aSeq.getArray(); - for(sal_uInt16 i = 0; i < aFldNames.size();i++) + for (size_t i = 0; i<aFldNames.size(); ++i) { - pArray[i] = *aFldNames[i]; - delete aFldNames[i]; + pArray[i] = aFldNames[i]; } return aSeq; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits