diff options
author | Noel Grandin <noel@peralex.com> | 2021-04-14 12:51:59 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-04-14 17:04:52 +0200 |
commit | 306f6934ac6f0b012eaecd05bb4abb7c9d341993 (patch) | |
tree | 9ab9b1d067b9ba3074fee1e32d065c4e407fd6f6 /oox/inc | |
parent | 869acd8315af695ff79594fc6a498abb8371103a (diff) |
reduce allocation in TextListStyle
Change-Id: Id1bad0bf39b03bc6d4004c50c0f35b60d6753aa8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114084
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'oox/inc')
-rw-r--r-- | oox/inc/drawingml/textbody.hxx | 1 | ||||
-rw-r--r-- | oox/inc/drawingml/textliststyle.hxx | 19 | ||||
-rw-r--r-- | oox/inc/drawingml/textparagraph.hxx | 1 |
3 files changed, 13 insertions, 8 deletions
diff --git a/oox/inc/drawingml/textbody.hxx b/oox/inc/drawingml/textbody.hxx index 5e6d156e7ce4..093642f30d97 100644 --- a/oox/inc/drawingml/textbody.hxx +++ b/oox/inc/drawingml/textbody.hxx @@ -24,6 +24,7 @@ #include <drawingml/textbodyproperties.hxx> #include <drawingml/textliststyle.hxx> #include <drawingml/shape3dproperties.hxx> +#include <oox/helper/refvector.hxx> namespace com::sun::star::text { class XText; diff --git a/oox/inc/drawingml/textliststyle.hxx b/oox/inc/drawingml/textliststyle.hxx index 52cb29330877..ac84cc9d903d 100644 --- a/oox/inc/drawingml/textliststyle.hxx +++ b/oox/inc/drawingml/textliststyle.hxx @@ -21,11 +21,14 @@ #define INCLUDED_OOX_DRAWINGML_TEXTLISTSTYLE_HXX #include <drawingml/textparagraphproperties.hxx> -#include <oox/helper/refvector.hxx> +#include <array> +#include <memory> namespace oox::drawingml { -typedef RefVector<TextParagraphProperties> TextParagraphPropertiesVector; +constexpr int NUM_TEXT_LIST_STYLE_ENTRIES = 9; +typedef std::array<std::shared_ptr<TextParagraphProperties>, NUM_TEXT_LIST_STYLE_ENTRIES> + TextParagraphPropertiesArray; class TextListStyle { @@ -38,22 +41,22 @@ public: void apply(const TextListStyle& rTextListStyle); - const TextParagraphPropertiesVector& getListStyle() const { return maListStyle; }; - TextParagraphPropertiesVector& getListStyle() { return maListStyle; }; + const TextParagraphPropertiesArray& getListStyle() const { return maListStyle; }; + TextParagraphPropertiesArray& getListStyle() { return maListStyle; }; - const TextParagraphPropertiesVector& getAggregationListStyle() const + const TextParagraphPropertiesArray& getAggregationListStyle() const { return maAggregationListStyle; }; - TextParagraphPropertiesVector& getAggregationListStyle() { return maAggregationListStyle; }; + TextParagraphPropertiesArray& getAggregationListStyle() { return maAggregationListStyle; }; #ifdef DBG_UTIL void dump() const; #endif private: - TextParagraphPropertiesVector maListStyle; - TextParagraphPropertiesVector maAggregationListStyle; + TextParagraphPropertiesArray maListStyle; + TextParagraphPropertiesArray maAggregationListStyle; }; } diff --git a/oox/inc/drawingml/textparagraph.hxx b/oox/inc/drawingml/textparagraph.hxx index 22465355142c..5139c51b9b26 100644 --- a/oox/inc/drawingml/textparagraph.hxx +++ b/oox/inc/drawingml/textparagraph.hxx @@ -25,6 +25,7 @@ #include <com/sun/star/text/XText.hpp> #include <oox/core/xmlfilterbase.hxx> +#include <oox/helper/refvector.hxx> #include <drawingml/textrun.hxx> #include <drawingml/textliststyle.hxx> #include <drawingml/textparagraphproperties.hxx> |