From efdf57aa44bd22a799d76ec67c805bc5c2d91678 Mon Sep 17 00:00:00 2001 From: Eike Rathke Date: Mon, 6 Nov 2017 19:39:26 +0100 Subject: ofz#4052 limit listener range to actually available sheets ... instead of an arbitrary reference range read from a binary file format, here 4k sheets resulting in >3GB allocated listener memory. Change-Id: I629297f4249fdf16a0ede098b63d9648fda69ac3 --- sc/inc/document.hxx | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'sc/inc') diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index a2a073a68ab2..31c5e2f4957a 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -2046,6 +2046,24 @@ private: static ScRecursionHelper* CreateRecursionHelperInstance(); + /** Adjust a range to available sheets. + + Used to start and stop listening on a sane range. Both o_rRange and + o_bEntirelyOutOfBounds are set only if needed and don't have to be + initialized by the caller. + + @param o_bEntirelyOutOfBounds + if both sheets in the range point outside the + available sheet range, in which case no adjustment is done and + o_rRange is not modified. + + @return if any adjustment was done or o_bEntirelyOutOfBounds + was set . + if rRange was within the available sheets. + */ + bool LimitRangeToAvailableSheets( const ScRange& rRange, ScRange& o_rRange, + bool& o_bEntirelyOutOfBounds ) const; + public: void StartListeningArea( const ScRange& rRange, bool bGroupListening, SvtListener* pListener ); -- cgit