summaryrefslogtreecommitdiff
path: root/sc/inc
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@suse.com>2011-09-06 20:52:37 -0400
committerKohei Yoshida <kohei.yoshida@suse.com>2011-09-06 23:48:12 -0400
commitcc2b19b992229af9d6bcfb5b43a545c418f8f9b5 (patch)
tree6ce334c4594a2d14f65bbbd1fdbbcb1a41874f28 /sc/inc
parent2207f9c75a3f0d92501a26d259d5d68853168ba8 (diff)
Improve performance of large Excel documents wrt cell style import.
This change improves import performance of Excel documents based on the following changes. 1) Pool styles only once per call. This removes SfxItemPoolCache instantiation and destruction which is quite expensive. This alone cuts import almost by half with large documents with lots of styles applied. 2) Skip removal of direct formats when setting style. The old code was iterating through all attribute regions in order to try to remove overlapping format attributes when applying a style. But that's strictly not necessary (and bad for performance) during import. This also removes the need to re-apply the direct formats right afterward. 3) Avoid creating a duplicate ScPatternAttr instance per XF. There is simply no need to create a clone of the style only to put it into the styles pool and get discarded. This saves additional few seconds.
Diffstat (limited to 'sc/inc')
-rw-r--r--sc/inc/patattr.hxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/sc/inc/patattr.hxx b/sc/inc/patattr.hxx
index dc58a8a6473a..78d1fd9c6c9d 100644
--- a/sc/inc/patattr.hxx
+++ b/sc/inc/patattr.hxx
@@ -121,7 +121,7 @@ public:
ScPatternAttr* PutInPool( ScDocument* pDestDoc, ScDocument* pSrcDoc ) const;
- void SetStyleSheet(ScStyleSheet* pNewStyle);
+ void SetStyleSheet(ScStyleSheet* pNewStyle, bool bClearDirectFormat = true);
const ScStyleSheet* GetStyleSheet() const { return pStyle; }
const String* GetStyleName() const;
void UpdateStyleSheet();