summaryrefslogtreecommitdiff
path: root/svl/source
diff options
context:
space:
mode:
authorArmin Le Grand (allotropia) <armin.le.grand.extern@allotropia.de>2024-02-12 17:44:15 +0100
committerArmin Le Grand <Armin.Le.Grand@me.com>2024-02-13 16:54:34 +0100
commit625fa07d3399eb85d8f4bf4bf9ae1d11532b477c (patch)
tree3dfb4aef003fcd1881946c42610067561df8e685 /svl/source
parentac2949ddaf78a95ab53d5d5f862b791d2c2d4312 (diff)
ITEM: corrected error for SfxSetItem
Secured usage of FontList in SvxFontListItem usage (a test) Change-Id: I412a7681b3ece4e5d3751165d4b566ccdf5b2da9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163257 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
Diffstat (limited to 'svl/source')
-rw-r--r--svl/source/items/itemset.cxx13
1 files changed, 6 insertions, 7 deletions
diff --git a/svl/source/items/itemset.cxx b/svl/source/items/itemset.cxx
index b01b0d54519e..05ba5672a02c 100644
--- a/svl/source/items/itemset.cxx
+++ b/svl/source/items/itemset.cxx
@@ -499,13 +499,12 @@ SfxPoolItem const* implCreateItemEntry(SfxItemPool& rPool, SfxPoolItem const* pS
// static default Items can just be used without RefCounting
return pSource;
- if (pSource->isDynamicDefault() && !pSource->isSetItem())
- {
- // dynamic default Items can only be used without RefCounting
- // when same pool, else it has to be cloned (below)
- if (static_cast<const SfxSetItem*>(pSource)->GetItemSet().GetPool() == &rPool)
- return pSource;
- }
+ if (pSource->isDynamicDefault()
+ && pSource->isSetItem()
+ && static_cast<const SfxSetItem*>(pSource)->GetItemSet().GetPool() == &rPool)
+ // only use without RefCounting when SfxSetItem and the Pool is correct.
+ // all other cases just clone (as before)
+ return pSource;
if (0 == pSource->Which())
{