From ea55492a6e55290d92a59324b3cb31ed958981ab Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Sun, 26 Nov 2017 23:28:05 +0200 Subject: Deduplicate conditional formats loaded from .ods If there are several separate conditional format elements that can be represented as just one (with several ranges), try to do that. A particular customer document used to take 3 minutes 20 seconds to load, and it contained so many (tens of thousands) conditional formats that the Format> Conditional Formatting> Manage... dialog was practically impossible to use. Now loading that document takes 15 seconds and there are just a handful of separate conditional formats. Also add a simple unit test to verify the deduplication. Change-Id: I7c468af99956d4646ee5507390f1476caff52325 Reviewed-on: https://gerrit.libreoffice.org/45460 Tested-by: Jenkins Reviewed-by: Tor Lillqvist --- sc/inc/conditio.hxx | 3 +++ 1 file changed, 3 insertions(+) (limited to 'sc/inc/conditio.hxx') diff --git a/sc/inc/conditio.hxx b/sc/inc/conditio.hxx index dede939a9185..93481f202236 100644 --- a/sc/inc/conditio.hxx +++ b/sc/inc/conditio.hxx @@ -352,6 +352,8 @@ public: bool operator== ( const ScConditionEntry& r ) const; + bool EqualIgnoringSrcPos( const ScConditionEntry& r ) const; + virtual void SetParent( ScConditionalFormat* pNew ) override; bool IsCellValid( ScRefCellValue& rCell, const ScAddress& rPos ) const; @@ -360,6 +362,7 @@ public: void SetOperation(ScConditionMode eMode); bool IsIgnoreBlank() const { return ( nOptions & SC_COND_NOBLANKS ) == 0; } void SetIgnoreBlank(bool bSet); + OUString GetSrcString() const { return aSrcString; } const ScAddress& GetSrcPos() const { return aSrcPos; } ScAddress GetValidSrcPos() const; // adjusted to allow textual representation of expressions -- cgit