summaryrefslogtreecommitdiff
path: root/linguistic/source/spelldsp.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'linguistic/source/spelldsp.cxx')
-rw-r--r--linguistic/source/spelldsp.cxx22
1 files changed, 11 insertions, 11 deletions
diff --git a/linguistic/source/spelldsp.cxx b/linguistic/source/spelldsp.cxx
index 26010a1e8406..e1d86ba74ac9 100644
--- a/linguistic/source/spelldsp.cxx
+++ b/linguistic/source/spelldsp.cxx
@@ -28,6 +28,7 @@
#include <cppuhelper/factory.hxx>
#include <unotools/localedatawrapper.hxx>
#include <comphelper/processfactory.hxx>
+#include <comphelper/sequence.hxx>
#include <tools/debug.hxx>
#include <svl/lngmisc.hxx>
#include <osl/mutex.hxx>
@@ -49,7 +50,7 @@ using namespace linguistic;
// ProposalList: list of proposals for misspelled words
-// The order of strings in the array should be left unchanged because the
+// The order of strings in the array should be left unchanged because the
// spellchecker should have put the more likely suggestions at the top.
// New entries will be added to the end but duplicates are to be avoided.
// Removing entries is done by assigning the empty string.
@@ -69,7 +70,7 @@ public:
void Append( const OUString &rNew );
void Append( const std::vector< OUString > &rNew );
void Append( const Sequence< OUString > &rNew );
- Sequence< OUString > GetSequence() const;
+ std::vector< OUString > GetVector() const;
};
@@ -134,19 +135,18 @@ size_t ProposalList::Count() const
return nRes;
}
-Sequence< OUString > ProposalList::GetSequence() const
+std::vector< OUString > ProposalList::GetVector() const
{
sal_Int32 nCount = Count();
sal_Int32 nIdx = 0;
- Sequence< OUString > aRes( nCount );
- OUString *pRes = aRes.getArray();
+ std::vector< OUString > aRes( nCount );
sal_Int32 nLen = aVec.size();
for (sal_Int32 i = 0; i < nLen; ++i)
{
const OUString &rText = aVec[i];
- DBG_ASSERT( nIdx < nCount, "index our of range" );
+ DBG_ASSERT( nIdx < nCount, "index out of range" );
if (nIdx < nCount && !rText.isEmpty())
- pRes[ nIdx++ ] = rText;
+ aRes[ nIdx++ ] = rText;
}
return aRes;
}
@@ -715,7 +715,7 @@ Reference< XSpellAlternatives > SpellCheckerDispatcher::spell_Impl(
std::vector< OUString > aDicListProps; // list of proposals from user-dictionaries
SearchSimilarText( aChkWord, nLanguage, xDList, aDicListProps );
aProposalList.Append( aDicListProps );
- Sequence< OUString > aProposals = aProposalList.GetSequence();
+ std::vector< OUString > aProposals = aProposalList.GetVector();
// remove entries listed in negative dictionaries
// (we don't want to display suggestions that will be regarded as misspelled later on)
@@ -725,7 +725,7 @@ Reference< XSpellAlternatives > SpellCheckerDispatcher::spell_Impl(
uno::Reference< linguistic2::XSetSpellAlternatives > xSetAlt( xRes, uno::UNO_QUERY );
if (xSetAlt.is())
{
- xSetAlt->setAlternatives( aProposals );
+ xSetAlt->setAlternatives( comphelper::containerToSequence(aProposals) );
xSetAlt->setFailureType( eFailureType );
}
else
@@ -734,12 +734,12 @@ Reference< XSpellAlternatives > SpellCheckerDispatcher::spell_Impl(
{
DBG_ASSERT( false, "XSetSpellAlternatives not implemented!" );
}
- else if (aProposals.getLength() > 0)
+ else if (!aProposals.empty())
{
// no xRes but Proposals found from the user-dictionaries.
// Thus we need to create an xRes...
xRes = new linguistic::SpellAlternatives( rWord, nLanguage,
- SpellFailure::IS_NEGATIVE_WORD, aProposals );
+ SpellFailure::IS_NEGATIVE_WORD, comphelper::containerToSequence(aProposals) );
}
}
}