Kaydet (Commit) 87b4a143 authored tarafından Markus Mohrhard's avatar Markus Mohrhard

write the conditional formatting earlier into the model

The conditional formatting can be written into calc's model already at
the end of the conditionalFormatting element and we don't need to wait
till the end of the worksheet.

This allows to modify the data through the ExtLst parser and allow
correct import of Excel2010 data bars.

Change-Id: Icb582931c6f89cbdb2b8b3dbe24af640ca8076ba
üst e6c07ad2
...@@ -73,9 +73,11 @@ protected: ...@@ -73,9 +73,11 @@ protected:
virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ); virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
virtual void onStartElement( const AttributeList& rAttribs ); virtual void onStartElement( const AttributeList& rAttribs );
virtual void onCharacters( const ::rtl::OUString& rChars ); virtual void onCharacters( const ::rtl::OUString& rChars );
virtual void onEndElement();
virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ); virtual ::oox::core::ContextHandlerRef onCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm );
virtual void onStartRecord( SequenceInputStream& rStrm ); virtual void onStartRecord( SequenceInputStream& rStrm );
virtual void onEndRecord();
private: private:
CondFormatRef mxCondFmt; CondFormatRef mxCondFmt;
......
...@@ -149,6 +149,17 @@ ContextHandlerRef CondFormatContext::onCreateContext( sal_Int32 nElement, const ...@@ -149,6 +149,17 @@ ContextHandlerRef CondFormatContext::onCreateContext( sal_Int32 nElement, const
return 0; return 0;
} }
void CondFormatContext::onEndElement()
{
switch( getCurrentElement() )
{
case XLS_TOKEN( conditionalFormatting ):
if(mxCondFmt.get())
mxCondFmt->finalizeImport();
break;
}
}
void CondFormatContext::onStartElement( const AttributeList& rAttribs ) void CondFormatContext::onStartElement( const AttributeList& rAttribs )
{ {
switch( getCurrentElement() ) switch( getCurrentElement() )
...@@ -191,6 +202,17 @@ void CondFormatContext::onStartRecord( SequenceInputStream& rStrm ) ...@@ -191,6 +202,17 @@ void CondFormatContext::onStartRecord( SequenceInputStream& rStrm )
} }
} }
void CondFormatContext::onEndRecord()
{
switch( getCurrentElement() )
{
case BIFF12_ID_CONDFORMATTING:
if( mxCondFmt.get() )
mxCondFmt->finalizeImport();
break;
}
}
// ============================================================================ // ============================================================================
} // namespace xls } // namespace xls
......
...@@ -954,7 +954,6 @@ void WorksheetGlobals::finalizeWorksheetImport() ...@@ -954,7 +954,6 @@ void WorksheetGlobals::finalizeWorksheetImport()
finalizeHyperlinkRanges(); finalizeHyperlinkRanges();
finalizeValidationRanges(); finalizeValidationRanges();
maAutoFilters.finalizeImport( getSheetIndex() ); maAutoFilters.finalizeImport( getSheetIndex() );
maCondFormats.finalizeImport();
maQueryTables.finalizeImport(); maQueryTables.finalizeImport();
maSheetSett.finalizeImport(); maSheetSett.finalizeImport();
maPageSett.finalizeImport(); maPageSett.finalizeImport();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment