summaryrefslogtreecommitdiff
path: root/basic
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2019-12-06 12:25:15 +0200
committerMike Kaganski <mike.kaganski@collabora.com>2019-12-09 10:46:53 +0100
commit87b421d25ef79e197d344e6bd515f1eadd06bfc9 (patch)
tree2056428bd8f09a049c40c334fb0677e09c0429c8 /basic
parent79465546b7fe9af5efc320bfbef8d032042063c0 (diff)
tdf#129227: this was always appending, not prepending
Regression after 0761f97525b3f3ce2cd73f8db28bf389a3c44f57 The change replaced // From 1996-03-06: take the HandleLast-Flag into account sal_uInt16 nPos = r.m_Factories.size(); // Insert position if( !pFac->IsHandleLast() ) // Only if not self HandleLast { // Rank new factory in front of factories with HandleLast while (nPos > 0 && r.m_Factories[ nPos-1 ]->IsHandleLast()) nPos--; } r.m_Factories.insert(r.m_Factories.begin() + nPos, std::unique_ptr<SbxFactory>(pFac)); with r.m_Factories.insert(r.m_Factories.begin(), std::unique_ptr<SbxFactory>(pFac)); Before that commit condition in while was always false, so decrementing nPos had never happened, and insertion to the end was always performed. This change restores that. Change-Id: I778d6fdc93e9078a541a9b98c9432b5cf88d9791 Reviewed-on: https://gerrit.libreoffice.org/84609 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Mike Kaganski <mike.kaganski@collabora.com> (cherry picked from commit ffd319a7589e0e9fcb83681f7f1e7c26a383ae5d) Reviewed-on: https://gerrit.libreoffice.org/84666 Tested-by: Jenkins
Diffstat (limited to 'basic')
-rw-r--r--basic/source/sbx/sbxbase.cxx4
1 files changed, 1 insertions, 3 deletions
diff --git a/basic/source/sbx/sbxbase.cxx b/basic/source/sbx/sbxbase.cxx
index 7f147e81e27f..d1b17d4fa288 100644
--- a/basic/source/sbx/sbxbase.cxx
+++ b/basic/source/sbx/sbxbase.cxx
@@ -114,9 +114,7 @@ void SbxBase::ResetError()
void SbxBase::AddFactory( SbxFactory* pFac )
{
- SbxAppData& r = GetSbxData_Impl();
-
- r.m_Factories.insert(r.m_Factories.begin(), std::unique_ptr<SbxFactory>(pFac));
+ GetSbxData_Impl().m_Factories.emplace_back(pFac);
}
void SbxBase::RemoveFactory( SbxFactory const * pFac )