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-28 14:00:37 +0100 |
commit | 7551a01e4fe3e8e3fd63938c401dcd855c67001d (patch) | |
tree | 1fb009e5eba09160ced3fff47ccc817528739c25 /sc | |
parent | c317fbeb2a1ac6a5e489aaed4d91de5c3f5f1dd8 (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 e81ca732f899..8420aaf7b519 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 01c3edc077ba..6660ac9c5784 100644 --- a/sc/source/filter/oox/condformatbuffer.cxx +++ b/sc/source/filter/oox/condformatbuffer.cxx @@ -932,7 +932,8 @@ CondFormatModel::CondFormatModel() : CondFormat::CondFormat( const WorksheetHelper& rHelper ) : WorksheetHelper( rHelper ), - mpFormat(NULL) + mpFormat(NULL), + mbReadyForFinalize(false) { } @@ -1013,6 +1014,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 f4d192c690f3..67b1ed93a868 100644 --- a/sc/source/filter/oox/condformatcontext.cxx +++ b/sc/source/filter/oox/condformatcontext.cxx @@ -178,7 +178,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 f18ee4942e08..bd8b9ba322d8 100644 --- a/sc/source/filter/oox/worksheethelper.cxx +++ b/sc/source/filter/oox/worksheethelper.cxx @@ -946,6 +946,7 @@ void WorksheetGlobals::finalizeWorksheetImport() { lclUpdateProgressBar( mxRowProgress, 1.0 ); maSheetData.finalizeImport(); + getCondFormats().finalizeImport(); lclUpdateProgressBar( mxFinalProgress, 0.25 ); finalizeHyperlinkRanges(); finalizeValidationRanges(); |