From 16e417b8c211a919a921baeb65660185aac38393 Mon Sep 17 00:00:00 2001 From: Luboš Luňák Date: Tue, 18 Sep 2018 15:01:29 +0200 Subject: add ScTokenArray::Finalize() to explicitly reduce memory usage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since ScTokenArray::Add() overallocates memory, make sure we do not keep such possibly large arrays. Since any copying of ScTokenArray implicitly finalizes as well, this is not a big problem right now, but then why needlessly do the copies? (next commit) Change-Id: I55398bcd8fb31f1be5a4b8e3f5a71b26649a7594 Reviewed-on: https://gerrit.libreoffice.org/60862 Tested-by: Jenkins Reviewed-by: Luboš Luňák --- include/formula/tokenarray.hxx | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include/formula') diff --git a/include/formula/tokenarray.hxx b/include/formula/tokenarray.hxx index 2c422d94faf8..2891601b2626 100644 --- a/include/formula/tokenarray.hxx +++ b/include/formula/tokenarray.hxx @@ -291,6 +291,11 @@ public: virtual void Clear(); + /** + * The array has its final used size and no more token can be added. + */ + void Finalize(); + void SetFromRangeName( bool b ) { mbFromRangeName = b; } bool IsFromRangeName() const { return mbFromRangeName; } -- cgit