summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Power <noel.power@novell.com>2012-06-07 14:00:03 +0100
committerNoel Power <noel.power@novell.com>2012-06-12 11:02:24 +0100
commit34ea7e01e8262fe76424545852874373cf728aed (patch)
tree564e003ae8f64089f22c89135304e7b381f62c6a
parentb3d25d0797c8697189a4db27135ae86ee92ba2f2 (diff)
attempt to use mce::FallBack for control/oleObject import
commit commit afbb2d8f7d72292532a9ea54fa2e6757b6d548c2 broke the existing mce::FallBack processing. Change-Id: I05296f6aad3841a8dd40aa345207c0114e0c7701
-rw-r--r--sc/source/filter/oox/worksheetfragment.cxx24
1 files changed, 19 insertions, 5 deletions
diff --git a/sc/source/filter/oox/worksheetfragment.cxx b/sc/source/filter/oox/worksheetfragment.cxx
index 8616305998ef..3743b0be196f 100644
--- a/sc/source/filter/oox/worksheetfragment.cxx
+++ b/sc/source/filter/oox/worksheetfragment.cxx
@@ -330,12 +330,26 @@ ContextHandlerRef WorksheetFragment::onCreateContext( sal_Int32 nElement, const
case XLS_TOKEN( evenFooter ): return this; // collect h/f contents in onCharacters()
}
break;
-
+ // Only process an oleObject or control if outside a mc:AlternateContent
+ // element OR if within a mc:Fallback. I suppose ideally we
+ // should process the stuff within 'mc:Choice'
+ case XLS_TOKEN( controls ):
case XLS_TOKEN( oleObjects ):
- if( nElement == XLS_TOKEN( oleObject ) && aMceState.empty() ) importOleObject( rAttribs );
- break;
- case XLS_TOKEN( controls ):
- if( nElement == XLS_TOKEN( control ) && aMceState.empty() ) importControl( rAttribs );
+ if ( getCurrentElement() == XLS_TOKEN( controls ) )
+ {
+ if( aMceState.empty() || ( !aMceState.empty() && aMceState.back() == MCE_STARTED ) )
+ {
+ if ( getCurrentElement() == XLS_TOKEN( oleObjects ) ) importOleObject( rAttribs );
+ else
+ importControl( rAttribs );
+ }
+ else if ( !aMceState.empty() && aMceState.back() == MCE_FOUND_CHOICE )
+ {
+ // reset the handling within 'Choice'
+ // this will force attempted handling in Fallback
+ aMceState.back() = MCE_STARTED;
+ }
+ }
break;
}
return 0;