summaryrefslogtreecommitdiffstats
path: root/cui
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-12-02 15:03:01 +0000
committerCaolán McNamara <caolanm@redhat.com>2020-12-02 21:06:24 +0100
commit62c0d42e179476da5fcad02722a9d3c6f83ef258 (patch)
treee9adfabdfb96b419bf62c2255276a1529fad2578 /cui
parenttdf#128501: DOC export: fix lost bitmap fill for OOXML custom shapes (diff)
downloadcore-62c0d42e179476da5fcad02722a9d3c6f83ef258.tar.gz
core-62c0d42e179476da5fcad02722a9d3c6f83ef258.zip
tdf#138596 don't destroy SfxItemSet that are still in use
update the existing ones instead Change-Id: I67fd6c4ecb5d4294efae0262d558281e6840b5dd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107031 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'cui')
-rw-r--r--cui/source/options/treeopt.cxx15
1 files changed, 10 insertions, 5 deletions
diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx
index 6e822e974c5e..3c8fcdadeff1 100644
--- a/cui/source/options/treeopt.cxx
+++ b/cui/source/options/treeopt.cxx
@@ -724,13 +724,18 @@ IMPL_LINK(OfaTreeOptionsDialog, ApplyHdl_Impl, weld::Button&, rButton, void)
m_xDialog->response(RET_OK);
else
{
- // tdf#137930 rebuild the in and out itemsets
- // to reflect the current post-apply state
+ // tdf#137930 rebuild the in and out itemsets to reflect the current
+ // post-apply state
if (pGroupInfo && pGroupInfo->m_pInItemSet)
{
- pGroupInfo->m_pInItemSet.reset();
- pGroupInfo->m_pOutItemSet.reset();
- InitItemSets(*pGroupInfo);
+ // tdf#138596 seeing as the SfxTabPages keep pointers to the m_pInItemSet
+ // we update the contents of the existing SfxItemSets to match
+ // the current settings, rather than create new ones
+ auto xInItemSet = pGroupInfo->m_pShell
+ ? pGroupInfo->m_pShell->CreateItemSet( pGroupInfo->m_nDialogId )
+ : CreateItemSet( pGroupInfo->m_nDialogId );
+ pGroupInfo->m_pInItemSet->Set(*xInItemSet, false);
+ pGroupInfo->m_pOutItemSet->ClearItem();
}
// for the Apply case, now that the settings are saved to config,