summaryrefslogtreecommitdiff
path: root/sfx2/source/explorer
diff options
context:
space:
mode:
authorArmin Le Grand (allotropia) <armin.le.grand.extern@allotropia.de>2024-02-19 14:50:37 +0100
committerArmin Le Grand <Armin.Le.Grand@me.com>2024-02-19 20:04:34 +0100
commit9bd2012df77da01b9ee30b25698237fb45673f49 (patch)
treec2f6b38b9b275f5a25092f58f96d8bccd16553be /sfx2/source/explorer
parentca935d5a016f5527422058f23c1bf3cb2917fb0f (diff)
ITEM: Speedup SlotIDToWhichID translations
With ItemInfoPackages we now can have a buffered, static global translation table from SlotIDs to WhichIDs since the ItemInfoStatic used already contains all the needed information. Register that in registerItemInfoPackage at the Pool and use it for lookup. That speeds up the lookup from O(n) to O(1). Since that lookup is used in UI and UNO API implementations this has positive effect on load/safe, but also all interactive stuff in the whole office. NOTE: I tried to use a merged version of that translation table in the parent pool, but this shows double SlotIDs, what is no wonder since that's what those are used for: To get different WhichIDs for a SlotID in Item handling. This *might* prevent getting rid of the chanined Pools at all - sadly. The returned WhichID directly depends on which Pool the function(s) GetWhichIDFromSlotID and GetTrueWhichIDFromSlotID are called. NOTE: Very strange is that the parameter 'bDeep' in that functions is *not* passed down to the call to the secondary Pool - probably an error, but risky to fix, that may change already the behaviour :-( Change-Id: Iea77ffad0f6a5401ab74fea0bbfc2589c66680ea Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163597 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
Diffstat (limited to 'sfx2/source/explorer')
-rw-r--r--sfx2/source/explorer/nochaos.cxx2
1 files changed, 2 insertions, 0 deletions
diff --git a/sfx2/source/explorer/nochaos.cxx b/sfx2/source/explorer/nochaos.cxx
index 3fb582a3d43d..ebed6cc8e17e 100644
--- a/sfx2/source/explorer/nochaos.cxx
+++ b/sfx2/source/explorer/nochaos.cxx
@@ -73,6 +73,8 @@ static ItemInfoPackage& getItemInfoPackageNoChaos()
{ WID_CHAOS_START, new SfxStringItem(WID_CHAOS_START, OUString()), 0, SFX_ITEMINFOFLAG_NONE }
}};
+ virtual const ItemInfoStatic& getItemInfoStatic(size_t nIndex) const override { return maItemInfos[nIndex]; }
+
public:
virtual size_t size() const override { return maItemInfos.size(); }
virtual const ItemInfo& getItemInfo(size_t nIndex, SfxItemPool& /*rPool*/) override { return maItemInfos[nIndex]; }