32#include <com/sun/star/container/XNameContainer.hpp>
33#include <com/sun/star/xforms/XModel2.hpp>
35#include <osl/diagnose.h>
39using com::sun::star::uno::Any;
40using com::sun::star::uno::UNO_QUERY;
41using com::sun::star::container::XNameContainer;
42using com::sun::star::xml::sax::XFastAttributeList;
43using com::sun::star::xforms::XModel2;
94 assert(
false &&
"should not happen" );
101 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList )
105 mxBinding->getPropertyValue(
"BindingNamespaces" ),
108 SAL_WARN_IF( !xContainer.is(),
"xmloff",
"binding should have a namespace container" );
109 if( xContainer.is() )
121 assert(
false &&
"no children supported" );
130 sal_uInt16 nKeyIter =
aMap.GetFirstKey();
134 const OUString&
sPrefix =
aMap.GetPrefixByKey( nKeyIter );
135 const OUString& sNamespace =
aMap.GetNameByKey( nKeyIter );
139 if( !
sPrefix.startsWith(
"_") &&
143 if( xContainer->hasByName(
sPrefix ) )
144 xContainer->replaceByName(
sPrefix,
Any( sNamespace ) );
146 xContainer->insertByName(
sPrefix,
Any( sNamespace ) );
150 nKeyIter =
aMap.GetNextKey( nKeyIter );
css::uno::Reference< css::frame::XModel2 > mxModel
static void lcl_fillNamespaceContainer(const SvXMLNamespaceMap &, Reference< XNameContainer > const &)
This class deliberately does not support XWeak, to improve performance when loading large documents.
SvXMLImport & GetImport()
handle attributes through an SvXMLTokenMap
virtual void SAL_CALL startFastElement(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
call HandleAttribute for each attribute in the token map; create a warning for all others.
virtual SvXMLImportContext * HandleChild(sal_Int32 nElementToken, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
will be called for each child element
const css::uno::Reference< css::xforms::XModel2 > mxModel
css::uno::Reference< css::beans::XPropertySet > mxBinding
XFormsBindContext(SvXMLImport &rImport, const css::uno::Reference< css::xforms::XModel2 > &xModel)
virtual void HandleAttribute(const sax_fastparser::FastAttributeList::FastAttributeIter &aIter) override
will be called for each attribute
virtual void SAL_CALL startFastElement(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
call HandleAttribute for each attribute in the token map; create a warning for all others.
sal_Int32 getToken() const
OUString toString() const
#define SAL_WARN_IF(condition, area, stream)
const sal_uInt16 XML_NAMESPACE_UNKNOWN
Handling of tokens in XML:
HashMap_OWString_Interface aMap
Reference< XModel > xModel
constexpr sal_Int32 TOKEN_MASK
constexpr sal_uInt16 XML_NAMESPACE_META_SO52