22#include <com/sun/star/io/XInputStream.hpp>
29#include <oox/token/namespaces.hxx>
30#include <oox/token/tokens.hxx>
32#include <osl/diagnose.h>
39using ::oox::core::ContextHandler2;
41using ::oox::core::FragmentHandler2;
42using ::oox::core::XmlFilterBase;
45 ContextHandler2( rFragment ),
53 switch( getCurrentElement() )
56 if( nElement == AX_TOKEN( ocxPr ) )
72 case AX_TOKEN( ocxPr ):
73 if( nElement == AX_TOKEN(
picture ) )
76 if( !aPicturePath.isEmpty() )
88 FragmentHandler2( rFilter, rFragmentPath, true ),
95 if( isRootElement() && (nElement == AX_TOKEN( ocx )) )
100 case XML_persistPropertyBag:
105 case XML_persistStreamInit:
107 OUString aFragmentPath = getFragmentPathFromRelId( rAttribs.
getStringDefaulted( R_TOKEN(
id )) );
108 if( !aFragmentPath.isEmpty() )
111 if( !aInStrm.
isEof() )
115 OSL_ENSURE( aClassId.equalsIgnoreAsciiCase( aStrmClassId ),
116 "AxControlFragment::importBinaryControl - form control class ID mismatch" );
118 pModel->importBinaryModel( aInStrm );
124 case XML_persistStorage:
126 OUString aFragmentPath = getFragmentPathFromRelId( rAttribs.
getStringDefaulted( R_TOKEN(
id )) );
127 if( !aFragmentPath.isEmpty() )
129 Reference< XInputStream > xStrgStrm = getFilter().openInputStream( aFragmentPath );
133 bool bImportedAsParent =
false;
136 if( !aInStrm.
isEof() )
140 pModel->importBinaryModel( aInStrm );
141 bImportedAsParent =
true;
145 if(!bImportedAsParent)
148 if (!aInStrm2.
isEof())
152 pModel->importBinaryModel(aInStrm2);
Provides access to attribute values of an element.
OUString getStringDefaulted(sal_Int32 nAttrToken) const
Returns the string value of the specified attribute, returns an empty string if attribute not present...
std::optional< sal_Int32 > getToken(sal_Int32 nAttrToken) const
Returns the token identifier of the value of the specified attribute.
bool isEof() const
Returns true, if the stream position is invalid (EOF).
css::uno::Reference< css::io::XInputStream > openInputStream(const OUString &rStreamName)
Opens and returns the specified input stream from the storage.
XmlFilterBase & getFilter() const
Returns the filter instance.
OUString getFragmentPathFromRelId(const OUString &rRelId) const
Returns the full fragment path for the passed relation identifier.
Base class for ActiveX container controls.
EmbeddedControl & mrControl
virtual ::oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElement, const AttributeList &rAttribs) override
AxControlFragment(::oox::core::XmlFilterBase &rFilter, const OUString &rFragmentPath, EmbeddedControl &rControl)
Context handler for ActiveX form control model properties.
AxControlPropertyContext(::oox::core::FragmentHandler2 const &rFragment, ControlModelBase &rModel)
virtual ::oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElement, const AttributeList &rAttribs) override
ControlModelBase & mrModel
sal_Int32 mnPropId
Identifier of currently processed property.
Base class for all models of form controls.
virtual void importProperty(sal_Int32 nPropId, const OUString &rValue)
Derived classes set specific OOXML properties at the model structure.
virtual void importPictureData(sal_Int32 nPropId, BinaryInputStream &rInStrm)
Derived classes set binary data (picture, mouse icon) at the model structure.
A form control embedded in a document draw page.
ControlModelBase * createModelFromGuid(std::u16string_view rClassId)
Creates and returns the internal control model according to the passed MS class identifier.
Implements stream access for binary OLE storages.
Reference< XComponentContext > getComponentContext(Reference< XMultiServiceFactory > const &factory)
::rtl::Reference< ContextHandler > ContextHandlerRef
OOX_DLLPUBLIC OUString importGuid(BinaryInputStream &rInStrm)
Imports a GUID from the passed binary stream and returns its string representation (in uppercase char...