summaryrefslogtreecommitdiff
path: root/linguistic/source/misc2.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2016-02-23 19:41:53 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-04-01 07:33:32 +0000
commit46b4634de93bdda2a8427c6c545dc6160d5201d0 (patch)
tree4c6245229f65d9a96bbc7f098767b392e86629ae /linguistic/source/misc2.cxx
parent9f6e6fabcd5718e0b65437c5ce398e520f47aae1 (diff)
sequence->vector in linguistic
Change-Id: I28ed0b4bb2a140493fca693807011b91b3569986 Reviewed-on: https://gerrit.libreoffice.org/23695 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'linguistic/source/misc2.cxx')
-rw-r--r--linguistic/source/misc2.cxx21
1 files changed, 10 insertions, 11 deletions
diff --git a/linguistic/source/misc2.cxx b/linguistic/source/misc2.cxx
index c5f6a1f24ab2..bf99fdcb3c69 100644
--- a/linguistic/source/misc2.cxx
+++ b/linguistic/source/misc2.cxx
@@ -74,11 +74,11 @@ bool FileExists( const OUString &rMainURL )
return bExists;
}
-static uno::Sequence< OUString > GetMultiPaths_Impl(
+static std::vector< OUString > GetMultiPaths_Impl(
const OUString &rPathPrefix,
DictionaryPathFlags nPathFlags )
{
- uno::Sequence< OUString > aRes;
+ std::vector< OUString > aRes;
uno::Sequence< OUString > aInternalPaths;
uno::Sequence< OUString > aUserPaths;
OUString aWritablePath;
@@ -110,11 +110,10 @@ static uno::Sequence< OUString > GetMultiPaths_Impl(
sal_Int32 nMaxEntries = aInternalPaths.getLength() + aUserPaths.getLength();
if (!aWritablePath.isEmpty())
++nMaxEntries;
- aRes.realloc( nMaxEntries );
- OUString *pRes = aRes.getArray();
+ aRes.resize( nMaxEntries );
sal_Int32 nCount = 0; // number of actually added entries
if ((nPathFlags & DictionaryPathFlags::WRITABLE) && !aWritablePath.isEmpty())
- pRes[ nCount++ ] = aWritablePath;
+ aRes[ nCount++ ] = aWritablePath;
for (int i = 0; i < 2; ++i)
{
const uno::Sequence< OUString > &rPathSeq = i == 0 ? aUserPaths : aInternalPaths;
@@ -124,10 +123,10 @@ static uno::Sequence< OUString > GetMultiPaths_Impl(
const bool bAddUser = &rPathSeq == &aUserPaths && (nPathFlags & DictionaryPathFlags::USER);
const bool bAddInternal = &rPathSeq == &aInternalPaths && (nPathFlags & DictionaryPathFlags::INTERNAL);
if ((bAddUser || bAddInternal) && !pPathSeq[k].isEmpty())
- pRes[ nCount++ ] = pPathSeq[k];
+ aRes[ nCount++ ] = pPathSeq[k];
}
}
- aRes.realloc( nCount );
+ aRes.resize( nCount );
}
return aRes;
@@ -135,15 +134,15 @@ static uno::Sequence< OUString > GetMultiPaths_Impl(
OUString GetDictionaryWriteablePath()
{
- uno::Sequence< OUString > aPaths( GetMultiPaths_Impl( "Dictionary", DictionaryPathFlags::WRITABLE ) );
- DBG_ASSERT( aPaths.getLength() == 1, "Dictionary_writable path corrupted?" );
+ std::vector< OUString > aPaths( GetMultiPaths_Impl( "Dictionary", DictionaryPathFlags::WRITABLE ) );
+ DBG_ASSERT( aPaths.size() == 1, "Dictionary_writable path corrupted?" );
OUString aRes;
- if (aPaths.getLength() > 0)
+ if (aPaths.size() > 0)
aRes = aPaths[0];
return aRes;
}
-uno::Sequence< OUString > GetDictionaryPaths()
+std::vector< OUString > GetDictionaryPaths()
{
return GetMultiPaths_Impl( "Dictionary", PATH_FLAG_ALL );
}