diff options
author | Jan-Marek Glogowski <glogow@fbihome.de> | 2020-12-22 18:59:43 +0100 |
---|---|---|
committer | Jan-Marek Glogowski <glogow@fbihome.de> | 2020-12-23 11:44:47 +0100 |
commit | 2e0b757e62536281f61b8d37987378646a246fcb (patch) | |
tree | 3ddd351e9080919820c17215d08834e5ec1a69cf /cui | |
parent | 86f3fa919a6de6767177193d5b7714f8f6dbd5c4 (diff) |
Rename sorted_vector::erase(size_t) to erase_at
emscripten clang fails with:
sc/source/core/data/attarray.cxx:378:44: \
error: call to member function 'erase' is ambiguous
aNewCondFormatData.erase(nIndex);
~~~~~~~~~~~~~~~~~~~^~~~~
include/o3tl/sorted_vector.hxx:86:15: note: candidate function
size_type erase( const Value& x )
^
include/o3tl/sorted_vector.hxx:97:10: note: candidate function
void erase( size_t index )
This looks like a compiler error, but if the vector contained
size_t values, this would also be ambiguous to begin with. So
this just renames erase(size_t) to erase_at.
And instead of a 2nd find in the failing code, after copying
the vector, it mow uses std::distance to remove the item.
Change-Id: I7d03ff32352a1890cc01ca241452c0f00d6a9302
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108212
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/tabpages/autocdlg.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/cui/source/tabpages/autocdlg.cxx b/cui/source/tabpages/autocdlg.cxx index 9b5ff2e30418..380d61123330 100644 --- a/cui/source/tabpages/autocdlg.cxx +++ b/cui/source/tabpages/autocdlg.cxx @@ -1270,7 +1270,7 @@ bool OfaAutocorrExceptPage::FillItemSet( SfxItemSet* ) if( !lcl_FindInArray(rArrays.aDoubleCapsStrings, aString)) { - pWrdList->erase(i); + pWrdList->erase_at(i); } } @@ -1292,7 +1292,7 @@ bool OfaAutocorrExceptPage::FillItemSet( SfxItemSet* ) OUString aString = (*pCplList)[ --i ]; if( !lcl_FindInArray(rArrays.aAbbrevStrings, aString)) { - pCplList->erase(i); + pCplList->erase_at(i); } } @@ -1318,7 +1318,7 @@ bool OfaAutocorrExceptPage::FillItemSet( SfxItemSet* ) OUString aString = (*pWrdList)[ --i ]; if (m_xDoubleCapsLB->find_text(aString) == -1) { - pWrdList->erase(i); + pWrdList->erase_at(i); } } nCount = m_xDoubleCapsLB->n_children(); @@ -1339,7 +1339,7 @@ bool OfaAutocorrExceptPage::FillItemSet( SfxItemSet* ) OUString aString = (*pCplList)[ --i ]; if (m_xAbbrevLB->find_text(aString) == -1) { - pCplList->erase(i); + pCplList->erase_at(i); } } sal_Int32 nAbbrevCount = m_xAbbrevLB->n_children(); |