[Libreoffice-commits] core.git: sc/source
Noel Grandin
noelgrandin at gmail.com
Fri Apr 1 13:15:59 UTC 2016
sc/source/filter/xml/XMLCodeNameProvider.cxx | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
New commits:
commit 9a14c7e1a99b4559fd5035b055f041dac7f48522
Author: Noel Grandin <noelgrandin at 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 <ci at libreoffice.org>
Reviewed-by: Eike Rathke <erack at redhat.com>
Tested-by: Eike Rathke <erack at 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( )
More information about the Libreoffice-commits
mailing list