summaryrefslogtreecommitdiff
path: root/cui/source/dialogs/thesdlg.cxx
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2024-04-29 01:31:19 +0500
committerMike Kaganski <mike.kaganski@collabora.com>2024-04-29 23:15:40 +0200
commit00e2762c664614a1b33f54dfc990ba29f0f81a07 (patch)
tree976d1d94d6d1e52812e128a5dfbcb3540ef9a42b /cui/source/dialogs/thesdlg.cxx
parent8755c80018bec656e1b102da25edc450da4eee52 (diff)
Drop uses of css::uno::Sequence::getConstArray in cppuhelper .. cui
where it was obsoleted by commits 2484de6728bd11bb7949003d112f1ece2223c7a1 (Remove non-const Sequence::begin()/end() in internal code, 2021-10-15) and fb3c04bd1930eedacd406874e1a285d62bbf27d9 (Drop non-const Sequence::operator[] in internal code 2021-11-05). Change-Id: Ia2b60af973183bbe79656e67b5e37d7efa39a308 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166817 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'cui/source/dialogs/thesdlg.cxx')
-rw-r--r--cui/source/dialogs/thesdlg.cxx19
1 files changed, 7 insertions, 12 deletions
diff --git a/cui/source/dialogs/thesdlg.cxx b/cui/source/dialogs/thesdlg.cxx
index ea98a44a3c9e..f1795ddd684d 100644
--- a/cui/source/dialogs/thesdlg.cxx
+++ b/cui/source/dialogs/thesdlg.cxx
@@ -89,7 +89,6 @@ bool SvxThesaurusDialog::UpdateAlternativesBox_Impl()
uno::Sequence< uno::Reference< linguistic2::XMeaning > > aMeanings = queryMeanings_Impl(
aLookUpText, aLocale, uno::Sequence< beans::PropertyValue >() );
const sal_Int32 nMeanings = aMeanings.getLength();
- const uno::Reference< linguistic2::XMeaning > *pMeanings = aMeanings.getConstArray();
m_xAlternativesCT->freeze();
@@ -97,22 +96,20 @@ bool SvxThesaurusDialog::UpdateAlternativesBox_Impl()
int nRow = 0;
for (sal_Int32 i = 0; i < nMeanings; ++i)
{
- OUString rMeaningTxt = pMeanings[i]->getMeaning();
- uno::Sequence< OUString > aSynonyms( pMeanings[i]->querySynonyms() );
- const sal_Int32 nSynonyms = aSynonyms.getLength();
- const OUString *pSynonyms = aSynonyms.getConstArray();
+ OUString rMeaningTxt = aMeanings[i]->getMeaning();
+ uno::Sequence<OUString> aSynonyms(aMeanings[i]->querySynonyms());
DBG_ASSERT( !rMeaningTxt.isEmpty(), "meaning with empty text" );
- DBG_ASSERT( nSynonyms > 0, "meaning without synonym" );
+ DBG_ASSERT(aSynonyms.hasElements(), "meaning without synonym");
OUString sHeading = OUString::number(i + 1) + ". " + rMeaningTxt;
m_xAlternativesCT->append_text(sHeading);
m_xAlternativesCT->set_text_emphasis(nRow, true, 0);
++nRow;
- for (sal_Int32 k = 0; k < nSynonyms; ++k)
+ for (auto& synonym : aSynonyms)
{
// GetThesaurusReplaceText will strip the leading spaces
- m_xAlternativesCT->append_text(" " + pSynonyms[k]);
+ m_xAlternativesCT->append_text(" " + synonym);
m_xAlternativesCT->set_text_emphasis(nRow, false, 0);
++nRow;
}
@@ -287,13 +284,11 @@ SvxThesaurusDialog::SvxThesaurusDialog(
uno::Sequence< lang::Locale > aLocales;
if (xThesaurus.is())
aLocales = xThesaurus->getLocales();
- const sal_Int32 nLocales = aLocales.getLength();
- const lang::Locale *pLocales = aLocales.getConstArray();
m_xLangLB->clear();
std::vector< OUString > aLangVec;
- for (sal_Int32 i = 0; i < nLocales; ++i)
+ for (auto& locale : aLocales)
{
- const LanguageType nLang = LanguageTag::convertToLanguageType( pLocales[i] );
+ const LanguageType nLang = LanguageTag::convertToLanguageType(locale);
DBG_ASSERT( nLang != LANGUAGE_NONE && nLang != LANGUAGE_DONTKNOW, "failed to get language" );
aLangVec.push_back( SvtLanguageTable::GetLanguageString( nLang ) );
}