LibreOffice Module xmloff (master) 1
|
Helper class for importing property values. More...
#include <propertyimport.hxx>
Public Member Functions | |
OPropertyImport (OFormLayerXMLImport_Impl &_rImport) | |
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL | createFastChildContext (sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &AttrList) override |
virtual void SAL_CALL | startFastElement (sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &_rxAttrList) override |
virtual void SAL_CALL | characters (const OUString &_rChars) override |
This method is called for all characters that are contained in the current element. More... | |
![]() | |
SvXMLImportContext (SvXMLImport &rImport) | |
A contexts constructor does anything that is required if an element starts. More... | |
virtual | ~SvXMLImportContext () |
A contexts destructor does anything that is required if an element ends. More... | |
virtual void SAL_CALL | startFastElement (sal_Int32 Element, const css::uno::Reference< css::xml::sax::XFastAttributeList > &Attribs) override |
virtual void SAL_CALL | startUnknownElement (const OUString &Namespace, const OUString &Name, const css::uno::Reference< css::xml::sax::XFastAttributeList > &Attribs) override |
virtual void SAL_CALL | endFastElement (sal_Int32 Element) override |
endFastElement is called before a context will be destructed, but after an elements context has been parsed. More... | |
virtual void SAL_CALL | endUnknownElement (const OUString &Namespace, const OUString &Name) override |
virtual css::uno::Reference< XFastContextHandler > SAL_CALL | createFastChildContext (sal_Int32 Element, const css::uno::Reference< css::xml::sax::XFastAttributeList > &Attribs) override |
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL | createUnknownChildContext (const OUString &Namespace, const OUString &Name, const css::uno::Reference< css::xml::sax::XFastAttributeList > &Attribs) override |
virtual void SAL_CALL | characters (const OUString &aChars) override |
This method is called for all characters that are contained in the current element. More... | |
virtual css::uno::Any SAL_CALL | queryInterface (const css::uno::Type &aType) final override |
virtual void SAL_CALL | acquire () noexcept final override |
virtual void SAL_CALL | release () noexcept final override |
virtual css::uno::Sequence< css::uno::Type > SAL_CALL | getTypes () final override |
virtual css::uno::Sequence< sal_Int8 > SAL_CALL | getImplementationId () final override |
Protected Types | |
typedef ::std::vector< css::beans::PropertyValue > | PropertyValueArray |
Protected Member Functions | |
virtual bool | handleAttribute (sal_Int32 nElement, const OUString &_rValue) |
handle one single attribute. More... | |
bool | encounteredAttribute (sal_Int32 nElement) const |
determine if the element imported by the object had a given attribute. More... | |
void | enableTrackAttributes () |
enables the tracking of the encountered attributes More... | |
void | implPushBackPropertyValue (const css::beans::PropertyValue &_rProp) |
void | implPushBackPropertyValue (const OUString &_rName, const css::uno::Any &_rValue) |
void | implPushBackGenericPropertyValue (const css::beans::PropertyValue &_rProp) |
![]() | |
SvXMLImport & | GetImport () |
const SvXMLImport & | GetImport () const |
Protected Attributes | |
PropertyValueArray | m_aValues |
PropertyValueArray | m_aGenericValues |
o3tl::sorted_vector< sal_Int32 > | m_aEncounteredAttributes |
OFormLayerXMLImport_Impl & | m_rContext |
bool | m_bTrackAttributes |
Friends | |
class | OSinglePropertyContext |
class | OListPropertyContext |
Helper class for importing property values.
This class imports properties which are stored as attributes as well as properties which are stored in <form:properties> elements.
Definition at line 71 of file propertyimport.hxx.
|
protected |
Definition at line 77 of file propertyimport.hxx.
xmloff::OPropertyImport::OPropertyImport | ( | OFormLayerXMLImport_Impl & | _rImport | ) |
Definition at line 257 of file propertyimport.cxx.
References m_rContext.
|
overridevirtual |
This method is called for all characters that are contained in the current element.
The default is to ignore them.
Reimplemented from SvXMLImportContext.
Definition at line 303 of file propertyimport.cxx.
|
overridevirtual |
Reimplemented from SvXMLImportContext.
Reimplemented in xmloff::OElementImport, xmloff::OListAndComboImport, xmloff::OGridImport, xmloff::OFormImport, and xmloff::OTextLikeImport.
Definition at line 264 of file propertyimport.cxx.
References xmloff::OFormLayerXMLImport_Impl::getGlobalContext(), m_rContext, SAL_WARN, TOKEN_MASK, and xmloff::token::XML_PROPERTIES.
Referenced by xmloff::OElementImport::createFastChildContext().
|
inlineprotected |
enables the tracking of the encountered attributes
The tracking will raise the import costs a little bit, but it's cheaper than derived classes tracking this themself.
Definition at line 131 of file propertyimport.hxx.
References m_bTrackAttributes.
Referenced by xmloff::OButtonImport::OButtonImport(), xmloff::OFormImport::OFormImport(), xmloff::OListAndComboImport::OListAndComboImport(), and xmloff::OTextLikeImport::OTextLikeImport().
|
protected |
determine if the element imported by the object had a given attribute.
Please be aware of the fact that the name given must be a local name, i.e. not contain a namespace. All form relevant attributes are in the same namespace, so this would be a redundant information.
Definition at line 297 of file propertyimport.cxx.
References o3tl::sorted_vector< typename Value, typename Compare, template< typename, typename > class Find, bool >::end(), o3tl::sorted_vector< typename Value, typename Compare, template< typename, typename > class Find, bool >::find(), m_aEncounteredAttributes, m_bTrackAttributes, and TOKEN_MASK.
|
protectedvirtual |
handle one single attribute.
This is called for every attribute of the element. This class' implementation checks if the attribute describes a property, if so, it is added to <member>m_aValues</member>.
All non-property attributes should be handled in derived classes.
_nNamespaceKey | key of the namespace used in the attribute |
_rLocalName | local (relative to the namespace) attribute name |
_rValue | attribute value |
Reimplemented in xmloff::OElementImport, xmloff::OControlImport, xmloff::OImagePositionImport, xmloff::OReferredControlImport, xmloff::OPasswordImport, xmloff::ORadioImport, xmloff::OURLReferenceImport, xmloff::OValueRangeImport, xmloff::OListAndComboImport, and xmloff::OFormImport.
Definition at line 309 of file propertyimport.cxx.
References xmloff::OAttribute2Property::AttributeAssignment::aPropertyType, xmloff::OAttribute2Property::AttributeAssignment::bInverseSemantics, xmloff::PropertyConversion::convertString(), xmloff::OFormLayerXMLImport_Impl::getAttributeMap(), xmloff::OAttribute2Property::getAttributeTranslation(), xmloff::OFormLayerXMLImport_Impl::getGlobalContext(), implPushBackPropertyValue(), m_rContext, xmloff::OAttribute2Property::AttributeAssignment::pEnumMap, SAL_WARN, xmloff::OAttribute2Property::AttributeAssignment::sPropertyName, TOKEN_MASK, xmloff::token::XML_HREF, and xmloff::token::XML_TYPE.
Referenced by startFastElement().
|
inlineprotected |
Definition at line 144 of file propertyimport.hxx.
References m_aGenericValues.
|
inlineprotected |
Definition at line 133 of file propertyimport.hxx.
References m_aValues.
Referenced by xmloff::OListAndComboImport::endFastElement(), handleAttribute(), xmloff::OControlImport::handleAttribute(), xmloff::OPasswordImport::handleAttribute(), xmloff::ORadioImport::handleAttribute(), xmloff::OListAndComboImport::handleAttribute(), xmloff::OFormImport::implTranslateStringListProperty(), xmloff::OImagePositionImport::startFastElement(), and xmloff::OControlImport::startFastElement().
|
inlineprotected |
Definition at line 138 of file propertyimport.hxx.
References m_aValues.
|
overridevirtual |
Reimplemented from SvXMLImportContext.
Reimplemented in xmloff::OListAndComboImport, xmloff::OImagePositionImport, xmloff::OReferredControlImport, xmloff::OButtonImport, xmloff::OValueRangeImport, xmloff::OTextLikeImport, xmloff::OElementImport, xmloff::OControlImport, and xmloff::OFormImport.
Definition at line 277 of file propertyimport.cxx.
References sax_fastparser::castToFastAttributeList(), handleAttribute(), o3tl::sorted_vector< typename Value, typename Compare, template< typename, typename > class Find, bool >::insert(), m_aEncounteredAttributes, m_aValues, m_bTrackAttributes, size, and TOKEN_MASK.
Referenced by xmloff::OElementImport::startFastElement().
|
friend |
Definition at line 74 of file propertyimport.hxx.
|
friend |
Definition at line 73 of file propertyimport.hxx.
|
protected |
Definition at line 82 of file propertyimport.hxx.
Referenced by encounteredAttribute(), and startFastElement().
|
protected |
Definition at line 79 of file propertyimport.hxx.
Referenced by xmloff::OElementImport::implApplyGenericProperties(), and implPushBackGenericPropertyValue().
|
protected |
Definition at line 78 of file propertyimport.hxx.
Referenced by xmloff::OTextLikeImport::adjustDefaultControlProperty(), xmloff::OControlImport::endFastElement(), xmloff::OElementImport::implApplySpecificProperties(), implPushBackPropertyValue(), xmloff::OTextLikeImport::removeRedundantCurrentValue(), and startFastElement().
|
protected |
Definition at line 86 of file propertyimport.hxx.
Referenced by enableTrackAttributes(), encounteredAttribute(), and startFastElement().
|
protected |
Definition at line 84 of file propertyimport.hxx.
Referenced by createFastChildContext(), xmloff::OTextLikeImport::createFastChildContext(), xmloff::OControlImport::doRegisterCellValueBinding(), xmloff::OControlImport::doRegisterXFormsListBinding(), xmloff::OControlImport::doRegisterXFormsSubmission(), xmloff::OControlImport::doRegisterXFormsValueBinding(), xmloff::OElementImport::endFastElement(), xmloff::OTextLikeImport::endFastElement(), xmloff::OListAndComboImport::endFastElement(), handleAttribute(), xmloff::OImagePositionImport::handleAttribute(), xmloff::ORadioImport::handleAttribute(), and xmloff::OURLReferenceImport::handleAttribute().