summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorNoel Power <noel.power@suse.com>2013-05-27 11:30:20 +0100
committerNoel Power <noel.power@suse.com>2013-05-27 19:44:49 +0100
commit96b8aa8ed659ef0501bcbc01f01c9013dbe4bc77 (patch)
tree678cb555f8b36697d82d06242ea49978ac873c03 /sc
parentf3611760f307949a17bfdcceadb3c6a7bfb20952 (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.hxx4
-rw-r--r--sc/source/filter/oox/condformatbuffer.cxx14
-rw-r--r--sc/source/filter/oox/condformatcontext.cxx2
-rw-r--r--sc/source/filter/oox/worksheethelper.cxx1
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();