[Libreoffice-commits] core.git: svl/source

Noel Grandin noel.grandin at collabora.co.uk
Fri May 18 18:02:21 UTC 2018


 svl/source/items/itemset.cxx |    6 ++++++
 1 file changed, 6 insertions(+)

New commits:
commit 9e60d29be40dfcc66604cb642e699d4febf032dc
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Fri May 18 10:53:26 2018 +0200

    tdf#117539 Crash after cut and paste operation of a chart stick
    
    regression from
       commit 3d44b720f58366398e7f59c00dba6339712a670f
       loplugin:useuniqueptr in SfxItemPool_Impl
    where I accidentally removed some fallback code.
    
    Note that this does not fix the underlying bug where some pool is not
    correctly set up.
    
    Also, this only fixes the bug that I introduced in the above commit,
    another bug in the same area has subsequently been introduced, causing
    a crash in a different area when performing this operation.
    
    Change-Id: Iaae3b0dc82c740b498e3735273820647ef28fd01
    Reviewed-on: https://gerrit.libreoffice.org/54522
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/svl/source/items/itemset.cxx b/svl/source/items/itemset.cxx
index e967089e17ee..0be3d7105525 100644
--- a/svl/source/items/itemset.cxx
+++ b/svl/source/items/itemset.cxx
@@ -94,6 +94,12 @@ SfxItemSet::SfxItemSet(SfxItemPool& rPool)
 {
     m_pWhichRanges = const_cast<sal_uInt16*>(m_pPool->GetFrozenIdRanges());
     assert( m_pWhichRanges && "don't create ItemSets with full range before FreezeIdRanges()" );
+    if (!m_pWhichRanges)
+    {
+        std::unique_ptr<sal_uInt16[]> tmp;
+        m_pPool->FillItemIdRanges_Impl(tmp);
+        m_pWhichRanges = tmp.release();
+    }
 
     const sal_uInt16 nSize = TotalCount();
     m_pItems.reset(new const SfxPoolItem*[nSize]{});


More information about the Libreoffice-commits mailing list