summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2024-03-08 13:14:09 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2024-03-08 17:56:46 +0100
commit02f88f45e681beacf611f7c20f7903916b7e7374 (patch)
tree416d99bb0ee4e0d8056d048b44de664d296c227d /include
parent5cd557a512551ae5033957e22ea5c5f285518be3 (diff)
tdf#158773 reduce cost of stylesheet lookup
we can store pointers styleSheetsByFamily and avoid having to access the vector Change-Id: I36b5df981b6e53d9aa4193de419fc6a44f0ed2da Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164573 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include')
-rw-r--r--include/svl/IndexedStyleSheets.hxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/svl/IndexedStyleSheets.hxx b/include/svl/IndexedStyleSheets.hxx
index 3ca69f1c76d5..1a76604bd972 100644
--- a/include/svl/IndexedStyleSheets.hxx
+++ b/include/svl/IndexedStyleSheets.hxx
@@ -153,11 +153,11 @@ public:
/** Get the positions of the style sheets which belong to a certain family.
*/
- const std::vector<sal_Int32>& GetStyleSheetPositionsByFamily(SfxStyleFamily) const;
+ const std::vector<SfxStyleSheetBase*>& GetStyleSheetsByFamily(SfxStyleFamily) const;
private:
/** Register the position of a styleName in the index */
- void Register(const SfxStyleSheetBase& style, sal_Int32 pos);
+ void Register(SfxStyleSheetBase& style, sal_Int32 pos);
typedef std::vector<rtl::Reference<SfxStyleSheetBase>> VectorType;
/** Vector with the stylesheets to allow for index-based access.
@@ -175,7 +175,7 @@ private:
static constexpr size_t NUMBER_OF_FAMILIES = 7;
- std::array<std::vector<sal_Int32>, NUMBER_OF_FAMILIES> mStyleSheetPositionsByFamily;
+ std::array<std::vector<SfxStyleSheetBase*>, NUMBER_OF_FAMILIES> mStyleSheetsByFamily;
};
} /* namespace svl */