From ba6ab05a2a1ecd557302e238e1890b5e631c28b7 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 11 Aug 2020 13:58:24 +0100 Subject: tdf#134604 library created in the wrong tree MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Iee526422a18aef8ef25289041b26ff1e4a6b39b3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100494 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- basctl/source/basicide/bastype2.cxx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'basctl/source') diff --git a/basctl/source/basicide/bastype2.cxx b/basctl/source/basicide/bastype2.cxx index 23c4d8cc411e..32c190203f8c 100644 --- a/basctl/source/basicide/bastype2.cxx +++ b/basctl/source/basicide/bastype2.cxx @@ -652,11 +652,12 @@ void SbTreeListBox::AddEntry( m_xControl->freeze(); m_bFreezeOnFirstAddRemove= false; } + std::unique_ptr xScratch = pRet ? nullptr : m_xControl->make_iterator(); + if (!pRet) + pRet = xScratch.get(); OUString sId(OUString::number(reinterpret_cast(rUserData.release()))); - m_xControl->insert(pParent, -1, &rText, &sId, nullptr, nullptr, bChildrenOnDemand, m_xScratchIter.get()); - m_xControl->set_image(*m_xScratchIter, rImage); - if (pRet) - m_xControl->copy_iterator(*m_xScratchIter, *pRet); + m_xControl->insert(pParent, -1, &rText, &sId, nullptr, nullptr, bChildrenOnDemand, pRet); + m_xControl->set_image(*pRet, rImage); } void SbTreeListBox::SetEntryBitmaps(const weld::TreeIter& rIter, const OUString& rImage) -- cgit