diff options
author | Noel Power <noel.power@suse.com> | 2013-05-27 11:30:20 +0100 |
---|---|---|
committer | Noel Power <noel.power@suse.com> | 2013-05-30 14:07:49 +0100 |
commit | faf99d003598c8d7527a635ec28514204ff5f948 (patch) | |
tree | ce232e4458ddb3a1e9d0261459dd978d1323be0e /sc | |
parent | 12f7468781011c9b40d8fa03004203c1f493e786 (diff) |
buffer conditional formatting finalization so it happens after styles import
Change-Id: If28059578280536141ea966d83e4540939f6e76b
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/filter/inc/condformatbuffer.hxx | 4 | ||||
-rw-r--r-- | sc/source/filter/oox/condformatbuffer.cxx | 14 | ||||
-rw-r--r-- | sc/source/filter/oox/condformatcontext.cxx | 2 | ||||
-rw-r--r-- | sc/source/filter/oox/worksheethelper.cxx | 1 |
4 files changed, 18 insertions, 3 deletions
diff --git a/sc/source/filter/inc/condformatbuffer.hxx b/sc/source/filter/inc/condformatbuffer.hxx index 25bae462410a..9a1ca7ddc6d7 100644 --- a/sc/source/filter/inc/condformatbuffer.hxx +++ b/sc/source/filter/inc/condformatbuffer.hxx @@ -217,6 +217,7 @@ public: /** Returns the cell ranges this conditional formatting belongs to. */ inline const ApiCellRangeList& getRanges() const { return maModel.maRanges; } + void setReadyForFinalize() { mbReadyForFinalize = true; } private: CondFormatRuleRef createRule(); void insertRule( CondFormatRuleRef xRule ); @@ -227,6 +228,7 @@ private: CondFormatModel maModel; /// Model of this conditional formatting. CondFormatRuleMap maRules; /// Maps formatting rules by priority. ScConditionalFormat* mpFormat; + bool mbReadyForFinalize; }; typedef ::boost::shared_ptr< CondFormat > CondFormatRef; @@ -246,7 +248,7 @@ public: /** Converts an OOXML condition operator token to the API constant. */ static sal_Int32 convertToApiOperator( sal_Int32 nToken ); static sal_Int32 convertToInternalOperator( sal_Int32 nToken ); - + void finalizeImport(); private: CondFormatRef createCondFormat(); diff --git a/sc/source/filter/oox/condformatbuffer.cxx b/sc/source/filter/oox/condformatbuffer.cxx index 604b97fbc4a1..7bb671dc033c 100644 --- a/sc/source/filter/oox/condformatbuffer.cxx +++ b/sc/source/filter/oox/condformatbuffer.cxx @@ -922,7 +922,8 @@ CondFormatModel::CondFormatModel() : CondFormat::CondFormat( const WorksheetHelper& rHelper ) : WorksheetHelper( rHelper ), - mpFormat(NULL) + mpFormat(NULL), + mbReadyForFinalize(false) { } @@ -1003,6 +1004,17 @@ CondFormatRef CondFormatBuffer::importConditionalFormatting( const AttributeList return xCondFmt; } +void CondFormatBuffer::finalizeImport() +{ + CondFormatVec::iterator it = maCondFormats.begin(); + CondFormatVec::iterator it_end = maCondFormats.end(); + for( ; it != it_end; ++it ) + { + if ( (*it).get() ) + (*it).get()->finalizeImport(); + } +} + CondFormatRef CondFormatBuffer::importCondFormatting( SequenceInputStream& rStrm ) { CondFormatRef xCondFmt = createCondFormat(); diff --git a/sc/source/filter/oox/condformatcontext.cxx b/sc/source/filter/oox/condformatcontext.cxx index 4337e9aca35d..155fe3b6a060 100644 --- a/sc/source/filter/oox/condformatcontext.cxx +++ b/sc/source/filter/oox/condformatcontext.cxx @@ -179,7 +179,7 @@ void CondFormatContext::onEndElement() { case XLS_TOKEN( conditionalFormatting ): if(mxCondFmt.get()) - mxCondFmt->finalizeImport(); + mxCondFmt->setReadyForFinalize(); break; } } diff --git a/sc/source/filter/oox/worksheethelper.cxx b/sc/source/filter/oox/worksheethelper.cxx index f736393fb80f..49add266a482 100644 --- a/sc/source/filter/oox/worksheethelper.cxx +++ b/sc/source/filter/oox/worksheethelper.cxx @@ -943,6 +943,7 @@ void WorksheetGlobals::finalizeWorksheetImport() { lclUpdateProgressBar( mxRowProgress, 1.0 ); maSheetData.finalizeImport(); + getCondFormats().finalizeImport(); lclUpdateProgressBar( mxFinalProgress, 0.25 ); finalizeHyperlinkRanges(); finalizeValidationRanges(); |