sc/source/filter/xml/XMLCodeNameProvider.cxx | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-)
New commits: commit 9a14c7e1a99b4559fd5035b055f041dac7f48522 Author: Noel Grandin <noelgran...@gmail.com> Date: Tue Mar 8 20:44:56 2016 +0200 sequence->vector in sc Change-Id: Iebf0aae6a3141430c43988e91d50f07b1c629e04 Reviewed-on: https://gerrit.libreoffice.org/23698 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Eike Rathke <er...@redhat.com> Tested-by: Eike Rathke <er...@redhat.com> diff --git a/sc/source/filter/xml/XMLCodeNameProvider.cxx b/sc/source/filter/xml/XMLCodeNameProvider.cxx index 7a0503f..0f053ee 100644 --- a/sc/source/filter/xml/XMLCodeNameProvider.cxx +++ b/sc/source/filter/xml/XMLCodeNameProvider.cxx @@ -19,6 +19,7 @@ #include "XMLCodeNameProvider.hxx" #include "document.hxx" +#include "comphelper/sequence.hxx" using namespace com::sun::star; @@ -112,11 +113,11 @@ uno::Sequence< OUString > SAL_CALL XMLCodeNameProvider::getElementNames( ) throw (uno::RuntimeException, std::exception) { SCTAB nCount = mpDoc->GetTableCount() + 1; - uno::Sequence< OUString > aNames( nCount ); - sal_Int32 nRealCount = 0; + std::vector< OUString > aNames; + aNames.reserve(nCount); if( !mpDoc->GetCodeName().isEmpty() ) - aNames[nRealCount++] = msDocName; + aNames.push_back(msDocName); OUString sSheetName, sCodeName; for( SCTAB i = 0; i < nCount; i++ ) @@ -125,14 +126,11 @@ uno::Sequence< OUString > SAL_CALL XMLCodeNameProvider::getElementNames( ) if (!sCodeName.isEmpty()) { if( mpDoc->GetName( i, sSheetName ) ) - aNames[nRealCount++] = sSheetName; + aNames.push_back(sSheetName); } } - if( nCount != nRealCount ) - aNames.realloc( nRealCount ); - - return aNames; + return comphelper::containerToSequence(aNames); } uno::Type SAL_CALL XMLCodeNameProvider::getElementType( ) _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits