summaryrefslogtreecommitdiff
path: root/oox/source/ole/axcontrolfragment.cxx
diff options
context:
space:
mode:
authorIvo Hinkelmann <ihi@openoffice.org>2009-11-20 14:02:34 +0000
committerIvo Hinkelmann <ihi@openoffice.org>2009-11-20 14:02:34 +0000
commitbd0b8ce42a54f117d90031dd01150396d2776658 (patch)
tree5c0f0e9e1bb1a1fd5dbb14ef0493d5d4f252c76c /oox/source/ole/axcontrolfragment.cxx
parent81087627f30494064a791bffd61ec99b5b289b4f (diff)
CWS-TOOLING: integrate CWS calc32stopper5
2009-11-12 13:18:26 +0100 dr r277477 : #i105267# missing in exception files list 2009-11-12 11:13:57 +0100 dr r277472 : CWS-TOOLING: rebase CWS calc32stopper5 to branches/OOO320@277373 (milestone: OOO320:m4) 2009-11-11 17:27:10 +0100 dr r277466 : #i105267# remember all existing copies of ScAccessibeEditLineTextData in the ScTextWnd instance (text input line) 2009-11-04 09:59:49 +0100 dr r277334 : dump even more BIFF records written by XL12 2009-10-27 19:11:37 +0100 dr r277231 : few dumper additions 2009-10-27 17:17:10 +0100 nn r277225 : #i106343# check if pDocShell is set in GetFormatter 2009-10-26 14:54:15 +0100 dr r277178 : #i106194# OOXML: load form controls from binary streams 2009-10-26 14:14:01 +0100 dr r277177 : #i106194# OOXML: load form controls from binary streams
Diffstat (limited to 'oox/source/ole/axcontrolfragment.cxx')
-rw-r--r--oox/source/ole/axcontrolfragment.cxx32
1 files changed, 25 insertions, 7 deletions
diff --git a/oox/source/ole/axcontrolfragment.cxx b/oox/source/ole/axcontrolfragment.cxx
index ff1b1e1c8117..047fd8daf4f4 100644
--- a/oox/source/ole/axcontrolfragment.cxx
+++ b/oox/source/ole/axcontrolfragment.cxx
@@ -79,9 +79,8 @@ ContextHandlerRef AxControlPropertyContext::onCreateContext( sal_Int32 nElement,
OUString aPicturePath = getFragmentPathFromRelId( rAttribs.getString( R_TOKEN( id ), OUString() ) );
if( aPicturePath.getLength() > 0 )
{
- StreamDataSequence aPictureData;
- if( getFilter().importBinaryData( aPictureData, aPicturePath ) )
- mrModel.importPictureData( mnPropId, aPictureData );
+ BinaryXInputStream aInStrm( getFilter().openInputStream( aPicturePath ), true );
+ mrModel.importPictureData( mnPropId, aInStrm );
}
}
break;
@@ -101,11 +100,30 @@ ContextHandlerRef AxControlFragment::onCreateContext( sal_Int32 nElement, const
{
if( isRootElement() && (nElement == AX_TOKEN( ocx )) )
{
- if( rAttribs.getToken( AX_TOKEN( persistence ), XML_TOKEN_INVALID ) == XML_persistPropertyBag )
+ OUString aClassId = rAttribs.getString( AX_TOKEN( classid ), OUString() );
+ switch( rAttribs.getToken( AX_TOKEN( persistence ), XML_TOKEN_INVALID ) )
{
- OUString aClassId = rAttribs.getString( AX_TOKEN( classid ), OUString() );
- if( AxControlModelBase* pModel = mrControl.createModel( aClassId ) )
- return new AxControlPropertyContext( *this, *pModel );
+ case XML_persistPropertyBag:
+ if( AxControlModelBase* pModel = mrControl.createModel( aClassId ) )
+ return new AxControlPropertyContext( *this, *pModel );
+ break;
+
+ case XML_persistStreamInit:
+ {
+ OUString aFragmentPath = getFragmentPathFromRelId( rAttribs.getString( R_TOKEN( id ), OUString() ) );
+ if( aFragmentPath.getLength() > 0 )
+ {
+ BinaryXInputStream aInStrm( getFilter().openInputStream( aFragmentPath ), true );
+ if( !aInStrm.isEof() )
+ {
+ mrControl.importBinaryModel( aInStrm );
+ // binary stream contains a copy of the class ID, must be equal to attribute value
+ OSL_ENSURE( !mrControl.getModel() || aClassId.equalsIgnoreAsciiCase( mrControl.getClassId() ),
+ "AxControlFragment::importBinaryControl - form control class ID mismatch" );
+ }
+ }
+ }
+ break;
}
}
return 0;